/* eslint-disable @typescript-eslint/no-unused-vars */
let ctor;
if (typeof CustomEvent === 'function') {
    ctor = CustomEvent;
}
else {
    const detailSymbol = Symbol('detail');
    ctor = class CustomEvent extends Event {
        [detailSymbol];
        get detail() {
            return this[detailSymbol];
        }
        constructor(type, eventInitDict) {
            super(type, eventInitDict);
            if (eventInitDict && eventInitDict.detail) {
                this[detailSymbol] = eventInitDict.detail;
            }
            else {
                // @ts-expect-error By default the `CustomEvent` sets null when nothing is passed.
                this[detailSymbol] = null;
            }
        }
        initCustomEvent(type, bubbles, cancelable, detail) {
            throw new Error(`This is deprecated. Do not use this function.`);
        }
    };
}
export default ctor;
//# sourceMappingURL=CustomEvent.js.map