/*
    *
    * Wijmo Library 5.20181.436
    * http://wijmo.com/
    *
    * Copyright(c) GrapeCity, Inc.  All rights reserved.
    *
    * Licensed under the GrapeCity Commercial License.
    * sales@wijmo.com
    * wijmo.com/products/wijmo-5/license/
    *
    */
System.register(["wijmo/wijmo","wijmo/wijmo.react.base","react-dom","react"],function(t,e){"use strict";var i,n,r,o,s,p,l=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();e&&e.id;return{setters:[function(t){i=t},function(t){n=t},function(t){o=t},function(t){s=t}],execute:function(){r=n||exports,window.wijmo=window.wijmo||{},window.wijmo.react=window.wijmo.react||{},window.wijmo.react.base=r,p=function(t){function e(e,i,n){var r=t.call(this,e)||this;r._objPropHash={},r._isMounted=!1,r._mountedCBs=[],r.props=e,r.controlType=i;for(var o=0,s=n&&n.objectProps||[];o<s.length;o++){var p=s[o];r._objPropHash[p]=!0}return r}return l(e,t),e.prototype.render=function(){var t={};t[e._propsParent]=this;var i=s.Children.map(this.props.children,function(e){return s.cloneElement(e,t)});return s.createElement("div",this._isChild()?{style:{display:"none"}}:null,i)},e.prototype.componentDidMount=function(){var t=this;if(this._isChild()){var i=this.props[e._propsParent];i&&i._mountedCB(function(){t._setParent(i)})}else this._prepareControl();return this.control},e.prototype.componentWillUnmount=function(){this._siblingInsertedEH&&this._getElement().removeEventListener("DOMNodeInserted",this._siblingInsertedEH);var t=this.control;if(t)if(this._isChild()){var e=this._getParentProp();if(e){var n=this.parent.control[e];if(i.isArray(n)){var r=n.indexOf(t);r>-1&&n.splice(r,1)}}}else t instanceof i.Control&&t.dispose()},e.prototype.shouldComponentUpdate=function(t){var e=this.control;return this._copy(e,t),!0},e.prototype._mountedCB=function(t){this._isMounted?t():this._mountedCBs.push(t)},e.prototype._createControl=function(){var t=this._isChild()?this._isParentInCtor()?this.parent.control:void 0:this._getElement();return new this.controlType(t)},e.prototype._prepareControl=function(){var t=this.control=this._createControl(),n=this._getElement(),r=this.props,o=t instanceof i.Control,s=e;this._siblingId||(null==this.constructor[s._typeSiblingIdProp]&&(this.constructor[s._typeSiblingIdProp]=++s._siblingDirId+""),this._siblingId=this.constructor[s._typeSiblingIdProp]),n.setAttribute(s._typeSiblingIdProp,this._siblingId);var p={};for(var l in r)if(!this._ignoreProp(l))if(l in t)p[l]=r[l];else switch(l){case"className":i.addClass(n,r.className);break;case"style":i.setCss(n,r.style);break;default:null!=n[l]&&(n[l]=r[l])}o?t.initialize(p):this._copy(t,p,!0),this._isMounted=!0;var a=this._mountedCBs;this._mountedCBs=[];for(var h=0,c=a;h<c.length;h++)(0,c[h])();i.isFunction(r.initialized)&&r.initialized(t)},e.prototype._initParent=function(){var t=this._getParentProp();if(t){var e=this.parent.control,n=e[t];if(i.isArray(n)){var r=this._getSiblingIndex();(r<0||r>=n.length)&&(r=n.length),n.splice(r,0,this.control),this._siblingInsertedEH=this._siblingInserted.bind(this),this._getElement().addEventListener("DOMNodeInserted",this._siblingInsertedEH)}else e[t]=this.control}},e.prototype._setParent=function(t){if(t!==this.parent){if(this.parent)throw"Wijmo child component is already attached to a different parent.";this.parent=t,this._prepareControl(),this._initParent()}},e.prototype._isChild=function(){return null!=this._parentProp||null!=this._parentInCtor},e.prototype._isParentInCtor=function(){return!0===this._parentInCtor},e.prototype._getParentProp=function(){return this.props.wjProperty||this._parentProp},e.prototype._getSiblingIndex=function(){var t=this._getElement(),i=t.parentElement;if(!i)return-1;for(var n=i.childNodes,r=-1,o=this._siblingId,s=0;s<n.length;s++){var p=n[s];if(1==p.nodeType&&p.getAttribute(e._typeSiblingIdProp)==o&&(++r,p===t))return r}return-1},e.prototype._siblingInserted=function(t){if(t.target===this._getElement()){var e=this._getSiblingIndex(),i=this.control,n=this.parent.control[this._getParentProp()],r=n.indexOf(i);e>=0&&r>=0&&e!==r&&(n.splice(r,1),e=Math.min(e,n.length),n.splice(e,0,i))}},e.prototype._copy=function(t,e,n){if(void 0===n&&(n=!1),t&&e){var r,o=t===this.control;for(var s in e)if(!this._ignoreProp(s)||!o){var p=e[s];if(s in t){if(this._isEvent(t,s))n&&i.isFunction(p)&&t[s].addHandler(p);else if(!this._sameValue(t[s],p))if(null==p)t[s]=p;else if(i.isPrimitive(p)||i.isFunction(p)||this._objPropHash[s]&&t===(r||(r=this.control)))t[s]=p;else if(i.isArray(p)&&i.isArray(t[s])){var l=t[s],a=p;if(a.length==l.length)for(var h=0;h<a.length;h++)this._copy(l[h],a[h])}else i.isObject(p)&&this._copy(t[s],e[s])}else"className"==s?t.hostElement&&i.addClass(t.hostElement,e[s]):"style"==s&&t.hostElement&&i.setCss(t.hostElement,e[s])}}},e.prototype._sameValue=function(t,e){return t==e||i.DateTime.equals(t,e)},e.prototype._isEvent=function(t,e){var n=t&&t[e];return null!=n&&n instanceof i.Event},e.prototype._getElement=function(){return o.findDOMNode(this)},e.prototype._ignoreProp=function(t){return"children"===t},e._propsParent="$parent",e._typeSiblingIdProp="_wjSiblingIdProp",e._siblingDirId=0,e}(s.Component),t("ComponentBase",p)}}});