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