PageSourceSearch

https://kanisius.sch.id/assets/Index-51d0302b.js

js kanisius.sch.id collected 2026-10-10 01:41:58 UTC 31,857 bytes, 1 lines download raw bytes

1import{_ as _e,a1 as De,k as pe,l as j,r as C,w as be,o as ke,a as B,c as v,d as _,e as a,x as h,f as y,a3 as Ne,h as O,a2 as ee,X as de,A as he,n as x,F as q,R as H,v as X,G as ge,N as ve,j as F,S as Ie,I as ae,aw as Oe,m as He,ax as Ge,ay as Ve,az as je,$ as We,i as se}from"./index-b9dc2928.js";import{A as Le}from"./AgGridVue-84189f2d.js";import{_ as Re}from"./index-b97e8a6a.js";import{Q as Me}from"./quill.snow-1303db1f.js";import{B as Ue}from"./ButtonActionDel-0eb0419a.js";import{L as Be}from"./LoadingButton-977965a5.js";import{D as qe}from"./default-940a17c9.js";import{M as Se}from"./ModalGallery-dd91dc93.js";import"./axios-5c1af97e.js";import{L as ze}from"./ListDetail-97c5d045.js";import{B as Pe}from"./ButtonAction-ad8f1110.js";import{H as Je,D as xe}from"./DateRead-d4698022.js";import{L as Qe}from"./LoadingData-8fc5cf40.js";import"./_commonjs-dynamic-modules-302442b1.js";import"./pdf-691749f0.js";const Xe={components:{AgGridVue:Le,ButtonAction:Ue},props:{modalShow:{Boolean}},methods:{onGridReady(l){this.gridApi=l.api,this.gridColumnApi=l.columnApi;const t=[];this.gridColumnApi.getAllColumns().forEach(c=>{t.push(c.colId),this.gridApi.sizeColumnsToFit()}),this.gridColumnApi.autoSizeColumns(t,!1)}},beforeMount(){this.context={componentParent:this}},emits:["close-modal"],setup(l,{emit:t}){const c=De(),e=(f,Q)=>{document.getElementById("myForm").reset(),t("close-plus",f,Q),i.value=!1},w=()=>{D.name=""},{t:L}=pe(),E=j({}),s=j({}),g=[{headerName:"#",valueGetter:"node.rowIndex+1",minWidth:60,maxWidth:60,sortable:!1,filter:!1},{headerName:L("admNewsCat.table.name"),field:"name",minWidth:160},{headerName:L("admDept.table.action"),field:"id",cellRenderer:"ButtonAction",sortable:!1,filter:!1,maxWidth:130}],p={sortable:!0,filter:!0,flex:1,minWidth:130},i=C(!1),D=j({name:""}),N=async()=>{H.get("album-category-get",{params:D}).then(f=>{s.value=f.data.data,E.value=s.value}).catch(f=>{console.log(f)})},r=async()=>{await H.post("album-category-post",D).then(f=>{t("click-newsrefresh"),f.data.success&&c.success(f.data.message),f.data.success===!1&&c.warning(f.data.message),w(),N()}).catch(f=>{console.log(f)})},b=C(!1),m=j({}),d=f=>{b.value=!0,b.id=f,m.value=E.value.filter(Q=>Q.id===f)[0].name},W=()=>{H.delete(`album-category-del/${b.id}`).then(f=>{N(),b.value=!1,c.success(f.data.message)}).catch(f=>{console.log(f)})};return be(()=>{l.modalShow?i.value=!0:i.value=!1}),ke(()=>{N()}),{reset:w,closePlus:e,modalPlus:i,toast:c,closePlus:e,t:L,columnDefs:g,rowData:E,defaultColDef:p,value:D,refresh:N,tempoData:s,postData:r,modalDel:b,deleteModalShow:d,confirmDelete:W,textDel:m}}},Ye={class:"modal-content small-content"},Ke={class:"header-form"},Ze={class:"content-form"},$e={class:"content-input"},ea={class:"Column-input"},aa=["placeholder"],la={class:"Column-input"},ta={type:"submit",class:"submit-btn"},na={class:"table-admin"},oa={class:"modal-content del-content"},ia={class:"warning-del"},sa={class:"text-del"},da={class:"delete-action"};function ca(l,t,c,e,w,L){const E=B("font-awesome-icon"),s=B("ag-grid-vue");return v(),_(q,null,[a("div",Ye,[a("div",Ke,[a("p",null,h(l.$t("admNewsCat.headTable")),1),a("div",{class:"close-btn",onClickCapture:t[0]||(t[0]=(...g)=>e.closePlus&&e.closePlus(...g))},[y(E,{icon:"fa-solid fa-xmark"})],32)]),a("div",Ze,[a("form",{onSubmit:t[2]||(t[2]=Ne((...g)=>e.postData&&e.postData(...g),["prevent"])),id:"plusForm"},[a("div",$e,[a("div",ea,[a("p",null,h(l.$t("admNewsCat.table.name")),1),O(a("input",{type:"text",placeholder:l.$t("admNewsCat.table.name"),"onUpdate:modelValue":t[1]||(t[1]=g=>e.value.name=g),required:""},null,8,aa),[[ee,e.value.name]])]),a("div",la,[a("button",ta,h(l.$t("admin.general.submit")),1)])])],32),a("div",na,[y(s,{class:"ag-theme-alpine",style:{height:"300px"},columnDefs:e.columnDefs,rowData:e.rowData.value,defaultColDef:e.defaultColDef,context:l.context,rowSelection:"multiple",animateRows:!0,pagination:!0,rowDragManaged:!0,suppressMoveWhenRowDragging:!0,onCellClicked:l.cellWasClicked,onGridReady:L.onGridReady},null,8,["columnDefs","rowData","defaultColDef","context","onCellClicked","onGridReady"])])])]),O(a("div",{class:"close-modal-form",onClickCapture:t[3]||(t[3]=(...g)=>e.closePlus&&e.closePlus(...g))},null,544),[[de,e.modalPlus]]),a("div",{class:x(["modal-form",e.modalDel?"modal-show":"modal-hide"])},[a("div",oa,[a("div",ia,h(l.$t("admin.general.warning")),1),a("div",sa,[he(h(l.$t("admin.general.deleteMessage"))+" ",1),a("span",null,'"'+h(e.textDel.value)+'"',1),he(" "+h(l.$t("admNewsCat.delData")),1)]),a("div",da,[a("button",{onClick:t[4]||(t[4]=g=>e.modalDel=!1)},h(l.$t("admin.general.cancel")),1),a("button",{onClick:t[5]||(t[5]=(...g)=>e.confirmDelete&&e.confirmDelete(...g))},h(l.$t("admin.general.confirm")),1)])]),O(a("div",{class:"close-modal-form",onClick:t[6]||(t[6]=g=>l.closeAdd())},null,512),[[de,e.modalDel]])],2)],64)}const ra=_e(Xe,[["render",ca]]),ua={components:{VuePdfEmbed:Re,PlusCategory:ra,LoadBtn:Be},props:{modalShow:{type:Boolean,default:!1},modalEdit:{type:Boolean,default:!1},dataAdmin:{type:Object,default:()=>({})},propClass:{type:Object,default:()=>({})}},setup(l,{emit:t}){const{t:c}=pe(),e=De(),w=C(!1);C(!1);const L=C([]),E=()=>{H.get("album-category-get").then(o=>{var n;L.value=((n=o==null?void 0:o.data)==null?void 0:n.data)??[]}).catch(o=>{console.log(o)})},s=C([]),g=o=>{H.get("album-image",{params:{content_id:o??null}}).then(n=>
1{n.data.data&&(s.value=n.data.data??[])}).catch(n=>{console.log(n)})},p=C({}),i=o=>{H.get("album",{params:{id:o??null}}).then(n=>{p.value=n.data.data??{}}).catch(n=>{console.log(n)})},D=X(()=>{var o,n,u;return!Array.isArray(s.value)||!((n=(o=p.value)==null?void 0:o.cover)!=null&&n.id)?null:(u=s.value.find(M=>M.id===p.value.cover.id))==null?void 0:u.file_base64}),N=X(()=>{var o,n;return Array.isArray(s.value)?(n=(o=p.value)==null?void 0:o.media)!=null&&n.length?p.value.media.map(u=>{const M=s.value.find(P=>P.id===u.id);return{...u,preview:M==null?void 0:M.file_base64}}):[]:[]}),r=X(()=>{var o,n;return Array.isArray(s.value)?(n=(o=p.value)==null?void 0:o.file)!=null&&n.length?p.value.file.map(u=>{const M=s.value.find(P=>P.id===u.id);return{...u,preview:M==null?void 0:M.file_base64}}):[]:[]}),b=()=>{var o,n,u,M,P,z;if(!(!l.modalEdit||!Array.isArray(s.value))){if((n=(o=p.value)==null?void 0:o.cover)!=null&&n.id){const T=s.value.find(K=>K.id===p.value.cover.id);G.value={id:T==null?void 0:T.id,filename:"Cover",preview:T==null?void 0:T.file_base64,isExisting:!0}}S.value=[],(M=(u=p.value)==null?void 0:u.media)==null||M.forEach((T,K)=>{const J=s.value.find($=>$.id===T.id);S.value.push({id:T.id,filename:`Image ${K+1}`,preview:J==null?void 0:J.file_base64,isExisting:!0})}),I.value=[],(z=(P=p.value)==null?void 0:P.file)==null||z.forEach((T,K)=>{const J=s.value.find($=>$.id===T.id);I.value.push({id:T.id,filename:`Document ${K+1}`,preview:J==null?void 0:J.file_base64,name:T.filename,isExisting:!0})})}};ge(()=>[p.value,s.value],()=>{b()},{deep:!0});const m=j({id:null,title:null,description:null,gallery_date:null,publish_date:null,is_active:null,category_id:null,created_at:null,created_by:null,updated_at:null,updated_by:null,media:[]}),d=j({action_by:null,user_id:null,message:null,message_en:null,detail:null,action:null}),W=()=>{d.action_by=null,d.user_id=null,d.message=null,d.message_en=null,d.detail=null,d.action=null},f=()=>{const o="notification",n="POST";d.action_by=l.dataAdmin.name,d.user_id=l.dataAdmin.user_id,d.message=l.modalEdit?"telah <span class='primary-notif'>mengubah</span> data Album":"telah <span class='primary-notif'>menambahkan</span> data Album",d.message_en=l.modalEdit?"has <span class='primary-notif'>edited</span> Album data":"has <span class='primary-notif'>added</span> Album data",d.detail=m.title,d.action=l.modalEdit?"edit":"add",H({method:n,url:o,params:d}).then(u=>{W()}).catch(u=>{console.log(u)})},Q=j({media:[]}),G=C({id:null,preview:null}),S=C([]),le=()=>{S.value.push({id:null,filename:`Image ${S.value.length+1}`,preview:null,isExisting:!1})},te=async o=>{const n=o.target.files[0],u=new FileReader,M=await new Promise(Ae=>{u.onload=Fe=>Ae(Fe.target.result),u.readAsDataURL(n)}),P=new Image;await new Promise(Ae=>{P.onload=Ae,P.src=M});const z=document.createElement("canvas"),T=z.getContext("2d"),K=1200,J=750,$=Math.min(K/P.naturalWidth,J/P.naturalHeight);return z.width=P.naturalWidth*$,z.height=P.naturalHeight*$,T.drawImage(P,0,0,z.width,z.height),z.toDataURL("image/webp",1)},ye=async(o,n)=>{const u=await te(o);S.value[n].preview=u,Z({id:S.value[n].id,type:S.value[n].id?"update":"add",filename:S.value[n].filename,file:u})},I=C([]),Ce=()=>{I.value.push({id:null,filename:`Document ${I.value.length+1}`,preview:null,name:null,isExisting:!1})},U=async o=>{const n=o.target.files[0];return n?await new Promise(u=>{const M=new FileReader;M.onload=P=>{u({base64:P.target.result,name:n.name,type:n.type})},M.readAsDataURL(n)}):null},ne=async(o,n)=>{const u=await U(o);u&&(I.value[n].preview=u.base64,I.value[n].name=u.name,Z({id:I.value[n].id,type:I.value[n].id?"update":"add",filename:I.value[n].filename,file:u.base64}))},Z=o=>{const n=m.media.findIndex(u=>u.filename===o.filename);n!==-1?m.media[n]=o:m.media.push(o)},we=async o=>{const n=await te(o);G.value.preview=n,Z({id:G.value.id,type:l.modalEdit?"update":"add",filename:"Cover",file:n})},R=X(()=>{var o;return((o=G.value)==null?void 0:o.preview)||null}),oe=o=>{const n=m.media.findIndex(M=>M.filename===o.filename),u={id:o.id,type:"delete",filename:o.filename,file:null};n!==-1?m.media[n]=u:m.media.push(u)},ce=o=>{const n=S.value[o];n.id&&oe({id:n.id,filename:n.filename}),S.value.splice(o,1),S.value.forEach((u,M)=>{u.filename=`Image ${M+1}`})},ie=o=>{const n=I.value[o];n.id&&oe({id:n.id,filename:n.filename}),I.value.splice(o,1),I.value.forEach((u,M)=>{u.filename=`Document ${M+1}`})},re=()=>{w.value=!0;const o=l.modalEdit?"album/"+m.id:"album",n=l.modalEdit?"PUT":"POST";l.modalEdit?m.updated_by=l.dataAdmin?l.dataAdmin.name:null:m.created_by=l.dataAdmin?l.dataAdmin.name:null;const u=JSON.stringify(m);H({method:n,url:o,data:u,headers:{"content-type":"application/json",Accept:"application/json"}}).then(P=>{P.data.success&&(f(),fe(),e.success(P.data.message),t("click-refresh",P),t("refresh-notif"),k(),w.value=!1),P.data.success===!1&&(e.warning(P.data.message),w.value=!1)}).catch(P=>{console.log(P),w.value=!1})},k=(o,n)=>{l.modalEdit||fe(),document.getElementById("myForm").reset(),t("close-click")},A=C(!1),V=(o,n)=>{A.value==!1?A.value=!0:A.value=!1},Ee=j([[{header:[1,2,!1]}],["bold","italic","underline"],["link"],[{align:[]}],[{color:[]},{background:[]}],[{script:"sub"},{script:"super"}],["blockquote","code-block"],[{list:"ordered"},{list:"bullet"}],[{indent:"-1"},{indent:"+1"}],["clean"]]),Y=C(null),ue=C(null),me=(o,n,u="")=>{ve(()=>{o.value&&n?o.value.root.innerHTML=u:!o.value&&n&&(o.value=new Me(n,{modules:{toolbar:Ee},theme:"snow"}),u&&(o.value.root.innerHTML=u),o.value.on("text-change",()=>{m.description=o.value.root.innerHTML}))})},Te=()=>{G.value={id:null,preview:null},S.value=[],I.value=[],m.media=[],s.value=[],p.value={}},fe=()=>{if(Y.value){const o=Me.find(Y.value);o&&(o.root.innerHTML="")}Te()};return ke(()=>{E(),ve(()=>
1{Y.value&&me(ue,Y.value,m.description)})}),ge(()=>l.modalShow,o=>{o&&(l.modalEdit||fe(),ve(()=>{me(ue,Y.value,m.description||"")}))}),be(()=>{l.propClass&&Object.assign(m,JSON.parse(JSON.stringify(l.propClass))),m.id&&l.modalEdit?(g(m.id),i(m.id)):s.value=[],m.active||m.active||m.active==null||m.active==""?m.active=!0:m.active=!1,ve(()=>{l.modalEdit&&m&&me(ue,Y.value,m.description||"")})}),{DefaultPict:qe,t:c,reset:fe,closeAdd:k,params:m,postData:re,toast:e,preview:Q,onFileChange:we,onFileChangeGallery:ye,modalPlusForm:A,closePlus:V,dataCategory:L,getCat:E,notif:d,postNotif:f,resetNotif:W,loaderBtn:w,getImage:g,dataImage:s,description:Y,editor:ue,initializeEditor:me,thisToolbar:Ee,coverPreview:R,gallery:S,addImage:le,saveMedia:Z,documents:I,addDocument:Ce,onFileChangeDocument:ne,coverExisting:D,galleryExisting:N,documentExisting:r,removeImage:ce,removeDocument:ie}}},ma={class:"modal-content small-content"},fa={class:"header-form"},va={class:"content-form"},ha={class:"content-input"},ga={class:"Column-input"},_a=["placeholder"],pa=["innerHTML"],ba={class:"content-input"},ya={class:"Column-input"},Ca=["placeholder"],wa=["innerHTML"],Aa={class:"content-input"},Da={class:"Column-input"},ka=["placeholder"],Ea=["innerHTML"],Ma={class:"Column-input"},Pa=["placeholder","min"],Na=["innerHTML"],Ia={class:"content-input"},La={class:"Column-input"},Ra={class:"doubble-act"},Ba={disabled:"",selected:"",value:"",class:"def-sel"},Sa=["value"],Ta={class:"Column-input"},Fa=a("p",null,"Status",-1),Oa={class:"input-check"},Ha={class:"input-check-content"},Ga={class:"switch"},Va=["checked"],ja=a("span",{class:"slider round"},null,-1),Wa={class:"content-input",style:{"margin-bottom":"80px"}},Ua={class:"Column-input"},qa=a("p",null,"Thumbnail",-1),za={class:"Column-input"},Ja={class:"preview-input"},xa=a("p",null,"Preview:",-1),Qa=["src"],Xa={class:"Column-input"},Ya=["onChange"],Ka={class:"Column-input"},Za={class:"preview-input preview-auto"},$a=["src"],el={class:"preview-delete"},al=["onClick"],ll={class:"content-input",style:{"margin-bottom":"80px"}},tl={class:"Column-input"},nl={class:"Column-input"},ol=["onChange"],il={class:"Column-input"},sl={class:"preview-input"},dl=a("p",null,"Preview:",-1),cl={key:0,class:"pdf-preview"},rl={class:"preview-delete"},ul=["onClick"],ml={class:"content-input"},fl={class:"Column-input"},vl={class:"content-action"},hl={class:"inner-act-btn"},gl=["type"],_l={key:0,class:"inner-act-btn"},pl={key:1,class:"inner-act-btn"};function bl(l,t,c,e,w,L){const E=B("font-awesome-icon"),s=B("VuePdfEmbed"),g=B("LoadBtn"),p=B("PlusCategory");return v(),_(q,null,[a("div",ma,[a("div",fa,[a("p",null,h(c.modalEdit?l.$t("admAlbum.editData"):l.$t("admAlbum.addData")),1),a("div",{class:"close-btn",onClickCapture:t[0]||(t[0]=(...i)=>e.closeAdd&&e.closeAdd(...i))},[y(E,{icon:"fa-solid fa-xmark"})],32)]),a("div",va,[a("form",{onSubmit:t[11]||(t[11]=Ne((...i)=>e.postData&&e.postData(...i),["prevent"])),id:"myForm"},[a("div",ha,[a("div",ga,[a("p",null,h(l.$t("admAlbum.form.title")),1),O(a("input",{type:"text",placeholder:l.$t("admAlbum.form.title"),"onUpdate:modelValue":t[1]||(t[1]=i=>e.params.title=i),required:""},null,8,_a),[[ee,e.params.title]]),!c.modalEdit||c.modalEdit&&!e.params.title?(v(),_("span",{key:0,class:"required",innerHTML:l.$t("admin.general.required")},null,8,pa)):F("",!0)])]),a("div",ba,[a("div",ya,[a("p",null,h(l.$t("admDept.form.description")),1),a("div",{class:"quill-editor",ref:"description",style:{height:"240px"},placeholder:l.$t("email.outbox.inputMessage"),required:""},null,8,Ca),!c.modalEdit||c.modalEdit&&!e.params.description?(v(),_("span",{key:0,class:"required",innerHTML:l.$t("admin.general.required")},null,8,wa)):F("",!0)])]),a("div",Aa,[a("div",Da,[a("p",null,h(l.$t("admAlbum.form.albumDate"))+" "+h(e.params.gallery_date),1),O(a("input",{type:"date",placeholder:l.$t("admAlbum.form.albumDate"),"onUpdate:modelValue":t[2]||(t[2]=i=>e.params.gallery_date=i),required:""},null,8,ka),[[ee,e.params.gallery_date]]),!c.modalEdit||c.modalEdit&&!e.params.gallery_date?(v(),_("span",{key:0,class:"required",innerHTML:l.$t("admin.general.required")},null,8,Ea)):F("",!0)]),a("div",Ma,[a("p",null,h(l.$t("admAlbum.form.postDate")),1),O(a("input",{type:"datetime-local",placeholder:l.$t("admAlbum.form.postDate"),"onUpdate:modelValue":t[3]||(t[3]=i=>e.params.publish_date=i),min:e.params.gallery_date+" 00:00:00",required:""},null,8,Pa),[[ee,e.params.publish_date]]),!c.modalEdit||c.modalEdit&&!e.params.publish_date?(v(),_("span",{key:0,class:"required",innerHTML:l.$t("admin.general.required")},null,8,Na)):F("",!0)])]),a("div",Ia,[a("div",La,[a("p",null,h(l.$t("admAlbum.form.category")),1),a("div",Ra,[O(a("select",{"onUpdate:modelValue":t[4]||(t[4]=i=>e.params.category_id=i)},[a("option",Ba,h(l.$t("admAlbum.form.selCat")),1),(v(!0),_(q,null,ae(e.dataCategory,i=>(v(),_("option",{value:i.id,key:i},h(i.name),9,Sa))),128))],512),[[Ie,e.params.category_id]]),a("div",{class:"btn-add-master",onClick:t[5]||(t[5]=i=>e.closePlus())},[y(E,{icon:"fa-solid fa-plus"})])])]),a("div",Ta,[Fa,a("div",Oa,[a("div",Ha,[a("label",Ga,[O(a("input",{type:"checkbox","onUpdate:modelValue":t[6]||(t[6]=i=>e.params.is_active=i),checked:e.params.is_active},null,8,Va),[[Oe,e.params.is_active]]),ja]),a("p",null,h(e.params.is_active?"Active":"Not Active"),1)])])])]),a("div",Wa,[a("div",Ua,[qa,a("input",{type:"file",accept:"image/*",capture:"camera",onChange:t[7]||(t[7]=(...i)=>e.onFileChange&&e.onFileChange(...i))},null,32)]),a("div",za,[a("div",Ja,[xa,e.coverPreview?(v(),_("img",{key:0,src:e.coverPreview,alt:"Cover"},null,8,Qa)):F("",!0)])])]),(v(!0),_(q,null,ae(e.gallery,(i,D)=>(v(),_("div",{key:i.id??D,class:"content-input"},[a("div",Xa,[a("p",null,h(i.filename),1),a("input",{type:"file",accept:"image/*",onChange:N=>e.onFileChangeGallery(N,D)},null,40,Ya)]),a("div",Ka,[a("div",Za,[i.preview?(v(),_("img",{key:0,src:i.preview},null,8,$a)):F("",!0)]),a("div",el,[a("button",{type:"button",onClick:N=>e.removeImage(D)},"Delete",8,al)])])]))),128)),a("div",ll,[a("div",tl,[a("button",{type:"button",onClick:t[8]||(t[8]=(...i)=>e.addImage&&e.addImage(...i)),class:"button-full-column"},"Add Image")])]),(v(!0),_(q,null,ae(e.documents,(i,D)=>(v(),_("div",{key:i.id??D,class:"content-input"},[a("div",nl,[a("p",null,h(i.filename),1),a("input",{type:"file",accept:".pdf",onChange:N=>e.onFileChangeDocument(N,D)},null,40,ol)]),a("div",il,[a("div",sl,[dl,i.preview?(v(),_("div",cl,[y(s,{source:i.preview},null,8,["source"])])):F("",!0)]),a("div",rl,[a("button",{type:"button",onClick:N=>e.removeDocument(D)},"Delete",8,ul)])])]))),128)),a("div",ml,[a("div",fl,[a("button",{type:"button",onClick:t[9]||(t[9]=(...i)=>e.addDocument&&e.addDocument(...i)),class:"button-full-column"},"Add PDF")])]),a("div",vl,[a("button",{type:"reset",class:"act-btn cancel-btn",onClickCapture:t[10]||(t[10]=(...i)=>e.closeAdd&&e.closeAdd(...i))},[a("div",hl,h(l.$t("admin.general.cancel")),1)],32),a("button",{type:e.loaderBtn===!1?"submit":"button",class:"act-btn submit-btn"},[e.loaderBtn===!1?(v(),_("div",_l,h(l.$t("admin.general.submit")),1)):F("",!0),e.loaderBtn?(v(),_("div",pl,[y(g)])):F("",!0)],8,gl)])],32)])]),a("div",{class:x(["modal-form transparent-modal",e.modalPlusForm?"modal-show":"modal-hide"])},[y(p,{onClosePlus:t[12]||(t[12]=i=>e.closePlus()),onClickNewsrefresh:e.getCat,"modal-show":e.modalPlusForm},null,8,["onClickNewsrefresh","modal-show"])],2),O(a("div",{class:"close-modal-form",onClickCapture:t[13]||(t[13]=(...i)=>e.closeAdd&&e.closeAdd(...i))},null,544),[[de,c.modalShow]])],64)}const yl=_e(ua,[["render",bl]]);He.add(Ge,Ve,je,We);const Cl={props:{modalShow:{type:Boolean,default:!1},propClass:{type:Object,default:()=>({})},dataAdmin:{type:Object,default:()=>({})}},components:{VuePdfEmbed:Re,ModalGallery:Se,ListDetail:ze},setup(l,{emit:t}){const{locale:c}=pe(),e=(r,b)=>{w.value={},t("close-click")},w=C([]),L=r=>{H.get("album-image",{params:{content_id:r??null}}).then(b=>{b.data.data&&(w.value=b.data.data??[])}).catch(b=>{console.log(b)})},E=C({}),s=r=>{H.get("album",{params:{id:r??null}}).then(b=>{E.value=b.data.data??{}}).catch(b=>{console.log(b)})},g=X(()=>
1{if(!Array.isArray(w.value))return{};const r={};return w.value.forEach(b=>{r[b.id]=b}),r}),p=X(()=>Array.isArray(w.value)?Object.fromEntries(w.value.map(r=>[r.id,r])):{}),i=C(!1),D=C(""),N=r=>{i.value==!1?(i.value=!0,D.value=r):(i.value=!1,D.value="")};return be(()=>{l.propClass?l.propClass.id&&l.modalShow&&(L(l.propClass.id),s(l.propClass.id)):w.value=[]}),{locale:c,closeAdd:e,dataImage:w,dataDetail:E,pdfMap:g,imageMap:p,modalPdf:i,prevPdf:D,openModalPdf:N}}},wl={class:"modal-content small-content"},Al={class:"header-form"},Dl={key:0,class:"content-detail"},kl={class:"title-detail"},El={class:"value-detail center-content"},Ml=["onClick"],Pl=["src"],Nl={class:"pdf-container"},Il={key:0,class:"pdf-content"};function Ll(l,t,c,e,w,L){var p,i,D,N,r,b,m;const E=B("font-awesome-icon"),s=B("ListDetail"),g=B("VuePdfEmbed");return v(),_(q,null,[a("div",wl,[a("div",Al,[a("p",null,h(l.$t("admAlbum.detailData")),1),a("div",{class:"close-btn",onClickCapture:t[0]||(t[0]=(...d)=>e.closeAdd&&e.closeAdd(...d))},[y(E,{icon:"fa-solid fa-xmark"})],32)]),c.propClass?(v(),_("div",Dl,[y(s,{"title-value":l.$t("admAlbum.table.title"),"data-value":c.propClass.title},null,8,["title-value","data-value"]),y(s,{"title-value":l.$t("admDept.table.description"),"data-value":c.propClass.description},null,8,["title-value","data-value"]),y(s,{"title-value":l.$t("admAlbum.table.albumDate"),"date-value":c.propClass.gallery_date,"date-type":"dayDate"},null,8,["title-value","date-value"]),y(s,{"title-value":l.$t("admAlbum.form.postDate"),"date-value":c.propClass.publish_date,"date-type":"dayDateTime"},null,8,["title-value","date-value"]),y(s,{"title-value":l.$t("admAlbum.form.category"),"data-value":c.propClass.category_name},null,8,["title-value","data-value"]),y(s,{"title-value":"Is Active","data-value":c.propClass.is_active?"Active":"Not Active"},null,8,["data-value"]),(i=(p=e.dataDetail)==null?void 0:p.cover)!=null&&i.id&&e.dataImage?(v(),se(s,{key:0,"title-value":"Thumbnail","image-value":(D=e.imageMap[e.dataDetail.cover.id])==null?void 0:D.file_base64,"type-image":"square"},null,8,["image-value"])):F("",!0),(r=(N=e.dataDetail)==null?void 0:N.media)!=null&&r.length&&e.dataImage?(v(!0),_(q,{key:1},ae(e.dataDetail.media,(d,W)=>{var f;return v(),se(s,{key:d.id,"title-value":`Image ${W+1}`,"image-value":(f=e.imageMap[d.id])==null?void 0:f.file_base64},null,8,["title-value","image-value"])}),128)):F("",!0),(m=(b=e.dataDetail)==null?void 0:b.file)!=null&&m.length&&e.dataImage?(v(!0),_(q,{key:2},ae(e.dataDetail.file,d=>{var W,f;return v(),_("div",{key:d.id,class:"bar-detail"},[a("div",kl,h(l.$t("File")),1),a("div",El,[a("div",{class:x((W=e.pdfMap[d.id])!=null&&W.file_base64?"detail-pdf":"detail-pdf-load"),onClick:Q=>{var G;return((G=e.pdfMap[d.id])==null?void 0:G.file_base64)&&e.openModalPdf(e.pdfMap[d.id].file_base64)}},[(f=e.pdfMap[d.id])!=null&&f.file_base64?(v(),se(g,{key:0,source:e.pdfMap[d.id].file_base64},null,8,["source"])):(v(),_("img",{key:1,src:l.pdficon},null,8,Pl))],10,Ml)])])}),128)):F("",!0),y(s,{"title-value":l.$t("table.createdAt"),"date-value":c.propClass.created_at},null,8,["title-value","date-value"]),y(s,{"title-value":l.$t("table.createdBy"),"data-value":c.propClass.created_by},null,8,["title-value","data-value"]),y(s,{"title-value":l.$t("table.updatedAt"),"date-value":c.propClass.updated_at},null,8,["title-value","date-value"]),y(s,{"title-value":l.$t("table.updatedBy"),"data-value":c.propClass.updated_by},null,8,["title-value","data-value"])])):F("",!0)]),O(a("div",{class:"close-modal-form",onClickCapture:t[1]||(t[1]=(...d)=>e.closeAdd&&e.closeAdd(...d))},null,544),[[de,c.modalShow]]),a("div",{class:x(["modal-image modal-pdf",e.modalPdf?"image-open":"image-hide"])},[a("div",Nl,[e.prevPdf?(v(),_("div",Il,[y(g,{source:e.prevPdf},null,8,["source"])])):F("",!0)]),a("div",{class:"close-pdf",onClick:t[2]||(t[2]=d=>e.openModalPdf())},[y(E,{icon:"fa-solid fa-xmark"})]),a("div",{class:"close-image",onClick:t[3]||(t[3]=d=>e.openModalPdf())})],2)],64)}const Rl=_e(Cl,[["render",Ll]]),Bl={components:{AgGridVue:Le,AddAlbum:yl,DetailAlbum:Rl,ButtonAction:Pe,ModalGallery:Se,HtmlRead:Je,DateRead:xe,LoadBtn:Be,LoadData:Qe},props:{dataAdmin:{Object}},methods:{onGridReady(l){this.gridApi=l.api,this.gridColumnApi=l.columnApi;const t=[];
1this.gridColumnApi.getAllColumns().forEach(c=>{t.push(c.colId),this.gridApi.sizeColumnsToFit()}),this.gridColumnApi.autoSizeColumns(t,!1)}},beforeMount(){this.context={componentParent:this}},setup(l,{emit:t}){const{t:c}=pe(),e=De(),w=C(!1),L=C([]),E=()=>{H.get("album-category-get").then(k=>{L.value=k.data.data??[]}).catch(k=>{console.log(k)})},s=C([]),g=C([]),p=()=>{const k={page:"admin"};H.get("album",{params:k}).then(A=>{A.data.data&&(ie(),g.value=A.data.data,r.category_id===""||r.category_id==="all"?s.value=A.data.data:s.value=A.data.data.filter(V=>V.category_id===r.category_id),w.value=!1)}).catch(A=>{console.log(A)})},i=()=>{w.value=!0,p()};ke(()=>{w.value=!0,p(),E()});const D=[{headerName:"#",valueGetter:"node.rowIndex+1",minWidth:60,maxWidth:60,sortable:!1,filter:!1},{headerName:c("admAlbum.table.title"),field:"title",minWidth:280},{headerName:c("admAlbum.table.albumDate"),field:"gallery_date",cellRenderer:"DateRead",minWidth:360},{headerName:c("admAlbum.table.desc"),field:"description",cellRenderer:"HtmlRead",minWidth:480},{headerName:c("admDept.table.action"),field:"id",cellRenderer:"ButtonAction",sortable:!1,filter:!1,maxWidth:160}],N={sortable:!0,filter:!0,flex:1,minWidth:130},r=j({name:"",category_id:"all"}),b=C(!1),m=()=>{b.value?b.value=!1:b.value=!0};ge(()=>r.category_id,(k,A)=>{r.category_id==="all"?s.value=g.value:s.value=X(()=>g.value.filter(V=>V.category_id===k)).value}),ge(()=>r.name,(k,A)=>{r.name.trim().length>0?s.value=g.value.filter(V=>V.display_title!=null&&V.display_title.toLowerCase().includes(r.name.trim().toLowerCase())):s.value=g.value,r.category_id!==""&&r.category_id!=="all"&&(s.value=X(()=>s.value.filter(V=>V.category_id===r.category_id)).value)});const d=j({}),W=(k,A)=>{f.value=!1,G.value=!1,le.value=!1,I.value=!1,U.value=!1,document.getElementById("aside").style.zIndex=5,d.id=null,d.title=null,d.description=null,d.gallery_date=null,d.publish_date=null,d.is_active=null,d.category_id=null,d.created_at=null,d.created_by=null,d.updated_at=null,d.updated_by=null},f=C(!1),Q=(k,A)=>{G.value=!1,f.value=!0},G=C(!1),S=(k,A)=>{G.value=!0,f.value=!0,Object.assign(d,JSON.parse(JSON.stringify(A)))},le=C(!1),te=C(!1),ye=(k,A)=>{le.value=!0,te.value=!0,Object.assign(d,JSON.parse(JSON.stringify(A)))},I=C(!1),Ce=(k,A)=>{I.value=!0,Object.assign(d,JSON.parse(JSON.stringify(A)))},U=C(!1),ne=j({}),Z=k=>{U.value=!0,U.id=k,ne.value=s.value.filter(A=>A.id===k)[0].title},we=()=>{w.value=!0,H.delete(`album/${U.id}`).then(k=>{p(),ce(),ie(),e.success(k.data.message),document.getElementById("aside").style.zIndex=5,U.value=!1}).catch(k=>{console.log(k)})},R=j({action_by:null,user_id:null,message:null,message_en:null,detail:null,action:null}),oe=()=>{R.action_by=null,R.user_id=null,R.message=null,R.message_en=null,R.detail=null,R.action=null},ce=()=>{const k="notification",A="POST";R.action_by=l.dataAdmin?l.dataAdmin.name:null,R.user_id=l.dataAdmin?l.dataAdmin.user_id:null,R.message="telah <span class='danger-notif'>menghapus</span> data Album",R.message_en="has <span class='danger-notif'>deleted</span> Album data",R.detail=ne.value,R.action="delete",H({method:A,url:k,params:R}).then(V=>{oe()}).catch(V=>{console.log(V)})},ie=()=>{t("refresh-notif")},re=()=>{f.value||I.value||U.value?document.body.style.overflowY="hidden":document.body.style.overflowY="auto"};return be(()=>{re(),(f.value||I.value||U.value)&&(document.getElementById("aside").style.zIndex=1)}),{t:c,columnDefs:D,refreshUpdate:i,refreshNotif:ie,rowData:s,defaultColDef:N,ButtonAction:Pe,modalForm:f,addData:Q,closeAdd:W,nonScroll:re,gridApi:null,gridColumnApi:null,value:r,refresh:p,modalDel:U,modalGallery:le,btnAddGallery:te,webGallery:ye,deleteModalShow:Z,confirmDelete:we,editData:S,dataObject:d,textDel:ne,modalDetail:I,detailData:Ce,modalEdit:G,toast:e,tempoData:g,opensearch:b,opSch:m,dataCategory:L,getCat:E,notif:R,postNotif:ce,resetNotif:oe,loaderBtn:w}}},Sl={class:"container-filter"},Tl={class:"content-filter"},Fl={class:"label-filter"},Ol={disabled:"",selected:"",value:"",class:"def-sel"},Hl=a("option",{value:"all"},"All",-1),Gl=["value"],Vl={class:"container-table"},jl={class:"header-table-content"},Wl={class:"header-left"},Ul=["innerHTML"],ql={class:"header-right"},zl={class:"inputbar"},Jl=["placeholder"],xl={class:"search-mobile"},Ql=["placeholder"],Xl={key:0,class:"table-button table-button-add"},Yl={class:"table-admin"},Kl={class:"modal-content del-content"},Zl={class:"warning-del"},$l={class:"text-del"},et=["innerHTML"],at={class:"delete-action"},lt={class:"inner-act-btn"},tt={key:0};function nt(l,t,c,e,w,L){const E=B("font-awesome-icon"),s=B("LoadBtn"),g=B("ag-grid-vue"),p=B("LoadData"),i=B("AddAlbum"),D=B("ModalGallery"),N=B("DetailAlbum");return v(),_(q,null,[a("div",Sl,[a("div",Tl,[a("div",Fl,h(l.$t("admAlbum.form.category")),1),O(a("select",{"onUpdate:modelValue":t[0]||(t[0]=r=>e.value.category_id=r)},[a("option",Ol,h(l.$t("admAlbum.form.selCat")),1),Hl,(v(!0),_(q,null,ae(e.dataCategory,r=>
1(v(),_("option",{value:r.id,key:r},h(r.name),9,Gl))),128))],512),[[Ie,e.value.category_id]])])]),a("div",Vl,[a("div",jl,[a("div",Wl,[y(E,{icon:"fa-solid fa-newspaper"}),a("p",{innerHTML:l.$t("admin.headerTable.album")},null,8,Ul)]),a("div",ql,[a("div",zl,[O(a("input",{type:"text",placeholder:l.$t("admin.general.search")+"...","onUpdate:modelValue":t[1]||(t[1]=r=>e.value.name=r),class:"search-wide"},null,8,Jl),[[ee,e.value.name]]),a("div",xl,[O(a("input",{type:"text",placeholder:l.$t("admin.general.search")+"...","onUpdate:modelValue":t[2]||(t[2]=r=>e.value.name=r),class:x(e.opensearch?"open-search":"hide-search")},null,10,Ql),[[ee,e.value.name]]),a("div",{class:x(["btn-search",e.opensearch?"btn-focus":""]),onClick:t[3]||(t[3]=r=>e.opSch())},[y(E,{icon:"fa-solid fa-magnifying-glass"})],2)])]),e.loaderBtn?(v(),_("div",Xl,[y(s)])):(v(),_("div",{key:1,class:"table-button table-button-add",onClick:t[4]||(t[4]=r=>e.modalForm=!0)},[a("p",null,h(l.$t("admin.general.add")),1),a("p",null,[y(E,{icon:"fa-solid fa-plus"})])]))])]),a("div",Yl,[y(g,{class:"ag-theme-alpine",style:{height:"500px"},columnDefs:e.columnDefs,rowData:e.rowData,defaultColDef:e.defaultColDef,context:l.context,rowSelection:"multiple",animateRows:!0,pagination:!0,rowDragManaged:!0,suppressMoveWhenRowDragging:!0,onCellClicked:l.cellWasClicked,onGridReady:L.onGridReady},null,8,["columnDefs","rowData","defaultColDef","context","onCellClicked","onGridReady"])]),e.loaderBtn?(v(),se(p,{key:0})):F("",!0)]),a("div",{class:x(["modal-form",e.modalForm||e.modalEdit?"modal-show":"modal-hide"])},[y(i,{"modal-show":e.modalForm,"data-admin":c.dataAdmin,"prop-class":e.dataObject,"modal-edit":e.modalEdit,onCloseClick:e.closeAdd,onClickRefresh:e.refreshUpdate,onRefreshNotif:e.refreshNotif},null,8,["modal-show","data-admin","prop-class","modal-edit","onCloseClick","onClickRefresh","onRefreshNotif"])],2),y(D,{"modal-show":e.modalGallery,"btn-gallery":e.btnAddGallery,"data-admin":c.dataAdmin,"data-object":e.dataObject,onCloseClick:e.closeAdd,onClickRefresh:e.refreshUpdate,onRefreshNotif:e.refreshNotif},null,8,["modal-show","btn-gallery","data-admin","data-object","onCloseClick","onClickRefresh","onRefreshNotif"]),a("div",{class:x(["modal-form",e.modalDetail?"modal-show":"modal-hide"])},[y(N,{"modal-show":e.modalDetail,"prop-class":e.dataObject,"data-admin":c.dataAdmin,onCloseClick:e.closeAdd,onClickRefresh:e.refreshUpdate,onRefreshNotif:e.refreshNotif},null,8,["modal-show","prop-class","data-admin","onCloseClick","onClickRefresh","onRefreshNotif"])],2),a("div",{class:x(["modal-form",e.modalDel?"modal-show":"modal-hide"])},[a("div",Kl,[a("div",Zl,h(l.$t("admin.general.warning")),1),a("div",$l,[he(h(l.$t("admin.general.deleteMessage"))+" ",1),a("span",{innerHTML:e.textDel.value},null,8,et),he(" "+h(l.$t("admin.general.from"))+" "+h(l.$t("admin.headerTable.album")),1)]),a("div",at,[a("button",{onClick:t[5]||(t[5]=r=>e.closeAdd())},h(l.$t("admin.general.cancel")),1),a("button",{onClick:t[6]||(t[6]=r=>e.loaderBtn===!1?e.confirmDelete():"")},[a("div",lt,[e.loaderBtn===!1?(v(),_("span",tt,h(l.$t("admin.general.confirm")),1)):(v(),se(s,{key:1}))])])])]),O(a("div",{class:"close-modal-form",onClick:t[7]||(t[7]=r=>e.closeAdd())},null,512),[[de,e.modalDel]])],2)],64)}const yt=_e(Bl,[["render",nt]]);export{yt 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.