@daffodil/checkout 0.39.13 → 0.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/billing/billing-state.module.d.ts +5 -0
- package/billing/billing.module.d.ts +7 -0
- package/billing/containers/billing.component.d.ts +3 -0
- package/billing/facades/billing.facade.d.ts +3 -0
- package/checkout.module.d.ts +9 -0
- package/daffodil-checkout.d.ts +1 -7
- package/{esm2015/billing/actions/billing.actions.js → esm2020/billing/actions/billing.actions.mjs} +0 -0
- package/esm2020/billing/billing-state.module.mjs +21 -0
- package/esm2020/billing/billing.module.mjs +39 -0
- package/esm2020/billing/containers/billing.component.mjs +36 -0
- package/esm2020/billing/facades/billing.facade.mjs +34 -0
- package/{esm2015/billing/reducers/billing/billing-reducer.interface.js → esm2020/billing/reducers/billing/billing-reducer.interface.mjs} +0 -0
- package/esm2020/billing/reducers/billing/billing.reducer.mjs +19 -0
- package/{esm2015/billing/reducers/billing-reducers.interface.js → esm2020/billing/reducers/billing-reducers.interface.mjs} +0 -0
- package/{esm2015/billing/reducers/billing-reducers.js → esm2020/billing/reducers/billing-reducers.mjs} +0 -0
- package/{esm2015/billing/selectors/billing.selector.js → esm2020/billing/selectors/billing.selector.mjs} +5 -10
- package/esm2020/checkout.module.mjs +47 -0
- package/esm2020/daffodil-checkout.mjs +5 -0
- package/{esm2015/drivers/injection-tokens/driver-checkout.token.js → esm2020/drivers/injection-tokens/driver-checkout.token.mjs} +0 -0
- package/{esm2015/drivers/injection-tokens/payment-driver.token.js → esm2020/drivers/injection-tokens/payment-driver.token.mjs} +0 -0
- package/{esm2015/drivers/injection-tokens/payment-transformer.token.js → esm2020/drivers/injection-tokens/payment-transformer.token.mjs} +0 -0
- package/{esm2015/drivers/interfaces/checkout-service.interface.js → esm2020/drivers/interfaces/checkout-service.interface.mjs} +0 -0
- package/{esm2015/drivers/interfaces/order-service.interface.js → esm2020/drivers/interfaces/order-service.interface.mjs} +0 -0
- package/{esm2015/index.js → esm2020/index.mjs} +0 -0
- package/{esm2015/models/cart-process-request.js → esm2020/models/cart-process-request.mjs} +1 -1
- package/{esm2015/models/order/order-address.js → esm2020/models/order/order-address.mjs} +0 -0
- package/{esm2015/models/order/order-item.js → esm2020/models/order/order-item.mjs} +0 -0
- package/{esm2015/models/order/order-payment.js → esm2020/models/order/order-payment.mjs} +0 -0
- package/{esm2015/models/order/order-shipping-rate.js → esm2020/models/order/order-shipping-rate.mjs} +0 -0
- package/{esm2015/models/order/order.js → esm2020/models/order/order.mjs} +0 -0
- package/{esm2015/models/payment/payment-info.js → esm2020/models/payment/payment-info.mjs} +1 -1
- package/{esm2015/models/shipping/shipping-option.js → esm2020/models/shipping/shipping-option.mjs} +1 -1
- package/{esm2015/models/shipping/shipping-rate.js → esm2020/models/shipping/shipping-rate.mjs} +1 -1
- package/{esm2015/order/actions/order.actions.js → esm2020/order/actions/order.actions.mjs} +0 -0
- package/esm2020/order/containers/order.component.mjs +28 -0
- package/esm2020/order/effects/order.effects.mjs +28 -0
- package/esm2020/order/facades/order.facade.mjs +37 -0
- package/esm2020/order/order-state.module.mjs +33 -0
- package/esm2020/order/order.module.mjs +42 -0
- package/{esm2015/order/reducers/order/order-reducer.interface.js → esm2020/order/reducers/order/order-reducer.interface.mjs} +0 -0
- package/esm2020/order/reducers/order/order.reducer.mjs +25 -0
- package/{esm2015/order/reducers/order-reducers.interface.js → esm2020/order/reducers/order-reducers.interface.mjs} +0 -0
- package/{esm2015/order/reducers/order-reducers.js → esm2020/order/reducers/order-reducers.mjs} +0 -0
- package/{esm2015/order/selectors/order.selector.js → esm2020/order/selectors/order.selector.mjs} +5 -10
- package/{esm2015/payment/actions/payment.actions.js → esm2020/payment/actions/payment.actions.mjs} +0 -0
- package/esm2020/payment/facades/payment.facade.mjs +32 -0
- package/esm2020/payment/payment-state.module.mjs +21 -0
- package/esm2020/payment/payment.module.mjs +32 -0
- package/{esm2015/payment/reducers/payment/payment-reducer.interface.js → esm2020/payment/reducers/payment/payment-reducer.interface.mjs} +0 -0
- package/esm2020/payment/reducers/payment/payment.reducer.mjs +13 -0
- package/{esm2015/payment/reducers/payment-reducers.interface.js → esm2020/payment/reducers/payment-reducers.interface.mjs} +0 -0
- package/{esm2015/payment/reducers/payment-reducers.js → esm2020/payment/reducers/payment-reducers.mjs} +0 -0
- package/{esm2015/payment/selectors/payment.selector.js → esm2020/payment/selectors/payment.selector.mjs} +3 -6
- package/{esm2015/shipping/actions/shipping.actions.js → esm2020/shipping/actions/shipping.actions.mjs} +0 -0
- package/esm2020/shipping/containers/shipping.component.mjs +33 -0
- package/esm2020/shipping/facades/shipping.facade.mjs +34 -0
- package/{esm2015/shipping/reducers/shipping/shipping-reducer.interface.js → esm2020/shipping/reducers/shipping/shipping-reducer.interface.mjs} +0 -0
- package/esm2020/shipping/reducers/shipping/shipping.reducer.mjs +16 -0
- package/{esm2015/shipping/reducers/shipping-reducers.interface.js → esm2020/shipping/reducers/shipping-reducers.interface.mjs} +0 -0
- package/{esm2015/shipping/reducers/shipping-reducers.js → esm2020/shipping/reducers/shipping-reducers.mjs} +0 -0
- package/{esm2015/shipping/selectors/shipping.selectors.js → esm2020/shipping/selectors/shipping.selectors.mjs} +5 -10
- package/esm2020/shipping/shipping-state.module.mjs +21 -0
- package/esm2020/shipping/shipping.module.mjs +39 -0
- package/{esm2015/testing/daffodil-checkout-testing.js → esm2020/testing/daffodil-checkout-testing.mjs} +0 -0
- package/esm2020/testing/drivers/in-memory/checkout-driver.module.mjs +32 -0
- package/esm2020/testing/drivers/in-memory/checkout.service.mjs +22 -0
- package/esm2020/testing/drivers/testing/checkout-driver.module.mjs +32 -0
- package/esm2020/testing/drivers/testing/checkout.service.mjs +25 -0
- package/{esm2015/testing/index.js → esm2020/testing/index.mjs} +0 -0
- package/{esm2015/testing/inmemory-backend/checkout.service.js → esm2020/testing/inmemory-backend/checkout.service.mjs} +9 -13
- package/{esm2015/testing/order/factories/order-address.factory.js → esm2020/testing/order/factories/order-address.factory.mjs} +9 -9
- package/{esm2015/testing/order/factories/order-item.factory.js → esm2020/testing/order/factories/order-item.factory.mjs} +9 -9
- package/{esm2015/testing/order/factories/order-payment.factory.js → esm2020/testing/order/factories/order-payment.factory.mjs} +9 -9
- package/{esm2015/testing/order/factories/order-shipping-rate.factory.js → esm2020/testing/order/factories/order-shipping-rate.factory.mjs} +9 -9
- package/{esm2015/testing/order/factories/order.factory.js → esm2020/testing/order/factories/order.factory.mjs} +9 -9
- package/esm2020/testing/payment/factories/payment.factory.mjs +26 -0
- package/esm2020/testing/shipping/factories/shipping-option.factory.mjs +24 -0
- package/esm2020/testing/shipping/factories/shipping-rate.factory.mjs +29 -0
- package/fesm2015/daffodil-checkout-testing.mjs +429 -0
- package/fesm2015/daffodil-checkout-testing.mjs.map +1 -0
- package/fesm2015/daffodil-checkout.mjs +740 -0
- package/fesm2015/daffodil-checkout.mjs.map +1 -0
- package/fesm2020/daffodil-checkout-testing.mjs +429 -0
- package/fesm2020/daffodil-checkout-testing.mjs.map +1 -0
- package/fesm2020/daffodil-checkout.mjs +738 -0
- package/fesm2020/daffodil-checkout.mjs.map +1 -0
- package/order/containers/order.component.d.ts +3 -0
- package/order/effects/order.effects.d.ts +3 -0
- package/order/facades/order.facade.d.ts +3 -0
- package/order/order-state.module.d.ts +6 -0
- package/order/order.module.d.ts +7 -0
- package/package.json +38 -18
- package/payment/facades/payment.facade.d.ts +3 -0
- package/payment/payment-state.module.d.ts +5 -0
- package/payment/payment.module.d.ts +6 -0
- package/payment/selectors/payment.selector.d.ts +1 -1
- package/shipping/containers/shipping.component.d.ts +3 -0
- package/shipping/facades/shipping.facade.d.ts +3 -0
- package/shipping/shipping-state.module.d.ts +5 -0
- package/shipping/shipping.module.d.ts +7 -0
- package/testing/daffodil-checkout-testing.d.ts +1 -0
- package/testing/drivers/in-memory/checkout-driver.module.d.ts +5 -0
- package/testing/drivers/in-memory/checkout.service.d.ts +3 -0
- package/testing/drivers/testing/checkout-driver.module.d.ts +5 -0
- package/testing/drivers/testing/checkout.service.d.ts +3 -0
- package/testing/inmemory-backend/checkout.service.d.ts +3 -0
- package/testing/order/factories/order-address.factory.d.ts +3 -0
- package/testing/order/factories/order-item.factory.d.ts +3 -0
- package/testing/order/factories/order-payment.factory.d.ts +3 -0
- package/testing/order/factories/order-shipping-rate.factory.d.ts +3 -0
- package/testing/order/factories/order.factory.d.ts +3 -0
- package/testing/package.json +5 -6
- package/testing/payment/factories/payment.factory.d.ts +3 -0
- package/testing/shipping/factories/shipping-option.factory.d.ts +3 -0
- package/testing/shipping/factories/shipping-rate.factory.d.ts +3 -0
- package/bundles/daffodil-checkout-testing.umd.js +0 -789
- package/bundles/daffodil-checkout-testing.umd.js.map +0 -1
- package/bundles/daffodil-checkout-testing.umd.min.js +0 -16
- package/bundles/daffodil-checkout-testing.umd.min.js.map +0 -1
- package/bundles/daffodil-checkout.umd.js +0 -1078
- package/bundles/daffodil-checkout.umd.js.map +0 -1
- package/bundles/daffodil-checkout.umd.min.js +0 -16
- package/bundles/daffodil-checkout.umd.min.js.map +0 -1
- package/daffodil-checkout.metadata.json +0 -1
- package/esm2015/billing/billing-state.module.js +0 -13
- package/esm2015/billing/billing.module.js +0 -24
- package/esm2015/billing/containers/billing.component.js +0 -35
- package/esm2015/billing/facades/billing.facade.js +0 -37
- package/esm2015/billing/reducers/billing/billing.reducer.js +0 -19
- package/esm2015/checkout.module.js +0 -26
- package/esm2015/daffodil-checkout.js +0 -11
- package/esm2015/order/containers/order.component.js +0 -27
- package/esm2015/order/effects/order.effects.js +0 -31
- package/esm2015/order/facades/order.facade.js +0 -40
- package/esm2015/order/order-state.module.js +0 -21
- package/esm2015/order/order.module.js +0 -27
- package/esm2015/order/reducers/order/order.reducer.js +0 -25
- package/esm2015/payment/facades/payment.facade.js +0 -35
- package/esm2015/payment/payment-state.module.js +0 -13
- package/esm2015/payment/payment.module.js +0 -17
- package/esm2015/payment/reducers/payment/payment.reducer.js +0 -13
- package/esm2015/shipping/containers/shipping.component.js +0 -32
- package/esm2015/shipping/facades/shipping.facade.js +0 -37
- package/esm2015/shipping/reducers/shipping/shipping.reducer.js +0 -16
- package/esm2015/shipping/shipping-state.module.js +0 -13
- package/esm2015/shipping/shipping.module.js +0 -24
- package/esm2015/testing/drivers/in-memory/checkout-driver.module.js +0 -25
- package/esm2015/testing/drivers/in-memory/checkout.service.js +0 -24
- package/esm2015/testing/drivers/testing/checkout-driver.module.js +0 -25
- package/esm2015/testing/drivers/testing/checkout.service.js +0 -28
- package/esm2015/testing/payment/factories/payment.factory.js +0 -26
- package/esm2015/testing/shipping/factories/shipping-option.factory.js +0 -24
- package/esm2015/testing/shipping/factories/shipping-rate.factory.js +0 -29
- package/fesm2015/daffodil-checkout-testing.js +0 -425
- package/fesm2015/daffodil-checkout-testing.js.map +0 -1
- package/fesm2015/daffodil-checkout.js +0 -662
- package/fesm2015/daffodil-checkout.js.map +0 -1
- package/testing/daffodil-checkout-testing.metadata.json +0 -1
@@ -1,1078 +0,0 @@
|
|
1
|
-
(function (global, factory) {
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@ngrx/store'), require('@angular/common'), require('@ngrx/effects'), require('rxjs'), require('rxjs/operators')) :
|
3
|
-
typeof define === 'function' && define.amd ? define('@daffodil/checkout', ['exports', '@angular/core', '@ngrx/store', '@angular/common', '@ngrx/effects', 'rxjs', 'rxjs/operators'], factory) :
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.daffodil = global.daffodil || {}, global.daffodil.checkout = {}), global.ng.core, global.i1, global.ng.common, global.effects, global.rxjs, global.rxjs.operators));
|
5
|
-
}(this, (function (exports, i0, i1, common, effects, rxjs, operators) { 'use strict';
|
6
|
-
|
7
|
-
(function (DaffShippingActionTypes) {
|
8
|
-
DaffShippingActionTypes["UpdateShippingAddressAction"] = "[Shipping] Update Shipping Address Action";
|
9
|
-
DaffShippingActionTypes["SelectShippingOptionAction"] = "[Shipping] Select Shipping Option Action";
|
10
|
-
})(exports.DaffShippingActionTypes || (exports.DaffShippingActionTypes = {}));
|
11
|
-
var DaffUpdateShippingAddress = /** @class */ (function () {
|
12
|
-
function DaffUpdateShippingAddress(payload) {
|
13
|
-
this.payload = payload;
|
14
|
-
this.type = exports.DaffShippingActionTypes.UpdateShippingAddressAction;
|
15
|
-
}
|
16
|
-
return DaffUpdateShippingAddress;
|
17
|
-
}());
|
18
|
-
var DaffSelectShippingOption = /** @class */ (function () {
|
19
|
-
function DaffSelectShippingOption(payload) {
|
20
|
-
this.payload = payload;
|
21
|
-
this.type = exports.DaffShippingActionTypes.SelectShippingOptionAction;
|
22
|
-
}
|
23
|
-
return DaffSelectShippingOption;
|
24
|
-
}());
|
25
|
-
|
26
|
-
/**
|
27
|
-
* Shipping Feature State
|
28
|
-
*/
|
29
|
-
var selectShippingFeatureState = i1.createFeatureSelector('shipping');
|
30
|
-
var ɵ0 = function (state) { return state.shipping; };
|
31
|
-
/**
|
32
|
-
* Shipping State
|
33
|
-
*/
|
34
|
-
var selectShippingState = i1.createSelector(selectShippingFeatureState, ɵ0);
|
35
|
-
var ɵ1 = function (state) { return state.shippingAddress; };
|
36
|
-
var selectShippingAddress = i1.createSelector(selectShippingState, ɵ1);
|
37
|
-
var ɵ2 = function (state) { return state.selectedShippingOptionId; };
|
38
|
-
var selectShippingOptionId = i1.createSelector(selectShippingState, ɵ2);
|
39
|
-
var ɵ3 = function (state) { return !!state; };
|
40
|
-
var selectIsShippingAddressValid = i1.createSelector(selectShippingAddress, ɵ3);
|
41
|
-
|
42
|
-
var ShippingContainer = /** @class */ (function () {
|
43
|
-
function ShippingContainer(store) {
|
44
|
-
this.store = store;
|
45
|
-
}
|
46
|
-
ShippingContainer.prototype.ngOnInit = function () {
|
47
|
-
this.shippingAddress$ = this.store.pipe(i1.select(selectShippingAddress));
|
48
|
-
this.selectedShippingOptionId$ = this.store.pipe(i1.select(selectShippingOptionId));
|
49
|
-
this.isShippingAddressValid$ = this.store.pipe(i1.select(selectIsShippingAddressValid));
|
50
|
-
};
|
51
|
-
ShippingContainer.prototype.updateShippingAddress = function (address) {
|
52
|
-
this.store.dispatch(new DaffUpdateShippingAddress(address));
|
53
|
-
};
|
54
|
-
ShippingContainer.prototype.selectShippingOption = function (optionId) {
|
55
|
-
this.store.dispatch(new DaffSelectShippingOption(optionId));
|
56
|
-
};
|
57
|
-
return ShippingContainer;
|
58
|
-
}());
|
59
|
-
ShippingContainer.decorators = [
|
60
|
-
{ type: i0.Component, args: [{
|
61
|
-
selector: '[shipping-container]',
|
62
|
-
template: '<ng-content></ng-content>',
|
63
|
-
exportAs: 'ShippingContainer'
|
64
|
-
},] }
|
65
|
-
];
|
66
|
-
/** @nocollapse */
|
67
|
-
ShippingContainer.ctorParameters = function () { return [
|
68
|
-
{ type: i1.Store }
|
69
|
-
]; };
|
70
|
-
|
71
|
-
/**
|
72
|
-
* Order Feature State
|
73
|
-
*
|
74
|
-
* @deprecated
|
75
|
-
*/
|
76
|
-
var selectOrderFeatureState = i1.createFeatureSelector('order');
|
77
|
-
var ɵ0$1 = function (state) { return state.order; };
|
78
|
-
/**
|
79
|
-
* Order State
|
80
|
-
*
|
81
|
-
* @deprecated
|
82
|
-
*/
|
83
|
-
var selectOrderState = i1.createSelector(selectOrderFeatureState, ɵ0$1);
|
84
|
-
var ɵ1$1 = function (state) { return state.order; };
|
85
|
-
/**
|
86
|
-
* @deprecated
|
87
|
-
*/
|
88
|
-
var selectOrder = i1.createSelector(selectOrderState, ɵ1$1);
|
89
|
-
var ɵ2$1 = function (state) { return state.loading; };
|
90
|
-
/**
|
91
|
-
* @deprecated
|
92
|
-
*/
|
93
|
-
var selectLoading = i1.createSelector(selectOrderState, ɵ2$1);
|
94
|
-
var ɵ3$1 = function (state) { return state.errors; };
|
95
|
-
/**
|
96
|
-
* @deprecated
|
97
|
-
*/
|
98
|
-
var selectErrors = i1.createSelector(selectOrderState, ɵ3$1);
|
99
|
-
|
100
|
-
/**
|
101
|
-
* @deprecated
|
102
|
-
*/
|
103
|
-
var OrderContainer = /** @class */ (function () {
|
104
|
-
function OrderContainer(store) {
|
105
|
-
this.store = store;
|
106
|
-
}
|
107
|
-
OrderContainer.prototype.ngOnInit = function () {
|
108
|
-
this.order$ = this.store.pipe(i1.select(selectOrder));
|
109
|
-
this.loading$ = this.store.pipe(i1.select(selectLoading));
|
110
|
-
};
|
111
|
-
return OrderContainer;
|
112
|
-
}());
|
113
|
-
OrderContainer.decorators = [
|
114
|
-
{ type: i0.Component, args: [{
|
115
|
-
selector: '[order-container]',
|
116
|
-
template: '<ng-content></ng-content>',
|
117
|
-
exportAs: 'OrderContainer'
|
118
|
-
},] }
|
119
|
-
];
|
120
|
-
/** @nocollapse */
|
121
|
-
OrderContainer.ctorParameters = function () { return [
|
122
|
-
{ type: i1.Store }
|
123
|
-
]; };
|
124
|
-
|
125
|
-
(function (DaffPaymentActionTypes) {
|
126
|
-
DaffPaymentActionTypes["UpdatePaymentInfoAction"] = "[Payment] Update Payment Info Action";
|
127
|
-
})(exports.DaffPaymentActionTypes || (exports.DaffPaymentActionTypes = {}));
|
128
|
-
var DaffUpdatePaymentInfo = /** @class */ (function () {
|
129
|
-
function DaffUpdatePaymentInfo(payload) {
|
130
|
-
this.payload = payload;
|
131
|
-
this.type = exports.DaffPaymentActionTypes.UpdatePaymentInfoAction;
|
132
|
-
}
|
133
|
-
return DaffUpdatePaymentInfo;
|
134
|
-
}());
|
135
|
-
|
136
|
-
var initialState = {
|
137
|
-
paymentInfo: null,
|
138
|
-
};
|
139
|
-
function daffPaymentReducer(state, action) {
|
140
|
-
if (state === void 0) { state = initialState; }
|
141
|
-
switch (action.type) {
|
142
|
-
case exports.DaffPaymentActionTypes.UpdatePaymentInfoAction:
|
143
|
-
return Object.assign(Object.assign({}, state), { paymentInfo: action.payload });
|
144
|
-
default:
|
145
|
-
return state;
|
146
|
-
}
|
147
|
-
}
|
148
|
-
|
149
|
-
var daffPaymentReducers = {
|
150
|
-
payment: daffPaymentReducer,
|
151
|
-
};
|
152
|
-
|
153
|
-
var DaffPaymentStateModule = /** @class */ (function () {
|
154
|
-
function DaffPaymentStateModule() {
|
155
|
-
}
|
156
|
-
return DaffPaymentStateModule;
|
157
|
-
}());
|
158
|
-
DaffPaymentStateModule.decorators = [
|
159
|
-
{ type: i0.NgModule, args: [{
|
160
|
-
imports: [
|
161
|
-
i1.StoreModule.forFeature('payment', daffPaymentReducers),
|
162
|
-
],
|
163
|
-
},] }
|
164
|
-
];
|
165
|
-
|
166
|
-
var DaffPaymentModule = /** @class */ (function () {
|
167
|
-
function DaffPaymentModule() {
|
168
|
-
}
|
169
|
-
return DaffPaymentModule;
|
170
|
-
}());
|
171
|
-
DaffPaymentModule.decorators = [
|
172
|
-
{ type: i0.NgModule, args: [{
|
173
|
-
imports: [
|
174
|
-
common.CommonModule,
|
175
|
-
/**
|
176
|
-
* Ngrx/store
|
177
|
-
*/
|
178
|
-
DaffPaymentStateModule,
|
179
|
-
],
|
180
|
-
},] }
|
181
|
-
];
|
182
|
-
|
183
|
-
/**
|
184
|
-
* Payment Feature State
|
185
|
-
*/
|
186
|
-
var selectPaymentFeatureState = i1.createFeatureSelector('payment');
|
187
|
-
var ɵ0$2 = function (state) { return state.payment; };
|
188
|
-
/**
|
189
|
-
* Payment State
|
190
|
-
*/
|
191
|
-
var selectPaymentState = i1.createSelector(selectPaymentFeatureState, ɵ0$2);
|
192
|
-
var ɵ1$2 = function (state) { return state.paymentInfo; };
|
193
|
-
var selectPaymentInfo = i1.createSelector(selectPaymentState, ɵ1$2);
|
194
|
-
|
195
|
-
/**
|
196
|
-
* A facade for accessing state for customer payment information.
|
197
|
-
*/
|
198
|
-
var DaffPaymentFacade = /** @class */ (function () {
|
199
|
-
function DaffPaymentFacade(store) {
|
200
|
-
this.store = store;
|
201
|
-
this.paymentInfo$ = this.store.pipe(i1.select(selectPaymentInfo));
|
202
|
-
}
|
203
|
-
/**
|
204
|
-
* Dispatches the given action.
|
205
|
-
*
|
206
|
-
* @param action action to dispatch.
|
207
|
-
*/
|
208
|
-
DaffPaymentFacade.prototype.dispatch = function (action) {
|
209
|
-
this.store.dispatch(action);
|
210
|
-
};
|
211
|
-
return DaffPaymentFacade;
|
212
|
-
}());
|
213
|
-
/** @nocollapse */ DaffPaymentFacade.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffPaymentFacade_Factory() { return new DaffPaymentFacade(i0.ɵɵinject(i1.Store)); }, token: DaffPaymentFacade, providedIn: DaffPaymentModule });
|
214
|
-
DaffPaymentFacade.decorators = [
|
215
|
-
{ type: i0.Injectable, args: [{
|
216
|
-
providedIn: DaffPaymentModule,
|
217
|
-
},] }
|
218
|
-
];
|
219
|
-
/** @nocollapse */
|
220
|
-
DaffPaymentFacade.ctorParameters = function () { return [
|
221
|
-
{ type: i1.Store }
|
222
|
-
]; };
|
223
|
-
|
224
|
-
var DaffPaymentDriver = new i0.InjectionToken('DaffPaymentDriver');
|
225
|
-
|
226
|
-
var DaffOrderDriver = new i0.InjectionToken('DaffOrderDriver');
|
227
|
-
|
228
|
-
var DaffPaymentTransformer = new i0.InjectionToken('DaffPaymentTransformer');
|
229
|
-
|
230
|
-
(function (DaffBillingActionTypes) {
|
231
|
-
DaffBillingActionTypes["UpdateBillingAddressAction"] = "[Billing] Update Billing Address Action";
|
232
|
-
DaffBillingActionTypes["UpdatePaymentInfoAction"] = "[Billing] Update Payment Info Action";
|
233
|
-
DaffBillingActionTypes["ToggleBillingAddressIsShippingAddressAction"] = "[Billing] Billing Address Is Shipping Address Action";
|
234
|
-
})(exports.DaffBillingActionTypes || (exports.DaffBillingActionTypes = {}));
|
235
|
-
var DaffUpdateBillingAddress = /** @class */ (function () {
|
236
|
-
function DaffUpdateBillingAddress(payload) {
|
237
|
-
this.payload = payload;
|
238
|
-
this.type = exports.DaffBillingActionTypes.UpdateBillingAddressAction;
|
239
|
-
}
|
240
|
-
return DaffUpdateBillingAddress;
|
241
|
-
}());
|
242
|
-
var DaffUpdatePaymentInfo$1 = /** @class */ (function () {
|
243
|
-
function DaffUpdatePaymentInfo(payload) {
|
244
|
-
this.payload = payload;
|
245
|
-
this.type = exports.DaffBillingActionTypes.UpdatePaymentInfoAction;
|
246
|
-
}
|
247
|
-
return DaffUpdatePaymentInfo;
|
248
|
-
}());
|
249
|
-
var DaffToggleBillingAddressIsShippingAddress = /** @class */ (function () {
|
250
|
-
function DaffToggleBillingAddressIsShippingAddress() {
|
251
|
-
this.type = exports.DaffBillingActionTypes.ToggleBillingAddressIsShippingAddressAction;
|
252
|
-
}
|
253
|
-
return DaffToggleBillingAddressIsShippingAddress;
|
254
|
-
}());
|
255
|
-
|
256
|
-
/**
|
257
|
-
* Billing Feature State
|
258
|
-
*/
|
259
|
-
var selectBillingFeatureState = i1.createFeatureSelector('billing');
|
260
|
-
var ɵ0$3 = function (state) { return state.billing; };
|
261
|
-
/**
|
262
|
-
* Billing State
|
263
|
-
*/
|
264
|
-
var selectBillingState = i1.createSelector(selectBillingFeatureState, ɵ0$3);
|
265
|
-
var ɵ1$3 = function (state) { return state.billingAddress; };
|
266
|
-
var selectBillingAddress = i1.createSelector(selectBillingState, ɵ1$3);
|
267
|
-
var ɵ2$2 = function (state) { return state.billingAddressIsShippingAddress; };
|
268
|
-
var selectBillingAddressIsShippingAddress = i1.createSelector(selectBillingState, ɵ2$2);
|
269
|
-
var ɵ3$2 = function (state) { return state.paymentInfo; };
|
270
|
-
var selectPaymentInfo$1 = i1.createSelector(selectBillingState, ɵ3$2);
|
271
|
-
|
272
|
-
var initialState$1 = {
|
273
|
-
billingAddress: null,
|
274
|
-
billingAddressIsShippingAddress: false,
|
275
|
-
paymentInfo: null,
|
276
|
-
};
|
277
|
-
function daffBillingReducer(state, action) {
|
278
|
-
if (state === void 0) { state = initialState$1; }
|
279
|
-
switch (action.type) {
|
280
|
-
case exports.DaffBillingActionTypes.UpdateBillingAddressAction:
|
281
|
-
return Object.assign(Object.assign({}, state), { billingAddress: action.payload });
|
282
|
-
case exports.DaffBillingActionTypes.ToggleBillingAddressIsShippingAddressAction:
|
283
|
-
return Object.assign(Object.assign({}, state), { billingAddress: null, billingAddressIsShippingAddress: !state.billingAddressIsShippingAddress });
|
284
|
-
case exports.DaffBillingActionTypes.UpdatePaymentInfoAction:
|
285
|
-
return Object.assign(Object.assign({}, state), { paymentInfo: action.payload });
|
286
|
-
default:
|
287
|
-
return state;
|
288
|
-
}
|
289
|
-
}
|
290
|
-
|
291
|
-
var daffBillingReducers = {
|
292
|
-
billing: daffBillingReducer,
|
293
|
-
};
|
294
|
-
|
295
|
-
var DaffBillingStateModule = /** @class */ (function () {
|
296
|
-
function DaffBillingStateModule() {
|
297
|
-
}
|
298
|
-
return DaffBillingStateModule;
|
299
|
-
}());
|
300
|
-
DaffBillingStateModule.decorators = [
|
301
|
-
{ type: i0.NgModule, args: [{
|
302
|
-
imports: [
|
303
|
-
i1.StoreModule.forFeature('billing', daffBillingReducers),
|
304
|
-
],
|
305
|
-
},] }
|
306
|
-
];
|
307
|
-
|
308
|
-
var BillingContainer = /** @class */ (function () {
|
309
|
-
function BillingContainer(store) {
|
310
|
-
this.store = store;
|
311
|
-
}
|
312
|
-
BillingContainer.prototype.ngOnInit = function () {
|
313
|
-
this.billingAddress$ = this.store.pipe(i1.select(selectBillingAddress));
|
314
|
-
this.billingAddressIsShippingAddress$ = this.store.pipe(i1.select(selectBillingAddressIsShippingAddress));
|
315
|
-
this.paymentInfo$ = this.store.pipe(i1.select(selectPaymentInfo$1));
|
316
|
-
};
|
317
|
-
BillingContainer.prototype.updateBillingAddress = function (address) {
|
318
|
-
this.store.dispatch(new DaffUpdateBillingAddress(address));
|
319
|
-
};
|
320
|
-
BillingContainer.prototype.toggleBillingAddressIsShippingAddress = function () {
|
321
|
-
this.store.dispatch(new DaffToggleBillingAddressIsShippingAddress());
|
322
|
-
};
|
323
|
-
BillingContainer.prototype.updatePaymentInfo = function (info) {
|
324
|
-
this.store.dispatch(new DaffUpdatePaymentInfo$1(info));
|
325
|
-
};
|
326
|
-
return BillingContainer;
|
327
|
-
}());
|
328
|
-
BillingContainer.decorators = [
|
329
|
-
{ type: i0.Component, args: [{
|
330
|
-
selector: '[billing-container]',
|
331
|
-
template: '<ng-content></ng-content>',
|
332
|
-
exportAs: 'BillingContainer'
|
333
|
-
},] }
|
334
|
-
];
|
335
|
-
/** @nocollapse */
|
336
|
-
BillingContainer.ctorParameters = function () { return [
|
337
|
-
{ type: i1.Store }
|
338
|
-
]; };
|
339
|
-
|
340
|
-
var DaffBillingModule = /** @class */ (function () {
|
341
|
-
function DaffBillingModule() {
|
342
|
-
}
|
343
|
-
return DaffBillingModule;
|
344
|
-
}());
|
345
|
-
DaffBillingModule.decorators = [
|
346
|
-
{ type: i0.NgModule, args: [{
|
347
|
-
imports: [
|
348
|
-
common.CommonModule,
|
349
|
-
/**
|
350
|
-
* Ngrx/store
|
351
|
-
*/
|
352
|
-
DaffBillingStateModule,
|
353
|
-
],
|
354
|
-
declarations: [
|
355
|
-
BillingContainer,
|
356
|
-
],
|
357
|
-
exports: [
|
358
|
-
BillingContainer,
|
359
|
-
],
|
360
|
-
},] }
|
361
|
-
];
|
362
|
-
|
363
|
-
/**
|
364
|
-
* A facade for accessing state for the billing information of a customer
|
365
|
-
*/
|
366
|
-
var DaffBillingFacade = /** @class */ (function () {
|
367
|
-
function DaffBillingFacade(store) {
|
368
|
-
this.store = store;
|
369
|
-
this.billingAddress$ = this.store.pipe(i1.select(selectBillingAddress));
|
370
|
-
this.billingAddressIsShippingAddress$ = this.store.pipe(i1.select(selectBillingAddressIsShippingAddress));
|
371
|
-
this.paymentInfo$ = this.store.pipe(i1.select(selectPaymentInfo$1));
|
372
|
-
}
|
373
|
-
/**
|
374
|
-
* Dispatches the given action.
|
375
|
-
*
|
376
|
-
* @param action action to dispatch.
|
377
|
-
*/
|
378
|
-
DaffBillingFacade.prototype.dispatch = function (action) {
|
379
|
-
this.store.dispatch(action);
|
380
|
-
};
|
381
|
-
return DaffBillingFacade;
|
382
|
-
}());
|
383
|
-
/** @nocollapse */ DaffBillingFacade.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffBillingFacade_Factory() { return new DaffBillingFacade(i0.ɵɵinject(i1.Store)); }, token: DaffBillingFacade, providedIn: DaffBillingModule });
|
384
|
-
DaffBillingFacade.decorators = [
|
385
|
-
{ type: i0.Injectable, args: [{
|
386
|
-
providedIn: DaffBillingModule,
|
387
|
-
},] }
|
388
|
-
];
|
389
|
-
/** @nocollapse */
|
390
|
-
DaffBillingFacade.ctorParameters = function () { return [
|
391
|
-
{ type: i1.Store }
|
392
|
-
]; };
|
393
|
-
|
394
|
-
var initialState$2 = {
|
395
|
-
shippingAddress: null,
|
396
|
-
selectedShippingOptionId: null,
|
397
|
-
};
|
398
|
-
function daffShippingReducer(state, action) {
|
399
|
-
if (state === void 0) { state = initialState$2; }
|
400
|
-
switch (action.type) {
|
401
|
-
case exports.DaffShippingActionTypes.UpdateShippingAddressAction:
|
402
|
-
return Object.assign(Object.assign({}, state), { shippingAddress: action.payload });
|
403
|
-
case exports.DaffShippingActionTypes.SelectShippingOptionAction:
|
404
|
-
return Object.assign(Object.assign({}, state), { selectedShippingOptionId: action.payload });
|
405
|
-
default:
|
406
|
-
return state;
|
407
|
-
}
|
408
|
-
}
|
409
|
-
|
410
|
-
var daffShippingReducers = {
|
411
|
-
shipping: daffShippingReducer,
|
412
|
-
};
|
413
|
-
|
414
|
-
var DaffShippingStateModule = /** @class */ (function () {
|
415
|
-
function DaffShippingStateModule() {
|
416
|
-
}
|
417
|
-
return DaffShippingStateModule;
|
418
|
-
}());
|
419
|
-
DaffShippingStateModule.decorators = [
|
420
|
-
{ type: i0.NgModule, args: [{
|
421
|
-
imports: [
|
422
|
-
i1.StoreModule.forFeature('shipping', daffShippingReducers),
|
423
|
-
],
|
424
|
-
},] }
|
425
|
-
];
|
426
|
-
|
427
|
-
var DaffShippingModule = /** @class */ (function () {
|
428
|
-
function DaffShippingModule() {
|
429
|
-
}
|
430
|
-
return DaffShippingModule;
|
431
|
-
}());
|
432
|
-
DaffShippingModule.decorators = [
|
433
|
-
{ type: i0.NgModule, args: [{
|
434
|
-
imports: [
|
435
|
-
common.CommonModule,
|
436
|
-
/**
|
437
|
-
* Ngrx/store
|
438
|
-
*/
|
439
|
-
DaffShippingStateModule,
|
440
|
-
],
|
441
|
-
declarations: [
|
442
|
-
ShippingContainer,
|
443
|
-
],
|
444
|
-
exports: [
|
445
|
-
ShippingContainer,
|
446
|
-
],
|
447
|
-
},] }
|
448
|
-
];
|
449
|
-
|
450
|
-
/**
|
451
|
-
* A facade for accessing state for shipping information.
|
452
|
-
*/
|
453
|
-
var DaffShippingFacade = /** @class */ (function () {
|
454
|
-
function DaffShippingFacade(store) {
|
455
|
-
this.store = store;
|
456
|
-
this.shippingAddress$ = this.store.pipe(i1.select(selectShippingAddress));
|
457
|
-
this.selectedShippingOptionId$ = this.store.pipe(i1.select(selectShippingOptionId));
|
458
|
-
this.isShippingAddressValid$ = this.store.pipe(i1.select(selectIsShippingAddressValid));
|
459
|
-
}
|
460
|
-
/**
|
461
|
-
* Dispatches the given action.
|
462
|
-
*
|
463
|
-
* @param action action to dispatch.
|
464
|
-
*/
|
465
|
-
DaffShippingFacade.prototype.dispatch = function (action) {
|
466
|
-
this.store.dispatch(action);
|
467
|
-
};
|
468
|
-
return DaffShippingFacade;
|
469
|
-
}());
|
470
|
-
/** @nocollapse */ DaffShippingFacade.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffShippingFacade_Factory() { return new DaffShippingFacade(i0.ɵɵinject(i1.Store)); }, token: DaffShippingFacade, providedIn: DaffShippingModule });
|
471
|
-
DaffShippingFacade.decorators = [
|
472
|
-
{ type: i0.Injectable, args: [{
|
473
|
-
providedIn: DaffShippingModule,
|
474
|
-
},] }
|
475
|
-
];
|
476
|
-
/** @nocollapse */
|
477
|
-
DaffShippingFacade.ctorParameters = function () { return [
|
478
|
-
{ type: i1.Store }
|
479
|
-
]; };
|
480
|
-
|
481
|
-
/**
|
482
|
-
* @deprecated
|
483
|
-
*/
|
484
|
-
(function (DaffOrderActionTypes) {
|
485
|
-
DaffOrderActionTypes["PlaceOrderAction"] = "[Order] Place Order Action";
|
486
|
-
DaffOrderActionTypes["PlaceOrderSuccessAction"] = "[Order] Place Order Success Action";
|
487
|
-
DaffOrderActionTypes["PlaceOrderFailureAction"] = "[Order] Place Order Failure Action";
|
488
|
-
})(exports.DaffOrderActionTypes || (exports.DaffOrderActionTypes = {}));
|
489
|
-
(function (OrderActionTypes) {
|
490
|
-
OrderActionTypes["PlaceOrderAction"] = "[Order] Place Order Action";
|
491
|
-
OrderActionTypes["PlaceOrderSuccessAction"] = "[Order] Place Order Success Action";
|
492
|
-
OrderActionTypes["PlaceOrderFailureAction"] = "[Order] Place Order Failure Action";
|
493
|
-
})(exports.OrderActionTypes || (exports.OrderActionTypes = {}));
|
494
|
-
/**
|
495
|
-
* @deprecated
|
496
|
-
*/
|
497
|
-
var PlaceOrder = /** @class */ (function () {
|
498
|
-
function PlaceOrder(payload) {
|
499
|
-
this.payload = payload;
|
500
|
-
this.type = exports.DaffOrderActionTypes.PlaceOrderAction;
|
501
|
-
}
|
502
|
-
return PlaceOrder;
|
503
|
-
}());
|
504
|
-
/**
|
505
|
-
* @deprecated
|
506
|
-
*/
|
507
|
-
var DaffPlaceOrder = /** @class */ (function () {
|
508
|
-
function DaffPlaceOrder(payload) {
|
509
|
-
this.payload = payload;
|
510
|
-
this.type = exports.DaffOrderActionTypes.PlaceOrderAction;
|
511
|
-
}
|
512
|
-
return DaffPlaceOrder;
|
513
|
-
}());
|
514
|
-
/**
|
515
|
-
* @deprecated
|
516
|
-
*/
|
517
|
-
var DaffPlaceOrderSuccess = /** @class */ (function () {
|
518
|
-
function DaffPlaceOrderSuccess(payload) {
|
519
|
-
this.payload = payload;
|
520
|
-
this.type = exports.DaffOrderActionTypes.PlaceOrderSuccessAction;
|
521
|
-
}
|
522
|
-
return DaffPlaceOrderSuccess;
|
523
|
-
}());
|
524
|
-
/**
|
525
|
-
* @deprecated
|
526
|
-
*/
|
527
|
-
var DaffPlaceOrderFailure = /** @class */ (function () {
|
528
|
-
function DaffPlaceOrderFailure(payload) {
|
529
|
-
this.payload = payload;
|
530
|
-
this.type = exports.DaffOrderActionTypes.PlaceOrderFailureAction;
|
531
|
-
}
|
532
|
-
return DaffPlaceOrderFailure;
|
533
|
-
}());
|
534
|
-
|
535
|
-
/**
|
536
|
-
* @deprecated
|
537
|
-
*/
|
538
|
-
var initialState$3 = {
|
539
|
-
order: null,
|
540
|
-
loading: false,
|
541
|
-
errors: [],
|
542
|
-
};
|
543
|
-
/**
|
544
|
-
* @deprecated
|
545
|
-
*/
|
546
|
-
function daffOrderReducer(state, action) {
|
547
|
-
if (state === void 0) { state = initialState$3; }
|
548
|
-
switch (action.type) {
|
549
|
-
case exports.DaffOrderActionTypes.PlaceOrderAction:
|
550
|
-
return Object.assign(Object.assign({}, state), { loading: true });
|
551
|
-
case exports.DaffOrderActionTypes.PlaceOrderSuccessAction:
|
552
|
-
return Object.assign(Object.assign({}, state), { order: action.payload, loading: false });
|
553
|
-
case exports.DaffOrderActionTypes.PlaceOrderFailureAction:
|
554
|
-
return Object.assign(Object.assign({}, state), { errors: [action.payload], loading: false });
|
555
|
-
default:
|
556
|
-
return state;
|
557
|
-
}
|
558
|
-
}
|
559
|
-
|
560
|
-
/**
|
561
|
-
* @deprecated
|
562
|
-
*/
|
563
|
-
var daffOrderReducers = {
|
564
|
-
order: daffOrderReducer,
|
565
|
-
};
|
566
|
-
|
567
|
-
/*! *****************************************************************************
|
568
|
-
Copyright (c) Microsoft Corporation.
|
569
|
-
|
570
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
571
|
-
purpose with or without fee is hereby granted.
|
572
|
-
|
573
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
574
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
575
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
576
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
577
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
578
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
579
|
-
PERFORMANCE OF THIS SOFTWARE.
|
580
|
-
***************************************************************************** */
|
581
|
-
/* global Reflect, Promise */
|
582
|
-
var extendStatics = function (d, b) {
|
583
|
-
extendStatics = Object.setPrototypeOf ||
|
584
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
585
|
-
function (d, b) { for (var p in b)
|
586
|
-
if (Object.prototype.hasOwnProperty.call(b, p))
|
587
|
-
d[p] = b[p]; };
|
588
|
-
return extendStatics(d, b);
|
589
|
-
};
|
590
|
-
function __extends(d, b) {
|
591
|
-
if (typeof b !== "function" && b !== null)
|
592
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
593
|
-
extendStatics(d, b);
|
594
|
-
function __() { this.constructor = d; }
|
595
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
596
|
-
}
|
597
|
-
var __assign = function () {
|
598
|
-
__assign = Object.assign || function __assign(t) {
|
599
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
600
|
-
s = arguments[i];
|
601
|
-
for (var p in s)
|
602
|
-
if (Object.prototype.hasOwnProperty.call(s, p))
|
603
|
-
t[p] = s[p];
|
604
|
-
}
|
605
|
-
return t;
|
606
|
-
};
|
607
|
-
return __assign.apply(this, arguments);
|
608
|
-
};
|
609
|
-
function __rest(s, e) {
|
610
|
-
var t = {};
|
611
|
-
for (var p in s)
|
612
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
613
|
-
t[p] = s[p];
|
614
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
615
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
616
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
617
|
-
t[p[i]] = s[p[i]];
|
618
|
-
}
|
619
|
-
return t;
|
620
|
-
}
|
621
|
-
function __decorate(decorators, target, key, desc) {
|
622
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
623
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
624
|
-
r = Reflect.decorate(decorators, target, key, desc);
|
625
|
-
else
|
626
|
-
for (var i = decorators.length - 1; i >= 0; i--)
|
627
|
-
if (d = decorators[i])
|
628
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
629
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
630
|
-
}
|
631
|
-
function __param(paramIndex, decorator) {
|
632
|
-
return function (target, key) { decorator(target, key, paramIndex); };
|
633
|
-
}
|
634
|
-
function __metadata(metadataKey, metadataValue) {
|
635
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
636
|
-
return Reflect.metadata(metadataKey, metadataValue);
|
637
|
-
}
|
638
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
639
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
640
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
641
|
-
function fulfilled(value) { try {
|
642
|
-
step(generator.next(value));
|
643
|
-
}
|
644
|
-
catch (e) {
|
645
|
-
reject(e);
|
646
|
-
} }
|
647
|
-
function rejected(value) { try {
|
648
|
-
step(generator["throw"](value));
|
649
|
-
}
|
650
|
-
catch (e) {
|
651
|
-
reject(e);
|
652
|
-
} }
|
653
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
654
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
655
|
-
});
|
656
|
-
}
|
657
|
-
function __generator(thisArg, body) {
|
658
|
-
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
659
|
-
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
660
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
661
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
662
|
-
function step(op) {
|
663
|
-
if (f)
|
664
|
-
throw new TypeError("Generator is already executing.");
|
665
|
-
while (_)
|
666
|
-
try {
|
667
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
668
|
-
return t;
|
669
|
-
if (y = 0, t)
|
670
|
-
op = [op[0] & 2, t.value];
|
671
|
-
switch (op[0]) {
|
672
|
-
case 0:
|
673
|
-
case 1:
|
674
|
-
t = op;
|
675
|
-
break;
|
676
|
-
case 4:
|
677
|
-
_.label++;
|
678
|
-
return { value: op[1], done: false };
|
679
|
-
case 5:
|
680
|
-
_.label++;
|
681
|
-
y = op[1];
|
682
|
-
op = [0];
|
683
|
-
continue;
|
684
|
-
case 7:
|
685
|
-
op = _.ops.pop();
|
686
|
-
_.trys.pop();
|
687
|
-
continue;
|
688
|
-
default:
|
689
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
690
|
-
_ = 0;
|
691
|
-
continue;
|
692
|
-
}
|
693
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
694
|
-
_.label = op[1];
|
695
|
-
break;
|
696
|
-
}
|
697
|
-
if (op[0] === 6 && _.label < t[1]) {
|
698
|
-
_.label = t[1];
|
699
|
-
t = op;
|
700
|
-
break;
|
701
|
-
}
|
702
|
-
if (t && _.label < t[2]) {
|
703
|
-
_.label = t[2];
|
704
|
-
_.ops.push(op);
|
705
|
-
break;
|
706
|
-
}
|
707
|
-
if (t[2])
|
708
|
-
_.ops.pop();
|
709
|
-
_.trys.pop();
|
710
|
-
continue;
|
711
|
-
}
|
712
|
-
op = body.call(thisArg, _);
|
713
|
-
}
|
714
|
-
catch (e) {
|
715
|
-
op = [6, e];
|
716
|
-
y = 0;
|
717
|
-
}
|
718
|
-
finally {
|
719
|
-
f = t = 0;
|
720
|
-
}
|
721
|
-
if (op[0] & 5)
|
722
|
-
throw op[1];
|
723
|
-
return { value: op[0] ? op[1] : void 0, done: true };
|
724
|
-
}
|
725
|
-
}
|
726
|
-
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
727
|
-
if (k2 === undefined)
|
728
|
-
k2 = k;
|
729
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
730
|
-
}) : (function (o, m, k, k2) {
|
731
|
-
if (k2 === undefined)
|
732
|
-
k2 = k;
|
733
|
-
o[k2] = m[k];
|
734
|
-
});
|
735
|
-
function __exportStar(m, o) {
|
736
|
-
for (var p in m)
|
737
|
-
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
738
|
-
__createBinding(o, m, p);
|
739
|
-
}
|
740
|
-
function __values(o) {
|
741
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
742
|
-
if (m)
|
743
|
-
return m.call(o);
|
744
|
-
if (o && typeof o.length === "number")
|
745
|
-
return {
|
746
|
-
next: function () {
|
747
|
-
if (o && i >= o.length)
|
748
|
-
o = void 0;
|
749
|
-
return { value: o && o[i++], done: !o };
|
750
|
-
}
|
751
|
-
};
|
752
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
753
|
-
}
|
754
|
-
function __read(o, n) {
|
755
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
756
|
-
if (!m)
|
757
|
-
return o;
|
758
|
-
var i = m.call(o), r, ar = [], e;
|
759
|
-
try {
|
760
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
761
|
-
ar.push(r.value);
|
762
|
-
}
|
763
|
-
catch (error) {
|
764
|
-
e = { error: error };
|
765
|
-
}
|
766
|
-
finally {
|
767
|
-
try {
|
768
|
-
if (r && !r.done && (m = i["return"]))
|
769
|
-
m.call(i);
|
770
|
-
}
|
771
|
-
finally {
|
772
|
-
if (e)
|
773
|
-
throw e.error;
|
774
|
-
}
|
775
|
-
}
|
776
|
-
return ar;
|
777
|
-
}
|
778
|
-
/** @deprecated */
|
779
|
-
function __spread() {
|
780
|
-
for (var ar = [], i = 0; i < arguments.length; i++)
|
781
|
-
ar = ar.concat(__read(arguments[i]));
|
782
|
-
return ar;
|
783
|
-
}
|
784
|
-
/** @deprecated */
|
785
|
-
function __spreadArrays() {
|
786
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
787
|
-
s += arguments[i].length;
|
788
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
789
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
790
|
-
r[k] = a[j];
|
791
|
-
return r;
|
792
|
-
}
|
793
|
-
function __spreadArray(to, from, pack) {
|
794
|
-
if (pack || arguments.length === 2)
|
795
|
-
for (var i = 0, l = from.length, ar; i < l; i++) {
|
796
|
-
if (ar || !(i in from)) {
|
797
|
-
if (!ar)
|
798
|
-
ar = Array.prototype.slice.call(from, 0, i);
|
799
|
-
ar[i] = from[i];
|
800
|
-
}
|
801
|
-
}
|
802
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
803
|
-
}
|
804
|
-
function __await(v) {
|
805
|
-
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
806
|
-
}
|
807
|
-
function __asyncGenerator(thisArg, _arguments, generator) {
|
808
|
-
if (!Symbol.asyncIterator)
|
809
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
810
|
-
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
811
|
-
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
812
|
-
function verb(n) { if (g[n])
|
813
|
-
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
814
|
-
function resume(n, v) { try {
|
815
|
-
step(g[n](v));
|
816
|
-
}
|
817
|
-
catch (e) {
|
818
|
-
settle(q[0][3], e);
|
819
|
-
} }
|
820
|
-
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
821
|
-
function fulfill(value) { resume("next", value); }
|
822
|
-
function reject(value) { resume("throw", value); }
|
823
|
-
function settle(f, v) { if (f(v), q.shift(), q.length)
|
824
|
-
resume(q[0][0], q[0][1]); }
|
825
|
-
}
|
826
|
-
function __asyncDelegator(o) {
|
827
|
-
var i, p;
|
828
|
-
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
829
|
-
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
830
|
-
}
|
831
|
-
function __asyncValues(o) {
|
832
|
-
if (!Symbol.asyncIterator)
|
833
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
834
|
-
var m = o[Symbol.asyncIterator], i;
|
835
|
-
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
836
|
-
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
837
|
-
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
838
|
-
}
|
839
|
-
function __makeTemplateObject(cooked, raw) {
|
840
|
-
if (Object.defineProperty) {
|
841
|
-
Object.defineProperty(cooked, "raw", { value: raw });
|
842
|
-
}
|
843
|
-
else {
|
844
|
-
cooked.raw = raw;
|
845
|
-
}
|
846
|
-
return cooked;
|
847
|
-
}
|
848
|
-
;
|
849
|
-
var __setModuleDefault = Object.create ? (function (o, v) {
|
850
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
851
|
-
}) : function (o, v) {
|
852
|
-
o["default"] = v;
|
853
|
-
};
|
854
|
-
function __importStar(mod) {
|
855
|
-
if (mod && mod.__esModule)
|
856
|
-
return mod;
|
857
|
-
var result = {};
|
858
|
-
if (mod != null)
|
859
|
-
for (var k in mod)
|
860
|
-
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
861
|
-
__createBinding(result, mod, k);
|
862
|
-
__setModuleDefault(result, mod);
|
863
|
-
return result;
|
864
|
-
}
|
865
|
-
function __importDefault(mod) {
|
866
|
-
return (mod && mod.__esModule) ? mod : { default: mod };
|
867
|
-
}
|
868
|
-
function __classPrivateFieldGet(receiver, state, kind, f) {
|
869
|
-
if (kind === "a" && !f)
|
870
|
-
throw new TypeError("Private accessor was defined without a getter");
|
871
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
872
|
-
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
873
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
874
|
-
}
|
875
|
-
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
876
|
-
if (kind === "m")
|
877
|
-
throw new TypeError("Private method is not writable");
|
878
|
-
if (kind === "a" && !f)
|
879
|
-
throw new TypeError("Private accessor was defined without a setter");
|
880
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
881
|
-
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
882
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
883
|
-
}
|
884
|
-
|
885
|
-
var DaffCheckoutDriver = new i0.InjectionToken('DaffCheckoutDriver');
|
886
|
-
|
887
|
-
/**
|
888
|
-
* @deprecated
|
889
|
-
*/
|
890
|
-
var OrderEffects = /** @class */ (function () {
|
891
|
-
function OrderEffects(actions$, checkoutDriver) {
|
892
|
-
var _this = this;
|
893
|
-
this.actions$ = actions$;
|
894
|
-
this.checkoutDriver = checkoutDriver;
|
895
|
-
this.onPlaceOrder$ = this.actions$.pipe(effects.ofType(exports.DaffOrderActionTypes.PlaceOrderAction), operators.switchMap(function (action) { return _this.checkoutDriver.placeOrder(action.payload.id.toString())
|
896
|
-
.pipe(operators.map(function (resp) { return new DaffPlaceOrderSuccess(resp); }), operators.catchError(function (error) { return rxjs.of(new DaffPlaceOrderFailure('Failed to place order')); })); }));
|
897
|
-
}
|
898
|
-
return OrderEffects;
|
899
|
-
}());
|
900
|
-
OrderEffects.decorators = [
|
901
|
-
{ type: i0.Injectable }
|
902
|
-
];
|
903
|
-
/** @nocollapse */
|
904
|
-
OrderEffects.ctorParameters = function () { return [
|
905
|
-
{ type: effects.Actions },
|
906
|
-
{ type: undefined, decorators: [{ type: i0.Inject, args: [DaffCheckoutDriver,] }] }
|
907
|
-
]; };
|
908
|
-
__decorate([
|
909
|
-
effects.Effect(),
|
910
|
-
__metadata("design:type", rxjs.Observable)
|
911
|
-
], OrderEffects.prototype, "onPlaceOrder$", void 0);
|
912
|
-
|
913
|
-
/**
|
914
|
-
* @deprecated
|
915
|
-
*/
|
916
|
-
var DaffOrderStateModule = /** @class */ (function () {
|
917
|
-
function DaffOrderStateModule() {
|
918
|
-
}
|
919
|
-
return DaffOrderStateModule;
|
920
|
-
}());
|
921
|
-
DaffOrderStateModule.decorators = [
|
922
|
-
{ type: i0.NgModule, args: [{
|
923
|
-
imports: [
|
924
|
-
i1.StoreModule.forFeature('order', daffOrderReducers),
|
925
|
-
effects.EffectsModule.forFeature([
|
926
|
-
OrderEffects,
|
927
|
-
]),
|
928
|
-
],
|
929
|
-
},] }
|
930
|
-
];
|
931
|
-
|
932
|
-
/**
|
933
|
-
* @deprecated
|
934
|
-
*/
|
935
|
-
var DaffOrderModule = /** @class */ (function () {
|
936
|
-
function DaffOrderModule() {
|
937
|
-
}
|
938
|
-
return DaffOrderModule;
|
939
|
-
}());
|
940
|
-
DaffOrderModule.decorators = [
|
941
|
-
{ type: i0.NgModule, args: [{
|
942
|
-
imports: [
|
943
|
-
common.CommonModule,
|
944
|
-
/**
|
945
|
-
* Ngrx/store
|
946
|
-
*/
|
947
|
-
DaffOrderStateModule,
|
948
|
-
],
|
949
|
-
declarations: [
|
950
|
-
OrderContainer,
|
951
|
-
],
|
952
|
-
exports: [
|
953
|
-
OrderContainer,
|
954
|
-
],
|
955
|
-
},] }
|
956
|
-
];
|
957
|
-
|
958
|
-
/**
|
959
|
-
* A facade for accessing state for the currently selected category.
|
960
|
-
*/
|
961
|
-
/**
|
962
|
-
* @deprecated
|
963
|
-
*/
|
964
|
-
var DaffOrderFacade = /** @class */ (function () {
|
965
|
-
function DaffOrderFacade(store) {
|
966
|
-
this.store = store;
|
967
|
-
this.order$ = this.store.pipe(i1.select(selectOrder));
|
968
|
-
this.loading$ = this.store.pipe(i1.select(selectLoading));
|
969
|
-
this.errors$ = this.store.pipe(i1.select(selectErrors));
|
970
|
-
}
|
971
|
-
/**
|
972
|
-
* Dispatches the given action.
|
973
|
-
*
|
974
|
-
* @param action action to dispatch.
|
975
|
-
*/
|
976
|
-
DaffOrderFacade.prototype.dispatch = function (action) {
|
977
|
-
this.store.dispatch(action);
|
978
|
-
};
|
979
|
-
return DaffOrderFacade;
|
980
|
-
}());
|
981
|
-
/** @nocollapse */ DaffOrderFacade.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffOrderFacade_Factory() { return new DaffOrderFacade(i0.ɵɵinject(i1.Store)); }, token: DaffOrderFacade, providedIn: DaffOrderModule });
|
982
|
-
DaffOrderFacade.decorators = [
|
983
|
-
{ type: i0.Injectable, args: [{
|
984
|
-
providedIn: DaffOrderModule,
|
985
|
-
},] }
|
986
|
-
];
|
987
|
-
/** @nocollapse */
|
988
|
-
DaffOrderFacade.ctorParameters = function () { return [
|
989
|
-
{ type: i1.Store }
|
990
|
-
]; };
|
991
|
-
|
992
|
-
var StateCheckoutModule = /** @class */ (function () {
|
993
|
-
function StateCheckoutModule() {
|
994
|
-
}
|
995
|
-
return StateCheckoutModule;
|
996
|
-
}());
|
997
|
-
StateCheckoutModule.decorators = [
|
998
|
-
{ type: i0.NgModule, args: [{
|
999
|
-
imports: [
|
1000
|
-
common.CommonModule,
|
1001
|
-
DaffShippingModule,
|
1002
|
-
DaffPaymentModule,
|
1003
|
-
DaffBillingModule,
|
1004
|
-
DaffOrderModule,
|
1005
|
-
],
|
1006
|
-
exports: [
|
1007
|
-
DaffShippingModule,
|
1008
|
-
DaffPaymentModule,
|
1009
|
-
DaffBillingModule,
|
1010
|
-
DaffOrderModule,
|
1011
|
-
],
|
1012
|
-
},] }
|
1013
|
-
];
|
1014
|
-
|
1015
|
-
/**
|
1016
|
-
* Generated bundle index. Do not edit.
|
1017
|
-
*/
|
1018
|
-
|
1019
|
-
exports.BillingContainer = BillingContainer;
|
1020
|
-
exports.DaffBillingFacade = DaffBillingFacade;
|
1021
|
-
exports.DaffBillingModule = DaffBillingModule;
|
1022
|
-
exports.DaffCheckoutDriver = DaffCheckoutDriver;
|
1023
|
-
exports.DaffOrderDriver = DaffOrderDriver;
|
1024
|
-
exports.DaffOrderFacade = DaffOrderFacade;
|
1025
|
-
exports.DaffOrderModule = DaffOrderModule;
|
1026
|
-
exports.DaffPaymentDriver = DaffPaymentDriver;
|
1027
|
-
exports.DaffPaymentFacade = DaffPaymentFacade;
|
1028
|
-
exports.DaffPaymentModule = DaffPaymentModule;
|
1029
|
-
exports.DaffPaymentTransformer = DaffPaymentTransformer;
|
1030
|
-
exports.DaffPlaceOrder = DaffPlaceOrder;
|
1031
|
-
exports.DaffPlaceOrderFailure = DaffPlaceOrderFailure;
|
1032
|
-
exports.DaffPlaceOrderSuccess = DaffPlaceOrderSuccess;
|
1033
|
-
exports.DaffSelectShippingOption = DaffSelectShippingOption;
|
1034
|
-
exports.DaffShippingFacade = DaffShippingFacade;
|
1035
|
-
exports.DaffShippingModule = DaffShippingModule;
|
1036
|
-
exports.DaffToggleBillingAddressIsShippingAddress = DaffToggleBillingAddressIsShippingAddress;
|
1037
|
-
exports.DaffUpdateBillingAddress = DaffUpdateBillingAddress;
|
1038
|
-
exports.DaffUpdatePaymentInfo = DaffUpdatePaymentInfo;
|
1039
|
-
exports.DaffUpdateShippingAddress = DaffUpdateShippingAddress;
|
1040
|
-
exports.OrderContainer = OrderContainer;
|
1041
|
-
exports.PlaceOrder = PlaceOrder;
|
1042
|
-
exports.ShippingContainer = ShippingContainer;
|
1043
|
-
exports.StateCheckoutModule = StateCheckoutModule;
|
1044
|
-
exports.daffBillingReducer = daffBillingReducer;
|
1045
|
-
exports.daffBillingReducers = daffBillingReducers;
|
1046
|
-
exports.daffOrderReducer = daffOrderReducer;
|
1047
|
-
exports.daffOrderReducers = daffOrderReducers;
|
1048
|
-
exports.daffPaymentReducers = daffPaymentReducers;
|
1049
|
-
exports.daffShippingReducer = daffShippingReducer;
|
1050
|
-
exports.daffShippingReducers = daffShippingReducers;
|
1051
|
-
exports.selectBillingAddress = selectBillingAddress;
|
1052
|
-
exports.selectBillingAddressIsShippingAddress = selectBillingAddressIsShippingAddress;
|
1053
|
-
exports.selectBillingFeatureState = selectBillingFeatureState;
|
1054
|
-
exports.selectBillingState = selectBillingState;
|
1055
|
-
exports.selectErrors = selectErrors;
|
1056
|
-
exports.selectIsShippingAddressValid = selectIsShippingAddressValid;
|
1057
|
-
exports.selectLoading = selectLoading;
|
1058
|
-
exports.selectOrder = selectOrder;
|
1059
|
-
exports.selectOrderFeatureState = selectOrderFeatureState;
|
1060
|
-
exports.selectOrderState = selectOrderState;
|
1061
|
-
exports.selectPaymentFeatureState = selectPaymentFeatureState;
|
1062
|
-
exports.selectPaymentInfo = selectPaymentInfo;
|
1063
|
-
exports.selectPaymentState = selectPaymentState;
|
1064
|
-
exports.selectShippingAddress = selectShippingAddress;
|
1065
|
-
exports.selectShippingFeatureState = selectShippingFeatureState;
|
1066
|
-
exports.selectShippingOptionId = selectShippingOptionId;
|
1067
|
-
exports.selectShippingState = selectShippingState;
|
1068
|
-
exports.ɵa = DaffPaymentStateModule;
|
1069
|
-
exports.ɵb = daffPaymentReducer;
|
1070
|
-
exports.ɵd = DaffBillingStateModule;
|
1071
|
-
exports.ɵe = DaffShippingStateModule;
|
1072
|
-
exports.ɵf = DaffOrderStateModule;
|
1073
|
-
exports.ɵg = OrderEffects;
|
1074
|
-
|
1075
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
1076
|
-
|
1077
|
-
})));
|
1078
|
-
//# sourceMappingURL=daffodil-checkout.umd.js.map
|