import{B as x,C as n,j as a,t as l,k as t,m as o,y as i,E as d,x as f,z as g,F as w,q as k}from"./vendor-CoimUlS3.js";import{I as y}from"./LogoutButton-BZlSuKxY.js";import{p as v}from"./pickBy-_N4B5OFc.js";import{L as C}from"./Layout-DhxLvS0V.js";import{t as V}from"./throttle-DRsYW0Dx.js";import{m as L}from"./mapValues-CJnTf0SX.js";import{P as N}from"./Pagination-D_wo4K-u.js";import{S as B}from"./SearchInput-CQhaAWWY.js";import{_ as I}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./utils-CXPYudwi.js";import"./app-W9XHfen4.js";/* empty css                                                                 */import"./ui-CI37mw-K.js";import"./Logo-DiOikIGZ.js";import"./FlashMessages-D1juQjH6.js";const j={metaInfo:{title:"Cities"},components:{SearchInput:B,Icon:y,Link:x,Pagination:N},layout:C,props:{filters:Object,cities:Object},data(){return{form:{search:this.filters.search}}},watch:{form:{deep:!0,handler:V(function(){this.$inertia.get(this.route("cities"),v(this.form),{preserveState:!0})},150)}},methods:{reset(){this.form=L(this.form,()=>null)}}},S={class:"mb-8 font-bold text-3xl"},$={class:"mb-6 flex justify-between items-center"},E={class:"hidden md:inline"},F={class:"bg-white rounded-md shadow overflow-x-auto"},O={class:"w-full whitespace-nowrap"},P={class:"text-left font-bold"},R={class:"px-6 pt-6 pb-4"},q={class:"border-t"},z={class:"border-t w-px"},D={key:0};function T(r,e,c,U,p,h){const u=n("search-input"),m=n("Link"),_=n("icon"),b=n("pagination");return l(),a("div",null,[t("h1",S,i(r.$t("City")),1),t("div",$,[o(u,{modelValue:p.form.search,"onUpdate:modelValue":e[0]||(e[0]=s=>p.form.search=s),class:"w-full max-w-md mr-4",onReset:h.reset},null,8,["modelValue","onReset"]),o(m,{class:"btn-indigo",href:this.route("cities.create")},{default:d(()=>[t("span",null,i(r.$t("Create")),1),e[1]||(e[1]=f("  ",-1)),t("span",E,i(r.$t("City")),1)]),_:1},8,["href"])]),t("div",F,[t("table",O,[t("tbody",null,[t("tr",P,[t("th",R,i(r.$t("Name")),1)]),(l(!0),a(w,null,k(c.cities.data,s=>(l(),a("tr",{key:s.id,class:"hover:bg-gray-100 focus-within:bg-gray-100"},[t("td",q,[o(m,{class:"px-6 py-4 flex items-center focus:text-indigo-500",href:this.route("cities.edit",s.id)},{default:d(()=>[f(i(s.name),1)]),_:2},1032,["href"])]),t("td",z,[o(m,{class:"px-4 flex items-center",href:this.route("cities.edit",s.id),tabindex:"-1"},{default:d(()=>[o(_,{name:"cheveron-right",class:"block w-6 h-6 fill-gray-400"})]),_:1},8,["href"])])]))),128)),c.cities.data.length===0?(l(),a("tr",D,[...e[2]||(e[2]=[t("td",{class:"border-t px-6 py-4",colspan:"4"},"No cities found.",-1)])])):g("",!0)])])]),o(b,{class:"mt-6",links:c.cities.links},null,8,["links"])])}const it=I(j,[["render",T]]);export{it as default};
