{"version":3,"file":"entity.context-C8qVKYoi.js","sources":["../../../src/packages/core/entity/entity.context-token.ts","../../../src/packages/core/entity/entity.context.ts"],"sourcesContent":["import type { UmbEntityContext } from './entity.context.js';\r\nimport { UmbContextToken } from '@umbraco-cms/backoffice/context-api';\r\n\r\nexport const UMB_ENTITY_CONTEXT = new UmbContextToken('UmbEntityContext');\r\n","import { UMB_ENTITY_CONTEXT } from './entity.context-token.js';\r\nimport type { UmbEntityUnique } from './types.js';\r\nimport { UmbContextBase } from '@umbraco-cms/backoffice/class-api';\r\nimport type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';\r\nimport { UmbStringState } from '@umbraco-cms/backoffice/observable-api';\r\n\r\n/**\r\n * Provides the entity context\r\n * @class UmbEntityContext\r\n * @augments {UmbContextBase}\r\n */\r\nexport class UmbEntityContext extends UmbContextBase {\r\n\t#entityType = new UmbStringState(undefined);\r\n\tpublic readonly entityType = this.#entityType.asObservable();\r\n\r\n\t#unique = new UmbStringState(null);\r\n\tpublic readonly unique = this.#unique.asObservable();\r\n\r\n\t/**\r\n\t * Creates an instance of UmbEntityContext.\r\n\t * @param {UmbControllerHost} host - The controller host for this controller to be appended to\r\n\t * @memberof UmbEntityContext\r\n\t */\r\n\tconstructor(host: UmbControllerHost) {\r\n\t\tsuper(host, UMB_ENTITY_CONTEXT);\r\n\t}\r\n\r\n\t/**\r\n\t * Set the entity type\r\n\t * @param {string | undefined} entityType\r\n\t * @memberof UmbEntityContext\r\n\t */\r\n\tsetEntityType(entityType: string | undefined) {\r\n\t\tthis.#entityType.setValue(entityType);\r\n\t}\r\n\r\n\t/**\r\n\t * Get the entity type\r\n\t * @returns {string | undefined}\r\n\t * @memberof UmbEntityContext\r\n\t */\r\n\tgetEntityType(): string | undefined {\r\n\t\treturn this.#entityType.getValue();\r\n\t}\r\n\r\n\t/**\r\n\t * Set the unique\r\n\t * @param {string | null} unique\r\n\t * @memberof UmbEntityContext\r\n\t */\r\n\tsetUnique(unique: string | null) {\r\n\t\tthis.#unique.setValue(unique);\r\n\t}\r\n\r\n\t/**\r\n\t * Get the unique\r\n\t * @returns {string | null}\r\n\t * @memberof UmbEntityContext\r\n\t */\r\n\tgetUnique() {\r\n\t\treturn this.#unique.getValue();\r\n\t}\r\n}\r\n"],"names":["UMB_ENTITY_CONTEXT","UmbContextToken","UmbEntityContext","UmbContextBase","host","#entityType","UmbStringState","#unique","entityType","unique"],"mappings":";;;AAGa,MAAAA,IAAqB,IAAIC,EAAkC,kBAAkB;ACQnF,MAAMC,UAAyBC,EAAiC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYtE,YAAYC,GAAyB;AACpC,UAAMA,GAAMJ,CAAkB,GAZjB,KAAAK,KAAA,IAAIC,EAAmC,MAAS,GAC9C,KAAA,aAAa,KAAKD,GAAY,aAAa,GAEjD,KAAAE,KAAA,IAAID,EAAgC,IAAI,GAClC,KAAA,SAAS,KAAKC,GAAQ,aAAa;AAAA,EAAA;AAAA,EAJnDF;AAAA,EAGAE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAiBA,cAAcC,GAAgC;AACxC,SAAAH,GAAY,SAASG,CAAU;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQrC,gBAAoC;AAC5B,WAAA,KAAKH,GAAY,SAAS;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQlC,UAAUI,GAAuB;AAC3B,SAAAF,GAAQ,SAASE,CAAM;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQ7B,YAAY;AACJ,WAAA,KAAKF,GAAQ,SAAS;AAAA,EAAA;AAE/B;"}