PageSourceSearch

https://nextthere.com/assets/PhoneEdit-BpJOi12y.js

js nextthere.com collected 2026-09-24 19:03:34 UTC 8,065 bytes, 1 lines download raw bytes

1var Z=Object.defineProperty;var H=(r,t,e)=>t in r?Z(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var v=(r,t,e)=>H(r,typeof t!="symbol"?t+"":t,e);import{x as Q,G as E,a as u,e as n,o as i,d as q,r as f,O as z,c as K,i as W,k as S,w as x,b as y,g,P as b,Q as $,R as X,F,l as O,t as k,s as Y,v as I,h as T,V as ee,m as te,_ as oe}from"./index-DbpIxVVg.js";import{P as N}from"./Stop-8NKSpgr4.js";import{_ as ne}from"./ErrorView.vue_vue_type_script_setup_true_lang-rTuR_K5N.js";import{P as se}from"./PageContent-CaO1rUex.js";import{S as B}from"./SimplePanel-CrGTrN0K.js";import{_ as ae}from"./TransitEntitySelect.vue_vue_type_script_setup_true_lang-Cl4izas8.js";import{u as le}from"./entity-Dyy2H1qK.js";import{r as re}from"./XMarkIcon-ClWH0SNC.js";import"./ErrorContent.vue_vue_type_script_setup_true_lang--XFDxIpt.js";import"./RoundedBadge-zDfp8xRL.js";import"./ArrowTopRightOnSquareIcon-Bwi8lzNJ.js";import"./ChevronRightIcon-CKGSa4-R.js";import"./disclosure-DbKVSJYz.js";import"./keyboard-C910qfwt.js";import"./SearchService-CvvzWgdB.js";import"./PointOfInterest-Buj-zZdX.js";import"./RouteGroup-C9eTeiZ3.js";import"./SearchPaletteItem.vue_vue_type_script_setup_true_lang-4nHU3J_8.js";import"./RouteGlyph.vue_vue_type_script_setup_true_lang-CZS1VAaM.js";import"./combobox-Bf1jGWS7.js";import"./form-BG81DLzL.js";import"./calculate-active-index-Bo9BYas1.js";import"./use-tree-walker-DlTPShXD.js";class h{constructor(t,e,l){v(this,"id");v(this,"stopId");v(this,"phoneNumber");v(this,"stop");v(this,"saved");this.stop=l,this.stopId=t,this.phoneNumber=e}static fromJSON(t,e){const l=Object.assign(new h,t);return l.saved=!0,l.phoneNumber=e,l}}class ie{constructor(t=Q().apiClient){v(this,"client");this.client=t}async findById(t){const e=await this.client.get(`/v1/phone/${t}`),l=N.fromJSON(e.data.phone);return l.mappings=e.data.mapping.map(p=>h.fromJSON(p,l)),l.region=E.fromJSON(e.data.region),l}async commit(t){const e=await this.client.post(`/v1/phone/${t.region.countryCode}/${t.region.regionCode}`,t);return N.fromJSON(e.data.phone)}async deletePhone(t){await this.client.delete(`/v1/phone/${t.id}`)}async commitMapping(t){const e=t.phoneNumber.region,l=t.phoneNumber.id,p=t.stopId,c=await this.client.post(`/v1/phone/${e.countryCode}/${e.regionCode}/${l}/${p}`,{});return h.fromJSON(c.data.mapping)}async deleteMapping(t){const e=t.phoneNumber.region,l=t.phoneNumber.id,p=t.stopId;await this.client.delete(`/v1/phone/${e.countryCode}/${e.regionCode}/${l}/${p}`)}}function de(r,t){return i(),u("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[n("path",{"fill-rule":"evenodd",d:"M10.5 3.75a6 6 0 0 0-5.98 6.496A5.25 5.25 0 0 0 6.75 20.25H18a4.5 4.5 0 0 0 2.206-8.423 3.75 3.75 0 0 0-4.133-4.303A6.001 6.001 0 0 0 10.5 3.75Zm2.03 5.47a.75.75 0 0 0-1.06 0l-3 3a.75.75 0 1 0 1.06 1.06l1.72-1.72v4.94a.75.75 0 0 0 1.5 0v-4.94l1.72 1.72a.75.75 0 1 0 1.06-1.06l-3-3Z","clip-rule":"evenodd"})])}const ue={class:"md:grid md:grid-cols-2 md:gap-6 xl:w-2/3 xl:mx-auto"},pe={class:"card-body"},ce={key:0,class:"lead"},me={class:"space-y-1"},ve={class:"form-group"},fe={class:"form-group"},ye=["value"],ge={class:"form-group"},he={class:"form-group"},xe={class:"flex space-x-3 justify-between"},we={class:"btn btn-primary space-x-2",type:"submit"},be={key:0,class:"text-success"},_e={key:1,class:"text-muted"},Ce={class:"card-body space-y-4"},Se={class:"space-y-2"},$e={class:"font-semibold"},ke={class:"text-slate-500-d"},Ie=["onClick"],Ne={key:0},Pe=q({__name:"PhoneEdit",props:{id:String,countryCode:String,regionCode:String,stopId:String},setup(r){const t=r,e=f(),l=f(),p=f(!1),c=f(!1),_=f(!1),d=f(),C=f(),J=te(),U=le(),w=new ie,D=z([{id:0,name:"Station"},{id:1,name:"Platform"},{id:2,name:"Transport Information"},{id:3,name:"Taxi Booking"}]),P=K(()=>`/stop/${t.countryCode}/${t.regionCode}/${t.stopId}/info`);W(async()=>{if(!t.id||t.id==="new"){const a=U.stop;e.value=R(),l.value=a?[new h(a.gtfsId,e.value,a)]:[]}else await M()});function R(){const a=new N;return a.type=0,a.region=new E(t.countryCode,t.regionCode),a}async function M(){try{p.value=!0,d.value=null,e.value=await w.findById(`${t.countryCode}/${t.regionCode}/${t.id}`)}catch(a){d.value=a}finally{p.value=!1}}async function A(){if(e.value)try{c.value=!0,_.value=!1,d.value=null,e.value=await w.commit(e.value),await j(),_.value=!0,await J.push(P.value)}catch(a){d.value=a}finally{c.value=!1}}async function j(){for(const a of l.value||[])a.saved||await V(a)}async function V(a){if(e.value.id)try{c.value=!0,d.value=null,await w.commitMapping(a),a.saved=!0}
1catch(o){d.value=o}finally{c.value=!1}}async function G(a){var m;const o=((m=e.value)==null?void 0:m.mappings)||[];try{c.value=!0,d.value=null,await w.deleteMapping(a),o.splice(o.indexOf(a),1)}catch(s){d.value=s}finally{c.value=!1}}async function L(a){const o=a.stop,m=e.value,s=new h(o.gtfsId,m,o);m.mappings.push(s),C.value=null,await V(s)}return(a,o)=>{const m=Y("router-link");return i(),S(se,null,{default:x(()=>[d.value?(i(),S(ne,{key:0,error:d.value,thing:"phone number",onRetry:M},null,8,["error"])):y("",!0),n("div",ue,[g(B,{class:"p-4 md:p-6 space-y-4"},{default:x(()=>[o[14]||(o[14]=n("div",{class:"text-xl text-slate-700-d"}," Phone number ",-1)),n("div",pe,[p.value?(i(),u("p",ce,"Loading...")):y("",!0),e.value?(i(),u("form",{key:1,role:"form",method:"post",autocomplete:"off",class:"space-y-4",onSubmit:o[4]||(o[4]=ee(s=>A(),["prevent"]))},[n("div",me,[n("div",ve,[o[6]||(o[6]=n("label",{for:"descriptionField"},"Display name",-1)),b(n("input",{id:"descriptionField","onUpdate:modelValue":o[0]||(o[0]=s=>e.value.description=s),class:"form-control",type:"text",autofocus:""},null,512),[[$,e.value.description]])]),n("div",fe,[o[7]||(o[7]=n("label",{for:"phoneTypeField"},"Type",-1)),b(n("select",{id:"phoneTypeField","onUpdate:modelValue":o[1]||(o[1]=s=>e.value.type=s),class:"form-control"},[(i(!0),u(F,null,O(D,s=>(i(),u("option",{key:s.id,value:s.id},k(s.name),9,ye))),128))],512),[[X,e.value.type]])]),n("div",ge,[o[8]||(o[8]=n("label",{for:"externalField"},"External number",-1)),b(n("input",{id:"externalField","onUpdate:modelValue":o[2]||(o[2]=s=>e.value.external=s),class:"form-control",type:"text"},null,512),[[$,e.value.external]])]),n("div",he,[o[9]||(o[9]=n("label",{for:"internalField"},"Internal number",-1)),b(n("input",{id:"internalField","onUpdate:modelValue":o[3]||(o[3]=s=>e.value.internal=s),class:"form-control",type:"text",placeholder:"Optional"},null,512),[[$,e.value.internal]])])]),n("div",xe,[g(m,{class:"btn btn-light mr-2",to:P.value},{default:x(()=>o[10]||(o[10]=[I("Cancel",-1)])),_:1,__:[10]},8,["to"]),n("button",we,[g(T(de),{class:"w-5 h-5"}),o[11]||(o[11]=n("span",null,"Save",-1))])]),_.value?(i(),u("span",be,o[12]||(o[12]=[n("i",{class:"fa fa-check mr-2"},null,-1),I("Saved",-1)]))):y("",!0),c.value?(i(),u("span",_e,o[13]||(o[13]=[n("i",{class:"fa fa-send mr-2"},null,-1),I("Saving changes...",-1)]))):y("",!0)],32)):y("",!0)])]),_:1,__:[14]}),e.value?(i(),S(B,{key:0,class:"p-4 md:p-6 space-y-4"},{default:x(()=>[o[15]||(o[15]=n("div",{class:"uppercase text-sm text-slate-700-d"},"Display on",-1)),n("div",Ce,[g(ae,{modelValue:C.value,"onUpdate:modelValue":[o[5]||(o[5]=s=>C.value=s),L],"region-code":r.regionCode,"country-code":r.countryCode,"entity-type":"stop","include-children":!0,placeholder:"Search for station or platform"},null,8,["modelValue","region-code","country-code"]),n("dl",Se,[(i(!0),u(F,null,O(e.value.mappings,s=>(i(),u("dd",{key:s.id||s.stopId,class:"flex items-center"},[g(m,{to:`/stop/${r.countryCode}/${r.regionCode}/${s.stop.id}`,class:"block flex-1 space-x-2"},{default:x(()=>[n("span",$e,k(s.stop.name),1),n("span",ke,k(s.stop.id),1)]),_:2},1032,["to"]),n("button",{class:"text-gray-500 hover:text-red-500",onClick:Me=>G(s)},[g(T(re),{class:"w-5 h-5"})],8,Ie)]))),128)),e.value.mappings.length?y("",!0):(i(),u("dd",Ne,"This number is not yet linked to any stops."))])])]),_:1,__:[15]})):y("",!0)])]),_:1})}}}),tt=oe(Pe,[["__scopeId","data-v-395c98c1"]]);export{tt 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.