@cyberskill/shared 1.65.0 → 1.67.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_tsup-dts-rollup.d.cts +341 -437
- package/dist/_tsup-dts-rollup.d.ts +341 -437
- package/dist/configs/config.util.cjs +1 -0
- package/dist/configs/config.util.d.cts +1 -0
- package/dist/configs/config.util.d.ts +1 -0
- package/dist/configs/config.util.js +1 -0
- package/dist/configs/graphql/graphql-codegen.type.d.cts +1 -0
- package/dist/configs/graphql/graphql-codegen.type.d.ts +1 -0
- package/dist/configs/graphql/graphql-codegen.util.cjs +1 -0
- package/dist/configs/graphql/graphql-codegen.util.js +1 -0
- package/dist/configs/graphql/index.cjs +1 -1
- package/dist/configs/graphql/index.d.cts +1 -0
- package/dist/configs/graphql/index.d.ts +1 -0
- package/dist/configs/graphql/index.js +1 -1
- package/dist/configs/index.cjs +1 -1
- package/dist/configs/index.d.cts +4 -1
- package/dist/configs/index.d.ts +4 -1
- package/dist/configs/index.js +1 -1
- package/dist/constants/index.cjs +1 -1
- package/dist/constants/index.d.cts +1 -43
- package/dist/constants/index.d.ts +1 -43
- package/dist/constants/index.js +1 -1
- package/dist/constants/nodejs.d.cts +1 -0
- package/dist/constants/nodejs.d.ts +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +115 -109
- package/dist/index.d.ts +115 -109
- package/dist/index.js +1 -1
- package/dist/nodejs/cli/cli.constant.d.cts +1 -0
- package/dist/nodejs/cli/cli.constant.d.ts +1 -0
- package/dist/nodejs/cli/cli.util.cjs +2 -0
- package/dist/nodejs/cli/cli.util.js +2 -0
- package/dist/nodejs/cli/index.cjs +1 -0
- package/dist/nodejs/cli/index.d.cts +1 -0
- package/dist/nodejs/cli/index.d.ts +1 -0
- package/dist/nodejs/cli/index.js +1 -0
- package/dist/nodejs/command/command.type.cjs +1 -0
- package/dist/nodejs/command/command.type.d.cts +8 -0
- package/dist/nodejs/command/command.type.d.ts +8 -0
- package/dist/nodejs/command/command.type.js +1 -0
- package/dist/nodejs/command/command.util.cjs +1 -0
- package/dist/nodejs/command/command.util.d.cts +6 -0
- package/dist/nodejs/command/command.util.d.ts +6 -0
- package/dist/nodejs/command/command.util.js +1 -0
- package/dist/nodejs/command/index.cjs +1 -0
- package/dist/nodejs/command/index.d.cts +14 -0
- package/dist/nodejs/command/index.d.ts +14 -0
- package/dist/nodejs/command/index.js +1 -0
- package/dist/nodejs/fs/fs.util.d.cts +5 -0
- package/dist/nodejs/fs/fs.util.d.ts +5 -0
- package/dist/nodejs/fs/index.cjs +1 -0
- package/dist/nodejs/fs/index.d.cts +5 -0
- package/dist/nodejs/fs/index.d.ts +5 -0
- package/dist/nodejs/fs/index.js +1 -0
- package/dist/nodejs/index.cjs +1 -1
- package/dist/nodejs/index.d.cts +136 -0
- package/dist/nodejs/index.d.ts +136 -0
- package/dist/nodejs/index.js +1 -1
- package/dist/nodejs/log/index.cjs +1 -0
- package/dist/nodejs/log/index.d.cts +6 -0
- package/dist/nodejs/log/index.d.ts +6 -0
- package/dist/nodejs/log/index.js +1 -0
- package/dist/nodejs/log/log.type.cjs +1 -0
- package/dist/nodejs/log/log.type.d.cts +4 -0
- package/dist/nodejs/log/log.type.d.ts +4 -0
- package/dist/nodejs/log/log.type.js +1 -0
- package/dist/nodejs/log/log.util.d.cts +2 -0
- package/dist/nodejs/log/log.util.d.ts +2 -0
- package/dist/nodejs/mongo/index.cjs +1 -0
- package/dist/nodejs/mongo/index.d.cts +64 -0
- package/dist/nodejs/mongo/index.d.ts +64 -0
- package/dist/nodejs/mongo/index.js +1 -0
- package/dist/nodejs/mongo/mongo.d.cts +5 -0
- package/dist/nodejs/mongo/mongo.d.ts +5 -0
- package/dist/nodejs/mongo/mongo.type.d.cts +59 -0
- package/dist/nodejs/mongo/mongo.type.d.ts +59 -0
- package/dist/nodejs/package/index.cjs +1 -0
- package/dist/nodejs/package/index.d.cts +7 -0
- package/dist/nodejs/package/index.d.ts +7 -0
- package/dist/nodejs/package/index.js +1 -0
- package/dist/nodejs/package/package.constant.d.cts +1 -0
- package/dist/nodejs/package/package.constant.d.ts +1 -0
- package/dist/nodejs/package/package.type.d.cts +3 -0
- package/dist/nodejs/package/package.type.d.ts +3 -0
- package/dist/nodejs/package/package.util.cjs +1 -0
- package/dist/nodejs/package/package.util.d.cts +3 -0
- package/dist/nodejs/package/package.util.d.ts +3 -0
- package/dist/nodejs/package/package.util.js +1 -0
- package/dist/nodejs/path/index.cjs +1 -0
- package/dist/nodejs/path/index.d.cts +43 -0
- package/dist/nodejs/path/index.d.ts +43 -0
- package/dist/nodejs/path/index.js +1 -0
- package/dist/nodejs/path/path.constant.cjs +1 -0
- package/dist/nodejs/path/path.constant.d.cts +40 -0
- package/dist/nodejs/path/path.constant.d.ts +40 -0
- package/dist/nodejs/path/path.constant.js +1 -0
- package/dist/nodejs/path/path.util.cjs +1 -0
- package/dist/nodejs/path/path.util.d.cts +3 -0
- package/dist/nodejs/path/path.util.d.ts +3 -0
- package/dist/nodejs/path/path.util.js +1 -0
- package/dist/nodejs/storage/index.cjs +1 -0
- package/dist/nodejs/storage/index.d.cts +1 -0
- package/dist/nodejs/storage/index.d.ts +1 -0
- package/dist/nodejs/storage/index.js +1 -0
- package/dist/nodejs/storage/storage.util.cjs +1 -0
- package/dist/nodejs/storage/storage.util.d.cts +1 -0
- package/dist/nodejs/storage/storage.util.d.ts +1 -0
- package/dist/nodejs/storage/storage.util.js +1 -0
- package/dist/react/apollo-client/apollo-client.component.cjs +1 -0
- package/dist/react/apollo-client/apollo-client.component.d.cts +1 -0
- package/dist/react/apollo-client/apollo-client.component.d.ts +1 -0
- package/dist/react/apollo-client/apollo-client.component.js +1 -0
- package/dist/react/apollo-client/apollo-client.constant.d.cts +1 -0
- package/dist/react/apollo-client/apollo-client.constant.d.ts +1 -0
- package/dist/react/apollo-client/apollo-client.type.d.cts +5 -0
- package/dist/react/apollo-client/apollo-client.type.d.ts +5 -0
- package/dist/react/apollo-client/index.cjs +1 -0
- package/dist/react/apollo-client/index.d.cts +7 -0
- package/dist/react/apollo-client/index.d.ts +7 -0
- package/dist/react/apollo-client/index.js +1 -0
- package/dist/react/apollo-error/apollo-error.component.cjs +1 -0
- package/dist/react/apollo-error/apollo-error.component.d.cts +1 -0
- package/dist/react/apollo-error/apollo-error.component.d.ts +1 -0
- package/dist/react/apollo-error/apollo-error.component.js +1 -0
- package/dist/react/apollo-error/apollo-error.context.cjs +1 -0
- package/dist/react/apollo-error/apollo-error.context.d.cts +1 -0
- package/dist/react/apollo-error/apollo-error.context.d.ts +1 -0
- package/dist/react/apollo-error/apollo-error.context.js +1 -0
- package/dist/react/apollo-error/apollo-error.hook.cjs +1 -0
- package/dist/react/apollo-error/apollo-error.hook.d.cts +1 -0
- package/dist/react/apollo-error/apollo-error.hook.d.ts +1 -0
- package/dist/react/apollo-error/apollo-error.hook.js +1 -0
- package/dist/react/{apollo-error.module.scss → apollo-error/apollo-error.module.scss} +15 -15
- package/dist/react/apollo-error/apollo-error.provider.cjs +1 -0
- package/dist/react/apollo-error/apollo-error.provider.d.cts +2 -0
- package/dist/react/apollo-error/apollo-error.provider.d.ts +2 -0
- package/dist/react/apollo-error/apollo-error.provider.js +1 -0
- package/dist/react/apollo-error/apollo-error.type.d.cts +1 -0
- package/dist/react/apollo-error/apollo-error.type.d.ts +1 -0
- package/dist/react/apollo-error/index.cjs +1 -0
- package/dist/react/apollo-error/index.d.cts +6 -0
- package/dist/react/apollo-error/index.d.ts +6 -0
- package/dist/react/apollo-error/index.js +1 -0
- package/dist/react/i18next/i18next.d.cts +1 -0
- package/dist/react/i18next/i18next.d.ts +1 -0
- package/dist/react/i18next/index.d.cts +1 -0
- package/dist/react/i18next/index.d.ts +1 -0
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.d.cts +32 -11
- package/dist/react/index.d.ts +32 -11
- package/dist/react/index.js +1 -1
- package/dist/react/loading/index.cjs +1 -0
- package/dist/react/loading/index.d.cts +6 -0
- package/dist/react/loading/index.d.ts +6 -0
- package/dist/react/loading/index.js +1 -0
- package/dist/react/loading/loading.component.cjs +1 -0
- package/dist/react/loading/loading.component.d.cts +1 -0
- package/dist/react/loading/loading.component.d.ts +1 -0
- package/dist/react/loading/loading.component.js +1 -0
- package/dist/react/loading/loading.context.cjs +1 -0
- package/dist/react/loading/loading.context.d.cts +1 -0
- package/dist/react/loading/loading.context.d.ts +1 -0
- package/dist/react/loading/loading.context.js +1 -0
- package/dist/react/loading/loading.hook.cjs +1 -0
- package/dist/react/loading/loading.hook.d.cts +1 -0
- package/dist/react/loading/loading.hook.d.ts +1 -0
- package/dist/react/loading/loading.hook.js +1 -0
- package/dist/react/loading/loading.provider.cjs +1 -0
- package/dist/react/loading/loading.provider.d.cts +1 -0
- package/dist/react/loading/loading.provider.d.ts +1 -0
- package/dist/react/loading/loading.provider.js +1 -0
- package/dist/react/loading/loading.type.d.cts +2 -0
- package/dist/react/loading/loading.type.d.ts +2 -0
- package/dist/react/log/index.d.cts +2 -0
- package/dist/react/log/index.d.ts +2 -0
- package/dist/react/log/log.type.d.cts +1 -0
- package/dist/react/log/log.type.d.ts +1 -0
- package/dist/react/log/log.util.cjs +1 -0
- package/dist/react/log/log.util.d.cts +1 -0
- package/dist/react/log/log.util.d.ts +1 -0
- package/dist/react/log/log.util.js +1 -0
- package/dist/react/next-intl/index.cjs +1 -0
- package/dist/react/next-intl/index.d.cts +9 -0
- package/dist/react/next-intl/index.d.ts +9 -0
- package/dist/react/next-intl/index.js +1 -0
- package/dist/react/next-intl/next-intl.context.cjs +1 -0
- package/dist/react/next-intl/next-intl.context.d.cts +1 -0
- package/dist/react/next-intl/next-intl.context.d.ts +1 -0
- package/dist/react/next-intl/next-intl.context.js +1 -0
- package/dist/react/next-intl/next-intl.hoc.cjs +1 -0
- package/dist/react/next-intl/next-intl.hoc.d.cts +1 -0
- package/dist/react/next-intl/next-intl.hoc.d.ts +1 -0
- package/dist/react/next-intl/next-intl.hoc.js +1 -0
- package/dist/react/next-intl/next-intl.hook.cjs +1 -0
- package/dist/react/next-intl/next-intl.hook.d.cts +2 -0
- package/dist/react/next-intl/next-intl.hook.d.ts +2 -0
- package/dist/react/next-intl/next-intl.hook.js +1 -0
- package/dist/react/next-intl/next-intl.provider.cjs +1 -0
- package/dist/react/next-intl/next-intl.provider.d.cts +1 -0
- package/dist/react/next-intl/next-intl.provider.d.ts +1 -0
- package/dist/react/next-intl/next-intl.provider.js +1 -0
- package/dist/react/next-intl/next-intl.type.d.cts +4 -0
- package/dist/react/next-intl/next-intl.type.d.ts +4 -0
- package/dist/react/storage/index.cjs +1 -0
- package/dist/react/storage/index.d.cts +2 -0
- package/dist/react/storage/index.d.ts +2 -0
- package/dist/react/storage/index.js +1 -0
- package/dist/react/{storage.cjs → storage/storage.hook.cjs} +1 -1
- package/dist/react/storage/storage.hook.d.cts +1 -0
- package/dist/react/storage/storage.hook.d.ts +1 -0
- package/dist/react/{storage.js → storage/storage.hook.js} +1 -1
- package/dist/{utils/storage-client.cjs → react/storage/storage.util.cjs} +1 -1
- package/dist/react/storage/storage.util.d.cts +1 -0
- package/dist/react/storage/storage.util.d.ts +1 -0
- package/dist/{utils/storage-client.js → react/storage/storage.util.js} +1 -1
- package/dist/react/toast/index.cjs +1 -0
- package/dist/react/toast/index.d.cts +2 -0
- package/dist/react/toast/index.d.ts +2 -0
- package/dist/react/toast/index.js +1 -0
- package/dist/react/vitest/index.cjs +1 -0
- package/dist/react/vitest/index.d.cts +2 -0
- package/dist/react/vitest/index.d.ts +2 -0
- package/dist/react/vitest/index.js +1 -0
- package/dist/{configs/vitest/react/e2e.cjs → react/vitest/vitest.e2e.cjs} +1 -1
- package/dist/react/vitest/vitest.e2e.d.cts +1 -0
- package/dist/react/vitest/vitest.e2e.d.ts +1 -0
- package/dist/{configs/vitest/react/e2e.js → react/vitest/vitest.e2e.js} +1 -1
- package/dist/react/vitest/vitest.unit.cjs +1 -0
- package/dist/react/vitest/vitest.unit.d.cts +1 -0
- package/dist/react/vitest/vitest.unit.d.ts +1 -0
- package/dist/react/vitest/vitest.unit.js +1 -0
- package/dist/typescript/index.cjs +1 -1
- package/dist/typescript/index.d.cts +1 -92
- package/dist/typescript/index.d.ts +1 -92
- package/dist/typescript/index.js +0 -1
- package/dist/typescript/react.d.cts +1 -1
- package/dist/typescript/react.d.ts +1 -1
- package/dist/utils/common/common.util.cjs +1 -0
- package/dist/utils/common/common.util.d.cts +2 -0
- package/dist/utils/common/common.util.d.ts +2 -0
- package/dist/utils/common/common.util.js +1 -0
- package/dist/utils/common/index.cjs +1 -0
- package/dist/utils/common/index.d.cts +2 -0
- package/dist/utils/common/index.d.ts +2 -0
- package/dist/utils/common/index.js +1 -0
- package/dist/utils/index.cjs +1 -1
- package/dist/utils/index.d.cts +7 -7
- package/dist/utils/index.d.ts +7 -7
- package/dist/utils/index.js +1 -1
- package/dist/utils/object/index.cjs +1 -0
- package/dist/utils/object/index.d.cts +3 -0
- package/dist/utils/object/index.d.ts +3 -0
- package/dist/utils/object/index.js +1 -0
- package/dist/utils/object/object.util.cjs +1 -0
- package/dist/utils/object/object.util.d.cts +3 -0
- package/dist/utils/object/object.util.d.ts +3 -0
- package/dist/utils/object/object.util.js +1 -0
- package/dist/utils/serializer/index.d.cts +2 -0
- package/dist/utils/serializer/index.d.ts +2 -0
- package/dist/utils/serializer/serializer.type.d.cts +1 -0
- package/dist/utils/serializer/serializer.type.d.ts +1 -0
- package/dist/utils/serializer/serializer.util.cjs +1 -0
- package/dist/utils/serializer/serializer.util.d.cts +1 -0
- package/dist/utils/serializer/serializer.util.d.ts +1 -0
- package/dist/utils/serializer/serializer.util.js +1 -0
- package/dist/utils/string/index.d.cts +3 -0
- package/dist/utils/string/index.d.ts +3 -0
- package/dist/utils/string/index.js +1 -0
- package/dist/utils/string/string.type.d.cts +1 -0
- package/dist/utils/string/string.type.d.ts +1 -0
- package/dist/utils/string/string.util.cjs +1 -0
- package/dist/utils/string/string.util.d.cts +2 -0
- package/dist/utils/string/string.util.d.ts +2 -0
- package/dist/utils/validate/index.d.cts +1 -0
- package/dist/utils/validate/index.d.ts +1 -0
- package/dist/utils/validate/validate.util.cjs +1 -0
- package/dist/utils/validate/validate.util.d.cts +1 -0
- package/dist/utils/validate/validate.util.d.ts +1 -0
- package/dist/utils/validate/validate.util.js +1 -0
- package/package.json +96 -46
- package/dist/cli.cjs +0 -2
- package/dist/cli.js +0 -2
- package/dist/configs/graphql/graphql-codegen.cjs +0 -1
- package/dist/configs/graphql/graphql-codegen.js +0 -1
- package/dist/configs/i18n/react/i18next.d.cts +0 -1
- package/dist/configs/i18n/react/i18next.d.ts +0 -1
- package/dist/configs/i18n/react/index.d.cts +0 -1
- package/dist/configs/i18n/react/index.d.ts +0 -1
- package/dist/configs/vitest/react/e2e.d.cts +0 -1
- package/dist/configs/vitest/react/e2e.d.ts +0 -1
- package/dist/configs/vitest/react/unit.cjs +0 -1
- package/dist/configs/vitest/react/unit.d.cts +0 -1
- package/dist/configs/vitest/react/unit.d.ts +0 -1
- package/dist/configs/vitest/react/unit.js +0 -1
- package/dist/constants/cli.d.cts +0 -1
- package/dist/constants/cli.d.ts +0 -1
- package/dist/constants/common-nodejs.d.cts +0 -1
- package/dist/constants/common-nodejs.d.ts +0 -1
- package/dist/constants/graphql.d.cts +0 -1
- package/dist/constants/graphql.d.ts +0 -1
- package/dist/constants/package.d.cts +0 -1
- package/dist/constants/package.d.ts +0 -1
- package/dist/constants/path.cjs +0 -1
- package/dist/constants/path.d.cts +0 -39
- package/dist/constants/path.d.ts +0 -39
- package/dist/constants/path.js +0 -1
- package/dist/nodejs/mongo.d.cts +0 -5
- package/dist/nodejs/mongo.d.ts +0 -5
- package/dist/react/apollo-client.cjs +0 -1
- package/dist/react/apollo-client.d.cts +0 -1
- package/dist/react/apollo-client.d.ts +0 -1
- package/dist/react/apollo-client.js +0 -1
- package/dist/react/apollo-error.cjs +0 -1
- package/dist/react/apollo-error.d.cts +0 -5
- package/dist/react/apollo-error.d.ts +0 -5
- package/dist/react/apollo-error.js +0 -1
- package/dist/react/loading.cjs +0 -1
- package/dist/react/loading.d.cts +0 -4
- package/dist/react/loading.d.ts +0 -4
- package/dist/react/loading.js +0 -1
- package/dist/react/next-intl.cjs +0 -1
- package/dist/react/next-intl.d.cts +0 -5
- package/dist/react/next-intl.d.ts +0 -5
- package/dist/react/next-intl.js +0 -1
- package/dist/react/storage.d.cts +0 -1
- package/dist/react/storage.d.ts +0 -1
- package/dist/typescript/api-response.d.cts +0 -3
- package/dist/typescript/api-response.d.ts +0 -3
- package/dist/typescript/apollo-error.d.cts +0 -1
- package/dist/typescript/apollo-error.d.ts +0 -1
- package/dist/typescript/apollo.d.cts +0 -5
- package/dist/typescript/apollo.d.ts +0 -5
- package/dist/typescript/command.cjs +0 -1
- package/dist/typescript/command.d.cts +0 -10
- package/dist/typescript/command.d.ts +0 -10
- package/dist/typescript/command.js +0 -1
- package/dist/typescript/graphql-codegen.d.cts +0 -1
- package/dist/typescript/graphql-codegen.d.ts +0 -1
- package/dist/typescript/loading.d.cts +0 -1
- package/dist/typescript/loading.d.ts +0 -1
- package/dist/typescript/log.d.cts +0 -3
- package/dist/typescript/log.d.ts +0 -3
- package/dist/typescript/mongo.d.cts +0 -56
- package/dist/typescript/mongo.d.ts +0 -56
- package/dist/typescript/next-intl.d.cts +0 -3
- package/dist/typescript/next-intl.d.ts +0 -3
- package/dist/typescript/package.d.cts +0 -3
- package/dist/typescript/package.d.ts +0 -3
- package/dist/typescript/serializer.d.cts +0 -1
- package/dist/typescript/serializer.d.ts +0 -1
- package/dist/typescript/string.cjs +0 -1
- package/dist/typescript/string.d.cts +0 -1
- package/dist/typescript/string.d.ts +0 -1
- package/dist/typescript/string.js +0 -0
- package/dist/utils/command.cjs +0 -1
- package/dist/utils/command.d.cts +0 -6
- package/dist/utils/command.d.ts +0 -6
- package/dist/utils/command.js +0 -1
- package/dist/utils/common.cjs +0 -1
- package/dist/utils/common.d.cts +0 -5
- package/dist/utils/common.d.ts +0 -5
- package/dist/utils/common.js +0 -1
- package/dist/utils/fs.d.cts +0 -5
- package/dist/utils/fs.d.ts +0 -5
- package/dist/utils/index-nodejs.cjs +0 -1
- package/dist/utils/index-nodejs.d.cts +0 -22
- package/dist/utils/index-nodejs.d.ts +0 -22
- package/dist/utils/index-nodejs.js +0 -1
- package/dist/utils/log-nodejs.d.cts +0 -2
- package/dist/utils/log-nodejs.d.ts +0 -2
- package/dist/utils/log.d.cts +0 -1
- package/dist/utils/log.d.ts +0 -1
- package/dist/utils/package.cjs +0 -1
- package/dist/utils/package.d.cts +0 -3
- package/dist/utils/package.d.ts +0 -3
- package/dist/utils/package.js +0 -1
- package/dist/utils/path.cjs +0 -1
- package/dist/utils/path.d.cts +0 -3
- package/dist/utils/path.d.ts +0 -3
- package/dist/utils/path.js +0 -1
- package/dist/utils/serializer.d.cts +0 -1
- package/dist/utils/serializer.d.ts +0 -1
- package/dist/utils/storage-client.d.cts +0 -1
- package/dist/utils/storage-client.d.ts +0 -1
- package/dist/utils/storage-server.cjs +0 -1
- package/dist/utils/storage-server.d.cts +0 -3
- package/dist/utils/storage-server.d.ts +0 -3
- package/dist/utils/storage-server.js +0 -1
- package/dist/utils/string.d.cts +0 -2
- package/dist/utils/string.d.ts +0 -2
- package/dist/utils/validate.d.cts +0 -1
- package/dist/utils/validate.d.ts +0 -1
- /package/dist/configs/commitlint/{base.cjs → index.cjs} +0 -0
- /package/dist/configs/commitlint/{base.d.cts → index.d.cts} +0 -0
- /package/dist/configs/commitlint/{base.d.ts → index.d.ts} +0 -0
- /package/dist/configs/commitlint/{base.js → index.js} +0 -0
- /package/dist/{typescript/config.cjs → configs/config.type.cjs} +0 -0
- /package/dist/{typescript/config.d.cts → configs/config.type.d.cts} +0 -0
- /package/dist/{typescript/config.d.ts → configs/config.type.d.ts} +0 -0
- /package/dist/{typescript/config.js → configs/config.type.js} +0 -0
- /package/dist/configs/eslint/{base.cjs → index.cjs} +0 -0
- /package/dist/configs/eslint/{base.d.cts → index.d.cts} +0 -0
- /package/dist/configs/eslint/{base.d.ts → index.d.ts} +0 -0
- /package/dist/configs/eslint/{base.js → index.js} +0 -0
- /package/dist/{typescript/api-response.cjs → configs/graphql/graphql-codegen.type.cjs} +0 -0
- /package/dist/{typescript/api-response.js → configs/graphql/graphql-codegen.type.js} +0 -0
- /package/dist/configs/graphql/{graphql-codegen.d.cts → graphql-codegen.util.d.cts} +0 -0
- /package/dist/configs/graphql/{graphql-codegen.d.ts → graphql-codegen.util.d.ts} +0 -0
- /package/dist/configs/lint-staged/{base.cjs → index.cjs} +0 -0
- /package/dist/configs/lint-staged/{base.d.cts → index.d.cts} +0 -0
- /package/dist/configs/lint-staged/{base.d.ts → index.d.ts} +0 -0
- /package/dist/configs/lint-staged/{base.js → index.js} +0 -0
- /package/dist/constants/{common-nodejs.cjs → nodejs.cjs} +0 -0
- /package/dist/constants/{common-nodejs.js → nodejs.js} +0 -0
- /package/dist/{constants/cli.cjs → nodejs/cli/cli.constant.cjs} +0 -0
- /package/dist/{constants/cli.js → nodejs/cli/cli.constant.js} +0 -0
- /package/dist/{cli.d.cts → nodejs/cli/cli.util.d.cts} +0 -0
- /package/dist/{cli.d.ts → nodejs/cli/cli.util.d.ts} +0 -0
- /package/dist/{utils/fs.cjs → nodejs/fs/fs.util.cjs} +0 -0
- /package/dist/{utils/fs.js → nodejs/fs/fs.util.js} +0 -0
- /package/dist/{utils/log-nodejs.cjs → nodejs/log/log.util.cjs} +0 -0
- /package/dist/{utils/log-nodejs.js → nodejs/log/log.util.js} +0 -0
- /package/dist/nodejs/{mongo.cjs → mongo/mongo.cjs} +0 -0
- /package/dist/nodejs/{mongo.js → mongo/mongo.js} +0 -0
- /package/dist/{typescript/mongo.cjs → nodejs/mongo/mongo.type.cjs} +0 -0
- /package/dist/{typescript/mongo.js → nodejs/mongo/mongo.type.js} +0 -0
- /package/dist/{constants/package.cjs → nodejs/package/package.constant.cjs} +0 -0
- /package/dist/{constants/package.js → nodejs/package/package.constant.js} +0 -0
- /package/dist/{typescript/apollo-error.cjs → nodejs/package/package.type.cjs} +0 -0
- /package/dist/{typescript/apollo-error.js → nodejs/package/package.type.js} +0 -0
- /package/dist/{constants/graphql.cjs → react/apollo-client/apollo-client.constant.cjs} +0 -0
- /package/dist/{constants/graphql.js → react/apollo-client/apollo-client.constant.js} +0 -0
- /package/dist/{typescript/apollo.cjs → react/apollo-client/apollo-client.type.cjs} +0 -0
- /package/dist/{typescript/apollo.js → react/apollo-client/apollo-client.type.js} +0 -0
- /package/dist/react/{apollo-error.module.d.cts → apollo-error/apollo-error.module.d.cts} +0 -0
- /package/dist/react/{apollo-error.module.d.ts → apollo-error/apollo-error.module.d.ts} +0 -0
- /package/dist/{typescript/graphql-codegen.cjs → react/apollo-error/apollo-error.type.cjs} +0 -0
- /package/dist/{typescript/graphql-codegen.js → react/apollo-error/apollo-error.type.js} +0 -0
- /package/dist/{configs/i18n/react → react/i18next}/i18next.cjs +0 -0
- /package/dist/{configs/i18n/react → react/i18next}/i18next.js +0 -0
- /package/dist/{configs/i18n/react → react/i18next}/index.cjs +0 -0
- /package/dist/{configs/i18n/react → react/i18next}/index.js +0 -0
- /package/dist/react/{loading.module.d.cts → loading/loading.module.d.cts} +0 -0
- /package/dist/react/{loading.module.d.ts → loading/loading.module.d.ts} +0 -0
- /package/dist/react/{loading.module.scss → loading/loading.module.scss} +0 -0
- /package/dist/{typescript/loading.cjs → react/loading/loading.type.cjs} +0 -0
- /package/dist/{typescript/loading.js → react/loading/loading.type.js} +0 -0
- /package/dist/{utils/log.cjs → react/log/index.cjs} +0 -0
- /package/dist/{utils/log.js → react/log/index.js} +0 -0
- /package/dist/{typescript/log.cjs → react/log/log.type.cjs} +0 -0
- /package/dist/{typescript/log.js → react/log/log.type.js} +0 -0
- /package/dist/{typescript/next-intl.cjs → react/next-intl/next-intl.type.cjs} +0 -0
- /package/dist/{typescript/next-intl.js → react/next-intl/next-intl.type.js} +0 -0
- /package/dist/{configs/vitest/react/unit.setup.cjs → react/vitest/vitest.unit.setup.cjs} +0 -0
- /package/dist/{configs/vitest/react/unit.setup.d.cts → react/vitest/vitest.unit.setup.d.cts} +0 -0
- /package/dist/{configs/vitest/react/unit.setup.d.ts → react/vitest/vitest.unit.setup.d.ts} +0 -0
- /package/dist/{configs/vitest/react/unit.setup.js → react/vitest/vitest.unit.setup.js} +0 -0
- /package/dist/utils/{serializer.cjs → serializer/index.cjs} +0 -0
- /package/dist/utils/{serializer.js → serializer/index.js} +0 -0
- /package/dist/{typescript/package.cjs → utils/serializer/serializer.type.cjs} +0 -0
- /package/dist/{typescript/package.js → utils/serializer/serializer.type.js} +0 -0
- /package/dist/utils/{string.cjs → string/index.cjs} +0 -0
- /package/dist/{typescript/serializer.cjs → utils/string/string.type.cjs} +0 -0
- /package/dist/{typescript/serializer.js → utils/string/string.type.js} +0 -0
- /package/dist/utils/{string.js → string/string.util.js} +0 -0
- /package/dist/utils/{validate.cjs → validate/index.cjs} +0 -0
- /package/dist/utils/{validate.js → validate/index.js} +0 -0
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e,r){if(r==null||r>e.length)r=e.length;for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function r(e){if(Array.isArray(e))return e}function t(r){if(Array.isArray(r))return e(r)}function n(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function s(e,r,t,n,s,o,a){try{var i=e[o](a);var c=i.value}catch(e){t(e);return}if(i.done){r(c)}else{Promise.resolve(c).then(n,s)}}function o(e){return function(){var r=this,t=arguments;return new Promise(function(n,o){var a=e.apply(r,t);function i(e){s(a,n,o,i,c,"next",e)}function c(e){s(a,n,o,i,c,"throw",e)}i(undefined)})}}function a(e,r,t){r=f(r);return A(e,I()?Reflect.construct(r,t||[],f(e).constructor):r.apply(e,t))}function i(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function c(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;Object.defineProperty(e,n.key,n)}}function u(e,r,t){if(r)c(e.prototype,r);if(t)c(e,t);return e}function l(e,r,t){if(r in e){Object.defineProperty(e,r,{value:t,enumerable:true,configurable:true,writable:true})}else{e[r]=t}return e}function f(e){f=Object.setPrototypeOf?Object.getPrototypeOf:function e(e){return e.__proto__||Object.getPrototypeOf(e)};return f(e)}function E(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function")}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:true,configurable:true}});if(r)N(e,r)}function d(e,r){if(r!=null&&typeof Symbol!=="undefined"&&r[Symbol.hasInstance]){return!!r[Symbol.hasInstance](e)}else{return e instanceof r}}function v(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function m(e,r){var t=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(t==null)return;var n=[];var s=true;var o=false;var a,i;try{for(t=t.call(e);!(s=(a=t.next()).done);s=true){n.push(a.value);if(r&&n.length===r)break}}catch(e){o=true;i=e}finally{try{if(!s&&t["return"]!=null)t["return"]()}finally{if(o)throw i}}return n}function h(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function p(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function g(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};var n=Object.keys(t);if(typeof Object.getOwnPropertySymbols==="function"){n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))}n.forEach(function(r){l(e,r,t[r])})}return e}function _(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);if(r){n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})}t.push.apply(t,n)}return t}function S(e,r){r=r!=null?r:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(r))}else{_(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function y(e,r){if(e==null)return{};var t=O(e,r);var n,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++){n=o[s];if(r.indexOf(n)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,n))continue;t[n]=e[n]}}return t}function O(e,r){if(e==null)return{};var t={};var n=Object.keys(e);var s,o;for(o=0;o<n.length;o++){s=n[o];if(r.indexOf(s)>=0)continue;t[s]=e[s]}return t}function A(e,r){if(r&&(R(r)==="object"||typeof r==="function")){return r}return n(e)}function N(e,r){N=Object.setPrototypeOf||function e(e,r){e.__proto__=r;return e};return N(e,r)}function C(e,t){return r(e)||m(e,t)||T(e,t)||h()}function D(e){return t(e)||v(e)||T(e)||p()}function R(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function T(r,t){if(!r)return;if(typeof r==="string")return e(r,t);var n=Object.prototype.toString.call(r).slice(8,-1);if(n==="Object"&&r.constructor)n=r.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(r,t)}function I(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(I=function(){return!!e})()}function b(e,r){var t,n,s,o,a={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]};return o={next:i(0),"throw":i(1),"return":i(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function i(e){return function(r){return c([e,r])}}function c(o){if(t)throw new TypeError("Generator is already executing.");while(a)try{if(t=1,n&&(s=o[0]&2?n["return"]:o[0]?n["throw"]||((s=n["return"])&&s.call(n),0):n.next)&&!(s=s.call(n,o[1])).done)return s;if(n=0,s)o=[o[0]&2,s.value];switch(o[0]){case 0:case 1:s=o;break;case 4:a.label++;return{value:o[1],done:false};case 5:a.label++;n=o[1];o=[0];continue;case 7:o=a.ops.pop();a.trys.pop();continue;default:if(!(s=a.trys,s=s.length>0&&s[s.length-1])&&(o[0]===6||o[0]===2)){a=0;continue}if(o[0]===3&&(!s||o[1]>s[0]&&o[1]<s[3])){a.label=o[1];break}if(o[0]===6&&a.label<s[1]){a.label=s[1];s=o;break}if(s&&a.label<s[2]){a.label=s[2];a.ops.push(o);break}if(s[2])a.ops.pop();a.trys.pop();continue}o=r.call(e,a)}catch(e){o=[6,e];n=0}finally{t=s=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}}var P={lint:"Check code for linting issues","lint:fix":"Fix linting issues automatically","lint:inspect":"View active ESLint configuration","lint-staged":"Run lint checks on staged files",commitlint:"Validate commit message format",setup:"Initialize project setup and dependencies",reset:"Reset the project and reinstall dependencies",inspect:"Analyze installed project dependencies","test:unit":"Run unit test suite","test:e2e":"Run end-to-end test suite"};import w from"node:process";var M=w.env.DEBUG==="true";var L=(typeof window==="undefined"?"undefined":R(window))<"u";var G="/graphql";var k={isCurrentProject:!1,installedPath:"",file:{},isUpToDate:!1};import U from"node:process";var x=function(e){return e.Error="error",e.Warning="warning",e}(x||{}),j=function(e){return e.PNPM_ADD_AND_EXEC="PNPM_ADD_AND_EXEC",e.PNPM_ADD_DEV_AND_EXEC="PNPM_ADD_DEV_AND_EXEC",e.RAW="RAW",e}(j||{});import{exec as F}from"node:child_process";import K from"node:process";import*as V from"node:util";import H from"chalk";import Y from"consola";import{GraphQLError as Q}from"graphql";var B={GRAPHQL_PARSE_FAILED:{CODE:"GRAPHQL_PARSE_FAILED",MESSAGE:"The GraphQL operation string contains a syntax error."},GRAPHQL_VALIDATION_FAILED:{CODE:"GRAPHQL_VALIDATION_FAILED",MESSAGE:"The GraphQL operation is not valid against the server's schema."},BAD_USER_INPUT:{CODE:"BAD_USER_INPUT",MESSAGE:"The GraphQL operation includes an invalid value for a field argument."},PERSISTED_QUERY_NOT_FOUND:{CODE:"PERSISTED_QUERY_NOT_FOUND",MESSAGE:"A client sent the hash of a query string to execute via automatic persisted queries, but the query was not in the APQ cache."},PERSISTED_QUERY_NOT_SUPPORTED:{CODE:"PERSISTED_QUERY_NOT_SUPPORTED",MESSAGE:"A client sent the hash of a query string to execute via automatic persisted queries, but the server has disabled APQ."},OPERATION_RESOLUTION_FAILURE:{CODE:"OPERATION_RESOLUTION_FAILURE",MESSAGE:"The request was parsed successfully and is valid against the server's schema, but the server couldn't resolve which operation to run. This occurs when a request containing multiple named operations doesn't specify which operation to run (i.e.,operationName), or if the named operation isn't included in the request."},CONTINUE:{CODE:100,MESSAGE:"Continue"},SWITCHING_PROTOCOLS:{CODE:101,MESSAGE:"Switching Protocols"},PROCESSING:{CODE:102,MESSAGE:"Processing"},OK:{CODE:200,MESSAGE:"OK"},CREATED:{CODE:201,MESSAGE:"Created"},ACCEPTED:{CODE:202,MESSAGE:"Accepted"},NON_AUTHORITATIVE_INFORMATION:{CODE:203,MESSAGE:"Non Authoritative Information"},NO_CONTENT:{CODE:204,MESSAGE:"No Content"},RESET_CONTENT:{CODE:205,MESSAGE:"Reset Content"},PARTIAL_CONTENT:{CODE:206,MESSAGE:"Partial Content"},MULTI_STATUS:{CODE:207,MESSAGE:"Multi-Status"},MULTIPLE_CHOICES:{CODE:300,MESSAGE:"Multiple Choices"},MOVED_PERMANENTLY:{CODE:301,MESSAGE:"Moved Permanently"},MOVED_TEMPORARILY:{CODE:302,MESSAGE:"Moved Temporarily"},SEE_OTHER:{CODE:303,MESSAGE:"See Other"},NOT_MODIFIED:{CODE:304,MESSAGE:"Not Modified"},USE_PROXY:{CODE:305,MESSAGE:"Use Proxy"},TEMPORARY_REDIRECT:{CODE:307,MESSAGE:"Temporary Redirect"},PERMANENT_REDIRECT:{CODE:308,MESSAGE:"Permanent Redirect"},BAD_REQUEST:{CODE:400,MESSAGE:"Bad Request"},UNAUTHORIZED:{CODE:401,MESSAGE:"Unauthorized"},PAYMENT_REQUIRED:{CODE:402,MESSAGE:"Payment Required"},FORBIDDEN:{CODE:403,MESSAGE:"Forbidden"},NOT_FOUND:{CODE:404,MESSAGE:"Not Found"},METHOD_NOT_ALLOWED:{CODE:405,MESSAGE:"Method Not Allowed"},NOT_ACCEPTABLE:{CODE:406,MESSAGE:"Not Acceptable"},PROXY_AUTHENTICATION_REQUIRED:{CODE:407,MESSAGE:"Proxy Authentication Required"},REQUEST_TIMEOUT:{CODE:408,MESSAGE:"Request Timeout"},CONFLICT:{CODE:409,MESSAGE:"Conflict"},GONE:{CODE:410,MESSAGE:"Gone"},LENGTH_REQUIRED:{CODE:411,MESSAGE:"Length Required"},PRECONDITION_FAILED:{CODE:412,MESSAGE:"Precondition Failed"},REQUEST_TOO_LONG:{CODE:413,MESSAGE:"Request Entity Too Large"},REQUEST_URI_TOO_LONG:{CODE:414,MESSAGE:"Request-URI Too Long"},UNSUPPORTED_MEDIA_TYPE:{CODE:415,MESSAGE:"Unsupported Media Type"},REQUESTED_RANGE_NOT_SATISFIABLE:{CODE:416,MESSAGE:"Requested Range Not Satisfiable"},EXPECTATION_FAILED:{CODE:417,MESSAGE:"Expectation Failed"},IM_A_TEAPOT:{CODE:418,MESSAGE:"I'm a teapot"},INSUFFICIENT_SPACE_ON_RESOURCE:{CODE:419,MESSAGE:"Insufficient Space on Resource"},METHOD_FAILURE:{CODE:420,MESSAGE:"Method Failure"},MISDIRECTED_REQUEST:{CODE:421,MESSAGE:"Misdirected Request"},UNPROCESSABLE_ENTITY:{CODE:422,MESSAGE:"Unprocessable Entity"},LOCKED:{CODE:423,MESSAGE:"Locked"},FAILED_DEPENDENCY:{CODE:424,MESSAGE:"Failed Dependency"},PRECONDITION_REQUIRED:{CODE:428,MESSAGE:"Precondition Required"},TOO_MANY_REQUESTS:{CODE:429,MESSAGE:"Too Many Requests"},REQUEST_HEADER_FIELDS_TOO_LARGE:{CODE:431,MESSAGE:"Request Header Fields Too Large"},UNAVAILABLE_FOR_LEGAL_REASONS:{CODE:451,MESSAGE:"Unavailable For Legal Reasons"},INTERNAL_SERVER_ERROR:{CODE:500,MESSAGE:"Internal Server Error"},NOT_IMPLEMENTED:{CODE:501,MESSAGE:"Not Implemented"},BAD_GATEWAY:{CODE:502,MESSAGE:"Bad Gateway"},SERVICE_UNAVAILABLE:{CODE:503,MESSAGE:"Service Unavailable"},GATEWAY_TIMEOUT:{CODE:504,MESSAGE:"Gateway Timeout"},HTTP_VERSION_NOT_SUPPORTED:{CODE:505,MESSAGE:"HTTP Version Not Supported"},INSUFFICIENT_STORAGE:{CODE:507,MESSAGE:"Insufficient Storage"},NETWORK_AUTHENTICATION_REQUIRED:{CODE:511,MESSAGE:"Network Authentication Required"}};function q(e){var r=e.message,t=e.status,n=t===void 0?B.INTERNAL_SERVER_ERROR:t,s=e.type,o=s===void 0?"graphql":s;var a;var i=(a=r!==null&&r!==void 0?r:n.MESSAGE)!==null&&a!==void 0?a:"Internal server error";throw o==="graphql"?new Q(i,{extensions:{code:n.CODE}}):new Error(i)}M||(Y.level=4);function W(e){var r=H[e];return typeof r=="function"?r:H.green}var J={silent:Y.silent,level:Y.level,fatal:Y.fatal,error:Y.error,warn:Y.warn,log:Y.log,info:Y.info,success:Y.success,ready:Y.ready,start:Y.start,box:Y.box,debug:Y.debug,trace:Y.trace,verbose:Y.verbose,printBoxedLog:function e(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(r===null||r===void 0?void 0:r.length)){Y.box(H.green(e));return}r.forEach(function(e){var r=e.file,n=e.position,s=e.rule,o=e.message;Y.log("".concat(H.gray("File:")," ").concat(H.blue("".concat(r).concat(n?":".concat(n):"")))),s&&Y.log(" ".concat(W(t)("Rule:")," ").concat(s)),Y.log(" ".concat(W(t)("Message:")," ").concat(o))}),Y.box(W(t)("".concat(e," : ").concat(r.length))),Y.log(H.gray("─".repeat(40)))}};import X from"node-fetch";import*as z from"node:fs";function $(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++){r[t]=arguments[t]}return r.every(function(e){return z.existsSync(e)})}function Z(e,r){var t=z.readFileSync(e,"utf-8");if(r===null||r===void 0?void 0:r.asJson)try{var n=JSON.parse(t);if((typeof n==="undefined"?"undefined":R(n))=="object"&&n!==null)return n;throw new Error("Parsed JSON is not an object or array")}catch(r){throw new Error("Failed to parse JSON from file: ".concat(e))}return t}function ee(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var n=t.isJson,s=n===void 0?!1:n,o=s&&(typeof r==="undefined"?"undefined":R(r))=="object"?JSON.stringify(r,null,4):String(r);z.writeFileSync(e,o,"utf-8")}function er(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var n=t.isJson,s=n===void 0?!1:n,o=s&&(typeof r==="undefined"?"undefined":R(r))=="object"?JSON.stringify(r,null,4):String(r);z.appendFileSync(e,o,"utf-8")}function et(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++){r[t]=arguments[t]}r.forEach(function(e){$(e)&&z.rmSync(e,{recursive:!0,force:!0})})}import*as en from"node:path";function es(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++){r[t]=arguments[t]}var n;return(n=en).resolve.apply(n,[eU].concat(D(r)))}function eo(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++){r[t]=arguments[t]}var n;return(n=en).resolve.apply(n,D(r))}function ea(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++){r[t]=arguments[t]}var n;return(n=en).join.apply(n,D(r))}var ei={};function ec(e){if(e in ei)return ei[e];var r=ea(eU,eV);if(!$(r))return ei[e]=!1;try{var t,n;var s=Z(r,{asJson:!0}),o=s.name===e,a=!!((t=s.dependencies)===null||t===void 0?void 0:t[e]),i=!!((n=s.devDependencies)===null||n===void 0?void 0:n[e]);return o||a||i?ei[e]={path:r,file:s,isCurrentProject:o,isDepend:a,isDevDepend:i}:ei[e]=!1}catch(r){return J.warn("Failed to read package.json: ".concat(r.message)),ei[e]=!1}}function eu(e){return el.apply(this,arguments)}function el(){el=o(function(e){var r,t,n,s;return b(this,function(o){switch(o.label){case 0:o.trys.push([0,3,,4]);return[4,X("https://registry.npmjs.org/".concat(e,"/latest"))];case 1:r=o.sent();if(!r.ok)throw new Error("Failed to fetch latest version: ".concat(r.status," ").concat(r.statusText));return[4,r.json()];case 2:t=o.sent(),n=t.version;return[2,n];case 3:s=o.sent();throw J.error('Failed to fetch version for "'.concat(e,'": ').concat(s.message)),s;case 4:return[2]}})});return el.apply(this,arguments)}function ef(e,r){return eE.apply(this,arguments)}function eE(){eE=o(function(e,r){var t,n,s,o,a,i,c,u,f,E,d,v,m,h,p;return b(this,function(_){switch(_.label){case 0:_.trys.push([0,4,,5]);a=ec(e);if(!a)return[2,g({},k)];i=a.path,c=a.file,u=a.isCurrentProject,f=a.isDepend,E=a.isDevDepend,d="0.0.0";u&&c.version?d=c.version:f&&((t=c.dependencies)===null||t===void 0?void 0:t[e])?d=(n=c.dependencies)===null||n===void 0?void 0:n[e]:E&&((s=c.devDependencies)===null||s===void 0?void 0:s[e])&&(d=(o=c.devDependencies)===null||o===void 0?void 0:o[e]);if(!u)return[3,1];h=d;return[3,3];case 1:return[4,eu(e)];case 2:h=_.sent();_.label=3;case 3:v=h,m=u||d===v;return[2,(!m&&(r===null||r===void 0?void 0:r.update)&&(f?c.dependencies=S(g({},c.dependencies||{}),l({},e,v)):E&&(c.devDependencies=S(g({},c.devDependencies||{}),l({},e,v))),J.info('Updating package "'.concat(e,'" to version ').concat(v)),ee(i,c,{isJson:!0})),{isCurrentProject:u,installedPath:i,file:c,isUpToDate:m})];case 4:p=_.sent();return[2,(J.error('Error checking package "'.concat(e,'": ').concat(p.message)),g({},k))];case 5:return[2]}})});return eE.apply(this,arguments)}import ed from"node-persist";import ev from"node:os";import em from"node:process";function eh(){return em.env.CYBERSKILL_STORAGE_DIR||ea(ev.homedir(),ej)}function ep(){return eg.apply(this,arguments)}function eg(){eg=o(function(){var e;return b(this,function(r){switch(r.label){case 0:e=ed.defaultInstance;if(e)return[3,2];return[4,ed.init({dir:eh(),stringify:JSON.stringify,parse:JSON.parse,encoding:"utf8",logging:!1,forgiveParseErrors:!0})];case 1:e=r.sent();r.label=2;case 2:e;return[2]}})});return eg.apply(this,arguments)}var e_={get:function e(e){return o(function(){var r,t;return b(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,ep()];case 1:n.sent();return[4,ed.getItem(e)];case 2:return[2,(r=n.sent())!==null&&r!==void 0?r:null];case 3:t=n.sent();return[2,(J.error('[Storage:get] Error getting key "'.concat(e,'":'),t),null)];case 4:return[2]}})})()},set:function e(e,r){return o(function(){var t;return b(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,ep()];case 1:n.sent();return[4,ed.setItem(e,r)];case 2:n.sent();return[3,4];case 3:t=n.sent();J.error('[Storage:set] Error setting key "'.concat(e,'":'),t);return[3,4];case 4:return[2]}})})()},remove:function e(e){return o(function(){var r;return b(this,function(t){switch(t.label){case 0:t.trys.push([0,3,,4]);return[4,ep()];case 1:t.sent();return[4,ed.removeItem(e)];case 2:t.sent();return[3,4];case 3:r=t.sent();J.error('[Storage:remove] Error removing key "'.concat(e,'":'),r);return[3,4];case 4:return[2]}})})()},keys:function e(){return o(function(){var e,r;return b(this,function(t){switch(t.label){case 0:t.trys.push([0,3,,4]);return[4,ep()];case 1:t.sent();return[4,ed.keys()];case 2:e=t.sent();return[2,Array.isArray(e)?e:(J.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:r=t.sent();return[2,(J.error("[Storage:keys] Error getting keys:",r),[])];case 4:return[2]}})})()},getLogLink:function e(e){return o(function(){return b(this,function(r){try{return[2,"".concat(eh()," (key: ").concat(e,")")]}catch(e){return[2,(J.error("[Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};var eS=V.promisify(F);function ey(e){return"error_list:".concat(e)}function eO(e){return eA.apply(this,arguments)}function eA(){eA=o(function(e){var r,t,n;return b(this,function(s){switch(s.label){case 0:if(e.length===0)return[2];r=Date.now(),t=ey(r);s.label=1;case 1:s.trys.push([1,3,,4]);return[4,e_.set(t,{errors:e,timestamp:r})];case 2:s.sent(),setTimeout(/*#__PURE__*/o(function(){var e;return b(this,function(r){switch(r.label){case 0:return[4,e_.getLogLink(t)];case 1:e=r.sent();e&&J.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})}),10);return[3,4];case 3:n=s.sent();J.error("Failed to save errors: ".concat(n.message));return[3,4];case 4:return[2]}})});return eA.apply(this,arguments)}function eN(){return eC.apply(this,arguments)}function eC(){eC=o(function(){var e,r,t;return b(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,e_.keys()];case 1:e=n.sent(),r=Array.isArray(e)?e.filter(function(e){var r;return e===null||e===void 0?void 0:(r=e.startsWith)===null||r===void 0?void 0:r.call(e,"error_list:")}):[];return[4,Promise.all(r.map(/*#__PURE__*/function(){var e=o(function(e){var r;return b(this,function(t){switch(t.label){case 0:return[4,e_.get(e)];case 1:return[2,((r=t.sent())===null||r===void 0?void 0:r.errors)||[]]}})});return function(r){return e.apply(this,arguments)}}()))];case 2:return[2,n.sent().flat()];case 3:t=n.sent();return[2,(J.error("Failed to retrieve stored errors: ".concat(t.message)),[])];case 4:return[2]}})});return eC.apply(this,arguments)}function eD(){return eR.apply(this,arguments)}function eR(){eR=o(function(){var e,r,t;return b(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,e_.keys()];case 1:e=n.sent(),r=Array.isArray(e)?e.filter(function(e){var r;return e===null||e===void 0?void 0:(r=e.startsWith)===null||r===void 0?void 0:r.call(e,"error_list:")}):[];return[4,Promise.all(r.map(function(e){return e_.remove(e)}))];case 2:n.sent();return[3,4];case 3:t=n.sent();J.error("Failed to clear error lists: ".concat(t.message));return[3,4];case 4:return[2]}})});return eR.apply(this,arguments)}function eT(e){var r=[],t=[],n="",s=/^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/,o=/^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/,a=/^✖\s+(.*?)\s+\[(.*?)\]$/;e.split("\n").forEach(function(e){if(e.startsWith("/"))n=e.trim();else{var i=s.exec(e)||[],c=o.exec(e)||[],u=a.exec(e)||[];i.length&&n?r.push({file:n,position:"".concat(i[1],":").concat(i[2]),type:i[3]==="error"?"error":"warning",message:i[4].trim(),rule:i[5].trim()}):c.length?r.push({file:c[1],position:"".concat(c[2],":").concat(c[3]),type:c[4]==="error"?"error":"warning",message:c[5].trim()}):u.length?r.push({file:"commitlint",type:"error",message:u[1].trim(),rule:u[2].trim()}):t.push(e.trim())}}),r.length&&eO(r),M&&t.length&&(J.warn("Unmatched lines:"),t.forEach(function(e){return J.info(" ".concat(e))}))}function eI(e){try{var r=JSON.parse(e),t=[];r.forEach(function(e){var r=e.filePath,n=e.messages;n.forEach(function(e){var n=e.severity,s=e.line,o=e.column,a=e.ruleId,i=e.message;t.push({type:n===2?"error":"warning",file:r,position:"".concat(s,":").concat(o),rule:a,message:i})})}),t.length&&eO(t)}catch(r){eT(e)}}function eb(e){return eP.apply(this,arguments)}function eP(){eP=o(function(e){var r,t,n,s,o,a,i,c,u;var l=arguments;return b(this,function(f){switch(f.label){case 0:r=l.length>1&&l[1]!==void 0?l[1]:eI;t=new AbortController;K.on("SIGINT",function(){J.warn("Process interrupted. Terminating..."),t.abort(),K.exit()});f.label=1;case 1:f.trys.push([1,3,,4]);return[4,eS(e,{maxBuffer:0x6400000,signal:t.signal})];case 2:n=f.sent(),s=n.stdout,o=n.stderr;[s,o].forEach(function(e){return e&&r(e)});return[3,4];case 3:a=f.sent();i=a.stdout,c=a.stderr,u=a.message;[i,c].forEach(function(e){return e&&r(e)}),!c&&!i&&J.error("Command failed: ".concat(u));return[3,4];case 4:return[2]}})});return eP.apply(this,arguments)}function ew(e){return{raw:!0,cmd:e}}function eM(e,r){return(r===null||r===void 0?void 0:r.isRemote)?"".concat(rt," ").concat(ex," ").concat(e):(r===null||r===void 0?void 0:r.isCurrentProject)?"".concat(rt," ").concat(e9," src/cli.ts ").concat(e):"".concat(rt," ").concat(ez," ").concat(e)}function eL(e,r){return typeof e=="function"?eM(e(r),r):(typeof e==="undefined"?"undefined":R(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?eM(e,r):e}function eG(e){return ek.apply(this,arguments)}function ek(){ek=o(function(e){var r,t,n,s,o,a,i;var c=arguments;return b(this,function(u){switch(u.label){case 0:r=c.length>1&&c[1]!==void 0?c[1]:{};n=(t=r===null||r===void 0?void 0:r.isRemote)!==null&&t!==void 0?t:!1;if(!n)return[3,1];i=!1;return[3,3];case 1:return[4,ef(ex)];case 2:i=u.sent().isCurrentProject;u.label=3;case 3:s=i,o={isRemote:n,isCurrentProject:s},a=typeof e=="function"?e(o):e;return[2,Object.fromEntries(Object.entries(a).map(function(e){var r=C(e,2),t=r[0],n=r[1];return[t,eL(n,o)]}))]}})});return ek.apply(this,arguments)}var eU=U.env.INIT_CWD||U.cwd(),ex="@cyberskill/shared",ej=".cyberskill-storage",eF="node_modules",eK="dist",eV="package.json",eH="package-lock.json",eY="tsconfig.json",eQ=".gitignore",eB=".simple-git-hooks.json",eq="pnpm-lock.yaml",eW=".git/hooks/",eJ=".git/COMMIT_EDITMSG",eX=ea(eU,eF,ex,eK),ez="cyberskill",e$="eslint",eZ="eslint",e0="vitest",e2="playwright",e1="vitest",e3="@commitlint/cli",e4="commitlint",e5="lint-staged",e8="lint-staged",e6="typescript",e7="tsc",e9="tsx",re="git",rr="pnpm",rt="pnpm exec",rn="simple-git-hooks",rs="simple-git-hooks",ro="@eslint/config-inspector",ra="eslint-config-inspector",ri="node-modules-inspector",rc="node-modules-inspector",ru={CYBERSKILL_DIRECTORY:eX,WORKING_DIRECTORY:eU,TS_CONFIG:es(eY),GIT_IGNORE:es(eQ),GIT_HOOK:es(eW),GIT_COMMIT_MSG:es(eJ),SIMPLE_GIT_HOOKS_JSON:es(eB),PACKAGE_JSON:es(eV),PACKAGE_LOCK_JSON:es(eH),PNPM_LOCK_YAML:es(eq),NODE_MODULES:es(eF),CYBERSKILL:{LINT_STAGED_CONFIG:es("".concat(eX,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:es("".concat(eX,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:es("".concat(eX,"/configs/vitest/react/unit.js")),UNIT_TEST_SETUP_CONFIG:es("".concat(eX,"/configs/vitest/react/unit.setup.js")),E2E_TEST_CONFIG:es("".concat(eX,"/configs/vitest/react/e2e.js"))}};function rl(e){var r=e.isCurrentProject;return g({"pre-commit":e8,"commit-msg":e4},r&&{"pre-push":ew("".concat(re," pull"))})}function rf(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++){t[n-1]=arguments[n]}var s=C(t,2),o=s[0],a=s[1],i=e==="RAW"?!0:$.apply(void 0,D(o.split(" ").map(function(e){return ea(ru.NODE_MODULES,e)})));switch(e){case"PNPM_ADD_AND_EXEC":return eL(ew("".concat(i?"":"".concat(rr," add ").concat(o," && ")).concat(rt," ").concat(a)));case"PNPM_ADD_DEV_AND_EXEC":return eL(ew("".concat(i?"":"".concat(rr," add -D ").concat(o," && ")).concat(rt," ").concat(a)));case"RAW":return eL(ew(o))}}var rE={SIMPLE_GIT_HOOKS:rf("PNPM_ADD_DEV_AND_EXEC",rn,rs),ESLINT_INSPECT:rf("PNPM_ADD_DEV_AND_EXEC",ro,ra),NODE_MODULES_INSPECT:rf("PNPM_ADD_DEV_AND_EXEC",ri,rc),ESLINT_CHECK:rf("PNPM_ADD_DEV_AND_EXEC",e$,"".concat(eZ," ").concat(ru.WORKING_DIRECTORY)),ESLINT_FIX:rf("PNPM_ADD_DEV_AND_EXEC",e$,"".concat(eZ," ").concat(ru.WORKING_DIRECTORY," --fix")),TYPESCRIPT_CHECK:rf("PNPM_ADD_AND_EXEC",e6,"".concat(e7," -p ").concat(ru.TS_CONFIG," --noEmit")),CONFIGURE_GIT_HOOK:rf("RAW","".concat(re," config core.hooksPath ").concat(ru.GIT_HOOK)),BUILD:rf("RAW","".concat(rr," run build")),STAGE_BUILD_DIRECTORY:rf("RAW","".concat(re," add ").concat(eK)),PNPM_INSTALL_STANDARD:rf("RAW","".concat(rr," install")),PNPM_INSTALL_LEGACY:rf("RAW","".concat(rr," install --legacy-peer-deps")),PNPM_INSTALL_FORCE:rf("RAW","".concat(rr," install --force")),CYBERSKILL:{TEST_UNIT:rf("PNPM_ADD_AND_EXEC",e0,"".concat(e1," --config ").concat(ru.CYBERSKILL.UNIT_TEST_CONFIG)),TEST_E2E:rf("PNPM_ADD_AND_EXEC","".concat(e0," ").concat(e2),"".concat(e1," --config ").concat(ru.CYBERSKILL.E2E_TEST_CONFIG)),COMMIT_LINT:rf("PNPM_ADD_DEV_AND_EXEC",e3,"".concat(e4," --edit ").concat(ru.GIT_COMMIT_MSG," --config ").concat(ru.CYBERSKILL.COMMITLINT_CONFIG)),LINT_STAGED:rf("PNPM_ADD_DEV_AND_EXEC",e5,"".concat(e8," --config ").concat(ru.CYBERSKILL.LINT_STAGED_CONFIG))}};import{format as rd}from"date-fns";import{Document as rv}from"mongoose";import rm from"mongoose-aggregate-paginate-v2";import rh from"mongoose-paginate-v2";import{v4 as rp}from"uuid";import rg from"crypto-js";import r_ from"slugify";var rS=r_.default||r_;function ry(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",r=arguments.length>1?arguments[1]:void 0;var t=r||{},n=t.lower,s=n===void 0?!0:n,o=t.locale,a=o===void 0?"vi":o,i=y(t,["lower","locale"]);return rS(e,g({lower:s,locale:a},i))}function rO(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:4;return rg.SHA256(e).toString(rg.enc.Hex).slice(0,r)}var rA={isEmpty:function e(e){return e==null?!0:Array.isArray(e)?e.length===0:(typeof e==="undefined"?"undefined":R(e))=="object"?d(e,Date)?!1:Object.keys(e).length===0:typeof e=="string"?e.trim().length===0:!1}};var rN={getDateTime:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Date;return rd(e,"yyyy-MM-dd HH:mm:ss.SSS")},createGenericFields:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=e.returnDateAs,t=r===void 0?"string":r;var n=t==="string"?rN.getDateTime():new Date;return{id:rp(),isDel:!1,createdAt:n,updatedAt:n}},applyPlugins:function e(e,r){r.filter(function(e){return typeof e=="function"}).forEach(function(r){return e.plugin(r)})},applyMiddlewares:function e(e,r){r.forEach(function(r){var t=r.method,n=r.pre,s=r.post;t&&n&&e.pre(t,n),t&&s&&e.post(t,s)})},createGenericSchema:function e(e){return new e.Schema({id:{type:String,default:rp,required:!0,unique:!0},isDel:{type:Boolean,default:!1,required:!0}},{timestamps:!0})},createSchema:function e(e){var r=e.mongoose,t=e.schema,n=e.virtuals,s=n===void 0?[]:n,o=e.standalone,a=o===void 0?!1:o;var i=new r.Schema(t,{strict:!0});return s.forEach(function(e){var r=e.name,t=e.options,n=e.get;var s=i.virtual(r,t);n&&s.get(n)}),a||i.add(rN.createGenericSchema(r)),i},createModel:function e(e){var r=e.mongoose,t=e.name,n=e.schema,s=e.pagination,o=s===void 0?!1:s,a=e.aggregate,i=a===void 0?!1:a,c=e.virtuals,u=c===void 0?[]:c,l=e.middlewares,f=l===void 0?[]:l;if(!t)throw new Error("Model name is required.");if(r.models[t])return r.models[t];var E=rN.createSchema({mongoose:r,schema:n,virtuals:u});return rN.applyPlugins(E,[o&&rh,i&&rm]),rN.applyMiddlewares(E,f),r.model(t,E)},createSlugQuery:function e(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=arguments.length>2?arguments[2]:void 0;return S(g({},r,t&&{id:{$ne:t}}),{$or:[{slug:e},{slugHistory:e}]})},validator:{isEmpty:function e(){return /*#__PURE__*/function(){var e=o(function(e){return b(this,function(r){return[2,!rA.isEmpty(e)]})});return function(r){return e.apply(this,arguments)}}()},isUnique:function e(e){return /*#__PURE__*/function(){var r=o(function(r){var t;return b(this,function(n){switch(n.label){case 0:if(!Array.isArray(e)||e.length===0)throw new Error("Fields must be a non-empty array of strings.");t={$or:e.map(function(e){return l({},e,r)})};return[4,this.constructor.findOne(t)];case 1:return[2,!n.sent()]}})});return function(e){return r.apply(this,arguments)}}()},matchesRegex:function e(e){return /*#__PURE__*/function(){var r=o(function(r){return b(this,function(t){if(!Array.isArray(e)||e.some(function(e){return!d(e,RegExp)}))throw new Error("regexArray must be an array of valid RegExp objects.");return[2,e.every(function(e){return e.test(r)})]})});return function(e){return r.apply(this,arguments)}}()}}},rC=/*#__PURE__*/function(){"use strict";function e(r,t){i(this,e);this.collection=r.collection(t)}u(e,[{key:"createOne",value:function e(e){var r=this;return o(function(){var t,n,s;return b(this,function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);t=g({},rN.createGenericFields(),e);n={success:!0,message:"Document created successfully"};return[4,r.collection.insertOne(t)];case 1:return[2,(n.result=o.sent(),n)];case 2:s=o.sent();return[2,{success:!1,message:s.message}];case 3:return[2]}})})()}},{key:"createMany",value:function e(e){var r=this;return o(function(){var t,n,s;return b(this,function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);t=e.map(function(e){return g({},rN.createGenericFields(),e)});return[4,r.collection.insertMany(t)];case 1:n=o.sent();return[2,n.insertedCount===0?{success:!1,message:"No documents were inserted"}:{success:!0,message:"".concat(n.insertedCount," documents created successfully"),result:n}];case 2:s=o.sent();return[2,{success:!1,message:s.message}];case 3:return[2]}})})()}},{key:"findOne",value:function e(e){var r=this;return o(function(){var t,n;return b(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);return[4,r.collection.findOne(e)];case 1:t=s.sent();return[2,t?{success:!0,message:"Document found",result:t}:{success:!1,message:"Document not found"}];case 2:n=s.sent();return[2,{success:!1,message:n.message}];case 3:return[2]}})})()}},{key:"findAll",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var r=this;return o(function(){var t,n;return b(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);t={success:!0,message:"Documents retrieved successfully"};return[4,r.collection.find(e).toArray()];case 1:return[2,(t.result=s.sent(),t)];case 2:n=s.sent();return[2,{success:!1,message:n.message}];case 3:return[2]}})})()}},{key:"count",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var r=this;return o(function(){var t,n;return b(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);t={success:!0,message:"Count retrieved successfully"};return[4,r.collection.countDocuments(e)];case 1:return[2,(t.result=s.sent(),t)];case 2:n=s.sent();return[2,{success:!1,message:n.message}];case 3:return[2]}})})()}},{key:"updateOne",value:function e(e,r){var t=this;return o(function(){var n,s;return b(this,function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);return[4,t.collection.updateOne(e,{$set:r})];case 1:n=o.sent();return[2,n.matchedCount===0?{success:!1,message:"No documents matched the filter"}:{success:!0,message:"Document updated successfully",result:n}];case 2:s=o.sent();return[2,{success:!1,message:s.message}];case 3:return[2]}})})()}},{key:"updateMany",value:function e(e,r){var t=this;return o(function(){var n,s;return b(this,function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);return[4,t.collection.updateMany(e,{$set:r})];case 1:n=o.sent();return[2,n.matchedCount===0?{success:!1,message:"No documents matched the filter"}:{success:!0,message:"Documents updated successfully",result:n}];case 2:s=o.sent();return[2,{success:!1,message:s.message}];case 3:return[2]}})})()}},{key:"deleteOne",value:function e(e){var r=this;return o(function(){var t,n;return b(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);return[4,r.collection.deleteOne(e)];case 1:t=s.sent();return[2,t.deletedCount===0?{success:!1,message:"No documents matched the filter"}:{success:!0,message:"Document deleted successfully",result:t}];case 2:n=s.sent();return[2,{success:!1,message:n.message}];case 3:return[2]}})})()}},{key:"deleteMany",value:function e(e){var r=this;return o(function(){var t,n;return b(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);return[4,r.collection.deleteMany(e)];case 1:t=s.sent();return[2,t.deletedCount===0?{success:!1,message:"No documents matched the filter"}:{success:!0,message:"Documents deleted successfully",result:t}];case 2:n=s.sent();return[2,{success:!1,message:n.message}];case 3:return[2]}})})()}}]);return e}(),rD=/*#__PURE__*/function(){"use strict";function e(r){i(this,e);this.model=r}u(e,[{key:"getModelName",value:function e(){return this.model.modelName}},{key:"findOne",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=arguments.length>3?arguments[3]:void 0;var s=this;return o(function(){var o,a,i;return b(this,function(c){switch(c.label){case 0:c.trys.push([0,2,,3]);o=s.model.findOne(e,r,t);n&&o.populate(n);return[4,o.exec()];case 1:a=c.sent();return[2,a?{success:!0,result:a}:{success:!1,message:"No ".concat(s.getModelName()," found."),code:B.NOT_FOUND.CODE}];case 2:i=c.sent();return[2,{success:!1,message:i.message,code:B.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"findAll",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=arguments.length>3?arguments[3]:void 0;var s=this;return o(function(){var o,a,i;return b(this,function(c){switch(c.label){case 0:c.trys.push([0,2,,3]);o=s.model.find(e,r,t);n&&o.populate(n);a={success:!0};return[4,o.exec()];case 1:return[2,(a.result=c.sent(),a)];case 2:i=c.sent();return[2,{success:!1,message:i.message,code:B.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"findPaging",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var t=this;return o(function(){var n,s;return b(this,function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);n={success:!0};return[4,t.model.paginate(e,r)];case 1:return[2,(n.result=o.sent(),n)];case 2:s=o.sent();return[2,{success:!1,message:s.message,code:B.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"findPagingAggregate",value:function e(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var t=this;return o(function(){var n,s;return b(this,function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);n={success:!0};return[4,t.model.aggregatePaginate(t.model.aggregate(e),r)];case 1:return[2,(n.result=o.sent(),n)];case 2:s=o.sent();return[2,{success:!1,message:s.message,code:B.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"count",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var r=this;return o(function(){var t,n;return b(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);t={success:!0};return[4,r.model.countDocuments(e)];case 1:return[2,(t.result=s.sent(),t)];case 2:n=s.sent();return[2,{success:!1,message:n.message,code:B.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"createOne",value:function e(e){var r=this;return o(function(){var t,n;return b(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);t={success:!0};return[4,r.model.create(e)];case 1:return[2,(t.result=s.sent(),t)];case 2:n=s.sent();return[2,{success:!1,message:n.message,code:B.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"createMany",value:function e(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var t=this;return o(function(){var n,s;return b(this,function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);n={success:!0};return[4,t.model.insertMany(e,r)];case 1:return[2,(n.result=o.sent().map(function(e){return d(e,rv)?e.toObject():null}).filter(function(e){return e!==null}),n)];case 2:s=o.sent();return[2,{success:!1,message:s.message,code:B.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"updateOne",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var n=this;return o(function(){var s,o;return b(this,function(a){switch(a.label){case 0:a.trys.push([0,2,,3]);return[4,n.model.findOneAndUpdate(e,r,g({new:!0},t)).exec()];case 1:s=a.sent();return[2,s?{success:!0,result:s}:{success:!1,message:"Failed to update ".concat(n.getModelName(),"."),code:B.NOT_FOUND.CODE}];case 2:o=a.sent();return[2,{success:!1,message:o.message,code:B.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"updateMany",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var n=this;return o(function(){var s,o;return b(this,function(a){switch(a.label){case 0:a.trys.push([0,2,,3]);s={success:!0};return[4,n.model.updateMany(e,r,t).exec()];case 1:return[2,(s.result=a.sent(),s)];case 2:o=a.sent();return[2,{success:!1,message:o.message,code:B.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"deleteOne",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var t=this;return o(function(){var n,s;return b(this,function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);return[4,t.model.findOneAndDelete(e,r).exec()];case 1:n=o.sent();return[2,n?{success:!0,result:n}:{success:!1,message:"No ".concat(t.getModelName()," found to delete."),code:B.NOT_FOUND.CODE}];case 2:s=o.sent();return[2,{success:!1,message:s.message,code:B.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"deleteMany",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var t=this;return o(function(){var n,s;return b(this,function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);return[4,t.model.deleteMany(e,r).exec()];case 1:n=o.sent();return[2,n.deletedCount===0?{success:!1,message:"No documents found to delete.",code:B.NOT_FOUND.CODE}:{success:!0,result:n}];case 2:s=o.sent();return[2,{success:!1,message:s.message,code:B.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"createShortId",value:function e(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:4;var t=this;return o(function(){var n,s,o,a;return b(this,function(i){switch(i.label){case 0:n=new Set;s=0;i.label=1;case 1:if(!(s<10))return[3,5];o=rO(e,s+r);a=!n.has(o);if(!a)return[3,3];n.add(o);return[4,t.model.exists({shortId:o})];case 2:a=!i.sent();i.label=3;case 3:if(a)return[2,{success:!0,result:o}];i.label=4;case 4:s++;return[3,1];case 5:return[2,{success:!1,message:"Failed to create a unique shortId",code:B.INTERNAL_SERVER_ERROR.CODE}]}})})()}},{key:"createSlug",value:function e(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var n=this;return o(function(){var s,a,i,c,u,l,f,E,d,v,m;return b(this,function(h){switch(h.label){case 0:h.trys.push([0,8,,9]);s=r[e],a=/*#__PURE__*/function(){var e=o(function(e){var s,o,a;return b(this,function(i){switch(i.label){case 0:return[4,n.model.findOne(rN.createSlugQuery(e,t,r.id))];case 1:s=i.sent();if(!s)return[2,e];o=1;i.label=2;case 2:a="".concat(e,"-").concat(o);return[4,n.model.findOne(rN.createSlugQuery(a,t,r.id))];case 3:s=i.sent(),o++;i.label=4;case 4:if(s)return[3,2];i.label=5;case 5:return[2,a]}})});return function r(r){return e.apply(this,arguments)}}();if(!((typeof s==="undefined"?"undefined":R(s))=="object"))return[3,5];i={};c=[];for(u in s)c.push(u);l=0;h.label=1;case 1:if(!(l<c.length))return[3,4];f=c[l];E=ry(s[f]);return[4,a(E)];case 2:i[f]=h.sent();h.label=3;case 3:l++;return[3,1];case 4:return[2,{success:!0,result:i}];case 5:d=ry(s);v={success:!0};return[4,a(d)];case 6:return[2,(v.result=h.sent(),v)];case 7:return[3,9];case 8:m=h.sent();return[2,{success:!1,message:"Failed to create a unique slug: ".concat(m.message),code:B.INTERNAL_SERVER_ERROR.CODE}];case 9:return[2]}})})()}},{key:"aggregate",value:function e(e){var r=this;return o(function(){var t,n;return b(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);t={success:!0};return[4,r.model.aggregate(e)];case 1:return[2,(t.result=s.sent(),t)];case 2:n=s.sent();return[2,{success:!1,message:n.message,code:B.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}}]);return e}();import{ApolloClient as rR,ApolloError as rT,ApolloLink as rI,ApolloProvider as rb,from as rP,HttpLink as rw,InMemoryCache as rM,split as rL}from"@apollo/client";import{onError as rG}from"@apollo/client/link/error";import{removeTypenameFromVariables as rk}from"@apollo/client/link/remove-typename";import{GraphQLWsLink as rU}from"@apollo/client/link/subscriptions";import{getMainDefinition as rx}from"@apollo/client/utilities";import{createClient as rj}from"graphql-ws";import{useMemo as rF}from"react";import{toast as rK,Toaster as rV}from"react-hot-toast";import{FaInfo as rH}from"react-icons/fa6";import{consola as rY}from"consola/browser";var rQ={silent:rY.silent,level:rY.level,fatal:rY.fatal,error:rY.error,warn:rY.warn,log:rY.log,info:rY.info,success:rY.success,ready:rY.ready,start:rY.start,box:rY.box,debug:rY.debug,trace:rY.trace,verbose:rY.verbose};import{createContext as rB,use as rq,useEffect as rW,useMemo as rJ,useState as rX}from"react";import{FaRepeat as rz}from"react-icons/fa6";import r$ from"./react/apollo-error.module.scss";import{jsx as rZ,jsxs as r0}from"react/jsx-runtime";var r2=rB(void 0);function r1(){var e=rq(r2);if(!e)throw new Error("useApolloErrorViewer must be used within ApolloErrorViewerProvider");return e}var r3=null;function r4(e){r3=e}function r5(e){r3===null||r3===void 0?void 0:r3(e)}function r8(e){var r=e.children;var t=C(rX(null),2),n=t[0],s=t[1];rW(function(){r4(s)},[]);var o=rJ(function(){return{error:n,showError:s,hideError:function(){return s(null)}}},[n]);return rZ(r2,{value:o,children:r})}function r6(){var e=rq(r2),r=e===null||e===void 0?void 0:e.error;if(!r)return null;var t=function(e,r){return(r===null||r===void 0?void 0:r.length)?r0("div",{children:[r0("strong",{children:[e,":"]}),rZ("ul",{children:r.map(function(e){return rZ("li",{children:e.message},e.message)})})]}):null};return rZ("div",{className:r$["modal-backdrop"],children:r0("div",{className:r$["modal-content"],children:[rZ("button",{type:"button",className:r$["btn-close"],onClick:e.hideError,children:"✕"}),r0("div",{className:r$["error-title"],children:[rZ("button",{type:"button",className:r$["btn-retry"],onClick:function(){return window.location.reload()},children:rZ(rz,{})}),r.message]}),r0("div",{className:r$["error-details"],children:[r.networkError&&r0("pre",{className:"network",children:[rZ("strong",{children:"Network Error:"})," ",r.networkError.message]}),t("GraphQL Errors",D(r.graphQLErrors)),t("Protocol Errors",D(r.protocolErrors)),t("Client Errors",D(r.clientErrors)),r.extraInfo&&r0("pre",{className:"extra",children:[rZ("strong",{children:"Extra Info:"})," ",JSON.stringify(r.extraInfo,null,4)]})]})]})})}import{Fragment as r7,jsx as r9,jsxs as te}from"react/jsx-runtime";var tr=/*#__PURE__*/function(e){"use strict";E(r,e);function r(){i(this,r);var e;e=a(this,r,arguments);e.count=0;return e}u(r,[{key:"request",value:function e(e,r){var t=this;var n=Date.now();return this.count+=1,r(e).map(function(r){var s=Date.now()-n,o=e.operationName||"Unnamed";return rQ.info("[Apollo] #".concat(t.count,": ").concat(o," (").concat(s,"ms)")),r})}}]);return r}(rI);function tt(e){var r=e||{},t=r.uri,n=r.wsUrl,s=r.customLinks,o=new tr,a=rG(function(e){var r=e.graphQLErrors,t=e.networkError,n=e.protocolErrors,s=e.operation;var o=(s===null||s===void 0?void 0:s.operationName)||"Unknown";if(r&&r.forEach(function(e){var r=e.message,t=e.locations,n=e.path;rQ.error("[GraphQL error] ".concat(o,": ").concat(r,", Location: ").concat(JSON.stringify(t),", Path: ").concat(n))}),n&&n.forEach(function(e){var r=e.message,t=e.extensions;rQ.error("[Protocol error]: ".concat(r,", Extensions: ").concat(JSON.stringify(t)))}),t&&rQ.error("[Network error]: ".concat(t)),r||n||t){var a,i;var c=(r===null||r===void 0?void 0:(a=r[0])===null||a===void 0?void 0:a.message)||(n===null||n===void 0?void 0:(i=n[0])===null||i===void 0?void 0:i.message)||(t===null||t===void 0?void 0:t.message)||"Unexpected error",u=new rT({graphQLErrors:r||[],protocolErrors:n||[],clientErrors:[],networkError:t||null,errorMessage:c,extraInfo:{operation:s}});rK.error(function(e){return te(r7,{children:[c,"\xa0",r9(rH,{onClick:function(){setTimeout(function(){r5(u)},0),rK.dismiss(e.id)}})]})})}}),i=rk();t||rQ.warn('[Apollo] No GraphQL URI provided — using "'.concat(G,'" as default'));var c=new rw({uri:t!==null&&t!==void 0?t:G,credentials:"include"}),u=n?new rU(rj({url:n})):rI.empty(),l=d(u,rI)?rL(function(e){var r=e.query;var t=rx(r);return t.kind==="OperationDefinition"&&t.operation==="subscription"},u,c):c;return l===c&&n&&rQ.warn("[Apollo] WS URL is set, but subscriptions fallback to HTTP. Check your wsLink config."),[o,a,i].concat(D(s!==null&&s!==void 0?s:[]),[l])}function tn(e){var r=e.isNextJS,t=e.options,n=e.children,s=e.client,o=e.provider,a=e.cache;var i=t||{},c=i.uri,u=i.wsUrl,l=i.customLinks,f=y(i,["uri","wsUrl","customLinks"]);if(typeof(s!==null&&s!==void 0?s:rR)!="function")throw new TypeError("Invalid ApolloClient provided. Ensure CustomClient is a class.");var E=o||rb,v=rF(function(){return rP(tt({uri:c,wsUrl:u,customLinks:l}))},[c,u,l]),m=rF(function(){return new rR(g({link:v,cache:d(a,rM)?a:new rM},f))},[v,a,f]),h=r?r9(E,{makeClient:function(){return m},children:n}):r9(E,{client:m,children:n});return r?r9(E,{makeClient:function(){return m},children:n}):te(r7,{children:[te(r8,{children:[h,r9(r6,{})]}),r9(rV,{position:"top-right"})]})}import ts from"classnames";import{createContext as to,use as ta,useCallback as ti,useMemo as tc,useState as tu}from"react";import tl from"./react/loading.module.scss";import{jsx as tf,jsxs as tE}from"react/jsx-runtime";var td=to(void 0);function tv(){var e=ta(td);if(!e)throw new Error("useLoading must be used within a LoadingProvider");return e}function tm(e){var r=e.full,t=r===void 0?!1:r,n=e.block,s=n===void 0?!1:n,o=e.className,a=o===void 0?"":o,i=e.message,c=i===void 0?"Loading":i,u=y(e,["full","block","className","message"]);function l(){return tE("div",S(g({className:tl.container},u),{children:[tf("div",{className:tl.ring}),tf("div",{className:tl.ring}),tf("div",{className:tl.ring}),tf("div",{className:tl.ring}),c&&tf("div",{className:tl.message,children:c})]}))}return t?tf("div",{className:ts(tl.fullscreen,a),children:l()}):s?tf("div",{className:ts(tl.block,a),children:l()}):l()}function th(e){var r=e.children;var t=C(tu(!1),2),n=t[0],s=t[1],o=C(tu(!1),2),a=o[0],i=o[1],c=ti(function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;s(!0),i(e)},[]),u=ti(function(){s(!1),i(!1)},[]),l=tc(function(){return{isLoading:n,isGlobalLoading:a,showLoading:c,hideLoading:u}},[n,a,c,u]);return tf(td,{value:l,children:n?tf(tm,{full:a}):r})}import{NextIntlClientProvider as tp,useTranslations as tg}from"next-intl";import{createContext as t_,use as tS,useMemo as ty}from"react";import{useCallback as tO,useEffect as tA,useState as tN}from"react";var tC={serialize:function(e){return JSON.stringify(e,function(e,r){return d(r,Date)?{__type:"Date",value:r.toISOString()}:r})},deserialize:function(e){return JSON.parse(e,function(e,r){return(r===null||r===void 0?void 0:r.__type)==="Date"?new Date(r.value):r})}};import tD from"localforage";var tR={get:function e(e){return o(function(){var r;return b(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,tD.getItem(e)];case 1:return[2,t.sent()];case 2:r=t.sent();return[2,(rQ.error('[Storage:get] Error getting key "'.concat(e,'":'),r),null)];case 3:return[2]}})})()},set:function e(e,r){return o(function(){var t;return b(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,tD.setItem(e,r)];case 1:n.sent();return[3,3];case 2:t=n.sent();rQ.error('[Storage:set] Error setting key "'.concat(e,'":'),t);return[3,3];case 3:return[2]}})})()},remove:function e(e){return o(function(){var r;return b(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,tD.removeItem(e)];case 1:t.sent();return[3,3];case 2:r=t.sent();rQ.error('[Storage:remove] Error removing key "'.concat(e,'":'),r);return[3,3];case 3:return[2]}})})()},keys:function e(){return o(function(){var e,r;return b(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,tD.keys()];case 1:return[2,(e=t.sent())!==null&&e!==void 0?e:[]];case 2:r=t.sent();return[2,(rQ.error("[Storage:keys] Error getting keys:",r),[])];case 3:return[2]}})})()}};function tT(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:tC;var n=C(tN(r),2),s=n[0],a=n[1],i=C(tN(!1),2),c=i[0],u=i[1];tA(function(){var n=!0;return o(function(){var s,o,i,c;return b(this,function(l){switch(l.label){case 0:l.trys.push([0,6,7,8]);return[4,tR.get(e)];case 1:s=l.sent();if(!n)return[3,5];if(!(s!==null))return[3,2];o=t.deserialize(s);a(o);return[3,5];case 2:if(!(r!==void 0))return[3,4];i=t.serialize(r);return[4,tR.set(e,i)];case 3:l.sent(),a(r);return[3,5];case 4:a(void 0);l.label=5;case 5:return[3,8];case 6:c=l.sent();rQ.error('Error loading value for key "'.concat(e,'":'),c),n&&a(r);return[3,8];case 7:n&&u(!0);return[7];case 8:return[2]}})})(),function(){n=!1,u(!1)}},[e,r,t]),tA(function(){if(!c)return;o(function(){var r,n;return b(this,function(o){switch(o.label){case 0:o.trys.push([0,3,,4]);if(!(s!==void 0))return[3,2];r=t.serialize(s);return[4,tR.set(e,r)];case 1:o.sent();o.label=2;case 2:return[3,4];case 3:n=o.sent();rQ.error('Error saving value for key "'.concat(e,'":'),n);return[3,4];case 4:return[2]}})})()},[s,e,t,c]);var l=tO(function(e){a(function(r){return typeof e=="function"?e(r):e})},[]),f=tO(/*#__PURE__*/o(function(){var r;return b(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,tR.remove(e)];case 1:t.sent(),a(void 0);return[3,3];case 2:r=t.sent();rQ.error('Error removing key "'.concat(e,'":'),r);return[3,3];case 3:return[2]}})}),[e]);return{value:s,set:l,remove:f}}import{Fragment as tI,jsx as tb}from"react/jsx-runtime";var tP=t_(void 0);function tw(){var e=tS(tP);if(!e)throw new Error("useNextIntl must be used within a NextIntlProvider");return e}var tM=tg;function tL(e){var r=function(r){var t;var n=tw(),s=n.currentLanguage,o=r.messages,a=r.languages,i="en",c=o[(s===null||s===void 0?void 0:s.value)||i],u=(t=a.find(function(e){return e.value===(s===null||s===void 0?void 0:s.value)}))===null||t===void 0?void 0:t.timezone;return o?tb(tp,{locale:(s===null||s===void 0?void 0:s.value)||i,messages:c,timeZone:u,children:tb(e,g({},r))}):(rQ.warn("Missing messages for language: ".concat((s===null||s===void 0?void 0:s.value)||i)),null)};return r.displayName="withNextIntl(".concat(e.displayName||e.name||"Component",")"),r}function tG(e){var r=e.children;return tb(tI,{children:r})}var tk=tL(tG);function tU(e){var r=e.children,t=e.languages,n=e.messages;var s;var o=tT("lang",(s=t===null||t===void 0?void 0:t[0])!==null&&s!==void 0?s:{}),a=o.value,i=o.set,c=ty(function(){return{languages:t,currentLanguage:a,setCurrentLanguage:i}},[t,i,a]);return tb(tP,{value:c,children:tb(tk,{languages:t,messages:n,children:r})})}var tx=function(e){return e.ESLINT="eslint",e.COMMITLINT="commitlint",e.LINT_STAGED="lint-staged",e.VITEST_REACT_E2E="vitest-react-e2e",e.VITEST_REACT_UNIT="vitest-react-unit",e}(tx||{});import{Collection as tj,Db as tF}from"mongodb";import{Document as tK,Model as tV}from"mongoose";var tH=/*#__PURE__*/function(e){"use strict";E(r,e);function r(){i(this,r);return a(this,r,arguments)}return r}(tF),tY=/*#__PURE__*/function(e){"use strict";E(r,e);function r(){i(this,r);return a(this,r,arguments)}return r}(tK),tQ=/*#__PURE__*/function(e){"use strict";E(r,e);function r(){i(this,r);return a(this,r,arguments)}return r}(tV),tB=/*#__PURE__*/function(e){"use strict";E(r,e);function r(){i(this,r);return a(this,r,arguments)}return r}(tj);import tq from"unorm";function tW(e){try{return JSON.parse(e),!0}catch(e){return!1}}function tJ(e){return!!e&&(typeof e==="undefined"?"undefined":R(e))=="object"&&!Array.isArray(e)}function tX(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++){r[t]=arguments[t]}return r.flat().reduce(function(e,r){var t=true,n=false,s=undefined;try{for(var o=Object.entries(r)[Symbol.iterator](),a;!(t=(a=o.next()).done);t=true){var i=C(a.value,2),c=i[0],u=i[1];var l=e[c];Array.isArray(u)?e[c]=Array.from(new Set(D(Array.isArray(l)?l:[]).concat(D(u)))):tJ(u)?e[c]=tX(tJ(l)?l:{},u):e[c]=u}}catch(e){n=true;s=e}finally{try{if(!t&&o.return!=null){o.return()}}finally{if(n){throw s}}}return e},{})}var tz={a:["\xe0","\xe1","ạ","ả","\xe3","\xe2","ầ","ấ","ậ","ẩ","ẫ","ă","ằ","ắ","ặ","ẳ","ẵ"],e:["\xe8","\xe9","ẹ","ẻ","ẽ","\xea","ề","ế","ệ","ể","ễ"],i:["\xec","\xed","ị","ỉ","ĩ"],o:["\xf2","\xf3","ọ","ỏ","\xf5","\xf4","ồ","ố","ộ","ổ","ỗ","ơ","ờ","ớ","ợ","ở","ỡ"],u:["\xf9","\xfa","ụ","ủ","ũ","ư","ừ","ứ","ự","ử","ữ"],y:["ỳ","\xfd","ỵ","ỷ","ỹ"],d:["đ"]},t$=Object.entries(tz).reduce(function(e,r){var t=C(r,2),n=t[0],s=t[1];return e[n.toUpperCase()]=s.map(function(e){return e.toUpperCase()}),e},{});function tZ(e){e=tq.nfkc(e);var r=g({},tz,t$);var t=true,n=false,s=undefined;try{for(var o=Object.entries(r)[Symbol.iterator](),a;!(t=(a=o.next()).done);t=true){var i=C(a.value,2),c=i[0],u=i[1];var l="[".concat(c).concat(u.join(""),"]"),f="(".concat([c].concat(D(u)).join("|"),")");e=e.replace(new RegExp(l,"g"),f)}}catch(e){n=true;s=e}finally{try{if(!t&&o.return!=null){o.return()}}finally{if(n){throw s}}}return e}function t0(e){return e.normalize("NFD").replace(RegExp("\\p{Diacritic}","gu"),"")}export{r6 as ApolloErrorViewerModal,r8 as ApolloErrorViewerProvider,tn as ApolloProvider,eK as BUILD_DIRECTORY,k as CHECK_PACKAGE_EMPTY_RESULT,rE as COMMAND,P as COMMAND_DESCRIPTIONS,e4 as COMMIT_LINT_CLI,e3 as COMMIT_LINT_PACKAGE_NAME,ez as CYBERSKILL_CLI,eX as CYBERSKILL_DIRECTORY,ex as CYBERSKILL_PACKAGE_NAME,ej as CYBERSKILL_STORAGE,tB as C_Collection,tH as C_Db,tY as C_Document,tQ as C_Model,M as DEBUG,eZ as ESLINT_CLI,ra as ESLINT_INSPECT_CLI,ro as ESLINT_INSPECT_PACKAGE_NAME,e$ as ESLINT_PACKAGE_NAME,j as E_CommandType,tx as E_ConfigType,x as E_IssueType,re as GIT_CLI,eJ as GIT_COMMIT_EDITMSG,eW as GIT_HOOK,eQ as GIT_IGNORE,G as GRAPHQL_URI_DEFAULT,rl as HOOK,L as IS_BROWSER,e8 as LINT_STAGED_CLI,e5 as LINT_STAGED_PACKAGE_NAME,tm as Loading,td as LoadingContext,th as LoadingProvider,rC as MongoController,rD as MongooseController,eF as NODE_MODULES,rc as NODE_MODULES_INSPECT_CLI,ri as NODE_MODULES_INSPECT_PACKAGE_NAME,tP as NextIntlContext,tU as NextIntlProvider,eV as PACKAGE_JSON,eH as PACKAGE_LOCK_JSON,ru as PATH,e2 as PLAYWRIGHT_PACKAGE_NAME,rr as PNPM_CLI,rt as PNPM_EXEC_CLI,eq as PNPM_LOCK_YAML,B as RESPONSE_STATUS,rn as SIMPLE_GIT_HOOKS_PACKAGE_NAME,rs as SIMPLE_GIT_HOOK_CLI,eB as SIMPLE_GIT_HOOK_JSON,eY as TSCONFIG_JSON,e7 as TSC_CLI,e6 as TSC_PACKAGE_NAME,e9 as TSX_CLI,e1 as VITEST_CLI,e0 as VITEST_PACKAGE_NAME,eU as WORKING_DIRECTORY,rm as aggregatePaginate,er as appendFileSync,ef as checkPackage,eD as clearAllErrorLists,tX as deepMerge,eb as executeCommand,$ as existsSync,eL as formatCommand,rO as generateShortId,ry as generateSlug,eu as getLatestPackageVersion,ec as getPackage,eh as getStorageDir,eN as getStoredErrorLists,ep as initNodePersist,tW as isJson,tJ as isPlainObject,ea as join,rQ as log,J as logNodeJS,rN as mongo,rh as mongoosePaginate,ew as rawCommand,Z as readFileSync,tZ as regexSearchMapper,r4 as registerApolloErrorViewerCallback,t0 as removeAccent,eo as resolve,eG as resolveCommands,es as resolveWorkingPath,et as rmSync,tC as serializer,r5 as showGlobalApolloError,tR as storageClient,e_ as storageServer,q as throwError,r1 as useApolloErrorViewer,tv as useLoading,tw as useNextIntl,tT as useStorage,tM as useTranslateNextIntl,rA as validate,tL as withNextIntl,ee as writeFileSync};
|
|
1
|
+
function e(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function t(e){if(Array.isArray(e))return e}function r(t){if(Array.isArray(t))return e(t)}function n(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function s(e,t,r,n,s,i,o){try{var a=e[i](o);var c=a.value}catch(e){r(e);return}if(a.done){t(c)}else{Promise.resolve(c).then(n,s)}}function i(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(e){s(o,n,i,a,c,"next",e)}function c(e){s(o,n,i,a,c,"throw",e)}a(undefined)})}}function o(e,t,r){t=d(t);return A(e,D()?Reflect.construct(t,r||[],d(e).constructor):t.apply(e,r))}function a(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;Object.defineProperty(e,n.key,n)}}function u(e,t,r){if(t)c(e.prototype,t);if(r)c(e,r);return e}function l(e,t,r){if(t in e){Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true})}else{e[t]=r}return e}function d(e){d=Object.setPrototypeOf?Object.getPrototypeOf:function e(e){return e.__proto__||Object.getPrototypeOf(e)};return d(e)}function f(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function")}e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:true,configurable:true}});if(t)N(e,t)}function p(e,t){if(t!=null&&typeof Symbol!=="undefined"&&t[Symbol.hasInstance]){return!!t[Symbol.hasInstance](e)}else{return e instanceof t}}function E(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function m(e,t){var r=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r==null)return;var n=[];var s=true;var i=false;var o,a;try{for(r=r.call(e);!(s=(o=r.next()).done);s=true){n.push(o.value);if(t&&n.length===t)break}}catch(e){i=true;a=e}finally{try{if(!s&&r["return"]!=null)r["return"]()}finally{if(i)throw a}}return n}function g(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function v(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function h(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};var n=Object.keys(r);if(typeof Object.getOwnPropertySymbols==="function"){n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))}n.forEach(function(t){l(e,t,r[t])})}return e}function y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);if(t){n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})}r.push.apply(r,n)}return r}function _(e,t){t=t!=null?t:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(t))}else{y(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function S(e,t){if(e==null)return{};var r=O(e,t);var n,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++){n=i[s];if(t.indexOf(n)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,n))continue;r[n]=e[n]}}return r}function O(e,t){if(e==null)return{};var r={};var n=Object.keys(e);var s,i;for(i=0;i<n.length;i++){s=n[i];if(t.indexOf(s)>=0)continue;r[s]=e[s]}return r}function A(e,t){if(t&&(C(t)==="object"||typeof t==="function")){return t}return n(e)}function N(e,t){N=Object.setPrototypeOf||function e(e,t){e.__proto__=t;return e};return N(e,t)}function I(e,r){return t(e)||m(e,r)||R(e,r)||g()}function T(e){return r(e)||E(e)||R(e)||v()}function C(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function R(t,r){if(!t)return;if(typeof t==="string")return e(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor)n=t.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,r)}function D(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(D=function(){return!!e})()}function b(e,t){var r,n,s,i,o={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]};return i={next:a(0),"throw":a(1),"return":a(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function a(e){return function(t){return c([e,t])}}function c(i){if(r)throw new TypeError("Generator is already executing.");while(o)try{if(r=1,n&&(s=i[0]&2?n["return"]:i[0]?n["throw"]||((s=n["return"])&&s.call(n),0):n.next)&&!(s=s.call(n,i[1])).done)return s;if(n=0,s)i=[i[0]&2,s.value];switch(i[0]){case 0:case 1:s=i;break;case 4:o.label++;return{value:i[1],done:false};case 5:o.label++;n=i[1];i=[0];continue;case 7:i=o.ops.pop();o.trys.pop();continue;default:if(!(s=o.trys,s=s.length>0&&s[s.length-1])&&(i[0]===6||i[0]===2)){o=0;continue}if(i[0]===3&&(!s||i[1]>s[0]&&i[1]<s[3])){o.label=i[1];break}if(i[0]===6&&o.label<s[1]){o.label=s[1];s=i;break}if(s&&o.label<s[2]){o.label=s[2];o.ops.push(i);break}if(s[2])o.ops.pop();o.trys.pop();continue}i=t.call(e,o)}catch(e){i=[6,e];n=0}finally{r=s=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}}var w=function(e){return e.ESLINT="eslint",e.COMMITLINT="commitlint",e.LINT_STAGED="lint-staged",e.VITEST_REACT_E2E="vitest-react-e2e",e.VITEST_REACT_UNIT="vitest-react-unit",e}(w||{});import x from"@antfu/eslint-config";import L from"@vitejs/plugin-react-swc";import{defineConfig as P}from"vitest/config";function M(e){return P(h({plugins:[L()],test:{include:["**/*.test.e2e.?(c|m)[jt]s?(x)"],browser:{enabled:!0,provider:"playwright",instances:[{browser:"chromium"},{browser:"firefox"},{browser:"webkit"}]}}},e))}import j from"@vitejs/plugin-react-swc";import{defineConfig as G}from"vitest/config";import k from"node:process";var U=function(e){return e.PNPM_ADD_AND_EXEC="PNPM_ADD_AND_EXEC",e.PNPM_ADD_DEV_AND_EXEC="PNPM_ADD_DEV_AND_EXEC",e.RAW="RAW",e}(U||{});import{exec as F}from"node:child_process";import q from"node:process";import*as K from"node:util";import Y from"node:process";var H=Y.env.DEBUG==="true";var B=function(e){return e.Error="error",e.Warning="warning",e}(B||{});import V from"chalk";import Q from"consola";import{GraphQLError as J}from"graphql";var W={GRAPHQL_PARSE_FAILED:{CODE:"GRAPHQL_PARSE_FAILED",MESSAGE:"The GraphQL operation string contains a syntax error."},GRAPHQL_VALIDATION_FAILED:{CODE:"GRAPHQL_VALIDATION_FAILED",MESSAGE:"The GraphQL operation is not valid against the server's schema."},BAD_USER_INPUT:{CODE:"BAD_USER_INPUT",MESSAGE:"The GraphQL operation includes an invalid value for a field argument."},PERSISTED_QUERY_NOT_FOUND:{CODE:"PERSISTED_QUERY_NOT_FOUND",MESSAGE:"A client sent the hash of a query string to execute via automatic persisted queries, but the query was not in the APQ cache."},PERSISTED_QUERY_NOT_SUPPORTED:{CODE:"PERSISTED_QUERY_NOT_SUPPORTED",MESSAGE:"A client sent the hash of a query string to execute via automatic persisted queries, but the server has disabled APQ."},OPERATION_RESOLUTION_FAILURE:{CODE:"OPERATION_RESOLUTION_FAILURE",MESSAGE:"The request was parsed successfully and is valid against the server's schema, but the server couldn't resolve which operation to run. This occurs when a request containing multiple named operations doesn't specify which operation to run (i.e.,operationName), or if the named operation isn't included in the request."},CONTINUE:{CODE:100,MESSAGE:"Continue"},SWITCHING_PROTOCOLS:{CODE:101,MESSAGE:"Switching Protocols"},PROCESSING:{CODE:102,MESSAGE:"Processing"},OK:{CODE:200,MESSAGE:"OK"},CREATED:{CODE:201,MESSAGE:"Created"},ACCEPTED:{CODE:202,MESSAGE:"Accepted"},NON_AUTHORITATIVE_INFORMATION:{CODE:203,MESSAGE:"Non Authoritative Information"},NO_CONTENT:{CODE:204,MESSAGE:"No Content"},RESET_CONTENT:{CODE:205,MESSAGE:"Reset Content"},PARTIAL_CONTENT:{CODE:206,MESSAGE:"Partial Content"},MULTI_STATUS:{CODE:207,MESSAGE:"Multi-Status"},MULTIPLE_CHOICES:{CODE:300,MESSAGE:"Multiple Choices"},MOVED_PERMANENTLY:{CODE:301,MESSAGE:"Moved Permanently"},MOVED_TEMPORARILY:{CODE:302,MESSAGE:"Moved Temporarily"},SEE_OTHER:{CODE:303,MESSAGE:"See Other"},NOT_MODIFIED:{CODE:304,MESSAGE:"Not Modified"},USE_PROXY:{CODE:305,MESSAGE:"Use Proxy"},TEMPORARY_REDIRECT:{CODE:307,MESSAGE:"Temporary Redirect"},PERMANENT_REDIRECT:{CODE:308,MESSAGE:"Permanent Redirect"},BAD_REQUEST:{CODE:400,MESSAGE:"Bad Request"},UNAUTHORIZED:{CODE:401,MESSAGE:"Unauthorized"},PAYMENT_REQUIRED:{CODE:402,MESSAGE:"Payment Required"},FORBIDDEN:{CODE:403,MESSAGE:"Forbidden"},NOT_FOUND:{CODE:404,MESSAGE:"Not Found"},METHOD_NOT_ALLOWED:{CODE:405,MESSAGE:"Method Not Allowed"},NOT_ACCEPTABLE:{CODE:406,MESSAGE:"Not Acceptable"},PROXY_AUTHENTICATION_REQUIRED:{CODE:407,MESSAGE:"Proxy Authentication Required"},REQUEST_TIMEOUT:{CODE:408,MESSAGE:"Request Timeout"},CONFLICT:{CODE:409,MESSAGE:"Conflict"},GONE:{CODE:410,MESSAGE:"Gone"},LENGTH_REQUIRED:{CODE:411,MESSAGE:"Length Required"},PRECONDITION_FAILED:{CODE:412,MESSAGE:"Precondition Failed"},REQUEST_TOO_LONG:{CODE:413,MESSAGE:"Request Entity Too Large"},REQUEST_URI_TOO_LONG:{CODE:414,MESSAGE:"Request-URI Too Long"},UNSUPPORTED_MEDIA_TYPE:{CODE:415,MESSAGE:"Unsupported Media Type"},REQUESTED_RANGE_NOT_SATISFIABLE:{CODE:416,MESSAGE:"Requested Range Not Satisfiable"},EXPECTATION_FAILED:{CODE:417,MESSAGE:"Expectation Failed"},IM_A_TEAPOT:{CODE:418,MESSAGE:"I'm a teapot"},INSUFFICIENT_SPACE_ON_RESOURCE:{CODE:419,MESSAGE:"Insufficient Space on Resource"},METHOD_FAILURE:{CODE:420,MESSAGE:"Method Failure"},MISDIRECTED_REQUEST:{CODE:421,MESSAGE:"Misdirected Request"},UNPROCESSABLE_ENTITY:{CODE:422,MESSAGE:"Unprocessable Entity"},LOCKED:{CODE:423,MESSAGE:"Locked"},FAILED_DEPENDENCY:{CODE:424,MESSAGE:"Failed Dependency"},PRECONDITION_REQUIRED:{CODE:428,MESSAGE:"Precondition Required"},TOO_MANY_REQUESTS:{CODE:429,MESSAGE:"Too Many Requests"},REQUEST_HEADER_FIELDS_TOO_LARGE:{CODE:431,MESSAGE:"Request Header Fields Too Large"},UNAVAILABLE_FOR_LEGAL_REASONS:{CODE:451,MESSAGE:"Unavailable For Legal Reasons"},INTERNAL_SERVER_ERROR:{CODE:500,MESSAGE:"Internal Server Error"},NOT_IMPLEMENTED:{CODE:501,MESSAGE:"Not Implemented"},BAD_GATEWAY:{CODE:502,MESSAGE:"Bad Gateway"},SERVICE_UNAVAILABLE:{CODE:503,MESSAGE:"Service Unavailable"},GATEWAY_TIMEOUT:{CODE:504,MESSAGE:"Gateway Timeout"},HTTP_VERSION_NOT_SUPPORTED:{CODE:505,MESSAGE:"HTTP Version Not Supported"},INSUFFICIENT_STORAGE:{CODE:507,MESSAGE:"Insufficient Storage"},NETWORK_AUTHENTICATION_REQUIRED:{CODE:511,MESSAGE:"Network Authentication Required"}};function X(e){var t=e.message,r=e.status,n=r===void 0?W.INTERNAL_SERVER_ERROR:r,s=e.type,i=s===void 0?"graphql":s;var o;var a=(o=t!==null&&t!==void 0?t:n.MESSAGE)!==null&&o!==void 0?o:"Internal server error";throw i==="graphql"?new J(a,{extensions:{code:n.CODE}}):new Error(a)}H||(Q.level=4);function z(e){var t=V[e];return typeof t=="function"?t:V.green}var $={silent:Q.silent,level:Q.level,fatal:Q.fatal,error:Q.error,warn:Q.warn,log:Q.log,info:Q.info,success:Q.success,ready:Q.ready,start:Q.start,box:Q.box,debug:Q.debug,trace:Q.trace,verbose:Q.verbose,printBoxedLog:function e(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(t===null||t===void 0?void 0:t.length)){Q.box(V.green(e));return}t.forEach(function(e){var t=e.file,n=e.position,s=e.rule,i=e.message;Q.log("".concat(V.gray("File:")," ").concat(V.blue("".concat(t).concat(n?":".concat(n):"")))),s&&Q.log(" ".concat(z(r)("Rule:")," ").concat(s)),Q.log(" ".concat(z(r)("Message:")," ").concat(i))}),Q.box(z(r)("".concat(e," : ").concat(t.length))),Q.log(V.gray("─".repeat(40)))}};var Z={isCurrentProject:!1,installedPath:"",file:{},isUpToDate:!1};import ee from"node-fetch";import*as et from"node:fs";function er(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return t.every(function(e){return et.existsSync(e)})}function en(e,t){var r=et.readFileSync(e,"utf-8");if(t===null||t===void 0?void 0:t.asJson)try{var n=JSON.parse(r);if((typeof n==="undefined"?"undefined":C(n))=="object"&&n!==null)return n;throw new Error("Parsed JSON is not an object or array")}catch(t){throw new Error("Failed to parse JSON from file: ".concat(e))}return r}function es(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var n=r.isJson,s=n===void 0?!1:n,i=s&&(typeof t==="undefined"?"undefined":C(t))=="object"?JSON.stringify(t,null,4):String(t);et.writeFileSync(e,i,"utf-8")}function ei(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var n=r.isJson,s=n===void 0?!1:n,i=s&&(typeof t==="undefined"?"undefined":C(t))=="object"?JSON.stringify(t,null,4):String(t);et.appendFileSync(e,i,"utf-8")}function eo(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}t.forEach(function(e){er(e)&&et.rmSync(e,{recursive:!0,force:!0})})}var ea={};function ec(e){if(e in ea)return ea[e];var t=eF(eq,eV);if(!er(t))return ea[e]=!1;try{var r,n;var s=en(t,{asJson:!0}),i=s.name===e,o=!!((r=s.dependencies)===null||r===void 0?void 0:r[e]),a=!!((n=s.devDependencies)===null||n===void 0?void 0:n[e]);return i||o||a?ea[e]={path:t,file:s,isCurrentProject:i,isDepend:o,isDevDepend:a}:ea[e]=!1}catch(t){return $.warn("Failed to read package.json: ".concat(t.message)),ea[e]=!1}}function eu(e){return el.apply(this,arguments)}function el(){el=i(function(e){var t,r,n,s;return b(this,function(i){switch(i.label){case 0:i.trys.push([0,3,,4]);return[4,ee("https://registry.npmjs.org/".concat(e,"/latest"))];case 1:t=i.sent();if(!t.ok)throw new Error("Failed to fetch latest version: ".concat(t.status," ").concat(t.statusText));return[4,t.json()];case 2:r=i.sent(),n=r.version;return[2,n];case 3:s=i.sent();throw $.error('Failed to fetch version for "'.concat(e,'": ').concat(s.message)),s;case 4:return[2]}})});return el.apply(this,arguments)}function ed(e,t){return ef.apply(this,arguments)}function ef(){ef=i(function(e,t){var r,n,s,i,o,a,c,u,d,f,p,E,m,g,v;return b(this,function(y){switch(y.label){case 0:y.trys.push([0,4,,5]);o=ec(e);if(!o)return[2,h({},Z)];a=o.path,c=o.file,u=o.isCurrentProject,d=o.isDepend,f=o.isDevDepend,p="0.0.0";u&&c.version?p=c.version:d&&((r=c.dependencies)===null||r===void 0?void 0:r[e])?p=(n=c.dependencies)===null||n===void 0?void 0:n[e]:f&&((s=c.devDependencies)===null||s===void 0?void 0:s[e])&&(p=(i=c.devDependencies)===null||i===void 0?void 0:i[e]);if(!u)return[3,1];g=p;return[3,3];case 1:return[4,eu(e)];case 2:g=y.sent();y.label=3;case 3:E=g,m=u||p===E;return[2,(!m&&(t===null||t===void 0?void 0:t.update)&&(d?c.dependencies=_(h({},c.dependencies||{}),l({},e,E)):f&&(c.devDependencies=_(h({},c.devDependencies||{}),l({},e,E))),$.info('Updating package "'.concat(e,'" to version ').concat(E)),es(a,c,{isJson:!0})),{isCurrentProject:u,installedPath:a,file:c,isUpToDate:m})];case 4:v=y.sent();return[2,($.error('Error checking package "'.concat(e,'": ').concat(v.message)),h({},Z))];case 5:return[2]}})});return ef.apply(this,arguments)}import ep from"node-persist";import eE from"node:os";import em from"node:process";function eg(){return em.env.CYBERSKILL_STORAGE_DIR||eF(eE.homedir(),eY)}function ev(){return eh.apply(this,arguments)}function eh(){eh=i(function(){var e;return b(this,function(t){switch(t.label){case 0:e=ep.defaultInstance;if(e)return[3,2];return[4,ep.init({dir:eg(),stringify:JSON.stringify,parse:JSON.parse,encoding:"utf8",logging:!1,forgiveParseErrors:!0})];case 1:e=t.sent();t.label=2;case 2:e;return[2]}})});return eh.apply(this,arguments)}var ey={get:function e(e){return i(function(){var t,r;return b(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,ev()];case 1:n.sent();return[4,ep.getItem(e)];case 2:return[2,(t=n.sent())!==null&&t!==void 0?t:null];case 3:r=n.sent();return[2,($.error('[Storage:get] Error getting key "'.concat(e,'":'),r),null)];case 4:return[2]}})})()},set:function e(e,t){return i(function(){var r;return b(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,ev()];case 1:n.sent();return[4,ep.setItem(e,t)];case 2:n.sent();return[3,4];case 3:r=n.sent();$.error('[Storage:set] Error setting key "'.concat(e,'":'),r);return[3,4];case 4:return[2]}})})()},remove:function e(e){return i(function(){var t;return b(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,ev()];case 1:r.sent();return[4,ep.removeItem(e)];case 2:r.sent();return[3,4];case 3:t=r.sent();$.error('[Storage:remove] Error removing key "'.concat(e,'":'),t);return[3,4];case 4:return[2]}})})()},keys:function e(){return i(function(){var e,t;return b(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,ev()];case 1:r.sent();return[4,ep.keys()];case 2:e=r.sent();return[2,Array.isArray(e)?e:($.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=r.sent();return[2,($.error("[Storage:keys] Error getting keys:",t),[])];case 4:return[2]}})})()},getLogLink:function e(e){return i(function(){return b(this,function(t){try{return[2,"".concat(eg()," (key: ").concat(e,")")]}catch(e){return[2,($.error("[Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};var e_=K.promisify(F);function eS(e){return"error_list:".concat(e)}function eO(e){return eA.apply(this,arguments)}function eA(){eA=i(function(e){var t,r,n;return b(this,function(s){switch(s.label){case 0:if(e.length===0)return[2];t=Date.now(),r=eS(t);s.label=1;case 1:s.trys.push([1,3,,4]);return[4,ey.set(r,{errors:e,timestamp:t})];case 2:s.sent(),setTimeout(/*#__PURE__*/i(function(){var e;return b(this,function(t){switch(t.label){case 0:return[4,ey.getLogLink(r)];case 1:e=t.sent();e&&$.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})}),10);return[3,4];case 3:n=s.sent();$.error("Failed to save errors: ".concat(n.message));return[3,4];case 4:return[2]}})});return eA.apply(this,arguments)}function eN(){return eI.apply(this,arguments)}function eI(){eI=i(function(){var e,t,r;return b(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,ey.keys()];case 1:e=n.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(/*#__PURE__*/function(){var e=i(function(e){var t;return b(this,function(r){switch(r.label){case 0:return[4,ey.get(e)];case 1:return[2,((t=r.sent())===null||t===void 0?void 0:t.errors)||[]]}})});return function(t){return e.apply(this,arguments)}}()))];case 2:return[2,n.sent().flat()];case 3:r=n.sent();return[2,($.error("Failed to retrieve stored errors: ".concat(r.message)),[])];case 4:return[2]}})});return eI.apply(this,arguments)}function eT(){return eC.apply(this,arguments)}function eC(){eC=i(function(){var e,t,r;return b(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,ey.keys()];case 1:e=n.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(function(e){return ey.remove(e)}))];case 2:n.sent();return[3,4];case 3:r=n.sent();$.error("Failed to clear error lists: ".concat(r.message));return[3,4];case 4:return[2]}})});return eC.apply(this,arguments)}function eR(e){var t=[],r=[],n="",s=/^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/,i=/^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/,o=/^✖\s+(.*?)\s+\[(.*?)\]$/;e.split("\n").forEach(function(e){if(e.startsWith("/"))n=e.trim();else{var a=s.exec(e)||[],c=i.exec(e)||[],u=o.exec(e)||[];a.length&&n?t.push({file:n,position:"".concat(a[1],":").concat(a[2]),type:a[3]==="error"?"error":"warning",message:a[4].trim(),rule:a[5].trim()}):c.length?t.push({file:c[1],position:"".concat(c[2],":").concat(c[3]),type:c[4]==="error"?"error":"warning",message:c[5].trim()}):u.length?t.push({file:"commitlint",type:"error",message:u[1].trim(),rule:u[2].trim()}):r.push(e.trim())}}),t.length&&eO(t),H&&r.length&&($.warn("Unmatched lines:"),r.forEach(function(e){return $.info(" ".concat(e))}))}function eD(e){try{var t=JSON.parse(e),r=[];t.forEach(function(e){var t=e.filePath,n=e.messages;n.forEach(function(e){var n=e.severity,s=e.line,i=e.column,o=e.ruleId,a=e.message;r.push({type:n===2?"error":"warning",file:t,position:"".concat(s,":").concat(i),rule:o,message:a})})}),r.length&&eO(r)}catch(t){eR(e)}}function eb(e){return ew.apply(this,arguments)}function ew(){ew=i(function(e){var t,r,n,s,i,o,a,c,u;var l=arguments;return b(this,function(d){switch(d.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:eD;r=new AbortController;q.on("SIGINT",function(){$.warn("Process interrupted. Terminating..."),r.abort(),q.exit()});d.label=1;case 1:d.trys.push([1,3,,4]);return[4,e_(e,{maxBuffer:0x6400000,signal:r.signal})];case 2:n=d.sent(),s=n.stdout,i=n.stderr;[s,i].forEach(function(e){return e&&t(e)});return[3,4];case 3:o=d.sent();a=o.stdout,c=o.stderr,u=o.message;[a,c].forEach(function(e){return e&&t(e)}),!c&&!a&&$.error("Command failed: ".concat(u));return[3,4];case 4:return[2]}})});return ew.apply(this,arguments)}function ex(e){return{raw:!0,cmd:e}}function eL(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(ta," ").concat(eK," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(ta," ").concat(ts," ").concat(e2," ").concat(e):"".concat(ta," ").concat(e1," ").concat(e)}function eP(e,t){return typeof e=="function"?eL(e(t),t):(typeof e==="undefined"?"undefined":C(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?eL(e,t):e}function eM(e){return ej.apply(this,arguments)}function ej(){ej=i(function(e){var t,r,n,s,i,o,a;var c=arguments;return b(this,function(u){switch(u.label){case 0:t=c.length>1&&c[1]!==void 0?c[1]:{};n=(r=t===null||t===void 0?void 0:t.isRemote)!==null&&r!==void 0?r:!1;if(!n)return[3,1];a=!1;return[3,3];case 1:return[4,ed(eK)];case 2:a=u.sent().isCurrentProject;u.label=3;case 3:s=a,i={isRemote:n,isCurrentProject:s},o=typeof e=="function"?e(i):e;return[2,Object.fromEntries(Object.entries(o).map(function(e){var t=I(e,2),r=t[0],n=t[1];return[r,eP(n,i)]}))]}})});return ej.apply(this,arguments)}import*as eG from"node:path";function ek(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}var n;return(n=eG).resolve.apply(n,[eq].concat(T(t)))}function eU(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}var n;return(n=eG).resolve.apply(n,T(t))}function eF(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}var n;return(n=eG).join.apply(n,T(t))}var eq=k.env.INIT_CWD||k.cwd(),eK="@cyberskill/shared",eY=".cyberskill-storage",eH="node_modules",eB="dist",eV="package.json",eQ="package-lock.json",eJ="tsconfig.json",eW=".gitignore",eX=".simple-git-hooks.json",ez="pnpm-lock.yaml",e$=".git/hooks/",eZ=".git/COMMIT_EDITMSG",e0=eF(eq,eH,eK,eB),e1="cyberskill",e2="src/nodejs/cli/index.ts",e3="eslint",e4="eslint",e5="vitest",e6="playwright",e8="vitest",e7="@commitlint/cli",e9="commitlint",te="lint-staged",tt="lint-staged",tr="typescript",tn="tsc",ts="tsx",ti="git",to="pnpm",ta="pnpm exec",tc="simple-git-hooks",tu="simple-git-hooks",tl="@eslint/config-inspector",td="eslint-config-inspector",tf="node-modules-inspector",tp="node-modules-inspector",tE={CYBERSKILL_DIRECTORY:e0,WORKING_DIRECTORY:eq,TS_CONFIG:ek(eJ),GIT_IGNORE:ek(eW),GIT_HOOK:ek(e$),GIT_COMMIT_MSG:ek(eZ),SIMPLE_GIT_HOOKS_JSON:ek(eX),PACKAGE_JSON:ek(eV),PACKAGE_LOCK_JSON:ek(eQ),PNPM_LOCK_YAML:ek(ez),NODE_MODULES:ek(eH),CYBERSKILL:{LINT_STAGED_CONFIG:ek("".concat(e0,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:ek("".concat(e0,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:ek("".concat(e0,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:ek("".concat(e0,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:ek("".concat(e0,"/react/vitest/vitest.e2e.js"))}};function tm(e){var t=e.isCurrentProject;return h({"pre-commit":tt,"commit-msg":e9},t&&{"pre-push":ex("".concat(ti," pull"))})}function tg(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++){r[n-1]=arguments[n]}var s=I(r,2),i=s[0],o=s[1],a=e==="RAW"?!0:er.apply(void 0,T(i.split(" ").map(function(e){return eF(tE.NODE_MODULES,e)})));switch(e){case"PNPM_ADD_AND_EXEC":return eP(ex("".concat(a?"":"".concat(to," add ").concat(i," && ")).concat(ta," ").concat(o)));case"PNPM_ADD_DEV_AND_EXEC":return eP(ex("".concat(a?"":"".concat(to," add -D ").concat(i," && ")).concat(ta," ").concat(o)));case"RAW":return eP(ex(i))}}var tv={SIMPLE_GIT_HOOKS:tg("PNPM_ADD_DEV_AND_EXEC",tc,tu),ESLINT_INSPECT:tg("PNPM_ADD_DEV_AND_EXEC",tl,td),NODE_MODULES_INSPECT:tg("PNPM_ADD_DEV_AND_EXEC",tf,tp),ESLINT_CHECK:tg("PNPM_ADD_DEV_AND_EXEC",e3,"".concat(e4," ").concat(tE.WORKING_DIRECTORY)),ESLINT_FIX:tg("PNPM_ADD_DEV_AND_EXEC",e3,"".concat(e4," ").concat(tE.WORKING_DIRECTORY," --fix")),TYPESCRIPT_CHECK:tg("PNPM_ADD_AND_EXEC",tr,"".concat(tn," -p ").concat(tE.TS_CONFIG," --noEmit")),CONFIGURE_GIT_HOOK:tg("RAW","".concat(ti," config core.hooksPath ").concat(tE.GIT_HOOK)),BUILD:tg("RAW","".concat(to," run build")),STAGE_BUILD_DIRECTORY:tg("RAW","".concat(ti," add ").concat(eB)),PNPM_INSTALL_STANDARD:tg("RAW","".concat(to," install")),PNPM_INSTALL_LEGACY:tg("RAW","".concat(to," install --legacy-peer-deps")),PNPM_INSTALL_FORCE:tg("RAW","".concat(to," install --force")),CYBERSKILL:{TEST_UNIT:tg("PNPM_ADD_AND_EXEC",e5,"".concat(e8," --config ").concat(tE.CYBERSKILL.UNIT_TEST_CONFIG)),TEST_E2E:tg("PNPM_ADD_AND_EXEC","".concat(e5," ").concat(e6),"".concat(e8," --config ").concat(tE.CYBERSKILL.E2E_TEST_CONFIG)),COMMIT_LINT:tg("PNPM_ADD_DEV_AND_EXEC",e7,"".concat(e9," --edit ").concat(tE.GIT_COMMIT_MSG," --config ").concat(tE.CYBERSKILL.COMMITLINT_CONFIG)),LINT_STAGED:tg("PNPM_ADD_DEV_AND_EXEC",te,"".concat(tt," --config ").concat(tE.CYBERSKILL.LINT_STAGED_CONFIG))}};function th(e){return G(h({plugins:[j()],test:{globals:!0,environment:"jsdom",pool:"vmThreads",include:["**/*.test.unit.?(c|m)[jt]s?(x)"],setupFiles:[tE.CYBERSKILL.UNIT_TEST_SETUP_CONFIG]}},e))}function ty(e){try{return JSON.parse(e),!0}catch(e){return!1}}function t_(e){return!!e&&(typeof e==="undefined"?"undefined":C(e))=="object"&&!Array.isArray(e)}function tS(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return t.flat().reduce(function(e,t){var r=true,n=false,s=undefined;try{for(var i=Object.entries(t)[Symbol.iterator](),o;!(r=(o=i.next()).done);r=true){var a=I(o.value,2),c=a[0],u=a[1];var l=e[c];Array.isArray(u)?e[c]=Array.from(new Set(T(Array.isArray(l)?l:[]).concat(T(u)))):t_(u)?e[c]=tS(t_(l)?l:{},u):e[c]=u}}catch(e){n=true;s=e}finally{try{if(!r&&i.return!=null){i.return()}}finally{if(n){throw s}}}return e},{})}import*as tO from"globals";var tA=[{languageOptions:{globals:h({},tO.node,tO.browser)},rules:{"no-console":"warn","no-debugger":"warn","no-alert":"warn","perfectionist/sort-imports":["error",{internalPattern:["^#.*","^@/.*"]}]},ignores:["build","dist"]}];var tN=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return tS.apply(void 0,T(t))},tI=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}var n=tS.apply(void 0,[tA].concat(T(t))),s=n.ignores,i=S(n,["ignores"]),o=Array.isArray(s)&&s.every(function(e){return typeof e=="string"})?{ignores:s}:void 0,a=[i].concat(T(o?[o]:[]));return x.apply(void 0,[{stylistic:{semi:!0,indent:4,quotes:"single"},formatters:{css:!0,html:!0,markdown:"prettier"},yaml:!1,react:!0}].concat(T(a)))},tT=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return M.apply(void 0,T(t))},tC=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return th.apply(void 0,T(t))},tR={eslint:tI,commitlint:tN,"lint-staged":tN,"vitest-react-e2e":tT,"vitest-react-unit":tC};function tD(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++){r[n-1]=arguments[n]}var s=tR[e];if(!s)throw new Error("Unknown config type: ".concat(e));return s.apply(void 0,T(r))}var tb=(typeof window==="undefined"?"undefined":C(window))<"u";var tw={lint:"Check code for linting issues","lint:fix":"Fix linting issues automatically","lint:inspect":"View active ESLint configuration","lint-staged":"Run lint checks on staged files",commitlint:"Validate commit message format",setup:"Initialize project setup and dependencies",reset:"Reset the project and reinstall dependencies",inspect:"Analyze installed project dependencies","test:unit":"Run unit test suite","test:e2e":"Run end-to-end test suite"};import tx from"node:process";import{hideBin as tL}from"yargs/helpers";import tP from"yargs/yargs";var tM={name:"@cyberskill/shared",type:"module",version:"1.66.0",description:"CyberSkill Shared",author:"Stephen Cheng",license:"MIT",homepage:"https://github.com/cyberskill-world/shared#readme",repository:{type:"git",url:"git+https://github.com/cyberskill-world/shared.git"},bugs:{url:"https://github.com/cyberskill-world/shared/issues"},exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./configs":{types:"./dist/configs/index.d.ts",import:"./dist/configs/index.js",require:"./dist/configs/index.cjs"},"./configs/commitlint":{types:"./dist/configs/commitlint/index.d.ts",import:"./dist/configs/commitlint/index.js",require:"./dist/configs/commitlint/index.cjs"},"./configs/eslint":{types:"./dist/configs/eslint/index.d.ts",import:"./dist/configs/eslint/index.js",require:"./dist/configs/eslint/index.cjs"},"./configs/graphql":{types:"./dist/configs/graphql/index.d.ts",import:"./dist/configs/graphql/index.js",require:"./dist/configs/graphql/index.cjs"},"./configs/lint-staged":{types:"./dist/configs/lint-staged/index.d.ts",import:"./dist/configs/lint-staged/index.js",require:"./dist/configs/lint-staged/index.cjs"},"./configs/vitest/react/e2e":{types:"./dist/configs/vitest/react/e2e.d.ts",import:"./dist/configs/vitest/react/e2e.js",require:"./dist/configs/vitest/react/e2e.cjs"},"./configs/vitest/react/unit":{types:"./dist/configs/vitest/react/unit.d.ts",import:"./dist/configs/vitest/react/unit.js",require:"./dist/configs/vitest/react/unit.cjs"},"./constants":{types:"./dist/constants/index.d.ts",import:"./dist/constants/index.js",require:"./dist/constants/index.cjs"},"./nodejs":{types:"./dist/nodejs/index.d.ts",import:"./dist/nodejs/index.js",require:"./dist/nodejs/index.cjs"},"./nodejs/cli":{types:"./dist/nodejs/cli/index.d.ts",import:"./dist/nodejs/cli/index.js",require:"./dist/nodejs/cli/index.cjs"},"./nodejs/command":{types:"./dist/nodejs/command/index.d.ts",import:"./dist/nodejs/command/index.js",require:"./dist/nodejs/command/index.cjs"},"./nodejs/fs":{types:"./dist/nodejs/fs/index.d.ts",import:"./dist/nodejs/fs/index.js",require:"./dist/nodejs/fs/index.cjs"},"./nodejs/log":{types:"./dist/nodejs/log/index.d.ts",import:"./dist/nodejs/log/index.js",require:"./dist/nodejs/log/index.cjs"},"./nodejs/mongo":{types:"./dist/nodejs/mongo/index.d.ts",import:"./dist/nodejs/mongo/index.js",require:"./dist/nodejs/mongo/index.cjs"},"./nodejs/package":{types:"./dist/nodejs/package/index.d.ts",import:"./dist/nodejs/package/index.js",require:"./dist/nodejs/package/index.cjs"},"./nodejs/path":{types:"./dist/nodejs/path/index.d.ts",import:"./dist/nodejs/path/index.js",require:"./dist/nodejs/path/index.cjs"},"./nodejs/storage":{types:"./dist/nodejs/storage/index.d.ts",import:"./dist/nodejs/storage/index.js",require:"./dist/nodejs/storage/index.cjs"},"./react":{types:"./dist/react/index.d.ts",import:"./dist/react/index.js",require:"./dist/react/index.cjs"},"./react/apollo-client":{types:"./dist/react/apollo-client/index.d.ts",import:"./dist/react/apollo-client/index.js",require:"./dist/react/apollo-client/index.cjs"},"./react/apollo-error":{types:"./dist/react/apollo-error/index.d.ts",import:"./dist/react/apollo-error/index.js",require:"./dist/react/apollo-error/index.cjs"},"./react/i18next":{types:"./dist/react/i18next/index.d.ts",import:"./dist/react/i18next/index.js",require:"./dist/react/i18next/index.cjs"},"./react/loading":{types:"./dist/react/loading/index.d.ts",import:"./dist/react/loading/index.js",require:"./dist/react/loading/index.cjs"},"./react/log":{types:"./dist/react/log/index.d.ts",import:"./dist/react/log/index.js",require:"./dist/react/log/index.cjs"},"./react/next-intl":{types:"./dist/react/next-intl/index.d.ts",import:"./dist/react/next-intl/index.js",require:"./dist/react/next-intl/index.cjs"},"./react/storage":{types:"./dist/react/storage/index.d.ts",import:"./dist/react/storage/index.js",require:"./dist/react/storage/index.cjs"},"./react/toast":{types:"./dist/react/toast/index.d.ts",import:"./dist/react/toast/index.js",require:"./dist/react/toast/index.cjs"},"./react/vitest":{types:"./dist/react/vitest/index.d.ts",import:"./dist/react/vitest/index.js",require:"./dist/react/vitest/index.cjs"},"./styles/reset.css":{import:"./dist/styles/reset.css",require:"./dist/styles/reset.css"},"./typescript":{types:"./dist/typescript/index.d.ts",import:"./dist/typescript/index.js",require:"./dist/typescript/index.cjs"},"./utils":{types:"./dist/utils/index.d.ts",import:"./dist/utils/index.js",require:"./dist/utils/index.cjs"}},main:"./dist/index.cjs",module:"./dist/index.js",types:"./dist/index.d.ts",bin:{cyberskill:"./dist/nodejs/cli/index.js"},files:["dist","public"],scripts:{build:"tsup",dev:"dotenv -e .env -- tsup --watch",lint:"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint","lint:fix":"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint:fix","lint:inspect":"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint:inspect",reset:"dotenv -e .env -- tsx src/nodejs/cli/index.ts reset",setup:"dotenv -e .env -- tsx src/nodejs/cli/index.ts setup",inspect:"dotenv -e .env -- tsx src/nodejs/cli/index.ts inspect","test:unit":"dotenv -e .env -- tsx src/nodejs/cli/index.ts test:unit","test:e2e":"dotenv -e .env -- tsx src/nodejs/cli/index.ts test:e2e",commitlint:"dotenv -e .env -- tsx src/nodejs/cli/index.ts commitlint","lint-staged":"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint-staged"},dependencies:{"@antfu/eslint-config":"4.11.0","@apollo/client":"3.13.6","@eslint-react/eslint-plugin":"1.41.0","@graphql-codegen/cli":"5.0.5","@graphql-codegen/client-preset":"4.8.0","@graphql-codegen/typescript-react-apollo":"4.3.2","@microsoft/api-extractor":"7.52.3","@next/eslint-plugin-next":"15.2.4","@swc/core":"1.11.18","@testing-library/jest-dom":"6.6.3","@testing-library/react":"16.3.0","@vitejs/plugin-react-swc":"3.8.1","@vitest/browser":"3.1.1",chalk:"5.4.1",classnames:"2.5.1",consola:"3.4.2","crypto-js":"4.2.0","date-fns":"4.1.0","dotenv-cli":"8.0.0","eslint-config-next":"15.2.4","eslint-plugin-format":"1.0.1","eslint-plugin-react-hooks":"5.2.0","eslint-plugin-react-refresh":"0.4.19",globals:"16.0.0",graphql:"16.10.0","graphql-ws":"6.0.4",i18next:"24.2.3",jsdom:"26.0.0",localforage:"1.10.0","modern-normalize":"3.0.1",mongodb:"6.15.0",mongoose:"8.13.2","mongoose-aggregate-paginate-v2":"1.1.4","mongoose-paginate-v2":"1.9.0","next-intl":"4.0.2","node-fetch":"3.3.2","node-persist":"4.0.4",ora:"8.2.0",playwright:"1.51.1","postcss-modules":"6.0.1",qs:"6.14.0",react:"19.1.0","react-dom":"19.1.0","react-hot-toast":"2.5.2","react-i18next":"15.4.1","react-icons":"5.5.0",sass:"1.86.3",slugify:"1.6.6",tsup:"8.4.0",tsx:"4.19.3",typescript:"5.8.3",unorm:"1.6.0",uuid:"11.1.0",vite:"6.2.5",vitest:"3.1.1","vitest-browser-react":"0.1.1",yargs:"17.7.2"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},devDependencies:{"@commitlint/cli":"19.8.0","@eslint/config-inspector":"1.0.2","@types/crypto-js":"4.2.2","@types/mongoose-aggregate-paginate-v2":"1.0.12","@types/node-persist":"3.1.8","@types/react":"19.1.0","@types/react-dom":"19.1.1","@types/unorm":"1.3.31","@types/uuid":"10.0.0","@types/yargs":"17.0.33",eslint:"9.24.0","lint-staged":"15.5.0","node-modules-inspector":"0.6.3","simple-git-hooks":"2.12.1"}};function tj(e,t){return tG.apply(this,arguments)}function tG(){tG=i(function(e,t){var r;return b(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);$.start("".concat(e)),H&&$.info("→ ".concat(t));return[4,eb(t)];case 1:n.sent(),$.success("".concat(e," done."));return[3,3];case 2:r=n.sent();throw $.error("".concat(e," failed: ").concat(r.message)),r;case 3:return[2]}})});return tG.apply(this,arguments)}function tk(){return tU.apply(this,arguments)}function tU(){tU=i(function(){var e;return b(this,function(t){switch(t.label){case 0:if(!er(tE.TS_CONFIG))return[3,2];return[4,tj("Performing TypeScript validation",tv.TYPESCRIPT_CHECK)];case 1:e=t.sent();return[3,3];case 2:e=$.warn("No TypeScript configuration found. Skipping type check.");t.label=3;case 3:e;return[2]}})});return tU.apply(this,arguments)}function tF(){return tq.apply(this,arguments)}function tq(){tq=i(function(){var e,t;var r=arguments;return b(this,function(n){switch(n.label){case 0:e=r.length>0&&r[0]!==void 0?r[0]:!1;if(!e)return[3,2];return[4,tj("Running ESLint with auto-fix",tv.ESLINT_FIX)];case 1:t=n.sent();return[3,4];case 2:return[4,tj("Running ESLint check",tv.ESLINT_CHECK)];case 3:t=n.sent();n.label=4;case 4:t;return[2]}})});return tq.apply(this,arguments)}function tK(e,t){if(!t.length)return;var r=e==="Errors"?"red":"yellow";$.printBoxedLog(e==="Errors"?"✖ Errors":"⚠ Warnings",t,r)}function tY(){return tH.apply(this,arguments)}function tH(){tH=i(function(){var e,t,r;return b(this,function(n){switch(n.label){case 0:return[4,eN()];case 1:e=n.sent(),t=e.filter(function(e){return e.type==="error"}),r=e.filter(function(e){return e.type==="warning"});!t.length&&!r.length?$.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(tK("Warnings",r),tK("Errors",t));return[2]}})});return tH.apply(this,arguments)}function tB(){return tV.apply(this,arguments)}function tV(){tV=i(function(){var e,t,r;return b(this,function(n){switch(n.label){case 0:return[4,eT()];case 1:n.sent();return[4,ed(eK)];case 2:e=n.sent(),t=e.isCurrentProject;if(!t)return[3,7];n.label=3;case 3:n.trys.push([3,6,,7]);return[4,tj("Building package: ".concat(eK),tv.BUILD)];case 4:n.sent();return[4,tj("Staging build artifacts",tv.STAGE_BUILD_DIRECTORY)];case 5:n.sent();return[3,7];case 6:r=n.sent();throw $.error("Error building and staging ".concat(eK,": ").concat(r.message)),r;case 7:return[4,tj("Executing lint-staged",tv.CYBERSKILL.LINT_STAGED)];case 8:n.sent(),tY();return[2]}})});return tV.apply(this,arguments)}function tQ(){return tJ.apply(this,arguments)}function tJ(){tJ=i(function(){return b(this,function(e){switch(e.label){case 0:return[4,tj("Inspecting ESLint configuration",tv.ESLINT_INSPECT)];case 1:e.sent();return[2]}})});return tJ.apply(this,arguments)}function tW(){return tX.apply(this,arguments)}function tX(){tX=i(function(){return b(this,function(e){switch(e.label){case 0:return[4,eT()];case 1:e.sent();return[4,Promise.all([tk(),tF()])];case 2:e.sent(),tY();return[2]}})});return tX.apply(this,arguments)}function tz(){return t$.apply(this,arguments)}function t$(){t$=i(function(){return b(this,function(e){switch(e.label){case 0:return[4,eT()];case 1:e.sent();return[4,Promise.all([tk(),tF(!0)])];case 2:e.sent(),tY();return[2]}})});return t$.apply(this,arguments)}function tZ(){return t0.apply(this,arguments)}function t0(){t0=i(function(){return b(this,function(e){switch(e.label){case 0:return[4,eT()];case 1:e.sent();return[4,tj("Validating commit message",tv.CYBERSKILL.COMMIT_LINT)];case 2:e.sent(),tY();return[2]}})});return t0.apply(this,arguments)}function t1(){return t2.apply(this,arguments)}function t2(){t2=i(function(){var e,t;return b(this,function(r){switch(r.label){case 0:return[4,tj("Configuring Git hooks",tv.CONFIGURE_GIT_HOOK)];case 1:r.sent(),eo(tE.GIT_HOOK);return[4,eM(tm)];case 2:e=r.sent();es(tE.SIMPLE_GIT_HOOKS_JSON,e,{isJson:!0});t="\n".concat(eX,"\n");er(tE.GIT_IGNORE)?en(tE.GIT_IGNORE).split("\n").includes(eX)||ei(tE.GIT_IGNORE,t):es(tE.GIT_IGNORE,t);return[4,tj("Setting up simple-git-hooks",tv.SIMPLE_GIT_HOOKS)];case 3:r.sent();return[2]}})});return t2.apply(this,arguments)}function t3(){return t4.apply(this,arguments)}function t4(){t4=i(function(){var e,t,r,n,s,i,o,a,c,u,l;return b(this,function(d){switch(d.label){case 0:e=[{command:tv.PNPM_INSTALL_STANDARD,message:"Installing dependencies (standard)"},{command:tv.PNPM_INSTALL_LEGACY,message:"Retrying with legacy peer dependencies"},{command:tv.PNPM_INSTALL_FORCE,message:"Retrying with force install"}];t=true,r=false,n=undefined;d.label=1;case 1:d.trys.push([1,8,9,10]);s=e[Symbol.iterator]();d.label=2;case 2:if(!!(t=(i=s.next()).done))return[3,7];o=i.value,a=o.command,c=o.message;d.label=3;case 3:d.trys.push([3,5,,6]);return[4,tj("".concat(c," using: ").concat(a),a)];case 4:d.sent();return[2];case 5:u=d.sent();$.warn("Installation attempt failed: ".concat(a)),$.error("Details: ".concat(u.message));return[3,6];case 6:t=true;return[3,2];case 7:return[3,10];case 8:l=d.sent();r=true;n=l;return[3,10];case 9:try{if(!t&&s.return!=null){s.return()}}finally{if(r){throw n}}return[7];case 10:throw new Error("All dependency installation strategies failed.")}})});return t4.apply(this,arguments)}function t5(e,t){return t6.apply(this,arguments)}function t6(){t6=i(function(e,t){var r,n,s,i,o,a,c,u,l,d,f,p;return b(this,function(E){switch(E.label){case 0:if(!er(tE.PACKAGE_JSON)){$.error("package.json not found. Aborting setup.");return[2]}E.label=1;case 1:E.trys.push([1,14,,15]);return[4,ed(e,{update:t===null||t===void 0?void 0:t.update})];case 2:r=E.sent(),n=r.isUpToDate;s=n;if(s)return[3,5];return[4,t3()];case 3:E.sent();return[4,tz()];case 4:s=E.sent();E.label=5;case 5:s;o=true,a=false,c=undefined;E.label=6;case 6:E.trys.push([6,11,12,13]);u=((i=t===null||t===void 0?void 0:t.postInstallActions)!==null&&i!==void 0?i:[])[Symbol.iterator]();E.label=7;case 7:if(!!(o=(l=u.next()).done))return[3,10];d=l.value;return[4,d()];case 8:E.sent();E.label=9;case 9:o=true;return[3,7];case 10:return[3,13];case 11:f=E.sent();a=true;c=f;return[3,13];case 12:try{if(!o&&u.return!=null){u.return()}}finally{if(a){throw c}}return[7];case 13:$.success('"'.concat(e,'" setup completed.'));return[3,15];case 14:p=E.sent();throw $.error('Failed to setup "'.concat(e,'": ').concat(p.message)),p;case 15:return[2]}})});return t6.apply(this,arguments)}function t8(){return t7.apply(this,arguments)}function t7(){t7=i(function(){return b(this,function(e){switch(e.label){case 0:return[4,t5(eK,{update:!0,postInstallActions:[t1]})];case 1:e.sent();return[2]}})});return t7.apply(this,arguments)}function t9(){return re.apply(this,arguments)}function re(){re=i(function(){return b(this,function(e){switch(e.label){case 0:eo(tE.NODE_MODULES,tE.PNPM_LOCK_YAML);return[4,t3()];case 1:e.sent();return[4,t1()];case 2:e.sent();return[2]}})});return re.apply(this,arguments)}function rt(){return rr.apply(this,arguments)}function rr(){rr=i(function(){return b(this,function(e){switch(e.label){case 0:return[4,tj("Inspecting project dependencies",tv.NODE_MODULES_INSPECT)];case 1:e.sent();return[2]}})});return rr.apply(this,arguments)}function rn(){return rs.apply(this,arguments)}function rs(){rs=i(function(){return b(this,function(e){switch(e.label){case 0:return[4,tj("Running unit tests",tv.CYBERSKILL.TEST_UNIT)];case 1:e.sent();return[2]}})});return rs.apply(this,arguments)}function ri(){return ro.apply(this,arguments)}function ro(){ro=i(function(){return b(this,function(e){switch(e.label){case 0:return[4,tj("Running end-to-end tests",tv.CYBERSKILL.TEST_E2E)];case 1:e.sent();return[2]}})});return ro.apply(this,arguments)}i(function(){var e;return b(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,tP(tL(tx.argv)).scriptName(e1).usage("$0 <command> [options]").command("lint",tw.lint,tW).command("lint:fix",tw["lint:fix"],tz).command("lint:inspect",tw["lint:inspect"],tQ).command("lint-staged",tw["lint-staged"],tB).command("commitlint",tw.commitlint,tZ).command("setup",tw.setup,t8).command("reset",tw.reset,t9).command("inspect",tw.inspect,rt).command("test:unit",tw["test:unit"],rn).command("test:e2e",tw["test:e2e"],ri).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(tM.version).epilog('\uD83D\uDCA1 Tip: Use "--help" with any command to see options\n').parse()];case 1:t.sent();return[3,3];case 2:e=t.sent();$.error("Fatal: ".concat(e.message)),tx.exit(1);return[3,3];case 3:return[2]}})})();import{format as ra}from"date-fns";import{Document as rc}from"mongoose";import ru from"mongoose-aggregate-paginate-v2";import rl from"mongoose-paginate-v2";import{v4 as rd}from"uuid";import rf from"crypto-js";import rp from"slugify";var rE=rp.default||rp;function rm(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;var r=t||{},n=r.lower,s=n===void 0?!0:n,i=r.locale,o=i===void 0?"vi":i,a=S(r,["lower","locale"]);return rE(e,h({lower:s,locale:o},a))}function rg(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:4;return rf.SHA256(e).toString(rf.enc.Hex).slice(0,t)}var rv={isEmpty:function e(e){return e==null?!0:Array.isArray(e)?e.length===0:(typeof e==="undefined"?"undefined":C(e))=="object"?p(e,Date)?!1:Object.keys(e).length===0:typeof e=="string"?e.trim().length===0:!1}};var rh={getDateTime:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Date;return ra(e,"yyyy-MM-dd HH:mm:ss.SSS")},createGenericFields:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.returnDateAs,r=t===void 0?"string":t;var n=r==="string"?rh.getDateTime():new Date;return{id:rd(),isDel:!1,createdAt:n,updatedAt:n}},applyPlugins:function e(e,t){t.filter(function(e){return typeof e=="function"}).forEach(function(t){return e.plugin(t)})},applyMiddlewares:function e(e,t){t.forEach(function(t){var r=t.method,n=t.pre,s=t.post;r&&n&&e.pre(r,n),r&&s&&e.post(r,s)})},createGenericSchema:function e(e){return new e.Schema({id:{type:String,default:rd,required:!0,unique:!0},isDel:{type:Boolean,default:!1,required:!0}},{timestamps:!0})},createSchema:function e(e){var t=e.mongoose,r=e.schema,n=e.virtuals,s=n===void 0?[]:n,i=e.standalone,o=i===void 0?!1:i;var a=new t.Schema(r,{strict:!0});return s.forEach(function(e){var t=e.name,r=e.options,n=e.get;var s=a.virtual(t,r);n&&s.get(n)}),o||a.add(rh.createGenericSchema(t)),a},createModel:function e(e){var t=e.mongoose,r=e.name,n=e.schema,s=e.pagination,i=s===void 0?!1:s,o=e.aggregate,a=o===void 0?!1:o,c=e.virtuals,u=c===void 0?[]:c,l=e.middlewares,d=l===void 0?[]:l;if(!r)throw new Error("Model name is required.");if(t.models[r])return t.models[r];var f=rh.createSchema({mongoose:t,schema:n,virtuals:u});return rh.applyPlugins(f,[i&&rl,a&&ru]),rh.applyMiddlewares(f,d),t.model(r,f)},createSlugQuery:function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;return _(h({},t,r&&{id:{$ne:r}}),{$or:[{slug:e},{slugHistory:e}]})},validator:{isEmpty:function e(){return /*#__PURE__*/function(){var e=i(function(e){return b(this,function(t){return[2,!rv.isEmpty(e)]})});return function(t){return e.apply(this,arguments)}}()},isUnique:function e(e){return /*#__PURE__*/function(){var t=i(function(t){var r;return b(this,function(n){switch(n.label){case 0:if(!Array.isArray(e)||e.length===0)throw new Error("Fields must be a non-empty array of strings.");r={$or:e.map(function(e){return l({},e,t)})};return[4,this.constructor.findOne(r)];case 1:return[2,!n.sent()]}})});return function(e){return t.apply(this,arguments)}}()},matchesRegex:function e(e){return /*#__PURE__*/function(){var t=i(function(t){return b(this,function(r){if(!Array.isArray(e)||e.some(function(e){return!p(e,RegExp)}))throw new Error("regexArray must be an array of valid RegExp objects.");return[2,e.every(function(e){return e.test(t)})]})});return function(e){return t.apply(this,arguments)}}()}}},ry=/*#__PURE__*/function(){"use strict";function e(t,r){a(this,e);this.collection=t.collection(r)}u(e,[{key:"createOne",value:function e(e){var t=this;return i(function(){var r,n,s;return b(this,function(i){switch(i.label){case 0:i.trys.push([0,2,,3]);r=h({},rh.createGenericFields(),e);n={success:!0,message:"Document created successfully"};return[4,t.collection.insertOne(r)];case 1:return[2,(n.result=i.sent(),n)];case 2:s=i.sent();return[2,{success:!1,message:s.message}];case 3:return[2]}})})()}},{key:"createMany",value:function e(e){var t=this;return i(function(){var r,n,s;return b(this,function(i){switch(i.label){case 0:i.trys.push([0,2,,3]);r=e.map(function(e){return h({},rh.createGenericFields(),e)});return[4,t.collection.insertMany(r)];case 1:n=i.sent();return[2,n.insertedCount===0?{success:!1,message:"No documents were inserted"}:{success:!0,message:"".concat(n.insertedCount," documents created successfully"),result:n}];case 2:s=i.sent();return[2,{success:!1,message:s.message}];case 3:return[2]}})})()}},{key:"findOne",value:function e(e){var t=this;return i(function(){var r,n;return b(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);return[4,t.collection.findOne(e)];case 1:r=s.sent();return[2,r?{success:!0,message:"Document found",result:r}:{success:!1,message:"Document not found"}];case 2:n=s.sent();return[2,{success:!1,message:n.message}];case 3:return[2]}})})()}},{key:"findAll",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var t=this;return i(function(){var r,n;return b(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);r={success:!0,message:"Documents retrieved successfully"};return[4,t.collection.find(e).toArray()];case 1:return[2,(r.result=s.sent(),r)];case 2:n=s.sent();return[2,{success:!1,message:n.message}];case 3:return[2]}})})()}},{key:"count",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var t=this;return i(function(){var r,n;return b(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);r={success:!0,message:"Count retrieved successfully"};return[4,t.collection.countDocuments(e)];case 1:return[2,(r.result=s.sent(),r)];case 2:n=s.sent();return[2,{success:!1,message:n.message}];case 3:return[2]}})})()}},{key:"updateOne",value:function e(e,t){var r=this;return i(function(){var n,s;return b(this,function(i){switch(i.label){case 0:i.trys.push([0,2,,3]);return[4,r.collection.updateOne(e,{$set:t})];case 1:n=i.sent();return[2,n.matchedCount===0?{success:!1,message:"No documents matched the filter"}:{success:!0,message:"Document updated successfully",result:n}];case 2:s=i.sent();return[2,{success:!1,message:s.message}];case 3:return[2]}})})()}},{key:"updateMany",value:function e(e,t){var r=this;return i(function(){var n,s;return b(this,function(i){switch(i.label){case 0:i.trys.push([0,2,,3]);return[4,r.collection.updateMany(e,{$set:t})];case 1:n=i.sent();return[2,n.matchedCount===0?{success:!1,message:"No documents matched the filter"}:{success:!0,message:"Documents updated successfully",result:n}];case 2:s=i.sent();return[2,{success:!1,message:s.message}];case 3:return[2]}})})()}},{key:"deleteOne",value:function e(e){var t=this;return i(function(){var r,n;return b(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);return[4,t.collection.deleteOne(e)];case 1:r=s.sent();return[2,r.deletedCount===0?{success:!1,message:"No documents matched the filter"}:{success:!0,message:"Document deleted successfully",result:r}];case 2:n=s.sent();return[2,{success:!1,message:n.message}];case 3:return[2]}})})()}},{key:"deleteMany",value:function e(e){var t=this;return i(function(){var r,n;return b(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);return[4,t.collection.deleteMany(e)];case 1:r=s.sent();return[2,r.deletedCount===0?{success:!1,message:"No documents matched the filter"}:{success:!0,message:"Documents deleted successfully",result:r}];case 2:n=s.sent();return[2,{success:!1,message:n.message}];case 3:return[2]}})})()}}]);return e}(),r_=/*#__PURE__*/function(){"use strict";function e(t){a(this,e);this.model=t}u(e,[{key:"getModelName",value:function e(){return this.model.modelName}},{key:"findOne",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=arguments.length>3?arguments[3]:void 0;var s=this;return i(function(){var i,o,a;return b(this,function(c){switch(c.label){case 0:c.trys.push([0,2,,3]);i=s.model.findOne(e,t,r);n&&i.populate(n);return[4,i.exec()];case 1:o=c.sent();return[2,o?{success:!0,result:o}:{success:!1,message:"No ".concat(s.getModelName()," found."),code:W.NOT_FOUND.CODE}];case 2:a=c.sent();return[2,{success:!1,message:a.message,code:W.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"findAll",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=arguments.length>3?arguments[3]:void 0;var s=this;return i(function(){var i,o,a;return b(this,function(c){switch(c.label){case 0:c.trys.push([0,2,,3]);i=s.model.find(e,t,r);n&&i.populate(n);o={success:!0};return[4,i.exec()];case 1:return[2,(o.result=c.sent(),o)];case 2:a=c.sent();return[2,{success:!1,message:a.message,code:W.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"findPaging",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var r=this;return i(function(){var n,s;return b(this,function(i){switch(i.label){case 0:i.trys.push([0,2,,3]);n={success:!0};return[4,r.model.paginate(e,t)];case 1:return[2,(n.result=i.sent(),n)];case 2:s=i.sent();return[2,{success:!1,message:s.message,code:W.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"findPagingAggregate",value:function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var r=this;return i(function(){var n,s;return b(this,function(i){switch(i.label){case 0:i.trys.push([0,2,,3]);n={success:!0};return[4,r.model.aggregatePaginate(r.model.aggregate(e),t)];case 1:return[2,(n.result=i.sent(),n)];case 2:s=i.sent();return[2,{success:!1,message:s.message,code:W.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"count",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var t=this;return i(function(){var r,n;return b(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);r={success:!0};return[4,t.model.countDocuments(e)];case 1:return[2,(r.result=s.sent(),r)];case 2:n=s.sent();return[2,{success:!1,message:n.message,code:W.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"createOne",value:function e(e){var t=this;return i(function(){var r,n;return b(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);r={success:!0};return[4,t.model.create(e)];case 1:return[2,(r.result=s.sent(),r)];case 2:n=s.sent();return[2,{success:!1,message:n.message,code:W.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"createMany",value:function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var r=this;return i(function(){var n,s;return b(this,function(i){switch(i.label){case 0:i.trys.push([0,2,,3]);n={success:!0};return[4,r.model.insertMany(e,t)];case 1:return[2,(n.result=i.sent().map(function(e){return p(e,rc)?e.toObject():null}).filter(function(e){return e!==null}),n)];case 2:s=i.sent();return[2,{success:!1,message:s.message,code:W.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"updateOne",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var n=this;return i(function(){var s,i;return b(this,function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);return[4,n.model.findOneAndUpdate(e,t,h({new:!0},r)).exec()];case 1:s=o.sent();return[2,s?{success:!0,result:s}:{success:!1,message:"Failed to update ".concat(n.getModelName(),"."),code:W.NOT_FOUND.CODE}];case 2:i=o.sent();return[2,{success:!1,message:i.message,code:W.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"updateMany",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var n=this;return i(function(){var s,i;return b(this,function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);s={success:!0};return[4,n.model.updateMany(e,t,r).exec()];case 1:return[2,(s.result=o.sent(),s)];case 2:i=o.sent();return[2,{success:!1,message:i.message,code:W.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"deleteOne",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var r=this;return i(function(){var n,s;return b(this,function(i){switch(i.label){case 0:i.trys.push([0,2,,3]);return[4,r.model.findOneAndDelete(e,t).exec()];case 1:n=i.sent();return[2,n?{success:!0,result:n}:{success:!1,message:"No ".concat(r.getModelName()," found to delete."),code:W.NOT_FOUND.CODE}];case 2:s=i.sent();return[2,{success:!1,message:s.message,code:W.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"deleteMany",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var r=this;return i(function(){var n,s;return b(this,function(i){switch(i.label){case 0:i.trys.push([0,2,,3]);return[4,r.model.deleteMany(e,t).exec()];case 1:n=i.sent();return[2,n.deletedCount===0?{success:!1,message:"No documents found to delete.",code:W.NOT_FOUND.CODE}:{success:!0,result:n}];case 2:s=i.sent();return[2,{success:!1,message:s.message,code:W.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"createShortId",value:function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:4;var r=this;return i(function(){var n,s,i,o;return b(this,function(a){switch(a.label){case 0:n=new Set;s=0;a.label=1;case 1:if(!(s<10))return[3,5];i=rg(e,s+t);o=!n.has(i);if(!o)return[3,3];n.add(i);return[4,r.model.exists({shortId:i})];case 2:o=!a.sent();a.label=3;case 3:if(o)return[2,{success:!0,result:i}];a.label=4;case 4:s++;return[3,1];case 5:return[2,{success:!1,message:"Failed to create a unique shortId",code:W.INTERNAL_SERVER_ERROR.CODE}]}})})()}},{key:"createSlug",value:function e(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var n=this;return i(function(){var s,o,a,c,u,l,d,f,p,E,m;return b(this,function(g){switch(g.label){case 0:g.trys.push([0,8,,9]);s=t[e],o=/*#__PURE__*/function(){var e=i(function(e){var s,i,o;return b(this,function(a){switch(a.label){case 0:return[4,n.model.findOne(rh.createSlugQuery(e,r,t.id))];case 1:s=a.sent();if(!s)return[2,e];i=1;a.label=2;case 2:o="".concat(e,"-").concat(i);return[4,n.model.findOne(rh.createSlugQuery(o,r,t.id))];case 3:s=a.sent(),i++;a.label=4;case 4:if(s)return[3,2];a.label=5;case 5:return[2,o]}})});return function t(t){return e.apply(this,arguments)}}();if(!((typeof s==="undefined"?"undefined":C(s))=="object"))return[3,5];a={};c=[];for(u in s)c.push(u);l=0;g.label=1;case 1:if(!(l<c.length))return[3,4];d=c[l];f=rm(s[d]);return[4,o(f)];case 2:a[d]=g.sent();g.label=3;case 3:l++;return[3,1];case 4:return[2,{success:!0,result:a}];case 5:p=rm(s);E={success:!0};return[4,o(p)];case 6:return[2,(E.result=g.sent(),E)];case 7:return[3,9];case 8:m=g.sent();return[2,{success:!1,message:"Failed to create a unique slug: ".concat(m.message),code:W.INTERNAL_SERVER_ERROR.CODE}];case 9:return[2]}})})()}},{key:"aggregate",value:function e(e){var t=this;return i(function(){var r,n;return b(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);r={success:!0};return[4,t.model.aggregate(e)];case 1:return[2,(r.result=s.sent(),r)];case 2:n=s.sent();return[2,{success:!1,message:n.message,code:W.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}}]);return e}();import{Collection as rS,Db as rO}from"mongodb";import{Document as rA,Model as rN}from"mongoose";var rI=/*#__PURE__*/function(e){"use strict";f(t,e);function t(){a(this,t);return o(this,t,arguments)}return t}(rO),rT=/*#__PURE__*/function(e){"use strict";f(t,e);function t(){a(this,t);return o(this,t,arguments)}return t}(rA),rC=/*#__PURE__*/function(e){"use strict";f(t,e);function t(){a(this,t);return o(this,t,arguments)}return t}(rN),rR=/*#__PURE__*/function(e){"use strict";f(t,e);function t(){a(this,t);return o(this,t,arguments)}return t}(rS);import{ApolloClient as rD,ApolloError as rb,ApolloLink as rw,ApolloProvider as rx,from as rL,HttpLink as rP,InMemoryCache as rM,split as rj}from"@apollo/client";import{onError as rG}from"@apollo/client/link/error";import{removeTypenameFromVariables as rk}from"@apollo/client/link/remove-typename";import{GraphQLWsLink as rU}from"@apollo/client/link/subscriptions";import{getMainDefinition as rF}from"@apollo/client/utilities";import{createClient as rq}from"graphql-ws";import{useMemo as rK}from"react";import{FaInfo as rY}from"react-icons/fa6";import{use as rH}from"react";import{FaRepeat as rB}from"react-icons/fa6";import{createContext as rV}from"react";var rQ=rV(void 0);import rJ from"./react/apollo-error/apollo-error.module.scss";import{jsx as rW,jsxs as rX}from"react/jsx-runtime";function rz(){var e=rH(rQ),t=e===null||e===void 0?void 0:e.error;if(!t)return null;var r=function(e,t){return(t===null||t===void 0?void 0:t.length)?rX("div",{children:[rX("strong",{children:[e,":"]}),rW("ul",{children:t.map(function(e){return rW("li",{children:e.message},e.message)})})]}):null};return rW("div",{className:rJ["modal-backdrop"],children:rX("div",{className:rJ["modal-content"],children:[rW("button",{type:"button",className:rJ["btn-close"],onClick:e.hideError,children:"✕"}),rX("div",{className:rJ["error-title"],children:[rW("button",{type:"button",className:rJ["btn-retry"],onClick:function(){return window.location.reload()},children:rW(rB,{})})," ",t.message]}),rX("div",{className:rJ["error-details"],children:[t.networkError&&rX("pre",{className:"network",children:[rW("strong",{children:"Network Error:"})," ",t.networkError.message]}),r("GraphQL Errors",T(t.graphQLErrors)),r("Protocol Errors",T(t.protocolErrors)),r("Client Errors",T(t.clientErrors)),t.extraInfo&&rX("pre",{className:"extra",children:[rW("strong",{children:"Extra Info:"})," ",JSON.stringify(t.extraInfo,null,4)]})]})]})})}import{use as r$}from"react";function rZ(){var e=r$(rQ);if(!e)throw new Error("useApolloError must be used within ApolloErrorProvider");return e}import{useEffect as r0,useMemo as r1,useState as r2}from"react";import{jsx as r3}from"react/jsx-runtime";var r4=null;function r5(e){r4===null||r4===void 0?void 0:r4(e)}function r6(e){var t=e.children;var r=I(r2(null),2),n=r[0],s=r[1];r0(function(){r4=s},[]);var i=r1(function(){return{error:n,showError:s,hideError:function(){return s(null)}}},[n]);return r3(rQ,{value:i,children:t})}import{consola as r8}from"consola/browser";var r7={silent:r8.silent,level:r8.level,fatal:r8.fatal,error:r8.error,warn:r8.warn,log:r8.log,info:r8.info,success:r8.success,ready:r8.ready,start:r8.start,box:r8.box,debug:r8.debug,trace:r8.trace,verbose:r8.verbose};import{toast as r9,Toaster as ne}from"react-hot-toast";var nt="/graphql";import{Fragment as nr,jsx as nn,jsxs as ns}from"react/jsx-runtime";var ni=/*#__PURE__*/function(e){"use strict";f(t,e);function t(){a(this,t);var e;e=o(this,t,arguments);e.count=0;return e}u(t,[{key:"request",value:function e(e,t){var r=this;var n=Date.now();return this.count+=1,t(e).map(function(t){var s=Date.now()-n,i=e.operationName||"Unnamed";return r7.info("[Apollo] #".concat(r.count,": ").concat(i," (").concat(s,"ms)")),t})}}]);return t}(rw);function no(e){var t=e||{},r=t.uri,n=t.wsUrl,s=t.customLinks,i=new ni,o=rG(function(e){var t=e.graphQLErrors,r=e.networkError,n=e.protocolErrors,s=e.operation;var i=(s===null||s===void 0?void 0:s.operationName)||"Unknown";if(t&&t.forEach(function(e){var t=e.message,r=e.locations,n=e.path;r7.error("[GraphQL error] ".concat(i,": ").concat(t,", Location: ").concat(JSON.stringify(r),", Path: ").concat(n))}),n&&n.forEach(function(e){var t=e.message,r=e.extensions;r7.error("[Protocol error]: ".concat(t,", Extensions: ").concat(JSON.stringify(r)))}),r&&r7.error("[Network error]: ".concat(r)),t||n||r){var o,a;var c=(t===null||t===void 0?void 0:(o=t[0])===null||o===void 0?void 0:o.message)||(n===null||n===void 0?void 0:(a=n[0])===null||a===void 0?void 0:a.message)||(r===null||r===void 0?void 0:r.message)||"Unexpected error",u=new rb({graphQLErrors:t||[],protocolErrors:n||[],clientErrors:[],networkError:r||null,errorMessage:c,extraInfo:{operation:s}});r9.error(function(e){return ns(nr,{children:[c,"\xa0",nn(rY,{cursor:"pointer",onClick:function(){setTimeout(function(){r5(u)},0),r9.dismiss(e.id)}})]})})}}),a=rk();r||r7.warn('[Apollo] No GraphQL URI provided — using "'.concat(nt,'" as default'));var c=new rP({uri:r!==null&&r!==void 0?r:nt,credentials:"include"}),u=n?new rU(rq({url:n})):rw.empty(),l=p(u,rw)?rj(function(e){var t=e.query;var r=rF(t);return r.kind==="OperationDefinition"&&r.operation==="subscription"},u,c):c;return l===c&&n&&r7.warn("[Apollo] WS URL is set, but subscriptions fallback to HTTP. Check your wsLink config."),[i,o,a].concat(T(s!==null&&s!==void 0?s:[]),[l])}function na(e){var t=e.isNextJS,r=e.options,n=e.children,s=e.client,i=e.provider,o=e.cache;var a=r||{},c=a.uri,u=a.wsUrl,l=a.customLinks,d=S(a,["uri","wsUrl","customLinks"]);if(typeof(s!==null&&s!==void 0?s:rD)!="function")throw new TypeError("Invalid ApolloClient provided. Ensure CustomClient is a class.");var f=i||rx,E=rK(function(){return rL(no({uri:c,wsUrl:u,customLinks:l}))},[c,u,l]),m=rK(function(){return new rD(h({link:E,cache:p(o,rM)?o:new rM},d))},[E,o,d]),g=t?nn(f,{makeClient:function(){return m},children:n}):nn(f,{client:m,children:n});return t?nn(f,{makeClient:function(){return m},children:n}):ns(nr,{children:[ns(r6,{children:[g,nn(rz,{})]}),nn(ne,{position:"top-right"})]})}import nc from"i18next";import{initReactI18next as nu}from"react-i18next";function nl(e){return nc.use(nu).init(e)}import nd from"classnames";import nf from"./react/loading/loading.module.scss";import{jsx as np,jsxs as nE}from"react/jsx-runtime";function nm(e){var t=e.full,r=t===void 0?!1:t,n=e.block,s=n===void 0?!1:n,i=e.className,o=i===void 0?"":i,a=e.message,c=a===void 0?"Loading":a,u=S(e,["full","block","className","message"]);function l(){return nE("div",_(h({className:nf.container},u),{children:[np("div",{className:nf.ring}),np("div",{className:nf.ring}),np("div",{className:nf.ring}),np("div",{className:nf.ring}),c&&np("div",{className:nf.message,children:c})]}))}return r?np("div",{className:nd(nf.fullscreen,o),children:l()}):s?np("div",{className:nd(nf.block,o),children:l()}):l()}import{createContext as ng}from"react";var nv=ng(void 0);import{use as nh}from"react";function ny(){var e=nh(nv);if(!e)throw new Error("useLoading must be used within a LoadingProvider");return e}import{useCallback as n_,useMemo as nS,useState as nO}from"react";import{jsx as nA}from"react/jsx-runtime";function nN(e){var t=e.children;var r=I(nO(!1),2),n=r[0],s=r[1],i=I(nO(!1),2),o=i[0],a=i[1],c=n_(function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;s(!0),a(e)},[]),u=n_(function(){s(!1),a(!1)},[]),l=nS(function(){return{isLoading:n,isGlobalLoading:o,showLoading:c,hideLoading:u}},[n,o,c,u]);return nA(nv,{value:l,children:n?nA(nm,{full:o}):t})}import{createContext as nI}from"react";var nT=nI(void 0);import{NextIntlClientProvider as nC}from"next-intl";import{useTranslations as nR}from"next-intl";import{use as nD}from"react";function nb(){var e=nD(nT);if(!e)throw new Error("useNextIntl must be used within a NextIntlProvider");return e}var nw=nR;import{jsx as nx}from"react/jsx-runtime";function nL(e){var t=function(t){var r;var n=nb(),s=n.currentLanguage,i=t.messages,o=t.languages,a="en",c=i[(s===null||s===void 0?void 0:s.value)||a],u=(r=o.find(function(e){return e.value===(s===null||s===void 0?void 0:s.value)}))===null||r===void 0?void 0:r.timezone;return i?nx(nC,{locale:(s===null||s===void 0?void 0:s.value)||a,messages:c,timeZone:u,children:nx(e,h({},t))}):(r7.warn("Missing messages for language: ".concat((s===null||s===void 0?void 0:s.value)||a)),null)};return t.displayName="withNextIntl(".concat(e.displayName||e.name||"Component",")"),t}import{useMemo as nP}from"react";import{useCallback as nM,useEffect as nj,useState as nG}from"react";var nk={serialize:function(e){return JSON.stringify(e,function(e,t){return p(t,Date)?{__type:"Date",value:t.toISOString()}:t})},deserialize:function(e){return JSON.parse(e,function(e,t){return(t===null||t===void 0?void 0:t.__type)==="Date"?new Date(t.value):t})}};import nU from"localforage";var nF={get:function e(e){return i(function(){var t;return b(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);return[4,nU.getItem(e)];case 1:return[2,r.sent()];case 2:t=r.sent();return[2,(r7.error('[Storage:get] Error getting key "'.concat(e,'":'),t),null)];case 3:return[2]}})})()},set:function e(e,t){return i(function(){var r;return b(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,nU.setItem(e,t)];case 1:n.sent();return[3,3];case 2:r=n.sent();r7.error('[Storage:set] Error setting key "'.concat(e,'":'),r);return[3,3];case 3:return[2]}})})()},remove:function e(e){return i(function(){var t;return b(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);return[4,nU.removeItem(e)];case 1:r.sent();return[3,3];case 2:t=r.sent();r7.error('[Storage:remove] Error removing key "'.concat(e,'":'),t);return[3,3];case 3:return[2]}})})()},keys:function e(){return i(function(){var e,t;return b(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);return[4,nU.keys()];case 1:return[2,(e=r.sent())!==null&&e!==void 0?e:[]];case 2:t=r.sent();return[2,(r7.error("[Storage:keys] Error getting keys:",t),[])];case 3:return[2]}})})()}};function nq(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:nk;var n=I(nG(t),2),s=n[0],o=n[1],a=I(nG(!1),2),c=a[0],u=a[1];nj(function(){var n=!0;return i(function(){var s,i,a,c;return b(this,function(l){switch(l.label){case 0:l.trys.push([0,6,7,8]);return[4,nF.get(e)];case 1:s=l.sent();if(!n)return[3,5];if(!(s!==null))return[3,2];i=r.deserialize(s);o(i);return[3,5];case 2:if(!(t!==void 0))return[3,4];a=r.serialize(t);return[4,nF.set(e,a)];case 3:l.sent(),o(t);return[3,5];case 4:o(void 0);l.label=5;case 5:return[3,8];case 6:c=l.sent();r7.error('Error loading value for key "'.concat(e,'":'),c),n&&o(t);return[3,8];case 7:n&&u(!0);return[7];case 8:return[2]}})})(),function(){n=!1,u(!1)}},[e,t,r]),nj(function(){if(!c)return;i(function(){var t,n;return b(this,function(i){switch(i.label){case 0:i.trys.push([0,3,,4]);if(!(s!==void 0))return[3,2];t=r.serialize(s);return[4,nF.set(e,t)];case 1:i.sent();i.label=2;case 2:return[3,4];case 3:n=i.sent();r7.error('Error saving value for key "'.concat(e,'":'),n);return[3,4];case 4:return[2]}})})()},[s,e,r,c]);var l=nM(function(e){o(function(t){return typeof e=="function"?e(t):e})},[]),d=nM(/*#__PURE__*/i(function(){var t;return b(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);return[4,nF.remove(e)];case 1:r.sent(),o(void 0);return[3,3];case 2:t=r.sent();r7.error('Error removing key "'.concat(e,'":'),t);return[3,3];case 3:return[2]}})}),[e]);return{value:s,set:l,remove:d}}import{Fragment as nK,jsx as nY}from"react/jsx-runtime";function nH(e){var t=e.children;return nY(nK,{children:t})}var nB=nL(nH);function nV(e){var t=e.children,r=e.languages,n=e.messages;var s;var i=nq("lang",(s=r===null||r===void 0?void 0:r[0])!==null&&s!==void 0?s:{}),o=i.value,a=i.set,c=nP(function(){return{languages:r,currentLanguage:o,setCurrentLanguage:a}},[r,a,o]);return nY(nT,{value:c,children:nY(nB,{languages:r,messages:n,children:t})})}import nQ from"unorm";var nJ={a:["\xe0","\xe1","ạ","ả","\xe3","\xe2","ầ","ấ","ậ","ẩ","ẫ","ă","ằ","ắ","ặ","ẳ","ẵ"],e:["\xe8","\xe9","ẹ","ẻ","ẽ","\xea","ề","ế","ệ","ể","ễ"],i:["\xec","\xed","ị","ỉ","ĩ"],o:["\xf2","\xf3","ọ","ỏ","\xf5","\xf4","ồ","ố","ộ","ổ","ỗ","ơ","ờ","ớ","ợ","ở","ỡ"],u:["\xf9","\xfa","ụ","ủ","ũ","ư","ừ","ứ","ự","ử","ữ"],y:["ỳ","\xfd","ỵ","ỷ","ỹ"],d:["đ"]},nW=Object.entries(nJ).reduce(function(e,t){var r=I(t,2),n=r[0],s=r[1];return e[n.toUpperCase()]=s.map(function(e){return e.toUpperCase()}),e},{});function nX(e){e=nQ.nfkc(e);var t=h({},nJ,nW);var r=true,n=false,s=undefined;try{for(var i=Object.entries(t)[Symbol.iterator](),o;!(r=(o=i.next()).done);r=true){var a=I(o.value,2),c=a[0],u=a[1];var l="[".concat(c).concat(u.join(""),"]"),d="(".concat([c].concat(T(u)).join("|"),")");e=e.replace(new RegExp(l,"g"),d)}}catch(e){n=true;s=e}finally{try{if(!r&&i.return!=null){i.return()}}finally{if(n){throw s}}}return e}function nz(e){return e.normalize("NFD").replace(RegExp("\\p{Diacritic}","gu"),"")}export{rz as ApolloError,rQ as ApolloErrorContext,r6 as ApolloErrorProvider,na as ApolloProvider,eB as BUILD_DIRECTORY,Z as CHECK_PACKAGE_EMPTY_RESULT,tv as COMMAND,tw as COMMAND_DESCRIPTIONS,e9 as COMMIT_LINT_CLI,e7 as COMMIT_LINT_PACKAGE_NAME,e1 as CYBERSKILL_CLI,e2 as CYBERSKILL_CLI_PATH,e0 as CYBERSKILL_DIRECTORY,eK as CYBERSKILL_PACKAGE_NAME,eY as CYBERSKILL_STORAGE,rR as C_Collection,rI as C_Db,rT as C_Document,rC as C_Model,H as DEBUG,e4 as ESLINT_CLI,td as ESLINT_INSPECT_CLI,tl as ESLINT_INSPECT_PACKAGE_NAME,e3 as ESLINT_PACKAGE_NAME,U as E_CommandType,w as E_ConfigType,B as E_IssueType,ti as GIT_CLI,eZ as GIT_COMMIT_EDITMSG,e$ as GIT_HOOK,eW as GIT_IGNORE,nt as GRAPHQL_URI_DEFAULT,tm as HOOK,tb as IS_BROWSER,tt as LINT_STAGED_CLI,te as LINT_STAGED_PACKAGE_NAME,nm as Loading,nv as LoadingContext,nN as LoadingProvider,ry as MongoController,r_ as MongooseController,eH as NODE_MODULES,tp as NODE_MODULES_INSPECT_CLI,tf as NODE_MODULES_INSPECT_PACKAGE_NAME,nT as NextIntlContext,nV as NextIntlProvider,eV as PACKAGE_JSON,eQ as PACKAGE_LOCK_JSON,tE as PATH,e6 as PLAYWRIGHT_PACKAGE_NAME,to as PNPM_CLI,ta as PNPM_EXEC_CLI,ez as PNPM_LOCK_YAML,W as RESPONSE_STATUS,tc as SIMPLE_GIT_HOOKS_PACKAGE_NAME,tu as SIMPLE_GIT_HOOK_CLI,eX as SIMPLE_GIT_HOOK_JSON,eJ as TSCONFIG_JSON,tn as TSC_CLI,tr as TSC_PACKAGE_NAME,ts as TSX_CLI,ne as Toaster,e8 as VITEST_CLI,e5 as VITEST_PACKAGE_NAME,eq as WORKING_DIRECTORY,ru as aggregatePaginate,ei as appendFileSync,ed as checkPackage,eT as clearAllErrorLists,tS as deepMerge,eb as executeCommand,er as existsSync,eP as formatCommand,rg as generateShortId,rm as generateSlug,eu as getLatestPackageVersion,ec as getPackage,eN as getStoredErrorLists,nl as initI18Next,ty as isJson,t_ as isPlainObject,eF as join,r7 as log,$ as logNodeJS,tD as mergeConfigs,rh as mongo,rl as mongoosePaginate,ex as rawCommand,en as readFileSync,nX as regexSearchMapper,nz as removeAccent,eU as resolve,eM as resolveCommands,ek as resolveWorkingPath,eo as rmSync,nk as serializer,r5 as showGlobalApolloError,nF as storage,ey as storageNodeJS,X as throwError,r9 as toast,rZ as useApolloError,ny as useLoading,nb as useNextIntl,nq as useStorage,nw as useTranslateNextIntl,rv as validate,M as vitestE2E,th as vitestUnit,nL as withNextIntl,es as writeFileSync};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { COMMAND_DESCRIPTIONS_alias_2 as COMMAND_DESCRIPTIONS } from '../../_tsup-dts-rollup.cjs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { COMMAND_DESCRIPTIONS_alias_2 as COMMAND_DESCRIPTIONS } from '../../_tsup-dts-rollup.js';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";function e(e,t){if(t==null||t>e.length)t=e.length;for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function t(e){if(Array.isArray(e))return e}function n(t){if(Array.isArray(t))return e(t)}function r(e,t,n,r,i,s,o){try{var c=e[s](o);var a=c.value}catch(e){n(e);return}if(c.done){t(a)}else{Promise.resolve(a).then(r,i)}}function i(e){return function(){var t=this,n=arguments;return new Promise(function(i,s){var o=e.apply(t,n);function c(e){r(o,i,s,c,a,"next",e)}function a(e){r(o,i,s,c,a,"throw",e)}c(undefined)})}}function s(e,t,n){if(t in e){Object.defineProperty(e,t,{value:n,enumerable:true,configurable:true,writable:true})}else{e[t]=n}return e}function o(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function c(e,t){var n=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n==null)return;var r=[];var i=true;var s=false;var o,c;try{for(n=n.call(e);!(i=(o=n.next()).done);i=true){r.push(o.value);if(t&&r.length===t)break}}catch(e){s=true;c=e}finally{try{if(!i&&n["return"]!=null)n["return"]()}finally{if(s)throw c}}return r}function a(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};var r=Object.keys(n);if(typeof Object.getOwnPropertySymbols==="function"){r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))}r.forEach(function(t){s(e,t,n[t])})}return e}function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);if(t){r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})}n.push.apply(n,r)}return n}function p(e,t){t=t!=null?t:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(t))}else{d(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function f(e,n){return t(e)||c(e,n)||y(e,n)||a()}function g(e){return n(e)||o(e)||y(e)||u()}function h(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function y(t,n){if(!t)return;if(typeof t==="string")return e(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return e(t,n)}function m(e,t){var n,r,i,s,o={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]};return s={next:c(0),"throw":c(1),"return":c(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(e){return function(t){return a([e,t])}}function a(s){if(n)throw new TypeError("Generator is already executing.");while(o)try{if(n=1,r&&(i=s[0]&2?r["return"]:s[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;if(r=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:o.label++;return{value:s[1],done:false};case 5:o.label++;r=s[1];s=[0];continue;case 7:s=o.ops.pop();o.trys.pop();continue;default:if(!(i=o.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){o=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(s[0]===6&&o.label<i[1]){o.label=i[1];i=s;break}if(i&&o.label<i[2]){o.label=i[2];o.ops.push(s);break}if(i[2])o.ops.pop();o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e];r=0}finally{n=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}}var v=Object.create;var j=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var E=Object.getPrototypeOf,_=Object.prototype.hasOwnProperty;var S=function(e,t,n,r){var i=true,s=false,o=undefined;if(t&&(typeof t==="undefined"?"undefined":h(t))=="object"||typeof t=="function")try{var c=function(){var i=u.value;!_.call(e,i)&&i!==n&&j(e,i,{get:function(){return t[i]},enumerable:!(r=b(t,i))||r.enumerable})};for(var a=x(t)[Symbol.iterator](),u;!(i=(u=a.next()).done);i=true)c()}catch(e){s=true;o=e}finally{try{if(!i&&a.return!=null){a.return()}}finally{if(s){throw o}}}return e};var I=function(e,t,n){return n=e!=null?v(E(e)):{},S(t||!e||!e.__esModule?j(n,"default",{value:e,enumerable:!0}):n,e)};var O=I(require("process"),1),w=require("yargs/helpers"),N=I(require("yargs/yargs"),1);var T=I(require("process"),1),D=T.default.env.DEBUG==="true";var P={name:"@cyberskill/shared",type:"module",version:"1.66.0",description:"CyberSkill Shared",author:"Stephen Cheng",license:"MIT",homepage:"https://github.com/cyberskill-world/shared#readme",repository:{type:"git",url:"git+https://github.com/cyberskill-world/shared.git"},bugs:{url:"https://github.com/cyberskill-world/shared/issues"},exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./configs":{types:"./dist/configs/index.d.ts",import:"./dist/configs/index.js",require:"./dist/configs/index.cjs"},"./configs/commitlint":{types:"./dist/configs/commitlint/index.d.ts",import:"./dist/configs/commitlint/index.js",require:"./dist/configs/commitlint/index.cjs"},"./configs/eslint":{types:"./dist/configs/eslint/index.d.ts",import:"./dist/configs/eslint/index.js",require:"./dist/configs/eslint/index.cjs"},"./configs/graphql":{types:"./dist/configs/graphql/index.d.ts",import:"./dist/configs/graphql/index.js",require:"./dist/configs/graphql/index.cjs"},"./configs/lint-staged":{types:"./dist/configs/lint-staged/index.d.ts",import:"./dist/configs/lint-staged/index.js",require:"./dist/configs/lint-staged/index.cjs"},"./configs/vitest/react/e2e":{types:"./dist/configs/vitest/react/e2e.d.ts",import:"./dist/configs/vitest/react/e2e.js",require:"./dist/configs/vitest/react/e2e.cjs"},"./configs/vitest/react/unit":{types:"./dist/configs/vitest/react/unit.d.ts",import:"./dist/configs/vitest/react/unit.js",require:"./dist/configs/vitest/react/unit.cjs"},"./constants":{types:"./dist/constants/index.d.ts",import:"./dist/constants/index.js",require:"./dist/constants/index.cjs"},"./nodejs":{types:"./dist/nodejs/index.d.ts",import:"./dist/nodejs/index.js",require:"./dist/nodejs/index.cjs"},"./nodejs/cli":{types:"./dist/nodejs/cli/index.d.ts",import:"./dist/nodejs/cli/index.js",require:"./dist/nodejs/cli/index.cjs"},"./nodejs/command":{types:"./dist/nodejs/command/index.d.ts",import:"./dist/nodejs/command/index.js",require:"./dist/nodejs/command/index.cjs"},"./nodejs/fs":{types:"./dist/nodejs/fs/index.d.ts",import:"./dist/nodejs/fs/index.js",require:"./dist/nodejs/fs/index.cjs"},"./nodejs/log":{types:"./dist/nodejs/log/index.d.ts",import:"./dist/nodejs/log/index.js",require:"./dist/nodejs/log/index.cjs"},"./nodejs/mongo":{types:"./dist/nodejs/mongo/index.d.ts",import:"./dist/nodejs/mongo/index.js",require:"./dist/nodejs/mongo/index.cjs"},"./nodejs/package":{types:"./dist/nodejs/package/index.d.ts",import:"./dist/nodejs/package/index.js",require:"./dist/nodejs/package/index.cjs"},"./nodejs/path":{types:"./dist/nodejs/path/index.d.ts",import:"./dist/nodejs/path/index.js",require:"./dist/nodejs/path/index.cjs"},"./nodejs/storage":{types:"./dist/nodejs/storage/index.d.ts",import:"./dist/nodejs/storage/index.js",require:"./dist/nodejs/storage/index.cjs"},"./react":{types:"./dist/react/index.d.ts",import:"./dist/react/index.js",require:"./dist/react/index.cjs"},"./react/apollo-client":{types:"./dist/react/apollo-client/index.d.ts",import:"./dist/react/apollo-client/index.js",require:"./dist/react/apollo-client/index.cjs"},"./react/apollo-error":{types:"./dist/react/apollo-error/index.d.ts",import:"./dist/react/apollo-error/index.js",require:"./dist/react/apollo-error/index.cjs"},"./react/i18next":{types:"./dist/react/i18next/index.d.ts",import:"./dist/react/i18next/index.js",require:"./dist/react/i18next/index.cjs"},"./react/loading":{types:"./dist/react/loading/index.d.ts",import:"./dist/react/loading/index.js",require:"./dist/react/loading/index.cjs"},"./react/log":{types:"./dist/react/log/index.d.ts",import:"./dist/react/log/index.js",require:"./dist/react/log/index.cjs"},"./react/next-intl":{types:"./dist/react/next-intl/index.d.ts",import:"./dist/react/next-intl/index.js",require:"./dist/react/next-intl/index.cjs"},"./react/storage":{types:"./dist/react/storage/index.d.ts",import:"./dist/react/storage/index.js",require:"./dist/react/storage/index.cjs"},"./react/toast":{types:"./dist/react/toast/index.d.ts",import:"./dist/react/toast/index.js",require:"./dist/react/toast/index.cjs"},"./react/vitest":{types:"./dist/react/vitest/index.d.ts",import:"./dist/react/vitest/index.js",require:"./dist/react/vitest/index.cjs"},"./styles/reset.css":{import:"./dist/styles/reset.css",require:"./dist/styles/reset.css"},"./typescript":{types:"./dist/typescript/index.d.ts",import:"./dist/typescript/index.js",require:"./dist/typescript/index.cjs"},"./utils":{types:"./dist/utils/index.d.ts",import:"./dist/utils/index.js",require:"./dist/utils/index.cjs"}},main:"./dist/index.cjs",module:"./dist/index.js",types:"./dist/index.d.ts",bin:{cyberskill:"./dist/nodejs/cli/index.js"},files:["dist","public"],scripts:{build:"tsup",dev:"dotenv -e .env -- tsup --watch",lint:"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint","lint:fix":"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint:fix","lint:inspect":"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint:inspect",reset:"dotenv -e .env -- tsx src/nodejs/cli/index.ts reset",setup:"dotenv -e .env -- tsx src/nodejs/cli/index.ts setup",inspect:"dotenv -e .env -- tsx src/nodejs/cli/index.ts inspect","test:unit":"dotenv -e .env -- tsx src/nodejs/cli/index.ts test:unit","test:e2e":"dotenv -e .env -- tsx src/nodejs/cli/index.ts test:e2e",commitlint:"dotenv -e .env -- tsx src/nodejs/cli/index.ts commitlint","lint-staged":"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint-staged"},dependencies:{"@antfu/eslint-config":"4.11.0","@apollo/client":"3.13.6","@eslint-react/eslint-plugin":"1.41.0","@graphql-codegen/cli":"5.0.5","@graphql-codegen/client-preset":"4.8.0","@graphql-codegen/typescript-react-apollo":"4.3.2","@microsoft/api-extractor":"7.52.3","@next/eslint-plugin-next":"15.2.4","@swc/core":"1.11.18","@testing-library/jest-dom":"6.6.3","@testing-library/react":"16.3.0","@vitejs/plugin-react-swc":"3.8.1","@vitest/browser":"3.1.1",chalk:"5.4.1",classnames:"2.5.1",consola:"3.4.2","crypto-js":"4.2.0","date-fns":"4.1.0","dotenv-cli":"8.0.0","eslint-config-next":"15.2.4","eslint-plugin-format":"1.0.1","eslint-plugin-react-hooks":"5.2.0","eslint-plugin-react-refresh":"0.4.19",globals:"16.0.0",graphql:"16.10.0","graphql-ws":"6.0.4",i18next:"24.2.3",jsdom:"26.0.0",localforage:"1.10.0","modern-normalize":"3.0.1",mongodb:"6.15.0",mongoose:"8.13.2","mongoose-aggregate-paginate-v2":"1.1.4","mongoose-paginate-v2":"1.9.0","next-intl":"4.0.2","node-fetch":"3.3.2","node-persist":"4.0.4",ora:"8.2.0",playwright:"1.51.1","postcss-modules":"6.0.1",qs:"6.14.0",react:"19.1.0","react-dom":"19.1.0","react-hot-toast":"2.5.2","react-i18next":"15.4.1","react-icons":"5.5.0",sass:"1.86.3",slugify:"1.6.6",tsup:"8.4.0",tsx:"4.19.3",typescript:"5.8.3",unorm:"1.6.0",uuid:"11.1.0",vite:"6.2.5",vitest:"3.1.1","vitest-browser-react":"0.1.1",yargs:"17.7.2"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},devDependencies:{"@commitlint/cli":"19.8.0","@eslint/config-inspector":"1.0.2","@types/crypto-js":"4.2.2","@types/mongoose-aggregate-paginate-v2":"1.0.12","@types/node-persist":"3.1.8","@types/react":"19.1.0","@types/react-dom":"19.1.1","@types/unorm":"1.3.31","@types/uuid":"10.0.0","@types/yargs":"17.0.33",eslint:"9.24.0","lint-staged":"15.5.0","node-modules-inspector":"0.6.3","simple-git-hooks":"2.12.1"}};var C={lint:"Check code for linting issues","lint:fix":"Fix linting issues automatically","lint:inspect":"View active ESLint configuration","lint-staged":"Run lint checks on staged files",commitlint:"Validate commit message format",setup:"Initialize project setup and dependencies",reset:"Reset the project and reinstall dependencies",inspect:"Analyze installed project dependencies","test:unit":"Run unit test suite","test:e2e":"Run end-to-end test suite"};var A=require("child_process"),L=I(require("process"),1),R=I(require("util"),1);var k=I(require("chalk"),1),q=I(require("consola"),1),G=require("graphql");D||(q.default.level=4);function M(e){var t=k.default[e];return typeof t=="function"?t:k.default.green}var K={silent:q.default.silent,level:q.default.level,fatal:q.default.fatal,error:q.default.error,warn:q.default.warn,log:q.default.log,info:q.default.info,success:q.default.success,ready:q.default.ready,start:q.default.start,box:q.default.box,debug:q.default.debug,trace:q.default.trace,verbose:q.default.verbose,printBoxedLog:function e(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(t===null||t===void 0?void 0:t.length)){q.default.box(k.default.green(e));return}t.forEach(function(e){var t=e.file,r=e.position,i=e.rule,s=e.message;q.default.log("".concat(k.default.gray("File:")," ").concat(k.default.blue("".concat(t).concat(r?":".concat(r):"")))),i&&q.default.log(" ".concat(M(n)("Rule:")," ").concat(i)),q.default.log(" ".concat(M(n)("Message:")," ").concat(s))}),q.default.box(M(n)("".concat(e," : ").concat(t.length))),q.default.log(k.default.gray("─".repeat(40)))}};var F={isCurrentProject:!1,installedPath:"",file:{},isUpToDate:!1};var U=I(require("node-fetch"),1);var Y=I(require("fs"),1);function B(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return t.every(function(e){return Y.existsSync(e)})}function J(e,t){var n=Y.readFileSync(e,"utf-8");if(t===null||t===void 0?void 0:t.asJson)try{var r=JSON.parse(n);if((typeof r==="undefined"?"undefined":h(r))=="object"&&r!==null)return r;throw new Error("Parsed JSON is not an object or array")}catch(t){throw new Error("Failed to parse JSON from file: ".concat(e))}return n}function W(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=n.isJson,i=r===void 0?!1:r,s=i&&(typeof t==="undefined"?"undefined":h(t))=="object"?JSON.stringify(t,null,4):String(t);Y.writeFileSync(e,s,"utf-8")}function X(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=n.isJson,i=r===void 0?!1:r,s=i&&(typeof t==="undefined"?"undefined":h(t))=="object"?JSON.stringify(t,null,4):String(t);Y.appendFileSync(e,s,"utf-8")}function H(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}t.forEach(function(e){B(e)&&Y.rmSync(e,{recursive:!0,force:!0})})}var V=I(require("process"),1);var $=I(require("path"),1);function z(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=$).resolve.apply(r,[Z].concat(g(t)))}function Q(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=$).join.apply(r,g(t))}var Z=V.default.env.INIT_CWD||V.default.cwd(),ee="@cyberskill/shared",et=".cyberskill-storage",en="node_modules",er="dist",ei="package.json",es="package-lock.json",eo="tsconfig.json",ec=".gitignore",ea=".simple-git-hooks.json",eu="pnpm-lock.yaml",el=".git/hooks/",ed=".git/COMMIT_EDITMSG",ep=Q(Z,en,ee,er),ef="cyberskill",eg="src/nodejs/cli/index.ts",eh="eslint",ey="eslint",em="vitest",ev="playwright",ej="vitest",eb="@commitlint/cli",ex="commitlint",eE="lint-staged",e_="lint-staged",eS="typescript",eI="tsc",eO="tsx",ew="git",eN="pnpm",eT="pnpm exec",eD="simple-git-hooks",eP="simple-git-hooks",eC="@eslint/config-inspector",eA="eslint-config-inspector",eL="node-modules-inspector",eR="node-modules-inspector",ek={CYBERSKILL_DIRECTORY:ep,WORKING_DIRECTORY:Z,TS_CONFIG:z(eo),GIT_IGNORE:z(ec),GIT_HOOK:z(el),GIT_COMMIT_MSG:z(ed),SIMPLE_GIT_HOOKS_JSON:z(ea),PACKAGE_JSON:z(ei),PACKAGE_LOCK_JSON:z(es),PNPM_LOCK_YAML:z(eu),NODE_MODULES:z(en),CYBERSKILL:{LINT_STAGED_CONFIG:z("".concat(ep,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:z("".concat(ep,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:z("".concat(ep,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:z("".concat(ep,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:z("".concat(ep,"/react/vitest/vitest.e2e.js"))}};function eq(e){var t=e.isCurrentProject;return l({"pre-commit":e_,"commit-msg":ex},t&&{"pre-push":tt("".concat(ew," pull"))})}function eG(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++){n[r-1]=arguments[r]}var i=f(n,2),s=i[0],o=i[1],c=e==="RAW"?!0:B.apply(void 0,g(s.split(" ").map(function(e){return Q(ek.NODE_MODULES,e)})));switch(e){case"PNPM_ADD_AND_EXEC":return tr(tt("".concat(c?"":"".concat(eN," add ").concat(s," && ")).concat(eT," ").concat(o)));case"PNPM_ADD_DEV_AND_EXEC":return tr(tt("".concat(c?"":"".concat(eN," add -D ").concat(s," && ")).concat(eT," ").concat(o)));case"RAW":return tr(tt(s))}}var eM={SIMPLE_GIT_HOOKS:eG("PNPM_ADD_DEV_AND_EXEC",eD,eP),ESLINT_INSPECT:eG("PNPM_ADD_DEV_AND_EXEC",eC,eA),NODE_MODULES_INSPECT:eG("PNPM_ADD_DEV_AND_EXEC",eL,eR),ESLINT_CHECK:eG("PNPM_ADD_DEV_AND_EXEC",eh,"".concat(ey," ").concat(ek.WORKING_DIRECTORY)),ESLINT_FIX:eG("PNPM_ADD_DEV_AND_EXEC",eh,"".concat(ey," ").concat(ek.WORKING_DIRECTORY," --fix")),TYPESCRIPT_CHECK:eG("PNPM_ADD_AND_EXEC",eS,"".concat(eI," -p ").concat(ek.TS_CONFIG," --noEmit")),CONFIGURE_GIT_HOOK:eG("RAW","".concat(ew," config core.hooksPath ").concat(ek.GIT_HOOK)),BUILD:eG("RAW","".concat(eN," run build")),STAGE_BUILD_DIRECTORY:eG("RAW","".concat(ew," add ").concat(er)),PNPM_INSTALL_STANDARD:eG("RAW","".concat(eN," install")),PNPM_INSTALL_LEGACY:eG("RAW","".concat(eN," install --legacy-peer-deps")),PNPM_INSTALL_FORCE:eG("RAW","".concat(eN," install --force")),CYBERSKILL:{TEST_UNIT:eG("PNPM_ADD_AND_EXEC",em,"".concat(ej," --config ").concat(ek.CYBERSKILL.UNIT_TEST_CONFIG)),TEST_E2E:eG("PNPM_ADD_AND_EXEC","".concat(em," ").concat(ev),"".concat(ej," --config ").concat(ek.CYBERSKILL.E2E_TEST_CONFIG)),COMMIT_LINT:eG("PNPM_ADD_DEV_AND_EXEC",eb,"".concat(ex," --edit ").concat(ek.GIT_COMMIT_MSG," --config ").concat(ek.CYBERSKILL.COMMITLINT_CONFIG)),LINT_STAGED:eG("PNPM_ADD_DEV_AND_EXEC",eE,"".concat(e_," --config ").concat(ek.CYBERSKILL.LINT_STAGED_CONFIG))}};var eK={};function eF(e){if(e in eK)return eK[e];var t=Q(Z,ei);if(!B(t))return eK[e]=!1;try{var n,r;var i=J(t,{asJson:!0}),s=i.name===e,o=!!((n=i.dependencies)===null||n===void 0?void 0:n[e]),c=!!((r=i.devDependencies)===null||r===void 0?void 0:r[e]);return s||o||c?eK[e]={path:t,file:i,isCurrentProject:s,isDepend:o,isDevDepend:c}:eK[e]=!1}catch(t){return K.warn("Failed to read package.json: ".concat(t.message)),eK[e]=!1}}function eU(e){return eY.apply(this,arguments)}function eY(){eY=i(function(e){var t,n,r,i;return m(this,function(s){switch(s.label){case 0:s.trys.push([0,3,,4]);return[4,(0,U.default)("https://registry.npmjs.org/".concat(e,"/latest"))];case 1:t=s.sent();if(!t.ok)throw new Error("Failed to fetch latest version: ".concat(t.status," ").concat(t.statusText));return[4,t.json()];case 2:n=s.sent(),r=n.version;return[2,r];case 3:i=s.sent();throw K.error('Failed to fetch version for "'.concat(e,'": ').concat(i.message)),i;case 4:return[2]}})});return eY.apply(this,arguments)}function eB(e,t){return eJ.apply(this,arguments)}function eJ(){eJ=i(function(e,t){var n,r,i,o,c,a,u,d,f,g,h,y,v,j,b;return m(this,function(m){switch(m.label){case 0:m.trys.push([0,4,,5]);c=eF(e);if(!c)return[2,l({},F)];a=c.path,u=c.file,d=c.isCurrentProject,f=c.isDepend,g=c.isDevDepend,h="0.0.0";d&&u.version?h=u.version:f&&((n=u.dependencies)===null||n===void 0?void 0:n[e])?h=(r=u.dependencies)===null||r===void 0?void 0:r[e]:g&&((i=u.devDependencies)===null||i===void 0?void 0:i[e])&&(h=(o=u.devDependencies)===null||o===void 0?void 0:o[e]);if(!d)return[3,1];j=h;return[3,3];case 1:return[4,eU(e)];case 2:j=m.sent();m.label=3;case 3:y=j,v=d||h===y;return[2,(!v&&(t===null||t===void 0?void 0:t.update)&&(f?u.dependencies=p(l({},u.dependencies||{}),s({},e,y)):g&&(u.devDependencies=p(l({},u.devDependencies||{}),s({},e,y))),K.info('Updating package "'.concat(e,'" to version ').concat(y)),W(a,u,{isJson:!0})),{isCurrentProject:d,installedPath:a,file:u,isUpToDate:v})];case 4:b=m.sent();return[2,(K.error('Error checking package "'.concat(e,'": ').concat(b.message)),l({},F))];case 5:return[2]}})});return eJ.apply(this,arguments)}var eW=I(require("node-persist"),1),eX=I(require("os"),1),eH=I(require("process"),1);function eV(){return eH.default.env.CYBERSKILL_STORAGE_DIR||Q(eX.default.homedir(),et)}function e$(){return ez.apply(this,arguments)}function ez(){ez=i(function(){var e;return m(this,function(t){switch(t.label){case 0:e=eW.default.defaultInstance;if(e)return[3,2];return[4,eW.default.init({dir:eV(),stringify:JSON.stringify,parse:JSON.parse,encoding:"utf8",logging:!1,forgiveParseErrors:!0})];case 1:e=t.sent();t.label=2;case 2:e;return[2]}})});return ez.apply(this,arguments)}var eQ={get:function e(e){return i(function(){var t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,e$()];case 1:r.sent();return[4,eW.default.getItem(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:null];case 3:n=r.sent();return[2,(K.error('[Storage:get] Error getting key "'.concat(e,'":'),n),null)];case 4:return[2]}})})()},set:function e(e,t){return i(function(){var n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,e$()];case 1:r.sent();return[4,eW.default.setItem(e,t)];case 2:r.sent();return[3,4];case 3:n=r.sent();K.error('[Storage:set] Error setting key "'.concat(e,'":'),n);return[3,4];case 4:return[2]}})})()},remove:function e(e){return i(function(){var t;return m(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,e$()];case 1:n.sent();return[4,eW.default.removeItem(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();K.error('[Storage:remove] Error removing key "'.concat(e,'":'),t);return[3,4];case 4:return[2]}})})()},keys:function e(){return i(function(){var e,t;return m(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,e$()];case 1:n.sent();return[4,eW.default.keys()];case 2:e=n.sent();return[2,Array.isArray(e)?e:(K.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=n.sent();return[2,(K.error("[Storage:keys] Error getting keys:",t),[])];case 4:return[2]}})})()},getLogLink:function e(e){return i(function(){return m(this,function(t){try{return[2,"".concat(eV()," (key: ").concat(e,")")]}catch(e){return[2,(K.error("[Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};var eZ=R.promisify(A.exec);function e0(e){return"error_list:".concat(e)}function e1(e){return e2.apply(this,arguments)}function e2(){e2=i(function(e){var t,n,r;return m(this,function(s){switch(s.label){case 0:if(e.length===0)return[2];t=Date.now(),n=e0(t);s.label=1;case 1:s.trys.push([1,3,,4]);return[4,eQ.set(n,{errors:e,timestamp:t})];case 2:s.sent(),setTimeout(/*#__PURE__*/i(function(){var e;return m(this,function(t){switch(t.label){case 0:return[4,eQ.getLogLink(n)];case 1:e=t.sent();e&&K.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})}),10);return[3,4];case 3:r=s.sent();K.error("Failed to save errors: ".concat(r.message));return[3,4];case 4:return[2]}})});return e2.apply(this,arguments)}function e4(){return e3.apply(this,arguments)}function e3(){e3=i(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,eQ.keys()];case 1:e=r.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(/*#__PURE__*/function(){var e=i(function(e){var t;return m(this,function(n){switch(n.label){case 0:return[4,eQ.get(e)];case 1:return[2,((t=n.sent())===null||t===void 0?void 0:t.errors)||[]]}})});return function(t){return e.apply(this,arguments)}}()))];case 2:return[2,r.sent().flat()];case 3:n=r.sent();return[2,(K.error("Failed to retrieve stored errors: ".concat(n.message)),[])];case 4:return[2]}})});return e3.apply(this,arguments)}function e5(){return e6.apply(this,arguments)}function e6(){e6=i(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,eQ.keys()];case 1:e=r.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(function(e){return eQ.remove(e)}))];case 2:r.sent();return[3,4];case 3:n=r.sent();K.error("Failed to clear error lists: ".concat(n.message));return[3,4];case 4:return[2]}})});return e6.apply(this,arguments)}function e8(e){var t=[],n=[],r="",i=/^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/,s=/^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/,o=/^✖\s+(.*?)\s+\[(.*?)\]$/;e.split("\n").forEach(function(e){if(e.startsWith("/"))r=e.trim();else{var c=i.exec(e)||[],a=s.exec(e)||[],u=o.exec(e)||[];c.length&&r?t.push({file:r,position:"".concat(c[1],":").concat(c[2]),type:c[3]==="error"?"error":"warning",message:c[4].trim(),rule:c[5].trim()}):a.length?t.push({file:a[1],position:"".concat(a[2],":").concat(a[3]),type:a[4]==="error"?"error":"warning",message:a[5].trim()}):u.length?t.push({file:"commitlint",type:"error",message:u[1].trim(),rule:u[2].trim()}):n.push(e.trim())}}),t.length&&e1(t),D&&n.length&&(K.warn("Unmatched lines:"),n.forEach(function(e){return K.info(" ".concat(e))}))}function e7(e){try{var t=JSON.parse(e),n=[];t.forEach(function(e){var t=e.filePath,r=e.messages;r.forEach(function(e){var r=e.severity,i=e.line,s=e.column,o=e.ruleId,c=e.message;n.push({type:r===2?"error":"warning",file:t,position:"".concat(i,":").concat(s),rule:o,message:c})})}),n.length&&e1(n)}catch(t){e8(e)}}function e9(e){return te.apply(this,arguments)}function te(){te=i(function(e){var t,n,r,i,s,o,c,a,u;var l=arguments;return m(this,function(d){switch(d.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:e7;n=new AbortController;L.default.on("SIGINT",function(){K.warn("Process interrupted. Terminating..."),n.abort(),L.default.exit()});d.label=1;case 1:d.trys.push([1,3,,4]);return[4,eZ(e,{maxBuffer:0x6400000,signal:n.signal})];case 2:r=d.sent(),i=r.stdout,s=r.stderr;[i,s].forEach(function(e){return e&&t(e)});return[3,4];case 3:o=d.sent();c=o.stdout,a=o.stderr,u=o.message;[c,a].forEach(function(e){return e&&t(e)}),!a&&!c&&K.error("Command failed: ".concat(u));return[3,4];case 4:return[2]}})});return te.apply(this,arguments)}function tt(e){return{raw:!0,cmd:e}}function tn(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(eT," ").concat(ee," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(eT," ").concat(eO," ").concat(eg," ").concat(e):"".concat(eT," ").concat(ef," ").concat(e)}function tr(e,t){return typeof e=="function"?tn(e(t),t):(typeof e==="undefined"?"undefined":h(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?tn(e,t):e}function ti(e){return ts.apply(this,arguments)}function ts(){ts=i(function(e){var t,n,r,i,s,o,c;var a=arguments;return m(this,function(u){switch(u.label){case 0:t=a.length>1&&a[1]!==void 0?a[1]:{};r=(n=t===null||t===void 0?void 0:t.isRemote)!==null&&n!==void 0?n:!1;if(!r)return[3,1];c=!1;return[3,3];case 1:return[4,eB(ee)];case 2:c=u.sent().isCurrentProject;u.label=3;case 3:i=c,s={isRemote:r,isCurrentProject:i},o=typeof e=="function"?e(s):e;return[2,Object.fromEntries(Object.entries(o).map(function(e){var t=f(e,2),n=t[0],r=t[1];return[n,tr(r,s)]}))]}})});return ts.apply(this,arguments)}function to(e,t){return tc.apply(this,arguments)}function tc(){tc=i(function(e,t){var n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);K.start("".concat(e)),D&&K.info("→ ".concat(t));return[4,e9(t)];case 1:r.sent(),K.success("".concat(e," done."));return[3,3];case 2:n=r.sent();throw K.error("".concat(e," failed: ").concat(n.message)),n;case 3:return[2]}})});return tc.apply(this,arguments)}function ta(){return tu.apply(this,arguments)}function tu(){tu=i(function(){var e;return m(this,function(t){switch(t.label){case 0:if(!B(ek.TS_CONFIG))return[3,2];return[4,to("Performing TypeScript validation",eM.TYPESCRIPT_CHECK)];case 1:e=t.sent();return[3,3];case 2:e=K.warn("No TypeScript configuration found. Skipping type check.");t.label=3;case 3:e;return[2]}})});return tu.apply(this,arguments)}function tl(){return td.apply(this,arguments)}function td(){td=i(function(){var e,t;var n=arguments;return m(this,function(r){switch(r.label){case 0:e=n.length>0&&n[0]!==void 0?n[0]:!1;if(!e)return[3,2];return[4,to("Running ESLint with auto-fix",eM.ESLINT_FIX)];case 1:t=r.sent();return[3,4];case 2:return[4,to("Running ESLint check",eM.ESLINT_CHECK)];case 3:t=r.sent();r.label=4;case 4:t;return[2]}})});return td.apply(this,arguments)}function tp(e,t){if(!t.length)return;var n=e==="Errors"?"red":"yellow";K.printBoxedLog(e==="Errors"?"✖ Errors":"⚠ Warnings",t,n)}function tf(){return tg.apply(this,arguments)}function tg(){tg=i(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:return[4,e4()];case 1:e=r.sent(),t=e.filter(function(e){return e.type==="error"}),n=e.filter(function(e){return e.type==="warning"});!t.length&&!n.length?K.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(tp("Warnings",n),tp("Errors",t));return[2]}})});return tg.apply(this,arguments)}function th(){return ty.apply(this,arguments)}function ty(){ty=i(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:return[4,e5()];case 1:r.sent();return[4,eB(ee)];case 2:e=r.sent(),t=e.isCurrentProject;if(!t)return[3,7];r.label=3;case 3:r.trys.push([3,6,,7]);return[4,to("Building package: ".concat(ee),eM.BUILD)];case 4:r.sent();return[4,to("Staging build artifacts",eM.STAGE_BUILD_DIRECTORY)];case 5:r.sent();return[3,7];case 6:n=r.sent();throw K.error("Error building and staging ".concat(ee,": ").concat(n.message)),n;case 7:return[4,to("Executing lint-staged",eM.CYBERSKILL.LINT_STAGED)];case 8:r.sent(),tf();return[2]}})});return ty.apply(this,arguments)}function tm(){return tv.apply(this,arguments)}function tv(){tv=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,to("Inspecting ESLint configuration",eM.ESLINT_INSPECT)];case 1:e.sent();return[2]}})});return tv.apply(this,arguments)}function tj(){return tb.apply(this,arguments)}function tb(){tb=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,e5()];case 1:e.sent();return[4,Promise.all([ta(),tl()])];case 2:e.sent(),tf();return[2]}})});return tb.apply(this,arguments)}function tx(){return tE.apply(this,arguments)}function tE(){tE=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,e5()];case 1:e.sent();return[4,Promise.all([ta(),tl(!0)])];case 2:e.sent(),tf();return[2]}})});return tE.apply(this,arguments)}function t_(){return tS.apply(this,arguments)}function tS(){tS=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,e5()];case 1:e.sent();return[4,to("Validating commit message",eM.CYBERSKILL.COMMIT_LINT)];case 2:e.sent(),tf();return[2]}})});return tS.apply(this,arguments)}function tI(){return tO.apply(this,arguments)}function tO(){tO=i(function(){var e,t;return m(this,function(n){switch(n.label){case 0:return[4,to("Configuring Git hooks",eM.CONFIGURE_GIT_HOOK)];case 1:n.sent(),H(ek.GIT_HOOK);return[4,ti(eq)];case 2:e=n.sent();W(ek.SIMPLE_GIT_HOOKS_JSON,e,{isJson:!0});t="\n".concat(ea,"\n");B(ek.GIT_IGNORE)?J(ek.GIT_IGNORE).split("\n").includes(ea)||X(ek.GIT_IGNORE,t):W(ek.GIT_IGNORE,t);return[4,to("Setting up simple-git-hooks",eM.SIMPLE_GIT_HOOKS)];case 3:n.sent();return[2]}})});return tO.apply(this,arguments)}function tw(){return tN.apply(this,arguments)}function tN(){tN=i(function(){var e,t,n,r,i,s,o,c,a,u,l;return m(this,function(d){switch(d.label){case 0:e=[{command:eM.PNPM_INSTALL_STANDARD,message:"Installing dependencies (standard)"},{command:eM.PNPM_INSTALL_LEGACY,message:"Retrying with legacy peer dependencies"},{command:eM.PNPM_INSTALL_FORCE,message:"Retrying with force install"}];t=true,n=false,r=undefined;d.label=1;case 1:d.trys.push([1,8,9,10]);i=e[Symbol.iterator]();d.label=2;case 2:if(!!(t=(s=i.next()).done))return[3,7];o=s.value,c=o.command,a=o.message;d.label=3;case 3:d.trys.push([3,5,,6]);return[4,to("".concat(a," using: ").concat(c),c)];case 4:d.sent();return[2];case 5:u=d.sent();K.warn("Installation attempt failed: ".concat(c)),K.error("Details: ".concat(u.message));return[3,6];case 6:t=true;return[3,2];case 7:return[3,10];case 8:l=d.sent();n=true;r=l;return[3,10];case 9:try{if(!t&&i.return!=null){i.return()}}finally{if(n){throw r}}return[7];case 10:throw new Error("All dependency installation strategies failed.")}})});return tN.apply(this,arguments)}function tT(e,t){return tD.apply(this,arguments)}function tD(){tD=i(function(e,t){var n,r,i,s,o,c,a,u,l,d,p,f;return m(this,function(g){switch(g.label){case 0:if(!B(ek.PACKAGE_JSON)){K.error("package.json not found. Aborting setup.");return[2]}g.label=1;case 1:g.trys.push([1,14,,15]);return[4,eB(e,{update:t===null||t===void 0?void 0:t.update})];case 2:n=g.sent(),r=n.isUpToDate;i=r;if(i)return[3,5];return[4,tw()];case 3:g.sent();return[4,tx()];case 4:i=g.sent();g.label=5;case 5:i;o=true,c=false,a=undefined;g.label=6;case 6:g.trys.push([6,11,12,13]);u=((s=t===null||t===void 0?void 0:t.postInstallActions)!==null&&s!==void 0?s:[])[Symbol.iterator]();g.label=7;case 7:if(!!(o=(l=u.next()).done))return[3,10];d=l.value;return[4,d()];case 8:g.sent();g.label=9;case 9:o=true;return[3,7];case 10:return[3,13];case 11:p=g.sent();c=true;a=p;return[3,13];case 12:try{if(!o&&u.return!=null){u.return()}}finally{if(c){throw a}}return[7];case 13:K.success('"'.concat(e,'" setup completed.'));return[3,15];case 14:f=g.sent();throw K.error('Failed to setup "'.concat(e,'": ').concat(f.message)),f;case 15:return[2]}})});return tD.apply(this,arguments)}function tP(){return tC.apply(this,arguments)}function tC(){tC=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,tT(ee,{update:!0,postInstallActions:[tI]})];case 1:e.sent();return[2]}})});return tC.apply(this,arguments)}function tA(){return tL.apply(this,arguments)}function tL(){tL=i(function(){return m(this,function(e){switch(e.label){case 0:H(ek.NODE_MODULES,ek.PNPM_LOCK_YAML);return[4,tw()];case 1:e.sent();return[4,tI()];case 2:e.sent();return[2]}})});return tL.apply(this,arguments)}function tR(){return tk.apply(this,arguments)}function tk(){tk=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,to("Inspecting project dependencies",eM.NODE_MODULES_INSPECT)];case 1:e.sent();return[2]}})});return tk.apply(this,arguments)}function tq(){return tG.apply(this,arguments)}function tG(){tG=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,to("Running unit tests",eM.CYBERSKILL.TEST_UNIT)];case 1:e.sent();return[2]}})});return tG.apply(this,arguments)}function tM(){return tK.apply(this,arguments)}function tK(){tK=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,to("Running end-to-end tests",eM.CYBERSKILL.TEST_E2E)];case 1:e.sent();return[2]}})});return tK.apply(this,arguments)}i(function(){var e;return m(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,(0,N.default)((0,w.hideBin)(O.default.argv)).scriptName(ef).usage("$0 <command> [options]").command("lint",C.lint,tj).command("lint:fix",C["lint:fix"],tx).command("lint:inspect",C["lint:inspect"],tm).command("lint-staged",C["lint-staged"],th).command("commitlint",C.commitlint,t_).command("setup",C.setup,tP).command("reset",C.reset,tA).command("inspect",C.inspect,tR).command("test:unit",C["test:unit"],tq).command("test:e2e",C["test:e2e"],tM).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(P.version).epilog('\uD83D\uDCA1 Tip: Use "--help" with any command to see options\n').parse()];case 1:t.sent();return[3,3];case 2:e=t.sent();K.error("Fatal: ".concat(e.message)),O.default.exit(1);return[3,3];case 3:return[2]}})})();
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
function e(e,t){if(t==null||t>e.length)t=e.length;for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function t(e){if(Array.isArray(e))return e}function n(t){if(Array.isArray(t))return e(t)}function r(e,t,n,r,s,i,o){try{var c=e[i](o);var a=c.value}catch(e){n(e);return}if(c.done){t(a)}else{Promise.resolve(a).then(r,s)}}function s(e){return function(){var t=this,n=arguments;return new Promise(function(s,i){var o=e.apply(t,n);function c(e){r(o,s,i,c,a,"next",e)}function a(e){r(o,s,i,c,a,"throw",e)}c(undefined)})}}function i(e,t,n){if(t in e){Object.defineProperty(e,t,{value:n,enumerable:true,configurable:true,writable:true})}else{e[t]=n}return e}function o(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function c(e,t){var n=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n==null)return;var r=[];var s=true;var i=false;var o,c;try{for(n=n.call(e);!(s=(o=n.next()).done);s=true){r.push(o.value);if(t&&r.length===t)break}}catch(e){i=true;c=e}finally{try{if(!s&&n["return"]!=null)n["return"]()}finally{if(i)throw c}}return r}function a(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};var r=Object.keys(n);if(typeof Object.getOwnPropertySymbols==="function"){r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))}r.forEach(function(t){i(e,t,n[t])})}return e}function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);if(t){r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})}n.push.apply(n,r)}return n}function p(e,t){t=t!=null?t:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(t))}else{d(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function f(e,n){return t(e)||c(e,n)||m(e,n)||a()}function g(e){return n(e)||o(e)||m(e)||u()}function h(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function m(t,n){if(!t)return;if(typeof t==="string")return e(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return e(t,n)}function y(e,t){var n,r,s,i,o={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]};return i={next:c(0),"throw":c(1),"return":c(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function c(e){return function(t){return a([e,t])}}function a(i){if(n)throw new TypeError("Generator is already executing.");while(o)try{if(n=1,r&&(s=i[0]&2?r["return"]:i[0]?r["throw"]||((s=r["return"])&&s.call(r),0):r.next)&&!(s=s.call(r,i[1])).done)return s;if(r=0,s)i=[i[0]&2,s.value];switch(i[0]){case 0:case 1:s=i;break;case 4:o.label++;return{value:i[1],done:false};case 5:o.label++;r=i[1];i=[0];continue;case 7:i=o.ops.pop();o.trys.pop();continue;default:if(!(s=o.trys,s=s.length>0&&s[s.length-1])&&(i[0]===6||i[0]===2)){o=0;continue}if(i[0]===3&&(!s||i[1]>s[0]&&i[1]<s[3])){o.label=i[1];break}if(i[0]===6&&o.label<s[1]){o.label=s[1];s=i;break}if(s&&o.label<s[2]){o.label=s[2];o.ops.push(i);break}if(s[2])o.ops.pop();o.trys.pop();continue}i=t.call(e,o)}catch(e){i=[6,e];r=0}finally{n=s=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}}import v from"node:process";import{hideBin as j}from"yargs/helpers";import x from"yargs/yargs";import E from"node:process";var _=E.env.DEBUG==="true";var b={name:"@cyberskill/shared",type:"module",version:"1.66.0",description:"CyberSkill Shared",author:"Stephen Cheng",license:"MIT",homepage:"https://github.com/cyberskill-world/shared#readme",repository:{type:"git",url:"git+https://github.com/cyberskill-world/shared.git"},bugs:{url:"https://github.com/cyberskill-world/shared/issues"},exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./configs":{types:"./dist/configs/index.d.ts",import:"./dist/configs/index.js",require:"./dist/configs/index.cjs"},"./configs/commitlint":{types:"./dist/configs/commitlint/index.d.ts",import:"./dist/configs/commitlint/index.js",require:"./dist/configs/commitlint/index.cjs"},"./configs/eslint":{types:"./dist/configs/eslint/index.d.ts",import:"./dist/configs/eslint/index.js",require:"./dist/configs/eslint/index.cjs"},"./configs/graphql":{types:"./dist/configs/graphql/index.d.ts",import:"./dist/configs/graphql/index.js",require:"./dist/configs/graphql/index.cjs"},"./configs/lint-staged":{types:"./dist/configs/lint-staged/index.d.ts",import:"./dist/configs/lint-staged/index.js",require:"./dist/configs/lint-staged/index.cjs"},"./configs/vitest/react/e2e":{types:"./dist/configs/vitest/react/e2e.d.ts",import:"./dist/configs/vitest/react/e2e.js",require:"./dist/configs/vitest/react/e2e.cjs"},"./configs/vitest/react/unit":{types:"./dist/configs/vitest/react/unit.d.ts",import:"./dist/configs/vitest/react/unit.js",require:"./dist/configs/vitest/react/unit.cjs"},"./constants":{types:"./dist/constants/index.d.ts",import:"./dist/constants/index.js",require:"./dist/constants/index.cjs"},"./nodejs":{types:"./dist/nodejs/index.d.ts",import:"./dist/nodejs/index.js",require:"./dist/nodejs/index.cjs"},"./nodejs/cli":{types:"./dist/nodejs/cli/index.d.ts",import:"./dist/nodejs/cli/index.js",require:"./dist/nodejs/cli/index.cjs"},"./nodejs/command":{types:"./dist/nodejs/command/index.d.ts",import:"./dist/nodejs/command/index.js",require:"./dist/nodejs/command/index.cjs"},"./nodejs/fs":{types:"./dist/nodejs/fs/index.d.ts",import:"./dist/nodejs/fs/index.js",require:"./dist/nodejs/fs/index.cjs"},"./nodejs/log":{types:"./dist/nodejs/log/index.d.ts",import:"./dist/nodejs/log/index.js",require:"./dist/nodejs/log/index.cjs"},"./nodejs/mongo":{types:"./dist/nodejs/mongo/index.d.ts",import:"./dist/nodejs/mongo/index.js",require:"./dist/nodejs/mongo/index.cjs"},"./nodejs/package":{types:"./dist/nodejs/package/index.d.ts",import:"./dist/nodejs/package/index.js",require:"./dist/nodejs/package/index.cjs"},"./nodejs/path":{types:"./dist/nodejs/path/index.d.ts",import:"./dist/nodejs/path/index.js",require:"./dist/nodejs/path/index.cjs"},"./nodejs/storage":{types:"./dist/nodejs/storage/index.d.ts",import:"./dist/nodejs/storage/index.js",require:"./dist/nodejs/storage/index.cjs"},"./react":{types:"./dist/react/index.d.ts",import:"./dist/react/index.js",require:"./dist/react/index.cjs"},"./react/apollo-client":{types:"./dist/react/apollo-client/index.d.ts",import:"./dist/react/apollo-client/index.js",require:"./dist/react/apollo-client/index.cjs"},"./react/apollo-error":{types:"./dist/react/apollo-error/index.d.ts",import:"./dist/react/apollo-error/index.js",require:"./dist/react/apollo-error/index.cjs"},"./react/i18next":{types:"./dist/react/i18next/index.d.ts",import:"./dist/react/i18next/index.js",require:"./dist/react/i18next/index.cjs"},"./react/loading":{types:"./dist/react/loading/index.d.ts",import:"./dist/react/loading/index.js",require:"./dist/react/loading/index.cjs"},"./react/log":{types:"./dist/react/log/index.d.ts",import:"./dist/react/log/index.js",require:"./dist/react/log/index.cjs"},"./react/next-intl":{types:"./dist/react/next-intl/index.d.ts",import:"./dist/react/next-intl/index.js",require:"./dist/react/next-intl/index.cjs"},"./react/storage":{types:"./dist/react/storage/index.d.ts",import:"./dist/react/storage/index.js",require:"./dist/react/storage/index.cjs"},"./react/toast":{types:"./dist/react/toast/index.d.ts",import:"./dist/react/toast/index.js",require:"./dist/react/toast/index.cjs"},"./react/vitest":{types:"./dist/react/vitest/index.d.ts",import:"./dist/react/vitest/index.js",require:"./dist/react/vitest/index.cjs"},"./styles/reset.css":{import:"./dist/styles/reset.css",require:"./dist/styles/reset.css"},"./typescript":{types:"./dist/typescript/index.d.ts",import:"./dist/typescript/index.js",require:"./dist/typescript/index.cjs"},"./utils":{types:"./dist/utils/index.d.ts",import:"./dist/utils/index.js",require:"./dist/utils/index.cjs"}},main:"./dist/index.cjs",module:"./dist/index.js",types:"./dist/index.d.ts",bin:{cyberskill:"./dist/nodejs/cli/index.js"},files:["dist","public"],scripts:{build:"tsup",dev:"dotenv -e .env -- tsup --watch",lint:"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint","lint:fix":"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint:fix","lint:inspect":"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint:inspect",reset:"dotenv -e .env -- tsx src/nodejs/cli/index.ts reset",setup:"dotenv -e .env -- tsx src/nodejs/cli/index.ts setup",inspect:"dotenv -e .env -- tsx src/nodejs/cli/index.ts inspect","test:unit":"dotenv -e .env -- tsx src/nodejs/cli/index.ts test:unit","test:e2e":"dotenv -e .env -- tsx src/nodejs/cli/index.ts test:e2e",commitlint:"dotenv -e .env -- tsx src/nodejs/cli/index.ts commitlint","lint-staged":"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint-staged"},dependencies:{"@antfu/eslint-config":"4.11.0","@apollo/client":"3.13.6","@eslint-react/eslint-plugin":"1.41.0","@graphql-codegen/cli":"5.0.5","@graphql-codegen/client-preset":"4.8.0","@graphql-codegen/typescript-react-apollo":"4.3.2","@microsoft/api-extractor":"7.52.3","@next/eslint-plugin-next":"15.2.4","@swc/core":"1.11.18","@testing-library/jest-dom":"6.6.3","@testing-library/react":"16.3.0","@vitejs/plugin-react-swc":"3.8.1","@vitest/browser":"3.1.1",chalk:"5.4.1",classnames:"2.5.1",consola:"3.4.2","crypto-js":"4.2.0","date-fns":"4.1.0","dotenv-cli":"8.0.0","eslint-config-next":"15.2.4","eslint-plugin-format":"1.0.1","eslint-plugin-react-hooks":"5.2.0","eslint-plugin-react-refresh":"0.4.19",globals:"16.0.0",graphql:"16.10.0","graphql-ws":"6.0.4",i18next:"24.2.3",jsdom:"26.0.0",localforage:"1.10.0","modern-normalize":"3.0.1",mongodb:"6.15.0",mongoose:"8.13.2","mongoose-aggregate-paginate-v2":"1.1.4","mongoose-paginate-v2":"1.9.0","next-intl":"4.0.2","node-fetch":"3.3.2","node-persist":"4.0.4",ora:"8.2.0",playwright:"1.51.1","postcss-modules":"6.0.1",qs:"6.14.0",react:"19.1.0","react-dom":"19.1.0","react-hot-toast":"2.5.2","react-i18next":"15.4.1","react-icons":"5.5.0",sass:"1.86.3",slugify:"1.6.6",tsup:"8.4.0",tsx:"4.19.3",typescript:"5.8.3",unorm:"1.6.0",uuid:"11.1.0",vite:"6.2.5",vitest:"3.1.1","vitest-browser-react":"0.1.1",yargs:"17.7.2"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},devDependencies:{"@commitlint/cli":"19.8.0","@eslint/config-inspector":"1.0.2","@types/crypto-js":"4.2.2","@types/mongoose-aggregate-paginate-v2":"1.0.12","@types/node-persist":"3.1.8","@types/react":"19.1.0","@types/react-dom":"19.1.1","@types/unorm":"1.3.31","@types/uuid":"10.0.0","@types/yargs":"17.0.33",eslint:"9.24.0","lint-staged":"15.5.0","node-modules-inspector":"0.6.3","simple-git-hooks":"2.12.1"}};var S={lint:"Check code for linting issues","lint:fix":"Fix linting issues automatically","lint:inspect":"View active ESLint configuration","lint-staged":"Run lint checks on staged files",commitlint:"Validate commit message format",setup:"Initialize project setup and dependencies",reset:"Reset the project and reinstall dependencies",inspect:"Analyze installed project dependencies","test:unit":"Run unit test suite","test:e2e":"Run end-to-end test suite"};import{exec as I}from"node:child_process";import w from"node:process";import*as O from"node:util";import T from"chalk";import N from"consola";import{GraphQLError as D}from"graphql";_||(N.level=4);function C(e){var t=T[e];return typeof t=="function"?t:T.green}var P={silent:N.silent,level:N.level,fatal:N.fatal,error:N.error,warn:N.warn,log:N.log,info:N.info,success:N.success,ready:N.ready,start:N.start,box:N.box,debug:N.debug,trace:N.trace,verbose:N.verbose,printBoxedLog:function e(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(t===null||t===void 0?void 0:t.length)){N.box(T.green(e));return}t.forEach(function(e){var t=e.file,r=e.position,s=e.rule,i=e.message;N.log("".concat(T.gray("File:")," ").concat(T.blue("".concat(t).concat(r?":".concat(r):"")))),s&&N.log(" ".concat(C(n)("Rule:")," ").concat(s)),N.log(" ".concat(C(n)("Message:")," ").concat(i))}),N.box(C(n)("".concat(e," : ").concat(t.length))),N.log(T.gray("─".repeat(40)))}};var A={isCurrentProject:!1,installedPath:"",file:{},isUpToDate:!1};import L from"node-fetch";import*as R from"node:fs";function k(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return t.every(function(e){return R.existsSync(e)})}function G(e,t){var n=R.readFileSync(e,"utf-8");if(t===null||t===void 0?void 0:t.asJson)try{var r=JSON.parse(n);if((typeof r==="undefined"?"undefined":h(r))=="object"&&r!==null)return r;throw new Error("Parsed JSON is not an object or array")}catch(t){throw new Error("Failed to parse JSON from file: ".concat(e))}return n}function M(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=n.isJson,s=r===void 0?!1:r,i=s&&(typeof t==="undefined"?"undefined":h(t))=="object"?JSON.stringify(t,null,4):String(t);R.writeFileSync(e,i,"utf-8")}function q(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=n.isJson,s=r===void 0?!1:r,i=s&&(typeof t==="undefined"?"undefined":h(t))=="object"?JSON.stringify(t,null,4):String(t);R.appendFileSync(e,i,"utf-8")}function K(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}t.forEach(function(e){k(e)&&R.rmSync(e,{recursive:!0,force:!0})})}import F from"node:process";import*as U from"node:path";function Y(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=U).resolve.apply(r,[J].concat(g(t)))}function B(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=U).join.apply(r,g(t))}var J=F.env.INIT_CWD||F.cwd(),W="@cyberskill/shared",X=".cyberskill-storage",H="node_modules",V="dist",$="package.json",z="package-lock.json",Q="tsconfig.json",Z=".gitignore",ee=".simple-git-hooks.json",et="pnpm-lock.yaml",en=".git/hooks/",er=".git/COMMIT_EDITMSG",es=B(J,H,W,V),ei="cyberskill",eo="src/nodejs/cli/index.ts",ec="eslint",ea="eslint",eu="vitest",el="playwright",ed="vitest",ep="@commitlint/cli",ef="commitlint",eg="lint-staged",eh="lint-staged",em="typescript",ey="tsc",ev="tsx",ej="git",ex="pnpm",eE="pnpm exec",e_="simple-git-hooks",eb="simple-git-hooks",eS="@eslint/config-inspector",eI="eslint-config-inspector",ew="node-modules-inspector",eO="node-modules-inspector",eT={CYBERSKILL_DIRECTORY:es,WORKING_DIRECTORY:J,TS_CONFIG:Y(Q),GIT_IGNORE:Y(Z),GIT_HOOK:Y(en),GIT_COMMIT_MSG:Y(er),SIMPLE_GIT_HOOKS_JSON:Y(ee),PACKAGE_JSON:Y($),PACKAGE_LOCK_JSON:Y(z),PNPM_LOCK_YAML:Y(et),NODE_MODULES:Y(H),CYBERSKILL:{LINT_STAGED_CONFIG:Y("".concat(es,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:Y("".concat(es,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:Y("".concat(es,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:Y("".concat(es,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:Y("".concat(es,"/react/vitest/vitest.e2e.js"))}};function eN(e){var t=e.isCurrentProject;return l({"pre-commit":eh,"commit-msg":ef},t&&{"pre-push":e4("".concat(ej," pull"))})}function eD(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++){n[r-1]=arguments[r]}var s=f(n,2),i=s[0],o=s[1],c=e==="RAW"?!0:k.apply(void 0,g(i.split(" ").map(function(e){return B(eT.NODE_MODULES,e)})));switch(e){case"PNPM_ADD_AND_EXEC":return e5(e4("".concat(c?"":"".concat(ex," add ").concat(i," && ")).concat(eE," ").concat(o)));case"PNPM_ADD_DEV_AND_EXEC":return e5(e4("".concat(c?"":"".concat(ex," add -D ").concat(i," && ")).concat(eE," ").concat(o)));case"RAW":return e5(e4(i))}}var eC={SIMPLE_GIT_HOOKS:eD("PNPM_ADD_DEV_AND_EXEC",e_,eb),ESLINT_INSPECT:eD("PNPM_ADD_DEV_AND_EXEC",eS,eI),NODE_MODULES_INSPECT:eD("PNPM_ADD_DEV_AND_EXEC",ew,eO),ESLINT_CHECK:eD("PNPM_ADD_DEV_AND_EXEC",ec,"".concat(ea," ").concat(eT.WORKING_DIRECTORY)),ESLINT_FIX:eD("PNPM_ADD_DEV_AND_EXEC",ec,"".concat(ea," ").concat(eT.WORKING_DIRECTORY," --fix")),TYPESCRIPT_CHECK:eD("PNPM_ADD_AND_EXEC",em,"".concat(ey," -p ").concat(eT.TS_CONFIG," --noEmit")),CONFIGURE_GIT_HOOK:eD("RAW","".concat(ej," config core.hooksPath ").concat(eT.GIT_HOOK)),BUILD:eD("RAW","".concat(ex," run build")),STAGE_BUILD_DIRECTORY:eD("RAW","".concat(ej," add ").concat(V)),PNPM_INSTALL_STANDARD:eD("RAW","".concat(ex," install")),PNPM_INSTALL_LEGACY:eD("RAW","".concat(ex," install --legacy-peer-deps")),PNPM_INSTALL_FORCE:eD("RAW","".concat(ex," install --force")),CYBERSKILL:{TEST_UNIT:eD("PNPM_ADD_AND_EXEC",eu,"".concat(ed," --config ").concat(eT.CYBERSKILL.UNIT_TEST_CONFIG)),TEST_E2E:eD("PNPM_ADD_AND_EXEC","".concat(eu," ").concat(el),"".concat(ed," --config ").concat(eT.CYBERSKILL.E2E_TEST_CONFIG)),COMMIT_LINT:eD("PNPM_ADD_DEV_AND_EXEC",ep,"".concat(ef," --edit ").concat(eT.GIT_COMMIT_MSG," --config ").concat(eT.CYBERSKILL.COMMITLINT_CONFIG)),LINT_STAGED:eD("PNPM_ADD_DEV_AND_EXEC",eg,"".concat(eh," --config ").concat(eT.CYBERSKILL.LINT_STAGED_CONFIG))}};var eP={};function eA(e){if(e in eP)return eP[e];var t=B(J,$);if(!k(t))return eP[e]=!1;try{var n,r;var s=G(t,{asJson:!0}),i=s.name===e,o=!!((n=s.dependencies)===null||n===void 0?void 0:n[e]),c=!!((r=s.devDependencies)===null||r===void 0?void 0:r[e]);return i||o||c?eP[e]={path:t,file:s,isCurrentProject:i,isDepend:o,isDevDepend:c}:eP[e]=!1}catch(t){return P.warn("Failed to read package.json: ".concat(t.message)),eP[e]=!1}}function eL(e){return eR.apply(this,arguments)}function eR(){eR=s(function(e){var t,n,r,s;return y(this,function(i){switch(i.label){case 0:i.trys.push([0,3,,4]);return[4,L("https://registry.npmjs.org/".concat(e,"/latest"))];case 1:t=i.sent();if(!t.ok)throw new Error("Failed to fetch latest version: ".concat(t.status," ").concat(t.statusText));return[4,t.json()];case 2:n=i.sent(),r=n.version;return[2,r];case 3:s=i.sent();throw P.error('Failed to fetch version for "'.concat(e,'": ').concat(s.message)),s;case 4:return[2]}})});return eR.apply(this,arguments)}function ek(e,t){return eG.apply(this,arguments)}function eG(){eG=s(function(e,t){var n,r,s,o,c,a,u,d,f,g,h,m,v,j,x;return y(this,function(y){switch(y.label){case 0:y.trys.push([0,4,,5]);c=eA(e);if(!c)return[2,l({},A)];a=c.path,u=c.file,d=c.isCurrentProject,f=c.isDepend,g=c.isDevDepend,h="0.0.0";d&&u.version?h=u.version:f&&((n=u.dependencies)===null||n===void 0?void 0:n[e])?h=(r=u.dependencies)===null||r===void 0?void 0:r[e]:g&&((s=u.devDependencies)===null||s===void 0?void 0:s[e])&&(h=(o=u.devDependencies)===null||o===void 0?void 0:o[e]);if(!d)return[3,1];j=h;return[3,3];case 1:return[4,eL(e)];case 2:j=y.sent();y.label=3;case 3:m=j,v=d||h===m;return[2,(!v&&(t===null||t===void 0?void 0:t.update)&&(f?u.dependencies=p(l({},u.dependencies||{}),i({},e,m)):g&&(u.devDependencies=p(l({},u.devDependencies||{}),i({},e,m))),P.info('Updating package "'.concat(e,'" to version ').concat(m)),M(a,u,{isJson:!0})),{isCurrentProject:d,installedPath:a,file:u,isUpToDate:v})];case 4:x=y.sent();return[2,(P.error('Error checking package "'.concat(e,'": ').concat(x.message)),l({},A))];case 5:return[2]}})});return eG.apply(this,arguments)}import eM from"node-persist";import eq from"node:os";import eK from"node:process";function eF(){return eK.env.CYBERSKILL_STORAGE_DIR||B(eq.homedir(),X)}function eU(){return eY.apply(this,arguments)}function eY(){eY=s(function(){var e;return y(this,function(t){switch(t.label){case 0:e=eM.defaultInstance;if(e)return[3,2];return[4,eM.init({dir:eF(),stringify:JSON.stringify,parse:JSON.parse,encoding:"utf8",logging:!1,forgiveParseErrors:!0})];case 1:e=t.sent();t.label=2;case 2:e;return[2]}})});return eY.apply(this,arguments)}var eB={get:function e(e){return s(function(){var t,n;return y(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,eU()];case 1:r.sent();return[4,eM.getItem(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:null];case 3:n=r.sent();return[2,(P.error('[Storage:get] Error getting key "'.concat(e,'":'),n),null)];case 4:return[2]}})})()},set:function e(e,t){return s(function(){var n;return y(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,eU()];case 1:r.sent();return[4,eM.setItem(e,t)];case 2:r.sent();return[3,4];case 3:n=r.sent();P.error('[Storage:set] Error setting key "'.concat(e,'":'),n);return[3,4];case 4:return[2]}})})()},remove:function e(e){return s(function(){var t;return y(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,eU()];case 1:n.sent();return[4,eM.removeItem(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();P.error('[Storage:remove] Error removing key "'.concat(e,'":'),t);return[3,4];case 4:return[2]}})})()},keys:function e(){return s(function(){var e,t;return y(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,eU()];case 1:n.sent();return[4,eM.keys()];case 2:e=n.sent();return[2,Array.isArray(e)?e:(P.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=n.sent();return[2,(P.error("[Storage:keys] Error getting keys:",t),[])];case 4:return[2]}})})()},getLogLink:function e(e){return s(function(){return y(this,function(t){try{return[2,"".concat(eF()," (key: ").concat(e,")")]}catch(e){return[2,(P.error("[Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};var eJ=O.promisify(I);function eW(e){return"error_list:".concat(e)}function eX(e){return eH.apply(this,arguments)}function eH(){eH=s(function(e){var t,n,r;return y(this,function(i){switch(i.label){case 0:if(e.length===0)return[2];t=Date.now(),n=eW(t);i.label=1;case 1:i.trys.push([1,3,,4]);return[4,eB.set(n,{errors:e,timestamp:t})];case 2:i.sent(),setTimeout(/*#__PURE__*/s(function(){var e;return y(this,function(t){switch(t.label){case 0:return[4,eB.getLogLink(n)];case 1:e=t.sent();e&&P.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})}),10);return[3,4];case 3:r=i.sent();P.error("Failed to save errors: ".concat(r.message));return[3,4];case 4:return[2]}})});return eH.apply(this,arguments)}function eV(){return e$.apply(this,arguments)}function e$(){e$=s(function(){var e,t,n;return y(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,eB.keys()];case 1:e=r.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(/*#__PURE__*/function(){var e=s(function(e){var t;return y(this,function(n){switch(n.label){case 0:return[4,eB.get(e)];case 1:return[2,((t=n.sent())===null||t===void 0?void 0:t.errors)||[]]}})});return function(t){return e.apply(this,arguments)}}()))];case 2:return[2,r.sent().flat()];case 3:n=r.sent();return[2,(P.error("Failed to retrieve stored errors: ".concat(n.message)),[])];case 4:return[2]}})});return e$.apply(this,arguments)}function ez(){return eQ.apply(this,arguments)}function eQ(){eQ=s(function(){var e,t,n;return y(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,eB.keys()];case 1:e=r.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(function(e){return eB.remove(e)}))];case 2:r.sent();return[3,4];case 3:n=r.sent();P.error("Failed to clear error lists: ".concat(n.message));return[3,4];case 4:return[2]}})});return eQ.apply(this,arguments)}function eZ(e){var t=[],n=[],r="",s=/^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/,i=/^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/,o=/^✖\s+(.*?)\s+\[(.*?)\]$/;e.split("\n").forEach(function(e){if(e.startsWith("/"))r=e.trim();else{var c=s.exec(e)||[],a=i.exec(e)||[],u=o.exec(e)||[];c.length&&r?t.push({file:r,position:"".concat(c[1],":").concat(c[2]),type:c[3]==="error"?"error":"warning",message:c[4].trim(),rule:c[5].trim()}):a.length?t.push({file:a[1],position:"".concat(a[2],":").concat(a[3]),type:a[4]==="error"?"error":"warning",message:a[5].trim()}):u.length?t.push({file:"commitlint",type:"error",message:u[1].trim(),rule:u[2].trim()}):n.push(e.trim())}}),t.length&&eX(t),_&&n.length&&(P.warn("Unmatched lines:"),n.forEach(function(e){return P.info(" ".concat(e))}))}function e0(e){try{var t=JSON.parse(e),n=[];t.forEach(function(e){var t=e.filePath,r=e.messages;r.forEach(function(e){var r=e.severity,s=e.line,i=e.column,o=e.ruleId,c=e.message;n.push({type:r===2?"error":"warning",file:t,position:"".concat(s,":").concat(i),rule:o,message:c})})}),n.length&&eX(n)}catch(t){eZ(e)}}function e1(e){return e2.apply(this,arguments)}function e2(){e2=s(function(e){var t,n,r,s,i,o,c,a,u;var l=arguments;return y(this,function(d){switch(d.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:e0;n=new AbortController;w.on("SIGINT",function(){P.warn("Process interrupted. Terminating..."),n.abort(),w.exit()});d.label=1;case 1:d.trys.push([1,3,,4]);return[4,eJ(e,{maxBuffer:0x6400000,signal:n.signal})];case 2:r=d.sent(),s=r.stdout,i=r.stderr;[s,i].forEach(function(e){return e&&t(e)});return[3,4];case 3:o=d.sent();c=o.stdout,a=o.stderr,u=o.message;[c,a].forEach(function(e){return e&&t(e)}),!a&&!c&&P.error("Command failed: ".concat(u));return[3,4];case 4:return[2]}})});return e2.apply(this,arguments)}function e4(e){return{raw:!0,cmd:e}}function e3(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(eE," ").concat(W," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(eE," ").concat(ev," ").concat(eo," ").concat(e):"".concat(eE," ").concat(ei," ").concat(e)}function e5(e,t){return typeof e=="function"?e3(e(t),t):(typeof e==="undefined"?"undefined":h(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?e3(e,t):e}function e6(e){return e8.apply(this,arguments)}function e8(){e8=s(function(e){var t,n,r,s,i,o,c;var a=arguments;return y(this,function(u){switch(u.label){case 0:t=a.length>1&&a[1]!==void 0?a[1]:{};r=(n=t===null||t===void 0?void 0:t.isRemote)!==null&&n!==void 0?n:!1;if(!r)return[3,1];c=!1;return[3,3];case 1:return[4,ek(W)];case 2:c=u.sent().isCurrentProject;u.label=3;case 3:s=c,i={isRemote:r,isCurrentProject:s},o=typeof e=="function"?e(i):e;return[2,Object.fromEntries(Object.entries(o).map(function(e){var t=f(e,2),n=t[0],r=t[1];return[n,e5(r,i)]}))]}})});return e8.apply(this,arguments)}function e7(e,t){return e9.apply(this,arguments)}function e9(){e9=s(function(e,t){var n;return y(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);P.start("".concat(e)),_&&P.info("→ ".concat(t));return[4,e1(t)];case 1:r.sent(),P.success("".concat(e," done."));return[3,3];case 2:n=r.sent();throw P.error("".concat(e," failed: ").concat(n.message)),n;case 3:return[2]}})});return e9.apply(this,arguments)}function te(){return tt.apply(this,arguments)}function tt(){tt=s(function(){var e;return y(this,function(t){switch(t.label){case 0:if(!k(eT.TS_CONFIG))return[3,2];return[4,e7("Performing TypeScript validation",eC.TYPESCRIPT_CHECK)];case 1:e=t.sent();return[3,3];case 2:e=P.warn("No TypeScript configuration found. Skipping type check.");t.label=3;case 3:e;return[2]}})});return tt.apply(this,arguments)}function tn(){return tr.apply(this,arguments)}function tr(){tr=s(function(){var e,t;var n=arguments;return y(this,function(r){switch(r.label){case 0:e=n.length>0&&n[0]!==void 0?n[0]:!1;if(!e)return[3,2];return[4,e7("Running ESLint with auto-fix",eC.ESLINT_FIX)];case 1:t=r.sent();return[3,4];case 2:return[4,e7("Running ESLint check",eC.ESLINT_CHECK)];case 3:t=r.sent();r.label=4;case 4:t;return[2]}})});return tr.apply(this,arguments)}function ts(e,t){if(!t.length)return;var n=e==="Errors"?"red":"yellow";P.printBoxedLog(e==="Errors"?"✖ Errors":"⚠ Warnings",t,n)}function ti(){return to.apply(this,arguments)}function to(){to=s(function(){var e,t,n;return y(this,function(r){switch(r.label){case 0:return[4,eV()];case 1:e=r.sent(),t=e.filter(function(e){return e.type==="error"}),n=e.filter(function(e){return e.type==="warning"});!t.length&&!n.length?P.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(ts("Warnings",n),ts("Errors",t));return[2]}})});return to.apply(this,arguments)}function tc(){return ta.apply(this,arguments)}function ta(){ta=s(function(){var e,t,n;return y(this,function(r){switch(r.label){case 0:return[4,ez()];case 1:r.sent();return[4,ek(W)];case 2:e=r.sent(),t=e.isCurrentProject;if(!t)return[3,7];r.label=3;case 3:r.trys.push([3,6,,7]);return[4,e7("Building package: ".concat(W),eC.BUILD)];case 4:r.sent();return[4,e7("Staging build artifacts",eC.STAGE_BUILD_DIRECTORY)];case 5:r.sent();return[3,7];case 6:n=r.sent();throw P.error("Error building and staging ".concat(W,": ").concat(n.message)),n;case 7:return[4,e7("Executing lint-staged",eC.CYBERSKILL.LINT_STAGED)];case 8:r.sent(),ti();return[2]}})});return ta.apply(this,arguments)}function tu(){return tl.apply(this,arguments)}function tl(){tl=s(function(){return y(this,function(e){switch(e.label){case 0:return[4,e7("Inspecting ESLint configuration",eC.ESLINT_INSPECT)];case 1:e.sent();return[2]}})});return tl.apply(this,arguments)}function td(){return tp.apply(this,arguments)}function tp(){tp=s(function(){return y(this,function(e){switch(e.label){case 0:return[4,ez()];case 1:e.sent();return[4,Promise.all([te(),tn()])];case 2:e.sent(),ti();return[2]}})});return tp.apply(this,arguments)}function tf(){return tg.apply(this,arguments)}function tg(){tg=s(function(){return y(this,function(e){switch(e.label){case 0:return[4,ez()];case 1:e.sent();return[4,Promise.all([te(),tn(!0)])];case 2:e.sent(),ti();return[2]}})});return tg.apply(this,arguments)}function th(){return tm.apply(this,arguments)}function tm(){tm=s(function(){return y(this,function(e){switch(e.label){case 0:return[4,ez()];case 1:e.sent();return[4,e7("Validating commit message",eC.CYBERSKILL.COMMIT_LINT)];case 2:e.sent(),ti();return[2]}})});return tm.apply(this,arguments)}function ty(){return tv.apply(this,arguments)}function tv(){tv=s(function(){var e,t;return y(this,function(n){switch(n.label){case 0:return[4,e7("Configuring Git hooks",eC.CONFIGURE_GIT_HOOK)];case 1:n.sent(),K(eT.GIT_HOOK);return[4,e6(eN)];case 2:e=n.sent();M(eT.SIMPLE_GIT_HOOKS_JSON,e,{isJson:!0});t="\n".concat(ee,"\n");k(eT.GIT_IGNORE)?G(eT.GIT_IGNORE).split("\n").includes(ee)||q(eT.GIT_IGNORE,t):M(eT.GIT_IGNORE,t);return[4,e7("Setting up simple-git-hooks",eC.SIMPLE_GIT_HOOKS)];case 3:n.sent();return[2]}})});return tv.apply(this,arguments)}function tj(){return tx.apply(this,arguments)}function tx(){tx=s(function(){var e,t,n,r,s,i,o,c,a,u,l;return y(this,function(d){switch(d.label){case 0:e=[{command:eC.PNPM_INSTALL_STANDARD,message:"Installing dependencies (standard)"},{command:eC.PNPM_INSTALL_LEGACY,message:"Retrying with legacy peer dependencies"},{command:eC.PNPM_INSTALL_FORCE,message:"Retrying with force install"}];t=true,n=false,r=undefined;d.label=1;case 1:d.trys.push([1,8,9,10]);s=e[Symbol.iterator]();d.label=2;case 2:if(!!(t=(i=s.next()).done))return[3,7];o=i.value,c=o.command,a=o.message;d.label=3;case 3:d.trys.push([3,5,,6]);return[4,e7("".concat(a," using: ").concat(c),c)];case 4:d.sent();return[2];case 5:u=d.sent();P.warn("Installation attempt failed: ".concat(c)),P.error("Details: ".concat(u.message));return[3,6];case 6:t=true;return[3,2];case 7:return[3,10];case 8:l=d.sent();n=true;r=l;return[3,10];case 9:try{if(!t&&s.return!=null){s.return()}}finally{if(n){throw r}}return[7];case 10:throw new Error("All dependency installation strategies failed.")}})});return tx.apply(this,arguments)}function tE(e,t){return t_.apply(this,arguments)}function t_(){t_=s(function(e,t){var n,r,s,i,o,c,a,u,l,d,p,f;return y(this,function(g){switch(g.label){case 0:if(!k(eT.PACKAGE_JSON)){P.error("package.json not found. Aborting setup.");return[2]}g.label=1;case 1:g.trys.push([1,14,,15]);return[4,ek(e,{update:t===null||t===void 0?void 0:t.update})];case 2:n=g.sent(),r=n.isUpToDate;s=r;if(s)return[3,5];return[4,tj()];case 3:g.sent();return[4,tf()];case 4:s=g.sent();g.label=5;case 5:s;o=true,c=false,a=undefined;g.label=6;case 6:g.trys.push([6,11,12,13]);u=((i=t===null||t===void 0?void 0:t.postInstallActions)!==null&&i!==void 0?i:[])[Symbol.iterator]();g.label=7;case 7:if(!!(o=(l=u.next()).done))return[3,10];d=l.value;return[4,d()];case 8:g.sent();g.label=9;case 9:o=true;return[3,7];case 10:return[3,13];case 11:p=g.sent();c=true;a=p;return[3,13];case 12:try{if(!o&&u.return!=null){u.return()}}finally{if(c){throw a}}return[7];case 13:P.success('"'.concat(e,'" setup completed.'));return[3,15];case 14:f=g.sent();throw P.error('Failed to setup "'.concat(e,'": ').concat(f.message)),f;case 15:return[2]}})});return t_.apply(this,arguments)}function tb(){return tS.apply(this,arguments)}function tS(){tS=s(function(){return y(this,function(e){switch(e.label){case 0:return[4,tE(W,{update:!0,postInstallActions:[ty]})];case 1:e.sent();return[2]}})});return tS.apply(this,arguments)}function tI(){return tw.apply(this,arguments)}function tw(){tw=s(function(){return y(this,function(e){switch(e.label){case 0:K(eT.NODE_MODULES,eT.PNPM_LOCK_YAML);return[4,tj()];case 1:e.sent();return[4,ty()];case 2:e.sent();return[2]}})});return tw.apply(this,arguments)}function tO(){return tT.apply(this,arguments)}function tT(){tT=s(function(){return y(this,function(e){switch(e.label){case 0:return[4,e7("Inspecting project dependencies",eC.NODE_MODULES_INSPECT)];case 1:e.sent();return[2]}})});return tT.apply(this,arguments)}function tN(){return tD.apply(this,arguments)}function tD(){tD=s(function(){return y(this,function(e){switch(e.label){case 0:return[4,e7("Running unit tests",eC.CYBERSKILL.TEST_UNIT)];case 1:e.sent();return[2]}})});return tD.apply(this,arguments)}function tC(){return tP.apply(this,arguments)}function tP(){tP=s(function(){return y(this,function(e){switch(e.label){case 0:return[4,e7("Running end-to-end tests",eC.CYBERSKILL.TEST_E2E)];case 1:e.sent();return[2]}})});return tP.apply(this,arguments)}s(function(){var e;return y(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,x(j(v.argv)).scriptName(ei).usage("$0 <command> [options]").command("lint",S.lint,td).command("lint:fix",S["lint:fix"],tf).command("lint:inspect",S["lint:inspect"],tu).command("lint-staged",S["lint-staged"],tc).command("commitlint",S.commitlint,th).command("setup",S.setup,tb).command("reset",S.reset,tI).command("inspect",S.inspect,tO).command("test:unit",S["test:unit"],tN).command("test:e2e",S["test:e2e"],tC).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(b.version).epilog('\uD83D\uDCA1 Tip: Use "--help" with any command to see options\n').parse()];case 1:t.sent();return[3,3];case 2:e=t.sent();P.error("Fatal: ".concat(e.message)),v.exit(1);return[3,3];case 3:return[2]}})})();
|