{"version":3,"file":"oiz-stzh-components-angular-stzh-audio.mjs","sources":["../../../projects/stzh-components-angular/stzh-audio/src/angular-component-lib/utils.ts","../../../projects/stzh-components-angular/stzh-audio/src/stzh-audio.ts","../../../projects/stzh-components-angular/stzh-audio/src/oiz-stzh-components-angular-stzh-audio.ts"],"sourcesContent":["/* eslint-disable */\n/* tslint:disable */\nimport { fromEvent } from 'rxjs';\n\nexport const proxyInputs = (Cmp: any, inputs: string[]) => {\n  const Prototype = Cmp.prototype;\n  inputs.forEach((item) => {\n    Object.defineProperty(Prototype, item, {\n      get() {\n        return this.el[item];\n      },\n      set(val: any) {\n        this.z.runOutsideAngular(() => (this.el[item] = val));\n      },\n      /**\n       * In the event that proxyInputs is called\n       * multiple times re-defining these inputs\n       * will cause an error to be thrown. As a result\n       * we set configurable: true to indicate these\n       * properties can be changed.\n       */\n      configurable: true,\n    });\n  });\n};\n\nexport const proxyMethods = (Cmp: any, methods: string[]) => {\n  const Prototype = Cmp.prototype;\n  methods.forEach((methodName) => {\n    Prototype[methodName] = function () {\n      const args = arguments;\n      return this.z.runOutsideAngular(() => this.el[methodName].apply(this.el, args));\n    };\n  });\n};\n\nexport const proxyOutputs = (instance: any, el: any, events: string[]) => {\n  events.forEach((eventName) => (instance[eventName] = fromEvent(el, eventName)));\n};\n\nexport const defineCustomElement = (tagName: string, customElement: any) => {\n  if (customElement !== undefined && typeof customElements !== 'undefined' && !customElements.get(tagName)) {\n    customElements.define(tagName, customElement);\n  }\n};\n\n// tslint:disable-next-line: only-arrow-functions\nexport function ProxyCmp(opts: { defineCustomElementFn?: () => void; inputs?: any; methods?: any }) {\n  const decorator = function (cls: any) {\n    const { defineCustomElementFn, inputs, methods } = opts;\n\n    if (defineCustomElementFn !== undefined) {\n      defineCustomElementFn();\n    }\n\n    if (inputs) {\n      proxyInputs(cls, inputs);\n    }\n    if (methods) {\n      proxyMethods(cls, methods);\n    }\n    return cls;\n  };\n  return decorator;\n}\n","import { initializeStzhComponents } from '@oiz/stzh-components/components/runtime.js';\n\ninitializeStzhComponents();\n\n/* tslint:disable */\n/* auto-generated angular directive proxies */\nimport { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, NgZone, EventEmitter, Output, NgModule } from '@angular/core';\n\nimport { ProxyCmp } from './angular-component-lib/utils';\n\nimport type { Components } from '@oiz/stzh-components/components';\n\nimport { defineCustomElement as defineStzhAudio } from '@oiz/stzh-components/components/stzh-audio.js';\n\n@ProxyCmp({\n  defineCustomElementFn: defineStzhAudio,\n  inputs: ['downloadAnalyticsId', 'localization', 'preload', 'src', 'transcript', 'transcriptAnalyticsId', 'transcriptShown'],\n  methods: ['play', 'pause']\n})\n@Component({\n  selector: 'stzh-audio',\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  template: '<ng-content></ng-content>',\n  // eslint-disable-next-line @angular-eslint/no-inputs-metadata-property\n  inputs: ['downloadAnalyticsId', 'localization', 'preload', 'src', 'transcript', 'transcriptAnalyticsId', 'transcriptShown'],\n  outputs: ['stzhPlay', 'stzhPlaying', 'stzhPause', 'stzhReplay', 'stzhEnd', 'stzhEnded', 'stzhError'],\n  standalone: false\n})\nexport class StzhAudio {\n  protected el: HTMLStzhAudioElement;\n  @Output() stzhPlay = new EventEmitter<StzhAudioCustomEvent<IStzhAudioStzhAudioPlayEvent>>();\n  @Output() stzhPlaying = new EventEmitter<StzhAudioCustomEvent<IStzhAudioStzhAudioPlayingEvent>>();\n  @Output() stzhPause = new EventEmitter<StzhAudioCustomEvent<IStzhAudioStzhAudioPauseEvent>>();\n  @Output() stzhReplay = new EventEmitter<StzhAudioCustomEvent<IStzhAudioStzhAudioReplayEvent>>();\n  @Output() stzhEnd = new EventEmitter<StzhAudioCustomEvent<IStzhAudioStzhAudioEndEvent>>();\n  @Output() stzhEnded = new EventEmitter<StzhAudioCustomEvent<IStzhAudioStzhAudioEndedEvent>>();\n  @Output() stzhError = new EventEmitter<StzhAudioCustomEvent<IStzhAudioStzhAudioErrorEvent>>();\n  constructor(c: ChangeDetectorRef, r: ElementRef, protected z: NgZone) {\n    c.detach();\n    this.el = r.nativeElement;\n  }\n}\n\n\n@NgModule({\n  declarations: [StzhAudio],\n  imports: [],\n  exports: [StzhAudio],\n})\nexport class StzhAudioModule {}\n\n\nimport type { StzhAudioCustomEvent } from '@oiz/stzh-components/components';\nimport type { StzhAudioPlayEvent as IStzhAudioStzhAudioPlayEvent } from '@oiz/stzh-components/components';\nimport type { StzhAudioPlayingEvent as IStzhAudioStzhAudioPlayingEvent } from '@oiz/stzh-components/components';\nimport type { StzhAudioPauseEvent as IStzhAudioStzhAudioPauseEvent } from '@oiz/stzh-components/components';\nimport type { StzhAudioReplayEvent as IStzhAudioStzhAudioReplayEvent } from '@oiz/stzh-components/components';\nimport type { StzhAudioEndEvent as IStzhAudioStzhAudioEndEvent } from '@oiz/stzh-components/components';\nimport type { StzhAudioEndedEvent as IStzhAudioStzhAudioEndedEvent } from '@oiz/stzh-components/components';\nimport type { StzhAudioErrorEvent as IStzhAudioStzhAudioErrorEvent } from '@oiz/stzh-components/components';\n\nexport declare interface StzhAudio extends Components.StzhAudio {\n  /**\n   * Fired when the paused property is changed from true to false, as a result of the play() method, or the autoplay attribute.\n   */\n  stzhPlay: EventEmitter<StzhAudioCustomEvent<IStzhAudioStzhAudioPlayEvent>>;\n  /**\n   * Fired when playback is ready to start after having been paused or delayed due to lack of data.\n   */\n  stzhPlaying: EventEmitter<StzhAudioCustomEvent<IStzhAudioStzhAudioPlayingEvent>>;\n  /**\n   * Fired when a request to pause an activity is handled and the activity has entered its paused state, most commonly after the media has been paused through a call to the pause() method.\n   */\n  stzhPause: EventEmitter<StzhAudioCustomEvent<IStzhAudioStzhAudioPauseEvent>>;\n  /**\n   * Fired when media playback starts again after being in an ended state. This is fired when the loop property is true and media loops, whereas the vds-play event is not.\n   */\n  stzhReplay: EventEmitter<StzhAudioCustomEvent<IStzhAudioStzhAudioReplayEvent>>;\n  /**\n   * Fired each time media playback has reached the end. This is fired even if the loop property is true, which is generally when you'd reach for this event over the MediaEndedEvent if you want to be notified of media looping.\n   */\n  stzhEnd: EventEmitter<StzhAudioCustomEvent<IStzhAudioStzhAudioEndEvent>>;\n  /**\n   * Fired when playback or streaming has stopped because the end of the media was reached or because no further data is available. This is not fired if playback will start from the beginning again due to the loop property being true (see MediaReplayEvent and MediaEndEvent).\n   */\n  stzhEnded: EventEmitter<StzhAudioCustomEvent<IStzhAudioStzhAudioEndedEvent>>;\n  /**\n   * Fired when media loading or playback has encountered any issues (for example, a network connectivity problem). The event detail contains a potential message containing more information about the error (empty string if nothing available), and a code that identifies the general type of error that occurred.\n   */\n  stzhError: EventEmitter<StzhAudioCustomEvent<IStzhAudioStzhAudioErrorEvent>>;\n}\n\n\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["defineStzhAudio"],"mappings":";;;;;;;;AAAA;AACA;AAGO,MAAM,WAAW,GAAG,CAAC,GAAQ,EAAE,MAAgB,KAAI;AACxD,IAAA,MAAM,SAAS,GAAG,GAAG,CAAC,SAAS;AAC/B,IAAA,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,KAAI;AACtB,QAAA,MAAM,CAAC,cAAc,CAAC,SAAS,EAAE,IAAI,EAAE;YACrC,GAAG,GAAA;AACD,gBAAA,OAAO,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC;YACtB,CAAC;AACD,YAAA,GAAG,CAAC,GAAQ,EAAA;AACV,gBAAA,IAAI,CAAC,CAAC,CAAC,iBAAiB,CAAC,OAAO,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC;YACvD,CAAC;AACD;;;;;;AAMG;AACH,YAAA,YAAY,EAAE,IAAI;AACnB,SAAA,CAAC;AACJ,IAAA,CAAC,CAAC;AACJ,CAAC;AAEM,MAAM,YAAY,GAAG,CAAC,GAAQ,EAAE,OAAiB,KAAI;AAC1D,IAAA,MAAM,SAAS,GAAG,GAAG,CAAC,SAAS;AAC/B,IAA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