1"use strict";(globalThis.webpackChunkwips_components_scripts||=[]).push([[11298],{"8ca74219c51136df"(e,l,o){o.r(l),o.d(l,{default:()=>v}),o("07a8db537f1fb869");var t=o("b641633d6c906d19"),i=o("a54fa6d0a722ba3f"),a=o("99c472be6da17922");const n={id:"petroForm"},s={id:"petroFormElements"},r={class:"container"},d=["src"],c={key:1},p=["src"],u={class:"container"},m={class:"container"},f={class:"container"},g={class:"col-8"},b={class:"container"},h={class:"container newsletter"},k={key:0,class:"col-8"},V={key:1,class:"col-8"},y={props:["userData","profileData","contactData"],data(){return{lists:[],user:this.userData,profile:this.profileData,contacts:this.contactData,newLogo:"",notifications:{logo:[],organizationNumber:[],organizationName:[],phone:[],position:[],category:[],serviceCategory:[],submit:[]},categories:{brønnsystemer:"Brønnsystemer",boring:"Boring","entreprenør/bygg/anlegg":"Entreprenør/bygg/anlegg","konstruksjon, fabrikasjon og vedlikehold":"Konstruksjon, fabrikasjon og vedlikehold",oljeselskaper:"Oljeselskaper","sikkerhet og beredskap":"Sikkerhet og beredskap","støtte- og servicetjenester":"Støtte- og servicetjenester",undervannsteknologi:"Undervannsteknologi","varer og tjenester":"Varer og tjenester",forvaltning:"Forvaltning"},serviceCategories:{engineering:"Engineering",konsulent:"Konsulent","logistikk og transport":"Logistikk og transport",utdanning:"Utdanning","miljø, renhold og avfallsløsninger":"Miljø, renhold og avfallsløsninger","test og inspeksjon":"Test og inspeksjon","utstyr og service":"Utstyr og service",bemanning:"Bemanning",organisasjon:"Organisasjon"}}},mounted(){this.getLists()},methods:{logoChanged(e){let l=e.target.files[0];this.profile.logo=URL.createObjectURL(l)},addContact(){this.contacts.push({name:"",phone:"",email:"",workTitle:""})},getLists(){fetch("/Api/mailchimp/getLists",{credentials:"same-origin"}).then(e=>e.json().then(e=>{for(let l in e.data){let o=e.data[l];this.lists.push({label:o.name,checked:o.isMember,id:o.id,originalChecked:o.isMember})}}))},updateMailingLists(){for(const e of this.lists)if(e.checked){if(!e.originalChecked){e.originalChecked=!0;const l=new FormData;l.append("listId",e.id),fetch("/Api/mailchimp/addToList",{method:"post",body:l,credentials:"same-origin"}).then(e=>e.json().then(()=>{this.addNotification("submit","Nyhetsbrev er lagt til","notice")}))}}else if(e.originalChecked){e.originalChecked=!1;const l=new FormData;l.append("listId",e.id),fetch("/Api/mailchimp/removeFromList",{method:"post",body:l,credentials:"same-origin"}).then(e=>e.json().then(()=>{this.addNotification("submit","Nyhetsbrev er tatt bort","notice")}))}},sendSaveRequest(e){fetch("/Api/petroArctic/saveProfile",{method:"post",body:e,credentials:"same-origin"}).then(e=>e.json().then(e=>{if(e.succeeded)this.updateMailingLists(),this.addNotification("submit","Din profil er lagret","notice");else if(e.error&&e.error.missingParameters){for(const l of e.error.missingParameters)this.addNotification(l,"Field is required","alert");this.addNotification("submit","Something is not right","alert")}else"Illegal email"===e.error?(this.addNotification("email","Not a valid e-mail address","alert"),this.addNotification("submit","Something is not right","alert")):this.addNotification("submit","An unknown error accoured","danger")}))},saveProfile(){this.clearNotifications();const e=new FormData;Object.keys(this.profile).forEach(l=>{"logo"!==l&&e.append(l,this.profile[l])}),e.append("contacts",JSON.stringify(this.contacts));let l=null;const o=document.querySelector("#logo input[type=file]");if(o){let e=o.files;e&&(l=e[0])}l?(new FileReader).onload=l=>{e.set("logo",l.target.result),this.sendSaveRequest(e)}:this.sendSaveRequest(e)},addNotification(e,l,o){this.notifications[e].push({content:l,severity:o})},clearNotifications(){for(const e in this.notifications)this.notifications[e]=[]}}},v=(0,t.pM)({...y,__name:"ProfileAdmin",setup(e){const l=(0,t.$V)(()=>Promise.all([o.e(52857),o.e(99959),o.e(94607),o.e(59442)]).then(o.bind(o,"a9bcaf22dee96965")));return(e,o)=>((0,t.uX)(),(0,t.CE)("div",n,[(0,t.Lk)("div",s,[e.profile?((0,t.uX)(),(0,t.CE)(t.FK,{key:0},[(0,t.Lk)("div",r,[o[21]||(o[21]=(0,t.Lk)("h2",{class:"col-8"},"1. Bedrift",-1)),(0,t.bF)((0,i.R1)(l),{notifications:e.notifications.organizationName,label:"Bedriftsnavn",type:"text",modelValue:e.profile.organizationName,"onUpdate:modelValue":o[0]||(o[0]=l=>e.profile.organizationName=l),required:"",class:"col-4"},null,8,["notifications","modelValue"]),(0,t.bF)((0,i.R1)(l),{class:"col-4",label:"E-post",type:"email",modelValue:e.profile.organizationEmail,"onUpdate:modelValue":o[1]||(o[1]=l=>e.profile.organizationEmail=l)},null,8,["modelValue"]),(0,t.bF)((0,i.R1)(l),{notifications:e.notifications.phone,class:"col-4",label:"Telefon",type:"tel",modelValue:e.profile.organizationPhone,"onUpdate:modelValue":o[2]||(o[2]=l=>e.profile.organizationPhone=l)},null,8,["notifications","modelValue"]),(0,t.bF)((0,i.R1)(l),{label:"Faks",type:"tel",class:"col-4",modelValue:e.profile.organizationFax,"onUpdate:modelValue":o[3]||(o[3]=l=>e.profile.organizationFax=l)},null,8,["modelValue"]),(0,t.bF)((0,i.R1)(l),{notifications:e.notifications.organizationNumber,required:"",label:"Organisasjonsnummer",type:"text",class:"col-4",modelValue:e.profile.organizationNumber,"onUpdate:modelValue":o[4]||(o[4]=l=>e.profile.organizationNumber=l)},null,8,["notifications","modelValue"]),(0,t.bF)((0,i.R1)(l),{class:"col-4",label:"Antall årsverk i Norge",type:"text",modelValue:e.profile.numberOfEmployees,"onUpdate:modelValue":o[5]||(o[5]=l=>e.profile.numberOfEmployees=l)},null,8,["modelValue"]),(0,t.bF)((0,i.R1)(l),{label:"Varer",type:"text",modelValue:e.profile.goods,"onUpdate:modelValue":o[6]||(o[6]=l=>e.profile.goods=l),class:"col-4"},null,8,["modelValue"]),(0,t.bF)((0,i.R1)(l),{label:"Tjenester",type:"text",modelValue:e.profile.services,"onUpdate:modelValue":o[7]||(o[7]=l=>e.profile.services=l),class:"col-4"},null,8,["modelValue"]),(0,t.bF)((0,i.R1)(l),{class:"col-4",notifications:e.notifications.category,modelValue:e.profile.category,"onUpdate:modelValue":o[8]||(o[8]=l=>e.profile.category=l),type:"select",options:e.categories,label:"Medlemskategori"},null,8,["notifications","modelValue","options"]),"støtte- og servicetjenester"===e.profile.category?((0,t.uX)(),(0,t.Wv)((0,i.R1)(l),{key:0,class:"col-4",notifications:e.notifications.serviceCategory,modelValue:e.profile.serviceCategory,"onUpdate:modelValue":o[9]||(o[9]=l=>e.profile.serviceCategory=l),type:"select",options:e.serviceCategories,label:"Underkategori"},null,8,["notifications","modelValue","options"])):(0,t.Q3)("",!0),(0,t.bF)((0,i.R1)(l),{class:"col-8",label:"Hjemmeside",type:"url",modelValue:e.profile.webpage,"onUpdate:modelValue":o[10]||(o[10]=l=>e.profile.webpage=l)},null,8,["modelValue"]),(0,t.bF)((0,i.R1)(l),{class:"col-8",notifications:e.notifications.logo,id:"logo",label:"Logo",type:"file",onChange:e.logoChanged},null,8,["notifications","onChange"]),(0,t.Lk)("div",null,[(0,t.Lk)("img",{class:"logo",src:e.newLogo},null,8,d)]),e.profile.logo?((0,t.uX)(),(0,t.CE)("div",c,[(0,t.Lk)("img",{class:"logo",src:e.profile.logo},null,8,p)])):(0,t.Q3)("",!0),o[22]||(o[22]=(0,t.Lk)("div",{class:"stop-float"},null,-1))]),(0,t.Lk)("div",u,[o[23]||(o[23]=(0,t.Lk)("h2",{class:"col-8"},"2. Adresse",-1)),(0,t.bF)((0,i.R1)(l),{label:"Besøksadresse",type:"text",class:"col-8",modelValue:e.profile.visitorAddress,"onUpdate:modelValue":o[11]||(o[11]=l=>e.profile.visitorAddress=l)},null,8,["modelValue"]),(0,t.bF)((0,i.R1)(l),{label:"Postadresse",type:"text",modelValue:e.profile.postAddress,"onUpdate:modelValue":o[12]||(o[12]=l=>e.profile.postAddress=l),class:"col-8"},null,8,["modelValue"]),(0,t.bF)((0,i.R1)(l),{label:"Postnummer",type:"text",modelValue:e.profile.zipCode,"onUpdate:modelValue":o[13]||(o[13]=l=>e.profile.zipCode=l),class:"col-2 zip"},null,8,["modelValue"]),(0,t.bF)((0,i.R1)(l),{label:"Poststed",type:"text",modelValue:e.profile.city,"onUpdate:modelValue":o[14]||(o[14]=l=>e.profile.city=l),class:"col-6"},null,8,["modelValue"]),(0,t.bF)((0,i.R1)(l),{label:"Land",type:"text",modelValue:e.profile.contry,"onUpdate:modelValue":o[15]||(o[15]=l=>e.profile.contry=l),class:"col-8"},null,8,["modelValue"])]),(0,t.Lk)("div",m,[o[24]||(o[24]=(0,t.Lk)("h2",{class:"col-8"},"3. Faktura",-1)),(0,t.bF)((0,i.R1)(l),{label:"Fakturamottaker",type:"text",modelValue:e.profile.invoiceReceiver,"onUpdate:modelValue":o[16]||(o[16]=l=>e.profile.invoiceReceiver=l),class:"col-4"},null,8,["modelValue"]),(0,t.bF)((0,i.R1)(l),{label:"Faktura e-post",type:"email",modelValue:e.profile.invoiceEmail,"onUpdate:modelValue":o[17]||(o[17]=l=>e.profile.invoiceEmail=l),class:"col-4"},null,8,["modelValue"]),(0,t.bF)((0,i.R1)(l),{label:"Fakturareferanse",type:"text",modelValue:e.profile.invoiceReference,"onUpdate:modelValue":o[18]||(o[18]=l=>e.profile.invoiceReference=l),class:"col-4"},null,8,["modelValue"]),(0,t.bF)((0,i.R1)(l),{label:"Betalingsreferanse",type:"text",modelValue:e.profile.billingReference,"onUpdate:modelValue":o[19]||(o[19]=l=>e.profile.billingReference=l),class:"col-4"},null,8,["modelValue"])]),(0,t.Lk)("div",f,[o[26]||(o[26]=(0,t.Lk)("h2",{class:"col-8"},"4. Kontaktpersoner",-1)),((0,t.uX)(!0),(0,t.CE)(t.FK,null,(0,t.pI)(e.contacts,(e,n)=>((0,t.uX)(),(0,t.CE)(t.FK,{key:n},[o[25]||(o[25]=(0,t.Lk)("div",{class:"container-spacer"},null,-1)),(0,t.Lk)("h3",g,"Kontaktperson "+(0,a.v_)(n+1),1),(0,t.bF)((0,i.R1)(l),{label:"Navn",type:"text",class:"col-8",modelValue:e.name,"onUpdate:modelValue":l=>
1e.name=l},null,8,["modelValue","onUpdate:modelValue"]),(0,t.bF)((0,i.R1)(l),{label:"Telefon",type:"tel",class:"col-4",modelValue:e.phone,"onUpdate:modelValue":l=>e.phone=l},null,8,["modelValue","onUpdate:modelValue"]),(0,t.bF)((0,i.R1)(l),{label:"E-post",type:"email",class:"col-4",modelValue:e.email,"onUpdate:modelValue":l=>e.email=l},null,8,["modelValue","onUpdate:modelValue"]),(0,t.bF)((0,i.R1)(l),{label:"Stilling",type:"text",class:"col-8",modelValue:e.workTitle,"onUpdate:modelValue":l=>e.workTitle=l},null,8,["modelValue","onUpdate:modelValue"])],64))),128)),(0,t.bF)((0,i.R1)(l),{class:"col-4 no-grow",type:"button","model-value":"Ny kontaktperson",onClick:e.addContact},null,8,["onClick"])]),(0,t.Lk)("div",b,[o[27]||(o[27]=(0,t.Lk)("h2",{class:"col-8"},"5. Firmabeskrivelse",-1)),o[28]||(o[28]=(0,t.Lk)("p",null,"Beskriv bedriften med noen få setninger.",-1)),(0,t.bF)((0,i.R1)(l),{class:"col-8",type:"textarea",modelValue:e.profile.description,"onUpdate:modelValue":o[20]||(o[20]=l=>e.profile.description=l)},null,8,["modelValue"])])],64)):(0,t.Q3)("",!0),(0,t.Lk)("div",h,[e.profile?((0,t.uX)(),(0,t.CE)("h2",k,"6. Nyhetsbrev")):((0,t.uX)(),(0,t.CE)("h2",V,"Nyhetsbrev")),o[29]||(o[29]=(0,t.Lk)("p",null,"Meld deg på nyhetsbrevgruppe under for å motta nyheter fra Petro Arctic.",-1)),((0,t.uX)(!0),(0,t.CE)(t.FK,null,(0,t.pI)(e.lists,e=>((0,t.uX)(),(0,t.CE)("div",{key:e.id,class:"newsletter-group"},[(0,t.bF)((0,i.R1)(l),{label:e.label,type:"checkbox",modelValue:e.checked,"onUpdate:modelValue":l=>e.checked=l},null,8,["label","modelValue","onUpdate:modelValue"])]))),128))])]),e.profile?((0,t.uX)(),(0,t.Wv)((0,i.R1)(l),{key:0,notifications:e.notifications.submit,type:"button",id:"submit",onClick:e.saveProfile,"model-value":"Oppdater profil"},null,8,["notifications","onClick"])):((0,t.uX)(),(0,t.Wv)((0,i.R1)(l),{key:1,notifications:e.notifications.submit,type:"button",id:"submit",onClick:e.updateMailingLists,"model-value":"Oppdater profil"},null,8,["notifications","onClick"]))]))}})}}]);
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.