@sava-info-systems/api-maker-with-extensions 1.18.3 → 1.19.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/dist/{1351.c372d4232c6551fb.js → 1351.48e08341fba9b889.js} +1 -1
  2. package/dist/{1417.336e9ca469a92f03.js → 1417.5caf023140e7c67f.js} +1 -1
  3. package/dist/1468.d42293f7d802a787.js +1 -0
  4. package/dist/1959.a22fe393419f10c5.js +1 -0
  5. package/dist/{2162.bb1f670dabb5c84a.js → 2162.3c94f3d66c6312d5.js} +1 -1
  6. package/dist/{2442.18887167a25c7dee.js → 2442.adbc5b49349bb569.js} +1 -1
  7. package/dist/{2818.dd50a60acfbaad6b.js → 2818.71176f4848a9419f.js} +1 -1
  8. package/dist/3488.ada60be2dbcd9845.js +1 -0
  9. package/dist/{3545.d415d4baf2d79163.js → 3545.b5585792e9fe1447.js} +1 -1
  10. package/dist/{3605.e398ec79072f4bf2.js → 3605.3c6cdf2a08c47301.js} +1 -1
  11. package/dist/{3611.59468f2dba2cd6df.js → 3611.9577d58af5f1f4aa.js} +1 -1
  12. package/dist/{3621.43633d73990c0546.js → 3621.412300a009ea6346.js} +1 -1
  13. package/dist/{3732.d698a74f1f0e24e6.js → 3732.b5ac36f1448e215c.js} +1 -1
  14. package/dist/{379.0d35e4e001b196b4.js → 379.d3e61f3350a595dc.js} +1 -1
  15. package/dist/{3929.a017182a7e24cf7f.js → 3929.9ac933e926943db2.js} +1 -1
  16. package/dist/{4092.b7a59976bb87bf26.js → 4092.71b0eccc0cb429f0.js} +1 -1
  17. package/dist/{4124.1dab3feb76c9c039.js → 4124.a8329e77343e7087.js} +1 -1
  18. package/dist/{4316.3745e74e3d9c2865.js → 4316.542be541e58dff84.js} +1 -1
  19. package/dist/4344.d8f42d425eaec852.js +1 -0
  20. package/dist/{4689.4f5958fddadc577e.js → 4689.e827720779e0cf34.js} +1 -1
  21. package/dist/{4709.bd58a5ca8c74f29c.js → 4709.262c34f60b50ebc9.js} +1 -1
  22. package/dist/{4774.088c1fbbb2988ee5.js → 4774.a4368f3ce2e778da.js} +1 -1
  23. package/dist/{4880.968e1ffff2f417d9.js → 4880.70ca405524206be7.js} +1 -1
  24. package/dist/{5011.f661999b271a98de.js → 5011.ed9a6465223f760d.js} +1 -1
  25. package/dist/{5090.fb3787137ba94607.js → 5090.c8bf74c35b0a5d26.js} +1 -1
  26. package/dist/{5140.05120f243608b828.js → 5140.581ccd2699e2a8a8.js} +1 -1
  27. package/dist/{5362.4514e2ffb27ce0ac.js → 5362.912e053f78479e90.js} +1 -1
  28. package/dist/{5442.454ac3ebe7c10659.js → 5442.186b40719e7c1da9.js} +1 -1
  29. package/dist/{5455.c1f4f3493ea016d4.js → 5455.a1d0d507419e3c59.js} +1 -1
  30. package/dist/5729.f0ee236ba6579a94.js +1 -0
  31. package/dist/{5826.650d402e8a957ea3.js → 5826.44efead20568788a.js} +1 -1
  32. package/dist/{6053.fa624fe98db9a213.js → 6053.67f38f7b35484475.js} +1 -1
  33. package/dist/6220.b6c29e6e3e717880.js +1 -0
  34. package/dist/{6415.6b8243526609c494.js → 6415.a48241737e134178.js} +1 -1
  35. package/dist/{6589.1003b792dd929437.js → 6589.b9c83295e466e464.js} +1 -1
  36. package/dist/{6679.e71f655f0e7e3e6c.js → 6679.c5073d3a60b67e2e.js} +1 -1
  37. package/dist/{6828.e0cfd2be83bbc047.js → 6828.36c6805f2b3c6f38.js} +1 -1
  38. package/dist/{6866.2b7ff38ea0ea8d8f.js → 6866.4dd76a41246a20be.js} +1 -1
  39. package/dist/{6882.c12e0aff75132b05.js → 6882.fe03a3df377ca119.js} +1 -1
  40. package/dist/{7014.8aa576d25335a412.js → 7014.5db4db60cc21782e.js} +1 -1
  41. package/dist/7152.dab3cc50472f703f.js +1 -0
  42. package/dist/{7367.bd5d43e22b265555.js → 7367.ba1e63db0f9b97f4.js} +1 -1
  43. package/dist/{7374.b0ad763987f68749.js → 7374.ebfe1004d1773912.js} +1 -1
  44. package/dist/{7597.9fe66d68836d18f4.js → 7597.177f15771dcdea42.js} +1 -1
  45. package/dist/7759.2b4ed39a62323abd.js +1 -0
  46. package/dist/{807.2ba5cc740aa4efa0.js → 807.dba59148bbbbe7fb.js} +1 -1
  47. package/dist/{8219.46ff63825141f651.js → 8219.2c97945d465ab185.js} +1 -1
  48. package/dist/{8447.17357e24b9438857.js → 8447.87b3cf73f79cd889.js} +1 -1
  49. package/dist/{8970.3abda875c6d7de4f.js → 8970.8eece52bbc1c316c.js} +1 -1
  50. package/dist/9036.876c1f0c1ce4e82b.js +1 -0
  51. package/dist/{9347.cb017d6396c7f64e.js → 9347.4e7d02eee86c5778.js} +1 -1
  52. package/dist/{9429.3ce31b960b639d09.js → 9429.9299aa0abda3dc76.js} +1 -1
  53. package/dist/{9785.edd131cfe4b5abdb.js → 9785.35cc7f0c3778344e.js} +1 -1
  54. package/dist/{9882.1e4cda6c65811bb5.js → 9882.a94c746b42e5fc0e.js} +1 -1
  55. package/dist/{9957.baf57c960e56a490.js → 9957.47ed0e74bdfeddd5.js} +1 -1
  56. package/dist/assets/schema-types/store-types.ts +1 -0
  57. package/dist/assets/schema-types/types.ts +1 -0
  58. package/dist/assets/styles/out/colors-dark.css +1 -1
  59. package/dist/assets/styles/out/styles.css +1 -1
  60. package/dist/assets/styles/styles.scss +2 -0
  61. package/dist/{common.2e05fdf2a25495d6.js → common.d4eb1616e93e21e1.js} +1 -1
  62. package/dist/index.html +1 -1
  63. package/dist/main.7d84949326f61c3e.js +1 -0
  64. package/dist/runtime.f7e0fa10d087fa0b.js +1 -0
  65. package/main.js +1 -1
  66. package/package.json +4 -4
  67. package/sandbox/Dockerfile +1 -0
  68. package/sandbox/assets/schema-types/store-types.js +1 -0
  69. package/sandbox/package.json +2 -1
  70. package/sandbox/sandbox.js +1 -1
  71. package/src/assets/schema-types/store-types.ts +1 -0
  72. package/src/assets/schema-types/types.ts +1 -0
  73. package/src/tools/local-client.js +1 -1
  74. package/dist/1468.7643522cc3e89857.js +0 -1
  75. package/dist/1959.59ee99be25f59755.js +0 -1
  76. package/dist/3488.7052042211d08d07.js +0 -1
  77. package/dist/4344.b6f194f896eb2205.js +0 -1
  78. package/dist/5729.9b201708284e16bc.js +0 -1
  79. package/dist/6220.7d7df941537ed662.js +0 -1
  80. package/dist/7152.4f047369765b7ac5.js +0 -1
  81. package/dist/7759.6c363b1156e3658a.js +0 -1
  82. package/dist/9036.18609df03a18bbdb.js +0 -1
  83. package/dist/main.b85e625cdc44b214.js +0 -1
  84. package/dist/runtime.f9839e08ff0d235d.js +0 -1
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[4124],{4124:(mt,v,i)=>{i.r(v),i.d(v,{I18nM:()=>lt});var M=i(7060),N=i(7431),t=i(540),l=i(467),c=i(8727),d=i(5046),p=i(7326),k=i(7376),u=i(6645),I=i(6129),C=i(6708),G=i(7337),S=i(7237),E=i(1011),D=i(1987),y=i(5779),P=i(3966),_=i(177),F=i(7645),b=i(7515),j=i(8542),f=i(4341),O=i(5312),X=i(9239),A=i(3864),V=i(3478),x=i(6914),U=i(4466);const W=["monacoEditorModalC"];function B(a,r){1&a&&(t.j41(0,"span"),t.nrm(1,"i",28),t.EFF(2," Add Internationalization"),t.k0s())}function Y(a,r){1&a&&(t.j41(0,"span"),t.nrm(1,"i",29),t.EFF(2," View Internationalization"),t.k0s())}function K(a,r){1&a&&(t.j41(0,"span"),t.nrm(1,"i",30),t.EFF(2," Edit Internationalization"),t.k0s())}function z(a,r){if(1&a){const e=t.RV6();t.j41(0,"a",31),t.bIt("click",function(){t.eBV(e);const n=t.XpG();return t.Njj(n.viewError())}),t.EFF(1,"View error"),t.k0s()}}function Q(a,r){1&a&&(t.j41(0,"span"),t.EFF(1,"Save"),t.k0s())}function L(a,r){1&a&&(t.j41(0,"span"),t.EFF(1,"Update"),t.k0s())}function H(a,r){if(1&a){const e=t.RV6();t.j41(0,"button",32),t.bIt("click",function(){t.eBV(e);const n=t.XpG();return t.Njj(n.save())}),t.nrm(1,"i",33),t.DNE(2,Q,2,0,"span",4),t.DNE(3,L,2,0,"span",4),t.k0s()}if(2&a){const e=t.XpG();t.Y8G("disabled",e.form.invalid),t.R7$(2),t.Y8G("ngIf",e.data.mode===e.EFormMode.ADD),t.R7$(1),t.Y8G("ngIf",e.data.mode===e.EFormMode.EDIT)}}function J(a,r){1&a&&t.nrm(0,"p-progressSpinner",34)}let w=(()=>{class a{fb;ns;generalCS;constantsS;authCS;i18nS;monacoS;data;loading={form:!1};EFormMode=d.X;form;subscriptions=[];editorI18N;editorOptionsI18N={readOnly:!1,language:"typescript",contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"json",contextmenu:!0};BE_HOST_PORT=O.c.BE_HOST_PORT;monacoDecorations=[];tab;viewDockerfileModelC;constructor(e,o,n,s,m,h,g){this.fb=e,this.ns=o,this.generalCS=n,this.constantsS=s,this.authCS=m,this.i18nS=h,this.monacoS=g}ngOnInit(){var e=this;return(0,l.A)(function*(){e.createForm(),e.subscriptions.push(e.data.eventChannel.subscribe(function(){var o=(0,l.A)(function*(n){if(n)if(e.form.enable(),n.action===c.K.OPEN_FORM_IN_EDIT_MODE){const s=yield e.i18nS.getById(e.data.formData._id).toPromise();e.form.reset(),e.form.patchValue(s.data),e.generalCS.setValueInEditor(e,"editorI18N",s.data.keysCode||"")}else if(n.action===c.K.OPEN_FORM_IN_VIEW_MODE){const s=yield e.i18nS.getById(e.data.formData._id).toPromise();e.form.reset(),e.form.patchValue(s.data),e.generalCS.setValueInEditor(e,"editorI18N",s.data.keysCode||""),e.form.disable()}else if(n.action===c.K.OPEN_FORM_IN_ADD_MODE){e.form.reset();const s=(yield e.i18nS.getSampleI18nText().toPromise()).data;s&&e.generalCS.setValueInEditor(e,"editorI18N",s)}});return function(n){return o.apply(this,arguments)}}()))})()}createForm(){this.form=this.fb.group({name:[null,[f.k0.required]]})}showModal(){this.lastError=void 0,$("#idI18NForm").modal("show")}hideModal(){$("#idI18NForm").modal("hide")}save(){var e=this;return(0,l.A)(function*(){const o=e.form.getRawValue();o.user=e.authCS.getUserId(),o.keysCode=e.editorI18N.getValue();try{let n;e.loading.form=!0,e.lastError=void 0,e.monacoS.clearEditorDecorations(e.editorI18N,e.monacoDecorations),e.data.mode===d.X.ADD?n=yield e.i18nS.post(o).toPromise():e.data.mode===d.X.EDIT&&(n=yield e.i18nS.put(e.data.formData._id,o,{select:u.GX._id}).toPromise()),e.ns.showSuccess(e.data.mode===d.X.ADD?e.constantsS.i18n.addSuccess:e.constantsS.i18n.editSuccess),e.data.eventChannel.emit({action:e.data.mode===d.X.ADD?c.K.SAVED:c.K.UPDATED}),e.loading.form=!1}catch(n){e.loading.form=!1,e.ns.showErrorFromResponse(n.error||n,"Unable to save internationalization."),e.lastError=n.error,e.tab=e.tab||{},e.tab.axiosResponse={data:n.error},e.monacoS.highlightErrorInMonacoEditor(e.editorI18N,e.tab,"MainSandbox.ts",e.monacoDecorations)}})()}editorGenerated(e){var o=this;return(0,l.A)(function*(){o.editorI18N=e,yield o.monacoS.loadSchemaEditorSettings(o.BE_HOST_PORT,o.authCS.getUserId(),null),o.monacoS.addSaveCodeKeyBinding(e,n=>{o.form.valid&&o.save()})})()}viewError(){this.viewDockerfileModelC.showModal(this.generalCS.stringify(this.lastError),X.L.json)}ngOnDestroy(){this.generalCS.unsubscribe(this.subscriptions)}static \u0275fac=function(o){return new(o||a)(t.rXU(f.ok),t.rXU(C.m),t.rXU(I.f),t.rXU(D.X),t.rXU(S.l),t.rXU(E.i),t.rXU(A.e))};static \u0275cmp=t.VBU({type:a,selectors:[["app-i18n-form"]],viewQuery:function(o,n){if(1&o&&t.GBs(W,5),2&o){let s;t.mGM(s=t.lsd())&&(n.viewDockerfileModelC=s.first)}},inputs:{data:"data"},decls:33,vars:12,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idI18NForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-xl"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],[1,"float-right"],["aria-label","Close","data-dismiss","modal","type","button",1,"close"],["aria-hidden","true"],[1,"fas","fa-window-close"],["href","https://docs.apimaker.dev/v1/docs/i18/i18.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-2","mr-1","mt-n1",2,"font-size","25px"],[1,"modal-body","overflow-auto"],[1,"container","pt-3",3,"formGroup"],[1,"form-group","row"],[1,"col-8"],[1,"row"],[1,"col-4","col-form-label","col-form-label-sm","text-right"],["formControlName","name","name","name","spellcheck","false","placeholder","Please provide name","type","text",1,"form-control","form-control-sm"],[1,"overflow-hidden","mb-3",2,"height","calc(100vh - 220px)"],[3,"isSchemaEditor","editorOptions","editorGenerated"],[1,"modal-footer"],["href","javascript:;","class","text-danger",3,"click",4,"ngIf"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary"],[1,"fas","fa-times","text-danger","fa-fw"],["class","btn btn-primary btn-sm","sava-no-dbl-click","","type","button",3,"disabled","click",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"modalId","editorOptionsMonacoEditorModal","modalTitle"],["monacoEditorModalC",""],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],[1,"far","fa-eye","text-info","fa-fw","mr-1"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],["href","javascript:;",1,"text-danger",3,"click"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"disabled","click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(o,n){1&o&&(t.j41(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),t.DNE(4,B,3,0,"span",4),t.DNE(5,Y,3,0,"span",4),t.DNE(6,K,3,0,"span",4),t.j41(7,"div",5)(8,"button",6)(9,"span",7),t.nrm(10,"i",8),t.k0s()(),t.j41(11,"a",9),t.nrm(12,"img",10),t.k0s()()(),t.j41(13,"div",11)(14,"form",12)(15,"div",13)(16,"div",14)(17,"div",15)(18,"label",16),t.EFF(19,"Name"),t.k0s(),t.j41(20,"div",14),t.nrm(21,"input",17),t.k0s()()()(),t.j41(22,"div",18)(23,"app-monaco-editor",19),t.bIt("editorGenerated",function(m){return n.editorGenerated(m)}),t.k0s()()()(),t.j41(24,"div",20),t.DNE(25,z,2,0,"a",21),t.j41(26,"button",22),t.nrm(27,"i",23),t.EFF(28," Close"),t.k0s(),t.DNE(29,H,4,3,"button",24),t.k0s(),t.DNE(30,J,1,0,"p-progressSpinner",25),t.k0s()()(),t.nrm(31,"app-monaco-editor-modal",26,27)),2&o&&(t.R7$(4),t.Y8G("ngIf",n.data.mode===n.EFormMode.ADD),t.R7$(1),t.Y8G("ngIf",n.data.mode===n.EFormMode.VIEW),t.R7$(1),t.Y8G("ngIf",n.data.mode===n.EFormMode.EDIT),t.R7$(8),t.Y8G("formGroup",n.form),t.R7$(9),t.Y8G("isSchemaEditor",!0)("editorOptions",n.editorOptionsI18N),t.R7$(2),t.Y8G("ngIf",n.lastError),t.R7$(4),t.Y8G("ngIf",n.data.mode!==n.EFormMode.VIEW),t.R7$(1),t.Y8G("ngIf",n.loading.form),t.R7$(1),t.Y8G("modalId","idMonacoEditorModalInI18n")("editorOptionsMonacoEditorModal",n.editorOptionsMonacoEditorModal)("modalTitle","Error info"))},dependencies:[f.qT,f.me,f.BC,f.cb,f.j4,f.JD,_.bT,V.U,x.A,b.p,U.J],encapsulation:2})}return a})();const Z=["i18nFormC"];function q(a,r){if(1&a){const e=t.RV6();t.j41(0,"span",17),t.bIt("click",function(){t.eBV(e);const n=t.XpG();return t.Njj(n.edit())}),t.nrm(1,"i",18),t.k0s()}}function tt(a,r){if(1&a){const e=t.RV6();t.j41(0,"span",19),t.bIt("click",function(){t.eBV(e);const n=t.XpG();return t.Njj(n.clone())}),t.nrm(1,"i",20),t.k0s()}}function et(a,r){if(1&a){const e=t.RV6();t.j41(0,"span",21),t.bIt("click",function(){t.eBV(e);const n=t.XpG();return t.Njj(n.removePermanentDialog())}),t.nrm(1,"i",22),t.k0s()}}function nt(a,r){1&a&&(t.j41(0,"tr")(1,"th"),t.EFF(2,"Name"),t.k0s()())}function ot(a,r){if(1&a&&(t.j41(0,"tr",23)(1,"td"),t.EFF(2),t.k0s()()),2&a){const e=r.$implicit;t.Y8G("pSelectableRow",e),t.R7$(2),t.JRh(e.name)}}function at(a,r){1&a&&t.nrm(0,"p-progressSpinner",24)}let R=(()=>{class a{generalS;notificationS;navigationCS;authCS;i18nS;constantsS;cd;confirmationService;eventCenterS;loading={grid:!1};subscriptions=[];data={mode:d.X.ADD,eventChannel:new t.bkB,formData:void 0};rows=[];rowsMap={};showAll=!1;selectedRows=[];gridKey=u.GX._id;i18nFormC;constructor(e,o,n,s,m,h,g,ct,dt){this.generalS=e,this.notificationS=o,this.navigationCS=n,this.authCS=s,this.i18nS=m,this.constantsS=h,this.cd=g,this.confirmationService=ct,this.eventCenterS=dt}ngOnInit(){this.eventCenterS.i18n.selectedI18n.next([]),this.loadGridData(),this.subscriptions.push(this.data.eventChannel.subscribe(e=>{(e.action===c.K.SAVED||e.action===c.K.UPDATED)&&(this.i18nFormC.hideModal(),this.loadGridData())})),this.generalS.setNewTitle("API Maker - Internationalization")}loadGridData(){var e=this;this.loading.grid=!0;const o={find:{user:this.authCS.getUserId(),active:!0},select:{name:1,active:1},sort:{name:1}};this.showAll&&delete o.find.active,this.subscriptions.push(this.i18nS.query(o).subscribe(function(){var n=(0,l.A)(function*(s){s.success&&(e.selectedRows=[],e.rows=s.data,e.rowsMap=k.keyBy(e.rows,u.GX._id));const m=e.navigationCS.getQueryParam(p.F.am_i18n);e.rowsMap[m]&&(yield e.fillData()),e.loading.grid=!1,e.cd.detectChanges()});return function(s){return n.apply(this,arguments)}}()))}add(){this.data.formData=void 0,this.data.mode=d.X.ADD,this.data.eventChannel.emit({action:c.K.OPEN_FORM_IN_ADD_MODE}),this.i18nFormC.showModal()}view(){this.data.formData=this.selectedRows[0],this.data.mode=d.X.VIEW,this.data.eventChannel.emit({action:c.K.OPEN_FORM_IN_VIEW_MODE}),this.i18nFormC.showModal()}edit(){this.data.formData=this.selectedRows[0],this.data.mode=d.X.EDIT,this.data.eventChannel.emit({action:c.K.OPEN_FORM_IN_EDIT_MODE}),this.i18nFormC.showModal()}clone(){var e=this;return(0,l.A)(function*(){try{if(!e.selectedRows[0])return;const o=(yield e.i18nS.getById(e.selectedRows[0]._id).toPromise()).data;delete o._id,o.name=`${o.name}-clone`,(yield e.i18nS.post(o).toPromise()).success?(e.notificationS.showSuccess(e.constantsS.logProfile.cloneSuccess),e.loadGridData()):e.notificationS.showSuccess(e.constantsS.logProfile.cloneSuccess)}catch{e.notificationS.showError(e.constantsS.logProfile.cloneError)}})()}removePermanentDialog(){var e=this;return(0,l.A)(function*(){var o;e.confirmationService.confirm({message:e.constantsS.i18n.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(o=(0,l.A)(function*(){yield e.removePermanent()}),function(){return o.apply(this,arguments)})})})()}removePermanent(){var e=this;return(0,l.A)(function*(){e.loading.grid=!0;const o=yield e.i18nS.permanentDelete(e.selectedRows[0]._id).toPromise();e.loading.grid=!1,o.success?(e.notificationS.showSuccess(e.constantsS.i18n.removePermanent),e.resetSelectedRows(),e.loadGridData()):e.notificationS.showErrorFromResponse(o,e.constantsS.i18n.removePermanentError)})()}resetSelectedRows(){this.selectedRows.length=0,this.eventCenterS.i18n.selectedI18n.next([])}resetDependents(){var e=this;return(0,l.A)(function*(){e.eventCenterS.i18n.selectedI18n.next([]),yield e.navigationCS.setQueryParam(p.F.am_i18n,null)})()}i18NSelected(){var e=this;return(0,l.A)(function*(){e.resetDependents().then(),e.fillData().then()})()}fillData(){var e=this;return(0,l.A)(function*(){if(!e.selectedRows.length)return yield e.navigationCS.setQueryParam(p.F.am_i18n,""),void e.eventCenterS.i18n.selectedI18n.next([]);const o=(yield e.i18nS.getById(e.selectedRows[0]._id).toPromise()).data;o._id?(yield e.navigationCS.setQueryParam(p.F.am_i18n,o._id),e.eventCenterS.i18n.selectedI18n.next([o])):e.resetDependents()})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}dblClickI18N(){this.selectedRows.length&&this.edit()}static \u0275fac=function(o){return new(o||a)(t.rXU(I.f),t.rXU(C.m),t.rXU(G.$),t.rXU(S.l),t.rXU(E.i),t.rXU(D.X),t.rXU(t.gRc),t.rXU(y.td),t.rXU(P.d))};static \u0275cmp=t.VBU({type:a,selectors:[["app-i18n-w"]],viewQuery:function(o,n){if(1&o&&t.GBs(Z,5),2&o){let s;t.mGM(s=t.lsd())&&(n.i18nFormC=s.first)}},decls:19,vars:11,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/i18n.svg","alt","Internationalization",1,"fa-fw","mr-1"],["href","https://docs.apimaker.dev/v1/docs/i18/i18.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"float-right","fa-fw","ml-3","mr-1",2,"font-size","25px"],["tooltipPosition","left","pTooltip","Add New",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Clone",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Permanent Delete",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["styleClass","p-datatable-striped","scrollHeight","calc(100vh - 100px)",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"data"],["i18nFormC",""],["tooltipPosition","left","pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["tooltipPosition","left","pTooltip","Clone",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-copy","text-warning","fa-fw"],["tooltipPosition","left","pTooltip","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],[3,"pSelectableRow"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(o,n){1&o&&(t.j41(0,"div",0)(1,"div",1)(2,"span"),t.nrm(3,"img",2),t.EFF(4," Internationalization"),t.k0s(),t.j41(5,"a",3),t.nrm(6,"img",4),t.k0s(),t.j41(7,"span",5),t.bIt("click",function(){return n.add()}),t.nrm(8,"i",6),t.k0s(),t.DNE(9,q,2,0,"span",7),t.DNE(10,tt,2,0,"span",8),t.DNE(11,et,2,0,"span",9),t.k0s(),t.j41(12,"div",10)(13,"p-table",11),t.bIt("selectionChange",function(m){return n.selectedRows=m})("selectionChange",function(){return n.i18NSelected()})("dblclick",function(){return n.dblClickI18N()}),t.DNE(14,nt,3,0,"ng-template",12),t.DNE(15,ot,3,2,"ng-template",13),t.k0s(),t.DNE(16,at,1,0,"p-progressSpinner",14),t.k0s()(),t.nrm(17,"app-i18n-form",15,16)),2&o&&(t.R7$(9),t.Y8G("ngIf",n.selectedRows.length),t.R7$(1),t.Y8G("ngIf",n.selectedRows.length),t.R7$(1),t.Y8G("ngIf",n.selectedRows.length),t.R7$(2),t.Y8G("selectionMode","multiple")("metaKeySelection",!0)("selection",n.selectedRows)("dataKey",n.gridKey)("scrollable",!0)("value",n.rows),t.R7$(3),t.Y8G("ngIf",n.loading.grid),t.R7$(1),t.Y8G("data",n.data))},dependencies:[_.bT,F.XI,y.Ei,F.d5,b.p,j.m,w],encapsulation:2})}return a})(),T=(()=>{class a{constructor(){}ngOnInit(){}static \u0275fac=function(o){return new(o||a)};static \u0275cmp=t.VBU({type:a,selectors:[["app-I18N-layout"]],decls:2,vars:0,consts:[[1,"pt-1","pl-1","pr-1"]],template:function(o,n){1&o&&(t.j41(0,"div",0),t.nrm(1,"app-i18n-w"),t.k0s())},dependencies:[R],encapsulation:2})}return a})();var it=i(2173),st=i(2508);const rt=[{path:"main",component:T,canActivate:[it.Z]}];let lt=(()=>{class a{static \u0275fac=function(o){return new(o||a)};static \u0275mod=t.$C({type:a});static \u0275inj=t.G2t({imports:[M.iI.forChild(rt),N.u,st.v]})}return a})()}}]);
1
+ "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[4124],{4124:(mt,v,i)=>{i.r(v),i.d(v,{I18nM:()=>lt});var M=i(7060),N=i(1709),t=i(540),l=i(467),c=i(8727),d=i(5046),p=i(7326),k=i(7376),u=i(6645),I=i(6129),C=i(6708),G=i(7337),S=i(7237),E=i(1011),D=i(1987),y=i(5779),P=i(3966),_=i(177),F=i(7645),b=i(7515),j=i(8542),f=i(4341),O=i(5312),X=i(9239),A=i(3864),V=i(3478),x=i(6914),U=i(4466);const W=["monacoEditorModalC"];function B(a,r){1&a&&(t.j41(0,"span"),t.nrm(1,"i",28),t.EFF(2," Add Internationalization"),t.k0s())}function Y(a,r){1&a&&(t.j41(0,"span"),t.nrm(1,"i",29),t.EFF(2," View Internationalization"),t.k0s())}function K(a,r){1&a&&(t.j41(0,"span"),t.nrm(1,"i",30),t.EFF(2," Edit Internationalization"),t.k0s())}function z(a,r){if(1&a){const e=t.RV6();t.j41(0,"a",31),t.bIt("click",function(){t.eBV(e);const n=t.XpG();return t.Njj(n.viewError())}),t.EFF(1,"View error"),t.k0s()}}function Q(a,r){1&a&&(t.j41(0,"span"),t.EFF(1,"Save"),t.k0s())}function L(a,r){1&a&&(t.j41(0,"span"),t.EFF(1,"Update"),t.k0s())}function H(a,r){if(1&a){const e=t.RV6();t.j41(0,"button",32),t.bIt("click",function(){t.eBV(e);const n=t.XpG();return t.Njj(n.save())}),t.nrm(1,"i",33),t.DNE(2,Q,2,0,"span",4),t.DNE(3,L,2,0,"span",4),t.k0s()}if(2&a){const e=t.XpG();t.Y8G("disabled",e.form.invalid),t.R7$(2),t.Y8G("ngIf",e.data.mode===e.EFormMode.ADD),t.R7$(1),t.Y8G("ngIf",e.data.mode===e.EFormMode.EDIT)}}function J(a,r){1&a&&t.nrm(0,"p-progressSpinner",34)}let w=(()=>{class a{fb;ns;generalCS;constantsS;authCS;i18nS;monacoS;data;loading={form:!1};EFormMode=d.X;form;subscriptions=[];editorI18N;editorOptionsI18N={readOnly:!1,language:"typescript",contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"json",contextmenu:!0};BE_HOST_PORT=O.c.BE_HOST_PORT;monacoDecorations=[];tab;viewDockerfileModelC;constructor(e,o,n,s,m,h,g){this.fb=e,this.ns=o,this.generalCS=n,this.constantsS=s,this.authCS=m,this.i18nS=h,this.monacoS=g}ngOnInit(){var e=this;return(0,l.A)(function*(){e.createForm(),e.subscriptions.push(e.data.eventChannel.subscribe(function(){var o=(0,l.A)(function*(n){if(n)if(e.form.enable(),n.action===c.K.OPEN_FORM_IN_EDIT_MODE){const s=yield e.i18nS.getById(e.data.formData._id).toPromise();e.form.reset(),e.form.patchValue(s.data),e.generalCS.setValueInEditor(e,"editorI18N",s.data.keysCode||"")}else if(n.action===c.K.OPEN_FORM_IN_VIEW_MODE){const s=yield e.i18nS.getById(e.data.formData._id).toPromise();e.form.reset(),e.form.patchValue(s.data),e.generalCS.setValueInEditor(e,"editorI18N",s.data.keysCode||""),e.form.disable()}else if(n.action===c.K.OPEN_FORM_IN_ADD_MODE){e.form.reset();const s=(yield e.i18nS.getSampleI18nText().toPromise()).data;s&&e.generalCS.setValueInEditor(e,"editorI18N",s)}});return function(n){return o.apply(this,arguments)}}()))})()}createForm(){this.form=this.fb.group({name:[null,[f.k0.required]]})}showModal(){this.lastError=void 0,$("#idI18NForm").modal("show")}hideModal(){$("#idI18NForm").modal("hide")}save(){var e=this;return(0,l.A)(function*(){const o=e.form.getRawValue();o.user=e.authCS.getUserId(),o.keysCode=e.editorI18N.getValue();try{let n;e.loading.form=!0,e.lastError=void 0,e.monacoS.clearEditorDecorations(e.editorI18N,e.monacoDecorations),e.data.mode===d.X.ADD?n=yield e.i18nS.post(o).toPromise():e.data.mode===d.X.EDIT&&(n=yield e.i18nS.put(e.data.formData._id,o,{select:u.GX._id}).toPromise()),e.ns.showSuccess(e.data.mode===d.X.ADD?e.constantsS.i18n.addSuccess:e.constantsS.i18n.editSuccess),e.data.eventChannel.emit({action:e.data.mode===d.X.ADD?c.K.SAVED:c.K.UPDATED}),e.loading.form=!1}catch(n){e.loading.form=!1,e.ns.showErrorFromResponse(n.error||n,"Unable to save internationalization."),e.lastError=n.error,e.tab=e.tab||{},e.tab.axiosResponse={data:n.error},e.monacoS.highlightErrorInMonacoEditor(e.editorI18N,e.tab,"MainSandbox.ts",e.monacoDecorations)}})()}editorGenerated(e){var o=this;return(0,l.A)(function*(){o.editorI18N=e,yield o.monacoS.loadSchemaEditorSettings(o.BE_HOST_PORT,o.authCS.getUserId(),null),o.monacoS.addSaveCodeKeyBinding(e,n=>{o.form.valid&&o.save()})})()}viewError(){this.viewDockerfileModelC.showModal(this.generalCS.stringify(this.lastError),X.L.json)}ngOnDestroy(){this.generalCS.unsubscribe(this.subscriptions)}static \u0275fac=function(o){return new(o||a)(t.rXU(f.ok),t.rXU(C.m),t.rXU(I.f),t.rXU(D.X),t.rXU(S.l),t.rXU(E.i),t.rXU(A.e))};static \u0275cmp=t.VBU({type:a,selectors:[["app-i18n-form"]],viewQuery:function(o,n){if(1&o&&t.GBs(W,5),2&o){let s;t.mGM(s=t.lsd())&&(n.viewDockerfileModelC=s.first)}},inputs:{data:"data"},decls:33,vars:12,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idI18NForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-xl"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],[1,"float-right"],["aria-label","Close","data-dismiss","modal","type","button",1,"close"],["aria-hidden","true"],[1,"fas","fa-window-close"],["href","https://docs.apimaker.dev/v1/docs/i18/i18.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-2","mr-1","mt-n1",2,"font-size","25px"],[1,"modal-body","overflow-auto"],[1,"container","pt-3",3,"formGroup"],[1,"form-group","row"],[1,"col-8"],[1,"row"],[1,"col-4","col-form-label","col-form-label-sm","text-right"],["formControlName","name","name","name","spellcheck","false","placeholder","Please provide name","type","text",1,"form-control","form-control-sm"],[1,"overflow-hidden","mb-3",2,"height","calc(100vh - 220px)"],[3,"isSchemaEditor","editorOptions","editorGenerated"],[1,"modal-footer"],["href","javascript:;","class","text-danger",3,"click",4,"ngIf"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary"],[1,"fas","fa-times","text-danger","fa-fw"],["class","btn btn-primary btn-sm","sava-no-dbl-click","","type","button",3,"disabled","click",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"modalId","editorOptionsMonacoEditorModal","modalTitle"],["monacoEditorModalC",""],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],[1,"far","fa-eye","text-info","fa-fw","mr-1"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],["href","javascript:;",1,"text-danger",3,"click"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"disabled","click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(o,n){1&o&&(t.j41(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),t.DNE(4,B,3,0,"span",4),t.DNE(5,Y,3,0,"span",4),t.DNE(6,K,3,0,"span",4),t.j41(7,"div",5)(8,"button",6)(9,"span",7),t.nrm(10,"i",8),t.k0s()(),t.j41(11,"a",9),t.nrm(12,"img",10),t.k0s()()(),t.j41(13,"div",11)(14,"form",12)(15,"div",13)(16,"div",14)(17,"div",15)(18,"label",16),t.EFF(19,"Name"),t.k0s(),t.j41(20,"div",14),t.nrm(21,"input",17),t.k0s()()()(),t.j41(22,"div",18)(23,"app-monaco-editor",19),t.bIt("editorGenerated",function(m){return n.editorGenerated(m)}),t.k0s()()()(),t.j41(24,"div",20),t.DNE(25,z,2,0,"a",21),t.j41(26,"button",22),t.nrm(27,"i",23),t.EFF(28," Close"),t.k0s(),t.DNE(29,H,4,3,"button",24),t.k0s(),t.DNE(30,J,1,0,"p-progressSpinner",25),t.k0s()()(),t.nrm(31,"app-monaco-editor-modal",26,27)),2&o&&(t.R7$(4),t.Y8G("ngIf",n.data.mode===n.EFormMode.ADD),t.R7$(1),t.Y8G("ngIf",n.data.mode===n.EFormMode.VIEW),t.R7$(1),t.Y8G("ngIf",n.data.mode===n.EFormMode.EDIT),t.R7$(8),t.Y8G("formGroup",n.form),t.R7$(9),t.Y8G("isSchemaEditor",!0)("editorOptions",n.editorOptionsI18N),t.R7$(2),t.Y8G("ngIf",n.lastError),t.R7$(4),t.Y8G("ngIf",n.data.mode!==n.EFormMode.VIEW),t.R7$(1),t.Y8G("ngIf",n.loading.form),t.R7$(1),t.Y8G("modalId","idMonacoEditorModalInI18n")("editorOptionsMonacoEditorModal",n.editorOptionsMonacoEditorModal)("modalTitle","Error info"))},dependencies:[f.qT,f.me,f.BC,f.cb,f.j4,f.JD,_.bT,V.U,x.A,b.p,U.J],encapsulation:2})}return a})();const Z=["i18nFormC"];function q(a,r){if(1&a){const e=t.RV6();t.j41(0,"span",17),t.bIt("click",function(){t.eBV(e);const n=t.XpG();return t.Njj(n.edit())}),t.nrm(1,"i",18),t.k0s()}}function tt(a,r){if(1&a){const e=t.RV6();t.j41(0,"span",19),t.bIt("click",function(){t.eBV(e);const n=t.XpG();return t.Njj(n.clone())}),t.nrm(1,"i",20),t.k0s()}}function et(a,r){if(1&a){const e=t.RV6();t.j41(0,"span",21),t.bIt("click",function(){t.eBV(e);const n=t.XpG();return t.Njj(n.removePermanentDialog())}),t.nrm(1,"i",22),t.k0s()}}function nt(a,r){1&a&&(t.j41(0,"tr")(1,"th"),t.EFF(2,"Name"),t.k0s()())}function ot(a,r){if(1&a&&(t.j41(0,"tr",23)(1,"td"),t.EFF(2),t.k0s()()),2&a){const e=r.$implicit;t.Y8G("pSelectableRow",e),t.R7$(2),t.JRh(e.name)}}function at(a,r){1&a&&t.nrm(0,"p-progressSpinner",24)}let R=(()=>{class a{generalS;notificationS;navigationCS;authCS;i18nS;constantsS;cd;confirmationService;eventCenterS;loading={grid:!1};subscriptions=[];data={mode:d.X.ADD,eventChannel:new t.bkB,formData:void 0};rows=[];rowsMap={};showAll=!1;selectedRows=[];gridKey=u.GX._id;i18nFormC;constructor(e,o,n,s,m,h,g,ct,dt){this.generalS=e,this.notificationS=o,this.navigationCS=n,this.authCS=s,this.i18nS=m,this.constantsS=h,this.cd=g,this.confirmationService=ct,this.eventCenterS=dt}ngOnInit(){this.eventCenterS.i18n.selectedI18n.next([]),this.loadGridData(),this.subscriptions.push(this.data.eventChannel.subscribe(e=>{(e.action===c.K.SAVED||e.action===c.K.UPDATED)&&(this.i18nFormC.hideModal(),this.loadGridData())})),this.generalS.setNewTitle("API Maker - Internationalization")}loadGridData(){var e=this;this.loading.grid=!0;const o={find:{user:this.authCS.getUserId(),active:!0},select:{name:1,active:1},sort:{name:1}};this.showAll&&delete o.find.active,this.subscriptions.push(this.i18nS.query(o).subscribe(function(){var n=(0,l.A)(function*(s){s.success&&(e.selectedRows=[],e.rows=s.data,e.rowsMap=k.keyBy(e.rows,u.GX._id));const m=e.navigationCS.getQueryParam(p.F.am_i18n);e.rowsMap[m]&&(yield e.fillData()),e.loading.grid=!1,e.cd.detectChanges()});return function(s){return n.apply(this,arguments)}}()))}add(){this.data.formData=void 0,this.data.mode=d.X.ADD,this.data.eventChannel.emit({action:c.K.OPEN_FORM_IN_ADD_MODE}),this.i18nFormC.showModal()}view(){this.data.formData=this.selectedRows[0],this.data.mode=d.X.VIEW,this.data.eventChannel.emit({action:c.K.OPEN_FORM_IN_VIEW_MODE}),this.i18nFormC.showModal()}edit(){this.data.formData=this.selectedRows[0],this.data.mode=d.X.EDIT,this.data.eventChannel.emit({action:c.K.OPEN_FORM_IN_EDIT_MODE}),this.i18nFormC.showModal()}clone(){var e=this;return(0,l.A)(function*(){try{if(!e.selectedRows[0])return;const o=(yield e.i18nS.getById(e.selectedRows[0]._id).toPromise()).data;delete o._id,o.name=`${o.name}-clone`,(yield e.i18nS.post(o).toPromise()).success?(e.notificationS.showSuccess(e.constantsS.logProfile.cloneSuccess),e.loadGridData()):e.notificationS.showSuccess(e.constantsS.logProfile.cloneSuccess)}catch{e.notificationS.showError(e.constantsS.logProfile.cloneError)}})()}removePermanentDialog(){var e=this;return(0,l.A)(function*(){var o;e.confirmationService.confirm({message:e.constantsS.i18n.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(o=(0,l.A)(function*(){yield e.removePermanent()}),function(){return o.apply(this,arguments)})})})()}removePermanent(){var e=this;return(0,l.A)(function*(){e.loading.grid=!0;const o=yield e.i18nS.permanentDelete(e.selectedRows[0]._id).toPromise();e.loading.grid=!1,o.success?(e.notificationS.showSuccess(e.constantsS.i18n.removePermanent),e.resetSelectedRows(),e.loadGridData()):e.notificationS.showErrorFromResponse(o,e.constantsS.i18n.removePermanentError)})()}resetSelectedRows(){this.selectedRows.length=0,this.eventCenterS.i18n.selectedI18n.next([])}resetDependents(){var e=this;return(0,l.A)(function*(){e.eventCenterS.i18n.selectedI18n.next([]),yield e.navigationCS.setQueryParam(p.F.am_i18n,null)})()}i18NSelected(){var e=this;return(0,l.A)(function*(){e.resetDependents().then(),e.fillData().then()})()}fillData(){var e=this;return(0,l.A)(function*(){if(!e.selectedRows.length)return yield e.navigationCS.setQueryParam(p.F.am_i18n,""),void e.eventCenterS.i18n.selectedI18n.next([]);const o=(yield e.i18nS.getById(e.selectedRows[0]._id).toPromise()).data;o._id?(yield e.navigationCS.setQueryParam(p.F.am_i18n,o._id),e.eventCenterS.i18n.selectedI18n.next([o])):e.resetDependents()})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}dblClickI18N(){this.selectedRows.length&&this.edit()}static \u0275fac=function(o){return new(o||a)(t.rXU(I.f),t.rXU(C.m),t.rXU(G.$),t.rXU(S.l),t.rXU(E.i),t.rXU(D.X),t.rXU(t.gRc),t.rXU(y.td),t.rXU(P.d))};static \u0275cmp=t.VBU({type:a,selectors:[["app-i18n-w"]],viewQuery:function(o,n){if(1&o&&t.GBs(Z,5),2&o){let s;t.mGM(s=t.lsd())&&(n.i18nFormC=s.first)}},decls:19,vars:11,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/i18n.svg","alt","Internationalization",1,"fa-fw","mr-1"],["href","https://docs.apimaker.dev/v1/docs/i18/i18.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"float-right","fa-fw","ml-3","mr-1",2,"font-size","25px"],["tooltipPosition","left","pTooltip","Add New",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Clone",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Permanent Delete",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["styleClass","p-datatable-striped","scrollHeight","calc(100vh - 100px)",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"data"],["i18nFormC",""],["tooltipPosition","left","pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["tooltipPosition","left","pTooltip","Clone",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-copy","text-warning","fa-fw"],["tooltipPosition","left","pTooltip","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],[3,"pSelectableRow"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(o,n){1&o&&(t.j41(0,"div",0)(1,"div",1)(2,"span"),t.nrm(3,"img",2),t.EFF(4," Internationalization"),t.k0s(),t.j41(5,"a",3),t.nrm(6,"img",4),t.k0s(),t.j41(7,"span",5),t.bIt("click",function(){return n.add()}),t.nrm(8,"i",6),t.k0s(),t.DNE(9,q,2,0,"span",7),t.DNE(10,tt,2,0,"span",8),t.DNE(11,et,2,0,"span",9),t.k0s(),t.j41(12,"div",10)(13,"p-table",11),t.bIt("selectionChange",function(m){return n.selectedRows=m})("selectionChange",function(){return n.i18NSelected()})("dblclick",function(){return n.dblClickI18N()}),t.DNE(14,nt,3,0,"ng-template",12),t.DNE(15,ot,3,2,"ng-template",13),t.k0s(),t.DNE(16,at,1,0,"p-progressSpinner",14),t.k0s()(),t.nrm(17,"app-i18n-form",15,16)),2&o&&(t.R7$(9),t.Y8G("ngIf",n.selectedRows.length),t.R7$(1),t.Y8G("ngIf",n.selectedRows.length),t.R7$(1),t.Y8G("ngIf",n.selectedRows.length),t.R7$(2),t.Y8G("selectionMode","multiple")("metaKeySelection",!0)("selection",n.selectedRows)("dataKey",n.gridKey)("scrollable",!0)("value",n.rows),t.R7$(3),t.Y8G("ngIf",n.loading.grid),t.R7$(1),t.Y8G("data",n.data))},dependencies:[_.bT,F.XI,y.Ei,F.d5,b.p,j.m,w],encapsulation:2})}return a})(),T=(()=>{class a{constructor(){}ngOnInit(){}static \u0275fac=function(o){return new(o||a)};static \u0275cmp=t.VBU({type:a,selectors:[["app-I18N-layout"]],decls:2,vars:0,consts:[[1,"pt-1","pl-1","pr-1"]],template:function(o,n){1&o&&(t.j41(0,"div",0),t.nrm(1,"app-i18n-w"),t.k0s())},dependencies:[R],encapsulation:2})}return a})();var it=i(2173),st=i(2508);const rt=[{path:"main",component:T,canActivate:[it.Z]}];let lt=(()=>{class a{static \u0275fac=function(o){return new(o||a)};static \u0275mod=t.$C({type:a});static \u0275inj=t.G2t({imports:[M.iI.forChild(rt),N.u,st.v]})}return a})()}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[4316],{4316:(ft,d,a)=>{a.r(d),a.d(d,{TpApiM:()=>it});var h=a(7060),I=a(7431),T=a(2173),t=a(540),c=a(5779),A=a(572),C=a(3173),r=a(467),E=a(9773),l=a(6645),y=a(5312),m=a(5632),P=a(9561),G=a(9239),_=a(4774),O=a(4752),f=a(6708),N=a(7237),j=a(3966),x=a(3864),B=a(6268),D=a(1987),M=a(6129),R=a(9368),F=a(6170),V=a(177),X=a(6914),b=a(7515),g=a(4945),U=a(8542),L=a(4466);const Y=["monacoEditorModalC"];function $(o,p){if(1&o){const e=t.RV6();t.j41(0,"span",12),t.bIt("click",function(){t.eBV(e);const n=t.XpG();return t.Njj(n.save())}),t.nrm(1,"i",13),t.k0s()}}function J(o,p){if(1&o){const e=t.RV6();t.j41(0,"span",14),t.bIt("click",function(){t.eBV(e);const n=t.XpG();return t.Njj(n.removePermanentDialog())}),t.nrm(1,"i",15),t.k0s()}}function H(o,p){if(1&o){const e=t.RV6();t.j41(0,"a",16),t.bIt("click",function(){t.eBV(e);const n=t.XpG();return t.Njj(n.viewError())}),t.EFF(1,"View error"),t.k0s()}}function k(o,p){if(1&o){const e=t.RV6();t.j41(0,"div")(1,"div",24)(2,"app-monaco-editor",27),t.bIt("editorGenerated",function(n){t.eBV(e);const s=t.XpG(2);return t.Njj(s.editorGeneratedBasicInfo(n))}),t.k0s()()()}if(2&o){const e=t.XpG(2);t.R7$(2),t.Y8G("isSchemaEditor",!0)("editorOptions",e.editorOptionsBasicInfo)}}function z(o,p){if(1&o){const e=t.RV6();t.j41(0,"div",28)(1,"button",29),t.bIt("click",function(){t.eBV(e);const n=t.XpG(2);return t.Njj(n.save())}),t.nrm(2,"i",30),t.EFF(3," Add Third Party API Settings "),t.k0s()()}}function w(o,p){1&o&&t.nrm(0,"p-progressSpinner",31)}function K(o,p){if(1&o){const e=t.RV6();t.j41(0,"div",17)(1,"div",18)(2,"p-tabView",19),t.bIt("activeIndexChange",function(n){t.eBV(e);const s=t.XpG();return t.Njj(s.activeIndex=n)})("activeIndexChange",function(){t.eBV(e);const n=t.XpG();return t.Njj(n.tabSelected())}),t.j41(3,"p-tabPanel",20),t.DNE(4,k,3,2,"div",21),t.k0s(),t.j41(5,"p-tabPanel",22),t.DNE(6,z,4,0,"div",23),t.j41(7,"div",24)(8,"app-monaco-editor",25),t.bIt("editorGenerated",function(n){t.eBV(e);const s=t.XpG();return t.Njj(s.editorGenerated(n))}),t.k0s()()()()(),t.DNE(9,w,1,0,"p-progressSpinner",26),t.k0s()}if(2&o){const e=t.XpG();t.R7$(2),t.Y8G("activeIndex",e.activeIndex),t.R7$(2),t.Y8G("ngIf",null==e.data.selectedTreeItem?null:e.data.selectedTreeItem.apiName),t.R7$(2),t.Y8G("ngIf",!e.tpApiSetting._id),t.R7$(2),t.Y8G("hidden",!e.tpApiSetting._id)("isSchemaEditor",!0)("editorOptions",e.editorOptionsTpApiSetting),t.R7$(1),t.Y8G("ngIf",e.loading.form)}}let S=(()=>{class o{groupS;navigationS;ns;authCS;eventCenterS;monacoS;instanceS;constantsS;generalCS;tpApiSettingsS;tpInstalledApisS;notificationS;confirmationService;cd;loading={form:!1};subscriptions=[];data={};EAPIAccessType=E.MW;editorTpApiSettingCode;editorOptionsTpApiSetting={readOnly:!1,language:"typescript",contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"json",contextmenu:!0};monacoDecorations=[];tab;BE_HOST_PORT=y.c.BE_HOST_PORT;tpApiSetting={};saveMode;editorTpApiSettingBasicInfo;editorOptionsBasicInfo={readOnly:!1,language:"typescript",contextmenu:!0};tpInstallApi={};selectedTabTitle="Basic Info";treeItemApiId;activeIndex=0;viewDockerfileModelC;constructor(e,i,n,s,nt,at,ot,st,rt,pt,dt,ct,lt,mt){this.groupS=e,this.navigationS=i,this.ns=n,this.authCS=s,this.eventCenterS=nt,this.monacoS=at,this.instanceS=ot,this.constantsS=st,this.generalCS=rt,this.tpApiSettingsS=pt,this.tpInstalledApisS=dt,this.notificationS=ct,this.confirmationService=lt,this.cd=mt}ngOnInit(){this.monacoS.loadSchemaEditorSettings(this.BE_HOST_PORT,this.authCS.getUserId(),null).then(),this.subscriptions.push(this.eventCenterS.tpApiSettings.apiSelected.subscribe(e=>{e&&(this.saveMode=e.apiName?"TABLE":"COLLECTION",this.setDataInForm(this.data.selectedTreeItem=e),this.cd.detectChanges())}))}editorGenerated(e){var i=this;return(0,r.A)(function*(){i.editorTpApiSettingCode=e,yield i.monacoS.loadSchemaEditorSettings(i.BE_HOST_PORT,i.authCS.getUserId(),null),i.monacoS.addSaveCodeKeyBinding(e,n=>{i.tpApiSetting._id&&i.save()})})()}setDataInForm(e){var i=this;return(0,r.A)(function*(){i.loading.form=!0,i.lastError=void 0;const n=i.authCS.getUserId();if(i.tpApiSetting=(yield i.tpApiSettingsS.getApiSettings(n,e.bundleName,e.apiVersion,e.apiName))||{},e.apiName){i.treeItemApiId=e._id;const s=`${e.guid}:${i.authCS.gUser._id}`;i.tpInstallApi=(yield i.tpInstalledApisS.getById(s).toPromise()).data,i.cd.detectChanges()}i.setDataInFormCommonCode(),i.loading.form=!1})()}setDataInFormCommonCode(){var e=this;return(0,r.A)(function*(){if(e.tpApiSetting._id)e.generalCS.setValueInEditor(e,"editorTpApiSettingCode",e.tpApiSetting.thirdPartyApiSettingsCode);else if(!e.tpApiSetting._id)if("COLLECTION"===e.saveMode){const i=yield e.instanceS.getDefaultContent(e.BE_HOST_PORT,m.O.THIRD_PARTY_API_VERSION_SETTINGS_JSON).toPromise();e.generalCS.setValueInEditor(e,"editorTpApiSettingCode",i.data)}else if("TABLE"===e.saveMode){const i=yield e.instanceS.getDefaultContent(e.BE_HOST_PORT,m.O.THIRD_PARTY_API_SETTINGS_JSON).toPromise();e.generalCS.setValueInEditor(e,"editorTpApiSettingCode",i.data)}e.tpInstallApi?.apiJsonStr&&e.generalCS.setValueInEditor(e,"editorTpApiSettingBasicInfo",e.tpInstallApi?.apiJsonStr),e.cd.detectChanges()})()}save(){var e=this;return(0,r.A)(function*(){if("Basic Info"===e.selectedTabTitle)try{const i={};i.apiJsonStr=e.editorTpApiSettingBasicInfo.getValue(),yield e.tpInstalledApisS.put(e.treeItemApiId,i,{select:l.GX._id}).toPromise(),e.notificationS.showSuccess("Basic Info saved successfully."),e.eventCenterS.filterInLog.refreshGrid.next(Math.random())}catch(i){e.notificationS.showErrorMessageFromErrorObject(i)}else{let i={};const n=e.eventCenterS.tpApiSettings.apiSelected.value;if(!n||!n.bundleName||!n.apiVersion)return;i.bundleName=n.bundleName,i.apiVersion=n.apiVersion,i.apiName=n.apiName||P.bP.__THIRD_PARTY_API_SETTINGS__,i.user=e.authCS.getUserId(),i.thirdPartyApiSettingsCode=e.editorTpApiSettingCode.getValue(),i=Object.assign({},e.tpApiSetting||{},i);try{let s;e.loading.form=!0,e.lastError=void 0,e.monacoS.clearEditorDecorations(e.editorTpApiSettingCode,e.monacoDecorations),e.tpApiSetting._id?e.tpApiSetting._id&&(s=yield e.tpApiSettingsS.replace(e.tpApiSetting._id,i,{select:l.GX._id}).toPromise()):(s=yield e.tpApiSettingsS.post(i).toPromise(),e.tpApiSetting=s.data),e.ns.showSuccess(e.constantsS.tpApiSettings.addOrUpdateSuccess),e.eventCenterS.filterInLog.refreshGrid.next(Math.random()),e.loading.form=!1}catch(s){e.loading.form=!1,e.ns.showErrorFromResponse(s.error||s,"Unable to save third party API."),e.lastError=s.error,e.tab=e.tab||{},e.tab.axiosResponse={data:s.error},e.monacoS.highlightErrorInMonacoEditor(e.editorTpApiSettingCode,e.tab,"MainSandbox.ts",e.monacoDecorations)}}})()}removePermanentDialog(){var e=this;return(0,r.A)(function*(){var i;e.confirmationService.confirm({message:e.constantsS.tpApiSettings.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(i=(0,r.A)(function*(){yield e.removePermanent()}),function(){return i.apply(this,arguments)})})})()}removePermanent(){var e=this;return(0,r.A)(function*(){e.loading.form=!0;const i=yield e.tpApiSettingsS.permanentDelete(e.tpApiSetting._id).toPromise();e.loading.form=!1,i?(e.ns.showSuccess(e.constantsS.tpApiSettings.removePermanent),e.tpApiSetting={},e.cd.detectChanges(),e.eventCenterS.filterInLog.refreshGrid.next(Math.random())):e.ns.showErrorFromResponse(i,e.constantsS.tpApiSettings.removePermanentError)})()}viewError(){this.viewDockerfileModelC.showModal(this.generalCS.stringify(this.lastError),G.L.json)}tabSelected(){0===this.activeIndex?this.selectedTabTitle="Basic Info":1===this.activeIndex&&(this.selectedTabTitle="API Settings")}editorGeneratedBasicInfo(e){var i=this;return(0,r.A)(function*(){i.editorTpApiSettingBasicInfo=e,i.monacoS.addSaveCodeKeyBinding(e,n=>{"Basic Info"===i.selectedTabTitle&&i.save()})})()}ngOnDestroy(){this.generalCS.unsubscribe(this.subscriptions)}static \u0275fac=function(i){return new(i||o)(t.rXU(_.L),t.rXU(O.O),t.rXU(f.m),t.rXU(N.l),t.rXU(j.d),t.rXU(x.e),t.rXU(B.J),t.rXU(D.X),t.rXU(M.f),t.rXU(R.d),t.rXU(F.h),t.rXU(f.m),t.rXU(c.td),t.rXU(t.gRc))};static \u0275cmp=t.VBU({type:o,selectors:[["app-w-tp-api-form"]],viewQuery:function(i,n){if(1&i&&t.GBs(Y,5),2&i){let s;t.mGM(s=t.lsd())&&(n.viewDockerfileModelC=s.first)}},decls:14,vars:7,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],[1,"fas","fa-cog","fa-fw","text-danger","mr-1"],["href","https://docs.apimaker.dev/v1/docs/settings/thirdPartyApiSettings.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"float-right","fa-fw","ml-3","mr-1",2,"font-size","25px"],["class","float-right cursor-pointer ml-3","pTooltip","Save",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Delete API Settings",3,"click",4,"ngIf"],["href","javascript:;","class","text-danger float-right",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["class","position-relative border-top h-100",4,"ngIf"],[3,"modalId","editorOptionsMonacoEditorModal","modalTitle"],["monacoEditorModalC",""],["pTooltip","Save",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-save","fa-fw","text-success"],["pTooltip","Delete API Settings",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],["href","javascript:;",1,"text-danger","float-right",3,"click"],[1,"position-relative","border-top","h-100"],[1,"modal-body","overflow-auto"],[3,"activeIndex","activeIndexChange"],["header","Basic Info"],[4,"ngIf"],["header","API Settings"],["class","p-1 text-center",4,"ngIf"],[1,"overflow-hidden","mb-3",2,"height","calc(100vh - 124px)"],[3,"hidden","isSchemaEditor","editorOptions","editorGenerated"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"isSchemaEditor","editorOptions","editorGenerated"],[1,"p-1","text-center"],["type","button",1,"btn","btn-primary","btn-sm",3,"click"],[1,"fas","fa-plus","text-success","fa-fw","align-middle","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(i,n){1&i&&(t.j41(0,"div",0)(1,"div",1)(2,"span"),t.nrm(3,"i",2),t.EFF(4," Third Party API Settings"),t.k0s(),t.j41(5,"a",3),t.nrm(6,"img",4),t.k0s(),t.DNE(7,$,2,0,"span",5),t.DNE(8,J,2,0,"span",6),t.DNE(9,H,2,0,"a",7),t.k0s(),t.j41(10,"div",8),t.DNE(11,K,10,7,"div",9),t.k0s()(),t.nrm(12,"app-monaco-editor-modal",10,11)),2&i&&(t.R7$(7),t.Y8G("ngIf",n.data.selectedTreeItem&&n.data.selectedTreeItem.bundleName&&n.data.selectedTreeItem.apiVersion&&(null==n.data.selectedTreeItem?null:n.data.selectedTreeItem.apiName)),t.R7$(1),t.Y8G("ngIf","API Settings"===n.selectedTabTitle&&n.data.selectedTreeItem&&n.data.selectedTreeItem.bundleName&&n.data.selectedTreeItem.apiVersion&&n.tpApiSetting._id),t.R7$(1),t.Y8G("ngIf",n.lastError),t.R7$(2),t.Y8G("ngIf",n.data.selectedTreeItem&&n.data.selectedTreeItem.bundleName&&n.data.selectedTreeItem.apiVersion),t.R7$(1),t.Y8G("modalId","idMonacoEditorModalInTpAPISettings")("editorOptionsMonacoEditorModal",n.editorOptionsMonacoEditorModal)("modalTitle","Error info"))},dependencies:[V.bT,X.A,b.p,g.JQ,g.Kp,U.m,L.J],encapsulation:2})}return o})();function Q(o,p){1&o&&t.nrm(0,"app-w-supported-tp-api",3),2&o&&t.Y8G("IsDependentOnGroup",!1)("isLPM",!1)}function W(o,p){1&o&&t.nrm(0,"app-w-tp-api-form",4)}const v=function(){return[40,60]};let u=(()=>{class o{constructor(){}ngOnInit(){}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=t.VBU({type:o,selectors:[["app-tp-api-layout"]],decls:4,vars:4,consts:[[1,"pt-1","pl-1","pr-1"],["styleClass","full-body",3,"panelSizes","minSizes"],["pTemplate",""],[1,"w-100",3,"IsDependentOnGroup","isLPM"],[1,"w-100"]],template:function(i,n){1&i&&(t.j41(0,"div",0)(1,"p-splitter",1),t.DNE(2,Q,1,2,"ng-template",2),t.DNE(3,W,1,0,"ng-template",2),t.k0s()()),2&i&&(t.R7$(1),t.Y8G("panelSizes",t.lJ4(2,v))("minSizes",t.lJ4(3,v)))},dependencies:[c.Ei,A.O,C.e,S],encapsulation:2})}return o})();var Z=a(6415),q=a(863),tt=a(2508);const et=[{path:"tp-layout",component:u,canActivate:[T.Z]}];let it=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=t.$C({type:o});static \u0275inj=t.G2t({imports:[h.iI.forChild(et),I.u,Z.GroupM,q.e,tt.v]})}return o})()}}]);
1
+ "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[4316],{4316:(ft,d,a)=>{a.r(d),a.d(d,{TpApiM:()=>it});var h=a(7060),I=a(1709),T=a(2173),t=a(540),c=a(5779),A=a(572),C=a(3173),r=a(467),E=a(9773),l=a(6645),y=a(5312),m=a(5632),P=a(9561),G=a(9239),_=a(4774),O=a(4752),f=a(6708),N=a(7237),j=a(3966),x=a(3864),B=a(6268),D=a(1987),M=a(6129),R=a(9368),F=a(6170),V=a(177),X=a(6914),b=a(7515),g=a(4945),U=a(8542),L=a(4466);const Y=["monacoEditorModalC"];function $(o,p){if(1&o){const e=t.RV6();t.j41(0,"span",12),t.bIt("click",function(){t.eBV(e);const n=t.XpG();return t.Njj(n.save())}),t.nrm(1,"i",13),t.k0s()}}function J(o,p){if(1&o){const e=t.RV6();t.j41(0,"span",14),t.bIt("click",function(){t.eBV(e);const n=t.XpG();return t.Njj(n.removePermanentDialog())}),t.nrm(1,"i",15),t.k0s()}}function H(o,p){if(1&o){const e=t.RV6();t.j41(0,"a",16),t.bIt("click",function(){t.eBV(e);const n=t.XpG();return t.Njj(n.viewError())}),t.EFF(1,"View error"),t.k0s()}}function k(o,p){if(1&o){const e=t.RV6();t.j41(0,"div")(1,"div",24)(2,"app-monaco-editor",27),t.bIt("editorGenerated",function(n){t.eBV(e);const s=t.XpG(2);return t.Njj(s.editorGeneratedBasicInfo(n))}),t.k0s()()()}if(2&o){const e=t.XpG(2);t.R7$(2),t.Y8G("isSchemaEditor",!0)("editorOptions",e.editorOptionsBasicInfo)}}function z(o,p){if(1&o){const e=t.RV6();t.j41(0,"div",28)(1,"button",29),t.bIt("click",function(){t.eBV(e);const n=t.XpG(2);return t.Njj(n.save())}),t.nrm(2,"i",30),t.EFF(3," Add Third Party API Settings "),t.k0s()()}}function w(o,p){1&o&&t.nrm(0,"p-progressSpinner",31)}function K(o,p){if(1&o){const e=t.RV6();t.j41(0,"div",17)(1,"div",18)(2,"p-tabView",19),t.bIt("activeIndexChange",function(n){t.eBV(e);const s=t.XpG();return t.Njj(s.activeIndex=n)})("activeIndexChange",function(){t.eBV(e);const n=t.XpG();return t.Njj(n.tabSelected())}),t.j41(3,"p-tabPanel",20),t.DNE(4,k,3,2,"div",21),t.k0s(),t.j41(5,"p-tabPanel",22),t.DNE(6,z,4,0,"div",23),t.j41(7,"div",24)(8,"app-monaco-editor",25),t.bIt("editorGenerated",function(n){t.eBV(e);const s=t.XpG();return t.Njj(s.editorGenerated(n))}),t.k0s()()()()(),t.DNE(9,w,1,0,"p-progressSpinner",26),t.k0s()}if(2&o){const e=t.XpG();t.R7$(2),t.Y8G("activeIndex",e.activeIndex),t.R7$(2),t.Y8G("ngIf",null==e.data.selectedTreeItem?null:e.data.selectedTreeItem.apiName),t.R7$(2),t.Y8G("ngIf",!e.tpApiSetting._id),t.R7$(2),t.Y8G("hidden",!e.tpApiSetting._id)("isSchemaEditor",!0)("editorOptions",e.editorOptionsTpApiSetting),t.R7$(1),t.Y8G("ngIf",e.loading.form)}}let S=(()=>{class o{groupS;navigationS;ns;authCS;eventCenterS;monacoS;instanceS;constantsS;generalCS;tpApiSettingsS;tpInstalledApisS;notificationS;confirmationService;cd;loading={form:!1};subscriptions=[];data={};EAPIAccessType=E.MW;editorTpApiSettingCode;editorOptionsTpApiSetting={readOnly:!1,language:"typescript",contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"json",contextmenu:!0};monacoDecorations=[];tab;BE_HOST_PORT=y.c.BE_HOST_PORT;tpApiSetting={};saveMode;editorTpApiSettingBasicInfo;editorOptionsBasicInfo={readOnly:!1,language:"typescript",contextmenu:!0};tpInstallApi={};selectedTabTitle="Basic Info";treeItemApiId;activeIndex=0;viewDockerfileModelC;constructor(e,i,n,s,nt,at,ot,st,rt,pt,dt,ct,lt,mt){this.groupS=e,this.navigationS=i,this.ns=n,this.authCS=s,this.eventCenterS=nt,this.monacoS=at,this.instanceS=ot,this.constantsS=st,this.generalCS=rt,this.tpApiSettingsS=pt,this.tpInstalledApisS=dt,this.notificationS=ct,this.confirmationService=lt,this.cd=mt}ngOnInit(){this.monacoS.loadSchemaEditorSettings(this.BE_HOST_PORT,this.authCS.getUserId(),null).then(),this.subscriptions.push(this.eventCenterS.tpApiSettings.apiSelected.subscribe(e=>{e&&(this.saveMode=e.apiName?"TABLE":"COLLECTION",this.setDataInForm(this.data.selectedTreeItem=e),this.cd.detectChanges())}))}editorGenerated(e){var i=this;return(0,r.A)(function*(){i.editorTpApiSettingCode=e,yield i.monacoS.loadSchemaEditorSettings(i.BE_HOST_PORT,i.authCS.getUserId(),null),i.monacoS.addSaveCodeKeyBinding(e,n=>{i.tpApiSetting._id&&i.save()})})()}setDataInForm(e){var i=this;return(0,r.A)(function*(){i.loading.form=!0,i.lastError=void 0;const n=i.authCS.getUserId();if(i.tpApiSetting=(yield i.tpApiSettingsS.getApiSettings(n,e.bundleName,e.apiVersion,e.apiName))||{},e.apiName){i.treeItemApiId=e._id;const s=`${e.guid}:${i.authCS.gUser._id}`;i.tpInstallApi=(yield i.tpInstalledApisS.getById(s).toPromise()).data,i.cd.detectChanges()}i.setDataInFormCommonCode(),i.loading.form=!1})()}setDataInFormCommonCode(){var e=this;return(0,r.A)(function*(){if(e.tpApiSetting._id)e.generalCS.setValueInEditor(e,"editorTpApiSettingCode",e.tpApiSetting.thirdPartyApiSettingsCode);else if(!e.tpApiSetting._id)if("COLLECTION"===e.saveMode){const i=yield e.instanceS.getDefaultContent(e.BE_HOST_PORT,m.O.THIRD_PARTY_API_VERSION_SETTINGS_JSON).toPromise();e.generalCS.setValueInEditor(e,"editorTpApiSettingCode",i.data)}else if("TABLE"===e.saveMode){const i=yield e.instanceS.getDefaultContent(e.BE_HOST_PORT,m.O.THIRD_PARTY_API_SETTINGS_JSON).toPromise();e.generalCS.setValueInEditor(e,"editorTpApiSettingCode",i.data)}e.tpInstallApi?.apiJsonStr&&e.generalCS.setValueInEditor(e,"editorTpApiSettingBasicInfo",e.tpInstallApi?.apiJsonStr),e.cd.detectChanges()})()}save(){var e=this;return(0,r.A)(function*(){if("Basic Info"===e.selectedTabTitle)try{const i={};i.apiJsonStr=e.editorTpApiSettingBasicInfo.getValue(),yield e.tpInstalledApisS.put(e.treeItemApiId,i,{select:l.GX._id}).toPromise(),e.notificationS.showSuccess("Basic Info saved successfully."),e.eventCenterS.filterInLog.refreshGrid.next(Math.random())}catch(i){e.notificationS.showErrorMessageFromErrorObject(i)}else{let i={};const n=e.eventCenterS.tpApiSettings.apiSelected.value;if(!n||!n.bundleName||!n.apiVersion)return;i.bundleName=n.bundleName,i.apiVersion=n.apiVersion,i.apiName=n.apiName||P.bP.__THIRD_PARTY_API_SETTINGS__,i.user=e.authCS.getUserId(),i.thirdPartyApiSettingsCode=e.editorTpApiSettingCode.getValue(),i=Object.assign({},e.tpApiSetting||{},i);try{let s;e.loading.form=!0,e.lastError=void 0,e.monacoS.clearEditorDecorations(e.editorTpApiSettingCode,e.monacoDecorations),e.tpApiSetting._id?e.tpApiSetting._id&&(s=yield e.tpApiSettingsS.replace(e.tpApiSetting._id,i,{select:l.GX._id}).toPromise()):(s=yield e.tpApiSettingsS.post(i).toPromise(),e.tpApiSetting=s.data),e.ns.showSuccess(e.constantsS.tpApiSettings.addOrUpdateSuccess),e.eventCenterS.filterInLog.refreshGrid.next(Math.random()),e.loading.form=!1}catch(s){e.loading.form=!1,e.ns.showErrorFromResponse(s.error||s,"Unable to save third party API."),e.lastError=s.error,e.tab=e.tab||{},e.tab.axiosResponse={data:s.error},e.monacoS.highlightErrorInMonacoEditor(e.editorTpApiSettingCode,e.tab,"MainSandbox.ts",e.monacoDecorations)}}})()}removePermanentDialog(){var e=this;return(0,r.A)(function*(){var i;e.confirmationService.confirm({message:e.constantsS.tpApiSettings.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(i=(0,r.A)(function*(){yield e.removePermanent()}),function(){return i.apply(this,arguments)})})})()}removePermanent(){var e=this;return(0,r.A)(function*(){e.loading.form=!0;const i=yield e.tpApiSettingsS.permanentDelete(e.tpApiSetting._id).toPromise();e.loading.form=!1,i?(e.ns.showSuccess(e.constantsS.tpApiSettings.removePermanent),e.tpApiSetting={},e.cd.detectChanges(),e.eventCenterS.filterInLog.refreshGrid.next(Math.random())):e.ns.showErrorFromResponse(i,e.constantsS.tpApiSettings.removePermanentError)})()}viewError(){this.viewDockerfileModelC.showModal(this.generalCS.stringify(this.lastError),G.L.json)}tabSelected(){0===this.activeIndex?this.selectedTabTitle="Basic Info":1===this.activeIndex&&(this.selectedTabTitle="API Settings")}editorGeneratedBasicInfo(e){var i=this;return(0,r.A)(function*(){i.editorTpApiSettingBasicInfo=e,i.monacoS.addSaveCodeKeyBinding(e,n=>{"Basic Info"===i.selectedTabTitle&&i.save()})})()}ngOnDestroy(){this.generalCS.unsubscribe(this.subscriptions)}static \u0275fac=function(i){return new(i||o)(t.rXU(_.L),t.rXU(O.O),t.rXU(f.m),t.rXU(N.l),t.rXU(j.d),t.rXU(x.e),t.rXU(B.J),t.rXU(D.X),t.rXU(M.f),t.rXU(R.d),t.rXU(F.h),t.rXU(f.m),t.rXU(c.td),t.rXU(t.gRc))};static \u0275cmp=t.VBU({type:o,selectors:[["app-w-tp-api-form"]],viewQuery:function(i,n){if(1&i&&t.GBs(Y,5),2&i){let s;t.mGM(s=t.lsd())&&(n.viewDockerfileModelC=s.first)}},decls:14,vars:7,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],[1,"fas","fa-cog","fa-fw","text-danger","mr-1"],["href","https://docs.apimaker.dev/v1/docs/settings/thirdPartyApiSettings.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"float-right","fa-fw","ml-3","mr-1",2,"font-size","25px"],["class","float-right cursor-pointer ml-3","pTooltip","Save",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Delete API Settings",3,"click",4,"ngIf"],["href","javascript:;","class","text-danger float-right",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["class","position-relative border-top h-100",4,"ngIf"],[3,"modalId","editorOptionsMonacoEditorModal","modalTitle"],["monacoEditorModalC",""],["pTooltip","Save",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-save","fa-fw","text-success"],["pTooltip","Delete API Settings",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],["href","javascript:;",1,"text-danger","float-right",3,"click"],[1,"position-relative","border-top","h-100"],[1,"modal-body","overflow-auto"],[3,"activeIndex","activeIndexChange"],["header","Basic Info"],[4,"ngIf"],["header","API Settings"],["class","p-1 text-center",4,"ngIf"],[1,"overflow-hidden","mb-3",2,"height","calc(100vh - 124px)"],[3,"hidden","isSchemaEditor","editorOptions","editorGenerated"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"isSchemaEditor","editorOptions","editorGenerated"],[1,"p-1","text-center"],["type","button",1,"btn","btn-primary","btn-sm",3,"click"],[1,"fas","fa-plus","text-success","fa-fw","align-middle","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(i,n){1&i&&(t.j41(0,"div",0)(1,"div",1)(2,"span"),t.nrm(3,"i",2),t.EFF(4," Third Party API Settings"),t.k0s(),t.j41(5,"a",3),t.nrm(6,"img",4),t.k0s(),t.DNE(7,$,2,0,"span",5),t.DNE(8,J,2,0,"span",6),t.DNE(9,H,2,0,"a",7),t.k0s(),t.j41(10,"div",8),t.DNE(11,K,10,7,"div",9),t.k0s()(),t.nrm(12,"app-monaco-editor-modal",10,11)),2&i&&(t.R7$(7),t.Y8G("ngIf",n.data.selectedTreeItem&&n.data.selectedTreeItem.bundleName&&n.data.selectedTreeItem.apiVersion&&(null==n.data.selectedTreeItem?null:n.data.selectedTreeItem.apiName)),t.R7$(1),t.Y8G("ngIf","API Settings"===n.selectedTabTitle&&n.data.selectedTreeItem&&n.data.selectedTreeItem.bundleName&&n.data.selectedTreeItem.apiVersion&&n.tpApiSetting._id),t.R7$(1),t.Y8G("ngIf",n.lastError),t.R7$(2),t.Y8G("ngIf",n.data.selectedTreeItem&&n.data.selectedTreeItem.bundleName&&n.data.selectedTreeItem.apiVersion),t.R7$(1),t.Y8G("modalId","idMonacoEditorModalInTpAPISettings")("editorOptionsMonacoEditorModal",n.editorOptionsMonacoEditorModal)("modalTitle","Error info"))},dependencies:[V.bT,X.A,b.p,g.JQ,g.Kp,U.m,L.J],encapsulation:2})}return o})();function Q(o,p){1&o&&t.nrm(0,"app-w-supported-tp-api",3),2&o&&t.Y8G("IsDependentOnGroup",!1)("isLPM",!1)}function W(o,p){1&o&&t.nrm(0,"app-w-tp-api-form",4)}const v=function(){return[40,60]};let u=(()=>{class o{constructor(){}ngOnInit(){}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=t.VBU({type:o,selectors:[["app-tp-api-layout"]],decls:4,vars:4,consts:[[1,"pt-1","pl-1","pr-1"],["styleClass","full-body",3,"panelSizes","minSizes"],["pTemplate",""],[1,"w-100",3,"IsDependentOnGroup","isLPM"],[1,"w-100"]],template:function(i,n){1&i&&(t.j41(0,"div",0)(1,"p-splitter",1),t.DNE(2,Q,1,2,"ng-template",2),t.DNE(3,W,1,0,"ng-template",2),t.k0s()()),2&i&&(t.R7$(1),t.Y8G("panelSizes",t.lJ4(2,v))("minSizes",t.lJ4(3,v)))},dependencies:[c.Ei,A.O,C.e,S],encapsulation:2})}return o})();var Z=a(6415),q=a(863),tt=a(2508);const et=[{path:"tp-layout",component:u,canActivate:[T.Z]}];let it=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=t.$C({type:o});static \u0275inj=t.G2t({imports:[h.iI.forChild(et),I.u,Z.GroupM,q.e,tt.v]})}return o})()}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[4344],{4339:(_e,G,l)=>{l.d(G,{m:()=>j});var C=l(467),e=l(5046),D=l(6147),P=l(7376),S=l(7326),T=l(6645),n=l(540),y=l(4341),k=l(6129),F=l(3851),w=l(6708),V=l(1987),i=l(7237),X=l(6268),K=l(7337),Y=l(9819),Q=l(6170),J=l(123),N=l(5938),H=l(177),U=l(5779),Z=l(7515),R=l(8150);function W(E,A){if(1&E){const o=n.RV6();n.j41(0,"div",2)(1,"span",3),n.EFF(2,"Database"),n.k0s(),n.j41(3,"p-dropdown",9),n.bIt("onChange",function(p){n.eBV(o);const r=n.XpG(2);return r.tab.database=p.value,n.Njj(r.loadCollections(!0))}),n.k0s()()}if(2&E){const o=n.XpG(2);n.R7$(3),n.Y8G("options",o.tab.allDatabases)("ngModel",o.tab.database)("filter",!0)}}function z(E,A){if(1&E){const o=n.RV6();n.j41(0,"div",2)(1,"span",3),n.EFF(2,"Collections"),n.k0s(),n.j41(3,"p-dropdown",4),n.bIt("onChange",function(p){n.eBV(o);const r=n.XpG(2);return r.tab.collection=p.value,n.Njj(r.loadInstanceAPIs(!0))}),n.k0s()()}if(2&E){const o=n.XpG(2);n.R7$(3),n.Y8G("options",o.tab.allCollections)("ngModel",o.tab.collection)("filter",!0)}}function q(E,A){if(1&E){const o=n.RV6();n.j41(0,"div",1)(1,"div",2)(2,"span",3),n.EFF(3,"Instances"),n.k0s(),n.j41(4,"p-dropdown",4),n.bIt("onChange",function(p){n.eBV(o);const r=n.XpG();return r.tab.instance=p.value,n.Njj(r.loadDatabases(!0))}),n.k0s()(),n.DNE(5,W,4,3,"div",8),n.DNE(6,z,4,3,"div",8),n.k0s()}if(2&E){const o=n.XpG();n.R7$(4),n.Y8G("options",o.tab.allInstances)("ngModel",o.tab.instance)("filter",!0),n.R7$(1),n.Y8G("ngIf",o.tab.apiCategory.id===o.EAPICategory.INSTANCES),n.R7$(1),n.Y8G("ngIf",o.tab.apiCategory.id===o.EAPICategory.INSTANCES)}}function ee(E,A){if(1&E){const o=n.RV6();n.j41(0,"div",2)(1,"span",3),n.EFF(2,"API Versions"),n.k0s(),n.j41(3,"p-dropdown",10),n.bIt("onChange",function(p){n.eBV(o);const r=n.XpG(2);return r.tab.tpStoreApiVersion=p.value,n.Njj(r.loadThirdPartyAPIs(!0))}),n.k0s()()}if(2&E){const o=n.XpG(2);n.R7$(3),n.Y8G("options",o.tab.allStoreApiVersions)("ngModel",o.tab.tpStoreApiVersion)("filter",!0)}}function L(E,A){if(1&E){const o=n.RV6();n.j41(0,"div",1)(1,"div",2)(2,"span",3),n.EFF(3,"API Bundle"),n.k0s(),n.j41(4,"p-dropdown",4),n.bIt("onChange",function(p){n.eBV(o);const r=n.XpG();return r.tab.tpApiBundle=p.value,n.Njj(r.loadStoreApiVersions(!0))}),n.k0s()(),n.DNE(5,ee,4,3,"div",8),n.k0s()}if(2&E){const o=n.XpG();n.R7$(4),n.Y8G("options",o.tab.allApiBundles)("ngModel",o.tab.tpApiBundle)("filter",!0),n.R7$(1),n.Y8G("ngIf",o.tab.apiCategory.id===o.EAPICategory.THIRD_PARTY_APIS)}}function B(E,A){if(1&E&&(n.j41(0,"span",18),n.EFF(1),n.k0s()),2&E){const o=n.XpG(2).$implicit;n.R7$(1),n.SpI(" - ",o.category.toLowerCase(),"")}}function te(E,A){if(1&E&&(n.j41(0,"span",19),n.EFF(1),n.k0s()),2&E){const o=n.XpG(2).$implicit;n.R7$(1),n.SpI(" - ",o.category.toLowerCase(),"")}}function ne(E,A){if(1&E&&(n.j41(0,"div")(1,"span"),n.EFF(2),n.k0s(),n.DNE(3,B,2,1,"span",16),n.DNE(4,te,2,1,"span",17),n.k0s()),2&E){const o=n.XpG().$implicit;n.R7$(2),n.JRh(o.name),n.R7$(1),n.Y8G("ngIf","SCHEMA"===o.category),n.R7$(1),n.Y8G("ngIf","GEN"===o.category)}}function ae(E,A){1&E&&n.DNE(0,ne,5,3,"div",15),2&E&&n.Y8G("ngIf",A.$implicit)}function se(E,A){if(1&E&&(n.j41(0,"span",18),n.EFF(1),n.k0s()),2&E){const o=n.XpG(2).$implicit;n.R7$(1),n.SpI(" - ",o.category.toLowerCase(),"")}}function oe(E,A){if(1&E&&(n.j41(0,"span",19),n.EFF(1),n.k0s()),2&E){const o=n.XpG(2).$implicit;n.R7$(1),n.SpI(" - ",o.category.toLowerCase(),"")}}function ie(E,A){if(1&E&&(n.j41(0,"div")(1,"span"),n.EFF(2),n.k0s(),n.DNE(3,se,2,1,"span",16),n.DNE(4,oe,2,1,"span",17),n.k0s()),2&E){const o=n.XpG().$implicit;n.R7$(2),n.JRh(o.name),n.R7$(1),n.Y8G("ngIf","SCHEMA"===o.category),n.R7$(1),n.Y8G("ngIf","GEN"===o.category)}}function re(E,A){1&E&&n.DNE(0,ie,5,3,"div",15),2&E&&n.Y8G("ngIf",A.$implicit)}function le(E,A){if(1&E){const o=n.RV6();n.j41(0,"div",11)(1,"div",1)(2,"div",12)(3,"span",3),n.EFF(4,"APIs"),n.k0s(),n.j41(5,"p-dropdown",4),n.bIt("onChange",function(p){n.eBV(o);const r=n.XpG();return n.Njj(r.tab.api=p.value)}),n.DNE(6,ae,1,1,"ng-template",13),n.DNE(7,re,1,1,"ng-template",14),n.k0s()()()()}if(2&E){const o=n.XpG();n.R7$(5),n.Y8G("options",o.tab.apiList)("ngModel",o.tab.api)("filter",!0)}}function x(E,A){1&E&&n.nrm(0,"p-progressSpinner",20)}let j=(()=>{class E{fb;generalS;webSocketEventsS;ns;constantsS;authCS;instanceS;navigationCS;tpStoreApiVersionS;tpInstalledApisS;functionS;dataProviderS;cd;EFormMode=e.X;form;subscriptions=[];tab={};apiCategories;loading={dropdown:!0};EAPICategory=D.O;tpAPIVersionMap={};apiCategoriesMap={};dbIdMap={};colIdMap={};tpLibraryMap={};tpPIMap={};constructor(o,t,p,r,d,u,c,v,f,I,h,_,b){this.fb=o,this.generalS=t,this.webSocketEventsS=p,this.ns=r,this.constantsS=d,this.authCS=u,this.instanceS=c,this.navigationCS=v,this.tpStoreApiVersionS=f,this.tpInstalledApisS=I,this.functionS=h,this.dataProviderS=_,this.cd=b}ngOnInit(){this.loadApiCategories().then()}loadApiCategories(){var o=this;return(0,C.A)(function*(){const t=o.dataProviderS.getApiCategoriesForWebSocketAndGroup();o.apiCategories=t.filter(r=>r.id!==D.O.SCHEDULERS&&r.id!==D.O.EVENTS),o.apiCategoriesMap=P.keyBy(o.apiCategories,T.qb.id);const p=o.navigationCS.getQueryParam(S.F.at_category);p&&o.tab&&(o.tab.apiCategory=P.find(o.apiCategories,{id:p})),o.tab.apiCategory||(o.tab.apiCategory=o.apiCategories[0]),yield o.apiCategoryChangedEvent(!1),yield o.categorySelected(!1),o.cd.detectChanges()})()}apiCategoryChangedEvent(o){var t=this;return(0,C.A)(function*(){t.loading.dropdown=!0,t.resetDependentObjects("INSTANCE"),yield t.categorySelected(o),t.tab.apiCategory.id===D.O.INSTANCES?yield t.loadInstances(o):t.tab.apiCategory.id===D.O.THIRD_PARTY_APIS?yield t.loadLibraries(o):t.tab.apiCategory.id===D.O.CUSTOM_APIS?yield t.loadCustomAPIs(o):t.tab.apiCategory.id===D.O.SYSTEM_APIS&&(yield t.loadSystemAPIs(o)),t.loading.dropdown=!1})()}loadInstances(o){var t=this;return(0,C.A)(function*(){t.resetDependentObjects("INSTANCE"),yield t.categorySelected(o),t.loading.dropdown=!0;try{const r={find:{user:t.authCS.getUserId(),active:!0},select:{name:1,active:1,user:1},sort:{name:1}};t.tab.allInstances=(yield t.instanceS.query(r).toPromise()).data||[]}catch(r){t.ns.showErrorMessageFromErrorObject(r),t.tab.allInstances=[]}const p=t.navigationCS.getQueryParam(S.F.at_instance);p&&(t.tab.instance=P.find(t.tab.allInstances,{name:p})),!t.tab.instance&&t.tab.allInstances.length&&(t.tab.instance=t.tab.allInstances[0]),yield t.loadDatabases(o),t.loading.dropdown=!1,t.cd.detectChanges()})()}loadDatabases(o){var t=this;return(0,C.A)(function*(){if(t.loading.dropdown=!0,t.resetDependentObjects("DATABASE"),yield t.setInstanceInURL(o),!t.tab.instance)return t.tab.allDatabases=[],t.tab.allCollections=[],void(t.tab.apiList=[]);try{t.tab.allDatabases=((yield t.instanceS.getDatabases([t.tab.instance]).toPromise()).data||[])[0]||[],t.dbIdMap=P.keyBy(t.tab.allDatabases,T.L3.db)}catch(r){t.ns.showErrorMessageFromErrorObject(r),t.tab.allDatabases=[]}const p=t.navigationCS.getQueryParam(S.F.at_database);p&&(t.tab.database=P.find(t.tab.allDatabases,{db:p})),!t.tab.database&&t.tab.allDatabases.length&&(t.tab.database=t.tab.allDatabases[0]),yield t.loadCollections(o),t.loading.dropdown=!1})()}loadCollections(o){var t=this;return(0,C.A)(function*(){if(t.loading.dropdown=!0,t.resetDependentObjects("COLLECTION"),yield t.setDatabaseInURL(o),!t.tab.instance||!t.tab.database)return t.tab.allCollections=[],void(t.tab.apiList=[]);try{t.tab.allCollections=((yield t.instanceS.getCollections([t.tab.database]).toPromise()).data||[])[0]||[],t.colIdMap=P.keyBy(t.tab.allCollections,T.qb.name)}catch(r){t.ns.showErrorMessageFromErrorObject(r),t.tab.allCollections=[]}const p=t.navigationCS.getQueryParam(S.F.at_collection);t.tab.collection=p?P.find(t.tab.allCollections,{name:p}):t.tab.allCollections[0],yield t.loadInstanceAPIs(o),t.loading.dropdown=!1,t.cd.detectChanges()})()}loadInstanceAPIs(o){var t=this;return(0,C.A)(function*(){if(t.loading.dropdown=!0,yield t.setCollectionInURL(o),!t.tab.instance||!t.tab.database||!t.tab.collection)return t.tab.apiList=[],void(t.loading.dropdown=!1);try{const r=t.tab.collection;r.removeStreamApisInResponse=!0,t.tab.apiList=(yield t.instanceS.instanceAPIList([r])).data||[]}catch(r){t.ns.showErrorMessageFromErrorObject(r),t.tab.apiList=[]}const p=t.navigationCS.getQueryParam(S.F.at_api);yield t.apiCommon(p)})()}loadLibraries(o){var t=this;return(0,C.A)(function*(){t.resetDependentObjects("LIBRARY"),t.loading.dropdown=!0,t.tab.allApiBundles=yield t.tpStoreApiVersionS.getAllAPIBundles(),t.tpLibraryMap=P.keyBy(t.tab.allApiBundles,"value");const p=t.navigationCS.getQueryParam(S.F.at_bundleName);p&&(t.tab.tpApiBundle=P.find(t.tab.allApiBundles,{value:p})),!t.tab.tpApiBundle&&t.tab.allApiBundles.length&&(t.tab.tpApiBundle=t.tab.allApiBundles[0]),yield t.loadStoreApiVersions(o),t.loading.dropdown=!1,t.cd.detectChanges()})()}loadStoreApiVersions(o){var t=this;return(0,C.A)(function*(){if(t.loading.dropdown=!0,t.resetDependentObjects("API_VERSION"),yield t.setLibraryInURL(o),!t.tab.tpApiBundle)return t.tab.allStoreApiVersions=[],void(t.tab.apiList=[]);t.tab.allStoreApiVersions=yield t.tpStoreApiVersionS.getAllStoreApiVersions([t.tab.tpApiBundle.value]);const p=t.navigationCS.getQueryParam(S.F.at_bundleName),r=t.navigationCS.getQueryParam(S.F.at_apiVersion);r&&(t.tab.tpStoreApiVersion=P.find(t.tab.allStoreApiVersions,{apiBundleName:p,storeApiVersion:r})),!t.tab.tpStoreApiVersion&&t.tab.allStoreApiVersions.length&&(t.tab.tpStoreApiVersion=t.tab.allStoreApiVersions[0]),yield t.loadThirdPartyAPIs(o),t.loading.dropdown=!1,t.cd.detectChanges()})()}loadThirdPartyAPIs(o){var t=this;return(0,C.A)(function*(){if(t.loading.dropdown=!0,yield t.setTPApiVersionInURL(o),!t.tab.tpApiBundle||!t.tab.tpStoreApiVersion)return void(t.tab.apiList=[]);t.tab.apiList=(yield t.tpInstalledApisS.getThirdPartyAPIListArray([t.tab.tpStoreApiVersion]).toPromise()).data,t.tpPIMap=P.keyBy(t.tab.apiList,T.GX._id);const p=t.navigationCS.getQueryParam(S.F.at_api);yield t.apiCommon(p)})()}loadCustomAPIs(o){var t=this;return(0,C.A)(function*(){t.loading.dropdown=!0;const p=yield t.functionS.getFunctionsAsAPI().toPromise();p.success&&p.data&&p.data.length&&(t.tab.apiList=p.data||[]);const r=t.navigationCS.getQueryParam(S.F.at_api);yield t.apiCommon(r)})()}loadSystemAPIs(o){var t=this;return(0,C.A)(function*(){t.loading.dropdown=!0;const p=yield t.instanceS.systemAPIList().toPromise();p?.data?.length&&(t.tab.apiList=p.data||[]);const r=t.navigationCS.getQueryParam(S.F.at_api);yield t.apiCommon(r)})()}apiCommon(o){var t=this;return(0,C.A)(function*(){t.loading.dropdown=!0,o?(t.tab.api=P.find(t.tab.apiList,{id:o}),t.tab.api||(t.tab.api=P.find(t.tab.apiList,{name:o}))):t.tab.api=t.tab.apiList[0],yield t.setApiInURL(),t.loading.dropdown=!1})()}categorySelected(o){var t=this;return(0,C.A)(function*(){t.tab.apiCategory&&(yield t.navigationCS.setQueryParam(S.F.at_category,t.tab.apiCategory.id),o&&(yield t.generalS.resetUrlParams([S.F.at_instance,S.F.at_database,S.F.at_collection,S.F.at_bundleName,S.F.at_apiVersion,S.F.at_api])))})()}resetDependentObjects(o){"INSTANCE"===o?(this.tab.allInstances=this.tab.allDatabases=this.tab.allCollections=this.tab.apiList=[],this.tab.instance=this.tab.database=this.tab.collection=this.tab.api=void 0):"DATABASE"===o?(this.tab.allDatabases=this.tab.allCollections=this.tab.apiList=[],this.tab.database=this.tab.collection=this.tab.api=void 0):"COLLECTION"===o?(this.tab.allCollections=this.tab.apiList=[],this.tab.collection=this.tab.api=void 0):"LIBRARY"===o?(this.tab.allApiBundles=this.tab.allStoreApiVersions=this.tab.apiList=[],this.tab.tpApiBundle=this.tab.api=this.tab.tpStoreApiVersion=void 0):"API_VERSION"===o&&(this.tab.allStoreApiVersions=this.tab.apiList=[],this.tab.tpStoreApiVersion=this.tab.api=void 0)}setInstanceInURL(o){var t=this;return(0,C.A)(function*(){t.tab.instance&&t.tab.instance._id&&(yield t.navigationCS.setQueryParam(S.F.at_instance,t.tab.instance._id),o&&(yield t.generalS.resetUrlParams([S.F.at_database,S.F.at_collection,S.F.at_api])))})()}setDatabaseInURL(o){var t=this;return(0,C.A)(function*(){t.tab.database&&t.tab.database._id&&(yield t.navigationCS.setQueryParam(S.F.at_database,t.tab.database._id),o&&(yield t.generalS.resetUrlParams([S.F.at_collection,S.F.at_api])))})()}setCollectionInURL(o){var t=this;return(0,C.A)(function*(){t.tab.collection&&t.tab.collection._id&&(yield t.navigationCS.setQueryParam(S.F.at_collection,t.tab.collection._id),o&&(yield t.generalS.resetUrlParams([S.F.at_api])))})()}setLibraryInURL(o){var t=this;return(0,C.A)(function*(){t.tab.tpApiBundle&&t.tab.tpApiBundle.value&&(yield t.navigationCS.setQueryParam(S.F.at_bundleName,t.tab.tpApiBundle.value),o&&(yield t.generalS.resetUrlParams([S.F.at_apiVersion,S.F.at_api])))})()}setTPApiVersionInURL(o){var t=this;return(0,C.A)(function*(){t.tab.tpStoreApiVersion&&t.tab.tpStoreApiVersion._id&&(yield t.navigationCS.setQueryParam(S.F.at_apiVersion,t.tab.tpStoreApiVersion._id),o&&(yield t.generalS.resetUrlParams([S.F.at_api])))})()}setApiInURL(){var o=this;return(0,C.A)(function*(){o.tab?.api?.id&&(yield o.navigationCS.setQueryParam(S.F.at_api,o.tab.api.id))})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(t){return new(t||E)(n.rXU(y.ok),n.rXU(k.f),n.rXU(F.g),n.rXU(w.m),n.rXU(V.X),n.rXU(i.l),n.rXU(X.J),n.rXU(K.$),n.rXU(Y.V),n.rXU(Q.h),n.rXU(J.a),n.rXU(N.n),n.rXU(n.gRc))};static \u0275cmp=n.VBU({type:E,selectors:[["app-web-socket-events-form-second"]],decls:13,vars:7,consts:[[1,"container","mt-3"],[1,"row"],[1,"col-4"],[1,"small"],["optionLabel","name","filterBy","name","appendTo","body","styleClass","w-100 p-input-filled",3,"options","ngModel","filter","onChange"],["class","row",4,"ngIf"],["class","container mt-3 mb-3",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],["class","col-4",4,"ngIf"],["optionLabel","db","filterBy","db","appendTo","body","styleClass","w-100 p-input-filled",3,"options","ngModel","filter","onChange"],["optionLabel","displayText","filterBy","displayText","appendTo","body","styleClass","w-100 p-input-filled",3,"options","ngModel","filter","onChange"],[1,"container","mt-3","mb-3"],[1,"col-8"],["pTemplate","item"],["pTemplate","selectedItem"],[4,"ngIf"],["class","small text-success italic",4,"ngIf"],["class","small text-info italic",4,"ngIf"],[1,"small","text-success","italic"],[1,"small","text-info","italic"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(t,p){1&t&&(n.j41(0,"div")(1,"div",0)(2,"div",1)(3,"div",2)(4,"span",3),n.EFF(5,"API Category"),n.k0s(),n.j41(6,"p-dropdown",4),n.bIt("onChange",function(d){return p.tab.apiCategory=d.value,p.apiCategoryChangedEvent(!0)}),n.k0s()()()(),n.j41(7,"div",0),n.DNE(8,q,7,5,"div",5),n.k0s(),n.j41(9,"div",0),n.DNE(10,L,6,4,"div",5),n.k0s(),n.DNE(11,le,8,3,"div",6),n.DNE(12,x,1,0,"p-progressSpinner",7),n.k0s()),2&t&&(n.R7$(6),n.Y8G("options",p.apiCategories)("ngModel",p.tab.apiCategory)("filter",!0),n.R7$(2),n.Y8G("ngIf",p.tab.apiCategory.id===p.EAPICategory.INSTANCES),n.R7$(2),n.Y8G("ngIf",p.tab.apiCategory.id===p.EAPICategory.THIRD_PARTY_APIS),n.R7$(1),n.Y8G("ngIf",p.tab.apiCategory.id!==p.EAPICategory.WEB_SOCKET_EVENT),n.R7$(1),n.Y8G("ngIf",p.loading.dropdown))},dependencies:[y.BC,y.vS,H.bT,U.Ei,Z.p,R.ms],encapsulation:2})}return E})()},2199:(_e,G,l)=>{l.d(G,{o:()=>h});var C=l(467),e=l(540),D=l(8727),P=l(5046),s=l(7376),T=l(5632),n=l(7326),y=l(6645),k=l(6589),F=l(6129),w=l(6708),V=l(3851),i=l(7237),X=l(1987),K=l(3966),Y=l(334),Q=l(123),J=l(7337),N=l(5779),H=l(7060),U=l(4341),Z=l(177),R=l(7645),W=l(7515),z=l(8542),q=l(5430),ee=l(8061);const L=["webSocketEventsManFormC"];function B(_,b){if(1&_){const a=e.RV6();e.j41(0,"span",17),e.bIt("click",function(){e.eBV(a);const g=e.XpG(2);return e.Njj(g.navigateToTreeView())}),e.nrm(1,"i",18),e.k0s()}}function te(_,b){if(1&_){const a=e.RV6();e.j41(0,"span",19),e.bIt("click",function(){e.eBV(a);const g=e.XpG(2);return e.Njj(g.edit())}),e.nrm(1,"i",20),e.k0s()}}function ne(_,b){if(1&_){const a=e.RV6();e.j41(0,"span",21),e.bIt("click",function(){e.eBV(a);const g=e.XpG(2);return e.Njj(g.removePermanentDialog())}),e.nrm(1,"i",22),e.k0s()}}function ae(_,b){if(1&_){const a=e.RV6();e.j41(0,"span")(1,"span",12),e.bIt("click",function(){e.eBV(a);const g=e.XpG();return e.Njj(g.add())}),e.nrm(2,"i",13),e.k0s(),e.DNE(3,B,2,0,"span",14),e.DNE(4,te,2,0,"span",15),e.DNE(5,ne,2,0,"span",16),e.k0s()}if(2&_){const a=e.XpG();e.R7$(3),e.Y8G("ngIf",a.rows.length),e.R7$(1),e.Y8G("ngIf",a.selectedRows.length),e.R7$(1),e.Y8G("ngIf",a.selectedRows.length)}}function se(_,b){if(1&_){const a=e.RV6();e.j41(0,"span",23)(1,"label",24)(2,"p-checkbox",25),e.bIt("ngModelChange",function(g){e.eBV(a);const M=e.XpG();return e.Njj(M.eventCenterS.group.apisRegex.allWebSocketEvents=g)}),e.k0s()()()}if(2&_){const a=e.XpG();e.R7$(2),e.Y8G("ngModel",a.eventCenterS.group.apisRegex.allWebSocketEvents)("binary",!0)}}function oe(_,b){if(1&_){const a=e.RV6();e.j41(0,"span",23)(1,"label",24)(2,"p-checkbox",25),e.bIt("ngModelChange",function(g){e.eBV(a);const M=e.XpG();return e.Njj(M.eventCenterS.filterInLog.apisRegex.allWebSocketEvents=g)}),e.k0s()()()}if(2&_){const a=e.XpG();e.R7$(2),e.Y8G("ngModel",a.eventCenterS.filterInLog.apisRegex.allWebSocketEvents)("binary",!0)}}function ie(_,b){if(1&_&&(e.j41(0,"div")(1,"div",26),e.EFF(2),e.k0s()()),2&_){const a=e.XpG();e.R7$(2),e.JRh(a.constantsS.group.allWebSocketEventsPermitted)}}function re(_,b){1&_&&(e.j41(0,"th",36),e.nrm(1,"p-tableHeaderCheckbox"),e.k0s())}function le(_,b){1&_&&e.nrm(0,"th",37)}function x(_,b){1&_&&e.nrm(0,"th",38)}function j(_,b){if(1&_&&(e.j41(0,"tr"),e.DNE(1,re,2,0,"th",32),e.DNE(2,le,1,0,"th",33),e.j41(3,"th",34),e.EFF(4,"API Category"),e.k0s(),e.j41(5,"th"),e.EFF(6,"Name"),e.k0s(),e.DNE(7,x,1,0,"th",35),e.k0s()),2&_){const a=e.XpG(2);e.R7$(1),e.Y8G("ngIf",a.showCheckbox),e.R7$(1),e.Y8G("ngIf",!a.isDependentOnGroup&&!a.isLPM&&!a.isFilterLogTable),e.R7$(5),e.Y8G("ngIf",a.isLPM)}}function E(_,b){if(1&_&&(e.j41(0,"td"),e.nrm(1,"p-tableCheckbox",41),e.k0s()),2&_){const a=e.XpG().$implicit;e.R7$(1),e.Y8G("value",a)("pSelectableRow",a)}}function A(_,b){if(1&_&&(e.j41(0,"td",42)(1,"span"),e.EFF(2),e.k0s()()),2&_){const a=e.XpG().rowIndex;e.R7$(2),e.JRh(a+1)}}function o(_,b){if(1&_&&(e.j41(0,"div")(1,"span"),e.EFF(2),e.k0s(),e.j41(3,"span"),e.EFF(4," \u2192 "),e.k0s(),e.j41(5,"span"),e.EFF(6),e.k0s(),e.j41(7,"span"),e.EFF(8," \u2192 "),e.k0s(),e.j41(9,"span"),e.EFF(10),e.k0s(),e.j41(11,"span"),e.EFF(12," \u2192 "),e.k0s(),e.j41(13,"span"),e.EFF(14),e.k0s()()),2&_){const a=e.XpG().$implicit;e.R7$(2),e.JRh(a.instanceNameUI),e.R7$(4),e.JRh(a.databaseName),e.R7$(4),e.JRh(a.collectionName),e.R7$(4),e.JRh(a.apiNameUI)}}function t(_,b){if(1&_&&(e.j41(0,"div")(1,"span"),e.EFF(2),e.k0s(),e.j41(3,"span"),e.EFF(4," \u2192 "),e.k0s(),e.j41(5,"span"),e.EFF(6),e.k0s(),e.j41(7,"span"),e.EFF(8," \u2192 "),e.k0s(),e.j41(9,"span"),e.EFF(10),e.k0s()()),2&_){const a=e.XpG().$implicit;e.R7$(2),e.JRh(a.apiBundleNameUI),e.R7$(4),e.JRh(a.storeApiVersionUI),e.R7$(4),e.JRh(a.apiNameUI)}}function p(_,b){if(1&_&&(e.j41(0,"div")(1,"span"),e.EFF(2),e.k0s()()),2&_){const a=e.XpG().$implicit;e.R7$(2),e.JRh(a.apiNameUI)}}function r(_,b){if(1&_&&(e.j41(0,"div")(1,"span"),e.EFF(2),e.k0s()()),2&_){const a=e.XpG().$implicit;e.R7$(2),e.JRh(a.apiNameUI)}}function d(_,b){if(1&_&&(e.j41(0,"div")(1,"span"),e.EFF(2),e.k0s()()),2&_){const a=e.XpG().$implicit;e.R7$(2),e.JRh(a.apiNameUI)}}function u(_,b){if(1&_){const a=e.RV6();e.j41(0,"div")(1,"label",43)(2,"p-checkbox",44),e.bIt("ngModelChange",function(){e.eBV(a);const g=e.XpG(2).$implicit,M=e.XpG(2);return e.Njj(M.checkedChangeGridItem(g))})("ngModelChange",function(g){e.eBV(a);const M=e.XpG(2).$implicit;return e.Njj(M.saveResponseInLog=g)}),e.k0s()()()}if(2&_){const a=e.XpG(2).$implicit;e.R7$(2),e.Y8G("ngModel",a.saveResponseInLog)("binary",!0)}}function c(_,b){if(1&_&&(e.j41(0,"td"),e.DNE(1,u,3,2,"div",6),e.k0s()),2&_){const a=e.XpG().$implicit,m=e.XpG(2);e.R7$(1),e.Y8G("ngIf",m.selectedRows.indexOf(a)>=0)}}function v(_,b){if(1&_&&(e.j41(0,"tr",39),e.DNE(1,E,2,2,"td",6),e.DNE(2,A,3,1,"td",40),e.j41(3,"td"),e.EFF(4),e.k0s(),e.j41(5,"td"),e.DNE(6,o,15,4,"div",6),e.DNE(7,t,11,3,"div",6),e.DNE(8,p,3,1,"div",6),e.DNE(9,r,3,1,"div",6),e.DNE(10,d,3,1,"div",6),e.k0s(),e.DNE(11,c,2,1,"td",6),e.k0s()),2&_){const a=b.$implicit,m=e.XpG(2);e.Y8G("pSelectableRow",a),e.R7$(1),e.Y8G("ngIf",m.showCheckbox),e.R7$(1),e.Y8G("ngIf",!m.isDependentOnGroup&&!m.isLPM&&!m.isFilterLogTable),e.R7$(2),e.JRh(a.categoryUI),e.R7$(2),e.Y8G("ngIf",a.apiCategory===m.EAPICategory.INSTANCES),e.R7$(1),e.Y8G("ngIf",a.apiCategory===m.EAPICategory.THIRD_PARTY_APIS),e.R7$(1),e.Y8G("ngIf",a.apiCategory===m.EAPICategory.SYSTEM_APIS),e.R7$(1),e.Y8G("ngIf",a.apiCategory===m.EAPICategory.CUSTOM_APIS),e.R7$(1),e.Y8G("ngIf",a.apiCategory===m.EAPICategory.WEB_SOCKET_EVENT),e.R7$(1),e.Y8G("ngIf",m.isLPM)}}function f(_,b){1&_&&e.nrm(0,"p-progressSpinner",45)}function I(_,b){if(1&_){const a=e.RV6();e.j41(0,"div",27)(1,"p-table",28),e.bIt("selectionChange",function(g){e.eBV(a);const M=e.XpG();return e.Njj(M.selectedRows=g)})("selectionChange",function(){e.eBV(a);const g=e.XpG();return e.Njj(g.webSocketEventSelected())})("dblclick",function(){e.eBV(a);const g=e.XpG();return e.Njj(g.dblClickWebSocketEvent())}),e.DNE(2,j,8,3,"ng-template",29),e.DNE(3,v,12,10,"ng-template",30),e.k0s(),e.DNE(4,f,1,0,"p-progressSpinner",31),e.k0s()}if(2&_){const a=e.XpG();e.R7$(1),e.Y8G("selectionMode","multiple")("metaKeySelection",a.metaKeySelection)("selection",a.selectedRows)("dataKey",a.gridKey)("scrollable",!0)("value",a.rows),e.R7$(3),e.Y8G("ngIf",a.loading.grid)}}let h=(()=>{class _{generalS;notificationS;webSocketEventsS;authCS;constantsS;eventCenterS;cd;eventCenterCS;functionS;navigationCS;confirmationService;router;isReadOnly=!1;showCheckbox=!1;isDependentOnGroup=!1;isLPM=!1;isFilterLogTable=!1;metaKeySelection=!0;loading={grid:!1};subscriptions=[];data={mode:P.X.ADD,eventChannel:new e.bkB,formData:void 0};rows=[];rowsMap={};rowsMapName={};showAll=!1;selectedRows=[];gridKey=y.GX._id;EAPICategory=T.O;ERequestMethod=k.mO;webSocketEventsManFormC;constructor(a,m,g,M,O,ce,de,pe,me,ve,fe,Ee){this.generalS=a,this.notificationS=m,this.webSocketEventsS=g,this.authCS=M,this.constantsS=O,this.eventCenterS=ce,this.cd=de,this.eventCenterCS=pe,this.functionS=me,this.navigationCS=ve,this.confirmationService=fe,this.router=Ee}ngOnInit(){var a=this;this.loadGridData().then(),this.subscriptions.push(this.data.eventChannel.subscribe(m=>{(m.action===D.K.SAVED||m.action===D.K.UPDATED)&&(this.webSocketEventsManFormC.hideModal(),this.loadGridData().then())})),this.isDependentOnGroup&&this.subscriptions.push(this.eventCenterS.group.selectedGroups.subscribe(function(){var m=(0,C.A)(function*(g){g.length&&(yield a.loadGridData())});return function(g){return m.apply(this,arguments)}}())),(this.isFilterLogTable||this.isLPM)&&this.subscriptions.push(this.eventCenterS.filterInLog.refreshGrid.subscribe(m=>{m&&this.loadGridData().then()})),this.generalS.setNewTitle("API Maker - WebSocket Events")}loadGridData(){var a=this;return(0,C.A)(function*(){if(a.isDependentOnGroup&&0===a.eventCenterS.group.selectedGroups.value.length)return void a.resetGridAndUrl();a.loading.grid=!0;const m=yield a.webSocketEventsS.getWSEventKGrid({}).toPromise();m.success?(a.selectedRows=[],a.rows=m.data,a.rowsMap=s.keyBy(a.rows,y.GX._id),a.rowsMapName=s.keyBy(a.rows,y.Wc.id)):a.resetGridAndUrl();const g=a.navigationCS.getQueryParam(n.F.am_ws_event)||(a.isFilterLogTable?a.eventCenterS.filterInLog.webSocketIds.value.join(","):a.eventCenterS.group.webSocketIds.value.join(","));if(g){const M=g.split(","),O=s.intersection(s.keys(a.rowsMap),M),ce=[];for(const de of O)a.rowsMap[de]&&ce.push(a.rowsMap[de]);a.selectedRows=ce,a.eventCenterS.webSocketEvents.selectedWebSocketEvents.next(ce),a.eventCenterS.filterInLog.webSocketIds.next(O)}if(a.isDependentOnGroup&&a.eventCenterS.group.webSocketIds.value.length&&(a.selectedRows=a.generalS.getObjectsFromIdArray(a.eventCenterS.group.webSocketIds.value,a.rowsMap),a.eventCenterS.group.webSocketApis.next(a.selectedRows)),a.isLPM&&a.eventCenterS.group.selectedGroups.value[0]?.queryParams?.webSocketEventNames?.length){const M=a.eventCenterS.group.selectedGroups.value[0];for(const O of M?.queryParams?.webSocketEventNames)a.rowsMapName[O]&&(a.rowsMapName[O].saveResponseInLog=M.webSocketEventsLog?.[O]?.saveResponseInLog||!1);a.setResDataInEventCenter()}setTimeout(()=>{a.loading.grid=!1,a.cd.detectChanges()},100)})()}add(){this.data.formData=void 0,this.data.mode=P.X.ADD,this.data.eventChannel.emit({action:D.K.OPEN_FORM_IN_ADD_MODE}),this.webSocketEventsManFormC.showModal().then()}view(){this.data.formData=this.selectedRows[0],this.data.mode=P.X.VIEW,this.data.eventChannel.emit({action:D.K.OPEN_FORM_IN_VIEW_MODE}),this.webSocketEventsManFormC.showModal().then()}edit(){this.data.formData=this.selectedRows[0],this.data.mode=P.X.EDIT,this.data.eventChannel.emit({action:D.K.OPEN_FORM_IN_EDIT_MODE}),this.webSocketEventsManFormC.showModal()}removePermanentDialog(){var a=this;return(0,C.A)(function*(){var m;a.confirmationService.confirm({message:a.constantsS.webSocketEvents.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(m=(0,C.A)(function*(){yield a.removePermanent()}),function(){return m.apply(this,arguments)})})})()}removePermanent(){var a=this;return(0,C.A)(function*(){a.loading.grid=!0;const m=yield a.webSocketEventsS.permanentDelete(a.selectedRows[0]._id).toPromise();a.loading.grid=!1,m.success?(a.notificationS.showSuccess(a.constantsS.webSocketEvents.removePermanent),a.resetGridAndUrl(),a.loadGridData().then(),a.selectedRows=[]):a.notificationS.showErrorFromResponse(m,a.constantsS.webSocketEvents.removePermanentError)})()}resetGridAndUrl(){this.rows=[],this.selectedRows=[],this.rowsMap={},this.rowsMapName={},this.eventCenterS.webSocketEvents.selectedWebSocketEvents.next([])}dblClickWebSocketEvent(){this.selectedRows.length&&this.edit()}navigateToTreeView(){this.router.navigate(["api-info","web-socket-events","layout-tree"]).then()}resetThisUrl(){var a=this;return(0,C.A)(function*(){a.eventCenterS.webSocketEvents.selectedWebSocketEvents.next([]),yield a.navigationCS.setQueryParam(n.F.am_ws_event,null)})()}setResDataInEventCenter(){this.isDependentOnGroup&&(this.eventCenterS.group.webSocketApis.next(this.selectedRows),this.eventCenterS.group.selectedWebSocket.next(this.selectedRows),this.eventCenterS.group.webSocketIds.next(s.map(this.selectedRows,"_id"))),this.isFilterLogTable&&this.eventCenterS.filterInLog.webSocketApis.next(this.selectedRows)}webSocketEventSelected(){var a=this;return(0,C.A)(function*(){if(a.fillData().then(),a.selectedRows?.[0]){const m=(a.selectedRows[0]?.nameUI||"").split("/");a.generalS.setNewTitle(m[m.length-1],T.O.WEB_SOCKET_EVENT)}})()}fillData(){var a=this;return(0,C.A)(function*(){if(!a.selectedRows.length)return yield a.navigationCS.setQueryParam(n.F.am_ws_event,""),a.eventCenterS.group.webSocketIds.next([]),a.eventCenterS.group.webSocketApis.next([]),a.eventCenterS.filterInLog.webSocketIds.next([]),void a.eventCenterS.filterInLog.webSocketApis.next([]);if(a.isDependentOnGroup||a.isFilterLogTable)a.eventCenterS.group.webSocketIds.next(s.map(a.selectedRows,"_id")),a.eventCenterS.group.webSocketApis.next(a.selectedRows),a.isFilterLogTable&&(a.eventCenterS.filterInLog.webSocketIds.next(s.map(a.selectedRows,"_id")),a.eventCenterS.filterInLog.webSocketApis.next(a.selectedRows));else{const m=(yield a.webSocketEventsS.getById(a.selectedRows[0]._id).toPromise()).data;m._id?(yield a.navigationCS.setQueryParam(n.F.am_ws_event,m._id),a.eventCenterS.webSocketEvents.selectedWebSocketEvents.next([m])):a.resetThisUrl()}})()}checkedChangeGridItem(a){var m=this;setTimeout((0,C.A)(function*(){m.selectedRows.push(a),m.selectedRows=s.uniq(m.selectedRows);for(const g in m.rowsMap){const M=m.rowsMap[g];-1===m.selectedRows.indexOf(M)&&(M.saveResponseInLog=!1)}m.setResDataInEventCenter(),m.cd.detectChanges()}),100)}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(m){return new(m||_)(e.rXU(F.f),e.rXU(w.m),e.rXU(V.g),e.rXU(i.l),e.rXU(X.X),e.rXU(K.d),e.rXU(e.gRc),e.rXU(Y.u),e.rXU(Q.a),e.rXU(J.$),e.rXU(N.td),e.rXU(H.Ix))};static \u0275cmp=e.VBU({type:_,selectors:[["app-web-socket-events-grid"]],viewQuery:function(m,g){if(1&m&&e.GBs(L,5),2&m){let M;e.mGM(M=e.lsd())&&(g.webSocketEventsManFormC=M.first)}},inputs:{isReadOnly:["IsReadOnly","isReadOnly"],showCheckbox:"showCheckbox",isDependentOnGroup:["IsDependentOnGroup","isDependentOnGroup"],isLPM:"isLPM",isFilterLogTable:"isFilterLogTable",metaKeySelection:"metaKeySelection"},decls:16,vars:6,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/web.svg","alt","WebSocket Events",1,"fa-fw","mr-1"],[1,"float-right"],["href","https://docs.apimaker.dev/v1/docs/pages/web-socket-event-page.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"float-right","fa-fw","ml-3","mr-1",2,"font-size","25px"],[4,"ngIf"],["class","float-right cursor-pointer","tooltipPosition","left","pTooltip","All WebSocket Events",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["class","h-100",4,"ngIf"],[3,"data"],["webSocketEventsManFormC",""],["pTooltip","Add New",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],["class","float-right cursor-pointer ml-3",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Permanent Delete",3,"click",4,"ngIf"],[1,"float-right","cursor-pointer","ml-3",3,"click"],["pTooltip","Tree View",1,"fas","fa-sitemap","text-yellow","fa-fw","fa-rotate-270"],["pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["pTooltip","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],["tooltipPosition","left","pTooltip","All WebSocket Events",1,"float-right","cursor-pointer"],[1,"align-middle","mb-0","mt--2px"],[3,"ngModel","binary","ngModelChange"],[1,"p-2","text-center","text-success"],[1,"h-100"],["styleClass","p-datatable-striped ws-events-grid-height","scrollHeight","flex",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],["style","width: 45px;",4,"ngIf"],["style","width: 80px;",4,"ngIf"],[2,"width","200px"],["style","width: 60px;",4,"ngIf"],[2,"width","45px"],[2,"width","80px"],[2,"width","60px"],[3,"pSelectableRow"],["class","text-center",4,"ngIf"],[3,"value","pSelectableRow"],[1,"text-center"],[1,"m-0","vertical-align-sub"],["label","Save Response In Log",3,"ngModel","binary","ngModelChange"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(m,g){1&m&&(e.j41(0,"div",0)(1,"div",1)(2,"span"),e.nrm(3,"img",2),e.EFF(4," WebSocket Events"),e.k0s(),e.j41(5,"div",3)(6,"a",4),e.nrm(7,"img",5),e.k0s()(),e.DNE(8,ae,6,3,"span",6),e.DNE(9,se,3,2,"span",7),e.DNE(10,oe,3,2,"span",7),e.k0s(),e.j41(11,"div",8),e.DNE(12,ie,3,1,"div",6),e.DNE(13,I,5,7,"div",9),e.k0s()(),e.nrm(14,"app-web-socket-events-man-form",10,11)),2&m&&(e.R7$(8),e.Y8G("ngIf",!g.isDependentOnGroup&&!g.isLPM&&!g.isFilterLogTable),e.R7$(1),e.Y8G("ngIf",g.isDependentOnGroup),e.R7$(1),e.Y8G("ngIf",g.isFilterLogTable),e.R7$(2),e.Y8G("ngIf",g.eventCenterS.group.apisRegex.allWebSocketEvents||g.eventCenterS.filterInLog.apisRegex.allWebSocketEvents),e.R7$(1),e.Y8G("ngIf",!(g.eventCenterS.group.apisRegex.allWebSocketEvents||g.eventCenterS.filterInLog.apisRegex.allWebSocketEvents)),e.R7$(1),e.Y8G("data",g.data))},dependencies:[U.BC,U.vS,Z.bT,R.XI,N.Ei,R.d5,R.S9,R.nA,W.p,z.m,q.Sc,ee.Y],styles:[".custom-tab-title[_ngcontent-%COMP%]{padding:.5rem}.min-width[_ngcontent-%COMP%], .none[_ngcontent-%COMP%], .delete[_ngcontent-%COMP%], .post[_ngcontent-%COMP%], .put[_ngcontent-%COMP%], .get[_ngcontent-%COMP%]{width:45px;display:inline-block}.get[_ngcontent-%COMP%]{color:var(--accent-success)}.put[_ngcontent-%COMP%]{color:var(--brand-secondary)}.post[_ngcontent-%COMP%]{color:var(--accent-warning)}.delete[_ngcontent-%COMP%]{color:var(--accent-error)}.none[_ngcontent-%COMP%]{color:var(--accent-success--shade--three)}.width-160[_ngcontent-%COMP%]{width:160px}"]})}return _})()},8061:(_e,G,l)=>{l.d(G,{Y:()=>r});var C=l(467),e=l(4341),D=l(8727),P=l(5046),s=l(6147),S=l(7376),n=l(4388),y=l(7326),k=l(6645),F=l(5312),w=l(8677),V=l(2133),i=l(540),X=l(6129),K=l(3851),Y=l(6708),Q=l(1987),J=l(7237),N=l(3864),H=l(6170),U=l(6268),Z=l(9819),R=l(7337),W=l(177),z=l(3478),q=l(4098),ee=l(6914),L=l(7515),B=l(4945),te=l(8542),ne=l(5430),ae=l(4339);const se=["webSocketEventsFormSecondC"],oe=["insertCodeModalC"];function ie(d,u){1&d&&(i.j41(0,"span"),i.nrm(1,"i",30),i.EFF(2," Add WebSocket Event"),i.k0s())}function re(d,u){1&d&&(i.j41(0,"span"),i.nrm(1,"i",31),i.EFF(2," View WebSocket Event"),i.k0s())}function le(d,u){1&d&&(i.j41(0,"span"),i.nrm(1,"i",32),i.EFF(2," Edit WebSocket Event"),i.k0s())}function x(d,u){1&d&&(i.j41(0,"div",33)(1,"div",34)(2,"span",35),i.EFF(3,"Name"),i.k0s(),i.nrm(4,"input",36),i.k0s()())}function j(d,u){if(1&d){const c=i.RV6();i.j41(0,"div",37)(1,"app-monaco-editor",38),i.bIt("editorGenerated",function(f){i.eBV(c);const I=i.XpG();return i.Njj(I.editorGenerated(f))}),i.k0s()()}if(2&d){const c=i.XpG();i.R7$(1),i.Y8G("isSchemaEditor",!0)("editorOptions",c.editorOptionsSchedulers)}}function E(d,u){1&d&&(i.j41(0,"span"),i.EFF(1,"Save"),i.k0s())}function A(d,u){1&d&&(i.j41(0,"span"),i.EFF(1,"Update"),i.k0s())}function o(d,u){if(1&d){const c=i.RV6();i.j41(0,"button",39),i.bIt("click",function(){i.eBV(c);const f=i.XpG();return i.Njj(f.save())}),i.nrm(1,"i",40),i.DNE(2,E,2,0,"span",4),i.DNE(3,A,2,0,"span",4),i.k0s()}if(2&d){const c=i.XpG();i.R7$(2),i.Y8G("ngIf",c.data.mode===c.EFormMode.ADD),i.R7$(1),i.Y8G("ngIf",c.data.mode===c.EFormMode.EDIT)}}function t(d,u){1&d&&i.nrm(0,"p-progressSpinner",41)}const p=function(d){return{"text-danger font-weight-bold":d}};let r=(()=>{class d{fb;generalCS;webSocketEventsS;ns;constantsS;authCS;monacoS;tpInstalledApisS;instanceS;tpStoreApiVersionS;navigationCS;cd;data;EFormMode=P.X;form;subscriptions=[];loading={form:!1};EAPICategory=s.O;reqActiveIndex=0;tabIndexReq={Basic:0,Code:1,Intervals:2};BE_HOST_PORT=F.c.BE_HOST_PORT;DOCS_HOST_PORT=F.c.DOCS_HOST_PORT;shouldLoadMonacoEditor=!1;editorWSNotifications;editorOptionsSchedulers={readOnly:!1,language:"typescript",contextmenu:!0};wsFormSecondC;insertCodeModalC;constructor(c,v,f,I,h,_,b,a,m,g,M,O){this.fb=c,this.generalCS=v,this.webSocketEventsS=f,this.ns=I,this.constantsS=h,this.authCS=_,this.monacoS=b,this.tpInstalledApisS=a,this.instanceS=m,this.tpStoreApiVersionS=g,this.navigationCS=M,this.cd=O}ngOnInit(){var c=this;this.createForm(),this.subscriptions.push(this.data.eventChannel.subscribe(function(){var v=(0,C.A)(function*(f){if(f)if(c.form.enable(),f.action===D.K.OPEN_FORM_IN_EDIT_MODE){if(!c.data.formData)return;const I=yield c.webSocketEventsS.getById(c.data.formData._id).toPromise();c.form.reset(),yield c.editModelLoadData(I.data),c.form.patchValue(I.data)}else if(f.action===D.K.OPEN_FORM_IN_VIEW_MODE){if(!c.data.formData)return;const I=yield c.webSocketEventsS.getById(c.data.formData._id).toPromise();c.form.reset(),c.form.patchValue(I.data),c.form.disable()}else if(f.action===D.K.OPEN_FORM_IN_ADD_MODE){c.form.reset();const I=yield c.instanceS.getDefaultContent(c.BE_HOST_PORT,s.O.WEB_SOCKET_EVENT_CAN_USER_CONNECT_CODE).toPromise();c.generalCS.setValueInEditor(c,"editorWSNotifications",I.data)}});return function(f){return v.apply(this,arguments)}}()))}createForm(){this.form=this.fb.group({name:[null,[e.k0.required]],runOnNativeProcess:[!1,[]]})}showInsertCodeModel(){this.generalCS.messageReceivedFor=n.r.All,this.insertCodeModalC.showModal(w.Z.WebSocketFormC)}showModal(){var c=this;return(0,C.A)(function*(){c.shouldLoadMonacoEditor=!0,$("#idWebSocketEventsForm").modal("show"),setTimeout((0,C.A)(function*(){yield c.wsFormSecondC.loadApiCategories()}),100)})()}hideModal(){$("#idWebSocketEventsForm").modal("hide")}editModelLoadData(c){var v=this;return(0,C.A)(function*(){if(yield v.wsFormSecondC.categorySelected(!0),v.wsFormSecondC.tab.apiCategory=v.wsFormSecondC.apiCategoriesMap[c.apiCategory],yield v.navigationCS.setQueryParam(y.F.at_category,c.apiCategory),c.apiCategory===s.O.SYSTEM_APIS)yield v.navigationCS.setQueryParam(y.F.at_api,c.systemApiName);else if(c.apiCategory===s.O.CUSTOM_APIS)yield v.navigationCS.setQueryParam(y.F.at_api,c.customApiName);else if(c.apiCategory===s.O.INSTANCES)yield v.navigationCS.setQueryParam(y.F.at_instance,c.instanceName),yield v.navigationCS.setQueryParam(y.F.at_database,c.databaseName),yield v.navigationCS.setQueryParam(y.F.at_collection,c.collectionName),yield v.navigationCS.setQueryParam(y.F.at_api,c.instanceApiName);else if(c.apiCategory===s.O.THIRD_PARTY_APIS){const f=(yield v.tpInstalledApisS.query({find:{bundleName:c.tpInstalledApiBundleName,apiVersion:c.tpInstalledApiVersion,name:c.tpInstalledApiName,user:c.user,active:!0},limit:1}).toPromise())?.data?.[0];if(f){const I=(yield v.tpStoreApiVersionS.query({find:{apiBundleName:f.bundleName,storeApiVersion:f.apiVersion,user:f.user,active:!0},limit:1}).toPromise()).data?.[0];yield v.navigationCS.setQueryParam(y.F.at_bundleName,f.bundleName),yield v.navigationCS.setQueryParam(y.F.at_apiVersion,I.storeApiVersion),yield v.navigationCS.setQueryParam(y.F.at_api,f.name)}}v.generalCS.setValueInEditor(v,"editorWSNotifications",c.canUserConnectViaWSCode||"")})()}save(){var c=this;return(0,C.A)(function*(){try{c.loading.form=!0;const v=c.form.getRawValue();let f;v.user=c.authCS.getUserId(),v.apiCategory=c.wsFormSecondC.tab.apiCategory.id,f=c.data.formData&&c.data.formData._id?(yield c.webSocketEventsS.getById(c.data.formData._id).toPromise()).data:{};const I=S.find(f.versions||[],{isActive:!0});I&&(I.apiCodeStr=c.editorWSNotifications.getValue());const h=Object.assign({},f,v);h.user=c.authCS.getUserId(),h.canUserConnectViaWSCode=c.editorWSNotifications.getValue();for(const b of h?.versions||[])b.version=b.version.toString();if(h.apiCategory===s.O.WEB_SOCKET_EVENT&&!h.name)return c.ns.showError("Please provide websocket events name.");let _;h.apiCategory===s.O.CUSTOM_APIS&&(h.customApiName=c.wsFormSecondC.tab.api.customApiName),h.apiCategory===s.O.SYSTEM_APIS&&(h.systemApiName=c.wsFormSecondC.tab.api.systemApiId),h.apiCategory===s.O.THIRD_PARTY_APIS&&(h.tpInstalledApiBundleName=c.wsFormSecondC.tab.api.bundleName,h.tpInstalledApiVersion=c.wsFormSecondC.tab.api.apiVersion,h.tpInstalledApiName=c.wsFormSecondC.tab.api.name),h.apiCategory===s.O.INSTANCES&&(h.instanceName=c.wsFormSecondC.tab.instance.name,h.databaseName=c.wsFormSecondC.tab.database.db,h.collectionName=c.wsFormSecondC.tab.collection.name,h.instanceApiName=c.wsFormSecondC.tab.api.id),h.apiCategory!==s.O.WEB_SOCKET_EVENT&&delete h.name,c.data.mode===P.X.ADD?_=yield c.webSocketEventsS.post(h).toPromise():c.data.mode===P.X.EDIT&&(_=yield c.webSocketEventsS.put(c.data.formData._id,h,{select:k.GX._id}).toPromise()),_&&(c.ns.showSuccess(c.data.mode===P.X.ADD?c.constantsS.webSocketEvents.addSuccess:c.constantsS.webSocketEvents.editSuccess),c.data.eventChannel.emit({action:c.data.mode===P.X.ADD?D.K.SAVED:D.K.UPDATED})),c.loading.form=!1}catch(v){c.loading.form=!1,c.ns.showErrorFromResponse(v.error||v,"Unable to save websocket event.")}c.cd.detectChanges()})()}editorGenerated(c){var v=this;return(0,C.A)(function*(){v.editorWSNotifications=c,yield v.monacoS.loadSchemaEditorSettings(v.BE_HOST_PORT,v.authCS.getUserId(),null),v.monacoS.addSaveCodeKeyBinding(c,f=>{v.form.valid&&v.save()}),v.monacoS.addInsertCodeKeyBinding(c,f=>{v.generalCS.messageReceivedFor=n.r.All,v.data.mode!==P.X.VIEW&&v.insertCodeModalC.showModal(w.Z.WebSocketFormC)}),v.subscriptions.push(v.generalCS.messageReceived.subscribe(f=>{f.type&&f.type===V.R.TEXT_COPIED&&f.componentName===w.Z.WebSocketFormC&&(v.monacoS.insertAtCursor(c,f.selectedText),v.insertCodeModalC.hideModal())}))})()}ngOnDestroy(){this.generalCS.unsubscribe(this.subscriptions)}ISchedulerProps=k.VC;static \u0275fac=function(v){return new(v||d)(i.rXU(e.ok),i.rXU(X.f),i.rXU(K.g),i.rXU(Y.m),i.rXU(Q.X),i.rXU(J.l),i.rXU(N.e),i.rXU(H.h),i.rXU(U.J),i.rXU(Z.V),i.rXU(R.$),i.rXU(i.gRc))};static \u0275cmp=i.VBU({type:d,selectors:[["app-web-socket-events-man-form"]],viewQuery:function(v,f){if(1&v&&(i.GBs(se,5),i.GBs(oe,5)),2&v){let I;i.mGM(I=i.lsd())&&(f.wsFormSecondC=I.first),i.mGM(I=i.lsd())&&(f.insertCodeModalC=I.first)}},inputs:{data:"data"},decls:34,vars:16,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idWebSocketEventsForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-xl"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],[1,"float-right"],["aria-label","Close","data-dismiss","modal","type","button",1,"close"],["aria-hidden","true"],[1,"fas","fa-window-close"],["pTooltip","Insert Code","sava-no-dbl-click","",1,"cursor-pointer","mr-1",2,"font-size","1.4em",3,"click"],[1,"fas","fa-info-circle","text-info","fa-fw"],[1,"modal-body","overflow-auto"],[1,"w-100",3,"activeIndex","activeIndexChange"],["header","Basic Info"],[1,"container","pt-3",3,"formGroup"],["webSocketEventsFormSecondC",""],["class","form-group row m-0",4,"ngIf"],[1,"form-group","row"],[1,"col-12"],[1,"align-middle","mb-0","ml-3"],["formControlName","runOnNativeProcess","pTooltip","Code will run on actual process and not in sandbox, so be careful with code. You can not use sandbox packages in this mode. You can use all Node.js packages + some packages on which API Maker is dependent on. You can use features of global variable 'g'.","label","Run Code On Native Process",3,"ngClass","binary"],["header","Code"],["class","overflow-hidden mb-3","style","height: calc(100vh - 270px);",4,"ngIf"],[1,"modal-footer"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary"],[1,"fas","fa-times","text-danger","fa-fw"],["class","btn btn-primary btn-sm","sava-no-dbl-click","","type","button",3,"click",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"frameId","modalId","docsHostPort"],["insertCodeModalC",""],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],[1,"far","fa-eye","text-info","fa-fw","mr-1"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],[1,"form-group","row","m-0"],[1,"col-4"],[1,"small"],["formControlName","name","name","name","spellcheck","false","type","text","placeholder","level1/level2/name",1,"form-control","form-control-sm"],[1,"overflow-hidden","mb-3",2,"height","calc(100vh - 270px)"],[3,"isSchemaEditor","editorOptions","editorGenerated"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(v,f){if(1&v&&(i.j41(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),i.DNE(4,ie,3,0,"span",4),i.DNE(5,re,3,0,"span",4),i.DNE(6,le,3,0,"span",4),i.j41(7,"div",5)(8,"button",6)(9,"span",7),i.nrm(10,"i",8),i.k0s()(),i.j41(11,"span",9),i.bIt("click",function(){return f.showInsertCodeModel()}),i.nrm(12,"i",10),i.k0s()()(),i.j41(13,"div",11)(14,"p-tabView",12),i.bIt("activeIndexChange",function(h){return f.reqActiveIndex=h}),i.j41(15,"p-tabPanel",13)(16,"form",14),i.nrm(17,"app-web-socket-events-form-second",null,15),i.DNE(19,x,5,0,"div",16),i.j41(20,"div",17)(21,"div",18)(22,"label",19),i.nrm(23,"p-checkbox",20),i.k0s()()()()(),i.j41(24,"p-tabPanel",21),i.DNE(25,j,2,2,"div",22),i.k0s()()(),i.j41(26,"div",23)(27,"button",24),i.nrm(28,"i",25),i.EFF(29," Close"),i.k0s(),i.DNE(30,o,4,2,"button",26),i.k0s(),i.DNE(31,t,1,0,"p-progressSpinner",27),i.k0s()()(),i.nrm(32,"app-insert-code-modal",28,29)),2&v){const I=i.sdS(18);i.R7$(4),i.Y8G("ngIf",f.data.mode===f.EFormMode.ADD),i.R7$(1),i.Y8G("ngIf",f.data.mode===f.EFormMode.VIEW),i.R7$(1),i.Y8G("ngIf",f.data.mode===f.EFormMode.EDIT),i.R7$(8),i.Y8G("activeIndex",f.reqActiveIndex),i.R7$(2),i.Y8G("formGroup",f.form),i.R7$(3),i.Y8G("ngIf",I.tab.apiCategory.id===f.EAPICategory.WEB_SOCKET_EVENT),i.R7$(4),i.Y8G("ngClass",i.eq3(14,p,!0===f.form.get(f.ISchedulerProps.runOnNativeProcess).value))("binary",!0),i.R7$(2),i.Y8G("ngIf",f.shouldLoadMonacoEditor),i.R7$(5),i.Y8G("ngIf",f.data.mode!==f.EFormMode.VIEW),i.R7$(1),i.Y8G("ngIf",f.loading.form),i.R7$(1),i.Y8G("frameId","idInsertCodeWebSocketFrame")("modalId","idInsertCodeWebSocketModal")("docsHostPort",f.DOCS_HOST_PORT)}},dependencies:[e.qT,e.me,e.BC,e.cb,e.j4,e.JD,W.YU,W.bT,z.U,q.V,ee.A,L.p,B.JQ,B.Kp,te.m,ne.Sc,ae.m],encapsulation:2})}return d})()},4344:(_e,G,l)=>{l.r(G),l.d(G,{WebSocketEventsM:()=>o});var C=l(7060),e=l(1709),D=l(2173),s=(l(4339),l(540)),S=l(2199);let T=(()=>{class t{constructor(){}ngOnInit(){}static \u0275fac=function(d){return new(d||t)};static \u0275cmp=s.VBU({type:t,selectors:[["app-web-socket-events-layout-grid"]],decls:2,vars:1,consts:[[1,"pt-1","pl-1","pr-1"],[3,"showCheckbox"]],template:function(d,u){1&d&&(s.j41(0,"div",0),s.nrm(1,"app-web-socket-events-grid",1),s.k0s()),2&d&&(s.R7$(1),s.Y8G("showCheckbox",!1))},dependencies:[S.o],encapsulation:2})}return t})();var n=l(467),y=l(8727),k=l(5046),F=l(5632),w=l(7326),V=l(6645),i=l(6589),X=l(6129),K=l(6708),Y=l(3851),Q=l(7237),J=l(1987),N=l(3966),H=l(334),U=l(123),Z=l(7337),R=l(5779),W=l(177),z=l(9861),q=l(7515),ee=l(8542),L=l(8061);const B=["webSocketEventsManFormC"];function te(t,p){if(1&t){const r=s.RV6();s.j41(0,"span",19),s.bIt("click",function(){s.eBV(r);const u=s.XpG();return s.Njj(u.edit())}),s.nrm(1,"i",20),s.k0s()}}function ne(t,p){if(1&t){const r=s.RV6();s.j41(0,"span",21),s.bIt("click",function(){s.eBV(r);const u=s.XpG();return s.Njj(u.removePermanentDialog())}),s.nrm(1,"i",22),s.k0s()}}function ae(t,p){if(1&t&&(s.j41(0,"div")(1,"div",23),s.EFF(2),s.k0s()()),2&t){const r=s.XpG();s.R7$(2),s.JRh(r.constantsS.group.allWebSocketEventsPermitted)}}function se(t,p){if(1&t&&(s.j41(0,"div"),s.EFF(1),s.k0s()),2&t){const r=s.XpG().$implicit;s.R7$(1),s.JRh(r.label)}}const oe=function(t,p,r,d){return{get:t,put:p,post:r,delete:d}};function ie(t,p){if(1&t&&(s.j41(0,"div")(1,"span",25),s.EFF(2),s.k0s(),s.j41(3,"span"),s.EFF(4),s.k0s()()),2&t){const r=s.XpG().$implicit,d=s.XpG();s.R7$(1),s.Y8G("ngClass",s.ziG(3,oe,r.data.requestMethod===d.ERequestMethod.GET,r.data.requestMethod===d.ERequestMethod.PUT,r.data.requestMethod===d.ERequestMethod.POST,r.data.requestMethod===d.ERequestMethod.DELETE)),s.R7$(1),s.JRh(r.data.requestMethod),s.R7$(2),s.JRh(r.data.name||r.label)}}function re(t,p){if(1&t){const r=s.RV6();s.j41(0,"div",24),s.bIt("click",function(){const c=s.eBV(r).$implicit,v=s.XpG();return c.children&&(c.isExpanded=!0),s.Njj(v.selectedRows=[c._id])}),s.DNE(1,se,2,1,"div",12),s.DNE(2,ie,5,8,"div",12),s.k0s()}if(2&t){const r=p.$implicit,d=s.XpG();s.R7$(1),s.Y8G("ngIf",(null==r.children?null:r.children.length)||(null==r||null==r.data?null:r.data.apiCategory)!==d.EAPICategory.CUSTOM_APIS),s.R7$(1),s.Y8G("ngIf",!(null!=r.children&&r.children.length)&&(null==r||null==r.data?null:r.data.apiCategory)===d.EAPICategory.CUSTOM_APIS)}}function le(t,p){1&t&&s.nrm(0,"p-progressSpinner",26)}let x=(()=>{class t{generalS;notificationS;webSocketEventsS;authCS;constantsS;eventCenterS;cd;eventCenterCS;functionS;navigationCS;confirmationService;router;isReadOnly=!1;loading={grid:!1};subscriptions=[];data={mode:k.X.ADD,eventChannel:new s.bkB,formData:void 0};rows=[];rowsMap={};rowsMapName={};showAll=!1;selectedRows=[];gridKey=V.GX._id;EAPICategory=F.O;ERequestMethod=i.mO;treeNodes=[];allTreeItemsMap={};leafSelected=!1;webSocketEventsManFormC;constructor(r,d,u,c,v,f,I,h,_,b,a,m){this.generalS=r,this.notificationS=d,this.webSocketEventsS=u,this.authCS=c,this.constantsS=v,this.eventCenterS=f,this.cd=I,this.eventCenterCS=h,this.functionS=_,this.navigationCS=b,this.confirmationService=a,this.router=m}ngOnInit(){this.loadTreeData().then(),this.subscriptions.push(this.data.eventChannel.subscribe(r=>{(r.action===y.K.SAVED||r.action===y.K.UPDATED)&&(this.webSocketEventsManFormC.hideModal(),this.loadTreeData().then())})),this.generalS.setNewTitle("API Maker - WebSocket Events")}add(){this.data.formData=void 0,this.data.mode=k.X.ADD,this.data.eventChannel.emit({action:y.K.OPEN_FORM_IN_ADD_MODE}),this.webSocketEventsManFormC.showModal().then()}edit(){this.selectedRows.length&&(this.data.formData=this.selectedRows[0].data,this.data.mode=k.X.EDIT,this.data.eventChannel.emit({action:y.K.OPEN_FORM_IN_EDIT_MODE}),this.webSocketEventsManFormC.showModal().then())}removePermanentDialog(){var r=this;return(0,n.A)(function*(){var d;r.confirmationService.confirm({message:r.constantsS.webSocketEvents.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(d=(0,n.A)(function*(){yield r.removePermanent()}),function(){return d.apply(this,arguments)})})})()}removePermanent(){var r=this;return(0,n.A)(function*(){r.loading.grid=!0;const d=r.selectedRows[0].data,u=yield r.webSocketEventsS.permanentDelete(d._id).toPromise();r.loading.grid=!1,u.success?(r.notificationS.showSuccess(r.constantsS.webSocketEvents.removePermanent),r.resetGridAndUrl(),r.loadTreeData().then(),r.selectedRows=[]):r.notificationS.showErrorFromResponse(u,r.constantsS.webSocketEvents.removePermanentError)})()}resetGridAndUrl(){this.rows=[],this.selectedRows=[],this.rowsMap={},this.rowsMapName={},this.eventCenterS.webSocketEvents.selectedWebSocketEvents.next([])}navigateToGrid(){var r=this;return(0,n.A)(function*(){r.router.navigate(["api-info","web-socket-events","layout-grid"]).then()})()}loadTreeData(){var r=this;return(0,n.A)(function*(){const d=(yield r.functionS.getWSEventKTree().toPromise()).data;for(const c of d)r.generalS.convertKTreeItemToPrimeNGTreeItem(c);const u={};r.generalS.getMapOfAllItems(u,d),r.generalS.setIsExpandedStateFromOldMap(r.allTreeItemsMap,u),r.treeNodes=d,r.allTreeItemsMap=u,r.loading.grid=!1,r.cd.detectChanges()})()}resetThisUrl(){var r=this;return(0,n.A)(function*(){r.eventCenterS.webSocketEvents.selectedWebSocketEvents.next([]),yield r.navigationCS.setQueryParam(w.F.am_ws_event,null)})()}selectedKeysChange(){var r=this;return(0,n.A)(function*(){if(r.selectedRows.length){const d=r.selectedRows[0];d.children?.length?r.leafSelected=!1:(r.leafSelected=!0,d&&d?.label?r.generalS.setNewTitle(d.label,F.O.WEB_SOCKET_EVENT):r.generalS.setNewTitle("API Maker - WebSocket Events"),yield r.resetThisUrl())}else r.leafSelected=!1})()}dblClickTreeEvent(){this.leafSelected&&this.selectedRows.length&&this.edit()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(d){return new(d||t)(s.rXU(X.f),s.rXU(K.m),s.rXU(Y.g),s.rXU(Q.l),s.rXU(J.X),s.rXU(N.d),s.rXU(s.gRc),s.rXU(H.u),s.rXU(U.a),s.rXU(Z.$),s.rXU(R.td),s.rXU(C.Ix))};static \u0275cmp=s.VBU({type:t,selectors:[["app-web-socket-events-tree"]],viewQuery:function(d,u){if(1&d&&s.GBs(B,5),2&d){let c;s.mGM(c=s.lsd())&&(u.webSocketEventsManFormC=c.first)}},inputs:{isReadOnly:["IsReadOnly","isReadOnly"]},decls:22,vars:7,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/web.svg","alt","WebSocket Events",1,"fa-fw","mr-1"],["href","https://docs.apimaker.dev/v1/docs/pages/web-socket-event-page.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"float-right","fa-fw","ml-3","mr-1",2,"font-size","25px"],["pTooltip","Add New",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],[1,"float-right","cursor-pointer","ml-3",3,"click"],["pTooltip","Grid View",1,"fas","fa-table","text-yellow","fa-fw"],["class","float-right cursor-pointer ml-3","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Permanent Delete",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],[4,"ngIf"],[1,"h-100"],["scrollHeight","flex","selectionMode","multiple",1,"w-full",3,"value","selection","selectionChange","dblclick"],["pTemplate","default"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"data"],["webSocketEventsManFormC",""],["pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["pTooltip","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],[1,"p-2","text-center","text-success"],[1,"w-100","prevent-text-selection","cursor-pointer",3,"click"],[1,"small","font-weight-bold","d-inline-block","mr-2",3,"ngClass"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(d,u){1&d&&(s.j41(0,"div",0)(1,"div",1)(2,"span"),s.nrm(3,"img",2),s.EFF(4," WebSocket Events"),s.k0s(),s.j41(5,"span")(6,"a",3),s.nrm(7,"img",4),s.k0s(),s.j41(8,"span",5),s.bIt("click",function(){return u.add()}),s.nrm(9,"i",6),s.k0s(),s.j41(10,"span",7),s.bIt("click",function(){return u.navigateToGrid()}),s.nrm(11,"i",8),s.k0s(),s.DNE(12,te,2,0,"span",9),s.DNE(13,ne,2,0,"span",10),s.k0s()(),s.j41(14,"div",11),s.DNE(15,ae,3,1,"div",12),s.j41(16,"div",13)(17,"p-tree",14),s.bIt("selectionChange",function(v){return u.selectedRows=v})("dblclick",function(){return u.dblClickTreeEvent()})("selectionChange",function(){return u.selectedKeysChange()}),s.DNE(18,re,3,2,"ng-template",15),s.k0s(),s.DNE(19,le,1,0,"p-progressSpinner",16),s.k0s()()(),s.nrm(20,"app-web-socket-events-man-form",17,18)),2&d&&(s.R7$(12),s.Y8G("ngIf",u.leafSelected),s.R7$(1),s.Y8G("ngIf",u.leafSelected),s.R7$(2),s.Y8G("ngIf",u.eventCenterS.group.apisRegex.allWebSocketEvents||u.eventCenterS.filterInLog.apisRegex.allWebSocketEvents),s.R7$(2),s.Y8G("value",u.treeNodes)("selection",u.selectedRows),s.R7$(2),s.Y8G("ngIf",u.loading.grid),s.R7$(1),s.Y8G("data",u.data))},dependencies:[W.YU,W.bT,R.Ei,z.PH,q.p,ee.m,L.Y],styles:[".custom-tab-title[_ngcontent-%COMP%]{padding:.5rem}.min-width[_ngcontent-%COMP%], .none[_ngcontent-%COMP%], .delete[_ngcontent-%COMP%], .post[_ngcontent-%COMP%], .put[_ngcontent-%COMP%], .get[_ngcontent-%COMP%]{width:45px;display:inline-block}.get[_ngcontent-%COMP%]{color:var(--accent-success)}.put[_ngcontent-%COMP%]{color:var(--brand-secondary)}.post[_ngcontent-%COMP%]{color:var(--accent-warning)}.delete[_ngcontent-%COMP%]{color:var(--accent-error)}.none[_ngcontent-%COMP%]{color:var(--accent-success--shade--three)}.width-160[_ngcontent-%COMP%]{width:160px}"]})}return t})();const E=[{path:"",redirectTo:"layout-tree",pathMatch:"full"},{path:"layout-tree",component:(()=>{class t{constructor(){}ngOnInit(){}static \u0275fac=function(d){return new(d||t)};static \u0275cmp=s.VBU({type:t,selectors:[["app-web-socket-events-layout-tree"]],decls:2,vars:0,consts:[[1,"pt-1","pl-1","pr-1"]],template:function(d,u){1&d&&(s.j41(0,"div",0),s.nrm(1,"app-web-socket-events-tree"),s.k0s())},dependencies:[x],encapsulation:2})}return t})(),canActivate:[D.Z]},{path:"layout-grid",component:T,canActivate:[D.Z]}];let o=(()=>{class t{static \u0275fac=function(d){return new(d||t)};static \u0275mod=s.$C({type:t});static \u0275inj=s.G2t({imports:[C.iI.forChild(E),e.u]})}return t})()}}]);