text: !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.Image=e()}}(function(){return function e(t,n,i){function r(s,d){if(!n[s]){if(!t[s]){var a="function"==typeof require&&require;if(!d&&a)return a(s,!0);if(o)return o(s,!0);var p=new Error("Cannot find module '"+s+"'");throw p.code="MODULE_NOT_FOUND",p}var u=n[s]={exports:{}};t[s][0].call(u.exports,function(e){var n=t[s][1][e];return r(n?n:e)},u,u.exports,e,t,n,i)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s<i.length;s++)r(i[s]);return r}({1:[function(e,t){(function(e){function n(e,t){var n;return function(){var i=this,r=arguments,o=function(){n=null,e.apply(i,r)};clearTimeout(n),n=setTimeout(o,t)}}function i(e,t,n,i){var r=i(e)-n,o=i(t)-n;return 0===r&&0!==o||0>o&&r>=0?e:0===o&&0!==r||0>r&&o>=0?t:Math.abs(r)<Math.abs(o)?e:Math.abs(o)<Math.abs(r)?t:e}function r(){return window.pageYOffset||document.documentElement.scrollTop}function o(e,t,n){var i=0,o=r()+n;if(e.offsetParent)do i+=e.offsetTop;while(e=e.offsetParent);return t+o>i}var s="undefined"!=typeof window?window.React:"undefined"!=typeof e?e.React:null,d=function(){return document.addEventListener?function(e,t,n){return e.addEventListener(t,n,!1)}:function(e,t,n){return e.attachEvent("on"+t,n)}}(),a=function(){return document.addEventListener?function(e,t,n){return e.removeEventListener(t,n,!1)}:function(e,t,n){return e.detachEvent("on"+t,n)}}(),p=s.createClass({displayName:"Image",nativeSupport:!1,propTypes:{src:s.PropTypes.string.isRequired,srcSet:s.PropTypes.string,sizes:s.PropTypes.string,alt:s.PropTypes.string,width:s.PropTypes.number,height:s.PropTypes.number,fade:s.PropTypes.bool,placeholderSrc:s.PropTypes.string,lazyOffset:s.PropTypes.number,crossorigin:s.PropTypes.oneOf(["anonymous","use-credentials"]),onLoad:s.PropTypes.func,onError:s.PropTypes.func},getDefaultProps:function(){return{onLoad:function(){},onError:function(){},lazyOffset:0,placeholderSrc:"data:image/gif;base64,R0lGODlhEAAJAIAAAP///wAAACH5BAEAAAAALAAAAAAQAAkAAAIKhI+py+0Po5yUFQA7"}},getInitialState:function(){if("undefined"!=typeof document){var e=document.createElement("img");this.nativeSupport="sizes"in e&&"srcset"in e}return this.onViewportResize=n(this.onViewportResize,150),this.onViewportScroll=n(this.onViewportScroll,150),{w:this.getViewportWidth(),h:this.getViewportHeight(),x:this.getDevicePixelRatio(),candidates:this.buildCandidates(this.props.srcSet)}},componentWillReceiveProps:function(e){e&&e.srcSet&&this.setState({candidates:this.buildCandidates(e.srcSet)})},componentDidMount:function(){"undefined"!=typeof window&&(this.props.lazy&&(this.onViewportScroll(),d(window,"scroll",this.onViewportScroll)),this.nativeSupport||d(window,"resize",this.onViewportResize))},componentWillUnmount:function(){"undefined"!=typeof window&&(this.props.lazy&&a(window,"scroll",this.onViewportScroll),this.nativeSupport||a(window,"resize",this.onViewportResize))},render:function(){return this.props.lazy&&!this.state.lazyloaded?this.renderPlaceholder():this.nativeSupport?this.renderNative():s.createElement("img",s.__spread({},this.props,{onLoad:this.props.onLoad,onError:this.props.onError,src:this.matchImage()}))},renderPlaceholder:function(){return s.createElement("img",{width:this.props.width,height:this.props.height,ref:"placeholder",src:this.props.placeholderSrc})},renderNative:function(){return s.createElement("img",s.__spread({},this.props,{onLoad:this.props.onLoad,onError:this.props.onError,src:this.state.candidates[0].url,srcSet:this.props.srcSet}))},buildCandidates:function(e){return e.split(",").map(function(e){for(var t=e.trim().split(" "),n={url:t[0].trim(),w:0,h:0,x:1},i=1;i<t.length;i++){var r=t[i].trim();-1!==r.indexOf("w",r.length-1)?n.w=parseInt(r.substring(0,r.length-1)):-1!==r.indexOf("h",r.length-1)?n.h=parseInt(r.substring(0,r.length-1)):-1!==r.indexOf("x",r.length-1)?n.x=parseFloat(r.substring(0,r.length-1)):console.warn("Invalid parameter passed to Image srcSet: ["+r+"] in "+e)}return n})},matchImage:function(){return this.state.candidates.reduce(function(e,t){return e.x===t.x?e.w===t.w?e.h===t.h?e:i(e,t,this.state.h,function(e){return e.h}):i(e,t,this.state.w,function(e){return e.w}):i(e,t,this.state.x,function(e){return e.x})}.bind(this)).url},onViewportResize:function(){this.setState({w:this.getViewportWidth(),h:this.getViewportHeight()})},onViewportScroll:function(){this.refs.placeholder&&o(this.refs.placeholder.getDOMNode(),this.getViewportHeight(),this.props.lazyOffset)&&this.setState({lazyloaded:!0})},getViewportWidth:function(){return"undefined"!=typeof window?window.innerWidth||document.documentElement.clientWidth:0},getViewportHeight:function(){return"undefined"!=typeof window?window.innerHeight||document.documentElement.clientHeight:0},getDevicePixelRatio:function(){return"undefined"!=typeof window?window.devicePixelRatio:1}});t.exports=p}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)});