(self.webpackChunkCustomerApp=self.webpackChunkCustomerApp||[]).push([[3279],{83279:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var r,o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(32330),l=(r=s)&&r.__esModule?r:{default:r},i=n(59113);function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var p=function(e){function t(){var e,n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var o=arguments.length,a=Array(o),s=0;s<o;s++)a[s]=arguments[s];return n=r=u(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(a))),r.state={width:1,height:1},r.measure=function(e){r.setState({width:e.nativeEvent.layout.width,height:e.nativeEvent.layout.height}),r.props.onLayout&&r.props.onLayout(e)},r.getAngle=function(){return r.props.useAngle?r.props.angle+"deg":Math.atan2(r.state.width*(r.props.end.y-r.props.start.y),r.state.height*(r.props.end.x-r.props.start.x))+Math.PI/2+"rad"},r.getColors=function(){return r.props.colors.map((function(e,t){var n=r.props.locations[t],o="";return n&&(o=" "+100*n+"%"),e+o})).join(",")},u(r,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),a(t,[{key:"render",value:function(){var e=this.props,t=(e.start,e.end,e.colors,e.locations,e.useAngle,e.angleCenter,e.angle,e.style),n=e.children,r=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["start","end","colors","locations","useAngle","angleCenter","angle","style","children"]);return l.default.createElement(i.View,o({},r,{style:[t,{backgroundImage:"linear-gradient("+this.getAngle()+","+this.getColors()+")"}],onLayout:this.measure,__source:{fileName:"src/index.js",lineNumber:76}}),n)}}]),t}(s.PureComponent);p.defaultProps={start:{x:.5,y:0},end:{x:.5,y:1},locations:[],colors:[],useAngle:!1,angle:0},t.default=p}}]);