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