import{d as h,p as b,C as v,i as g,w,c,o as d,a as r,b as t,u as a,m as y,e as k,g as m,t as l,v as p,h as $,f as _,F as V}from"./app-BidmlC59.js";import{_ as C,a as L}from"./StoreLayout.vue_vue_type_script_setup_true_lang-B7aW7sSo.js";import{s as N}from"./dropdown.esm-C1E4YBQt.js";import"./coloris--ejmIHou.js";import"./portal.esm-DCp8ZhOj.js";/* empty css                             */import"./simplebar.min-hRaQJumN.js";/* empty css              */import"./useToastify-Bhe2cyz3.js";import"./Pagination.vue_vue_type_script_setup_true_lang-DQBGGaaV.js";import"./SearchList.vue_vue_type_script_setup_true_lang-Mz6dy287.js";import"./useRandomNum-BTw6623a.js";import"./useCopyToClipboard-CsEpRQpU.js";import"./useNl2br-N6ZYQSPJ.js";import"./virtualscroller.esm-DPG6aN44.js";const T={class:"container-fluid"},U={class:"create-ticket mb-4"},B={class:"card"},D={class:"card-body"},F={class:"row"},M={class:"col-md-6"},S={class:"form-element-row mb-4"},j={class:"form-label"},x=["placeholder"],E={class:"col-md-6"},R={class:"form-element-row mb-4"},q={class:"form-label"},z={class:"row"},A={class:"col-12"},G={class:"form-element-row mb-4"},H={class:"form-label"},I={class:"col-12"},J={class:"form-element-row form-element-row-file mb-4"},K={class:"text-center"},O={class:"fs-6 fw-bold text-dark mb-2"},P={class:"fs-9 text-muted mb-4"},Q={key:0,class:"selected-image"},W=["src"],X={class:"custom-input-file"},Y={"data-bs-toggle":"modal","data-bs-target":"#mediaLibrary","data-bs-input":"attachment",for:"attachment",class:"custom-input-file-label"},Z={class:"label"},tt={class:"col-12 text-end"},et=["disabled"],vt=h({layout:C,__name:"Create",props:{priorityList:{}},setup(st){const n=b(),o=v({title:null,priority:"normal",content:null,attachment:""}),u=g("mediaData");w(u,e=>{e.type=="attachment"&&e.file!=null&&(n.value=e.file.url,o.attachment=e.file.id+"")});const f=()=>{o.post(route("seller.tickets.store"),{replace:!0})};return(e,s)=>(d(),c(V,null,[r(a(y),{title:e.$t("messages.title.create_ticket")},null,8,["title"]),t("div",T,[r(L,{title:e.$t("messages.sentence.create_ticket")},null,8,["title"]),t("div",U,[t("div",B,[t("div",D,[t("form",{onSubmit:k(f,["prevent"]),class:"add-ticket-form"},[t("div",F,[t("div",M,[t("div",S,[t("label",j,l(e.$t("messages.word.title")),1),m(t("input",{"onUpdate:modelValue":s[0]||(s[0]=i=>a(o).title=i),type:"text",class:"form-control",placeholder:e.$t("messages.sentence.ticket_title")},null,8,x),[[p,a(o).title]])])]),t("div",E,[t("div",R,[t("label",q,l(e.$t("messages.word.priority")),1),r(a(N),{modelValue:a(o).priority,"onUpdate:modelValue":s[1]||(s[1]=i=>a(o).priority=i),options:e.priorityList,optionLabel:"label",optionValue:"id",type:"text",readonly:"",class:"pvc-dropdown"},null,8,["modelValue","options"])])])]),t("div",z,[t("div",A,[t("div",G,[t("label",H,l(e.$t("messages.word.message")),1),m(t("textarea",{"onUpdate:modelValue":s[2]||(s[2]=i=>a(o).content=i),rows:"5",class:"form-control",placeholder:"متن پیام"},null,512),[[p,a(o).content]])])]),t("div",I,[t("div",J,[t("div",K,[t("div",O,l(e.$t("messages.sentence.upload_your_image_as_attachment_to_ticket")),1),t("div",P,"("+l(e.$t("messages.sentence.ticket_attachment_hint"))+")",1)]),a(o).attachment!=""?(d(),c("div",Q,[t("img",{class:"shadow-1",src:n.value},null,8,W),t("i",{onClick:s[3]||(s[3]=i=>{a(o).attachment="",n.value=null}),class:"ri-close-line shadow-1 remove-image"})])):$("",!0),t("div",X,[t("label",Y,[t("span",Z,[s[4]||(s[4]=t("i",{class:"ri-arrow-up-fill me-1"},null,-1)),_(" "+l(e.$t("messages.sentence.select_image")),1)])])])])]),t("div",tt,[t("button",{type:"submit",disabled:a(o).processing,class:"btn btn-primary shadow-1 px-4"},[_(l(e.$t("messages.word.send"))+" ",1),s[5]||(s[5]=t("i",{class:"ri-send-plane-2-line ms-2"},null,-1))],8,et)])])],32)])])])])],64))}});export{vt as default};
