PageSourceSearch

https://kiku.listen.org/1401.d017192b60427e30.bundle.js

js listen.org collected 2026-09-24 20:15:45 UTC 12,984 bytes, 1 lines download raw bytes

1"use strict";(self["webpackChunkclient"]=self["webpackChunkclient"]||[]).push([[1401],{31401:function(e,l,t){t.r(l),t.d(l,{default:function(){return y}});var a=t(20641),o=t(90033);const i={class:"o-maxwidth"},n={class:"page-header mb-6"},s={class:"is-flex is-align-items-center"},d={class:"icon"},c={class:"page-title"},m={class:"form-actions mt-6"},u={class:"icon is-small"};function r(e,l,t,r,p,g){const h=(0,a.g2)("b-loading"),b=(0,a.g2)("font-awesome-icon"),L=(0,a.g2)("Form");return(0,a.uX)(),(0,a.CE)("section",i,[(0,a.bF)(h,{modelValue:p.isSaving,"onUpdate:modelValue":l[0]||(l[0]=e=>p.isSaving=e),"is-full-page":!1},null,8,["modelValue"]),(0,a.Lk)("div",n,[(0,a.Lk)("div",s,[(0,a.Lk)("a",{class:"back-button mr-4",onClick:l[1]||(l[1]=l=>e.$router.go(-1))},[(0,a.Lk)("span",d,[(0,a.bF)(b,{icon:"fa-light fa-arrow-left"})])]),(0,a.Lk)("h1",c,(0,o.v_)(e.$t("Create Company")),1)])]),(0,a.bF)(L,{item:p.item,errors:p.errors,onLogoChange:g.handleLogoChange},null,8,["item","errors","onLogoChange"]),(0,a.Lk)("div",m,[(0,a.Lk)("button",{class:"button is-light is-rounded",onClick:l[2]||(l[2]=l=>e.$router.go(-1))},(0,o.v_)(e.$t("Cancel")),1),(0,a.Lk)("button",{class:(0,o.C4)(["button is-primary is-rounded",{"is-loading":p.isSaving}]),onClick:l[3]||(l[3]=(...e)=>g.save&&g.save(...e))},[(0,a.Lk)("span",u,[(0,a.bF)(b,{icon:"fa-light fa-check"})]),(0,a.Lk)("span",null,(0,o.v_)(e.$t("Create Company")),1)],2)])])}t(44114);var p=t(82222),g=t(40834),h={components:{Form:p.A},data(){return{isSaving:!1,pendingLogoFile:null,errors:{},item:{name:null,description:null,website:null,contactEmail:null,ccEmail1:null,ccEmail2:null,contactPhone:null,contactFullName:null,address:null,vatNumber:null,logo:null,mapLatitude:null,mapLongitude:null,mapPlaceName:null}}},computed:{...(0,g.L8)(["tenant","user","isGranted"])},created(){this.isGranted(this.tenant.settingFeatures.company?.whoCanCreateCompany||"USER")||this.$router.push({name:"Dashboard"})},methods:{handleLogoChange(e){this.pendingLogoFile=e},validate(){return this.errors={},this.item.name&&this.item.name.trim()||(this.errors.name=this.$t("Company name is required")),0===Object.keys(this.errors).length},save(){if(!this.validate())return void this.$buefy.toast.open({message:this.$t("Please fill in all required fields"),type:"is-danger"});this.isSaving=!0;let e={...this.item};delete e.logo,e.town&&"object"===typeof e.town&&(e.town=e.town["@id"]||null),e.country&&"object"===typeof e.country&&(e.country=e.country["@id"]||null),this.$http.plain.post("/companies",e).then(e=>this.pendingLogoFile?this.uploadLogo(e.data.id).then(()=>e):e).then(e=>this.saveSuccess(e)).catch(e=>{console.log(e);const l=e.response?.data?.["hydra:description"]||e.response?.data?.detail||this.$t("Error creating company");this.$buefy.toast.open({message:l,type:"is-danger"})}).finally(()=>{this.isSaving=!1})},uploadLogo(e){const l=this.pendingLogoFile,t=new FormData;return t.append("file",l),t.append("type","company"),t.append("entity_id",e),this.$http.plain.post("/media_objects",t,{headers:{"Content-Type":"multipart/form-data"}}).then(e=>{this.item.logo=e.data.contentUrl,this.pendingLogoFile=null}).catch(e=>{console.log(e);const l=e.response?.data?.["hydra:description"]||e.response?.data?.detail||this.$t("Failed to upload logo");this.$buefy.toast.open({message:l,type:"is-danger"})})},saveSuccess(e){this.$buefy.toast.open({message:this.$t("Company created"),type:"is-success"}),this.$router.push({name:"CompanyShow",params:{uuid:e.data.uuid}})}}},b=t(66262);const L=(0,b.A)(h,[["render",r],["__scopeId","data-v-260fcd36"]]);var y=L},82222:function(e,l,t){t.d(l,{A:function(){return Y}});var a=t(20641),o=t(90033);const i={class:"columns is-multiline"},n={class:"column is-8"},s={class:"column is-4"},d={class:"has-text-grey is-size-7 mb-2"},c={class:"card p-4"},m={class:"is-flex is-flex-direction-column is-align-items-center"},u={key:0,class:"image is-96x96 mb-3"},r=["src","alt"],p={key:1,class:"image is-96x96 mb-3"},g=["src","alt"],h={key:2,class:"logo-placeholder mb-3"},b={class:"icon is-large has-text-grey-light"},L={class:"is-flex"},y={class:"button is-small is-light is-rounded"},v={class:"icon is-small"},k={class:"icon is-small"},f={class:"is-size-7 has-text-grey-dark has-text-weight-semibold is-uppercase mt-6 mb-2"},F={class:"card p-5 mb-5"},V={class:"columns is-multiline"},$={class:"column is-6"},C={class:"column is-6"},w={class:"column is-6"},P={class:"column is-6"},U={class:"column is-6"},_={class:"column is-6"},N={key:0,class:"column is-12"},S={class:"help"},x={class:"is-size-7 has-text-grey-dark has-text-weight-semibold is-uppercase mt-5 mb-2"},E={class:"card p-5"},A={class:"columns is-multiline"},j={class:"column is-6"},R={class:"column is-6"},O={class:"column is-6"},T={class:"field has-addons"},X={class:"control"},D={class:"control is-expanded"},q={class:"column is-6"},z={class:"column is-6"};function I(e,l,t,I,B,G){const M=(0,a.g2)("b-loading"),Q=(0,a.g2)("b-input"),W=(0,a.g2)("b-field"),H=(0,a.g2)("font-awesome-icon"),J=(0,a.g2)("b-upload"),K=(0,a.g2)("TownAutocomplete"),Y=(0,a.g2)("CountryAutocomplete"),Z=(0,a.g2)("MapLocationSelector"),ee=(0,a.g2)("PhoneCountryPrefixSelect");return(0,a.uX)(),(0,a.CE)("section",null,[(0,a.bF)(M,{modelValue:B.isLoading,"onUpdate:modelValue":l[0]||(l[0]=e=>B.isLoading=e),"is-full-page":!1},null,8,["modelValue"]),(0,a.Lk)("div",i,[(0,a.Lk)("div",n,[(0,a.bF)(W,{label:e.$t("Company Name"),class:"required",type:t.errors.name?"is-danger":"",message:t.errors.name},{default:(0,a.k6)(()=>[(0,a.bF)(Q,{modelValue:t.item.name,"onUpdate:modelValue":l[1]||(l[1]=e=>t.item.name=e),placeholder:e.$t("Display name"),required:""},null,8,["modelValue","placeholder"])]),_:1},8,["label","type","message"]),(0,a.bF)(W,{label:e.$t("Description"),class:"mt-4"},{default:(0,a.k6)(()=>[(0,a.bF)(Q,{modelValue:t.item.description,"onUpdate:modelValue":l[2]||(l[2]=e=>t.item.description=e),type:"textarea",placeholder:e.$t("Brief description of your company"),rows:"2"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),(0,a.bF)(W,{label:e.$t("Website"),class:"mt-4"},{default:(0,a.k6)(()=>[(0,a.bF)(Q,{modelValue:t.item.website,"onUpdate:modelValue":l[3]||(l[3]=e=>t.item.website=e),type:"url",placeholder:"https://example.com"},null,8,["modelValue"])]),_:1},8,["label"])]),(0,a.Lk)("div",s,[(0,a.Lk)("p",d,(0,o.v_)(e.$t("Company Logo")),1),(0,a.Lk)("div",c,[(0,a.Lk)("div",m,[t.item.logo&&!B.pendingLogoPreview?((0,a.uX)(),(0,a.CE)("figure",u,[(0,a.Lk)("img",{src:t.item.logo,alt:t.item.name,class:"is-rounded"}
1,null,8,r)])):B.pendingLogoPreview?((0,a.uX)(),(0,a.CE)("figure",p,[(0,a.Lk)("img",{src:B.pendingLogoPreview,alt:e.$t("New logo"),class:"is-rounded"},null,8,g)])):((0,a.uX)(),(0,a.CE)("div",h,[(0,a.Lk)("span",b,[(0,a.bF)(H,{icon:"fa-light fa-building",size:"2x"})])])),(0,a.Lk)("div",L,[(0,a.bF)(J,{modelValue:B.pendingLogoFile,"onUpdate:modelValue":[l[4]||(l[4]=e=>B.pendingLogoFile=e),G.handlePendingLogoUpload],accept:"image/png, image/jpeg, image/jpg"},{default:(0,a.k6)(()=>[(0,a.Lk)("a",y,[(0,a.Lk)("span",v,[(0,a.bF)(H,{icon:"fa-light fa-camera"})]),(0,a.Lk)("span",null,(0,o.v_)(t.item.logo||B.pendingLogoPreview?e.$t("Change"):e.$t("Upload")),1)])]),_:1},8,["modelValue","onUpdate:modelValue"]),B.pendingLogoPreview?((0,a.uX)(),(0,a.CE)("button",{key:0,class:"button is-small is-light is-rounded ml-2",type:"button",onClick:l[5]||(l[5]=(...e)=>G.clearPendingLogo&&G.clearPendingLogo(...e))},[(0,a.Lk)("span",k,[(0,a.bF)(H,{icon:"fa-light fa-times"})])])):(0,a.Q3)("",!0)])])])])]),(0,a.Lk)("p",f,(0,o.v_)(e.$t("Billing Details")),1),(0,a.Lk)("div",F,[(0,a.Lk)("div",V,[(0,a.Lk)("div",$,[(0,a.bF)(W,{label:e.$t("Legal Name")},{default:(0,a.k6)(()=>[(0,a.bF)(Q,{modelValue:t.item.legalName,"onUpdate:modelValue":l[6]||(l[6]=e=>t.item.legalName=e),placeholder:e.$t("Full legal company name for invoices")},null,8,["modelValue","placeholder"])]),_:1},8,["label"])]),(0,a.Lk)("div",C,[(0,a.bF)(W,{label:e.$t("Registration Number")},{default:(0,a.k6)(()=>[(0,a.bF)(Q,{modelValue:t.item.registrationNumber,"onUpdate:modelValue":l[7]||(l[7]=e=>t.item.registrationNumber=e),placeholder:e.$t("CUI / Company ID")},null,8,["modelValue","placeholder"])]),_:1},8,["label"])]),(0,a.Lk)("div",w,[(0,a.bF)(W,{label:e.$t("VAT Number")},{default:(0,a.k6)(()=>[(0,a.bF)(Q,{modelValue:t.item.vatNumber,"onUpdate:modelValue":l[8]||(l[8]=e=>t.item.vatNumber=e),placeholder:"RO12345678"},null,8,["modelValue"])]),_:1},8,["label"])]),(0,a.Lk)("div",P,[(0,a.bF)(W,{label:e.$t("Billing Address")},{default:(0,a.k6)(()=>[(0,a.bF)(Q,{modelValue:t.item.address,"onUpdate:modelValue":l[9]||(l[9]=e=>t.item.address=e),placeholder:e.$t("Full billing address")},null,8,["modelValue","placeholder"])]),_:1},8,["label"])]),(0,a.Lk)("div",U,[(0,a.bF)(K,{modelValue:t.item.town,"onUpdate:modelValue":[l[10]||(l[10]=e=>t.item.town=e),G.onTownSelected],label:e.$t("Town"),town:t.item.town,"is-result-object":!0,"show-map-icon":!0},null,8,["modelValue","label","town","onUpdate:modelValue"])]),(0,a.Lk)("div",_,[(0,a.bF)(Y,{country:t.item.country,label:e.$t("Country"),placeholder:e.$t("Select country"),"is-result-object":!0,"onUpdate:modelValue":G.onCountrySelected},null,8,["country","label","placeholder","onUpdate:modelValue"])]),e.tenant?.settingFeatures?.company?.isActive?((0,a.uX)(),(0,a.CE)("div",N,[(0,a.bF)(Z,{modelValue:G.mapLocation,"onUpdate:modelValue":l[11]||(l[11]=e=>G.mapLocation=e),label:e.$t("Location on companies map"),placeholder:e.$t("Search for your address")},null,8,["modelValue","label","placeholder"]),(0,a.Lk)("p",S,(0,o.v_)(e.$t("Used to place your company on the directory map. Leave empty to use the town centre.")),1)])):(0,a.Q3)("",!0)])]),(0,a.Lk)("p",x,(0,o.v_)(e.$t("Financial Contact")),1),(0,a.Lk)("div",E,[(0,a.Lk)("div",A,[(0,a.Lk)("div",j,[(0,a.bF)(W,{label:e.$t("Financial contact full name")},{default:(0,a.k6)(()=>[(0,a.bF)(Q,{modelValue:t.item.contactFullName,"onUpdate:modelValue":l[12]||(l[12]=e=>t.item.contactFullName=e),placeholder:e.$t("Financial contact person")},null,8,["modelValue","placeholder"])]),_:1},8,["label"])]),(0,a.Lk)("div",R,[(0,a.bF)(W,{label:e.$t("Financial contact email")},{default:(0,a.k6)(()=>[(0,a.bF)(Q,{modelValue:t.item.contactEmail,"onUpdate:modelValue":l[13]||(l[13]=e=>t.item.contactEmail=e),type:"email",placeholder:"[email protected]"},null,8,["modelValue"])]),_:1},8,["label"])]),(0,a.Lk)("div",O,[(0,a.bF)(W,{label:e.$t("Financial contact phone")},{default:(0,a.k6)(()=>[(0,a.Lk)("div",T,[(0,a.Lk)("div",X,[(0,a.bF)(ee,{modelValue:t.item.contactPhoneCountry,"onUpdate:modelValue":l[14]||(l[14]=e=>t.item.contactPhoneCountry=e),placeholder:e.$t("Prefix")},null,8,["modelValue","placeholder"])]),(0,a.Lk)("div",D,[(0,a.bF)(Q,{modelValue:t.item.contactPhone,"onUpdate:modelValue":l[15]||(l[15]=e=>t.item.contactPhone=e),type:"tel",disabled:!t.item.contactPhoneCountry,placeholder:e.$t("Phone number")},null,8,["modelValue","disabled","placeholder"])])])]),_:1},8,["label"])]),(0,a.Lk)("div",q,[(0,a.bF)(W,{label:e.$t("Additional contact email 1 (Cc)")},{default:(0,a.k6)(()=>[(0,a.bF)(Q,{modelValue:t.item.ccEmail1,"onUpdate:modelValue":l[16
1]||(l[16]=e=>t.item.ccEmail1=e),type:"email",placeholder:"[email protected]"},null,8,["modelValue"])]),_:1},8,["label"])]),(0,a.Lk)("div",z,[(0,a.bF)(W,{label:e.$t("Additional contact email 2 (Cc)")},{default:(0,a.k6)(()=>[(0,a.bF)(Q,{modelValue:t.item.ccEmail2,"onUpdate:modelValue":l[17]||(l[17]=e=>t.item.ccEmail2=e),type:"email",placeholder:"[email protected]"},null,8,["modelValue"])]),_:1},8,["label"])])])])])}t(14603),t(47566),t(98721);var B=t(40834),G=t(99440),M=t(53369),Q=t(36401),W=t(83806),H={components:{PhoneCountryPrefixSelect:G.A,TownAutocomplete:M.A,CountryAutocomplete:Q.A,MapLocationSelector:W.A},props:{item:{type:Object,required:!0},errors:{type:Object,default:()=>({})}},data(){return{isLoading:!1,pendingLogoFile:null,pendingLogoPreview:null}},computed:{...(0,B.L8)(["tenant"]),mapLocation:{get(){return this.item.mapLatitude||this.item.mapLongitude||this.item.mapPlaceName?{latitude:this.item.mapLatitude,longitude:this.item.mapLongitude,placeName:this.item.mapPlaceName}:null},set(e){e?(this.item.mapLatitude=e.latitude?String(e.latitude):null,this.item.mapLongitude=e.longitude?String(e.longitude):null,this.item.mapPlaceName=e.placeName||null):(this.item.mapLatitude=null,this.item.mapLongitude=null,this.item.mapPlaceName=null)}}},methods:{onTownSelected(e){this.item.town=e,e&&e.country&&"object"===typeof e.country&&(this.item.country=e.country)},onCountrySelected(e){this.item.country=e||null},handlePendingLogoUpload(e){e&&(this.pendingLogoPreview&&URL.revokeObjectURL(this.pendingLogoPreview),this.pendingLogoPreview=URL.createObjectURL(e),this.$emit("logo-change",e))},clearPendingLogo(){this.pendingLogoPreview&&URL.revokeObjectURL(this.pendingLogoPreview),this.pendingLogoFile=null,this.pendingLogoPreview=null,this.$emit("logo-change",null)}}},J=t(66262);const K=(0,J.A)(H,[["render",I],["__scopeId","data-v-7d66de62"]]);var Y=K}}]);

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.