module.exports=[50640,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"InvariantError",{enumerable:!0,get:function(){return d}});class d extends Error{constructor(a,b){super(`Invariant: ${a.endsWith(".")?a:a+"."} This is a bug in Next.js.`,b),this.name="InvariantError"}}},89605,a=>{"use strict";var b=a.i(37936),c=a.i(98310),d=a.i(18558);async function e(){let a=await (0,c.createClient)(),{data:b,error:d}=await a.from("end_customers").select("*").order("company_name",{ascending:!0});if(d)throw d;return b}async function f(a){let b=await (0,c.createClient)(),{data:d,error:e}=await b.from("end_customers").select("*").eq("id",a).single();return e?null:d}async function g(a){let b=await (0,c.createClient)(),{data:{user:e}}=await b.auth.getUser();if(!e)throw Error("Not authenticated");let{data:f,error:g}=await b.from("end_customers").insert([{partner_id:e.id,company_name:a.company_name,vat_id:a.vat_id||null,first_name:a.first_name||null,last_name:a.last_name||null,street:a.street||null,zip:a.zip||null,city:a.city||null}]).select().single();if(g)throw g;return(0,d.revalidatePath)("/my-customers"),f}async function h(a,b){let e=await (0,c.createClient)(),{error:f}=await e.from("end_customers").update({company_name:b.company_name,vat_id:b.vat_id||null,first_name:b.first_name||null,last_name:b.last_name||null,street:b.street||null,zip:b.zip||null,city:b.city||null}).eq("id",a);if(f)throw f;(0,d.revalidatePath)("/my-customers"),(0,d.revalidatePath)(`/my-customers/${a}`)}async function i(a){let b=await (0,c.createClient)(),{error:e}=await b.from("end_customers").update({company_name:"[GELÖSCHT]",vat_id:null,first_name:"[GELÖSCHT]",last_name:null,street:null,zip:null,city:null,is_anonymized:!0}).eq("id",a).eq("is_anonymized",!1);if(e)throw e;(0,d.revalidatePath)("/my-customers"),(0,d.revalidatePath)(`/my-customers/${a}`)}(0,a.i(13095).ensureServerEntryExports)([e,f,g,h,i]),(0,b.registerServerReference)(e,"0036e9685aaabfdadc7d206e1f647a0c387c6b7762",null),(0,b.registerServerReference)(f,"40b1828e674eaaaba9492eb021cee55fcf1bf5db06",null),(0,b.registerServerReference)(g,"40a04206a3bd39a0f09607845ce500a4c968ddf45b",null),(0,b.registerServerReference)(h,"604eedcac9aeacad0088ea6f03de48edc8c9904b05",null),(0,b.registerServerReference)(i,"40a0f04003dd01338359a0385cffe593cf4fb2b44c",null),a.s(["anonymizeEndCustomer",0,i,"createEndCustomer",0,g,"getEndCustomer",0,f,"getEndCustomers",0,e,"updateEndCustomer",0,h])},72724,a=>{"use strict";var b=a.i(89605);a.s([],12992),a.i(12992),a.s(["40a04206a3bd39a0f09607845ce500a4c968ddf45b",()=>b.createEndCustomer],72724)}];

//# sourceMappingURL=_0n~8gc3._.js.map