'use strict';
import { createBaseResourceProperties } from '../utils/base-resource-properties.js';
import { createStore } from './store-db.js';
import { workspaceConstants } from '../../../fd-toolbox/server/constants/workspace-constants.js';
import { defaultStoreId } from '../../common/products/product-constants.js';
import { storeStatuses } from '../../common/stores/store-enums.js';
import { defaultStoreName } from './store-constants.js';
import { getNewUuid } from '../../../fd-toolbox/uuids.js';
import { copyFile } from 'fs/promises';
import { emptyUuid } from '../../../fd-toolbox/constants/constants.js';
import { mediaConstants } from '../../meta/constants/media-constants.js';
import _0x1869d0__default from 'path';
import { resourceNames } from '../../../fd-toolbox/resources/resource-names.js';
import { fileExtensionsWithoutDot } from '../../../base-repo/app-constants/internal-system-constants.js';
import { getBlobUrl } from '../../meta/core/resources/blob/blob-urls.js';
import { getFileNameWithExtension } from '../../../fd-toolbox/paths/paths-names.js';
import { createResource } from '../../meta/server/resources/crud-resources.js';

var __defProp=Object['defineProperty'],__name=(_0x4dd774,_0x4586b4)=>__defProp(_0x4dd774,'name',{'value':_0x4586b4,'configurable':!![]});const storeIds={'techStoreId':defaultStoreId};const storeImages={'storeImagesFolder':'public/images/store','techStoreImageFileName':getFileNameWithExtension(emptyUuid,fileExtensionsWithoutDot['webp'])};async function seedStores(){await seedTechStore();}__name(seedStores,'seedStores');async function seedBlob(_0x11c165){createResource(_0x11c165,resourceNames['blob']);}__name(seedBlob,'seedBlob');async function seedStore(_0x247405,_0x8a67f2,_0x3c1577,_0x365980){const _0x1d9c36={...createBaseResourceProperties(_0x247405),'name':_0x8a67f2,'workspaceId':_0x3c1577,'status':_0x365980};return createStore(_0x1d9c36);}__name(seedStore,'seedStore');async function seedTechStore(){const _0x3d70b4=await seedStore(storeIds['techStoreId'],defaultStoreName,workspaceConstants['defaultWorkspaceId'],storeStatuses['approved']),_0x3f7723=storeImages['storeImagesFolder']+'/'+storeImages['techStoreImageFileName'];await seedStoreImage(_0x3f7723,_0x3d70b4['id']);}__name(seedTechStore,'seedTechStore');async function seedStoreImage(_0x4a9c00,_0x46b0dd){const _0x28b4a3=getNewUuid(),_0x48f070=getFileNameWithExtension(_0x28b4a3,fileExtensionsWithoutDot['webp']),_0x3ba2a4=_0x1869d0__default['join'](mediaConstants['path'],_0x48f070);await copyFile(_0x4a9c00,_0x3ba2a4),await seedBlob({...createBaseResourceProperties(_0x28b4a3),'id':_0x28b4a3,'storeId':_0x46b0dd,'blobUrl':getBlobUrl(_0x48f070)});}__name(seedStoreImage,'seedStoreImage');

export { seedBlob, seedStores, storeIds, storeImages };
