1import y from"./u6tGqJ83.js";import{g as k,a1 as v,d as C,e as E,f as B,R as A,n as u,i as L}from"./CSWLIH4M.js";import{_ as O}from"./CyZoWuXa.js";import{u as U}from"./thJ7xa97.js";import{u as I}from"./hr7FhLVH.js";import{u as p}from"./htDu5c9K.js";import{B as P,h as T,j as N,S as F,a2 as d,L as s,J as R,E as l,u as o,a1 as V,I as $}from"./C6xDOBa0.js";import"./Z1sdcnp3.js";import"./BLbQcILz.js";import"./C_FJxykz.js";import"./C44z3hqI.js";import"./DXCmJwMh.js";import"./C2VOVgPC.js";import"./Cicz0nUF.js";import"./Ruz4joay.js";import"./Dbepr3Kq.js";import"./DryEFwgf.js";import"./BuCHR-O_.js";import"./9alRJhac.js";import"./B1FreOgu.js";import"./D4nmUS8E.js";import"./EBcS9wm6.js";import"./DIZSkkMb.js";import"./gEgD7Han.js";const j={class:"flex items-center gap-4 mb-6"},D={class:"text-3xl font-semibold mb-0"},gt=P({name:"AccountOrganizationUnitsNewPage",__name:"new",setup(J){const{t}=k(),g=v(),_=C(),{formatLink:n}=E(_),i=B(),f=U(),c=I("organization-units-create-page"),r=n("/account/organization-units");A([{name:t("breadcrumbs.accountOverview"),path:n("/account").toString()},{name:t("organization-unit.organizationTitle"),path:r.toString()},{name:t("organization-unit.create.title"),path:""}]),T(()=>{const e=p();e.isB2bAdmin||e.can("organization-unit.create")||(console.warn("Organization Unit creation is not available - redirecting"),u(n("/account")))});const m=p(),b=N(()=>m.isB2bAdmin||m.can("organization-unit.create")),h=()=>{g.push(r)};async function z(e){if("id"in e){console.error("Unexpected update payload in create page");return}try{if(!await f.createOne(e)){i.addError({code:"organization_unit_create_error",message:t("errors.message-default"),type:"Error"});return}i.addError({code:"organization_unit_create_success",message:t("organization-unit.messages.createSuccess"),type:"Success"}),await u(r)}catch(a){i.addError({code:"organization_unit_create_error",message:(a==null?void 0:a.message)||t("errors.message-default"),type:"Error"})}}return(e,a)=>{const x=y,S=L,w=O;return $(),F("section",l(o(c).attrs,{class:"max-w-5xl mx-auto p-4 md:p-6"}),[d("div",j,[s(S,l({to:o(r)},o(c).button("back").attrs,{class:"inline-flex items-center text-gray-600 border rounded border-gray-200 p-2.5","aria-label":o(t)("general.back")}),{default:R(()=>[s(x,{class:"w-6 h-6"})]),_:1},16,["to","aria-label"]),d("h1",D,V(e.$t("organization-unit.create.title")),1)]),s(w,{"form-disabled":!o(b),onSaveChanges:z,onCancel:h},null,8,["form-disabled"])],16)}}});export{gt as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.