{ "version": 3, "sources": ["apps/vendor-center-client/src/app/core/galaxy-image-upload.service.ts"], "sourcesContent": ["import { map } from 'rxjs/operators';\nimport { HttpClient } from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { FileInfo, GalaxyImageUploaderService, UploadResponse } from '@vendasta/galaxy/uploader';\n\nexport const defaultImageMaxSize = 5242880; // 5MB\nexport const defaultSupportedImageExtensions = '.png,.jpg,.jpeg/*';\nexport const defaultPreviewBackgroundColor = '#ba68c8'; // purple\n\n@Injectable()\nexport class GalaxyImageUploadService extends GalaxyImageUploaderService {\n constructor(private httpClient: HttpClient) {\n super(httpClient);\n }\n\n buildRequest(fileInfo: FileInfo): Observable {\n const body = new FormData();\n body.append('file', fileInfo?.data?.croppedImage || fileInfo.file);\n return this.httpClient.post('/fileupload/', body).pipe(\n map((result: { file: { fileurl: string; mimetype: string; filename: string } }) => {\n return { data: { url: result.file.fileurl } };\n }),\n );\n }\n}\n"], "mappings": "wIAOO,IAAMA,EAAkC,oBAI/C,IAAaC,GAAyB,IAAA,CAAhC,IAAOA,EAAP,MAAOA,UAAiCC,CAA0B,CACtEC,YAAoBC,EAAsB,CACxC,MAAMA,CAAU,EADE,KAAAA,WAAAA,CAEpB,CAEAC,aAAaC,EAAkB,CAC7B,IAAMC,EAAO,IAAIC,SACjBD,OAAAA,EAAKE,OAAO,OAAQH,GAAUI,MAAMC,cAAgBL,EAASM,IAAI,EAC1D,KAAKR,WAAWS,KAAK,eAAgBN,CAAI,EAAEO,KAChDC,EAAKC,IACI,CAAEN,KAAM,CAAEO,IAAKD,EAAOJ,KAAKM,OAAO,CAAE,EAC5C,CAAC,CAEN,yCAbWjB,GAAwBkB,EAAAC,CAAA,CAAA,CAAA,wBAAxBnB,EAAwBoB,QAAxBpB,EAAwBqB,SAAA,CAAA,EAA/B,IAAOrB,EAAPsB,SAAOtB,CAAyB,GAAA", "names": ["defaultSupportedImageExtensions", "GalaxyImageUploadService", "GalaxyImageUploaderService", "constructor", "httpClient", "buildRequest", "fileInfo", "body", "FormData", "append", "data", "croppedImage", "file", "post", "pipe", "map", "result", "url", "fileurl", "\u0275\u0275inject", "HttpClient", "factory", "\u0275fac", "_GalaxyImageUploadService"] }