/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["../chunks/_rollupPluginBabelHelpers","./iteratorUtils","./maybe","./accessorSupport/get","./accessorSupport/interfaces","./accessorSupport/metadata","./accessorSupport/Properties","./accessorSupport/set","./accessorSupport/watch","./accessorSupport/decorators/property","./accessorSupport/decorators/subclass"],(function(t,e,r,s,n,i,o,c,a,u,_){"use strict";var l;function h(t){var e;if(null==t)return{value:t};if(Array.isArray(t))return{type:[t[0]],value:null};switch(typeof t){case"object":return null!=(e=t.constructor)&&e.__accessorMetadata__||t instanceof Date?{type:t.constructor,value:t}:t;case"boolean":return{type:Boolean,value:t};case"string":return{type:String,value:t};case"number":return{type:Number,value:t};case"function":return{type:t,value:null};default:return}}const p=Symbol("Accessor-Handles");let f=function(){function f(...t){if(this[l]=null,this.constructor===f)throw new Error("[accessor] cannot instantiate Accessor. This can be fixed by creating a subclass of Accessor");Object.defineProperty(this,"__accessor__",{enumerable:!1,value:new o(this)}),t.length>0&&this.normalizeCtorArgs&&(this.__accessor__.ctorArgs=this.normalizeCtorArgs.apply(this,t))}f.createSubclass=function(e={}){if(Array.isArray(e))throw new Error("Multi-inheritance unsupported since 4.16");const{properties:r,declaredClass:s,constructor:n}=e;delete e.declaredClass,delete e.properties,delete e.constructor;const o=this;let c=function(e){function r(...r){var s;return(s=e.call(this,...r)||this).inherited=null,n&&n.apply(t._assertThisInitialized(s),r),s}return t._inheritsLoose(r,e),r}(o);i.getOwnClassMetadata(c.prototype);for(const t in e){const r=e[t];c.prototype[t]="function"==typeof r?function(...e){const s=this.inherited;let n;this.inherited=function(...e){if(o.prototype[t])return o.prototype[t].apply(this,e)};try{n=r.apply(this,e)}catch(i){throw this.inherited=s,i}return this.inherited=s,n}:e[t]}for(const t in r){const e=h(r[t]);u.property(e)(c.prototype,t)}return _.subclass(s)(c)};var d=f.prototype;return d.postscript=function(t){const e=this.__accessor__,r=e.ctorArgs||t;e.initialize(),r&&(this.set(r),e.ctorArgs=null),e.constructed(),this.initialize()},d.initialize=function(){},d.destroy=function(){this.destroyed||(r.applySome(this[p],(t=>{t.forEach((t=>t.remove()))})),this[p]=null,a.removeTarget(this),this.__accessor__.destroy())},d.commitProperty=function(t){this.get(t)},d.get=function(t){return s.get(this,t)},d.hasOwnProperty=function(t){return this.__accessor__?this.__accessor__.has(t):Object.prototype.hasOwnProperty.call(this,t)},d.keys=function(){return this.__accessor__?this.__accessor__.keys():[]},d.set=function(t,e){return c.set(this,t,e),this},d.watch=function(t,e,r){return a.watch(this,t,e,r)},d.own=function(t){let s=this[p];if(r.isNone(s)&&(s=this[p]=new Set),e.isIterable(t))for(const e of t)s.add(e);else s.add(t)},d._clearOverride=function(t){return this.__accessor__.clearOverride(t)},d._override=function(t,e){return this.__accessor__.override(t,e)},d._isOverridden=function(t){return this.__accessor__.isOverridden(t)},d.notifyChange=function(t){this.__accessor__.notifyChange(t)},d._get=function(t){return this.__accessor__.internalGet(t)},d._set=function(t,e){return this.__accessor__.internalSet(t,e),this},t._createClass(f,[{key:"initialized",get:function(){return this.__accessor__&&this.__accessor__.initialized||!1}},{key:"constructed",get:function(){return this.__accessor__&&this.__accessor__.lifecycle===n.Lifecycle.CONSTRUCTED||!1}},{key:"destroyed",get:function(){return this.__accessor__&&this.__accessor__.destroyed||!1}}]),f}();return l=p,f}));
