import{__decorate as e}from"tslib";import{ItemType as i}from"./ItemType.js";import{INVARIANT as t}from"./locale.js";import{serializable as s,SerializableBase as r}from"./support/Serializable.js";import{ObservableMap as l}from"./utilities/ObservableMap.js";import{generateUuid as o}from"./utilities/uuid.js";let a=class extends r{get id(){return this._id||(this._id=o()),this._id}get locale(){return this._locale}get values(){return this._values}get itemType(){return i.LANGUAGE_RESOURCES}_id;_locale=t;_values=new l;constructor(e){super(e),this._id=e?.id,e?.locale&&(this._locale=e.locale)}toItemUri(){return`item://${encodeURIComponent(this.itemType)}/${encodeURIComponent(this.id)}`}_getSerializableProperties(){return{...super._getSerializableProperties(),id:{serializeModes:["initial"],deserialize:!1},locale:{serializeModes:["initial"],deserialize:!1},values:{serializeModes:["initial"],serialize:()=>{const e={};for(const[i,t]of this.values.entries())e[i]=t;return e},deserialize:e=>{this._values.clear();for(const i of Object.keys(e))this._values.set(i,e[i])}}}}};a=e([s],a);export{a as LanguageResources};