import{d as g,u as b,o as r,a as i,b as d,e as a,h as f,w as x,f as e,s as k,j as p,v as l,x as u,t as m,y as v,i as n,F as h}from"./app-bWy6VYs1.js";import{_ as w}from"./AppLayout.vue_vue_type_script_setup_true_lang-BwuDxc8O.js";import"./index-C32fBP6Q.js";import"./index-CMWG4mbA.js";import"./useForwardExpose-Cx2E44RD.js";import"./VisuallyHidden-0BfmsMPn.js";import"./RovingFocusGroup-D20OvR_w.js";import"./useArrowNavigation-C6Y-ieo6.js";import"./_plugin-vue_export-helper-DmjF0He4.js";const I={class:"p-6"},M={class:"rounded-lg bg-white p-6 shadow"},A={key:0,class:"mb-2 text-sm text-gray-600"},S={key:1,class:"mt-1 text-sm text-red-600"},V={class:"flex items-center gap-2 text-sm text-gray-700"},D={key:0,class:"mt-1 text-sm text-red-600"},G={class:"flex gap-2"},P=["disabled"],j=g({__name:"GoogleIntegration",props:{maps_map_id:{},has_maps_api_key:{type:Boolean}},setup(_){const s=b({maps_api_key:"",maps_map_id:_.maps_map_id||"",clear_maps_api_key:!1}),c=()=>{s.put("/administration/google-integration",{preserveScroll:!0})};return(y,t)=>(r(),i(h,null,[d(a(f),{title:"Google Integration"}),d(w,{breadcrumbs:[{title:"Administration",href:"/administration"},{title:"Google Integration",href:"#"}]},{default:x(()=>[e("div",I,[t[7]||(t[7]=e("div",{class:"mb-6"},[e("h1",{class:"text-2xl font-bold text-gray-900"},"Google Integration"),e("p",{class:"text-gray-600"}," Instance-wide Maps JavaScript API credentials for Dispatch (maps, geocoding, ETA) and server-side route optimization. Values are stored encrypted. ")],-1)),e("div",M,[e("form",{class:"max-w-2xl space-y-6",onSubmit:k(c,["prevent"])},[e("div",null,[t[3]||(t[3]=e("label",{class:"mb-2 block text-sm font-medium text-gray-700"},"Maps JavaScript API key",-1)),y.has_maps_api_key?(r(),i("p",A," A key is already saved. Enter a new key to replace it, or use the checkbox below to remove it. ")):p("",!0),l(e("input",{"onUpdate:modelValue":t[0]||(t[0]=o=>a(s).maps_api_key=o),type:"password",autocomplete:"off",class:"w-full rounded border px-3 py-2 font-mono text-sm focus:border-blue-500 focus:ring-2 focus:ring-blue-500",placeholder:"Paste API key"},null,512),[[u,a(s).maps_api_key]]),a(s).errors.maps_api_key?(r(),i("p",S,m(a(s).errors.maps_api_key),1)):p("",!0)]),e("label",V,[l(e("input",{"onUpdate:modelValue":t[1]||(t[1]=o=>a(s).clear_maps_api_key=o),type:"checkbox",class:"rounded border-gray-300"},null,512),[[v,a(s).clear_maps_api_key]]),t[4]||(t[4]=n(" Remove stored API key ",-1))]),e("div",null,[t[5]||(t[5]=e("label",{class:"mb-2 block text-sm font-medium text-gray-700"},"Map ID (Advanced Markers)",-1)),t[6]||(t[6]=e("p",{class:"mb-2 text-sm text-gray-600"},[n(" From Google Cloud Console (Maps Management → Map IDs). Leave empty to use the default from server configuration ("),e("code",{class:"rounded bg-gray-100 px-1"},"GOOGLE_MAPS_MAP_ID"),n(" / demo ID). ")],-1)),l(e("input",{"onUpdate:modelValue":t[2]||(t[2]=o=>a(s).maps_map_id=o),type:"text",class:"w-full rounded border px-3 py-2 font-mono text-sm focus:border-blue-500 focus:ring-2 focus:ring-blue-500",placeholder:"e.g. abc123def456"},null,512),[[u,a(s).maps_map_id]]),a(s).errors.maps_map_id?(r(),i("p",D,m(a(s).errors.maps_map_id),1)):p("",!0)]),e("div",G,[e("button",{type:"submit",class:"rounded bg-primary px-4 py-2 text-sm font-medium text-white hover:bg-primary/90 disabled:opacity-60",disabled:a(s).processing},m(a(s).processing?"Saving…":"Save"),9,P)])],32)])])]),_:1})],64))}});export{j as default};
