File manager - Edit - /home/web/vm-3fadc827.na4u.ru/www/bitrix/modules/sale/install/js/sale/checkout/provider/rest/dist/rest.bundle.min.js
Back
this.BX=this.BX||{};this.BX.Sale=this.BX.Sale||{};this.BX.Sale.Checkout=this.BX.Sale.Checkout||{};(function(e,t,r,a){"use strict";var i=function(){babelHelpers.createClass(e,null,[{key:"create",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return new this(t)}}]);function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};babelHelpers.classCallCheck(this,e);if(babelHelpers.typeof(t.store)==="object"&&t.store){this.store=t.store}}babelHelpers.createClass(e,[{key:"execute",value:function e(t,r){var a=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};t="handle"+t.split(".").map(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}).join("");if(r.error){if(typeof this[t+"Error"]==="function"){return this[t+"Error"](r.error,a)}}else{if(typeof this[t+"Success"]==="function"){return this[t+"Success"](r.data,a)}}return typeof this[t]==="function"?this[t](r,a):null}}]);return e}();function s(e,t,r){if(!t.has(e)){throw new TypeError("attempted to get private field on non-instance")}return r}var n=new WeakSet;var l=new WeakSet;var o=new WeakSet;var c=new WeakSet;var u=new WeakSet;var d=new WeakSet;var p=new WeakSet;var f=new WeakSet;var v=new WeakSet;var h=new WeakSet;var b=new WeakSet;var y=new WeakSet;var m=new WeakSet;var k=new WeakSet;var T=new WeakSet;var P=new WeakSet;var g=new WeakSet;var E=new WeakSet;var I=new WeakSet;var S=function(e){babelHelpers.inherits(i,e);function i(){var e;var t;babelHelpers.classCallCheck(this,i);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++){a[s]=arguments[s]}t=babelHelpers.possibleConstructorReturn(this,(e=babelHelpers.getPrototypeOf(i)).call.apply(e,[this].concat(a)));I.add(babelHelpers.assertThisInitialized(t));E.add(babelHelpers.assertThisInitialized(t));g.add(babelHelpers.assertThisInitialized(t));P.add(babelHelpers.assertThisInitialized(t));T.add(babelHelpers.assertThisInitialized(t));k.add(babelHelpers.assertThisInitialized(t));m.add(babelHelpers.assertThisInitialized(t));y.add(babelHelpers.assertThisInitialized(t));b.add(babelHelpers.assertThisInitialized(t));h.add(babelHelpers.assertThisInitialized(t));v.add(babelHelpers.assertThisInitialized(t));f.add(babelHelpers.assertThisInitialized(t));p.add(babelHelpers.assertThisInitialized(t));d.add(babelHelpers.assertThisInitialized(t));u.add(babelHelpers.assertThisInitialized(t));c.add(babelHelpers.assertThisInitialized(t));o.add(babelHelpers.assertThisInitialized(t));l.add(babelHelpers.assertThisInitialized(t));n.add(babelHelpers.assertThisInitialized(t));return t}babelHelpers.createClass(i,[{key:"handleRecalculateBasket",value:function e(t,i){var c=this;return new Promise(function(e,u){if(t.data.needFullRecalculation==="Y"){r.EventEmitter.emit(a.EventType.basket.needRefresh,{})}var d=c.store.getters["basket/getNeedRefresh"];s(c,o,O).call(c,t.data,i).then(function(){return e()});s(c,l,H).call(c,t.data).then(function(){return e()});if(d==="Y"){if(i.isEmpty()){s(c,n,w).call(c,t.data,i);r.EventEmitter.emit(a.EventType.basket.refreshAfter,{})}}})}},{key:"handleSaveOrderSuccess",value:function e(t){var i=this;r.EventEmitter.emit(a.EventType.order.success);this.store.dispatch("application/setStage",{stage:a.Application.stage.success});this.store.dispatch("order/set",{id:t.order.id,hash:t.hash,accountNumber:t.order.accountNumber});return s(this,P,N).call(this,t).then(function(){return s(i,T,q).call(i,t)})}},{key:"handleSaveOrderError",value:function e(r){var i=this;return new Promise(function(e,n){if(t.Type.isArrayFilled(r)){var l=s(i,I,L).call(i,r);var o=s(i,E,F).call(i,r);if(l.length>0){i.store.commit("application/setErrors",l)}else{i.store.commit("application/clearErrors")}if(o.length>0){i.store.commit("property/setErrors",o);i.store.getters["property/getProperty"].forEach(function(e,t){if(typeof o.find(function(t){return t.propertyId===e.id})!=="undefined"){e.validated=a.Property.validate.failure}else{if(e.validated!==a.Property.validate.unvalidated){e.validated=a.Property.validate.successful}}i.store.dispatch("property/changeItem",{index:t,fields:e})})}else{i.store.commit("property/clearErrors");i.store.getters["property/getProperty"].forEach(function(e,t){if(e.validated!==a.Property.validate.unvalidated){e.validated=a.Property.validate.successful}i.store.dispatch("property/changeItem",{index:t,fields:e})})}}})}}]);return i}(i);var w=function e(r,a){var i=this;return new Promise(function(e,a){if(t.Type.isObject(r)&&t.Type.isArray(r.basketItems)){var n=r.basketItems;var l=i.store.getters["basket/getBasket"];l.forEach(function(e,r){var a=s(i,h,X).call(i,e.id,n);if(t.Type.isObject(a)){var l=s(i,y,A).call(i,a);s(i,b,x).call(i,l,r)}});if(t.Type.isObject(r)&&t.Type.isObject(r.orderPriceTotal)){s(i,m,R).call(i,r);s(i,k,D).call(i,r)}}e()})};var H=function e(r){var a=this;return new Promise(function(e,i){if(t.Type.isObject(r)&&t.Type.isObject(r.actions)){var n=r.actions;var l=a.store.getters["basket/getBasket"];var o=s(a,g,U).call(a,l,n);if(o.length>0){a.store.commit("basket/setErrors",o)}else{a.store.commit("basket/clearErrors")}}e()})};var O=function e(i,n){var l=this;return new Promise(function(e,o){if(t.Type.isObject(i)&&t.Type.isArray(i.basketItems)){var c=i.basketItems;var u=i.actions;var d=l.store.getters["basket/getBasket"];var v=n.get();d.forEach(function(e,i){var n;var o=s(l,p,j).call(l,u,i);if(t.Type.isString(o)){if(o===a.Pool.action.quantity){n=null;var d=s(l,f,B).call(l,i,a.Pool.action.quantity,v);if(d===false){n=s(l,h,X).call(l,e.id,c)}}else if(o===a.Pool.action.restore){n=s(l,h,X).call(l,u[i].fields.id,c)}else if(o===a.Pool.action.delete){e.status=a.Loader.status.none;s(l,b,x).call(l,e,i).then(function(){return r.EventEmitter.emit(a.EventType.basket.removeProduct,{index:i})})}else if(o===a.Pool.action.offer){n=null;var m=s(l,f,B).call(l,i,a.Pool.action.offer,v);if(m===false){n=s(l,h,X).call(l,e.id,c)}}if(t.Type.isObject(n)){var k=s(l,y,A).call(l,n);k.status=a.Loader.status.none;s(l,b,x).call(l,k,i).then(function(){if(o===a.Pool.action.restore){r.EventEmitter.emit(a.EventType.basket.restoreProduct,{index:i})}})}}});if(t.Type.isObject(i)&&t.Type.isObject(i.orderPriceTotal)){s(l,m,R).call(l,i);s(l,k,D).call(l,i)}}e()})};var W=function e(t,r){return t.hasOwnProperty(r)?t[r]:null};var z=function e(t,r){var a=s(this,u,W).call(this,t,r);if(a!==null){return a.hasOwnProperty("errors")?a.errors:null}else{return null}};var j=function e(t,r){var i=Object.values(a.Pool.action);var n=s(this,u,W).call(this,t,r);if(n!==null){var l=n.type.toString();return i.includes(l)?l:null}return null};var B=function e(r,a,i){var n=i.hasOwnProperty(r)?i[r]:null;if(t.Type.isArray(n)){return s(this,v,C).call(this,n,a)}return false};var C=function e(t,r){return t.some(function(e){return e.hasOwnProperty(r)})};var X=function e(t,r){t=parseInt(t);for(var a in r){if(!r.hasOwnProperty(a)){continue}r[a].id=parseInt(r[a].id);if(r[a].id===t){return r[a]}}return null};var x=function e(t,r){return this.store.dispatch("basket/changeItem",{index:r,fields:t})};var A=function e(r){return{id:r.id,name:r.name,quantity:r.quantity,measureText:r.measureText,sum:r.sum,price:r.price,module:r.module,productProviderClass:r.productProviderClass,baseSum:r.sumBase,basePrice:r.basePrice,currency:r.currency,discount:{sum:r.sumDiscountDiff,price:r.discountPrice},props:r.props,sku:r.sku,product:{id:r.catalogProduct.id,detailPageUrl:r.detailPageUrl,picture:t.Type.isObject(r.catalogProduct.frontImage)?r.catalogProduct.frontImage.src:null,ratio:r.catalogProduct.ratio,availableQuantity:r.catalogProduct.availableQuantity}}};var R=function e(t){var r=t.orderPriceTotal;this.store.dispatch("basket/setTotal",{price:r.orderPrice,basePrice:r.priceWithoutDiscountValue})};var D=function e(t){var r=t.orderPriceTotal;this.store.dispatch("basket/setDiscount",{sum:r.basketPriceDiscountDiffValue})};var q=function e(r){var a=this;this.store.commit("property/clearProperty");if(t.Type.isObject(r)&&t.Type.isArray(r.properties)){r.properties.forEach(function(e,t){var r={id:e.id,name:e.name,type:e.type,value:e.value[0]};a.store.dispatch("property/changeItem",{index:t,fields:r})})}};var N=function e(r){var a=this;return new Promise(function(e,i){a.store.commit("basket/clearBasket");if(t.Type.isObject(r)&&t.Type.isArray(r.basketItems)){var n=r.basketItems;n.forEach(function(e,t){var r=s(a,y,A).call(a,e);s(a,b,x).call(a,r,t)})}if(t.Type.isObject(r)&&t.Type.isObject(r.orderPriceTotal)){s(a,m,R).call(a,r);s(a,k,D).call(a,r)}e()})};var U=function e(t,r){var a=this;var i=[];t.forEach(function(e,t){var n=s(a,d,z).call(a,r,t);if(n!==null){i.push({list:n,index:t})}});return i};var F=function e(t){var r=[];t.forEach(function(e){if(e.code==="PROPERTIES"){if(e.hasOwnProperty("customData")){var t=parseInt(e.customData.id);r.push({message:e.message,propertyId:t})}}});return r};var L=function e(t){var r=[];t.forEach(function(e){if(parseInt(e.code)===0||e.code==="ORDER"){r.push({message:e.message})}});return r};e.BasketRestHandler=S})(this.BX.Sale.Checkout.Provider=this.BX.Sale.Checkout.Provider||{},BX,BX.Event,BX.Sale.Checkout.Const); //# sourceMappingURL=rest.bundle.map.js
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.26 |
proxy
|
phpinfo
|
Settings