/*!CK:2425935961!*//*1427086800,*/

if (self.CavalryLogger) { CavalryLogger.start_js(["nTeaS"]); }

__d("MessengerAttachmentImageBlock.react",["React","cx","joinClasses"],function(a,b,c,d,e,f,g,h,i){b.__markCompiled&&b.__markCompiled();'use strict';var j=g,k=j.PropTypes,l=g.createClass({displayName:"MessengerAttachmentImageBlock",propTypes:{attachment:k.object.isRequired},render:function(){return (g.createElement("div",{className:i(this.props.className,this._computeClass())},this._renderImage(),this.props.children));},_renderImage:function(){var n=this._getDimensions(),o=n.height,p=n.width;if(!o||!p)return null;var q=o>p,r=m(o,p),s=o/p*100,t=(q||r)?.2:1,u=(q||r)?s:52;return (g.createElement("div",{className:"_3xn1",style:{backgroundImage:'url('+this.props.attachment.media.image+')',paddingBottom:q&&s>150?'136px':u*t+'%'}}));},_computeClass:function(){var n=this._getDimensions(),o=n.height,p=n.width,q=o>p;return (("_3xn3")+(m(o,p)&&!q?' '+"_3xn5":'')+(q?' '+"_3xn6":'')+(p>=o?' '+"_3xn7":''));},_getDimensions:function(){var n=this.props.attachment.properties||{},o=n.height,p=n.width;if(o&&p){o=parseInt(o,10);p=parseInt(p,10);return {height:o,width:p};}return {height:0,width:0};}});function m(n,o){return n<=300&&o<=300;}e.exports=l;},null);
__d("MNCommerceFooterTypes",["keyMirror"],function(a,b,c,d,e,f,g){b.__markCompiled&&b.__markCompiled();var h=g({TOTAL:null,REFUND:null});e.exports=h;},null);
__d("MNCommerceHeaderLabels",["fbt"],function(a,b,c,d,e,f,g){b.__markCompiled&&b.__markCompiled();var h={CANCELED:{plural:(g._("Cancelled Items")),single:(g._("Canceled Item"))},RETURNED:{plural:(g._("Returned Items")),single:(g._("Returned Item"))}};e.exports=h;},null);
__d("MNCommerceItemText.react",["React","cx","joinClasses"],function(a,b,c,d,e,f,g,h,i){b.__markCompiled&&b.__markCompiled();'use strict';var j=g,k=j.PropTypes,l=g.createClass({displayName:"MNCommerceItemText",propTypes:{description:k.string,title:k.string,width:k.number,size:k.oneOf(['large','small'])},getDefaultProps:function(){return {size:'small'};},render:function(){var m={width:this.props.width},n=this.props,o=n.className,p=(function(r,s){var t={},u=Object.prototype.hasOwnProperty;if(r==null)throw new TypeError();for(var v in r)if(u.call(r,v)&&!u.call(s,v))t[v]=r[v];return t;})(n,{className:1}),q=(("_swr")+(p.size==='small'?' '+"_sws":''));return (g.createElement("div",g.__spread({className:i(o,q)},p),g.createElement("div",{className:(("_51fw")+(p.size==='large'?' '+"_swt":'')),style:m},this.props.title),g.createElement("div",{className:"_51fx",style:m},this.props.description)));}});e.exports=l;},null);
__d("MNCommerceSingleListItem.react",["Image.react","MNCommerceItemText.react","React","cx","merge"],function(a,b,c,d,e,f,g,h,i,j,k){b.__markCompiled&&b.__markCompiled();'use strict';var l=i,m=l.PropTypes,n=6,o=i.createClass({displayName:"MNCommerceSingleListItem",propTypes:{description:m.string,thumbURL:m.string,imageDimension:m.number.isRequired},render:function(){var p=this.props.width-n-this.props.imageDimension,q=k(this.props,{width:p});return (i.createElement("div",{className:this.props.className},i.createElement("div",{className:"_1fld",style:{marginRight:n}},this._renderImage()),i.createElement(h,i.__spread({className:"_1flf",style:{height:this.props.imageDimension},size:this.props.size},q))));},_renderImage:function(){var p=this.props.imageDimension;if(this.props.thumbURL){return (i.createElement(g,{className:"_1fle",height:p,src:this.props.thumbURL,width:p}));}else return (i.createElement("div",{className:"_1prr",style:{height:p,width:p}}));}});e.exports=o;},null);
__d("MNCommerceItemList.react",["List.react","MNCommerceSingleListItem.react","React","cx","fbt"],function(a,b,c,d,e,f,g,h,i,j,k){b.__markCompiled&&b.__markCompiled();'use strict';var l=i,m=l.PropTypes,n=3,o=i.createClass({displayName:"MNCommerceItemList",propTypes:{items:m.array,imageDimension:m.number.isRequired,size:m.oneOf(['small','large']),width:m.number},render:function(){var p=this._getItems(),q=this.props.items.length;if(q>n)p.push(i.createElement("li",{key:"andMore",className:"_24ry"},k._("And {Number of items not visible} more",[k.param("Number of items not visible",q-n)])));return (i.createElement("div",null,i.createElement(g,{border:"none",spacing:"none"},p)));},_getItems:function(){var p=this.props,q=p.imageDimension,r=p.items,s=r.map(function(t){return i.createElement("li",{key:t.id,className:"_24rx"},i.createElement(h,i.__spread({imageDimension:q,size:this.props.size,width:this.props.width},t)));}.bind(this)).slice(0,n);return s;}});e.exports=o;},null);
__d("MNCommerceAttachmentConstants",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();var g={LARGE_IMAGE_DIMENSION:60,SMALL_IMAGE_DIMENSION:32,BUBBLE_PADDING:6};e.exports=g;},null);
__d("MNCommerceLogoHeader.react",["Image.react","React","cx"],function(a,b,c,d,e,f,g,h,i){b.__markCompiled&&b.__markCompiled();'use strict';var j=h,k=j.PropTypes,l=h.createClass({displayName:"MNCommerceLogoHeader",propTypes:{logo:k.object,label:k.string},render:function(){var m=this._renderLogo();if(this.props.label){return (h.createElement("div",{className:"_56rt"},h.createElement("div",{className:"_56ru"},h.createElement("div",{className:"_56rv"},this.props.label)),h.createElement("div",{className:"_56ru"},m)));}else return m;},_renderLogo:function(){var m=this.props.logo;if(!m)return null;return (h.createElement(g,{className:"_56rs",height:m.height,src:m.src,width:m.width}));}});e.exports=l;},null);
__d("MNCommerceTotalCostFooter.react",["LeftRight.react","MNCommerceFooterTypes","React","cx","fbt"],function(a,b,c,d,e,f,g,h,i,j,k){b.__markCompiled&&b.__markCompiled();'use strict';var l=i,m=l.PropTypes,n=i.createClass({displayName:"MNCommerceTotalCostFooter",propTypes:{type:m.oneOf(Object.keys(h)),totalCost:m.string},render:function(){var o,p;switch(this.props.type){case h.TOTAL:o=(k._("Total"));p="_28k2";break;case h.REFUND:o=(k._("Refund"));p="_28k3";break;default:o='';p='';break;}return (i.createElement(g,{className:p},i.createElement("div",null,o),i.createElement("div",{className:"_28k4"},this.props.totalCost)));}});e.exports=n;},null);
__d("MNCommerceCancelReturnMercuryAttachment.react",["MNCommerceFooterTypes","MNCommerceHeaderLabels","MNCommerceItemList.react","MNCommerceAttachmentConstants","MNCommerceLogoHeader.react","MNCommerceTotalCostFooter.react","React","StoryAttachmentStyle","cx"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){b.__markCompiled&&b.__markCompiled();'use strict';var p=m,q=p.PropTypes,r='retail_return',s=m.createClass({displayName:"MNCommerceCancelReturnMercuryAttachment",propTypes:{items:q.array.isRequired,logo:q.object,totalCost:q.string,type:q.string,width:q.number},render:function(){var t=this._getHeaderLabelText();return (m.createElement("div",{className:"_l4o"},m.createElement("div",{className:"_l4p"},m.createElement(k,{label:t,logo:this.props.logo})),m.createElement("div",{className:"_l4q"},this._renderItemDescriptions()),m.createElement("div",{className:"_l4r"},m.createElement(l,{totalCost:this.props.totalCost,type:g.REFUND}))));},_getHeaderLabelText:function(){var t;switch(this.props.type){case n.RETAIL_CANCELLATION:t=h.CANCELED;break;case r:t=h.RETURNED;break;}var u;if(t)if(this.props.items.length===1){u=t.single;}else u=t.plural;return u;},_renderItemDescriptions:function(){if(!this.props.items.length)return null;var t=this.props.width-2*j.BUBBLE_PADDING;return (m.createElement(i,{items:this.props.items,imageDimension:j.LARGE_IMAGE_DIMENSION,size:"large",width:t}));}});e.exports=s;},null);
__d("MNCommerceCancelReturnMercuryShareAttachment.react",["MercuryShareAttachmentReactShape","MNCommerceCancelReturnMercuryAttachment.react","StoryAttachmentStyle","React"],function(a,b,c,d,e,f,g,h,i,j){b.__markCompiled&&b.__markCompiled();'use strict';var k=j,l=k.PropTypes,m=j.createClass({displayName:"MNCommerceCancelReturnMercuryShareAttachment",propTypes:{attachment:g(),maxWidth:l.number},render:function(){var n=this.props.attachment,o=[];Object.keys(n.subattachments).forEach(function(q){var r=n.subattachments[q],s=Object.assign({},r);s.id=q;s.thumbURL=r.media&&r.media.image;o.push(s);});var p={items:o,totalCost:n.properties.refund_amount,width:this.props.maxWidth,type:i.RETAIL_CANCELLATION};return (j.createElement(h,j.__spread({},p)));}});e.exports=m;},null);
__d("MNCommerceReceiptMercuryAttachment.react",["Image.react","MNCommerceFooterTypes","MNCommerceItemList.react","MNCommerceAttachmentConstants","MNCommerceLogoHeader.react","MNCommerceItemText.react","MNCommerceTotalCostFooter.react","React","cx"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){b.__markCompiled&&b.__markCompiled();'use strict';var p=n,q=p.PropTypes,r=n.createClass({displayName:"MNCommerceReceiptMercuryAttachment",propTypes:{items:q.array.isRequired,logo:q.object,totalCost:q.string,width:q.number},render:function(){var s=this.props.items.length>1?"_abt":"_abu",t=this.props.logo,u=t?n.createElement("div",{className:s},n.createElement(k,{logo:t})):null;return (n.createElement("div",null,this._renderSingleImage(),n.createElement("div",{style:{padding:j.BUBBLE_PADDING}},u,n.createElement("div",{className:"_xmt"},this._renderItemDescriptions()),n.createElement("div",{className:"_xmx"},n.createElement(m,{totalCost:this.props.totalCost,type:h.TOTAL})))));},_renderSingleImage:function(){if(!this.props.items.length||this.props.items.length>1)return null;var s=this.props.items[0];return (n.createElement(g,{className:"_xm1",height:s.imageHeight,src:s.thumbURL,width:s.imageWidth}));},_renderItemDescriptions:function(){if(!this.props.items.length)return null;var s=this.props.width-2*j.BUBBLE_PADDING,t={size:'large',width:s};if(this.props.items.length===1){var u=this.props.items[0];return (n.createElement(l,n.__spread({description:u.description,title:u.title},t)));}return (n.createElement(i,n.__spread({items:this.props.items,imageDimension:j.LARGE_IMAGE_DIMENSION},t)));}});e.exports=r;},null);
__d("MNCommerceReceiptMercuryShareAttachment.react",["MercuryShareAttachmentReactShape","MNCommerceReceiptMercuryAttachment.react","React","mergeDeep"],function(a,b,c,d,e,f,g,h,i,j){b.__markCompiled&&b.__markCompiled();'use strict';var k=i,l=k.PropTypes,m=i.createClass({displayName:"MNCommerceReceiptMercuryShareAttachment",propTypes:{attachment:g(),maxWidth:l.number},render:function(){var n=this.props.attachment,o=[];Object.keys(n.subattachments).forEach(function(q){var r=n.subattachments[q],s=j({},r);s.id=q;s.thumbURL=r.media&&r.media.image;o.push(s);});var p={items:o,totalCost:n.properties.total_cost,width:this.props.maxWidth};return (i.createElement(h,i.__spread({},p)));}});e.exports=m;},null);
__d("MNCommerceShippingMercuryAttachment.react",["MNCommerceItemList.react","MNCommerceAttachmentConstants","MNCommerceLogoHeader.react","MNCommerceShipmentTrackingEventTypes","React","cx","fbt"],function(a,b,c,d,e,f,g,h,i,j,k,l,m){b.__markCompiled&&b.__markCompiled();'use strict';var n=k,o=n.PropTypes,p=k.createClass({displayName:"MNCommerceShippingMercuryAttachment",propTypes:{carrierName:o.string,deliveryDate:o.string,deliveryPeriod:o.string,hasUnsupportedCarrier:o.bool,items:o.array.isRequired,logo:o.object,shippingDate:o.string,type:o.number,width:o.number},render:function(){var q=null;if(!this.props.hasUnsupportedCarrier&&this.props.logo)q=k.createElement("div",{className:"_3lx4"},k.createElement(i,{logo:this.props.logo}));var r=this.props.items.length>1?m._("Item"):m._("Items");return (k.createElement("div",{className:"_3lx3"},q,k.createElement("div",{className:"_3lx5"},this._renderShippingSection(),this._renderDeliveryOrCarrierSection(),k.createElement("p",{className:"_5ry9 _3lxb"},r),this._renderItemDescriptions())));},_renderDeliveryOrCarrierSection:function(){var q,r;if(this.props.hasUnsupportedCarrier){q=(m._("Network provider"));r=k.createElement("p",{className:"_5rya"},this.props.carrierName);}else if(!this.props.deliveryDate){return null;}else{q=this._getDeliveryLabel();var s=this.props.type===j.DELAYED?k.createElement("span",null,k.createElement("span",{className:"_5ryb"},m._("Delayed")),' '," · ",' '):'',t=this.props.deliveryDate;if(this.props.deliveryPeriod)t+=', '+this.props.deliveryPeriod;r=k.createElement("p",{className:"_5rya"},s,t);}return (k.createElement("div",{className:"_3lx6"},k.createElement("p",{className:"_5ry9"},q),r));},_getDeliveryLabel:function(){switch(this.props.type){case j.OUT_FOR_DELIVERY:return (m._("Out for delivery on"));case j.DELIVERED:return (m._("Delivered on"));default:return (m._("Delivery on"));}},_renderShippingSection:function(){if(!this.props.type)return (k.createElement("div",{className:"_3lx6"},k.createElement("p",{className:"_5ry9"},m._("Shipped On")),k.createElement("p",{className:"_5rya"},this.props.shippingDate)));return null;},_renderItemDescriptions:function(){if(!this.props.items.length)return null;var q=this.props.width-2*h.BUBBLE_PADDING;return (k.createElement(g,{items:this.props.items,imageDimension:h.SMALL_IMAGE_DIMENSION,size:"small",width:q}));}});e.exports=p;},null);
__d("MNCommerceShippingMercuryShareAttachment.react",["MercuryShareAttachmentReactShape","MNCommerceShippingMercuryAttachment.react","ReactComponentWithPureRenderMixin","React","formatDate"],function(a,b,c,d,e,f,g,h,i,j,k){b.__markCompiled&&b.__markCompiled();'use strict';var l=j,m=l.PropTypes,n=j.createClass({displayName:"MNCommerceShippingMercuryShareAttachment",mixins:[i],propTypes:{attachment:g(),maxWidth:m.number},render:function(){var o=this.props.attachment,p=[];Object.keys(o.subattachments).forEach(function(v){var w=o.subattachments[v],x=Object.assign({},w);x.id=v;x.thumbURL=w.media&&w.media.image;p.push(x);});var q=o.properties,r=q.ship_date?k(q.ship_date,'D M d')+', '+k(q.ship_date,'g:ia'):null,s=q.estimated_delivery_time||q.timestamp,t=s?k(s,'D M d'):null,u={carrierName:q.carrier,deliveryDate:t,items:p,width:this.props.maxWidth,type:q.tracking_event_type,shippingDate:r};return (j.createElement(h,j.__spread({},u)));}});e.exports=n;},null);