{"version":3,"file":"fundamental-ngx-ui5-webcomponents-ai-button-state.mjs","sources":["../../../../libs/ui5-webcomponents-ai/button-state/index.ts","../../../../libs/ui5-webcomponents-ai/button-state/fundamental-ngx-ui5-webcomponents-ai-button-state.ts"],"sourcesContent":["\nimport {\n  ChangeDetectionStrategy,\n  Component,\n  ElementRef,\n  input,\n  output,\n  AfterViewInit,\n  effect,\n  runInInjectionContext,\n  inject,\n  Injector,\n  booleanAttribute,\n  computed,\n  signal\n} from '@angular/core';\nimport '@ui5/webcomponents-ai/dist/ButtonState.js';\nimport { default as _ButtonState } from '@ui5/webcomponents-ai/dist/ButtonState.js';\nimport { UI5CustomEvent } from '@ui5/webcomponents-base';\nimport {\n  ContentDensityObserver,\n  contentDensityObserverProviders,\n  ContentDensityMode\n} from '@fundamental-ngx/core/content-density';\n\n\n\n\n@Component({\n  standalone: true,\n  selector: 'ui5-ai-button-state, [ui5-ai-button-state]',\n  template: '<ng-content></ng-content>',\n  exportAs: 'ui5ButtonState',\n  providers: [\n    contentDensityObserverProviders({\n      supportedContentDensity: [ContentDensityMode.COMPACT, ContentDensityMode.COZY]\n    })\n  ],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ButtonState implements AfterViewInit {\n\n  /**\n   * Defines the icon to be displayed as graphical element within the component after the text.\nThe SAP-icons font provides numerous options.\n\n**Example:**\n\nSee all the available icons in the [Icon Explorer](https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html).\n   */\n  endIcon = input<typeof _ButtonState.prototype.endIcon | undefined>();\n\n  /**\n   * Defines the icon to be displayed as graphical element within the component before the text.\nThe SAP-icons font provides numerous options.\n\n**Example:**\n\nSee all the available icons in the [Icon Explorer](https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html).\n   */\n  icon = input<typeof _ButtonState.prototype.icon | undefined>();\n\n  /**\n   * Defines the name of the button state.\n   */\n  name = input<typeof _ButtonState.prototype.name | undefined>();\n\n  /**\n   * Defines if the component is in split button mode.\n   */\n  showArrowButton = input(false, { transform: booleanAttribute });\n\n  /**\n   * Defines the text of the button in this state.\n   */\n  text = input<typeof _ButtonState.prototype.text | undefined>(); // className is now passed\n\n\n\n\n\n  public elementRef: ElementRef<_ButtonState> = inject(ElementRef);\n  public injector = inject(Injector);\n\n  /**\n   * Content density observer is injected to activate automatic CSS class and\n   * UI5 attribute application. The observer self-initializes, no explicit subscribe() needed.\n   * @private\n   */\n  private readonly _contentDensityObserver = inject(ContentDensityObserver);\n\n  get element(): _ButtonState {\n    return this.elementRef.nativeElement;\n  }\n\n  ngAfterViewInit(): void {\n    const wcElement = this.element;\n    \n    const inputsToSync = [\n      'endIcon',\n      'icon',\n      'name',\n      'showArrowButton',\n      'text',\n    ];\n    \n    // Synchronize inputs (properties)\n    for (const inputName of inputsToSync) {\n      // Find the corresponding camelCase signal property on the Angular component\n      const signalName = inputName.replace(/-./g, (x: string) => x[1].toUpperCase());\n\n      // Use the Injector to run the effect in the correct context\n      if (this[signalName] && typeof this[signalName] === 'function') {\n        runInInjectionContext(this.injector, (): void => {\n          effect((): void => {\n            // Read the signal value\n            const value = this[signalName]();\n            if (wcElement) {\n              // Skip writes when the signal is undefined and the property is already truthy\n              // This prevents clobbering imperatively-set values (e.g., from RouterLink)\n              if (value === undefined && wcElement[inputName]) {\n                return;\n              }\n              // Write the value to the Web Component's property\n              wcElement[inputName] = value;\n            }\n          });\n        });\n      }\n    }\n  \n    \n    \n\n  }\n}\n\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAwCa,WAAW,CAAA;AAZxB,IAAA,WAAA,GAAA;AAcE;;;;;;;AAOG;AACH,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK;+FAAqD;AAEpE;;;;;;;AAOG;AACH,QAAA,IAAA,CAAA,IAAI,GAAG,KAAK;4FAAkD;AAE9D;;AAEG;AACH,QAAA,IAAA,CAAA,IAAI,GAAG,KAAK;4FAAkD;AAE9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