import { MiniProgramCoreFactory as MiniProgramCoreFactory$1 } from 'angular-miniprogram/platform/default';
export { ComponentFinderService, MiniProgramRenderer, MiniProgramRendererFactory, PAGE_TOKEN, pageBind, propertyChange } from 'angular-miniprogram/platform/default';

/* eslint-disable @typescript-eslint/no-explicit-any */
class MiniProgramCoreFactory extends MiniProgramCoreFactory$1 {
    constructor() {
        super(...arguments);
        this.eventPrefixList = [
            { listener: 'on', prefix: 'on' },
            { listener: 'catch', prefix: 'catch' },
        ];
    }
    getListenerEventMapping(prefix, name) {
        const upperName = name[0].toLocaleUpperCase() + name.substr(1);
        const isOn = prefix === 'on';
        return [
            name,
            prefix + name,
            prefix + upperName,
            ...(isOn
                ? [
                    'mut-bind' + name,
                    'capture-bind' + name,
                    'bind' + name,
                    'mut-bind' + upperName,
                    'capture-bind' + upperName,
                    'bind' + upperName,
                ]
                : ['capture-catch' + name, 'capture-catch' + upperName]),
        ];
    }
    addNgComponentLinkLogic(config) {
        const _this = this;
        config.props = {
            nodePath: undefined,
            nodeIndex: undefined,
        };
        let addWait = false;
        const oldOnInit = config.onInit;
        config.onInit = function () {
            let resolveFunction;
            this.__waitLinkPromise = new Promise((resolve) => (resolveFunction = resolve));
            this.__waitLinkResolve = resolveFunction;
            addWait = true;
            if (oldOnInit) {
                oldOnInit.bind(this)();
            }
        };
        const oldDidMount = config.didMount;
        config.didMount = function () {
            if (!addWait) {
                addWait = true;
                let resolveFunction;
                this.__waitLinkPromise = new Promise((resolve) => (resolveFunction = resolve));
                this.__waitLinkResolve = resolveFunction;
            }
            const nodePath = (this.props.nodePath || []).map((item) => (item === 'directive' ? item : parseInt(item, 10)));
            const nodeIndex = parseInt(this.props.nodeIndex, 10);
            if (this.__isLink) {
                return;
            }
            this.__completePath = [...nodePath, nodeIndex];
            _this.linkNgComponentWithPath(this, this.__completePath);
            if (oldDidMount) {
                oldDidMount.bind(this)();
            }
        };
        return config;
    }
}
const MiniProgramCore = new MiniProgramCoreFactory();

/**
 * Generated bundle index. Do not edit.
 */

;

export { MiniProgramCore };
//# sourceMappingURL=angular-miniprogram-platform-zfb.mjs.map
