import { efContext } from "./efContext.js";
import { playingContext } from "./playingContext.js";
import { __decorate } from "../_virtual/_@oxc-project_runtime@0.95.0/helpers/decorate.js";
import { attachContextRoot } from "../attachContextRoot.js";
import { TargetOrContextMixin } from "./TargetOrContextMixin.js";
import { consume } from "@lit/context";
import { LitElement, css, html } from "lit";
import { customElement, state } from "lit/decorators.js";

//#region src/gui/EFPause.ts
attachContextRoot();
let EFPause = class EFPause$1 extends TargetOrContextMixin(LitElement, efContext) {
	constructor(..._args) {
		super(..._args);
		this.playing = false;
		this.handleClick = () => {
			if (this.efContext) this.efContext.pause();
		};
	}
	static {
		this.styles = [css`
      :host {
        display: block;
      }
      :host([hidden]) {
        display: none;
      }
      div {
        all: inherit;
      }
    `];
	}
	get efContext() {
		return this.effectiveContext;
	}
	connectedCallback() {
		super.connectedCallback();
		this.addEventListener("click", this.handleClick);
	}
	disconnectedCallback() {
		super.disconnectedCallback();
		this.removeEventListener("click", this.handleClick);
	}
	updated(changedProperties) {
		super.updated(changedProperties);
		if (changedProperties.has("playing")) this.style.display = this.playing ? "" : "none";
	}
	render() {
		return html`
      <div>
        <slot></slot>
      </div>
    `;
	}
};
__decorate([consume({
	context: playingContext,
	subscribe: true
}), state()], EFPause.prototype, "playing", void 0);
EFPause = __decorate([customElement("ef-pause")], EFPause);

//#endregion
export { EFPause };
//# sourceMappingURL=EFPause.js.map