UNPKG

364 kBJavaScriptView Raw
1import { CommonModule } from '@angular/common';
2import { Component, Input, NgModule, EventEmitter, Output, Injectable, ChangeDetectionStrategy, Pipe, ChangeDetectorRef, InjectionToken, Inject } from '@angular/core';
3import { MatCardModule, MatButtonModule, MatIconModule, MatMenuModule, MatChipsModule, MatTooltipModule, MatCheckboxModule, MatExpansionModule, MatInputModule, MatOptionModule, MatProgressSpinnerModule, MatSelectModule, MatListModule as MatListModule$1, MatDividerModule } from '@angular/material';
4import { ImageTransformationService, ImageTransformationModule } from '@vendasta/core/image-transformation';
5import { VaIconModule, VaBadgeModule, VaSafeHtmlModule, VaListModule, VaImageGalleryModule, VaBreadcrumbsModule, CheckboxFilterField, FilterSection, Filters, TabbedFilterField, FilterService, UIKitModule } from '@vendasta/uikit';
6import { __read, __spread, __extends, __assign, __values } from 'tslib';
7import { DisplayPriceService, CoreSharedModule, formatDisplayPrice, formatBillingFrequency, Addon } from '@vendasta/core/shared';
8import { BehaviorSubject, combineLatest, of, ReplaySubject, merge, zip } from 'rxjs';
9import { TranslateService, TranslateModule } from '@ngx-translate/core';
10import { map, switchMap, debounceTime, distinctUntilChanged, startWith, filter, take, skipWhile, shareReplay, tap } from 'rxjs/operators';
11import { Validators, FormControl, FormGroup, FormArray, FormsModule, ReactiveFormsModule } from '@angular/forms';
12import { MatListModule } from '@angular/material/list';
13import { VaFormsModule } from '@vendasta/forms';
14import { BillingModel, buildBilledProductFromProductPricingAndAddon, BillingService, BillingModule } from '@vendasta/core/billing';
15import { FieldType, Field, CustomField, AddonKey, CommonField } from '@vendasta/sales-orders';
16import uuid from 'uuid/v4';
17import { MatProgressSpinnerModule as MatProgressSpinnerModule$1 } from '@angular/material/progress-spinner';
18import { isNullOrUndefined } from 'util';
19import { Categories, Pricing as Pricing$1, Currency } from '@vendasta/core/marketplace-packages';
20import { trigger, state, style, transition, animate } from '@angular/animations';
21
22/**
23 * @fileoverview added by tsickle
24 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
25 */
26/*tslint:disable*/
27var En = /** @class */ (function () {
28 function En() {
29 }
30 En.en = {
31 "FRONTEND.STORE": {
32 "TOTAL": "Total",
33 "CONTACT_SALES": "Contact Sales",
34 "FREE": "Free",
35 "STARTING_AT": "Starting at",
36 "ENABLED_UPPER": "ENABLED",
37 "ENABLE_UPPER": "ENABLE",
38 "MIN_TO_MAX": "{{minRange}} to {{maxRange}}",
39 "PRODUCT_PRICING_WITH_FREQUENCY": "{{pricingTier}} accounts {{frequency}}",
40 "COMMITMENT_WITH_RENEWAL": "*{{initial}} {{frequencyString}} minimum, renews for {{recurring}} {{frequencyString}} periods",
41 "COMMITMENT": "${{initial}} ${{frequencyString}} commitment",
42 "PRICING_FREQUENCIES": {
43 "MONTH": "month",
44 "YEAR": "year"
45 },
46 "REQUIRES_DESCRIPTOR": "(Requires {{requirementName}})",
47 "ADMINISTRATIVE_QUESTIONS": "Administrative Questions",
48 "AUTO_TITLE_TEXT": {
49 "SOME_FIELDS_INVALID": "* Some fields are invalid and/or required but empty",
50 "OPTIONAL_FIELDS_UNANSWERED": "Optional fields unanswered",
51 "COMPLETE": "Complete"
52 },
53 "REQUIRES": "Requires",
54 "ENABLED_WITH_PREREQUISITE": "Enabled with {{prerequisite}}",
55 "PRICE_APPLIES_PER_UNIT": "Price applies per unit within a range",
56 "PRICE_APPLIES_TO_ALL_UNITS": "Price applies to all units once range is met",
57 "PRICING": "Pricing",
58 "FAQS": "FAQs",
59 "GALLERY": "Gallery",
60 "FILES": "Files",
61 "GET_IT_NOW": "Get It Now",
62 "CONTAINS_NUM_ITEMS": "Contains {{itemCount}} items"
63 }
64 };
65 return En;
66}());
67if (false) {
68 /** @type {?} */
69 En.en;
70}
71
72/**
73 * @fileoverview added by tsickle
74 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
75 */
76/*tslint:disable*/
77var Cs = /** @class */ (function () {
78 function Cs() {
79 }
80 Cs.cs = {
81 "FRONTEND.STORE": {
82 "TOTAL": "Celkem",
83 "CONTACT_SALES": "Kontaktovat obchodního zástupce",
84 "FREE": "Zdarma",
85 "STARTING_AT": "Začíná na",
86 "ENABLED_UPPER": "POVOLENO",
87 "ENABLE_UPPER": "POVOLIT",
88 "MIN_TO_MAX": "{{minRange}} až {{maxRange}}",
89 "PRODUCT_PRICING_WITH_FREQUENCY": "{{pricingTier}} účtů za {{frequency}}",
90 "COMMITMENT_WITH_RENEWAL": "*{{initial}} {{frequencyString}} minimum, obnovuje se na {{recurring}} {{frequencyString}}",
91 "COMMITMENT": "Závazek {{initial}} {{frequencyString}}",
92 "PRICING_FREQUENCIES": {
93 "MONTH": "měsíč",
94 "YEAR": "rok"
95 },
96 "REQUIRES_DESCRIPTOR": "(Vyžaduje {{requirementName}})",
97 "ADMINISTRATIVE_QUESTIONS": "Administrativní otázky",
98 "AUTO_TITLE_TEXT": {
99 "SOME_FIELDS_INVALID": "* Některá pole jsou neplatná a/nebo povinná, ale prázdná",
100 "OPTIONAL_FIELDS_UNANSWERED": "Volitelná pole nezodpovězena",
101 "COMPLETE": "Kompletní"
102 },
103 "REQUIRES": "Vyžaduje",
104 "ENABLED_WITH_PREREQUISITE": "Povoleno s {{prerequisite}}",
105 "PRICE_APPLIES_PER_UNIT": "Cena platí za jednotku v rozsahu",
106 "PRICE_APPLIES_TO_ALL_UNITS": "Cena se vztahuje na všechny jednotky, jakmile je dosaženo rozsahu",
107 "PRICING": "Cena",
108 "FAQS": "FAQ",
109 "GALLERY": "Galerie",
110 "FILES": "Soubory",
111 "GET_IT_NOW": "Získat hned",
112 "CONTAINS_NUM_ITEMS": "Obsahuje {{itemCount}} položek"
113 }
114 };
115 return Cs;
116}());
117if (false) {
118 /** @type {?} */
119 Cs.cs;
120}
121
122/**
123 * @fileoverview added by tsickle
124 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
125 */
126var VaPricingComponent = /** @class */ (function () {
127 function VaPricingComponent(translateService, displayPriceService) {
128 var _this = this;
129 this.translateService = translateService;
130 this.displayPriceService = displayPriceService;
131 this.pricing = null;
132 this.wrapFrequency = false;
133 this.isAddon = false;
134 this.hasVerifiedContract = false;
135 this.highlightPrice = true;
136 this.loaded = true;
137 this.pricing$$ = new BehaviorSubject(null);
138 this.billedProduct$$ = new BehaviorSubject(null);
139 this.hasVerifiedContract$$ = new BehaviorSubject(false);
140 this.translateService.setTranslation('en', En.en, true);
141 this.translateService.setTranslation('cs', Cs.cs, true);
142 this.isFree$ = combineLatest([this.pricing$, this.billedProduct$, this.hasVerifiedContract$]).pipe(map((/**
143 * @param {?} __0
144 * @return {?}
145 */
146 function (_a) {
147 var _b = __read(_a, 3), pricing = _b[0], billedProduct = _b[1], hasVerifiedContract = _b[2];
148 /** @type {?} */
149 var isFreeHelper = (/**
150 * @param {?} prices
151 * @return {?}
152 */
153 function (prices) {
154 return prices ? prices.some((/**
155 * @param {?} p
156 * @return {?}
157 */
158 function (p) { return p.price === 0 || p.price === undefined; })) : false;
159 });
160 if (hasVerifiedContract && billedProduct) {
161 return billedProduct.pricingTiers.length === 1 ? isFreeHelper(billedProduct.pricingTiers) : false;
162 }
163 return !!pricing && isFreeHelper(pricing.prices);
164 })));
165 this.shouldContactSales$ = combineLatest([this.pricing$, this.billedProduct$, this.hasVerifiedContract$]).pipe(map((/**
166 * @param {?} __0
167 * @return {?}
168 */
169 function (_a) {
170 var _b = __read(_a, 3), pricing = _b[0], billedProduct = _b[1], hasVerifiedContract = _b[2];
171 /** @type {?} */
172 var nestedPricesIsContactSales = (/**
173 * @param {?} prices
174 * @return {?}
175 */
176 function (prices) {
177 return prices && prices.length > 0 ? prices.some((/**
178 * @param {?} p
179 * @return {?}
180 */
181 function (p) { return p.price === null || p.price < 0; })) : true;
182 });
183 if (hasVerifiedContract && billedProduct) {
184 return nestedPricesIsContactSales(billedProduct.pricingTiers);
185 }
186 if (!pricing) {
187 return true;
188 }
189 return nestedPricesIsContactSales(pricing.prices);
190 })));
191 this.isFlatPrice$ = this.billedProduct$.pipe(map((/**
192 * @param {?} billedProduct
193 * @return {?}
194 */
195 function (billedProduct) { return billedProduct.pricingTiers.length === 1; })));
196 this.pricingTierData$ = this.billedProduct$.pipe(switchMap((/**
197 * @param {?} billedProduct
198 * @return {?}
199 */
200 function (billedProduct) {
201 /** @type {?} */
202 var pricingTierObservables = billedProduct.pricingTiers.map((/**
203 * @param {?} pricingTier
204 * @return {?}
205 */
206 function (pricingTier) {
207 return combineLatest(of(pricingTier.isStartingPrice), _this.buildPricingTierString(pricingTier), _this.buildPricingTierForProduct(pricingTier, billedProduct.billingFrequency), _this.buildPricingTierForAddon(pricingTier), _this.buildPriceStringForTier(pricingTier, billedProduct.billingFrequency, pricingTier.isStartingPrice), _this.buildPriceStringForTier(pricingTier)).pipe(map((/**
208 * @param {?} __0
209 * @return {?}
210 */
211 function (_a) {
212 var _b = __read(_a, 6), isStartingPrice = _b[0], pricingTierString = _b[1], pricingTierForProduct = _b[2], pricingTierForAddon = _b[3], priceStringForTier = _b[4], priceStringForTierWithoutFreq = _b[5];
213 return {
214 isStartingPrice: isStartingPrice,
215 pricingTierString: pricingTierString,
216 pricingTierForProduct: pricingTierForProduct,
217 pricingTierForAddon: pricingTierForAddon,
218 priceStringForTier: priceStringForTier,
219 priceStringForTierWithoutFreq: priceStringForTierWithoutFreq
220 };
221 })));
222 }));
223 return combineLatest.apply(void 0, __spread(pricingTierObservables));
224 })));
225 this.priceData$ = this.pricing$.pipe(switchMap((/**
226 * @param {?} pricing
227 * @return {?}
228 */
229 function (pricing) {
230 /** @type {?} */
231 var priceObservables = pricing.prices.map((/**
232 * @param {?} price
233 * @return {?}
234 */
235 function (price) {
236 return combineLatest(of(price.isStartingPrice), _this.buildPriceStringForPricing(price, pricing.currency, true, false), _this.buildPriceStringForPricing(price, pricing.currency, false, true), _this.buildFrequencyString(price.frequency)).pipe(map((/**
237 * @param {?} __0
238 * @return {?}
239 */
240 function (_a) {
241 var _b = __read(_a, 4), isStartingPrice = _b[0], priceStringForPricingWithoutFrequency = _b[1], priceStringForPricingWithFrequency = _b[2], frequencyString = _b[3];
242 return {
243 isStartingPrice: isStartingPrice,
244 priceStringForPricingWithoutFrequency: priceStringForPricingWithoutFrequency,
245 priceStringForPricingWithFrequency: priceStringForPricingWithFrequency,
246 frequencyString: frequencyString
247 };
248 })));
249 }));
250 return combineLatest.apply(void 0, __spread(priceObservables));
251 })));
252 this.commitmentMessage$ = this.buildCommitmentMessage();
253 }
254 Object.defineProperty(VaPricingComponent.prototype, "pricing$", {
255 get: /**
256 * @return {?}
257 */
258 function () {
259 return this.pricing$$.asObservable();
260 },
261 enumerable: true,
262 configurable: true
263 });
264 Object.defineProperty(VaPricingComponent.prototype, "billedProduct$", {
265 get: /**
266 * @return {?}
267 */
268 function () {
269 return this.billedProduct$$.asObservable();
270 },
271 enumerable: true,
272 configurable: true
273 });
274 Object.defineProperty(VaPricingComponent.prototype, "hasVerifiedContract$", {
275 get: /**
276 * @return {?}
277 */
278 function () {
279 return this.hasVerifiedContract$$.asObservable();
280 },
281 enumerable: true,
282 configurable: true
283 });
284 /**
285 * @param {?} changes
286 * @return {?}
287 */
288 VaPricingComponent.prototype.ngOnChanges = /**
289 * @param {?} changes
290 * @return {?}
291 */
292 function (changes) {
293 if (changes.hasOwnProperty('pricing')) {
294 this.pricing$$.next(changes.pricing.currentValue);
295 }
296 if (changes.hasOwnProperty('billedProduct')) {
297 this.billedProduct$$.next(changes.billedProduct.currentValue);
298 }
299 if (changes.hasOwnProperty('hasVerifiedContract')) {
300 this.hasVerifiedContract$$.next(changes.hasVerifiedContract.currentValue);
301 }
302 };
303 /**
304 * @param {?} tier
305 * @return {?}
306 */
307 VaPricingComponent.prototype.buildPricingTierString = /**
308 * @param {?} tier
309 * @return {?}
310 */
311 function (tier) {
312 /** @type {?} */
313 var max = String(tier.rangeMax);
314 if (tier.rangeMax === -1) {
315 max = '∞';
316 if (tier.rangeMin === 0 || tier.rangeMin === 1) {
317 return of('');
318 }
319 }
320 return this.translateService.stream('FRONTEND.STORE.MIN_TO_MAX', { minRange: String(tier.rangeMin), maxRange: max });
321 };
322 /**
323 * @param {?} tier
324 * @param {?=} frequency
325 * @return {?}
326 */
327 VaPricingComponent.prototype.buildPricingTierForProduct = /**
328 * @param {?} tier
329 * @param {?=} frequency
330 * @return {?}
331 */
332 function (tier, frequency) {
333 var _this = this;
334 return combineLatest(this.buildPricingTierString(tier), this.buildFrequencyString(frequency)).pipe(switchMap((/**
335 * @param {?} __0
336 * @return {?}
337 */
338 function (_a) {
339 var _b = __read(_a, 2), pricingTier = _b[0], formattedFrequency = _b[1];
340 if (pricingTier) {
341 return _this.translateService.stream('FRONTEND.STORE.PRODUCT_PRICING_WITH_FREQUENCY', {
342 pricingTier: pricingTier,
343 frequency: formattedFrequency
344 });
345 }
346 return of(formattedFrequency);
347 })));
348 };
349 /**
350 * @param {?} tier
351 * @return {?}
352 */
353 VaPricingComponent.prototype.buildPricingTierForAddon = /**
354 * @param {?} tier
355 * @return {?}
356 */
357 function (tier) {
358 return this.buildPricingTierString(tier).pipe(map((/**
359 * @param {?} pricingRange
360 * @return {?}
361 */
362 function (pricingRange) { return pricingRange ? pricingRange : ''; })));
363 };
364 /**
365 * @param {?} price
366 * @param {?} currency
367 * @param {?} excludeFrequency
368 * @param {?} canIncludeStartingAtPrefix
369 * @return {?}
370 */
371 VaPricingComponent.prototype.buildPriceStringForPricing = /**
372 * @param {?} price
373 * @param {?} currency
374 * @param {?} excludeFrequency
375 * @param {?} canIncludeStartingAtPrefix
376 * @return {?}
377 */
378 function (price, currency, excludeFrequency, canIncludeStartingAtPrefix) {
379 return this.displayPriceService.formatDisplayPrice(price.price, currency, (/** @type {?} */ ((excludeFrequency ? '' : price.frequency))), true, true, true, price.isStartingPrice && canIncludeStartingAtPrefix);
380 };
381 /**
382 * @param {?} tier
383 * @param {?=} frequency
384 * @param {?=} isStartingPrice
385 * @return {?}
386 */
387 VaPricingComponent.prototype.buildPriceStringForTier = /**
388 * @param {?} tier
389 * @param {?=} frequency
390 * @param {?=} isStartingPrice
391 * @return {?}
392 */
393 function (tier, frequency, isStartingPrice) {
394 return this.displayPriceService.formatDisplayPrice(tier.price, this.billedProduct.currency, (/** @type {?} */ (frequency)), undefined, undefined, undefined, isStartingPrice);
395 };
396 /**
397 * @param {?=} frequency
398 * @return {?}
399 */
400 VaPricingComponent.prototype.buildFrequencyString = /**
401 * @param {?=} frequency
402 * @return {?}
403 */
404 function (frequency) {
405 return this.displayPriceService.formatBillingFrequency(frequency);
406 };
407 /**
408 * @return {?}
409 */
410 VaPricingComponent.prototype.buildCommitmentMessage = /**
411 * @return {?}
412 */
413 function () {
414 var _this = this;
415 return combineLatest([
416 this.translateService.stream('FRONTEND.STORE.PRICING_FREQUENCIES'),
417 this.billedProduct$,
418 this.pricing$,
419 this.isFree$,
420 this.shouldContactSales$
421 ]).pipe(switchMap((/**
422 * @param {?} __0
423 * @return {?}
424 */
425 function (_a) {
426 var _b = __read(_a, 5), frequencyTranslations = _b[0], billedProduct = _b[1], pricing = _b[2], isFree = _b[3], shouldContactSales = _b[4];
427 /** @type {?} */
428 var frequency = billedProduct ? billedProduct.billingFrequency.toString().toLowerCase() :
429 pricing && pricing.prices.length > 0 ? pricing.prices[0].frequency.toLowerCase() : '';
430 /** @type {?} */
431 var frequencyString = '';
432 if (frequency === 'yearly') {
433 frequencyString = frequencyTranslations.YEAR;
434 }
435 else if (frequency === 'monthly') {
436 frequencyString = frequencyTranslations.MONTH;
437 }
438 if (!frequencyString || isFree || shouldContactSales) {
439 return of('');
440 }
441 if (billedProduct && billedProduct.commitment) {
442 /** @type {?} */
443 var initial = billedProduct.commitment.initial;
444 /** @type {?} */
445 var recurring = billedProduct.commitment.recurring;
446 return _this.translateService.stream('FRONTEND.STORE.COMMITMENT_WITH_RENEWAL', {
447 initial: initial,
448 frequencyString: frequencyString,
449 recurring: recurring,
450 });
451 }
452 return of('');
453 })));
454 };
455 VaPricingComponent.decorators = [
456 { type: Component, args: [{
457 selector: 'va-pricing',
458 template: "<ng-container *ngIf=\"highlightPrice\">\n <highlight-pricing [pricing]=\"pricing\"\n [billedProduct]=\"billedProduct\"\n [highlightPrice]=\"highlightPrice\"\n [isAddon]=\"isAddon\"\n [hasVerifiedContract]=\"hasVerifiedContract\"\n [wrapFrequency]=\"wrapFrequency\"\n [loaded]=\"loaded\">\n </highlight-pricing>\n</ng-container>\n<ng-container *ngIf=\"!highlightPrice\">\n <table-pricing [pricing]=\"pricing\"\n [highlightPrice]=\"highlightPrice\"\n [billedProduct]=\"billedProduct\"\n [hasVerifiedContract]=\"hasVerifiedContract\"\n [loaded]=\"loaded\">\n </table-pricing>\n</ng-container>\n",
459 styles: [""]
460 }] }
461 ];
462 /** @nocollapse */
463 VaPricingComponent.ctorParameters = function () { return [
464 { type: TranslateService },
465 { type: DisplayPriceService }
466 ]; };
467 VaPricingComponent.propDecorators = {
468 pricing: [{ type: Input }],
469 billedProduct: [{ type: Input }],
470 wrapFrequency: [{ type: Input }],
471 isAddon: [{ type: Input }],
472 hasVerifiedContract: [{ type: Input }],
473 highlightPrice: [{ type: Input }],
474 loaded: [{ type: Input }]
475 };
476 return VaPricingComponent;
477}());
478if (false) {
479 /** @type {?} */
480 VaPricingComponent.prototype.pricing;
481 /** @type {?} */
482 VaPricingComponent.prototype.billedProduct;
483 /** @type {?} */
484 VaPricingComponent.prototype.wrapFrequency;
485 /** @type {?} */
486 VaPricingComponent.prototype.isAddon;
487 /** @type {?} */
488 VaPricingComponent.prototype.hasVerifiedContract;
489 /** @type {?} */
490 VaPricingComponent.prototype.highlightPrice;
491 /** @type {?} */
492 VaPricingComponent.prototype.loaded;
493 /** @type {?} */
494 VaPricingComponent.prototype.pricing$$;
495 /** @type {?} */
496 VaPricingComponent.prototype.billedProduct$$;
497 /** @type {?} */
498 VaPricingComponent.prototype.hasVerifiedContract$$;
499 /** @type {?} */
500 VaPricingComponent.prototype.isFree$;
501 /** @type {?} */
502 VaPricingComponent.prototype.shouldContactSales$;
503 /** @type {?} */
504 VaPricingComponent.prototype.isFlatPrice$;
505 /** @type {?} */
506 VaPricingComponent.prototype.pricingTierData$;
507 /** @type {?} */
508 VaPricingComponent.prototype.priceData$;
509 /** @type {?} */
510 VaPricingComponent.prototype.commitmentMessage$;
511 /**
512 * @type {?}
513 * @private
514 */
515 VaPricingComponent.prototype.translateService;
516 /**
517 * @type {?}
518 * @private
519 */
520 VaPricingComponent.prototype.displayPriceService;
521}
522
523/**
524 * @fileoverview added by tsickle
525 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
526 */
527var HighlightPricingComponent = /** @class */ (function (_super) {
528 __extends(HighlightPricingComponent, _super);
529 function HighlightPricingComponent() {
530 return _super !== null && _super.apply(this, arguments) || this;
531 }
532 HighlightPricingComponent.decorators = [
533 { type: Component, args: [{
534 selector: 'highlight-pricing',
535 template: "<ng-container *ngIf=\"loaded; else loading\">\n <div class=\"no-price\" *ngIf=\"shouldContactSales$ | async; else dontContactSales\">\n {{ 'FRONTEND.STORE.CONTACT_SALES' | translate }}\n </div>\n <ng-template #dontContactSales>\n <div class=\"no-price\" *ngIf=\"isFree$ | async; else notFree\">\n <b>{{ 'FRONTEND.STORE.FREE' | translate }}</b>\n </div>\n <ng-template #notFree>\n <ng-container *ngIf=\"!isAddon\">\n <ng-container *ngIf=\"hasVerifiedContract && billedProduct; else usePricing\">\n <div *ngFor=\"let tier of pricingTierData$ | async\" class=\"price-box\">\n <span>\n <span *ngIf=\"tier.isStartingPrice\" class=\"starting-at\">{{ 'FRONTEND.STORE.STARTING_AT' | translate }}</span>\n <b class=\"price-number\">{{ tier.priceStringForTierWithoutFreq }}</b>\n </span>\n <span class=\"tier-billing-freq\" [ngClass]=\"{'va-wrap': wrapFrequency}\">\n {{ tier.pricingTierForProduct }}\n </span>\n </div>\n </ng-container>\n <ng-template #usePricing>\n <ng-container *ngIf=\"pricing?.prices\">\n <div *ngFor=\"let price of priceData$ | async; let i = index\" class=\"price-box\">\n <span>\n <span *ngIf=\"price.isStartingPrice\" class=\"starting-at\">{{ 'FRONTEND.STORE.STARTING_AT' | translate }}</span>\n <b class=\"price-number\">\n <ng-container *ngIf=\"i == 1\">+</ng-container>\n {{ price.priceStringForPricingWithoutFrequency }}\n </b>\n </span>\n <span *ngIf=\"price.frequencyString\" class=\"billing-freq\" [ngClass]=\"{'va-wrap': wrapFrequency}\">\n {{ price.frequencyString }}\n </span>\n </div>\n </ng-container>\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"isAddon\">\n <div *ngIf=\"hasVerifiedContract && billedProduct; else useAddonPricing\">\n <div *ngFor=\"let tier of pricingTierData$ | async\" class=\"price-box\">\n <span class=\"addon-billing-freq\">\n {{ tier.pricingTierForAddon }}\n </span>\n <span>\n <span *ngIf=\"tier.isStartingPrice\" class=\"starting-at\">{{ 'FRONTEND.STORE.STARTING_AT' | translate }}</span>\n <b class=\"price-number\">\n {{ tier.priceStringForTier }}\n </b>\n </span>\n </div>\n </div>\n <ng-template #useAddonPricing>\n <div class=\"price-box\">\n <span *ngIf=\"pricing?.prices[0].frequency\" class=\"addon-billing-freq\">\n {{ (priceData$ | async)[0]?.frequencyString }}\n </span>\n <span>\n <span *ngIf=\"pricing?.prices[0]?.isStartingPrice\" class=\"starting-at\">\n {{ 'FRONTEND.STORE.STARTING_AT' | translate }}\n </span>\n <b class=\"price-number\">\n {{ (priceData$ | async)[0]?.priceStringForPricingWithoutFrequency }}\n </b>\n </span>\n </div>\n </ng-template>\n </ng-container>\n <div class=\"commitment\" *ngIf=\"billedProduct && billedProduct.commitment && billedProduct.commitment.initial > 1\">\n {{ commitmentMessage$ | async }}\n </div>\n </ng-template>\n </ng-template>\n</ng-container>\n<ng-template #loading>\n <div class=\"stencil-pricing stencil-shimmer\"></div>\n</ng-template>\n",
536 styles: [":host{color:#9e9e9e}.starting-at{margin-right:5px}.price-box{display:-webkit-box;display:flex;-webkit-box-align:baseline;align-items:baseline;-webkit-box-orient:horizontal;-webkit-box-direction:reverse;flex-direction:row-reverse}.no-price{text-align:center}b{color:#212121;font-size:20px}@media screen and (max-width:600px){.no-price,.price-box,b{font-size:16px}}.billing-freq{text-transform:capitalize;-webkit-box-flex:1;flex:1}.tier-billing-freq{-webkit-box-flex:1;flex:1}.addon-billing-freq{padding-left:5px}.va-wrap{display:block}.stencil-pricing{height:1em}.commitment{color:#9e9e9e;font-size:12px;font-style:italic}"]
537 }] }
538 ];
539 return HighlightPricingComponent;
540}(VaPricingComponent));
541
542/**
543 * @fileoverview added by tsickle
544 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
545 */
546var TablePricingComponent = /** @class */ (function (_super) {
547 __extends(TablePricingComponent, _super);
548 function TablePricingComponent() {
549 return _super !== null && _super.apply(this, arguments) || this;
550 }
551 TablePricingComponent.decorators = [
552 { type: Component, args: [{
553 selector: 'table-pricing',
554 template: "<ng-container *ngIf=\"loaded; else loading\">\n <div *ngIf=\"hasVerifiedContract && billedProduct; else usePricing\">\n <div class=\"price-container\" *ngIf=\"isFlatPrice$ | async; else notFlatPrice\">\n <div class=\"price\">\n {{ (pricingTierData$ | async)[0]?.priceStringForTier }}\n </div>\n </div>\n <ng-template #notFlatPrice>\n <div class=\"price-container--tiered\" *ngIf=\"!(isFlatPrice$ | async)\">\n <div class=\"pricing-tier\" *ngFor=\"let tier of pricingTierData$ | async\">\n <div class=\"pricing-tier__range\">{{ tier.pricingTierString }}</div>\n <div class=\"pricing-tier__price\">\n {{ tier.priceStringForTier }}\n </div>\n </div>\n </div>\n </ng-template>\n <div class=\"commitment\" *ngIf=\"billedProduct && billedProduct.commitment && billedProduct.commitment.initial > 1\">\n {{ commitmentMessage$ | async }}\n </div>\n </div>\n <ng-template #usePricing>\n <div class=\"gray-font\">\n <ng-container *ngIf=\"shouldContactSales$ | async; else dontContactSales\">\n {{ 'FRONTEND.STORE.CONTACT_SALES' | translate }}\n </ng-container>\n <ng-template #dontContactSales>\n <ng-container *ngIf=\"isFree$ | async; else notFree\">\n {{ 'FRONTEND.STORE.FREE' | translate }}\n </ng-container>\n <ng-template #notFree>\n {{ (priceData$ | async)[0].priceStringForPricingWithFrequency }}\n <div class=\"commitment\" *ngIf=\"billedProduct && billedProduct.commitment && billedProduct.commitment.initial > 1\">\n {{ commitmentMessage$ | async }}\n </div>\n </ng-template>\n </ng-template>\n </div>\n </ng-template>\n</ng-container>\n<ng-template #loading>\n <div class=\"stencil-pricing stencil-shimmer\"></div>\n</ng-template>\n",
555 styles: [":host{color:#616161}.price-container--tiered{font-size:12px;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;display:-webkit-box;display:flex;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.price-container--tiered .pricing-tier{border-bottom:1px solid #e0e0e0;padding:5px 0;display:-webkit-box;display:flex}.price-container--tiered .pricing-tier:first-child{padding-top:0}.price-container--tiered .pricing-tier:last-child{padding-bottom:0;border-bottom:none}.price-container--tiered .pricing-tier .pricing-tier__range{padding-right:20px;-webkit-box-flex:1;flex:1}.stencil-pricing{height:1em}.commitment{color:#9e9e9e;font-size:12px;font-style:italic}"]
556 }] }
557 ];
558 return TablePricingComponent;
559}(VaPricingComponent));
560
561/**
562 * @fileoverview added by tsickle
563 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
564 */
565var VaPricingModule = /** @class */ (function () {
566 function VaPricingModule() {
567 }
568 VaPricingModule.decorators = [
569 { type: NgModule, args: [{
570 imports: [
571 CommonModule,
572 CoreSharedModule,
573 TranslateModule
574 ],
575 declarations: [VaPricingComponent, HighlightPricingComponent, TablePricingComponent],
576 exports: [VaPricingComponent]
577 },] }
578 ];
579 return VaPricingModule;
580}());
581
582/**
583 * @fileoverview added by tsickle
584 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
585 */
586var StoreCardComponent = /** @class */ (function () {
587 function StoreCardComponent(imageTransformationService, translateService) {
588 this.imageTransformationService = imageTransformationService;
589 this.translateService = translateService;
590 this.purchasedClicked = new EventEmitter();
591 this.cardClicked = new EventEmitter();
592 this.descriptionClicked = new EventEmitter();
593 this.bannerClicked = new EventEmitter();
594 this.translateService.setTranslation('en', En.en, true);
595 this.translateService.setTranslation('cs', Cs.cs, true);
596 }
597 /**
598 * @return {?}
599 */
600 StoreCardComponent.prototype.getBannerColorForName = /**
601 * @return {?}
602 */
603 function () {
604 // determine an icon color for a product with no icon by using the product name
605 /** @type {?} */
606 var COLOR_CODES = [
607 '#EF5350', '#42A5F5', '#66BB6A', '#FFA726', '#AB47BC', '#FFCA28', '#EC407A', '#26C6DA',
608 '#FF7B57'
609 ];
610 /** @type {?} */
611 var nameSum = 0;
612 /** @type {?} */
613 var defaultColor = '#808080';
614 if (!this.item.name) {
615 return defaultColor;
616 }
617 for (var i = 0; i < this.item.name.length; i++) {
618 nameSum += this.item.name[i].charCodeAt(0);
619 }
620 /** @type {?} */
621 var index = nameSum % COLOR_CODES.length;
622 return COLOR_CODES[index];
623 };
624 /**
625 * @param {?} imageUrl
626 * @return {?}
627 */
628 StoreCardComponent.prototype.getSrcsetHeaderUrls = /**
629 * @param {?} imageUrl
630 * @return {?}
631 */
632 function (imageUrl) {
633 return this.imageTransformationService.getSrcSetForImage(imageUrl, [680, 1360, 2720]);
634 };
635 StoreCardComponent.decorators = [
636 { type: Component, args: [{
637 selector: 'va-store-card',
638 template: "\n<mat-card class=\"hover-card\" *ngIf=\"item\" (click)=\"cardClicked.emit(item)\">\n<div class=\"hover-area\">\n <div class=\"product-banner\" (click)=\"bannerClicked.emit(item)\"\n [style.background-color]=\"item.headerImageUrl ? '': getBannerColorForName()\">\n <img class=\"img-container\" *ngIf=\"item.headerImageUrl\"\n [src]=\"item.headerImageUrl\" [srcset]=\"getSrcsetHeaderUrls(item.headerImageUrl)\">\n </div>\n\n <div class=\"description\" (click)=\"descriptionClicked.emit(item)\">\n <mat-card-header>\n <va-icon mat-card-avatar [diameter]=\"40\" [name]=\"item.name\" [iconUrl]=\"item.iconUrl\"></va-icon>\n <mat-card-title>{{item.name}}</mat-card-title>\n <mat-card-subtitle>\n <ng-container *ngIf=\"item.pricing; else formatted\">\n <va-pricing [pricing]=\"item.pricing\"\n [highlightPrice]=\"false\"></va-pricing>\n </ng-container>\n <ng-template #formatted>{{item.formattedPrice}}</ng-template>\n </mat-card-subtitle>\n </mat-card-header>\n <mat-card-content> {{ item.tagline }}\n </mat-card-content>\n </div>\n\n <button *ngIf=\"item.purchased !== undefined\"\n mat-button color=\"primary\" class=\"enabled-indicator\" (click)=\"purchasedClicked.emit(item)\" [disabled]=\"item.purchased\">\n <i *ngIf=\"!item.purchased\" class=\"material-icons\">add</i>\n <i *ngIf=\"item.purchased\" class=\"material-icons\" style=\"color: #39B74A\">check</i>\n <span>{{ (item.purchased ? 'FRONTEND.STORE.ENABLED_UPPER' : 'FRONTEND.STORE.ENABLE_UPPER') | translate }}</span>\n </button>\n </div>\n</mat-card>\n ",
639 styles: [":host{position:relative}::ng-deep .mat-card-header-text{width:100%}mat-card.hover-card{overflow:hidden;padding:0;margin-bottom:0}mat-card.hover-card mat-card-subtitle,mat-card.hover-card mat-card-title{margin:0 80px 0 0;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}mat-card.hover-card mat-card-subtitle{font-size:12px;margin-top:4px}.hover-area{position:relative;cursor:pointer}.product-banner{max-height:133px;overflow:hidden;display:-webkit-box;display:flex;width:100%;height:100px;-webkit-box-align:center;align-items:center;-webkit-box-pack:center;justify-content:center}.product-banner img{max-width:100%}@media screen and (min-width:480px){.hover-area{padding-top:55%}.hover-area:hover .description{top:0}.hover-area:hover .enabled-indicator span{width:70px}.product-banner{max-height:none;position:absolute;height:60%;top:0}}.description{box-sizing:border-box;padding:10px 16px 0;overflow:hidden;background:#fff;color:#212121;-webkit-transition:.3s;transition:.3s}.description:after{content:'';display:block;width:100%;height:40%;position:absolute;bottom:0;left:0;background:-webkit-gradient(linear,left top,left bottom,color-stop(40%,rgba(255,255,255,0)),color-stop(70%,#fff));background:linear-gradient(rgba(255,255,255,0) 40%,#fff 70%)}mat-card-header{box-sizing:border-box;padding-bottom:16px;margin:0;height:40%;display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center}mat-card-content{min-height:40px;max-height:80px;padding:16px;margin:0 -16px;border-top:1px solid #e0e0e0;font-size:12px}.enabled-indicator{position:absolute;right:8px;bottom:8px}.enabled-indicator span{display:inline-block;width:70px;overflow:hidden;-webkit-transition:.3s;transition:.3s}@media screen and (min-width:480px){.description{position:absolute;top:60%;width:100%;height:100%}.description:after{height:70%}mat-card-content{min-height:0;max-height:none}.enabled-indicator span{width:0}}button[mat-button]{padding:0 8px;min-width:0}mat-card-actions{position:relative;padding:8px!important;margin:0!important;text-align:right;border-top:1px solid #e0e0e0;background-color:#fff;color:#212121}.status{font-size:14px}.img-container{height:100%;width:100%}"]
640 }] }
641 ];
642 /** @nocollapse */
643 StoreCardComponent.ctorParameters = function () { return [
644 { type: ImageTransformationService },
645 { type: TranslateService }
646 ]; };
647 StoreCardComponent.propDecorators = {
648 item: [{ type: Input }],
649 purchasedClicked: [{ type: Output }],
650 cardClicked: [{ type: Output }],
651 descriptionClicked: [{ type: Output }],
652 bannerClicked: [{ type: Output }]
653 };
654 return StoreCardComponent;
655}());
656if (false) {
657 /** @type {?} */
658 StoreCardComponent.prototype.item;
659 /** @type {?} */
660 StoreCardComponent.prototype.purchasedClicked;
661 /** @type {?} */
662 StoreCardComponent.prototype.cardClicked;
663 /** @type {?} */
664 StoreCardComponent.prototype.descriptionClicked;
665 /** @type {?} */
666 StoreCardComponent.prototype.bannerClicked;
667 /**
668 * @type {?}
669 * @private
670 */
671 StoreCardComponent.prototype.imageTransformationService;
672 /**
673 * @type {?}
674 * @private
675 */
676 StoreCardComponent.prototype.translateService;
677}
678
679/**
680 * @fileoverview added by tsickle
681 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
682 */
683var StoreCardModule = /** @class */ (function () {
684 function StoreCardModule() {
685 }
686 StoreCardModule.decorators = [
687 { type: NgModule, args: [{
688 imports: [
689 CommonModule,
690 VaIconModule,
691 MatCardModule,
692 MatButtonModule,
693 MatIconModule,
694 MatMenuModule,
695 ImageTransformationModule,
696 VaPricingModule,
697 TranslateModule
698 ],
699 declarations: [StoreCardComponent],
700 exports: [StoreCardComponent]
701 },] }
702 ];
703 return StoreCardModule;
704}());
705
706/**
707 * @fileoverview added by tsickle
708 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
709 */
710var StoreComponent = /** @class */ (function () {
711 function StoreComponent() {
712 this.items = [];
713 this.searchable = true;
714 this.itemClicked = new EventEmitter();
715 }
716 Object.defineProperty(StoreComponent.prototype, "filteredItems", {
717 get: /**
718 * @return {?}
719 */
720 function () {
721 var _this = this;
722 if (this.filterTerm) {
723 return this.items.filter((/**
724 * @param {?} pkg
725 * @return {?}
726 */
727 function (pkg) { return pkg.name.toLowerCase().indexOf(_this.filterTerm.toLowerCase()) !== -1; }));
728 }
729 return this.items;
730 },
731 enumerable: true,
732 configurable: true
733 });
734 StoreComponent.decorators = [
735 { type: Component, args: [{
736 selector: 'va-store',
737 template: "\n <div class=\"toolbar\">\n <div *ngIf=\"searchable\" class=\"table-controls-row\">\n <va-search-box (update)=\"filterTerm = $event\"></va-search-box>\n </div>\n </div>\n <div class=\"row row-gutters\">\n <div *ngFor=\"let item of filteredItems\" class=\"col-flex\">\n <va-store-card [item]=\"item\" (cardClicked)=\"this.itemClicked.emit(item)\"></va-store-card>\n </div>\n </div>\n ",
738 styles: [".flex-row{display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row}.toolbar{padding:0;background-color:#fff;color:#616161}.toolbar .disabled{cursor:default}.toolbar .disabled mat-icon{cursor:default;color:#9e9e9e}.toolbar va-search-box{margin-right:10px;width:350px}.toolbar .table-controls-row{padding:0 10px 10px;display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;-webkit-box-align:center;align-items:center}.toolbar .table-controls-row:first-of-type{padding-top:10px}.top-border{border-top:1px solid #fff}.selected{background-color:#fff}.row{display:-webkit-box;display:flex;flex-wrap:wrap}.row+.row-gutters{margin-top:0}.row-gutters{margin-top:-20px;margin-left:-20px}.row-gutters>.col-flex{padding-top:20px;padding-left:20px}.col-flex{position:relative;max-width:100%;box-sizing:border-box;-webkit-box-flex:0;flex:0 0 auto;width:100%}@media screen and (min-width:480px){.col-flex{width:50%}}@media screen and (min-width:1200px){.col-flex{width:33.333333%}}"]
739 }] }
740 ];
741 StoreComponent.propDecorators = {
742 items: [{ type: Input }],
743 searchable: [{ type: Input }],
744 itemClicked: [{ type: Output }]
745 };
746 return StoreComponent;
747}());
748if (false) {
749 /** @type {?} */
750 StoreComponent.prototype.items;
751 /** @type {?} */
752 StoreComponent.prototype.searchable;
753 /** @type {?} */
754 StoreComponent.prototype.itemClicked;
755 /** @type {?} */
756 StoreComponent.prototype.filterTerm;
757}
758
759/**
760 * @fileoverview added by tsickle
761 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
762 */
763var DropDownFormSectionComponent = /** @class */ (function () {
764 function DropDownFormSectionComponent(translateService) {
765 this.translateService = translateService;
766 this.startOpen = false;
767 this.displayAutoTitle = false;
768 this.titleText = '';
769 this.displayAutoDescription = true;
770 this.descriptionText = '';
771 this.editingHint = '';
772 this.expandable = true;
773 this.autoDescriptionText = '';
774 this.iconName = 'help_outline';
775 this.subscriptions = [];
776 this.uniqueIndex = 1;
777 this.autoTitleText = '';
778 this.translateService.setTranslation('en', En.en, true);
779 this.translateService.setTranslation('cs', Cs.cs, true);
780 }
781 /**
782 * @return {?}
783 */
784 DropDownFormSectionComponent.prototype.ngOnInit = /**
785 * @return {?}
786 */
787 function () {
788 var _this = this;
789 /** @type {?} */
790 var allFieldsHidden = this.fields.reduce((/**
791 * @param {?} p
792 * @param {?} c
793 * @param {?} i
794 * @param {?} a
795 * @return {?}
796 */
797 function (p, c, i, a) { return p && c.hidden; }), true);
798 if (allFieldsHidden) {
799 this.expandable = false;
800 }
801 while (this.parentForm.controls.hasOwnProperty(this.titleText + this.uniqueIndex)) {
802 this.uniqueIndex += 1;
803 }
804 this.parentForm.addControl(this.titleText + this.uniqueIndex, this.toFormGroup(this.fields));
805 /** @type {?} */
806 var form = (/** @type {?} */ (this.parentForm.controls[this.titleText + this.uniqueIndex]));
807 for (var key in form.controls) {
808 if (form.controls.hasOwnProperty(key)) {
809 if (this.prepopulatedData != null && this.prepopulatedData.hasOwnProperty(key)) {
810 form.controls[key].setValue(this.prepopulatedData[key]);
811 }
812 }
813 }
814 this.subscriptions.push(combineLatest([
815 form.statusChanges,
816 this.translateService.stream('FRONTEND.STORE.AUTO_TITLE_TEXT')
817 ]).subscribe((/**
818 * @param {?} __0
819 * @return {?}
820 */
821 function (_a) {
822 var _b = __read(_a, 2), change = _b[0], autoTitleText = _b[1];
823 /** @type {?} */
824 var missingFields = false;
825 for (var control in form.controls) {
826 if (!form.controls[control].value || (form.controls[control].value.constructor === Array && !form.controls[control].value[0])) {
827 _this.iconName = 'help_outline';
828 missingFields = true;
829 if (change === 'INVALID') {
830 _this.autoTitleText = autoTitleText.SOME_FIELDS_INVALID;
831 if (form.controls[control].dirty || form.controls[control].touched) {
832 _this.iconName = 'warning';
833 break;
834 }
835 }
836 else {
837 _this.autoTitleText = autoTitleText.OPTIONAL_FIELDS_UNANSWERED;
838 }
839 }
840 }
841 if (!missingFields) {
842 _this.iconName = 'check_circle';
843 _this.autoTitleText = autoTitleText.COMPLETE;
844 }
845 })));
846 if (this.displayAutoDescription) {
847 this.subscriptions.push(form.valueChanges.subscribe((/**
848 * @param {?} changes
849 * @return {?}
850 */
851 function (changes) {
852 /** @type {?} */
853 var description = '';
854 for (var key in changes) {
855 if (changes.hasOwnProperty(key) && changes[key] != null && changes[key].length > 0) {
856 if (changes[key][0].name) {
857 for (var fileKey in changes[key]) {
858 if (changes[key][fileKey] != null) {
859 description += changes[key][fileKey].name;
860 description += ', ';
861 }
862 }
863 }
864 else {
865 description += changes[key];
866 description += ', ';
867 }
868 }
869 }
870 _this.autoDescriptionText = description.substring(0, description.length - 2);
871 })));
872 }
873 form.updateValueAndValidity({ onlySelf: false, emitEvent: true });
874 };
875 /**
876 * @param {?} formFields
877 * @return {?}
878 */
879 DropDownFormSectionComponent.prototype.toFormGroup = /**
880 * @param {?} formFields
881 * @return {?}
882 */
883 function (formFields) {
884 var _this = this;
885 /** @type {?} */
886 var group = {};
887 formFields.forEach((/**
888 * @param {?} field
889 * @return {?}
890 */
891 function (field) {
892 /** @type {?} */
893 var validations;
894 if (!field.required || field.hidden) {
895 validations = field.validator;
896 }
897 else if (field.controlType === 'checkbox') {
898 validations = [Validators.requiredTrue, field.validator];
899 }
900 else {
901 validations = [Validators.required, field.validator];
902 }
903 /** @type {?} */
904 var formControl = new FormControl({ value: field.value, disabled: field.disabled }, validations);
905 group[field.id] = formControl;
906 _this.subscriptions.push(formControl.valueChanges.subscribe((/**
907 * @param {?} value
908 * @return {?}
909 */
910 function (value) { return (field.value = value); })));
911 }));
912 return new FormGroup(group);
913 };
914 /**
915 * @return {?}
916 */
917 DropDownFormSectionComponent.prototype.ngOnDestroy = /**
918 * @return {?}
919 */
920 function () {
921 this.subscriptions.forEach((/**
922 * @param {?} subscription
923 * @return {?}
924 */
925 function (subscription) { return subscription.unsubscribe(); }));
926 };
927 DropDownFormSectionComponent.decorators = [
928 { type: Component, args: [{
929 selector: 'va-dropdown-form-section',
930 template: "\n <mat-expansion-panel *ngIf=\"expandable || expandable == undefined\" [expanded]=\"startOpen\">\n <mat-expansion-panel-header [collapsedHeight]=\"'*'\" [expandedHeight]=\"'*'\">\n <div class=\"dropdown-form-header\">\n <mat-icon\n [ngClass]=\"{invalid: iconName=='warning', valid: iconName=='check_circle', question: iconName=='help_outline'}\">\n {{ iconName }}\n </mat-icon>\n <mat-panel-title *ngIf=\"!displayAutoTitle\">\n {{ titleText }}\n </mat-panel-title>\n <mat-panel-title *ngIf=\"displayAutoTitle\"\n [ngClass]=\"{valid: iconName=='check_circle', invalid: iconName=='warning'}\">\n <div class=\"title\"> {{ titleText }}</div>\n <div *ngIf=\"titleText && autoTitleText\"> &nbsp;</div>\n <div><ng-container><i> {{autoTitleText}} </i></ng-container></div>\n </mat-panel-title>\n <mat-panel-description *ngIf=\"displayAutoDescription\" [ngClass]=\"{invalid: iconName=='warning'}\">\n {{ autoDescriptionText }}\n </mat-panel-description>\n <mat-panel-description *ngIf=\"!displayAutoDescription\" [ngClass]=\"{invalid: iconName=='warning'}\">\n <i> {{descriptionText}} </i>\n </mat-panel-description>\n </div>\n </mat-expansion-panel-header>\n <div class=\"expansion-panel-body\">\n <va-field *ngFor=\"let field of fields\" [field]=\"field\"\n [form]=\"parentForm.controls[titleText + uniqueIndex]\"\n ></va-field>\n <p *ngIf=\"editingHint != ''\" class=\"editing-hint\"><i>{{ editingHint }}</i></p>\n </div>\n </mat-expansion-panel>\n ",
931 styles: [":host-context(va-dropdown-form-section){font-size:14px}:host-context(va-dropdown-form-section) .expansion-panel-body{margin-top:-10px;display:block}@media screen and (min-width:600px){:host-context(va-dropdown-form-section) .expansion-panel-body{width:60%}}.mat-expanded,.mat-expansion-panel{-webkit-transition:margin .4s;transition:margin .4s}mat-expansion-panel-header{min-height:48px;padding:12px 24px}.dropdown-form-header{width:90%;display:-webkit-box;display:flex}mat-panel-description{align-self:center;-webkit-box-flex:inherit;flex:inherit;display:initial;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}mat-panel-description.invalid{color:#c62828}mat-icon{margin-right:7px;-ms-grid-row-align:center;align-self:center}mat-icon.valid{color:#4caf50}mat-icon.invalid{color:#c62828}mat-icon.question{color:#9e9e9e}mat-panel-title{align-self:center;-webkit-box-flex:0;flex:none;margin-right:20px;display:-webkit-box;display:flex;max-width:100%}mat-panel-title div{display:-webkit-box;display:flex}mat-panel-title.valid{color:#4caf50}mat-panel-title.invalid{color:#c62828}.editing-hint{color:#9e9e9e}.title{color:#212121}.not-expandable-card{background:#fff;cursor:default;font-size:15px;display:-webkit-box;display:flex;height:48px;-webkit-box-align:center;align-items:center;box-shadow:0 3px 1px -2px rgba(0,0,0,.2),0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12)}.not-expandable-card .not-expandable-icon{margin-left:24px}.not-expandable-card .not-expandable-header{display:-webkit-box;display:flex}.not-expandable-card .not-expandable-description{margin-left:22px}.not-expandable-card .valid{color:#4caf50}"]
932 }] }
933 ];
934 /** @nocollapse */
935 DropDownFormSectionComponent.ctorParameters = function () { return [
936 { type: TranslateService }
937 ]; };
938 DropDownFormSectionComponent.propDecorators = {
939 prepopulatedData: [{ type: Input }],
940 startOpen: [{ type: Input }],
941 parentForm: [{ type: Input }],
942 displayAutoTitle: [{ type: Input }],
943 titleText: [{ type: Input }],
944 displayAutoDescription: [{ type: Input }],
945 descriptionText: [{ type: Input }],
946 fields: [{ type: Input }],
947 editingHint: [{ type: Input }],
948 expandable: [{ type: Input }]
949 };
950 return DropDownFormSectionComponent;
951}());
952if (false) {
953 /** @type {?} */
954 DropDownFormSectionComponent.prototype.prepopulatedData;
955 /** @type {?} */
956 DropDownFormSectionComponent.prototype.startOpen;
957 /** @type {?} */
958 DropDownFormSectionComponent.prototype.parentForm;
959 /** @type {?} */
960 DropDownFormSectionComponent.prototype.displayAutoTitle;
961 /** @type {?} */
962 DropDownFormSectionComponent.prototype.titleText;
963 /** @type {?} */
964 DropDownFormSectionComponent.prototype.displayAutoDescription;
965 /** @type {?} */
966 DropDownFormSectionComponent.prototype.descriptionText;
967 /** @type {?} */
968 DropDownFormSectionComponent.prototype.fields;
969 /** @type {?} */
970 DropDownFormSectionComponent.prototype.editingHint;
971 /** @type {?} */
972 DropDownFormSectionComponent.prototype.expandable;
973 /** @type {?} */
974 DropDownFormSectionComponent.prototype.autoDescriptionText;
975 /** @type {?} */
976 DropDownFormSectionComponent.prototype.iconName;
977 /** @type {?} */
978 DropDownFormSectionComponent.prototype.subscriptions;
979 /** @type {?} */
980 DropDownFormSectionComponent.prototype.uniqueIndex;
981 /** @type {?} */
982 DropDownFormSectionComponent.prototype.autoTitleText;
983 /**
984 * @type {?}
985 * @private
986 */
987 DropDownFormSectionComponent.prototype.translateService;
988}
989
990/**
991 * @fileoverview added by tsickle
992 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
993 */
994var FieldComponent = /** @class */ (function () {
995 function FieldComponent() {
996 }
997 Object.defineProperty(FieldComponent.prototype, "isValid", {
998 get: /**
999 * @return {?}
1000 */
1001 function () {
1002 return this.form.controls[this.field.id].valid || this.form.controls[this.field.id].pristine;
1003 },
1004 enumerable: true,
1005 configurable: true
1006 });
1007 /**
1008 * @param {?} field
1009 * @return {?}
1010 */
1011 FieldComponent.prototype.showCheckboxError = /**
1012 * @param {?} field
1013 * @return {?}
1014 */
1015 function (field) {
1016 return this.form.controls[field].errors && this.form.controls[field].errors.required && this.form.controls[field].touched;
1017 };
1018 FieldComponent.decorators = [
1019 { type: Component, args: [{
1020 selector: 'va-field',
1021 template: "<ng-container [ngSwitch]=\"field.controlType\" [formGroup]=\"form\">\n <div *ngIf=\"!field.hidden\" [ngClass]=\"{'for-office-use-only': field.forOfficeUseOnly}\">\n <span *ngIf=\"field.forOfficeUseOnly\" class=\"office-text\">*For Office Use Only</span>\n\n <ng-container *ngSwitchCase=\"'dropdown'\">\n <ng-container *ngIf=\"!field.allowMultiples\">\n <mat-form-field class=\"form-field-container\">\n <mat-select matInput [formControlName]=\"field.id\" [id]=\"field.id\" [placeholder]=\"field.getLabel()\">\n <mat-option *ngFor=\"let option of field.options\" [value]=\"option.value\">{{ option.label }}</mat-option>\n </mat-select>\n <mat-hint *ngIf=\"field.description\"> {{ field.description }} </mat-hint>\n </mat-form-field>\n </ng-container>\n <ng-container *ngIf=\"field.allowMultiples\">\n <va-input-tags class=\"form-field-container\" [id]=\"field.id\" [formControlName]=\"field.id\"\n [placeholder]=\"field.getLabel()\"\n [tooltip]=\"field.description\"\n [required]=\"field.required\"\n [options]=\"field.options\"\n [allowDuplicates]=\"field.allowDuplicates\"\n [maxFields]=\"field.maxChoices\">\n </va-input-tags>\n </ng-container>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'textbox'\">\n <mat-form-field class=\"form-field-container\">\n <span matPrefix *ngIf=\"field.prefix\"> {{ field.prefix}} &nbsp;</span>\n <input matInput [type]=\"field.textboxType\" [id]=\"field.id\" [formControlName]=\"field.id\" [placeholder]=\"field.getLabel()\" [pattern]=\"field.regexValidator || ''\"\n [readonly]=\"field.displayOnly\" [ngClass]=\"{'display-only': field.displayOnly}\">\n <span matSuffix *ngIf=\"field.suffix\"> &nbsp;{{ field.suffix }} </span>\n <mat-hint *ngIf=\"field.description\"> {{ field.description }} </mat-hint>\n <mat-error *ngIf=\"form.controls[field.id].hasError('pattern')\"> {{field.regexErrorMessage}} </mat-error>\n </mat-form-field>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'checkbox'\">\n <div class=\"form-field-container checkbox\">\n <mat-checkbox [formControlName]=\"field.id\" [id]=\"field.id\" ngControlDefault></mat-checkbox>\n <div class=\"checkbox-placeholder\"> {{field.label}}</div>\n <mat-error *ngIf=\"showCheckboxError(field.id)\" class=\"checkboxError\"> *Required </mat-error>\n </div>\n <div class=\"checkbox-description\" *ngIf=\"field.description\">{{ field.description }}</div>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'textarea'\">\n <mat-form-field class=\"form-field-container\">\n <textarea matInput [formControlName]=\"field.id\" [placeholder]=\"field.getLabel()\" [id]=\"field.id\"></textarea>\n <mat-hint *ngIf=\"field.description\"> {{ field.description }} </mat-hint>\n </mat-form-field>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'file'\">\n <div class=\"form-field-container\">\n <file-group-uploader [uploadUrl]=\"field.uploadUrl\" [label]=\"field.getLabel()\" [description]=\"field.description\" [formGroup]=\"form\" [formControlName]=\"field.id\"\n [numFiles]=\"field.numFiles\" class=\"form-field-container\"></file-group-uploader>\n </div>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'vbcuser'\">\n <mat-form-field class=\"form-field-container\">\n <mat-select matInput [formControlName]=\"field.id\" [id]=\"field.id\" [placeholder]=\"field.getLabel()\">\n <mat-option *ngFor=\"let option of field.options\" [value]=\"option.value\" [disabled]=\"option.disabled\">{{ option.label }}</mat-option>\n </mat-select>\n <mat-hint *ngIf=\"field.description\"> {{ field.description }} </mat-hint>\n </mat-form-field>\n </ng-container>\n </div>\n</ng-container>\n",
1022 styles: [".form-field-container{font-size:16px;width:100%;margin:10px 0}.checkbox{display:-webkit-box;display:flex;padding:5px 0;color:rgba(0,0,0,.54);margin-top:24px}.checkbox .checkbox-placeholder{margin-left:10px}.checkbox-description{margin-top:-14px;margin-left:32px;color:rgba(0,0,0,.54);font-size:12px}.for-office-use-only{position:relative}.office-text{font-size:8px;position:absolute;right:5px}.display-only{color:rgba(0,0,0,.38)}.checkboxError{padding-left:16px}"]
1023 }] }
1024 ];
1025 FieldComponent.propDecorators = {
1026 field: [{ type: Input }],
1027 form: [{ type: Input }]
1028 };
1029 return FieldComponent;
1030}());
1031if (false) {
1032 /** @type {?} */
1033 FieldComponent.prototype.field;
1034 /** @type {?} */
1035 FieldComponent.prototype.form;
1036}
1037
1038/**
1039 * @fileoverview added by tsickle
1040 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1041 */
1042var FieldService = /** @class */ (function () {
1043 function FieldService() {
1044 }
1045 /**
1046 * @param {?} field
1047 * @return {?}
1048 */
1049 FieldService.prototype.createFormControl = /**
1050 * @param {?} field
1051 * @return {?}
1052 */
1053 function (field) {
1054 if (field.required) {
1055 return new FormControl(field.value, Validators.required);
1056 }
1057 else {
1058 return new FormControl(field.value);
1059 }
1060 };
1061 /**
1062 * @param {?} formFields
1063 * @param {?} subscriptions
1064 * @return {?}
1065 */
1066 FieldService.prototype.toFormGroup = /**
1067 * @param {?} formFields
1068 * @param {?} subscriptions
1069 * @return {?}
1070 */
1071 function (formFields, subscriptions) {
1072 var _this = this;
1073 /** @type {?} */
1074 var group = {};
1075 formFields.forEach((/**
1076 * @param {?} field
1077 * @return {?}
1078 */
1079 function (field) {
1080 /** @type {?} */
1081 var formControl;
1082 if (field.controlType === 'checkbox') {
1083 formControl = new FormControl(field.value);
1084 }
1085 else {
1086 formControl = _this.createFormControl(field);
1087 }
1088 group[field.id] = formControl;
1089 if (subscriptions) {
1090 subscriptions.push(formControl.valueChanges.subscribe((/**
1091 * @param {?} value
1092 * @return {?}
1093 */
1094 function (value) { return (field.value = value); })));
1095 }
1096 }));
1097 return new FormGroup(group);
1098 };
1099 FieldService.decorators = [
1100 { type: Injectable }
1101 ];
1102 return FieldService;
1103}());
1104
1105/**
1106 * @fileoverview added by tsickle
1107 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1108 */
1109var VaHeaderContainerComponent = /** @class */ (function () {
1110 function VaHeaderContainerComponent(translateService) {
1111 this.translateService = translateService;
1112 this.loaded = true;
1113 this.showEnableAddon = false;
1114 this.prerequisiteSelected = new EventEmitter();
1115 this.actionSelected = new EventEmitter();
1116 this.primaryPricingActionSelected = new EventEmitter();
1117 this.pricingActionSelected = new EventEmitter();
1118 this.translateService.setTranslation('en', En.en, true);
1119 this.translateService.setTranslation('cs', Cs.cs, true);
1120 }
1121 /**
1122 * @return {?}
1123 */
1124 VaHeaderContainerComponent.prototype.onActionSelected = /**
1125 * @return {?}
1126 */
1127 function () {
1128 this.actionSelected.emit();
1129 };
1130 /**
1131 * @return {?}
1132 */
1133 VaHeaderContainerComponent.prototype.onPrerequisiteSelected = /**
1134 * @return {?}
1135 */
1136 function () {
1137 this.prerequisiteSelected.emit();
1138 };
1139 /**
1140 * @param {?} billedProduct
1141 * @return {?}
1142 */
1143 VaHeaderContainerComponent.prototype.showPricingModel = /**
1144 * @param {?} billedProduct
1145 * @return {?}
1146 */
1147 function (billedProduct) {
1148 return billedProduct && [BillingModel.Tiered, BillingModel.Stairstep].includes(billedProduct.billingModel);
1149 };
1150 /**
1151 * @param {?} billingModel
1152 * @return {?}
1153 */
1154 VaHeaderContainerComponent.prototype.getPricingModelTooltips = /**
1155 * @param {?} billingModel
1156 * @return {?}
1157 */
1158 function (billingModel) {
1159 switch (billingModel) {
1160 case BillingModel.Stairstep:
1161 return this.translateService.stream('FRONTEND.STORE.PRICE_APPLIES_PER_UNIT');
1162 case BillingModel.Tiered:
1163 return this.translateService.stream('FRONTEND.STORE.PRICE_APPLIES_TO_ALL_UNITS');
1164 default:
1165 return of('');
1166 }
1167 };
1168 VaHeaderContainerComponent.decorators = [
1169 { type: Component, args: [{
1170 selector: 'va-header-container',
1171 template: "<div class=\"header-container\">\n <div class=\"product-overview\">\n <div class=\"product-id\">\n\n <va-icon [iconUrl]=\"iconUrl\" [name]=\"title\" [diameter]=\"120\"></va-icon>\n\n <div class=\"product-id-text\">\n\n <h1 [ngClass]=\"{'stencil-title stencil-shimmer': !title, 'product-title': title}\">\n {{ title }}\n </h1>\n\n <span [ngClass]=\"{'stencil-tagline stencil-shimmer': !title && !tagline, 'tagline': tagline}\">\n {{ tagline }}\n </span>\n\n <div *ngIf=\"prerequisite\" class=\"prerequisite\">\n <span class=\"requires-text\">{{ 'FRONTEND.STORE.REQUIRES' | translate }}</span>\n <span>{{ prerequisite }}</span>\n </div>\n\n <mat-chip-list>\n <mat-chip *ngFor=\"let chip of chipLabels\">{{ chip }}</mat-chip>\n </mat-chip-list>\n\n </div>\n </div>\n\n <div class=\"pricing\">\n\n <button *ngIf=\"showAction && !showEnableAddon\" mat-raised-button class=\"app-enable-button\" [disabled]=\"!actionEnabled\" (click)=\"onActionSelected()\">\n {{ actionLabel }}\n </button>\n\n <button *ngIf=\"showEnableAddon && !showAction\" mat-raised-button class=\"app-enable-button\" [disabled]=\"!showEnableAddon\" (click)=\"onActionSelected()\">\n {{ actionLabel }}\n </button>\n\n <div *ngIf=\"prerequisiteLabel && !showEnableAddon\" class=\"addon-enable\" (click)=\"onPrerequisiteSelected()\">\n {{ 'FRONTEND.STORE.ENABLED_WITH_PREREQUISITE' | translate: {prerequisite: prerequisiteLabel } }}\n </div>\n\n <div *ngIf=\"showPricing\" class=\"price-box\">\n <div *ngIf=\"pricing?.prices?.length\" class=\"wholesale-price\">{{ pricingLabel }}\n <div *ngIf=\"showPricingModel(billedProduct) && hasVerifiedContract\"\n class=\"pricing-model\"\n [matTooltip]=\"getPricingModelTooltips(billedProduct.billingModel) | async\">({{ billedProduct.billingModel }})\n </div>\n </div>\n <va-pricing [pricing]=\"pricing\"\n [billedProduct]=\"billedProduct\"\n [hasVerifiedContract]=\"hasVerifiedContract\"\n [loaded]=\"loaded\"></va-pricing>\n </div>\n\n <p *ngIf=\"pricingActionEnabled\" class=\"pricing-action-container\">\n <a (click)=\"primaryPricingActionSelected.emit()\">{{ primaryPricingActionLabel }}</a>\n <a (click)=\"pricingActionSelected.emit()\">{{ pricingActionLabel }}</a>\n </p>\n\n </div>\n\n </div>\n</div>\n",
1172 styles: [":host{font-size:16px}.product-title{font-size:24px}.product-overview{display:-webkit-box;display:flex;flex-wrap:wrap;border-bottom:1px solid #e0e0e0}.product-overview h1{margin:0;font-weight:400;line-height:1.2}.product-overview mat-chip{margin-bottom:3px}.product-id{display:-webkit-box;display:flex;width:100%;padding:24px;-webkit-box-flex:1;flex-grow:1}.product-id va-icon{margin-right:20px}@media screen and (max-width:600px){.product-id va-icon ::ng-deep .va-icon-container{width:40px!important;height:40px!important}.product-id va-icon ::ng-deep .va-icon-container span{line-height:40px!important;font-size:15px!important}}.product-id .product-id-text{display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;-webkit-box-pack:center;justify-content:center}.product-id span{overflow:hidden}.product-id .tagline{color:#616161;margin:.5em 0 1em;font-size:16px}@media screen and (min-width:600px){.product-title{font-size:32px}.product-id .tagline{font-size:20px}.product-id{width:66%;padding-right:20px}}.product-id .prerequisite{margin:.5em 0 1em;font-size:14px}.product-id .requires-text{color:#9e9e9e}.inline-link{display:-webkit-inline-box!important;display:inline-flex!important;color:#1e88e5;cursor:pointer;padding-top:5px}.pricing{display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;width:100%;padding:0 24px 24px;color:#616161}@media screen and (min-width:600px){.pricing{width:34%;padding-top:24px;padding-left:20px}}.pricing span{display:block}.pricing span:nth-child(2){margin:.5em 0 1em}.pricing .price{font-size:24px;font-weight:700;line-height:1;color:#4caf50}.pricing .price-box{padding-top:10px}.pricing .pricing-action-container{display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;margin:8px 0}.pricing .pricing-action-container mat-icon{vertical-align:middle;margin-right:6px}.pricing .pricing-action-container a{cursor:pointer;margin:5px 0}.pricing .pricing-model{display:inline-block;font-size:.8rem;color:#9e9e9e;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.app-enable-button{height:inherit;color:#fff;background-color:#4caf50;font-size:20px;padding:14px 16px;line-height:1}.addon-enable{height:inherit;background-color:#e0e0e0;font-size:14px;padding:14px 16px;line-height:1;color:#1e88e5;cursor:pointer;text-align:center}.wholesale-price{margin-top:0;padding-bottom:8px;margin-bottom:4px;border-bottom:1px solid #e0e0e0}.stencil-title{height:32px;width:200px;margin-bottom:5px!important}.stencil-tagline{height:32px;width:250px}"]
1173 }] }
1174 ];
1175 /** @nocollapse */
1176 VaHeaderContainerComponent.ctorParameters = function () { return [
1177 { type: TranslateService }
1178 ]; };
1179 VaHeaderContainerComponent.propDecorators = {
1180 iconUrl: [{ type: Input }],
1181 title: [{ type: Input }],
1182 tagline: [{ type: Input }],
1183 prerequisite: [{ type: Input }],
1184 chipLabels: [{ type: Input }],
1185 pricing: [{ type: Input }],
1186 billedProduct: [{ type: Input }],
1187 loaded: [{ type: Input }],
1188 hasVerifiedContract: [{ type: Input }],
1189 pricingLabel: [{ type: Input }],
1190 primaryPricingActionLabel: [{ type: Input }],
1191 pricingActionLabel: [{ type: Input }],
1192 pricingActionEnabled: [{ type: Input }],
1193 actionEnabled: [{ type: Input }],
1194 actionLabel: [{ type: Input }],
1195 showAction: [{ type: Input }],
1196 showPricing: [{ type: Input }],
1197 showEnableAddon: [{ type: Input }],
1198 prerequisiteLabel: [{ type: Input }],
1199 prerequisiteSelected: [{ type: Output }],
1200 actionSelected: [{ type: Output }],
1201 primaryPricingActionSelected: [{ type: Output }],
1202 pricingActionSelected: [{ type: Output }]
1203 };
1204 return VaHeaderContainerComponent;
1205}());
1206if (false) {
1207 /** @type {?} */
1208 VaHeaderContainerComponent.prototype.iconUrl;
1209 /** @type {?} */
1210 VaHeaderContainerComponent.prototype.title;
1211 /** @type {?} */
1212 VaHeaderContainerComponent.prototype.tagline;
1213 /** @type {?} */
1214 VaHeaderContainerComponent.prototype.prerequisite;
1215 /** @type {?} */
1216 VaHeaderContainerComponent.prototype.chipLabels;
1217 /** @type {?} */
1218 VaHeaderContainerComponent.prototype.pricing;
1219 /** @type {?} */
1220 VaHeaderContainerComponent.prototype.billedProduct;
1221 /** @type {?} */
1222 VaHeaderContainerComponent.prototype.loaded;
1223 /** @type {?} */
1224 VaHeaderContainerComponent.prototype.hasVerifiedContract;
1225 /** @type {?} */
1226 VaHeaderContainerComponent.prototype.pricingLabel;
1227 /** @type {?} */
1228 VaHeaderContainerComponent.prototype.primaryPricingActionLabel;
1229 /** @type {?} */
1230 VaHeaderContainerComponent.prototype.pricingActionLabel;
1231 /** @type {?} */
1232 VaHeaderContainerComponent.prototype.pricingActionEnabled;
1233 /** @type {?} */
1234 VaHeaderContainerComponent.prototype.actionEnabled;
1235 /** @type {?} */
1236 VaHeaderContainerComponent.prototype.actionLabel;
1237 /** @type {?} */
1238 VaHeaderContainerComponent.prototype.showAction;
1239 /** @type {?} */
1240 VaHeaderContainerComponent.prototype.showPricing;
1241 /** @type {?} */
1242 VaHeaderContainerComponent.prototype.showEnableAddon;
1243 /** @type {?} */
1244 VaHeaderContainerComponent.prototype.prerequisiteLabel;
1245 /** @type {?} */
1246 VaHeaderContainerComponent.prototype.prerequisiteSelected;
1247 /** @type {?} */
1248 VaHeaderContainerComponent.prototype.actionSelected;
1249 /** @type {?} */
1250 VaHeaderContainerComponent.prototype.primaryPricingActionSelected;
1251 /** @type {?} */
1252 VaHeaderContainerComponent.prototype.pricingActionSelected;
1253 /**
1254 * @type {?}
1255 * @private
1256 */
1257 VaHeaderContainerComponent.prototype.translateService;
1258}
1259
1260/**
1261 * @fileoverview added by tsickle
1262 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1263 */
1264var VaHeaderContainerModule = /** @class */ (function () {
1265 function VaHeaderContainerModule() {
1266 }
1267 VaHeaderContainerModule.decorators = [
1268 { type: NgModule, args: [{
1269 imports: [
1270 CommonModule,
1271 MatIconModule,
1272 VaPricingModule,
1273 VaIconModule,
1274 MatChipsModule,
1275 MatButtonModule,
1276 MatTooltipModule,
1277 TranslateModule
1278 ],
1279 declarations: [VaHeaderContainerComponent],
1280 exports: [VaHeaderContainerComponent]
1281 },] }
1282 ];
1283 return VaHeaderContainerModule;
1284}());
1285
1286/**
1287 * @fileoverview added by tsickle
1288 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1289 */
1290var OrderFormSectionData = /** @class */ (function () {
1291 function OrderFormSectionData() {
1292 }
1293 return OrderFormSectionData;
1294}());
1295if (false) {
1296 /** @type {?} */
1297 OrderFormSectionData.prototype.parentForm;
1298 /** @type {?} */
1299 OrderFormSectionData.prototype.titleText;
1300 /** @type {?} */
1301 OrderFormSectionData.prototype.subtitleText;
1302 /** @type {?} */
1303 OrderFormSectionData.prototype.descriptionText;
1304 /** @type {?} */
1305 OrderFormSectionData.prototype.iconUrl;
1306 /** @type {?} */
1307 OrderFormSectionData.prototype.primarySection;
1308 /** @type {?} */
1309 OrderFormSectionData.prototype.subsections;
1310}
1311
1312/**
1313 * @fileoverview added by tsickle
1314 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1315 */
1316var OrderFormSectionComponent = /** @class */ (function () {
1317 function OrderFormSectionComponent() {
1318 }
1319 /**
1320 * @return {?}
1321 */
1322 OrderFormSectionComponent.prototype.ngOnInit = /**
1323 * @return {?}
1324 */
1325 function () {
1326 // The first section should always be expanded.
1327 /** @type {?} */
1328 var topSection = this.getTopSection();
1329 if (topSection) {
1330 topSection.startOpen = true;
1331 }
1332 };
1333 /**
1334 * @return {?}
1335 */
1336 OrderFormSectionComponent.prototype.getTopSection = /**
1337 * @return {?}
1338 */
1339 function () {
1340 if (!this.data) {
1341 return null;
1342 }
1343 if (this.data.primarySection) {
1344 return this.data.primarySection;
1345 }
1346 if (this.data.subsections && this.data.subsections.length > 0) {
1347 return this.data.subsections[0];
1348 }
1349 return null;
1350 };
1351 OrderFormSectionComponent.decorators = [
1352 { type: Component, args: [{
1353 selector: 'va-order-form-section',
1354 template: "<div>\n <mat-card class=\"va-order-form-section-header mat-card\">\n <div class=\"product-overview\">\n <div class=\"product-id\">\n <va-icon [iconUrl]=\"data.iconUrl\" [name]=\"data.titleText\" [diameter]=\"45\"></va-icon>\n <div class=\"product-id-text\">\n <h1 class=\"product-title\">{{ data.titleText }}</h1>\n <span *ngIf=\"data.subtitleText\" class=\"tagline\">{{ data.subtitleText }}</span>\n </div>\n </div>\n <div class=\"description\" *ngIf=\"data.descriptionText\">\n <span>{{ data.descriptionText }}</span>\n </div>\n </div>\n </mat-card>\n <va-dropdown-form-section class=\"va-primary-form-section\" *ngIf=\"data.primarySection\"\n [titleText]=\"data.primarySection.titleText\"\n [editingHint]=\"data.primarySection.editingHint\"\n [displayAutoDescription]=\"data.primarySection.displayAutoDescription\"\n [descriptionText]=\"data.primarySection.descriptionText\"\n [displayAutoTitle]=\"data.primarySection.displayAutoTitle\"\n [prepopulatedData]=\"data.primarySection.prepopulatedData\"\n [parentForm]=\"data.parentForm\"\n [fields]=\"data.primarySection.fields\"\n [startOpen]=\"data.primarySection.startOpen\"\n [expandable]=\"data.primarySection.expandable\">\n </va-dropdown-form-section>\n <ng-container *ngIf=\"data.subsections?.length > 0\">\n <va-dropdown-form-section class=\"va-secondary-form-section\" *ngFor=\"let addon of data.subsections\"\n [titleText]=\"addon.titleText\"\n [editingHint]=\"addon.editingHint\"\n [displayAutoDescription]=\"addon.displayAutoDescription\"\n [descriptionText]=\"addon.descriptionText\"\n [displayAutoTitle]=\"addon.displayAutoTitle\"\n [prepopulatedData]=\"addon.prepopulatedData\"\n [parentForm]=\"data.parentForm\"\n [fields]=\"addon.fields\"\n [startOpen]=\"addon.startOpen\"\n [expandable]=\"addon.expandable\">\n </va-dropdown-form-section>\n </ng-container>\n <ng-container *ngIf=\"!data.primarySection && !(data.subsections?.length > 0)\">\n <mat-card class=\"not-expandable-card\">\n <ng-content></ng-content>\n </mat-card>\n </ng-container>\n</div>\n",
1355 styles: [":host{font-size:16px}mat-card.va-order-form-section-header{margin-bottom:0;border-bottom-color:#e0e0e0;border-bottom-width:1px;box-shadow:0 0 1px -2px rgba(0,0,0,.2),0 0 2px 0 rgba(0,0,0,.14),0 0 5px 0 rgba(0,0,0,.12)}.product-title{font-size:16px}va-mat-card{margin-bottom:24px}.product-overview{display:-webkit-box;display:flex;flex-wrap:wrap}.product-overview h1{margin:0;font-weight:700}.product-id{display:-webkit-box;display:flex;width:100%;-webkit-box-flex:1;flex-grow:1}.product-id va-icon{margin-right:20px}@media screen and (max-width:600px){.product-id va-icon ::ng-deep .va-icon-container{width:40px!important;height:40px!important}}.product-id .product-id-text{display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;-webkit-box-pack:center;justify-content:center}.product-id span{display:block;overflow:hidden}.product-id .tagline{color:#616161;margin-top:8px;font-size:16px}@media screen and (min-width:600px){.product-id{width:66%;padding-right:16px}}.description{padding-top:16px;width:100%;color:#616161}"]
1356 }] }
1357 ];
1358 /** @nocollapse */
1359 OrderFormSectionComponent.ctorParameters = function () { return []; };
1360 OrderFormSectionComponent.propDecorators = {
1361 data: [{ type: Input }]
1362 };
1363 return OrderFormSectionComponent;
1364}());
1365if (false) {
1366 /** @type {?} */
1367 OrderFormSectionComponent.prototype.data;
1368}
1369
1370/**
1371 * @fileoverview added by tsickle
1372 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1373 */
1374var DropDownFormSectionData = /** @class */ (function () {
1375 function DropDownFormSectionData() {
1376 /* tslint:disable */
1377 this.expandable = true;
1378 /* tslint:enable */
1379 }
1380 return DropDownFormSectionData;
1381}());
1382if (false) {
1383 /** @type {?} */
1384 DropDownFormSectionData.prototype.prepopulatedData;
1385 /** @type {?} */
1386 DropDownFormSectionData.prototype.startOpen;
1387 /** @type {?} */
1388 DropDownFormSectionData.prototype.parentForm;
1389 /** @type {?} */
1390 DropDownFormSectionData.prototype.displayAutoTitle;
1391 /** @type {?} */
1392 DropDownFormSectionData.prototype.titleText;
1393 /** @type {?} */
1394 DropDownFormSectionData.prototype.displayAutoDescription;
1395 /** @type {?} */
1396 DropDownFormSectionData.prototype.descriptionText;
1397 /** @type {?} */
1398 DropDownFormSectionData.prototype.fields;
1399 /** @type {?} */
1400 DropDownFormSectionData.prototype.editingHint;
1401 /** @type {?} */
1402 DropDownFormSectionData.prototype.expandable;
1403}
1404
1405/**
1406 * @fileoverview added by tsickle
1407 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1408 */
1409/**
1410 * @record
1411 */
1412function OrderLabelsInterface() { }
1413if (false) {
1414 /** @type {?} */
1415 OrderLabelsInterface.prototype.commonForm;
1416}
1417/**
1418 * @record
1419 */
1420function OrderFormInterface() { }
1421if (false) {
1422 /** @type {?} */
1423 OrderFormInterface.prototype.appId;
1424 /** @type {?|undefined} */
1425 OrderFormInterface.prototype.addonId;
1426 /** @type {?|undefined} */
1427 OrderFormInterface.prototype.commonForm;
1428 /** @type {?|undefined} */
1429 OrderFormInterface.prototype.commonFormRequiredFields;
1430 /** @type {?|undefined} */
1431 OrderFormInterface.prototype.customFields;
1432}
1433/**
1434 * @record
1435 */
1436function IncludedCommonFormFieldsInterface() { }
1437if (false) {
1438 /** @type {?|undefined} */
1439 IncludedCommonFormFieldsInterface.prototype.businessName;
1440 /** @type {?|undefined} */
1441 IncludedCommonFormFieldsInterface.prototype.businessAddress;
1442 /** @type {?|undefined} */
1443 IncludedCommonFormFieldsInterface.prototype.businessPhoneNumber;
1444 /** @type {?|undefined} */
1445 IncludedCommonFormFieldsInterface.prototype.businessAccountGroupId;
1446 /** @type {?|undefined} */
1447 IncludedCommonFormFieldsInterface.prototype.businessWebsite;
1448 /** @type {?|undefined} */
1449 IncludedCommonFormFieldsInterface.prototype.salespersonName;
1450 /** @type {?|undefined} */
1451 IncludedCommonFormFieldsInterface.prototype.salespersonPhoneNumber;
1452 /** @type {?|undefined} */
1453 IncludedCommonFormFieldsInterface.prototype.salespersonEmail;
1454 /** @type {?|undefined} */
1455 IncludedCommonFormFieldsInterface.prototype.contactName;
1456 /** @type {?|undefined} */
1457 IncludedCommonFormFieldsInterface.prototype.contactPhoneNumber;
1458 /** @type {?|undefined} */
1459 IncludedCommonFormFieldsInterface.prototype.contactEmail;
1460}
1461/**
1462 * @record
1463 */
1464function CommonFormSectionInterface() { }
1465if (false) {
1466 /** @type {?} */
1467 CommonFormSectionInterface.prototype.fields;
1468 /** @type {?|undefined} */
1469 CommonFormSectionInterface.prototype.sectionName;
1470 /** @type {?|undefined} */
1471 CommonFormSectionInterface.prototype.populatedData;
1472}
1473/**
1474 * @record
1475 */
1476function AddonKeyInterface() { }
1477if (false) {
1478 /** @type {?|undefined} */
1479 AddonKeyInterface.prototype.addonId;
1480 /** @type {?|undefined} */
1481 AddonKeyInterface.prototype.appId;
1482}
1483/**
1484 * @record
1485 */
1486function CommonFormFieldInterface() { }
1487if (false) {
1488 /** @type {?|undefined} */
1489 CommonFormFieldInterface.prototype.productIds;
1490 /** @type {?|undefined} */
1491 CommonFormFieldInterface.prototype.addonKeys;
1492}
1493/**
1494 * @record
1495 */
1496function CommonFieldIdsInterface() { }
1497if (false) {
1498 /** @type {?} */
1499 CommonFieldIdsInterface.prototype.fieldId;
1500 /** @type {?} */
1501 CommonFieldIdsInterface.prototype.required;
1502}
1503/**
1504 * @record
1505 */
1506function CommonFormData() { }
1507if (false) {
1508 /** @type {?|undefined} */
1509 CommonFormData.prototype.contact_email;
1510 /** @type {?|undefined} */
1511 CommonFormData.prototype.contact_name;
1512 /** @type {?|undefined} */
1513 CommonFormData.prototype.contact_phone_number;
1514 /** @type {?|undefined} */
1515 CommonFormData.prototype.business_account_group_id;
1516 /** @type {?|undefined} */
1517 CommonFormData.prototype.business_name;
1518 /** @type {?|undefined} */
1519 CommonFormData.prototype.business_address;
1520 /** @type {?|undefined} */
1521 CommonFormData.prototype.business_phone_number;
1522 /** @type {?|undefined} */
1523 CommonFormData.prototype.business_website;
1524 /** @type {?|undefined} */
1525 CommonFormData.prototype.salesperson_name;
1526 /** @type {?|undefined} */
1527 CommonFormData.prototype.salesperson_email;
1528 /** @type {?|undefined} */
1529 CommonFormData.prototype.salesperson_phone_number;
1530}
1531var ProductOrderFormSectionData = /** @class */ (function (_super) {
1532 __extends(ProductOrderFormSectionData, _super);
1533 function ProductOrderFormSectionData() {
1534 return _super !== null && _super.apply(this, arguments) || this;
1535 }
1536 return ProductOrderFormSectionData;
1537}(OrderFormSectionData));
1538if (false) {
1539 /** @type {?} */
1540 ProductOrderFormSectionData.prototype.productId;
1541 /** @type {?} */
1542 ProductOrderFormSectionData.prototype.subsections;
1543}
1544var AddonDropDownFormSectionData = /** @class */ (function (_super) {
1545 __extends(AddonDropDownFormSectionData, _super);
1546 function AddonDropDownFormSectionData() {
1547 return _super !== null && _super.apply(this, arguments) || this;
1548 }
1549 return AddonDropDownFormSectionData;
1550}(DropDownFormSectionData));
1551if (false) {
1552 /** @type {?} */
1553 AddonDropDownFormSectionData.prototype.productId;
1554 /** @type {?} */
1555 AddonDropDownFormSectionData.prototype.addonId;
1556}
1557/**
1558 * @record
1559 */
1560function ProductInfoInterface() { }
1561if (false) {
1562 /** @type {?} */
1563 ProductInfoInterface.prototype.productId;
1564 /** @type {?|undefined} */
1565 ProductInfoInterface.prototype.name;
1566 /** @type {?|undefined} */
1567 ProductInfoInterface.prototype.tagline;
1568 /** @type {?|undefined} */
1569 ProductInfoInterface.prototype.icon;
1570 /** @type {?|undefined} */
1571 ProductInfoInterface.prototype.addonInfo;
1572}
1573/**
1574 * @record
1575 */
1576function AddonInfoInterface() { }
1577if (false) {
1578 /** @type {?} */
1579 AddonInfoInterface.prototype.addonId;
1580 /** @type {?|undefined} */
1581 AddonInfoInterface.prototype.name;
1582}
1583/**
1584 * @record
1585 */
1586function CustomFieldsAnswers() { }
1587if (false) {
1588 /** @type {?} */
1589 CustomFieldsAnswers.prototype.productID;
1590 /** @type {?|undefined} */
1591 CustomFieldsAnswers.prototype.addonKey;
1592 /** @type {?} */
1593 CustomFieldsAnswers.prototype.customFieldsAnswers;
1594}
1595/**
1596 * @record
1597 */
1598function CustomFieldsAnswer() { }
1599if (false) {
1600 /** @type {?} */
1601 CustomFieldsAnswer.prototype.fieldId;
1602 /** @type {?|undefined} */
1603 CustomFieldsAnswer.prototype.answer;
1604}
1605/**
1606 * @record
1607 */
1608function OrderFormOptionsInterface() { }
1609if (false) {
1610 /** @type {?|undefined} */
1611 OrderFormOptionsInterface.prototype.bypassRequiredQuestions;
1612 /** @type {?|undefined} */
1613 OrderFormOptionsInterface.prototype.readOnly;
1614 /** @type {?|undefined} */
1615 OrderFormOptionsInterface.prototype.showOfficeUseQuestions;
1616}
1617
1618/**
1619 * @fileoverview added by tsickle
1620 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1621 */
1622var OrderFormService = /** @class */ (function () {
1623 function OrderFormService() {
1624 }
1625 /**
1626 * @private
1627 * @param {?} orderForm
1628 * @return {?}
1629 */
1630 OrderFormService.extractRequiredCommonFieldIds = /**
1631 * @private
1632 * @param {?} orderForm
1633 * @return {?}
1634 */
1635 function (orderForm) {
1636 if (!orderForm || !orderForm.commonFormRequiredFields) {
1637 return [];
1638 }
1639 return Object.keys(orderForm.commonFormRequiredFields).filter((/**
1640 * @param {?} k
1641 * @return {?}
1642 */
1643 function (k) { return orderForm.commonFormRequiredFields[k]; }));
1644 };
1645 /**
1646 * @private
1647 * @param {?} orderForms
1648 * @return {?}
1649 */
1650 OrderFormService.buildCommonFieldIds = /**
1651 * @private
1652 * @param {?} orderForms
1653 * @return {?}
1654 */
1655 function (orderForms) {
1656 var _this = this;
1657 /** @type {?} */
1658 var commonFieldIdsMap = new Map();
1659 for (var key in OrderFormService.camelToSnakeCaseMap) {
1660 if (key) {
1661 commonFieldIdsMap.set(key, {
1662 fieldId: key,
1663 required: false,
1664 });
1665 }
1666 }
1667 orderForms.map((/**
1668 * @param {?} orderForm
1669 * @return {?}
1670 */
1671 function (orderForm) {
1672 /** @type {?} */
1673 var requiredCommonFieldIds = _this.extractRequiredCommonFieldIds(orderForm);
1674 requiredCommonFieldIds.map((/**
1675 * @param {?} fieldId
1676 * @return {?}
1677 */
1678 function (fieldId) {
1679 /** @type {?} */
1680 var commonFieldId = commonFieldIdsMap.get(fieldId);
1681 commonFieldId.required = true;
1682 commonFieldIdsMap.set(fieldId, commonFieldId);
1683 }));
1684 }));
1685 return Array.from(commonFieldIdsMap.values());
1686 };
1687 /**
1688 * @private
1689 * @param {?} fieldIds
1690 * @param {?} commonData
1691 * @param {?} labels
1692 * @param {?} options
1693 * @return {?}
1694 */
1695 OrderFormService.fillCommonFormSections = /**
1696 * @private
1697 * @param {?} fieldIds
1698 * @param {?} commonData
1699 * @param {?} labels
1700 * @param {?} options
1701 * @return {?}
1702 */
1703 function (fieldIds, commonData, labels, options) {
1704 /** @type {?} */
1705 var commonFormSections = OrderFormService.buildCommonOrderFormFields(fieldIds, labels, options);
1706 return commonFormSections.map((/**
1707 * @param {?} section
1708 * @return {?}
1709 */
1710 function (section) { return (__assign({}, section, { populatedData: commonData })); }));
1711 };
1712 /**
1713 * @private
1714 * @param {?} fieldIds
1715 * @param {?} labels
1716 * @param {?} options
1717 * @return {?}
1718 */
1719 OrderFormService.buildCommonOrderFormFields = /**
1720 * @private
1721 * @param {?} fieldIds
1722 * @param {?} labels
1723 * @param {?} options
1724 * @return {?}
1725 */
1726 function (fieldIds, labels, options) {
1727 var e_1, _a;
1728 /** @type {?} */
1729 var businessSection = {
1730 sectionName: labels.commonForm.businessSectionTitle || 'Business',
1731 fields: []
1732 };
1733 /** @type {?} */
1734 var salespersonSection = {
1735 sectionName: labels.commonForm.salespersonSectionTitle || 'Salesperson',
1736 fields: []
1737 };
1738 /** @type {?} */
1739 var contactSection = {
1740 sectionName: labels.commonForm.contactSectionTitle || 'Contact',
1741 fields: []
1742 };
1743 try {
1744 for (var fieldIds_1 = __values(fieldIds), fieldIds_1_1 = fieldIds_1.next(); !fieldIds_1_1.done; fieldIds_1_1 = fieldIds_1.next()) {
1745 var field = fieldIds_1_1.value;
1746 /** @type {?} */
1747 var fieldLabel = this.getLabelForFieldId(field.fieldId, labels);
1748 /** @type {?} */
1749 var commonFormField = new TextboxField({
1750 id: OrderFormService.camelToSnakeCaseMap[field.fieldId],
1751 label: fieldLabel,
1752 textboxType: 'text'
1753 });
1754 commonFormField.displayOnly = commonFormField.id === 'business_account_group_id';
1755 commonFormField.disabled = options.readOnly;
1756 if (!options.bypassRequiredQuestions) {
1757 commonFormField.required = field.required;
1758 }
1759 if (field.fieldId.startsWith('contact')) {
1760 contactSection.fields.push(commonFormField);
1761 }
1762 if (field.fieldId.startsWith('business')) {
1763 businessSection.fields.push(commonFormField);
1764 }
1765 if (field.fieldId.startsWith('salesperson')) {
1766 if (!options.showOfficeUseQuestions) {
1767 commonFormField.hidden = true;
1768 }
1769 salespersonSection.fields.push(commonFormField);
1770 }
1771 }
1772 }
1773 catch (e_1_1) { e_1 = { error: e_1_1 }; }
1774 finally {
1775 try {
1776 if (fieldIds_1_1 && !fieldIds_1_1.done && (_a = fieldIds_1.return)) _a.call(fieldIds_1);
1777 }
1778 finally { if (e_1) throw e_1.error; }
1779 }
1780 return [businessSection, contactSection, salespersonSection].filter((/**
1781 * @param {?} section
1782 * @return {?}
1783 */
1784 function (section) {
1785 return section.fields ? section.fields.length > 0 : false;
1786 }));
1787 };
1788 /**
1789 * @private
1790 * @param {?} fieldId
1791 * @param {?} labels
1792 * @return {?}
1793 */
1794 OrderFormService.getLabelForFieldId = /**
1795 * @private
1796 * @param {?} fieldId
1797 * @param {?} labels
1798 * @return {?}
1799 */
1800 function (fieldId, labels) {
1801 return labels.commonForm[fieldId] || '';
1802 };
1803 /**
1804 * @private
1805 * @param {?} parentForm
1806 * @return {?}
1807 */
1808 OrderFormService.buildOrderFormSectionData = /**
1809 * @private
1810 * @param {?} parentForm
1811 * @return {?}
1812 */
1813 function (parentForm) {
1814 /** @type {?} */
1815 var section = new AddonDropDownFormSectionData();
1816 section.displayAutoTitle = true;
1817 section.descriptionText = '';
1818 section.displayAutoDescription = false;
1819 section.parentForm = parentForm;
1820 return section;
1821 };
1822 /**
1823 * @private
1824 * @param {?} customFields
1825 * @param {?} fileUploadUrl
1826 * @param {?} users
1827 * @param {?} answers
1828 * @param {?} options
1829 * @return {?}
1830 */
1831 OrderFormService.buildCustomOrderFormFields = /**
1832 * @private
1833 * @param {?} customFields
1834 * @param {?} fileUploadUrl
1835 * @param {?} users
1836 * @param {?} answers
1837 * @param {?} options
1838 * @return {?}
1839 */
1840 function (customFields, fileUploadUrl, users, answers, options) {
1841 /** @type {?} */
1842 var fieldTypeMap = {
1843 text: TextboxField,
1844 textbox: TextboxField,
1845 dropdown: DropdownField,
1846 checkbox: CheckboxField,
1847 file: FileUploadGroupField,
1848 textarea: TextareaField,
1849 vbcuser: VBCUserField
1850 };
1851 return customFields
1852 .filter((/**
1853 * @param {?} field
1854 * @return {?}
1855 */
1856 function (field) {
1857 return fieldTypeMap[field.type];
1858 }))
1859 .map((/**
1860 * @param {?} field
1861 * @return {?}
1862 */
1863 function (field) {
1864 /** @type {?} */
1865 var fieldClass = fieldTypeMap[field.type];
1866 /** @type {?} */
1867 var result = ((/**
1868 * @return {?}
1869 */
1870 function () {
1871 switch (fieldClass) {
1872 case VBCUserField:
1873 /** @type {?} */
1874 var fieldConfig = (/** @type {?} */ ({
1875 description: field.description,
1876 id: field.id,
1877 required: field.required,
1878 type: field.type,
1879 label: field.label,
1880 forOfficeUseOnly: field.forOfficeUseOnly,
1881 hidden: field.hidden,
1882 users: users // TODO: Get users in this component
1883 }));
1884 return new VBCUserField(fieldConfig);
1885 case FileUploadGroupField:
1886 /** @type {?} */
1887 var uploadField = (/** @type {?} */ (field));
1888 uploadField.uploadUrl = fileUploadUrl;
1889 return new FileUploadGroupField(uploadField);
1890 default:
1891 return new fieldClass(field);
1892 }
1893 }))();
1894 result.id = OrderFormService.encodeCustomFieldId(field.id);
1895 if (!options.showOfficeUseQuestions) {
1896 result.hidden = result.forOfficeUseOnly ? true : result.hidden;
1897 }
1898 result.required = options.bypassRequiredQuestions ? false : result.required;
1899 result.disabled = options.readOnly ? options.readOnly : result.disabled;
1900 if (answers) {
1901 /** @type {?} */
1902 var ca = answers.find((/**
1903 * @param {?} a
1904 * @return {?}
1905 */
1906 function (a) { return a.fieldId === field.id; }));
1907 if (ca) {
1908 try {
1909 result.value = JSON.parse(ca.answer);
1910 }
1911 catch (error) {
1912 result.value = ca.answer;
1913 }
1914 }
1915 }
1916 return result;
1917 }));
1918 };
1919 // Different products can have order form fields with the same fieldID, which will cause problem.
1920 // Please refer to https://github.com/vendasta/business-center-client/pull/1002
1921 // We will prefix the fieldID with uuid, and take it off before we same the order form into session storage
1922 // Different products can have order form fields with the same fieldID, which will cause problem.
1923 // Please refer to https://github.com/vendasta/business-center-client/pull/1002
1924 // We will prefix the fieldID with uuid, and take it off before we same the order form into session storage
1925 /**
1926 * @private
1927 * @param {?} fieldId
1928 * @return {?}
1929 */
1930 OrderFormService.encodeCustomFieldId =
1931 // Different products can have order form fields with the same fieldID, which will cause problem.
1932 // Please refer to https://github.com/vendasta/business-center-client/pull/1002
1933 // We will prefix the fieldID with uuid, and take it off before we same the order form into session storage
1934 /**
1935 * @private
1936 * @param {?} fieldId
1937 * @return {?}
1938 */
1939 function (fieldId) {
1940 /** @type {?} */
1941 var id = uuid();
1942 return id + "#" + fieldId;
1943 };
1944 /**
1945 * @private
1946 * @param {?} fieldId
1947 * @return {?}
1948 */
1949 OrderFormService.decodeCustomFieldId = /**
1950 * @private
1951 * @param {?} fieldId
1952 * @return {?}
1953 */
1954 function (fieldId) {
1955 return fieldId.replace(new RegExp('(.*#)'), '');
1956 };
1957 /**
1958 * @private
1959 * @param {?} fieldType
1960 * @return {?}
1961 */
1962 OrderFormService.mapFieldType = /**
1963 * @private
1964 * @param {?} fieldType
1965 * @return {?}
1966 */
1967 function (fieldType) {
1968 switch (fieldType) {
1969 case 'textbox':
1970 return FieldType.TEXT;
1971 case 'textarea':
1972 return FieldType.TEXTAREA;
1973 case 'checkbox':
1974 return FieldType.CHECKBOX;
1975 case 'dropdown':
1976 return FieldType.DROPDOWN;
1977 case 'file':
1978 return FieldType.FILE;
1979 case 'vbcuser':
1980 return FieldType.VBCUSER;
1981 default:
1982 return FieldType.NOT_SPECIFIED;
1983 }
1984 };
1985 /**
1986 * @private
1987 * @param {?} fieldBase
1988 * @return {?}
1989 */
1990 OrderFormService.orderFieldToSalesOrderField = /**
1991 * @private
1992 * @param {?} fieldBase
1993 * @return {?}
1994 */
1995 function (fieldBase) {
1996 return new Field({
1997 fieldId: OrderFormService.decodeCustomFieldId(fieldBase.id),
1998 fieldType: OrderFormService.mapFieldType(fieldBase.controlType),
1999 label: fieldBase.label,
2000 description: fieldBase.description || '',
2001 prefix: fieldBase.prefix || '',
2002 suffix: fieldBase.suffix || '',
2003 regexValidator: fieldBase.regexValidator || '',
2004 regexErrorMessage: fieldBase.regexErrorMessage || '',
2005 answer: fieldBase.value ? JSON.stringify(fieldBase.value) : 'null'
2006 });
2007 };
2008 /**
2009 * @private
2010 * @param {?} orderFormData
2011 * @return {?}
2012 */
2013 OrderFormService.productOrderFormToCustomFields = /**
2014 * @private
2015 * @param {?} orderFormData
2016 * @return {?}
2017 */
2018 function (orderFormData) {
2019 var _this = this;
2020 /** @type {?} */
2021 var primaryCustomField = new CustomField();
2022 primaryCustomField.productId = orderFormData.productId;
2023 primaryCustomField.fields = orderFormData.primarySection
2024 ? orderFormData.primarySection.fields.map((/**
2025 * @param {?} field
2026 * @return {?}
2027 */
2028 function (field) { return _this.orderFieldToSalesOrderField(field); }))
2029 : [];
2030 /** @type {?} */
2031 var secondaryCustomFields = orderFormData.subsections.map((/**
2032 * @param {?} subsection
2033 * @return {?}
2034 */
2035 function (subsection) {
2036 /** @type {?} */
2037 var customField = new CustomField();
2038 if (subsection.addonId) {
2039 customField.addonKey = new AddonKey({
2040 appId: subsection.productId,
2041 addonId: subsection.addonId
2042 });
2043 }
2044 else {
2045 customField.productId = orderFormData.productId;
2046 }
2047 customField.fields = subsection.fields.map((/**
2048 * @param {?} field
2049 * @return {?}
2050 */
2051 function (field) { return _this.orderFieldToSalesOrderField(field); }));
2052 return customField;
2053 }));
2054 return [].concat(primaryCustomField, secondaryCustomFields);
2055 };
2056 /**
2057 * @param {?} orderForms
2058 * @param {?} commonData
2059 * @param {?} labels
2060 * @param {?} options
2061 * @return {?}
2062 */
2063 OrderFormService.getCommonFormSections = /**
2064 * @param {?} orderForms
2065 * @param {?} commonData
2066 * @param {?} labels
2067 * @param {?} options
2068 * @return {?}
2069 */
2070 function (orderForms, commonData, labels, options) {
2071 /** @type {?} */
2072 var fieldIds = OrderFormService.buildCommonFieldIds(orderForms);
2073 return OrderFormService.fillCommonFormSections(fieldIds, commonData, labels, options);
2074 };
2075 /**
2076 * @param {?} orderForms
2077 * @param {?} products
2078 * @param {?} parentForm
2079 * @param {?} fileUploadUrl
2080 * @param {?} users
2081 * @param {?} answers
2082 * @param {?} options
2083 * @return {?}
2084 */
2085 OrderFormService.getCustomFormSections = /**
2086 * @param {?} orderForms
2087 * @param {?} products
2088 * @param {?} parentForm
2089 * @param {?} fileUploadUrl
2090 * @param {?} users
2091 * @param {?} answers
2092 * @param {?} options
2093 * @return {?}
2094 */
2095 function (orderForms, products, parentForm, fileUploadUrl, users, answers, options) {
2096 /** @type {?} */
2097 var formSections = products.map((/**
2098 * @param {?} product
2099 * @return {?}
2100 */
2101 function (product) {
2102 /** @type {?} */
2103 var subsections = [];
2104 (product.addonInfo || []).map((/**
2105 * @param {?} addon
2106 * @return {?}
2107 */
2108 function (addon) {
2109 /** @type {?} */
2110 var addonOrderForms = orderForms.filter((/**
2111 * @param {?} o
2112 * @return {?}
2113 */
2114 function (o) { return o.addonId === addon.addonId; }));
2115 /** @type {?} */
2116 var addonAnswers = (answers || []).filter((/**
2117 * @param {?} a
2118 * @return {?}
2119 */
2120 function (a) { return a.addonKey &&
2121 a.addonKey.appId === product.productId && a.addonKey.addonId === addon.addonId && a.productID === product.productId; }));
2122 addonOrderForms.map((/**
2123 * @param {?} addonOrderForm
2124 * @param {?} index
2125 * @return {?}
2126 */
2127 function (addonOrderForm, index) {
2128 if (addonOrderForm && addonOrderForm.customFields && addonOrderForm.customFields.length > 0) {
2129 /** @type {?} */
2130 var addonSection = OrderFormService.buildOrderFormSectionData(parentForm);
2131 /** @type {?} */
2132 var addonAnswersForThisSpecificFormIndex = (addonAnswers.length > index) ? addonAnswers[index].customFieldsAnswers : [];
2133 /** @type {?} */
2134 var formFields = OrderFormService.buildCustomOrderFormFields(addonOrderForm.customFields, fileUploadUrl, users, addonAnswersForThisSpecificFormIndex, options);
2135 addonSection.expandable = true;
2136 addonSection.titleText = addon.name;
2137 addonSection.fields = formFields;
2138 addonSection.productId = product.productId;
2139 addonSection.addonId = addon.addonId;
2140 subsections.push(addonSection);
2141 }
2142 }));
2143 }));
2144 /** @type {?} */
2145 var foundOrderForms = orderForms.reduce((/**
2146 * @param {?} orderFormsFound
2147 * @param {?} o
2148 * @return {?}
2149 */
2150 function (orderFormsFound, o) {
2151 if (o.appId === product.productId && !o.addonId) {
2152 orderFormsFound.push(o);
2153 }
2154 return orderFormsFound;
2155 }), []);
2156 var _a = __read(foundOrderForms), primaryOrder = _a[0], otherOrdersForSameProduct = _a.slice(1);
2157 /** @type {?} */
2158 var productHasOrderForm = primaryOrder && primaryOrder.customFields && primaryOrder.customFields.length > 0;
2159 if (subsections.length > 0 || productHasOrderForm) {
2160 /** @type {?} */
2161 var sectionData = new ProductOrderFormSectionData();
2162 sectionData.productId = product.productId;
2163 sectionData.parentForm = parentForm;
2164 sectionData.titleText = product.name;
2165 sectionData.subtitleText = product.tagline;
2166 sectionData.descriptionText = ''; // TODO: build the description string to show which common data this form uses
2167 sectionData.iconUrl = product.icon;
2168 if (productHasOrderForm) {
2169 /** @type {?} */
2170 var section_1 = OrderFormService.buildOrderFormSectionData(parentForm);
2171 section_1.titleText = product.name;
2172 /** @type {?} */
2173 var productAnswers = [];
2174 if (answers) {
2175 productAnswers = answers.filter((/**
2176 * @param {?} a
2177 * @return {?}
2178 */
2179 function (a) { return !a.addonKey && a.productID === product.productId; }));
2180 }
2181 var _b = __read(productAnswers), firstProductAnswers = _b[0], otherProductAnswers_1 = _b.slice(1);
2182 section_1.fields = OrderFormService.buildCustomOrderFormFields(primaryOrder.customFields, fileUploadUrl, users, firstProductAnswers ? firstProductAnswers.customFieldsAnswers : [], options);
2183 sectionData.primarySection = section_1;
2184 otherOrdersForSameProduct.forEach((/**
2185 * @param {?} _
2186 * @param {?} index
2187 * @return {?}
2188 */
2189 function (_, index) {
2190 /**
2191 * Clone the same section to avoid child component from modifying all as if these are all the top section.
2192 * All sections need to be re-created or else they will have the same id and send repeated data as well.
2193 * @type {?}
2194 */
2195 var dupeSection = __assign({}, section_1);
2196 /** @type {?} */
2197 var answersForSpecificForm = (otherProductAnswers_1.length > index) ? otherProductAnswers_1[index].customFieldsAnswers : [];
2198 dupeSection.fields = OrderFormService.buildCustomOrderFormFields(primaryOrder.customFields, fileUploadUrl, users, answersForSpecificForm, options);
2199 subsections.unshift(dupeSection);
2200 }));
2201 }
2202 sectionData.subsections = subsections;
2203 return sectionData;
2204 }
2205 return null;
2206 })).filter((/**
2207 * @param {?} s
2208 * @return {?}
2209 */
2210 function (s) { return !!s; }));
2211 return formSections;
2212 };
2213 /**
2214 * @param {?} extraFields
2215 * @param {?} parentForm
2216 * @param {?} fileUploadUrl
2217 * @param {?} users
2218 * @param {?} answers
2219 * @param {?} options
2220 * @return {?}
2221 */
2222 OrderFormService.getExtraFieldsSection = /**
2223 * @param {?} extraFields
2224 * @param {?} parentForm
2225 * @param {?} fileUploadUrl
2226 * @param {?} users
2227 * @param {?} answers
2228 * @param {?} options
2229 * @return {?}
2230 */
2231 function (extraFields, parentForm, fileUploadUrl, users, answers, options) {
2232 if (!extraFields || extraFields.length < 1) {
2233 return null;
2234 }
2235 /** @type {?} */
2236 var section = OrderFormService.buildOrderFormSectionData(parentForm);
2237 section.fields = OrderFormService.buildCustomOrderFormFields(extraFields, fileUploadUrl, users, answers, options);
2238 return section;
2239 };
2240 /**
2241 * @param {?} customFormSections
2242 * @return {?}
2243 */
2244 OrderFormService.getCustomFieldsData = /**
2245 * @param {?} customFormSections
2246 * @return {?}
2247 */
2248 function (customFormSections) {
2249 /** @type {?} */
2250 var customFormData = customFormSections.reduce((/**
2251 * @param {?} acc
2252 * @param {?} orderFormData
2253 * @return {?}
2254 */
2255 function (acc, orderFormData) {
2256 acc = acc.concat(OrderFormService.productOrderFormToCustomFields(orderFormData));
2257 return acc;
2258 }), []);
2259 return customFormData;
2260 };
2261 /**
2262 * @param {?} commonFormSections
2263 * @return {?}
2264 */
2265 OrderFormService.getCommonFieldsData = /**
2266 * @param {?} commonFormSections
2267 * @return {?}
2268 */
2269 function (commonFormSections) {
2270 /** @type {?} */
2271 var commonFields = [];
2272 if (commonFormSections) {
2273 commonFields = commonFormSections.reduce((/**
2274 * @param {?} acc
2275 * @param {?} group
2276 * @return {?}
2277 */
2278 function (acc, group) {
2279 /** @type {?} */
2280 var fields = group.fields.map((/**
2281 * @param {?} singleField
2282 * @return {?}
2283 */
2284 function (singleField) {
2285 /** @type {?} */
2286 var field = OrderFormService.orderFieldToSalesOrderField(singleField);
2287 if (field.fieldId) {
2288 return new CommonField({
2289 field: field,
2290 productIds: singleField.productIds,
2291 addonKeys: singleField.addonKeys
2292 });
2293 }
2294 }));
2295 return acc.concat(fields);
2296 }), []);
2297 }
2298 return commonFields;
2299 };
2300 /**
2301 * @param {?} extraFieldsSection
2302 * @return {?}
2303 */
2304 OrderFormService.getExtraFieldsData = /**
2305 * @param {?} extraFieldsSection
2306 * @return {?}
2307 */
2308 function (extraFieldsSection) {
2309 /** @type {?} */
2310 var extraFieldsData = [];
2311 if (!!extraFieldsSection) {
2312 extraFieldsData = extraFieldsSection.fields.map((/**
2313 * @param {?} field
2314 * @return {?}
2315 */
2316 function (field) { return OrderFormService.orderFieldToSalesOrderField(field); }));
2317 }
2318 return extraFieldsData;
2319 };
2320 OrderFormService.camelToSnakeCaseMap = {
2321 'contactName': 'contact_name',
2322 'contactEmail': 'contact_email',
2323 'contactPhoneNumber': 'contact_phone_number',
2324 'businessAccountGroupId': 'business_account_group_id',
2325 'businessName': 'business_name',
2326 'businessAddress': 'business_address',
2327 'businessPhoneNumber': 'business_phone_number',
2328 'businessWebsite': 'business_website',
2329 'salespersonName': 'salesperson_name',
2330 'salespersonEmail': 'salesperson_email',
2331 'salespersonPhoneNumber': 'salesperson_phone_number'
2332 };
2333 OrderFormService.decorators = [
2334 { type: Injectable }
2335 ];
2336 /** @nocollapse */
2337 OrderFormService.ctorParameters = function () { return []; };
2338 return OrderFormService;
2339}());
2340if (false) {
2341 /** @type {?} */
2342 OrderFormService.camelToSnakeCaseMap;
2343}
2344
2345/**
2346 * @fileoverview added by tsickle
2347 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2348 */
2349var OrderFormComponent = /** @class */ (function () {
2350 function OrderFormComponent(translateService) {
2351 this.translateService = translateService;
2352 this.dropdownOpen$$ = new BehaviorSubject(false);
2353 this.dropdownOpen$ = this.dropdownOpen$$.asObservable();
2354 this.translateService.setTranslation('en', En.en, true);
2355 this.translateService.setTranslation('cs', Cs.cs, true);
2356 }
2357 /**
2358 * @return {?}
2359 */
2360 OrderFormComponent.prototype.ngOnInit = /**
2361 * @return {?}
2362 */
2363 function () {
2364 /** @type {?} */
2365 var options = new OrderFormOptions(this.orderFormOptions || {});
2366 this.commonFormSections = OrderFormService.getCommonFormSections(this.orderForms, this.commonData, this.labels, options);
2367 this.customFormSections = OrderFormService.getCustomFormSections(this.orderForms, this.productInfo, this.parentForm, this.fileUploadUrl, this.users, this.answers, options);
2368 // TODO: Handle MyCorporation OrderForm (handled in a separate component right now)
2369 this.extraFieldsSection = OrderFormService.getExtraFieldsSection(this.extraFields, this.parentForm, this.fileUploadUrl, this.users, this.extraFieldsAnswers, options);
2370 };
2371 /**
2372 * returns the data from common form fields in a format that is usable by sales orders
2373 */
2374 /**
2375 * returns the data from common form fields in a format that is usable by sales orders
2376 * @return {?}
2377 */
2378 OrderFormComponent.prototype.getCommonFormData = /**
2379 * returns the data from common form fields in a format that is usable by sales orders
2380 * @return {?}
2381 */
2382 function () {
2383 return OrderFormService.getCommonFieldsData(this.commonFormSections);
2384 };
2385 /**
2386 * returns the data from custom forms in a format that is usable by sales orders
2387 */
2388 /**
2389 * returns the data from custom forms in a format that is usable by sales orders
2390 * @return {?}
2391 */
2392 OrderFormComponent.prototype.getCustomFormData = /**
2393 * returns the data from custom forms in a format that is usable by sales orders
2394 * @return {?}
2395 */
2396 function () {
2397 return OrderFormService.getCustomFieldsData(this.customFormSections);
2398 };
2399 /**
2400 * returns the data from extra fields in a format that is usable by sales orders
2401 */
2402 /**
2403 * returns the data from extra fields in a format that is usable by sales orders
2404 * @return {?}
2405 */
2406 OrderFormComponent.prototype.getExtraFieldsData = /**
2407 * returns the data from extra fields in a format that is usable by sales orders
2408 * @return {?}
2409 */
2410 function () {
2411 return OrderFormService.getExtraFieldsData(this.extraFieldsSection);
2412 };
2413 /**
2414 * changes the read only state of the sales order form
2415 */
2416 /**
2417 * changes the read only state of the sales order form
2418 * @param {?} readOnly
2419 * @return {?}
2420 */
2421 OrderFormComponent.prototype.changeReadOnly = /**
2422 * changes the read only state of the sales order form
2423 * @param {?} readOnly
2424 * @return {?}
2425 */
2426 function (readOnly) {
2427 this.orderFormOptions.readOnly = readOnly;
2428 readOnly ? this.parentForm.disable() : this.parentForm.enable();
2429 };
2430 /**
2431 * @return {?}
2432 */
2433 OrderFormComponent.prototype.openDropdown = /**
2434 * @return {?}
2435 */
2436 function () {
2437 this.dropdownOpen$$.next(true);
2438 };
2439 OrderFormComponent.decorators = [
2440 { type: Component, args: [{
2441 template: "<form [formGroup]=\"parentForm\">\n <!-- Common Fields -->\n <div *ngIf=\"commonFormSections?.length > 0\" class=\"common-form-container\">\n <mat-card class=\"common-form-header\">\n <mat-card-title class=\"common-form-header-title\">{{ labels.commonForm.headerTitle }}</mat-card-title>\n <div class=\"common-form-header-text\">{{ labels.commonForm.headerText }}</div>\n </mat-card>\n <va-dropdown-form-section\n *ngFor=\"let formSection of commonFormSections\"\n [parentForm]=\"parentForm\"\n [prepopulatedData]=\"formSection.populatedData\"\n [fields]=\"formSection.fields\"\n [titleText]=\"formSection.sectionName\"\n [startOpen]=\"dropdownOpen$ | async\"\n editingHint=\"{{ labels.commonForm.editingHint }}\"\n >\n </va-dropdown-form-section>\n <ng-container *ngIf=\"extraFieldsSection\">\n <va-dropdown-form-section\n [parentForm]=\"parentForm\"\n [prepopulatedData]=\"extraFieldsSection.prepopulatedData\"\n [fields]=\"extraFieldsSection.fields\"\n [displayAutoDescription]=false\n [startOpen]=\"true\"\n [titleText]=\"'FRONTEND.STORE.ADMINISTRATIVE_QUESTIONS' | translate\"\n >\n </va-dropdown-form-section>\n </ng-container>\n </div>\n\n <!--Custom Fields-->\n <div *ngIf=\"customFormSections?.length > 0\" class=\"custom-form-container\">\n <va-order-form-section *ngFor=\"let sectionData of customFormSections\" [data]=\"sectionData\"></va-order-form-section>\n </div>\n</form>\n",
2442 providers: [],
2443 selector: 'va-order-form',
2444 styles: [".common-form-container{margin-bottom:16px}mat-card.common-form-header{margin-bottom:0;border-bottom-color:#fafafa;border-bottom-width:1px;box-shadow:0 0 1px -2px rgba(0,0,0,.2),0 0 2px 0 rgba(0,0,0,.14),0 0 5px 0 rgba(0,0,0,.12)}.common-form-header-text{font-size:15px;color:#9e9e9e}.common-form-header-title{margin-bottom:0;padding-bottom:15px}va-order-form-section{display:block;margin-bottom:16px}"]
2445 }] }
2446 ];
2447 /** @nocollapse */
2448 OrderFormComponent.ctorParameters = function () { return [
2449 { type: TranslateService }
2450 ]; };
2451 OrderFormComponent.propDecorators = {
2452 commonData: [{ type: Input }],
2453 answers: [{ type: Input }],
2454 parentForm: [{ type: Input }],
2455 fileUploadUrl: [{ type: Input }],
2456 orderForms: [{ type: Input }],
2457 productInfo: [{ type: Input }],
2458 labels: [{ type: Input }],
2459 users: [{ type: Input }],
2460 extraFields: [{ type: Input }],
2461 extraFieldsAnswers: [{ type: Input }],
2462 orderFormOptions: [{ type: Input }]
2463 };
2464 return OrderFormComponent;
2465}());
2466if (false) {
2467 /** @type {?} */
2468 OrderFormComponent.prototype.commonData;
2469 /** @type {?} */
2470 OrderFormComponent.prototype.answers;
2471 /** @type {?} */
2472 OrderFormComponent.prototype.parentForm;
2473 /** @type {?} */
2474 OrderFormComponent.prototype.fileUploadUrl;
2475 /** @type {?} */
2476 OrderFormComponent.prototype.orderForms;
2477 /** @type {?} */
2478 OrderFormComponent.prototype.productInfo;
2479 /** @type {?} */
2480 OrderFormComponent.prototype.labels;
2481 /** @type {?} */
2482 OrderFormComponent.prototype.users;
2483 /** @type {?} */
2484 OrderFormComponent.prototype.extraFields;
2485 /** @type {?} */
2486 OrderFormComponent.prototype.extraFieldsAnswers;
2487 /** @type {?} */
2488 OrderFormComponent.prototype.orderFormOptions;
2489 /** @type {?} */
2490 OrderFormComponent.prototype.commonFormSections;
2491 /** @type {?} */
2492 OrderFormComponent.prototype.customFormSections;
2493 /** @type {?} */
2494 OrderFormComponent.prototype.extraFieldsSection;
2495 /** @type {?} */
2496 OrderFormComponent.prototype.dropdownOpen$$;
2497 /** @type {?} */
2498 OrderFormComponent.prototype.dropdownOpen$;
2499 /**
2500 * @type {?}
2501 * @private
2502 */
2503 OrderFormComponent.prototype.translateService;
2504}
2505var OrderFormOptions = /** @class */ (function () {
2506 function OrderFormOptions(i) {
2507 this.bypassRequiredQuestions = !!i.bypassRequiredQuestions;
2508 this.readOnly = !!i.readOnly;
2509 this.showOfficeUseQuestions = !!i.showOfficeUseQuestions;
2510 }
2511 return OrderFormOptions;
2512}());
2513if (false) {
2514 /** @type {?} */
2515 OrderFormOptions.prototype.bypassRequiredQuestions;
2516 /** @type {?} */
2517 OrderFormOptions.prototype.readOnly;
2518 /** @type {?} */
2519 OrderFormOptions.prototype.showOfficeUseQuestions;
2520}
2521
2522/**
2523 * @fileoverview added by tsickle
2524 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2525 */
2526/** @type {?} */
2527var FILES = 'file';
2528/** @type {?} */
2529var DROP_DOWN = 'dropdown';
2530/** @type {?} */
2531var CHECK_BOX = 'checkbox';
2532/** @type {?} */
2533var TEXT_AREA = 'textarea';
2534/** @type {?} */
2535var TEXT_BOX = 'textbox';
2536/** @type {?} */
2537var BUSINESS_USER = 'vbcuser';
2538/**
2539 * @record
2540 */
2541function FieldBaseOptions() { }
2542if (false) {
2543 /** @type {?} */
2544 FieldBaseOptions.prototype.id;
2545 /** @type {?} */
2546 FieldBaseOptions.prototype.label;
2547 /** @type {?|undefined} */
2548 FieldBaseOptions.prototype.required;
2549 /** @type {?|undefined} */
2550 FieldBaseOptions.prototype.description;
2551 /** @type {?|undefined} */
2552 FieldBaseOptions.prototype.type;
2553 /** @type {?|undefined} */
2554 FieldBaseOptions.prototype.prefix;
2555 /** @type {?|undefined} */
2556 FieldBaseOptions.prototype.suffix;
2557 /** @type {?|undefined} */
2558 FieldBaseOptions.prototype.regexValidator;
2559 /** @type {?|undefined} */
2560 FieldBaseOptions.prototype.regexErrorMessage;
2561 /** @type {?|undefined} */
2562 FieldBaseOptions.prototype.disabled;
2563 /** @type {?|undefined} */
2564 FieldBaseOptions.prototype.forOfficeUseOnly;
2565 /** @type {?|undefined} */
2566 FieldBaseOptions.prototype.hidden;
2567 /** @type {?|undefined} */
2568 FieldBaseOptions.prototype.displayOnly;
2569}
2570/**
2571 * @abstract
2572 * @template T
2573 */
2574var /**
2575 * @abstract
2576 * @template T
2577 */
2578FieldBase = /** @class */ (function () {
2579 function FieldBase(options) {
2580 this.id = options.id;
2581 this.label = options.label;
2582 this.required = !!options.required;
2583 this.description = options.description || null;
2584 options.type = options.type === 'text' ? 'textbox' : options.type;
2585 this.controlType = (/** @type {?} */ (options.type));
2586 this.prefix = options.prefix;
2587 this.suffix = options.suffix;
2588 this.regexValidator = options.regexValidator;
2589 this.regexErrorMessage = options.regexErrorMessage;
2590 this.disabled = options.disabled || false;
2591 this.validator = this.validatorBuilder();
2592 this.forOfficeUseOnly = !!options.forOfficeUseOnly;
2593 this.hidden = options.hidden;
2594 this.displayOnly = options.displayOnly;
2595 }
2596 /**
2597 * @return {?}
2598 */
2599 FieldBase.prototype.getLabel = /**
2600 * @return {?}
2601 */
2602 function () {
2603 /** @type {?} */
2604 var fieldLabel = this.label;
2605 if (this.required) {
2606 fieldLabel += ' *';
2607 }
2608 return fieldLabel;
2609 };
2610 /**
2611 * @protected
2612 * @return {?}
2613 */
2614 FieldBase.prototype.validatorBuilder = /**
2615 * @protected
2616 * @return {?}
2617 */
2618 function () {
2619 return (/**
2620 * @param {?} control
2621 * @return {?}
2622 */
2623 function (control) {
2624 return null;
2625 });
2626 };
2627 return FieldBase;
2628}());
2629if (false) {
2630 /** @type {?} */
2631 FieldBase.prototype.value;
2632 /** @type {?} */
2633 FieldBase.prototype.id;
2634 /** @type {?} */
2635 FieldBase.prototype.label;
2636 /** @type {?} */
2637 FieldBase.prototype.required;
2638 /** @type {?} */
2639 FieldBase.prototype.order;
2640 /** @type {?} */
2641 FieldBase.prototype.description;
2642 /** @type {?} */
2643 FieldBase.prototype.controlType;
2644 /** @type {?} */
2645 FieldBase.prototype.prefix;
2646 /** @type {?} */
2647 FieldBase.prototype.suffix;
2648 /** @type {?} */
2649 FieldBase.prototype.regexValidator;
2650 /** @type {?} */
2651 FieldBase.prototype.regexErrorMessage;
2652 /** @type {?} */
2653 FieldBase.prototype.disabled;
2654 /** @type {?} */
2655 FieldBase.prototype.validator;
2656 /** @type {?} */
2657 FieldBase.prototype.forOfficeUseOnly;
2658 /** @type {?} */
2659 FieldBase.prototype.hidden;
2660 /** @type {?} */
2661 FieldBase.prototype.displayOnly;
2662}
2663
2664/**
2665 * @fileoverview added by tsickle
2666 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2667 */
2668var FieldBuilderComponent = /** @class */ (function () {
2669 function FieldBuilderComponent() {
2670 this.removeField = new EventEmitter(null);
2671 }
2672 /**
2673 * @param {?} option
2674 * @param {?} required
2675 * @return {?}
2676 */
2677 FieldBuilderComponent.createDropDownOption = /**
2678 * @param {?} option
2679 * @param {?} required
2680 * @return {?}
2681 */
2682 function (option, required) {
2683 return new FormGroup({
2684 label: new FormControl(option.label || option.value, required ? [Validators.required] : []),
2685 value: new FormControl(option.value),
2686 useValue: new FormControl(!!option.value)
2687 });
2688 };
2689 /**
2690 * @param {?} options
2691 * @return {?}
2692 */
2693 FieldBuilderComponent.createDropDownOptions = /**
2694 * @param {?} options
2695 * @return {?}
2696 */
2697 function (options) {
2698 if (options === null || options === undefined) {
2699 options = [];
2700 }
2701 /** @type {?} */
2702 var orderFormFieldsGroupArray = options.map((/**
2703 * @param {?} option
2704 * @return {?}
2705 */
2706 function (option) { return FieldBuilderComponent.createDropDownOption(option, false); }));
2707 return new FormArray(orderFormFieldsGroupArray);
2708 };
2709 /**
2710 * @param {?} orderFormField
2711 * @return {?}
2712 */
2713 FieldBuilderComponent.createOrderFormFieldGroup = /**
2714 * @param {?} orderFormField
2715 * @return {?}
2716 */
2717 function (orderFormField) {
2718 /** @type {?} */
2719 var orderFormFieldGroup = new FormGroup({
2720 descriptionControl: new FormControl(orderFormField.description, []),
2721 labelControl: new FormControl(orderFormField.label, [Validators.required]),
2722 idControl: new FormControl(orderFormField.id, [Validators.required]),
2723 requiredControl: new FormControl(orderFormField.required || false, []),
2724 uploadUrlControl: new FormControl(orderFormField.uploadUrl, []),
2725 prefixControl: new FormControl(orderFormField.prefix, []),
2726 suffixControl: new FormControl(orderFormField.suffix, []),
2727 regexValidatorControl: new FormControl(orderFormField.regexValidator, regexValidator()),
2728 regexErrorMessageControl: new FormControl(orderFormField.regexErrorMessage, []),
2729 typeControl: new FormControl(getFieldInterface(orderFormField.type), [Validators.required]),
2730 allowMultiples: new FormControl(orderFormField.allowMultiples || false, []),
2731 allowDuplicates: new FormControl(orderFormField.allowDuplicates || false, []),
2732 maxChoices: new FormControl(orderFormField.maxChoices ? orderFormField.maxChoices : 1, [Validators.min(1), numberValidator()]),
2733 forOfficeUseOnly: new FormControl(orderFormField.forOfficeUseOnly || false, [])
2734 });
2735 if (orderFormField.optionsWithLabels) {
2736 /** @type {?} */
2737 var optionsArray = FieldBuilderComponent.createDropDownOptions(orderFormField.optionsWithLabels);
2738 orderFormFieldGroup.addControl('optionsFormArray', optionsArray);
2739 }
2740 else if (orderFormField.options) {
2741 /** @type {?} */
2742 var optionsArray = FieldBuilderComponent.createDropDownOptions(orderFormField.options.map((/**
2743 * @param {?} option
2744 * @return {?}
2745 */
2746 function (option) { return ({ label: option }); })));
2747 orderFormFieldGroup.addControl('optionsFormArray', optionsArray);
2748 }
2749 else {
2750 orderFormFieldGroup.addControl('optionsFormArray', new FormArray([]));
2751 }
2752 return orderFormFieldGroup;
2753 };
2754 /**
2755 * @return {?}
2756 */
2757 FieldBuilderComponent.prototype.ngOnInit = /**
2758 * @return {?}
2759 */
2760 function () {
2761 if (!this.supportedFieldTypes || this.supportedFieldTypes.length < 1) {
2762 this.supportedFieldTypes = FORM_FIELDS;
2763 }
2764 this.initForm();
2765 };
2766 /**
2767 * @return {?}
2768 */
2769 FieldBuilderComponent.prototype.initForm = /**
2770 * @return {?}
2771 */
2772 function () {
2773 // Check to see if form has been initiated
2774 if (!this.orderFormFieldGroup.get('labelControl')) {
2775 this.orderFormFieldGroup =
2776 FieldBuilderComponent.createOrderFormFieldGroup({});
2777 }
2778 };
2779 /**
2780 * @return {?}
2781 */
2782 FieldBuilderComponent.prototype.getOptionsArray = /**
2783 * @return {?}
2784 */
2785 function () {
2786 return (/** @type {?} */ (this.orderFormFieldGroup.get('optionsFormArray')));
2787 };
2788 /**
2789 * @return {?}
2790 */
2791 FieldBuilderComponent.prototype.getCurrentFieldInterface = /**
2792 * @return {?}
2793 */
2794 function () {
2795 /** @type {?} */
2796 var formFieldTypeInterface = ((/** @type {?} */ (this.orderFormFieldGroup.get('typeControl').value)));
2797 return formFieldTypeInterface ? formFieldTypeInterface.id : null;
2798 };
2799 /**
2800 * @param {?} index
2801 * @return {?}
2802 */
2803 FieldBuilderComponent.prototype.removeOption = /**
2804 * @param {?} index
2805 * @return {?}
2806 */
2807 function (index) {
2808 /** @type {?} */
2809 var formArray = this.getOptionsArray();
2810 formArray.removeAt(index);
2811 };
2812 /**
2813 * @return {?}
2814 */
2815 FieldBuilderComponent.prototype.addOption = /**
2816 * @return {?}
2817 */
2818 function () {
2819 /** @type {?} */
2820 var fieldArray = this.getOptionsArray();
2821 fieldArray.push(FieldBuilderComponent.createDropDownOption({ label: '' }, true));
2822 };
2823 /**
2824 * @return {?}
2825 */
2826 FieldBuilderComponent.prototype.getFormValues = /**
2827 * @return {?}
2828 */
2829 function () {
2830 /** @type {?} */
2831 var obj = {};
2832 obj.label = this.orderFormFieldGroup.get('labelControl').value;
2833 obj.id = this.orderFormFieldGroup.get('idControl').value;
2834 /** @type {?} */
2835 var formFieldType = ((/** @type {?} */ (this.orderFormFieldGroup.get('typeControl').value)));
2836 obj.type = formFieldType ? formFieldType.id : null;
2837 // Options will be nested under their own form control in the larger Orderformfield array
2838 /** @type {?} */
2839 var optionsArray = ((/** @type {?} */ (this.orderFormFieldGroup.get('optionsFormArray'))));
2840 if (optionsArray && optionsArray.value) {
2841 obj.options = optionsArray.value.map((/**
2842 * @param {?} option
2843 * @return {?}
2844 */
2845 function (option) { return option.value || option.label; }));
2846 obj.optionsWithLabels = optionsArray.value.map((/**
2847 * @param {?} option
2848 * @return {?}
2849 */
2850 function (option) { return ({ label: option.label, value: option.value }); }));
2851 }
2852 obj.description = this.orderFormFieldGroup.get('descriptionControl').value;
2853 obj.required = this.orderFormFieldGroup.get('requiredControl').value || false;
2854 obj.uploadUrl = this.orderFormFieldGroup.get('uploadUrlControl').value;
2855 obj.prefix = this.orderFormFieldGroup.get('prefixControl').value;
2856 obj.suffix = this.orderFormFieldGroup.get('suffixControl').value;
2857 obj.regexValidator = this.orderFormFieldGroup.get('regexValidatorControl').value;
2858 obj.regexErrorMessage = this.orderFormFieldGroup.get('regexErrorMessageControl').value;
2859 obj.allowMultiples = this.orderFormFieldGroup.get('allowMultiples').value || false;
2860 obj.allowDuplicates = this.orderFormFieldGroup.get('allowDuplicates').value || false;
2861 obj.maxChoices = this.orderFormFieldGroup.get('maxChoices').value || 1;
2862 obj.forOfficeUseOnly = this.orderFormFieldGroup.get('forOfficeUseOnly').value || false;
2863 return obj;
2864 };
2865 FieldBuilderComponent.decorators = [
2866 { type: Component, args: [{
2867 selector: 'va-field-builder',
2868 template: "<div class=\"color-primary grab-mask order-form-field-form-container\" [formGroup]=\"orderFormFieldGroup\">\n <mat-form-field class=\"order-form-mat-form-field\">\n <mat-select matInput formControlName=\"typeControl\" placeholder=\"Type\" required novalidate>\n <mat-option *ngFor=\"let field of supportedFieldTypes\" [value]=\"field\">\n {{ field.name }}\n </mat-option>\n </mat-select>\n <mat-error *ngIf=\"'typeControl.invalid'\">Form Field type is Required</mat-error>\n </mat-form-field>\n <span class=\"options\">\n <mat-checkbox color=\"primary\" [formControlName]=\"'requiredControl'\"> Required</mat-checkbox>\n <mat-checkbox color=\"primary\" [formControlName]=\"'forOfficeUseOnly'\" class=\"underlined\" matTooltip=\"This question will not be shown to end users\"> For Office Use Only</mat-checkbox>\n </span>\n <!-- Options if drop down type is selected -->\n <ng-container *ngIf=\"getCurrentFieldInterface() && getCurrentFieldInterface() === 'dropdown'\">\n <div formArrayName=\"optionsFormArray\" *ngFor=\"let option of getOptionsArray().controls; let i = index;\">\n <div class=\"removable-form-field dropdown-option\">\n <mat-form-field class=\"dropdown-option-label\">\n <input matInput [formControl]=\"option.get('label')\" placeholder=\"Option\">\n </mat-form-field>\n <mat-form-field class=\"dropdown-option-value\" *ngIf=\"option.get('useValue').value\">\n <input matInput [formControl]=\"option.get('value')\" placeholder=\"Value\">\n </mat-form-field>\n <a class=\"dropdown-option-value\" (click)=\"option.get('useValue').setValue(true)\" *ngIf=\"!option.get('useValue').value\">+ Assign Value</a>\n <button mat-icon-button type=\"button\" color=\"primary\" (click)=\"removeOption(i)\">\n <mat-icon aria-label=\"Clear Button\">clear</mat-icon>\n </button>\n </div>\n </div>\n <div class=\"order-form-mat-form-field\">\n <a (click)=\"addOption()\">+ Option</a>\n </div>\n <div class=\"dropdown-config\">\n <mat-checkbox color=\"primary\" [formControlName]=\"'allowMultiples'\"> Allow Multiples</mat-checkbox>\n <ng-container *ngIf=\"orderFormFieldGroup.controls.allowMultiples.value\">\n <mat-checkbox class=\"required-checkbox\" color=\"primary\" [formControlName]=\"'allowDuplicates'\"> Allow Duplicates</mat-checkbox>\n <div>\n <mat-form-field class=\"order-form-mat-form-field\">\n <input matInput formControlName=\"maxChoices\" placeholder=\"Maximum Number of Choices\" required type=\"number\">\n <mat-hint>Must be greater than 0</mat-hint>\n <mat-error *ngIf=\"'maxChoices.invalid'\">Max Choices must be a number larger than 0</mat-error>\n </mat-form-field>\n </div>\n </ng-container>\n </div>\n </ng-container>\n <div>\n <mat-form-field class=\"order-form-mat-form-field\">\n <input matInput formControlName=\"labelControl\" placeholder=\"Label\" required novalidate>\n <mat-hint>Keep it short. Recommended: Max 140 characters</mat-hint>\n <mat-error *ngIf=\"'idControl.invalid'\">Label is Required</mat-error>\n </mat-form-field>\n </div>\n <!-- Prefix/suffix if textbox type is selected -->\n <ng-container *ngIf=\"getCurrentFieldInterface() && getCurrentFieldInterface() === 'textbox'\">\n <ng-container *ngIf=\"showSuffixes\">\n <mat-form-field>\n <input matInput formControlName=\"prefixControl\" placeholder=\"Prefix\">\n </mat-form-field>\n <mat-form-field>\n <input matInput formControlName=\"suffixControl\" placeholder=\"Suffix\">\n </mat-form-field>\n <div class=\"show-hide-text-button\"><a (click)=\"showSuffixes = !showSuffixes\">Hide Prefix/Suffix</a></div>\n </ng-container>\n <div *ngIf=\"!showSuffixes\" class=\"show-hide-text-button\">\n <a (click)=\"showSuffixes = !showSuffixes\">+ Prefix/Suffix</a>\n <div class=\"hidden-note\">- Values will apply even though currently hidden </div>\n </div>\n </ng-container>\n\n <div>\n <mat-form-field class=\"order-form-mat-form-field\">\n <input matInput formControlName=\"idControl\" placeholder=\"ID\" required>\n <mat-error *ngIf=\"'idControl.invalid'\">Id is Required</mat-error>\n <mat-hint>ID must be unique</mat-hint>\n </mat-form-field>\n </div>\n\n\n <!-- Upload url if file type is selected -->\n <ng-container *ngIf=\"getCurrentFieldInterface() && getCurrentFieldInterface() === 'file'\">\n <mat-form-field>\n <input matInput formControlName=\"uploadUrlControl\" placeholder=\"Upload URL\">\n </mat-form-field>\n </ng-container>\n\n\n <!-- Prefix/suffix if textbox type is selected -->\n <ng-container *ngIf=\"getCurrentFieldInterface() && getCurrentFieldInterface() === 'textbox'\">\n\n <!-- RegexValidator/RegexErrorMessage if textbox type is selected -->\n <ng-container *ngIf=\"showValidators\">\n <mat-form-field>\n <input matInput formControlName=\"regexValidatorControl\" placeholder=\"Regex Validator\">\n <mat-error *ngIf=\"'regexValidatorControl.invalid'\"> Must be a valid regular expression </mat-error>\n </mat-form-field>\n <mat-form-field>\n <input matInput formControlName=\"regexErrorMessageControl\" placeholder=\"Regex Error Message\">\n <mat-hint> Error displayed to the user when the regular expression is not matched </mat-hint>\n </mat-form-field>\n <div class=\"show-hide-text-button\">\n <a (click)=\"showValidators = !showValidators\">Hide Validation</a>\n </div>\n </ng-container>\n <div *ngIf=\"!showValidators\" class=\"show-hide-text-button\">\n <a (click)=\"showValidators = !showValidators\">+ Validation</a>\n <div class=\"hidden-note\"> - Values will apply even though currently hidden </div>\n </div>\n </ng-container>\n\n <!-- Optional description -->\n <div class=\"removable-form-field\">\n <mat-form-field>\n <input matInput formControlName=\"descriptionControl\" placeholder=\"Hint text\">\n <mat-hint>A short sentence to show below the field if you absolutely need extra instruction</mat-hint>\n </mat-form-field>\n </div>\n\n <div class=\"delete-field-section\">\n <button mat-icon-button type=\"button\" color=\"primary\" (click)=\"removeField.emit()\">\n Delete field\n <!-- <mat-icon aria-label=\"Clear Button\">clear</mat-icon> -->\n </button>\n </div>\n</div>\n",
2869 changeDetection: ChangeDetectionStrategy.OnPush,
2870 styles: [".show-hide-text-button{margin-bottom:2em;display:-webkit-box;display:flex}.show-hide-text-button .hidden-note{font-size:10px;margin-left:7px;color:#9e9e9e;-ms-grid-row-align:center;align-self:center}.options{padding-left:15px;width:15%;display:inline-block}.dropdown-option,mat-form-field{width:85%}.delete-field-section{text-align:right}.mat-icon-button{width:auto;color:rgba(0,0,0,.54)!important}.mat-icon-button:hover{color:#c62828!important}.dropdown-config{margin-top:17px}.dropdown-config mat-checkbox{margin-right:16px}.dropdown-option{display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center}.dropdown-option-label{-webkit-box-flex:1;flex:1 1 auto;margin-right:16px}.dropdown-option-value{-webkit-box-flex:0;flex:0 1 33%}.underlined{border-bottom:1px dotted}"]
2871 }] }
2872 ];
2873 FieldBuilderComponent.propDecorators = {
2874 orderFormFieldGroup: [{ type: Input }],
2875 supportedFieldTypes: [{ type: Input }],
2876 removeField: [{ type: Output }]
2877 };
2878 return FieldBuilderComponent;
2879}());
2880if (false) {
2881 /** @type {?} */
2882 FieldBuilderComponent.prototype.orderFormFieldGroup;
2883 /** @type {?} */
2884 FieldBuilderComponent.prototype.supportedFieldTypes;
2885 /** @type {?} */
2886 FieldBuilderComponent.prototype.removeField;
2887 /** @type {?} */
2888 FieldBuilderComponent.prototype.showValidators;
2889 /** @type {?} */
2890 FieldBuilderComponent.prototype.showSuffixes;
2891}
2892// Validation to ensure supplied regex is valid
2893/**
2894 * @return {?}
2895 */
2896function regexValidator() {
2897 return (/**
2898 * @param {?} control
2899 * @return {?}
2900 */
2901 function (control) {
2902 try {
2903 /** @type {?} */
2904 var _ = new RegExp(control.value || '');
2905 }
2906 catch (e) {
2907 return { 'regex': true };
2908 }
2909 return null;
2910 });
2911}
2912/**
2913 * @return {?}
2914 */
2915function numberValidator() {
2916 return (/**
2917 * @param {?} control
2918 * @return {?}
2919 */
2920 function (control) {
2921 /** @type {?} */
2922 var isNumber = /^\d+$/;
2923 if (isNumber.test(control.value)) {
2924 return null;
2925 }
2926 return { 'number': true };
2927 });
2928}
2929/**
2930 * @record
2931 */
2932function FormFieldInterface() { }
2933if (false) {
2934 /** @type {?} */
2935 FormFieldInterface.prototype.id;
2936 /** @type {?} */
2937 FormFieldInterface.prototype.name;
2938}
2939/** @type {?} */
2940var FORM_FIELDS = [
2941 { id: FILES, name: 'Files' }, { id: DROP_DOWN, name: 'Drop Down' },
2942 { id: CHECK_BOX, name: 'Check Box' }, { id: TEXT_AREA, name: 'Text Area' },
2943 { id: TEXT_BOX, name: 'Text Box' }, { id: BUSINESS_USER, name: 'End User' }
2944];
2945/**
2946 * @param {?} formFieldId
2947 * @return {?}
2948 */
2949function getFieldInterface(formFieldId) {
2950 return getFormFieldInterfaceFromId(((/** @type {?} */ (formFieldId))));
2951}
2952/**
2953 * @param {?} id
2954 * @return {?}
2955 */
2956function getFormFieldInterfaceFromId(id) {
2957 return FORM_FIELDS.find((/**
2958 * @param {?} obj
2959 * @return {?}
2960 */
2961 function (obj) { return obj.id === id; }));
2962}
2963
2964/**
2965 * @fileoverview added by tsickle
2966 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2967 */
2968var OrderItemListService = /** @class */ (function () {
2969 function OrderItemListService() {
2970 }
2971 /**
2972 * @param {?} items
2973 * @return {?}
2974 */
2975 OrderItemListService.getPriceSummary = /**
2976 * @param {?} items
2977 * @return {?}
2978 */
2979 function (items) {
2980 if (!items) {
2981 return { items: [], includesUndefinedPricing: false };
2982 }
2983 /** @type {?} */
2984 var includesUndefinedPricing = false;
2985 /** @type {?} */
2986 var summaryItems = items.reduce((/**
2987 * @param {?} currentArray
2988 * @param {?} item
2989 * @return {?}
2990 */
2991 function (currentArray, item) {
2992 if (item.pricing.prices.length <= 0) {
2993 includesUndefinedPricing = true;
2994 return currentArray;
2995 }
2996 item.pricing.prices.map((/**
2997 * @param {?} price
2998 * @return {?}
2999 */
3000 function (price) {
3001 if (!price || price.price < 0) {
3002 includesUndefinedPricing = true;
3003 return;
3004 }
3005 /** @type {?} */
3006 var freq = price.billingFrequency;
3007 /** @type {?} */
3008 var cur = item.pricing.currency;
3009 /** @type {?} */
3010 var existingCurIndex = currentArray.findIndex((/**
3011 * @param {?} summaryItem
3012 * @return {?}
3013 */
3014 function (summaryItem) { return summaryItem.currency === cur; }));
3015 /** @type {?} */
3016 var pricing = {
3017 currency: cur,
3018 prices: []
3019 };
3020 if (existingCurIndex > -1) {
3021 pricing = currentArray[existingCurIndex];
3022 }
3023 /** @type {?} */
3024 var existingFreqIndex = pricing.prices.findIndex((/**
3025 * @param {?} summaryItem
3026 * @return {?}
3027 */
3028 function (summaryItem) { return summaryItem.billingFrequency === freq; }));
3029 /** @type {?} */
3030 var quantifiedPrice = price.price !== null ? price.price * item.quantity : null;
3031 /** @type {?} */
3032 var quantifiedDiscount = (price.discountAmount || 0) * item.quantity;
3033 if (existingFreqIndex > -1) {
3034 pricing.prices[existingFreqIndex] = {
3035 price: pricing.prices[existingFreqIndex].price + quantifiedPrice,
3036 billingFrequency: freq,
3037 discountAmount: pricing.prices[existingFreqIndex].discountAmount + quantifiedDiscount
3038 };
3039 }
3040 else {
3041 pricing.prices.push({
3042 price: quantifiedPrice,
3043 billingFrequency: freq,
3044 discountAmount: quantifiedDiscount
3045 });
3046 }
3047 if (existingCurIndex > -1) {
3048 currentArray[existingCurIndex] = pricing;
3049 }
3050 else {
3051 currentArray.push(pricing);
3052 }
3053 }));
3054 return currentArray;
3055 }), []);
3056 return { items: summaryItems, includesUndefinedPricing: includesUndefinedPricing };
3057 };
3058 return OrderItemListService;
3059}());
3060
3061/**
3062 * @fileoverview added by tsickle
3063 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3064 */
3065var OrderItemListComponent = /** @class */ (function () {
3066 function OrderItemListComponent(translateService) {
3067 this.translateService = translateService;
3068 this.includesUndefinedPricing = false;
3069 this.translateService.setTranslation('en', En.en, true);
3070 this.translateService.setTranslation('cs', Cs.cs, true);
3071 }
3072 Object.defineProperty(OrderItemListComponent.prototype, "orderItems", {
3073 set: /**
3074 * @param {?} items
3075 * @return {?}
3076 */
3077 function (items) {
3078 this.items = items || [];
3079 /** @type {?} */
3080 var summary = OrderItemListService.getPriceSummary(items);
3081 this.summaryItems = summary.items;
3082 this.includesUndefinedPricing = summary.includesUndefinedPricing;
3083 },
3084 enumerable: true,
3085 configurable: true
3086 });
3087 /**
3088 * @param {?} price
3089 * @return {?}
3090 */
3091 OrderItemListComponent.prototype.calculateTotalPrice = /**
3092 * @param {?} price
3093 * @return {?}
3094 */
3095 function (price) {
3096 if (price.price === null) {
3097 return null;
3098 }
3099 /** @type {?} */
3100 var totalPrice = price.price - price.discountAmount;
3101 if (!this.taxOptions) {
3102 return totalPrice;
3103 }
3104 /** @type {?} */
3105 var taxTotal = this.taxOptions.reduce((/**
3106 * @param {?} all
3107 * @param {?} tax
3108 * @return {?}
3109 */
3110 function (all, tax) { return all + (tax.percentage * totalPrice); }), 0);
3111 return totalPrice + taxTotal;
3112 };
3113 /**
3114 * @param {?} tax
3115 * @return {?}
3116 */
3117 OrderItemListComponent.prototype.buildTaxLabel = /**
3118 * @param {?} tax
3119 * @return {?}
3120 */
3121 function (tax) {
3122 /** @type {?} */
3123 var taxPercentage = Number(tax.percentage * 100).toFixed(2);
3124 return tax.label + " (" + taxPercentage + "%)";
3125 };
3126 /**
3127 * @return {?}
3128 */
3129 OrderItemListComponent.prototype.isFree = /**
3130 * @return {?}
3131 */
3132 function () {
3133 /** @type {?} */
3134 var summaryTotal = this.summaryItems.reduce((/**
3135 * @param {?} all
3136 * @param {?} item
3137 * @return {?}
3138 */
3139 function (all, item) {
3140 /** @type {?} */
3141 var totalPrices = item.prices.reduce((/**
3142 * @param {?} acc
3143 * @param {?} price
3144 * @return {?}
3145 */
3146 function (acc, price) { return acc + price.price; }), 0);
3147 return all + totalPrices;
3148 }), 0);
3149 return summaryTotal === 0;
3150 };
3151 OrderItemListComponent.decorators = [
3152 { type: Component, args: [{
3153 selector: 'va-order-item-list',
3154 template: "<div class=\"va-order-item-list\">\n <mat-list class=\"product-list\" *ngIf=\"items; else loading\">\n <ng-container *ngFor=\"let item of items\">\n <mat-list-item>\n <div class=\"list-item\">\n <div class=\"left-section\">\n <div class=\"icon-and-name\">\n <div class=\"icon-container\">\n <va-icon [diameter]=\"32\" [iconUrl]=\"item.icon\" [name]=\"item.name\"></va-icon>\n </div>\n <div>\n <div>\n {{ item.name }}\n <va-badge color=\"blue-solid\" *ngIf=\"item.editionName\">\n <span> {{ item.editionName }} </span>\n </va-badge>\n <span *ngIf=\"item.quantity > 1\"> ({{ item.quantity }})</span>\n </div>\n </div>\n </div>\n </div>\n <div class=\"right-section\" *ngIf=\"!hidePricing && item.pricing\">\n <ng-container *ngIf=\"item.pricing.prices?.length > 0\">\n <ng-container *ngFor=\"let price of item.pricing.prices\">\n <div matLine>\n <strong *ngIf=\"!price.discountAmount\">{{ price.price | price: item.pricing.currency }}</strong>\n <ng-container *ngIf=\"price.price && price.discountAmount > 0\">\n <span matTooltipPosition=\"left\" class=\"item-price-before-discount\"\n [matTooltip]=\"price.discountAmount | price: item.pricing.currency\">\n {{ price.price | price: item.pricing.currency }}\n </span>\n <strong>{{ price.price - price.discountAmount | price: item.pricing.currency }}</strong>\n </ng-container>\n </div>\n <div matLine class=\"tertiary-font-color\" *ngIf=\"price.price > 0\">\n {{ price.billingFrequency | formatBillingFrequency }}\n </div>\n </ng-container>\n </ng-container>\n <ng-container *ngIf=\"item.pricing.prices?.length <= 0\">\n <mat-list-item class=\"summary-list-item\">\n <div matLine>\n <strong>{{ null | price: 'CAD' }}</strong>\n </div>\n </mat-list-item>\n </ng-container>\n </div>\n </div>\n </mat-list-item>\n <mat-divider></mat-divider>\n </ng-container>\n </mat-list>\n\n <div *ngIf=\"!hidePricing\">\n <div *ngIf=\"items; else loading\">\n <div class=\"total-header\">\n {{ 'FRONTEND.STORE.TOTAL' | translate }}\n </div>\n <mat-list class=\"summary-list\">\n <ng-container *ngIf=\"includesUndefinedPricing; else totalIsDefined\">\n <mat-list-item class=\"summary-list-item\">\n <div matLine>\n <strong>{{ null | price: 'CAD' }}</strong>\n </div>\n </mat-list-item>\n </ng-container>\n\n <ng-template #totalIsDefined>\n <ng-container *ngIf=\"isFree(); else totalNotFree\">\n <div class=\"summary-item-group\">\n <mat-list-item class=\"summary-list-item\">\n <div matLine>\n <strong>{{ 0 | price: 'USD' }}</strong>\n </div>\n </mat-list-item>\n </div>\n </ng-container>\n\n <ng-template #totalNotFree>\n <ng-container *ngFor=\"let item of summaryItems\">\n <div class=\"summary-item-group\" *ngFor=\"let price of item.prices\">\n <ng-container *ngIf=\"price.price > 0\">\n <div class=\"tax-calculation\">\n <mat-list-item class=\"summary-list-item tax-item\">\n <div matLine *ngIf=\"taxOptions\">\n <strong>{{ price.price - price.discountAmount | price: item.currency }}</strong>\n </div>\n </mat-list-item>\n <ng-container *ngFor=\"let tax of taxOptions\">\n <mat-list-item class=\"summary-list-item tax-item\">\n <div matLine class=\"tax-label\">\n <span>\n {{ buildTaxLabel(tax) }}\n </span>\n <strong>\n +{{ (price.price - price.discountAmount) * tax.percentage | price: item.currency }}\n </strong>\n </div>\n </mat-list-item>\n </ng-container>\n </div>\n\n <mat-list-item class=\"summary-list-item\" [ngClass]=\"{ 'result-item': (price.price > 0 && taxOptions) }\">\n <div matLine>\n <strong>{{ calculateTotalPrice(price) | price: item.currency }}</strong>\n </div>\n </mat-list-item>\n\n <mat-list-item class=\"summary-list-item\">\n <div matLine class=\"tertiary-font-color\">\n {{ price.billingFrequency | formatBillingFrequency }}\n </div>\n </mat-list-item>\n </ng-container>\n </div>\n </ng-container>\n\n </ng-template>\n </ng-template>\n </mat-list>\n </div>\n </div>\n\n <ng-template #loading>\n <div class=\"stencil-shimmer\"></div>\n </ng-template>\n\n</div>\n",
3155 styles: ["::ng-deep .va-order-item-list .mat-list-item{height:auto!important}::ng-deep .va-order-item-list .mat-list .mat-list-item-content{padding:10px 0!important}::ng-deep .va-order-item-list .mat-list .summary-list-item .mat-list-item-content{padding:0!important}.product-list{padding:0;position:relative}.product-list .list-item{display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;-webkit-box-pack:justify;justify-content:space-between;width:100%}.product-list .list-item .left-section .icon-and-name{display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center}.product-list .list-item .left-section .icon-and-name .icon-container{margin-right:16px}.product-list .list-item .right-section{margin-left:1em;text-align:right;align-self:flex-start}.total-header{background-color:#616161;color:#fff;line-height:2;height:2em;font-weight:700;padding-right:14px;text-align:right}.summary-list{padding:8px 0;background-color:#f5f5f5}.summary-list .summary-list-item{padding-right:14px;text-align:right}.summary-list .summary-item-group{padding:10px 0}.summary-list .summary-list-item.tax-item{color:#9e9e9e;font-size:14px}.summary-list .summary-list-item.result-item{text-decoration:overline;padding-top:5px}.summary-list .tax-label{font-size:12px}.tertiary-font-color{color:#212121;font-size:14px!important}.stencil-shimmer{width:100%;min-height:20px;margin-bottom:4px}.item-price-before-discount{font-size:14px;margin-right:8px;color:#9e9e9e;text-decoration:line-through;border-bottom:1px dotted #9e9e9e}"]
3156 }] }
3157 ];
3158 /** @nocollapse */
3159 OrderItemListComponent.ctorParameters = function () { return [
3160 { type: TranslateService }
3161 ]; };
3162 OrderItemListComponent.propDecorators = {
3163 taxOptions: [{ type: Input }],
3164 hidePricing: [{ type: Input }],
3165 orderItems: [{ type: Input }]
3166 };
3167 return OrderItemListComponent;
3168}());
3169if (false) {
3170 /** @type {?} */
3171 OrderItemListComponent.prototype.items;
3172 /** @type {?} */
3173 OrderItemListComponent.prototype.summaryItems;
3174 /** @type {?} */
3175 OrderItemListComponent.prototype.includesUndefinedPricing;
3176 /** @type {?} */
3177 OrderItemListComponent.prototype.taxOptions;
3178 /** @type {?} */
3179 OrderItemListComponent.prototype.hidePricing;
3180 /**
3181 * @type {?}
3182 * @private
3183 */
3184 OrderItemListComponent.prototype.translateService;
3185}
3186
3187/**
3188 * @fileoverview added by tsickle
3189 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3190 */
3191var PricePipe = /** @class */ (function () {
3192 function PricePipe() {
3193 }
3194 /**
3195 * @param {?} value
3196 * @param {?} currency
3197 * @param {?=} billingFrequency
3198 * @param {?=} isCents
3199 * @param {?=} translateZero
3200 * @param {?=} displaySymbol
3201 * @return {?}
3202 */
3203 PricePipe.prototype.transform = /**
3204 * @param {?} value
3205 * @param {?} currency
3206 * @param {?=} billingFrequency
3207 * @param {?=} isCents
3208 * @param {?=} translateZero
3209 * @param {?=} displaySymbol
3210 * @return {?}
3211 */
3212 function (value, currency, billingFrequency, isCents, translateZero, displaySymbol) {
3213 if (isCents === void 0) { isCents = true; }
3214 if (translateZero === void 0) { translateZero = true; }
3215 if (displaySymbol === void 0) { displaySymbol = true; }
3216 return formatDisplayPrice(value, currency, billingFrequency, isCents, translateZero, displaySymbol);
3217 };
3218 PricePipe.decorators = [
3219 { type: Pipe, args: [{ name: 'price' },] }
3220 ];
3221 return PricePipe;
3222}());
3223var FormatBillingFrequencyPipe = /** @class */ (function () {
3224 function FormatBillingFrequencyPipe() {
3225 }
3226 /**
3227 * @param {?} value
3228 * @return {?}
3229 */
3230 FormatBillingFrequencyPipe.prototype.transform = /**
3231 * @param {?} value
3232 * @return {?}
3233 */
3234 function (value) {
3235 return formatBillingFrequency(value);
3236 };
3237 FormatBillingFrequencyPipe.decorators = [
3238 { type: Pipe, args: [{ name: 'formatBillingFrequency' },] }
3239 ];
3240 return FormatBillingFrequencyPipe;
3241}());
3242
3243/**
3244 * @fileoverview added by tsickle
3245 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3246 */
3247var VaOrderFormModule = /** @class */ (function () {
3248 function VaOrderFormModule() {
3249 }
3250 VaOrderFormModule.decorators = [
3251 { type: NgModule, args: [{
3252 imports: [
3253 CommonModule,
3254 FormsModule,
3255 MatButtonModule,
3256 MatCheckboxModule,
3257 MatExpansionModule,
3258 MatIconModule,
3259 MatInputModule,
3260 MatOptionModule,
3261 MatProgressSpinnerModule,
3262 MatSelectModule,
3263 MatCardModule,
3264 MatTooltipModule,
3265 ReactiveFormsModule,
3266 VaFormsModule,
3267 VaHeaderContainerModule,
3268 VaIconModule,
3269 VaFormsModule,
3270 VaBadgeModule,
3271 MatListModule,
3272 TranslateModule,
3273 ],
3274 declarations: [
3275 DropDownFormSectionComponent,
3276 FieldComponent,
3277 OrderFormSectionComponent,
3278 OrderFormComponent,
3279 FieldBuilderComponent,
3280 OrderItemListComponent,
3281 PricePipe,
3282 FormatBillingFrequencyPipe,
3283 ],
3284 exports: [
3285 DropDownFormSectionComponent,
3286 FieldComponent,
3287 OrderFormSectionComponent,
3288 OrderFormComponent,
3289 FieldBuilderComponent,
3290 OrderItemListComponent,
3291 ],
3292 providers: [
3293 FieldService,
3294 OrderFormService,
3295 OrderItemListService,
3296 ]
3297 },] }
3298 ];
3299 return VaOrderFormModule;
3300}());
3301
3302/**
3303 * @fileoverview added by tsickle
3304 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3305 */
3306var StoreService = /** @class */ (function () {
3307 function StoreService() {
3308 }
3309 /**
3310 * @param {?} formGroup
3311 * @return {?}
3312 */
3313 StoreService.prototype.markFormsAsTouched = /**
3314 * @param {?} formGroup
3315 * @return {?}
3316 */
3317 function (formGroup) {
3318 for (var key in formGroup.controls) {
3319 if (formGroup.controls[key] instanceof FormGroup) {
3320 this.markFormsAsTouched((/** @type {?} */ (formGroup.controls[key])));
3321 }
3322 else {
3323 ((/** @type {?} */ (formGroup.controls[key]))).markAsTouched();
3324 ((/** @type {?} */ (formGroup.controls[key]))).updateValueAndValidity();
3325 }
3326 }
3327 };
3328 StoreService.decorators = [
3329 { type: Injectable }
3330 ];
3331 return StoreService;
3332}());
3333
3334/**
3335 * @fileoverview added by tsickle
3336 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3337 */
3338var File = /** @class */ (function () {
3339 function File(url) {
3340 this.url = url;
3341 this.url = url;
3342 }
3343 Object.defineProperty(File.prototype, "name", {
3344 get: /**
3345 * @return {?}
3346 */
3347 function () {
3348 return this.url ? this.url.substring(this.url.lastIndexOf('/') + 1, this.url.lastIndexOf('.')) : null;
3349 },
3350 enumerable: true,
3351 configurable: true
3352 });
3353 Object.defineProperty(File.prototype, "icon", {
3354 get: /**
3355 * @return {?}
3356 */
3357 function () {
3358 /** @type {?} */
3359 var ext = this.url ? this.url.substring(this.url.lastIndexOf('.') + 1) : null;
3360 switch (ext) {
3361 case 'pdf':
3362 return 'icon-pdf';
3363 case 'ppt':
3364 return 'icon-ppt';
3365 default:
3366 return 'icon-docs';
3367 }
3368 },
3369 enumerable: true,
3370 configurable: true
3371 });
3372 return File;
3373}());
3374if (false) {
3375 /** @type {?} */
3376 File.prototype.url;
3377}
3378
3379/**
3380 * @fileoverview added by tsickle
3381 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3382 */
3383/**
3384 * @record
3385 */
3386function Pricing() { }
3387if (false) {
3388 /** @type {?} */
3389 Pricing.prototype.currency;
3390 /** @type {?} */
3391 Pricing.prototype.prices;
3392}
3393/**
3394 * @record
3395 */
3396function Price() { }
3397if (false) {
3398 /** @type {?} */
3399 Price.prototype.price;
3400 /** @type {?} */
3401 Price.prototype.frequency;
3402 /** @type {?|undefined} */
3403 Price.prototype.isStartingPrice;
3404}
3405/** @type {?} */
3406var CONTACT_SALES = -1;
3407
3408/**
3409 * @fileoverview added by tsickle
3410 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3411 */
3412var Sellable = /** @class */ (function () {
3413 function Sellable() {
3414 }
3415 Object.defineProperty(Sellable.prototype, "isFree", {
3416 get: /**
3417 * @return {?}
3418 */
3419 function () {
3420 return this.pricing && this.pricing.prices ? this.pricing.prices.some((/**
3421 * @param {?} p
3422 * @return {?}
3423 */
3424 function (p) { return p.price === 0 || p.price === undefined; })) : false;
3425 },
3426 enumerable: true,
3427 configurable: true
3428 });
3429 Object.defineProperty(Sellable.prototype, "shouldContactSales", {
3430 get: /**
3431 * @return {?}
3432 */
3433 function () {
3434 return this.pricing && this.pricing.prices ?
3435 this.pricing.prices.some((/**
3436 * @param {?} p
3437 * @return {?}
3438 */
3439 function (p) { return p.price === null || p.price === CONTACT_SALES; })) ||
3440 this.pricing.prices.length === 0 : true;
3441 },
3442 enumerable: true,
3443 configurable: true
3444 });
3445 /**
3446 * @param {?} inputString
3447 * @return {?}
3448 */
3449 Sellable.getCapitalizeFirstLetter = /**
3450 * @param {?} inputString
3451 * @return {?}
3452 */
3453 function (inputString) {
3454 return inputString ? inputString.charAt(0).toUpperCase() + inputString.slice(1) : null;
3455 };
3456 Object.defineProperty(Sellable.prototype, "formattedPricingList", {
3457 get: /**
3458 * @return {?}
3459 */
3460 function () {
3461 if (this.pricing && this.pricing.prices && this.pricing.prices.length) {
3462 /** @type {?} */
3463 var hasCurrencyAndIsNotUSD = this.pricing.currency && this.pricing.currency !== 'USD';
3464 /** @type {?} */
3465 var currencyStr_1 = hasCurrencyAndIsNotUSD ? this.pricing.currency : '';
3466 /** @type {?} */
3467 var currencySymbol_1 = Sellable.getCurrencySymbol(this.pricing.currency);
3468 return this.pricing.prices.map((/**
3469 * @param {?} price
3470 * @return {?}
3471 */
3472 function (price) {
3473 /** @type {?} */
3474 var frequencyStr = price.frequency ? '/ ' + Sellable.getCapitalizeFirstLetter(price.frequency) : '';
3475 /** @type {?} */
3476 var roundedPrice = ((price.price || 0) / 100.0).toFixed(2);
3477 /** @type {?} */
3478 var startingAtPrefix = price.isStartingPrice ? 'Starting at ' : '';
3479 /** @type {?} */
3480 var priceStr = "" + startingAtPrefix + currencySymbol_1 + roundedPrice + " " + currencyStr_1 + " " + frequencyStr;
3481 return (priceStr.trim().replace(/\s+/g, ' '));
3482 }));
3483 }
3484 else {
3485 return ['Contact Sales'];
3486 }
3487 },
3488 enumerable: true,
3489 configurable: true
3490 });
3491 Object.defineProperty(Sellable.prototype, "priceStrings", {
3492 get: /**
3493 * @return {?}
3494 */
3495 function () {
3496 if (this.shouldContactSales) {
3497 return ['Contact Sales'];
3498 }
3499 if (this.isFree) {
3500 return ['Free'];
3501 }
3502 return this.formattedPricingList;
3503 },
3504 enumerable: true,
3505 configurable: true
3506 });
3507 Object.defineProperty(Sellable.prototype, "formattedWholesalePrice", {
3508 get: /**
3509 * @return {?}
3510 */
3511 function () {
3512 return this.priceStrings.join(' + ');
3513 },
3514 enumerable: true,
3515 configurable: true
3516 });
3517 /**
3518 * @param {?} currency
3519 * @return {?}
3520 */
3521 Sellable.getCurrencySymbol = /**
3522 * @param {?} currency
3523 * @return {?}
3524 */
3525 function (currency) {
3526 /** @type {?} */
3527 var currencySymbol = '$';
3528 switch (currency) {
3529 case 'EUR':
3530 currencySymbol = '\u20AC';
3531 break;
3532 case 'GBP':
3533 currencySymbol = '\u00A3';
3534 break;
3535 case 'CHF':
3536 currencySymbol = 'Fr';
3537 break;
3538 case 'CNY':
3539 currencySymbol = '\u00A5';
3540 break;
3541 case 'JPY':
3542 currencySymbol = '\u00A5';
3543 break;
3544 case 'CZK':
3545 currencySymbol = 'K\u010d';
3546 break;
3547 case 'INR':
3548 currencySymbol = '\u20B9';
3549 break;
3550 case 'KHR':
3551 currencySymbol = '\u17DB';
3552 break;
3553 case 'KRW':
3554 currencySymbol = '\u20A9';
3555 break;
3556 case 'NOK':
3557 currencySymbol = 'kr';
3558 break;
3559 case 'SEK':
3560 currencySymbol = 'kr';
3561 break;
3562 case 'RUB':
3563 currencySymbol = '\u20BD';
3564 break;
3565 case 'TRY':
3566 currencySymbol = '\u20BA';
3567 break;
3568 case 'ZAR':
3569 currencySymbol = 'R';
3570 break;
3571 default:
3572 currencySymbol = '$';
3573 break;
3574 }
3575 return currencySymbol;
3576 };
3577 return Sellable;
3578}());
3579if (false) {
3580 /** @type {?} */
3581 Sellable.prototype.pricing;
3582}
3583
3584/**
3585 * @fileoverview added by tsickle
3586 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3587 */
3588// @dynamic
3589var
3590// @dynamic
3591CaseTransform = /** @class */ (function () {
3592 function CaseTransform() {
3593 }
3594 /**
3595 * @param {?} value
3596 * @return {?}
3597 */
3598 CaseTransform.snakeToCamelCase = /**
3599 * @param {?} value
3600 * @return {?}
3601 */
3602 function (value) {
3603 return value ? value.replace(new RegExp(/_/g), ' ').replace(/\b\w/g, (/**
3604 * @param {?} l
3605 * @return {?}
3606 */
3607 function (l) { return l.toUpperCase(); }))
3608 .replace(/\b\w/, (/**
3609 * @param {?} l
3610 * @return {?}
3611 */
3612 function (l) { return l.toLowerCase(); })).replace(/\s/g, '') : value;
3613 };
3614 /**
3615 * @param {?} value
3616 * @return {?}
3617 */
3618 CaseTransform.lowerToTitleCase = /**
3619 * @param {?} value
3620 * @return {?}
3621 */
3622 function (value) {
3623 // Code taken from https://github.com/gouch/to-title-case to support the proper spec.
3624 /** @type {?} */
3625 var smallWords = /^(a|an|and|as|at|but|by|en|for|if|in|nor|of|on|or|per|the|to|vs?\.?|via)$/i;
3626 return value ? value.replace(/[A-Za-z0-9\u00C0-\u00FF]+[^\s-]*/g, (/**
3627 * @param {?} match
3628 * @param {?} index
3629 * @param {?} title
3630 * @return {?}
3631 */
3632 function (match, index, title) {
3633 if (index > 0 && index + match.length !== title.length &&
3634 match.search(smallWords) > -1 && title.charAt(index - 2) !== ':' &&
3635 (title.charAt(index + match.length) !== '-' || title.charAt(index - 1) === '-') &&
3636 title.charAt(index - 1).search(/[^\s-]/) < 0) {
3637 return match.toLowerCase();
3638 }
3639 if (match.substr(1).search(/[A-Z]|\../) > -1) {
3640 return match;
3641 }
3642 return match.charAt(0).toUpperCase() + match.substr(1);
3643 })) : value;
3644 };
3645 ;
3646 return CaseTransform;
3647}());
3648
3649/**
3650 * @fileoverview added by tsickle
3651 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3652 */
3653/** @type {?} */
3654var COLOR_CODES = [
3655 '#EF5350', '#42A5F5', '#66BB6A', '#FFA726', '#AB47BC', '#FFCA28', '#EC407A', '#26C6DA',
3656 '#FF7B57'
3657];
3658/** @type {?} */
3659var DEFAULT_COLOR = '#808080';
3660var Product = /** @class */ (function (_super) {
3661 __extends(Product, _super);
3662 function Product(data) {
3663 var _this = _super.call(this) || this;
3664 _this.addons = [];
3665 data = data || {};
3666 _this.pricing = data.pricing;
3667 _this.productId = data.productId;
3668 _this.editionId = data.editionId;
3669 _this.editionName = data.editionName;
3670 _this.name = data.name;
3671 _this.description = data.description;
3672 _this.tagline = data.tagline;
3673 _this.iconUrl = data.iconUrl;
3674 _this.entryUrl = data.entryUrl;
3675 _this.screenshotUrls = data.screenshotUrls;
3676 _this.pdfUploadUrls = data.pdfUploadUrls;
3677 _this.lmiCategories = data.lmiCategories;
3678 _this.keySellingPoints = data.keySellingPoints;
3679 _this.faqs = data.faqs;
3680 _this.wholesalePrice = data.wholesalePrice;
3681 _this.currency = data.currency;
3682 _this.billingFrequency = data.billingFrequency;
3683 _this.isArchived = data.isArchived;
3684 _this.addons = data.addons;
3685 _this.restrictions = data.restrictions;
3686 _this.billingId = data.billingId;
3687 if (data.hasOwnProperty('pdfUploadUrls')) {
3688 _this.files = _this.pdfUploadUrls ? _this.pdfUploadUrls.map((/**
3689 * @param {?} url
3690 * @return {?}
3691 */
3692 function (url) { return new File(url); })) : null;
3693 }
3694 return _this;
3695 }
3696 /**
3697 * @param {?} data
3698 * @return {?}
3699 */
3700 Product.fromApi = /**
3701 * @param {?} data
3702 * @return {?}
3703 */
3704 function (data) {
3705 /** @type {?} */
3706 var newProduct = {};
3707 data = data || {};
3708 for (var key in data) {
3709 if (data.hasOwnProperty(key)) {
3710 /** @type {?} */
3711 var newKey = CaseTransform.snakeToCamelCase(key);
3712 newProduct[newKey] = data[key];
3713 }
3714 }
3715 return new Product(newProduct);
3716 };
3717 Object.defineProperty(Product.prototype, "iconStyle", {
3718 get: /**
3719 * @return {?}
3720 */
3721 function () {
3722 return this.iconUrl ? "url(\"" + this.iconUrl + "\") no-repeat center / 100% 100%" : null;
3723 },
3724 enumerable: true,
3725 configurable: true
3726 });
3727 Object.defineProperty(Product.prototype, "iconColor", {
3728 get: /**
3729 * @return {?}
3730 */
3731 function () {
3732 // determine an icon color for a product with no icon by using the product name
3733 if (!this.name) {
3734 return DEFAULT_COLOR;
3735 }
3736 /** @type {?} */
3737 var nameSum = 0;
3738 for (var i = 0; i < this.name.length; i++) {
3739 nameSum += this.name[i].charCodeAt(0);
3740 }
3741 /** @type {?} */
3742 var index = nameSum % COLOR_CODES.length;
3743 return COLOR_CODES[index];
3744 },
3745 enumerable: true,
3746 configurable: true
3747 });
3748 /**
3749 * @return {?}
3750 */
3751 Product.prototype.getLmiCategoryNames = /**
3752 * @return {?}
3753 */
3754 function () {
3755 /** @type {?} */
3756 var lmiCategories = this.lmiCategories || [];
3757 return lmiCategories.map((/**
3758 * @param {?} lmiCategory
3759 * @return {?}
3760 */
3761 function (lmiCategory) { return CaseTransform.lowerToTitleCase(lmiCategory.toLowerCase().replace(/_/g, ' ')); }));
3762 };
3763 return Product;
3764}(Sellable));
3765if (false) {
3766 /** @type {?} */
3767 Product.prototype.productId;
3768 /** @type {?} */
3769 Product.prototype.editionId;
3770 /** @type {?} */
3771 Product.prototype.editionName;
3772 /** @type {?} */
3773 Product.prototype.name;
3774 /** @type {?} */
3775 Product.prototype.description;
3776 /** @type {?} */
3777 Product.prototype.tagline;
3778 /** @type {?} */
3779 Product.prototype.iconUrl;
3780 /** @type {?} */
3781 Product.prototype.entryUrl;
3782 /** @type {?} */
3783 Product.prototype.screenshotUrls;
3784 /** @type {?} */
3785 Product.prototype.pdfUploadUrls;
3786 /** @type {?} */
3787 Product.prototype.lmiCategories;
3788 /** @type {?} */
3789 Product.prototype.keySellingPoints;
3790 /** @type {?} */
3791 Product.prototype.faqs;
3792 /** @type {?} */
3793 Product.prototype.wholesalePrice;
3794 /** @type {?} */
3795 Product.prototype.currency;
3796 /** @type {?} */
3797 Product.prototype.billingFrequency;
3798 /** @type {?} */
3799 Product.prototype.billingId;
3800 /** @type {?} */
3801 Product.prototype.isArchived;
3802 /** @type {?} */
3803 Product.prototype.addons;
3804 /** @type {?} */
3805 Product.prototype.files;
3806 /** @type {?} */
3807 Product.prototype.restrictions;
3808 /** @type {?} */
3809 Product.prototype.trialConfiguration;
3810}
3811var ProductWithParent = /** @class */ (function (_super) {
3812 __extends(ProductWithParent, _super);
3813 function ProductWithParent(data) {
3814 var _this = _super.call(this, data) || this;
3815 _this.parentId = data.parentId;
3816 _this.parentName = data.parentName;
3817 _this.parentIconUrl = data.parentIconUrl;
3818 _this.multipleActivations = data.multipleActivations || false;
3819 return _this;
3820 }
3821 /**
3822 * @param {?} data
3823 * @return {?}
3824 */
3825 ProductWithParent.fromApi = /**
3826 * @param {?} data
3827 * @return {?}
3828 */
3829 function (data) {
3830 /** @type {?} */
3831 var newProduct = {};
3832 data = data || {};
3833 for (var key in data) {
3834 if (data.hasOwnProperty(key)) {
3835 /** @type {?} */
3836 var newKey = CaseTransform.snakeToCamelCase(key);
3837 newProduct[newKey] = data[key];
3838 }
3839 }
3840 return new ProductWithParent(newProduct);
3841 };
3842 return ProductWithParent;
3843}(Product));
3844if (false) {
3845 /** @type {?} */
3846 ProductWithParent.prototype.parentId;
3847 /** @type {?} */
3848 ProductWithParent.prototype.parentName;
3849 /** @type {?} */
3850 ProductWithParent.prototype.parentIconUrl;
3851 /** @type {?} */
3852 ProductWithParent.prototype.multipleActivations;
3853}
3854/**
3855 * @record
3856 */
3857function TrialConfigurationInterface() { }
3858if (false) {
3859 /** @type {?} */
3860 TrialConfigurationInterface.prototype.trialEnabled;
3861 /** @type {?} */
3862 TrialConfigurationInterface.prototype.trialDuration;
3863}
3864
3865/**
3866 * @fileoverview added by tsickle
3867 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3868 */
3869var AddonDetailsComponent = /** @class */ (function () {
3870 function AddonDetailsComponent() {
3871 this.hasVerifiedContract = false;
3872 this.loaded = true;
3873 this.showPricing = true;
3874 this.showEnableAddon = false;
3875 this.actionEnabled = false;
3876 this.prerequisiteSelected = new EventEmitter();
3877 this.actionSelected = new EventEmitter();
3878 }
3879 /**
3880 * @return {?}
3881 */
3882 AddonDetailsComponent.prototype.onPrerequisiteSelected = /**
3883 * @return {?}
3884 */
3885 function () {
3886 this.prerequisiteSelected.emit();
3887 };
3888 /**
3889 * @return {?}
3890 */
3891 AddonDetailsComponent.prototype.onActionSelected = /**
3892 * @return {?}
3893 */
3894 function () {
3895 this.actionSelected.emit();
3896 };
3897 /**
3898 * @param {?} product
3899 * @param {?} addon
3900 * @return {?}
3901 */
3902 AddonDetailsComponent.prototype.getPricing = /**
3903 * @param {?} product
3904 * @param {?} addon
3905 * @return {?}
3906 */
3907 function (product, addon) {
3908 return {
3909 currency: product.currency,
3910 prices: [
3911 {
3912 price: addon.price,
3913 frequency: addon.billingFrequency ? addon.billingFrequency : 'Monthly'
3914 }
3915 ]
3916 };
3917 };
3918 Object.defineProperty(AddonDetailsComponent.prototype, "pricingLabel", {
3919 get: /**
3920 * @return {?}
3921 */
3922 function () {
3923 return this.reseller ? 'Wholesale Pricing' : 'Pricing';
3924 },
3925 enumerable: true,
3926 configurable: true
3927 });
3928 AddonDetailsComponent.decorators = [
3929 { type: Component, args: [{
3930 selector: 'addon-details',
3931 template: "<div class=\"addon-page\">\n <va-header-container [iconUrl]=\"addon.icon\"\n [title]=\"addon.title\"\n [tagline]=\"addon.tagline\"\n [chipLabels]=\"product.getLmiCategoryNames()\"\n [pricing]=\"getPricing(product, addon)\"\n [pricingLabel]=\"pricingLabel\"\n [prerequisiteLabel]=\"product.name\"\n [billedProduct]=\"billedProduct\"\n [hasVerifiedContract]=\"hasVerifiedContract\"\n [loaded]=\"loaded\"\n [showPricing]=\"showPricing\"\n [actionLabel]=\"'Enable Add-on'\"\n [showEnableAddon]=\"showEnableAddon\"\n (actionSelected)=\"onActionSelected()\"\n (prerequisiteSelected)=\"onPrerequisiteSelected()\">\n </va-header-container>\n\n <div class=\"addon-details addon-content\">\n <ng-container *ngIf=\"reseller\">\n <div class=\"left-column\">\n <div *ngIf=\"addon.resellerMarketing?.description || addon.resellerMarketing?.keySellingPoints\">\n <va-selling-info [description]=\"addon.resellerMarketing?.description\"\n [keySellingPoints]=\"addon.resellerMarketing?.keySellingPoints\"></va-selling-info>\n </div>\n <section *ngIf=\"addon.resellerMarketing?.faqs?.length > 0 && addon.resellerMarketing?.faqs[0].question\">\n <h2 class=\"va-addon-title\">FAQs</h2>\n <va-faqs [faqs]=\"addon.resellerMarketing?.faqs\"></va-faqs>\n </section>\n </div>\n <div class=\"right-column\">\n <section *ngIf=\"addon.restrictions?.country?.whitelist\">\n <supported-countries [countryCodes]=\"addon.restrictions.country.whitelist\"></supported-countries>\n </section>\n <section *ngIf=\"addon.screenshots?.length > 0\">\n <h2 class=\"va-addon-title\">Gallery</h2>\n <va-image-gallery [imageUrls]=\"addon.screenshots\"></va-image-gallery>\n </section>\n <section *ngIf=\"addon.resellerMarketing?.files?.length > 0\">\n <h2 class=\"va-addon-title\">Files</h2>\n <va-files [files]=\"addon.resellerMarketingFiles\"></va-files>\n </section>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"!reseller\">\n <div class=\"left-column\">\n <div *ngIf=\"addon.endUserMarketing?.description || addon.endUserMarketing?.keySellingPoints\">\n <va-selling-info [description]=\"addon.endUserMarketing?.description\"\n [keySellingPoints]=\"addon.endUserMarketing?.keySellingPoints\"></va-selling-info>\n </div>\n <section *ngIf=\"addon.endUserMarketing?.faqs?.length > 0 && addon.endUserMarketing?.faqs[0].question\">\n <h2 class=\"va-addon-title\">FAQs</h2>\n <va-faqs [faqs]=\"addon.endUserMarketing?.faqs\"></va-faqs>\n </section>\n </div>\n\n <div class=\"right-column\">\n <section *ngIf=\"addon.restrictions?.country?.whitelist?.length > 0\">\n <supported-countries [countryCodes]=\"addon.restrictions.country.whitelist\"></supported-countries>\n </section>\n <section *ngIf=\"addon.screenshots?.length > 0\">\n <h2 class=\"va-addon-title\">Gallery</h2>\n <va-image-gallery [imageUrls]=\"addon.screenshots\"></va-image-gallery>\n </section>\n <section *ngIf=\"addon.endUserMarketing?.files?.length > 0\">\n <h2 class=\"va-addon-title\">Files</h2>\n <va-files [files]=\"addon.endUserMarketingFiles\"></va-files>\n </section>\n </div>\n </ng-container>\n </div>\n\n</div>\n",
3932 styles: [":host{display:block;font-size:14px;line-height:1.4}:host *{box-sizing:border-box}.va-addon-title{font-size:32px;font-weight:300;margin-top:0;color:#212121}@media screen and (min-width:600px){.va-addon-title{font-size:32px}}img{max-width:100%}va-icon{display:inline-block}.addon-page{position:relative;margin:0 auto 20px;background:#fff;box-shadow:0 3px 10px rgba(33,33,33,.3);overflow:hidden;font-size:16px;color:#212121}.addon-page .item-amount{color:#999;font-size:14px;text-align:right;margin:0 24px 8px}section{padding:24px}.left-column{width:66%}@media screen and (max-width:600px){.left-column{width:100%}}.right-column{width:34%}.addon-content{display:-webkit-box;display:flex}@media screen and (max-width:600px){.right-column{width:100%}.addon-content{-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}}"]
3933 }] }
3934 ];
3935 AddonDetailsComponent.propDecorators = {
3936 product: [{ type: Input }],
3937 addon: [{ type: Input }],
3938 reseller: [{ type: Input }],
3939 billedProduct: [{ type: Input }],
3940 hasVerifiedContract: [{ type: Input }],
3941 loaded: [{ type: Input }],
3942 showPricing: [{ type: Input }],
3943 showEnableAddon: [{ type: Input }],
3944 actionEnabled: [{ type: Input }],
3945 prerequisiteSelected: [{ type: Output }],
3946 actionSelected: [{ type: Output }]
3947 };
3948 return AddonDetailsComponent;
3949}());
3950if (false) {
3951 /** @type {?} */
3952 AddonDetailsComponent.prototype.product;
3953 /** @type {?} */
3954 AddonDetailsComponent.prototype.addon;
3955 /** @type {?} */
3956 AddonDetailsComponent.prototype.reseller;
3957 /** @type {?} */
3958 AddonDetailsComponent.prototype.billedProduct;
3959 /** @type {?} */
3960 AddonDetailsComponent.prototype.hasVerifiedContract;
3961 /** @type {?} */
3962 AddonDetailsComponent.prototype.loaded;
3963 /** @type {?} */
3964 AddonDetailsComponent.prototype.showPricing;
3965 /** @type {?} */
3966 AddonDetailsComponent.prototype.showEnableAddon;
3967 /** @type {?} */
3968 AddonDetailsComponent.prototype.actionEnabled;
3969 /** @type {?} */
3970 AddonDetailsComponent.prototype.prerequisiteSelected;
3971 /** @type {?} */
3972 AddonDetailsComponent.prototype.actionSelected;
3973}
3974
3975/**
3976 * @fileoverview added by tsickle
3977 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3978 */
3979var VaFilesComponent = /** @class */ (function () {
3980 function VaFilesComponent() {
3981 }
3982 VaFilesComponent.decorators = [
3983 { type: Component, args: [{
3984 selector: 'va-files',
3985 template: "\n <div class=\"va-files file-list-container\" *ngFor=\"let file of files\">\n <mat-icon class=\"file-icon\">insert_drive_file</mat-icon>\n <a [href]=\"file.url\" target=\"_blank\">{{ file.name }}</a>\n </div>",
3986 styles: [".va-files{display:-webkit-inline-box;display:inline-flex;margin-bottom:16px}.va-files a{color:#212121;font-size:16px;font-weight:700;-ms-grid-row-align:center;align-self:center;padding-left:8px;text-decoration:none}.va-files .file-icon{vertical-align:middle}.va-files .file-list-container{display:-webkit-box;display:flex}"]
3987 }] }
3988 ];
3989 VaFilesComponent.propDecorators = {
3990 files: [{ type: Input }]
3991 };
3992 return VaFilesComponent;
3993}());
3994if (false) {
3995 /** @type {?} */
3996 VaFilesComponent.prototype.files;
3997}
3998
3999/**
4000 * @fileoverview added by tsickle
4001 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4002 */
4003var VaFilesModule = /** @class */ (function () {
4004 function VaFilesModule() {
4005 }
4006 VaFilesModule.decorators = [
4007 { type: NgModule, args: [{
4008 imports: [
4009 CommonModule,
4010 MatIconModule
4011 ],
4012 declarations: [VaFilesComponent],
4013 exports: [VaFilesComponent]
4014 },] }
4015 ];
4016 return VaFilesModule;
4017}());
4018
4019/**
4020 * @fileoverview added by tsickle
4021 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4022 */
4023var VaFaqsComponent = /** @class */ (function () {
4024 function VaFaqsComponent() {
4025 this.openFaqs = [];
4026 }
4027 /**
4028 * @param {?} index
4029 * @return {?}
4030 */
4031 VaFaqsComponent.prototype.toggleFaq = /**
4032 * @param {?} index
4033 * @return {?}
4034 */
4035 function (index) {
4036 if (this.openFaqs.indexOf(index) >= 0) {
4037 this.openFaqs.splice(this.openFaqs.indexOf(index), 1); // Remove
4038 }
4039 else {
4040 this.openFaqs.push(index); // Insert
4041 }
4042 };
4043 /**
4044 * @param {?} index
4045 * @return {?}
4046 */
4047 VaFaqsComponent.prototype.isFaqOpen = /**
4048 * @param {?} index
4049 * @return {?}
4050 */
4051 function (index) {
4052 return this.openFaqs.indexOf(index) >= 0;
4053 };
4054 /**
4055 * @param {?} index
4056 * @return {?}
4057 */
4058 VaFaqsComponent.prototype.faqIcon = /**
4059 * @param {?} index
4060 * @return {?}
4061 */
4062 function (index) {
4063 return this.isFaqOpen(index) ? 'keyboard_arrow_up' : 'keyboard_arrow_down';
4064 };
4065 VaFaqsComponent.decorators = [
4066 { type: Component, args: [{
4067 selector: 'va-faqs',
4068 template: "\n <div class=\"va-faq\" *ngFor=\"let faq of faqs; let i = index;\">\n <div class=\"question\" (click)=\"toggleFaq(i)\">\n <span>{{ faq.question }}</span>\n <mat-icon>{{ faqIcon(i) }}</mat-icon>\n </div>\n <span class=\"answer\" [ngClass]=\"{'show': isFaqOpen(i) }\" [innerHtml]=\"faq.answer | vaSanitize\"></span>\n </div>",
4069 styles: [".va-faq{font-size:16px;display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;-webkit-box-pack:start;justify-content:flex-start;padding:12px 0;border-bottom:1px solid #e0e0e0}.va-faq:first-of-type{border-top:1px solid #e0e0e0}.va-faq .question{display:-webkit-box;display:flex;-webkit-box-pack:justify;justify-content:space-between;-webkit-box-align:center;align-items:center;color:#212121;cursor:pointer}.va-faq .answer{color:#616161;height:0;overflow:hidden}.va-faq .show{padding-top:12px;height:inherit}"]
4070 }] }
4071 ];
4072 VaFaqsComponent.propDecorators = {
4073 faqs: [{ type: Input }]
4074 };
4075 return VaFaqsComponent;
4076}());
4077if (false) {
4078 /** @type {?} */
4079 VaFaqsComponent.prototype.faqs;
4080 /** @type {?} */
4081 VaFaqsComponent.prototype.openFaqs;
4082}
4083
4084/**
4085 * @fileoverview added by tsickle
4086 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4087 */
4088var VaFaqsModule = /** @class */ (function () {
4089 function VaFaqsModule() {
4090 }
4091 VaFaqsModule.decorators = [
4092 { type: NgModule, args: [{
4093 imports: [CommonModule, MatIconModule, VaSafeHtmlModule],
4094 declarations: [VaFaqsComponent],
4095 exports: [VaFaqsComponent]
4096 },] }
4097 ];
4098 return VaFaqsModule;
4099}());
4100
4101/**
4102 * @fileoverview added by tsickle
4103 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4104 */
4105var VaSellingInfoComponent = /** @class */ (function () {
4106 function VaSellingInfoComponent() {
4107 }
4108 Object.defineProperty(VaSellingInfoComponent.prototype, "filterDescription", {
4109 get: /**
4110 * @return {?}
4111 */
4112 function () {
4113 /** @type {?} */
4114 var desc = this.description.replace(/max-width:\d*[^\"]/i, 'max-width:100%');
4115 if ((desc.indexOf('"max-width:100%"') === -1) && (desc.indexOf('<iframe ') !== -1)) {
4116 /** @type {?} */
4117 var index = desc.indexOf('<iframe ') + 7;
4118 return desc.substr(0, index) + ' style="max-width:100%"' + desc.substr(index);
4119 }
4120 return String(desc);
4121 },
4122 enumerable: true,
4123 configurable: true
4124 });
4125 VaSellingInfoComponent.decorators = [
4126 { type: Component, args: [{
4127 selector: 'va-selling-info',
4128 template: "\n <section *ngIf=\"description\" class=\"resize\" [innerHtml]=\"filterDescription | vaSafeHtml\"></section>\n <section *ngIf=\"keySellingPoints && keySellingPoints.length > 0\" class=\"key-selling-points\">\n <div *ngFor=\"let ksp of keySellingPoints\" class=\"key-selling-point\">\n <mat-icon>check_circle</mat-icon>\n {{ ksp }}\n </div>\n </section>\n ",
4129 styles: ["section{padding:24px}section ::ng-deep>:first-child{margin-top:0;padding-top:0}#description *{max-width:100%!important}.key-selling-point{display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;padding-bottom:24px;font-size:16px}@media screen and (max-width:600px){.resize{font-size:16px}.key-selling-point{-webkit-box-align:start;align-items:flex-start}}.key-selling-point:last-of-type{padding-bottom:0}.key-selling-point mat-icon{color:#4caf50;font-size:32px;width:32px;height:32px;margin-right:20px}"]
4130 }] }
4131 ];
4132 VaSellingInfoComponent.propDecorators = {
4133 description: [{ type: Input }],
4134 keySellingPoints: [{ type: Input }]
4135 };
4136 return VaSellingInfoComponent;
4137}());
4138if (false) {
4139 /** @type {?} */
4140 VaSellingInfoComponent.prototype.description;
4141 /** @type {?} */
4142 VaSellingInfoComponent.prototype.keySellingPoints;
4143}
4144
4145/**
4146 * @fileoverview added by tsickle
4147 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4148 */
4149var VaSellingInfoModule = /** @class */ (function () {
4150 function VaSellingInfoModule() {
4151 }
4152 VaSellingInfoModule.decorators = [
4153 { type: NgModule, args: [{
4154 imports: [CommonModule, MatIconModule, VaSafeHtmlModule],
4155 declarations: [VaSellingInfoComponent],
4156 exports: [VaSellingInfoComponent]
4157 },] }
4158 ];
4159 return VaSellingInfoModule;
4160}());
4161
4162/**
4163 * @fileoverview added by tsickle
4164 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4165 */
4166var SupportedCountriesComponent = /** @class */ (function () {
4167 function SupportedCountriesComponent() {
4168 }
4169 SupportedCountriesComponent.decorators = [
4170 { type: Component, args: [{
4171 selector: 'supported-countries',
4172 template: "\n <span class=\"supported-text\"> Supported Countries: </span>\n <div class=\"flags\">\n <span *ngFor=\"let countryCode of countryCodes\" matTooltip=\"{{countryCode}}\" matTooltipPosition=\"below\"\n class=\"flag-icon flag-icon-{{countryCode.toLowerCase()}}\">\n </span>\n </div>\n ",
4173 styles: [".flag-icon{margin-right:10px}.supported-text{margin-right:3px}.flags{display:inline-block}"]
4174 }] }
4175 ];
4176 SupportedCountriesComponent.propDecorators = {
4177 countryCodes: [{ type: Input }]
4178 };
4179 return SupportedCountriesComponent;
4180}());
4181if (false) {
4182 /** @type {?} */
4183 SupportedCountriesComponent.prototype.countryCodes;
4184}
4185
4186/**
4187 * @fileoverview added by tsickle
4188 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4189 */
4190var RestrictionsModule = /** @class */ (function () {
4191 function RestrictionsModule() {
4192 }
4193 RestrictionsModule.decorators = [
4194 { type: NgModule, args: [{
4195 imports: [CommonModule, MatTooltipModule],
4196 declarations: [SupportedCountriesComponent],
4197 exports: [SupportedCountriesComponent]
4198 },] }
4199 ];
4200 return RestrictionsModule;
4201}());
4202
4203/**
4204 * @fileoverview added by tsickle
4205 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4206 */
4207var AddonModule = /** @class */ (function () {
4208 function AddonModule() {
4209 }
4210 AddonModule.decorators = [
4211 { type: NgModule, args: [{
4212 imports: [
4213 CommonModule,
4214 VaListModule,
4215 VaImageGalleryModule,
4216 VaIconModule,
4217 VaPricingModule,
4218 VaFilesModule,
4219 VaFaqsModule,
4220 VaSellingInfoModule,
4221 VaHeaderContainerModule,
4222 VaSafeHtmlModule,
4223 MatProgressSpinnerModule$1,
4224 VaBreadcrumbsModule,
4225 RestrictionsModule
4226 ],
4227 exports: [AddonDetailsComponent],
4228 declarations: [AddonDetailsComponent],
4229 providers: [],
4230 entryComponents: []
4231 },] }
4232 ];
4233 return AddonModule;
4234}());
4235
4236/**
4237 * @fileoverview added by tsickle
4238 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4239 */
4240var DetailsStencilComponent = /** @class */ (function () {
4241 function DetailsStencilComponent() {
4242 }
4243 DetailsStencilComponent.decorators = [
4244 { type: Component, args: [{
4245 selector: 'details-stencil',
4246 template: "\n <div class=\"details\">\n\n <mat-card class=\"details-header\">\n <div class=\"details-column-0\">\n <div class=\"details-column-0-1\">\n <div class=\"details-icon stencil-shimmer\"></div>\n </div>\n <div class=\"details-column-0-2\">\n <div class=\"details-title stencil-shimmer\"></div>\n <div class=\"details-title stencil-shimmer\"></div>\n </div>\n </div>\n <div class=\"details-column-1\">\n <div class=\"details-column-1-0 stencil-shimmer\"></div>\n <div class=\"details-column-1-1 stencil-shimmer\"></div>\n </div>\n </mat-card>\n\n <mat-card>\n <div class=\"details-box-large stencil-shimmer\"></div>\n </mat-card>\n\n <mat-card class=\"details-body\">\n <div class=\"details-body-column-0\" >\n <div class=\"details-icon-small stencil-shimmer\"></div>\n <div class=\"details-icon-small stencil-shimmer\"></div>\n <div class=\"details-icon-small stencil-shimmer\"></div>\n <div class=\"details-icon-small stencil-shimmer\"></div>\n <div class=\"details-icon-small stencil-shimmer\"></div>\n <div class=\"details-icon-small stencil-shimmer\"></div>\n <div class=\"details-icon-small stencil-shimmer\"></div>\n </div>\n <div class=\"details-body-column-1\">\n <div class=\"details-line stencil-shimmer\"></div>\n <div class=\"details-line stencil-shimmer\"></div>\n <div class=\"details-line stencil-shimmer\"></div>\n <div class=\"details-line stencil-shimmer\"></div>\n <div class=\"details-line stencil-shimmer\"></div>\n <div class=\"details-line stencil-shimmer\"></div>\n <div class=\"details-line stencil-shimmer\"></div>\n </div>\n <div class=\"details-body-column-2\">\n <div class=\"details-box stencil-shimmer\"></div>\n <div class=\"details-box stencil-shimmer\"></div>\n <div class=\"details-box stencil-shimmer\"></div>\n <div class=\"details-box stencil-shimmer\"></div>\n <div class=\"details-box stencil-shimmer\"></div>\n </div>\n </mat-card>\n\n </div>\n ",
4247 styles: [".details{position:relative;margin:0 auto 20px;background:#fff;box-shadow:0 3px 10px rgba(33,33,33,.3);overflow:hidden;font-size:16px}.details-header{display:-webkit-box;display:flex;height:180px}.details-column-0{display:-webkit-box;display:flex;width:66%}@media screen and (max-width:600px){.details-column-0{width:100%}}.details-column-0-1{display:-webkit-box;display:flex;width:25%;min-width:120px}@media screen and (max-width:600px){.details-column-0-1{width:50%}}.details-icon{height:120px;width:120px;border-radius:50%}.details-title{margin:20px 0 20px 20px;height:32px;width:250px}@media screen and (max-width:600px){.details-title{width:120px}}.details-column-1{width:34%;display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}@media screen and (max-width:1100px){.details-column-1{width:0}}.details-column-1-0{height:32px;margin:10px 0}.details-column-1-1{height:70px}@media screen and (max-width:600px){.details-column-1-0{width:0;margin:0}.details-column-1-1{height:0}}.details-box-large{display:-webkit-box;display:flex;width:650px;height:150px}@media screen and (max-width:1100px){.details-box-large{width:100%}}.details-body{display:-webkit-box;display:flex;height:500px;width:100%}.details-body-column-0{width:10%;display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}@media screen and (max-width:600px){.details-body-column-0{width:0%}}.details-body-column-1{width:56%;display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}@media screen and (max-width:600px){.details-body-column-1{width:100%}}.details-icon-small{margin-bottom:24px;display:-webkit-box;display:flex;height:32px;width:32px;border-radius:50%}.details-line{margin-bottom:24px;height:32px;width:400px}@media screen and (max-width:600px){.details-line{width:100%;margin-right:10px}}.details-body-column-2{width:34%;display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}@media screen and (max-width:1100px){.details-body-column-2{width:0}}.details-box{height:70px;margin-bottom:10px}@media screen and (max-width:600px){.details-box{width:0;margin:0}}"]
4248 }] }
4249 ];
4250 return DetailsStencilComponent;
4251}());
4252
4253/**
4254 * @fileoverview added by tsickle
4255 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4256 */
4257var CardStencilComponent = /** @class */ (function () {
4258 function CardStencilComponent() {
4259 }
4260 CardStencilComponent.decorators = [
4261 { type: Component, args: [{
4262 selector: 'card-stencil',
4263 template: "\n <div class=\"card-stencil-container\">\n <mat-card class=\"card-stencil\">\n <div class=\"card-stencil-header stencil-shimmer\"></div>\n <div class=\"card-stencil-footer\">\n <div class=\"card-stencil-circle stencil-shimmer\"></div>\n <div>\n <div class=\"card-stencil-line-large stencil-shimmer\"></div>\n <div class=\"card-stencil-line-medium stencil-shimmer\"></div>\n </div>\n </div>\n </mat-card>\n </div>\n ",
4264 styles: [".card-stencil-container{position:relative;width:100%;padding-bottom:100%;margin-bottom:-45%}.card-stencil{position:absolute;width:100%;height:55%;padding:0;margin-bottom:0}.card-stencil-header{display:-webkit-box;display:flex;height:60%}.card-stencil-footer{display:-webkit-box;display:flex;height:40%;-webkit-box-align:center;align-items:center}.card-stencil-circle{margin:0 16px;height:60px;width:60px;border-radius:50%}@media screen and (max-width:650px){.card-stencil-circle{width:45px;height:45px}}.card-stencil-line-large{height:20px;width:200px;margin-bottom:10px}@media screen and (max-width:650px){.card-stencil-line-large{width:100px;height:10px}}.card-stencil-line-medium{height:20px;width:160px}@media screen and (max-width:650px){.card-stencil-line-medium{width:80px;height:10px}}"]
4265 }] }
4266 ];
4267 return CardStencilComponent;
4268}());
4269
4270/**
4271 * @fileoverview added by tsickle
4272 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4273 */
4274var CardListStencilComponent = /** @class */ (function () {
4275 function CardListStencilComponent() {
4276 this.numCards = 3;
4277 this.cards = [];
4278 }
4279 /**
4280 * @return {?}
4281 */
4282 CardListStencilComponent.prototype.ngOnInit = /**
4283 * @return {?}
4284 */
4285 function () {
4286 for (var n = 0; n < this.numCards; n++) {
4287 this.cards.push(n);
4288 }
4289 };
4290 CardListStencilComponent.decorators = [
4291 { type: Component, args: [{
4292 selector: 'card-stencil-list',
4293 template: "\n <div class=\"row row-gutters\">\n <div *ngFor=\"let _ of cards\" class=\"col-flex\">\n <card-stencil></card-stencil>\n </div>\n </div>\n ",
4294 styles: ["\n .row {\n display: flex;\n flex-wrap: wrap;\n }\n\n .row + .row-gutters {\n margin-top: 0;\n }\n\n .row-gutters {\n margin-top: -20px;\n margin-left: -20px;\n }\n\n .row-gutters > .col-flex {\n padding-top: 20px;\n padding-left: 20px;\n }\n\n .col-flex {\n position: relative;\n max-width: 100%;\n box-sizing: border-box;\n flex: 0 0 auto;\n width: 100%;\n }\n\n @media screen and (min-width: 480px) {\n .col-flex {\n width: 50%;\n }\n }\n\n @media screen and (min-width: 1200px) {\n\n .col-flex {\n width: 33.333333%;\n }\n }\n\n "]
4295 }] }
4296 ];
4297 CardListStencilComponent.propDecorators = {
4298 numCards: [{ type: Input }]
4299 };
4300 return CardListStencilComponent;
4301}());
4302if (false) {
4303 /** @type {?} */
4304 CardListStencilComponent.prototype.numCards;
4305 /** @type {?} */
4306 CardListStencilComponent.prototype.cards;
4307}
4308
4309/**
4310 * @fileoverview added by tsickle
4311 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4312 */
4313var SearchBarStencilComponent = /** @class */ (function () {
4314 function SearchBarStencilComponent() {
4315 }
4316 SearchBarStencilComponent.decorators = [
4317 { type: Component, args: [{
4318 selector: 'search-bar-stencil',
4319 template: "\n <div class=\"search-bar-stencil-container\">\n <div class=\"search-bar-stencil-line stencil-shimmer\">\n <div class=\"search-bar-stencil-icon\"></div>\n </div>\n </div>\n ",
4320 styles: ["\n .search-bar-stencil-container {\n height: 52px;\n display: flex;\n align-content: center;\n background-color: white;\n border-radius: 2px;\n }\n .search-bar-stencil-line {\n height: 30px;\n width: 350px;\n margin: auto 10px;\n display: flex;\n justify-content: flex-end;\n }\n .search-bar-stencil-icon {\n background-color: white;\n width: 20px;\n height: 20px;\n margin: auto 5px;\n }\n "]
4321 }] }
4322 ];
4323 return SearchBarStencilComponent;
4324}());
4325
4326/**
4327 * @fileoverview added by tsickle
4328 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4329 */
4330var ListStencilComponent = /** @class */ (function () {
4331 function ListStencilComponent() {
4332 this.showHeader = true;
4333 this.numRows = 3;
4334 this.rowHeight = '51px'; // defaults to height of partner center business tab height (95px for marketplace)
4335 // defaults to height of partner center business tab height (95px for marketplace)
4336 this.sidePadding = '17px'; // defaults to padding on partner center business padding (38px for marketplace)
4337 // defaults to padding on partner center business padding (38px for marketplace)
4338 this.rows = []; // this is to turn the number of rows into an arbitrary list so we can loop through them
4339 }
4340 /**
4341 * @return {?}
4342 */
4343 ListStencilComponent.prototype.ngOnInit = /**
4344 * @return {?}
4345 */
4346 function () {
4347 for (var n = 0; n < this.numRows; n++) {
4348 this.rows.push(n);
4349 }
4350 // if you think this is gross i agree
4351 // if you think this is gross and actually have a solution hit me up otherwise just enjoy the magic.
4352 // determine the height of each row for the table
4353 this.listItemRowStyles = {
4354 'height': "" + this.rowHeight,
4355 'padding': "0 " + this.sidePadding
4356 };
4357 };
4358 ListStencilComponent.decorators = [
4359 { type: Component, args: [{
4360 selector: 'list-stencil',
4361 template: "\n <mat-card class=\"list-container\">\n <div *ngIf=\"showHeader\" class=\"list-header stencil-shimmer\" style=\"\"></div>\n <div *ngFor=\"let _ of rows\">\n <div class=\"list-item-row\" [ngStyle]=\"listItemRowStyles\">\n <div class=\"stencil-shimmer\" style=\"margin: 0; padding: 0; width: 100%; height: 80%;\"></div>\n </div>\n </div>\n </mat-card>\n ",
4362 styles: ["\n .list-container { padding: 0; }\n .list-header { height: 40px; }\n .list-item-row { height: 50px; display: flex; justify-content: space-between; align-items: center; }\n "]
4363 }] }
4364 ];
4365 ListStencilComponent.propDecorators = {
4366 showHeader: [{ type: Input }],
4367 numRows: [{ type: Input }],
4368 rowHeight: [{ type: Input }],
4369 sidePadding: [{ type: Input }]
4370 };
4371 return ListStencilComponent;
4372}());
4373if (false) {
4374 /** @type {?} */
4375 ListStencilComponent.prototype.showHeader;
4376 /** @type {?} */
4377 ListStencilComponent.prototype.numRows;
4378 /** @type {?} */
4379 ListStencilComponent.prototype.rowHeight;
4380 /** @type {?} */
4381 ListStencilComponent.prototype.sidePadding;
4382 /** @type {?} */
4383 ListStencilComponent.prototype.rows;
4384 /** @type {?} */
4385 ListStencilComponent.prototype.listItemRowStyles;
4386}
4387
4388/**
4389 * @fileoverview added by tsickle
4390 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4391 */
4392var StencilsModule = /** @class */ (function () {
4393 function StencilsModule() {
4394 }
4395 StencilsModule.decorators = [
4396 { type: NgModule, args: [{
4397 imports: [CommonModule, MatCardModule, MatIconModule, MatInputModule, MatSelectModule, MatExpansionModule, MatCheckboxModule],
4398 declarations: [DetailsStencilComponent, CardStencilComponent, CardListStencilComponent, SearchBarStencilComponent, ListStencilComponent],
4399 exports: [DetailsStencilComponent, CardStencilComponent, CardListStencilComponent, SearchBarStencilComponent, ListStencilComponent]
4400 },] }
4401 ];
4402 return StencilsModule;
4403}());
4404
4405/**
4406 * @fileoverview added by tsickle
4407 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4408 */
4409var VaAddonListComponent = /** @class */ (function () {
4410 function VaAddonListComponent(billingService, cdr) {
4411 this.billingService = billingService;
4412 this.cdr = cdr;
4413 this.showPricing = true;
4414 this._hasVerifiedContract = null;
4415 this._canAccessContractPricing = null;
4416 this.addonSelected = new EventEmitter();
4417 this.billedProductsMap = new Map();
4418 this.billedProductLoaded = new Map();
4419 this.subscriptions = [];
4420 }
4421 Object.defineProperty(VaAddonListComponent.prototype, "addons", {
4422 set: /**
4423 * @param {?} addons
4424 * @return {?}
4425 */
4426 function (addons) {
4427 this._addons = addons;
4428 this.populateBilledProduct();
4429 },
4430 enumerable: true,
4431 configurable: true
4432 });
4433 Object.defineProperty(VaAddonListComponent.prototype, "hasVerifiedContract", {
4434 set: /**
4435 * @param {?} value
4436 * @return {?}
4437 */
4438 function (value) {
4439 this._hasVerifiedContract = value;
4440 this.populateBilledProduct();
4441 },
4442 enumerable: true,
4443 configurable: true
4444 });
4445 Object.defineProperty(VaAddonListComponent.prototype, "canAccessContractPricing", {
4446 set: /**
4447 * @param {?} value
4448 * @return {?}
4449 */
4450 function (value) {
4451 this._canAccessContractPricing = value;
4452 this.populateBilledProduct();
4453 },
4454 enumerable: true,
4455 configurable: true
4456 });
4457 /**
4458 * @return {?}
4459 */
4460 VaAddonListComponent.prototype.ngOnInit = /**
4461 * @return {?}
4462 */
4463 function () {
4464 this.populateBilledProduct();
4465 };
4466 /**
4467 * @return {?}
4468 */
4469 VaAddonListComponent.prototype.populateBilledProduct = /**
4470 * @return {?}
4471 */
4472 function () {
4473 var _this = this;
4474 if (this.displayContractPricing()) {
4475 /** @type {?} */
4476 var billingIDs = this._addons.map((/**
4477 * @param {?} a
4478 * @return {?}
4479 */
4480 function (a) {
4481 _this.billedProductsMap.set(a.addonId, null);
4482 _this.billedProductLoaded.set(a.addonId, false);
4483 return a.billingId;
4484 }));
4485 this.subscriptions.push(this.billingService.getMultiProductPricing(this.partnerID, billingIDs).subscribe((/**
4486 * @param {?} pricing
4487 * @return {?}
4488 */
4489 function (pricing) {
4490 _this._addons.forEach((/**
4491 * @param {?} addon
4492 * @return {?}
4493 */
4494 function (addon) {
4495 /** @type {?} */
4496 var addonPricing = pricing[addon.billingId];
4497 if (!addonPricing) {
4498 return;
4499 }
4500 /** @type {?} */
4501 var billedProduct = buildBilledProductFromProductPricingAndAddon(addon, addonPricing);
4502 _this.billedProductsMap.set(addon.addonId, billedProduct);
4503 _this.billedProductLoaded.set(addon.addonId, true);
4504 }));
4505 _this.cdr.detectChanges();
4506 })));
4507 }
4508 };
4509 /**
4510 * @param {?} addonId
4511 * @return {?}
4512 */
4513 VaAddonListComponent.prototype.onClick = /**
4514 * @param {?} addonId
4515 * @return {?}
4516 */
4517 function (addonId) {
4518 this.addonSelected.emit(addonId);
4519 };
4520 /**
4521 * @param {?} object
4522 * @return {?}
4523 */
4524 VaAddonListComponent.prototype.instanceOfPricing = /**
4525 * @param {?} object
4526 * @return {?}
4527 */
4528 function (object) {
4529 if (typeof object === 'number') {
4530 return false;
4531 }
4532 return object.currency !== undefined && object.prices !== undefined;
4533 };
4534 /**
4535 * @param {?} addon
4536 * @return {?}
4537 */
4538 VaAddonListComponent.prototype.getDisplayPricing = /**
4539 * @param {?} addon
4540 * @return {?}
4541 */
4542 function (addon) {
4543 /** @type {?} */
4544 var price = addon.price;
4545 if (price && this.instanceOfPricing(price)) {
4546 return price;
4547 }
4548 return {
4549 currency: addon.currency,
4550 prices: [
4551 {
4552 price: addon.price,
4553 frequency: addon.billingFrequency ? addon.billingFrequency : 'Monthly'
4554 }
4555 ]
4556 };
4557 };
4558 /**
4559 * @return {?}
4560 */
4561 VaAddonListComponent.prototype.noData = /**
4562 * @return {?}
4563 */
4564 function () {
4565 return isNullOrUndefined(this._hasVerifiedContract) || isNullOrUndefined(this._canAccessContractPricing);
4566 };
4567 /**
4568 * @return {?}
4569 */
4570 VaAddonListComponent.prototype.displayContractPricing = /**
4571 * @return {?}
4572 */
4573 function () {
4574 return this._canAccessContractPricing && this._hasVerifiedContract;
4575 };
4576 /**
4577 * @param {?} addon
4578 * @return {?}
4579 */
4580 VaAddonListComponent.prototype.isBilledProductLoaded = /**
4581 * @param {?} addon
4582 * @return {?}
4583 */
4584 function (addon) {
4585 if (this.noData()) {
4586 return false;
4587 }
4588 if (this.displayContractPricing()) {
4589 /** @type {?} */
4590 var value = this.billedProductLoaded.get(addon.addonId);
4591 return value ? value : false;
4592 }
4593 return true;
4594 };
4595 /**
4596 * @return {?}
4597 */
4598 VaAddonListComponent.prototype.ngOnDestroy = /**
4599 * @return {?}
4600 */
4601 function () {
4602 this.subscriptions.forEach((/**
4603 * @param {?} subscription
4604 * @return {?}
4605 */
4606 function (subscription) { return subscription.unsubscribe(); }));
4607 };
4608 VaAddonListComponent.decorators = [
4609 { type: Component, args: [{
4610 selector: 'va-addon-list',
4611 template: "<mat-list *ngIf=\"_addons\" class=\"addon-list\">\n <mat-divider></mat-divider>\n <ng-container *ngFor=\"let addon of _addons\">\n <mat-list-item (click)=\"onClick(addon.addonId)\">\n <div class=\"addon-icon-title\">\n <img *ngIf=\"addon.icon;else noIcon\" class=\"addon-icon\" [src]=\"addon.icon\" mat-list-avatar/>\n <ng-template #noIcon>\n <mat-icon class=\"addon-default-icon\" mat-list-icon>add_circle</mat-icon>\n </ng-template>\n <div class=\"addon-title-tagline\">\n <p class=\"addon-title\" matLine>{{ addon.title }} </p>\n <p class=\"addon-tagline\" matLine>{{ addon.tagline }}</p>\n </div>\n </div>\n <div *ngIf=\"showPricing\" class=\"price-section\">\n <va-pricing\n [pricing]=\"getDisplayPricing(addon)\"\n [highlightPrice]=\"false\"\n [hasVerifiedContract]=\"_hasVerifiedContract\"\n [billedProduct]=\"billedProductsMap.get(addon.addonId)\"\n [loaded]=\"isBilledProductLoaded(addon)\">\n </va-pricing>\n </div>\n </mat-list-item>\n <mat-divider></mat-divider>\n </ng-container>\n</mat-list>\n",
4612 styles: [":host{display:block}h2+:host{margin:-8px 0}:host ::ng-deep .mat-list-item.mat-2-line{height:auto!important}:host ::ng-deep .mat-list .mat-list-item .mat-list-item-content{padding:8px;-webkit-box-align:start;align-items:flex-start;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}@media screen and (min-width:800px){:host ::ng-deep .mat-list .mat-list-item .mat-list-item-content{-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row}}.addon-list{position:relative}.addon-default-icon{margin:0 5px;color:#4caf50}.addon-icon{width:32px;height:32px}.addon-icon-title{-webkit-box-flex:1;flex-grow:1;display:-webkit-box;display:flex;width:100%}@media screen and (min-width:800px){.addon-icon-title{width:auto}}.addon-title-tagline{padding:0 16px 10px 8px;-webkit-box-flex:1;flex-grow:1}.addon-title-tagline .addon-title{color:#212121;font-size:16px;line-height:1.2;margin:6px 0;white-space:normal}.addon-title-tagline .addon-tagline{color:#616161;font-size:14px;margin:0;white-space:normal}.price-section{min-width:10em;margin-top:6px;flex-shrink:0}mat-list-item:hover{background-color:#fafafa!important;cursor:pointer!important}"]
4613 }] }
4614 ];
4615 /** @nocollapse */
4616 VaAddonListComponent.ctorParameters = function () { return [
4617 { type: BillingService },
4618 { type: ChangeDetectorRef }
4619 ]; };
4620 VaAddonListComponent.propDecorators = {
4621 addons: [{ type: Input, args: ['addons',] }],
4622 showPricing: [{ type: Input }],
4623 partnerID: [{ type: Input }],
4624 hasVerifiedContract: [{ type: Input, args: ['hasVerifiedContract',] }],
4625 canAccessContractPricing: [{ type: Input, args: ['canAccessContractPricing',] }],
4626 addonSelected: [{ type: Output }]
4627 };
4628 return VaAddonListComponent;
4629}());
4630if (false) {
4631 /** @type {?} */
4632 VaAddonListComponent.prototype._addons;
4633 /** @type {?} */
4634 VaAddonListComponent.prototype.showPricing;
4635 /** @type {?} */
4636 VaAddonListComponent.prototype.partnerID;
4637 /** @type {?} */
4638 VaAddonListComponent.prototype._hasVerifiedContract;
4639 /** @type {?} */
4640 VaAddonListComponent.prototype._canAccessContractPricing;
4641 /** @type {?} */
4642 VaAddonListComponent.prototype.addonSelected;
4643 /** @type {?} */
4644 VaAddonListComponent.prototype.billedProductsMap;
4645 /**
4646 * @type {?}
4647 * @private
4648 */
4649 VaAddonListComponent.prototype.billedProductLoaded;
4650 /**
4651 * @type {?}
4652 * @private
4653 */
4654 VaAddonListComponent.prototype.subscriptions;
4655 /**
4656 * @type {?}
4657 * @private
4658 */
4659 VaAddonListComponent.prototype.billingService;
4660 /**
4661 * @type {?}
4662 * @private
4663 */
4664 VaAddonListComponent.prototype.cdr;
4665}
4666
4667/**
4668 * @fileoverview added by tsickle
4669 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4670 */
4671var VaAddonListModule = /** @class */ (function () {
4672 function VaAddonListModule() {
4673 }
4674 VaAddonListModule.decorators = [
4675 { type: NgModule, args: [{
4676 imports: [
4677 BillingModule,
4678 CommonModule,
4679 MatIconModule,
4680 MatListModule$1,
4681 MatDividerModule,
4682 VaPricingModule
4683 ],
4684 declarations: [VaAddonListComponent],
4685 exports: [VaAddonListComponent]
4686 },] }
4687 ];
4688 return VaAddonListModule;
4689}());
4690
4691/**
4692 * @fileoverview added by tsickle
4693 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4694 */
4695/**
4696 * @record
4697 */
4698function HeimdallServiceTokenInterface() { }
4699if (false) {
4700 /**
4701 * @param {?} category
4702 * @param {?} action
4703 * @param {?} label
4704 * @param {?=} value
4705 * @param {?=} dimensions
4706 * @return {?}
4707 */
4708 HeimdallServiceTokenInterface.prototype.track = function (category, action, label, value, dimensions) { };
4709}
4710/** @type {?} */
4711var HeimdallServiceToken = new InjectionToken('HeimdallService');
4712var HeimdallClient = /** @class */ (function () {
4713 function HeimdallClient(userEvents) {
4714 this.userEvents = userEvents;
4715 }
4716 /**
4717 * @param {?} category
4718 * @param {?} action
4719 * @param {?} label
4720 * @param {?=} value
4721 * @param {?=} dimensions
4722 * @return {?}
4723 */
4724 HeimdallClient.prototype.track = /**
4725 * @param {?} category
4726 * @param {?} action
4727 * @param {?} label
4728 * @param {?=} value
4729 * @param {?=} dimensions
4730 * @return {?}
4731 */
4732 function (category, action, label, value, dimensions) {
4733 this.userEvents.track(category, action, label, value, dimensions);
4734 };
4735 HeimdallClient.decorators = [
4736 { type: Injectable }
4737 ];
4738 /** @nocollapse */
4739 HeimdallClient.ctorParameters = function () { return [
4740 { type: undefined, decorators: [{ type: Inject, args: [HeimdallServiceToken,] }] }
4741 ]; };
4742 return HeimdallClient;
4743}());
4744if (false) {
4745 /**
4746 * @type {?}
4747 * @private
4748 */
4749 HeimdallClient.prototype.userEvents;
4750}
4751var HeimdallClientModule = /** @class */ (function () {
4752 function HeimdallClientModule() {
4753 }
4754 HeimdallClientModule.decorators = [
4755 { type: NgModule, args: [{
4756 providers: [HeimdallClient]
4757 },] }
4758 ];
4759 return HeimdallClientModule;
4760}());
4761
4762/**
4763 * @fileoverview added by tsickle
4764 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4765 */
4766/** @type {?} */
4767var STOREFRONT_FILTER_NAME = 'Store Filters';
4768/**
4769 * @record
4770 */
4771function StorefrontCategory() { }
4772if (false) {
4773 /** @type {?} */
4774 StorefrontCategory.prototype.id;
4775 /** @type {?} */
4776 StorefrontCategory.prototype.name;
4777 /** @type {?} */
4778 StorefrontCategory.prototype.packageIds;
4779}
4780var StorefrontComponent = /** @class */ (function () {
4781 function StorefrontComponent(userEvents, filterService, translateService) {
4782 this.userEvents = userEvents;
4783 this.filterService = filterService;
4784 this.translateService = translateService;
4785 this.useCustomCase = false;
4786 this.categorySelected = new EventEmitter();
4787 this.packageIdSelected = new EventEmitter();
4788 this.getDataForCategory = new EventEmitter();
4789 this.categories$$ = new BehaviorSubject([]);
4790 this.packagesMap$$ = new BehaviorSubject(new Map());
4791 this.searchTerm$$ = new BehaviorSubject('');
4792 this.selectedCateoryId$$ = new BehaviorSubject('');
4793 this.translateService.setTranslation('en', En.en, true);
4794 this.translateService.setTranslation('cs', Cs.cs, true);
4795 }
4796 Object.defineProperty(StorefrontComponent.prototype, "categories", {
4797 set: /**
4798 * @param {?} value
4799 * @return {?}
4800 */
4801 function (value) {
4802 this.categories$$.next(value || []);
4803 },
4804 enumerable: true,
4805 configurable: true
4806 });
4807 Object.defineProperty(StorefrontComponent.prototype, "categoryIdToStoreItemListMap", {
4808 set: /**
4809 * @param {?} value
4810 * @return {?}
4811 */
4812 function (value) {
4813 this.packagesMap$$.next(value || new Map());
4814 },
4815 enumerable: true,
4816 configurable: true
4817 });
4818 /**
4819 * @return {?}
4820 */
4821 StorefrontComponent.prototype.ngOnInit = /**
4822 * @return {?}
4823 */
4824 function () {
4825 var _this = this;
4826 /** @type {?} */
4827 var lmiCategoryCheckboxList = LMI_CATEGORIES.map((/**
4828 * @param {?} category
4829 * @return {?}
4830 */
4831 function (category) {
4832 return new CheckboxFilterField({
4833 name: category.name,
4834 id: category.categoryId,
4835 value: false,
4836 condition: (/**
4837 * @param {?} item
4838 * @return {?}
4839 */
4840 function (item) {
4841 /** @type {?} */
4842 var lmiCategories = [];
4843 if (item.lmiCategories) {
4844 lmiCategories = item.lmiCategories.map((/**
4845 * @param {?} cat
4846 * @return {?}
4847 */
4848 function (cat) {
4849 return Categories[cat].toLowerCase();
4850 }));
4851 }
4852 return lmiCategories.indexOf(category.categoryId) > -1;
4853 })
4854 });
4855 }));
4856 /** @type {?} */
4857 var lmiCategoryFilterSection = new FilterSection({
4858 title: 'LMI Category',
4859 type: 'or',
4860 fields: lmiCategoryCheckboxList
4861 });
4862 this.lmiCategoryFilter = new Filters(STOREFRONT_FILTER_NAME, [
4863 lmiCategoryFilterSection
4864 ]);
4865 this.filters$ = this.categories$$.pipe(map((/**
4866 * @param {?} categories
4867 * @return {?}
4868 */
4869 function (categories) {
4870 /** @type {?} */
4871 var tabbedFilterField = new TabbedFilterField({
4872 name: '',
4873 value: null,
4874 id: 'categorytab',
4875 options: categories
4876 });
4877 /** @type {?} */
4878 var filters = new Filters(STOREFRONT_FILTER_NAME, [
4879 new FilterSection({
4880 title: 'Categories',
4881 type: 'or',
4882 fields: [tabbedFilterField]
4883 }),
4884 lmiCategoryFilterSection
4885 ]);
4886 return filters;
4887 })));
4888 this.filterService.setFilters(this.lmiCategoryFilter);
4889 this.searchTermSubscription = this.searchTerm$$.asObservable().pipe(debounceTime(300), distinctUntilChanged()).subscribe((/**
4890 * @param {?} searchTerm
4891 * @return {?}
4892 */
4893 function (searchTerm) { return _this.userEvents.track('store', 'search-input', '', 1, { 'searchTerm': searchTerm }); }));
4894 /** @type {?} */
4895 var selectedLMIFilters$ = this.filterService.filters.fieldValuesObservable.pipe(startWith([]), map((/**
4896 * @return {?}
4897 */
4898 function () {
4899 return _this.lmiCategoryFilter.fields.filter((/**
4900 * @param {?} item
4901 * @return {?}
4902 */
4903 function (item) { return item.value; }));
4904 })));
4905 this.showLMIFilter$ = selectedLMIFilters$.pipe(filter((/**
4906 * @param {?} selectedLMIFilters
4907 * @return {?}
4908 */
4909 function (selectedLMIFilters) { return !!selectedLMIFilters; })), take(1), map((/**
4910 * @param {?} selectedLMIFilters
4911 * @return {?}
4912 */
4913 function (selectedLMIFilters) { return selectedLMIFilters.length > 0; })));
4914 this.filteredItems$ = combineLatest(this.packagesMap$$, this.searchTerm$$, this.selectedCateoryId$$, selectedLMIFilters$).pipe(map((/**
4915 * @param {?} __0
4916 * @return {?}
4917 */
4918 function (_a) {
4919 var _b = __read(_a, 4), packages = _b[0], searchTerm = _b[1], selectedCategoryId = _b[2], selectedLMIFilters = _b[3];
4920 /** @type {?} */
4921 var storeItems = [];
4922 if (packages.size) {
4923 storeItems = (selectedCategoryId ? packages.get(selectedCategoryId) : packages.get(Array.from(packages.keys())[0]));
4924 }
4925 storeItems = storeItems ? _this.lmiCategoryFilter.applyFilters(storeItems) : [];
4926 return searchTerm ? storeItems.filter((/**
4927 * @param {?} item
4928 * @return {?}
4929 */
4930 function (item) { return item.name.toLowerCase().indexOf(searchTerm.toLowerCase()) !== -1; })) : storeItems;
4931 })));
4932 };
4933 /**
4934 * @return {?}
4935 */
4936 StorefrontComponent.prototype.ngOnDestroy = /**
4937 * @return {?}
4938 */
4939 function () {
4940 this.searchTermSubscription.unsubscribe();
4941 };
4942 /**
4943 * @param {?} term
4944 * @return {?}
4945 */
4946 StorefrontComponent.prototype.onSearchTermChanged = /**
4947 * @param {?} term
4948 * @return {?}
4949 */
4950 function (term) {
4951 this.searchTerm$$.next(term);
4952 };
4953 /**
4954 * @param {?} filterField
4955 * @return {?}
4956 */
4957 StorefrontComponent.prototype.onFieldValueChanged = /**
4958 * @param {?} filterField
4959 * @return {?}
4960 */
4961 function (filterField) {
4962 if (!(filterField instanceof TabbedFilterField)) {
4963 return;
4964 }
4965 this.selectedCateoryId$$.next(filterField.value.id);
4966 this.categorySelected.emit((/** @type {?} */ (filterField.value)));
4967 /** @type {?} */
4968 var currentStoreItemsForSelectCategory = this.packagesMap$$.getValue().get(filterField.value.id);
4969 if (!(currentStoreItemsForSelectCategory && currentStoreItemsForSelectCategory.length)) {
4970 this.getDataForCategory.emit((/** @type {?} */ (filterField.value)));
4971 }
4972 };
4973 /**
4974 * @param {?} item
4975 * @return {?}
4976 */
4977 StorefrontComponent.prototype.storeItemClicked = /**
4978 * @param {?} item
4979 * @return {?}
4980 */
4981 function (item) {
4982 this.packageIdSelected.emit(item.id);
4983 };
4984 StorefrontComponent.decorators = [
4985 { type: Component, args: [{
4986 selector: 'va-storefront',
4987 template: "<va-filter-container\n [filters]=\"filters$ | async\"\n (searchTermChanged)=\"onSearchTermChanged($event)\"\n (fieldValueChanged)=\"onFieldValueChanged($event)\"\n [theme]=\"'plain'\"\n [filterIsOpen]=\"showLMIFilter$ | async\"\n [useCustomCase]=\"useCustomCase\"\n >\n <va-store\n [items]=\"filteredItems$ | async\"\n [searchable]=\"false\"\n (itemClicked)=\"storeItemClicked($event)\"\n content>\n </va-store>\n</va-filter-container>\n",
4988 styles: [".public-store-container{padding:20px}va-store{margin-top:20px;display:block}@media only screen and (device-width:375px) and (-webkit-device-pixel-ratio:2){::ng-deep va-filter-tabbed{width:280px}::ng-deep .filter-container .toolbar.toolbar{background:0 0}}@media only screen and (device-width:414px) and (-webkit-device-pixel-ratio:3){::ng-deep va-filter-tabbed{width:280px}::ng-deep .filter-container .toolbar.toolbar{background:0 0}}"]
4989 }] }
4990 ];
4991 /** @nocollapse */
4992 StorefrontComponent.ctorParameters = function () { return [
4993 { type: undefined, decorators: [{ type: Inject, args: [HeimdallServiceToken,] }] },
4994 { type: FilterService },
4995 { type: TranslateService }
4996 ]; };
4997 StorefrontComponent.propDecorators = {
4998 categories: [{ type: Input }],
4999 categoryIdToStoreItemListMap: [{ type: Input }],
5000 useCustomCase: [{ type: Input }],
5001 categorySelected: [{ type: Output }],
5002 packageIdSelected: [{ type: Output }],
5003 getDataForCategory: [{ type: Output }]
5004 };
5005 return StorefrontComponent;
5006}());
5007if (false) {
5008 /** @type {?} */
5009 StorefrontComponent.prototype.useCustomCase;
5010 /** @type {?} */
5011 StorefrontComponent.prototype.categorySelected;
5012 /** @type {?} */
5013 StorefrontComponent.prototype.packageIdSelected;
5014 /** @type {?} */
5015 StorefrontComponent.prototype.getDataForCategory;
5016 /**
5017 * @type {?}
5018 * @private
5019 */
5020 StorefrontComponent.prototype.categories$$;
5021 /**
5022 * @type {?}
5023 * @private
5024 */
5025 StorefrontComponent.prototype.packagesMap$$;
5026 /**
5027 * @type {?}
5028 * @private
5029 */
5030 StorefrontComponent.prototype.searchTerm$$;
5031 /**
5032 * @type {?}
5033 * @private
5034 */
5035 StorefrontComponent.prototype.selectedCateoryId$$;
5036 /**
5037 * @type {?}
5038 * @private
5039 */
5040 StorefrontComponent.prototype.lmiCategoryFilter;
5041 /** @type {?} */
5042 StorefrontComponent.prototype.filters$;
5043 /** @type {?} */
5044 StorefrontComponent.prototype.filteredItems$;
5045 /** @type {?} */
5046 StorefrontComponent.prototype.searchTermSubscription;
5047 /** @type {?} */
5048 StorefrontComponent.prototype.showLMIFilter$;
5049 /**
5050 * @type {?}
5051 * @private
5052 */
5053 StorefrontComponent.prototype.userEvents;
5054 /**
5055 * @type {?}
5056 * @private
5057 */
5058 StorefrontComponent.prototype.filterService;
5059 /**
5060 * @type {?}
5061 * @private
5062 */
5063 StorefrontComponent.prototype.translateService;
5064}
5065
5066/**
5067 * @fileoverview added by tsickle
5068 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
5069 */
5070var StoreModule = /** @class */ (function () {
5071 function StoreModule() {
5072 }
5073 StoreModule.decorators = [
5074 { type: NgModule, args: [{
5075 imports: [CommonModule, UIKitModule, MatCardModule, MatIconModule, MatInputModule, FormsModule, ReactiveFormsModule,
5076 MatSelectModule, MatExpansionModule, MatCheckboxModule, StoreCardModule, VaOrderFormModule, AddonModule, StencilsModule,
5077 VaPricingModule, VaAddonListModule, HeimdallClientModule],
5078 declarations: [StoreComponent, StorefrontComponent],
5079 providers: [StoreService, FilterService],
5080 exports: [StoreComponent, StoreCardModule, VaOrderFormModule, StencilsModule, StorefrontComponent]
5081 },] }
5082 ];
5083 return StoreModule;
5084}());
5085
5086/**
5087 * @fileoverview added by tsickle
5088 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
5089 */
5090/**
5091 * @record
5092 */
5093function LmiCategory() { }
5094if (false) {
5095 /** @type {?} */
5096 LmiCategory.prototype.name;
5097 /** @type {?} */
5098 LmiCategory.prototype.categoryId;
5099}
5100/** @type {?} */
5101var LMI_CATEGORIES = [
5102 { name: 'Listings', categoryId: 'listings' },
5103 { name: 'Social', categoryId: 'social' },
5104 { name: 'Reputation', categoryId: 'reputation' },
5105 { name: 'SEO', categoryId: 'seo' },
5106 { name: 'Website', categoryId: 'website' },
5107 { name: 'Advertising', categoryId: 'advertising' },
5108 { name: 'Content & Experience', categoryId: 'content_and_experience' }
5109];
5110/** @type {?} */
5111var LMI_CATEGORY_MAP = LMI_CATEGORIES.reduce((/**
5112 * @param {?} previous
5113 * @param {?} current
5114 * @return {?}
5115 */
5116function (previous, current) {
5117 previous[current.categoryId] = current;
5118 return previous;
5119}), {});
5120/** @type {?} */
5121var LMI_CATEGORIES_BY_NAME = LMI_CATEGORIES.reduce((/**
5122 * @param {?} previous
5123 * @param {?} current
5124 * @return {?}
5125 */
5126function (previous, current) {
5127 previous[current.name] = current;
5128 return previous;
5129}), {});
5130
5131/**
5132 * @fileoverview added by tsickle
5133 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
5134 */
5135var VaSalespersonDetailsComponent = /** @class */ (function () {
5136 function VaSalespersonDetailsComponent() {
5137 this.showGetItNow = true;
5138 this.getItNow = new EventEmitter();
5139 }
5140 /**
5141 * @return {?}
5142 */
5143 VaSalespersonDetailsComponent.prototype.onGetItNowSelected = /**
5144 * @return {?}
5145 */
5146 function () {
5147 this.getItNow.emit(this.salesperson);
5148 };
5149 Object.defineProperty(VaSalespersonDetailsComponent.prototype, "iconUrl", {
5150 get: /**
5151 * @return {?}
5152 */
5153 function () {
5154 return this.salesperson && this.salesperson.photoUrlSecure ?
5155 this.salesperson.photoUrlSecure :
5156 'https://vbc-frontend.storage-download.googleapis.com/salesperson-details/default_sales_person.jpg';
5157 },
5158 enumerable: true,
5159 configurable: true
5160 });
5161 Object.defineProperty(VaSalespersonDetailsComponent.prototype, "name", {
5162 get: /**
5163 * @return {?}
5164 */
5165 function () {
5166 return this.salesperson && this.salesperson.formattedName ?
5167 this.salesperson.formattedName : '';
5168 },
5169 enumerable: true,
5170 configurable: true
5171 });
5172 Object.defineProperty(VaSalespersonDetailsComponent.prototype, "title", {
5173 get: /**
5174 * @return {?}
5175 */
5176 function () {
5177 return this.salesperson && this.salesperson.jobTitle ?
5178 this.salesperson.jobTitle : '';
5179 },
5180 enumerable: true,
5181 configurable: true
5182 });
5183 Object.defineProperty(VaSalespersonDetailsComponent.prototype, "email", {
5184 get: /**
5185 * @return {?}
5186 */
5187 function () {
5188 return this.salesperson && this.salesperson.email ?
5189 this.salesperson.email : '';
5190 },
5191 enumerable: true,
5192 configurable: true
5193 });
5194 Object.defineProperty(VaSalespersonDetailsComponent.prototype, "cityAndState", {
5195 get: /**
5196 * @return {?}
5197 */
5198 function () {
5199 return this.salesperson && this.salesperson.city && this.salesperson.state ?
5200 this.salesperson.city + ', ' + this.salesperson.state : '';
5201 },
5202 enumerable: true,
5203 configurable: true
5204 });
5205 VaSalespersonDetailsComponent.decorators = [
5206 { type: Component, args: [{
5207 selector: 'va-salesperson-details',
5208 template: "<div class=\"container\">\n <div class=\"salesperson-contact-info\">\n\n <div class=\"salesperson-image\" *ngIf=\"salesperson\">\n <va-icon [iconUrl]=\"iconUrl\" [diameter]=\"60\"></va-icon>\n </div>\n\n <div>\n <div class=\"salesperson-name\">{{ name }}</div>\n <div>{{ title }}</div>\n <div>{{ cityAndState }}</div>\n <div><a href=\"mailto:{{ email }}\">{{ email }}</a></div>\n </div>\n\n <div *ngIf=\"!salesperson\" class=\"generic-contact\">\n Contact {{ brandName ? \"your \" + brandName : \"a\" }} representative today!\n </div>\n\n <div class=\"pricing\">\n <va-pricing [pricing]=\"packagePricing\" wrapFrequency=\"true\"></va-pricing>\n <div class=\"cta get-it-now-bottom-button\">\n <button mat-button *ngIf=\"salesperson && showGetItNow\" (click)=\"onGetItNowSelected()\" class=\"now-button\">\n Get it Now\n </button>\n </div>\n </div>\n </div>\n</div>\n",
5209 styles: ["a{color:#1e88e5;text-decoration:none}.container{width:100%;margin:0 auto;background-color:#fff;box-shadow:1px 1px 1px 0 rgba(0,0,0,.2)}.salesperson-image{margin-right:20px}.salesperson-contact-info{display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;padding:24px;font-size:14px;color:#9e9e9e}@media screen and (max-width:600px){.salesperson-contact-info{-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;display:inline-block}}.salesperson-name{font-size:20px;font-weight:700;color:#212121}.generic-contact{margin-left:20px}.pricing{display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;-webkit-box-flex:1;flex-grow:1;-webkit-box-pack:end;justify-content:flex-end}.pricing ::ng-deep .price-box{-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row}.pricing ::ng-deep .price-number{margin-right:4px}@media screen and (min-width:600px){.pricing{padding-left:16px}}.pricing va-pricing{margin-right:20px}.now-button{font-size:14px;color:#fff;background-color:#4caf50}"]
5210 }] }
5211 ];
5212 VaSalespersonDetailsComponent.propDecorators = {
5213 salesperson: [{ type: Input }],
5214 packagePricing: [{ type: Input }],
5215 brandName: [{ type: Input }],
5216 showGetItNow: [{ type: Input }],
5217 getItNow: [{ type: Output }]
5218 };
5219 return VaSalespersonDetailsComponent;
5220}());
5221if (false) {
5222 /** @type {?} */
5223 VaSalespersonDetailsComponent.prototype.salesperson;
5224 /** @type {?} */
5225 VaSalespersonDetailsComponent.prototype.packagePricing;
5226 /** @type {?} */
5227 VaSalespersonDetailsComponent.prototype.brandName;
5228 /** @type {?} */
5229 VaSalespersonDetailsComponent.prototype.showGetItNow;
5230 /** @type {?} */
5231 VaSalespersonDetailsComponent.prototype.getItNow;
5232}
5233
5234/**
5235 * @fileoverview added by tsickle
5236 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
5237 */
5238var VaSalespersonDetailsModule = /** @class */ (function () {
5239 function VaSalespersonDetailsModule() {
5240 }
5241 VaSalespersonDetailsModule.decorators = [
5242 { type: NgModule, args: [{
5243 imports: [
5244 CommonModule,
5245 MatButtonModule,
5246 MatIconModule,
5247 VaIconModule,
5248 VaPricingModule,
5249 ],
5250 declarations: [
5251 VaSalespersonDetailsComponent
5252 ],
5253 exports: [
5254 VaSalespersonDetailsComponent
5255 ],
5256 entryComponents: [
5257 VaSalespersonDetailsComponent
5258 ]
5259 },] }
5260 ];
5261 return VaSalespersonDetailsModule;
5262}());
5263
5264/**
5265 * @fileoverview added by tsickle
5266 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
5267 */
5268var Package = /** @class */ (function (_super) {
5269 __extends(Package, _super);
5270 function Package() {
5271 return _super !== null && _super.apply(this, arguments) || this;
5272 }
5273 // the order the product / addons in the package
5274 /**
5275 * @param {?} data
5276 * @return {?}
5277 */
5278 Package.fromApi =
5279 // the order the product / addons in the package
5280 /**
5281 * @param {?} data
5282 * @return {?}
5283 */
5284 function (data) {
5285 /** @type {?} */
5286 var newPackage = new Package();
5287 if (!data.pricing && data.selling_price) {
5288 data.pricing = {
5289 currency: data.currency,
5290 prices: [{
5291 price: data.selling_price * 100,
5292 frequency: data.billingFrequency,
5293 isStartingPrice: false,
5294 }]
5295 };
5296 }
5297 Object.assign(newPackage, data);
5298 if (!newPackage.name) {
5299 newPackage.name = 'Untitled';
5300 }
5301 if (data.created) {
5302 newPackage.createdDate = new Date(data.created);
5303 }
5304 if (data.updated) {
5305 newPackage.updatedDate = new Date(data.updated);
5306 }
5307 return newPackage;
5308 };
5309 Object.defineProperty(Package.prototype, "isPackageFree", {
5310 get: /**
5311 * @return {?}
5312 */
5313 function () {
5314 return this.isFree;
5315 },
5316 enumerable: true,
5317 configurable: true
5318 });
5319 return Package;
5320}(Sellable));
5321if (false) {
5322 /** @type {?} */
5323 Package.prototype.solution_id;
5324 /** @type {?} */
5325 Package.prototype.partner_id;
5326 /** @type {?} */
5327 Package.prototype.market_id;
5328 /** @type {?} */
5329 Package.prototype.name;
5330 /** @type {?} */
5331 Package.prototype.icon;
5332 /** @type {?} */
5333 Package.prototype.status;
5334 /** @type {?} */
5335 Package.prototype.tagline;
5336 /** @type {?} */
5337 Package.prototype.header_image_url;
5338 /** @type {?} */
5339 Package.prototype.content;
5340 /** @type {?} */
5341 Package.prototype.products;
5342 /** @type {?} */
5343 Package.prototype.addon_keys;
5344 /** @type {?} */
5345 Package.prototype.hide_product_icons_and_names;
5346 /** @type {?} */
5347 Package.prototype.hide_product_details;
5348 /** @type {?} */
5349 Package.prototype.createdDate;
5350 /** @type {?} */
5351 Package.prototype.updatedDate;
5352 /** @type {?} */
5353 Package.prototype.productOrder;
5354}
5355
5356/**
5357 * @fileoverview added by tsickle
5358 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
5359 */
5360/**
5361 * @param {?} combined
5362 * @param {?} order
5363 * @return {?}
5364 */
5365function orderProductsAndAddons(combined, order) {
5366 if (!order || order.length === 0) {
5367 return combined || [];
5368 }
5369 if (!combined || combined.length === 0) {
5370 return [];
5371 }
5372 /** @type {?} */
5373 var itemMap = (combined || []).reduce((/**
5374 * @param {?} m
5375 * @param {?} curr
5376 * @return {?}
5377 */
5378 function (m, curr) {
5379 m.set(getUniqueProductAddonId(curr), curr);
5380 return m;
5381 }), new Map());
5382 /** @type {?} */
5383 var combinedIdList = combined.map(getUniqueProductAddonId);
5384 /** @type {?} */
5385 var finalOrderedIds = combineProductOrderWithContainedProducts(order, combinedIdList);
5386 /** @type {?} */
5387 var orderedList = (/** @type {?} */ (finalOrderedIds.reduce((/**
5388 * @param {?} items
5389 * @param {?} id
5390 * @return {?}
5391 */
5392 function (items, id) {
5393 items.push(itemMap.get(id));
5394 return items;
5395 }), [])));
5396 return orderedList.filter(filterUniqueAndDefined);
5397}
5398/**
5399 * @param {?} elem
5400 * @param {?} pos
5401 * @param {?} arr
5402 * @return {?}
5403 */
5404function filterUniqueAndDefined(elem, pos, arr) {
5405 return elem && arr.indexOf(elem) === pos;
5406}
5407/**
5408 * @param {?} productOrder
5409 * @param {?} itemIds
5410 * @return {?}
5411 */
5412function combineProductOrderWithContainedProducts(productOrder, itemIds) {
5413 if (itemIds == null || itemIds.length === 0) {
5414 return [];
5415 }
5416 if (!productOrder || productOrder.length === 0) {
5417 return itemIds.filter(filterUniqueAndDefined);
5418 }
5419 return productOrder
5420 .filter((/**
5421 * @param {?} elem
5422 * @return {?}
5423 */
5424 function (elem) { return itemIds.indexOf(elem) >= 0; }))
5425 .concat(itemIds)
5426 .filter(filterUniqueAndDefined);
5427}
5428/**
5429 * @param {?} thing
5430 * @return {?}
5431 */
5432function getUniqueProductAddonId(thing) {
5433 return thing['addonId'] || thing['productId'];
5434}
5435
5436/**
5437 * @fileoverview added by tsickle
5438 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
5439 */
5440var VaPackageDetailsComponent = /** @class */ (function () {
5441 function VaPackageDetailsComponent() {
5442 this.showActionButton = true;
5443 this.showPricing = true;
5444 this.actionLabel = 'Get It Now';
5445 this.getItNow = new EventEmitter();
5446 this.standAloneProducts$$ = new BehaviorSubject([]);
5447 this.products$ = new BehaviorSubject([]);
5448 this.addons$ = new BehaviorSubject([]);
5449 this.pkg$ = new ReplaySubject(1);
5450 this.itemSelectedEvent$ = new ReplaySubject(1);
5451 this.combinedItemsList$ = combineLatest(this.products$, this.addons$, (/**
5452 * @param {?} products
5453 * @param {?} addons
5454 * @return {?}
5455 */
5456 function (products, addons) {
5457 return (/** @type {?} */ ([].concat(products || []).concat(addons || [])));
5458 }));
5459 this.orderedItemsList$ = combineLatest(this.combinedItemsList$, this.pkg$, (/**
5460 * @param {?} combined
5461 * @param {?} pkg
5462 * @return {?}
5463 */
5464 function (combined, pkg) {
5465 return orderProductsAndAddons(combined, pkg ? pkg.productOrder || [] : []);
5466 }));
5467 /** @type {?} */
5468 var nonEmptyCombinedItemsList = this.combinedItemsList$.pipe(skipWhile((/**
5469 * @param {?} items
5470 * @return {?}
5471 */
5472 function (items) { return !items || items.length === 0; })), shareReplay(1));
5473 // Need to map to an index because that's how product selection works.
5474 /** @type {?} */
5475 var initialSelectedItem$ = nonEmptyCombinedItemsList.pipe(map((/**
5476 * @param {?} _
5477 * @return {?}
5478 */
5479 function (_) { return 0; })), take(1));
5480 /** @type {?} */
5481 var mergedSelection = merge(initialSelectedItem$, this.itemSelectedEvent$);
5482 this.selectedItem$ = combineLatest(mergedSelection, this.orderedItemsList$).pipe(map((/**
5483 * @param {?} __0
5484 * @return {?}
5485 */
5486 function (_a) {
5487 var _b = __read(_a, 2), index = _b[0], items = _b[1];
5488 return items[index];
5489 })));
5490 this.lmiCategories$ = this.products$.pipe(skipWhile((/**
5491 * @param {?} products
5492 * @return {?}
5493 */
5494 function (products) { return !products || products.length === 0; })), map((/**
5495 * @param {?} products
5496 * @return {?}
5497 */
5498 function (products) {
5499 return VaPackageDetailsComponent.getLmiCategories(products);
5500 })));
5501 this.productNameForSingleAddon$ = nonEmptyCombinedItemsList.pipe(map((/**
5502 * @param {?} items
5503 * @return {?}
5504 */
5505 function (items) {
5506 return VaPackageDetailsComponent.getProductNameForSingleAddon(items);
5507 })));
5508 this.displayTagName$ = combineLatest(this.pkg$, this.combinedItemsList$).pipe(map((/**
5509 * @param {?} __0
5510 * @return {?}
5511 */
5512 function (_a) {
5513 var _b = __read(_a, 2), pkg = _b[0], items = _b[1];
5514 return VaPackageDetailsComponent.getDisplayTagline(pkg, items);
5515 })));
5516 }
5517 Object.defineProperty(VaPackageDetailsComponent.prototype, "standAloneProducts", {
5518 set: /**
5519 * @param {?} standAloneProducts
5520 * @return {?}
5521 */
5522 function (standAloneProducts) {
5523 this.standAloneProducts$$.next(standAloneProducts);
5524 },
5525 enumerable: true,
5526 configurable: true
5527 });
5528 Object.defineProperty(VaPackageDetailsComponent.prototype, "products", {
5529 set: /**
5530 * @param {?} products
5531 * @return {?}
5532 */
5533 function (products) {
5534 this.products$.next(products);
5535 },
5536 enumerable: true,
5537 configurable: true
5538 });
5539 Object.defineProperty(VaPackageDetailsComponent.prototype, "addons", {
5540 set: /**
5541 * @param {?} addons
5542 * @return {?}
5543 */
5544 function (addons) {
5545 this.addons$.next(addons);
5546 },
5547 enumerable: true,
5548 configurable: true
5549 });
5550 Object.defineProperty(VaPackageDetailsComponent.prototype, "pkg", {
5551 set: /**
5552 * @param {?} pkg
5553 * @return {?}
5554 */
5555 function (pkg) {
5556 this.pkg$.next(pkg);
5557 },
5558 enumerable: true,
5559 configurable: true
5560 });
5561 /**
5562 * @param {?} products
5563 * @return {?}
5564 */
5565 VaPackageDetailsComponent.getLmiCategories = /**
5566 * @param {?} products
5567 * @return {?}
5568 */
5569 function (products) {
5570 /** @type {?} */
5571 var lmiCategories = [];
5572 if (products) {
5573 products.forEach((/**
5574 * @param {?} product
5575 * @return {?}
5576 */
5577 function (product) {
5578 lmiCategories = lmiCategories.concat(product.getLmiCategoryNames());
5579 }));
5580 }
5581 return new Set(lmiCategories);
5582 };
5583 /**
5584 * @param {?} pkg
5585 * @param {?} items
5586 * @return {?}
5587 */
5588 VaPackageDetailsComponent.getDisplayTagline = /**
5589 * @param {?} pkg
5590 * @param {?} items
5591 * @return {?}
5592 */
5593 function (pkg, items) {
5594 if (pkg && pkg.tagline) {
5595 return pkg.tagline;
5596 }
5597 else if (items && items.length === 1) {
5598 // Single product / addon package.
5599 return items[0].tagline || '';
5600 }
5601 return '';
5602 };
5603 /**
5604 * @param {?} items
5605 * @return {?}
5606 */
5607 VaPackageDetailsComponent.getProductNameForSingleAddon = /**
5608 * @param {?} items
5609 * @return {?}
5610 */
5611 function (items) {
5612 if (items && items.length === 1 && items[0] instanceof Addon) {
5613 /** @type {?} */
5614 var addon = (/** @type {?} */ (items[0]));
5615 return addon.productName;
5616 }
5617 };
5618 /**
5619 * @param {?} i
5620 * @return {?}
5621 */
5622 VaPackageDetailsComponent.prototype.selectItem = /**
5623 * @param {?} i
5624 * @return {?}
5625 */
5626 function (i) {
5627 this.itemSelectedEvent$.next(i);
5628 };
5629 /**
5630 * @return {?}
5631 */
5632 VaPackageDetailsComponent.prototype.emitGetItNow = /**
5633 * @return {?}
5634 */
5635 function () {
5636 this.getItNow.emit();
5637 };
5638 VaPackageDetailsComponent.decorators = [
5639 { type: Component, args: [{
5640 selector: 'va-package-details',
5641 template: "<div *ngIf=\"pkg$ | async as pkg\" class=\"page\">\n <va-header-container [iconUrl]=\"pkg.icon\"\n [title]=\"pkg.name\"\n [tagline]=\"displayTagName$ | async\"\n [prerequisite]=\"productNameForSingleAddon$ | async\"\n [chipLabels]=\"lmiCategories$ | async\"\n [pricing]=\"pkg.pricing\"\n [pricingLabel]=\"'Pricing'\"\n [showAction]=\"showActionButton\"\n [showPricing]=\"showPricing\"\n [actionLabel]=\"actionLabel\"\n [actionEnabled]=true\n (actionSelected)=\"emitGetItNow()\"\n ></va-header-container>\n <ng-container *ngIf=\"pkg?.content\">\n <va-selling-info [description]=\"pkg.content\"></va-selling-info>\n </ng-container>\n\n <va-products-nav [items]=\"orderedItemsList$ | async\"\n [hideItemsNav]=\"pkg?.hide_product_icons_and_names\"\n (itemSelected)=\"selectItem($event)\"></va-products-nav>\n\n <ng-container *ngIf=\"selectedItem$ | async as selectedItem\">\n <div *ngIf=\"!pkg?.hide_product_details\" class=\"package-content\">\n <div class=\"left-column\">\n <section\n *ngIf=\"(selectedItem.endUserMarketing?.description || selectedItem.endUserMarketing?.keySellingPoints) ||\n (selectedItem.description || selectedItem.keySellingPoints)\">\n <va-selling-info [description]=\"selectedItem.endUserMarketing?.description || selectedItem.description\"\n [keySellingPoints]=\"selectedItem.endUserMarketing?.keySellingPoints || selectedItem.keySellingPoints\"></va-selling-info>\n </section>\n\n <section *ngIf=\"(selectedItem.endUserMarketing?.faqs?.length > 0\n && selectedItem.endUserMarketing?.faqs[0].question) || selectedItem.faqs?.length > 0\">\n <h2 class=\"va-component-title\">FAQs</h2>\n <va-faqs [faqs]=\"selectedItem.endUserMarketing?.faqs || selectedItem.faqs\"></va-faqs>\n </section>\n </div>\n\n <div class=\"right-column\">\n <section *ngIf=\"selectedItem.screenshotUrls?.length > 0 || selectedItem.screenshots?.length > 0\">\n <h2 class=\"va-component-title\">Gallery</h2>\n <va-image-gallery [imageUrls]=\"selectedItem.screenshotUrls || selectedItem.screenshots\"></va-image-gallery>\n </section>\n\n <section *ngIf=\"selectedItem.endUserMarketing?.files?.length > 0 || selectedItem.files?.length > 0\">\n <h2 class=\"va-component-title\">Files</h2>\n <va-files [files]=\"selectedItem.endUserMarketingFiles || selectedItem.files\"></va-files>\n </section>\n </div>\n </div>\n </ng-container>\n</div>\n",
5642 styles: [":host{display:block;font-size:14px;line-height:1.4}:host *{box-sizing:border-box}.va-component-title{font-size:24px;font-weight:300;margin-top:0}@media screen and (min-width:600px){.va-component-title{font-size:32px}}img{max-width:100%}va-icon{display:inline-block}.page{position:relative;margin:0 auto 20px;background:#fff;color:#212121;box-shadow:0 3px 10px rgba(33,33,33,.3);overflow:hidden;font-size:16px}.page .item-amount{color:#9e9e9e;font-size:14px;text-align:right;margin:0 24px 8px}section{padding:24px}.left-column{width:66%}@media screen and (max-width:600px){.left-column{width:100%}}.right-column{width:34%}.package-content{display:-webkit-box;display:flex}@media screen and (max-width:600px){.right-column{width:100%}.package-content{-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}}"]
5643 }] }
5644 ];
5645 /** @nocollapse */
5646 VaPackageDetailsComponent.ctorParameters = function () { return []; };
5647 VaPackageDetailsComponent.propDecorators = {
5648 showActionButton: [{ type: Input }],
5649 showPricing: [{ type: Input }],
5650 actionLabel: [{ type: Input }],
5651 getItNow: [{ type: Output }],
5652 standAloneProducts: [{ type: Input }],
5653 products: [{ type: Input }],
5654 addons: [{ type: Input }],
5655 pkg: [{ type: Input }]
5656 };
5657 return VaPackageDetailsComponent;
5658}());
5659if (false) {
5660 /** @type {?} */
5661 VaPackageDetailsComponent.prototype.showActionButton;
5662 /** @type {?} */
5663 VaPackageDetailsComponent.prototype.showPricing;
5664 /** @type {?} */
5665 VaPackageDetailsComponent.prototype.actionLabel;
5666 /** @type {?} */
5667 VaPackageDetailsComponent.prototype.getItNow;
5668 /** @type {?} */
5669 VaPackageDetailsComponent.prototype.standAloneProducts$$;
5670 /** @type {?} */
5671 VaPackageDetailsComponent.prototype.products$;
5672 /** @type {?} */
5673 VaPackageDetailsComponent.prototype.addons$;
5674 /** @type {?} */
5675 VaPackageDetailsComponent.prototype.pkg$;
5676 /** @type {?} */
5677 VaPackageDetailsComponent.prototype.itemSelectedEvent$;
5678 /** @type {?} */
5679 VaPackageDetailsComponent.prototype.selectedItem$;
5680 /** @type {?} */
5681 VaPackageDetailsComponent.prototype.combinedItemsList$;
5682 /** @type {?} */
5683 VaPackageDetailsComponent.prototype.orderedItemsList$;
5684 /** @type {?} */
5685 VaPackageDetailsComponent.prototype.lmiCategories$;
5686 /** @type {?} */
5687 VaPackageDetailsComponent.prototype.productNameForSingleAddon$;
5688 /** @type {?} */
5689 VaPackageDetailsComponent.prototype.displayTagName$;
5690}
5691
5692/**
5693 * @fileoverview added by tsickle
5694 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
5695 */
5696var VaProductsNavComponent = /** @class */ (function () {
5697 function VaProductsNavComponent(translateService) {
5698 this.translateService = translateService;
5699 this.itemSelected = new EventEmitter();
5700 this.selectedIndex = 0;
5701 this.pageMarker = 0;
5702 this.translateService.setTranslation('en', En.en, true);
5703 this.translateService.setTranslation('cs', Cs.cs, true);
5704 }
5705 /**
5706 * @param {?} index
5707 * @return {?}
5708 */
5709 VaProductsNavComponent.prototype.onItemSelected = /**
5710 * @param {?} index
5711 * @return {?}
5712 */
5713 function (index) {
5714 this.selectedIndex = index;
5715 this.itemSelected.emit(index);
5716 };
5717 /**
5718 * @param {?} slides
5719 * @return {?}
5720 */
5721 VaProductsNavComponent.prototype.moveSlides = /**
5722 * @param {?} slides
5723 * @return {?}
5724 */
5725 function (slides) {
5726 /** @type {?} */
5727 var sliderWidth = Math.round(slides.offsetWidth / slides.children[0].clientWidth);
5728 /** @type {?} */
5729 var numSlides = Math.ceil(slides.children.length / sliderWidth);
5730 if (numSlides === 0) {
5731 return;
5732 }
5733 /** @type {?} */
5734 var pageWidth = slides.offsetWidth;
5735 /** @type {?} */
5736 var move = 0;
5737 if (this.pageMarker === -1) {
5738 this.pageMarker = numSlides - 1; // go to end
5739 move = pageWidth * this.pageMarker;
5740 slides.style.left = "-" + move + "px";
5741 }
5742 else if (this.pageMarker >= numSlides) {
5743 slides.style.left = '0px';
5744 this.pageMarker = 0; // reset
5745 }
5746 else {
5747 move = pageWidth * this.pageMarker;
5748 slides.style.left = "-" + move + "px";
5749 }
5750 };
5751 /**
5752 * @param {?} slides
5753 * @return {?}
5754 */
5755 VaProductsNavComponent.prototype.pageNext = /**
5756 * @param {?} slides
5757 * @return {?}
5758 */
5759 function (slides) {
5760 this.pageMarker++;
5761 this.moveSlides(slides);
5762 };
5763 /**
5764 * @param {?} slides
5765 * @return {?}
5766 */
5767 VaProductsNavComponent.prototype.pagePrev = /**
5768 * @param {?} slides
5769 * @return {?}
5770 */
5771 function (slides) {
5772 this.pageMarker--;
5773 this.moveSlides(slides);
5774 };
5775 VaProductsNavComponent.decorators = [
5776 { type: Component, args: [{
5777 selector: 'va-products-nav',
5778 template: "<p *ngIf=\"items?.length > 1\" class=\"item-amount\">{{ 'FRONTEND.STORE.CONTAINS_NUM_ITEMS' | translate: {itemCount: items.length} }}</p>\n<div class=\"wrapper\">\n <nav *ngIf=\"items && !hideItemsNav\" (swipeleft)=\"pageNext(slides)\" (swiperight)=\"pagePrev(slides)\">\n <div [ngClass]=\"{'hide-arrows': items && items.length < 5}\">\n <span class=\"prev\" (click)=\"pagePrev(slides)\"><mat-icon>keyboard_arrow_left</mat-icon></span>\n <span class=\"next\" (click)=\"pageNext(slides)\"><mat-icon>keyboard_arrow_right</mat-icon></span>\n </div>\n <ul class=\"slides\" #slides>\n <li *ngFor=\"let item of items; index as i;\" (click)=\"onItemSelected(i)\">\n <a [ngClass]=\"{'active': i === selectedIndex}\">\n <span class=\"icon-area\">\n <va-icon [iconUrl]=\"item.icon || item.iconUrl\" [name]=\"item.name || item.title\" [diameter]=\"80\"></va-icon>\n <va-icon *ngIf=\"item.addonId\" class=\"addon-indicator\" [iconUrl]=\"item.productIcon\" [name]=\"item.productName\" [diameter]=\"24\"></va-icon>\n </span>\n <p>{{ item.name || item.title }}</p>\n <div *ngIf=\"item.addonId\">\n <span class=\"requires-text\">{{ 'FRONTEND.STORE.REQUIRES' | translate }}</span>\n <span>{{item.productName}}</span>\n </div>\n </a>\n </li>\n </ul>\n </nav>\n</div>\n",
5779 styles: ["nav{position:relative;width:350px;margin:0 auto;background:#fff;border:1px solid #e0e0e0;border-width:1px 0;overflow:hidden}nav ul{display:-webkit-box;display:flex;flex-wrap:nowrap;list-style:none;margin:0 50px;padding:0;position:relative;left:0;-webkit-transition:left .3s;transition:left .3s;word-break:break-word}nav li{min-width:100%;-webkit-box-flex:1;flex:1 0 25%;text-align:center;font-size:14px}nav li:first-child a{border-right:1px solid #e0e0e0}nav a{position:relative;display:block;height:100%;padding:20px;text-decoration:none;color:#212121;-webkit-transition:background .3s;transition:background .3s;-webkit-box-align:center;align-items:center;border-right:1px solid #e0e0e0;cursor:pointer}nav a:hover{background-color:rgba(255,255,255,.6)}nav a.active{background-color:#fff}nav a.active:after{content:'';display:block;position:absolute;bottom:-1px;left:0;width:100%;height:1px;background-color:#fff}nav p{margin-bottom:0}nav .icon img{width:80px;min-width:80px;height:80px}nav .next,nav .prev{position:absolute;height:100%;width:50px;top:0;background:rgba(33,33,33,.1);cursor:pointer;text-align:center;opacity:1;-webkit-transition:opacity .3s;transition:opacity .3s;display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;-webkit-box-pack:center;justify-content:center;-webkit-box-align:center;align-items:center;z-index:1}nav .next:not(.disabled):hover,nav .prev:not(.disabled):hover{background:rgba(33,33,33,.3)}nav .prev{left:0}nav .next{right:0}nav .disabled{cursor:default;opacity:0}@media screen and (min-width:600px){nav{width:auto;overflow:initial}nav li{min-width:0;width:25%;-webkit-box-flex:0;flex-grow:0}nav .hide-arrows{display:none}nav .hide-arrows+.slides{margin:0}}va-icon{display:inline-block}.item-amount{color:#9e9e9e;font-size:14px;text-align:right;margin:0 24px 8px}.wrapper{overflow:hidden}.requires-text{color:#9e9e9e}.icon-area{position:relative;display:inline-block}.addon-indicator{position:absolute;border:2px solid #fff;border-radius:50%;bottom:-2px;right:-2px}"]
5780 }] }
5781 ];
5782 /** @nocollapse */
5783 VaProductsNavComponent.ctorParameters = function () { return [
5784 { type: TranslateService }
5785 ]; };
5786 VaProductsNavComponent.propDecorators = {
5787 items: [{ type: Input }],
5788 hideItemsNav: [{ type: Input }],
5789 itemSelected: [{ type: Output }]
5790 };
5791 return VaProductsNavComponent;
5792}());
5793if (false) {
5794 /** @type {?} */
5795 VaProductsNavComponent.prototype.items;
5796 /** @type {?} */
5797 VaProductsNavComponent.prototype.hideItemsNav;
5798 /** @type {?} */
5799 VaProductsNavComponent.prototype.itemSelected;
5800 /** @type {?} */
5801 VaProductsNavComponent.prototype.selectedIndex;
5802 /** @type {?} */
5803 VaProductsNavComponent.prototype.pageMarker;
5804 /**
5805 * @type {?}
5806 * @private
5807 */
5808 VaProductsNavComponent.prototype.translateService;
5809}
5810
5811/**
5812 * @fileoverview added by tsickle
5813 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
5814 */
5815var ProductsNavV2Component = /** @class */ (function () {
5816 function ProductsNavV2Component(translateService) {
5817 this.translateService = translateService;
5818 this.itemSelected = new EventEmitter();
5819 this.selected_id = '';
5820 this.pageMarker = 0;
5821 this.translateService.setTranslation('en', En.en, true);
5822 this.translateService.setTranslation('cs', Cs.cs, true);
5823 }
5824 /**
5825 * @param {?} id
5826 * @return {?}
5827 */
5828 ProductsNavV2Component.prototype.onItemSelected = /**
5829 * @param {?} id
5830 * @return {?}
5831 */
5832 function (id) {
5833 this.selected_id = id;
5834 this.itemSelected.emit(id);
5835 };
5836 /**
5837 * @param {?} slides
5838 * @return {?}
5839 */
5840 ProductsNavV2Component.prototype.moveSlides = /**
5841 * @param {?} slides
5842 * @return {?}
5843 */
5844 function (slides) {
5845 /** @type {?} */
5846 var sliderWidth = Math.round(slides.offsetWidth / slides.children[0].clientWidth);
5847 /** @type {?} */
5848 var numSlides = Math.ceil(slides.children.length / sliderWidth);
5849 if (numSlides === 0) {
5850 return;
5851 }
5852 /** @type {?} */
5853 var pageWidth = slides.offsetWidth;
5854 /** @type {?} */
5855 var move = 0;
5856 if (this.pageMarker === -1) {
5857 this.pageMarker = numSlides - 1; // go to end
5858 move = pageWidth * this.pageMarker;
5859 slides.style.left = "-" + move + "px";
5860 }
5861 else if (this.pageMarker >= numSlides) {
5862 slides.style.left = '0px';
5863 this.pageMarker = 0; // reset
5864 }
5865 else {
5866 move = pageWidth * this.pageMarker;
5867 slides.style.left = "-" + move + "px";
5868 }
5869 };
5870 /**
5871 * @param {?} slides
5872 * @return {?}
5873 */
5874 ProductsNavV2Component.prototype.pageNext = /**
5875 * @param {?} slides
5876 * @return {?}
5877 */
5878 function (slides) {
5879 this.pageMarker++;
5880 this.moveSlides(slides);
5881 };
5882 /**
5883 * @param {?} slides
5884 * @return {?}
5885 */
5886 ProductsNavV2Component.prototype.pagePrev = /**
5887 * @param {?} slides
5888 * @return {?}
5889 */
5890 function (slides) {
5891 this.pageMarker--;
5892 this.moveSlides(slides);
5893 };
5894 ProductsNavV2Component.decorators = [
5895 { type: Component, args: [{
5896 selector: 'va-products-nav-v2',
5897 template: "<p *ngIf=\"items?.length > 1\" class=\"item-amount\">{{ 'FRONTEND.STORE.CONTAINS_NUM_ITEMS' | translate: {itemCount: items.length} }}</p>\n<div class=\"wrapper\">\n <nav *ngIf=\"items && !hideItemsNav\" (swipeleft)=\"pageNext(slides)\" (swiperight)=\"pagePrev(slides)\">\n <div [ngClass]=\"{'hide-arrows': items && items.length < 5}\">\n <span class=\"prev\" (click)=\"pagePrev(slides)\"><mat-icon>keyboard_arrow_left</mat-icon></span>\n <span class=\"next\" (click)=\"pageNext(slides)\"><mat-icon>keyboard_arrow_right</mat-icon></span>\n </div>\n <ul class=\"slides\" #slides>\n <li *ngFor=\"let lineItem of items;\" (click)=\"onItemSelected(lineItem?.item?.id)\">\n <a [ngClass]=\"{'active': lineItem?.item?.id === selected_id}\">\n <span class=\"icon-area\">\n <va-icon [iconUrl]=\"lineItem?.item?.icon\" [name]=\"lineItem?.item?.name\" [diameter]=\"80\"></va-icon>\n <va-icon *ngIf=\"lineItem?.parent?.id\" class=\"addon-indicator\" [iconUrl]=\"lineItem?.parent?.icon\" [name]=\"lineItem?.parent?.name\"\n [diameter]=\"24\"></va-icon>\n </span>\n <div class=\"name-container\">\n <div>{{ lineItem?.item?.name }}</div>\n <div *ngIf=\"lineItem?.item?.editionName\" class=\"edition-name\">{{ lineItem.item.editionName }}</div>\n </div>\n <div *ngIf=\"lineItem?.parent?.id\">\n <span class=\"requires-text\">{{ 'FRONTEND.STORE.REQUIRES' | translate }} </span>\n <span>{{lineItem?.parent.name}}</span>\n </div>\n </a>\n </li>\n </ul>\n </nav>\n</div>\n",
5898 styles: [".name-container{display:-webkit-box;display:flex;-webkit-box-pack:center;justify-content:center;-webkit-box-align:center;align-items:center;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}.name-container va-badge{margin-top:12px;margin-left:6px}nav{position:relative;width:350px;margin:0 auto;background:#fff;border:1px solid #e0e0e0;border-width:1px 0;overflow:hidden}nav ul{display:-webkit-box;display:flex;flex-wrap:nowrap;list-style:none;margin:0 50px;padding:0;position:relative;left:0;-webkit-transition:left .3s;transition:left .3s;word-break:break-word}nav li{min-width:100%;-webkit-box-flex:1;flex:1 0 25%;text-align:center;font-size:14px}nav li:first-child a{border-right:1px solid #e0e0e0}nav a{position:relative;display:block;height:100%;padding:20px;text-decoration:none;color:#212121;-webkit-transition:background .3s;transition:background .3s;-webkit-box-align:center;align-items:center;border-right:1px solid #e0e0e0;cursor:pointer}nav a:hover{background-color:rgba(255,255,255,.6)}nav a.active{background-color:#fff}nav a.active:after{content:'';display:block;position:absolute;bottom:-1px;left:0;width:100%;height:1px;background-color:#fff}nav p{margin-bottom:0}nav .icon img{width:80px;min-width:80px;height:80px}nav .next,nav .prev{position:absolute;height:100%;width:50px;top:0;background:rgba(33,33,33,.1);cursor:pointer;text-align:center;opacity:1;-webkit-transition:opacity .3s;transition:opacity .3s;display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;-webkit-box-pack:center;justify-content:center;-webkit-box-align:center;align-items:center;z-index:1}nav .next:not(.disabled):hover,nav .prev:not(.disabled):hover{background:rgba(33,33,33,.3)}nav .prev{left:0}nav .next{right:0}nav .disabled{cursor:default;opacity:0}@media screen and (min-width:600px){nav{width:auto;overflow:initial}nav li{min-width:0;width:25%;-webkit-box-flex:0;flex-grow:0}nav .hide-arrows{display:none}nav .hide-arrows+.slides{margin:0}}va-icon{display:inline-block}.item-amount{color:#9e9e9e;font-size:14px;text-align:right;margin:0 24px 8px}.wrapper{overflow:hidden}.requires-text{color:#9e9e9e}.icon-area{position:relative;display:inline-block}.addon-indicator{position:absolute;border:2px solid #fff;border-radius:50%;bottom:-2px;right:-2px}.edition-name{color:#9e9e9e;font-style:italic;text-align:center;width:100%;font-size:16px;margin-bottom:4px}"]
5899 }] }
5900 ];
5901 /** @nocollapse */
5902 ProductsNavV2Component.ctorParameters = function () { return [
5903 { type: TranslateService }
5904 ]; };
5905 ProductsNavV2Component.propDecorators = {
5906 items: [{ type: Input }],
5907 hideItemsNav: [{ type: Input }],
5908 itemSelected: [{ type: Output }]
5909 };
5910 return ProductsNavV2Component;
5911}());
5912if (false) {
5913 /** @type {?} */
5914 ProductsNavV2Component.prototype.items;
5915 /** @type {?} */
5916 ProductsNavV2Component.prototype.hideItemsNav;
5917 /** @type {?} */
5918 ProductsNavV2Component.prototype.itemSelected;
5919 /** @type {?} */
5920 ProductsNavV2Component.prototype.selected_id;
5921 /** @type {?} */
5922 ProductsNavV2Component.prototype.pageMarker;
5923 /**
5924 * @type {?}
5925 * @private
5926 */
5927 ProductsNavV2Component.prototype.translateService;
5928}
5929
5930/**
5931 * @fileoverview added by tsickle
5932 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
5933 */
5934var VaProductsNavModule = /** @class */ (function () {
5935 function VaProductsNavModule() {
5936 }
5937 VaProductsNavModule.decorators = [
5938 { type: NgModule, args: [{
5939 imports: [
5940 CommonModule,
5941 MatIconModule,
5942 VaIconModule,
5943 VaBadgeModule,
5944 TranslateModule
5945 ],
5946 declarations: [VaProductsNavComponent, ProductsNavV2Component],
5947 exports: [VaProductsNavComponent, ProductsNavV2Component]
5948 },] }
5949 ];
5950 return VaProductsNavModule;
5951}());
5952
5953/**
5954 * @fileoverview added by tsickle
5955 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
5956 */
5957var VaPackageDetailsModule = /** @class */ (function () {
5958 function VaPackageDetailsModule() {
5959 }
5960 VaPackageDetailsModule.decorators = [
5961 { type: NgModule, args: [{
5962 imports: [
5963 VaImageGalleryModule, CommonModule, MatIconModule, VaSafeHtmlModule, VaIconModule,
5964 VaPricingModule, MatButtonModule, VaFilesModule, VaFaqsModule, VaSellingInfoModule,
5965 VaHeaderContainerModule, VaAddonListModule, VaProductsNavModule
5966 ],
5967 declarations: [VaPackageDetailsComponent],
5968 exports: [VaPackageDetailsComponent],
5969 entryComponents: [VaPackageDetailsComponent]
5970 },] }
5971 ];
5972 return VaPackageDetailsModule;
5973}());
5974
5975/**
5976 * @fileoverview added by tsickle
5977 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
5978 */
5979var PackageDetails = /** @class */ (function () {
5980 function PackageDetails() {
5981 }
5982 Object.defineProperty(PackageDetails.prototype, "isPackageFree", {
5983 get: /**
5984 * @return {?}
5985 */
5986 function () {
5987 /** @type {?} */
5988 var isFreeHelper = (/**
5989 * @param {?} prices
5990 * @return {?}
5991 */
5992 function (prices) {
5993 return prices ? prices.some((/**
5994 * @param {?} p
5995 * @return {?}
5996 */
5997 function (p) { return p.price === 0 || p.price === undefined; })) : false;
5998 });
5999 return this.pricing && isFreeHelper(this.pricing.prices);
6000 },
6001 enumerable: true,
6002 configurable: true
6003 });
6004 return PackageDetails;
6005}());
6006if (false) {
6007 /** @type {?} */
6008 PackageDetails.prototype.solution_id;
6009 /** @type {?} */
6010 PackageDetails.prototype.partner_id;
6011 /** @type {?} */
6012 PackageDetails.prototype.market_id;
6013 /** @type {?} */
6014 PackageDetails.prototype.name;
6015 /** @type {?} */
6016 PackageDetails.prototype.icon;
6017 /** @type {?} */
6018 PackageDetails.prototype.status;
6019 /** @type {?} */
6020 PackageDetails.prototype.tagline;
6021 /** @type {?} */
6022 PackageDetails.prototype.header_image_url;
6023 /** @type {?} */
6024 PackageDetails.prototype.content;
6025 /** @type {?} */
6026 PackageDetails.prototype.hide_product_icons_and_names;
6027 /** @type {?} */
6028 PackageDetails.prototype.hide_product_details;
6029 /** @type {?} */
6030 PackageDetails.prototype.createdDate;
6031 /** @type {?} */
6032 PackageDetails.prototype.updatedDate;
6033 /** @type {?} */
6034 PackageDetails.prototype.pricing;
6035 /** @type {?} */
6036 PackageDetails.prototype.line_items;
6037 /** @type {?} */
6038 PackageDetails.prototype.market_action;
6039}
6040/**
6041 * @param {?} data
6042 * @param {?} products
6043 * @return {?}
6044 */
6045function convertToPackageDetails(data, products) {
6046 if (!data) {
6047 return undefined;
6048 }
6049 /** @type {?} */
6050 var newPackage = new PackageDetails();
6051 if (!data.pricing) {
6052 data.pricing = Pricing$1.fromProto({
6053 currency: undefined,
6054 prices: [{
6055 price: 0,
6056 frequency: undefined,
6057 isStartingPrice: false,
6058 }]
6059 });
6060 }
6061 Object.assign(newPackage, data);
6062 if (!newPackage.name) {
6063 newPackage.name = 'Untitled';
6064 }
6065 if (data.created) {
6066 newPackage.createdDate = new Date(data.created);
6067 }
6068 if (data.updated) {
6069 newPackage.updatedDate = new Date(data.updated);
6070 }
6071 if (data.lineItems) {
6072 newPackage.line_items = convertProtoLineItemsToStoreLineItems(data.lineItems, products);
6073 }
6074 if (typeof data.pricing.currency === 'number') {
6075 newPackage.pricing.currency = Currency[data.pricing.currency];
6076 }
6077 return newPackage;
6078}
6079/**
6080 * @param {?} protoLineItems
6081 * @param {?} products
6082 * @return {?}
6083 */
6084function convertProtoLineItemsToStoreLineItems(protoLineItems, products) {
6085 if (!protoLineItems || !protoLineItems.lineItems || protoLineItems.lineItems.length === 0 || !products || products.length === 0) {
6086 return [];
6087 }
6088 return protoLineItems.lineItems.map((/**
6089 * @param {?} lineItem
6090 * @return {?}
6091 */
6092 function (lineItem) {
6093 /** @type {?} */
6094 var product = products.find((/**
6095 * @param {?} p
6096 * @return {?}
6097 */
6098 function (p) { return p.productId === lineItem.id; }));
6099 /** @type {?} */
6100 var parent;
6101 if (!!lineItem.parentId) {
6102 parent = products.find((/**
6103 * @param {?} p
6104 * @return {?}
6105 */
6106 function (p) { return p.productId === lineItem.parentId; }));
6107 }
6108 return convertProtoLineItemToStoreLineItem(lineItem, product, parent);
6109 }));
6110}
6111/**
6112 * @param {?} protoLineItem
6113 * @param {?} product
6114 * @param {?=} parentProduct
6115 * @return {?}
6116 */
6117function convertProtoLineItemToStoreLineItem(protoLineItem, product, parentProduct) {
6118 if (!product || !protoLineItem) {
6119 return undefined;
6120 }
6121 /** @type {?} */
6122 var files = [];
6123 if (product.pdfUploadUrls && product.pdfUploadUrls.length > 0) {
6124 files = product.pdfUploadUrls.map((/**
6125 * @param {?} url
6126 * @return {?}
6127 */
6128 function (url) { return new File(url); }));
6129 }
6130 /** @type {?} */
6131 var lineItem = (/** @type {?} */ ({
6132 item: {
6133 id: protoLineItem.id,
6134 editionId: protoLineItem.editionId,
6135 icon: product.iconUrl,
6136 name: product.name,
6137 editionName: '',
6138 description: product.description,
6139 keySellingPoints: product.keySellingPoints,
6140 faqs: product.faqs,
6141 files: files,
6142 screenshotUrls: product.screenshotUrls,
6143 lmiCategories: [],
6144 },
6145 quantity: protoLineItem.quantity,
6146 parent: {}
6147 }));
6148 if (protoLineItem.parentId && parentProduct) {
6149 lineItem.parent = {
6150 id: protoLineItem.parentId,
6151 editionId: '',
6152 icon: parentProduct.iconUrl,
6153 name: parentProduct.name,
6154 editionName: '',
6155 };
6156 }
6157 return lineItem;
6158}
6159
6160/**
6161 * @fileoverview added by tsickle
6162 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
6163 */
6164var VaPackageDetailsV2Component = /** @class */ (function () {
6165 function VaPackageDetailsV2Component(translateService) {
6166 var _this = this;
6167 this.translateService = translateService;
6168 this.showActionButton = true;
6169 this.showPricing = true;
6170 this.getItNow = new EventEmitter();
6171 this.pkg$$ = new ReplaySubject(1);
6172 this.itemSelectedEvent$$ = new BehaviorSubject('');
6173 this.translateService.setTranslation('en', En.en, true);
6174 this.translateService.setTranslation('cs', Cs.cs, true);
6175 this.orderedLineItems$ = this.pkg$$.pipe(map((/**
6176 * @param {?} pkg
6177 * @return {?}
6178 */
6179 function (pkg) { return pkg.line_items; })), filter((/**
6180 * @param {?} items
6181 * @return {?}
6182 */
6183 function (items) { return !!items || items.length === 0; })), shareReplay(1));
6184 this.productNameForSingleAddon$ = this.orderedLineItems$.pipe(map((/**
6185 * @param {?} items
6186 * @return {?}
6187 */
6188 function (items) { return _this.getParentsNameForItem(items); })));
6189 this.selectedItem$ = combineLatest([this.itemSelectedEvent$$, this.orderedLineItems$]).pipe(map((/**
6190 * @param {?} __0
6191 * @return {?}
6192 */
6193 function (_a) {
6194 var _b = __read(_a, 2), id = _b[0], lineItems = _b[1];
6195 return lineItems.find((/**
6196 * @param {?} lineItem
6197 * @return {?}
6198 */
6199 function (lineItem) { return lineItem.item.id === id; }));
6200 })));
6201 this.lmiCategories$ = this.orderedLineItems$.pipe(map((/**
6202 * @param {?} lis
6203 * @return {?}
6204 */
6205 function (lis) {
6206 /** @type {?} */
6207 var lmiMap = (lis || []).reduce((/**
6208 * @param {?} prev
6209 * @param {?} li
6210 * @return {?}
6211 */
6212 function (prev, li) {
6213 if (li && li.item) {
6214 (li.item.lmiCategories || []).forEach((/**
6215 * @param {?} lmi
6216 * @return {?}
6217 */
6218 function (lmi) { return prev.set(lmi, lmi); }));
6219 }
6220 return prev;
6221 }), new Map());
6222 /** @type {?} */
6223 var lmiCats = [];
6224 lmiMap.forEach((/**
6225 * @param {?} v
6226 * @param {?} k
6227 * @return {?}
6228 */
6229 function (v, k) {
6230 lmiCats.push(k);
6231 }));
6232 return lmiCats;
6233 })));
6234 // Set the initial selected Item
6235 this.orderedLineItems$.pipe(map((/**
6236 * @param {?} lineItems
6237 * @return {?}
6238 */
6239 function (lineItems) { return lineItems[0]; })), tap((/**
6240 * @param {?} lineItem
6241 * @return {?}
6242 */
6243 function (lineItem) { return _this.selectItem(lineItem && lineItem.item ? lineItem.item.id : ''); })), take(1)).subscribe();
6244 }
6245 Object.defineProperty(VaPackageDetailsV2Component.prototype, "pkg", {
6246 set: /**
6247 * @param {?} pkg
6248 * @return {?}
6249 */
6250 function (pkg) {
6251 this.pkg$$.next(pkg);
6252 },
6253 enumerable: true,
6254 configurable: true
6255 });
6256 /**
6257 * @return {?}
6258 */
6259 VaPackageDetailsV2Component.prototype.ngOnInit = /**
6260 * @return {?}
6261 */
6262 function () {
6263 if (!this.actionLabel) {
6264 this.actionLabel = this.translateService.instant('FRONTEND.STORE.GET_IT_NOW');
6265 }
6266 };
6267 /**
6268 * @param {?} id
6269 * @return {?}
6270 */
6271 VaPackageDetailsV2Component.prototype.selectItem = /**
6272 * @param {?} id
6273 * @return {?}
6274 */
6275 function (id) {
6276 this.itemSelectedEvent$$.next(id);
6277 };
6278 /**
6279 * @return {?}
6280 */
6281 VaPackageDetailsV2Component.prototype.emitGetItNow = /**
6282 * @return {?}
6283 */
6284 function () {
6285 this.getItNow.emit();
6286 };
6287 /**
6288 * @param {?} items
6289 * @return {?}
6290 */
6291 VaPackageDetailsV2Component.prototype.getParentsNameForItem = /**
6292 * @param {?} items
6293 * @return {?}
6294 */
6295 function (items) {
6296 if (items && items.length === 1 && items[0]) {
6297 return items[0].parent.name;
6298 }
6299 };
6300 VaPackageDetailsV2Component.decorators = [
6301 { type: Component, args: [{
6302 selector: 'va-package-details-v2',
6303 template: "<div *ngIf=\"pkg$$ | async as pkg\" class=\"page\">\n <va-header-container [iconUrl]=\"pkg.icon\"\n [title]=\"pkg.name\"\n [tagline]=\"pkg.tagline\"\n [prerequisite]=\"productNameForSingleAddon$ | async\"\n [chipLabels]=\"lmiCategories$ | async\"\n [pricing]=\"pkg.pricing\"\n [pricingLabel]=\"'FRONTEND.STORE.PRICING' | translate\"\n [showAction]=\"showActionButton\"\n [showPricing]=\"showPricing\"\n [actionLabel]=\"actionLabel\"\n [actionEnabled]=true\n (actionSelected)=\"emitGetItNow()\"\n ></va-header-container>\n\n <ng-container *ngIf=\"pkg?.content\">\n <va-selling-info [description]=\"pkg.content\"></va-selling-info>\n </ng-container>\n\n <va-products-nav-v2 [items]=\"orderedLineItems$ | async\"\n [hideItemsNav]=\"pkg?.hide_product_icons_and_names\"\n (itemSelected)=\"selectItem($event)\"></va-products-nav-v2>\n\n <ng-container *ngIf=\"selectedItem$ | async as selectedItem\">\n <div *ngIf=\"!pkg?.hide_product_details\" class=\"package-content\">\n <div class=\"left-column\">\n <section *ngIf=\"selectedItem?.item?.description || selectedItem?.item?.keySellingPoints\">\n <va-selling-info [description]=\"selectedItem?.item?.description\"\n [keySellingPoints]=\"selectedItem?.item?.keySellingPoints\"></va-selling-info>\n </section>\n\n <section *ngIf=\"selectedItem?.item?.faqs?.length > 0 && selectedItem?.item?.faqs[0].question\">\n <h2 class=\"va-component-title\">{{ 'FRONTEND.STORE.FAQS' | translate }}</h2>\n <va-faqs [faqs]=\"selectedItem.item.faqs\"></va-faqs>\n </section>\n </div>\n\n <div class=\"right-column\">\n <section *ngIf=\"selectedItem?.item?.screenshotUrls?.length > 0\">\n <h2 class=\"va-component-title\">{{ 'FRONTEND.STORE.GALLERY' | translate }}</h2>\n <va-image-gallery [imageUrls]=\"selectedItem.item.screenshotUrls\"></va-image-gallery>\n </section>\n\n <section *ngIf=\"selectedItem?.item?.files?.length > 0\">\n <h2 class=\"va-component-title\">{{ 'FRONTEND.STORE.FILES' | translate }}</h2>\n <va-files [files]=\"selectedItem.item.files\"></va-files>\n </section>\n </div>\n </div>\n </ng-container>\n</div>\n",
6304 styles: [":host{display:block;font-size:14px;line-height:1.4}:host *{box-sizing:border-box}.va-component-title{font-size:24px;font-weight:300;margin-top:0}@media screen and (min-width:600px){.va-component-title{font-size:32px}}img{max-width:100%}va-icon{display:inline-block}.page{position:relative;margin:0 auto 20px;background:#fff;color:#212121;box-shadow:0 3px 10px rgba(33,33,33,.3);overflow:hidden;font-size:16px}.page .item-amount{color:#9e9e9e;font-size:14px;text-align:right;margin:0 24px 8px}section{padding:24px}.left-column{width:66%}@media screen and (max-width:600px){.left-column{width:100%}}.right-column{width:34%}.package-content{display:-webkit-box;display:flex}@media screen and (max-width:600px){.right-column{width:100%}.package-content{-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}}"]
6305 }] }
6306 ];
6307 /** @nocollapse */
6308 VaPackageDetailsV2Component.ctorParameters = function () { return [
6309 { type: TranslateService }
6310 ]; };
6311 VaPackageDetailsV2Component.propDecorators = {
6312 showActionButton: [{ type: Input }],
6313 showPricing: [{ type: Input }],
6314 actionLabel: [{ type: Input }],
6315 pkg: [{ type: Input }],
6316 getItNow: [{ type: Output }]
6317 };
6318 return VaPackageDetailsV2Component;
6319}());
6320if (false) {
6321 /** @type {?} */
6322 VaPackageDetailsV2Component.prototype.showActionButton;
6323 /** @type {?} */
6324 VaPackageDetailsV2Component.prototype.showPricing;
6325 /** @type {?} */
6326 VaPackageDetailsV2Component.prototype.actionLabel;
6327 /** @type {?} */
6328 VaPackageDetailsV2Component.prototype.getItNow;
6329 /** @type {?} */
6330 VaPackageDetailsV2Component.prototype.pkg$$;
6331 /** @type {?} */
6332 VaPackageDetailsV2Component.prototype.itemSelectedEvent$$;
6333 /** @type {?} */
6334 VaPackageDetailsV2Component.prototype.selectedItem$;
6335 /** @type {?} */
6336 VaPackageDetailsV2Component.prototype.orderedLineItems$;
6337 /** @type {?} */
6338 VaPackageDetailsV2Component.prototype.productNameForSingleAddon$;
6339 /** @type {?} */
6340 VaPackageDetailsV2Component.prototype.lmiCategories$;
6341 /**
6342 * @type {?}
6343 * @private
6344 */
6345 VaPackageDetailsV2Component.prototype.translateService;
6346}
6347
6348/**
6349 * @fileoverview added by tsickle
6350 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
6351 */
6352var VaPackageDetailsV2Module = /** @class */ (function () {
6353 function VaPackageDetailsV2Module() {
6354 }
6355 VaPackageDetailsV2Module.decorators = [
6356 { type: NgModule, args: [{
6357 imports: [
6358 VaImageGalleryModule,
6359 CommonModule,
6360 MatIconModule,
6361 VaSafeHtmlModule,
6362 VaIconModule,
6363 VaPricingModule,
6364 MatButtonModule,
6365 VaFilesModule,
6366 VaFaqsModule,
6367 VaSellingInfoModule,
6368 VaHeaderContainerModule,
6369 VaAddonListModule,
6370 VaProductsNavModule,
6371 TranslateModule
6372 ],
6373 declarations: [VaPackageDetailsV2Component],
6374 exports: [VaPackageDetailsV2Component],
6375 entryComponents: [VaPackageDetailsV2Component]
6376 },] }
6377 ];
6378 return VaPackageDetailsV2Module;
6379}());
6380
6381/**
6382 * @fileoverview added by tsickle
6383 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
6384 */
6385/**
6386 * @record
6387 */
6388function SalesPackage() { }
6389if (false) {
6390 /** @type {?} */
6391 SalesPackage.prototype.formattedPrices;
6392 /** @type {?} */
6393 SalesPackage.prototype.packageId;
6394 /** @type {?} */
6395 SalesPackage.prototype.name;
6396 /** @type {?} */
6397 SalesPackage.prototype.icon;
6398 /** @type {?} */
6399 SalesPackage.prototype.productIds;
6400 /** @type {?} */
6401 SalesPackage.prototype.products;
6402 /** @type {?} */
6403 SalesPackage.prototype.addonsWithNoParent;
6404 /** @type {?} */
6405 SalesPackage.prototype.totalAddons;
6406 /** @type {?|undefined} */
6407 SalesPackage.prototype.activationStatus;
6408}
6409/**
6410 * @record
6411 */
6412function SalesProduct() { }
6413if (false) {
6414 /** @type {?} */
6415 SalesProduct.prototype.formattedPrices;
6416 /** @type {?} */
6417 SalesProduct.prototype.productId;
6418 /** @type {?} */
6419 SalesProduct.prototype.name;
6420 /** @type {?} */
6421 SalesProduct.prototype.icon;
6422 /** @type {?} */
6423 SalesProduct.prototype.tagline;
6424 /** @type {?|undefined} */
6425 SalesProduct.prototype.activationStatus;
6426 /** @type {?|undefined} */
6427 SalesProduct.prototype.editionId;
6428 /** @type {?|undefined} */
6429 SalesProduct.prototype.editionName;
6430 /** @type {?} */
6431 SalesProduct.prototype.addons;
6432 /** @type {?|undefined} */
6433 SalesProduct.prototype.parentInfo;
6434}
6435/**
6436 * @record
6437 */
6438function ProductParentInfo() { }
6439if (false) {
6440 /** @type {?} */
6441 ProductParentInfo.prototype.parentId;
6442 /** @type {?} */
6443 ProductParentInfo.prototype.parentName;
6444 /** @type {?} */
6445 ProductParentInfo.prototype.parentIconUrl;
6446 /** @type {?} */
6447 ProductParentInfo.prototype.multipleActivations;
6448}
6449/**
6450 * @record
6451 */
6452function SalesAddon() { }
6453if (false) {
6454 /** @type {?} */
6455 SalesAddon.prototype.parentId;
6456 /** @type {?} */
6457 SalesAddon.prototype.addonId;
6458 /** @type {?} */
6459 SalesAddon.prototype.name;
6460 /** @type {?} */
6461 SalesAddon.prototype.icon;
6462 /** @type {?} */
6463 SalesAddon.prototype.tagline;
6464 /** @type {?} */
6465 SalesAddon.prototype.parentName;
6466 /** @type {?} */
6467 SalesAddon.prototype.parentIcon;
6468 /** @type {?} */
6469 SalesAddon.prototype.multipleActivations;
6470 /** @type {?|undefined} */
6471 SalesAddon.prototype.activationStatus;
6472}
6473/**
6474 * @record
6475 */
6476function PackageItemActivationStatus() { }
6477if (false) {
6478 /** @type {?} */
6479 PackageItemActivationStatus.prototype.packageItemId;
6480 /** @type {?} */
6481 PackageItemActivationStatus.prototype.status;
6482}
6483/** @enum {number} */
6484var ActivationStatus = {
6485 SUCCESS: 0,
6486 WARNING: 1,
6487 ERROR: 2,
6488};
6489ActivationStatus[ActivationStatus.SUCCESS] = 'SUCCESS';
6490ActivationStatus[ActivationStatus.WARNING] = 'WARNING';
6491ActivationStatus[ActivationStatus.ERROR] = 'ERROR';
6492/**
6493 * @record
6494 */
6495function StatusNotificationItem() { }
6496if (false) {
6497 /** @type {?} */
6498 StatusNotificationItem.prototype.icon;
6499 /** @type {?} */
6500 StatusNotificationItem.prototype.text;
6501 /** @type {?} */
6502 StatusNotificationItem.prototype.status;
6503}
6504/**
6505 * @param {?} packages
6506 * @param {?} products
6507 * @param {?} addons
6508 * @return {?}
6509 */
6510function buildSalesPackages(packages, products, addons) {
6511 if (!packages || packages.length < 1) {
6512 return [];
6513 }
6514 return packages.map((/**
6515 * @param {?} pkg
6516 * @return {?}
6517 */
6518 function (pkg) { return buildSalesPackageFromPackage(pkg, products, addons); }));
6519}
6520/**
6521 * @param {?} pkg
6522 * @param {?} products
6523 * @param {?} addons
6524 * @return {?}
6525 */
6526function buildSalesPackageFromPackage(pkg, products, addons) {
6527 if (!pkg) {
6528 return null;
6529 }
6530 /** @type {?} */
6531 var salesProducts = buildSalesProducts(pkg, products, addons);
6532 // Addons can be in a package even if the parent product is not, this will create salesAddons with no parent
6533 /** @type {?} */
6534 var addonsWithNoParent = buildSalesAddonsWithNoParent(pkg, products, addons);
6535 return createSalesPackage(pkg, salesProducts, addonsWithNoParent);
6536}
6537/**
6538 * @param {?} pkg
6539 * @param {?} products
6540 * @param {?} addons
6541 * @return {?}
6542 */
6543function buildSalesProducts(pkg, products, addons) {
6544 if (!(products && products.length && pkg.products && pkg.products.length)) {
6545 return [];
6546 }
6547 /** @type {?} */
6548 var productMap = new Map();
6549 products.forEach((/**
6550 * @param {?} product
6551 * @return {?}
6552 */
6553 function (product) { return productMap.set(product.productId, product); }));
6554 return pkg.products
6555 .map((/**
6556 * @param {?} productId
6557 * @return {?}
6558 */
6559 function (productId) {
6560 /** @type {?} */
6561 var productMatch = productMap.get(productId);
6562 /** @type {?} */
6563 var addonsInPackage = coerceAddonsForAddonKeys(addons, pkg.addon_keys);
6564 return productMatch ? buildSalesProductFromProduct(productMatch, addonsInPackage) : null;
6565 }))
6566 .filter((/**
6567 * @param {?} productItem
6568 * @return {?}
6569 */
6570 function (productItem) { return productItem; }));
6571}
6572/**
6573 * @param {?} addons
6574 * @param {?} addonKeys
6575 * @return {?}
6576 */
6577function coerceAddonsForAddonKeys(addons, addonKeys) {
6578 if (!addons || addons.length === 0 || !addonKeys || addonKeys.length === 0) {
6579 return [];
6580 }
6581 return addons.reduce((/**
6582 * @param {?} addonsArray
6583 * @param {?} addon
6584 * @return {?}
6585 */
6586 function (addonsArray, addon) {
6587 /** @type {?} */
6588 var key = addonKeys.find((/**
6589 * @param {?} k
6590 * @return {?}
6591 */
6592 function (k) { return k.addonId === addon.addonId; }));
6593 if (key) {
6594 /** @type {?} */
6595 var quantity = key.quantity || 1;
6596 for (var i = 0; i < quantity; i++) {
6597 addonsArray.push(addon);
6598 }
6599 }
6600 return addonsArray;
6601 }), []);
6602}
6603/**
6604 * @param {?} pkg
6605 * @param {?} products
6606 * @param {?} addons
6607 * @return {?}
6608 */
6609function buildSalesAddonsWithNoParent(pkg, products, addons) {
6610 if (!addons || addons.length < 1 || !pkg.addon_keys) {
6611 return [];
6612 }
6613 /** @type {?} */
6614 var productMap = new Map();
6615 products.forEach((/**
6616 * @param {?} product
6617 * @return {?}
6618 */
6619 function (product) { return productMap.set(product.productId, product); }));
6620 /** @type {?} */
6621 var addonsMap = new Map();
6622 addons.forEach((/**
6623 * @param {?} addon
6624 * @return {?}
6625 */
6626 function (addon) { return addonsMap.set(addon.addonId, addon); }));
6627 /** @type {?} */
6628 var addonsWithNoParent = pkg.addon_keys.reduce((/**
6629 * @param {?} addonArray
6630 * @param {?} addonKey
6631 * @return {?}
6632 */
6633 function (addonArray, addonKey) {
6634 if (pkg.products && pkg.products.some((/**
6635 * @param {?} productId
6636 * @return {?}
6637 */
6638 function (productId) { return productId === addonKey.appId; }))) {
6639 return addonArray || [];
6640 }
6641 /** @type {?} */
6642 var parentProduct = productMap.get(addonKey.appId);
6643 /** @type {?} */
6644 var parentName = parentProduct ? parentProduct.name : null;
6645 /** @type {?} */
6646 var parentIcon = parentProduct ? parentProduct.iconUrl : null;
6647 /** @type {?} */
6648 var quantity = addonKey.quantity || 1;
6649 /** @type {?} */
6650 var addon = addonsMap.get(addonKey.addonId);
6651 for (var i = 0; i < quantity; i++) {
6652 addonArray.push(createSalesAddon(addon, parentName, parentIcon));
6653 }
6654 return addonArray;
6655 }), []);
6656 return addonsWithNoParent;
6657}
6658/**
6659 * @param {?} product
6660 * @param {?} addons
6661 * @return {?}
6662 */
6663function buildSalesProductFromProduct(product, addons) {
6664 if (!product) {
6665 return null;
6666 }
6667 if (!addons || addons.length < 1) {
6668 return createSalesProduct(product, null);
6669 }
6670 /** @type {?} */
6671 var productAddons = addons.filter((/**
6672 * @param {?} addon
6673 * @return {?}
6674 */
6675 function (addon) { return addon.appId === product.productId; }));
6676 /** @type {?} */
6677 var salesAddons = createSalesAddons(productAddons);
6678 return createSalesProduct(product, salesAddons);
6679}
6680/**
6681 * @param {?} pkg
6682 * @param {?} salesProducts
6683 * @param {?} addonsWithNoParent
6684 * @return {?}
6685 */
6686function createSalesPackage(pkg, salesProducts, addonsWithNoParent) {
6687 var e_1, _a;
6688 /** @type {?} */
6689 var totalAddons = 0;
6690 try {
6691 for (var _b = __values(pkg.addon_keys || []), _c = _b.next(); !_c.done; _c = _b.next()) {
6692 var key = _c.value;
6693 totalAddons += key.quantity || 1;
6694 }
6695 }
6696 catch (e_1_1) { e_1 = { error: e_1_1 }; }
6697 finally {
6698 try {
6699 if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
6700 }
6701 finally { if (e_1) throw e_1.error; }
6702 }
6703 return {
6704 formattedPrices: pkg.priceStrings.join(', '),
6705 packageId: pkg.solution_id,
6706 name: pkg.name,
6707 icon: pkg.icon,
6708 productIds: pkg.products,
6709 products: salesProducts || [],
6710 addonsWithNoParent: addonsWithNoParent || [],
6711 totalAddons: totalAddons
6712 };
6713}
6714/**
6715 * @param {?} product
6716 * @param {?} salesAddons
6717 * @return {?}
6718 */
6719function createSalesProduct(product, salesAddons) {
6720 /** @type {?} */
6721 var parentInfo;
6722 if (product instanceof ProductWithParent) {
6723 parentInfo = {
6724 parentId: product.parentId,
6725 parentName: product.parentName,
6726 parentIconUrl: product.parentIconUrl,
6727 multipleActivations: product.multipleActivations || false,
6728 };
6729 }
6730 return {
6731 formattedPrices: product.priceStrings.join(', '),
6732 productId: product.productId,
6733 name: product.name,
6734 tagline: product.tagline || '',
6735 icon: product.iconUrl,
6736 addons: salesAddons || [],
6737 editionId: product.editionId,
6738 editionName: product.editionName,
6739 parentInfo: parentInfo,
6740 };
6741}
6742/**
6743 * @param {?} addons
6744 * @return {?}
6745 */
6746function createSalesAddons(addons) {
6747 return addons.map((/**
6748 * @param {?} addon
6749 * @return {?}
6750 */
6751 function (addon) { return createSalesAddon(addon); }));
6752}
6753/**
6754 * @param {?} addon
6755 * @param {?=} parentName
6756 * @param {?=} parentIcon
6757 * @return {?}
6758 */
6759function createSalesAddon(addon, parentName, parentIcon) {
6760 return {
6761 parentId: addon.appId,
6762 addonId: addon.addonId,
6763 name: addon.title,
6764 tagline: addon.tagline || '',
6765 icon: addon.icon || '',
6766 multipleActivations: addon.multipleActivations,
6767 parentIcon: parentIcon || '',
6768 parentName: parentName || ''
6769 };
6770}
6771/**
6772 * @param {?} pkg
6773 * @param {?} products
6774 * @param {?} addons
6775 * @param {?} activationStatus
6776 * @return {?}
6777 */
6778function createSalesPackageWithStatus(pkg, products, addons, activationStatus) {
6779 return {
6780 formattedPrices: pkg.formattedPrices,
6781 packageId: pkg.packageId,
6782 name: pkg.name,
6783 icon: pkg.icon,
6784 productIds: pkg.productIds,
6785 products: products || [],
6786 addonsWithNoParent: addons || [],
6787 activationStatus: activationStatus || null,
6788 totalAddons: pkg.totalAddons
6789 };
6790}
6791/**
6792 * @param {?} product
6793 * @param {?} addons
6794 * @param {?} activationStatus
6795 * @return {?}
6796 */
6797function createSalesProductWithStatus(product, addons, activationStatus) {
6798 return {
6799 formattedPrices: product.formattedPrices,
6800 productId: product.productId,
6801 name: product.name,
6802 editionId: product.editionId,
6803 editionName: product.editionName,
6804 tagline: product.tagline,
6805 icon: product.icon,
6806 addons: addons || [],
6807 activationStatus: activationStatus || null,
6808 parentInfo: product.parentInfo || null,
6809 };
6810}
6811/**
6812 * @param {?} addon
6813 * @param {?} activationStatus
6814 * @return {?}
6815 */
6816function createSalesAddonWithStatus(addon, activationStatus) {
6817 return {
6818 parentId: addon.parentId,
6819 addonId: addon.addonId,
6820 name: addon.name,
6821 tagline: addon.tagline,
6822 icon: addon.icon,
6823 parentIcon: addon.parentIcon,
6824 parentName: addon.parentName,
6825 multipleActivations: addon.multipleActivations,
6826 activationStatus: activationStatus || null
6827 };
6828}
6829/**
6830 * @param {?} salesPackages
6831 * @param {?} statuses
6832 * @return {?}
6833 */
6834function addStatusesToSalesPackages(salesPackages, statuses) {
6835 if (!statuses || statuses.length === 0) {
6836 return salesPackages;
6837 }
6838 return salesPackages.map((/**
6839 * @param {?} salesPackage
6840 * @return {?}
6841 */
6842 function (salesPackage) {
6843 /** @type {?} */
6844 var newProducts = salesPackage.products.map((/**
6845 * @param {?} product
6846 * @return {?}
6847 */
6848 function (product) { return addStatusesToSalesProduct(product, statuses); }));
6849 /** @type {?} */
6850 var newAddonsWithNoParent = salesPackage.addonsWithNoParent.map((/**
6851 * @param {?} addon
6852 * @return {?}
6853 */
6854 function (addon) {
6855 /** @type {?} */
6856 var status = findStatus(statuses, addon.addonId);
6857 return addStatusesToSalesAddon(addon, status);
6858 }));
6859 /** @type {?} */
6860 var productStatuses = newProducts
6861 .map((/**
6862 * @param {?} product
6863 * @return {?}
6864 */
6865 function (product) { return product.activationStatus.status; }));
6866 /** @type {?} */
6867 var addonStatuses = newProducts
6868 .map((/**
6869 * @param {?} product
6870 * @return {?}
6871 */
6872 function (product) { return product.addons ? product.addons.map((/**
6873 * @param {?} addon
6874 * @return {?}
6875 */
6876 function (addon) { return addon.activationStatus.status; })) : []; }))
6877 .reduce((/**
6878 * @param {?} statusList
6879 * @param {?} reducedList
6880 * @return {?}
6881 */
6882 function (statusList, reducedList) { return reducedList.concat(statusList); }), []);
6883 /** @type {?} */
6884 var addonsWithNoParentStatuses = newAddonsWithNoParent
6885 .map((/**
6886 * @param {?} addon
6887 * @return {?}
6888 */
6889 function (addon) { return addon.activationStatus ? addon.activationStatus.status : null; }));
6890 /** @type {?} */
6891 var allStatuses = __spread(productStatuses, addonStatuses, addonsWithNoParentStatuses);
6892 /** @type {?} */
6893 var packageStatus = convertNumberToActivationStatus(Math.max.apply(Math, __spread(allStatuses)));
6894 /** @type {?} */
6895 var statusNotification = createStatusNotificationItemForPackage(packageStatus);
6896 return createSalesPackageWithStatus(salesPackage, newProducts, newAddonsWithNoParent, statusNotification);
6897 }));
6898}
6899/**
6900 * @param {?} product
6901 * @param {?} statuses
6902 * @return {?}
6903 */
6904function addStatusesToSalesProduct(product, statuses) {
6905 if (!statuses || statuses.length === 0) {
6906 return product;
6907 }
6908 /** @type {?} */
6909 var productStatus = findStatus(statuses, product.productId);
6910 /** @type {?} */
6911 var statusNotification = createStatusNotificationItemForPackageItem(productStatus);
6912 if (!product.addons) {
6913 return createSalesProductWithStatus(product, null, statusNotification);
6914 }
6915 /** @type {?} */
6916 var newSalesAddons = product.addons.map((/**
6917 * @param {?} addon
6918 * @return {?}
6919 */
6920 function (addon) {
6921 /** @type {?} */
6922 var addonStatus = findStatus(statuses, addon.addonId);
6923 return addStatusesToSalesAddon(addon, addonStatus);
6924 }));
6925 return createSalesProductWithStatus(product, newSalesAddons, statusNotification);
6926}
6927/**
6928 * @param {?} addon
6929 * @param {?} status
6930 * @return {?}
6931 */
6932function addStatusesToSalesAddon(addon, status) {
6933 /** @type {?} */
6934 var addonStatusNotification = createStatusNotificationItemForPackageItem(status);
6935 return createSalesAddonWithStatus(addon, addonStatusNotification);
6936}
6937/**
6938 * @param {?} statuses
6939 * @param {?} id
6940 * @return {?}
6941 */
6942function findStatus(statuses, id) {
6943 if (!statuses || statuses.length <= 0) {
6944 return null;
6945 }
6946 /** @type {?} */
6947 var statusIndex = statuses.findIndex((/**
6948 * @param {?} s
6949 * @return {?}
6950 */
6951 function (s) {
6952 return s.packageItemId === id;
6953 }));
6954 if (statusIndex < 0) {
6955 return null;
6956 }
6957 /** @type {?} */
6958 var status = statuses[statusIndex].status;
6959 statuses.splice(statusIndex, 1);
6960 return status;
6961}
6962/**
6963 * @param {?} status
6964 * @return {?}
6965 */
6966function createStatusNotificationItemForPackageItem(status) {
6967 switch (status) {
6968 case ActivationStatus.SUCCESS:
6969 return { icon: 'check_circle', status: status, text: 'Activated' };
6970 case ActivationStatus.WARNING:
6971 return { icon: 'warning', status: status, text: 'Already Activated' };
6972 default:
6973 return { icon: 'error', status: status, text: 'Activation Errors' };
6974 }
6975}
6976/**
6977 * @param {?} status
6978 * @return {?}
6979 */
6980function createStatusNotificationItemForPackage(status) {
6981 switch (status) {
6982 case ActivationStatus.SUCCESS:
6983 return { icon: 'check_circle', status: status, text: 'Activated' };
6984 case ActivationStatus.WARNING:
6985 return { icon: 'warning', status: status, text: 'Activation Warnings' };
6986 default:
6987 return { icon: 'error', status: status, text: 'Activation Errors Occured' };
6988 }
6989}
6990/**
6991 * @param {?} number
6992 * @return {?}
6993 */
6994function convertNumberToActivationStatus(number) {
6995 switch (number) {
6996 case 0:
6997 return ActivationStatus.SUCCESS;
6998 case 1:
6999 return ActivationStatus.WARNING;
7000 default:
7001 return ActivationStatus.ERROR;
7002 }
7003}
7004
7005/**
7006 * @fileoverview added by tsickle
7007 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
7008 */
7009/** @enum {string} */
7010var ListIndent = {
7011 INDENT_ZERO: 'indent-zero',
7012 INDENT_ONE: 'indent-one',
7013 INDENT_TWO: 'indent-two',
7014};
7015var VaPackageDropdownItemComponent = /** @class */ (function () {
7016 function VaPackageDropdownItemComponent() {
7017 this.enableDropdown = false;
7018 this.indent = ListIndent.INDENT_ZERO;
7019 this.itemToggled = new EventEmitter();
7020 }
7021 /**
7022 * @return {?}
7023 */
7024 VaPackageDropdownItemComponent.prototype.ngOnInit = /**
7025 * @return {?}
7026 */
7027 function () {
7028 };
7029 /**
7030 * @return {?}
7031 */
7032 VaPackageDropdownItemComponent.prototype.toggleItem = /**
7033 * @return {?}
7034 */
7035 function () {
7036 this.itemToggled.emit(null);
7037 };
7038 /**
7039 * @param {?} status
7040 * @return {?}
7041 */
7042 VaPackageDropdownItemComponent.prototype.isActivatedStatus = /**
7043 * @param {?} status
7044 * @return {?}
7045 */
7046 function (status) {
7047 return status === ActivationStatus.SUCCESS;
7048 };
7049 /**
7050 * @param {?} status
7051 * @return {?}
7052 */
7053 VaPackageDropdownItemComponent.prototype.isWarningStatus = /**
7054 * @param {?} status
7055 * @return {?}
7056 */
7057 function (status) {
7058 return status === ActivationStatus.WARNING;
7059 };
7060 /**
7061 * @param {?} status
7062 * @return {?}
7063 */
7064 VaPackageDropdownItemComponent.prototype.isErrorStatus = /**
7065 * @param {?} status
7066 * @return {?}
7067 */
7068 function (status) {
7069 return status === ActivationStatus.ERROR;
7070 };
7071 VaPackageDropdownItemComponent.decorators = [
7072 { type: Component, args: [{
7073 selector: 'va-package-dropdown-item',
7074 template: "<mat-list-item [ngClass]=\"indent\" class=\"va-dropdown-list-item\">\n <va-icon *ngIf=\"!secondaryIconUrl && !secondaryIconName; else dualIcon\" mat-list-avatar [name]=\"title\" [iconUrl]=\"iconUrl\" [diameter]=\"40\"></va-icon>\n <h3 mat-line class=\"va-dropdown-list-item__title\">{{ title }}\n <va-badge *ngIf=\"titleBadge\" small color=\"blue-solid\" class=\"va-dropdown-list-item__title-badge\">{{ titleBadge }}</va-badge>\n <span *ngIf=\"titleDescriptor\" class=\"va-dropdown-list-item__title-descriptor\">{{ titleDescriptor }}</span>\n </h3>\n <p class=\"package-dropdown-font\" mat-line>{{subtitle}}</p>\n\n <span *ngIf=\"!statusItem\" class=\"va-dropdown-list-item__layout\">\n <p class=\"va-dropdown-list-item__layout va-dropdown-list-item__notice\">{{ description }}</p>\n <ng-container *ngIf=\"enableDropdown; then dropdownButton\"></ng-container>\n </span>\n\n <span *ngIf=\"statusItem\" class=\"va-dropdown-list-item__layout va-dropdown-list-item__status\">\n <div [ngClass]=\"{\n 'activated': isActivatedStatus(statusItem.status),\n 'warning': isWarningStatus(statusItem.status),\n 'error': isErrorStatus(statusItem.status)}\">\n <mat-icon>{{statusItem.icon}}</mat-icon>\n </div>\n <p class=\"va-dropdown-list-item__notice\"\n [ngClass]=\"{\n 'activated': isActivatedStatus(statusItem.status),\n 'warning': isWarningStatus(statusItem.status),\n 'error': isErrorStatus(statusItem.status)}\">\n {{ statusItem.text }}\n </p>\n <ng-container *ngIf=\"enableDropdown; then dropdownButton\"></ng-container>\n </span>\n</mat-list-item>\n\n\n<ng-template #dropdownButton>\n <button *ngIf=\"enableDropdown\" mat-icon-button type=\"button\" (click)=\"toggleItem()\">\n <mat-icon mat-list-icon\n class=\"dropdown-icon\"\n [ngClass]=\"{'dropdown-icon-rotate-up': !toggleValue, 'dropdown-icon-rotate-down': toggleValue}\">\n keyboard_arrow_down\n </mat-icon>\n </button>\n</ng-template>\n\n<ng-template #dualIcon>\n <div class=\"dual-icon\">\n <va-icon mat-list-avatar [iconUrl]=\"iconUrl\" [name]=\"title\" [diameter]=\"40\"></va-icon>\n <va-icon mat-list-avatar class=\"secondary-icon\" [iconUrl]=\"secondaryIconUrl\" [diameter]=\"20\" [name]=\"secondaryIconName\"></va-icon>\n </div>\n</ng-template>\n",
7075 styles: [".va-dropdown-list-item{border-bottom:1px solid rgba(0,0,0,.12)}mat-list-item .va-dropdown-list-item__title{font-weight:700}.va-dropdown-list-item__title-badge{padding-bottom:4px}.indent-one{padding-left:30px}.va-dropdown-list-item__title-descriptor{font-size:11px;font-weight:700;font-style:italic}.indent-two{padding-left:30px}.indent-two .mat-list-avatar{margin-left:40px}.dual-icon{position:relative;display:inline-block;-webkit-box-ordinal-group:0;order:-1;margin-right:16px}.dual-icon .secondary-icon{position:absolute;border-radius:50%;bottom:-24px;right:-24px}.va-dropdown-list-item__layout{display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;-webkit-box-align:center;align-items:center}.va-dropdown-list-item__layout .va-dropdown-list-item__notice{width:-webkit-max-content;width:-moz-max-content;width:max-content;font-style:italic}@media screen and (max-width:500px){.va-dropdown-list-item__layout p{display:none}}.va-dropdown-list-item__layout mat-icon{padding:0}.va-dropdown-list-item__layout button{padding:0;min-width:0}.va-dropdown-list-item__layout button .dropdown-icon{color:rgba(0,0,0,.54)}.va-dropdown-list-item__layout button .dropdown-icon-rotate-down{-webkit-transform:rotate(180deg);transform:rotate(180deg);-webkit-transition:.4s;transition:.4s;pointer-events:none}.va-dropdown-list-item__layout button .dropdown-icon-rotate-up{-webkit-transform:rotate(0);transform:rotate(0);-webkit-transition:.4s;transition:.4s;pointer-events:none}.va-dropdown-list-item__status{display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;-webkit-box-align:center;align-items:center}.va-dropdown-list-item__status p{padding-left:6px;font-size:14px;white-space:nowrap}.va-dropdown-list-item__status .activated{color:#4caf50}.va-dropdown-list-item__status .warning{color:#ffa000}.va-dropdown-list-item__status .error{color:#c62828}", ".package-dropdown-font,.product-dropdown-font{color:rgba(0,0,0,.54);font-size:14px;font-weight:400}.package-list-container{border-top:1px solid rgba(0,0,0,.12);padding:0}.package-list-container mat-list{padding:0}.package-dropdown-stencil-display{display:-webkit-box;display:flex;width:100%;-webkit-box-flex:1;flex-grow:1}.package-dropdown-stencil-display va-icon{margin-right:20px}.package-dropdown-stencil-display .stencil-text{width:inherit;display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;-webkit-box-pack:center;justify-content:center}.package-dropdown-stencil-display .stencil-text .stencil-title{height:32px;width:40%;margin-bottom:5px!important;margin-top:0!important}.package-dropdown-stencil-display .stencil-text .stencil-tagline{height:32px;width:inherit}.product-or-addon-list{background-color:rgba(0,0,0,.04);overflow:hidden}"]
7076 }] }
7077 ];
7078 VaPackageDropdownItemComponent.propDecorators = {
7079 title: [{ type: Input }],
7080 titleBadge: [{ type: Input }],
7081 titleDescriptor: [{ type: Input }],
7082 iconUrl: [{ type: Input }],
7083 secondaryIconUrl: [{ type: Input }],
7084 secondaryIconName: [{ type: Input }],
7085 subtitle: [{ type: Input }],
7086 statusItem: [{ type: Input }],
7087 enableDropdown: [{ type: Input }],
7088 indent: [{ type: Input }],
7089 toggleValue: [{ type: Input }],
7090 description: [{ type: Input }],
7091 itemToggled: [{ type: Output }]
7092 };
7093 return VaPackageDropdownItemComponent;
7094}());
7095if (false) {
7096 /** @type {?} */
7097 VaPackageDropdownItemComponent.prototype.title;
7098 /** @type {?} */
7099 VaPackageDropdownItemComponent.prototype.titleBadge;
7100 /** @type {?} */
7101 VaPackageDropdownItemComponent.prototype.titleDescriptor;
7102 /** @type {?} */
7103 VaPackageDropdownItemComponent.prototype.iconUrl;
7104 /** @type {?} */
7105 VaPackageDropdownItemComponent.prototype.secondaryIconUrl;
7106 /** @type {?} */
7107 VaPackageDropdownItemComponent.prototype.secondaryIconName;
7108 /** @type {?} */
7109 VaPackageDropdownItemComponent.prototype.subtitle;
7110 /** @type {?} */
7111 VaPackageDropdownItemComponent.prototype.statusItem;
7112 /** @type {?} */
7113 VaPackageDropdownItemComponent.prototype.enableDropdown;
7114 /** @type {?} */
7115 VaPackageDropdownItemComponent.prototype.indent;
7116 /** @type {?} */
7117 VaPackageDropdownItemComponent.prototype.toggleValue;
7118 /** @type {?} */
7119 VaPackageDropdownItemComponent.prototype.description;
7120 /** @type {?} */
7121 VaPackageDropdownItemComponent.prototype.itemToggled;
7122}
7123
7124/**
7125 * @fileoverview added by tsickle
7126 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
7127 */
7128/**
7129 * @record
7130 */
7131function OrderLengthsForToggling() { }
7132if (false) {
7133 /** @type {?} */
7134 OrderLengthsForToggling.prototype.packages;
7135 /** @type {?} */
7136 OrderLengthsForToggling.prototype.products;
7137}
7138var VaPackageDropdownComponent = /** @class */ (function () {
7139 function VaPackageDropdownComponent(translateService) {
7140 this.translateService = translateService;
7141 // controls whether only one dropdown can be expanded at a time
7142 this.singularDropdown = false;
7143 // hides pricing
7144 this.hidePricing = false;
7145 this.packageProductIndent = ListIndent.INDENT_ONE;
7146 this.packageAddonWithoutProductIndent = ListIndent.INDENT_ONE;
7147 this.packageAddonWithProductIndent = ListIndent.INDENT_TWO;
7148 this.productAddonIndent = ListIndent.INDENT_ONE;
7149 this.packages$$ = new ReplaySubject(1);
7150 this.products$$ = new ReplaySubject(1);
7151 this.standAloneProducts$$ = new ReplaySubject(1);
7152 this.statuses$$ = new BehaviorSubject([]);
7153 this.addons$$ = new ReplaySubject(1);
7154 this.orderItemLengths$$ = new BehaviorSubject((/** @type {?} */ ({
7155 packages: 0,
7156 products: 0
7157 })));
7158 this.packageToggles = [];
7159 this.productToggles = [];
7160 this.translateService.setTranslation('en', En.en, true);
7161 this.translateService.setTranslation('cs', Cs.cs, true);
7162 }
7163 Object.defineProperty(VaPackageDropdownComponent.prototype, "packages", {
7164 // packages in dropdown
7165 set:
7166 // packages in dropdown
7167 /**
7168 * @param {?} packages
7169 * @return {?}
7170 */
7171 function (packages) {
7172 this.packages$$.next(packages);
7173 },
7174 enumerable: true,
7175 configurable: true
7176 });
7177 Object.defineProperty(VaPackageDropdownComponent.prototype, "products", {
7178 // products within given packages
7179 set:
7180 // products within given packages
7181 /**
7182 * @param {?} products
7183 * @return {?}
7184 */
7185 function (products) {
7186 this.products$$.next(products);
7187 },
7188 enumerable: true,
7189 configurable: true
7190 });
7191 Object.defineProperty(VaPackageDropdownComponent.prototype, "standAloneProducts", {
7192 // products not associated with a package
7193 set:
7194 // products not associated with a package
7195 /**
7196 * @param {?} standAloneProducts
7197 * @return {?}
7198 */
7199 function (standAloneProducts) {
7200 this.standAloneProducts$$.next(standAloneProducts);
7201 },
7202 enumerable: true,
7203 configurable: true
7204 });
7205 Object.defineProperty(VaPackageDropdownComponent.prototype, "statuses", {
7206 // statuses for all products and addons
7207 set:
7208 // statuses for all products and addons
7209 /**
7210 * @param {?} statuses
7211 * @return {?}
7212 */
7213 function (statuses) {
7214 this.statuses$$.next(statuses);
7215 },
7216 enumerable: true,
7217 configurable: true
7218 });
7219 Object.defineProperty(VaPackageDropdownComponent.prototype, "addons", {
7220 // addons within given packages
7221 set:
7222 // addons within given packages
7223 /**
7224 * @param {?} addons
7225 * @return {?}
7226 */
7227 function (addons) {
7228 this.addons$$.next(addons);
7229 },
7230 enumerable: true,
7231 configurable: true
7232 });
7233 /**
7234 * @return {?}
7235 */
7236 VaPackageDropdownComponent.prototype.ngOnInit = /**
7237 * @return {?}
7238 */
7239 function () {
7240 var _this = this;
7241 /** @type {?} */
7242 var packages$ = this.packages$$.pipe(filter((/**
7243 * @param {?} packages
7244 * @return {?}
7245 */
7246 function (packages) { return packages !== null; })));
7247 /** @type {?} */
7248 var products$ = this.products$$.pipe(filter((/**
7249 * @param {?} products
7250 * @return {?}
7251 */
7252 function (products) { return products !== null; })));
7253 /** @type {?} */
7254 var addons$ = this.addons$$.pipe(filter((/**
7255 * @param {?} addons
7256 * @return {?}
7257 */
7258 function (addons) { return addons !== null; })));
7259 /** @type {?} */
7260 var salesPackage$ = zip(packages$, products$, addons$).pipe(tap((/**
7261 * @param {?} __0
7262 * @return {?}
7263 */
7264 function (_a) {
7265 var _b = __read(_a, 3), packages = _b[0], products = _b[1], _ = _b[2];
7266 _this.orderItemLengths$$.next((/** @type {?} */ ({
7267 packages: packages.length,
7268 products: products.length
7269 })));
7270 })), map((/**
7271 * @param {?} __0
7272 * @return {?}
7273 */
7274 function (_a) {
7275 var _b = __read(_a, 3), packages = _b[0], products = _b[1], addons = _b[2];
7276 return buildSalesPackages(packages, products, addons);
7277 })));
7278 this.salesPackages$ = combineLatest(salesPackage$, this.statuses$$).pipe(map((/**
7279 * @param {?} __0
7280 * @return {?}
7281 */
7282 function (_a) {
7283 var _b = __read(_a, 2), salesPackages = _b[0], statuses = _b[1];
7284 return addStatusesToSalesPackages(salesPackages, statuses);
7285 })), startWith([]));
7286 this.salesProducts$ = combineLatest(this.standAloneProducts$$, this.statuses$$).pipe(filter((/**
7287 * @param {?} __0
7288 * @return {?}
7289 */
7290 function (_a) {
7291 var _b = __read(_a, 2), products = _b[0], _ = _b[1];
7292 return products !== null;
7293 })), map((/**
7294 * @param {?} __0
7295 * @return {?}
7296 */
7297 function (_a) {
7298 var _b = __read(_a, 2), products = _b[0], statuses = _b[1];
7299 return products.map((/**
7300 * @param {?} p
7301 * @return {?}
7302 */
7303 function (p) {
7304 /** @type {?} */
7305 var addons = p.addons || null;
7306 /** @type {?} */
7307 var salesProducts = buildSalesProductFromProduct(p, addons);
7308 return addStatusesToSalesProduct(salesProducts, statuses);
7309 }));
7310 })), startWith([]));
7311 this.templateData$ = combineLatest(this.salesPackages$, this.salesProducts$).pipe(map((/**
7312 * @param {?} __0
7313 * @return {?}
7314 */
7315 function (_a) {
7316 var _b = __read(_a, 2), packages = _b[0], products = _b[1];
7317 return ({ packages: packages, products: products });
7318 })));
7319 };
7320 /**
7321 * @return {?}
7322 */
7323 VaPackageDropdownComponent.prototype.openAllDropdowns = /**
7324 * @return {?}
7325 */
7326 function () {
7327 for (var x = 0; x < this.orderItemLengths$$.getValue().packages; x++) {
7328 this.packageToggles[x] = true;
7329 }
7330 for (var x = 0; x < this.orderItemLengths$$.getValue().products; x++) {
7331 this.productToggles[x] = true;
7332 }
7333 };
7334 /**
7335 * @param {?} indexToToggle
7336 * @return {?}
7337 */
7338 VaPackageDropdownComponent.prototype.togglePackage = /**
7339 * @param {?} indexToToggle
7340 * @return {?}
7341 */
7342 function (indexToToggle) {
7343 if (this.singularDropdown) {
7344 /** @type {?} */
7345 var openedIndex = this.packageToggles.findIndex((/**
7346 * @param {?} value
7347 * @return {?}
7348 */
7349 function (value) { return value === true; }));
7350 if (openedIndex !== indexToToggle) {
7351 this.packageToggles[openedIndex] = false;
7352 }
7353 /** @type {?} */
7354 var productOpenedIndex = this.productToggles.findIndex((/**
7355 * @param {?} value
7356 * @return {?}
7357 */
7358 function (value) { return value === true; }));
7359 if (productOpenedIndex > -1) {
7360 this.productToggles[productOpenedIndex] = false;
7361 }
7362 }
7363 this.packageToggles[indexToToggle] = !this.packageToggles[indexToToggle];
7364 };
7365 /**
7366 * @param {?} indexToToggle
7367 * @return {?}
7368 */
7369 VaPackageDropdownComponent.prototype.toggleProduct = /**
7370 * @param {?} indexToToggle
7371 * @return {?}
7372 */
7373 function (indexToToggle) {
7374 if (this.singularDropdown) {
7375 /** @type {?} */
7376 var openedIndex = this.productToggles.findIndex((/**
7377 * @param {?} value
7378 * @return {?}
7379 */
7380 function (value) { return value === true; }));
7381 if (openedIndex !== indexToToggle) {
7382 this.productToggles[openedIndex] = false;
7383 }
7384 /** @type {?} */
7385 var packageOpenedIndex = this.packageToggles.findIndex((/**
7386 * @param {?} value
7387 * @return {?}
7388 */
7389 function (value) { return value === true; }));
7390 if (packageOpenedIndex > -1) {
7391 this.packageToggles[packageOpenedIndex] = false;
7392 }
7393 }
7394 this.productToggles[indexToToggle] = !this.productToggles[indexToToggle];
7395 };
7396 /**
7397 * @param {?} product
7398 * @return {?}
7399 */
7400 VaPackageDropdownComponent.prototype.standAloneProductDescription = /**
7401 * @param {?} product
7402 * @return {?}
7403 */
7404 function (product) {
7405 if (product.addons && product.addons.length > 0) {
7406 /** @type {?} */
7407 var description = "Contains " + product.addons.length;
7408 description = product.addons.length === 1 ? description + " Addon" : description + " Addons";
7409 return description;
7410 }
7411 return '';
7412 };
7413 /**
7414 * @param {?} product
7415 * @return {?}
7416 */
7417 VaPackageDropdownComponent.prototype.standAloneProductWithParentDescription = /**
7418 * @param {?} product
7419 * @return {?}
7420 */
7421 function (product) {
7422 if (!product.parentInfo) {
7423 return '';
7424 }
7425 return "(Requires " + product.parentInfo.parentName + ")";
7426 };
7427 /**
7428 * @param {?} pkg
7429 * @return {?}
7430 */
7431 VaPackageDropdownComponent.prototype.packageDescription = /**
7432 * @param {?} pkg
7433 * @return {?}
7434 */
7435 function (pkg) {
7436 /** @type {?} */
7437 var hasProducts = pkg.products && pkg.products.length > 0;
7438 if (!hasProducts && pkg.totalAddons === 0) {
7439 return 'No Items in Package';
7440 }
7441 /** @type {?} */
7442 var description = '';
7443 /** @type {?} */
7444 var hasOneProduct = pkg.products && pkg.products.length === 1;
7445 if (hasProducts || pkg.totalAddons > 0) {
7446 description = 'Contains ';
7447 }
7448 if (hasProducts) {
7449 description = description + " " + pkg.products.length;
7450 description = hasOneProduct ? description + " Product" : description + " Products";
7451 }
7452 if (hasProducts && pkg.totalAddons > 0) {
7453 description = description + " & " + pkg.totalAddons;
7454 description = pkg.totalAddons === 1 ? description + " Addon" : description + " Addons";
7455 }
7456 return description;
7457 };
7458 VaPackageDropdownComponent.decorators = [
7459 { type: Component, args: [{
7460 selector: 'va-package-dropdown',
7461 animations: [
7462 trigger('listAnimationStart', [
7463 state('void', style({ height: '0px' })),
7464 state('*', style({ height: '*' })),
7465 transition('void => *', [animate('0.25s ease')]),
7466 transition('* => void', [animate('0.25s ease')])
7467 ])
7468 ],
7469 template: "<ng-container *ngIf=\"templateData$ | async as data\">\n <mat-card class=\"package-list-container\" *ngIf=\"data.products?.length > 0 || data.packages?.length > 0 else loading\">\n <mat-list>\n <div class=\"package-list\" *ngFor=\"let package of data.packages; let packageIndex = index\">\n\n <va-package-dropdown-item\n [title]=\"package.name\"\n [iconUrl]=\"package.icon\"\n [subtitle]=\"hidePricing ? '' : package.formattedPrices\"\n [statusItem]=\"package.activationStatus\"\n [description]=\"packageDescription(package)\"\n [enableDropdown]=\"package.products?.length > 0 || package.addonsWithNoParent?.length > 0\"\n [toggleValue]=\"packageToggles[packageIndex]\"\n (itemToggled)=\"togglePackage(packageIndex)\"\n ></va-package-dropdown-item>\n\n <mat-list class=\"product-or-addon-list package-dropdown-font\" *ngIf=\"packageToggles[packageIndex]\"\n [@listAnimationStart]>\n <div *ngFor=\"let product of package.products\">\n <va-package-dropdown-item\n [title]=\"product.name\"\n [subtitle]=\"product.tagline\"\n [titleBadge]=\"product.editionName\"\n [iconUrl]=\"product.icon\"\n [statusItem]=\"product.activationStatus\"\n [indent]=\"packageProductIndent\"\n ></va-package-dropdown-item>\n\n <va-package-dropdown-item\n *ngFor=\"let addon of product.addons\"\n [title]=\"addon.name\"\n [subtitle]=\"addon.tagline\"\n [iconUrl]=\"addon.icon\"\n [statusItem]=\"addon.activationStatus\"\n [indent]=\"packageAddonWithProductIndent\"\n ></va-package-dropdown-item>\n </div>\n\n <va-package-dropdown-item\n *ngFor=\"let addon of package.addonsWithNoParent\"\n [title]=\"addon.name\"\n [titleDescriptor]=\"'FRONTEND.STORE.REQUIRES_DESCRIPTOR' | translate: {requirementName: addon.parentName}\"\n [subtitle]=\"addon.tagline\"\n [iconUrl]=\"addon.icon\"\n [secondaryIconUrl]=\"addon.parentIcon\"\n [secondaryIconName]=\"addon.parentName\"\n [statusItem]=\"addon.activationStatus\"\n [indent]=\"packageAddonWithoutProductIndent\"\n ></va-package-dropdown-item>\n </mat-list>\n </div>\n\n <div class=\"product-list\" *ngFor=\"let product of data.products; let productIndex = index\">\n <va-package-dropdown-item\n [title]=\"product.name\"\n [titleBadge]=\"product.editionName\"\n [titleDescriptor]=\"standAloneProductWithParentDescription(product)\"\n [iconUrl]=\"product.icon\"\n [subtitle]=\"hidePricing ? '' : product.formattedPrices\"\n [secondaryIconUrl]=\"product.parentInfo?.parentIconUrl\"\n [secondaryIconName]=\"product.parentInfo?.parentName\"\n [statusItem]=\"product.activationStatus\"\n [description]=\"standAloneProductDescription(product)\"\n [enableDropdown]=\"product.addons?.length > 0\"\n [toggleValue]=\"productToggles[productIndex]\"\n (itemToggled)=\"toggleProduct(productIndex)\"\n ></va-package-dropdown-item>\n\n <mat-list class=\"product-or-addon-list product-dropdown-font\" *ngIf=\"productToggles[productIndex]\"\n [@listAnimationStart]>\n <va-package-dropdown-item\n *ngFor=\"let addon of product.addons\"\n [title]=\"addon.name\"\n [subtitle]=\"addon.tagline\"\n [iconUrl]=\"addon.icon\"\n [statusItem]=\"addon.activationStatus\"\n [indent]=\"productAddonIndent\"\n ></va-package-dropdown-item>\n </mat-list>\n </div>\n\n </mat-list>\n </mat-card>\n</ng-container>\n\n<ng-template #loading>\n <mat-card>\n <div class=\"package-dropdown-stencil-display\">\n <va-icon [iconUrl]=\"\"></va-icon>\n <div class=\"stencil-text\">\n <h1 class=\"stencil-title stencil-shimmer\"></h1>\n <span class=\"stencil-tagline stencil-shimmer\"></span>\n </div>\n </div>\n </mat-card>\n</ng-template>\n",
7470 styles: [".package-dropdown-font,.product-dropdown-font{color:rgba(0,0,0,.54);font-size:14px;font-weight:400}.package-list-container{border-top:1px solid rgba(0,0,0,.12);padding:0}.package-list-container mat-list{padding:0}.package-dropdown-stencil-display{display:-webkit-box;display:flex;width:100%;-webkit-box-flex:1;flex-grow:1}.package-dropdown-stencil-display va-icon{margin-right:20px}.package-dropdown-stencil-display .stencil-text{width:inherit;display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;-webkit-box-pack:center;justify-content:center}.package-dropdown-stencil-display .stencil-text .stencil-title{height:32px;width:40%;margin-bottom:5px!important;margin-top:0!important}.package-dropdown-stencil-display .stencil-text .stencil-tagline{height:32px;width:inherit}.product-or-addon-list{background-color:rgba(0,0,0,.04);overflow:hidden}"]
7471 }] }
7472 ];
7473 /** @nocollapse */
7474 VaPackageDropdownComponent.ctorParameters = function () { return [
7475 { type: TranslateService }
7476 ]; };
7477 VaPackageDropdownComponent.propDecorators = {
7478 packages: [{ type: Input }],
7479 products: [{ type: Input }],
7480 standAloneProducts: [{ type: Input }],
7481 statuses: [{ type: Input }],
7482 addons: [{ type: Input }],
7483 singularDropdown: [{ type: Input }],
7484 hidePricing: [{ type: Input }]
7485 };
7486 return VaPackageDropdownComponent;
7487}());
7488if (false) {
7489 /** @type {?} */
7490 VaPackageDropdownComponent.prototype.singularDropdown;
7491 /** @type {?} */
7492 VaPackageDropdownComponent.prototype.hidePricing;
7493 /** @type {?} */
7494 VaPackageDropdownComponent.prototype.packageProductIndent;
7495 /** @type {?} */
7496 VaPackageDropdownComponent.prototype.packageAddonWithoutProductIndent;
7497 /** @type {?} */
7498 VaPackageDropdownComponent.prototype.packageAddonWithProductIndent;
7499 /** @type {?} */
7500 VaPackageDropdownComponent.prototype.productAddonIndent;
7501 /** @type {?} */
7502 VaPackageDropdownComponent.prototype.packages$$;
7503 /** @type {?} */
7504 VaPackageDropdownComponent.prototype.products$$;
7505 /** @type {?} */
7506 VaPackageDropdownComponent.prototype.standAloneProducts$$;
7507 /** @type {?} */
7508 VaPackageDropdownComponent.prototype.statuses$$;
7509 /** @type {?} */
7510 VaPackageDropdownComponent.prototype.addons$$;
7511 /** @type {?} */
7512 VaPackageDropdownComponent.prototype.orderItemLengths$$;
7513 /** @type {?} */
7514 VaPackageDropdownComponent.prototype.templateData$;
7515 /** @type {?} */
7516 VaPackageDropdownComponent.prototype.salesPackages$;
7517 /** @type {?} */
7518 VaPackageDropdownComponent.prototype.salesProducts$;
7519 /** @type {?} */
7520 VaPackageDropdownComponent.prototype.packageToggles;
7521 /** @type {?} */
7522 VaPackageDropdownComponent.prototype.productToggles;
7523 /**
7524 * @type {?}
7525 * @private
7526 */
7527 VaPackageDropdownComponent.prototype.translateService;
7528}
7529
7530/**
7531 * @fileoverview added by tsickle
7532 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
7533 */
7534var VaPackageDropdownModule = /** @class */ (function () {
7535 function VaPackageDropdownModule() {
7536 }
7537 VaPackageDropdownModule.decorators = [
7538 { type: NgModule, args: [{
7539 imports: [
7540 CommonModule,
7541 MatButtonModule,
7542 MatCardModule,
7543 MatListModule$1,
7544 MatIconModule,
7545 VaIconModule,
7546 VaBadgeModule,
7547 TranslateModule
7548 ],
7549 declarations: [VaPackageDropdownComponent, VaPackageDropdownItemComponent],
7550 exports: [VaPackageDropdownComponent],
7551 entryComponents: [VaPackageDropdownComponent]
7552 },] }
7553 ];
7554 return VaPackageDropdownModule;
7555}());
7556
7557/**
7558 * @fileoverview added by tsickle
7559 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
7560 */
7561var VaProductDetailsComponent = /** @class */ (function () {
7562 function VaProductDetailsComponent() {
7563 this.hasVerifiedContract = false;
7564 this.canAccessContractPricing = false;
7565 this.showActionButton = false;
7566 this.showPricing = false;
7567 this.showPricingAction = false;
7568 this.loaded = true;
7569 this.enableClicked = new EventEmitter();
7570 this.addonSelected = new EventEmitter();
7571 this.primaryPricingActionSelected = new EventEmitter();
7572 this.pricingActionSelected = new EventEmitter();
7573 }
7574 /**
7575 * @return {?}
7576 */
7577 VaProductDetailsComponent.prototype.getAddons = /**
7578 * @return {?}
7579 */
7580 function () {
7581 if (!this._addons) {
7582 this._addons = this.product.addons.map((/**
7583 * @param {?} addon
7584 * @return {?}
7585 */
7586 function (addon) { return Addon.fromApi(addon); }));
7587 }
7588 return this._addons;
7589 };
7590 /**
7591 * @return {?}
7592 */
7593 VaProductDetailsComponent.prototype.getActionLabel = /**
7594 * @return {?}
7595 */
7596 function () {
7597 if (this.product.isArchived) {
7598 return 'Enable';
7599 }
7600 return 'Enabled';
7601 };
7602 Object.defineProperty(VaProductDetailsComponent.prototype, "price", {
7603 get: /**
7604 * @return {?}
7605 */
7606 function () {
7607 // NOTE: wholesalePrice = 0 means free, wholesalePrice = null || -1 means "contact sales"
7608 /** @type {?} */
7609 var prices = [];
7610 if (this.product.wholesalePrice !== CONTACT_SALES && this.product.wholesalePrice != null) {
7611 prices = [{
7612 price: this.product.wholesalePrice,
7613 frequency: this.product.billingFrequency
7614 }];
7615 }
7616 return {
7617 currency: this.product.currency,
7618 prices: prices
7619 };
7620 },
7621 enumerable: true,
7622 configurable: true
7623 });
7624 /**
7625 * @param {?} addonId
7626 * @return {?}
7627 */
7628 VaProductDetailsComponent.prototype.onAddonSelected = /**
7629 * @param {?} addonId
7630 * @return {?}
7631 */
7632 function (addonId) {
7633 this.addonSelected.emit(addonId);
7634 };
7635 VaProductDetailsComponent.decorators = [
7636 { type: Component, args: [{
7637 selector: 'va-product-details',
7638 template: "<div class=\"page\">\n <va-header-container [iconUrl]=\"product.iconUrl\"\n [title]=\"product.name\"\n [tagline]=\"product.tagline\"\n [chipLabels]=\"product.getLmiCategoryNames()\"\n [pricing]=\"price\"\n [pricingLabel]=\"'Wholesale Price'\"\n [primaryPricingActionLabel]=\"primaryPricingActionLabel\"\n [pricingActionLabel]=\"pricingActionLabel\"\n [pricingActionEnabled]=\"showPricingAction\"\n [actionLabel]=\"getActionLabel()\"\n [actionEnabled]=\"product.isArchived\"\n [showAction]=\"showActionButton\"\n [showPricing]=\"showPricing\"\n [billedProduct]=\"billedProduct\"\n [hasVerifiedContract]=\"hasVerifiedContract\"\n [loaded]=\"loaded\"\n (primaryPricingActionSelected)=\"primaryPricingActionSelected.emit()\"\n (pricingActionSelected)=\"pricingActionSelected.emit()\"\n (actionSelected)=\"enableClicked.emit()\">\n </va-header-container>\n <div class=\"product-details product-content\">\n <div class=\"left-column\">\n <ng-container *ngIf=\"product.description || product.keySellingPoints\">\n <va-selling-info [description]=\"product.description\"\n [keySellingPoints]=\"product.keySellingPoints\"></va-selling-info>\n </ng-container>\n <section *ngIf=\"product.addons?.length > 0\">\n <h2 class=\"va-component-title\">Add-Ons</h2>\n <va-addon-list (addonSelected)=\"onAddonSelected($event)\"\n [addons]=\"getAddons()\"\n [showPricing]=\"showPricing\"\n [hasVerifiedContract]=\"hasVerifiedContract\"\n [canAccessContractPricing]=\"canAccessContractPricing\"\n [partnerID]=\"partnerID\">\n </va-addon-list>\n </section>\n\n <section *ngIf=\"product.faqs?.length > 0\">\n <h2 class=\"va-component-title\">FAQs</h2>\n <va-faqs [faqs]=\"product.faqs\"></va-faqs>\n </section>\n </div>\n\n <div class=\"right-column\">\n <section *ngIf=\"product.restrictions?.country?.whitelist?.length > 0\">\n <supported-countries [countryCodes]=\"product.restrictions.country.whitelist\"></supported-countries>\n </section>\n\n <section *ngIf=\"product.screenshotUrls?.length > 0\">\n <h2 class=\"va-component-title\">Gallery</h2>\n <va-image-gallery [imageUrls]=\"product.screenshotUrls\"></va-image-gallery>\n </section>\n\n <section *ngIf=\"product.files?.length > 0\">\n <h2 class=\"va-component-title\">Files</h2>\n <va-files [files]=\"product.files\"></va-files>\n </section>\n </div>\n </div>\n</div>\n",
7639 styles: [":host{display:block;font-size:14px;line-height:1.4}:host *{box-sizing:border-box}.va-component-title{font-size:24px;font-weight:300;margin-top:0}@media screen and (min-width:600px){.va-component-title{font-size:32px}}img{max-width:100%}va-icon{display:inline-block}.sales-person-details{max-height:430px;overflow:hidden}.page{position:relative;margin:0 auto 20px;background:#fff;color:#212121;box-shadow:0 3px 10px rgba(33,33,33,.3);overflow:hidden;font-size:16px}.page .item-amount{color:#9e9e9e;font-size:14px;text-align:right;margin:0 24px 8px}section{padding:24px}.left-column{width:66%}@media screen and (max-width:600px){.left-column{width:100%}}.right-column{width:34%}.product-content{display:-webkit-box;display:flex}@media screen and (max-width:600px){.right-column{width:100%}.product-content{-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}}"]
7640 }] }
7641 ];
7642 VaProductDetailsComponent.propDecorators = {
7643 product: [{ type: Input }],
7644 billedProduct: [{ type: Input }],
7645 hasVerifiedContract: [{ type: Input }],
7646 canAccessContractPricing: [{ type: Input }],
7647 showActionButton: [{ type: Input }],
7648 showPricing: [{ type: Input }],
7649 primaryPricingActionLabel: [{ type: Input }],
7650 pricingActionLabel: [{ type: Input }],
7651 showPricingAction: [{ type: Input }],
7652 loaded: [{ type: Input }],
7653 partnerID: [{ type: Input }],
7654 enableClicked: [{ type: Output }],
7655 addonSelected: [{ type: Output }],
7656 primaryPricingActionSelected: [{ type: Output }],
7657 pricingActionSelected: [{ type: Output }]
7658 };
7659 return VaProductDetailsComponent;
7660}());
7661if (false) {
7662 /** @type {?} */
7663 VaProductDetailsComponent.prototype.product;
7664 /** @type {?} */
7665 VaProductDetailsComponent.prototype.billedProduct;
7666 /** @type {?} */
7667 VaProductDetailsComponent.prototype.hasVerifiedContract;
7668 /** @type {?} */
7669 VaProductDetailsComponent.prototype.canAccessContractPricing;
7670 /** @type {?} */
7671 VaProductDetailsComponent.prototype.showActionButton;
7672 /** @type {?} */
7673 VaProductDetailsComponent.prototype.showPricing;
7674 /** @type {?} */
7675 VaProductDetailsComponent.prototype.primaryPricingActionLabel;
7676 /** @type {?} */
7677 VaProductDetailsComponent.prototype.pricingActionLabel;
7678 /** @type {?} */
7679 VaProductDetailsComponent.prototype.showPricingAction;
7680 /** @type {?} */
7681 VaProductDetailsComponent.prototype.loaded;
7682 /** @type {?} */
7683 VaProductDetailsComponent.prototype.partnerID;
7684 /** @type {?} */
7685 VaProductDetailsComponent.prototype.enableClicked;
7686 /** @type {?} */
7687 VaProductDetailsComponent.prototype.addonSelected;
7688 /** @type {?} */
7689 VaProductDetailsComponent.prototype.primaryPricingActionSelected;
7690 /** @type {?} */
7691 VaProductDetailsComponent.prototype.pricingActionSelected;
7692 /**
7693 * @type {?}
7694 * @private
7695 */
7696 VaProductDetailsComponent.prototype._addons;
7697}
7698
7699/**
7700 * @fileoverview added by tsickle
7701 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
7702 */
7703var VaProductDetailsModule = /** @class */ (function () {
7704 function VaProductDetailsModule() {
7705 }
7706 VaProductDetailsModule.decorators = [
7707 { type: NgModule, args: [{
7708 imports: [
7709 VaImageGalleryModule, CommonModule, VaIconModule,
7710 VaPricingModule, VaFilesModule, VaFaqsModule, VaSellingInfoModule,
7711 VaHeaderContainerModule, VaSafeHtmlModule, VaAddonListModule, RestrictionsModule
7712 ],
7713 declarations: [VaProductDetailsComponent],
7714 exports: [VaProductDetailsComponent],
7715 entryComponents: [VaProductDetailsComponent]
7716 },] }
7717 ];
7718 return VaProductDetailsModule;
7719}());
7720
7721/**
7722 * @fileoverview added by tsickle
7723 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
7724 */
7725var ResellerItem = /** @class */ (function () {
7726 function ResellerItem(data) {
7727 this.quantity = 1;
7728 data = data || {};
7729 Object.assign(this, data);
7730 }
7731 return ResellerItem;
7732}());
7733if (false) {
7734 /** @type {?} */
7735 ResellerItem.prototype.appId;
7736 /** @type {?} */
7737 ResellerItem.prototype.addonId;
7738 /** @type {?} */
7739 ResellerItem.prototype.name;
7740 /** @type {?} */
7741 ResellerItem.prototype.icon;
7742 /** @type {?} */
7743 ResellerItem.prototype.tagline;
7744 /** @type {?} */
7745 ResellerItem.prototype.headerImage;
7746 /** @type {?} */
7747 ResellerItem.prototype.currency;
7748 /** @type {?} */
7749 ResellerItem.prototype.price;
7750 /** @type {?} */
7751 ResellerItem.prototype.billingFrequency;
7752 /** @type {?} */
7753 ResellerItem.prototype.lmiCategories;
7754 /** @type {?} */
7755 ResellerItem.prototype.enabled;
7756 /** @type {?} */
7757 ResellerItem.prototype.isCustom;
7758 /** @type {?} */
7759 ResellerItem.prototype.orderForm;
7760 /** @type {?} */
7761 ResellerItem.prototype.quantity;
7762 /** @type {?} */
7763 ResellerItem.prototype.allowMultipleActivations;
7764 /** @type {?} */
7765 ResellerItem.prototype.usesCustomizationForm;
7766 /** @type {?} */
7767 ResellerItem.prototype.usesActivationSpecificEntryUrl;
7768 /** @type {?} */
7769 ResellerItem.prototype.entryUrl;
7770 /** @type {?} */
7771 ResellerItem.prototype.restrictions;
7772 /** @type {?} */
7773 ResellerItem.prototype.activationRequiresApproval;
7774 /** @type {?} */
7775 ResellerItem.prototype.billingId;
7776 /** @type {?} */
7777 ResellerItem.prototype.usesEditions;
7778 /** @type {?} */
7779 ResellerItem.prototype.editionIds;
7780 /** @type {?} */
7781 ResellerItem.prototype.suggestedRetailPrice;
7782 /** @type {?} */
7783 ResellerItem.prototype.editionId;
7784 /** @type {?} */
7785 ResellerItem.prototype.trialConfiguration;
7786 /** @type {?} */
7787 ResellerItem.prototype.integration;
7788}
7789
7790/**
7791 * @fileoverview added by tsickle
7792 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
7793 */
7794var CheckboxField = /** @class */ (function (_super) {
7795 __extends(CheckboxField, _super);
7796 function CheckboxField() {
7797 var _this = _super !== null && _super.apply(this, arguments) || this;
7798 _this.controlType = 'checkbox';
7799 return _this;
7800 }
7801 return CheckboxField;
7802}(FieldBase));
7803if (false) {
7804 /** @type {?} */
7805 CheckboxField.prototype.controlType;
7806}
7807
7808/**
7809 * @fileoverview added by tsickle
7810 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
7811 */
7812/**
7813 * @record
7814 */
7815function Option() { }
7816if (false) {
7817 /** @type {?} */
7818 Option.prototype.value;
7819 /** @type {?} */
7820 Option.prototype.label;
7821 /** @type {?|undefined} */
7822 Option.prototype.disabled;
7823}
7824/**
7825 * @record
7826 */
7827function DropDownFieldOptions() { }
7828if (false) {
7829 /** @type {?} */
7830 DropDownFieldOptions.prototype.options;
7831 /** @type {?|undefined} */
7832 DropDownFieldOptions.prototype.allowMultiples;
7833 /** @type {?|undefined} */
7834 DropDownFieldOptions.prototype.allowDuplicates;
7835 /** @type {?|undefined} */
7836 DropDownFieldOptions.prototype.maxChoices;
7837}
7838var DropdownField = /** @class */ (function (_super) {
7839 __extends(DropdownField, _super);
7840 function DropdownField(options) {
7841 var _this = _super.call(this, options) || this;
7842 _this.controlType = 'dropdown';
7843 _this.options = [];
7844 if (!!options.options && options.options.length > 0) {
7845 // Because this typeof guard is on the element and not the array as a whole typescript doesn't recognize it as a valid type assertion
7846 // The ts-ignore's are required because of this
7847 if (typeof options.options[0] === 'string') {
7848 if (options.allowMultiples) {
7849 // @ts-ignore
7850 _this.options = options.options.map((/**
7851 * @param {?} o
7852 * @return {?}
7853 */
7854 function (o) { return ({ value: o, name: o }); }));
7855 }
7856 else {
7857 // @ts-ignore
7858 _this.options = options.options.map((/**
7859 * @param {?} o
7860 * @return {?}
7861 */
7862 function (o) { return ({ value: o, label: o }); }));
7863 }
7864 }
7865 else {
7866 if (options.allowMultiples) {
7867 // @ts-ignore
7868 _this.options = options.options.map((/**
7869 * @param {?} o
7870 * @return {?}
7871 */
7872 function (o) { return ({ value: o.value, name: o.label }); }));
7873 }
7874 else {
7875 // @ts-ignore
7876 _this.options = options.options;
7877 }
7878 }
7879 }
7880 _this.allowMultiples = !!options.allowMultiples;
7881 _this.allowDuplicates = !!options.allowDuplicates;
7882 _this.maxChoices = options.maxChoices ? options.maxChoices : 1;
7883 _this.validator = _this.validatorBuilder();
7884 return _this;
7885 }
7886 /**
7887 * @protected
7888 * @return {?}
7889 */
7890 DropdownField.prototype.validatorBuilder = /**
7891 * @protected
7892 * @return {?}
7893 */
7894 function () {
7895 /** @type {?} */
7896 var maxChoices = this.maxChoices;
7897 return (/**
7898 * @param {?} control
7899 * @return {?}
7900 */
7901 function (control) {
7902 if (Array.isArray(control.value) && maxChoices && control.value.length > maxChoices) {
7903 return { overMaxChoices: true };
7904 }
7905 });
7906 };
7907 return DropdownField;
7908}(FieldBase));
7909if (false) {
7910 /** @type {?} */
7911 DropdownField.prototype.controlType;
7912 /** @type {?} */
7913 DropdownField.prototype.options;
7914 /** @type {?} */
7915 DropdownField.prototype.allowMultiples;
7916 /** @type {?} */
7917 DropdownField.prototype.allowDuplicates;
7918 /** @type {?} */
7919 DropdownField.prototype.maxChoices;
7920}
7921
7922/**
7923 * @fileoverview added by tsickle
7924 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
7925 */
7926/** @type {?} */
7927var DEFAULT_NUM_FILES = 5;
7928/**
7929 * @record
7930 */
7931function FileUploadGroupFieldOptions() { }
7932if (false) {
7933 /** @type {?} */
7934 FileUploadGroupFieldOptions.prototype.fileType;
7935 /** @type {?} */
7936 FileUploadGroupFieldOptions.prototype.uploadUrl;
7937 /** @type {?} */
7938 FileUploadGroupFieldOptions.prototype.numFiles;
7939}
7940var FileUploadGroupField = /** @class */ (function (_super) {
7941 __extends(FileUploadGroupField, _super);
7942 function FileUploadGroupField(options) {
7943 var _this = _super.call(this, options) || this;
7944 _this.controlType = 'file';
7945 if (!options.uploadUrl) {
7946 throw new Error('uploadUrl is required.');
7947 }
7948 _this.fileType = options.fileType || 'image';
7949 _this.numFiles = options.numFiles || DEFAULT_NUM_FILES;
7950 _this.uploadUrl = options.uploadUrl;
7951 _this.value = [];
7952 return _this;
7953 }
7954 return FileUploadGroupField;
7955}(FieldBase));
7956if (false) {
7957 /** @type {?} */
7958 FileUploadGroupField.prototype.controlType;
7959 /** @type {?} */
7960 FileUploadGroupField.prototype.fileType;
7961 /** @type {?} */
7962 FileUploadGroupField.prototype.uploadUrl;
7963 /** @type {?} */
7964 FileUploadGroupField.prototype.numFiles;
7965}
7966
7967/**
7968 * @fileoverview added by tsickle
7969 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
7970 */
7971var TextareaField = /** @class */ (function (_super) {
7972 __extends(TextareaField, _super);
7973 function TextareaField() {
7974 var _this = _super !== null && _super.apply(this, arguments) || this;
7975 _this.controlType = 'textarea';
7976 return _this;
7977 }
7978 return TextareaField;
7979}(FieldBase));
7980if (false) {
7981 /** @type {?} */
7982 TextareaField.prototype.controlType;
7983}
7984
7985/**
7986 * @fileoverview added by tsickle
7987 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
7988 */
7989/**
7990 * @record
7991 */
7992function TextBoxFieldOptions() { }
7993if (false) {
7994 /** @type {?} */
7995 TextBoxFieldOptions.prototype.textboxType;
7996 /** @type {?|undefined} */
7997 TextBoxFieldOptions.prototype.prefix;
7998 /** @type {?|undefined} */
7999 TextBoxFieldOptions.prototype.suffix;
8000 /** @type {?|undefined} */
8001 TextBoxFieldOptions.prototype.displayOnly;
8002}
8003var TextboxField = /** @class */ (function (_super) {
8004 __extends(TextboxField, _super);
8005 function TextboxField(options) {
8006 var _this = _super.call(this, options) || this;
8007 _this.controlType = 'textbox';
8008 _this.textboxType = options.textboxType || 'text';
8009 _this.prefix = options.prefix || '';
8010 _this.suffix = options.suffix || '';
8011 _this.regexValidator = options.regexValidator || '';
8012 _this.regexErrorMessage = options.regexErrorMessage || '';
8013 _this.displayOnly = options.displayOnly || false;
8014 return _this;
8015 }
8016 return TextboxField;
8017}(FieldBase));
8018if (false) {
8019 /** @type {?} */
8020 TextboxField.prototype.controlType;
8021 /** @type {?} */
8022 TextboxField.prototype.textboxType;
8023 /** @type {?} */
8024 TextboxField.prototype.prefix;
8025 /** @type {?} */
8026 TextboxField.prototype.suffix;
8027 /** @type {?} */
8028 TextboxField.prototype.regexValidator;
8029 /** @type {?} */
8030 TextboxField.prototype.regexErrorMessage;
8031 /** @type {?} */
8032 TextboxField.prototype.displayOnly;
8033}
8034
8035/**
8036 * @fileoverview added by tsickle
8037 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
8038 */
8039/**
8040 * @record
8041 */
8042function User() { }
8043if (false) {
8044 /** @type {?} */
8045 User.prototype.userId;
8046 /** @type {?} */
8047 User.prototype.email;
8048 /** @type {?|undefined} */
8049 User.prototype.firstName;
8050 /** @type {?|undefined} */
8051 User.prototype.lastName;
8052}
8053/**
8054 * @record
8055 */
8056function VBCUserFieldOptions() { }
8057if (false) {
8058 /** @type {?} */
8059 VBCUserFieldOptions.prototype.users;
8060}
8061var VBCUserField = /** @class */ (function (_super) {
8062 __extends(VBCUserField, _super);
8063 function VBCUserField(options) {
8064 var _this = _super.call(this, {
8065 id: options.id,
8066 label: options.label,
8067 required: options.required,
8068 description: options.description,
8069 options: getOptions(options.users),
8070 disabled: options.disabled,
8071 forOfficeUseOnly: options.forOfficeUseOnly
8072 }) || this;
8073 _this.controlType = 'vbcuser';
8074 return _this;
8075 }
8076 return VBCUserField;
8077}(DropdownField));
8078if (false) {
8079 /** @type {?} */
8080 VBCUserField.prototype.controlType;
8081}
8082/**
8083 * @param {?} vbcUsers
8084 * @return {?}
8085 */
8086function getOptions(vbcUsers) {
8087 if (vbcUsers && vbcUsers.length > 0) {
8088 vbcUsers.sort(compareUsersByEmail);
8089 return vbcUsers.map((/**
8090 * @param {?} user
8091 * @return {?}
8092 */
8093 function (user) {
8094 /** @type {?} */
8095 var labelString = createLabelString(user.firstName, user.lastName, user.email);
8096 if (user.userId && user.email && user.firstName && user.lastName) {
8097 return {
8098 label: labelString,
8099 value: JSON.stringify({ firstName: user.firstName, lastName: user.lastName, email: user.email, id: user.userId })
8100 };
8101 }
8102 return { label: labelString, value: '', disabled: true };
8103 }));
8104 }
8105 return [{ label: 'No Users — Please add one to this account', value: '', disabled: true }];
8106}
8107/**
8108 * @param {?} a
8109 * @param {?} b
8110 * @return {?}
8111 */
8112function compareUsersByEmail(a, b) {
8113 if (a == null) {
8114 return -1;
8115 }
8116 if (b == null) {
8117 return 1;
8118 }
8119 return a.email.localeCompare(b.email);
8120}
8121/**
8122 * @param {?} firstName
8123 * @param {?} lastName
8124 * @param {?} email
8125 * @return {?}
8126 */
8127function createLabelString(firstName, lastName, email) {
8128 /** @type {?} */
8129 var returnString = '';
8130 returnString += firstName ? firstName + ' ' : '';
8131 returnString += lastName ? lastName + ' ' : '';
8132 returnString += email ? "(" + email + ")" : '';
8133 return returnString;
8134}
8135
8136/**
8137 * @fileoverview added by tsickle
8138 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
8139 */
8140
8141/**
8142 * @fileoverview added by tsickle
8143 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
8144 */
8145
8146/**
8147 * @fileoverview added by tsickle
8148 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
8149 */
8150
8151/**
8152 * @fileoverview added by tsickle
8153 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
8154 */
8155
8156export { ActivationStatus, AddonDetailsComponent, AddonDropDownFormSectionData, AddonModule, BUSINESS_USER, CHECK_BOX, CONTACT_SALES, CardListStencilComponent, CardStencilComponent, CaseTransform, CheckboxField, DROP_DOWN, DetailsStencilComponent, DropDownFormSectionComponent, DropDownFormSectionData, DropdownField, FILES, FORM_FIELDS, FieldBase, FieldBuilderComponent, FieldComponent, FieldService, File, FileUploadGroupField, HeimdallServiceToken, LMI_CATEGORIES, LMI_CATEGORIES_BY_NAME, LMI_CATEGORY_MAP, ListStencilComponent, OrderFormComponent, OrderFormSectionComponent, OrderFormSectionData, Package, PackageDetails, Product, ProductOrderFormSectionData, ProductWithParent, ProductsNavV2Component, ResellerItem, RestrictionsModule, STOREFRONT_FILTER_NAME, SearchBarStencilComponent, StencilsModule, StoreCardComponent, StoreCardModule, StoreComponent, StoreModule, StoreService, StorefrontComponent, TEXT_AREA, TEXT_BOX, TextareaField, TextboxField, VBCUserField, VaAddonListComponent, VaAddonListModule, VaFaqsComponent, VaFaqsModule, VaFilesComponent, VaFilesModule, VaHeaderContainerComponent, VaHeaderContainerModule, VaOrderFormModule, VaPackageDetailsComponent, VaPackageDetailsModule, VaPackageDetailsV2Component, VaPackageDetailsV2Module, VaPackageDropdownComponent, VaPackageDropdownModule, VaPricingComponent, VaPricingModule, VaProductDetailsComponent, VaProductDetailsModule, VaProductsNavComponent, VaProductsNavModule, VaSalespersonDetailsComponent, VaSalespersonDetailsModule, VaSellingInfoComponent, VaSellingInfoModule, combineProductOrderWithContainedProducts, convertToPackageDetails, getUniqueProductAddonId, orderProductsAndAddons, HeimdallClient as ɵb, HeimdallClientModule as ɵc, HighlightPricingComponent as ɵd, TablePricingComponent as ɵe, OrderItemListComponent as ɵf, PricePipe as ɵg, FormatBillingFrequencyPipe as ɵh, OrderFormService as ɵi, OrderItemListService as ɵj, SupportedCountriesComponent as ɵk, VaPackageDetailsV2Component as ɵl, Sellable as ɵm, VaPackageDropdownItemComponent as ɵn };
8157//# sourceMappingURL=vendasta-store.js.map