PageSourceSearch

https://tallersl.vercel.app/_nuxt/BGPTHnhi.js

js tallersl.vercel.app collected 2026-10-03 07:51:25 UTC 14,409 bytes, 1 lines download raw bytes

1import{g as q,N as L,r as u,V as ee,o as $,l as M,w as s,b as e,i as O,d as A,a,k as n,O as z,A as C,x as Q,c as T,m as G,z as D,t as B,U as ye,L as te,R as ve,s as be,j as Ve,S as he,W as Y}from"./DGOCsKbJ.js";import{_ as xe}from"./Cbriqcdo.js";import{_ as Se}from"./B7qyZaaO.js";import{_ as I}from"./CwjtMqIk.js";import{_ as oe}from"./DW-bwwiw.js";import{c as W,a as E,d as le,_ as H,b as X}from"./KUsPglfi.js";import{_ as ne}from"./Pu4RV_Lr.js";import{_ as J}from"./D4_SDJ5c.js";import{u as K}from"./Rfz0g9nS.js";import{T as N,u as Z}from"./DBUkMtN1.js";import{_ as Ue}from"./C-m1F9h0.js";import{_ as we,a as $e}from"./DOVi0YEZ.js";import{_ as ke}from"./CxENDTAM.js";import"./CKy1ZBMz.js";import"./tMGWua4Q.js";import"./DQwYSzmU.js";import"./CpUaKuWf.js";import"./DsPgcvHI.js";import"./DXbXvk_r.js";const Ce={class:"flex justify-between w-full items-center"},je={class:"flex justify-end space-x-2"},Ae=q({__name:"addStory",setup(m){const S=K(),d=u(!1),_=u(),y=L(),l=Q({message:"",name:"",title:"",photo:void 0}),c=u(!1),p=u(Number.parseInt(ee().public.limit)),r=W({photo:le().required("Photo is required").test("fileType","Only PNG, JPG, JPEG are allowed",g=>g?["image/png","image/jpeg","image/jpg"].includes(g.type):!1).test("fileSize","File must be less than 2MB",g=>g?g.size<=2e6:!1),name:E().required("Name are required"),message:E().required("Message is required"),title:E().required("Title is required")});function b(g){if(_.value)return _.value.errors.find(o=>o.name===g)!=null}const i=async()=>{try{c.value=!0,await S.create(l),await S.find(1,p.value),y.add({title:N,description:"Story added successfully"}),h()}catch(g){throw g}finally{c.value=!1}};function h(){l.photo=void 0,l.name="",l.message="",l.title="",d.value=!1}return(g,t)=>{const o=O,U=oe,w=X,v=I,P=ne,R=H,j=J;return $(),M(j,{open:n(d),"onUpdate:open":t[6]||(t[6]=f=>C(d)?d.value=f:null),title:"Slideover with title"},{header:s(()=>[a("div",Ce,[t[8]||(t[8]=a("p",{class:"font-noto-serif"},"Add Story",-1)),e(o,{onClick:h,icon:"material-symbols-light:close",variant:"link",color:"neutral"})])]),body:s(()=>[e(R,{ref_key:"formRef",ref:_,state:l,schema:n(r),class:"space-y-4",onSubmit:z(i,["prevent"])},{default:s(()=>[e(w,{name:"photo"},{default:s(()=>[e(U,{highlight:"",color:b("photo")?"error":void 0,size:"xl",modelValue:l.photo,"onUpdate:modelValue":t[1]||(t[1]=f=>l.photo=f),variant:"area",label:"Drop your image here",description:"PNG, JPG, JPEG (max. 2MB)",class:"h-56"},null,8,["color","modelValue"])]),_:1}),e(w,{label:"Name",name:"name"},{default:s(()=>[e(v,{modelValue:l.name,"onUpdate:modelValue":t[2]||(t[2]=f=>l.name=f),placeholder:"Enter name"},null,8,["modelValue"])]),_:1}),e(w,{label:"Title",name:"title"},{default:s(()=>[e(v,{modelValue:l.title,"onUpdate:modelValue":t[3]||(t[3]=f=>l.title=f),placeholder:"Enter title"},null,8,["modelValue"])]),_:1}),e(w,{label:"Message",name:"message"},{default:s(()=>[e(P,{modelValue:l.message,"onUpdate:modelValue":t[4]||(t[4]=f=>l.message=f),placeholder:"Enter message"},null,8,["modelValue"])]),_:1})]),_:1},8,["state","schema"])]),footer:s(()=>[a("div",je,[e(o,{onClick:t[5]||(t[5]=f=>n(_).submit()),loading:n(c),color:"primary"},{default:s(()=>[...t[9]||(t[9]=[A("Save Changes",-1)])]),_:1},8,["loading"]),e(o,{onClick:h,variant:"outline",color:"neutral"},{default:s(()=>[...t[10]||(t[10]=[A("Cancel",-1)])]),_:1})])]),default:s(()=>[e(o,{variant:"subtle",color:"primary",onClick:t[0]||(t[0]=()=>{d.value=!0})},{default:s(()=>[...t[7]||(t[7]=[A("Add",-1)])]),_:1})]),_:1},8,["open"])}}}),Re=Object.assign(Ae,{__name:"AdminAddStory"}),Pe={key:0,class:"space-y-3"},Te={class:"flex gap-2 py-2.5 border-gray-200 border-y"},Be={key:1,class:"group h-80 overflow-hidden rounded-lg relative cursor-pointer"},Ee=["src","alt"],Ne={key:0,class:"absolute inset-0 bg-black/40 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity duration-300"},qe=q({__name:"StoryPhoto",props:{record:{},isAdmin:{}},emits:["onUpload"],setup(m,{emit:S}){const d=L(),_=K(),y=u(),l=u(!1),c=Q({photo:void 0}),p=W({photo:le().required("Photo is required").test("fileType","Only PNG, JPG, JPEG are allowed",t=>t?["image/png","image/jpeg","image/jpg"].includes(t.type):!1).test("fileSize","File must be less than 2MB",t=>t?t.size<=2e6:!1)}),r=async()=>
1{try{m.record&&(l.value=!0,await _.upload(m.record.id,c.photo??null),d.add({title:N,description:"Story profile change successfully",color:"success"}),g(),h("onUpload"))}catch(t){d.add({title:N,description:t.message,color:"error"})}finally{l.value=!1}};function b(t){if(y.value)return y.value.errors.find(U=>U.name===t)!=null}const i=u(!1),h=S;function g(){c.photo=void 0,i.value=!1}return(t,o)=>{const U=oe,w=X,v=O,P=H;return $(),T("div",null,[n(i)&&m.isAdmin?($(),T("div",Pe,[e(P,{ref_key:"formRef",ref:y,state:n(c),schema:n(p),class:"space-y-4",onSubmit:z(r,["prevent"])},{default:s(()=>[e(w,{name:"photo"},{default:s(()=>[e(U,{color:b("photo")?"error":void 0,highlight:"",size:"xl",variant:"area",label:"Drop your image here",description:"PNG, JPG, JPEG (max. 2MB)",modelValue:n(c).photo,"onUpdate:modelValue":o[0]||(o[0]=R=>n(c).photo=R),class:"h-80"},null,8,["color","modelValue"])]),_:1}),a("div",Te,[e(v,{variant:"soft",loading:n(l),type:"submit",label:"Save Changes"},null,8,["loading"]),e(v,{label:"Cancel",color:"neutral",variant:"soft",onClick:g})])]),_:1},8,["state","schema"])])):m.record?($(),T("div",Be,[a("img",{src:m.record.imageUrl,alt:m.record.name,class:"h-full w-full object-cover"},null,8,Ee),m.isAdmin?($(),T("div",Ne,[e(v,{icon:"sidekickicons:photo-plus",variant:"soft",label:"Change Profile",onClick:o[1]||(o[1]=z(()=>{i.value=!0},["stop"]))})])):G("",!0)])):G("",!0)])}}}),Oe=Object.assign(qe,{__name:"AdminStoryPhoto"}),De={class:"flex justify-between w-full items-center"},Fe={key:0},ze={class:"mt-5"},Ge={class:"space-y-4"},Le={class:"text-2xl font-noto-serif"},Me={class:"leading-7"},Ie=q({__name:"viewStory",props:{modelValue:{type:Boolean,default:!1},record:{type:Object,default:null},isAdmin:{type:Boolean,required:!1}},emits:["update:modelValue"],setup(m,{emit:S}){const d=m,_=S,y=u(d.modelValue);D(()=>d.modelValue,c=>y.value=c,{immediate:!0});const l=()=>{_("update:modelValue",!1)};return(c,p)=>{const r=O,b=Oe,i=J;return $(),M(i,{open:n(y),"onUpdate:open":p[0]||(p[0]=h=>C(y)?y.value=h:null),title:"Slideover with title"},{header:s(()=>[a("div",De,[p[1]||(p[1]=a("p",{class:"font-noto-serif"},"View Story",-1)),e(r,{onClick:l,icon:"material-symbols-light:close",variant:"link",color:"neutral"})])]),body:s(()=>[m.record?($(),T("div",Fe,[e(b,{"is-admin":d.isAdmin,onOnUpload:l,record:m.record},null,8,["is-admin","record"]),a("div",ze,[a("div",Ge,[a("p",Le,B(m.record.name),1),a("div",null,[p[2]||(p[2]=a("p",{class:"text-muted"},"Title:",-1)),a("p",null,B(m.record.title),1)]),a("div",null,[p[3]||(p[3]=a("p",{class:"text-muted"},"Story:",-1)),a("p",Me,B(m.record.message),1)])])])])):G("",!0)]),_:1},8,["open"])}}}),Je=Object.assign(Ie,{__name:"AdminViewStory"}),Ke={class:"flex justify-between w-full items-center"},Qe={class:"flex justify-end space-x-2"},We=q({__name:"editStory",props:{modelValue:{type:Boolean,default:!1},record:{type:Object,default:null}},emits:["update:modelValue"],setup(m,{emit:S}){const d=K(),_=m,y=S,l=u(_.modelValue),c=u(),p=L(),r=Q({message:"",name:"",title:""}),b=u(!1),i=W({name:E().required("Name are required"),message:E().required("Message is required"),title:E().required("Position is required")}),h=async()=>{try{_.record&&(b.value=!0,await d.update({id:_.record.id,message:r.message,name:r.name,title:r.title}),await d.find(1,10),p.add({title:N,description:"Story updated successfully"}),g())}catch(t){throw t}finally{b.value=!1}};D(()=>_.modelValue,t=>{l.value=t;const o=_.record;o&&(r.name=o.name,r.message=o.message,r.title=o.title)},{immediate:!0});const g=()=>{r.name="",r.message="",r.title="",y("update:modelValue",!1)};return(t,o)=>{const U=O,w=I,v=X,P=ne,R=H,j=J;return $(),M(j,{open:n(l),"onUpdate:open":o[4]||(o[4]=f=>C(l)?l.value=f:null),title:"Slideover with title"},{header:s(()=>[a("div",Ke,[o[5]||(o[5]=a("p",{class:"font-noto-serif"},"Edit Story",-1)),e(U,{onClick:g,icon:"material-symbols-light:close",variant:"link",color:"neutral"})])]),body:s(()=>[e(R,{ref_key:"formRef",ref:c,state:r,schema:n(i),class:"space-y-4",onSubmit:z(h,["prevent"])},{default:s(()=>[e(v,{label:"Name",name:"name"},{default:s(()=>[e(w,{modelValue:r.name,"onUpdate:modelValue":o[0]||(o[0]=f=>r.name=f),placeholder:"Enter name"},null,8,["modelValue"])]),_:1}),e(v,{label:"Position",name:"title"},{default:s(()=>[e(w,{modelValue:r.title,"onUpdate:modelValue":o[1]||(o[1]=f=>r.title=f),placeholder:"Enter position"},null,8,["modelValue"])]),_:1}),e(v,{label:"Message",name:"message"},{default:s(()=>[e(P,{rows:10,modelValue:r.message,"onUpdate:modelValue":o[2]||(o[2]=f=>r.message=f),placeholder:"Enter message"},null,8,["modelValue"])]),_:1})]),_:1},8,["state","schema"])]),footer:s(()=>[a("div",Qe,[e(U,{onClick:o[3]||(o[3]=f=>n(c).submit()),loading:n(b),color:"primary"},{default:s(()=>[...o[6]||(o[6]=[A("Save Changes",-1)])]),_:1},8,["loading"]),e(U,{onClick:g,variant:"outline",color:"neutral"},{default:s(()=>[...o[7]||(o[7]=[A("Cancel",-1)])]),_:1})])]),_:1},8,["open"])}}}),He=Object.assign(We,{__name:"AdminEditStory"}),Xe={class:"flex justify-between w-full items-center"},Ye={class:"space-y-4"},Ze={class:"text-sm text-gray-600"},et={key:0,class:"text-xs text-red-500"},tt={class:"flex justify-end gap-3"},ot=q({__name:"removeStory",props:{modelValue:{type:Boolean,default:!1},name:{type:Object,default:null},id:{type:Object,default:null},isLoading:{type:Boolean,default:!1}},emits:["update:modelValue","onDelete"],setup(m,{emit:S}){const d=m,_=S,y=u(d.modelValue),l=u(""),c=te(()=>l.value.trim().toLowerCase()===d.name?.toLowerCase());D(()=>d.modelValue,b=>{y.value=b,l.value=""});const p=async()=>{d.id&&await _("onDelete",d.id)},r=()=>{l.value="",_("update:modelValue",!1)};return(b,i)=>{const h=O,g=I,t=J;return $(),M(t,{open:n(y),"onUpdate:open":i[1]||(i[1]=o=>C(y)?y.value=o:null)},ye({header:s(()=>[a("div",Xe,[i[2]||(i[2]=a("p",{class:"font-noto-serif text-red-600 font-semibold"}," Delete Story ",-1)),e(h,{onClick:r,icon:"material-symbols-light:close",variant:"link",color:"neutral"})])]),body:s(()=>
1[a("div",Ye,[a("p",Ze,[i[3]||(i[3]=A(" This action is ",-1)),i[4]||(i[4]=a("span",{class:"font-semibold text-red-600"},"permanent",-1)),i[5]||(i[5]=A(". To confirm deletion, type the story's name below: ",-1)),a("span",null,B(m.name),1)]),e(g,{modelValue:n(l),"onUpdate:modelValue":i[0]||(i[0]=o=>C(l)?l.value=o:null),type:"name",placeholder:"Enter story name to confirm"},null,8,["modelValue"]),n(l)&&!n(c)?($(),T("p",et," Name does not match the story name. ")):G("",!0)])]),_:2},[n(c)?{name:"footer",fn:s(()=>[a("div",tt,[e(h,{color:"error",loading:m.isLoading,onClick:p},{default:s(()=>[...i[6]||(i[6]=[A(" Delete Record ",-1)])]),_:1},8,["loading"]),e(h,{variant:"subtle",color:"neutral",onClick:r,disabled:m.isLoading},{default:s(()=>[...i[7]||(i[7]=[A(" Cancel ",-1)])]),_:1},8,["disabled"])])]),key:"0"}:void 0]),1032,["open"])}}}),lt=Object.assign(ot,{__name:"AdminRemoveStory"}),nt={class:"space-y-5"},st={class:"flex items-center justify-between"},at={class:"flex justify-between items-center"},it={class:"flex space-x-3 w-1/3"},rt={class:"flex space-x-5 items-center"},dt={class:"flex space-x-2"},mt={class:"line-clamp-1 whitespace-pre-wrap"},ut={class:"flex justify-between items-center"},Rt=q({__name:"stories",setup(m){const S=L(),d=u(!0),_=u(!1),y=u(),l=u(!1),c=u(),p=u(!1),r=u(),b=u(!1),i=K(),h=ve(),g=ee(),{records:t,meta:o}=be(i),U=[{accessorKey:"name",header:"Name"},{accessorKey:"title",header:"Title"},{accessorKey:"message",header:"Message"},{id:"actions",meta:{class:{td:"text-right"}},cell:({row:k})=>Y(xe,{content:{align:"end"},items:se(k),"aria-label":"Actions dropdown"},()=>Y(O,{icon:"i-lucide-ellipsis-vertical",color:"neutral",variant:"ghost","aria-label":"Actions dropdown"}))}];async function w(k){try{_.value=!0,await i.delete(k),S.add({title:N,description:"Story deleted successfully"}),await F(),p.value=!1}catch(V){S.add({title:N,description:V.message})}finally{_.value=!1}}const v=te({get:()=>Number(h.query.page??1),set:k=>Z({page:k})}),P=Number.parseInt(g.public.limit),R=u(P),j=u("");let f;D(j,()=>{clearTimeout(f),f=setTimeout(()=>{v.value===1?F():v.value=1},350)});function se(k){return[{label:"View Record",onClick:()=>{l.value=!0,y.value=k.original}},{label:"Edit Record",onClick:()=>{b.value=!0,r.value=k.original}},{label:"Delete Record",onClick:()=>{p.value=!0,c.value=k.original}}]}Ve(async()=>{Z({page:v.value}),await F()});async function F(){d.value=!0,await i.find(v.value,R.value,j.value||void 0),d.value=!1}return D(()=>v.value,async()=>{await F()},{immediate:!0}),(k,V)=>{const ae=Se,ie=I,re=Re,de=he,me=Ue,ue=we,ce=$e,pe=ke,fe=Je,_e=He,ge=lt;return $(),T("div",nt,[a("div",st,[V[5]||(V[5]=a("p",{class:"text-xl font-noto-serif"},"All Stories",-1)),e(ae,{items:[{label:"Dashboard",href:"/admin"},{label:"Stories",href:"/admin/stories"}]})]),e(pe,{ui:{body:"sm:p-0 p-0"}},{header:s(()=>[a("div",at,[V[6]||(V[6]=a("p",null,"All Stories",-1)),a("div",it,[e(ie,{modelValue:n(j),"onUpdate:modelValue":V[0]||(V[0]=x=>C(j)?j.value=x:null),placeholder:"Search here . . .",icon:"i-lucide-search"},null,8,["modelValue"]),e(re)])])]),footer:s(()=>[a("div",ut,[e(ue,{meta:n(o)},null,8,["meta"]),e(ce,{page:n(v),"onUpdate:page":V[1]||(V[1]=x=>C(v)?v.value=x:null),size:"sm","page-size":n(o)?.size,"items-per-page":n(R),total:n(o)?.total,"show-edges":""},null,8,["page","page-size","items-per-page","total"])])]),default:s(()=>[e(me,{loading:n(d),data:n(t),columns:U,class:"flex-1"},{"name-cell":s(({row:x})=>[a("div",rt,[e(de,{src:x.original.imageUrl},null,8,["src"]),a("p",dt,B(x.original.name),1)])]),"message-cell":s(({row:x})=>[a("p",mt,B(x.original.message),1)]),_:1},8,["loading","data"])]),_:1}),e(fe,{"is-admin":"",modelValue:n(l),"onUpdate:modelValue":V[2]||(V[2]=x=>C(l)?l.value=x:null),record:n(y)},null,8,["modelValue","record"]),e(_e,{"is-admin":"",modelValue:n(b),"onUpdate:modelValue":V[3]||(V[3]=x=>C(b)?b.value=x:null),record:n(r)},null,8,["modelValue","record"]),e(ge,{"is-loading":n(_),onOnDelete:w,modelValue:n(p),"onUpdate:modelValue":V[4]||(V[4]=x=>C(p)?p.value=x:null),name:n(c)?.name,id:n(c)?.id},null,8,["is-loading","modelValue","name","id"])])}}});
1export{Rt 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.