/*
    *
    * Wijmo Library 5.20182.500
    * 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/
    *
    */
"use strict";function _getProps(t,e){for(var o=window,n=t.split("."),r=0;r<n.length&&null!=o;r++)o=o[n[r]];if(!o)return null;for(var i=["control","initialized","wjProperty"],s=o.prototype;s!=Object.prototype;s=Object.getPrototypeOf(s))for(var p=Object.getOwnPropertyNames(s),r=0;r<p.length;r++){var a=p[r],h=Object.getOwnPropertyDescriptor(s,a),l=a.match(/^on[A-Z]/);(h.set||l)&&(l&&(a=a[2].toLowerCase()+a.substr(3)),i.indexOf(a)<0&&!a.match(/disabled|required|style/)&&i.push(a))}return e&&Array.prototype.push.apply(i,e),i}function _initialize(t,e){function o(t){this.cmp[WjComponentBehavior._behProp]._updateControl(this.prop,t)}var n=[];for(var r in t.$options.propsData)n.push(r);n.sort();var i=t[WjComponentBehavior._behProp].constructor.extraProps;return n.forEach(function(n){!(n in e||i&&i.indexOf(n)>-1)||e[n]instanceof wjcCore.Event||wjcCore.isUndefined(t[n])||(t[WjComponentBehavior._behProp]._updateControl(n,t[n]),t.$watch(n,o.bind({cmp:t,prop:n})))}),function(){var o=t.$el,n={};"style"in e&&o.style.cssText.length&&(o.style.cssText.split(";").forEach(function(t){var e=t.split(":");2==e.length&&(n[e[0].trim()]=e[1].trim())}),e.style=n)}(),n.forEach(function(o){if(e[o]instanceof wjcCore.Event){var n=e[o];wjcCore.isFunction(t[o])&&n.addHandler(t[o],e)}}),t.control&&t.$parent&&(t.$parent[t.control]=e),wjcCore.isFunction(t.initialized)&&t.initialized(e),e}Object.defineProperty(exports,"__esModule",{value:!0});var wjcCore=require("wijmo/wijmo"),wjcSelfRef=require("wijmo/wijmo.vue2.base"),wjcSelf=wjcSelfRef||exports;window.wijmo=window.wijmo||{},window.wijmo.vue2=window.wijmo.vue2||{},window.wijmo.vue2.base=wjcSelf;var vue_1=require("vue"),VueModule=require("vue");exports.Vue=vue_1.default||VueModule,exports.WjVueBase=exports.Vue.extend({beforeCreate:function(){var t=this.$options[WjComponentBehavior._behClassProp];t&&(this[WjComponentBehavior._behProp]=t._attach(this))},mounted:function(){this[WjComponentBehavior._behProp].lhMounted()},destroyed:function(){this[WjComponentBehavior._behProp].lhDestroyed()}});var WjComponentBehavior=function(){function t(t){this._isMounted=!1,this._mountedCBs=[],this.component=t}return t._attach=function(t){return new this(t)},t.register=function(){var e=(o={data:this.data,extends:exports.WjVueBase,template:this.template,render:this.render,props:_getProps(this.className,this.extraProps)},o[t._behClassProp]=this,o);return exports.Vue.component(this.tag,e);var o},t.prototype.lhMounted=function(){var e=this;if(this._isChild()){var o=this.component.$parent;o&&(this.parent=o[t._behProp],this.parent._mountedCB(function(){e._prepareControl(),e._initParent()}))}else this._prepareControl()},t.prototype.lhDestroyed=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 o=this.parent.control[e];if(wjcCore.isArray(o)){var n=o.indexOf(t);n>-1&&o.splice(n,1)}}}else t instanceof wjcCore.Control&&t.dispose()},t.prototype._createControl=function(){var t=this._isChild()?this._isParentInCtor()?this.parent.control:void 0:this._getElement();return new(this.constructor._getControlType())(t)},t.prototype._initParent=function(){var t=this._getParentProp();if(t){var e=this.parent.control,o=e[t];if(wjcCore.isArray(o)){var n=this._getSiblingIndex();(n<0||n>=o.length)&&(n=o.length),o.splice(n,0,this.control),this._siblingInsertedEH=this._siblingInserted.bind(this),this._getElement().addEventListener("DOMNodeInserted",this._siblingInsertedEH)}else e[t]=this.control}},t.prototype._updateControl=function(t,e){this.control[t]=e},t.prototype._prepareControl=function(){var t=this.control=this._createControl(),e=this._getElement(),o=(wjcCore.Control,this.constructor);this._siblingId||(null==o.siblingId&&(o.siblingId=++o._siblingDirId+""),this._siblingId=o.siblingId),e.setAttribute(o._typeSiblingIdAttr,this._siblingId),this._isMounted=!0;var n=this._mountedCBs;this._mountedCBs=[];for(var r=0,i=n;r<i.length;r++)(0,i[r])();_initialize(this.component,t)},t.prototype._isChild=function(){var t=this.constructor;return null!=t.parentProp||null!=t.parentInCtor},t.prototype._isParentInCtor=function(){return!0===this.constructor.parentInCtor},t.prototype._getParentProp=function(){return this.component.$options.propsData.wjProperty||this.constructor.parentProp},t.prototype._getSiblingIndex=function(){var e=this._getElement(),o=e.parentElement;if(!o)return-1;for(var n=o.childNodes,r=-1,i=this._siblingId,s=0;s<n.length;s++){var p=n[s];if(1==p.nodeType&&p.getAttribute(t._typeSiblingIdAttr)==i&&(++r,p===e))return r}return-1},t.prototype._siblingInserted=function(t){if(t.target===this._getElement()){var e=this._getSiblingIndex(),o=this.control,n=this.parent.control[this._getParentProp()],r=n.indexOf(o);e>=0&&r>=0&&e!==r&&(n.splice(r,1),e=Math.min(e,n.length),n.splice(e,0,o))}},t.prototype._getElement=function(){return this.component.$el},t._getControlType=function(){return this.classCtor()},t.prototype._mountedCB=function(t){this._isMounted?t():this._mountedCBs.push(t)},t._typeSiblingIdAttr="_wjSiblingId",t._behClassProp="_wjBehCl",t._behProp="__wjBeh",t._siblingDirId=0,t}();exports.WjComponentBehavior=WjComponentBehavior,exports._getProps=_getProps,exports._initialize=_initialize;