var __decorate=this&&this.__decorate||function(e,t,o,s){var r,i=arguments.length,a=i<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,o):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,s);else for(var c=e.length-1;c>=0;c--)(r=e[c])&&(a=(i<3?r(a):i>3?r(t,o,a):r(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a};import{createId as e,isControl as t,mapDispatchToControlProps as o,removeId as s}from"@jsonforms/core";import{property as r}from"lit/decorators.js";import{BaseElement as i}from"../base-element";export class ControlBaseElement extends i{constructor(){super()}updated(e){if(super.updated(e),e.has("state")){let{handleChange:e}=o(this.state.dispatch);this.handleChange=e}}shouldUpdate(o){var r;if(o.has("uischema")&&t(this.uischema)){let t=o.get("uischema");(null==t?void 0:t.scope)!==(null==(r=this.uischema)?void 0:r.scope)&&(this.id&&s(this.id),this.id=e(this.uischema.scope))}return!0}disconnectedCallback(){t(this.uischema)&&s(this.id)}}__decorate([r()],ControlBaseElement.prototype,"description",void 0),__decorate([r()],ControlBaseElement.prototype,"rootSchema",void 0);