import{d as b,r as c,w as f,W as h,C as v,c as g,o as w,a as i,b as e,u as a,m as y,s as u,j as V,P as $,f as M,t as d,e as L,g as C,v as F,F as P}from"./app-DJb_CRLj.js";import{_ as T}from"./AdminLayout.vue_vue_type_script_setup_true_lang-CE8oEe4m.js";import{_ as k}from"./Files.vue_vue_type_script_setup_true_lang-CRYWsXWh.js";import"./simplebar.min-CZ5saGqI.js";import"./debounce-CDPmhVE8.js";import"./useToastify-DqLaHt3f.js";import"./coloris-DdyWondq.js";/* empty css                             *//* empty css              */import"./Pagination.vue_vue_type_script_setup_true_lang-9skHAHfw.js";import"./SearchList.vue_vue_type_script_setup_true_lang-CyAiOusi.js";import"./useCopyToClipboard-CrZ6pkmz.js";import"./useRandomNum-BTw6623a.js";import"./FilterList.vue_vue_type_script_setup_true_lang-CCLhEmVl.js";const B={class:"container-fluid"},N={class:"menu-container row mb-4"},S={class:"col-12 mb-4"},U={class:"card"},j={class:"card-body menu-action-container d-flex align-items-center justify-content-between"},D={class:"edit-menu d-flex align-items-center"},E={class:"create-menu btn btn-primary shadow-1 lts-05","data-bs-toggle":"modal","data-bs-target":"#addMenu"},W={class:"modal fade",id:"addMenu",tabindex:"-1","aria-hidden":"true"},q={class:"modal-dialog modal-dialog-centered"},z={class:"modal-content"},A={class:"modal-header"},G={class:"modal-title lts-05 fs-5"},H={class:"modal-body"},I={class:"row"},J={class:"col-12 mb-4"},K={for:"eaMenuTitle",class:"form-label"},O=["placeholder"],Q={class:"col-12 mb-4"},R={class:"form-label"},X={class:"modal-footer"},Y={"data-bs-dismiss":"modal",class:"btn btn-sm btn-primary px-3"},ue=b({layout:T,__name:"Manage",props:{menus:{},menuPlaceList:{}},setup(p){const m=p,o=c(0);f(o,s=>{h.get(route("admin.menus.edit",s))});const r=c([]);for(let s in m.menus)r.value.push({id:m.menus[s].id,label:m.menus[s].name});const l=v({name:null,place:null}),_=()=>{l.post(route("admin.menus.store"),{replace:!0,preserveState:!1})};return(s,t)=>(w(),g(P,null,[i(a(y),{title:s.$t("messages.title.menus")},null,8,["title"]),e("div",B,[i(k,{title:s.$t("messages.word.menus")},null,8,["title"]),e("div",N,[e("div",S,[e("div",U,[e("div",j,[e("div",D,[i(a(u),{class:"pvc-dropdown",modelValue:o.value,"onUpdate:modelValue":t[0]||(t[0]=n=>o.value=n),options:r.value,display:"chip",optionLabel:"label",optionValue:"id",placeholder:s.$t("messages.sentence.select_menu_to_edit")},null,8,["modelValue","options","placeholder"]),i(a($),{as:"button",disabled:o.value==0,href:s.route("admin.menus.edit",o.value),class:"btn btn-dark btn-square shadow-1 ms-2 lts-05"},{default:V(()=>t[3]||(t[3]=[e("i",{class:"ri-pencil-fill"},null,-1)])),_:1},8,["disabled","href"])]),e("button",E,[M(d(s.$t("messages.sentence.create_new_menu"))+" ",1),t[4]||(t[4]=e("i",{class:"ri-add-line"},null,-1))]),e("div",W,[e("div",q,[e("div",z,[e("form",{onSubmit:L(_,["prevent"]),style:{direction:"rtl"}},[e("div",A,[e("div",G,d(s.$t("messages.sentence.create_new_menu")),1),t[5]||(t[5]=e("button",{type:"button",class:"btn modal-close","data-bs-dismiss":"modal","aria-label":"Close"},[e("i",{class:"ri-close-line"})],-1))]),e("div",H,[e("div",I,[e("div",J,[e("label",K,d(s.$t("messages.sentence.menu_title")),1),C(e("input",{"onUpdate:modelValue":t[1]||(t[1]=n=>a(l).name=n),type:"text",placeholder:s.$t("messages.sentence.menu_title"),class:"form-control",id:"eaMenuTitle"},null,8,O),[[F,a(l).name]])]),e("div",Q,[e("label",R,d(s.$t("messages.sentence.menu_place")),1),i(a(u),{class:"pvc-dropdown",modelValue:a(l).place,"onUpdate:modelValue":t[2]||(t[2]=n=>a(l).place=n),options:s.menuPlaceList,display:"chip",optionLabel:"label",optionValue:"id",placeholder:s.$t("messages.sentence.select_menu_place")},null,8,["modelValue","options","placeholder"])])])]),e("div",X,[e("button",Y,d(s.$t("messages.sentence.create_menu")),1)])],32)])])])])])])])])],64))}});export{ue as default};
