{"version":3,"file":"imageTextItems.schema.cjs","sources":["../../../../../../src/schema/public/components/imageTextItems/imageTextItems.schema.ts"],"sourcesContent":["import { z } from \"zod\";\nimport zodToCamelCase from \"zod-to-camel-case\";\n\nexport const imageObjectSchema = z\n  .object({\n    format: z.enum([\"png\", \"jpg\", \"jpeg\", \"webp\", \"gif\", \"svg\"]),\n    secure_url: z.url(),\n    url: z.url(),\n    height: z.number(),\n    width: z.number(),\n    metadata: z.union([\n      z\n        .object({\n          attribution: z.string(),\n          usageRestriction: z.string(),\n        })\n        .partial(),\n      z.array(z.never()).length(0), // cloudinary provides an empty array if there is no metadata ?!\n    ]),\n    public_id: z.string(),\n    version: z.number(),\n  })\n  .partial();\n\nexport type ImageObject = z.infer<typeof imageObjectSchema>;\n\nexport const imageItemSchema = z.object({\n  image_object: imageObjectSchema,\n  type: z.literal(\"image\"),\n});\n\nexport type ImageItem = z.infer<typeof imageItemSchema>;\n\nexport const textItemSchema = z.object({\n  text: z.string(),\n  type: z.literal(\"text\"),\n});\n\nexport type TextItem = z.infer<typeof textItemSchema>;\n\nexport const imageObjectSchemaCamel = zodToCamelCase(imageObjectSchema);\nexport type ImageObjectCamel = z.infer<typeof imageObjectSchemaCamel>;\n\nexport const imageItemSchemaCamel = zodToCamelCase(imageItemSchema);\nexport type ImageItemCamel = z.infer<typeof imageItemSchemaCamel>;\n\nexport const textItemSchemaCamel = zodToCamelCase(textItemSchema);\nexport type TextItemCamel = z.infer<typeof textItemSchemaCamel>;\n"],"names":["imageObjectSchema","z","object","format","enum","secure_url","url","height","number","width","metadata","union","attribution","string","usageRestriction","partial","array","never","length","public_id","version","imageItemSchema","image_object","type","literal","textItemSchema","text","imageObjectSchemaCamel","zodToCamelCase","imageItemSchemaCamel","textItemSchemaCamel"],"mappings":"2HAGO,MAAMA,EAAoBC,EAAAA,EAC9BC,OAAO,CACNC,OAAQF,EAAAA,EAAEG,KAAK,CAAC,MAAO,MAAO,OAAQ,OAAQ,MAAO,QACrDC,WAAYJ,EAAAA,EAAEK,MACdA,IAAKL,EAAAA,EAAEK,MACPC,OAAQN,EAAAA,EAAEO,SACVC,MAAOR,EAAAA,EAAEO,SACTE,SAAUT,EAAAA,EAAEU,MAAM,CAChBV,EAAAA,EACGC,OAAO,CACNU,YAAaX,EAAAA,EAAEY,SACfC,iBAAkBb,EAAAA,EAAEY,WAErBE,UACHd,EAAAA,EAAEe,MAAMf,EAAAA,EAAEgB,SAASC,OAAO,KAE5BC,UAAWlB,EAAAA,EAAEY,SACbO,QAASnB,EAAAA,EAAEO,WAEZO,UAIUM,EAAkBpB,EAAAA,EAAEC,OAAO,CACtCoB,aAActB,EACduB,KAAMtB,EAAAA,EAAEuB,QAAQ,WAKLC,EAAiBxB,EAAAA,EAAEC,OAAO,CACrCwB,KAAMzB,EAAAA,EAAEY,SACRU,KAAMtB,EAAAA,EAAEuB,QAAQ,UAKLG,EAAyBC,EAAAA,QAAe5B,GAGxC6B,EAAuBD,EAAAA,QAAeP,GAGtCS,EAAsBF,EAAAA,QAAeH"}