text: !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("prop-types"),require("react"),require("react-dom"),require("ag-grid-community")):"function"==typeof define&&define.amd?define(["exports","prop-types","react","react-dom","ag-grid-community"],e):e(t.AgGridReact={},t.PropTypes,t.React,t.ReactDOM,t.agGrid)}(this,function(t,e,i,a,s){"use strict";var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function n(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var o,p=(n(c,o=i.Component),c.prototype.render=function(){return null},c.mapChildColumnDefs=function(t){return i.Children.map(t.children,function(t){return c.toColDef(t.props)})},c.toColDef=function(t){var e=c.createColDefFromGridColumn(t);return c.hasChildColumns(t)&&(e.children=c.getChildColDefs(t.children)),e},c.hasChildColumns=function(t){return 0<i.Children.count(t.children)},c.getChildColDefs=function(t){return i.Children.map(t,function(t){return c.createColDefFromGridColumn(t.props)})},c.createColDefFromGridColumn=function(t){var e={};return c.assign(e,t),delete e.children,e},c.assign=function(t,e){return[e].reduce(function(e,n){return Object.keys(n).forEach(function(t){e[t]=n[t]}),e},t)},c);function c(t,e){var n=o.call(this,t,e)||this;return n.props=t,n.state=e,n}function u(t,e){t.forEach(function(t){p[t]=e})}u(s.ColDefUtil.BOOLEAN_PROPERTIES,e.bool),u(s.ColDefUtil.STRING_PROPERTIES,e.string),u(s.ColDefUtil.OBJECT_PROPERTIES,e.object),u(s.ColDefUtil.ARRAY_PROPERTIES,e.array),u(s.ColDefUtil.NUMBER_PROPERTIES,e.number),u(s.ColDefUtil.FUNCTION_PROPERTIES,e.func);var l=(f.prototype.hasMethod=function(t){var e=this.getFrameworkComponentInstance();return null!=e&&null!=e[t]},f.prototype.callMethod=function(t,e){var n=this,r=this.getFrameworkComponentInstance();if(null!=r){var o=this.getFrameworkComponentInstance()[t];if(null==o)return;return o.apply(r,e)}window.setTimeout(function(){return n.callMethod(t,e)},100)},f.prototype.addMethod=function(t,e){this[t]=e},f);function f(){}var h=0;var d,m,C,y=(n(g,d=l),g.prototype.getFrameworkComponentInstance=function(){return this.componentInstance},g.prototype.isStatelessComponent=function(){return this.statelessComponent},g.prototype.getReactComponentName=function(){return this.reactComponent.name},g.prototype.init=function(e){var n=this;return new s.Promise(function(t){n.eParentElement=n.createParentElement(e),n.createReactComponent(e,t)})},g.prototype.getGui=function(){return this.eParentElement},g.prototype.destroy=function(){return this.parentComponent.destroyPortal(this.portal)},g.prototype.createReactComponent=function(t,e){var n=this;this.statelessComponent||(t.ref=function(t){n.componentInstance=t,n.addParentContainerStyleAndClasses()});var r=i.createElement(this.reactComponent,t),o=a.createPortal(r,this.eParentElement,"agPortalKey_"+ ++h);this.portal=o,this.parentComponent.mountReactPortal(o,this,e)},g.prototype.addParentContainerStyleAndClasses=function(){var e=this;this.componentInstance&&(this.componentInstance.getReactContainerStyle&&this.componentInstance.getReactContainerStyle()&&function(e,n){Object.keys(n).forEach(function(t){e[t]=n[t]})}(this.eParentElement.style,this.componentInstance.getReactContainerStyle()),this.componentInstance.getReactContainerClasses&&this.componentInstance.getReactContainerClasses()&&this.componentInstance.getReactContainerClasses().forEach(function(t){return s.Utils.addCssClass(e.eParentElement,t)}))},g.prototype.createParentElement=function(t){var e=document.createElement(this.parentComponent.props.componentWrappingElement||"div");return s.Utils.addCssClass(e,"ag-react-container"),t.reactContainer=e},g.prototype.statelessComponentRendered=function(){return 0<this.eParentElement.childElementCount||0<this.eParentElement.childNodes.length},g.isStateless=function(t){return"function"==typeof t&&!(t.prototype&&t.prototype.isReactComponent)},g);function g(t,e){var n=d.call(this)||this;return n.portal=null,n.componentWrappingElement="div",n.reactComponent=t,n.parentComponent=e,n.statelessComponent=g.isStateless(n.reactComponent),n}(C=m=m||{}).IdentityCheck="IdentityCheck",C.DeepValueCheck="DeepValueCheck",C.NoCheck="NoCheck";var E=(v.prototype.getStrategy=function(t){return this.strategyMap[t]},v);function v(){var t;this.strategyMap=((t={})[m.DeepValueCheck]=new O,t[m.IdentityCheck]=new P(function(t,e){return t===e}),t[m.NoCheck]=new P(function(t,e){return!0}),t)}var P=(R.prototype.areEqual=function(t,e){return this.strategy(t,e)},R);function R(t){this.strategy=t}var O=(D.prototype.areEqual=function(t,e){return D.areEquivalent(D.copy(t),D.copy(e))},D.unwrapStringOrNumber=function(t){return t instanceof Number||t instanceof String?t.valueOf():t},D.copy=function(t){if(!t)return t;if(Array.isArray(t)){for(var e=[],n=0;n<t.length;n++)e.push(this.copy(t[n]));return e}return"object"!=typeof t?t:[{},t].reduce(function(e,n){return Object.keys(n).forEach(function(t){e[t]=n[t]}),e},{})},D.isNaN=function(t){return Number.isNaN?Number.isNaN(t):"number"==typeof t&&isNaN(t)},D.areEquivalent=function(e,n){if(e=D.unwrapStringOrNumber(e),n=D.unwrapStringOrNumber(n),e===n)return!0;if(null===e||null===n||typeof e!=typeof n)return!1;if(D.isNaN(e)&&D.isNaN(n))return!0;if(e instanceof Date)return n instanceof Date&&e.valueOf()===n.valueOf();if("function"==typeof e)return e.toString()===n.toString();if("object"!=typeof e)return e==n;var t=void 0===e.areEquivPropertyTracking,r=void 0===n.areEquivPropertyTracking;try{var o=void 0;if(t)e.areEquivPropertyTracking=[];else if(e.areEquivPropertyTracking.some(function(t){return t===n}))return!0;if(r)n.areEquivPropertyTracking=[];else if(n.areEquivPropertyTracking.some(function(t){return t===e}))return!0;e.areEquivPropertyTracking.push(n),n.areEquivPropertyTracking.push(e);var i={};for(o in e)"areEquivPropertyTracking"!=o&&(i[o]=null);for(o in n)"areEquivPropertyTracking"!=o&&(i[o]=null);for(o in i)if(!this.areEquivalent(e[o],n[o]))return!1;return!0}finally{t&&delete e.areEquivPropertyTracking,r&&delete n.areEquivPropertyTracking}},D);function D(){}var T,I=(n(S,T=i.Component),S.prototype.render=function(){var e=this;return i.createElement("div",{style:this.createStyleForDiv(),ref:function(t){e.eGridDiv=t}},this.portals)},S.prototype.createStyleForDiv=function(){var e={height:"100%"},n=this.props.containerStyle;return n&&Object.keys(n).forEach(function(t){e[t]=n[t]}),e},S.prototype.componentDidMount=function(){var t=this.props.modules||[],e={providedBeanInstances:{agGridReact:this,frameworkComponentWrapper:new b(this)},modules:t},n=this.props.gridOptions||{};p.hasChildColumns(this.props)&&(n.columnDefs=p.mapChildColumnDefs(this.props)),this.gridOptions=s.ComponentUtil.copyAttributesToGridOptions(n,this.props),new s.Grid(this.eGridDiv,this.gridOptions,e),this.api=this.gridOptions.api,this.columnApi=this.gridOptions.columnApi},S.prototype.waitForInstance=function(t,e,n){var r=this;if(void 0===n&&(n=0),this.destroyed)e(null);else if(t.isStatelessComponent()&&t.statelessComponentRendered())e(null);else if(!t.isStatelessComponent()&&t.getFrameworkComponentInstance())e(null);else{if(S.MAX_COMPONENT_CREATION_TIME<=n)return void console.error("ag-Grid: React Component '"+t.getReactComponentName()+"' not created within "+S.MAX_COMPONENT_CREATION_TIME+"ms");window.setTimeout(function(){return r.waitForInstance(t,e,n+5)},5)}},S.prototype.mountReactPortal=function(t,e,n){this.portals=function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],a=0,s=i.length;a<s;a++,o++)r[o]=i[a];return r}(this.portals,[t]),this.batchUpdate(this.waitForInstance(e,n))},S.prototype.batchUpdate=function(t){var e=this;if(this.hasPendingPortalUpdate)return t&&t();setTimeout(function(){e.api&&e.forceUpdate(function(){t&&t(),e.hasPendingPortalUpdate=!1})}),this.hasPendingPortalUpdate=!0},S.prototype.destroyPortal=function(e){this.portals=this.portals.filter(function(t){return t!==e}),this.batchUpdate()},S.prototype.getStrategyTypeForProp=function(t){if("rowData"===t){if(this.props.rowDataChangeDetectionStrategy)return this.props.rowDataChangeDetectionStrategy;if(this.props.deltaRowDataMode)return m.IdentityCheck}return m.DeepValueCheck},S.prototype.shouldComponentUpdate=function(t){return this.processPropsChanges(this.props,t),!1},S.prototype.componentDidUpdate=function(t){this.processPropsChanges(t,this.props)},S.prototype.processPropsChanges=function(t,e){var n={};this.extractGridPropertyChanges(t,e,n),this.extractDeclarativeColDefChanges(e,n),0<Object.keys(n).length&&s.ComponentUtil.processOnChange(n,this.gridOptions,this.api,this.columnApi)},S.prototype.extractDeclarativeColDefChanges=function(t,e){var n=!!t.debug;if(p.hasChildColumns(t)){var r=this.changeDetectionService.getStrategy(m.DeepValueCheck),o=this.gridOptions.columnDefs,i=p.mapChildColumnDefs(t);r.areEqual(o,i)||(n&&console.log("agGridReact: colDefs definitions changed"),e.columnDefs={previousValue:this.gridOptions.columnDefs,currentValue:p.mapChildColumnDefs(t)})}},S.prototype.extractGridPropertyChanges=function(e,n,r){var o=this,i=!!n.debug;Object.keys(n).forEach(function(t){-1!==s.ComponentUtil.ALL_PROPERTIES.indexOf(t)&&(o.changeDetectionService.getStrategy(o.getStrategyTypeForProp(t)).areEqual(e[t],n[t])||(i&&console.log("agGridReact: ["+t+"] property changed"),r[t]={previousValue:e[t],currentValue:n[t]}))}),s.ComponentUtil.getEventCallbacks().forEach(function(t){o.props[t]!==n[t]&&(i&&console.log("agGridReact: ["+t+"] event callback changed"),r[t]={previousValue:e[t],currentValue:n[t]})})},S.prototype.componentWillUnmount=function(){this.api&&(this.api.destroy(),this.api=null),this.destroyed=!0},S.MAX_COMPONENT_CREATION_TIME=1e3,S);function S(t,e){var n=T.call(this,t,e)||this;return n.props=t,n.state=e,n.changeDetectionService=new E,n.api=null,n.portals=[],n.hasPendingPortalUpdate=!1,n.destroyed=!1,n}function N(t,e){t.forEach(function(t){I[t]=e})}I.propTypes={gridOptions:e.object},N(s.ComponentUtil.getEventCallbacks(),e.func),N(s.ComponentUtil.BOOLEAN_PROPERTIES,e.bool),N(s.ComponentUtil.STRING_PROPERTIES,e.string),N(s.ComponentUtil.OBJECT_PROPERTIES,e.object),N(s.ComponentUtil.ARRAY_PROPERTIES,e.array),N(s.ComponentUtil.NUMBER_PROPERTIES,e.number),N(s.ComponentUtil.FUNCTION_PROPERTIES,e.func);var k,b=(n(U,k=s.BaseComponentWrapper),U.prototype.createWrapper=function(t){return new y(t,this.agGridReact)},U);function U(t){var e=k.call(this)||this;return e.agGridReact=t,e}t.AgGridReact=I,t.AgGridColumn=p,Object.defineProperty(t,"__esModule",{value:!0})});
  