@limetech/lime-web-components 6.8.0 → 6.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/ai-context/ai-context-registry.d.ts +252 -0
- package/dist/ai-context/ai-context-registry.d.ts.map +1 -0
- package/dist/ai-context/index.d.ts +3 -0
- package/dist/ai-context/index.d.ts.map +1 -0
- package/dist/ai-context/types.d.ts +15 -0
- package/dist/ai-context/types.d.ts.map +1 -0
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +90 -88
- package/dist/index.esm.js.map +1 -1
- package/package.json +5 -5
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../src/core/platform.ts","../src/core/idle.ts","../src/limetype/property.ts","../src/limetype/types.ts","../node_modules/tslib/tslib.es6.mjs","../node_modules/rxjs/dist/esm5/internal/util/isFunction.js","../node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js","../node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js","../node_modules/rxjs/dist/esm5/internal/util/arrRemove.js","../node_modules/rxjs/dist/esm5/internal/Subscription.js","../node_modules/rxjs/dist/esm5/internal/config.js","../node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js","../node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js","../node_modules/rxjs/dist/esm5/internal/util/noop.js","../node_modules/rxjs/dist/esm5/internal/util/errorContext.js","../node_modules/rxjs/dist/esm5/internal/Subscriber.js","../node_modules/rxjs/dist/esm5/internal/symbol/observable.js","../node_modules/rxjs/dist/esm5/internal/util/identity.js","../node_modules/rxjs/dist/esm5/internal/util/pipe.js","../node_modules/rxjs/dist/esm5/internal/Observable.js","../node_modules/rxjs/dist/esm5/internal/util/ObjectUnsubscribedError.js","../node_modules/rxjs/dist/esm5/internal/Subject.js","../node_modules/rxjs/dist/esm5/internal/BehaviorSubject.js","../src/core/decorators/factory.ts","../src/limetype/decorator.ts","../src/limetype/find-limetype-by-label.ts","../src/limetype/get-properties-by-type.ts","../src/limetype/get-property-by-label.ts","../src/limetype/get-property-by-name.ts","../src/limetype/has-label.ts","../src/limeobject/types.ts","../src/limeobject/decorator.ts","../src/commandbus/commandbus.ts","../src/commandbus/types.ts","../src/limeobject/commands/bulk-create-dialog.ts","../src/limeobject/commands/create-dialog.ts","../src/limeobject/commands/delete-object.ts","../src/limeobject/commands/object-access.ts","../src/limeobject/commands/save-object.ts","../src/query/query.ts","../src/query/types.ts","../src/http/http.ts","../src/http/types.ts","../src/eventdispatcher/types.ts","../src/translator/types.ts","../src/dialog/types.ts","../src/keybindings/types.ts","../src/navigator/types.ts","../src/navigator/decorator.ts","../src/navigator/command.ts","../src/notifications/types.ts","../src/routeregistry/types.ts","../src/task/repository.ts","../src/task/types.ts","../src/config/types.ts","../src/config/decorator.ts","../src/device/types.ts","../src/device/decorator.ts","../src/filter/types.ts","../src/filter/decorator.ts","../src/userdata/types.ts","../src/userdata/decorator.ts","../src/application/types.ts","../src/application/decorators/application.ts","../src/application/decorators/user.ts","../src/application/decorators/session.ts","../src/userpreferences/types.ts","../src/datetimeformatter/types.ts","../src/conditionregistry/conditionregistry.ts","../src/conditionregistry/types.ts","../src/view/types.ts","../src/webcomponent/types.ts","../src/notification-service/types.ts","../src/poller/types.ts","../src/logger/logger.ts","../src/logger/types.ts","../src/logger/factory.ts","../src/problem/problem.ts","../src/problem/types.ts","../src/error/error.ts"],"sourcesContent":["/**\n * Service container for the Lime CRM platform that provides access to all platform services.\n *\n * The platform acts as a service locator for accessing repositories, the command bus,\n * HTTP client, and other services throughout the application. It is used by web components\n * (injected via Stencil's `@Prop` decorator), command handlers, and other parts of the system.\n *\n * The platform type indicates which Lime CRM client is hosting the component:\n * - `LimeCRMWebClient`: Standard web client\n * - `LimeCRMDesktopClient`: Desktop application client\n * - `LimeCRMWebAdminClient`: Administrative web interface\n *\n * @example\n * ```typescript\n * // Get core services\n * const http = platform.get(PlatformServiceName.Http);\n * const commandBus = platform.get(PlatformServiceName.CommandBus);\n * const limetypes = platform.get(PlatformServiceName.LimeTypeRepository);\n *\n * // Check platform type for conditional logic\n * if (platform.type === 'LimeCRMDesktopClient') {\n * // Desktop-specific functionality\n * }\n *\n * // Check feature switches\n * if (platform.isFeatureEnabled('newFeature')) {\n * // Use new feature\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Register a custom service (third-party plugins)\n * platform.register('myPlugin.analytics', new AnalyticsService());\n *\n * // Later retrieve it\n * const analytics = platform.get('myPlugin.analytics');\n * ```\n *\n * @public\n * @group Core\n */\nexport interface LimeWebComponentPlatform {\n /**\n * The type of Lime CRM client currently running.\n * Use this to conditionally enable features based on the client environment.\n */\n type: 'LimeCRMWebClient' | 'LimeCRMDesktopClient' | 'LimeCRMWebAdminClient';\n\n /**\n * Get a service from the platform container.\n *\n * Services are accessed through the `PlatformServiceName` enum, which can be extended\n * by third-party modules using module augmentation.\n *\n * @param name - The name of the service to retrieve\n * @returns The requested service instance\n *\n * @example\n * ```typescript\n * const http = platform.get(PlatformServiceName.Http);\n * const repository = platform.get(PlatformServiceName.LimeObjectRepository);\n * ```\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n get(name: string): any;\n\n /**\n * Check if a service is currently registered on the platform.\n *\n * Useful for optional dependencies or checking service availability.\n *\n * @param name - The name of the service to check\n * @returns `true` if the service is registered, `false` otherwise\n *\n * @example\n * ```typescript\n * if (platform.has(PlatformServiceName.Analytics)) {\n * const tracker = platform.get(PlatformServiceName.Analytics);\n * tracker.track('event');\n * }\n * ```\n */\n has(name: string): boolean;\n\n /**\n * Register a service on the platform for use throughout the application.\n *\n * Service names are typically defined in the `PlatformServiceName` enum through module\n * augmentation. This ensures type safety and prevents naming conflicts.\n *\n * @param name - The name to register the service under\n * @param service - The service instance to register\n *\n * @example\n * ```typescript\n * const SERVICE_NAME = 'myPlugin.cache';\n * PlatformServiceName.MyCache = SERVICE_NAME;\n *\n * declare module '@limetech/lime-web-components' {\n * interface PlatformServiceNameType {\n * MyCache: typeof SERVICE_NAME;\n * }\n *\n * interface LimeWebComponentPlatform {\n * get(name: PlatformServiceNameType['MyCache']): CacheService;\n * }\n * }\n *\n * // Register the service\n * platform.register(PlatformServiceName.MyCache, new CacheService());\n * ```\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n register(name: string, service: any): void;\n\n /**\n * Check if a feature is enabled in the current environment.\n *\n * Feature switches allow gradual rollout of new functionality and\n * environment-specific behavior. Features can be enabled/disabled\n * at the application, user, or system level.\n *\n * @param name - Name of the feature switch to check\n * @returns `true` if the feature is enabled, `false` otherwise\n *\n * @example\n * ```typescript\n * // Use feature switches for gradual rollout\n * if (platform.isFeatureEnabled('advancedSearch')) {\n * return new AdvancedSearchComponent();\n * } else {\n * return new BasicSearchComponent();\n * }\n * ```\n */\n isFeatureEnabled(name: keyof FeatureSwitches): boolean;\n}\n\n/**\n * Core platform service names for accessing built-in services via the platform.\n *\n * Use these strongly-typed keys to retrieve platform services.\n *\n * @example\n * ```typescript\n * const http = platform.get(PlatformServiceName.Http);\n * const commandBus = platform.get(PlatformServiceName.CommandBus);\n * const limeObjects = platform.get(PlatformServiceName.LimeObjectRepository);\n * const limeTypes = platform.get(PlatformServiceName.LimeTypeRepository);\n * const navigator = platform.get(PlatformServiceName.Navigator);\n * ```\n *\n * @remarks\n * Available services include:\n * - `Http` - HTTP client for API requests\n * - `CommandBus` - Command pattern implementation for actions\n * - `LimeObjectRepository` - CRUD operations for business objects\n * - `LimeTypeRepository` - Schema and metadata access\n * - `Navigator` - Client-side routing\n * - `EventDispatcher` - Event pub/sub system\n * - `Translator` - Localization service\n * - And many more...\n *\n * @public\n * @group Core\n */\nexport const PlatformServiceName: PlatformServiceNameType = {\n Route: 'route',\n} as unknown as PlatformServiceNameType;\n\n/**\n * Interface for platform service names that gets augmented by each service module.\n *\n * Each platform service extends this interface through module augmentation to add\n * its service name. This pattern provides compile-time type safety for service names.\n *\n * @example\n * ```typescript\n * // How services augment this interface (done internally by each service):\n * const SERVICE_NAME = 'http';\n * PlatformServiceName.Http = SERVICE_NAME;\n *\n * declare module '@limetech/lime-web-components' {\n * interface PlatformServiceNameType {\n * Http: typeof SERVICE_NAME;\n * }\n *\n * interface LimeWebComponentPlatform {\n * get(name: PlatformServiceNameType['Http']): HttpService;\n * }\n * }\n * ```\n *\n * @public\n * @group Core\n */\nexport interface PlatformServiceNameType {}\n\n/**\n * Available feature switches for conditional functionality.\n *\n * Feature switches enable gradual rollout and A/B testing of new features.\n * This interface is augmented by feature modules to register their switches.\n *\n * @example\n * ```typescript\n * // How features augment this interface:\n * declare module '@limetech/lime-web-components' {\n * interface FeatureSwitches {\n * advancedSearch: boolean;\n * newUIDesign: boolean;\n * betaFeatures: boolean;\n * }\n * }\n *\n * // Usage in components:\n * if (platform.isFeatureEnabled('advancedSearch')) {\n * // Enable advanced search functionality\n * }\n * ```\n *\n * @public\n * @group Core\n */\nexport interface FeatureSwitches {}\n","// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport { EventDispatcher } from '../eventdispatcher';\n\n/**\n * The user's idle state. When set to `active` the user is actively using the\n * application. When set to `idle`, the user has either minimized the\n * application or not used it actively for a while.\n * @beta\n * @group Core\n */\nexport type IdleState = 'active' | 'idle';\n\n/**\n * The event emitted by {@link EventDispatcher} when the user's idle state\n * changes\n * @beta\n * @group Core\n */\nexport type IdleStateChangeEvent = CustomEvent<{ state: IdleState }>;\n\n/**\n * Name of the event emitted by {@link EventDispatcher} when the user's idle\n * state changes\n * @beta\n * @group Core\n */\nexport const IdleStateEventName = 'idle-state' as const;\n","import { Acl } from './acl';\nimport { LimeType } from './limetype';\n\n/**\n * @public\n * @group Lime types\n */\nexport interface LimeProperty {\n acl: Acl;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n defaultvalue: any;\n fieldorder: number;\n has_sql?: boolean;\n label: string;\n length?: number;\n localname: string;\n name: string;\n required: boolean;\n type: PropertyType;\n options?: Option[];\n relation?: {\n getLimetype: () => LimeType;\n getBackreference: () => LimeProperty;\n };\n}\n\n/**\n * @public\n * @group Lime types\n */\nexport interface Option {\n key: string;\n inactive: boolean;\n text: string;\n order?: number;\n id?: number;\n}\n\n/**\n * The subset of `PropertyType`s that represent a date or time of some kind.\n *\n * **NOTE**<br>\n * For legacy reasons:\n * - the type `time` represents a value with date _and_ time\n * - the type `timeofday` represents a value with _only_ time\n * - there is no type for \"week\"; instead week properties use the type `time` and are configured as \"week\" in the applicable view config\n *\n * @public\n * @group Lime types\n */\nexport type DateTimePropertyType =\n | 'time'\n | 'timeofday'\n | 'date'\n | 'year'\n | 'quarter'\n | 'month';\n\n/**\n * @public\n * @group Lime types\n */\nexport type PropertyType =\n | 'string'\n | 'text'\n | 'phone'\n | 'integer'\n | 'decimal'\n | 'percent'\n | 'yesno'\n | 'link'\n | 'user'\n | 'xml'\n | 'option'\n | 'set'\n | 'file'\n | 'hasone'\n | 'hasmany'\n | 'belongsto'\n | 'hasandbelongstomany'\n | 'system'\n | DateTimePropertyType;\n\n/**\n * Check if the property is a relation type, i.e. it is a property that\n * relates to another LimeType, such as `hasone`, `hasmany`, `belongsto`,\n * or `hasandbelongstomany`.\n *\n * @param property - the property to check\n * @returns true if the property is a relation type, false otherwise\n *\n * @public\n * @group Lime types\n */\nexport function isRelation(property: LimeProperty) {\n const propTypes: PropertyType[] = [\n 'belongsto',\n 'hasone',\n 'hasmany',\n 'hasandbelongstomany',\n ];\n\n return property && propTypes.includes(property.type);\n}\n\n/**\n * Check if the property is a single relation type, i.e. it is a property\n * that relates to another LimeType, such as `hasone` or `belongsto`.\n *\n * @param property - the property to check\n * @returns true if the property is a single relation type, false otherwise\n *\n * @public\n * @group Lime types\n */\nexport function isSingleRelation(property: LimeProperty) {\n const propTypes: PropertyType[] = ['belongsto', 'hasone'];\n\n return property && propTypes.includes(property.type);\n}\n\n/**\n * Check if the property is a date or time type, i.e. it is a property\n * that represents a date or time, such as `time`, `timeofday`, `date`,\n * `year`, `quarter`, or `month`.\n *\n * @param property - the property to check\n * @returns true if the property is a date or time type, false otherwise\n *\n * @public\n * @group Lime types\n */\nexport function isDate(property: LimeProperty) {\n const propTypes: PropertyType[] = [\n 'time',\n 'timeofday',\n 'date',\n 'year',\n 'quarter',\n 'month',\n ];\n\n return property && propTypes.includes(property.type);\n}\n\n/**\n * Check if the property is a string type, i.e. it is a property\n * that represents a string, such as `string`, `text`, `phone`, or `link`.\n *\n * @param property - the property to check\n * @returns true if the property is a string type, false otherwise\n *\n * @public\n * @group Lime types\n */\nexport function isString(property: LimeProperty) {\n const propTypes: PropertyType[] = ['string', 'text', 'phone', 'link'];\n\n return property && propTypes.includes(property.type);\n}\n\n/**\n * Check if the property is a float type, i.e. it is a property\n * that represents a decimal or percent value, such as `decimal` or `percent`.\n *\n * @param property - the property to check\n * @returns true if the property is a float type, false otherwise\n *\n * @public\n * @group Lime types\n */\nexport function isFloat(property: LimeProperty) {\n const propTypes: PropertyType[] = ['decimal', 'percent'];\n\n return property && propTypes.includes(property.type);\n}\n","import { PlatformServiceName } from '../core/platform';\nimport { LimeTypeRepository } from './repository';\n\nconst SERVICE_NAME = 'state.limetypes';\n\nPlatformServiceName.LimeTypeRepository = SERVICE_NAME;\n\ndeclare module '../core/platform' {\n interface PlatformServiceNameType {\n /**\n * @see {@link LimeTypeRepository}\n */\n LimeTypeRepository: typeof SERVICE_NAME;\n }\n\n interface LimeWebComponentPlatform {\n get(\n name: PlatformServiceNameType['LimeTypeRepository']\n ): LimeTypeRepository;\n }\n}\n","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nvar ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\n });\n }\n return path;\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __esDecorate,\n __runInitializers,\n __propKey,\n __setFunctionName,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n __rewriteRelativeImportExtension,\n};\n","export function isFunction(value) {\n return typeof value === 'function';\n}\n//# sourceMappingURL=isFunction.js.map","export function createErrorClass(createImpl) {\n var _super = function (instance) {\n Error.call(instance);\n instance.stack = new Error().stack;\n };\n var ctorFunc = createImpl(_super);\n ctorFunc.prototype = Object.create(Error.prototype);\n ctorFunc.prototype.constructor = ctorFunc;\n return ctorFunc;\n}\n//# sourceMappingURL=createErrorClass.js.map","import { createErrorClass } from './createErrorClass';\nexport var UnsubscriptionError = createErrorClass(function (_super) {\n return function UnsubscriptionErrorImpl(errors) {\n _super(this);\n this.message = errors\n ? errors.length + \" errors occurred during unsubscription:\\n\" + errors.map(function (err, i) { return i + 1 + \") \" + err.toString(); }).join('\\n ')\n : '';\n this.name = 'UnsubscriptionError';\n this.errors = errors;\n };\n});\n//# sourceMappingURL=UnsubscriptionError.js.map","export function arrRemove(arr, item) {\n if (arr) {\n var index = arr.indexOf(item);\n 0 <= index && arr.splice(index, 1);\n }\n}\n//# sourceMappingURL=arrRemove.js.map","import { __read, __spreadArray, __values } from \"tslib\";\nimport { isFunction } from './util/isFunction';\nimport { UnsubscriptionError } from './util/UnsubscriptionError';\nimport { arrRemove } from './util/arrRemove';\nvar Subscription = (function () {\n function Subscription(initialTeardown) {\n this.initialTeardown = initialTeardown;\n this.closed = false;\n this._parentage = null;\n this._finalizers = null;\n }\n Subscription.prototype.unsubscribe = function () {\n var e_1, _a, e_2, _b;\n var errors;\n if (!this.closed) {\n this.closed = true;\n var _parentage = this._parentage;\n if (_parentage) {\n this._parentage = null;\n if (Array.isArray(_parentage)) {\n try {\n for (var _parentage_1 = __values(_parentage), _parentage_1_1 = _parentage_1.next(); !_parentage_1_1.done; _parentage_1_1 = _parentage_1.next()) {\n var parent_1 = _parentage_1_1.value;\n parent_1.remove(this);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_parentage_1_1 && !_parentage_1_1.done && (_a = _parentage_1.return)) _a.call(_parentage_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n }\n else {\n _parentage.remove(this);\n }\n }\n var initialFinalizer = this.initialTeardown;\n if (isFunction(initialFinalizer)) {\n try {\n initialFinalizer();\n }\n catch (e) {\n errors = e instanceof UnsubscriptionError ? e.errors : [e];\n }\n }\n var _finalizers = this._finalizers;\n if (_finalizers) {\n this._finalizers = null;\n try {\n for (var _finalizers_1 = __values(_finalizers), _finalizers_1_1 = _finalizers_1.next(); !_finalizers_1_1.done; _finalizers_1_1 = _finalizers_1.next()) {\n var finalizer = _finalizers_1_1.value;\n try {\n execFinalizer(finalizer);\n }\n catch (err) {\n errors = errors !== null && errors !== void 0 ? errors : [];\n if (err instanceof UnsubscriptionError) {\n errors = __spreadArray(__spreadArray([], __read(errors)), __read(err.errors));\n }\n else {\n errors.push(err);\n }\n }\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (_finalizers_1_1 && !_finalizers_1_1.done && (_b = _finalizers_1.return)) _b.call(_finalizers_1);\n }\n finally { if (e_2) throw e_2.error; }\n }\n }\n if (errors) {\n throw new UnsubscriptionError(errors);\n }\n }\n };\n Subscription.prototype.add = function (teardown) {\n var _a;\n if (teardown && teardown !== this) {\n if (this.closed) {\n execFinalizer(teardown);\n }\n else {\n if (teardown instanceof Subscription) {\n if (teardown.closed || teardown._hasParent(this)) {\n return;\n }\n teardown._addParent(this);\n }\n (this._finalizers = (_a = this._finalizers) !== null && _a !== void 0 ? _a : []).push(teardown);\n }\n }\n };\n Subscription.prototype._hasParent = function (parent) {\n var _parentage = this._parentage;\n return _parentage === parent || (Array.isArray(_parentage) && _parentage.includes(parent));\n };\n Subscription.prototype._addParent = function (parent) {\n var _parentage = this._parentage;\n this._parentage = Array.isArray(_parentage) ? (_parentage.push(parent), _parentage) : _parentage ? [_parentage, parent] : parent;\n };\n Subscription.prototype._removeParent = function (parent) {\n var _parentage = this._parentage;\n if (_parentage === parent) {\n this._parentage = null;\n }\n else if (Array.isArray(_parentage)) {\n arrRemove(_parentage, parent);\n }\n };\n Subscription.prototype.remove = function (teardown) {\n var _finalizers = this._finalizers;\n _finalizers && arrRemove(_finalizers, teardown);\n if (teardown instanceof Subscription) {\n teardown._removeParent(this);\n }\n };\n Subscription.EMPTY = (function () {\n var empty = new Subscription();\n empty.closed = true;\n return empty;\n })();\n return Subscription;\n}());\nexport { Subscription };\nexport var EMPTY_SUBSCRIPTION = Subscription.EMPTY;\nexport function isSubscription(value) {\n return (value instanceof Subscription ||\n (value && 'closed' in value && isFunction(value.remove) && isFunction(value.add) && isFunction(value.unsubscribe)));\n}\nfunction execFinalizer(finalizer) {\n if (isFunction(finalizer)) {\n finalizer();\n }\n else {\n finalizer.unsubscribe();\n }\n}\n//# sourceMappingURL=Subscription.js.map","export var config = {\n onUnhandledError: null,\n onStoppedNotification: null,\n Promise: undefined,\n useDeprecatedSynchronousErrorHandling: false,\n useDeprecatedNextContext: false,\n};\n//# sourceMappingURL=config.js.map","import { __read, __spreadArray } from \"tslib\";\nexport var timeoutProvider = {\n setTimeout: function (handler, timeout) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n var delegate = timeoutProvider.delegate;\n if (delegate === null || delegate === void 0 ? void 0 : delegate.setTimeout) {\n return delegate.setTimeout.apply(delegate, __spreadArray([handler, timeout], __read(args)));\n }\n return setTimeout.apply(void 0, __spreadArray([handler, timeout], __read(args)));\n },\n clearTimeout: function (handle) {\n var delegate = timeoutProvider.delegate;\n return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearTimeout) || clearTimeout)(handle);\n },\n delegate: undefined,\n};\n//# sourceMappingURL=timeoutProvider.js.map","import { config } from '../config';\nimport { timeoutProvider } from '../scheduler/timeoutProvider';\nexport function reportUnhandledError(err) {\n timeoutProvider.setTimeout(function () {\n var onUnhandledError = config.onUnhandledError;\n if (onUnhandledError) {\n onUnhandledError(err);\n }\n else {\n throw err;\n }\n });\n}\n//# sourceMappingURL=reportUnhandledError.js.map","export function noop() { }\n//# sourceMappingURL=noop.js.map","import { config } from '../config';\nvar context = null;\nexport function errorContext(cb) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n var isRoot = !context;\n if (isRoot) {\n context = { errorThrown: false, error: null };\n }\n cb();\n if (isRoot) {\n var _a = context, errorThrown = _a.errorThrown, error = _a.error;\n context = null;\n if (errorThrown) {\n throw error;\n }\n }\n }\n else {\n cb();\n }\n}\nexport function captureError(err) {\n if (config.useDeprecatedSynchronousErrorHandling && context) {\n context.errorThrown = true;\n context.error = err;\n }\n}\n//# sourceMappingURL=errorContext.js.map","import { __extends } from \"tslib\";\nimport { isFunction } from './util/isFunction';\nimport { isSubscription, Subscription } from './Subscription';\nimport { config } from './config';\nimport { reportUnhandledError } from './util/reportUnhandledError';\nimport { noop } from './util/noop';\nimport { nextNotification, errorNotification, COMPLETE_NOTIFICATION } from './NotificationFactories';\nimport { timeoutProvider } from './scheduler/timeoutProvider';\nimport { captureError } from './util/errorContext';\nvar Subscriber = (function (_super) {\n __extends(Subscriber, _super);\n function Subscriber(destination) {\n var _this = _super.call(this) || this;\n _this.isStopped = false;\n if (destination) {\n _this.destination = destination;\n if (isSubscription(destination)) {\n destination.add(_this);\n }\n }\n else {\n _this.destination = EMPTY_OBSERVER;\n }\n return _this;\n }\n Subscriber.create = function (next, error, complete) {\n return new SafeSubscriber(next, error, complete);\n };\n Subscriber.prototype.next = function (value) {\n if (this.isStopped) {\n handleStoppedNotification(nextNotification(value), this);\n }\n else {\n this._next(value);\n }\n };\n Subscriber.prototype.error = function (err) {\n if (this.isStopped) {\n handleStoppedNotification(errorNotification(err), this);\n }\n else {\n this.isStopped = true;\n this._error(err);\n }\n };\n Subscriber.prototype.complete = function () {\n if (this.isStopped) {\n handleStoppedNotification(COMPLETE_NOTIFICATION, this);\n }\n else {\n this.isStopped = true;\n this._complete();\n }\n };\n Subscriber.prototype.unsubscribe = function () {\n if (!this.closed) {\n this.isStopped = true;\n _super.prototype.unsubscribe.call(this);\n this.destination = null;\n }\n };\n Subscriber.prototype._next = function (value) {\n this.destination.next(value);\n };\n Subscriber.prototype._error = function (err) {\n try {\n this.destination.error(err);\n }\n finally {\n this.unsubscribe();\n }\n };\n Subscriber.prototype._complete = function () {\n try {\n this.destination.complete();\n }\n finally {\n this.unsubscribe();\n }\n };\n return Subscriber;\n}(Subscription));\nexport { Subscriber };\nvar _bind = Function.prototype.bind;\nfunction bind(fn, thisArg) {\n return _bind.call(fn, thisArg);\n}\nvar ConsumerObserver = (function () {\n function ConsumerObserver(partialObserver) {\n this.partialObserver = partialObserver;\n }\n ConsumerObserver.prototype.next = function (value) {\n var partialObserver = this.partialObserver;\n if (partialObserver.next) {\n try {\n partialObserver.next(value);\n }\n catch (error) {\n handleUnhandledError(error);\n }\n }\n };\n ConsumerObserver.prototype.error = function (err) {\n var partialObserver = this.partialObserver;\n if (partialObserver.error) {\n try {\n partialObserver.error(err);\n }\n catch (error) {\n handleUnhandledError(error);\n }\n }\n else {\n handleUnhandledError(err);\n }\n };\n ConsumerObserver.prototype.complete = function () {\n var partialObserver = this.partialObserver;\n if (partialObserver.complete) {\n try {\n partialObserver.complete();\n }\n catch (error) {\n handleUnhandledError(error);\n }\n }\n };\n return ConsumerObserver;\n}());\nvar SafeSubscriber = (function (_super) {\n __extends(SafeSubscriber, _super);\n function SafeSubscriber(observerOrNext, error, complete) {\n var _this = _super.call(this) || this;\n var partialObserver;\n if (isFunction(observerOrNext) || !observerOrNext) {\n partialObserver = {\n next: (observerOrNext !== null && observerOrNext !== void 0 ? observerOrNext : undefined),\n error: error !== null && error !== void 0 ? error : undefined,\n complete: complete !== null && complete !== void 0 ? complete : undefined,\n };\n }\n else {\n var context_1;\n if (_this && config.useDeprecatedNextContext) {\n context_1 = Object.create(observerOrNext);\n context_1.unsubscribe = function () { return _this.unsubscribe(); };\n partialObserver = {\n next: observerOrNext.next && bind(observerOrNext.next, context_1),\n error: observerOrNext.error && bind(observerOrNext.error, context_1),\n complete: observerOrNext.complete && bind(observerOrNext.complete, context_1),\n };\n }\n else {\n partialObserver = observerOrNext;\n }\n }\n _this.destination = new ConsumerObserver(partialObserver);\n return _this;\n }\n return SafeSubscriber;\n}(Subscriber));\nexport { SafeSubscriber };\nfunction handleUnhandledError(error) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n captureError(error);\n }\n else {\n reportUnhandledError(error);\n }\n}\nfunction defaultErrorHandler(err) {\n throw err;\n}\nfunction handleStoppedNotification(notification, subscriber) {\n var onStoppedNotification = config.onStoppedNotification;\n onStoppedNotification && timeoutProvider.setTimeout(function () { return onStoppedNotification(notification, subscriber); });\n}\nexport var EMPTY_OBSERVER = {\n closed: true,\n next: noop,\n error: defaultErrorHandler,\n complete: noop,\n};\n//# sourceMappingURL=Subscriber.js.map","export var observable = (function () { return (typeof Symbol === 'function' && Symbol.observable) || '@@observable'; })();\n//# sourceMappingURL=observable.js.map","export function identity(x) {\n return x;\n}\n//# sourceMappingURL=identity.js.map","import { identity } from './identity';\nexport function pipe() {\n var fns = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n fns[_i] = arguments[_i];\n }\n return pipeFromArray(fns);\n}\nexport function pipeFromArray(fns) {\n if (fns.length === 0) {\n return identity;\n }\n if (fns.length === 1) {\n return fns[0];\n }\n return function piped(input) {\n return fns.reduce(function (prev, fn) { return fn(prev); }, input);\n };\n}\n//# sourceMappingURL=pipe.js.map","import { SafeSubscriber, Subscriber } from './Subscriber';\nimport { isSubscription } from './Subscription';\nimport { observable as Symbol_observable } from './symbol/observable';\nimport { pipeFromArray } from './util/pipe';\nimport { config } from './config';\nimport { isFunction } from './util/isFunction';\nimport { errorContext } from './util/errorContext';\nvar Observable = (function () {\n function Observable(subscribe) {\n if (subscribe) {\n this._subscribe = subscribe;\n }\n }\n Observable.prototype.lift = function (operator) {\n var observable = new Observable();\n observable.source = this;\n observable.operator = operator;\n return observable;\n };\n Observable.prototype.subscribe = function (observerOrNext, error, complete) {\n var _this = this;\n var subscriber = isSubscriber(observerOrNext) ? observerOrNext : new SafeSubscriber(observerOrNext, error, complete);\n errorContext(function () {\n var _a = _this, operator = _a.operator, source = _a.source;\n subscriber.add(operator\n ?\n operator.call(subscriber, source)\n : source\n ?\n _this._subscribe(subscriber)\n :\n _this._trySubscribe(subscriber));\n });\n return subscriber;\n };\n Observable.prototype._trySubscribe = function (sink) {\n try {\n return this._subscribe(sink);\n }\n catch (err) {\n sink.error(err);\n }\n };\n Observable.prototype.forEach = function (next, promiseCtor) {\n var _this = this;\n promiseCtor = getPromiseCtor(promiseCtor);\n return new promiseCtor(function (resolve, reject) {\n var subscriber = new SafeSubscriber({\n next: function (value) {\n try {\n next(value);\n }\n catch (err) {\n reject(err);\n subscriber.unsubscribe();\n }\n },\n error: reject,\n complete: resolve,\n });\n _this.subscribe(subscriber);\n });\n };\n Observable.prototype._subscribe = function (subscriber) {\n var _a;\n return (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber);\n };\n Observable.prototype[Symbol_observable] = function () {\n return this;\n };\n Observable.prototype.pipe = function () {\n var operations = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n operations[_i] = arguments[_i];\n }\n return pipeFromArray(operations)(this);\n };\n Observable.prototype.toPromise = function (promiseCtor) {\n var _this = this;\n promiseCtor = getPromiseCtor(promiseCtor);\n return new promiseCtor(function (resolve, reject) {\n var value;\n _this.subscribe(function (x) { return (value = x); }, function (err) { return reject(err); }, function () { return resolve(value); });\n });\n };\n Observable.create = function (subscribe) {\n return new Observable(subscribe);\n };\n return Observable;\n}());\nexport { Observable };\nfunction getPromiseCtor(promiseCtor) {\n var _a;\n return (_a = promiseCtor !== null && promiseCtor !== void 0 ? promiseCtor : config.Promise) !== null && _a !== void 0 ? _a : Promise;\n}\nfunction isObserver(value) {\n return value && isFunction(value.next) && isFunction(value.error) && isFunction(value.complete);\n}\nfunction isSubscriber(value) {\n return (value && value instanceof Subscriber) || (isObserver(value) && isSubscription(value));\n}\n//# sourceMappingURL=Observable.js.map","import { createErrorClass } from './createErrorClass';\nexport var ObjectUnsubscribedError = createErrorClass(function (_super) {\n return function ObjectUnsubscribedErrorImpl() {\n _super(this);\n this.name = 'ObjectUnsubscribedError';\n this.message = 'object unsubscribed';\n };\n});\n//# sourceMappingURL=ObjectUnsubscribedError.js.map","import { __extends, __values } from \"tslib\";\nimport { Observable } from './Observable';\nimport { Subscription, EMPTY_SUBSCRIPTION } from './Subscription';\nimport { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError';\nimport { arrRemove } from './util/arrRemove';\nimport { errorContext } from './util/errorContext';\nvar Subject = (function (_super) {\n __extends(Subject, _super);\n function Subject() {\n var _this = _super.call(this) || this;\n _this.closed = false;\n _this.currentObservers = null;\n _this.observers = [];\n _this.isStopped = false;\n _this.hasError = false;\n _this.thrownError = null;\n return _this;\n }\n Subject.prototype.lift = function (operator) {\n var subject = new AnonymousSubject(this, this);\n subject.operator = operator;\n return subject;\n };\n Subject.prototype._throwIfClosed = function () {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n };\n Subject.prototype.next = function (value) {\n var _this = this;\n errorContext(function () {\n var e_1, _a;\n _this._throwIfClosed();\n if (!_this.isStopped) {\n if (!_this.currentObservers) {\n _this.currentObservers = Array.from(_this.observers);\n }\n try {\n for (var _b = __values(_this.currentObservers), _c = _b.next(); !_c.done; _c = _b.next()) {\n var observer = _c.value;\n observer.next(value);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n }\n });\n };\n Subject.prototype.error = function (err) {\n var _this = this;\n errorContext(function () {\n _this._throwIfClosed();\n if (!_this.isStopped) {\n _this.hasError = _this.isStopped = true;\n _this.thrownError = err;\n var observers = _this.observers;\n while (observers.length) {\n observers.shift().error(err);\n }\n }\n });\n };\n Subject.prototype.complete = function () {\n var _this = this;\n errorContext(function () {\n _this._throwIfClosed();\n if (!_this.isStopped) {\n _this.isStopped = true;\n var observers = _this.observers;\n while (observers.length) {\n observers.shift().complete();\n }\n }\n });\n };\n Subject.prototype.unsubscribe = function () {\n this.isStopped = this.closed = true;\n this.observers = this.currentObservers = null;\n };\n Object.defineProperty(Subject.prototype, \"observed\", {\n get: function () {\n var _a;\n return ((_a = this.observers) === null || _a === void 0 ? void 0 : _a.length) > 0;\n },\n enumerable: false,\n configurable: true\n });\n Subject.prototype._trySubscribe = function (subscriber) {\n this._throwIfClosed();\n return _super.prototype._trySubscribe.call(this, subscriber);\n };\n Subject.prototype._subscribe = function (subscriber) {\n this._throwIfClosed();\n this._checkFinalizedStatuses(subscriber);\n return this._innerSubscribe(subscriber);\n };\n Subject.prototype._innerSubscribe = function (subscriber) {\n var _this = this;\n var _a = this, hasError = _a.hasError, isStopped = _a.isStopped, observers = _a.observers;\n if (hasError || isStopped) {\n return EMPTY_SUBSCRIPTION;\n }\n this.currentObservers = null;\n observers.push(subscriber);\n return new Subscription(function () {\n _this.currentObservers = null;\n arrRemove(observers, subscriber);\n });\n };\n Subject.prototype._checkFinalizedStatuses = function (subscriber) {\n var _a = this, hasError = _a.hasError, thrownError = _a.thrownError, isStopped = _a.isStopped;\n if (hasError) {\n subscriber.error(thrownError);\n }\n else if (isStopped) {\n subscriber.complete();\n }\n };\n Subject.prototype.asObservable = function () {\n var observable = new Observable();\n observable.source = this;\n return observable;\n };\n Subject.create = function (destination, source) {\n return new AnonymousSubject(destination, source);\n };\n return Subject;\n}(Observable));\nexport { Subject };\nvar AnonymousSubject = (function (_super) {\n __extends(AnonymousSubject, _super);\n function AnonymousSubject(destination, source) {\n var _this = _super.call(this) || this;\n _this.destination = destination;\n _this.source = source;\n return _this;\n }\n AnonymousSubject.prototype.next = function (value) {\n var _a, _b;\n (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.next) === null || _b === void 0 ? void 0 : _b.call(_a, value);\n };\n AnonymousSubject.prototype.error = function (err) {\n var _a, _b;\n (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.error) === null || _b === void 0 ? void 0 : _b.call(_a, err);\n };\n AnonymousSubject.prototype.complete = function () {\n var _a, _b;\n (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.complete) === null || _b === void 0 ? void 0 : _b.call(_a);\n };\n AnonymousSubject.prototype._subscribe = function (subscriber) {\n var _a, _b;\n return (_b = (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber)) !== null && _b !== void 0 ? _b : EMPTY_SUBSCRIPTION;\n };\n return AnonymousSubject;\n}(Subject));\nexport { AnonymousSubject };\n//# sourceMappingURL=Subject.js.map","import { __extends } from \"tslib\";\nimport { Subject } from './Subject';\nvar BehaviorSubject = (function (_super) {\n __extends(BehaviorSubject, _super);\n function BehaviorSubject(_value) {\n var _this = _super.call(this) || this;\n _this._value = _value;\n return _this;\n }\n Object.defineProperty(BehaviorSubject.prototype, \"value\", {\n get: function () {\n return this.getValue();\n },\n enumerable: false,\n configurable: true\n });\n BehaviorSubject.prototype._subscribe = function (subscriber) {\n var subscription = _super.prototype._subscribe.call(this, subscriber);\n !subscription.closed && subscriber.next(this._value);\n return subscription;\n };\n BehaviorSubject.prototype.getValue = function () {\n var _a = this, hasError = _a.hasError, thrownError = _a.thrownError, _value = _a._value;\n if (hasError) {\n throw thrownError;\n }\n this._throwIfClosed();\n return _value;\n };\n BehaviorSubject.prototype.next = function (value) {\n _super.prototype.next.call(this, (this._value = value));\n };\n return BehaviorSubject;\n}(Subject));\nexport { BehaviorSubject };\n//# sourceMappingURL=BehaviorSubject.js.map","import {\n LimeWebComponent,\n LimeWebComponentPlatform,\n ContextAwareStateOptions,\n StateOptions,\n} from '..';\nimport { getElement } from '@stencil/core';\nimport { BehaviorSubject, Observer } from 'rxjs';\n\ntype OptionFactory = (\n options: StateOptions,\n component: LimeWebComponent\n) => StateOptions;\n\n/**\n * @group Core\n * @internal\n */\nexport interface StateDecoratorConfig {\n /**\n * Name of the state service to use in the platform\n */\n name: string;\n\n /**\n * Name of the method on the service to use\n */\n method?: string;\n\n /**\n * Factory for creating options dynamically\n *\n * @param options - decorator options\n * @param component - the web component\n * @returns state options\n */\n optionFactory?: OptionFactory;\n}\n\ninterface Component {\n connectedCallback: () => void | Promise<void>;\n componentWillLoad: () => void | Promise<void>;\n componentWillUpdate: () => void | Promise<void>;\n componentDidUnload: () => void;\n disconnectedCallback: () => void | Promise<void>;\n}\n\ninterface Property {\n name: string;\n options: StateOptions;\n optionFactory?: OptionFactory;\n service: {\n name: string;\n method: string;\n };\n}\n\nfunction defaultOptionFactory(options: StateOptions) {\n return options;\n}\n\n/**\n * Create a new state decorator\n *\n * @param options - decorator options\n * @param config - decorator configuration\n * @returns state decorator\n * @public\n */\nexport function createStateDecorator(\n options: StateOptions,\n config: StateDecoratorConfig\n): PropertyDecorator {\n return (target: Component, property: string) => {\n const properties = getComponentProperties(\n target,\n property,\n options,\n config\n );\n\n if (properties.length === 1) {\n extendLifecycleMethods(target, properties);\n }\n };\n}\n\nconst componentProperties = new WeakMap<Component, Property[]>();\nconst componentSubscriptions = new WeakMap<object, Array<() => void>>();\nconst connectedComponents = new WeakMap<object, boolean>();\n\n/**\n * Get properties data for a component\n *\n * @param component - the component class containing the decorator\n * @param property - name of the property\n * @param options - decorator options\n * @param config - decorator configuration\n * @returns properties data for the component\n */\nfunction getComponentProperties(\n component: Component,\n property: string,\n options: StateOptions,\n config: StateDecoratorConfig\n): Property[] {\n let properties = componentProperties.get(component);\n if (!properties) {\n properties = [];\n componentProperties.set(component, properties);\n }\n\n properties.push({\n options: options,\n name: property,\n optionFactory: config.optionFactory || defaultOptionFactory,\n service: {\n name: config.name,\n method: config.method || 'subscribe',\n },\n });\n\n return properties;\n}\n\n/**\n * Extend the lifecycle methods on the component\n *\n * @param component - the component to extend\n * @param properties - the properties with which to extend the component\n */\nfunction extendLifecycleMethods(component: Component, properties: Property[]) {\n // `componentWillLoad` and `componentDidUnload` is included for backwards\n // compatibility reasons. The correct way to setup the subscriptions is in\n // `connectedCallback` and `disconnectedCallback`, but since not all\n // plugins might implement those methods yet we still have include them\n // until we make `connectedCallback` and `disconnectedCallback` required\n // on the interface.\n\n component.connectedCallback = createConnectedCallback(\n component.connectedCallback,\n properties\n );\n component.componentWillLoad = createComponentWillLoad(\n component.componentWillLoad,\n properties\n );\n component.componentDidUnload = createDisconnectedCallback(\n component.componentDidUnload\n );\n component.disconnectedCallback = createDisconnectedCallback(\n component.disconnectedCallback\n );\n}\n\nfunction createConnectedCallback(original: () => void, properties: Property[]) {\n return async function (this: LimeWebComponent, ...args) {\n connectedComponents.set(this, true);\n componentSubscriptions.set(this, []);\n await ensureLimeProps(this);\n\n const observable = new BehaviorSubject(this.context);\n watchProp(this, 'context', observable);\n\n for (const property of properties) {\n property.options = property.optionFactory(property.options, this);\n if (isContextAware(property.options)) {\n property.options.context = observable;\n }\n\n subscribe(this, property);\n }\n\n if (original) {\n return original.apply(this, args);\n }\n };\n}\n\nfunction createComponentWillLoad(\n original: () => void | Promise<void>,\n properties: Property[]\n) {\n return async function (...args) {\n if (connectedComponents.get(this) === true) {\n await ensureLimeProps(this);\n if (original) {\n return original.apply(this, args);\n }\n\n return;\n }\n\n const connectedCallback = createConnectedCallback(original, properties);\n\n return connectedCallback.apply(this, args);\n };\n}\n\nfunction createDisconnectedCallback(original: () => void) {\n return async function (...args) {\n let result;\n if (original) {\n result = original.apply(this, args);\n }\n\n unsubscribeAll(this);\n\n return result;\n };\n}\n\n/**\n * Check if the options are context aware\n *\n * @param options - state decorator options\n * @returns true if the options are context aware\n */\nfunction isContextAware(options: object): options is ContextAwareStateOptions {\n return 'context' in options;\n}\n\n/**\n * Make sure that all required lime properties are set on the web component\n *\n * @param target - the web component\n * @returns a promise that resolves when all properties are defined\n */\nfunction ensureLimeProps(target: LimeWebComponent): Promise<unknown> {\n const promises = [];\n if (!target.platform) {\n promises.push(waitForProp(target, 'platform'));\n }\n\n if (!target.context) {\n promises.push(waitForProp(target, 'context'));\n }\n\n if (promises.length === 0) {\n return Promise.resolve();\n }\n\n return Promise.all(promises);\n}\n\n/**\n * Wait for a property to be defined on an object\n *\n * @param target - the web component\n * @param property - the name of the property to watch\n * @returns a promise that will resolve when the property is set on the object\n */\nfunction waitForProp(\n target: LimeWebComponent,\n property: string\n): Promise<void> {\n const element = getElement(target);\n\n return new Promise((resolve) => {\n Object.defineProperty(element, property, {\n configurable: true,\n set: (value: unknown) => {\n delete element[property];\n element[property] = value;\n resolve();\n },\n });\n });\n}\n\nfunction watchProp<T>(\n target: LimeWebComponent,\n property: string,\n observer: Observer<T>\n) {\n const element = getElement(target);\n\n const { get, set } = Object.getOwnPropertyDescriptor(\n Object.getPrototypeOf(element),\n property\n );\n\n Object.defineProperty(element, property, {\n configurable: true,\n get: get,\n set: function (value: T) {\n set.call(this, value);\n observer.next(value);\n },\n });\n}\n\n/**\n * Subscribe to changes from the state\n *\n * @param component - the component instance\n * @param property - property to update when subscription triggers\n */\nfunction subscribe(component: LimeWebComponent, property: Property): void {\n const subscription = createSubscription(component, property);\n if (typeof subscription !== 'function') {\n return;\n }\n\n const subscriptions = componentSubscriptions.get(component);\n subscriptions.push(subscription);\n}\n\n/**\n * Unsubscribe to changes from the state\n *\n * @param component - the instance of the component\n */\nfunction unsubscribeAll(component: LimeWebComponent): void {\n const subscriptions = componentSubscriptions.get(component);\n\n for (const unsubscribe of subscriptions) unsubscribe();\n componentSubscriptions.set(component, []);\n}\n\n/**\n * Get a function that accepts a state, and updates the given property\n * on the given component with that state\n *\n * @param instance - the component to augment\n * @param property - name of the property on the component\n * @returns updates the state\n */\nfunction mapState(instance: unknown, property: string) {\n return (state: unknown) => {\n instance[property] = state;\n };\n}\n\n/**\n * Create a state subscription\n *\n * @param component - the component instance\n * @param property - the property on the component\n * @returns unsubscribe function\n */\nfunction createSubscription(\n component: LimeWebComponent,\n property: Property\n): () => void {\n const myOptions = { ...property.options };\n bindFunctions(myOptions, component);\n const name = property.service.name;\n\n const platform: LimeWebComponentPlatform = component.platform;\n if (!platform.has(name)) {\n throw new Error(`Service ${name} does not exist`);\n }\n\n const service = platform.get(name);\n\n return service[property.service.method](\n mapState(component, property.name),\n myOptions\n );\n}\n\n/**\n * Bind connect functions to the current scope\n *\n * @param options - options for the selector\n * @param scope - the current scope to bind to\n */\nfunction bindFunctions(options: StateOptions, scope: unknown) {\n if (options.filter) {\n options.filter = options.filter.map((func) => func.bind(scope));\n }\n\n if (options.map) {\n options.map = options.map.map((func) => func.bind(scope));\n }\n}\n","import {\n PlatformServiceName,\n StateOptions,\n StateDecoratorConfig,\n ContextAwareStateOptions,\n} from '../core';\nimport { createStateDecorator } from '../core/decorators/factory';\nimport { LimeType } from './limetype';\n\n/**\n * Config for the {@link SelectLimeTypes} state decorator\n * @public\n * @group Lime types\n */\nexport interface SelectLimeTypesOptions extends StateOptions {\n name?: string;\n}\n\n/**\n * Gets an object with all limetypes where name is used as key\n *\n * @param options - state decorator options\n * @returns state decorator\n * @public\n * @group Lime types\n */\nexport function SelectLimeTypes(\n options: SelectLimeTypesOptions = {}\n): PropertyDecorator {\n const config: StateDecoratorConfig = {\n name: PlatformServiceName.LimeTypeRepository,\n };\n\n return createStateDecorator(options, config);\n}\n\n/**\n * Get the limetype for the current context\n *\n * @param options - state decorator options\n * @returns state decorator\n * @public\n * @group Lime types\n */\nexport function SelectCurrentLimeType(\n options: ContextAwareStateOptions = {}\n): PropertyDecorator {\n const config: StateDecoratorConfig = {\n name: PlatformServiceName.LimeTypeRepository,\n };\n options.map = [currentLimetype, ...(options.map || [])];\n options.context = null;\n\n return createStateDecorator(options, config);\n}\n\nfunction currentLimetype(limetypes: Record<string, LimeType>) {\n const { limetype } = this.context;\n\n return limetypes[limetype];\n}\n","import { hasLabel, LimeType } from '.';\n\n/**\n * Creates a function to find a limetype by its label in a collection of limetypes.\n *\n * The returned function searches through a collection of limetypes and returns\n * the first one that matches the given label. This function is typically used\n * to generate a callback for decorators or other higher-order logic.\n *\n * @param label - The label of the limetype to find.\n * @returns A function that takes a collection of limetypes and returns the first\n * limetype that matches the label, or `undefined` if no match is found.\n *\n * @example\n * ```typescript\n * import { findLimetypeByLabel } from '@limetech/lime-web-components';\n *\n * const limetypes = {\n * company: { label: 'company', properties: {} },\n * person: { label: 'person', properties: {} },\n * };\n *\n * const findPersonLimetype = findLimetypeByLabel('person');\n * const personLimetype = findPersonLimetype(limetypes);\n * console.log(personLimetype); // { label: 'person', properties: {} }\n * ```\n *\n * @example\n * ```typescript\n * // Using `findLimetypeByLabel` as a callback for a decorator\n * import { findLimetypeByLabel, SelectLimeTypes } from '@limetech/lime-web-components';\n *\n * @SelectLimeTypes({\n * map: [findLimetypeByLabel('person')],\n * })\n * private personLimetype: LimeType;\n * ```\n *\n * @public\n * @group Lime types\n */\nexport const findLimetypeByLabel =\n (label: string) => (limetypes: Record<string, LimeType>) => {\n return Object.values(limetypes).find(hasLabel(label));\n };\n","import { LimeProperty, LimeType, PropertyType } from '.';\n\n/**\n * Retrieves all properties of a specific type from a limetype.\n *\n * This function filters the properties of a limetype and returns\n * those that match the specified property type.\n *\n * @param limetype - The limetype containing the properties.\n * @param type - The type of properties to retrieve.\n * @returns An array of properties that match the specified type.\n *\n * @public\n * @group Lime types\n */\nexport function getPropertiesByType(\n limetype: LimeType,\n type: PropertyType\n): LimeProperty[] {\n return Object.values(limetype.properties).filter(\n (property) => property.type === type\n );\n}\n","import { hasLabel, LimeProperty, LimeType } from '.';\n\n/**\n * Retrieves a property from a limetype by its label.\n *\n * This function searches through the properties of a given limetype\n * and returns the first property that matches the specified label.\n *\n * @param limetype - The limetype containing the properties.\n * @param label - The label of the property to retrieve.\n * @returns The property with the specified label, or `undefined` if no match is found.\n *\n * @public\n * @group Lime types\n */\nexport function getPropertyByLabel(\n limetype: LimeType,\n label: string\n): LimeProperty | undefined {\n return Object.values(limetype.properties).find(hasLabel(label));\n}\n","import { LimeProperty, LimeType } from '.';\n\n/**\n * Retrieves a property from a limetype by its name.\n *\n * This function extracts a specific property from a given limetype\n * based on the property's name.\n *\n * @param limetype - The limetype containing the properties.\n * @param propertyName - The name of the property to retrieve.\n * @returns The property with the specified name.\n * @throws Will throw an error if the property name does not exist in the limetype.\n *\n * @public\n * @group Lime types\n */\nexport function getPropertyByName(\n limetype: LimeType,\n propertyName: string\n): LimeProperty {\n return limetype.properties[propertyName];\n}\n","import { LimeProperty, LimeType } from '.';\n\n/**\n * Creates a function to check if a given object has a specific label.\n *\n * The returned function takes an object (a `LimeType` or `LimeProperty`) and\n * checks whether it contains the specified label. This function is typically\n * used as a callback for array methods like `.find` or `.filter`.\n *\n * @param label - The label to check for.\n * @returns A function that takes an optional object and returns `true` if the label matches, or `false` otherwise.\n *\n * @example\n * ```typescript\n * import { hasLabel } from '@limetech/lime-web-components';\n *\n * const properties = [\n * { label: 'name', type: 'string' },\n * { label: 'email', type: 'string' },\n * ];\n *\n * const emailProperty = properties.find(hasLabel('email'));\n * console.log(emailProperty); // { label: 'email', type: 'string' }\n * ```\n *\n * @public\n * @group Lime types\n */\nexport const hasLabel =\n (label: string) => (object?: LimeType | LimeProperty) => {\n return object?.label === label;\n };\n","import { LimeObjectRepository as Service } from './repository';\nimport { PlatformServiceName } from '../core/platform';\n\nconst SERVICE_NAME = 'state.limeobjects';\n\nPlatformServiceName.LimeObjectRepository = SERVICE_NAME;\n\ndeclare module '../core/platform' {\n interface PlatformServiceNameType {\n /**\n * @see {@link Service | LimeObjectRepository}\n */\n LimeObjectRepository: typeof SERVICE_NAME;\n }\n\n interface LimeWebComponentPlatform {\n get(name: PlatformServiceNameType['LimeObjectRepository']): Service;\n }\n}\n","import {\n PlatformServiceName,\n StateOptions,\n StateDecoratorConfig,\n LimeWebComponent,\n ContextAwareStateOptions,\n} from '../core';\nimport { createStateDecorator } from '../core/decorators/factory';\n\n/**\n * Config for the {@link SelectLimeObjects} state decorator\n * @public\n * @group Lime objects\n */\nexport interface SelectLimeObjectsOptions extends StateOptions {\n /**\n * LimeType of the object\n */\n limetype?: string;\n\n /**\n * A function to get the limetype\n */\n getLimetype?: (component: LimeWebComponent) => string;\n\n /**\n * Id of the limeobject\n */\n id?: number;\n}\n\n/**\n * Get a list of limeobjects\n *\n * @param options - state decorator options\n * @returns state decorator\n * @public\n * @group Lime objects\n */\nexport function SelectLimeObjects(\n options: SelectLimeObjectsOptions = {}\n): PropertyDecorator {\n const config: StateDecoratorConfig = {\n name: PlatformServiceName.LimeObjectRepository,\n optionFactory: createOptions,\n };\n\n return createStateDecorator(options, config);\n}\n\n/**\n * Get the limeobject for the current context\n *\n * @param options - state decorator options\n * @returns state decorator\n * @public\n * @group Lime objects\n */\nexport function SelectCurrentLimeObject(\n options: ContextAwareStateOptions = {}\n): PropertyDecorator {\n const config: StateDecoratorConfig = {\n name: PlatformServiceName.LimeObjectRepository,\n };\n options.map = [currentLimeobject, ...(options.map || [])];\n options.context = null;\n\n return createStateDecorator(options, config);\n}\n\nfunction currentLimeobject(limeobjects: Record<string, Array<{ id: string }>>) {\n const { limetype, id } = this.context;\n\n if (!limeobjects[limetype]) {\n return;\n }\n\n return limeobjects[limetype].find((object) => object.id === id);\n}\n\nfunction createOptions(\n options: SelectLimeObjectsOptions,\n component: LimeWebComponent\n): StateOptions {\n if (options.getLimetype) {\n options.limetype = options.getLimetype(component);\n }\n\n return options;\n}\n","import { LimeWebComponentContext, ConfigMetadata } from '../core';\nimport { Expression } from '../query';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport { LimeObject } from '../limeobject';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport { LimeType } from '../limetype';\n\n/**\n * Base marker interface for all commands in the command bus pattern.\n *\n * {@link AnyCommand} serves as the root interface for the command pattern implementation.\n * All commands must extend this interface (either directly or through {@link LimeObjectCommand}\n * or {@link LimeObjectBulkCommand}) to be handled by the {@link CommandBus}.\n *\n * Commands represent user actions or operations that can be executed, such as:\n * - Exporting data to Excel\n * - Sending emails\n * - Generating reports\n * - Creating or deleting records\n * - Custom business logic operations\n *\n * > **Important:** All properties of a command must be serializable and publicly assignable:\n * >\n * > **Serialization requirements:**\n * > - Use primitive types (string, number, boolean)\n * > - Use plain objects and arrays\n * > - Use serializable custom types (like {@link Expression})\n * > - Avoid functions, DOM elements, class instances with methods, circular references, etc.\n * >\n * > **Assignability requirements:**\n * > - All properties must be public (not private or protected)\n * > - Properties cannot be readonly after instantiation\n * > - Constructor parameters are optional for command creation\n * >\n * > The platform creates commands by instantiating the class without constructor arguments,\n * > then directly assigning values to properties. Commands may also be serialized for storage,\n * > transmission, or recreation via {@link CommandBus.createCommand}.\n *\n * @example\n * ```typescript\n * @Command({ id: 'generate-report' })\n * export class GenerateReportCommand implements AnyCommand {\n * public reportType: string;\n * public startDate: string; // ISO date string, not Date object\n * public endDate: string;\n * }\n * ```\n *\n * @see {@link LimeObjectCommand} for commands operating on a single object\n * @see {@link LimeObjectBulkCommand} for commands operating on multiple objects\n * @see {@link CommandBus} for executing commands\n *\n * @public\n * @group Command bus\n */\nexport interface AnyCommand {}\n\n/**\n * A command that operates on a single {@link LimeObject}.\n *\n * {@link LimeObjectCommand} is used for actions that target a specific record,\n * such as sending an email to a contact, generating a PDF for a deal, or\n * archiving a specific company. The context property identifies which object\n * the command should operate on.\n *\n * @example\n * ```typescript\n * @Command({ id: 'send-email' })\n * export class SendEmailCommand implements LimeObjectCommand {\n * public context: LimeWebComponentContext & { limetype: string; id: number };\n * public subject: string;\n * public body: string;\n *\n * constructor(\n * context?: LimeWebComponentContext & { limetype: string; id: number },\n * subject?: string,\n * body?: string\n * ) {\n * this.context = context;\n * this.subject = subject;\n * this.body = body;\n * }\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Execute a single-object command\n * const commandBus = platform.get(PlatformServiceName.CommandBus);\n *\n * const command = new SendEmailCommand(\n * context,\n * 'Meeting Invitation',\n * 'Please join us for a meeting...'\n * );\n *\n * await commandBus.handle(command);\n * ```\n *\n * @public\n * @group Command bus\n */\nexport interface LimeObjectCommand extends AnyCommand {\n /**\n * Context describing the {@link LimeObject} the command will operate on.\n *\n * Must include both `limetype` (the type of object) and `id` (the specific\n * object's identifier). This ensures the command knows exactly which record\n * to target.\n */\n context: LimeWebComponentContext & { limetype: string; id: number };\n}\n\n/**\n * A command that operates on multiple {@link LimeObject | LimeObjects} of a single {@link LimeType}.\n *\n * {@link LimeObjectBulkCommand} is used for batch operations on multiple records,\n * such as exporting selected deals to Excel, sending bulk emails, or mass-updating\n * status fields. The filter property determines which objects are included in the operation.\n *\n * > **Important:** Do not assume a specific filter structure in your command handler.\n * > The filter expression can vary depending on the user's selection:\n * > - **Specific selection**: `{ key: 'id', op: 'IN', exp: [1, 2, 3] }` (selected rows)\n * > - **Select all with criteria**: `{ key: 'status', op: '=', exp: 'won' }` (filtered view)\n * > - **Select all**: `null` (all objects in the limetype)\n * >\n * > Always pass the filter to your data queries rather than parsing its structure.\n *\n * @example\n * ```typescript\n * @Command({ id: 'export-to-excel' })\n * export class ExportToExcelCommand implements LimeObjectBulkCommand {\n * public context: LimeWebComponentContext & { limetype: string };\n * public filter: Expression | null;\n * public includeRelations: boolean;\n *\n * constructor(\n * context?: LimeWebComponentContext & { limetype: string },\n * filter?: Expression | null,\n * includeRelations: boolean = false\n * ) {\n * this.context = context;\n * this.filter = filter;\n * this.includeRelations = includeRelations;\n * }\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Execute a bulk command on selected items\n * const commandBus = platform.get(PlatformServiceName.CommandBus);\n *\n * const selectedFilter: Expression = {\n * key: 'id',\n * op: 'IN',\n * exp: [1, 2, 3, 4, 5]\n * };\n *\n * const command = new ExportToExcelCommand(\n * { limetype: 'deal' },\n * selectedFilter,\n * true\n * );\n *\n * await commandBus.handle(command);\n * ```\n *\n * @example\n * ```typescript\n * // Bulk command with parent context (related objects)\n * const command = new UpdateStatusCommand(\n * {\n * limetype: 'deal',\n * parent: { limetype: 'company', id: 123 }\n * },\n * {\n * key: 'status',\n * op: '=',\n * exp: 'pending'\n * },\n * 'active' // New status value\n * );\n * // This will update all pending deals for company #123\n * ```\n *\n * @public\n * @group Command bus\n */\nexport interface LimeObjectBulkCommand extends AnyCommand {\n /**\n * Context describing the {@link LimeType} the command will operate on.\n *\n * Must include `limetype` to identify which type of objects to operate on.\n * If `parent` is set on the context, it indicates that the {@link LimeObject | LimeObjects}\n * are all related to a common parent {@link LimeObject} via a `belongsto` relation.\n *\n * @example\n * ```typescript\n * // All deals (no parent filter)\n * context = { limetype: 'deal' }\n *\n * // Only deals related to a specific company\n * context = { limetype: 'deal', parent: { limetype: 'company', id: 456 } }\n * ```\n */\n context: LimeWebComponentContext & { limetype: string };\n\n /**\n * An {@link Expression} describing which {@link LimeObject | LimeObjects} to operate on.\n *\n * Can be `null` to operate on all objects (subject to parent context filtering),\n * or a filter expression to limit the operation to specific records.\n *\n * @example\n * ```typescript\n * // Operate on selected IDs\n * filter = { key: 'id', op: 'IN', exp: [1, 2, 3] };\n *\n * // Operate on objects matching criteria\n * filter = {\n * op: 'AND',\n * exp: [\n * { key: 'status', op: '=', exp: 'active' },\n * { key: 'value', op: '>', exp: 10000 }\n * ]\n * };\n *\n * // Operate on all objects\n * filter = null;\n * ```\n */\n filter: Expression | null;\n}\n\n/**\n * @public\n * @group Command bus\n */\nexport type CommandClass<T extends AnyCommand = AnyCommand> = new (\n ...args: unknown[]\n) => T;\n\n/**\n * @public\n * @group Command bus\n */\nexport type CommandIdentifier<T extends AnyCommand = AnyCommand> =\n | CommandClass<T>\n | string;\n\n/**\n * Service for registering and executing commands using the command pattern.\n *\n * The {@link CommandBus} is the central hub for the command pattern implementation.\n * It manages command registration, handler lookup, and command execution. Commands\n * are decoupled from their handlers, allowing for flexible middleware chains and\n * cross-cutting concerns like logging, validation, and authorization.\n *\n * Key responsibilities:\n * - Register commands with their handlers\n * - Execute commands through their registered handlers\n * - Support middleware for command pipeline\n * - Dispatch command lifecycle events\n * - Provide command metadata and discovery\n *\n * @example\n * ```typescript\n * // Register and execute a command\n * const commandBus = platform.get(PlatformServiceName.CommandBus);\n *\n * if (commandBus.isSupported(SendEmailCommand)) {\n * const command = new SendEmailCommand(context, 'Subject', 'Body');\n * await commandBus.handle(command);\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Register a custom command handler\n * const commandBus = platform.get(PlatformServiceName.CommandBus);\n *\n * const handler = {\n * handle: async (command: GenerateReportCommand) => {\n * console.log('Generating report...');\n * return { success: true, reportUrl: '/reports/123.pdf' };\n * }\n * };\n *\n * commandBus.register(\n * GenerateReportCommand,\n * handler,\n * {\n * title: 'Generate Report',\n * description: 'Creates a PDF report',\n * icon: 'file-pdf'\n * }\n * );\n * ```\n *\n * @see {@link AnyCommand} for base command interface\n * @see {@link CommandHandler} for handler interface\n * @see {@link CommandMiddleware} for middleware implementation\n *\n * @public\n * @group Command bus\n */\nexport interface CommandBus extends CommandHandler {\n /**\n * Register a command to be executed by the given handler.\n *\n * Associates a command class with a handler that will process instances\n * of that command when {@link CommandBus.handle} is called.\n *\n * @param commandClass - The command class to register\n * @param handler - The {@link CommandHandler} instance that will execute the command\n *\n * @example\n * ```typescript\n * commandBus.register(SendEmailCommand, {\n * handle: async (command: SendEmailCommand) => {\n * // Send email logic\n * return { success: true };\n * }\n * });\n * ```\n */\n register(commandClass: CommandClass, handler: CommandHandler): void;\n\n /**\n * Register a command to be executed by the given handler\n *\n * @param commandClass - type of command\n * @param handler - the handler instance used to execute the command\n * @param metadata - metadata for the command\n * @beta\n */\n register(\n commandClass: CommandClass,\n handler: CommandHandler,\n // TODO combine signatures when CommandMetadata is also public\n metadata?: Omit<CommandMetadata, 'id'>\n ): void;\n\n /**\n * Execute the given command with it's registered command handler\n *\n * @param command - command to execute\n *\n * @returns result from the command handler\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n handle(command: AnyCommand): any;\n\n /**\n * Check if a command is supported\n *\n * @param commandId - identifier of the command. Can be either the class or the string the class was registered with\n *\n * @returns true if the command is supported, false otherwise\n */\n isSupported(commandId: CommandIdentifier): boolean;\n\n /**\n * Get a handler associated with a command\n *\n * @param commandClass - The command class\n *\n * @returns the handler for the command class\n */\n getHandler(commandClass: CommandClass): CommandHandler;\n\n /**\n * Get a list of configs for all registered commands\n *\n * @beta\n */\n getAll?(): CommandMetadata[];\n\n /**\n * Create a command instance from a {@link CommandConfig}\n *\n * @param config - The command configuration\n * @throws Thrown if the command has not been registered yet\n */\n createCommand<Key extends keyof CommandRegistry>(\n config: CommandConfig<CommandRegistry[Key], Key>\n ): CommandRegistry[Key];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n createCommand<T = any, Key extends string = string>(\n config: CommandConfig<T, Exclude<Key, keyof CommandRegistry>>\n ): T;\n}\n\n/**\n * Service for executing commands\n * @public\n * @group Command bus\n */\nexport interface CommandHandler {\n /**\n * Handle the execution of the given command\n *\n * @param command - the command to handle\n *\n * @returns the result of the operation\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n handle(command: AnyCommand): any;\n}\n\n/**\n * @public\n * @group Command bus\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type CallableCommandMiddleware = (command: AnyCommand) => any;\n\n/**\n * Middleware for the command bus\n * @public\n * @group Command bus\n */\nexport interface CommandMiddleware {\n /**\n * Execute the middleware before passing the command further down the chain\n *\n * @param command - the command that is being handled\n * @param next - the next middleware in the chain\n *\n * @returns the result of the operation\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n execute(command: AnyCommand, next: CallableCommandMiddleware): any;\n}\n\n/**\n * Events dispatched by the commandbus event middleware.\n *\n * The command bus dispatches events at key points in the command lifecycle,\n * allowing you to observe command execution, access results, handle errors,\n * or even prevent commands from executing.\n *\n * @example\n * ```typescript\n * // Listen for command results\n * document.addEventListener(CommandEventName.Handled, (event: CommandEvent) => {\n * console.log('Command executed:', event.detail.command);\n * console.log('Result:', event.detail.result);\n * });\n *\n * // Handle command errors\n * document.addEventListener(CommandEventName.Failed, (event: CommandEvent) => {\n * console.error('Command failed:', event.detail.error);\n * });\n *\n * // Prevent a command from executing\n * document.addEventListener(CommandEventName.Received, (event: CommandEvent) => {\n * if (shouldBlockCommand(event.detail.command)) {\n * event.preventDefault();\n * }\n * });\n * ```\n *\n * @public\n * @group Command bus\n */\nexport enum CommandEventName {\n /**\n * Dispatched when the command has been received by the commandbus.\n * Calling `preventDefault()` on the event will stop the command from being handled\n *\n * @see {@link CommandEvent}\n */\n Received = 'command.received',\n\n /**\n * Dispatched when the command has been handled by the commandbus.\n * The event detail includes the result returned by the command handler.\n *\n * @see {@link CommandEvent}\n */\n Handled = 'command.handled',\n\n /**\n * Dispatched if an error occurs while handling the command.\n * The event detail includes the error that was thrown.\n *\n * @see {@link CommandEvent}\n */\n Failed = 'command.failed',\n}\n\n/**\n * @public\n * @group Command bus\n */\nexport type CommandEventDetail = {\n command: AnyCommand;\n result?: unknown;\n error?: unknown;\n};\n\n/**\n * @public\n * @group Command bus\n */\nexport type CommandEvent = CustomEvent<CommandEventDetail>;\n\n/**\n * @public\n * @group Command bus\n */\nexport interface CommandOptions {\n /**\n * Id of the command\n */\n id: string;\n}\n\n/**\n * Config for describing a command.\n *\n * Used with {@link CommandBus.createCommand} to create command instances from\n * configuration data. This is useful for storing command definitions or\n * transmitting them across boundaries.\n *\n * @public\n * @group Command bus\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface CommandConfig<TCommand = any, TKey extends string = string> {\n /**\n * Id of the command.\n *\n * Specified by the {@link Command} decorator when declaring the command.\n */\n id: TKey;\n\n /**\n * Optional parameters to set when creating the command from the config.\n *\n * **All values must be serializable** (primitive types, plain objects, arrays).\n * This matches the requirement that all command properties must be serializable\n * as defined in {@link AnyCommand}.\n */\n params?: {\n [K in keyof TCommand]?: TCommand[K];\n };\n}\n\n/**\n * Registry for commands\n *\n * This interface is designed to be extended by consumers of Lime Web\n * Components using module augmentation. Each key in the interface corresponds\n * to the id of a registered command, and the value is the type of the command.\n * This allows for type-safe access to commands within the application.\n *\n * @example\n * ```ts\n * declare module '@limetech/lime-web-components' {\n * interface CommandRegistry {\n * myCommand: MyCommand;\n * }\n * }\n * ```\n *\n * @beta\n * @group Command bus\n */\nexport interface CommandRegistry {}\n\n/**\n * Metadata for a command\n *\n * @beta\n * @group Command bus\n */\nexport type CommandMetadata = ConfigMetadata & {\n /**\n * Command id\n */\n id: keyof CommandRegistry | (string & {});\n};\n\n/**\n * Decorator to register a class as a command with a unique identifier.\n *\n * The `@Command` decorator marks a class as a command and assigns it a unique ID\n * that can be used for command lookup, registration, and execution. This decorator\n * is essential for the command pattern implementation and enables type-safe command\n * creation through the {@link CommandRegistry}.\n *\n * @param options - A {@link CommandOptions} object containing the unique command ID\n * @returns Decorator function that registers the command class\n *\n * @example\n * ```typescript\n * // Basic command definition\n * @Command({ id: 'generate-pdf-report' })\n * export class GeneratePdfReportCommand implements AnyCommand {\n * public reportType: string;\n * public includeCharts: boolean;\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Single-object command with context\n * @Command({ id: 'archive-deal' })\n * export class ArchiveDealCommand implements LimeObjectCommand {\n * public context: LimeWebComponentContext & { limetype: string; id: number };\n * public reason: string;\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Bulk command with filter\n * @Command({ id: 'bulk-update-status' })\n * export class BulkUpdateStatusCommand implements LimeObjectBulkCommand {\n * public context: LimeWebComponentContext & { limetype: string };\n * public filter: Expression | null;\n * public newStatus: string;\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Register in CommandRegistry for type safety\n * declare module '@limetech/lime-web-components' {\n * interface CommandRegistry {\n * 'generate-pdf-report': GeneratePdfReportCommand;\n * 'archive-deal': ArchiveDealCommand;\n * 'bulk-update-status': BulkUpdateStatusCommand;\n * }\n * }\n *\n * // Now you can use createCommand with type safety\n * const command = commandBus.createCommand({\n * id: 'generate-pdf-report',\n * params: { reportType: 'monthly', includeCharts: true }\n * });\n * ```\n *\n * @public\n * @group Command bus\n */\nexport function Command(options: CommandOptions) {\n return (commandClass: CommandClass) => {\n setCommandId(commandClass, options.id);\n setHasInstance(commandClass, options.id);\n };\n}\n\nfunction setCommandId(commandClass: CommandClass, id: string) {\n commandClass['commandId'] = id;\n}\n\nfunction setHasInstance(commandClass: CommandClass, id: string) {\n Object.defineProperty(commandClass, Symbol.hasInstance, {\n value: (instance: unknown) => {\n return getCommandIds(instance).includes(id);\n },\n });\n}\n\n/**\n * Get the registered id of the command\n *\n * @param value - either a command or a command identifier\n *\n * @returns id of the command\n * @public\n * @group Command bus\n */\nexport function getCommandId(\n value: AnyCommand | CommandIdentifier\n): keyof CommandRegistry | (string & {}) {\n if (typeof value === 'string') {\n return value;\n }\n\n if (value && value.constructor && value.constructor['commandId']) {\n return value.constructor['commandId'];\n }\n\n if (value && value['commandId']) {\n return value['commandId'];\n }\n\n return null;\n}\n\n/**\n * Get all registered ids of a command and its parent classes\n *\n * @param value - either a command or a command identifier\n *\n * @returns ids of the command\n * @public\n * @group Command bus\n */\nexport function getCommandIds(\n value: AnyCommand | CommandIdentifier\n): Array<keyof CommandRegistry | (string & {})> {\n let ids: string[] = [];\n let id: string;\n let commandClass = value;\n\n while ((id = getCommandId(commandClass))) {\n ids = [...ids, id];\n commandClass = Object.getPrototypeOf(commandClass);\n }\n\n return [...new Set(ids)];\n}\n","import { CommandBus as Service } from './commandbus';\nimport { PlatformServiceName } from '../core/platform';\n\nconst SERVICE_NAME = 'commandBus';\n\nPlatformServiceName.CommandBus = SERVICE_NAME;\n\ndeclare module '../core/platform' {\n interface PlatformServiceNameType {\n /**\n * @see {@link Service | CommandBus}\n */\n CommandBus: typeof SERVICE_NAME;\n }\n\n interface LimeWebComponentPlatform {\n get(name: PlatformServiceNameType['CommandBus']): Service;\n }\n}\n","import { Command, LimeObjectBulkCommand } from '../../commandbus';\nimport { Expression } from '../../query';\nimport { LimeWebComponentContext } from '../../core';\n\nconst COMMAND_ID = 'limeobject.bulk-create-dialog' as const;\ndeclare module '../../commandbus' {\n interface CommandRegistry {\n [COMMAND_ID]: BulkCreateDialogCommand;\n }\n}\n\n/**\n * Open a dialog for bulk creating limeobjects\n *\n *\n * ### Flow example\n * Let's have a look at the general flow by going through the concrete example of adding several persons to a marketing activity:\n * - Go to the table view of persons.\n * - Filter everyone who should be included in the marketing activity.\n * - Select 'Bulk create objects' form the action menu.\n * - Fill out the form and click 'create'.\n * - A toast message appears and gives you 5 seconds to undo the action before it creates the corresponding task.\n * - Another toast message will inform you after the task is completed.\n * - If the task ended successful you can go to the participant table view and check the result.\n *\n * ### Configuration\n * In order to activate the feature go to a table configuration in lime-admin to the limetype you want to bulk create from\n * and add the following configuration:\n *\n * ```json\n * \"actions\": [\n * {\n * \"id\": \"limeobject.bulk-create-dialog\",\n * \"params\": {\n * \"relation\": \"<name of relation>\"\n * }\n * }\n * ],\n * ```\n *\n * @id `limeobject.bulk-create-dialog`\n * @public\n * @group Lime objects\n */\n@Command({\n id: COMMAND_ID,\n})\nexport class BulkCreateDialogCommand implements LimeObjectBulkCommand {\n public context: LimeWebComponentContext;\n\n /**\n * A query describing what limeobjects to create new limeobjects from. Each object from the result will result in a\n * new related limeobject to be created\n */\n public filter: Expression;\n\n /**\n * The name of the relation on the limetype to create objects of\n */\n public relation: string;\n}\n","import { LimeWebComponentContext } from '../../core';\nimport { LimeType } from '../../limetype';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport { LimeObject } from '..';\nimport { Command } from '../../commandbus';\n\nconst COMMAND_ID = 'limeobject.create-dialog' as const;\ndeclare module '../../commandbus' {\n interface CommandRegistry {\n [COMMAND_ID]: CreateLimeobjectDialogCommand;\n }\n}\n\n/**\n * Open a dialog for creating a new limeobject or editing a specific limeobject\n *\n * The create dialog is implemented as a command so a plugin can easily replace the original dialog with a custom one.\n * Check out the \"Hello, Event!\" tutorial for a detailed description on how to implement your own create dialog.\n *\n * This dialog also useful to edit a limeobject that already exists\n *\n * @id `limeobject.create-dialog`\n * @public\n * @group Lime objects\n */\n@Command({\n id: COMMAND_ID,\n})\nexport class CreateLimeobjectDialogCommand {\n /**\n * The limetype of the object to create\n */\n public limetype: LimeType;\n\n /**\n * Default data to populate the form with\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public limeobject?: any;\n\n /**\n * Specifies if routing to limeobject should be done after confirmation\n */\n public route?: boolean = false;\n\n /*\n * Title of the dialog\n */\n public title?: string;\n\n /*\n * Subtitle of the dialog\n */\n public subtitle?: string;\n\n /*\n * Current context\n */\n public context?: LimeWebComponentContext;\n\n /**\n * When `context` is used, this is the name of the relation on the\n * reference {@link LimeObject} to use when auto attaching the new object.\n *\n */\n public autoAttachRelation?: string;\n\n /**\n * Specifies any command that can be used to save the result of the dialog.\n * If not specified, it will default to the {@link SaveLimeObjectCommand}\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public saveCommand?: any;\n}\n","import { Command, LimeObjectCommand } from '../../commandbus';\nimport { LimeWebComponentContext } from '../../core';\n\nconst COMMAND_ID = 'limeobject.delete-object' as const;\ndeclare module '../../commandbus' {\n interface CommandRegistry {\n [COMMAND_ID]: DeleteObjectCommand;\n }\n}\n\n/**\n * Deletes the object from the database\n *\n * @id `limeobject.delete-object`\n * @public\n * @group Lime objects\n */\n@Command({\n id: COMMAND_ID,\n})\nexport class DeleteObjectCommand implements LimeObjectCommand {\n public context: LimeWebComponentContext;\n}\n","import { Command, LimeObjectCommand } from '../../commandbus';\nimport { LimeWebComponentContext } from '../../core';\n\nconst COMMAND_ID = 'limeobject.object-access' as const;\ndeclare module '../../commandbus' {\n interface CommandRegistry {\n [COMMAND_ID]: OpenObjectAccessDialogCommand;\n }\n}\n\n/**\n * Open a dialog to view and edit object access information\n *\n * @id `limeobject.object-access`\n * @public\n * @group Lime objects\n */\n@Command({\n id: COMMAND_ID,\n})\nexport class OpenObjectAccessDialogCommand implements LimeObjectCommand {\n public context: LimeWebComponentContext;\n}\n","import { LimeObject } from '../../limeobject';\nimport { Command, LimeObjectCommand } from '../../commandbus';\nimport { LimeWebComponentContext } from '../../core';\n\nconst COMMAND_ID = 'limeobject.save-object' as const;\ndeclare module '../../commandbus' {\n interface CommandRegistry {\n [COMMAND_ID]: SaveLimeObjectCommand;\n }\n}\n\n/**\n * Saves the object to the database\n *\n * @id `limeobject.save-object`\n * @public\n * @group Lime objects\n */\n@Command({\n id: COMMAND_ID,\n})\nexport class SaveLimeObjectCommand implements LimeObjectCommand {\n public context: LimeWebComponentContext;\n\n /**\n * The limeobject to save\n */\n public limeobject: LimeObject;\n\n /**\n * Specifies if routing to limeobject should be done after confirmation\n */\n public route?: boolean = false;\n\n /**\n * @beta\n * Specifies an optional save label to be displayed in the create-object dialog\n */\n public label?: string;\n}\n","/**\n * @public\n * @group Query\n */\nexport interface Query {\n limetype: string;\n limit?: number;\n offset?: number;\n orderBy?: object[];\n filter?: Expression;\n responseFormat: {\n object?: object;\n aggregates?: object;\n };\n}\n\n/**\n * @public\n * @group Query\n */\nexport interface QueryResponse {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n objects: any[];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n aggregates: any;\n}\n\n/**\n * @public\n * @group Query\n */\nexport type Expression =\n | AndOrExpression\n | NotExpression\n | InFilterExpression\n | InExpression\n | BasicExpression;\n\n/**\n * @public\n * @group Query\n */\nexport type AndOrExpression = {\n op: Operator.AND | Operator.OR;\n exp: Expression[];\n};\n\n/**\n * @public\n * @group Query\n */\nexport type NotExpression = {\n op: Operator.NOT;\n exp: Expression;\n};\n\n/**\n * @public\n * @group Query\n */\nexport type InFilterExpression = {\n type: 'filter';\n key: string;\n op: Operator.IN;\n exp: string;\n};\n\n/**\n * @public\n * @group Query\n */\nexport type InExpression = {\n key: string;\n op: Operator.IN;\n exp: ExpressionValue[];\n};\n\n/**\n * @public\n * @group Query\n */\nexport type BasicExpression = {\n key: string;\n op: BasicOperator;\n exp: ExpressionValue;\n};\n\n/**\n * @public\n * @group Query\n */\nexport type BasicOperator =\n | Operator.EQUALS\n | Operator.NOT_EQUALS\n | Operator.GREATER\n | Operator.LESS\n | Operator.BEGINS\n | Operator.LIKE\n | Operator.LESS_OR_EQUAL\n | Operator.GREATER_OR_EQUAL\n | Operator.ENDS;\n\n/**\n * @public\n * @group Query\n */\nexport type ExpressionValue = string | number | boolean | null;\n\n/**\n * @public\n * @group Query\n */\nexport enum Operator {\n AND = 'AND',\n OR = 'OR',\n NOT = '!',\n EQUALS = '=',\n NOT_EQUALS = '!=',\n GREATER = '>',\n LESS = '<',\n IN = 'IN',\n BEGINS = '=?',\n LIKE = '?',\n LESS_OR_EQUAL = '<=',\n GREATER_OR_EQUAL = '>=',\n ENDS = '=$',\n}\n\n/**\n * @public\n * @group Query\n */\nexport interface Filter {\n id: string;\n limetype: string;\n name: {\n [language: string]: string;\n };\n filter: Expression;\n description?: {\n [language: string]: string;\n };\n iduser?: number;\n}\n\n/**\n *\n * @public\n * @group Query\n */\nexport const AggregateOperator = {\n Count: 'COUNT',\n Sum: 'SUM',\n Average: 'AVG',\n Maximum: 'MAX',\n Minimum: 'MIN',\n} as const;\n\n/**\n *\n * @public\n * @group Query\n */\nexport type AggregateOperator =\n (typeof AggregateOperator)[keyof typeof AggregateOperator];\n","import { QueryService } from './service';\nimport { PlatformServiceName } from '../core/platform';\n\nconst SERVICE_NAME = 'query';\n\nPlatformServiceName.Query = SERVICE_NAME;\n\ndeclare module '../core/platform' {\n interface PlatformServiceNameType {\n /**\n * @see {@link QueryService}\n */\n Query: typeof SERVICE_NAME;\n }\n\n interface LimeWebComponentPlatform {\n get(name: PlatformServiceNameType['Query']): QueryService;\n }\n}\n","/**\n * HTTP service for sending requests to backend endpoints\n *\n * The {@link HttpClient} is the primary interface for making HTTP requests\n * within the Lime platform.\n *\n * By default, all requests expect JSON responses. For other content types\n * (text, binary data, etc.), set the `responseType` in {@link HttpOptions}.\n *\n * All methods throw {@link HttpResponseError} on HTTP errors (4xx, 5xx status codes).\n *\n * @example\n * Basic GET request for JSON data\n * ```typescript\n * const http = platform.get(PlatformServiceName.Http);\n * const data = await http.get('my_addon/endpoint');\n * console.log(data);\n * ```\n *\n * @example\n * POST request with data and query parameters\n * ```typescript\n * const http = platform.get(PlatformServiceName.Http);\n * const response = await http.post(\n * 'my_addon/users',\n * { name: 'John Doe', email: 'john@example.com' },\n * { params: { notify: 'true' } }\n * );\n * ```\n *\n * @example\n * Error handling with HttpResponseError\n * ```typescript\n * const http = platform.get(PlatformServiceName.Http);\n * try {\n * const data = await http.get('my_addon/endpoint');\n * } catch (error) {\n * if (error.name === 'HttpResponseError') {\n * console.error(`HTTP ${error.status}: ${error.message}`);\n * console.error('Response:', error.response);\n * }\n * }\n * ```\n *\n * @example\n * Downloading a file as blob\n * ```typescript\n * const http = platform.get(PlatformServiceName.Http);\n * const blob = await http.get('my_addon/download/report.pdf', {\n * responseType: 'blob'\n * });\n * const url = URL.createObjectURL(blob);\n * window.open(url);\n * ```\n *\n * @public\n * @group HTTP\n */\nexport interface HttpClient {\n /**\n * Sends a GET request to retrieve data from the server\n *\n * @param url - Relative URL to the resource (e.g., 'my_addon/endpoint').\n * The URL is relative to the Lime CRM base URL.\n * @param options - Optional {@link HttpOptions} for query parameters, headers, or response type\n * @returns Promise resolving to the response data. Type depends on {@link HttpOptions.responseType}\n *\n * @throws {@link HttpResponseError} when the server responds with an error status (4xx, 5xx)\n *\n * @example\n * ```typescript\n * const http = platform.get(PlatformServiceName.Http);\n * const users = await http.get('my_addon/users', {\n * params: { active: 'true', limit: '10' }\n * });\n * ```\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n get(url: string, options?: HttpOptions): Promise<any>;\n\n /**\n * Sends a POST request to create new data on the server\n *\n * @param url - Relative URL to the resource (e.g., 'my_addon/endpoint')\n * @param data - Payload to send in the request body. Will be JSON-encoded by default.\n * @param options - Optional {@link HttpOptions} for query parameters, headers, or response type\n * @returns Promise resolving to the response data. Type depends on {@link HttpOptions.responseType}\n *\n * @throws {@link HttpResponseError} when the server responds with an error status (4xx, 5xx)\n *\n * @example\n * ```typescript\n * const http = platform.get(PlatformServiceName.Http);\n * const newUser = await http.post('my_addon/users', {\n * name: 'Jane Smith',\n * email: 'jane@example.com'\n * });\n * ```\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n post(url: string, data?: object, options?: HttpOptions): Promise<any>;\n\n /**\n * Sends a PATCH request to partially update existing data on the server\n *\n * @param url - Relative URL to the resource (e.g., 'my_addon/users/123')\n * @param data - Partial payload containing only the fields to update\n * @param options - Optional {@link HttpOptions} for query parameters, headers, or response type\n * @returns Promise resolving to the response data. Type depends on {@link HttpOptions.responseType}\n *\n * @throws {@link HttpResponseError} when the server responds with an error status (4xx, 5xx)\n *\n * @example\n * ```typescript\n * const http = platform.get(PlatformServiceName.Http);\n * await http.patch('my_addon/users/123', {\n * email: 'newemail@example.com'\n * });\n * ```\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n patch(url: string, data?: object, options?: HttpOptions): Promise<any>;\n\n /**\n * Sends a PUT request to replace existing data on the server\n *\n * @param url - Relative URL to the resource (e.g., 'my_addon/users/123')\n * @param data - Complete payload to replace the existing resource\n * @param options - Optional {@link HttpOptions} for query parameters, headers, or response type\n * @returns Promise resolving to the response data. Type depends on {@link HttpOptions.responseType}\n *\n * @throws {@link HttpResponseError} when the server responds with an error status (4xx, 5xx)\n *\n * @example\n * ```typescript\n * const http = platform.get(PlatformServiceName.Http);\n * await http.put('my_addon/users/123', {\n * name: 'Jane Doe',\n * email: 'jane@example.com',\n * role: 'admin'\n * });\n * ```\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n put(url: string, data?: object, options?: HttpOptions): Promise<any>;\n\n /**\n * Sends a DELETE request to remove data from the server\n *\n * @param url - Relative URL to the resource (e.g., 'my_addon/users/123')\n * @param options - Optional {@link HttpOptions} for query parameters or headers\n * @returns Promise resolving to the response data. Type depends on {@link HttpOptions.responseType}\n *\n * @throws {@link HttpResponseError} when the server responds with an error status (4xx, 5xx)\n *\n * @example\n * ```typescript\n * const http = platform.get(PlatformServiceName.Http);\n * await http.delete('my_addon/users/123');\n * ```\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n delete(url: string, options?: HttpOptions): Promise<any>;\n}\n\n/**\n * Configuration options for HTTP requests\n *\n * @example\n * ```typescript\n * const http = platform.get(PlatformServiceName.Http);\n * const options: HttpOptions = {\n * params: { search: 'John', limit: '10' },\n * headers: { 'X-Custom-Header': 'value' },\n * responseType: 'json'\n * };\n * const data = await http.get('my_addon/users', options);\n * ```\n *\n * @public\n * @group HTTP\n */\nexport interface HttpOptions {\n /**\n * Query parameters to append to the URL\n *\n * Parameters will be URL-encoded and appended to the request URL.\n *\n * @example\n * ```typescript\n * // Results in: my_addon/users?active=true&role=admin&role=user\n * const params = {\n * active: 'true',\n * role: ['admin', 'user']\n * };\n * ```\n */\n params?: HttpParams;\n\n /**\n * Additional HTTP headers to include in the request\n *\n * @example\n * ```typescript\n * const headers = {\n * 'Authorization': 'Bearer token123',\n * 'Accept-Language': 'en-US'\n * };\n * ```\n */\n headers?: HttpHeaders;\n\n /**\n * Expected response data type. Defaults to 'json'\n *\n * - `json`: Parse response as JSON (default)\n * - `text`: Get response as plain text string\n * - `blob`: Get response as binary Blob (for file downloads)\n * - `arraybuffer`: Get response as ArrayBuffer (for binary data processing)\n *\n * @example\n * ```typescript\n * // Download PDF file\n * const pdfBlob = await http.get('my_addon/report.pdf', {\n * responseType: 'blob'\n * });\n * ```\n */\n responseType?: HttpResponseType;\n}\n\n/**\n * URL query parameters for HTTP requests\n *\n * Key-value pairs that will be appended to the request URL as query string.\n * Array values will be repeated for the same parameter name.\n *\n * @public\n * @group HTTP\n */\nexport interface HttpParams {\n [param: string]: string | string[];\n}\n\n/**\n * HTTP headers for requests\n *\n * Custom headers to include in the HTTP request. Array values will be\n * joined as comma-separated values for the same header name.\n *\n * @public\n * @group HTTP\n */\nexport interface HttpHeaders {\n [header: string]: string | string[];\n}\n\n/**\n * Response data type for HTTP requests\n *\n * Determines how the response body will be parsed and returned.\n *\n * @public\n * @group HTTP\n */\nexport type HttpResponseType = 'text' | 'json' | 'arraybuffer' | 'blob';\n\n/**\n * HTTP method constants\n *\n * Standard HTTP methods as constant values. Useful for type-safe method\n * selection in custom HTTP utilities.\n *\n * @example\n * ```typescript\n * function makeRequest(method: HttpMethod, url: string) {\n * if (method === HttpMethod.Get) {\n * // Handle GET request\n * }\n * }\n *\n * makeRequest(HttpMethod.Post, 'my_addon/endpoint');\n * ```\n *\n * @public\n * @group HTTP\n */\nexport const HttpMethod = {\n Get: 'GET',\n Post: 'POST',\n Put: 'PUT',\n Delete: 'DELETE',\n Patch: 'PATCH',\n} as const;\n\n/**\n * Type definition for HTTP methods\n *\n * Union type of all values in the {@link HttpMethod} constant.\n *\n * @public\n * @group HTTP\n */\nexport type HttpMethod = (typeof HttpMethod)[keyof typeof HttpMethod];\n\n/**\n * Error thrown when an HTTP request fails\n *\n * This error is thrown by {@link HttpClient} methods when the server responds\n * with an error status code (4xx or 5xx).\n *\n * @example\n * ```typescript\n * const http = platform.get(PlatformServiceName.Http);\n *\n * try {\n * const data = await http.get('my_addon/data');\n * } catch (error) {\n * if (error.name !== 'HttpResponseError') {\n * throw error;\n * }\n *\n * if (error.status === 404) {\n * console.error('Resource not found');\n * } else if (error.status >= 500) {\n * console.error('Server error:', error.status);\n * }\n *\n * const body = await error.response.text();\n * console.error('Response body:', body);\n * }\n * ```\n *\n * @public\n * @group HTTP\n */\nexport interface HttpResponseError extends Error {\n name: 'HttpResponseError';\n\n /**\n * HTTP status code from the failed response\n */\n status: number;\n\n /**\n * The full Response object from the failed request\n *\n * Use this to access response headers or read the response body:\n * ```typescript\n * const body = await error.response.text();\n * const contentType = error.response.headers.get('content-type');\n * ```\n */\n response: Response;\n}\n","import { HttpClient } from './http';\nimport { PlatformServiceName } from '../core/platform';\n\nconst SERVICE_NAME = 'http';\n\nPlatformServiceName.Http = SERVICE_NAME;\n\ndeclare module '../core/platform' {\n interface PlatformServiceNameType {\n /**\n * @see {@link HttpClient}\n */\n Http: typeof SERVICE_NAME;\n }\n\n interface LimeWebComponentPlatform {\n get(name: PlatformServiceNameType['Http']): HttpClient;\n }\n}\n","import { EventDispatcher as Service } from './eventdispatcher';\nimport { PlatformServiceName } from '../core/platform';\n\nconst SERVICE_NAME = 'eventDispatcher';\n\nPlatformServiceName.EventDispatcher = SERVICE_NAME;\n\ndeclare module '../core/platform' {\n interface PlatformServiceNameType {\n /**\n * @see {@link Service | EventDispatcher}\n */\n EventDispatcher: typeof SERVICE_NAME;\n }\n\n interface LimeWebComponentPlatform {\n get(name: PlatformServiceNameType['EventDispatcher']): Service;\n }\n}\n","import { Translator } from './translator';\nimport { PlatformServiceName } from '../core/platform';\n\nconst SERVICE_NAME = 'translate';\n\nPlatformServiceName.Translate = SERVICE_NAME;\n\ndeclare module '../core/platform' {\n interface PlatformServiceNameType {\n /**\n * @see {@link Translate}\n */\n Translate: typeof SERVICE_NAME;\n }\n\n interface LimeWebComponentPlatform {\n get(name: PlatformServiceNameType['Translate']): Translator;\n }\n}\n","import { DialogRenderer } from './dialog';\nimport { PlatformServiceName } from '../core/platform';\n\nconst SERVICE_NAME = 'dialog';\n\nPlatformServiceName.Dialog = SERVICE_NAME;\n\ndeclare module '../core/platform' {\n interface PlatformServiceNameType {\n /**\n * @see {@link DialogRenderer}\n */\n Dialog: typeof SERVICE_NAME;\n }\n\n interface LimeWebComponentPlatform {\n get(name: PlatformServiceNameType['Dialog']): DialogRenderer;\n }\n}\n","import { KeybindingRegistry as Service } from './registry';\nimport { PlatformServiceName } from '../core/platform';\n\nconst SERVICE_NAME = 'keybindingRegistry';\n\nPlatformServiceName.KeybindingRegistry = SERVICE_NAME;\n\ndeclare module '../core/platform' {\n interface PlatformServiceNameType {\n /**\n * @see {@link Service | KeybindingRegistry}\n *\n * @note Work in progress, do not use!\n * @beta\n */\n KeybindingRegistry: typeof SERVICE_NAME;\n }\n\n interface LimeWebComponentPlatform {\n get(name: PlatformServiceNameType['KeybindingRegistry']): Service;\n }\n}\n","import { Navigator as Service } from './navigator';\nimport { PlatformServiceName } from '../core/platform';\n\nconst SERVICE_NAME = 'navigator';\n\nPlatformServiceName.Navigator = SERVICE_NAME;\n\ndeclare module '../core/platform' {\n interface PlatformServiceNameType {\n /**\n * @see {@link Service | Navigator}\n */\n Navigator: typeof SERVICE_NAME;\n }\n\n interface LimeWebComponentPlatform {\n get(name: PlatformServiceNameType['Navigator']): Service;\n }\n}\n","import { ContextAwareStateOptions, PlatformServiceName } from '../core';\nimport {\n createStateDecorator,\n StateDecoratorConfig,\n} from '../core/decorators/factory';\n\n/**\n * Config for the {@link SelectQueryParam} decorator\n * @public\n * @group Navigation\n */\nexport interface SelectQueryParamOptions extends ContextAwareStateOptions {\n /**\n * The query param to select\n */\n selector: string;\n}\n\n/**\n * Gets a named query param from the location\n *\n * @param options - state decorator options\n * @returns state decorator\n * @public\n * @group Navigation\n */\nexport function SelectQueryParam(\n options: SelectQueryParamOptions\n): PropertyDecorator {\n const config: StateDecoratorConfig = {\n name: PlatformServiceName.Navigator,\n };\n\n return createStateDecorator({ context: null, ...options }, config);\n}\n","import { Command } from '../commandbus';\nimport { Location } from './navigator';\n\nconst COMMAND_ID = 'navigator.navigate' as const;\ndeclare module '../commandbus' {\n interface CommandRegistry {\n [COMMAND_ID]: NavigateCommand;\n }\n}\n\n/**\n * Navigates to a new location\n *\n * @id `navigator.navigate`\n * @public\n * @group Navigation\n */\n@Command({\n id: COMMAND_ID,\n})\nexport class NavigateCommand implements Partial<Location> {\n public path?: string;\n\n public query?: Record<string, unknown>;\n\n public hash?: string;\n\n public state?: unknown;\n}\n","import { Notifications } from './notifications';\nimport { PlatformServiceName } from '../core/platform';\n\nconst SERVICE_NAME = 'notifications';\n\nPlatformServiceName.Notification = SERVICE_NAME;\n\ndeclare module '../core/platform' {\n interface PlatformServiceNameType {\n /**\n * @see {@link Notifications}\n */\n Notification: typeof SERVICE_NAME;\n }\n\n interface LimeWebComponentPlatform {\n get(name: PlatformServiceNameType['Notification']): Notifications;\n }\n}\n","import { RouteRegistry as Service } from './registry';\nimport { PlatformServiceName } from '../core/platform';\n\nconst SERVICE_NAME = 'routeRegistry';\n\nPlatformServiceName.RouteRegistry = SERVICE_NAME;\n\ndeclare module '../core/platform' {\n interface PlatformServiceNameType {\n /**\n * @see {@link Service | RouteRegistry}\n */\n RouteRegistry: typeof SERVICE_NAME;\n }\n\n interface LimeWebComponentPlatform {\n get(name: PlatformServiceNameType['RouteRegistry']): Service;\n }\n}\n","import { StateRepository } from '../core';\n\n/**\n * Service for creating background tasks\n * @public\n * @group Tasks\n */\nexport interface TaskRepository extends StateRepository {\n /**\n * Create a new background task\n *\n * @param url - url to the resource that will create the task\n * @param data - task specific data\n * @param cancelAction - true to allow task creation to be cancelled\n * @param message - notification message to display before the task is created instead of the default one\n * @returns a promise that resolves to the id of the task if it was created successfully\n */\n create(\n url: string,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n data: any,\n cancelAction?: boolean,\n message?: string\n ): Promise<string | void>;\n\n /**\n * Get status about specific tasks\n *\n * @param ids - the ids of the tasks to check\n * @returns a promise that resolves to the status about the tasks\n */\n getStatus(ids: string[]): Promise<TaskStatus[]>;\n}\n\n/**\n * @public\n * @group Tasks\n */\nexport enum TaskState {\n /**\n * Task state is unknown\n */\n Pending = 'PENDING',\n\n /**\n * Task was started by a worker\n */\n Started = 'STARTED',\n\n /**\n * Task is waiting for retry\n */\n Retry = 'RETRY',\n\n /**\n * Task succeeded\n */\n Success = 'SUCCESS',\n\n /**\n * Task failed\n */\n Failure = 'FAILURE',\n}\n\n/**\n * @public\n * @group Tasks\n */\nexport interface TaskStatus {\n /**\n * ID of the task\n */\n id: string;\n\n /**\n * The state of the task\n */\n status: TaskState;\n\n /**\n * The result of the task once it has finished its execution\n */\n result?: string;\n}\n\n/**\n * Events dispatched by the task service\n * @public\n * @group Tasks\n */\nexport enum TaskEventType {\n /**\n * Dispatched when a task has been created.\n *\n * @see {@link TaskEvent}\n */\n Created = 'task.created',\n\n /**\n * Dispatched when the task has successfully been completed\n *\n * @see {@link TaskEvent}\n */\n Success = 'task.success',\n\n /**\n * Dispatched if an error occured while running the task\n *\n * @see {@link TaskEvent}\n */\n Failed = 'task.failed',\n}\n\n/**\n * @public\n * @group Tasks\n */\nexport type TaskEventDetail = {\n task: TaskStatus;\n error?: unknown;\n};\n\n/**\n * @public\n * @group Tasks\n */\nexport type TaskEvent = CustomEvent<TaskEventDetail>;\n","import { TaskRepository as Service } from './repository';\nimport { PlatformServiceName } from '../core/platform';\n\nconst SERVICE_NAME = 'state.tasks';\n\nPlatformServiceName.TaskRepository = SERVICE_NAME;\n\ndeclare module '../core/platform' {\n interface PlatformServiceNameType {\n /**\n * @see {@link Service | TaskRepository}\n */\n TaskRepository: typeof SERVICE_NAME;\n }\n\n interface LimeWebComponentPlatform {\n get(name: PlatformServiceNameType['TaskRepository']): Service;\n }\n}\n","import { ConfigRepository as Service } from './repository';\nimport { PlatformServiceName } from '../core/platform';\n\nconst SERVICE_NAME = 'state.configs';\n\nPlatformServiceName.ConfigRepository = SERVICE_NAME;\n\ndeclare module '../core/platform' {\n interface PlatformServiceNameType {\n /**\n * @see {@link Service | ConfigRepository}\n */\n ConfigRepository: typeof SERVICE_NAME;\n }\n\n interface LimeWebComponentPlatform {\n get(name: PlatformServiceNameType['ConfigRepository']): Service;\n }\n}\n","import {\n PlatformServiceName,\n StateOptions,\n StateDecoratorConfig,\n} from '../core';\nimport { createStateDecorator } from '../core/decorators/factory';\n\n/**\n * Config for the {@link SelectConfig} state decorator\n * @public\n * @group Config\n */\nexport interface SelectConfigOptions extends StateOptions {\n name?: string;\n}\n\n/**\n * Decorator that subscribes to configuration data from the {@link ConfigRepository}.\n *\n * This decorator automatically updates the decorated property whenever configuration\n * data changes in the platform. Returns an object with all configs where the config\n * key is used as the key. It's the recommended approach over manual subscriptions as\n * it handles subscription lifecycle automatically.\n *\n * @param options - Configuration including key filtering and state transformation via {@link SelectConfigOptions}\n * @returns A PropertyDecorator that sets up automatic subscription to config data\n *\n * @remarks\n * Subscribes to: {@link ConfigRepository}\n *\n * Updates: The decorated property with configuration data (object or specific value)\n *\n * Lifecycle: Automatically subscribes in `connectedCallback` and unsubscribes\n * in `disconnectedCallback`\n *\n * @example\n * Get all configuration data\n * ```typescript\n * @State()\n * @SelectConfig({})\n * private config: Record<string, unknown>;\n *\n * render() {\n * return (\n * <div>\n * <h2>Configuration</h2>\n * <pre>{JSON.stringify(this.config, null, 2)}</pre>\n * </div>\n * );\n * }\n * ```\n *\n * @example\n * Get specific config value by name\n * ```typescript\n * @State()\n * @SelectConfig({\n * name: 'apiEndpoint',\n * map: [(config) => config?.url || 'https://api.example.com']\n * })\n * private apiUrl: string;\n *\n * async fetchData() {\n * const response = await fetch(`${this.apiUrl}/data`);\n * return response.json();\n * }\n * ```\n *\n * @public\n * @group Config\n */\nexport function SelectConfig(options: SelectConfigOptions): PropertyDecorator {\n const config: StateDecoratorConfig = {\n name: PlatformServiceName.ConfigRepository,\n };\n\n return createStateDecorator(options, config);\n}\n","import { Device as Service } from './device';\nimport { PlatformServiceName } from '../core/platform';\n\nconst SERVICE_NAME = 'state.device';\n\nPlatformServiceName.Device = SERVICE_NAME;\n\ndeclare module '../core/platform' {\n interface PlatformServiceNameType {\n /**\n * @see {@link Service | Device}\n */\n Device: typeof SERVICE_NAME;\n }\n\n interface LimeWebComponentPlatform {\n get(name: PlatformServiceNameType['Device']): Service;\n }\n}\n","import {\n PlatformServiceName,\n StateOptions,\n StateDecoratorConfig,\n} from '../core';\nimport { createStateDecorator } from '../core/decorators/factory';\n\n/**\n * DeviceType\n * @public\n * @group Device\n */\nexport type DeviceType = 'desktop' | 'tablet' | 'phone';\n\n/**\n * Decorator that subscribes to the current device type from the device service.\n *\n * This decorator automatically updates the decorated property whenever the device type\n * changes (typically when the viewport is resized). The device type indicates roughly\n * how big the viewport is, not what actual device is being used. It's the recommended\n * approach over manual subscriptions as it handles subscription lifecycle automatically.\n *\n * @param options - Configuration for state transformation and filtering via {@link StateOptions}\n * @returns A PropertyDecorator that sets up automatic subscription to device type\n *\n * @remarks\n * Subscribes to: Device service\n *\n * Updates: The decorated property with {@link DeviceType} ('desktop', 'tablet', or 'phone')\n *\n * Viewport-aware: Automatically updates when viewport size changes\n *\n * Lifecycle: Automatically subscribes in `connectedCallback` and\n * unsubscribes in `disconnectedCallback`\n *\n * @example\n * Basic usage with Stencil component\n * ```typescript\n * @State()\n * @SelectDevice()\n * private deviceType: DeviceType;\n *\n * render() {\n * return (\n * <div class={`layout-${this.deviceType}`}>\n * <p>Viewing on: {this.deviceType}</p>\n * </div>\n * );\n * }\n * ```\n *\n * @example\n * Conditional rendering based on device\n * ```typescript\n * @State()\n * @SelectDevice()\n * private device: DeviceType;\n *\n * render() {\n * if (this.device === 'phone') {\n * return <button class=\"hamburger-menu\">Menu</button>;\n * }\n *\n * return (\n * <nav class=\"full-menu\">\n * <a href=\"/home\">Home</a>\n * <a href=\"/about\">About</a>\n * <a href=\"/contact\">Contact</a>\n * </nav>\n * );\n * }\n * ```\n *\n * @public\n * @group Device\n */\nexport function SelectDevice(options: StateOptions = {}): PropertyDecorator {\n const config: StateDecoratorConfig = {\n name: PlatformServiceName.Device,\n };\n\n return createStateDecorator(options, config);\n}\n","import { FilterRepository as Service } from './repository';\nimport { PlatformServiceName } from '../core/platform';\n\nconst SERVICE_NAME = 'state.filters';\n\nPlatformServiceName.FilterRepository = SERVICE_NAME;\n\ndeclare module '../core/platform' {\n interface PlatformServiceNameType {\n /**\n * @see {@link Service | FilterRepository}\n */\n FilterRepository: typeof SERVICE_NAME;\n }\n\n interface LimeWebComponentPlatform {\n get(name: PlatformServiceNameType['FilterRepository']): Service;\n }\n}\n","import {\n PlatformServiceName,\n StateOptions,\n StateDecoratorConfig,\n} from '../core';\nimport { createStateDecorator } from '../core/decorators/factory';\n\n/**\n * Config for the {@link SelectFilters} state decorator\n * @public\n * @group Filters\n */\nexport interface SelectFiltersOptions extends StateOptions {\n id?: string;\n limetype?: string;\n}\n\n/**\n * Decorator that subscribes to filters from the {@link FilterRepository}.\n *\n * This decorator automatically updates the decorated property whenever filters\n * change in the platform. You can optionally filter by limetype or filter ID.\n *\n * @param options - Configuration including limetype/ID filtering and state transformation via {@link SelectFiltersOptions}\n * @returns A PropertyDecorator that sets up automatic subscription to filters\n *\n * @example\n * ```typescript\n * @State()\n * @SelectFilters()\n * private filters: Filter[];\n * ```\n *\n * @example\n * ```typescript\n * @State()\n * @SelectFilters({ limetype: 'company' })\n * private companyFilters: Filter[];\n * ```\n *\n * @public\n * @group Filters\n */\nexport function SelectFilters(\n options: SelectFiltersOptions = {}\n): PropertyDecorator {\n const config: StateDecoratorConfig = {\n name: PlatformServiceName.FilterRepository,\n };\n\n return createStateDecorator(options, config);\n}\n","import { UserDataRepository } from './repository';\nimport { PlatformServiceName } from '../core/platform';\n\nconst SERVICE_NAME = 'state.user-data';\n\nPlatformServiceName.UserDataRepository = SERVICE_NAME;\n\ndeclare module '../core/platform' {\n interface PlatformServiceNameType {\n /**\n * @see {@link UserDataRepository}\n */\n UserDataRepository: typeof SERVICE_NAME;\n }\n\n interface LimeWebComponentPlatform {\n get(\n name: PlatformServiceNameType['UserDataRepository']\n ): UserDataRepository;\n }\n}\n","import {\n PlatformServiceName,\n StateOptions,\n StateDecoratorConfig,\n} from '../core';\nimport { createStateDecorator } from '../core/decorators/factory';\n\n/**\n * Config for the {@link SelectUserData} state decorator\n * @public\n * @group User data\n */\nexport interface SelectUserDataOptions extends StateOptions {\n /**\n * Key specifying the user data\n */\n key?: string;\n}\n\n/**\n * Gets an object with all user data, optionally filtered by key\n *\n * @param options - state decorator options\n * @returns state decorator\n * @public\n * @group User data\n */\nexport function SelectUserData(\n options: SelectUserDataOptions = {}\n): PropertyDecorator {\n const config: StateDecoratorConfig = {\n name: PlatformServiceName.UserDataRepository,\n };\n\n return createStateDecorator(options, config);\n}\n","import { PlatformServiceName } from '../core/platform';\nimport { ApplicationRepository } from './repository';\n\nconst SERVICE_NAME = 'state.application';\n\nPlatformServiceName.Application = SERVICE_NAME;\n\ndeclare module '../core/platform' {\n interface PlatformServiceNameType {\n /**\n * @see {@link ApplicationRepository}\n */\n Application: typeof SERVICE_NAME;\n }\n\n interface LimeWebComponentPlatform {\n get(\n name: PlatformServiceNameType['Application']\n ): ApplicationRepository;\n }\n}\n","import {\n PlatformServiceName,\n StateOptions,\n StateDecoratorConfig,\n} from '../../core';\nimport { createStateDecorator } from '../../core/decorators/factory';\n\n/**\n * Decorator that subscribes to the application name from the {@link ApplicationRepository}.\n *\n * This decorator automatically updates the decorated property whenever the application\n * name changes in the platform. It's the recommended approach over manual subscriptions\n * as it handles subscription lifecycle automatically.\n *\n * @param options - Configuration for state transformation and filtering via {@link StateOptions}\n * @returns A PropertyDecorator that sets up automatic subscription to application name\n *\n * @remarks\n * Subscribes to: {@link ApplicationRepository}\n *\n * Updates: The decorated property with the application name (`string`)\n *\n * Lifecycle: Automatically subscribes in `connectedCallback` and\n * unsubscribes in `disconnectedCallback` of the component.\n *\n * @example\n * ```typescript\n * @State()\n * @SelectApplicationName()\n * private appName: string;\n * ```\n *\n * @example\n * ```typescript\n * // Transform the application name\n * @State()\n * @SelectApplicationName({\n * map: [(name) => name?.toUpperCase()]\n * })\n * private appNameUppercase: string;\n * ```\n *\n * @example\n * ```typescript\n * // Only update when name is defined\n * @State()\n * @SelectApplicationName({\n * filter: [(name) => name !== null && name !== undefined]\n * })\n * private validAppName: string;\n * ```\n *\n * @example\n * ```typescript\n * // Combine map and filter for complex transformations\n * @State()\n * @SelectApplicationName({\n * map: [\n * (name) => name?.toLowerCase(),\n * (name) => `${name} CRM`\n * ],\n * filter: [(formattedName) => formattedName?.length > 4]\n * })\n * private brandedName: string;\n * ```\n *\n * @public\n * @group Application\n */\nexport function SelectApplicationName(\n options: StateOptions = {}\n): PropertyDecorator {\n const config: StateDecoratorConfig = {\n name: PlatformServiceName.Application,\n };\n options.map = [getApplicationName, ...(options.map || [])];\n\n return createStateDecorator(options, config);\n}\n\nfunction getApplicationName(applicationData: { applicationName: string }) {\n return applicationData.applicationName;\n}\n","import {\n PlatformServiceName,\n StateOptions,\n StateDecoratorConfig,\n} from '../../core';\nimport { createStateDecorator } from '../../core/decorators/factory';\nimport { User } from '../user';\n\n/**\n * Decorator that subscribes to the currently logged in user from the {@link ApplicationRepository}.\n *\n * This decorator automatically updates the decorated property whenever the current user\n * changes in the platform. It's the recommended approach over manual subscriptions as it\n * handles subscription lifecycle automatically.\n *\n * @param options - Configuration for state transformation and filtering via {@link StateOptions}\n * @returns A PropertyDecorator that sets up automatic subscription to the current user\n *\n * @remarks\n * Subscribes to: {@link ApplicationRepository}\n *\n * Updates: The decorated property with the {@link User} object\n *\n * Lifecycle: Automatically subscribes in `connectedCallback` and\n * unsubscribes in `disconnectedCallback` of the component.\n *\n * @example\n * ```typescript\n * @State()\n * @SelectCurrentUser()\n * private user: User;\n * ```\n *\n * @example\n * ```typescript\n * // Extract user's full name\n * @State()\n * @SelectCurrentUser({\n * map: [(user) => user?.fullname]\n * })\n * private userName: string;\n * ```\n *\n * @example\n * ```typescript\n * // Create initials with map transformations\n * @State()\n * @SelectCurrentUser({\n * map: [\n * (user) => user?.fullname,\n * (name) => name?.split(' ').map(n => n[0]).join('').toUpperCase()\n * ],\n * filter: [(initials) => initials !== undefined]\n * })\n * private userInitials: string;\n * ```\n *\n * @public\n * @group Application\n */\nexport function SelectCurrentUser(\n options: StateOptions = {}\n): PropertyDecorator {\n const config: StateDecoratorConfig = {\n name: PlatformServiceName.Application,\n };\n options.map = [getCurrentUser, ...(options.map || [])];\n\n return createStateDecorator(options, config);\n}\n\nfunction getCurrentUser(applicationData: { currentUser: User }) {\n return applicationData.currentUser;\n}\n","import {\n PlatformServiceName,\n StateOptions,\n StateDecoratorConfig,\n} from '../../core';\nimport { createStateDecorator } from '../../core/decorators/factory';\nimport { Session } from '../session';\n\n/**\n * Decorator that subscribes to the application session from the {@link ApplicationRepository}.\n *\n * This decorator automatically updates the decorated property whenever the session\n * changes in the platform. The session contains authentication and authorization\n * information. It's the recommended approach over manual subscriptions as it handles\n * subscription lifecycle automatically.\n *\n * @param options - Configuration for state transformation and filtering via {@link StateOptions}\n * @returns A PropertyDecorator that sets up automatic subscription to the session\n *\n * @remarks\n * Subscribes to: {@link ApplicationRepository}\n *\n * Updates: The decorated property with the {@link Session} object\n *\n * Lifecycle: Automatically subscribes in `connectedCallback` and\n * unsubscribes in `disconnectedCallback` of the component.\n *\n * @example\n * ```typescript\n * @State()\n * @SelectSession()\n * private session: Session;\n * ```\n *\n * @example\n * ```typescript\n * // Extract specific session property\n * @State()\n * @SelectSession({\n * map: [(session) => session?.admin]\n * })\n * private isAdmin: boolean;\n * ```\n *\n * @example\n * ```typescript\n * // Filter for valid sessions only\n * @State()\n * @SelectSession({\n * filter: [(session) => session !== null && session?.active === true]\n * })\n * private activeSession: Session;\n * ```\n *\n * @public\n * @group Application\n */\nexport function SelectSession(options: StateOptions = {}): PropertyDecorator {\n const config: StateDecoratorConfig = {\n name: PlatformServiceName.Application,\n };\n options.map = [getSession, ...(options.map || [])];\n\n return createStateDecorator(options, config);\n}\n\nfunction getSession(applicationData: { session: Session }) {\n return applicationData.session;\n}\n","import { PlatformServiceName } from '../core/platform';\nimport { UserPreferencesRepository } from './repository';\n\nconst SERVICE_NAME = 'userPreferences';\n\nPlatformServiceName.UserPreferencesRepository = SERVICE_NAME;\n\ndeclare module '../core/platform' {\n interface PlatformServiceNameType {\n /**\n * @see {@link UserPreferencesRepository}\n */\n UserPreferencesRepository: typeof SERVICE_NAME;\n }\n\n interface LimeWebComponentPlatform {\n get(\n name: PlatformServiceNameType['UserPreferencesRepository']\n ): UserPreferencesRepository;\n }\n}\n","import { DateTimeFormatter } from './datetimeformatter';\nimport { PlatformServiceName } from '../core/platform';\n\nconst SERVICE_NAME = 'datetimeformatter';\n\nPlatformServiceName.DateTimeFormatter = SERVICE_NAME;\n\ndeclare module '../core/platform' {\n interface PlatformServiceNameType {\n /**\n * @see {@link DateTimeFormatter}\n */\n DateTimeFormatter: typeof SERVICE_NAME;\n }\n\n interface LimeWebComponentPlatform {\n get(\n name: PlatformServiceNameType['DateTimeFormatter']\n ): DateTimeFormatter;\n }\n}\n","import { Action } from '../action';\nimport { LimeObject } from '../limeobject';\n\n/**\n * Represents a conditional evaluation rule that can be registered and used\n * throughout the application.\n *\n * Conditions are predicate functions that determine whether certain UI elements should be\n * visible, enabled, or available based on runtime state. For example, they can be used to:\n * - Control action visibility (show/hide menu items based on object state)\n * - Enable/disable features based on user permissions or context\n * - Filter lists of items based on dynamic criteria\n * - Implement business rules for conditional UI rendering\n *\n * Each condition has a unique ID and a type that indicates what kind of subject it evaluates.\n * The most common types are 'limeobject' and 'action', but custom types can be defined.\n *\n * @example\n * Registering a simple LimeObject condition\n * ```typescript\n * const registry = platform.get(PlatformServiceName.ConditionRegistry);\n *\n * const isDealWon = {\n * id: 'deal.is-won',\n * type: 'limeobject',\n * evaluate: (deal) => deal.dealstatus === 'won'\n * };\n *\n * registry.addCondition(isDealWon);\n * ```\n *\n * @example\n * Condition with additional parameters\n * ```typescript\n * const hasMinimumValue = {\n * id: 'object.min-value',\n * type: 'limeobject',\n * evaluate: (object, params) => {\n * const { field, minValue } = params;\n * const value = object[field];\n * return typeof value === 'number' && value >= minValue;\n * }\n * };\n *\n * const isHighValue = hasMinimumValue.evaluate(dealObject, {\n * field: 'value',\n * minValue: 100000\n * });\n * ```\n *\n * @see {@link ConditionRegistry} for managing conditions\n * @see {@link LimeObjectCondition} for LimeObject-specific conditions\n * @see {@link ActionCondition} for action-specific conditions\n *\n * @beta\n * @group Conditions\n */\nexport type Condition<T = unknown> = {\n /**\n * The type of subject this condition evaluates.\n *\n * Common types include:\n * - `limeobject` - Evaluates {@link LimeObject} instances\n * - `action` - Evaluates {@link Action} instances\n *\n * Custom types can be defined for specialized evaluation contexts.\n */\n type: string;\n\n /**\n * The evaluation function that determines if the condition is met.\n *\n * This predicate function receives the subject to evaluate and optional parameters\n * for configuration. It should return `true` if the condition is satisfied,\n * `false` otherwise.\n *\n * The function should be pure and side-effect free when possible, as it may be\n * called frequently during UI rendering and updates.\n *\n * @param subject - The value to evaluate. Type depends on the condition type.\n * For 'limeobject' conditions, this is a {@link LimeObject}.\n * For 'action' conditions, this is an {@link Action}.\n * @param params - Optional configuration data for the evaluation.\n * Can be used to pass context-specific values like field names, thresholds,\n * or other criteria. The evaluation function should validate params if used.\n * @returns `true` if the condition is met, `false` otherwise.\n * @throws May throw an error if params has an unexpected type or required data is missing.\n *\n * @example\n * Simple boolean check\n * ```typescript\n * const evaluate = (deal: LimeObject) => deal.dealstatus === 'won';\n * ```\n *\n * @example\n * Using params for configuration\n * ```typescript\n * const evaluate = (obj: LimeObject, params?: { propertyName: string }) => {\n * return obj.getValue(params.propertyName) !== null;\n * };\n * ```\n */\n evaluate: (subject: T, params?: unknown) => boolean;\n\n /**\n * Unique identifier for this condition.\n *\n * The ID is used to reference the condition when registering, removing, or\n * looking it up from the {@link ConditionRegistry}. It must be unique across\n * all registered conditions.\n */\n id: string;\n};\n\n/**\n * A specialized condition type for evaluating {@link LimeObject} instances.\n *\n * LimeObject conditions are the most common type of condition, used to control\n * UI elements based on the state of business objects (deals, contacts, companies, etc.).\n * The evaluate function receives a LimeObject and can check any of its properties\n * to determine if the condition is met.\n *\n * @example\n * Condition based on object status\n * ```typescript\n * const registry = platform.get(PlatformServiceName.ConditionRegistry);\n *\n * const isDealActive = {\n * id: 'deal.is-active',\n * type: 'limeobject',\n * evaluate: (deal) => {\n * return deal.dealstatus === 'qualification' ||\n * deal.dealstatus === 'proposal';\n * }\n * };\n *\n * registry.addCondition(isDealActive);\n *\n * const condition = registry.getCondition('deal.is-active');\n * const isActive = condition.evaluate(deal);\n * ```\n *\n * @example\n * Condition for conditional action visibility\n * ```typescript\n * const canSendEmail = {\n * id: 'contact.can-send-email',\n * type: 'limeobject',\n * evaluate: (contact) => contact.email && contact.email.length > 0\n * };\n *\n * const sendEmailAction = {\n * label: 'Send Email',\n * icon: 'envelope',\n * command: { name: 'send-email' },\n * condition: canSendEmail\n * };\n * ```\n *\n * @see {@link Condition} for the base condition type\n * @see {@link LimeObject} for the object structure\n *\n * @beta\n * @group Conditions\n */\nexport type LimeObjectCondition = Condition<LimeObject> & {\n type: 'limeobject';\n};\n\n/**\n * A specialized condition type for evaluating {@link Action} instances.\n *\n * Action conditions are used to control the availability or visibility of actions\n * themselves, based on properties of the action. This is less common than {@link LimeObject}\n * conditions but useful for creating dynamic action menus that filter or organize\n * actions based on their metadata.\n *\n * @example\n * Condition to filter bulk actions\n * ```typescript\n * const registry = platform.get(PlatformServiceName.ConditionRegistry);\n *\n * const isBulkAction = {\n * id: 'action.is-bulk',\n * type: 'action',\n * evaluate: (action) => action.command.name.startsWith('bulk-')\n * };\n *\n * registry.addCondition(isBulkAction);\n * ```\n *\n * @see {@link Condition} for the base condition type\n * @see {@link Action} for the action structure\n *\n * @beta\n * @group Conditions\n */\nexport type ActionCondition = Condition<Action> & {\n type: 'action';\n};\n\n/**\n * Check if condition expects a {@link LimeObject} to be passed when it is evaluated\n *\n * @param condition - the condition to check\n * @returns true if the condition is a condition for a {@link LimeObject},\n * false otherwise\n *\n * @beta\n * @group Conditions\n */\nexport function isLimeObjectCondition(\n condition: Condition\n): condition is Condition<LimeObject> {\n return condition.type === 'limeobject';\n}\n\n/**\n * Check if condition expects an action to be passed when it is evaluated\n *\n * @param condition - the condition to check\n * @returns true if the condition is a condition for an {@link Action},\n * false otherwise\n *\n * @beta\n * @group Conditions\n */\nexport function isActionCondition(\n condition: Condition\n): condition is Condition<Action> {\n return condition.type === 'action';\n}\n\n/**\n * Central registry for managing conditional evaluation rules across the application.\n *\n * The ConditionRegistry acts as a global repository for {@link Condition} instances,\n * allowing different parts of the application to register, retrieve, and evaluate\n * conditions. This is particularly useful for:\n * - Controlling action visibility based on object state\n * - Implementing permission-based UI rendering\n * - Creating dynamic, context-aware interfaces\n * - Sharing reusable business logic across components\n *\n * Components typically access the registry via the platform service and register\n * their conditions when the application initializes. Conditions can be\n * added and removed dynamically, allowing for flexible runtime configuration.\n *\n * @example\n * Registering and using conditions in a component\n * ```typescript\n * const registry = platform.get(PlatformServiceName.ConditionRegistry);\n *\n * const canWinDeal = {\n * id: 'deal.can-win',\n * type: 'limeobject',\n * evaluate: (deal) => deal.dealstatus === 'proposal' && deal.value > 0\n * };\n *\n * const canLoseDeal = {\n * id: 'deal.can-lose',\n * type: 'limeobject',\n * evaluate: (deal) => deal.dealstatus !== 'lost' && deal.dealstatus !== 'won'\n * };\n *\n * registry.addCondition(canWinDeal);\n * registry.addCondition(canLoseDeal);\n *\n * const actions = [\n * {\n * label: 'Mark as Won',\n * icon: 'trophy',\n * command: { name: 'win-deal' },\n * condition: registry.getCondition('deal.can-win')\n * },\n * {\n * label: 'Mark as Lost',\n * icon: 'times',\n * command: { name: 'lose-deal' },\n * condition: registry.getCondition('deal.can-lose')\n * }\n * ];\n *\n * const availableActions = actions.filter(action => {\n * return !action.condition || action.condition.evaluate(deal);\n * });\n * ```\n *\n * @see {@link Condition} for the condition structure\n * @see {@link LimeObjectCondition} for object-specific conditions\n * @see {@link ActionCondition} for action-specific conditions\n *\n * @beta\n * @group Conditions\n */\nexport interface ConditionRegistry {\n /**\n * Registers a new condition in the registry.\n *\n * The condition's ID must be unique across all registered conditions.\n * If a condition with the same ID already exists, this method throws an error.\n * It's recommended to register conditions during application startup.\n *\n * @param condition - The condition to register. Must have a unique ID.\n * @throws Error if a condition with the same ID already exists in the registry.\n *\n * @example\n * ```typescript\n * const isActive: LimeObjectCondition = {\n * id: 'deal.is-active',\n * type: 'limeobject',\n * evaluate: (deal) => deal.dealstatus === 'active'\n * };\n *\n * registry.addCondition(isActive);\n * ```\n */\n addCondition(condition: Condition);\n\n /**\n * Removes a condition from the registry.\n *\n * The condition is identified by its ID. If no condition with the given ID\n * exists in the registry, this method throws an error.\n *\n * @param condition - The condition to remove. Must exist in the registry.\n * @throws Error if the condition's ID does not exist in the registry.\n *\n * @example\n * ```typescript\n * const condition = registry.getCondition('deal.is-active');\n * registry.removeCondition(condition);\n * ```\n *\n * @example\n * Safe removal with existence check\n * ```typescript\n * if (registry.hasCondition('deal.is-active')) {\n * registry.removeCondition(registry.getCondition('deal.is-active'));\n * }\n * ```\n */\n removeCondition(condition: Condition);\n\n /**\n * Checks whether a condition with the given ID exists in the registry.\n *\n * This method is useful for defensive programming, allowing you to verify\n * that a condition exists before attempting to retrieve or remove it.\n *\n * @param id - The unique identifier of the condition to check.\n * @returns `true` if a condition with the ID exists, `false` otherwise.\n *\n * @example\n * ```typescript\n * if (registry.hasCondition('deal.can-win')) {\n * const condition = registry.getCondition('deal.can-win');\n * const canWin = condition.evaluate(deal);\n * }\n * ```\n */\n hasCondition(id: string): boolean;\n\n /**\n * Retrieves all registered conditions.\n *\n * This method returns a list of all conditions currently in the registry,\n * regardless of their type. This can be useful for debugging, inspection,\n * or building dynamic UIs that need to enumerate available conditions.\n *\n * @returns An array of all registered conditions.\n *\n * @example\n * ```typescript\n * const allConditions = registry.getConditions();\n * console.log(`Found ${allConditions.length} conditions`);\n *\n * const limeObjectConditions = allConditions.filter(\n * c => c.type === 'limeobject'\n * );\n * ```\n */\n getConditions(): Condition[];\n\n /**\n * Retrieves a specific condition by its unique identifier.\n *\n * If no condition with the given ID exists, this method throws an error.\n * Use {@link ConditionRegistry.hasCondition} first if you need to check for existence.\n *\n * @param id - The unique identifier of the condition to retrieve.\n * @returns The condition with the specified ID.\n * @throws Error if no condition with the given ID exists in the registry.\n *\n * @example\n * ```typescript\n * const canWin = registry.getCondition('deal.can-win');\n * const isEligible = canWin.evaluate(dealObject);\n * ```\n *\n * @example\n * Safe retrieval with type checking\n * ```typescript\n * const condition = registry.getCondition('deal.is-active');\n * if (isLimeObjectCondition(condition)) {\n * const result = condition.evaluate(myDeal);\n * }\n * ```\n */\n getCondition(id: string): Condition;\n}\n","import { PlatformServiceName } from '../core/platform';\nimport { ConditionRegistry as Service } from './conditionregistry';\n\nconst SERVICE_NAME = 'conditionRegistry';\n\nPlatformServiceName.ConditionRegistry = SERVICE_NAME;\n\ndeclare module '../core/platform' {\n interface PlatformServiceNameType {\n /**\n * @see {@link Service | ConditionRegistry}\n */\n ConditionRegistry: typeof SERVICE_NAME;\n }\n interface LimeWebComponentPlatform {\n get(name: PlatformServiceNameType['ConditionRegistry']): Service;\n }\n}\n","import { ViewFactoryRegistry } from './registry';\nimport { PlatformServiceName } from '../core/platform';\n\nconst SERVICE_NAME = 'viewFactoryRegistry';\n\nPlatformServiceName.ViewFactoryRegistry = SERVICE_NAME;\n\ndeclare module '../core/platform' {\n interface PlatformServiceNameType {\n /**\n * @beta\n * @see {@link ViewFactoryRegistry}\n */\n ViewFactoryRegistry: typeof SERVICE_NAME;\n }\n\n interface LimeWebComponentPlatform {\n /**\n * @beta\n */\n get(\n name: PlatformServiceNameType['ViewFactoryRegistry']\n ): ViewFactoryRegistry;\n }\n}\n","import { PlatformServiceName } from '../core/platform';\nimport { WebComponentRegistry } from './registry';\n\nconst SERVICE_NAME = 'webComponentRegistry';\n\nPlatformServiceName.WebComponentRegistry = SERVICE_NAME;\n\ndeclare module '../core/platform' {\n interface PlatformServiceNameType {\n /**\n * @see {@link WebComponentRegistry}\n */\n WebComponentRegistry: typeof SERVICE_NAME;\n }\n\n interface LimeWebComponentPlatform {\n get(\n name: PlatformServiceNameType['WebComponentRegistry']\n ): WebComponentRegistry;\n }\n}\n","import { NotificationRepository } from './repository';\nimport { PlatformServiceName } from '../core/platform';\n\nconst SERVICE_NAME = 'state.notifications';\n\nPlatformServiceName.NotificationRepository = SERVICE_NAME;\n\ndeclare module '../core/platform' {\n interface PlatformServiceNameType {\n /**\n * @see {@link NotificationRepository}\n */\n NotificationRepository: typeof SERVICE_NAME;\n }\n\n interface LimeWebComponentPlatform {\n get(\n name: PlatformServiceNameType['NotificationRepository']\n ): NotificationRepository;\n }\n}\n","import { PollerFactory as PollerFactoryService } from './factory';\nimport { PlatformServiceName } from '../core/platform';\n\nconst SERVICE_NAME = 'pollerFactory';\n\nPlatformServiceName.PollerFactory = SERVICE_NAME;\n\ndeclare module '../core/platform' {\n interface PlatformServiceNameType {\n /**\n * @see {@link PollerFactoryService}\n */\n PollerFactory: typeof SERVICE_NAME;\n }\n\n interface LimeWebComponentPlatform {\n get(\n name: PlatformServiceNameType['PollerFactory']\n ): PollerFactoryService;\n }\n}\n","/**\n * Logger service for writing log messages to configured handlers\n *\n * Loggers are created from a {@link LoggerFactory} with a specific scope/category.\n * All log messages written to a logger will be sent to all handlers configured\n * in the factory.\n *\n * @example\n * ```typescript\n * const logger = loggerFactory.createLogger('my-component');\n *\n * logger.info('Component initialized');\n * logger.debug('Processing data', { itemCount: 42 });\n * logger.warn('Deprecated API usage detected');\n * logger.error('Failed to fetch data', error, { url: '/api/data' });\n * ```\n *\n * @beta\n * @group Logger\n */\nexport interface Logger {\n /**\n * The scope/category for this logger instance\n */\n readonly scope: string;\n\n /**\n * Logs a debug message\n *\n * Use for detailed diagnostic information useful during development and troubleshooting.\n * Debug logs are typically disabled in production and should include technical details\n * like internal state, intermediate values, or execution flow.\n *\n * @param message - The log message\n * @param data - Optional additional data to include with the log entry\n *\n * @example\n * ```typescript\n * logger.debug('Cache miss, fetching from API', { key: 'user:123' });\n * logger.debug('Rendering component', { props: componentProps });\n * ```\n */\n debug(message: string, data?: LogData): void;\n\n /**\n * Logs an informational message\n *\n * Use for significant application events that represent normal behavior.\n * Info logs should capture key milestones, successful operations, or state transitions\n * that are useful for understanding application flow in production.\n *\n * @param message - The log message\n * @param data - Optional additional data to include with the log entry\n *\n * @example\n * ```typescript\n * logger.info('User authenticated', { userId: user.id });\n * logger.info('File uploaded successfully', { filename: 'report.pdf', size: 2048 });\n * ```\n */\n info(message: string, data?: LogData): void;\n\n /**\n * Logs a warning message\n *\n * Use for unexpected situations that don't prevent the application from functioning\n * but may indicate potential issues, deprecated usage, or suboptimal conditions.\n * Warnings should be actionable and suggest something that may need attention.\n *\n * @param message - The log message\n * @param data - Optional additional data to include with the log entry\n *\n * @example\n * ```typescript\n * logger.warn('API response time exceeded threshold', { duration: 3500, threshold: 3000 });\n * logger.warn('Using deprecated configuration option', { option: 'legacy_mode' });\n * ```\n */\n warn(message: string, data?: LogData): void;\n\n /**\n * Logs an error message\n *\n * Use for failures and exceptions that prevent normal operation or indicate\n * something has gone wrong. Error logs should always describe what failed\n * and include relevant context to aid in diagnosis.\n *\n * @param message - The log message\n * @param error - Optional error object\n * @param data - Optional additional data to include with the log entry\n *\n * @example\n * ```typescript\n * logger.error('Failed to fetch user data', error, { userId: 123 });\n * logger.error('Invalid configuration detected', undefined, { config: invalidConfig });\n * ```\n */\n error(message: string, error?: Error, data?: LogData): void;\n}\n\n/**\n * Handler for processing log messages\n *\n * Implementations can handle logs by writing to different outputs such as\n * console, memory, IndexedDB, or external services.\n *\n * @example\n * ```typescript\n * class ConsoleHandler implements LogHandler {\n * minLevel = LogLevel.Info;\n *\n * handle(entry: LogEntry): void {\n * const prefix = `[${entry.level.toUpperCase()}] [${entry.scope}]`;\n * console.log(`${prefix} ${entry.message}`, entry.data);\n * }\n * }\n *\n * // Change level at runtime\n * consoleHandler.minLevel = LogLevel.Debug;\n * ```\n *\n * @beta\n * @group Logger\n */\nexport interface LogHandler {\n /**\n * Handles a log entry\n *\n * Implementations should handle their own errors internally to ensure\n * reliability. However, any uncaught errors thrown by this method will\n * be caught by the factory to prevent one handler from breaking others.\n * Errors will be logged to the console but will not stop other handlers\n * from receiving the log entry.\n *\n * @param entry - The log entry to handle\n */\n handle(entry: LogEntry): void | Promise<void>;\n\n /**\n * Minimum log level this handler should receive\n *\n * If specified, the factory will only pass log entries with a level\n * equal to or higher than this value. If not specified, all log\n * entries are passed to the handler.\n *\n * Level priority (lowest to highest): Debug → Info → Warn → Error\n *\n * This can be changed at runtime to dynamically adjust filtering.\n */\n minLevel?: LogLevel;\n}\n\n/**\n * Extended handler interface for handlers that support log storage and retrieval\n *\n * Handlers like memory and IndexedDB implement this interface to allow\n * querying and exporting stored logs.\n *\n * @remarks\n * Implementations should respect the configured retention policies (`maxEntries`\n * and `maxAge`) to prevent unbounded growth. These limits can be changed at\n * runtime to dynamically adjust retention behavior.\n *\n * For high-volume logging, consider batching writes to reduce overhead.\n *\n * @example\n * ```typescript\n * class MemoryHandler implements LogStore {\n * maxEntries = 10000;\n * maxAge = 7 * 24 * 60 * 60 * 1000; // 7 days\n *\n * handle(entry: LogEntry): void { }\n * getLogs(): LogEntry[] { return []; }\n * clear(): void { }\n * }\n * ```\n *\n * @beta\n * @group Logger\n */\nexport interface LogStore extends LogHandler {\n /**\n * Retrieves all stored log entries\n *\n * @returns Array of all log entries\n */\n getLogs(): LogEntry[] | Promise<LogEntry[]>;\n\n /**\n * Clears all stored log entries\n */\n clear(): void | Promise<void>;\n\n /**\n * Maximum number of log entries to retain\n *\n * When the number of stored entries exceeds this limit, the oldest\n * entries should be removed. If not specified, no entry-count limit\n * is enforced.\n *\n * This can be changed at runtime to dynamically adjust retention.\n */\n maxEntries?: number;\n\n /**\n * Maximum age of log entries in milliseconds\n *\n * Entries older than this age should be removed during cleanup.\n * If not specified, no age-based cleanup is performed.\n *\n * This can be changed at runtime to dynamically adjust retention.\n *\n * @example\n * ```typescript\n * // Retain logs for 7 days\n * store.maxAge = 7 * 24 * 60 * 60 * 1000;\n *\n * // Retain logs for 1 hour\n * store.maxAge = 60 * 60 * 1000;\n * ```\n */\n maxAge?: number;\n}\n\n/**\n * Factory for creating {@link Logger} instances\n *\n * The factory is initialized with one or more log handlers. All loggers created\n * from the factory will write to all configured handlers.\n *\n * @example\n * ```typescript\n * // Get the logger factory from the platform\n * const loggerFactory = platform.get('logger');\n *\n * // Create loggers for different components\n * const httpLogger = loggerFactory.createLogger('http');\n * const authLogger = loggerFactory.createLogger('auth');\n *\n * // Register a custom handler dynamically\n * const customHandler = new MyCustomHandler();\n * loggerFactory.addHandler(customHandler);\n *\n * // Retrieve all logs\n * const allLogs = await loggerFactory.getLogs();\n *\n * // Clear all logs\n * await loggerFactory.clearLogs();\n * ```\n *\n * @beta\n * @group Logger\n */\nexport interface LoggerFactory {\n /**\n * Creates a logger instance for a specific scope/category\n *\n * @param scope - The scope or category for the logger (e.g., 'http', 'auth', 'component-name')\n * @returns A logger instance that writes to all configured handlers\n */\n createLogger(scope: string): Logger;\n\n /**\n * Registers a new handler with the factory\n *\n * The handler will receive all future log entries from all loggers\n * (both existing and newly created). Historical logs are not replayed.\n *\n * @param handler - The handler to register\n */\n addHandler(handler: LogHandler): void;\n\n /**\n * Removes a handler from the factory\n *\n * @param handler - The handler to remove\n * @returns `true` if the handler was removed, `false` if it was not found\n */\n removeHandler(handler: LogHandler): boolean;\n\n /**\n * Retrieves logs from all handlers that support storage\n *\n * This method aggregates logs from all handlers that implement {@link LogStore}.\n * Handlers that don't support log retrieval (like console) are ignored.\n *\n * @returns Array of all log entries from all storage handlers\n */\n getLogs(): Promise<LogEntry[]>;\n\n /**\n * Clears logs from all handlers that support storage\n *\n * This method clears logs from all handlers that implement {@link LogStore}.\n * Handlers that don't support clearing (like console) are ignored.\n */\n clearLogs(): Promise<void>;\n}\n\n/**\n * Base properties shared by all log entries\n *\n * @beta\n * @group Logger\n */\ninterface BaseLogEntry {\n /**\n * The scope/category this log entry belongs to\n */\n scope: string;\n\n /**\n * The log message\n */\n message: string;\n\n /**\n * Timestamp when the log entry was created (milliseconds since Unix epoch)\n *\n * Use `Date.now()` to create, `new Date(timestamp)` to convert back to Date object.\n */\n timestamp: number;\n\n /**\n * Optional additional structured data\n */\n data?: LogData;\n}\n\n/**\n * Log entry for Debug, Info, and Warn levels\n *\n * @beta\n * @group Logger\n */\ninterface StandardLogEntry extends BaseLogEntry {\n level: typeof LogLevel.Debug | typeof LogLevel.Info | typeof LogLevel.Warn;\n}\n\n/**\n * Log entry for Error level with optional error object\n *\n * @beta\n * @group Logger\n */\ninterface ErrorLogEntry extends BaseLogEntry {\n level: typeof LogLevel.Error;\n\n /**\n * Optional error object\n *\n * @remarks\n * Error objects do not serialize well to JSON - only `name` and `message`\n * are preserved, while `stack` is lost. Storage handlers that persist logs\n * should manually serialize errors before storage:\n *\n * ```typescript\n * const serialized = {\n * name: error.name,\n * message: error.message,\n * stack: error.stack\n * };\n * ```\n */\n error?: Error;\n}\n\n/**\n * A log entry with type-safe level discrimination\n *\n * When `level` is `LogLevel.Error`, the `error` property is available.\n *\n * @beta\n * @group Logger\n */\nexport type LogEntry = StandardLogEntry | ErrorLogEntry;\n\n/**\n * Log level values\n *\n * @beta\n * @group Logger\n */\nexport const LogLevel = {\n Debug: 'debug',\n Info: 'info',\n Warn: 'warn',\n Error: 'error',\n} as const;\n\n/**\n * Log level type indicating the severity of a log message\n *\n * @beta\n * @group Logger\n */\nexport type LogLevel = (typeof LogLevel)[keyof typeof LogLevel];\n\n/**\n * Additional structured data that can be attached to a log entry\n *\n * Values should be JSON-serializable (primitives, arrays, plain objects) to\n * ensure compatibility with storage handlers. Avoid functions, symbols,\n * undefined, and circular references.\n *\n * @beta\n * @group Logger\n */\nexport type LogData = Record<string, unknown>;\n","import { LoggerFactory } from './logger';\nimport { PlatformServiceName } from '../core/platform';\n\nconst SERVICE_NAME = 'logger';\n\nPlatformServiceName.Logger = SERVICE_NAME;\n\ndeclare module '../core/platform' {\n interface PlatformServiceNameType {\n /**\n * @see {@link LoggerFactory}\n */\n Logger: typeof SERVICE_NAME;\n }\n\n interface LimeWebComponentPlatform {\n get(name: PlatformServiceNameType['Logger']): LoggerFactory;\n }\n}\n","import { Logger } from './logger';\n\nlet scriptUrl: string | null | undefined;\nlet packageName: string | null | undefined;\n\n/**\n * Creates a logger instance using the platform's logger factory\n *\n * This function retrieves the logger factory from the global Lime platform\n * object and creates a scoped logger. If the platform factory is not available,\n * it falls back to the browser console.\n *\n * The package name is automatically determined from the module's URL on the first\n * call and cached for all subsequent calls. This ensures consistent logger scopes\n * across all loggers created from the same module instance.\n *\n * @param scope - The scope/category for the logger (e.g., 'my-component', 'http-client')\n * @returns A logger instance integrated with the platform or console fallback\n *\n * @remarks\n * The console fallback is provided for development scenarios where the full\n * Lime platform is not available. The console object does not fully implement\n * the Logger interface but provides compatible logging methods.\n *\n * @example\n * ```typescript\n * const logger = createLogger('my-component');\n * logger.info('Component initialized');\n * logger.debug('Processing data', { count: 42 });\n * ```\n *\n * @beta\n * @group Logger\n */\nexport function createLogger(scope: string): Logger {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const factory = (window as any).Lime?.logger?.createLogger;\n\n if (typeof factory !== 'function') {\n console.warn(\n `Logger factory is not configured. Returning console logger for scope \"${scope}\".`\n );\n\n return console as unknown as Logger;\n }\n\n if (packageName === undefined) {\n packageName = getPackageNameFromUrl(getCurrentScriptUrl());\n }\n\n if (packageName) {\n scope = `${packageName}:${scope}`;\n }\n\n return factory(scope);\n}\n\nfunction getCurrentScriptUrl(): string | null {\n if (scriptUrl !== undefined) {\n return scriptUrl;\n }\n\n if (import.meta !== undefined && typeof import.meta.url === 'string') {\n scriptUrl = import.meta.url;\n return scriptUrl;\n }\n\n scriptUrl = getUrlFromErrorStack();\n return scriptUrl;\n}\n\nfunction getUrlFromErrorStack(): string | null {\n try {\n const stack = new Error('.').stack;\n if (!stack) {\n return null;\n }\n\n const stackLines = stack.split('\\n');\n for (const line of stackLines) {\n const match = line.match(/(https?:\\/\\/[^)\\s:]+)/);\n if (match) {\n return match[1];\n }\n }\n\n return null;\n } catch {\n return null;\n }\n}\n\n/**\n * Extracts the package name from a given URL\n *\n * Supports multiple URL patterns:\n * - `/packages/@scope/name/version/...` → extracts `name`\n * - `/static/name+version/...` → extracts `name`\n * - `/static/directory/name+version/...` → extracts `name`\n * - `/static/name/...` → extracts `name`\n *\n * The extracted name is cleaned by removing common prefixes and suffixes.\n *\n * @param url - The URL string to extract the package name from\n *\n * @returns The extracted package name, or null if not found\n *\n * @beta\n * @group Logger\n */\nexport function getPackageNameFromUrl(url: string | null): string | null {\n if (!url) return null;\n\n const rawName =\n extractFromLwcComponentsPath(url) ||\n extractFromPackagesPath(url) ||\n extractFromPlusVersion(url) ||\n extractFromStaticPath(url);\n\n if (!rawName) {\n return null;\n }\n\n return rawName;\n}\n\nfunction extractFromLwcComponentsPath(url: string): string | null {\n const pattern = /\\/([^/]+)-lwc-components\\//;\n const match = url.match(pattern);\n\n return match ? match[1] : null;\n}\n\nfunction extractFromPackagesPath(url: string): string | null {\n const packagesPattern = /\\/packages\\/(?:@[^/]+\\/)?([^/]+)/;\n const match = url.match(packagesPattern);\n\n return match ? match[1] : null;\n}\n\nfunction extractFromPlusVersion(url: string): string | null {\n const plusIndex = url.indexOf('+');\n if (plusIndex === -1) {\n return null;\n }\n\n const beforePlus = url.slice(0, plusIndex);\n const lastSlash = beforePlus.lastIndexOf('/');\n\n if (lastSlash === -1) {\n return null;\n }\n\n return beforePlus.slice(lastSlash + 1);\n}\n\nfunction extractFromStaticPath(url: string): string | null {\n const staticPattern = /\\/static\\/([^/]+)\\//;\n const match = url.match(staticPattern);\n\n return match ? match[1] : null;\n}\n","/**\n * Available severity levels for problems.\n *\n * Severity indicates the urgency and impact of a problem, helping users\n * prioritize which issues need attention first. The levels are:\n * - `Low` - Minor issues that don't significantly impact operations\n * - `Medium` - Issues that should be addressed but aren't urgent\n * - `High` - Important issues requiring prompt attention\n * - `Critical` - Severe issues that need immediate action\n *\n * @example\n * Setting severity when creating a problem\n * ```typescript\n * const problem: Problem = {\n * id: 'email-123',\n * providerId: 'email-integration',\n * type: 'delivery-failed',\n * description: 'Email could not be delivered to recipient',\n * createdAt: new Date().toISOString(),\n * severity: ProblemSeverity.High\n * };\n * ```\n *\n * @example\n * Filtering problems by severity\n * ```typescript\n * const criticalProblems = await provider.getProblems({\n * severity: ProblemSeverity.Critical\n * });\n *\n * const urgentProblems = await provider.getProblems({\n * severity: [ProblemSeverity.High, ProblemSeverity.Critical]\n * });\n * ```\n *\n * @alpha\n * @group Problem\n */\nexport const ProblemSeverity = {\n Low: 'low',\n Medium: 'medium',\n High: 'high',\n Critical: 'critical',\n} as const;\n\n/**\n * Severity level for a problem, indicating urgency and impact.\n *\n * @see {@link ProblemSeverity} for available values\n *\n * @alpha\n * @group Problem\n */\nexport type ProblemSeverity =\n (typeof ProblemSeverity)[keyof typeof ProblemSeverity];\n\n/**\n * Links a problem to a specific {@link LimeObject}.\n *\n * When a problem is related to a specific business object (e.g., a contact\n * whose email bounced, or a deal that failed to sync), the context provides\n * the link to that object. This enables:\n * - Navigating from the problem to the related object\n * - Showing problems when viewing a specific object\n * - Filtering problems by related object type or instance\n *\n * @example\n * Problem linked to a specific contact\n * ```typescript\n * const problem: Problem = {\n * id: 'email-789',\n * providerId: 'email-integration',\n * type: 'delivery-failed',\n * description: 'Email bounced - invalid address',\n * createdAt: new Date().toISOString(),\n * context: {\n * limetype: 'contact',\n * id: 12345\n * }\n * };\n * ```\n *\n * @see {@link Problem.context}\n * @see {@link ProblemContextFilter} for filtering by context\n *\n * @alpha\n * @group Problem\n */\nexport type ProblemContext = {\n /**\n * The limetype of the related object (e.g., 'contact', 'deal', 'company')\n */\n limetype: string;\n\n /**\n * The id of the specific object instance\n */\n id: number;\n};\n\n/**\n * Technical error details for a problem.\n *\n * While {@link Problem.description} provides a user-friendly explanation,\n * ProblemError captures the underlying technical details useful for debugging.\n * This separation allows the platform to show appropriate information to\n * different audiences.\n *\n * @example\n * Problem with error details\n * ```typescript\n * const problem: Problem = {\n * id: 'sync-001',\n * providerId: 'external-crm',\n * type: 'connection-error',\n * description: 'Could not sync deal with external CRM',\n * createdAt: new Date().toISOString(),\n * error: {\n * message: 'Connection refused by remote host',\n * code: 'ECONNREFUSED',\n * stack: 'Error: Connection refused\\n at TCPConnectWrap...'\n * }\n * };\n * ```\n *\n * @see {@link Problem.error}\n *\n * @alpha\n * @group Problem\n */\nexport interface ProblemError {\n /**\n * Technical error message.\n *\n * This is the raw error message from the underlying system, which may\n * be more technical than the user-facing {@link Problem.description}.\n */\n message: string;\n\n /**\n * Error code for programmatic handling.\n *\n * Codes allow categorizing errors without parsing message text.\n * Use standard codes where applicable (e.g., `ETIMEDOUT`, `ECONNREFUSED`)\n * or provider-specific codes.\n */\n code?: string;\n\n /**\n * Stack trace for debugging.\n *\n * The full stack trace helps developers diagnose where errors originated.\n * May be displayed in an expandable \"Technical Details\" section.\n */\n stack?: string;\n}\n\n/**\n * Represents a problem reported by a {@link ProblemProvider}.\n *\n * Problems are system-level issues that require manual intervention, such as:\n * - Failed email delivery or validation errors\n * - Integration sync failures with external systems\n * - Background task configuration errors\n * - Data import issues with corrupt records\n *\n * Each problem belongs to a provider which owns the problem's lifecycle,\n * storage, and available actions. Problems can optionally be linked to a\n * specific {@link LimeObject} via the `context` property.\n *\n * The platform aggregates problems from all registered providers, allowing\n * authorized users to view and manage issues across the system.\n *\n * The generic type parameter `T` allows providers to define strongly-typed\n * metadata for their specific problem types.\n *\n * @typeParam T - The type of the metadata object. Defaults to `unknown`.\n *\n * @example\n * Basic problem with required fields only\n * ```typescript\n * const problem: Problem = {\n * id: 'prob-001',\n * providerId: 'email-integration',\n * type: 'delivery-failed',\n * description: 'Email to john@example.com bounced with error: mailbox full',\n * createdAt: '2024-01-15T10:30:00Z'\n * };\n * ```\n *\n * @example\n * Problem with typed metadata\n * ```typescript\n * interface EmailProblemMetadata {\n * recipientEmail: string;\n * bounceType: 'permanent' | 'temporary';\n * smtpCode: number;\n * }\n *\n * const problem: Problem<EmailProblemMetadata> = {\n * id: 'email-123',\n * providerId: 'email-integration',\n * type: 'delivery-failed',\n * description: 'Email bounced',\n * createdAt: '2024-01-15T10:30:00Z',\n * metadata: {\n * recipientEmail: 'john@example.com',\n * bounceType: 'permanent',\n * smtpCode: 550\n * }\n * };\n * ```\n *\n * @example\n * Problem with error details\n * ```typescript\n * const problem: Problem = {\n * id: 'sync-error-042',\n * providerId: 'external-crm-sync',\n * type: 'connection-error',\n * description: 'Failed to sync deal with external CRM',\n * createdAt: '2024-01-15T14:22:00Z',\n * severity: ProblemSeverity.High,\n * status: 'pending-retry',\n * context: { limetype: 'deal', id: 98765 },\n * error: {\n * message: 'ETIMEDOUT: connection timed out after 30000ms',\n * code: 'ETIMEDOUT',\n * stack: 'Error: ETIMEDOUT\\n at TCPConnectWrap.afterConnect...'\n * }\n * };\n * ```\n *\n * @see {@link ProblemProvider} for the interface that supplies problems\n * @see {@link ProblemRepository} for registering providers and querying problems\n * @see {@link ProblemSeverity} for severity levels\n * @see {@link ProblemError} for technical error details\n *\n * @alpha\n * @group Problem\n */\nexport interface Problem<T = unknown> {\n /**\n * Unique identifier for the problem within the provider.\n *\n * The id only needs to be unique within a single provider. The combination\n * of `providerId` and `id` uniquely identifies a problem across the system.\n */\n id: string;\n\n /**\n * Identifier of the {@link ProblemProvider} that reported this problem.\n *\n * This links the problem back to its owning provider, which controls\n * the problem's lifecycle and available actions.\n *\n * This property is set automatically by the platform when problems are\n * returned from the {@link ProblemRepository}. Providers should not\n * include this property when returning problems from their methods.\n */\n providerId: string;\n\n /**\n * Type identifier for categorizing the problem.\n *\n * Types are provider-specific and allow grouping similar problems together.\n * Use a consistent naming convention, typically with a prefix indicating\n * the domain (e.g., 'email.delivery-failed', 'sync.connection-error').\n *\n * The provider's {@link ProblemProvider.getType} method returns display\n * information (title, description, icon) for each type.\n *\n * @example\n * ```typescript\n * // Email integration provider types\n * type: 'email.delivery-failed'\n * type: 'email.validation-error'\n * type: 'email.attachment-too-large'\n *\n * // Sync provider types\n * type: 'sync.connection-error'\n * type: 'sync.data-conflict'\n * type: 'sync.rate-limited'\n * ```\n */\n type: string;\n\n /**\n * Human-readable description of what went wrong.\n *\n * The description should be clear enough for users to understand the issue\n * without needing technical knowledge. Include relevant details like\n * affected entities, error messages, or suggested actions.\n *\n * @example\n * ```typescript\n * // Good descriptions\n * description: 'Email to john@example.com could not be delivered: mailbox is full'\n * description: 'Failed to sync deal \"Big Corp Renewal\" with external system: connection timeout'\n *\n * // Avoid overly technical descriptions\n * description: 'SMTP 452 4.2.2 error' // Too technical\n * ```\n */\n description: string;\n\n /**\n * ISO 8601 timestamp when the problem was first detected.\n *\n * @example\n * ```typescript\n * createdAt: '2024-01-15T10:30:00Z'\n * createdAt: new Date().toISOString()\n * ```\n */\n createdAt: string;\n\n /**\n * Severity level indicating the problem's urgency and impact.\n *\n * Use severity to help users prioritize which problems to address first.\n *\n * @see {@link ProblemSeverity}\n */\n severity?: ProblemSeverity;\n\n /**\n * Current status in the problem's lifecycle.\n *\n * Status is provider-defined. Each provider can define their own status\n * values that make sense for their workflow (e.g., 'open', 'in-progress',\n * 'pending-retry', 'resolved').\n *\n * Status is optional. Some providers may choose to simply remove problems\n * when they're resolved rather than tracking status transitions.\n */\n status?: string;\n\n /**\n * Tags for additional categorization and filtering.\n *\n * Tags provide flexible categorization beyond the `type` field. They can\n * represent things like affected systems, error categories, or custom\n * classifications specific to your domain.\n *\n * @example\n * ```typescript\n * tags: ['email', 'bounce', 'permanent']\n * tags: ['sync', 'external-system', 'timeout']\n * tags: ['import', 'validation', 'required-field']\n * ```\n */\n tags?: string[];\n\n /**\n * Identifier of the user associated with this problem.\n *\n * This could be the user who triggered the action that failed, or the\n * user responsible for the affected data. The exact meaning depends on\n * the provider's context.\n */\n userId?: string;\n\n /**\n * Link to a related {@link LimeObject}.\n *\n * When a problem is directly related to a specific business object,\n * the context provides navigation and filtering capabilities.\n *\n * @see {@link ProblemContext}\n */\n context?: ProblemContext;\n\n /**\n * Technical error details for debugging.\n *\n * While `description` provides a user-friendly explanation, `error`\n * captures the underlying technical details. The platform may display\n * this in an expandable \"Technical Details\" section.\n *\n * @see {@link ProblemError}\n */\n error?: ProblemError;\n\n /**\n * Additional provider-specific data.\n *\n * Metadata allows providers to attach arbitrary data to problems that\n * may be useful for debugging, displaying additional details, or\n * powering actions. Values should be JSON-serializable.\n *\n * Use the generic type parameter to get type safety for your metadata.\n *\n * @example\n * ```typescript\n * metadata: {\n * originalEmailId: 'msg-123',\n * recipientEmail: 'john@example.com',\n * bounceType: 'permanent',\n * smtpCode: 550\n * }\n * ```\n */\n metadata?: T;\n\n /**\n * ISO 8601 timestamp when the problem was last modified.\n *\n * Updated when status changes, metadata is modified, or any other\n * property is updated after initial creation.\n */\n updatedAt?: string;\n}\n","import { PlatformServiceName } from '../core/platform';\nimport { ProblemRepository as Service } from './repository';\n\nconst SERVICE_NAME = 'problemRepository';\n\nPlatformServiceName.ProblemRepository = SERVICE_NAME;\n\ndeclare module '../core/platform' {\n interface PlatformServiceNameType {\n /**\n * @see {@link Service | ProblemRepository}\n */\n ProblemRepository: typeof SERVICE_NAME;\n }\n interface LimeWebComponentPlatform {\n get(name: PlatformServiceNameType['ProblemRepository']): Service;\n }\n}\n","import { createLogger, Logger } from '../logger';\nimport { setErrorHandler } from '@stencil/core';\n\nlet logger: Logger | null = null;\n\n/**\n * Global error handler for uncaught errors in Stencil components.\n * Logs the error using the Lime platform's logging system.\n *\n * @remarks\n * This function is registered as the global error handler for Stencil\n * components to capture uncaught errors and log them appropriately.\n *\n * @param err - The uncaught error object\n * @param element - The Stencil component element where the error occurred\n *\n * @internal\n */\nexport function errorHandler(err: unknown, element?: HTMLElement) {\n if (!logger) {\n logger = createLogger('uncaught-error');\n }\n\n const data: Record<string, unknown> = {};\n\n if (element) {\n data.element = element.tagName;\n if (element.id) {\n data.elementId = element.id;\n }\n }\n\n const message = err instanceof Error ? err.message : String(err);\n const error = err instanceof Error ? err : undefined;\n\n logger.error(message, error, data);\n}\n\ntry {\n // Sets up a global error handler for uncaught errors in Stencil components.\n setErrorHandler(errorHandler);\n} catch {\n // Ignore errors if Stencil core is not available\n}\n"],"names":["PlatformServiceName","IdleStateEventName","isRelation","property","isSingleRelation","isDate","isString","isFloat","SERVICE_NAME","extendStatics","d","b","p","__extends","__","__values","o","s","m","i","__read","n","r","ar","e","error","__spreadArray","to","from","pack","l","isFunction","value","createErrorClass","createImpl","_super","instance","ctorFunc","UnsubscriptionError","errors","err","arrRemove","arr","item","index","Subscription","initialTeardown","e_1","_a","e_2","_b","_parentage","_parentage_1","_parentage_1_1","parent_1","e_1_1","initialFinalizer","_finalizers","_finalizers_1","_finalizers_1_1","finalizer","execFinalizer","e_2_1","teardown","parent","empty","EMPTY_SUBSCRIPTION","isSubscription","config","timeoutProvider","handler","timeout","args","_i","handle","reportUnhandledError","noop","errorContext","cb","Subscriber","destination","_this","EMPTY_OBSERVER","next","complete","SafeSubscriber","ConsumerObserver","partialObserver","handleUnhandledError","observerOrNext","defaultErrorHandler","observable","identity","x","pipeFromArray","fns","input","prev","fn","Observable","subscribe","operator","subscriber","isSubscriber","source","sink","promiseCtor","getPromiseCtor","resolve","reject","Symbol_observable","operations","isObserver","ObjectUnsubscribedError","Subject","subject","AnonymousSubject","_c","observer","observers","hasError","isStopped","thrownError","BehaviorSubject","_value","subscription","defaultOptionFactory","options","createStateDecorator","target","properties","getComponentProperties","extendLifecycleMethods","componentProperties","componentSubscriptions","connectedComponents","component","createConnectedCallback","createComponentWillLoad","createDisconnectedCallback","original","ensureLimeProps","watchProp","isContextAware","result","unsubscribeAll","promises","waitForProp","element","getElement","get","set","createSubscription","subscriptions","unsubscribe","mapState","state","myOptions","bindFunctions","name","platform","scope","func","SelectLimeTypes","SelectCurrentLimeType","currentLimetype","limetypes","limetype","findLimetypeByLabel","label","hasLabel","getPropertiesByType","type","getPropertyByLabel","getPropertyByName","propertyName","object","SelectLimeObjects","createOptions","SelectCurrentLimeObject","currentLimeobject","limeobjects","id","CommandEventName","Command","commandClass","setCommandId","setHasInstance","getCommandIds","getCommandId","ids","COMMAND_ID","BulkCreateDialogCommand","__decorateClass","CreateLimeobjectDialogCommand","DeleteObjectCommand","OpenObjectAccessDialogCommand","SaveLimeObjectCommand","Operator","AggregateOperator","HttpMethod","SelectQueryParam","NavigateCommand","TaskState","TaskEventType","SelectConfig","SelectDevice","SelectFilters","SelectUserData","SelectApplicationName","getApplicationName","applicationData","SelectCurrentUser","getCurrentUser","SelectSession","getSession","isLimeObjectCondition","condition","isActionCondition","LogLevel","scriptUrl","packageName","createLogger","factory","getPackageNameFromUrl","getCurrentScriptUrl","getUrlFromErrorStack","stack","stackLines","line","match","url","rawName","extractFromLwcComponentsPath","extractFromPackagesPath","extractFromPlusVersion","extractFromStaticPath","pattern","packagesPattern","plusIndex","beforePlus","lastSlash","staticPattern","ProblemSeverity","logger","errorHandler","data","message","setErrorHandler"],"mappings":";AAuKO,MAAMA,IAA+C;AAAA,EACxD,OAAO;AACX,GC/IaC,KAAqB;ACoE3B,SAASC,GAAWC,GAAwB;AAQ/C,SAAOA,KAP2B;AAAA,IAC9B;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,EAGyB,SAASA,EAAS,IAAI;AACvD;AAYO,SAASC,GAAiBD,GAAwB;AAGrD,SAAOA,KAF2B,CAAC,aAAa,QAA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AC,IAAI;AAC9B;AAEA,SAASK,GAAuBJ,GAA4B;AACxD,QAAMQ,IAAYR,EAAI,QAAQ,GAAG;AACjC,MAAIQ,MAAc;AACd,WAAO;AAGX,QAAMC,IAAaT,EAAI,MAAM,GAAGQ,CAAS,GACnCE,IAAYD,EAAW,YAAY,GAAG;AAE5C,SAAIC,MAAc,KACP,OAGJD,EAAW,MAAMC,IAAY,CAAC;AACzC;AAEA,SAASL,GAAsBL,GAA4B;AACvD,QAAMW,IAAgB,uBAChBZ,IAAQC,EAAI,MAAMW,CAAa;AAErC,SAAOZ,IAAQA,EAAM,CAAC,IAAI;AAC9B;AC3HO,MAAMa,KAAkB;AAAA,EAC3B,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,UAAU;AACd,GCxCM3O,KAAe;AAErBR,EAAoB,oBAAoBQ;ACFxC,IAAI4O,IAAwB;AAerB,SAASC,GAAa7M,GAAc4G,GAAuB;AAC9D,EAAKgG,MACDA,IAAStB,GAAa,gBAAgB;AAG1C,QAAMwB,IAAgC,CAAA;AAEtC,EAAIlG,MACAkG,EAAK,UAAUlG,EAAQ,SACnBA,EAAQ,OACRkG,EAAK,YAAYlG,EAAQ;AAIjC,QAAMmG,IAAU/M,aAAe,QAAQA,EAAI,UAAU,OAAOA,CAAG,GACzDf,IAAQe,aAAe,QAAQA,IAAM;AAE3C,EAAA4M,EAAO,MAAMG,GAAS9N,GAAO6N,CAAI;AACrC;AAEA,IAAI;AAEA,EAAAE,GAAgBH,EAAY;AAChC,QAAQ;AAER;","x_google_ignoreList":[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]}
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../src/core/platform.ts","../src/core/idle.ts","../src/limetype/property.ts","../src/limetype/types.ts","../node_modules/tslib/tslib.es6.mjs","../node_modules/rxjs/dist/esm5/internal/util/isFunction.js","../node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js","../node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js","../node_modules/rxjs/dist/esm5/internal/util/arrRemove.js","../node_modules/rxjs/dist/esm5/internal/Subscription.js","../node_modules/rxjs/dist/esm5/internal/config.js","../node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js","../node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js","../node_modules/rxjs/dist/esm5/internal/util/noop.js","../node_modules/rxjs/dist/esm5/internal/util/errorContext.js","../node_modules/rxjs/dist/esm5/internal/Subscriber.js","../node_modules/rxjs/dist/esm5/internal/symbol/observable.js","../node_modules/rxjs/dist/esm5/internal/util/identity.js","../node_modules/rxjs/dist/esm5/internal/util/pipe.js","../node_modules/rxjs/dist/esm5/internal/Observable.js","../node_modules/rxjs/dist/esm5/internal/util/ObjectUnsubscribedError.js","../node_modules/rxjs/dist/esm5/internal/Subject.js","../node_modules/rxjs/dist/esm5/internal/BehaviorSubject.js","../src/core/decorators/factory.ts","../src/limetype/decorator.ts","../src/limetype/find-limetype-by-label.ts","../src/limetype/get-properties-by-type.ts","../src/limetype/get-property-by-label.ts","../src/limetype/get-property-by-name.ts","../src/limetype/has-label.ts","../src/limeobject/types.ts","../src/limeobject/decorator.ts","../src/commandbus/commandbus.ts","../src/commandbus/types.ts","../src/limeobject/commands/bulk-create-dialog.ts","../src/limeobject/commands/create-dialog.ts","../src/limeobject/commands/delete-object.ts","../src/limeobject/commands/object-access.ts","../src/limeobject/commands/save-object.ts","../src/query/query.ts","../src/query/types.ts","../src/http/http.ts","../src/http/types.ts","../src/eventdispatcher/types.ts","../src/translator/types.ts","../src/dialog/types.ts","../src/keybindings/types.ts","../src/navigator/types.ts","../src/navigator/decorator.ts","../src/navigator/command.ts","../src/notifications/types.ts","../src/routeregistry/types.ts","../src/task/repository.ts","../src/task/types.ts","../src/config/types.ts","../src/config/decorator.ts","../src/device/types.ts","../src/device/decorator.ts","../src/filter/types.ts","../src/filter/decorator.ts","../src/userdata/types.ts","../src/userdata/decorator.ts","../src/application/types.ts","../src/application/decorators/application.ts","../src/application/decorators/user.ts","../src/application/decorators/session.ts","../src/userpreferences/types.ts","../src/datetimeformatter/types.ts","../src/conditionregistry/conditionregistry.ts","../src/conditionregistry/types.ts","../src/view/types.ts","../src/webcomponent/types.ts","../src/notification-service/types.ts","../src/poller/types.ts","../src/logger/logger.ts","../src/logger/types.ts","../src/logger/factory.ts","../src/problem/problem.ts","../src/problem/types.ts","../src/ai-context/types.ts","../src/error/error.ts"],"sourcesContent":["/**\n * Service container for the Lime CRM platform that provides access to all platform services.\n *\n * The platform acts as a service locator for accessing repositories, the command bus,\n * HTTP client, and other services throughout the application. It is used by web components\n * (injected via Stencil's `@Prop` decorator), command handlers, and other parts of the system.\n *\n * The platform type indicates which Lime CRM client is hosting the component:\n * - `LimeCRMWebClient`: Standard web client\n * - `LimeCRMDesktopClient`: Desktop application client\n * - `LimeCRMWebAdminClient`: Administrative web interface\n *\n * @example\n * ```typescript\n * // Get core services\n * const http = platform.get(PlatformServiceName.Http);\n * const commandBus = platform.get(PlatformServiceName.CommandBus);\n * const limetypes = platform.get(PlatformServiceName.LimeTypeRepository);\n *\n * // Check platform type for conditional logic\n * if (platform.type === 'LimeCRMDesktopClient') {\n * // Desktop-specific functionality\n * }\n *\n * // Check feature switches\n * if (platform.isFeatureEnabled('newFeature')) {\n * // Use new feature\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Register a custom service (third-party plugins)\n * platform.register('myPlugin.analytics', new AnalyticsService());\n *\n * // Later retrieve it\n * const analytics = platform.get('myPlugin.analytics');\n * ```\n *\n * @public\n * @group Core\n */\nexport interface LimeWebComponentPlatform {\n /**\n * The type of Lime CRM client currently running.\n * Use this to conditionally enable features based on the client environment.\n */\n type: 'LimeCRMWebClient' | 'LimeCRMDesktopClient' | 'LimeCRMWebAdminClient';\n\n /**\n * Get a service from the platform container.\n *\n * Services are accessed through the `PlatformServiceName` enum, which can be extended\n * by third-party modules using module augmentation.\n *\n * @param name - The name of the service to retrieve\n * @returns The requested service instance\n *\n * @example\n * ```typescript\n * const http = platform.get(PlatformServiceName.Http);\n * const repository = platform.get(PlatformServiceName.LimeObjectRepository);\n * ```\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n get(name: string): any;\n\n /**\n * Check if a service is currently registered on the platform.\n *\n * Useful for optional dependencies or checking service availability.\n *\n * @param name - The name of the service to check\n * @returns `true` if the service is registered, `false` otherwise\n *\n * @example\n * ```typescript\n * if (platform.has(PlatformServiceName.Analytics)) {\n * const tracker = platform.get(PlatformServiceName.Analytics);\n * tracker.track('event');\n * }\n * ```\n */\n has(name: string): boolean;\n\n /**\n * Register a service on the platform for use throughout the application.\n *\n * Service names are typically defined in the `PlatformServiceName` enum through module\n * augmentation. This ensures type safety and prevents naming conflicts.\n *\n * @param name - The name to register the service under\n * @param service - The service instance to register\n *\n * @example\n * ```typescript\n * const SERVICE_NAME = 'myPlugin.cache';\n * PlatformServiceName.MyCache = SERVICE_NAME;\n *\n * declare module '@limetech/lime-web-components' {\n * interface PlatformServiceNameType {\n * MyCache: typeof SERVICE_NAME;\n * }\n *\n * interface LimeWebComponentPlatform {\n * get(name: PlatformServiceNameType['MyCache']): CacheService;\n * }\n * }\n *\n * // Register the service\n * platform.register(PlatformServiceName.MyCache, new CacheService());\n * ```\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n register(name: string, service: any): void;\n\n /**\n * Check if a feature is enabled in the current environment.\n *\n * Feature switches allow gradual rollout of new functionality and\n * environment-specific behavior. Features can be enabled/disabled\n * at the application, user, or system level.\n *\n * @param name - Name of the feature switch to check\n * @returns `true` if the feature is enabled, `false` otherwise\n *\n * @example\n * ```typescript\n * // Use feature switches for gradual rollout\n * if (platform.isFeatureEnabled('advancedSearch')) {\n * return new AdvancedSearchComponent();\n * } else {\n * return new BasicSearchComponent();\n * }\n * ```\n */\n isFeatureEnabled(name: keyof FeatureSwitches): boolean;\n}\n\n/**\n * Core platform service names for accessing built-in services via the platform.\n *\n * Use these strongly-typed keys to retrieve platform services.\n *\n * @example\n * ```typescript\n * const http = platform.get(PlatformServiceName.Http);\n * const commandBus = platform.get(PlatformServiceName.CommandBus);\n * const limeObjects = platform.get(PlatformServiceName.LimeObjectRepository);\n * const limeTypes = platform.get(PlatformServiceName.LimeTypeRepository);\n * const navigator = platform.get(PlatformServiceName.Navigator);\n * ```\n *\n * @remarks\n * Available services include:\n * - `Http` - HTTP client for API requests\n * - `CommandBus` - Command pattern implementation for actions\n * - `LimeObjectRepository` - CRUD operations for business objects\n * - `LimeTypeRepository` - Schema and metadata access\n * - `Navigator` - Client-side routing\n * - `EventDispatcher` - Event pub/sub system\n * - `Translator` - Localization service\n * - And many more...\n *\n * @public\n * @group Core\n */\nexport const PlatformServiceName: PlatformServiceNameType = {\n Route: 'route',\n} as unknown as PlatformServiceNameType;\n\n/**\n * Interface for platform service names that gets augmented by each service module.\n *\n * Each platform service extends this interface through module augmentation to add\n * its service name. This pattern provides compile-time type safety for service names.\n *\n * @example\n * ```typescript\n * // How services augment this interface (done internally by each service):\n * const SERVICE_NAME = 'http';\n * PlatformServiceName.Http = SERVICE_NAME;\n *\n * declare module '@limetech/lime-web-components' {\n * interface PlatformServiceNameType {\n * Http: typeof SERVICE_NAME;\n * }\n *\n * interface LimeWebComponentPlatform {\n * get(name: PlatformServiceNameType['Http']): HttpService;\n * }\n * }\n * ```\n *\n * @public\n * @group Core\n */\nexport interface PlatformServiceNameType {}\n\n/**\n * Available feature switches for conditional functionality.\n *\n * Feature switches enable gradual rollout and A/B testing of new features.\n * This interface is augmented by feature modules to register their switches.\n *\n * @example\n * ```typescript\n * // How features augment this interface:\n * declare module '@limetech/lime-web-components' {\n * interface FeatureSwitches {\n * advancedSearch: boolean;\n * newUIDesign: boolean;\n * betaFeatures: boolean;\n * }\n * }\n *\n * // Usage in components:\n * if (platform.isFeatureEnabled('advancedSearch')) {\n * // Enable advanced search functionality\n * }\n * ```\n *\n * @public\n * @group Core\n */\nexport interface FeatureSwitches {}\n","// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport { EventDispatcher } from '../eventdispatcher';\n\n/**\n * The user's idle state. When set to `active` the user is actively using the\n * application. When set to `idle`, the user has either minimized the\n * application or not used it actively for a while.\n * @beta\n * @group Core\n */\nexport type IdleState = 'active' | 'idle';\n\n/**\n * The event emitted by {@link EventDispatcher} when the user's idle state\n * changes\n * @beta\n * @group Core\n */\nexport type IdleStateChangeEvent = CustomEvent<{ state: IdleState }>;\n\n/**\n * Name of the event emitted by {@link EventDispatcher} when the user's idle\n * state changes\n * @beta\n * @group Core\n */\nexport const IdleStateEventName = 'idle-state' as const;\n","import { Acl } from './acl';\nimport { LimeType } from './limetype';\n\n/**\n * @public\n * @group Lime types\n */\nexport interface LimeProperty {\n acl: Acl;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n defaultvalue: any;\n fieldorder: number;\n has_sql?: boolean;\n label: string;\n length?: number;\n localname: string;\n name: string;\n required: boolean;\n type: PropertyType;\n options?: Option[];\n relation?: {\n getLimetype: () => LimeType;\n getBackreference: () => LimeProperty;\n };\n}\n\n/**\n * @public\n * @group Lime types\n */\nexport interface Option {\n key: string;\n inactive: boolean;\n text: string;\n order?: number;\n id?: number;\n}\n\n/**\n * The subset of `PropertyType`s that represent a date or time of some kind.\n *\n * **NOTE**<br>\n * For legacy reasons:\n * - the type `time` represents a value with date _and_ time\n * - the type `timeofday` represents a value with _only_ time\n * - there is no type for \"week\"; instead week properties use the type `time` and are configured as \"week\" in the applicable view config\n *\n * @public\n * @group Lime types\n */\nexport type DateTimePropertyType =\n | 'time'\n | 'timeofday'\n | 'date'\n | 'year'\n | 'quarter'\n | 'month';\n\n/**\n * @public\n * @group Lime types\n */\nexport type PropertyType =\n | 'string'\n | 'text'\n | 'phone'\n | 'integer'\n | 'decimal'\n | 'percent'\n | 'yesno'\n | 'link'\n | 'user'\n | 'xml'\n | 'option'\n | 'set'\n | 'file'\n | 'hasone'\n | 'hasmany'\n | 'belongsto'\n | 'hasandbelongstomany'\n | 'system'\n | DateTimePropertyType;\n\n/**\n * Check if the property is a relation type, i.e. it is a property that\n * relates to another LimeType, such as `hasone`, `hasmany`, `belongsto`,\n * or `hasandbelongstomany`.\n *\n * @param property - the property to check\n * @returns true if the property is a relation type, false otherwise\n *\n * @public\n * @group Lime types\n */\nexport function isRelation(property: LimeProperty) {\n const propTypes: PropertyType[] = [\n 'belongsto',\n 'hasone',\n 'hasmany',\n 'hasandbelongstomany',\n ];\n\n return property && propTypes.includes(property.type);\n}\n\n/**\n * Check if the property is a single relation type, i.e. it is a property\n * that relates to another LimeType, such as `hasone` or `belongsto`.\n *\n * @param property - the property to check\n * @returns true if the property is a single relation type, false otherwise\n *\n * @public\n * @group Lime types\n */\nexport function isSingleRelation(property: LimeProperty) {\n const propTypes: PropertyType[] = ['belongsto', 'hasone'];\n\n return property && propTypes.includes(property.type);\n}\n\n/**\n * Check if the property is a date or time type, i.e. it is a property\n * that represents a date or time, such as `time`, `timeofday`, `date`,\n * `year`, `quarter`, or `month`.\n *\n * @param property - the property to check\n * @returns true if the property is a date or time type, false otherwise\n *\n * @public\n * @group Lime types\n */\nexport function isDate(property: LimeProperty) {\n const propTypes: PropertyType[] = [\n 'time',\n 'timeofday',\n 'date',\n 'year',\n 'quarter',\n 'month',\n ];\n\n return property && propTypes.includes(property.type);\n}\n\n/**\n * Check if the property is a string type, i.e. it is a property\n * that represents a string, such as `string`, `text`, `phone`, or `link`.\n *\n * @param property - the property to check\n * @returns true if the property is a string type, false otherwise\n *\n * @public\n * @group Lime types\n */\nexport function isString(property: LimeProperty) {\n const propTypes: PropertyType[] = ['string', 'text', 'phone', 'link'];\n\n return property && propTypes.includes(property.type);\n}\n\n/**\n * Check if the property is a float type, i.e. it is a property\n * that represents a decimal or percent value, such as `decimal` or `percent`.\n *\n * @param property - the property to check\n * @returns true if the property is a float type, false otherwise\n *\n * @public\n * @group Lime types\n */\nexport function isFloat(property: LimeProperty) {\n const propTypes: PropertyType[] = ['decimal', 'percent'];\n\n return property && propTypes.includes(property.type);\n}\n","import { PlatformServiceName } from '../core/platform';\nimport { LimeTypeRepository } from './repository';\n\nconst SERVICE_NAME = 'state.limetypes';\n\nPlatformServiceName.LimeTypeRepository = SERVICE_NAME;\n\ndeclare module '../core/platform' {\n interface PlatformServiceNameType {\n /**\n * @see {@link LimeTypeRepository}\n */\n LimeTypeRepository: typeof SERVICE_NAME;\n }\n\n interface LimeWebComponentPlatform {\n get(\n name: PlatformServiceNameType['LimeTypeRepository']\n ): LimeTypeRepository;\n }\n}\n","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nvar ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\n });\n }\n return path;\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __esDecorate,\n __runInitializers,\n __propKey,\n __setFunctionName,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n __rewriteRelativeImportExtension,\n};\n","export function isFunction(value) {\n return typeof value === 'function';\n}\n//# sourceMappingURL=isFunction.js.map","export function createErrorClass(createImpl) {\n var _super = function (instance) {\n Error.call(instance);\n instance.stack = new Error().stack;\n };\n var ctorFunc = createImpl(_super);\n ctorFunc.prototype = Object.create(Error.prototype);\n ctorFunc.prototype.constructor = ctorFunc;\n return ctorFunc;\n}\n//# sourceMappingURL=createErrorClass.js.map","import { createErrorClass } from './createErrorClass';\nexport var UnsubscriptionError = createErrorClass(function (_super) {\n return function UnsubscriptionErrorImpl(errors) {\n _super(this);\n this.message = errors\n ? errors.length + \" errors occurred during unsubscription:\\n\" + errors.map(function (err, i) { return i + 1 + \") \" + err.toString(); }).join('\\n ')\n : '';\n this.name = 'UnsubscriptionError';\n this.errors = errors;\n };\n});\n//# sourceMappingURL=UnsubscriptionError.js.map","export function arrRemove(arr, item) {\n if (arr) {\n var index = arr.indexOf(item);\n 0 <= index && arr.splice(index, 1);\n }\n}\n//# sourceMappingURL=arrRemove.js.map","import { __read, __spreadArray, __values } from \"tslib\";\nimport { isFunction } from './util/isFunction';\nimport { UnsubscriptionError } from './util/UnsubscriptionError';\nimport { arrRemove } from './util/arrRemove';\nvar Subscription = (function () {\n function Subscription(initialTeardown) {\n this.initialTeardown = initialTeardown;\n this.closed = false;\n this._parentage = null;\n this._finalizers = null;\n }\n Subscription.prototype.unsubscribe = function () {\n var e_1, _a, e_2, _b;\n var errors;\n if (!this.closed) {\n this.closed = true;\n var _parentage = this._parentage;\n if (_parentage) {\n this._parentage = null;\n if (Array.isArray(_parentage)) {\n try {\n for (var _parentage_1 = __values(_parentage), _parentage_1_1 = _parentage_1.next(); !_parentage_1_1.done; _parentage_1_1 = _parentage_1.next()) {\n var parent_1 = _parentage_1_1.value;\n parent_1.remove(this);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_parentage_1_1 && !_parentage_1_1.done && (_a = _parentage_1.return)) _a.call(_parentage_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n }\n else {\n _parentage.remove(this);\n }\n }\n var initialFinalizer = this.initialTeardown;\n if (isFunction(initialFinalizer)) {\n try {\n initialFinalizer();\n }\n catch (e) {\n errors = e instanceof UnsubscriptionError ? e.errors : [e];\n }\n }\n var _finalizers = this._finalizers;\n if (_finalizers) {\n this._finalizers = null;\n try {\n for (var _finalizers_1 = __values(_finalizers), _finalizers_1_1 = _finalizers_1.next(); !_finalizers_1_1.done; _finalizers_1_1 = _finalizers_1.next()) {\n var finalizer = _finalizers_1_1.value;\n try {\n execFinalizer(finalizer);\n }\n catch (err) {\n errors = errors !== null && errors !== void 0 ? errors : [];\n if (err instanceof UnsubscriptionError) {\n errors = __spreadArray(__spreadArray([], __read(errors)), __read(err.errors));\n }\n else {\n errors.push(err);\n }\n }\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (_finalizers_1_1 && !_finalizers_1_1.done && (_b = _finalizers_1.return)) _b.call(_finalizers_1);\n }\n finally { if (e_2) throw e_2.error; }\n }\n }\n if (errors) {\n throw new UnsubscriptionError(errors);\n }\n }\n };\n Subscription.prototype.add = function (teardown) {\n var _a;\n if (teardown && teardown !== this) {\n if (this.closed) {\n execFinalizer(teardown);\n }\n else {\n if (teardown instanceof Subscription) {\n if (teardown.closed || teardown._hasParent(this)) {\n return;\n }\n teardown._addParent(this);\n }\n (this._finalizers = (_a = this._finalizers) !== null && _a !== void 0 ? _a : []).push(teardown);\n }\n }\n };\n Subscription.prototype._hasParent = function (parent) {\n var _parentage = this._parentage;\n return _parentage === parent || (Array.isArray(_parentage) && _parentage.includes(parent));\n };\n Subscription.prototype._addParent = function (parent) {\n var _parentage = this._parentage;\n this._parentage = Array.isArray(_parentage) ? (_parentage.push(parent), _parentage) : _parentage ? [_parentage, parent] : parent;\n };\n Subscription.prototype._removeParent = function (parent) {\n var _parentage = this._parentage;\n if (_parentage === parent) {\n this._parentage = null;\n }\n else if (Array.isArray(_parentage)) {\n arrRemove(_parentage, parent);\n }\n };\n Subscription.prototype.remove = function (teardown) {\n var _finalizers = this._finalizers;\n _finalizers && arrRemove(_finalizers, teardown);\n if (teardown instanceof Subscription) {\n teardown._removeParent(this);\n }\n };\n Subscription.EMPTY = (function () {\n var empty = new Subscription();\n empty.closed = true;\n return empty;\n })();\n return Subscription;\n}());\nexport { Subscription };\nexport var EMPTY_SUBSCRIPTION = Subscription.EMPTY;\nexport function isSubscription(value) {\n return (value instanceof Subscription ||\n (value && 'closed' in value && isFunction(value.remove) && isFunction(value.add) && isFunction(value.unsubscribe)));\n}\nfunction execFinalizer(finalizer) {\n if (isFunction(finalizer)) {\n finalizer();\n }\n else {\n finalizer.unsubscribe();\n }\n}\n//# sourceMappingURL=Subscription.js.map","export var config = {\n onUnhandledError: null,\n onStoppedNotification: null,\n Promise: undefined,\n useDeprecatedSynchronousErrorHandling: false,\n useDeprecatedNextContext: false,\n};\n//# sourceMappingURL=config.js.map","import { __read, __spreadArray } from \"tslib\";\nexport var timeoutProvider = {\n setTimeout: function (handler, timeout) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n var delegate = timeoutProvider.delegate;\n if (delegate === null || delegate === void 0 ? void 0 : delegate.setTimeout) {\n return delegate.setTimeout.apply(delegate, __spreadArray([handler, timeout], __read(args)));\n }\n return setTimeout.apply(void 0, __spreadArray([handler, timeout], __read(args)));\n },\n clearTimeout: function (handle) {\n var delegate = timeoutProvider.delegate;\n return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearTimeout) || clearTimeout)(handle);\n },\n delegate: undefined,\n};\n//# sourceMappingURL=timeoutProvider.js.map","import { config } from '../config';\nimport { timeoutProvider } from '../scheduler/timeoutProvider';\nexport function reportUnhandledError(err) {\n timeoutProvider.setTimeout(function () {\n var onUnhandledError = config.onUnhandledError;\n if (onUnhandledError) {\n onUnhandledError(err);\n }\n else {\n throw err;\n }\n });\n}\n//# sourceMappingURL=reportUnhandledError.js.map","export function noop() { }\n//# sourceMappingURL=noop.js.map","import { config } from '../config';\nvar context = null;\nexport function errorContext(cb) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n var isRoot = !context;\n if (isRoot) {\n context = { errorThrown: false, error: null };\n }\n cb();\n if (isRoot) {\n var _a = context, errorThrown = _a.errorThrown, error = _a.error;\n context = null;\n if (errorThrown) {\n throw error;\n }\n }\n }\n else {\n cb();\n }\n}\nexport function captureError(err) {\n if (config.useDeprecatedSynchronousErrorHandling && context) {\n context.errorThrown = true;\n context.error = err;\n }\n}\n//# sourceMappingURL=errorContext.js.map","import { __extends } from \"tslib\";\nimport { isFunction } from './util/isFunction';\nimport { isSubscription, Subscription } from './Subscription';\nimport { config } from './config';\nimport { reportUnhandledError } from './util/reportUnhandledError';\nimport { noop } from './util/noop';\nimport { nextNotification, errorNotification, COMPLETE_NOTIFICATION } from './NotificationFactories';\nimport { timeoutProvider } from './scheduler/timeoutProvider';\nimport { captureError } from './util/errorContext';\nvar Subscriber = (function (_super) {\n __extends(Subscriber, _super);\n function Subscriber(destination) {\n var _this = _super.call(this) || this;\n _this.isStopped = false;\n if (destination) {\n _this.destination = destination;\n if (isSubscription(destination)) {\n destination.add(_this);\n }\n }\n else {\n _this.destination = EMPTY_OBSERVER;\n }\n return _this;\n }\n Subscriber.create = function (next, error, complete) {\n return new SafeSubscriber(next, error, complete);\n };\n Subscriber.prototype.next = function (value) {\n if (this.isStopped) {\n handleStoppedNotification(nextNotification(value), this);\n }\n else {\n this._next(value);\n }\n };\n Subscriber.prototype.error = function (err) {\n if (this.isStopped) {\n handleStoppedNotification(errorNotification(err), this);\n }\n else {\n this.isStopped = true;\n this._error(err);\n }\n };\n Subscriber.prototype.complete = function () {\n if (this.isStopped) {\n handleStoppedNotification(COMPLETE_NOTIFICATION, this);\n }\n else {\n this.isStopped = true;\n this._complete();\n }\n };\n Subscriber.prototype.unsubscribe = function () {\n if (!this.closed) {\n this.isStopped = true;\n _super.prototype.unsubscribe.call(this);\n this.destination = null;\n }\n };\n Subscriber.prototype._next = function (value) {\n this.destination.next(value);\n };\n Subscriber.prototype._error = function (err) {\n try {\n this.destination.error(err);\n }\n finally {\n this.unsubscribe();\n }\n };\n Subscriber.prototype._complete = function () {\n try {\n this.destination.complete();\n }\n finally {\n this.unsubscribe();\n }\n };\n return Subscriber;\n}(Subscription));\nexport { Subscriber };\nvar _bind = Function.prototype.bind;\nfunction bind(fn, thisArg) {\n return _bind.call(fn, thisArg);\n}\nvar ConsumerObserver = (function () {\n function ConsumerObserver(partialObserver) {\n this.partialObserver = partialObserver;\n }\n ConsumerObserver.prototype.next = function (value) {\n var partialObserver = this.partialObserver;\n if (partialObserver.next) {\n try {\n partialObserver.next(value);\n }\n catch (error) {\n handleUnhandledError(error);\n }\n }\n };\n ConsumerObserver.prototype.error = function (err) {\n var partialObserver = this.partialObserver;\n if (partialObserver.error) {\n try {\n partialObserver.error(err);\n }\n catch (error) {\n handleUnhandledError(error);\n }\n }\n else {\n handleUnhandledError(err);\n }\n };\n ConsumerObserver.prototype.complete = function () {\n var partialObserver = this.partialObserver;\n if (partialObserver.complete) {\n try {\n partialObserver.complete();\n }\n catch (error) {\n handleUnhandledError(error);\n }\n }\n };\n return ConsumerObserver;\n}());\nvar SafeSubscriber = (function (_super) {\n __extends(SafeSubscriber, _super);\n function SafeSubscriber(observerOrNext, error, complete) {\n var _this = _super.call(this) || this;\n var partialObserver;\n if (isFunction(observerOrNext) || !observerOrNext) {\n partialObserver = {\n next: (observerOrNext !== null && observerOrNext !== void 0 ? observerOrNext : undefined),\n error: error !== null && error !== void 0 ? error : undefined,\n complete: complete !== null && complete !== void 0 ? complete : undefined,\n };\n }\n else {\n var context_1;\n if (_this && config.useDeprecatedNextContext) {\n context_1 = Object.create(observerOrNext);\n context_1.unsubscribe = function () { return _this.unsubscribe(); };\n partialObserver = {\n next: observerOrNext.next && bind(observerOrNext.next, context_1),\n error: observerOrNext.error && bind(observerOrNext.error, context_1),\n complete: observerOrNext.complete && bind(observerOrNext.complete, context_1),\n };\n }\n else {\n partialObserver = observerOrNext;\n }\n }\n _this.destination = new ConsumerObserver(partialObserver);\n return _this;\n }\n return SafeSubscriber;\n}(Subscriber));\nexport { SafeSubscriber };\nfunction handleUnhandledError(error) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n captureError(error);\n }\n else {\n reportUnhandledError(error);\n }\n}\nfunction defaultErrorHandler(err) {\n throw err;\n}\nfunction handleStoppedNotification(notification, subscriber) {\n var onStoppedNotification = config.onStoppedNotification;\n onStoppedNotification && timeoutProvider.setTimeout(function () { return onStoppedNotification(notification, subscriber); });\n}\nexport var EMPTY_OBSERVER = {\n closed: true,\n next: noop,\n error: defaultErrorHandler,\n complete: noop,\n};\n//# sourceMappingURL=Subscriber.js.map","export var observable = (function () { return (typeof Symbol === 'function' && Symbol.observable) || '@@observable'; })();\n//# sourceMappingURL=observable.js.map","export function identity(x) {\n return x;\n}\n//# sourceMappingURL=identity.js.map","import { identity } from './identity';\nexport function pipe() {\n var fns = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n fns[_i] = arguments[_i];\n }\n return pipeFromArray(fns);\n}\nexport function pipeFromArray(fns) {\n if (fns.length === 0) {\n return identity;\n }\n if (fns.length === 1) {\n return fns[0];\n }\n return function piped(input) {\n return fns.reduce(function (prev, fn) { return fn(prev); }, input);\n };\n}\n//# sourceMappingURL=pipe.js.map","import { SafeSubscriber, Subscriber } from './Subscriber';\nimport { isSubscription } from './Subscription';\nimport { observable as Symbol_observable } from './symbol/observable';\nimport { pipeFromArray } from './util/pipe';\nimport { config } from './config';\nimport { isFunction } from './util/isFunction';\nimport { errorContext } from './util/errorContext';\nvar Observable = (function () {\n function Observable(subscribe) {\n if (subscribe) {\n this._subscribe = subscribe;\n }\n }\n Observable.prototype.lift = function (operator) {\n var observable = new Observable();\n observable.source = this;\n observable.operator = operator;\n return observable;\n };\n Observable.prototype.subscribe = function (observerOrNext, error, complete) {\n var _this = this;\n var subscriber = isSubscriber(observerOrNext) ? observerOrNext : new SafeSubscriber(observerOrNext, error, complete);\n errorContext(function () {\n var _a = _this, operator = _a.operator, source = _a.source;\n subscriber.add(operator\n ?\n operator.call(subscriber, source)\n : source\n ?\n _this._subscribe(subscriber)\n :\n _this._trySubscribe(subscriber));\n });\n return subscriber;\n };\n Observable.prototype._trySubscribe = function (sink) {\n try {\n return this._subscribe(sink);\n }\n catch (err) {\n sink.error(err);\n }\n };\n Observable.prototype.forEach = function (next, promiseCtor) {\n var _this = this;\n promiseCtor = getPromiseCtor(promiseCtor);\n return new promiseCtor(function (resolve, reject) {\n var subscriber = new SafeSubscriber({\n next: function (value) {\n try {\n next(value);\n }\n catch (err) {\n reject(err);\n subscriber.unsubscribe();\n }\n },\n error: reject,\n complete: resolve,\n });\n _this.subscribe(subscriber);\n });\n };\n Observable.prototype._subscribe = function (subscriber) {\n var _a;\n return (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber);\n };\n Observable.prototype[Symbol_observable] = function () {\n return this;\n };\n Observable.prototype.pipe = function () {\n var operations = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n operations[_i] = arguments[_i];\n }\n return pipeFromArray(operations)(this);\n };\n Observable.prototype.toPromise = function (promiseCtor) {\n var _this = this;\n promiseCtor = getPromiseCtor(promiseCtor);\n return new promiseCtor(function (resolve, reject) {\n var value;\n _this.subscribe(function (x) { return (value = x); }, function (err) { return reject(err); }, function () { return resolve(value); });\n });\n };\n Observable.create = function (subscribe) {\n return new Observable(subscribe);\n };\n return Observable;\n}());\nexport { Observable };\nfunction getPromiseCtor(promiseCtor) {\n var _a;\n return (_a = promiseCtor !== null && promiseCtor !== void 0 ? promiseCtor : config.Promise) !== null && _a !== void 0 ? _a : Promise;\n}\nfunction isObserver(value) {\n return value && isFunction(value.next) && isFunction(value.error) && isFunction(value.complete);\n}\nfunction isSubscriber(value) {\n return (value && value instanceof Subscriber) || (isObserver(value) && isSubscription(value));\n}\n//# sourceMappingURL=Observable.js.map","import { createErrorClass } from './createErrorClass';\nexport var ObjectUnsubscribedError = createErrorClass(function (_super) {\n return function ObjectUnsubscribedErrorImpl() {\n _super(this);\n this.name = 'ObjectUnsubscribedError';\n this.message = 'object unsubscribed';\n };\n});\n//# sourceMappingURL=ObjectUnsubscribedError.js.map","import { __extends, __values } from \"tslib\";\nimport { Observable } from './Observable';\nimport { Subscription, EMPTY_SUBSCRIPTION } from './Subscription';\nimport { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError';\nimport { arrRemove } from './util/arrRemove';\nimport { errorContext } from './util/errorContext';\nvar Subject = (function (_super) {\n __extends(Subject, _super);\n function Subject() {\n var _this = _super.call(this) || this;\n _this.closed = false;\n _this.currentObservers = null;\n _this.observers = [];\n _this.isStopped = false;\n _this.hasError = false;\n _this.thrownError = null;\n return _this;\n }\n Subject.prototype.lift = function (operator) {\n var subject = new AnonymousSubject(this, this);\n subject.operator = operator;\n return subject;\n };\n Subject.prototype._throwIfClosed = function () {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n };\n Subject.prototype.next = function (value) {\n var _this = this;\n errorContext(function () {\n var e_1, _a;\n _this._throwIfClosed();\n if (!_this.isStopped) {\n if (!_this.currentObservers) {\n _this.currentObservers = Array.from(_this.observers);\n }\n try {\n for (var _b = __values(_this.currentObservers), _c = _b.next(); !_c.done; _c = _b.next()) {\n var observer = _c.value;\n observer.next(value);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n }\n });\n };\n Subject.prototype.error = function (err) {\n var _this = this;\n errorContext(function () {\n _this._throwIfClosed();\n if (!_this.isStopped) {\n _this.hasError = _this.isStopped = true;\n _this.thrownError = err;\n var observers = _this.observers;\n while (observers.length) {\n observers.shift().error(err);\n }\n }\n });\n };\n Subject.prototype.complete = function () {\n var _this = this;\n errorContext(function () {\n _this._throwIfClosed();\n if (!_this.isStopped) {\n _this.isStopped = true;\n var observers = _this.observers;\n while (observers.length) {\n observers.shift().complete();\n }\n }\n });\n };\n Subject.prototype.unsubscribe = function () {\n this.isStopped = this.closed = true;\n this.observers = this.currentObservers = null;\n };\n Object.defineProperty(Subject.prototype, \"observed\", {\n get: function () {\n var _a;\n return ((_a = this.observers) === null || _a === void 0 ? void 0 : _a.length) > 0;\n },\n enumerable: false,\n configurable: true\n });\n Subject.prototype._trySubscribe = function (subscriber) {\n this._throwIfClosed();\n return _super.prototype._trySubscribe.call(this, subscriber);\n };\n Subject.prototype._subscribe = function (subscriber) {\n this._throwIfClosed();\n this._checkFinalizedStatuses(subscriber);\n return this._innerSubscribe(subscriber);\n };\n Subject.prototype._innerSubscribe = function (subscriber) {\n var _this = this;\n var _a = this, hasError = _a.hasError, isStopped = _a.isStopped, observers = _a.observers;\n if (hasError || isStopped) {\n return EMPTY_SUBSCRIPTION;\n }\n this.currentObservers = null;\n observers.push(subscriber);\n return new Subscription(function () {\n _this.currentObservers = null;\n arrRemove(observers, subscriber);\n });\n };\n Subject.prototype._checkFinalizedStatuses = function (subscriber) {\n var _a = this, hasError = _a.hasError, thrownError = _a.thrownError, isStopped = _a.isStopped;\n if (hasError) {\n subscriber.error(thrownError);\n }\n else if (isStopped) {\n subscriber.complete();\n }\n };\n Subject.prototype.asObservable = function () {\n var observable = new Observable();\n observable.source = this;\n return observable;\n };\n Subject.create = function (destination, source) {\n return new AnonymousSubject(destination, source);\n };\n return Subject;\n}(Observable));\nexport { Subject };\nvar AnonymousSubject = (function (_super) {\n __extends(AnonymousSubject, _super);\n function AnonymousSubject(destination, source) {\n var _this = _super.call(this) || this;\n _this.destination = destination;\n _this.source = source;\n return _this;\n }\n AnonymousSubject.prototype.next = function (value) {\n var _a, _b;\n (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.next) === null || _b === void 0 ? void 0 : _b.call(_a, value);\n };\n AnonymousSubject.prototype.error = function (err) {\n var _a, _b;\n (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.error) === null || _b === void 0 ? void 0 : _b.call(_a, err);\n };\n AnonymousSubject.prototype.complete = function () {\n var _a, _b;\n (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.complete) === null || _b === void 0 ? void 0 : _b.call(_a);\n };\n AnonymousSubject.prototype._subscribe = function (subscriber) {\n var _a, _b;\n return (_b = (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber)) !== null && _b !== void 0 ? _b : EMPTY_SUBSCRIPTION;\n };\n return AnonymousSubject;\n}(Subject));\nexport { AnonymousSubject };\n//# sourceMappingURL=Subject.js.map","import { __extends } from \"tslib\";\nimport { Subject } from './Subject';\nvar BehaviorSubject = (function (_super) {\n __extends(BehaviorSubject, _super);\n function BehaviorSubject(_value) {\n var _this = _super.call(this) || this;\n _this._value = _value;\n return _this;\n }\n Object.defineProperty(BehaviorSubject.prototype, \"value\", {\n get: function () {\n return this.getValue();\n },\n enumerable: false,\n configurable: true\n });\n BehaviorSubject.prototype._subscribe = function (subscriber) {\n var subscription = _super.prototype._subscribe.call(this, subscriber);\n !subscription.closed && subscriber.next(this._value);\n return subscription;\n };\n BehaviorSubject.prototype.getValue = function () {\n var _a = this, hasError = _a.hasError, thrownError = _a.thrownError, _value = _a._value;\n if (hasError) {\n throw thrownError;\n }\n this._throwIfClosed();\n return _value;\n };\n BehaviorSubject.prototype.next = function (value) {\n _super.prototype.next.call(this, (this._value = value));\n };\n return BehaviorSubject;\n}(Subject));\nexport { BehaviorSubject };\n//# sourceMappingURL=BehaviorSubject.js.map","import {\n LimeWebComponent,\n LimeWebComponentPlatform,\n ContextAwareStateOptions,\n StateOptions,\n} from '..';\nimport { getElement } from '@stencil/core';\nimport { BehaviorSubject, Observer } from 'rxjs';\n\ntype OptionFactory = (\n options: StateOptions,\n component: LimeWebComponent\n) => StateOptions;\n\n/**\n * @group Core\n * @internal\n */\nexport interface StateDecoratorConfig {\n /**\n * Name of the state service to use in the platform\n */\n name: string;\n\n /**\n * Name of the method on the service to use\n */\n method?: string;\n\n /**\n * Factory for creating options dynamically\n *\n * @param options - decorator options\n * @param component - the web component\n * @returns state options\n */\n optionFactory?: OptionFactory;\n}\n\ninterface Component {\n connectedCallback: () => void | Promise<void>;\n componentWillLoad: () => void | Promise<void>;\n componentWillUpdate: () => void | Promise<void>;\n componentDidUnload: () => void;\n disconnectedCallback: () => void | Promise<void>;\n}\n\ninterface Property {\n name: string;\n options: StateOptions;\n optionFactory?: OptionFactory;\n service: {\n name: string;\n method: string;\n };\n}\n\nfunction defaultOptionFactory(options: StateOptions) {\n return options;\n}\n\n/**\n * Create a new state decorator\n *\n * @param options - decorator options\n * @param config - decorator configuration\n * @returns state decorator\n * @public\n */\nexport function createStateDecorator(\n options: StateOptions,\n config: StateDecoratorConfig\n): PropertyDecorator {\n return (target: Component, property: string) => {\n const properties = getComponentProperties(\n target,\n property,\n options,\n config\n );\n\n if (properties.length === 1) {\n extendLifecycleMethods(target, properties);\n }\n };\n}\n\nconst componentProperties = new WeakMap<Component, Property[]>();\nconst componentSubscriptions = new WeakMap<object, Array<() => void>>();\nconst connectedComponents = new WeakMap<object, boolean>();\n\n/**\n * Get properties data for a component\n *\n * @param component - the component class containing the decorator\n * @param property - name of the property\n * @param options - decorator options\n * @param config - decorator configuration\n * @returns properties data for the component\n */\nfunction getComponentProperties(\n component: Component,\n property: string,\n options: StateOptions,\n config: StateDecoratorConfig\n): Property[] {\n let properties = componentProperties.get(component);\n if (!properties) {\n properties = [];\n componentProperties.set(component, properties);\n }\n\n properties.push({\n options: options,\n name: property,\n optionFactory: config.optionFactory || defaultOptionFactory,\n service: {\n name: config.name,\n method: config.method || 'subscribe',\n },\n });\n\n return properties;\n}\n\n/**\n * Extend the lifecycle methods on the component\n *\n * @param component - the component to extend\n * @param properties - the properties with which to extend the component\n */\nfunction extendLifecycleMethods(component: Component, properties: Property[]) {\n // `componentWillLoad` and `componentDidUnload` is included for backwards\n // compatibility reasons. The correct way to setup the subscriptions is in\n // `connectedCallback` and `disconnectedCallback`, but since not all\n // plugins might implement those methods yet we still have include them\n // until we make `connectedCallback` and `disconnectedCallback` required\n // on the interface.\n\n component.connectedCallback = createConnectedCallback(\n component.connectedCallback,\n properties\n );\n component.componentWillLoad = createComponentWillLoad(\n component.componentWillLoad,\n properties\n );\n component.componentDidUnload = createDisconnectedCallback(\n component.componentDidUnload\n );\n component.disconnectedCallback = createDisconnectedCallback(\n component.disconnectedCallback\n );\n}\n\nfunction createConnectedCallback(original: () => void, properties: Property[]) {\n return async function (this: LimeWebComponent, ...args) {\n connectedComponents.set(this, true);\n componentSubscriptions.set(this, []);\n await ensureLimeProps(this);\n\n const observable = new BehaviorSubject(this.context);\n watchProp(this, 'context', observable);\n\n for (const property of properties) {\n property.options = property.optionFactory(property.options, this);\n if (isContextAware(property.options)) {\n property.options.context = observable;\n }\n\n subscribe(this, property);\n }\n\n if (original) {\n return original.apply(this, args);\n }\n };\n}\n\nfunction createComponentWillLoad(\n original: () => void | Promise<void>,\n properties: Property[]\n) {\n return async function (...args) {\n if (connectedComponents.get(this) === true) {\n await ensureLimeProps(this);\n if (original) {\n return original.apply(this, args);\n }\n\n return;\n }\n\n const connectedCallback = createConnectedCallback(original, properties);\n\n return connectedCallback.apply(this, args);\n };\n}\n\nfunction createDisconnectedCallback(original: () => void) {\n return async function (...args) {\n let result;\n if (original) {\n result = original.apply(this, args);\n }\n\n unsubscribeAll(this);\n\n return result;\n };\n}\n\n/**\n * Check if the options are context aware\n *\n * @param options - state decorator options\n * @returns true if the options are context aware\n */\nfunction isContextAware(options: object): options is ContextAwareStateOptions {\n return 'context' in options;\n}\n\n/**\n * Make sure that all required lime properties are set on the web component\n *\n * @param target - the web component\n * @returns a promise that resolves when all properties are defined\n */\nfunction ensureLimeProps(target: LimeWebComponent): Promise<unknown> {\n const promises = [];\n if (!target.platform) {\n promises.push(waitForProp(target, 'platform'));\n }\n\n if (!target.context) {\n promises.push(waitForProp(target, 'context'));\n }\n\n if (promises.length === 0) {\n return Promise.resolve();\n }\n\n return Promise.all(promises);\n}\n\n/**\n * Wait for a property to be defined on an object\n *\n * @param target - the web component\n * @param property - the name of the property to watch\n * @returns a promise that will resolve when the property is set on the object\n */\nfunction waitForProp(\n target: LimeWebComponent,\n property: string\n): Promise<void> {\n const element = getElement(target);\n\n return new Promise((resolve) => {\n Object.defineProperty(element, property, {\n configurable: true,\n set: (value: unknown) => {\n delete element[property];\n element[property] = value;\n resolve();\n },\n });\n });\n}\n\nfunction watchProp<T>(\n target: LimeWebComponent,\n property: string,\n observer: Observer<T>\n) {\n const element = getElement(target);\n\n const { get, set } = Object.getOwnPropertyDescriptor(\n Object.getPrototypeOf(element),\n property\n );\n\n Object.defineProperty(element, property, {\n configurable: true,\n get: get,\n set: function (value: T) {\n set.call(this, value);\n observer.next(value);\n },\n });\n}\n\n/**\n * Subscribe to changes from the state\n *\n * @param component - the component instance\n * @param property - property to update when subscription triggers\n */\nfunction subscribe(component: LimeWebComponent, property: Property): void {\n const subscription = createSubscription(component, property);\n if (typeof subscription !== 'function') {\n return;\n }\n\n const subscriptions = componentSubscriptions.get(component);\n subscriptions.push(subscription);\n}\n\n/**\n * Unsubscribe to changes from the state\n *\n * @param component - the instance of the component\n */\nfunction unsubscribeAll(component: LimeWebComponent): void {\n const subscriptions = componentSubscriptions.get(component);\n\n for (const unsubscribe of subscriptions) unsubscribe();\n componentSubscriptions.set(component, []);\n}\n\n/**\n * Get a function that accepts a state, and updates the given property\n * on the given component with that state\n *\n * @param instance - the component to augment\n * @param property - name of the property on the component\n * @returns updates the state\n */\nfunction mapState(instance: unknown, property: string) {\n return (state: unknown) => {\n instance[property] = state;\n };\n}\n\n/**\n * Create a state subscription\n *\n * @param component - the component instance\n * @param property - the property on the component\n * @returns unsubscribe function\n */\nfunction createSubscription(\n component: LimeWebComponent,\n property: Property\n): () => void {\n const myOptions = { ...property.options };\n bindFunctions(myOptions, component);\n const name = property.service.name;\n\n const platform: LimeWebComponentPlatform = component.platform;\n if (!platform.has(name)) {\n throw new Error(`Service ${name} does not exist`);\n }\n\n const service = platform.get(name);\n\n return service[property.service.method](\n mapState(component, property.name),\n myOptions\n );\n}\n\n/**\n * Bind connect functions to the current scope\n *\n * @param options - options for the selector\n * @param scope - the current scope to bind to\n */\nfunction bindFunctions(options: StateOptions, scope: unknown) {\n if (options.filter) {\n options.filter = options.filter.map((func) => func.bind(scope));\n }\n\n if (options.map) {\n options.map = options.map.map((func) => func.bind(scope));\n }\n}\n","import {\n PlatformServiceName,\n StateOptions,\n StateDecoratorConfig,\n ContextAwareStateOptions,\n} from '../core';\nimport { createStateDecorator } from '../core/decorators/factory';\nimport { LimeType } from './limetype';\n\n/**\n * Config for the {@link SelectLimeTypes} state decorator\n * @public\n * @group Lime types\n */\nexport interface SelectLimeTypesOptions extends StateOptions {\n name?: string;\n}\n\n/**\n * Gets an object with all limetypes where name is used as key\n *\n * @param options - state decorator options\n * @returns state decorator\n * @public\n * @group Lime types\n */\nexport function SelectLimeTypes(\n options: SelectLimeTypesOptions = {}\n): PropertyDecorator {\n const config: StateDecoratorConfig = {\n name: PlatformServiceName.LimeTypeRepository,\n };\n\n return createStateDecorator(options, config);\n}\n\n/**\n * Get the limetype for the current context\n *\n * @param options - state decorator options\n * @returns state decorator\n * @public\n * @group Lime types\n */\nexport function SelectCurrentLimeType(\n options: ContextAwareStateOptions = {}\n): PropertyDecorator {\n const config: StateDecoratorConfig = {\n name: PlatformServiceName.LimeTypeRepository,\n };\n options.map = [currentLimetype, ...(options.map || [])];\n options.context = null;\n\n return createStateDecorator(options, config);\n}\n\nfunction currentLimetype(limetypes: Record<string, LimeType>) {\n const { limetype } = this.context;\n\n return limetypes[limetype];\n}\n","import { hasLabel, LimeType } from '.';\n\n/**\n * Creates a function to find a limetype by its label in a collection of limetypes.\n *\n * The returned function searches through a collection of limetypes and returns\n * the first one that matches the given label. This function is typically used\n * to generate a callback for decorators or other higher-order logic.\n *\n * @param label - The label of the limetype to find.\n * @returns A function that takes a collection of limetypes and returns the first\n * limetype that matches the label, or `undefined` if no match is found.\n *\n * @example\n * ```typescript\n * import { findLimetypeByLabel } from '@limetech/lime-web-components';\n *\n * const limetypes = {\n * company: { label: 'company', properties: {} },\n * person: { label: 'person', properties: {} },\n * };\n *\n * const findPersonLimetype = findLimetypeByLabel('person');\n * const personLimetype = findPersonLimetype(limetypes);\n * console.log(personLimetype); // { label: 'person', properties: {} }\n * ```\n *\n * @example\n * ```typescript\n * // Using `findLimetypeByLabel` as a callback for a decorator\n * import { findLimetypeByLabel, SelectLimeTypes } from '@limetech/lime-web-components';\n *\n * @SelectLimeTypes({\n * map: [findLimetypeByLabel('person')],\n * })\n * private personLimetype: LimeType;\n * ```\n *\n * @public\n * @group Lime types\n */\nexport const findLimetypeByLabel =\n (label: string) => (limetypes: Record<string, LimeType>) => {\n return Object.values(limetypes).find(hasLabel(label));\n };\n","import { LimeProperty, LimeType, PropertyType } from '.';\n\n/**\n * Retrieves all properties of a specific type from a limetype.\n *\n * This function filters the properties of a limetype and returns\n * those that match the specified property type.\n *\n * @param limetype - The limetype containing the properties.\n * @param type - The type of properties to retrieve.\n * @returns An array of properties that match the specified type.\n *\n * @public\n * @group Lime types\n */\nexport function getPropertiesByType(\n limetype: LimeType,\n type: PropertyType\n): LimeProperty[] {\n return Object.values(limetype.properties).filter(\n (property) => property.type === type\n );\n}\n","import { hasLabel, LimeProperty, LimeType } from '.';\n\n/**\n * Retrieves a property from a limetype by its label.\n *\n * This function searches through the properties of a given limetype\n * and returns the first property that matches the specified label.\n *\n * @param limetype - The limetype containing the properties.\n * @param label - The label of the property to retrieve.\n * @returns The property with the specified label, or `undefined` if no match is found.\n *\n * @public\n * @group Lime types\n */\nexport function getPropertyByLabel(\n limetype: LimeType,\n label: string\n): LimeProperty | undefined {\n return Object.values(limetype.properties).find(hasLabel(label));\n}\n","import { LimeProperty, LimeType } from '.';\n\n/**\n * Retrieves a property from a limetype by its name.\n *\n * This function extracts a specific property from a given limetype\n * based on the property's name.\n *\n * @param limetype - The limetype containing the properties.\n * @param propertyName - The name of the property to retrieve.\n * @returns The property with the specified name.\n * @throws Will throw an error if the property name does not exist in the limetype.\n *\n * @public\n * @group Lime types\n */\nexport function getPropertyByName(\n limetype: LimeType,\n propertyName: string\n): LimeProperty {\n return limetype.properties[propertyName];\n}\n","import { LimeProperty, LimeType } from '.';\n\n/**\n * Creates a function to check if a given object has a specific label.\n *\n * The returned function takes an object (a `LimeType` or `LimeProperty`) and\n * checks whether it contains the specified label. This function is typically\n * used as a callback for array methods like `.find` or `.filter`.\n *\n * @param label - The label to check for.\n * @returns A function that takes an optional object and returns `true` if the label matches, or `false` otherwise.\n *\n * @example\n * ```typescript\n * import { hasLabel } from '@limetech/lime-web-components';\n *\n * const properties = [\n * { label: 'name', type: 'string' },\n * { label: 'email', type: 'string' },\n * ];\n *\n * const emailProperty = properties.find(hasLabel('email'));\n * console.log(emailProperty); // { label: 'email', type: 'string' }\n * ```\n *\n * @public\n * @group Lime types\n */\nexport const hasLabel =\n (label: string) => (object?: LimeType | LimeProperty) => {\n return object?.label === label;\n };\n","import { LimeObjectRepository as Service } from './repository';\nimport { PlatformServiceName } from '../core/platform';\n\nconst SERVICE_NAME = 'state.limeobjects';\n\nPlatformServiceName.LimeObjectRepository = SERVICE_NAME;\n\ndeclare module '../core/platform' {\n interface PlatformServiceNameType {\n /**\n * @see {@link Service | LimeObjectRepository}\n */\n LimeObjectRepository: typeof SERVICE_NAME;\n }\n\n interface LimeWebComponentPlatform {\n get(name: PlatformServiceNameType['LimeObjectRepository']): Service;\n }\n}\n","import {\n PlatformServiceName,\n StateOptions,\n StateDecoratorConfig,\n LimeWebComponent,\n ContextAwareStateOptions,\n} from '../core';\nimport { createStateDecorator } from '../core/decorators/factory';\n\n/**\n * Config for the {@link SelectLimeObjects} state decorator\n * @public\n * @group Lime objects\n */\nexport interface SelectLimeObjectsOptions extends StateOptions {\n /**\n * LimeType of the object\n */\n limetype?: string;\n\n /**\n * A function to get the limetype\n */\n getLimetype?: (component: LimeWebComponent) => string;\n\n /**\n * Id of the limeobject\n */\n id?: number;\n}\n\n/**\n * Get a list of limeobjects\n *\n * @param options - state decorator options\n * @returns state decorator\n * @public\n * @group Lime objects\n */\nexport function SelectLimeObjects(\n options: SelectLimeObjectsOptions = {}\n): PropertyDecorator {\n const config: StateDecoratorConfig = {\n name: PlatformServiceName.LimeObjectRepository,\n optionFactory: createOptions,\n };\n\n return createStateDecorator(options, config);\n}\n\n/**\n * Get the limeobject for the current context\n *\n * @param options - state decorator options\n * @returns state decorator\n * @public\n * @group Lime objects\n */\nexport function SelectCurrentLimeObject(\n options: ContextAwareStateOptions = {}\n): PropertyDecorator {\n const config: StateDecoratorConfig = {\n name: PlatformServiceName.LimeObjectRepository,\n };\n options.map = [currentLimeobject, ...(options.map || [])];\n options.context = null;\n\n return createStateDecorator(options, config);\n}\n\nfunction currentLimeobject(limeobjects: Record<string, Array<{ id: string }>>) {\n const { limetype, id } = this.context;\n\n if (!limeobjects[limetype]) {\n return;\n }\n\n return limeobjects[limetype].find((object) => object.id === id);\n}\n\nfunction createOptions(\n options: SelectLimeObjectsOptions,\n component: LimeWebComponent\n): StateOptions {\n if (options.getLimetype) {\n options.limetype = options.getLimetype(component);\n }\n\n return options;\n}\n","import { LimeWebComponentContext, ConfigMetadata } from '../core';\nimport { Expression } from '../query';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport { LimeObject } from '../limeobject';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport { LimeType } from '../limetype';\n\n/**\n * Base marker interface for all commands in the command bus pattern.\n *\n * {@link AnyCommand} serves as the root interface for the command pattern implementation.\n * All commands must extend this interface (either directly or through {@link LimeObjectCommand}\n * or {@link LimeObjectBulkCommand}) to be handled by the {@link CommandBus}.\n *\n * Commands represent user actions or operations that can be executed, such as:\n * - Exporting data to Excel\n * - Sending emails\n * - Generating reports\n * - Creating or deleting records\n * - Custom business logic operations\n *\n * > **Important:** All properties of a command must be serializable and publicly assignable:\n * >\n * > **Serialization requirements:**\n * > - Use primitive types (string, number, boolean)\n * > - Use plain objects and arrays\n * > - Use serializable custom types (like {@link Expression})\n * > - Avoid functions, DOM elements, class instances with methods, circular references, etc.\n * >\n * > **Assignability requirements:**\n * > - All properties must be public (not private or protected)\n * > - Properties cannot be readonly after instantiation\n * > - Constructor parameters are optional for command creation\n * >\n * > The platform creates commands by instantiating the class without constructor arguments,\n * > then directly assigning values to properties. Commands may also be serialized for storage,\n * > transmission, or recreation via {@link CommandBus.createCommand}.\n *\n * @example\n * ```typescript\n * @Command({ id: 'generate-report' })\n * export class GenerateReportCommand implements AnyCommand {\n * public reportType: string;\n * public startDate: string; // ISO date string, not Date object\n * public endDate: string;\n * }\n * ```\n *\n * @see {@link LimeObjectCommand} for commands operating on a single object\n * @see {@link LimeObjectBulkCommand} for commands operating on multiple objects\n * @see {@link CommandBus} for executing commands\n *\n * @public\n * @group Command bus\n */\nexport interface AnyCommand {}\n\n/**\n * A command that operates on a single {@link LimeObject}.\n *\n * {@link LimeObjectCommand} is used for actions that target a specific record,\n * such as sending an email to a contact, generating a PDF for a deal, or\n * archiving a specific company. The context property identifies which object\n * the command should operate on.\n *\n * @example\n * ```typescript\n * @Command({ id: 'send-email' })\n * export class SendEmailCommand implements LimeObjectCommand {\n * public context: LimeWebComponentContext & { limetype: string; id: number };\n * public subject: string;\n * public body: string;\n *\n * constructor(\n * context?: LimeWebComponentContext & { limetype: string; id: number },\n * subject?: string,\n * body?: string\n * ) {\n * this.context = context;\n * this.subject = subject;\n * this.body = body;\n * }\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Execute a single-object command\n * const commandBus = platform.get(PlatformServiceName.CommandBus);\n *\n * const command = new SendEmailCommand(\n * context,\n * 'Meeting Invitation',\n * 'Please join us for a meeting...'\n * );\n *\n * await commandBus.handle(command);\n * ```\n *\n * @public\n * @group Command bus\n */\nexport interface LimeObjectCommand extends AnyCommand {\n /**\n * Context describing the {@link LimeObject} the command will operate on.\n *\n * Must include both `limetype` (the type of object) and `id` (the specific\n * object's identifier). This ensures the command knows exactly which record\n * to target.\n */\n context: LimeWebComponentContext & { limetype: string; id: number };\n}\n\n/**\n * A command that operates on multiple {@link LimeObject | LimeObjects} of a single {@link LimeType}.\n *\n * {@link LimeObjectBulkCommand} is used for batch operations on multiple records,\n * such as exporting selected deals to Excel, sending bulk emails, or mass-updating\n * status fields. The filter property determines which objects are included in the operation.\n *\n * > **Important:** Do not assume a specific filter structure in your command handler.\n * > The filter expression can vary depending on the user's selection:\n * > - **Specific selection**: `{ key: 'id', op: 'IN', exp: [1, 2, 3] }` (selected rows)\n * > - **Select all with criteria**: `{ key: 'status', op: '=', exp: 'won' }` (filtered view)\n * > - **Select all**: `null` (all objects in the limetype)\n * >\n * > Always pass the filter to your data queries rather than parsing its structure.\n *\n * @example\n * ```typescript\n * @Command({ id: 'export-to-excel' })\n * export class ExportToExcelCommand implements LimeObjectBulkCommand {\n * public context: LimeWebComponentContext & { limetype: string };\n * public filter: Expression | null;\n * public includeRelations: boolean;\n *\n * constructor(\n * context?: LimeWebComponentContext & { limetype: string },\n * filter?: Expression | null,\n * includeRelations: boolean = false\n * ) {\n * this.context = context;\n * this.filter = filter;\n * this.includeRelations = includeRelations;\n * }\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Execute a bulk command on selected items\n * const commandBus = platform.get(PlatformServiceName.CommandBus);\n *\n * const selectedFilter: Expression = {\n * key: 'id',\n * op: 'IN',\n * exp: [1, 2, 3, 4, 5]\n * };\n *\n * const command = new ExportToExcelCommand(\n * { limetype: 'deal' },\n * selectedFilter,\n * true\n * );\n *\n * await commandBus.handle(command);\n * ```\n *\n * @example\n * ```typescript\n * // Bulk command with parent context (related objects)\n * const command = new UpdateStatusCommand(\n * {\n * limetype: 'deal',\n * parent: { limetype: 'company', id: 123 }\n * },\n * {\n * key: 'status',\n * op: '=',\n * exp: 'pending'\n * },\n * 'active' // New status value\n * );\n * // This will update all pending deals for company #123\n * ```\n *\n * @public\n * @group Command bus\n */\nexport interface LimeObjectBulkCommand extends AnyCommand {\n /**\n * Context describing the {@link LimeType} the command will operate on.\n *\n * Must include `limetype` to identify which type of objects to operate on.\n * If `parent` is set on the context, it indicates that the {@link LimeObject | LimeObjects}\n * are all related to a common parent {@link LimeObject} via a `belongsto` relation.\n *\n * @example\n * ```typescript\n * // All deals (no parent filter)\n * context = { limetype: 'deal' }\n *\n * // Only deals related to a specific company\n * context = { limetype: 'deal', parent: { limetype: 'company', id: 456 } }\n * ```\n */\n context: LimeWebComponentContext & { limetype: string };\n\n /**\n * An {@link Expression} describing which {@link LimeObject | LimeObjects} to operate on.\n *\n * Can be `null` to operate on all objects (subject to parent context filtering),\n * or a filter expression to limit the operation to specific records.\n *\n * @example\n * ```typescript\n * // Operate on selected IDs\n * filter = { key: 'id', op: 'IN', exp: [1, 2, 3] };\n *\n * // Operate on objects matching criteria\n * filter = {\n * op: 'AND',\n * exp: [\n * { key: 'status', op: '=', exp: 'active' },\n * { key: 'value', op: '>', exp: 10000 }\n * ]\n * };\n *\n * // Operate on all objects\n * filter = null;\n * ```\n */\n filter: Expression | null;\n}\n\n/**\n * @public\n * @group Command bus\n */\nexport type CommandClass<T extends AnyCommand = AnyCommand> = new (\n ...args: unknown[]\n) => T;\n\n/**\n * @public\n * @group Command bus\n */\nexport type CommandIdentifier<T extends AnyCommand = AnyCommand> =\n | CommandClass<T>\n | string;\n\n/**\n * Service for registering and executing commands using the command pattern.\n *\n * The {@link CommandBus} is the central hub for the command pattern implementation.\n * It manages command registration, handler lookup, and command execution. Commands\n * are decoupled from their handlers, allowing for flexible middleware chains and\n * cross-cutting concerns like logging, validation, and authorization.\n *\n * Key responsibilities:\n * - Register commands with their handlers\n * - Execute commands through their registered handlers\n * - Support middleware for command pipeline\n * - Dispatch command lifecycle events\n * - Provide command metadata and discovery\n *\n * @example\n * ```typescript\n * // Register and execute a command\n * const commandBus = platform.get(PlatformServiceName.CommandBus);\n *\n * if (commandBus.isSupported(SendEmailCommand)) {\n * const command = new SendEmailCommand(context, 'Subject', 'Body');\n * await commandBus.handle(command);\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Register a custom command handler\n * const commandBus = platform.get(PlatformServiceName.CommandBus);\n *\n * const handler = {\n * handle: async (command: GenerateReportCommand) => {\n * console.log('Generating report...');\n * return { success: true, reportUrl: '/reports/123.pdf' };\n * }\n * };\n *\n * commandBus.register(\n * GenerateReportCommand,\n * handler,\n * {\n * title: 'Generate Report',\n * description: 'Creates a PDF report',\n * icon: 'file-pdf'\n * }\n * );\n * ```\n *\n * @see {@link AnyCommand} for base command interface\n * @see {@link CommandHandler} for handler interface\n * @see {@link CommandMiddleware} for middleware implementation\n *\n * @public\n * @group Command bus\n */\nexport interface CommandBus extends CommandHandler {\n /**\n * Register a command to be executed by the given handler.\n *\n * Associates a command class with a handler that will process instances\n * of that command when {@link CommandBus.handle} is called.\n *\n * @param commandClass - The command class to register\n * @param handler - The {@link CommandHandler} instance that will execute the command\n *\n * @example\n * ```typescript\n * commandBus.register(SendEmailCommand, {\n * handle: async (command: SendEmailCommand) => {\n * // Send email logic\n * return { success: true };\n * }\n * });\n * ```\n */\n register(commandClass: CommandClass, handler: CommandHandler): void;\n\n /**\n * Register a command to be executed by the given handler\n *\n * @param commandClass - type of command\n * @param handler - the handler instance used to execute the command\n * @param metadata - metadata for the command\n * @beta\n */\n register(\n commandClass: CommandClass,\n handler: CommandHandler,\n // TODO combine signatures when CommandMetadata is also public\n metadata?: Omit<CommandMetadata, 'id'>\n ): void;\n\n /**\n * Execute the given command with it's registered command handler\n *\n * @param command - command to execute\n *\n * @returns result from the command handler\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n handle(command: AnyCommand): any;\n\n /**\n * Check if a command is supported\n *\n * @param commandId - identifier of the command. Can be either the class or the string the class was registered with\n *\n * @returns true if the command is supported, false otherwise\n */\n isSupported(commandId: CommandIdentifier): boolean;\n\n /**\n * Get a handler associated with a command\n *\n * @param commandClass - The command class\n *\n * @returns the handler for the command class\n */\n getHandler(commandClass: CommandClass): CommandHandler;\n\n /**\n * Get a list of configs for all registered commands\n *\n * @beta\n */\n getAll?(): CommandMetadata[];\n\n /**\n * Create a command instance from a {@link CommandConfig}\n *\n * @param config - The command configuration\n * @throws Thrown if the command has not been registered yet\n */\n createCommand<Key extends keyof CommandRegistry>(\n config: CommandConfig<CommandRegistry[Key], Key>\n ): CommandRegistry[Key];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n createCommand<T = any, Key extends string = string>(\n config: CommandConfig<T, Exclude<Key, keyof CommandRegistry>>\n ): T;\n}\n\n/**\n * Service for executing commands\n * @public\n * @group Command bus\n */\nexport interface CommandHandler {\n /**\n * Handle the execution of the given command\n *\n * @param command - the command to handle\n *\n * @returns the result of the operation\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n handle(command: AnyCommand): any;\n}\n\n/**\n * @public\n * @group Command bus\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type CallableCommandMiddleware = (command: AnyCommand) => any;\n\n/**\n * Middleware for the command bus\n * @public\n * @group Command bus\n */\nexport interface CommandMiddleware {\n /**\n * Execute the middleware before passing the command further down the chain\n *\n * @param command - the command that is being handled\n * @param next - the next middleware in the chain\n *\n * @returns the result of the operation\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n execute(command: AnyCommand, next: CallableCommandMiddleware): any;\n}\n\n/**\n * Events dispatched by the commandbus event middleware.\n *\n * The command bus dispatches events at key points in the command lifecycle,\n * allowing you to observe command execution, access results, handle errors,\n * or even prevent commands from executing.\n *\n * @example\n * ```typescript\n * // Listen for command results\n * document.addEventListener(CommandEventName.Handled, (event: CommandEvent) => {\n * console.log('Command executed:', event.detail.command);\n * console.log('Result:', event.detail.result);\n * });\n *\n * // Handle command errors\n * document.addEventListener(CommandEventName.Failed, (event: CommandEvent) => {\n * console.error('Command failed:', event.detail.error);\n * });\n *\n * // Prevent a command from executing\n * document.addEventListener(CommandEventName.Received, (event: CommandEvent) => {\n * if (shouldBlockCommand(event.detail.command)) {\n * event.preventDefault();\n * }\n * });\n * ```\n *\n * @public\n * @group Command bus\n */\nexport enum CommandEventName {\n /**\n * Dispatched when the command has been received by the commandbus.\n * Calling `preventDefault()` on the event will stop the command from being handled\n *\n * @see {@link CommandEvent}\n */\n Received = 'command.received',\n\n /**\n * Dispatched when the command has been handled by the commandbus.\n * The event detail includes the result returned by the command handler.\n *\n * @see {@link CommandEvent}\n */\n Handled = 'command.handled',\n\n /**\n * Dispatched if an error occurs while handling the command.\n * The event detail includes the error that was thrown.\n *\n * @see {@link CommandEvent}\n */\n Failed = 'command.failed',\n}\n\n/**\n * @public\n * @group Command bus\n */\nexport type CommandEventDetail = {\n command: AnyCommand;\n result?: unknown;\n error?: unknown;\n};\n\n/**\n * @public\n * @group Command bus\n */\nexport type CommandEvent = CustomEvent<CommandEventDetail>;\n\n/**\n * @public\n * @group Command bus\n */\nexport interface CommandOptions {\n /**\n * Id of the command\n */\n id: string;\n}\n\n/**\n * Config for describing a command.\n *\n * Used with {@link CommandBus.createCommand} to create command instances from\n * configuration data. This is useful for storing command definitions or\n * transmitting them across boundaries.\n *\n * @public\n * @group Command bus\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface CommandConfig<TCommand = any, TKey extends string = string> {\n /**\n * Id of the command.\n *\n * Specified by the {@link Command} decorator when declaring the command.\n */\n id: TKey;\n\n /**\n * Optional parameters to set when creating the command from the config.\n *\n * **All values must be serializable** (primitive types, plain objects, arrays).\n * This matches the requirement that all command properties must be serializable\n * as defined in {@link AnyCommand}.\n */\n params?: {\n [K in keyof TCommand]?: TCommand[K];\n };\n}\n\n/**\n * Registry for commands\n *\n * This interface is designed to be extended by consumers of Lime Web\n * Components using module augmentation. Each key in the interface corresponds\n * to the id of a registered command, and the value is the type of the command.\n * This allows for type-safe access to commands within the application.\n *\n * @example\n * ```ts\n * declare module '@limetech/lime-web-components' {\n * interface CommandRegistry {\n * myCommand: MyCommand;\n * }\n * }\n * ```\n *\n * @beta\n * @group Command bus\n */\nexport interface CommandRegistry {}\n\n/**\n * Metadata for a command\n *\n * @beta\n * @group Command bus\n */\nexport type CommandMetadata = ConfigMetadata & {\n /**\n * Command id\n */\n id: keyof CommandRegistry | (string & {});\n};\n\n/**\n * Decorator to register a class as a command with a unique identifier.\n *\n * The `@Command` decorator marks a class as a command and assigns it a unique ID\n * that can be used for command lookup, registration, and execution. This decorator\n * is essential for the command pattern implementation and enables type-safe command\n * creation through the {@link CommandRegistry}.\n *\n * @param options - A {@link CommandOptions} object containing the unique command ID\n * @returns Decorator function that registers the command class\n *\n * @example\n * ```typescript\n * // Basic command definition\n * @Command({ id: 'generate-pdf-report' })\n * export class GeneratePdfReportCommand implements AnyCommand {\n * public reportType: string;\n * public includeCharts: boolean;\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Single-object command with context\n * @Command({ id: 'archive-deal' })\n * export class ArchiveDealCommand implements LimeObjectCommand {\n * public context: LimeWebComponentContext & { limetype: string; id: number };\n * public reason: string;\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Bulk command with filter\n * @Command({ id: 'bulk-update-status' })\n * export class BulkUpdateStatusCommand implements LimeObjectBulkCommand {\n * public context: LimeWebComponentContext & { limetype: string };\n * public filter: Expression | null;\n * public newStatus: string;\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Register in CommandRegistry for type safety\n * declare module '@limetech/lime-web-components' {\n * interface CommandRegistry {\n * 'generate-pdf-report': GeneratePdfReportCommand;\n * 'archive-deal': ArchiveDealCommand;\n * 'bulk-update-status': BulkUpdateStatusCommand;\n * }\n * }\n *\n * // Now you can use createCommand with type safety\n * const command = commandBus.createCommand({\n * id: 'generate-pdf-report',\n * params: { reportType: 'monthly', includeCharts: true }\n * });\n * ```\n *\n * @public\n * @group Command bus\n */\nexport function Command(options: CommandOptions) {\n return (commandClass: CommandClass) => {\n setCommandId(commandClass, options.id);\n setHasInstance(commandClass, options.id);\n };\n}\n\nfunction setCommandId(commandClass: CommandClass, id: string) {\n commandClass['commandId'] = id;\n}\n\nfunction setHasInstance(commandClass: CommandClass, id: string) {\n Object.defineProperty(commandClass, Symbol.hasInstance, {\n value: (instance: unknown) => {\n return getCommandIds(instance).includes(id);\n },\n });\n}\n\n/**\n * Get the registered id of the command\n *\n * @param value - either a command or a command identifier\n *\n * @returns id of the command\n * @public\n * @group Command bus\n */\nexport function getCommandId(\n value: AnyCommand | CommandIdentifier\n): keyof CommandRegistry | (string & {}) {\n if (typeof value === 'string') {\n return value;\n }\n\n if (value && value.constructor && value.constructor['commandId']) {\n return value.constructor['commandId'];\n }\n\n if (value && value['commandId']) {\n return value['commandId'];\n }\n\n return null;\n}\n\n/**\n * Get all registered ids of a command and its parent classes\n *\n * @param value - either a command or a command identifier\n *\n * @returns ids of the command\n * @public\n * @group Command bus\n */\nexport function getCommandIds(\n value: AnyCommand | CommandIdentifier\n): Array<keyof CommandRegistry | (string & {})> {\n let ids: string[] = [];\n let id: string;\n let commandClass = value;\n\n while ((id = getCommandId(commandClass))) {\n ids = [...ids, id];\n commandClass = Object.getPrototypeOf(commandClass);\n }\n\n return [...new Set(ids)];\n}\n","import { CommandBus as Service } from './commandbus';\nimport { PlatformServiceName } from '../core/platform';\n\nconst SERVICE_NAME = 'commandBus';\n\nPlatformServiceName.CommandBus = SERVICE_NAME;\n\ndeclare module '../core/platform' {\n interface PlatformServiceNameType {\n /**\n * @see {@link Service | CommandBus}\n */\n CommandBus: typeof SERVICE_NAME;\n }\n\n interface LimeWebComponentPlatform {\n get(name: PlatformServiceNameType['CommandBus']): Service;\n }\n}\n","import { Command, LimeObjectBulkCommand } from '../../commandbus';\nimport { Expression } from '../../query';\nimport { LimeWebComponentContext } from '../../core';\n\nconst COMMAND_ID = 'limeobject.bulk-create-dialog' as const;\ndeclare module '../../commandbus' {\n interface CommandRegistry {\n [COMMAND_ID]: BulkCreateDialogCommand;\n }\n}\n\n/**\n * Open a dialog for bulk creating limeobjects\n *\n *\n * ### Flow example\n * Let's have a look at the general flow by going through the concrete example of adding several persons to a marketing activity:\n * - Go to the table view of persons.\n * - Filter everyone who should be included in the marketing activity.\n * - Select 'Bulk create objects' form the action menu.\n * - Fill out the form and click 'create'.\n * - A toast message appears and gives you 5 seconds to undo the action before it creates the corresponding task.\n * - Another toast message will inform you after the task is completed.\n * - If the task ended successful you can go to the participant table view and check the result.\n *\n * ### Configuration\n * In order to activate the feature go to a table configuration in lime-admin to the limetype you want to bulk create from\n * and add the following configuration:\n *\n * ```json\n * \"actions\": [\n * {\n * \"id\": \"limeobject.bulk-create-dialog\",\n * \"params\": {\n * \"relation\": \"<name of relation>\"\n * }\n * }\n * ],\n * ```\n *\n * @id `limeobject.bulk-create-dialog`\n * @public\n * @group Lime objects\n */\n@Command({\n id: COMMAND_ID,\n})\nexport class BulkCreateDialogCommand implements LimeObjectBulkCommand {\n public context: LimeWebComponentContext;\n\n /**\n * A query describing what limeobjects to create new limeobjects from. Each object from the result will result in a\n * new related limeobject to be created\n */\n public filter: Expression;\n\n /**\n * The name of the relation on the limetype to create objects of\n */\n public relation: string;\n}\n","import { LimeWebComponentContext } from '../../core';\nimport { LimeType } from '../../limetype';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport { LimeObject } from '..';\nimport { Command } from '../../commandbus';\n\nconst COMMAND_ID = 'limeobject.create-dialog' as const;\ndeclare module '../../commandbus' {\n interface CommandRegistry {\n [COMMAND_ID]: CreateLimeobjectDialogCommand;\n }\n}\n\n/**\n * Open a dialog for creating a new limeobject or editing a specific limeobject\n *\n * The create dialog is implemented as a command so a plugin can easily replace the original dialog with a custom one.\n * Check out the \"Hello, Event!\" tutorial for a detailed description on how to implement your own create dialog.\n *\n * This dialog also useful to edit a limeobject that already exists\n *\n * @id `limeobject.create-dialog`\n * @public\n * @group Lime objects\n */\n@Command({\n id: COMMAND_ID,\n})\nexport class CreateLimeobjectDialogCommand {\n /**\n * The limetype of the object to create\n */\n public limetype: LimeType;\n\n /**\n * Default data to populate the form with\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public limeobject?: any;\n\n /**\n * Specifies if routing to limeobject should be done after confirmation\n */\n public route?: boolean = false;\n\n /*\n * Title of the dialog\n */\n public title?: string;\n\n /*\n * Subtitle of the dialog\n */\n public subtitle?: string;\n\n /*\n * Current context\n */\n public context?: LimeWebComponentContext;\n\n /**\n * When `context` is used, this is the name of the relation on the\n * reference {@link LimeObject} to use when auto attaching the new object.\n *\n */\n public autoAttachRelation?: string;\n\n /**\n * Specifies any command that can be used to save the result of the dialog.\n * If not specified, it will default to the {@link SaveLimeObjectCommand}\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public saveCommand?: any;\n}\n","import { Command, LimeObjectCommand } from '../../commandbus';\nimport { LimeWebComponentContext } from '../../core';\n\nconst COMMAND_ID = 'limeobject.delete-object' as const;\ndeclare module '../../commandbus' {\n interface CommandRegistry {\n [COMMAND_ID]: DeleteObjectCommand;\n }\n}\n\n/**\n * Deletes the object from the database\n *\n * @id `limeobject.delete-object`\n * @public\n * @group Lime objects\n */\n@Command({\n id: COMMAND_ID,\n})\nexport class DeleteObjectCommand implements LimeObjectCommand {\n public context: LimeWebComponentContext;\n}\n","import { Command, LimeObjectCommand } from '../../commandbus';\nimport { LimeWebComponentContext } from '../../core';\n\nconst COMMAND_ID = 'limeobject.object-access' as const;\ndeclare module '../../commandbus' {\n interface CommandRegistry {\n [COMMAND_ID]: OpenObjectAccessDialogCommand;\n }\n}\n\n/**\n * Open a dialog to view and edit object access information\n *\n * @id `limeobject.object-access`\n * @public\n * @group Lime objects\n */\n@Command({\n id: COMMAND_ID,\n})\nexport class OpenObjectAccessDialogCommand implements LimeObjectCommand {\n public context: LimeWebComponentContext;\n}\n","import { LimeObject } from '../../limeobject';\nimport { Command, LimeObjectCommand } from '../../commandbus';\nimport { LimeWebComponentContext } from '../../core';\n\nconst COMMAND_ID = 'limeobject.save-object' as const;\ndeclare module '../../commandbus' {\n interface CommandRegistry {\n [COMMAND_ID]: SaveLimeObjectCommand;\n }\n}\n\n/**\n * Saves the object to the database\n *\n * @id `limeobject.save-object`\n * @public\n * @group Lime objects\n */\n@Command({\n id: COMMAND_ID,\n})\nexport class SaveLimeObjectCommand implements LimeObjectCommand {\n public context: LimeWebComponentContext;\n\n /**\n * The limeobject to save\n */\n public limeobject: LimeObject;\n\n /**\n * Specifies if routing to limeobject should be done after confirmation\n */\n public route?: boolean = false;\n\n /**\n * @beta\n * Specifies an optional save label to be displayed in the create-object dialog\n */\n public label?: string;\n}\n","/**\n * @public\n * @group Query\n */\nexport interface Query {\n limetype: string;\n limit?: number;\n offset?: number;\n orderBy?: object[];\n filter?: Expression;\n responseFormat: {\n object?: object;\n aggregates?: object;\n };\n}\n\n/**\n * @public\n * @group Query\n */\nexport interface QueryResponse {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n objects: any[];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n aggregates: any;\n}\n\n/**\n * @public\n * @group Query\n */\nexport type Expression =\n | AndOrExpression\n | NotExpression\n | InFilterExpression\n | InExpression\n | BasicExpression;\n\n/**\n * @public\n * @group Query\n */\nexport type AndOrExpression = {\n op: Operator.AND | Operator.OR;\n exp: Expression[];\n};\n\n/**\n * @public\n * @group Query\n */\nexport type NotExpression = {\n op: Operator.NOT;\n exp: Expression;\n};\n\n/**\n * @public\n * @group Query\n */\nexport type InFilterExpression = {\n type: 'filter';\n key: string;\n op: Operator.IN;\n exp: string;\n};\n\n/**\n * @public\n * @group Query\n */\nexport type InExpression = {\n key: string;\n op: Operator.IN;\n exp: ExpressionValue[];\n};\n\n/**\n * @public\n * @group Query\n */\nexport type BasicExpression = {\n key: string;\n op: BasicOperator;\n exp: ExpressionValue;\n};\n\n/**\n * @public\n * @group Query\n */\nexport type BasicOperator =\n | Operator.EQUALS\n | Operator.NOT_EQUALS\n | Operator.GREATER\n | Operator.LESS\n | Operator.BEGINS\n | Operator.LIKE\n | Operator.LESS_OR_EQUAL\n | Operator.GREATER_OR_EQUAL\n | Operator.ENDS;\n\n/**\n * @public\n * @group Query\n */\nexport type ExpressionValue = string | number | boolean | null;\n\n/**\n * @public\n * @group Query\n */\nexport enum Operator {\n AND = 'AND',\n OR = 'OR',\n NOT = '!',\n EQUALS = '=',\n NOT_EQUALS = '!=',\n GREATER = '>',\n LESS = '<',\n IN = 'IN',\n BEGINS = '=?',\n LIKE = '?',\n LESS_OR_EQUAL = '<=',\n GREATER_OR_EQUAL = '>=',\n ENDS = '=$',\n}\n\n/**\n * @public\n * @group Query\n */\nexport interface Filter {\n id: string;\n limetype: string;\n name: {\n [language: string]: string;\n };\n filter: Expression;\n description?: {\n [language: string]: string;\n };\n iduser?: number;\n}\n\n/**\n *\n * @public\n * @group Query\n */\nexport const AggregateOperator = {\n Count: 'COUNT',\n Sum: 'SUM',\n Average: 'AVG',\n Maximum: 'MAX',\n Minimum: 'MIN',\n} as const;\n\n/**\n *\n * @public\n * @group Query\n */\nexport type AggregateOperator =\n (typeof AggregateOperator)[keyof typeof AggregateOperator];\n","import { QueryService } from './service';\nimport { PlatformServiceName } from '../core/platform';\n\nconst SERVICE_NAME = 'query';\n\nPlatformServiceName.Query = SERVICE_NAME;\n\ndeclare module '../core/platform' {\n interface PlatformServiceNameType {\n /**\n * @see {@link QueryService}\n */\n Query: typeof SERVICE_NAME;\n }\n\n interface LimeWebComponentPlatform {\n get(name: PlatformServiceNameType['Query']): QueryService;\n }\n}\n","/**\n * HTTP service for sending requests to backend endpoints\n *\n * The {@link HttpClient} is the primary interface for making HTTP requests\n * within the Lime platform.\n *\n * By default, all requests expect JSON responses. For other content types\n * (text, binary data, etc.), set the `responseType` in {@link HttpOptions}.\n *\n * All methods throw {@link HttpResponseError} on HTTP errors (4xx, 5xx status codes).\n *\n * @example\n * Basic GET request for JSON data\n * ```typescript\n * const http = platform.get(PlatformServiceName.Http);\n * const data = await http.get('my_addon/endpoint');\n * console.log(data);\n * ```\n *\n * @example\n * POST request with data and query parameters\n * ```typescript\n * const http = platform.get(PlatformServiceName.Http);\n * const response = await http.post(\n * 'my_addon/users',\n * { name: 'John Doe', email: 'john@example.com' },\n * { params: { notify: 'true' } }\n * );\n * ```\n *\n * @example\n * Error handling with HttpResponseError\n * ```typescript\n * const http = platform.get(PlatformServiceName.Http);\n * try {\n * const data = await http.get('my_addon/endpoint');\n * } catch (error) {\n * if (error.name === 'HttpResponseError') {\n * console.error(`HTTP ${error.status}: ${error.message}`);\n * console.error('Response:', error.response);\n * }\n * }\n * ```\n *\n * @example\n * Downloading a file as blob\n * ```typescript\n * const http = platform.get(PlatformServiceName.Http);\n * const blob = await http.get('my_addon/download/report.pdf', {\n * responseType: 'blob'\n * });\n * const url = URL.createObjectURL(blob);\n * window.open(url);\n * ```\n *\n * @public\n * @group HTTP\n */\nexport interface HttpClient {\n /**\n * Sends a GET request to retrieve data from the server\n *\n * @param url - Relative URL to the resource (e.g., 'my_addon/endpoint').\n * The URL is relative to the Lime CRM base URL.\n * @param options - Optional {@link HttpOptions} for query parameters, headers, or response type\n * @returns Promise resolving to the response data. Type depends on {@link HttpOptions.responseType}\n *\n * @throws {@link HttpResponseError} when the server responds with an error status (4xx, 5xx)\n *\n * @example\n * ```typescript\n * const http = platform.get(PlatformServiceName.Http);\n * const users = await http.get('my_addon/users', {\n * params: { active: 'true', limit: '10' }\n * });\n * ```\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n get(url: string, options?: HttpOptions): Promise<any>;\n\n /**\n * Sends a POST request to create new data on the server\n *\n * @param url - Relative URL to the resource (e.g., 'my_addon/endpoint')\n * @param data - Payload to send in the request body. Will be JSON-encoded by default.\n * @param options - Optional {@link HttpOptions} for query parameters, headers, or response type\n * @returns Promise resolving to the response data. Type depends on {@link HttpOptions.responseType}\n *\n * @throws {@link HttpResponseError} when the server responds with an error status (4xx, 5xx)\n *\n * @example\n * ```typescript\n * const http = platform.get(PlatformServiceName.Http);\n * const newUser = await http.post('my_addon/users', {\n * name: 'Jane Smith',\n * email: 'jane@example.com'\n * });\n * ```\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n post(url: string, data?: object, options?: HttpOptions): Promise<any>;\n\n /**\n * Sends a PATCH request to partially update existing data on the server\n *\n * @param url - Relative URL to the resource (e.g., 'my_addon/users/123')\n * @param data - Partial payload containing only the fields to update\n * @param options - Optional {@link HttpOptions} for query parameters, headers, or response type\n * @returns Promise resolving to the response data. Type depends on {@link HttpOptions.responseType}\n *\n * @throws {@link HttpResponseError} when the server responds with an error status (4xx, 5xx)\n *\n * @example\n * ```typescript\n * const http = platform.get(PlatformServiceName.Http);\n * await http.patch('my_addon/users/123', {\n * email: 'newemail@example.com'\n * });\n * ```\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n patch(url: string, data?: object, options?: HttpOptions): Promise<any>;\n\n /**\n * Sends a PUT request to replace existing data on the server\n *\n * @param url - Relative URL to the resource (e.g., 'my_addon/users/123')\n * @param data - Complete payload to replace the existing resource\n * @param options - Optional {@link HttpOptions} for query parameters, headers, or response type\n * @returns Promise resolving to the response data. Type depends on {@link HttpOptions.responseType}\n *\n * @throws {@link HttpResponseError} when the server responds with an error status (4xx, 5xx)\n *\n * @example\n * ```typescript\n * const http = platform.get(PlatformServiceName.Http);\n * await http.put('my_addon/users/123', {\n * name: 'Jane Doe',\n * email: 'jane@example.com',\n * role: 'admin'\n * });\n * ```\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n put(url: string, data?: object, options?: HttpOptions): Promise<any>;\n\n /**\n * Sends a DELETE request to remove data from the server\n *\n * @param url - Relative URL to the resource (e.g., 'my_addon/users/123')\n * @param options - Optional {@link HttpOptions} for query parameters or headers\n * @returns Promise resolving to the response data. Type depends on {@link HttpOptions.responseType}\n *\n * @throws {@link HttpResponseError} when the server responds with an error status (4xx, 5xx)\n *\n * @example\n * ```typescript\n * const http = platform.get(PlatformServiceName.Http);\n * await http.delete('my_addon/users/123');\n * ```\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n delete(url: string, options?: HttpOptions): Promise<any>;\n}\n\n/**\n * Configuration options for HTTP requests\n *\n * @example\n * ```typescript\n * const http = platform.get(PlatformServiceName.Http);\n * const options: HttpOptions = {\n * params: { search: 'John', limit: '10' },\n * headers: { 'X-Custom-Header': 'value' },\n * responseType: 'json'\n * };\n * const data = await http.get('my_addon/users', options);\n * ```\n *\n * @public\n * @group HTTP\n */\nexport interface HttpOptions {\n /**\n * Query parameters to append to the URL\n *\n * Parameters will be URL-encoded and appended to the request URL.\n *\n * @example\n * ```typescript\n * // Results in: my_addon/users?active=true&role=admin&role=user\n * const params = {\n * active: 'true',\n * role: ['admin', 'user']\n * };\n * ```\n */\n params?: HttpParams;\n\n /**\n * Additional HTTP headers to include in the request\n *\n * @example\n * ```typescript\n * const headers = {\n * 'Authorization': 'Bearer token123',\n * 'Accept-Language': 'en-US'\n * };\n * ```\n */\n headers?: HttpHeaders;\n\n /**\n * Expected response data type. Defaults to 'json'\n *\n * - `json`: Parse response as JSON (default)\n * - `text`: Get response as plain text string\n * - `blob`: Get response as binary Blob (for file downloads)\n * - `arraybuffer`: Get response as ArrayBuffer (for binary data processing)\n *\n * @example\n * ```typescript\n * // Download PDF file\n * const pdfBlob = await http.get('my_addon/report.pdf', {\n * responseType: 'blob'\n * });\n * ```\n */\n responseType?: HttpResponseType;\n}\n\n/**\n * URL query parameters for HTTP requests\n *\n * Key-value pairs that will be appended to the request URL as query string.\n * Array values will be repeated for the same parameter name.\n *\n * @public\n * @group HTTP\n */\nexport interface HttpParams {\n [param: string]: string | string[];\n}\n\n/**\n * HTTP headers for requests\n *\n * Custom headers to include in the HTTP request. Array values will be\n * joined as comma-separated values for the same header name.\n *\n * @public\n * @group HTTP\n */\nexport interface HttpHeaders {\n [header: string]: string | string[];\n}\n\n/**\n * Response data type for HTTP requests\n *\n * Determines how the response body will be parsed and returned.\n *\n * @public\n * @group HTTP\n */\nexport type HttpResponseType = 'text' | 'json' | 'arraybuffer' | 'blob';\n\n/**\n * HTTP method constants\n *\n * Standard HTTP methods as constant values. Useful for type-safe method\n * selection in custom HTTP utilities.\n *\n * @example\n * ```typescript\n * function makeRequest(method: HttpMethod, url: string) {\n * if (method === HttpMethod.Get) {\n * // Handle GET request\n * }\n * }\n *\n * makeRequest(HttpMethod.Post, 'my_addon/endpoint');\n * ```\n *\n * @public\n * @group HTTP\n */\nexport const HttpMethod = {\n Get: 'GET',\n Post: 'POST',\n Put: 'PUT',\n Delete: 'DELETE',\n Patch: 'PATCH',\n} as const;\n\n/**\n * Type definition for HTTP methods\n *\n * Union type of all values in the {@link HttpMethod} constant.\n *\n * @public\n * @group HTTP\n */\nexport type HttpMethod = (typeof HttpMethod)[keyof typeof HttpMethod];\n\n/**\n * Error thrown when an HTTP request fails\n *\n * This error is thrown by {@link HttpClient} methods when the server responds\n * with an error status code (4xx or 5xx).\n *\n * @example\n * ```typescript\n * const http = platform.get(PlatformServiceName.Http);\n *\n * try {\n * const data = await http.get('my_addon/data');\n * } catch (error) {\n * if (error.name !== 'HttpResponseError') {\n * throw error;\n * }\n *\n * if (error.status === 404) {\n * console.error('Resource not found');\n * } else if (error.status >= 500) {\n * console.error('Server error:', error.status);\n * }\n *\n * const body = await error.response.text();\n * console.error('Response body:', body);\n * }\n * ```\n *\n * @public\n * @group HTTP\n */\nexport interface HttpResponseError extends Error {\n name: 'HttpResponseError';\n\n /**\n * HTTP status code from the failed response\n */\n status: number;\n\n /**\n * The full Response object from the failed request\n *\n * Use this to access response headers or read the response body:\n * ```typescript\n * const body = await error.response.text();\n * const contentType = error.response.headers.get('content-type');\n * ```\n */\n response: Response;\n}\n","import { HttpClient } from './http';\nimport { PlatformServiceName } from '../core/platform';\n\nconst SERVICE_NAME = 'http';\n\nPlatformServiceName.Http = SERVICE_NAME;\n\ndeclare module '../core/platform' {\n interface PlatformServiceNameType {\n /**\n * @see {@link HttpClient}\n */\n Http: typeof SERVICE_NAME;\n }\n\n interface LimeWebComponentPlatform {\n get(name: PlatformServiceNameType['Http']): HttpClient;\n }\n}\n","import { EventDispatcher as Service } from './eventdispatcher';\nimport { PlatformServiceName } from '../core/platform';\n\nconst SERVICE_NAME = 'eventDispatcher';\n\nPlatformServiceName.EventDispatcher = SERVICE_NAME;\n\ndeclare module '../core/platform' {\n interface PlatformServiceNameType {\n /**\n * @see {@link Service | EventDispatcher}\n */\n EventDispatcher: typeof SERVICE_NAME;\n }\n\n interface LimeWebComponentPlatform {\n get(name: PlatformServiceNameType['EventDispatcher']): Service;\n }\n}\n","import { Translator } from './translator';\nimport { PlatformServiceName } from '../core/platform';\n\nconst SERVICE_NAME = 'translate';\n\nPlatformServiceName.Translate = SERVICE_NAME;\n\ndeclare module '../core/platform' {\n interface PlatformServiceNameType {\n /**\n * @see {@link Translate}\n */\n Translate: typeof SERVICE_NAME;\n }\n\n interface LimeWebComponentPlatform {\n get(name: PlatformServiceNameType['Translate']): Translator;\n }\n}\n","import { DialogRenderer } from './dialog';\nimport { PlatformServiceName } from '../core/platform';\n\nconst SERVICE_NAME = 'dialog';\n\nPlatformServiceName.Dialog = SERVICE_NAME;\n\ndeclare module '../core/platform' {\n interface PlatformServiceNameType {\n /**\n * @see {@link DialogRenderer}\n */\n Dialog: typeof SERVICE_NAME;\n }\n\n interface LimeWebComponentPlatform {\n get(name: PlatformServiceNameType['Dialog']): DialogRenderer;\n }\n}\n","import { KeybindingRegistry as Service } from './registry';\nimport { PlatformServiceName } from '../core/platform';\n\nconst SERVICE_NAME = 'keybindingRegistry';\n\nPlatformServiceName.KeybindingRegistry = SERVICE_NAME;\n\ndeclare module '../core/platform' {\n interface PlatformServiceNameType {\n /**\n * @see {@link Service | KeybindingRegistry}\n *\n * @note Work in progress, do not use!\n * @beta\n */\n KeybindingRegistry: typeof SERVICE_NAME;\n }\n\n interface LimeWebComponentPlatform {\n get(name: PlatformServiceNameType['KeybindingRegistry']): Service;\n }\n}\n","import { Navigator as Service } from './navigator';\nimport { PlatformServiceName } from '../core/platform';\n\nconst SERVICE_NAME = 'navigator';\n\nPlatformServiceName.Navigator = SERVICE_NAME;\n\ndeclare module '../core/platform' {\n interface PlatformServiceNameType {\n /**\n * @see {@link Service | Navigator}\n */\n Navigator: typeof SERVICE_NAME;\n }\n\n interface LimeWebComponentPlatform {\n get(name: PlatformServiceNameType['Navigator']): Service;\n }\n}\n","import { ContextAwareStateOptions, PlatformServiceName } from '../core';\nimport {\n createStateDecorator,\n StateDecoratorConfig,\n} from '../core/decorators/factory';\n\n/**\n * Config for the {@link SelectQueryParam} decorator\n * @public\n * @group Navigation\n */\nexport interface SelectQueryParamOptions extends ContextAwareStateOptions {\n /**\n * The query param to select\n */\n selector: string;\n}\n\n/**\n * Gets a named query param from the location\n *\n * @param options - state decorator options\n * @returns state decorator\n * @public\n * @group Navigation\n */\nexport function SelectQueryParam(\n options: SelectQueryParamOptions\n): PropertyDecorator {\n const config: StateDecoratorConfig = {\n name: PlatformServiceName.Navigator,\n };\n\n return createStateDecorator({ context: null, ...options }, config);\n}\n","import { Command } from '../commandbus';\nimport { Location } from './navigator';\n\nconst COMMAND_ID = 'navigator.navigate' as const;\ndeclare module '../commandbus' {\n interface CommandRegistry {\n [COMMAND_ID]: NavigateCommand;\n }\n}\n\n/**\n * Navigates to a new location\n *\n * @id `navigator.navigate`\n * @public\n * @group Navigation\n */\n@Command({\n id: COMMAND_ID,\n})\nexport class NavigateCommand implements Partial<Location> {\n public path?: string;\n\n public query?: Record<string, unknown>;\n\n public hash?: string;\n\n public state?: unknown;\n}\n","import { Notifications } from './notifications';\nimport { PlatformServiceName } from '../core/platform';\n\nconst SERVICE_NAME = 'notifications';\n\nPlatformServiceName.Notification = SERVICE_NAME;\n\ndeclare module '../core/platform' {\n interface PlatformServiceNameType {\n /**\n * @see {@link Notifications}\n */\n Notification: typeof SERVICE_NAME;\n }\n\n interface LimeWebComponentPlatform {\n get(name: PlatformServiceNameType['Notification']): Notifications;\n }\n}\n","import { RouteRegistry as Service } from './registry';\nimport { PlatformServiceName } from '../core/platform';\n\nconst SERVICE_NAME = 'routeRegistry';\n\nPlatformServiceName.RouteRegistry = SERVICE_NAME;\n\ndeclare module '../core/platform' {\n interface PlatformServiceNameType {\n /**\n * @see {@link Service | RouteRegistry}\n */\n RouteRegistry: typeof SERVICE_NAME;\n }\n\n interface LimeWebComponentPlatform {\n get(name: PlatformServiceNameType['RouteRegistry']): Service;\n }\n}\n","import { StateRepository } from '../core';\n\n/**\n * Service for creating background tasks\n * @public\n * @group Tasks\n */\nexport interface TaskRepository extends StateRepository {\n /**\n * Create a new background task\n *\n * @param url - url to the resource that will create the task\n * @param data - task specific data\n * @param cancelAction - true to allow task creation to be cancelled\n * @param message - notification message to display before the task is created instead of the default one\n * @returns a promise that resolves to the id of the task if it was created successfully\n */\n create(\n url: string,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n data: any,\n cancelAction?: boolean,\n message?: string\n ): Promise<string | void>;\n\n /**\n * Get status about specific tasks\n *\n * @param ids - the ids of the tasks to check\n * @returns a promise that resolves to the status about the tasks\n */\n getStatus(ids: string[]): Promise<TaskStatus[]>;\n}\n\n/**\n * @public\n * @group Tasks\n */\nexport enum TaskState {\n /**\n * Task state is unknown\n */\n Pending = 'PENDING',\n\n /**\n * Task was started by a worker\n */\n Started = 'STARTED',\n\n /**\n * Task is waiting for retry\n */\n Retry = 'RETRY',\n\n /**\n * Task succeeded\n */\n Success = 'SUCCESS',\n\n /**\n * Task failed\n */\n Failure = 'FAILURE',\n}\n\n/**\n * @public\n * @group Tasks\n */\nexport interface TaskStatus {\n /**\n * ID of the task\n */\n id: string;\n\n /**\n * The state of the task\n */\n status: TaskState;\n\n /**\n * The result of the task once it has finished its execution\n */\n result?: string;\n}\n\n/**\n * Events dispatched by the task service\n * @public\n * @group Tasks\n */\nexport enum TaskEventType {\n /**\n * Dispatched when a task has been created.\n *\n * @see {@link TaskEvent}\n */\n Created = 'task.created',\n\n /**\n * Dispatched when the task has successfully been completed\n *\n * @see {@link TaskEvent}\n */\n Success = 'task.success',\n\n /**\n * Dispatched if an error occured while running the task\n *\n * @see {@link TaskEvent}\n */\n Failed = 'task.failed',\n}\n\n/**\n * @public\n * @group Tasks\n */\nexport type TaskEventDetail = {\n task: TaskStatus;\n error?: unknown;\n};\n\n/**\n * @public\n * @group Tasks\n */\nexport type TaskEvent = CustomEvent<TaskEventDetail>;\n","import { TaskRepository as Service } from './repository';\nimport { PlatformServiceName } from '../core/platform';\n\nconst SERVICE_NAME = 'state.tasks';\n\nPlatformServiceName.TaskRepository = SERVICE_NAME;\n\ndeclare module '../core/platform' {\n interface PlatformServiceNameType {\n /**\n * @see {@link Service | TaskRepository}\n */\n TaskRepository: typeof SERVICE_NAME;\n }\n\n interface LimeWebComponentPlatform {\n get(name: PlatformServiceNameType['TaskRepository']): Service;\n }\n}\n","import { ConfigRepository as Service } from './repository';\nimport { PlatformServiceName } from '../core/platform';\n\nconst SERVICE_NAME = 'state.configs';\n\nPlatformServiceName.ConfigRepository = SERVICE_NAME;\n\ndeclare module '../core/platform' {\n interface PlatformServiceNameType {\n /**\n * @see {@link Service | ConfigRepository}\n */\n ConfigRepository: typeof SERVICE_NAME;\n }\n\n interface LimeWebComponentPlatform {\n get(name: PlatformServiceNameType['ConfigRepository']): Service;\n }\n}\n","import {\n PlatformServiceName,\n StateOptions,\n StateDecoratorConfig,\n} from '../core';\nimport { createStateDecorator } from '../core/decorators/factory';\n\n/**\n * Config for the {@link SelectConfig} state decorator\n * @public\n * @group Config\n */\nexport interface SelectConfigOptions extends StateOptions {\n name?: string;\n}\n\n/**\n * Decorator that subscribes to configuration data from the {@link ConfigRepository}.\n *\n * This decorator automatically updates the decorated property whenever configuration\n * data changes in the platform. Returns an object with all configs where the config\n * key is used as the key. It's the recommended approach over manual subscriptions as\n * it handles subscription lifecycle automatically.\n *\n * @param options - Configuration including key filtering and state transformation via {@link SelectConfigOptions}\n * @returns A PropertyDecorator that sets up automatic subscription to config data\n *\n * @remarks\n * Subscribes to: {@link ConfigRepository}\n *\n * Updates: The decorated property with configuration data (object or specific value)\n *\n * Lifecycle: Automatically subscribes in `connectedCallback` and unsubscribes\n * in `disconnectedCallback`\n *\n * @example\n * Get all configuration data\n * ```typescript\n * @State()\n * @SelectConfig({})\n * private config: Record<string, unknown>;\n *\n * render() {\n * return (\n * <div>\n * <h2>Configuration</h2>\n * <pre>{JSON.stringify(this.config, null, 2)}</pre>\n * </div>\n * );\n * }\n * ```\n *\n * @example\n * Get specific config value by name\n * ```typescript\n * @State()\n * @SelectConfig({\n * name: 'apiEndpoint',\n * map: [(config) => config?.url || 'https://api.example.com']\n * })\n * private apiUrl: string;\n *\n * async fetchData() {\n * const response = await fetch(`${this.apiUrl}/data`);\n * return response.json();\n * }\n * ```\n *\n * @public\n * @group Config\n */\nexport function SelectConfig(options: SelectConfigOptions): PropertyDecorator {\n const config: StateDecoratorConfig = {\n name: PlatformServiceName.ConfigRepository,\n };\n\n return createStateDecorator(options, config);\n}\n","import { Device as Service } from './device';\nimport { PlatformServiceName } from '../core/platform';\n\nconst SERVICE_NAME = 'state.device';\n\nPlatformServiceName.Device = SERVICE_NAME;\n\ndeclare module '../core/platform' {\n interface PlatformServiceNameType {\n /**\n * @see {@link Service | Device}\n */\n Device: typeof SERVICE_NAME;\n }\n\n interface LimeWebComponentPlatform {\n get(name: PlatformServiceNameType['Device']): Service;\n }\n}\n","import {\n PlatformServiceName,\n StateOptions,\n StateDecoratorConfig,\n} from '../core';\nimport { createStateDecorator } from '../core/decorators/factory';\n\n/**\n * DeviceType\n * @public\n * @group Device\n */\nexport type DeviceType = 'desktop' | 'tablet' | 'phone';\n\n/**\n * Decorator that subscribes to the current device type from the device service.\n *\n * This decorator automatically updates the decorated property whenever the device type\n * changes (typically when the viewport is resized). The device type indicates roughly\n * how big the viewport is, not what actual device is being used. It's the recommended\n * approach over manual subscriptions as it handles subscription lifecycle automatically.\n *\n * @param options - Configuration for state transformation and filtering via {@link StateOptions}\n * @returns A PropertyDecorator that sets up automatic subscription to device type\n *\n * @remarks\n * Subscribes to: Device service\n *\n * Updates: The decorated property with {@link DeviceType} ('desktop', 'tablet', or 'phone')\n *\n * Viewport-aware: Automatically updates when viewport size changes\n *\n * Lifecycle: Automatically subscribes in `connectedCallback` and\n * unsubscribes in `disconnectedCallback`\n *\n * @example\n * Basic usage with Stencil component\n * ```typescript\n * @State()\n * @SelectDevice()\n * private deviceType: DeviceType;\n *\n * render() {\n * return (\n * <div class={`layout-${this.deviceType}`}>\n * <p>Viewing on: {this.deviceType}</p>\n * </div>\n * );\n * }\n * ```\n *\n * @example\n * Conditional rendering based on device\n * ```typescript\n * @State()\n * @SelectDevice()\n * private device: DeviceType;\n *\n * render() {\n * if (this.device === 'phone') {\n * return <button class=\"hamburger-menu\">Menu</button>;\n * }\n *\n * return (\n * <nav class=\"full-menu\">\n * <a href=\"/home\">Home</a>\n * <a href=\"/about\">About</a>\n * <a href=\"/contact\">Contact</a>\n * </nav>\n * );\n * }\n * ```\n *\n * @public\n * @group Device\n */\nexport function SelectDevice(options: StateOptions = {}): PropertyDecorator {\n const config: StateDecoratorConfig = {\n name: PlatformServiceName.Device,\n };\n\n return createStateDecorator(options, config);\n}\n","import { FilterRepository as Service } from './repository';\nimport { PlatformServiceName } from '../core/platform';\n\nconst SERVICE_NAME = 'state.filters';\n\nPlatformServiceName.FilterRepository = SERVICE_NAME;\n\ndeclare module '../core/platform' {\n interface PlatformServiceNameType {\n /**\n * @see {@link Service | FilterRepository}\n */\n FilterRepository: typeof SERVICE_NAME;\n }\n\n interface LimeWebComponentPlatform {\n get(name: PlatformServiceNameType['FilterRepository']): Service;\n }\n}\n","import {\n PlatformServiceName,\n StateOptions,\n StateDecoratorConfig,\n} from '../core';\nimport { createStateDecorator } from '../core/decorators/factory';\n\n/**\n * Config for the {@link SelectFilters} state decorator\n * @public\n * @group Filters\n */\nexport interface SelectFiltersOptions extends StateOptions {\n id?: string;\n limetype?: string;\n}\n\n/**\n * Decorator that subscribes to filters from the {@link FilterRepository}.\n *\n * This decorator automatically updates the decorated property whenever filters\n * change in the platform. You can optionally filter by limetype or filter ID.\n *\n * @param options - Configuration including limetype/ID filtering and state transformation via {@link SelectFiltersOptions}\n * @returns A PropertyDecorator that sets up automatic subscription to filters\n *\n * @example\n * ```typescript\n * @State()\n * @SelectFilters()\n * private filters: Filter[];\n * ```\n *\n * @example\n * ```typescript\n * @State()\n * @SelectFilters({ limetype: 'company' })\n * private companyFilters: Filter[];\n * ```\n *\n * @public\n * @group Filters\n */\nexport function SelectFilters(\n options: SelectFiltersOptions = {}\n): PropertyDecorator {\n const config: StateDecoratorConfig = {\n name: PlatformServiceName.FilterRepository,\n };\n\n return createStateDecorator(options, config);\n}\n","import { UserDataRepository } from './repository';\nimport { PlatformServiceName } from '../core/platform';\n\nconst SERVICE_NAME = 'state.user-data';\n\nPlatformServiceName.UserDataRepository = SERVICE_NAME;\n\ndeclare module '../core/platform' {\n interface PlatformServiceNameType {\n /**\n * @see {@link UserDataRepository}\n */\n UserDataRepository: typeof SERVICE_NAME;\n }\n\n interface LimeWebComponentPlatform {\n get(\n name: PlatformServiceNameType['UserDataRepository']\n ): UserDataRepository;\n }\n}\n","import {\n PlatformServiceName,\n StateOptions,\n StateDecoratorConfig,\n} from '../core';\nimport { createStateDecorator } from '../core/decorators/factory';\n\n/**\n * Config for the {@link SelectUserData} state decorator\n * @public\n * @group User data\n */\nexport interface SelectUserDataOptions extends StateOptions {\n /**\n * Key specifying the user data\n */\n key?: string;\n}\n\n/**\n * Gets an object with all user data, optionally filtered by key\n *\n * @param options - state decorator options\n * @returns state decorator\n * @public\n * @group User data\n */\nexport function SelectUserData(\n options: SelectUserDataOptions = {}\n): PropertyDecorator {\n const config: StateDecoratorConfig = {\n name: PlatformServiceName.UserDataRepository,\n };\n\n return createStateDecorator(options, config);\n}\n","import { PlatformServiceName } from '../core/platform';\nimport { ApplicationRepository } from './repository';\n\nconst SERVICE_NAME = 'state.application';\n\nPlatformServiceName.Application = SERVICE_NAME;\n\ndeclare module '../core/platform' {\n interface PlatformServiceNameType {\n /**\n * @see {@link ApplicationRepository}\n */\n Application: typeof SERVICE_NAME;\n }\n\n interface LimeWebComponentPlatform {\n get(\n name: PlatformServiceNameType['Application']\n ): ApplicationRepository;\n }\n}\n","import {\n PlatformServiceName,\n StateOptions,\n StateDecoratorConfig,\n} from '../../core';\nimport { createStateDecorator } from '../../core/decorators/factory';\n\n/**\n * Decorator that subscribes to the application name from the {@link ApplicationRepository}.\n *\n * This decorator automatically updates the decorated property whenever the application\n * name changes in the platform. It's the recommended approach over manual subscriptions\n * as it handles subscription lifecycle automatically.\n *\n * @param options - Configuration for state transformation and filtering via {@link StateOptions}\n * @returns A PropertyDecorator that sets up automatic subscription to application name\n *\n * @remarks\n * Subscribes to: {@link ApplicationRepository}\n *\n * Updates: The decorated property with the application name (`string`)\n *\n * Lifecycle: Automatically subscribes in `connectedCallback` and\n * unsubscribes in `disconnectedCallback` of the component.\n *\n * @example\n * ```typescript\n * @State()\n * @SelectApplicationName()\n * private appName: string;\n * ```\n *\n * @example\n * ```typescript\n * // Transform the application name\n * @State()\n * @SelectApplicationName({\n * map: [(name) => name?.toUpperCase()]\n * })\n * private appNameUppercase: string;\n * ```\n *\n * @example\n * ```typescript\n * // Only update when name is defined\n * @State()\n * @SelectApplicationName({\n * filter: [(name) => name !== null && name !== undefined]\n * })\n * private validAppName: string;\n * ```\n *\n * @example\n * ```typescript\n * // Combine map and filter for complex transformations\n * @State()\n * @SelectApplicationName({\n * map: [\n * (name) => name?.toLowerCase(),\n * (name) => `${name} CRM`\n * ],\n * filter: [(formattedName) => formattedName?.length > 4]\n * })\n * private brandedName: string;\n * ```\n *\n * @public\n * @group Application\n */\nexport function SelectApplicationName(\n options: StateOptions = {}\n): PropertyDecorator {\n const config: StateDecoratorConfig = {\n name: PlatformServiceName.Application,\n };\n options.map = [getApplicationName, ...(options.map || [])];\n\n return createStateDecorator(options, config);\n}\n\nfunction getApplicationName(applicationData: { applicationName: string }) {\n return applicationData.applicationName;\n}\n","import {\n PlatformServiceName,\n StateOptions,\n StateDecoratorConfig,\n} from '../../core';\nimport { createStateDecorator } from '../../core/decorators/factory';\nimport { User } from '../user';\n\n/**\n * Decorator that subscribes to the currently logged in user from the {@link ApplicationRepository}.\n *\n * This decorator automatically updates the decorated property whenever the current user\n * changes in the platform. It's the recommended approach over manual subscriptions as it\n * handles subscription lifecycle automatically.\n *\n * @param options - Configuration for state transformation and filtering via {@link StateOptions}\n * @returns A PropertyDecorator that sets up automatic subscription to the current user\n *\n * @remarks\n * Subscribes to: {@link ApplicationRepository}\n *\n * Updates: The decorated property with the {@link User} object\n *\n * Lifecycle: Automatically subscribes in `connectedCallback` and\n * unsubscribes in `disconnectedCallback` of the component.\n *\n * @example\n * ```typescript\n * @State()\n * @SelectCurrentUser()\n * private user: User;\n * ```\n *\n * @example\n * ```typescript\n * // Extract user's full name\n * @State()\n * @SelectCurrentUser({\n * map: [(user) => user?.fullname]\n * })\n * private userName: string;\n * ```\n *\n * @example\n * ```typescript\n * // Create initials with map transformations\n * @State()\n * @SelectCurrentUser({\n * map: [\n * (user) => user?.fullname,\n * (name) => name?.split(' ').map(n => n[0]).join('').toUpperCase()\n * ],\n * filter: [(initials) => initials !== undefined]\n * })\n * private userInitials: string;\n * ```\n *\n * @public\n * @group Application\n */\nexport function SelectCurrentUser(\n options: StateOptions = {}\n): PropertyDecorator {\n const config: StateDecoratorConfig = {\n name: PlatformServiceName.Application,\n };\n options.map = [getCurrentUser, ...(options.map || [])];\n\n return createStateDecorator(options, config);\n}\n\nfunction getCurrentUser(applicationData: { currentUser: User }) {\n return applicationData.currentUser;\n}\n","import {\n PlatformServiceName,\n StateOptions,\n StateDecoratorConfig,\n} from '../../core';\nimport { createStateDecorator } from '../../core/decorators/factory';\nimport { Session } from '../session';\n\n/**\n * Decorator that subscribes to the application session from the {@link ApplicationRepository}.\n *\n * This decorator automatically updates the decorated property whenever the session\n * changes in the platform. The session contains authentication and authorization\n * information. It's the recommended approach over manual subscriptions as it handles\n * subscription lifecycle automatically.\n *\n * @param options - Configuration for state transformation and filtering via {@link StateOptions}\n * @returns A PropertyDecorator that sets up automatic subscription to the session\n *\n * @remarks\n * Subscribes to: {@link ApplicationRepository}\n *\n * Updates: The decorated property with the {@link Session} object\n *\n * Lifecycle: Automatically subscribes in `connectedCallback` and\n * unsubscribes in `disconnectedCallback` of the component.\n *\n * @example\n * ```typescript\n * @State()\n * @SelectSession()\n * private session: Session;\n * ```\n *\n * @example\n * ```typescript\n * // Extract specific session property\n * @State()\n * @SelectSession({\n * map: [(session) => session?.admin]\n * })\n * private isAdmin: boolean;\n * ```\n *\n * @example\n * ```typescript\n * // Filter for valid sessions only\n * @State()\n * @SelectSession({\n * filter: [(session) => session !== null && session?.active === true]\n * })\n * private activeSession: Session;\n * ```\n *\n * @public\n * @group Application\n */\nexport function SelectSession(options: StateOptions = {}): PropertyDecorator {\n const config: StateDecoratorConfig = {\n name: PlatformServiceName.Application,\n };\n options.map = [getSession, ...(options.map || [])];\n\n return createStateDecorator(options, config);\n}\n\nfunction getSession(applicationData: { session: Session }) {\n return applicationData.session;\n}\n","import { PlatformServiceName } from '../core/platform';\nimport { UserPreferencesRepository } from './repository';\n\nconst SERVICE_NAME = 'userPreferences';\n\nPlatformServiceName.UserPreferencesRepository = SERVICE_NAME;\n\ndeclare module '../core/platform' {\n interface PlatformServiceNameType {\n /**\n * @see {@link UserPreferencesRepository}\n */\n UserPreferencesRepository: typeof SERVICE_NAME;\n }\n\n interface LimeWebComponentPlatform {\n get(\n name: PlatformServiceNameType['UserPreferencesRepository']\n ): UserPreferencesRepository;\n }\n}\n","import { DateTimeFormatter } from './datetimeformatter';\nimport { PlatformServiceName } from '../core/platform';\n\nconst SERVICE_NAME = 'datetimeformatter';\n\nPlatformServiceName.DateTimeFormatter = SERVICE_NAME;\n\ndeclare module '../core/platform' {\n interface PlatformServiceNameType {\n /**\n * @see {@link DateTimeFormatter}\n */\n DateTimeFormatter: typeof SERVICE_NAME;\n }\n\n interface LimeWebComponentPlatform {\n get(\n name: PlatformServiceNameType['DateTimeFormatter']\n ): DateTimeFormatter;\n }\n}\n","import { Action } from '../action';\nimport { LimeObject } from '../limeobject';\n\n/**\n * Represents a conditional evaluation rule that can be registered and used\n * throughout the application.\n *\n * Conditions are predicate functions that determine whether certain UI elements should be\n * visible, enabled, or available based on runtime state. For example, they can be used to:\n * - Control action visibility (show/hide menu items based on object state)\n * - Enable/disable features based on user permissions or context\n * - Filter lists of items based on dynamic criteria\n * - Implement business rules for conditional UI rendering\n *\n * Each condition has a unique ID and a type that indicates what kind of subject it evaluates.\n * The most common types are 'limeobject' and 'action', but custom types can be defined.\n *\n * @example\n * Registering a simple LimeObject condition\n * ```typescript\n * const registry = platform.get(PlatformServiceName.ConditionRegistry);\n *\n * const isDealWon = {\n * id: 'deal.is-won',\n * type: 'limeobject',\n * evaluate: (deal) => deal.dealstatus === 'won'\n * };\n *\n * registry.addCondition(isDealWon);\n * ```\n *\n * @example\n * Condition with additional parameters\n * ```typescript\n * const hasMinimumValue = {\n * id: 'object.min-value',\n * type: 'limeobject',\n * evaluate: (object, params) => {\n * const { field, minValue } = params;\n * const value = object[field];\n * return typeof value === 'number' && value >= minValue;\n * }\n * };\n *\n * const isHighValue = hasMinimumValue.evaluate(dealObject, {\n * field: 'value',\n * minValue: 100000\n * });\n * ```\n *\n * @see {@link ConditionRegistry} for managing conditions\n * @see {@link LimeObjectCondition} for LimeObject-specific conditions\n * @see {@link ActionCondition} for action-specific conditions\n *\n * @beta\n * @group Conditions\n */\nexport type Condition<T = unknown> = {\n /**\n * The type of subject this condition evaluates.\n *\n * Common types include:\n * - `limeobject` - Evaluates {@link LimeObject} instances\n * - `action` - Evaluates {@link Action} instances\n *\n * Custom types can be defined for specialized evaluation contexts.\n */\n type: string;\n\n /**\n * The evaluation function that determines if the condition is met.\n *\n * This predicate function receives the subject to evaluate and optional parameters\n * for configuration. It should return `true` if the condition is satisfied,\n * `false` otherwise.\n *\n * The function should be pure and side-effect free when possible, as it may be\n * called frequently during UI rendering and updates.\n *\n * @param subject - The value to evaluate. Type depends on the condition type.\n * For 'limeobject' conditions, this is a {@link LimeObject}.\n * For 'action' conditions, this is an {@link Action}.\n * @param params - Optional configuration data for the evaluation.\n * Can be used to pass context-specific values like field names, thresholds,\n * or other criteria. The evaluation function should validate params if used.\n * @returns `true` if the condition is met, `false` otherwise.\n * @throws May throw an error if params has an unexpected type or required data is missing.\n *\n * @example\n * Simple boolean check\n * ```typescript\n * const evaluate = (deal: LimeObject) => deal.dealstatus === 'won';\n * ```\n *\n * @example\n * Using params for configuration\n * ```typescript\n * const evaluate = (obj: LimeObject, params?: { propertyName: string }) => {\n * return obj.getValue(params.propertyName) !== null;\n * };\n * ```\n */\n evaluate: (subject: T, params?: unknown) => boolean;\n\n /**\n * Unique identifier for this condition.\n *\n * The ID is used to reference the condition when registering, removing, or\n * looking it up from the {@link ConditionRegistry}. It must be unique across\n * all registered conditions.\n */\n id: string;\n};\n\n/**\n * A specialized condition type for evaluating {@link LimeObject} instances.\n *\n * LimeObject conditions are the most common type of condition, used to control\n * UI elements based on the state of business objects (deals, contacts, companies, etc.).\n * The evaluate function receives a LimeObject and can check any of its properties\n * to determine if the condition is met.\n *\n * @example\n * Condition based on object status\n * ```typescript\n * const registry = platform.get(PlatformServiceName.ConditionRegistry);\n *\n * const isDealActive = {\n * id: 'deal.is-active',\n * type: 'limeobject',\n * evaluate: (deal) => {\n * return deal.dealstatus === 'qualification' ||\n * deal.dealstatus === 'proposal';\n * }\n * };\n *\n * registry.addCondition(isDealActive);\n *\n * const condition = registry.getCondition('deal.is-active');\n * const isActive = condition.evaluate(deal);\n * ```\n *\n * @example\n * Condition for conditional action visibility\n * ```typescript\n * const canSendEmail = {\n * id: 'contact.can-send-email',\n * type: 'limeobject',\n * evaluate: (contact) => contact.email && contact.email.length > 0\n * };\n *\n * const sendEmailAction = {\n * label: 'Send Email',\n * icon: 'envelope',\n * command: { name: 'send-email' },\n * condition: canSendEmail\n * };\n * ```\n *\n * @see {@link Condition} for the base condition type\n * @see {@link LimeObject} for the object structure\n *\n * @beta\n * @group Conditions\n */\nexport type LimeObjectCondition = Condition<LimeObject> & {\n type: 'limeobject';\n};\n\n/**\n * A specialized condition type for evaluating {@link Action} instances.\n *\n * Action conditions are used to control the availability or visibility of actions\n * themselves, based on properties of the action. This is less common than {@link LimeObject}\n * conditions but useful for creating dynamic action menus that filter or organize\n * actions based on their metadata.\n *\n * @example\n * Condition to filter bulk actions\n * ```typescript\n * const registry = platform.get(PlatformServiceName.ConditionRegistry);\n *\n * const isBulkAction = {\n * id: 'action.is-bulk',\n * type: 'action',\n * evaluate: (action) => action.command.name.startsWith('bulk-')\n * };\n *\n * registry.addCondition(isBulkAction);\n * ```\n *\n * @see {@link Condition} for the base condition type\n * @see {@link Action} for the action structure\n *\n * @beta\n * @group Conditions\n */\nexport type ActionCondition = Condition<Action> & {\n type: 'action';\n};\n\n/**\n * Check if condition expects a {@link LimeObject} to be passed when it is evaluated\n *\n * @param condition - the condition to check\n * @returns true if the condition is a condition for a {@link LimeObject},\n * false otherwise\n *\n * @beta\n * @group Conditions\n */\nexport function isLimeObjectCondition(\n condition: Condition\n): condition is Condition<LimeObject> {\n return condition.type === 'limeobject';\n}\n\n/**\n * Check if condition expects an action to be passed when it is evaluated\n *\n * @param condition - the condition to check\n * @returns true if the condition is a condition for an {@link Action},\n * false otherwise\n *\n * @beta\n * @group Conditions\n */\nexport function isActionCondition(\n condition: Condition\n): condition is Condition<Action> {\n return condition.type === 'action';\n}\n\n/**\n * Central registry for managing conditional evaluation rules across the application.\n *\n * The ConditionRegistry acts as a global repository for {@link Condition} instances,\n * allowing different parts of the application to register, retrieve, and evaluate\n * conditions. This is particularly useful for:\n * - Controlling action visibility based on object state\n * - Implementing permission-based UI rendering\n * - Creating dynamic, context-aware interfaces\n * - Sharing reusable business logic across components\n *\n * Components typically access the registry via the platform service and register\n * their conditions when the application initializes. Conditions can be\n * added and removed dynamically, allowing for flexible runtime configuration.\n *\n * @example\n * Registering and using conditions in a component\n * ```typescript\n * const registry = platform.get(PlatformServiceName.ConditionRegistry);\n *\n * const canWinDeal = {\n * id: 'deal.can-win',\n * type: 'limeobject',\n * evaluate: (deal) => deal.dealstatus === 'proposal' && deal.value > 0\n * };\n *\n * const canLoseDeal = {\n * id: 'deal.can-lose',\n * type: 'limeobject',\n * evaluate: (deal) => deal.dealstatus !== 'lost' && deal.dealstatus !== 'won'\n * };\n *\n * registry.addCondition(canWinDeal);\n * registry.addCondition(canLoseDeal);\n *\n * const actions = [\n * {\n * label: 'Mark as Won',\n * icon: 'trophy',\n * command: { name: 'win-deal' },\n * condition: registry.getCondition('deal.can-win')\n * },\n * {\n * label: 'Mark as Lost',\n * icon: 'times',\n * command: { name: 'lose-deal' },\n * condition: registry.getCondition('deal.can-lose')\n * }\n * ];\n *\n * const availableActions = actions.filter(action => {\n * return !action.condition || action.condition.evaluate(deal);\n * });\n * ```\n *\n * @see {@link Condition} for the condition structure\n * @see {@link LimeObjectCondition} for object-specific conditions\n * @see {@link ActionCondition} for action-specific conditions\n *\n * @beta\n * @group Conditions\n */\nexport interface ConditionRegistry {\n /**\n * Registers a new condition in the registry.\n *\n * The condition's ID must be unique across all registered conditions.\n * If a condition with the same ID already exists, this method throws an error.\n * It's recommended to register conditions during application startup.\n *\n * @param condition - The condition to register. Must have a unique ID.\n * @throws Error if a condition with the same ID already exists in the registry.\n *\n * @example\n * ```typescript\n * const isActive: LimeObjectCondition = {\n * id: 'deal.is-active',\n * type: 'limeobject',\n * evaluate: (deal) => deal.dealstatus === 'active'\n * };\n *\n * registry.addCondition(isActive);\n * ```\n */\n addCondition(condition: Condition);\n\n /**\n * Removes a condition from the registry.\n *\n * The condition is identified by its ID. If no condition with the given ID\n * exists in the registry, this method throws an error.\n *\n * @param condition - The condition to remove. Must exist in the registry.\n * @throws Error if the condition's ID does not exist in the registry.\n *\n * @example\n * ```typescript\n * const condition = registry.getCondition('deal.is-active');\n * registry.removeCondition(condition);\n * ```\n *\n * @example\n * Safe removal with existence check\n * ```typescript\n * if (registry.hasCondition('deal.is-active')) {\n * registry.removeCondition(registry.getCondition('deal.is-active'));\n * }\n * ```\n */\n removeCondition(condition: Condition);\n\n /**\n * Checks whether a condition with the given ID exists in the registry.\n *\n * This method is useful for defensive programming, allowing you to verify\n * that a condition exists before attempting to retrieve or remove it.\n *\n * @param id - The unique identifier of the condition to check.\n * @returns `true` if a condition with the ID exists, `false` otherwise.\n *\n * @example\n * ```typescript\n * if (registry.hasCondition('deal.can-win')) {\n * const condition = registry.getCondition('deal.can-win');\n * const canWin = condition.evaluate(deal);\n * }\n * ```\n */\n hasCondition(id: string): boolean;\n\n /**\n * Retrieves all registered conditions.\n *\n * This method returns a list of all conditions currently in the registry,\n * regardless of their type. This can be useful for debugging, inspection,\n * or building dynamic UIs that need to enumerate available conditions.\n *\n * @returns An array of all registered conditions.\n *\n * @example\n * ```typescript\n * const allConditions = registry.getConditions();\n * console.log(`Found ${allConditions.length} conditions`);\n *\n * const limeObjectConditions = allConditions.filter(\n * c => c.type === 'limeobject'\n * );\n * ```\n */\n getConditions(): Condition[];\n\n /**\n * Retrieves a specific condition by its unique identifier.\n *\n * If no condition with the given ID exists, this method throws an error.\n * Use {@link ConditionRegistry.hasCondition} first if you need to check for existence.\n *\n * @param id - The unique identifier of the condition to retrieve.\n * @returns The condition with the specified ID.\n * @throws Error if no condition with the given ID exists in the registry.\n *\n * @example\n * ```typescript\n * const canWin = registry.getCondition('deal.can-win');\n * const isEligible = canWin.evaluate(dealObject);\n * ```\n *\n * @example\n * Safe retrieval with type checking\n * ```typescript\n * const condition = registry.getCondition('deal.is-active');\n * if (isLimeObjectCondition(condition)) {\n * const result = condition.evaluate(myDeal);\n * }\n * ```\n */\n getCondition(id: string): Condition;\n}\n","import { PlatformServiceName } from '../core/platform';\nimport { ConditionRegistry as Service } from './conditionregistry';\n\nconst SERVICE_NAME = 'conditionRegistry';\n\nPlatformServiceName.ConditionRegistry = SERVICE_NAME;\n\ndeclare module '../core/platform' {\n interface PlatformServiceNameType {\n /**\n * @see {@link Service | ConditionRegistry}\n */\n ConditionRegistry: typeof SERVICE_NAME;\n }\n interface LimeWebComponentPlatform {\n get(name: PlatformServiceNameType['ConditionRegistry']): Service;\n }\n}\n","import { ViewFactoryRegistry } from './registry';\nimport { PlatformServiceName } from '../core/platform';\n\nconst SERVICE_NAME = 'viewFactoryRegistry';\n\nPlatformServiceName.ViewFactoryRegistry = SERVICE_NAME;\n\ndeclare module '../core/platform' {\n interface PlatformServiceNameType {\n /**\n * @beta\n * @see {@link ViewFactoryRegistry}\n */\n ViewFactoryRegistry: typeof SERVICE_NAME;\n }\n\n interface LimeWebComponentPlatform {\n /**\n * @beta\n */\n get(\n name: PlatformServiceNameType['ViewFactoryRegistry']\n ): ViewFactoryRegistry;\n }\n}\n","import { PlatformServiceName } from '../core/platform';\nimport { WebComponentRegistry } from './registry';\n\nconst SERVICE_NAME = 'webComponentRegistry';\n\nPlatformServiceName.WebComponentRegistry = SERVICE_NAME;\n\ndeclare module '../core/platform' {\n interface PlatformServiceNameType {\n /**\n * @see {@link WebComponentRegistry}\n */\n WebComponentRegistry: typeof SERVICE_NAME;\n }\n\n interface LimeWebComponentPlatform {\n get(\n name: PlatformServiceNameType['WebComponentRegistry']\n ): WebComponentRegistry;\n }\n}\n","import { NotificationRepository } from './repository';\nimport { PlatformServiceName } from '../core/platform';\n\nconst SERVICE_NAME = 'state.notifications';\n\nPlatformServiceName.NotificationRepository = SERVICE_NAME;\n\ndeclare module '../core/platform' {\n interface PlatformServiceNameType {\n /**\n * @see {@link NotificationRepository}\n */\n NotificationRepository: typeof SERVICE_NAME;\n }\n\n interface LimeWebComponentPlatform {\n get(\n name: PlatformServiceNameType['NotificationRepository']\n ): NotificationRepository;\n }\n}\n","import { PollerFactory as PollerFactoryService } from './factory';\nimport { PlatformServiceName } from '../core/platform';\n\nconst SERVICE_NAME = 'pollerFactory';\n\nPlatformServiceName.PollerFactory = SERVICE_NAME;\n\ndeclare module '../core/platform' {\n interface PlatformServiceNameType {\n /**\n * @see {@link PollerFactoryService}\n */\n PollerFactory: typeof SERVICE_NAME;\n }\n\n interface LimeWebComponentPlatform {\n get(\n name: PlatformServiceNameType['PollerFactory']\n ): PollerFactoryService;\n }\n}\n","/**\n * Logger service for writing log messages to configured handlers\n *\n * Loggers are created from a {@link LoggerFactory} with a specific scope/category.\n * All log messages written to a logger will be sent to all handlers configured\n * in the factory.\n *\n * @example\n * ```typescript\n * const logger = loggerFactory.createLogger('my-component');\n *\n * logger.info('Component initialized');\n * logger.debug('Processing data', { itemCount: 42 });\n * logger.warn('Deprecated API usage detected');\n * logger.error('Failed to fetch data', error, { url: '/api/data' });\n * ```\n *\n * @beta\n * @group Logger\n */\nexport interface Logger {\n /**\n * The scope/category for this logger instance\n */\n readonly scope: string;\n\n /**\n * Logs a debug message\n *\n * Use for detailed diagnostic information useful during development and troubleshooting.\n * Debug logs are typically disabled in production and should include technical details\n * like internal state, intermediate values, or execution flow.\n *\n * @param message - The log message\n * @param data - Optional additional data to include with the log entry\n *\n * @example\n * ```typescript\n * logger.debug('Cache miss, fetching from API', { key: 'user:123' });\n * logger.debug('Rendering component', { props: componentProps });\n * ```\n */\n debug(message: string, data?: LogData): void;\n\n /**\n * Logs an informational message\n *\n * Use for significant application events that represent normal behavior.\n * Info logs should capture key milestones, successful operations, or state transitions\n * that are useful for understanding application flow in production.\n *\n * @param message - The log message\n * @param data - Optional additional data to include with the log entry\n *\n * @example\n * ```typescript\n * logger.info('User authenticated', { userId: user.id });\n * logger.info('File uploaded successfully', { filename: 'report.pdf', size: 2048 });\n * ```\n */\n info(message: string, data?: LogData): void;\n\n /**\n * Logs a warning message\n *\n * Use for unexpected situations that don't prevent the application from functioning\n * but may indicate potential issues, deprecated usage, or suboptimal conditions.\n * Warnings should be actionable and suggest something that may need attention.\n *\n * @param message - The log message\n * @param data - Optional additional data to include with the log entry\n *\n * @example\n * ```typescript\n * logger.warn('API response time exceeded threshold', { duration: 3500, threshold: 3000 });\n * logger.warn('Using deprecated configuration option', { option: 'legacy_mode' });\n * ```\n */\n warn(message: string, data?: LogData): void;\n\n /**\n * Logs an error message\n *\n * Use for failures and exceptions that prevent normal operation or indicate\n * something has gone wrong. Error logs should always describe what failed\n * and include relevant context to aid in diagnosis.\n *\n * @param message - The log message\n * @param error - Optional error object\n * @param data - Optional additional data to include with the log entry\n *\n * @example\n * ```typescript\n * logger.error('Failed to fetch user data', error, { userId: 123 });\n * logger.error('Invalid configuration detected', undefined, { config: invalidConfig });\n * ```\n */\n error(message: string, error?: Error, data?: LogData): void;\n}\n\n/**\n * Handler for processing log messages\n *\n * Implementations can handle logs by writing to different outputs such as\n * console, memory, IndexedDB, or external services.\n *\n * @example\n * ```typescript\n * class ConsoleHandler implements LogHandler {\n * minLevel = LogLevel.Info;\n *\n * handle(entry: LogEntry): void {\n * const prefix = `[${entry.level.toUpperCase()}] [${entry.scope}]`;\n * console.log(`${prefix} ${entry.message}`, entry.data);\n * }\n * }\n *\n * // Change level at runtime\n * consoleHandler.minLevel = LogLevel.Debug;\n * ```\n *\n * @beta\n * @group Logger\n */\nexport interface LogHandler {\n /**\n * Handles a log entry\n *\n * Implementations should handle their own errors internally to ensure\n * reliability. However, any uncaught errors thrown by this method will\n * be caught by the factory to prevent one handler from breaking others.\n * Errors will be logged to the console but will not stop other handlers\n * from receiving the log entry.\n *\n * @param entry - The log entry to handle\n */\n handle(entry: LogEntry): void | Promise<void>;\n\n /**\n * Minimum log level this handler should receive\n *\n * If specified, the factory will only pass log entries with a level\n * equal to or higher than this value. If not specified, all log\n * entries are passed to the handler.\n *\n * Level priority (lowest to highest): Debug → Info → Warn → Error\n *\n * This can be changed at runtime to dynamically adjust filtering.\n */\n minLevel?: LogLevel;\n}\n\n/**\n * Extended handler interface for handlers that support log storage and retrieval\n *\n * Handlers like memory and IndexedDB implement this interface to allow\n * querying and exporting stored logs.\n *\n * @remarks\n * Implementations should respect the configured retention policies (`maxEntries`\n * and `maxAge`) to prevent unbounded growth. These limits can be changed at\n * runtime to dynamically adjust retention behavior.\n *\n * For high-volume logging, consider batching writes to reduce overhead.\n *\n * @example\n * ```typescript\n * class MemoryHandler implements LogStore {\n * maxEntries = 10000;\n * maxAge = 7 * 24 * 60 * 60 * 1000; // 7 days\n *\n * handle(entry: LogEntry): void { }\n * getLogs(): LogEntry[] { return []; }\n * clear(): void { }\n * }\n * ```\n *\n * @beta\n * @group Logger\n */\nexport interface LogStore extends LogHandler {\n /**\n * Retrieves all stored log entries\n *\n * @returns Array of all log entries\n */\n getLogs(): LogEntry[] | Promise<LogEntry[]>;\n\n /**\n * Clears all stored log entries\n */\n clear(): void | Promise<void>;\n\n /**\n * Maximum number of log entries to retain\n *\n * When the number of stored entries exceeds this limit, the oldest\n * entries should be removed. If not specified, no entry-count limit\n * is enforced.\n *\n * This can be changed at runtime to dynamically adjust retention.\n */\n maxEntries?: number;\n\n /**\n * Maximum age of log entries in milliseconds\n *\n * Entries older than this age should be removed during cleanup.\n * If not specified, no age-based cleanup is performed.\n *\n * This can be changed at runtime to dynamically adjust retention.\n *\n * @example\n * ```typescript\n * // Retain logs for 7 days\n * store.maxAge = 7 * 24 * 60 * 60 * 1000;\n *\n * // Retain logs for 1 hour\n * store.maxAge = 60 * 60 * 1000;\n * ```\n */\n maxAge?: number;\n}\n\n/**\n * Factory for creating {@link Logger} instances\n *\n * The factory is initialized with one or more log handlers. All loggers created\n * from the factory will write to all configured handlers.\n *\n * @example\n * ```typescript\n * // Get the logger factory from the platform\n * const loggerFactory = platform.get('logger');\n *\n * // Create loggers for different components\n * const httpLogger = loggerFactory.createLogger('http');\n * const authLogger = loggerFactory.createLogger('auth');\n *\n * // Register a custom handler dynamically\n * const customHandler = new MyCustomHandler();\n * loggerFactory.addHandler(customHandler);\n *\n * // Retrieve all logs\n * const allLogs = await loggerFactory.getLogs();\n *\n * // Clear all logs\n * await loggerFactory.clearLogs();\n * ```\n *\n * @beta\n * @group Logger\n */\nexport interface LoggerFactory {\n /**\n * Creates a logger instance for a specific scope/category\n *\n * @param scope - The scope or category for the logger (e.g., 'http', 'auth', 'component-name')\n * @returns A logger instance that writes to all configured handlers\n */\n createLogger(scope: string): Logger;\n\n /**\n * Registers a new handler with the factory\n *\n * The handler will receive all future log entries from all loggers\n * (both existing and newly created). Historical logs are not replayed.\n *\n * @param handler - The handler to register\n */\n addHandler(handler: LogHandler): void;\n\n /**\n * Removes a handler from the factory\n *\n * @param handler - The handler to remove\n * @returns `true` if the handler was removed, `false` if it was not found\n */\n removeHandler(handler: LogHandler): boolean;\n\n /**\n * Retrieves logs from all handlers that support storage\n *\n * This method aggregates logs from all handlers that implement {@link LogStore}.\n * Handlers that don't support log retrieval (like console) are ignored.\n *\n * @returns Array of all log entries from all storage handlers\n */\n getLogs(): Promise<LogEntry[]>;\n\n /**\n * Clears logs from all handlers that support storage\n *\n * This method clears logs from all handlers that implement {@link LogStore}.\n * Handlers that don't support clearing (like console) are ignored.\n */\n clearLogs(): Promise<void>;\n}\n\n/**\n * Base properties shared by all log entries\n *\n * @beta\n * @group Logger\n */\ninterface BaseLogEntry {\n /**\n * The scope/category this log entry belongs to\n */\n scope: string;\n\n /**\n * The log message\n */\n message: string;\n\n /**\n * Timestamp when the log entry was created (milliseconds since Unix epoch)\n *\n * Use `Date.now()` to create, `new Date(timestamp)` to convert back to Date object.\n */\n timestamp: number;\n\n /**\n * Optional additional structured data\n */\n data?: LogData;\n}\n\n/**\n * Log entry for Debug, Info, and Warn levels\n *\n * @beta\n * @group Logger\n */\ninterface StandardLogEntry extends BaseLogEntry {\n level: typeof LogLevel.Debug | typeof LogLevel.Info | typeof LogLevel.Warn;\n}\n\n/**\n * Log entry for Error level with optional error object\n *\n * @beta\n * @group Logger\n */\ninterface ErrorLogEntry extends BaseLogEntry {\n level: typeof LogLevel.Error;\n\n /**\n * Optional error object\n *\n * @remarks\n * Error objects do not serialize well to JSON - only `name` and `message`\n * are preserved, while `stack` is lost. Storage handlers that persist logs\n * should manually serialize errors before storage:\n *\n * ```typescript\n * const serialized = {\n * name: error.name,\n * message: error.message,\n * stack: error.stack\n * };\n * ```\n */\n error?: Error;\n}\n\n/**\n * A log entry with type-safe level discrimination\n *\n * When `level` is `LogLevel.Error`, the `error` property is available.\n *\n * @beta\n * @group Logger\n */\nexport type LogEntry = StandardLogEntry | ErrorLogEntry;\n\n/**\n * Log level values\n *\n * @beta\n * @group Logger\n */\nexport const LogLevel = {\n Debug: 'debug',\n Info: 'info',\n Warn: 'warn',\n Error: 'error',\n} as const;\n\n/**\n * Log level type indicating the severity of a log message\n *\n * @beta\n * @group Logger\n */\nexport type LogLevel = (typeof LogLevel)[keyof typeof LogLevel];\n\n/**\n * Additional structured data that can be attached to a log entry\n *\n * Values should be JSON-serializable (primitives, arrays, plain objects) to\n * ensure compatibility with storage handlers. Avoid functions, symbols,\n * undefined, and circular references.\n *\n * @beta\n * @group Logger\n */\nexport type LogData = Record<string, unknown>;\n","import { LoggerFactory } from './logger';\nimport { PlatformServiceName } from '../core/platform';\n\nconst SERVICE_NAME = 'logger';\n\nPlatformServiceName.Logger = SERVICE_NAME;\n\ndeclare module '../core/platform' {\n interface PlatformServiceNameType {\n /**\n * @see {@link LoggerFactory}\n */\n Logger: typeof SERVICE_NAME;\n }\n\n interface LimeWebComponentPlatform {\n get(name: PlatformServiceNameType['Logger']): LoggerFactory;\n }\n}\n","import { Logger } from './logger';\n\nlet scriptUrl: string | null | undefined;\nlet packageName: string | null | undefined;\n\n/**\n * Creates a logger instance using the platform's logger factory\n *\n * This function retrieves the logger factory from the global Lime platform\n * object and creates a scoped logger. If the platform factory is not available,\n * it falls back to the browser console.\n *\n * The package name is automatically determined from the module's URL on the first\n * call and cached for all subsequent calls. This ensures consistent logger scopes\n * across all loggers created from the same module instance.\n *\n * @param scope - The scope/category for the logger (e.g., 'my-component', 'http-client')\n * @returns A logger instance integrated with the platform or console fallback\n *\n * @remarks\n * The console fallback is provided for development scenarios where the full\n * Lime platform is not available. The console object does not fully implement\n * the Logger interface but provides compatible logging methods.\n *\n * @example\n * ```typescript\n * const logger = createLogger('my-component');\n * logger.info('Component initialized');\n * logger.debug('Processing data', { count: 42 });\n * ```\n *\n * @beta\n * @group Logger\n */\nexport function createLogger(scope: string): Logger {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const factory = (window as any).Lime?.logger?.createLogger;\n\n if (typeof factory !== 'function') {\n console.warn(\n `Logger factory is not configured. Returning console logger for scope \"${scope}\".`\n );\n\n return console as unknown as Logger;\n }\n\n if (packageName === undefined) {\n packageName = getPackageNameFromUrl(getCurrentScriptUrl());\n }\n\n if (packageName) {\n scope = `${packageName}:${scope}`;\n }\n\n return factory(scope);\n}\n\nfunction getCurrentScriptUrl(): string | null {\n if (scriptUrl !== undefined) {\n return scriptUrl;\n }\n\n if (import.meta !== undefined && typeof import.meta.url === 'string') {\n scriptUrl = import.meta.url;\n return scriptUrl;\n }\n\n scriptUrl = getUrlFromErrorStack();\n return scriptUrl;\n}\n\nfunction getUrlFromErrorStack(): string | null {\n try {\n const stack = new Error('.').stack;\n if (!stack) {\n return null;\n }\n\n const stackLines = stack.split('\\n');\n for (const line of stackLines) {\n const match = line.match(/(https?:\\/\\/[^)\\s:]+)/);\n if (match) {\n return match[1];\n }\n }\n\n return null;\n } catch {\n return null;\n }\n}\n\n/**\n * Extracts the package name from a given URL\n *\n * Supports multiple URL patterns:\n * - `/packages/@scope/name/version/...` → extracts `name`\n * - `/static/name+version/...` → extracts `name`\n * - `/static/directory/name+version/...` → extracts `name`\n * - `/static/name/...` → extracts `name`\n *\n * The extracted name is cleaned by removing common prefixes and suffixes.\n *\n * @param url - The URL string to extract the package name from\n *\n * @returns The extracted package name, or null if not found\n *\n * @beta\n * @group Logger\n */\nexport function getPackageNameFromUrl(url: string | null): string | null {\n if (!url) return null;\n\n const rawName =\n extractFromLwcComponentsPath(url) ||\n extractFromPackagesPath(url) ||\n extractFromPlusVersion(url) ||\n extractFromStaticPath(url);\n\n if (!rawName) {\n return null;\n }\n\n return rawName;\n}\n\nfunction extractFromLwcComponentsPath(url: string): string | null {\n const pattern = /\\/([^/]+)-lwc-components\\//;\n const match = url.match(pattern);\n\n return match ? match[1] : null;\n}\n\nfunction extractFromPackagesPath(url: string): string | null {\n const packagesPattern = /\\/packages\\/(?:@[^/]+\\/)?([^/]+)/;\n const match = url.match(packagesPattern);\n\n return match ? match[1] : null;\n}\n\nfunction extractFromPlusVersion(url: string): string | null {\n const plusIndex = url.indexOf('+');\n if (plusIndex === -1) {\n return null;\n }\n\n const beforePlus = url.slice(0, plusIndex);\n const lastSlash = beforePlus.lastIndexOf('/');\n\n if (lastSlash === -1) {\n return null;\n }\n\n return beforePlus.slice(lastSlash + 1);\n}\n\nfunction extractFromStaticPath(url: string): string | null {\n const staticPattern = /\\/static\\/([^/]+)\\//;\n const match = url.match(staticPattern);\n\n return match ? match[1] : null;\n}\n","/**\n * Available severity levels for problems.\n *\n * Severity indicates the urgency and impact of a problem, helping users\n * prioritize which issues need attention first. The levels are:\n * - `Low` - Minor issues that don't significantly impact operations\n * - `Medium` - Issues that should be addressed but aren't urgent\n * - `High` - Important issues requiring prompt attention\n * - `Critical` - Severe issues that need immediate action\n *\n * @example\n * Setting severity when creating a problem\n * ```typescript\n * const problem: Problem = {\n * id: 'email-123',\n * providerId: 'email-integration',\n * type: 'delivery-failed',\n * description: 'Email could not be delivered to recipient',\n * createdAt: new Date().toISOString(),\n * severity: ProblemSeverity.High\n * };\n * ```\n *\n * @example\n * Filtering problems by severity\n * ```typescript\n * const criticalProblems = await provider.getProblems({\n * severity: ProblemSeverity.Critical\n * });\n *\n * const urgentProblems = await provider.getProblems({\n * severity: [ProblemSeverity.High, ProblemSeverity.Critical]\n * });\n * ```\n *\n * @alpha\n * @group Problem\n */\nexport const ProblemSeverity = {\n Low: 'low',\n Medium: 'medium',\n High: 'high',\n Critical: 'critical',\n} as const;\n\n/**\n * Severity level for a problem, indicating urgency and impact.\n *\n * @see {@link ProblemSeverity} for available values\n *\n * @alpha\n * @group Problem\n */\nexport type ProblemSeverity =\n (typeof ProblemSeverity)[keyof typeof ProblemSeverity];\n\n/**\n * Links a problem to a specific {@link LimeObject}.\n *\n * When a problem is related to a specific business object (e.g., a contact\n * whose email bounced, or a deal that failed to sync), the context provides\n * the link to that object. This enables:\n * - Navigating from the problem to the related object\n * - Showing problems when viewing a specific object\n * - Filtering problems by related object type or instance\n *\n * @example\n * Problem linked to a specific contact\n * ```typescript\n * const problem: Problem = {\n * id: 'email-789',\n * providerId: 'email-integration',\n * type: 'delivery-failed',\n * description: 'Email bounced - invalid address',\n * createdAt: new Date().toISOString(),\n * context: {\n * limetype: 'contact',\n * id: 12345\n * }\n * };\n * ```\n *\n * @see {@link Problem.context}\n * @see {@link ProblemContextFilter} for filtering by context\n *\n * @alpha\n * @group Problem\n */\nexport type ProblemContext = {\n /**\n * The limetype of the related object (e.g., 'contact', 'deal', 'company')\n */\n limetype: string;\n\n /**\n * The id of the specific object instance\n */\n id: number;\n};\n\n/**\n * Technical error details for a problem.\n *\n * While {@link Problem.description} provides a user-friendly explanation,\n * ProblemError captures the underlying technical details useful for debugging.\n * This separation allows the platform to show appropriate information to\n * different audiences.\n *\n * @example\n * Problem with error details\n * ```typescript\n * const problem: Problem = {\n * id: 'sync-001',\n * providerId: 'external-crm',\n * type: 'connection-error',\n * description: 'Could not sync deal with external CRM',\n * createdAt: new Date().toISOString(),\n * error: {\n * message: 'Connection refused by remote host',\n * code: 'ECONNREFUSED',\n * stack: 'Error: Connection refused\\n at TCPConnectWrap...'\n * }\n * };\n * ```\n *\n * @see {@link Problem.error}\n *\n * @alpha\n * @group Problem\n */\nexport interface ProblemError {\n /**\n * Technical error message.\n *\n * This is the raw error message from the underlying system, which may\n * be more technical than the user-facing {@link Problem.description}.\n */\n message: string;\n\n /**\n * Error code for programmatic handling.\n *\n * Codes allow categorizing errors without parsing message text.\n * Use standard codes where applicable (e.g., `ETIMEDOUT`, `ECONNREFUSED`)\n * or provider-specific codes.\n */\n code?: string;\n\n /**\n * Stack trace for debugging.\n *\n * The full stack trace helps developers diagnose where errors originated.\n * May be displayed in an expandable \"Technical Details\" section.\n */\n stack?: string;\n}\n\n/**\n * Represents a problem reported by a {@link ProblemProvider}.\n *\n * Problems are system-level issues that require manual intervention, such as:\n * - Failed email delivery or validation errors\n * - Integration sync failures with external systems\n * - Background task configuration errors\n * - Data import issues with corrupt records\n *\n * Each problem belongs to a provider which owns the problem's lifecycle,\n * storage, and available actions. Problems can optionally be linked to a\n * specific {@link LimeObject} via the `context` property.\n *\n * The platform aggregates problems from all registered providers, allowing\n * authorized users to view and manage issues across the system.\n *\n * The generic type parameter `T` allows providers to define strongly-typed\n * metadata for their specific problem types.\n *\n * @typeParam T - The type of the metadata object. Defaults to `unknown`.\n *\n * @example\n * Basic problem with required fields only\n * ```typescript\n * const problem: Problem = {\n * id: 'prob-001',\n * providerId: 'email-integration',\n * type: 'delivery-failed',\n * description: 'Email to john@example.com bounced with error: mailbox full',\n * createdAt: '2024-01-15T10:30:00Z'\n * };\n * ```\n *\n * @example\n * Problem with typed metadata\n * ```typescript\n * interface EmailProblemMetadata {\n * recipientEmail: string;\n * bounceType: 'permanent' | 'temporary';\n * smtpCode: number;\n * }\n *\n * const problem: Problem<EmailProblemMetadata> = {\n * id: 'email-123',\n * providerId: 'email-integration',\n * type: 'delivery-failed',\n * description: 'Email bounced',\n * createdAt: '2024-01-15T10:30:00Z',\n * metadata: {\n * recipientEmail: 'john@example.com',\n * bounceType: 'permanent',\n * smtpCode: 550\n * }\n * };\n * ```\n *\n * @example\n * Problem with error details\n * ```typescript\n * const problem: Problem = {\n * id: 'sync-error-042',\n * providerId: 'external-crm-sync',\n * type: 'connection-error',\n * description: 'Failed to sync deal with external CRM',\n * createdAt: '2024-01-15T14:22:00Z',\n * severity: ProblemSeverity.High,\n * status: 'pending-retry',\n * context: { limetype: 'deal', id: 98765 },\n * error: {\n * message: 'ETIMEDOUT: connection timed out after 30000ms',\n * code: 'ETIMEDOUT',\n * stack: 'Error: ETIMEDOUT\\n at TCPConnectWrap.afterConnect...'\n * }\n * };\n * ```\n *\n * @see {@link ProblemProvider} for the interface that supplies problems\n * @see {@link ProblemRepository} for registering providers and querying problems\n * @see {@link ProblemSeverity} for severity levels\n * @see {@link ProblemError} for technical error details\n *\n * @alpha\n * @group Problem\n */\nexport interface Problem<T = unknown> {\n /**\n * Unique identifier for the problem within the provider.\n *\n * The id only needs to be unique within a single provider. The combination\n * of `providerId` and `id` uniquely identifies a problem across the system.\n */\n id: string;\n\n /**\n * Identifier of the {@link ProblemProvider} that reported this problem.\n *\n * This links the problem back to its owning provider, which controls\n * the problem's lifecycle and available actions.\n *\n * This property is set automatically by the platform when problems are\n * returned from the {@link ProblemRepository}. Providers should not\n * include this property when returning problems from their methods.\n */\n providerId: string;\n\n /**\n * Type identifier for categorizing the problem.\n *\n * Types are provider-specific and allow grouping similar problems together.\n * Use a consistent naming convention, typically with a prefix indicating\n * the domain (e.g., 'email.delivery-failed', 'sync.connection-error').\n *\n * The provider's {@link ProblemProvider.getType} method returns display\n * information (title, description, icon) for each type.\n *\n * @example\n * ```typescript\n * // Email integration provider types\n * type: 'email.delivery-failed'\n * type: 'email.validation-error'\n * type: 'email.attachment-too-large'\n *\n * // Sync provider types\n * type: 'sync.connection-error'\n * type: 'sync.data-conflict'\n * type: 'sync.rate-limited'\n * ```\n */\n type: string;\n\n /**\n * Human-readable description of what went wrong.\n *\n * The description should be clear enough for users to understand the issue\n * without needing technical knowledge. Include relevant details like\n * affected entities, error messages, or suggested actions.\n *\n * @example\n * ```typescript\n * // Good descriptions\n * description: 'Email to john@example.com could not be delivered: mailbox is full'\n * description: 'Failed to sync deal \"Big Corp Renewal\" with external system: connection timeout'\n *\n * // Avoid overly technical descriptions\n * description: 'SMTP 452 4.2.2 error' // Too technical\n * ```\n */\n description: string;\n\n /**\n * ISO 8601 timestamp when the problem was first detected.\n *\n * @example\n * ```typescript\n * createdAt: '2024-01-15T10:30:00Z'\n * createdAt: new Date().toISOString()\n * ```\n */\n createdAt: string;\n\n /**\n * Severity level indicating the problem's urgency and impact.\n *\n * Use severity to help users prioritize which problems to address first.\n *\n * @see {@link ProblemSeverity}\n */\n severity?: ProblemSeverity;\n\n /**\n * Current status in the problem's lifecycle.\n *\n * Status is provider-defined. Each provider can define their own status\n * values that make sense for their workflow (e.g., 'open', 'in-progress',\n * 'pending-retry', 'resolved').\n *\n * Status is optional. Some providers may choose to simply remove problems\n * when they're resolved rather than tracking status transitions.\n */\n status?: string;\n\n /**\n * Tags for additional categorization and filtering.\n *\n * Tags provide flexible categorization beyond the `type` field. They can\n * represent things like affected systems, error categories, or custom\n * classifications specific to your domain.\n *\n * @example\n * ```typescript\n * tags: ['email', 'bounce', 'permanent']\n * tags: ['sync', 'external-system', 'timeout']\n * tags: ['import', 'validation', 'required-field']\n * ```\n */\n tags?: string[];\n\n /**\n * Identifier of the user associated with this problem.\n *\n * This could be the user who triggered the action that failed, or the\n * user responsible for the affected data. The exact meaning depends on\n * the provider's context.\n */\n userId?: string;\n\n /**\n * Link to a related {@link LimeObject}.\n *\n * When a problem is directly related to a specific business object,\n * the context provides navigation and filtering capabilities.\n *\n * @see {@link ProblemContext}\n */\n context?: ProblemContext;\n\n /**\n * Technical error details for debugging.\n *\n * While `description` provides a user-friendly explanation, `error`\n * captures the underlying technical details. The platform may display\n * this in an expandable \"Technical Details\" section.\n *\n * @see {@link ProblemError}\n */\n error?: ProblemError;\n\n /**\n * Additional provider-specific data.\n *\n * Metadata allows providers to attach arbitrary data to problems that\n * may be useful for debugging, displaying additional details, or\n * powering actions. Values should be JSON-serializable.\n *\n * Use the generic type parameter to get type safety for your metadata.\n *\n * @example\n * ```typescript\n * metadata: {\n * originalEmailId: 'msg-123',\n * recipientEmail: 'john@example.com',\n * bounceType: 'permanent',\n * smtpCode: 550\n * }\n * ```\n */\n metadata?: T;\n\n /**\n * ISO 8601 timestamp when the problem was last modified.\n *\n * Updated when status changes, metadata is modified, or any other\n * property is updated after initial creation.\n */\n updatedAt?: string;\n}\n","import { PlatformServiceName } from '../core/platform';\nimport { ProblemRepository as Service } from './repository';\n\nconst SERVICE_NAME = 'problemRepository';\n\nPlatformServiceName.ProblemRepository = SERVICE_NAME;\n\ndeclare module '../core/platform' {\n interface PlatformServiceNameType {\n /**\n * @see {@link Service | ProblemRepository}\n */\n ProblemRepository: typeof SERVICE_NAME;\n }\n interface LimeWebComponentPlatform {\n get(name: PlatformServiceNameType['ProblemRepository']): Service;\n }\n}\n","import { PlatformServiceName } from '../core/platform';\nimport { AIContextRegistry as Service } from './ai-context-registry';\n\nconst SERVICE_NAME = 'aiContextRegistry';\n\nPlatformServiceName.AIContextRegistry = SERVICE_NAME;\n\ndeclare module '../core/platform' {\n interface PlatformServiceNameType {\n /**\n * @see {@link Service | AIContextRegistry}\n */\n AIContextRegistry: typeof SERVICE_NAME;\n }\n interface LimeWebComponentPlatform {\n get(name: PlatformServiceNameType['AIContextRegistry']): Service;\n }\n}\n","import { createLogger, Logger } from '../logger';\nimport { setErrorHandler } from '@stencil/core';\n\nlet logger: Logger | null = null;\n\n/**\n * Global error handler for uncaught errors in Stencil components.\n * Logs the error using the Lime platform's logging system.\n *\n * @remarks\n * This function is registered as the global error handler for Stencil\n * components to capture uncaught errors and log them appropriately.\n *\n * @param err - The uncaught error object\n * @param element - The Stencil component element where the error occurred\n *\n * @internal\n */\nexport function errorHandler(err: unknown, element?: HTMLElement) {\n if (!logger) {\n logger = createLogger('uncaught-error');\n }\n\n const data: Record<string, unknown> = {};\n\n if (element) {\n data.element = element.tagName;\n if (element.id) {\n data.elementId = element.id;\n }\n }\n\n const message = err instanceof Error ? err.message : String(err);\n const error = err instanceof Error ? err : undefined;\n\n logger.error(message, error, data);\n}\n\ntry {\n // Sets up a global error handler for uncaught errors in Stencil components.\n setErrorHandler(errorHandler);\n} catch {\n // Ignore errors if Stencil core is not available\n}\n"],"names":["PlatformServiceName","IdleStateEventName","isRelation","property","isSingleRelation","isDate","isString","isFloat","SERVICE_NAME","extendStatics","d","b","p","__extends","__","__values","o","s","m","i","__read","n","r","ar","e","error","__spreadArray","to","from","pack","l","isFunction","value","createErrorClass","createImpl","_super","instance","ctorFunc","UnsubscriptionError","errors","err","arrRemove","arr","item","index","Subscription","initialTeardown","e_1","_a","e_2","_b","_parentage","_parentage_1","_parentage_1_1","parent_1","e_1_1","initialFinalizer","_finalizers","_finalizers_1","_finalizers_1_1","finalizer","execFinalizer","e_2_1","teardown","parent","empty","EMPTY_SUBSCRIPTION","isSubscription","config","timeoutProvider","handler","timeout","args","_i","handle","reportUnhandledError","noop","errorContext","cb","Subscriber","destination","_this","EMPTY_OBSERVER","next","complete","SafeSubscriber","ConsumerObserver","partialObserver","handleUnhandledError","observerOrNext","defaultErrorHandler","observable","identity","x","pipeFromArray","fns","input","prev","fn","Observable","subscribe","operator","subscriber","isSubscriber","source","sink","promiseCtor","getPromiseCtor","resolve","reject","Symbol_observable","operations","isObserver","ObjectUnsubscribedError","Subject","subject","AnonymousSubject","_c","observer","observers","hasError","isStopped","thrownError","BehaviorSubject","_value","subscription","defaultOptionFactory","options","createStateDecorator","target","properties","getComponentProperties","extendLifecycleMethods","componentProperties","componentSubscriptions","connectedComponents","component","createConnectedCallback","createComponentWillLoad","createDisconnectedCallback","original","ensureLimeProps","watchProp","isContextAware","result","unsubscribeAll","promises","waitForProp","element","getElement","get","set","createSubscription","subscriptions","unsubscribe","mapState","state","myOptions","bindFunctions","name","platform","scope","func","SelectLimeTypes","SelectCurrentLimeType","currentLimetype","limetypes","limetype","findLimetypeByLabel","label","hasLabel","getPropertiesByType","type","getPropertyByLabel","getPropertyByName","propertyName","object","SelectLimeObjects","createOptions","SelectCurrentLimeObject","currentLimeobject","limeobjects","id","CommandEventName","Command","commandClass","setCommandId","setHasInstance","getCommandIds","getCommandId","ids","COMMAND_ID","BulkCreateDialogCommand","__decorateClass","CreateLimeobjectDialogCommand","DeleteObjectCommand","OpenObjectAccessDialogCommand","SaveLimeObjectCommand","Operator","AggregateOperator","HttpMethod","SelectQueryParam","NavigateCommand","TaskState","TaskEventType","SelectConfig","SelectDevice","SelectFilters","SelectUserData","SelectApplicationName","getApplicationName","applicationData","SelectCurrentUser","getCurrentUser","SelectSession","getSession","isLimeObjectCondition","condition","isActionCondition","LogLevel","scriptUrl","packageName","createLogger","factory","getPackageNameFromUrl","getCurrentScriptUrl","getUrlFromErrorStack","stack","stackLines","line","match","url","rawName","extractFromLwcComponentsPath","extractFromPackagesPath","extractFromPlusVersion","extractFromStaticPath","pattern","packagesPattern","plusIndex","beforePlus","lastSlash","staticPattern","ProblemSeverity","logger","errorHandler","data","message","setErrorHandler"],"mappings":";AAuKO,MAAMA,IAA+C;AAAA,EACxD,OAAO;AACX,GC/IaC,KAAqB;ACoE3B,SAASC,GAAWC,GAAwB;AAQ/C,SAAOA,KAP2B;AAAA,IAC9B;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,EAGyB,SAASA,EAAS,IAAI;AACvD;AAYO,SAASC,GAAiBD,GAAwB;AAGrD,SAAOA,KAF2B,CAAC,aAAa,QAAQ,EAE3B,SAASA,EAAS,IAAI;AACvD;AAaO,SAASE,GAAOF,GAAwB;AAU3C,SAAOA,KAT2B;AAAA,IAC9B;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,EAGyB,SAASA,EAAS,IAAI;AACvD;AAYO,SAASG,GAASH,GAAwB;AAG7C,SAAOA,KAF2B,CAAC,UAAU,QAAQ,SAAS,MAAM,EAEvC,SAASA,EAAS,IAAI;AACvD;AAYO,SAASI,GAAQJ,GAAwB;AAG5C,SAAOA,KAF2B,CAAC,WAAW,SAAS,EAE1B,SAASA,EAAS,IAAI;AACvD;AC5KA,MA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