!function(){"use strict";var t=[];angular.module("webshop.shoppingcart.options",[]).constant("OptionsConstants",{FILES:t})}(),function(){angular.module("webshop.shoppingcart.options.templates",[]).run(["$templateCache",function(t){t.put("/toggleGroupOptionTemplate",' \n

\n in behandeling voor\n {{toggleGroupOptionCtrl.getPendingChange()}}\n (geldig vanaf 00:00)\n

\n'),t.put("/toggleGroupOptionItemTemplate",' \n'),t.put("/toggleOptionTemplate",'
\n in behandeling...\n
\n
\n \n
\n
\n
\n \n \n
\n
\n \n
\n
\n'),t.put("/myProximusOverlayerDialogTemplate",'
\n
\n

\n Je staat op het punt te stoppen met:\n

\n

\n Je staat op het punt om te bestellen:\n

\n\n

\n Je staat op het punt om te bestellen:\n

\n\n

\n Je staat op het punt te stoppen met:\n

\n\n

\n Je staat op het punt om te vervangen:\n

\n\n
\n

\n {{incompatibleProduct}}\n \n door\n \n

\n

\n door\n

\n
\n
\n
\n
\n

{{product.description}}

\n
\n
\n \n
\n
\n
\n
\n
\n
\n \n
\n
\n
\n
\n \n
\n \n \n
\n
\n
\n
\n
\n

Je bestelling is in behandeling

\n
\n
\n
\n
\n \n Wij behandelen momenteel je vorige aanvraag. Gelieve deze af te wachten vooraleer een nieuwe bestelling te plaatsen. Alvast bedankt voor je begrip.\n \n
\n \n
\n')}])}(),function(){"use strict";function t(t,n){function e(){t.listenMyProximusOverlayer(r)}function i(){n.handleEvent.apply(this,arguments)}function r(t,n){i(t,"/myProximusOverlayerDialogTemplate","myProximusOverlayerDialogController","static",!1,n,"slide-in-down")}var o={init:e};return o}t.$inject=["EventService","DialogService"],angular.module("webshop.shoppingcart.options").factory("OptionDialogService",t)}(),function(){"use strict";function t(t,n){function e(){var t=void 0;return i.products&&i.products.forEach(function(e){(e.isLocked||n.isOptionPresentInCart(e,i.installationId,i.serviceId))&&(t=e.name)}),t}var i=this;i["class"]=t["class"],i.installationId=t.installationid,i.serviceId=t.serviceid,i.products=t.products,i.plc=t.plc?t.plc:"MV",i.getPendingChange=e}t.$inject=["$scope","OptionService"],angular.module("webshop.shoppingcart.options").controller("toggleGroupOptionController",t)}(),function(){"use strict";function t(){var t={templateUrl:"/toggleGroupOptionTemplate",transclude:!0,controller:"toggleGroupOptionController",controllerAs:"toggleGroupOptionCtrl",scope:{installationid:"@",serviceid:"@",products:"=",plc:"@","class":"@"}};return t}angular.module("webshop.shoppingcart.options").directive("webshopToggleGroupOption",t)}(),function(){"use strict";function t(t,n,e,i){function r(){s()?e.emitMyProximusOverlayer({pendingOrders:s()},{cartId:u||g}):(n.handleClickEvent(v,u,g),l=!0,O.isActive||n.activateOption(v,u,g,m,f)["catch"](angular.noop)["finally"](d))}function o(){return t.haspendingchange||l}function a(){return p}function s(){return C}function c(){n.initializeOptionsCart(u,g,f)["catch"](angular.noop)["finally"](d),e.onCartFetched().subscribe(d),e.onPendingOrdersError().subscribe(function(){C=!0})}function d(){l=!1}var l=!0,p=i.getUniqueIdentifier(),u=t.installationid,g=t.serviceid,v=t.product,f=t.plc?t.plc:"MV",m=t.isactive,C=!1,O=this;O.isActive=m,O.product=v,O.toggle=r,O.isDisabled=o,O.getUniqueIdentifier=a,O.hasPendingOrders=s,c()}t.$inject=["$scope","OptionService","EventService","UniqueIdentifierService"],angular.module("webshop.shoppingcart.options").controller("toggleGroupOptionItemController",t)}(),function(){"use strict";function t(){var t={templateUrl:"/toggleGroupOptionItemTemplate",transclude:!0,controller:"toggleGroupOptionItemController",controllerAs:"toggleGroupOptionItemCtrl",scope:{installationid:"@",serviceid:"@",product:"=",plc:"@",isactive:"=",haspendingchange:"="}};return t}angular.module("webshop.shoppingcart.options").directive("webshopToggleGroupOptionItem",t)}(),function(){"use strict";function t(t,n,e,i,r){function o(){var t={product:b,installationId:O,serviceId:h,isActiveInInstallbase:T?!E:E,plc:I,isReverse:T};n.handleClickEvent(b,O,h),A=!0,f(),G.isOn?T?C(t):m(t):S===!1?(n.handleProductNotCeasable(b,O,h),v()):T?m(t):C(t)}function a(){return A}function s(){return y||R}function c(){return w}function d(){return G.pendingOrders}function l(){d()&&e.emitMyProximusOverlayer({pendingOrders:!0},{cartId:O||h})}function p(){return P}function u(){G.isOn=!0,d()?l():o()}function g(){n.initializeOptionsCart(O,h,I)["catch"](angular.noop)["finally"](v),e.onCartFetched().subscribe(v),e.onPendingOrdersError().subscribe(function(){G.pendingOrders=!0})}function v(){$&&r.cancel($),G.displaySpinner=!1,G.isOn=E,R=n.isOptionPresentInCart(b,O,h),A=!1}function f(){$=r(function(){G.displaySpinner=!0},D)}function m(t){n.activateOption(t.product,t.installationId,t.serviceId,t.isActiveInInstallbase,t.plc,t.isReverse)["catch"](angular.noop)["finally"](v)}function C(t){n.deactivateOption(t.product,t.installationId,t.serviceId,t.isActiveInInstallbase,t.plc,t.isReverse)["catch"](angular.noop)["finally"](v)}var O=t.installationid,h=t.serviceid,b=t.product,I=t.plc?t.plc:"MV",P=!!t.showorderbutton&&t.showorderbutton,E=!P&&t.isactive,S=t.isceasable,y=t.islocked,T=!!t.isreverse&&t.isreverse,w=i.getUniqueIdentifier(),A=!0,R=!1,$=null,D=500,G=this;G["class"]=t["class"]?t["class"]:"rs-switch rs-no-margin-bottom",G.isOn=E,G.pendingOrders=!1,G.displaySpinner=!1,G.toggle=o,G.isDisabled=a,G.isPending=s,G.hasPendingOrders=d,G.getUniqueIdentifier=c,G.togglePendingOrders=l,G.mustShowOrderButton=p,G.order=u,g()}t.$inject=["$scope","OptionService","EventService","UniqueIdentifierService","$timeout"],angular.module("webshop.shoppingcart.options").controller("toggleOptionController",t)}(),function(){"use strict";function t(){var t={templateUrl:"/toggleOptionTemplate",controller:"toggleOptionController",controllerAs:"toggleOptionCtrl",scope:{installationid:"@",serviceid:"@",product:"=",plc:"@","class":"@",isactive:"=",isceasable:"=",islocked:"=",isreverse:"=",showorderbutton:"="}};return t}angular.module("webshop.shoppingcart.options").directive("webshopToggleOption",t)}(),function(){"use strict";function t(t,n,e,i){var r={};r[e.CONTEXT]=n.MY_PRODUCTS;var o={requestHeaders:["language","proximusContentType","userId","etag","encryptionKey","customHeaders"],customHeaders:r};t.setApplicationVersion(i.APP_NAME_MY_PRODUCTS,i.APP_VERSION,!1),t.setDefaultEntityConfiguration(o)}t.$inject=["$entityManagerProvider","SpecialEvent","HttpHeadersConstants","WebshopConstants"],angular.module("webshop.shoppingcart.options").config(t)}(),function(){"use strict";function t(t,n){function e(e,i){t.emit(g(e,i.uuid,f.PROVIDE),n.buildBundledProduct(i))}function i(e,i){t.emit(g(e,i.uuid,f.CEASE),n.buildBundledProduct(i))}function r(n,e,i){t.emitError(g(n,e,f.PROVIDE),i)}function o(n,e,i,r){if(5==arguments.length)throw new Error("method signature is: subscribeToOrderEvent(identifierId, mpcUuid, onNext, onError)");t.listen(g(n,e,f.PROVIDE),i,r)}function a(n,e,i){t.emitError(g(n,e,f.CEASE),i)}function s(n,e,i,r){t.listen(g(n,e,f.CEASE),i,r)}function c(n,e,i){t.emit(g(n,e,f.CLOSE),i)}function d(n,e,i){t.emitError(g(n,e,f.CLOSE),i)}function l(n,e,i,r){t.listen(g(n,e,f.CLOSE),i,r)}function p(n,e){t.listen(n,e)}function u(e,i){t.emit(g(e,i.mpcUuid,f.CLICK),n.buildBundledProduct(i))}function g(t,n,e){return t+"-"+n+"-"+e+"-EVENT"}var v={emitOrderSuccessEvent:e,emitOrderSuccessCeaseEvent:i,emitOrderErrorEvent:r,subscribeToOrderEvent:o,emitCeaseOrderErrorEvent:a,subscribeToCeaseOrderEvent:s,emitClosePopupEvent:c,emitClosePopupErrorEvent:d,subscribeToCloseEvent:l,subscribeToEvent:p,emitClickEvent:u},f={CLOSE:"CLOSE",PROVIDE:"PROVIDE",CEASE:"CEASE",CLICK:"CLICK"};return v}t.$inject=["EventService","BundledProductsService"],angular.module("webshop.shoppingcart.options").factory("OptionEventService",t)}(),function(){"use strict";function t(t,n){function e(){t.init(),n.init()}try{e()}catch(i){console.error(i)}}t.$inject=["OptionDialogService","OptionService"],angular.module("webshop.shoppingcart.options.init",["webshop.shoppingcart.options"]).run(t)}(),function(){"use strict";function t(t,n,e,i,r){function o(o,a,c){var l=t.defer(),p=s(o,a,c),u=e.createEntity(d.optionsCart,p);return u.value={},e.saveEntity(u,p).subscribe(function(t){r.saveCartEntityJwtToken(t).then(function(){var n=t.value;i.setCart(n),l.resolve(n)})["catch"](function(){l.reject("Cart JWT save failed")})},function(t){var e=t?t.errorData:void 0;n.error("Error when creating cart with installationId: "+o+" and serviceId: "+a,e),l.reject(e)}),l.promise}function a(o,a,c){var l=t.defer(),p=s(o,a,c);return e.getEntity(d.optionsCart,p).subscribe(function(t){204===t.status?l.reject({httpStatus:t.status,msg:"not found"}):r.saveCartEntityJwtToken(t).then(function(){var n=t.value;i.setCart(n),l.resolve(n)})["catch"](l.reject)},function(t){var e=t?t.errorData:void 0;t&&409===t.status?l.reject(t):(n.error("Error when finding cart with installationId: "+o+" and serviceId: "+a,e),l.reject(e))}),l.promise}function s(t,n,e){var i={};return t?i.installationPointId=t:n&&(i.serviceId=n),e&&(i.productLineClassification=e),i}var c={createCart:o,findCart:a},d={optionsCart:{url:"/rest/shopping-basket/optionsCarts{?installationPointId,serviceId,productLineClassification}",rel:"sc:optionsCart",version:"v1",requiredJwts:["x-application-authorization-cart{identifier}"],uniqueJwts:["x-application-authorization-cart"],uniqueIdentifier:"cartId",dataStrategy:proximusConfig.DATASTRATEGY.PROXY_STORAGE,storageStrategy:proximusConfig.STORAGESTRATEGY.NONE,storageStrategyJwts:proximusConfig.STORAGESTRATEGY.LOCALSTORAGE}};return c._entitiesConfig=d,c}t.$inject=["$q","$log","$entityManager","CartService","CartJwtService"],angular.module("webshop.shoppingcart.options").factory("OptionRepository",t)}(),function(){"use strict";function t(t,n,e,i,r,o,a,s,c,d){function l(n,e,i){return w(n,e)?t.resolve():P(n,e,i).then(function(t){return r.fetchCart(t.cartId)})["catch"](angular.noop)}function p(n,r,c,d,l,p){var u=S(n),g=r||c;return y(r,c,l).then(function(t){if(d){var n=A(u,t.ceasedCartItems);return e.removeProductCommand(n,t).then(function(){a.emitOrderSuccessEvent(g,n)})["catch"](angular.noop)}return i.addProduct(u,t,o.MY_PRODUCTS,void 0,s.ACTION.PROVIDE,void 0,void 0,p)})["catch"](function(n){return a.emitOrderErrorEvent(g,u.mpcUuid,n),t.reject(n)})}function u(n,r,c,d,l,p){var u=S(n),g=r||c;return y(r,c,l).then(function(t){if(d)return i.addProduct(u,t,o.MY_PRODUCTS,void 0,s.ACTION.CEASE,void 0,void 0,p);var n=A(u,t.cartItems);return e.removeProductCommand(n,t).then(function(){a.emitOrderSuccessCeaseEvent(g,n)})["catch"](angular.noop)})["catch"](function(n){return a.emitOrderErrorEvent(g,u.mpcUuid,n),t.reject(n)})}function g(t,n,e){a.emitCeaseOrderErrorEvent(n||e,t.mpcUuid,G)}function v(t,n,e){a.emitClickEvent(n||e,t)}function f(t,n,e,i){var r=w(n,e),o=S(t);return(!r||!R(o,r.ceasedCartItems))&&(i||r&&R(o,r.cartItems))}function m(t){for(var n in $.installationIdsToCartIds)if($.installationIdsToCartIds[n]===t)return n}function C(t){for(var n in $.serviceIdsToCartIds)if($.serviceIdsToCartIds[n]===t)return n}function O(){d.listenCeaseProductNotAllowed(h)}function h(t,n){var i=r.getCart(n.cart.cartId),o=e.findRootProduct(i,n.productId),s=m(i.cartId),d=C(i.cartId);a.emitCeaseOrderErrorEvent(s||d,o.uuid,D),c.invokeGenericAction(n.ACTION,i)}function b(t,n,e){var i=w(n,e),r=S(t);return i&&(R(r,i.ceasedCartItems)||R(r,i.cartItems))}function I(t){var n=S(t);return e.isDigitalis(n)}function P(e,i,r){return n.findCart(e,i,r).then(function(t){return E(e,i,t)})["catch"](function(n){return n&&409===n.status&&d.emitPendingOrdersError(),t.reject(n)})}function E(t,n,e){return t&&($.installationIdsToCartIds[t]=e.cartId),n&&($.serviceIdsToCartIds[n]=e.cartId),e}function S(t){return _.isString(t)?JSON.parse(t.split("'").join('"')):t}function y(e,i,r){return T(e,i,r)["catch"](function(o){return o&&409===o.status?(d.emitPendingOrdersError(),t.reject(o)):n.createCart(e,i,r).then(function(t){return E(e,i,t)})["catch"](angular.noop)})}function T(n,e,i){var r=w(n,e);return r?t.resolve(r):P(n,e,i)}function w(t,n){var e=$.installationIdsToCartIds[t]?$.installationIdsToCartIds[t]:$.serviceIdsToCartIds[n];if(e)return r.getCart(e)}function A(t,n){if(n){var i=e.getRootProducts(n);return e.findFirst(i,function(n){return n.uuid===t.mpcUuid&&n.price.chargeEvent===t.chargeEvent&&n.price.chargeCode===t.chargeCode})}}function R(t,n){return!!A(t,n)}var $={installationIdsToCartIds:{},serviceIdsToCartIds:{}},D="CEASE_PRODUCT_NOT_ALLOWED",G="PRODUCT_NOT_CEASABLE",x={initializeOptionsCart:l,activateOption:p,deactivateOption:u,handleProductNotCeasable:g,handleClickEvent:v,isOptionActive:f,isOptionPresentInCart:b,isDigitalisOption:I,getInstallationIdFromCartId:m,getServiceIdFromCartId:C,init:O,_setCart:E,_getCart:w,_findCart:T,_handleCeaseProductNotAllowed:h};return x}t.$inject=["$q","OptionRepository","ProductService","AddToCartService","CartService","SpecialEvent","OptionEventService","WebshopConstants","ActionService","EventService"],angular.module("webshop.shoppingcart.options").factory("OptionService",t)}(),function(){"use strict";function t(t,n,e,i,r,o,a,s,c,d,l){function p(){return O.incompatibleProductsNames&&_.isArray(O.incompatibleProductsNames)&&O.incompatibleProductsNames.length>0}function u(){O.acceptTermsAndConditions.userAnswer&&(i.close(),s.invokeGenericAction(O.confirmAction,O.cart).then(function(){d.emitOrderSuccessEvent(O.identifierId,O.product)})["catch"](function(t){d.emitOrderErrorEvent(O.identifierId,O.product.uuid,t)}))}function g(){return i.close(),n.dispatch(a.DELETE_PRODUCT.EVENT,{args:{product:O.product,cart:O.cart}}).then(function(){d.emitClosePopupEvent(O.identifierId,O.product.uuid,{})})["catch"](function(t){d.emitClosePopupErrorEvent(O.identifierId,O.product.uuid,t)})}function v(){return C()&&o.showFrequency(O.product.price)}function f(){return C()&&o.updateCalculatedPrice(O.product.price)}function m(){return o.getWebDeal(O.product.price)}function C(){return O.product&&O.product.price}var O=e;O.confirmProduct=u,O.deleteProduct=g,O.hasIncompatibleProducts=p,O.showFrequency=v,O.getPrice=f,O.getWebDeal=m,O.closeDialog=i.close,O.acceptTermsAndConditions={userAnswer:void 0},O.cart=t?t.cart:null,O.incompatibleProductsNames=t.incompatibleProductsNames,O.confirmAction=t.confirmAction,O.product=r.findRootProduct(t.cart,t.productId),O.provide=t.provide,O.isReverseOrdering=t.isReverseOrdering,O.pendingOrders=t.pendingOrders,O.identifierId=l.getInstallationIdFromCartId(O.cart.cartId)||l.getServiceIdFromCartId(O.cart.cartId),O.confirmAction&&O.product&&O.cart||O.pendingOrders||(c.error("invalid modal config, will close",t),i.close())}t.$inject=["args","$commangular","$scope","DialogService","ProductService","PriceService","ShoppingCartCoreCommandConfig","ActionService","$log","OptionEventService","OptionService"],angular.module("webshop.shoppingcart.options").controller("myProximusOverlayerDialogController",t)}(); //# sourceMappingURL=options.webshop.process.js.map