Viewing File: /usr/local/cpanel/base/frontend/jupiter/calendar-contact-management/main.2cd007b0385e360f.js
"use strict";(self.webpackChunkcalendar_contact_management=self.webpackChunkcalendar_contact_management||[]).push([[792],{2041:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{sB:()=>ListComponent});var _services_calendar_service__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(4901),_cpanel_locale__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(6381),_angular_core__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(3953),_cpanel_angular_ui_jupiter__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(3819),_angular_router__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(7901),_angular_common__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(177);function ListComponent_span_7_Template(e,n){1&e&&_angular_core__WEBPACK_IMPORTED_MODULE_2__.nrm(0,"span",13)}function ListComponent_span_8_Template(e,n){1&e&&_angular_core__WEBPACK_IMPORTED_MODULE_2__.nrm(0,"span",14)}function ListComponent_span_12_Template(e,n){1&e&&_angular_core__WEBPACK_IMPORTED_MODULE_2__.nrm(0,"span",13)}function ListComponent_span_13_Template(e,n){1&e&&_angular_core__WEBPACK_IMPORTED_MODULE_2__.nrm(0,"span",14)}function ListComponent_span_17_Template(e,n){1&e&&_angular_core__WEBPACK_IMPORTED_MODULE_2__.nrm(0,"span",13)}function ListComponent_span_18_Template(e,n){1&e&&_angular_core__WEBPACK_IMPORTED_MODULE_2__.nrm(0,"span",14)}function ListComponent_tr_22_Template(e,n){if(1&e&&(_angular_core__WEBPACK_IMPORTED_MODULE_2__.j41(0,"tr",15),_angular_core__WEBPACK_IMPORTED_MODULE_2__.nrm(1,"cp-loading-spinner",16),_angular_core__WEBPACK_IMPORTED_MODULE_2__.k0s()),2&e){const t=_angular_core__WEBPACK_IMPORTED_MODULE_2__.XpG();_angular_core__WEBPACK_IMPORTED_MODULE_2__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_2__.Y8G("title",t.locale.maketext("Loading collections \u2026"))("isActive",!0)}}function ListComponent_tr_23_Template(e,n){if(1&e&&(_angular_core__WEBPACK_IMPORTED_MODULE_2__.j41(0,"tr")(1,"td",17),_angular_core__WEBPACK_IMPORTED_MODULE_2__.EFF(2),_angular_core__WEBPACK_IMPORTED_MODULE_2__.k0s()()),2&e){const t=_angular_core__WEBPACK_IMPORTED_MODULE_2__.XpG();_angular_core__WEBPACK_IMPORTED_MODULE_2__.R7$(2),_angular_core__WEBPACK_IMPORTED_MODULE_2__.SpI(" ",t.locale.maketext("No collections currently exist for your account.")," ")}}function ListComponent_tr_24_span_2_Template(e,n){if(1&e&&_angular_core__WEBPACK_IMPORTED_MODULE_2__.nrm(0,"span",23),2&e){const t=_angular_core__WEBPACK_IMPORTED_MODULE_2__.XpG().$implicit;_angular_core__WEBPACK_IMPORTED_MODULE_2__.muq("background-color: ",t.color,"")}}function ListComponent_tr_24_Template(e,n){if(1&e){const t=_angular_core__WEBPACK_IMPORTED_MODULE_2__.RV6();_angular_core__WEBPACK_IMPORTED_MODULE_2__.j41(0,"tr")(1,"td"),_angular_core__WEBPACK_IMPORTED_MODULE_2__.DNE(2,ListComponent_tr_24_span_2_Template,1,3,"span",18),_angular_core__WEBPACK_IMPORTED_MODULE_2__.EFF(3),_angular_core__WEBPACK_IMPORTED_MODULE_2__.k0s(),_angular_core__WEBPACK_IMPORTED_MODULE_2__.j41(4,"td",19),_angular_core__WEBPACK_IMPORTED_MODULE_2__.EFF(5),_angular_core__WEBPACK_IMPORTED_MODULE_2__.k0s(),_angular_core__WEBPACK_IMPORTED_MODULE_2__.j41(6,"td"),_angular_core__WEBPACK_IMPORTED_MODULE_2__.EFF(7),_angular_core__WEBPACK_IMPORTED_MODULE_2__.k0s(),_angular_core__WEBPACK_IMPORTED_MODULE_2__.j41(8,"td")(9,"a",20),_angular_core__WEBPACK_IMPORTED_MODULE_2__.bIt("click",function(){const _=_angular_core__WEBPACK_IMPORTED_MODULE_2__.eBV(t).$implicit,p=_angular_core__WEBPACK_IMPORTED_MODULE_2__.XpG();return _angular_core__WEBPACK_IMPORTED_MODULE_2__.Njj(p.editCollection(_))}),_angular_core__WEBPACK_IMPORTED_MODULE_2__.nrm(10,"span",21),_angular_core__WEBPACK_IMPORTED_MODULE_2__.k0s(),_angular_core__WEBPACK_IMPORTED_MODULE_2__.EFF(11," \xa0 "),_angular_core__WEBPACK_IMPORTED_MODULE_2__.j41(12,"a",20),_angular_core__WEBPACK_IMPORTED_MODULE_2__.bIt("click",function(){const _=_angular_core__WEBPACK_IMPORTED_MODULE_2__.eBV(t).$implicit,p=_angular_core__WEBPACK_IMPORTED_MODULE_2__.XpG();return _angular_core__WEBPACK_IMPORTED_MODULE_2__.Njj(p.removeCollection(_))}),_angular_core__WEBPACK_IMPORTED_MODULE_2__.nrm(13,"span",22),_angular_core__WEBPACK_IMPORTED_MODULE_2__.k0s()()()}if(2&e){const t=n.$implicit,s=_angular_core__WEBPACK_IMPORTED_MODULE_2__.XpG();_angular_core__WEBPACK_IMPORTED_MODULE_2__.R7$(2),_angular_core__WEBPACK_IMPORTED_MODULE_2__.Y8G("ngIf",t.color),_angular_core__WEBPACK_IMPORTED_MODULE_2__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_2__.SpI(" ",t.name," "),_angular_core__WEBPACK_IMPORTED_MODULE_2__.R7$(2),_angular_core__WEBPACK_IMPORTED_MODULE_2__.JRh(t.type),_angular_core__WEBPACK_IMPORTED_MODULE_2__.R7$(2),_angular_core__WEBPACK_IMPORTED_MODULE_2__.JRh(t.description),_angular_core__WEBPACK_IMPORTED_MODULE_2__.R7$(2),_angular_core__WEBPACK_IMPORTED_MODULE_2__.FS9("title",s.locale.maketext("Edit collection")),_angular_core__WEBPACK_IMPORTED_MODULE_2__.R7$(3),_angular_core__WEBPACK_IMPORTED_MODULE_2__.FS9("title",s.locale.maketext("Delete collection")),_angular_core__WEBPACK_IMPORTED_MODULE_2__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_2__.Y8G("ngClass",t.deleting||t.protected?"ri-xl ri-delete-bin-5-line disabledButan":"ri-xl ri-delete-bin-5-line")}}var DeleteStatus=function(e){return e[e.none=0]="none",e[e.confirmation=1]="confirmation",e[e.inProgress=2]="inProgress",e}(DeleteStatus||{}),UpdateStatus=function(e){return e[e.none=0]="none",e[e.inProgress=1]="inProgress",e}(UpdateStatus||{});let ListComponent=(()=>{class ListComponent{constructor(e,n,t,s){this.calendarService=e,this.locale=n,this._notifySvc=t,this.router=s,this.subscriptions=[],this.collections=[],this.lastSortOrder=1,this.lastSortProp="",this.usersForDisplay=[],this.loadingCollections=!0,this.calendarService.hideCreateBtn=!1,document.dispatchEvent(new CustomEvent("breadcrumbSetCrumbs",{bubbles:!0,detail:{help:"https://go.cpanel.net/calcontact-management",crumbs:[{displayName:"List Collections",longName:"The list of calendars, address books, and task lists you have available to manage.",link:"list"}]}}))}ngOnInit(){this.subscriptions.push(this.calendarService.getCollectionList().subscribe(response=>{const user=eval("window.REMOTE_USER"),collections=response.data,transformedCollections=[];if(collections&&collections.hasOwnProperty(user))for(const e of Object.keys(collections[user])){const n={name:collections[user][e].displayname,owner:user,path:e,type:this.mapCollectionType(collections[user][e].type),description:collections[user][e].description??"",protected:!!collections[user][e].protected};("VCALENDAR"===collections[user][e].type||"VTODO"===collections[user][e].type)&&(n.color=collections[user][e]["calendar-color"]),transformedCollections.push(n)}this.setCollectionList(transformedCollections)}))}ngOnDestroy(){for(const e in this.subscriptions)this.subscriptions[e]&&this.subscriptions[e].unsubscribe();this.subscriptions=[]}setCollectionList(e){if(this.collections=e,this.collections)for(const n of this.collections)n.deleting=!1;this.sort("name"),this.loadingCollections=!1}removeCollection(e){e.protected||!confirm(this.locale.maketext("Are you sure you wish to delete the \u201c[_1]\u201d named \u201c[_2]\u201d?",e.type,e.name))||(e.deleting=!0,this.calendarService.manageCollection("delete",e).subscribe(t=>{if(!t)return void(e.deleting=!1);const s=this.locale.maketext("Successfully deleted the \u201c[_1]\u201d named \u201c[_2]\u201d for \u201c[_3]\u201d.",e.type,e.name,e.owner),_=this.collections.indexOf(e);this.collections.splice(_,1),this.collections=this.collections.slice(),e.deleting=!1,this._notifySvc.success(s)}))}sort(e){this.lastSortOrder=-1*this.lastSortOrder,e!==this.lastSortProp&&(this.lastSortOrder=1),this.collections=[...this.collections.sort((n,t)=>n[e].toLowerCase().localeCompare(t[e].toLowerCase())*this.lastSortOrder)],this.lastSortProp=e}editCollection(e){this.calendarService.CRUDComponentFormState=e,this.calendarService.CRUDComponentMode="update",this.calendarService.CRUDComponentValidationState="is-valid",this.router.navigate(["editor"])}mapCollectionType(e){switch(e){case"VCALENDAR":return"calendar";case"VTODO":return"tasks";case"VADDRESSBOOK":return"addressbook";default:return"unknown"}}static#_=this.\u0275fac=function e(n){return new(n||ListComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_2__.rXU(_services_calendar_service__WEBPACK_IMPORTED_MODULE_0__.IE),_angular_core__WEBPACK_IMPORTED_MODULE_2__.rXU(_cpanel_locale__WEBPACK_IMPORTED_MODULE_1__.h),_angular_core__WEBPACK_IMPORTED_MODULE_2__.rXU(_cpanel_angular_ui_jupiter__WEBPACK_IMPORTED_MODULE_3__.JE),_angular_core__WEBPACK_IMPORTED_MODULE_2__.rXU(_angular_router__WEBPACK_IMPORTED_MODULE_4__.Ix))};static#_2=this.\u0275cmp=_angular_core__WEBPACK_IMPORTED_MODULE_2__.VBU({type:ListComponent,selectors:[["cp-calcontact-manager-list"]],decls:25,vars:13,consts:[[1,"table-responsive"],[1,"table","table-striped"],["id","colHeads"],["id","colHead-name"],["href","javascript:;",3,"click"],["class","ri-arrow-down-s-line",4,"ngIf"],["class","ri-arrow-up-s-line",4,"ngIf"],["id","colHead-type"],["id","colHead-description"],["id","colHeadActions"],["height","300","colspan","5",4,"ngIf"],[4,"ngIf"],[4,"ngFor","ngForOf"],[1,"ri-arrow-down-s-line"],[1,"ri-arrow-up-s-line"],["height","300","colspan","5"],["id","collectionsLoadingMsg",3,"title","isActive"],["colspan","4"],["class","colorBox",3,"style",4,"ngIf"],[1,"ucfirst"],["href","javascript:;",3,"click","title"],[1,"ri-xl","ri-pencil-fill"],[3,"ngClass"],[1,"colorBox"]],template:function e(n,t){1&n&&(_angular_core__WEBPACK_IMPORTED_MODULE_2__.j41(0,"div",0)(1,"table",1)(2,"thead",2)(3,"tr")(4,"th",3)(5,"a",4),_angular_core__WEBPACK_IMPORTED_MODULE_2__.bIt("click",function(){return t.sort("name")}),_angular_core__WEBPACK_IMPORTED_MODULE_2__.EFF(6),_angular_core__WEBPACK_IMPORTED_MODULE_2__.k0s(),_angular_core__WEBPACK_IMPORTED_MODULE_2__.DNE(7,ListComponent_span_7_Template,1,0,"span",5)(8,ListComponent_span_8_Template,1,0,"span",6),_angular_core__WEBPACK_IMPORTED_MODULE_2__.k0s(),_angular_core__WEBPACK_IMPORTED_MODULE_2__.j41(9,"th",7)(10,"a",4),_angular_core__WEBPACK_IMPORTED_MODULE_2__.bIt("click",function(){return t.sort("type")}),_angular_core__WEBPACK_IMPORTED_MODULE_2__.EFF(11),_angular_core__WEBPACK_IMPORTED_MODULE_2__.k0s(),_angular_core__WEBPACK_IMPORTED_MODULE_2__.DNE(12,ListComponent_span_12_Template,1,0,"span",5)(13,ListComponent_span_13_Template,1,0,"span",6),_angular_core__WEBPACK_IMPORTED_MODULE_2__.k0s(),_angular_core__WEBPACK_IMPORTED_MODULE_2__.j41(14,"th",8)(15,"a",4),_angular_core__WEBPACK_IMPORTED_MODULE_2__.bIt("click",function(){return t.sort("description")}),_angular_core__WEBPACK_IMPORTED_MODULE_2__.EFF(16),_angular_core__WEBPACK_IMPORTED_MODULE_2__.k0s(),_angular_core__WEBPACK_IMPORTED_MODULE_2__.DNE(17,ListComponent_span_17_Template,1,0,"span",5)(18,ListComponent_span_18_Template,1,0,"span",6),_angular_core__WEBPACK_IMPORTED_MODULE_2__.k0s(),_angular_core__WEBPACK_IMPORTED_MODULE_2__.j41(19,"th",9),_angular_core__WEBPACK_IMPORTED_MODULE_2__.EFF(20),_angular_core__WEBPACK_IMPORTED_MODULE_2__.k0s()()(),_angular_core__WEBPACK_IMPORTED_MODULE_2__.j41(21,"tbody"),_angular_core__WEBPACK_IMPORTED_MODULE_2__.DNE(22,ListComponent_tr_22_Template,2,2,"tr",10)(23,ListComponent_tr_23_Template,3,1,"tr",11)(24,ListComponent_tr_24_Template,14,7,"tr",12),_angular_core__WEBPACK_IMPORTED_MODULE_2__.k0s()()()),2&n&&(_angular_core__WEBPACK_IMPORTED_MODULE_2__.R7$(6),_angular_core__WEBPACK_IMPORTED_MODULE_2__.SpI(" ",t.locale.maketext("Name")," "),_angular_core__WEBPACK_IMPORTED_MODULE_2__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_2__.Y8G("ngIf",1===t.lastSortOrder&&"name"===t.lastSortProp),_angular_core__WEBPACK_IMPORTED_MODULE_2__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_2__.Y8G("ngIf",-1===t.lastSortOrder&&"name"===t.lastSortProp),_angular_core__WEBPACK_IMPORTED_MODULE_2__.R7$(3),_angular_core__WEBPACK_IMPORTED_MODULE_2__.SpI(" ",t.locale.maketext("Type")," "),_angular_core__WEBPACK_IMPORTED_MODULE_2__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_2__.Y8G("ngIf",1===t.lastSortOrder&&"type"===t.lastSortProp),_angular_core__WEBPACK_IMPORTED_MODULE_2__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_2__.Y8G("ngIf",-1===t.lastSortOrder&&"type"===t.lastSortProp),_angular_core__WEBPACK_IMPORTED_MODULE_2__.R7$(3),_angular_core__WEBPACK_IMPORTED_MODULE_2__.SpI(" ",t.locale.maketext("Description")," "),_angular_core__WEBPACK_IMPORTED_MODULE_2__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_2__.Y8G("ngIf",1===t.lastSortOrder&&"description"===t.lastSortProp),_angular_core__WEBPACK_IMPORTED_MODULE_2__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_2__.Y8G("ngIf",-1===t.lastSortOrder&&"description"===t.lastSortProp),_angular_core__WEBPACK_IMPORTED_MODULE_2__.R7$(2),_angular_core__WEBPACK_IMPORTED_MODULE_2__.SpI(" ",t.locale.maketext("Actions")," "),_angular_core__WEBPACK_IMPORTED_MODULE_2__.R7$(2),_angular_core__WEBPACK_IMPORTED_MODULE_2__.Y8G("ngIf",t.loadingCollections),_angular_core__WEBPACK_IMPORTED_MODULE_2__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_2__.Y8G("ngIf",!t.collections.length&&!t.loadingCollections),_angular_core__WEBPACK_IMPORTED_MODULE_2__.R7$(),_angular_core__WEBPACK_IMPORTED_MODULE_2__.Y8G("ngForOf",t.collections))},dependencies:[_angular_common__WEBPACK_IMPORTED_MODULE_5__.YU,_angular_common__WEBPACK_IMPORTED_MODULE_5__.Sq,_angular_common__WEBPACK_IMPORTED_MODULE_5__.bT,_cpanel_angular_ui_jupiter__WEBPACK_IMPORTED_MODULE_3__.NB],styles:["td[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]{text-decoration:none}.ucfirst[_ngcontent-%COMP%]:first-letter{text-transform:capitalize}span.colorBox[_ngcontent-%COMP%]{display:inline-block;height:1rem;width:1rem;border-radius:.25rem}html[dir=ltr][_ngcontent-%COMP%] span.colorBox[_ngcontent-%COMP%], [dir=ltr][_ngcontent-%COMP%] span.colorBox[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] span.colorBox[_ngcontent-%COMP%], html[dir=ltr][_nghost-%COMP%] span.colorBox[_ngcontent-%COMP%], html[dir=ltr] [_nghost-%COMP%] span.colorBox[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] span.colorBox[_ngcontent-%COMP%], [dir=ltr] [_nghost-%COMP%] span.colorBox[_ngcontent-%COMP%]{box-shadow:.5rem #000}html[dir=rtl][_ngcontent-%COMP%] span.colorBox[_ngcontent-%COMP%], [dir=rtl][_ngcontent-%COMP%] span.colorBox[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] span.colorBox[_ngcontent-%COMP%], html[dir=rtl][_nghost-%COMP%] span.colorBox[_ngcontent-%COMP%], html[dir=rtl] [_nghost-%COMP%] span.colorBox[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] span.colorBox[_ngcontent-%COMP%], [dir=rtl] [_nghost-%COMP%] span.colorBox[_ngcontent-%COMP%]{box-shadow:-.5rem #000}span.disabledButan[_ngcontent-%COMP%]{color:gray;cursor:not-allowed}thead[_ngcontent-%COMP%]{white-space:nowrap}.table-responsive[_ngcontent-%COMP%]{margin-bottom:1rem}.table[_ngcontent-%COMP%]{margin-bottom:0}"]})}return ListComponent})()},4901:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{IE:()=>CalendarService});var rxjs__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(1985),rxjs_operators__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(6354),_cpanel_api__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(3280),_cpanel_api__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(6802),_cpanel_locale__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(6381),_angular_core__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(3953),_cpanel_angular_api__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(6822),_cpanel_angular_ui_jupiter__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(3819);let CalendarService=(()=>{class CalendarService{constructor(uapi,_notifySvc,_locale){this.uapi=uapi,this._notifySvc=_notifySvc,this._locale=_locale,this.CRUDComponentFormState={owner:eval("window.REMOTE_USER"),name:"",path:"",color:"#de5c2e",description:"",type:"calendar",protected:!1},this.CRUDComponentMode="create",this.CRUDComponentValidationState="is-invalid",this.hideCreateBtn=!1}getPageDescription(){return this._locale.maketext(this.hideCreateBtn?"This is the editor view. Please input the details for the collection here.":"This interface allows you to create, rename, or delete calendars or address books for your account.")}submitUapiRequest(e){return this.uapi.post(e).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_1__.T)(n=>n.success?n:(n.errors.length&&this._notifySvc.error(n.errors[0].message),!1)))}getCollectionList(){return this.submitUapiRequest(new _cpanel_api__WEBPACK_IMPORTED_MODULE_2__.V({namespace:"CPDAVD",method:"list_users",arguments:[new _cpanel_api__WEBPACK_IMPORTED_MODULE_3__.e("api.filter",!0),new _cpanel_api__WEBPACK_IMPORTED_MODULE_3__.e("api.filter_type","eq"),new _cpanel_api__WEBPACK_IMPORTED_MODULE_3__.e("api.filter_term",eval("window.REMOTE_USER")),new _cpanel_api__WEBPACK_IMPORTED_MODULE_3__.e("api.filter_column","user")]}))}manageCollection(e,n){const t={namespace:"CPDAVD",method:"manage_collection",arguments:[new _cpanel_api__WEBPACK_IMPORTED_MODULE_3__.e("account",n.owner),new _cpanel_api__WEBPACK_IMPORTED_MODULE_3__.e("action",e),new _cpanel_api__WEBPACK_IMPORTED_MODULE_3__.e("path",n.path),new _cpanel_api__WEBPACK_IMPORTED_MODULE_3__.e("collection_type",n.type),new _cpanel_api__WEBPACK_IMPORTED_MODULE_3__.e("name",n.name),new _cpanel_api__WEBPACK_IMPORTED_MODULE_3__.e("description",n.description)]};return n.color&&t.arguments.push(new _cpanel_api__WEBPACK_IMPORTED_MODULE_3__.e("calendar-color",n.color)),this.submitUapiRequest(new _cpanel_api__WEBPACK_IMPORTED_MODULE_2__.V(t))}resetFormState(){this.CRUDComponentFormState={owner:eval("window.REMOTE_USER"),name:"",path:"",color:"#de5c2e",description:"",type:"calendar",protected:!1},this.CRUDComponentMode="create",this.CRUDComponentValidationState="is-invalid"}static#_=this.\u0275fac=function e(n){return new(n||CalendarService)(_angular_core__WEBPACK_IMPORTED_MODULE_4__.KVO(_cpanel_angular_api__WEBPACK_IMPORTED_MODULE_5__.dF),_angular_core__WEBPACK_IMPORTED_MODULE_4__.KVO(_cpanel_angular_ui_jupiter__WEBPACK_IMPORTED_MODULE_6__.JE),_angular_core__WEBPACK_IMPORTED_MODULE_4__.KVO(_cpanel_locale__WEBPACK_IMPORTED_MODULE_0__.h))};static#_2=this.\u0275prov=_angular_core__WEBPACK_IMPORTED_MODULE_4__.jDH({token:CalendarService,factory:CalendarService.\u0275fac,providedIn:"root"})}return CalendarService})();class CalendarMock{constructor(){this.CRUDComponentFormState={owner:"luser",name:"",path:"",color:"#de5c2e",description:"",type:"calendar",protected:!1},this.CRUDComponentMode="create",this.CRUDComponentValidationState="is-invalid",this.hideCreateBtn=!1}submitUapiRequest(n){return rxjs__WEBPACK_IMPORTED_MODULE_7__.c.create(t=>n)}getCollectionList(){return this.submitUapiRequest(this.mockedCollectionList)}manageCollection(){return this.submitUapiRequest(this.mockedManageReturn)}resetFormState(){this.CRUDComponentFormState={owner:"luser",name:"",path:"",color:"#de5c2e",description:"",type:"calendar",protected:!1},this.CRUDComponentMode="create",this.CRUDComponentValidationState="is-invalid"}getPageDescription(){return"This is never consulted but prevents exceptions. YOLO."}}const CalendarServiceMock={provide:CalendarService,useClass:CalendarMock}},5102:(e,n,t)=>{var s=t(345),_=t(3953),p=t(177),g=t(8658),u=t(7901),O=t(6381),D=t(2041),d=t(4901),c=t(9417),i=t(3819),M=t(7410),m=function(a){return a.left="ri-arrow-left-line",a.right="ri-arrow-right-line",a}(m||{});const h=a=>({"ng-form-validated":a});function R(a,P){if(1&a&&(_.j41(0,"div",7)(1,"cp-form-field",16)(2,"div",9),_.EFF(3),_.k0s(),_.j41(4,"select",17)(5,"option",18),_.EFF(6),_.k0s(),_.j41(7,"option",19),_.EFF(8),_.k0s(),_.j41(9,"option",20),_.EFF(10),_.k0s()()()()),2&a){const o=_.XpG();_.R7$(),_.Y8G("isRequired",!0)("showInfoToggle",!0)("showAllHelp",o.showAllHelp)("labelText",o.locale.maketext("Collection Type")),_.R7$(2),_.SpI(" ",o.locale.maketext("Collection type can be a Calendar, Address Book, or Task List.")," "),_.R7$(3),_.SpI(" ",o.locale.maketext("Calendar")," "),_.R7$(2),_.SpI(" ",o.locale.maketext("Address Book")," "),_.R7$(2),_.SpI(" ",o.locale.maketext("Task List")," ")}}function T(a,P){if(1&a&&(_.j41(0,"div",21)(1,"cp-form-field",22)(2,"div",9),_.EFF(3),_.k0s(),_.nrm(4,"input",23),_.k0s()()),2&a){const o=_.XpG();_.R7$(),_.Y8G("isRequired",!1)("labelText",o.locale.maketext("Color"))("showInfoToggle",!0)("showAllHelp",o.showAllHelp)("control",o.createCollectionForm.get("color")),_.R7$(2),_.SpI(" ",o.locale.maketext("Provide a color code for the calendar.")," ")}}const I=[{path:"editor",component:(()=>{class a{constructor(o,l,r,E,C){this.router=o,this.calendarService=l,this._notifySvc=r,this.locale=E,this.location=C,this.showAllHelp=!1,this.submitBtn={id:"submitBtn",buttonState:i.w.enabled,type:"submit"},this.backBtn={id:"backBtn",type:"button",cssClass:"m-2",buttonState:i.w.enabled,buttonVariant:i.Ak.iconLink},this.calendarService.hideCreateBtn=!0}get returnArrowDir(){return this.locale.isRtl?m.right:m.left}ngOnInit(){this.createView="create"===this.calendarService.CRUDComponentMode,this.formVerb=this.calendarService.CRUDComponentMode,this.arrowDirection=this.returnArrowDir,this.headerText=this.locale.maketext(`${this.formVerb.charAt(0).toUpperCase()+this.formVerb.slice(1)} Collection`),this.createCollectionForm=new c.J3({type:new c.hs(`${this.calendarService.CRUDComponentFormState.type}`),name:new c.hs(`${this.calendarService.CRUDComponentFormState.name}`),color:new c.hs(`${this.calendarService.CRUDComponentFormState.color}`),description:new c.hs(`${this.calendarService.CRUDComponentFormState.description}`)}),this.setValidators(this.createCollectionForm),this.showColorInputHandler(this.createCollectionForm.get("type").value),this.formTypeSubscription=this.createCollectionForm.get("type").valueChanges.subscribe(o=>{this.showColorInputHandler(o)})}ngOnDestroy(){this.formTypeSubscription.unsubscribe()}showColorInputHandler(o){this.showColorInput="calendar"===o}toggleHelpText(){this.showAllHelp=!this.showAllHelp}setValidators(o){o.get("type").setValidators([M.ln.required(this.locale.maketext("You [output,strong,must] choose a type."))]),o.get("name").setValidators([M.ln.required(this.locale.maketext("You [output,strong,must] provide a collection name."))])}updateCalendarServiceFormValues(o){this.calendarService.CRUDComponentFormState.type=o.get("type").value,this.calendarService.CRUDComponentFormState.name=o.get("name").value,this.calendarService.CRUDComponentFormState.color=o.get("color").value,this.calendarService.CRUDComponentFormState.description=o.get("description").value}backNav(){this.location.back()}doCollMng(){this.createCollectionForm.invalid||(this.submitBtn.buttonState=i.w.loading,this.updateCalendarServiceFormValues(this.createCollectionForm),this.calendarService.manageCollection(this.calendarService.CRUDComponentMode,this.calendarService.CRUDComponentFormState).subscribe(o=>{1===o.status&&(this._notifySvc.success(o.messages[0].message),this.router.navigate(["list"])),this.submitBtn.buttonState=i.w.enabled}))}static#_=this.\u0275fac=function(l){return new(l||a)(_.rXU(u.Ix),_.rXU(d.IE),_.rXU(i.JE),_.rXU(O.h),_.rXU(p.aZ))};static#e=this.\u0275cmp=_.VBU({type:a,selectors:[["cp-calcontact-manager-crud"]],decls:26,vars:30,consts:[["ngForm","ngForm"],[1,"row"],["id","collection-form",1,"col-sm-6",3,"ngSubmit","formGroup","ngClass"],["id","header",3,"toggleFormHelp","formHeaderText","showHelpLink"],[1,"panel","card","panel-default"],[1,"panel-body","card-block","card-body"],["class","mb-3",4,"ngIf"],[1,"mb-3"],["id","name","labelFor","nameInput",3,"labelText","isRequired","showInfoToggle","showAllHelp","control"],["label-help-text",""],["input-content","","type","text","id","nameInput","formControlName","name",1,"form-control"],["class","colorFormAligner",4,"ngIf"],["labelFor","descriptionInput","id","description",3,"labelText","showInfoToggle","control","showAllHelp"],["input-content","","type","text","id","descriptionInput","formControlName","description",1,"form-control"],[3,"id","buttonState","type"],[3,"btnClick","id","cssClass","buttonState","type","buttonVariant"],["labelFor","typeInput","id","type",3,"isRequired","showInfoToggle","showAllHelp","labelText"],["input-content","","formControlName","type","id","typeInput",1,"form-select"],["selected","selected","value","calendar"],["value","addressbook"],["value","tasks"],[1,"colorFormAligner"],["labelFor","colorInput","id","color",3,"isRequired","labelText","showInfoToggle","showAllHelp","control"],["input-content","","formControlName","color","type","color","id","colorInput",1,"form-control"]],template:function(l,r){if(1&l){const E=_.RV6();_.j41(0,"div",1)(1,"form",2,0),_.bIt("ngSubmit",function(){return _.eBV(E),_.Njj(r.doCollMng())}),_.j41(3,"cp-form-header",3),_.bIt("toggleFormHelp",function(){return _.eBV(E),_.Njj(r.toggleHelpText())}),_.k0s(),_.j41(4,"div",4)(5,"div",5),_.DNE(6,R,11,8,"div",6),_.j41(7,"div",7)(8,"cp-form-field",8)(9,"div",9),_.EFF(10),_.k0s(),_.nrm(11,"input",10),_.k0s()(),_.DNE(12,T,5,6,"div",11),_.j41(13,"div",7)(14,"cp-form-field",12)(15,"div",9),_.EFF(16),_.j41(17,"em"),_.EFF(18),_.k0s(),_.EFF(19," ) "),_.k0s(),_.nrm(20,"textarea",13),_.k0s()()()(),_.j41(21,"cp-form-footer")(22,"cp-button",14),_.EFF(23),_.k0s(),_.j41(24,"cp-button",15),_.bIt("btnClick",function(){return _.eBV(E),_.Njj(r.backNav())}),_.EFF(25),_.k0s()()()()}if(2&l){const E=_.sdS(2);_.R7$(),_.Y8G("formGroup",r.createCollectionForm)("ngClass",_.eq3(28,h,E.submitted)),_.R7$(2),_.Y8G("formHeaderText",r.headerText)("showHelpLink",!0),_.R7$(3),_.Y8G("ngIf",r.createView),_.R7$(2),_.Y8G("labelText",r.locale.maketext("Collection Name"))("isRequired",!0)("showInfoToggle",!0)("showAllHelp",r.showAllHelp)("control",r.createCollectionForm.get("name")),_.R7$(2),_.SpI(" ",r.locale.maketext("Provide a name for the collection.")," "),_.R7$(2),_.Y8G("ngIf",r.showColorInput),_.R7$(2),_.Y8G("labelText",r.locale.maketext("Description"))("showInfoToggle",!0)("control",r.createCollectionForm.get("description"))("showAllHelp",r.showAllHelp),_.R7$(2),_.SpI(" ",r.locale.maketext("Describe the collection.")," ( "),_.R7$(2),_.JRh(r.locale.maketext("Optional.")),_.R7$(4),_.Y8G("id",r.submitBtn.id)("buttonState",r.submitBtn.buttonState)("type",r.submitBtn.type),_.R7$(),_.SpI("",r.locale.maketext("Submit")," "),_.R7$(),_.Y8G("id",r.backBtn.id)("cssClass",r.backBtn.cssClass)("buttonState",r.backBtn.buttonState)("type",r.backBtn.type)("buttonVariant",r.backBtn.buttonVariant),_.R7$(),_.SpI(" ",r.locale.maketext("Go back")," ")}},dependencies:[p.YU,p.bT,c.qT,c.xH,c.y7,c.me,c.wz,c.BC,c.cb,c.j4,c.JD,i.nF,i.zO,i.KS,i.Qp],styles:["div.colorFormAligner[_ngcontent-%COMP%]{line-height:2.5rem;margin-bottom:.5rem}#colorInput[_ngcontent-%COMP%]{height:2.5rem;width:3.5rem;vertical-align:middle}@media (max-width: 900px){#crud-footer-container[_ngcontent-%COMP%]{flex-direction:column-reverse}}.spinner[_ngcontent-%COMP%]{display:inline-block;animation:_ngcontent-%COMP%_spin 1s infinite linear}@keyframes _ngcontent-%COMP%_spin{0%{transform:scale(1) rotate(0)}to{transform:scale(1) rotate(360deg)}}"]})}return a})(),data:{breadcrumb:{id:"editor"}}},{path:"list",component:D.sB,data:{breadcrumb:{id:"list"}}},{path:"",redirectTo:"list",pathMatch:"full"},{path:"**",redirectTo:"list",pathMatch:"full"}];let f=(()=>{class a{constructor(o,l){this.breadcrumbService=o,this.locale=l;const r={list:{displayName:l.maketext("List Collections"),id:"list",link:l.maketext("Go to the List Collections interface."),longName:l.maketext("List of existing Collections."),path:"list",parentId:null},editor:{displayName:l.maketext("Collection Editor"),id:"editor",link:l.maketext("Go to the Collection Editor interface."),longName:l.maketext("Create or edit a Collection."),path:"editor",parentId:"list"}};this.breadcrumbService.initializeBreadcrumbs(),this.breadcrumbService.flattenedRoutesData=Object.values(r)}static#_=this.\u0275fac=function(l){return new(l||a)(_.KVO(i.bA),_.KVO(O.h))};static#e=this.\u0275mod=_.$C({type:a});static#t=this.\u0275inj=_.G2t({imports:[u.iI.forRoot(I,{useHash:!0,enableTracing:!1}),u.iI]})}return a})();var U=t(2806);function B(a,P){if(1&a){const o=_.RV6();_.j41(0,"div",4)(1,"cp-button",5),_.bIt("btnClick",function(){_.eBV(o);const r=_.XpG();return _.Njj(r.gotoEditor())}),_.EFF(2),_.k0s()()}if(2&a){const o=_.XpG();_.R7$(),_.Y8G("id",o.createBtn.id)("type",o.createBtn.type),_.R7$(),_.SpI(" ",o.locale.maketext("Create")," ")}}let L=(()=>{class a{constructor(o,l,r){this.calendarService=o,this.router=l,this.locale=r,this.title="calendar-contact-management",this.notifyPosition=i.Rk.topRight,this.docUrl="https://go.cpanel.net/calcontact-management",this.createBtn={id:"createBtn",type:"button",buttonState:i.w.enabled},(0,U.Yl)("bs5")}gotoEditor(){this.calendarService.resetFormState(),this.router.navigate(["editor"])}static#_=this.\u0275fac=function(l){return new(l||a)(_.rXU(d.IE),_.rXU(u.Ix),_.rXU(O.h))};static#e=this.\u0275cmp=_.VBU({type:a,selectors:[["cp-calcontact-manager"]],decls:7,vars:4,consts:[[3,"position"],["id","page-intro"],[3,"innerHTML"],["class","create-btn-container",4,"ngIf"],[1,"create-btn-container"],[3,"btnClick","id","type"]],template:function(l,r){1&l&&(_.nrm(0,"cp-notification-list",0),_.j41(1,"div",1)(2,"p"),_.EFF(3),_.k0s(),_.nrm(4,"p",2),_.k0s(),_.DNE(5,B,3,3,"div",3),_.nrm(6,"router-outlet")),2&l&&(_.Y8G("position",r.notifyPosition),_.R7$(3),_.SpI(" ",r.calendarService.getPageDescription()," "),_.R7$(),_.Y8G("innerHTML",r.locale.maketext("Visit [output,url,_1,our documentation] for more information.",r.docUrl),_.npT),_.R7$(),_.Y8G("ngIf",!r.calendarService.hideCreateBtn))},dependencies:[p.bT,u.n3,i.bR,i.Qp],styles:[".create-btn-container[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;margin-bottom:var(--cp-spacer-3)}html[dir=ltr][_ngcontent-%COMP%] .right-float[_ngcontent-%COMP%], [dir=ltr][_ngcontent-%COMP%] .right-float[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .right-float[_ngcontent-%COMP%], html[dir=ltr][_nghost-%COMP%] .right-float[_ngcontent-%COMP%], html[dir=ltr] [_nghost-%COMP%] .right-float[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .right-float[_ngcontent-%COMP%], [dir=ltr] [_nghost-%COMP%] .right-float[_ngcontent-%COMP%]{float:right}html[dir=rtl][_ngcontent-%COMP%] .right-float[_ngcontent-%COMP%], [dir=rtl][_ngcontent-%COMP%] .right-float[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .right-float[_ngcontent-%COMP%], html[dir=rtl][_nghost-%COMP%] .right-float[_ngcontent-%COMP%], html[dir=rtl] [_nghost-%COMP%] .right-float[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .right-float[_ngcontent-%COMP%], [dir=rtl] [_nghost-%COMP%] .right-float[_ngcontent-%COMP%]{float:left}html[dir=rtl][_ngcontent-%COMP%] .right-float[_ngcontent-%COMP%]{float:left}"]})}return a})();var A=t(1562),b=t(3380),v=t(5e3),K=t(8008);let W=(()=>{class a{static#_=this.\u0275fac=function(l){return new(l||a)};static#e=this.\u0275mod=_.$C({type:a,bootstrap:[L]});static#t=this.\u0275inj=_.G2t({providers:[d.IE],imports:[s.Bb,p.MD,f,i.ys,b.Kj,A.q1,v.Ss.forRoot(),K.MQ,c.YN,c.X1,i.E4,i.y6,i.LT,i.rY,i.H7,g.B,i.nx,i.zJ,i.tm,i._S]})}return a})();(0,_.SmG)(),s.sG().bootstrapModule(W).catch(a=>console.error(a))}},e=>{e.O(0,[128,996,538],()=>e(e.s=5102)),e.O()}]);
Back to Directory
File Manager