PageSourceSearch

https://vsp.gov.in/chunk-RJ5LTKQY.js

js vsp.gov.in collected 2026-10-07 14:08:10 UTC 8,281 bytes, 1 lines download raw bytes

1import{a as J}from"./chunk-Z3T2MDMF.js";import{b as K}from"./chunk-QVKPXASL.js";import"./chunk-7CAVQDSV.js";import"./chunk-ZZDVIRJH.js";import"./chunk-6MUMN5T2.js";import{a as j}from"./chunk-4QW632IT.js";import{b as T,d as D,e as W,f as B,g as A,h as I,m as N,n as V,o as H,r as q,u as R}from"./chunk-NZUHQ2NW.js";import{c as k}from"./chunk-S6Q2THYM.js";import"./chunk-7T3PMH3O.js";import{Bb as M,Cb as v,Db as F,Fb as t,Gb as i,Hb as c,Lc as x,Mb as w,Qb as s,Sb as y,Ya as u,ba as g,dc as l,ec as C,fc as b,ga as f,ha as P,kc as p,lb as E,lc as _,mc as h}from"./chunk-EPMS55EN.js";import{a as S,g as O}from"./chunk-WQBO2HMV.js";var m=O(j());function z(d,L){if(d&1){let n=w();t(0,"div",26)(1,"div",27)(2,"div",28)(3,"span",29),l(4),i(),t(5,"h5",30),l(6),t(7,"small",31),l(8),i()(),t(9,"p",32)(10,"strong"),l(11,"\u0935\u093F\u0935\u0930\u0923 (EN):"),i(),c(12,"br"),l(13),i(),t(14,"p",31)(15,"strong"),l(16,"\u0935\u093F\u0935\u0930\u0923 (HI):"),i(),c(17,"br"),l(18),i()(),t(19,"div",33)(20,"button",34),s("click",function(){let e=f(n).$implicit,r=y();return P(r.editPublication(e))}),c(21,"i",35),l(22," Edit "),i(),t(23,"button",36),s("click",function(){let e=f(n).$implicit,r=y();return P(r.deletePublication(e.id))}),c(24,"i",37),l(25," Delete "),i()()()()}if(d&2){let n=L.$implicit;u(4),b(" ",n.type==="B"?"\u092A\u0941\u0938\u094D\u0924\u0915\u0947\u0902":n.type==="J"?"\u092A\u0924\u094D\u0930\u093F\u0915\u093E":n.type==="CA"?"\u0915\u0947\u0902\u0926\u094D\u0930\u0940\u092F \u0905\u0927\u093F\u0928\u093F\u092F\u092E":"\u0928\u093F\u0930\u094D\u0923\u092F"," "),u(2),b(" ",n.title_en," "),u(2),b("(",n.title_hi,")"),u(5),b(" ",n.description_en," "),u(5),b(" ",n.description_hi," ")}}var te=(()=>{class d{publications=[];selectedPublication={type:"B",title_en:"",title_hi:"",description_en:"",description_hi:""};isEditMode=!1;isMobile=!1;modalRef=null;apiService=g(k);modalService=g(K);cdr=g(x);ngOnInit(){this.loadPublications()}checkIfMobile(){let n=/iPhone|iPad|iPod|Android/i.test(navigator.userAgent),a=window.innerWidth<900;return n||a}openKeyboardModal(n,a=""){this.modalRef=this.modalService.open(J,{size:"lg",backdrop:"static",windowClass:"keyboard-modal",keyboard:!1}),this.modalRef.componentInstance.initialValue=a;let e=this.modalRef.componentInstance.inputConfirmed.subscribe(r=>{this.selectedPublication[n]=r,this.cdr.detectChanges()});this.modalRef.result.finally(()=>{e.unsubscribe(),this.modalRef=null})}loadPublications(){this.apiService.getPublications().subscribe({next:n=>{this.publications=n},error:n=>{m.default.fire("Error","Failed to load publications: "+n.message,"error")}})}savePublication(){let n={type:this.selectedPublication.type,title_en:this.selectedPublication.title_en,title_hi:this.selectedPublication.title_hi,description_en:this.selectedPublication.description_en,description_hi:this.selectedPublication.description_hi};(this.isEditMode?this.apiService.updatePublication(this.selectedPublication.id,n):this.apiService.createPublication(n)).subscribe({next:()=>{this.loadPublications(),this.resetForm(),m.default.fire("Success",this.isEditMode?"Publication updated successfully!":"Publication added successfully!","success")},error:e=>{m.default.fire("Error","Failed to save publication: "+e.message,"error")}})}editPublication(n){this.selectedPublication=S({},n),this.isEditMode=!0}deletePublication(n){m.default.fire({title:"Are you sure?",text:"Do you want to delete this publication?",icon:"warning",showCancelButton:!0,confirmButtonText:"Yes, delete it!",cancelButtonText:"No, cancel"}).then(a=>{a.isConfirmed&&this.apiService.deletePublication(n).subscribe({next:()=>{this.loadPublications(),m.default.fire("Deleted","Publication has been deleted.","success")},error:e=>{m.default.fire("Error","Failed to delete publication: "+e.message,"error")}})})}resetForm(){this.selectedPublication={type:"B",title_en:"",title_hi:"",description_en:"",description_hi:""},this.isEditMode=!1}static \u0275fac=function(a){return new(a||d)};static \u0275cmp=E({type:d,selectors:[["app-publication-form"]],decls:48,vars:6,consts:[[1,"container","mt-4"],[1,"mb-4"],[1,"card","p-4","mb-4","shadow-lg",3,"ngSubmit"],[1,"row"],[1,"col-6","mb-3"],["for","type",1,"form-label"],["id","type","name","type","required","",1,"form-select",3,"ngModelChange","ngModel"],["value","B"],["value","J"],["value","CA"],["value","Jm"],["for","titleEn",1,"form-label"],["type","text","id","titleEn","name","title_en","placeholder","Enter title in English","required","",1,"form-control",3,"ngModelChange","ngModel"],["for","titleHi",1,"form-label"],[1,"input-group"],["type","text","id","titleHi","name","title_hi","placeholder","\u093
16\u0940\u0930\u094D\u0937\u0915 \u0939\u093F\u0902\u0926\u0940 \u092E\u0947\u0902 \u0926\u0930\u094D\u091C \u0915\u0930\u0947\u0902","required","","aria-label","Title in Hindi",1,"form-control",3,"ngModelChange","ngModel"],["type","button","title","Open Hindi Keyboard","aria-label","Open Hindi Keyboard",1,"btn","btn-outline-secondary",3,"click"],[1,"bi","bi-keyboard"],[1,"mb-3"],["for","descriptionEn",1,"form-label"],["id","descriptionEn","name","description_en","rows","4","placeholder","Enter description in English","required","",1,"form-control",3,"ngModelChange","ngModel"],["for","descriptionHi",1,"form-label"],["id","descriptionHi","name","description_hi","rows","4","placeholder","\u0935\u093F\u0935\u0930\u0923 \u0939\u093F\u0902\u0926\u0940 \u092E\u0947\u0902 \u0926\u0930\u094D\u091C \u0915\u0930\u0947\u0902","required","","aria-label","Description in Hindi",1,"form-control",3,"ngModelChange","ngModel"],[1,"d-flex","gap-2"],["type","submit",1,"btn","btn-primary"],["type","button",1,"btn","btn-secondary",3,"click"],[1,"col-md-4","col-sm-6","mb-4"],[1,"card","h-100","shadow-lg","border-0"],[1,"card-body"],[1,"badge","bg-primary","mb-2"],[1,"card-title","fw-bold"],[1,"text-muted"],[1,"mb-2"],[1,"card-footer","bg-white","border-0","d-flex","justify-content-between"],[1,"btn","btn-sm","btn-warning",3,"click"],[1,"bi","bi-pencil"],[1,"btn","btn-sm","btn-danger",3,"click"],[1,"bi","bi-trash"]],template:function(a,e){a&1&&(t(0,"div",0)(1,"h2",1),l(2,"Manage Publications"),i(),t(3,"form",2),s("ngSubmit",function(){return e.savePublication()}),t(4,"div",3)(5,"div",4)(6,"label",5),l(7,"Type"),i(),t(8,"select",6),h("ngModelChange",function(o){return _(e.selectedPublication.type,o)||(e.selectedPublication.type=o),o}),t(9,"option",7),l(10,"Books"),i(),t(11,"option",8),l(12,"Journals"),i(),t(13,"option",9),l(14,"Central Acts"),i(),t(15,"option",10),l(16,"Judgments"),i()()()(),t(17,"div",3)(18,"div",4)(19,"label",11),l(20,"Title"),i(),t(21,"input",12),h("ngModelChange",function(o){return _(e.selectedPublication.title_en,o)||(e.selectedPublication.title_en=o),o}),i()(),t(22,"div",4)(23,"label",13),l(24,"\u0936\u0940\u0930\u094D\u0937\u0915"),i(),t(25,"div",14)(26,"input",15),h("ngModelChange",function(o){return _(e.selectedPublication.title_hi,o)||(e.selectedPublication.title_hi=o),o}),i(),t(27,"button",16),s("click",function(){return e.openKeyboardModal("title_hi",e.selectedPublication.title_hi)}),c(28,"i",17),i()()()(),t(29,"div",18)(30,"label",19),l(31,"Description"),i(),t(32,"textarea",20),h("ngModelChange",function(o){return _(e.selectedPublication.description_en,o)||(e.selectedPublication.description_en=o),o}),i()(),t(33,"div",18)(34,"label",21),l(35,"\u0935\u093F\u0935\u0930\u0923"),i(),t(36,"div",14)(37,"textarea",22),h("ngModelChange",function(o){return _(e.selectedPublication.description_hi,o)||(e.selectedPublication.description_hi=o),o}),i(),t(38,"button",16),s("click",function(){return e.openKeyboardModal("description_hi",e.selectedPublication.description_hi)}),c(39,"i",17),i()()(),t(40,"div",23)(41,"button",24),l(42),i(),t(43,"button",25),s("click",function(){return e.resetForm()}),l(44,"Cancel"),i()()(),t(45,"div",3),v(46,z,26,5,"div",26,M),i()()),a&2&&(u(8),p("ngModel",e.selectedPublication.type),u(13),p("ngModel",e.selectedPublication.title_en),u(5),p("ngModel",e.selectedPublication.title_hi),u(6),p("ngModel",e.selectedPublication.description_en),u(5),p("ngModel",e.selectedPublication.description_hi),u(5),C(e.isEditMode?"Update":"Add"),u(4),F(e.publications))},dependencies:[R,I,V,H,T,N,D,W,q,A,B],encapsulation:2})}return d})();export{te as PublicationForm};

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.