@sava-info-systems/api-maker-with-extensions 1.6.0 → 1.7.0

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 (162) hide show
  1. package/README.md +1 -1
  2. package/dist/1025.js +1 -1
  3. package/dist/148.js +1 -1
  4. package/dist/1558.js +1 -1
  5. package/dist/1678.js +1 -1
  6. package/dist/2295.js +1 -1
  7. package/dist/2443.js +1 -1
  8. package/dist/2473.js +1 -1
  9. package/dist/2714.js +1 -1
  10. package/dist/3139.js +1 -1
  11. package/dist/4181.js +1 -1
  12. package/dist/4186.js +1 -1
  13. package/dist/4211.js +1 -1
  14. package/dist/485.js +1 -1
  15. package/dist/4895.js +1 -1
  16. package/dist/5334.js +1 -1
  17. package/dist/5421.js +1 -1
  18. package/dist/5679.js +1 -1
  19. package/dist/5765.js +1 -0
  20. package/dist/6236.js +1 -1
  21. package/dist/6393.js +1 -1
  22. package/dist/6401.js +1 -1
  23. package/dist/6855.js +1 -0
  24. package/dist/7436.js +1 -1
  25. package/dist/7470.js +1 -1
  26. package/dist/7987.js +1 -1
  27. package/dist/8125.js +1 -1
  28. package/dist/8266.js +1 -1
  29. package/dist/8296.js +1 -1
  30. package/dist/885.js +1 -1
  31. package/dist/9243.js +1 -1
  32. package/dist/assets/images/icons/api-group.svg +10 -9
  33. package/dist/assets/images/icons/api-user.svg +9 -6
  34. package/dist/assets/images/icons/comparator.svg +13 -4
  35. package/dist/assets/images/icons/custom.svg +5 -8
  36. package/dist/assets/images/icons/database.svg +28 -11
  37. package/dist/assets/images/icons/db-m.svg +9 -27
  38. package/dist/assets/images/icons/dev.svg +10 -6
  39. package/dist/assets/images/icons/diagram.svg +27 -6
  40. package/dist/assets/images/icons/event.svg +16 -0
  41. package/dist/assets/images/icons/film-movies-icon.svg +3 -13
  42. package/dist/assets/images/icons/finder.svg +9 -6
  43. package/dist/assets/images/icons/i18n.svg +10 -8
  44. package/dist/assets/images/icons/increment.svg +4 -3
  45. package/dist/assets/images/icons/license.svg +6 -0
  46. package/dist/assets/images/icons/log-profile.svg +20 -6
  47. package/dist/assets/images/icons/log.svg +14 -6
  48. package/dist/assets/images/icons/masters.svg +14 -0
  49. package/dist/assets/images/icons/nodes.svg +4 -2
  50. package/dist/assets/images/icons/notes.svg +11 -18
  51. package/dist/assets/images/icons/process_initializers.svg +19 -12
  52. package/dist/assets/images/icons/redis.svg +17 -6
  53. package/dist/assets/images/icons/sandbox.svg +10 -3
  54. package/dist/assets/images/icons/schedulers.svg +7 -11
  55. package/dist/assets/images/icons/secret.svg +12 -6
  56. package/dist/assets/images/icons/systems.svg +7 -8
  57. package/dist/assets/images/icons/testing.svg +11 -3
  58. package/dist/assets/images/icons/third-party.svg +16 -6
  59. package/dist/assets/images/icons/typescript.svg +7 -6
  60. package/dist/assets/images/icons/ui-maker.svg +11 -0
  61. package/dist/assets/images/icons/utility.svg +18 -6
  62. package/dist/assets/images/icons/vulnerability.svg +19 -11
  63. package/dist/assets/images/icons/web.svg +3 -9
  64. package/dist/assets/schema-types/InterfaceProps.ts +8 -0
  65. package/dist/assets/schema-types/types.ts +1358 -140
  66. package/dist/assets/styles/out/styles.css +1 -1
  67. package/dist/assets/styles/out/styles.css.map +1 -1
  68. package/dist/assets/styles/styles.scss +2 -2
  69. package/dist/common.js +1 -1
  70. package/dist/main.js +1 -1
  71. package/dist/primeicons.eot +0 -0
  72. package/dist/primeicons.svg +62 -9
  73. package/dist/primeicons.ttf +0 -0
  74. package/dist/primeicons.woff +0 -0
  75. package/dist/primeicons.woff2 +0 -0
  76. package/dist/styles.css +1 -1
  77. package/license.txt +2 -1
  78. package/main.js +1 -1
  79. package/package.json +5 -4
  80. package/sandbox/assets/schema-types/types.js +179 -9
  81. package/sandbox/package.json +1 -0
  82. package/sandbox/sandbox.js +1 -1
  83. package/src/assets/schema-types/types.ts +1358 -140
  84. package/src/public/dist-db-masters/3rdpartylicenses.txt +1 -1
  85. package/src/public/dist-db-masters/browser/assets/data/mime_types.json +819 -0
  86. package/src/public/dist-db-masters/browser/assets/iframe_test.html +34 -1
  87. package/src/public/dist-db-masters/browser/assets/themes/arya-blue/theme.css +117 -5
  88. package/src/public/dist-db-masters/browser/assets/themes/arya-green/theme.css +117 -5
  89. package/src/public/dist-db-masters/browser/assets/themes/arya-orange/theme.css +117 -5
  90. package/src/public/dist-db-masters/browser/assets/themes/arya-purple/theme.css +117 -5
  91. package/src/public/dist-db-masters/browser/assets/themes/aura-dark-amber/theme.css +174 -2
  92. package/src/public/dist-db-masters/browser/assets/themes/aura-dark-blue/theme.css +174 -2
  93. package/src/public/dist-db-masters/browser/assets/themes/aura-dark-cyan/theme.css +174 -2
  94. package/src/public/dist-db-masters/browser/assets/themes/aura-dark-green/theme.css +174 -2
  95. package/src/public/dist-db-masters/browser/assets/themes/aura-dark-indigo/theme.css +174 -2
  96. package/src/public/dist-db-masters/browser/assets/themes/aura-dark-lime/theme.css +174 -2
  97. package/src/public/dist-db-masters/browser/assets/themes/aura-dark-noir/theme.css +174 -2
  98. package/src/public/dist-db-masters/browser/assets/themes/aura-dark-pink/theme.css +174 -2
  99. package/src/public/dist-db-masters/browser/assets/themes/aura-dark-purple/theme.css +174 -2
  100. package/src/public/dist-db-masters/browser/assets/themes/aura-dark-teal/theme.css +174 -2
  101. package/src/public/dist-db-masters/browser/assets/themes/aura-light-amber/theme.css +174 -2
  102. package/src/public/dist-db-masters/browser/assets/themes/aura-light-blue/theme.css +174 -2
  103. package/src/public/dist-db-masters/browser/assets/themes/aura-light-cyan/theme.css +174 -2
  104. package/src/public/dist-db-masters/browser/assets/themes/aura-light-green/theme.css +174 -2
  105. package/src/public/dist-db-masters/browser/assets/themes/aura-light-indigo/theme.css +174 -2
  106. package/src/public/dist-db-masters/browser/assets/themes/aura-light-lime/theme.css +174 -2
  107. package/src/public/dist-db-masters/browser/assets/themes/aura-light-noir/theme.css +174 -2
  108. package/src/public/dist-db-masters/browser/assets/themes/aura-light-pink/theme.css +174 -2
  109. package/src/public/dist-db-masters/browser/assets/themes/aura-light-purple/theme.css +174 -2
  110. package/src/public/dist-db-masters/browser/assets/themes/aura-light-teal/theme.css +174 -2
  111. package/src/public/dist-db-masters/browser/assets/themes/bootstrap4-dark-blue/theme.css +166 -5
  112. package/src/public/dist-db-masters/browser/assets/themes/bootstrap4-dark-purple/theme.css +166 -5
  113. package/src/public/dist-db-masters/browser/assets/themes/bootstrap4-light-blue/theme.css +166 -5
  114. package/src/public/dist-db-masters/browser/assets/themes/bootstrap4-light-purple/theme.css +166 -5
  115. package/src/public/dist-db-masters/browser/assets/themes/fluent-light/theme.css +117 -5
  116. package/src/public/dist-db-masters/browser/assets/themes/lara-dark-blue/theme.css +173 -1
  117. package/src/public/dist-db-masters/browser/assets/themes/lara-dark-indigo/theme.css +173 -1
  118. package/src/public/dist-db-masters/browser/assets/themes/lara-dark-purple/theme.css +173 -1
  119. package/src/public/dist-db-masters/browser/assets/themes/lara-dark-teal/theme.css +173 -1
  120. package/src/public/dist-db-masters/browser/assets/themes/lara-light-blue/theme.css +222 -1
  121. package/src/public/dist-db-masters/browser/assets/themes/lara-light-indigo/theme.css +222 -1
  122. package/src/public/dist-db-masters/browser/assets/themes/lara-light-purple/theme.css +222 -1
  123. package/src/public/dist-db-masters/browser/assets/themes/lara-light-teal/theme.css +222 -1
  124. package/src/public/dist-db-masters/browser/assets/themes/luna-amber/theme.css +117 -5
  125. package/src/public/dist-db-masters/browser/assets/themes/luna-blue/theme.css +117 -5
  126. package/src/public/dist-db-masters/browser/assets/themes/luna-green/theme.css +117 -5
  127. package/src/public/dist-db-masters/browser/assets/themes/luna-pink/theme.css +117 -5
  128. package/src/public/dist-db-masters/browser/assets/themes/md-dark-deeppurple/theme.css +187 -4
  129. package/src/public/dist-db-masters/browser/assets/themes/md-dark-indigo/theme.css +187 -4
  130. package/src/public/dist-db-masters/browser/assets/themes/md-light-deeppurple/theme.css +187 -4
  131. package/src/public/dist-db-masters/browser/assets/themes/md-light-indigo/theme.css +187 -4
  132. package/src/public/dist-db-masters/browser/assets/themes/mdc-dark-deeppurple/theme.css +187 -4
  133. package/src/public/dist-db-masters/browser/assets/themes/mdc-dark-indigo/theme.css +187 -4
  134. package/src/public/dist-db-masters/browser/assets/themes/mdc-light-deeppurple/theme.css +187 -4
  135. package/src/public/dist-db-masters/browser/assets/themes/mdc-light-indigo/theme.css +187 -4
  136. package/src/public/dist-db-masters/browser/assets/themes/mira/theme.css +117 -5
  137. package/src/public/dist-db-masters/browser/assets/themes/nano/theme.css +117 -5
  138. package/src/public/dist-db-masters/browser/assets/themes/nova/theme.css +117 -5
  139. package/src/public/dist-db-masters/browser/assets/themes/nova-accent/theme.css +117 -5
  140. package/src/public/dist-db-masters/browser/assets/themes/nova-alt/theme.css +117 -5
  141. package/src/public/dist-db-masters/browser/assets/themes/rhea/theme.css +117 -5
  142. package/src/public/dist-db-masters/browser/assets/themes/saga-blue/theme.css +117 -5
  143. package/src/public/dist-db-masters/browser/assets/themes/saga-green/theme.css +117 -5
  144. package/src/public/dist-db-masters/browser/assets/themes/saga-orange/theme.css +117 -5
  145. package/src/public/dist-db-masters/browser/assets/themes/saga-purple/theme.css +117 -5
  146. package/src/public/dist-db-masters/browser/assets/themes/soho-dark/theme.css +117 -5
  147. package/src/public/dist-db-masters/browser/assets/themes/soho-light/theme.css +117 -5
  148. package/src/public/dist-db-masters/browser/assets/themes/tailwind-light/theme.css +117 -5
  149. package/src/public/dist-db-masters/browser/assets/themes/vela-blue/theme.css +117 -5
  150. package/src/public/dist-db-masters/browser/assets/themes/vela-green/theme.css +117 -5
  151. package/src/public/dist-db-masters/browser/assets/themes/vela-orange/theme.css +117 -5
  152. package/src/public/dist-db-masters/browser/assets/themes/vela-purple/theme.css +117 -5
  153. package/src/public/dist-db-masters/browser/assets/themes/viva-dark/theme.css +117 -5
  154. package/src/public/dist-db-masters/browser/assets/themes/viva-light/theme.css +117 -5
  155. package/src/public/dist-db-masters/browser/index.html +2 -0
  156. package/src/public/dist-db-masters/browser/main.js +58 -62
  157. package/src/public/dist-db-masters/browser/polyfills.js +2 -2
  158. package/dist/1840.js +0 -1
  159. package/dist/9208.js +0 -1
  160. package/dist/assets/images/icons/event.png +0 -0
  161. package/dist/assets/images/icons/license.png +0 -0
  162. package/dist/assets/images/icons/masters.png +0 -0
package/dist/6401.js CHANGED
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[6401],{6401:($e,F,i)=>{i.r(F),i.d(F,{GroupM:()=>Ve});var q=i(7664),B=i(8176),K=i(3726),L=i(1025),Z=i(5085),e=i(4946),I=i(2915),w=i(5219),H=i(5043),V=i(3885),j=i(559),z=i(6937),X=i(740),ee=i(7595),te=i(9329),ne=i(356),se=i(3824),ae=i(8651),oe=i(2726),d=i(5861),C=i(3157),y=i(328),g=i(6212),c=i(6990),m=i(1162),R=i(8883),D=i(3429),ie=i(7629),re=i(2559),le=i(262),A=i(7240),E=i(9961),O=i(2189),N=i(5852),P=i(7414),pe=i(3065),M=i(6814),U=i(5431),T=i(7680),J=i(3259),h=i(95),ce=i(2660);function de(o,l){1&o&&(e.TgZ(0,"span"),e._UZ(1,"i",19),e._uU(2," Add Group"),e.qZA())}function ue(o,l){1&o&&(e.TgZ(0,"span"),e._UZ(1,"i",20),e._uU(2," View Group"),e.qZA())}function ge(o,l){1&o&&(e.TgZ(0,"span"),e._UZ(1,"i",21),e._uU(2," Edit Group"),e.qZA())}function me(o,l){1&o&&(e.TgZ(0,"span"),e._uU(1,"Save Group"),e.qZA())}function he(o,l){1&o&&(e.TgZ(0,"span"),e._uU(1,"Update Group"),e.qZA())}function fe(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"button",22),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.save())}),e._UZ(1,"i",23),e.YNc(2,me,2,0,"span",4),e.YNc(3,he,2,0,"span",4),e.qZA()}if(2&o){const t=e.oxw();e.Q6J("disabled",t.form.invalid),e.xp6(2),e.Q6J("ngIf",t.data.mode===t.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT)}}function ve(o,l){1&o&&e._UZ(0,"p-progressSpinner",24)}let k=(()=>{class o{fb;ns;groupS;generalS;authCS;constantsS;data;loading={form:!1};EFormMode=y.D;form;subscriptions=[];constructor(t,s,n,a,r,u){this.fb=t,this.ns=s,this.groupS=n,this.generalS=a,this.authCS=r,this.constantsS=u}ngOnInit(){var t=this;this.createForm(),this.subscriptions.push(this.data.eventChannel.subscribe(function(){var s=(0,d.Z)(function*(n){if(n)if(t.form.enable(),n.action===C.F.OPEN_FORM_IN_EDIT_MODE){const a=yield t.groupS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(a.data)}else if(n.action===C.F.OPEN_FORM_IN_VIEW_MODE){const a=yield t.groupS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(a.data),t.form.disable()}else n.action===C.F.OPEN_FORM_IN_ADD_MODE&&t.form.reset()});return function(n){return s.apply(this,arguments)}}()))}createForm(){this.form=this.fb.group({name:[null,[h.kI.required]]})}showModal(){$("#idGroupsForm").modal("show")}hideModal(){$("#idGroupsForm").modal("hide")}save(){var t=this;return(0,d.Z)(function*(){const s=t.form.getRawValue();let n;n=t.data.formData&&t.data.formData._id?(yield t.groupS.getById(t.data.formData._id).toPromise()).data:{};const a=Object.assign({},n,s);a.user=t.authCS.getUserId();try{let r;t.loading.form=!0,t.data.mode===y.D.ADD?r=yield t.groupS.post(a).toPromise():t.data.mode===y.D.EDIT&&(r=yield t.groupS.put(t.data.formData._id,a,{select:m.iH._id}).toPromise()),t.ns.showSuccess(t.data.mode===y.D.ADD?t.constantsS.group.addSuccess:t.constantsS.group.editSuccess),t.data.eventChannel.emit({action:t.data.mode===y.D.ADD?C.F.SAVED:C.F.UPDATED}),t.loading.form=!1}catch(r){t.loading.form=!1,t.ns.showErrorFromResponse(r.error||r,"Unable to save group.")}})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(s){return new(s||o)(e.Y36(h.qu),e.Y36(E.W),e.Y36(R.e),e.Y36(A.b),e.Y36(N.D),e.Y36(P.L))};static \u0275cmp=e.Xpm({type:o,selectors:[["app-w-groups-form"]],inputs:{data:"data"},decls:23,vars:6,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idGroupsForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],["aria-label","Close","data-dismiss","modal","type","button",1,"close"],["aria-hidden","true"],[1,"fas","fa-window-close"],[1,"modal-body","overflow-auto"],[1,"container","pt-3",3,"formGroup"],[1,"form-group","row"],[1,"col-4","col-form-label","col-form-label-sm","text-right"],[1,"col-6"],["formControlName","name","name","name","spellcheck","false","type","text","placeholder","Please provide name",1,"form-control","form-control-sm"],[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,"disabled","click",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[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"],["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(s,n){1&s&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.YNc(4,de,3,0,"span",4),e.YNc(5,ue,3,0,"span",4),e.YNc(6,ge,3,0,"span",4),e.TgZ(7,"button",5)(8,"span",6),e._UZ(9,"i",7),e.qZA()()(),e.TgZ(10,"div",8)(11,"form",9)(12,"div",10)(13,"label",11),e._uU(14,"Name"),e.qZA(),e.TgZ(15,"div",12),e._UZ(16,"input",13),e.qZA()()()(),e.TgZ(17,"div",14)(18,"button",15),e._UZ(19,"i",16),e._uU(20," Close"),e.qZA(),e.YNc(21,fe,4,3,"button",17),e.qZA(),e.YNc(22,ve,1,0,"p-progressSpinner",18),e.qZA()()()),2&s&&(e.xp6(4),e.Q6J("ngIf",n.data.mode===n.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",n.data.mode===n.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",n.data.mode===n.EFormMode.EDIT),e.xp6(5),e.Q6J("formGroup",n.form),e.xp6(10),e.Q6J("ngIf",n.data.mode!==n.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",n.loading.form))},dependencies:[h._Y,h.Fj,h.JJ,h.JL,h.sg,h.u,M.O5,ce.y,T.G],encapsulation:2})}return o})();const Ce=["groupsFormC"];function Se(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"span",18),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.edit())}),e._UZ(1,"i",19),e.qZA()}}function ye(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"span",20),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.clone())}),e._UZ(1,"i",21),e.qZA()}}function _e(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"span",22),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.removePermanentDialog())}),e._UZ(1,"i",23),e.qZA()}}function be(o,l){1&o&&(e.TgZ(0,"tr")(1,"th"),e._uU(2,"Name"),e.qZA(),e._UZ(3,"th",24),e.qZA())}function Ie(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"i",27),e.NdJ("click",function(n){e.CHM(t);const a=e.oxw().$implicit,r=e.oxw();return e.KtG(r.saveGroupPermissions(n,a))}),e.qZA()}}function we(o,l){if(1&o&&(e.TgZ(0,"tr",25)(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,Ie,1,0,"i",26),e.qZA()()),2&o){const t=l.$implicit,s=e.oxw();e.Q6J("pSelectableRow",t),e.xp6(2),e.Oqu(t.name),e.xp6(2),e.Q6J("ngIf",s.selectedRows.indexOf(t)>-1)}}function Ae(o,l){1&o&&e._UZ(0,"p-progressSpinner",28)}let Y=(()=>{class o{groupS;instanceS;functionS;tpInstalledApisS;webSocketEventsS;generalS;notificationS;navigationCS;authCS;constantsS;apiS;eventCenterS;confirmationService;loading={grid:!1};subscriptions=[];data={mode:y.D.ADD,eventChannel:new e.vpe,formData:void 0};rows=[];rowsMap={};showAll=!1;selectedRows=[];gridKey=m.iH._id;groupsFormC;constructor(t,s,n,a,r,u,_,p,f,S,v,b,x){this.groupS=t,this.instanceS=s,this.functionS=n,this.tpInstalledApisS=a,this.webSocketEventsS=r,this.generalS=u,this.notificationS=_,this.navigationCS=p,this.authCS=f,this.constantsS=S,this.apiS=v,this.eventCenterS=b,this.confirmationService=x}ngOnInit(){this.eventCenterS.group.selectedGroups.next([]),this.loadGridData(),this.subscriptions.push(this.data.eventChannel.subscribe(t=>{(t.action===C.F.SAVED||t.action===C.F.UPDATED)&&(this.groupsFormC.hideModal(),this.loadGridData())})),this.generalS.setNewTitle("API Maker - Groups")}loadGridData(){var t=this;this.loading.grid=!0;const s={find:{user:this.authCS.getUserId(),active:!0},select:{name:1,active:1}};this.showAll&&delete s.find.active,this.subscriptions.push(this.groupS.query(s).subscribe(function(){var n=(0,d.Z)(function*(a){a.success&&(t.selectedRows=[],t.rows=a.data,t.rowsMap=c.keyBy(t.rows,m.iH._id));const r=t.navigationCS.getQueryParam(g.p.group);t.rowsMap[r]&&(t.selectedRows.length=0,t.selectedRows.push(t.rowsMap[r]),yield t.fillData()),t.generalS.setNewTitle("API Maker - Groups"),t.loading.grid=!1});return function(a){return n.apply(this,arguments)}}()))}add(){this.data.formData=void 0,this.data.mode=y.D.ADD,this.data.eventChannel.emit({action:C.F.OPEN_FORM_IN_ADD_MODE}),this.groupsFormC.showModal()}view(){this.data.formData=this.selectedRows[0],this.data.mode=y.D.VIEW,this.data.eventChannel.emit({action:C.F.OPEN_FORM_IN_VIEW_MODE}),this.groupsFormC.showModal()}edit(){this.data.formData=this.selectedRows[0],this.data.mode=y.D.EDIT,this.data.eventChannel.emit({action:C.F.OPEN_FORM_IN_EDIT_MODE}),this.groupsFormC.showModal()}clone(){var t=this;return(0,d.Z)(function*(){try{if(!t.selectedRows[0])return;const s=(yield t.groupS.getById(t.selectedRows[0]._id).toPromise()).data;delete s._id,delete s.queryParamsMap,s.name=`${s.name}-clone`,(yield t.groupS.post(s).toPromise()).success?(t.notificationS.showSuccess(t.constantsS.group.cloneSuccess),t.loadGridData()):t.notificationS.showSuccess(t.constantsS.group.cloneSuccess)}catch{t.notificationS.showError(t.constantsS.group.cloneError)}})()}removePermanentDialog(){var t=this;return(0,d.Z)(function*(){var s;t.confirmationService.confirm({message:t.constantsS.group.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(s=(0,d.Z)(function*(){yield t.removePermanent()}),function(){return s.apply(this,arguments)})})})()}removePermanent(){var t=this;return(0,d.Z)(function*(){t.loading.grid=!0;const s=yield t.groupS.permanentDelete(t.selectedRows[0]._id).toPromise();t.loading.grid=!1,s.success?(t.notificationS.showSuccess(t.constantsS.group.removePermanent),t.resetSelectedRows(),t.loadGridData()):t.notificationS.showErrorFromResponse(s,t.constantsS.group.removePermanentError)})()}resetSelectedRows(){this.selectedRows.length=0,this.eventCenterS.group.selectedGroups.next([])}resetDependents(){var t=this;return(0,d.Z)(function*(){t.eventCenterS.group.selectedGroups.next([]),yield t.generalS.resetUrlParams([g.p.group,g.p.api_category]),t.eventCenterS.apiCategory.selectedApiCategory.next([]),t.eventCenterS.group.instanceIds.next([]),t.eventCenterS.group.databaseNames.next([]),t.eventCenterS.group.collectionNames.next([]),t.eventCenterS.group.supportedApiIds.next([]),t.eventCenterS.group.fields.next([]),t.eventCenterS.group.customApiIds.next([]),t.eventCenterS.group.thirdPartyApiIds.next([]),t.eventCenterS.group.systemApiIds.next([]),t.eventCenterS.group.webSocketIds.next([]),t.eventCenterS.group.apisRegex={}})()}groupSelected(){var t=this;return(0,d.Z)(function*(){yield t.resetDependents(),yield t.fillData()})()}fillData(){var t=this;return(0,d.Z)(function*(){if(!t.selectedRows.length)return void(yield t.resetDependents());const s=(yield t.groupS.getById(t.selectedRows[0]._id).toPromise()).data;s&&s.queryParams&&(t.eventCenterS.group.instanceIds.next((yield t.apiS.getIdArrFromNames(s.queryParams.instanceNames,t.instanceS))||[]),t.eventCenterS.group.databaseNames.next(s.queryParams.databaseNames||[]),t.eventCenterS.group.collectionNames.next(s.queryParams.collectionNames||[]),t.eventCenterS.group.supportedApiIds.next(s.queryParams.supportedApiNames||[]),t.eventCenterS.group.fields.next(s.queryParams.fields||[]),t.eventCenterS.group.customApiIds.next((yield t.apiS.getIdArrFromNames(s.queryParams.customApiNames,t.functionS))||[]),t.eventCenterS.group.systemApiIds.next(s.queryParams.systemApiNames||[]),t.eventCenterS.group.thirdPartyApiIds.next((yield t.apiS.getIdArrFromNames(s.queryParams.thirdPartyApiNames,t.tpInstalledApisS,Z.R.THIRD_PARTY_APIS))||[]),t.eventCenterS.group.webSocketIds.next(yield t.apiS.getIdArrFromNamesWebSocketEvents(s.queryParams.webSocketEventNames))),s&&(t.eventCenterS.group.selectedGroups.next([s]),t.eventCenterS.group.apisRegex=s.apisRegex,yield t.navigationCS.setQueryParam(g.p.group,t.selectedRows[0]._id)),s?.queryParams||t.resetDependents()})()}saveGroupPermissions(t,s){var n=this;return(0,d.Z)(function*(){t.stopImmediatePropagation();const a=JSON.parse(JSON.stringify(s));a.fields=n.getPermissionMap(n.eventCenterS.group.schemaFields.value,["path","allowRead","allowWrite"]),a.apisRegex=n.eventCenterS.group.apisRegex,a.queryParams={},a.user=n.authCS.getUserId(),a.queryParams.instanceNames=yield n.apiS.getNameArrFromIds(n.eventCenterS.group.instanceIds.value,n.instanceS),a.queryParams.databaseNames=c.uniq(n.eventCenterS.group.databaseNames.value),a.queryParams.collectionNames=c.uniq(n.eventCenterS.group.collectionNames.value),a.queryParams.supportedApiNames=c.uniq(n.eventCenterS.group.supportedApiIds.value),a.queryParams.fields=c.uniq(n.eventCenterS.group.fields.value),a.queryParams.customApiNames=yield n.apiS.getNameArrFromIds(n.eventCenterS.group.customApiIds.value,n.functionS),a.queryParams.systemApiNames=c.uniq(n.eventCenterS.group.systemApiIds.value),a.queryParams.thirdPartyApiNames=yield n.apiS.getNameArrFromIds(n.eventCenterS.group.thirdPartyApiIds.value,n.tpInstalledApisS,Z.R.THIRD_PARTY_APIS),a.queryParams.webSocketEventNames=yield n.apiS.getNameArrFromIdsWebSocketEvents(n.eventCenterS.group.webSocketIds.value);const r=yield n.groupS.put(a._id,a,{select:m.iH._id}).toPromise();r&&r.success&&n.notificationS.showSuccess(n.constantsS.group.editSuccess)})()}getPermissionMap(t,s){const n=s.slice(1),a=c.groupBy(t,m.W$.instanceName);for(const r in a){const u=a[r]=c.groupBy(a[r],m.W$.databaseName);for(const _ in u){const p=u[_]=c.groupBy(u[_],m.W$.collectionName);for(const f in p)if(1===s.length){const S={};for(const v of p[f])S[v[s[0]]]=!0;p[f]=S}else{const S={};for(const v of p[f])S[v[s[0]]]=c.pick(v,n);p[f]=S}}}return a}getPermissionMapThirdPartyAPIs(t){const s=c.groupBy(t,m.W$.apiBundleName);for(const n in s){if("undefined"===n){delete s[n];continue}const a=s[n]=c.groupBy(s[n],m.W$.apiVersionName);for(const r in a){if("undefined"===r){delete a[r];continue}const u=a[r]=c.groupBy(a[r],m.W$.apiName);for(const _ in u)"undefined"!==_?u[_]=!0:delete u[_]}}return s}getPermissionMapFunctionsAndWSEventAndSysApis(t){const s={};for(const n of t||[])s[n._id]=!0;return s}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}dblClickGroups(){this.selectedRows.length&&this.edit()}static \u0275fac=function(s){return new(s||o)(e.Y36(R.e),e.Y36(D.E),e.Y36(ie.d),e.Y36(re.d),e.Y36(le.a),e.Y36(A.b),e.Y36(E.W),e.Y36(O.S),e.Y36(N.D),e.Y36(P.L),e.Y36(pe.k),e.Y36(I.u),e.Y36(w.YP))};static \u0275cmp=e.Xpm({type:o,selectors:[["app-w-groups"]],viewQuery:function(s,n){if(1&s&&e.Gf(Ce,5),2&s){let a;e.iGM(a=e.CRH())&&(n.groupsFormC=a.first)}},decls:20,vars:11,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/api-group.svg","alt","API Group Permissions",1,"fa-fw","mr-1"],[1,"float-right"],["href","https://docs.apimaker.dev/v1/docs/apis-security/api-group-permission.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-3","mr-1","mt-n1",2,"font-size","25px"],["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","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Clone",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"],["styleClass","p-datatable-striped log-profile-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"],[3,"data"],["groupsFormC",""],["pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["pTooltip","Clone",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-copy","text-warning","fa-fw"],["pTooltip","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],[2,"width","40px"],[3,"pSelectableRow"],["class","fas fa-save text-success fa-fw cursor-pointer","pTooltip","Save group settings",3,"click",4,"ngIf"],["pTooltip","Save group settings",1,"fas","fa-save","text-success","fa-fw","cursor-pointer",3,"click"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(s,n){1&s&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"img",2),e._uU(4," Groups"),e.qZA(),e.TgZ(5,"div",3)(6,"a",4),e._UZ(7,"img",5),e.qZA()(),e.TgZ(8,"span",6),e.NdJ("click",function(){return n.add()}),e._UZ(9,"i",7),e.qZA(),e.YNc(10,Se,2,0,"span",8),e.YNc(11,ye,2,0,"span",9),e.YNc(12,_e,2,0,"span",10),e.qZA(),e.TgZ(13,"div",11)(14,"p-table",12),e.NdJ("selectionChange",function(r){return n.selectedRows=r})("selectionChange",function(){return n.groupSelected()})("dblclick",function(){return n.dblClickGroups()}),e.YNc(15,be,4,0,"ng-template",13),e.YNc(16,we,5,3,"ng-template",14),e.qZA(),e.YNc(17,Ae,1,0,"p-progressSpinner",15),e.qZA()(),e._UZ(18,"app-w-groups-form",16,17)),2&s&&(e.xp6(10),e.Q6J("ngIf",n.selectedRows.length),e.xp6(1),e.Q6J("ngIf",n.selectedRows.length),e.xp6(1),e.Q6J("ngIf",n.selectedRows.length),e.xp6(2),e.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",n.selectedRows)("dataKey",n.gridKey)("scrollable",!0)("value",n.rows),e.xp6(3),e.Q6J("ngIf",n.loading.grid),e.xp6(1),e.Q6J("data",n.data))},dependencies:[M.O5,U.iA,w.jx,U.Ei,T.G,J.u,k]})}return o})();var Me=i(1426),Te=i(7526),Ze=i(8057);function De(o,l){if(1&o&&(e.TgZ(0,"div")(1,"div",10),e._uU(2),e.qZA()()),2&o){const t=e.oxw();e.xp6(2),e.Oqu(t.constantsS.group.allFieldsPermitted)}}function Ne(o,l){if(1&o&&(e.TgZ(0,"span",18),e._uU(1),e.qZA()),2&o){const t=e.oxw().$implicit;e.xp6(1),e.AsE(" [",t.instanceName.substr(0,3).toUpperCase(),"] [",t.databaseName.substr(0,3).toUpperCase(),"] ")}}function Pe(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"span",19)(1,"label",20)(2,"p-checkbox",21),e.NdJ("ngModelChange",function(n){e.CHM(t);const a=e.oxw().$implicit;return e.KtG(a.allowRead=n)})("click",function(n){e.CHM(t);const a=e.oxw().$implicit,r=e.oxw(2);return r.generalS.stopPropagation(n),e.KtG(r.removeDataItemFromSelectedRows(a))}),e.qZA()(),e.TgZ(3,"label",22)(4,"p-checkbox",23),e.NdJ("ngModelChange",function(n){e.CHM(t);const a=e.oxw().$implicit;return e.KtG(a.allowWrite=n)})("click",function(n){e.CHM(t);const a=e.oxw().$implicit,r=e.oxw(2);return r.generalS.stopPropagation(n),e.KtG(r.removeDataItemFromSelectedRows(a))}),e.qZA()()()}if(2&o){const t=e.oxw().$implicit;e.xp6(2),e.Q6J("ngModel",t.allowRead)("binary",!0),e.xp6(2),e.Q6J("ngModel",t.allowWrite)("binary",!0)}}function xe(o,l){if(1&o&&(e.TgZ(0,"div",15),e._uU(1),e.YNc(2,Ne,2,2,"span",16),e.YNc(3,Pe,5,4,"span",17),e.qZA()),2&o){const t=l.$implicit,s=e.oxw(2);e.xp6(1),e.hij(" ",t.label||t.name," "),e.xp6(1),e.Q6J("ngIf",t.level1),e.xp6(1),e.Q6J("ngIf",!t.level1&&(!t.children||0===t.children.length)&&s.selectedRows.indexOf(t)>=0)}}function Ge(o,l){1&o&&e._UZ(0,"p-progressSpinner",24)}function Fe(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"div",11)(1,"p-tree",12),e.NdJ("selectionChange",function(n){e.CHM(t);const a=e.oxw();return e.KtG(a.selectedRows=n)})("selectionChange",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.checkedChange())})("onNodeSelect",function(n){e.CHM(t);const a=e.oxw();return e.KtG(a.nodeSelected(n))})("onNodeUnselect",function(n){e.CHM(t);const a=e.oxw();return e.KtG(a.nodeUnSelected(n))}),e.YNc(2,xe,4,3,"ng-template",13),e.qZA(),e.YNc(3,Ge,1,0,"p-progressSpinner",14),e.qZA()}if(2&o){const t=e.oxw();e.xp6(1),e.Q6J("value",t.propertiesListData)("selection",t.selectedRows)("metaKeySelection",!1),e.xp6(2),e.Q6J("ngIf",t.loading.grid)}}let Q=(()=>{class o{instanceS;eventCenterS;constantsS;generalS;loading={grid:!1};subscriptions=[];propertiesListData=[];allTreeItemsMap={};selectedRows=[];checkedKeysMap={};key="_id";constructor(t,s,n,a){this.instanceS=t,this.eventCenterS=s,this.constantsS=n,this.generalS=a}ngOnInit(){var t=this;this.subscriptions.push(this.eventCenterS.collection.selectedCollections.pipe((0,Me.b)(300)).subscribe(function(){var s=(0,d.Z)(function*(n){yield t.loadSchemas()});return function(n){return s.apply(this,arguments)}}()))}loadSchemas(){var t=this;return(0,d.Z)(function*(){const s=t.eventCenterS.collection.selectedCollections.value;if(!s.length)return void(yield t.resetGridAndUrl());t.loading.grid=!0;const n=t.eventCenterS.group.selectedGroups.value[0];yield t.resetGridAndUrl(),t.allTreeItemsMap={};const a=(yield t.instanceS.getSchemas(s).toPromise()).data,r=[],u=[];for(const p of a){const f=[];if(p.propertyItems){const b=[];for(const x of p.propertyItems){const G=t.generalS.convertKTreeItemToPrimeNGTreeItem(x);t.setReadWriteRecursively(n,G),b.push(G),f.push(G)}u.push(b)}const S=p.instanceName+":"+p.databaseName+":"+p.collectionName,v={label:`${p.collectionName}`,children:f,_id:S,level1:!0,instanceName:p.instanceName,databaseName:p.databaseName,collectionName:p.collectionName};r.push(v),t.allTreeItemsMap[S]=v;for(const b of v?.children||[])b.parent=v}t.propertiesListData=r;for(const p of u)t.generateIdMap(p,t.allTreeItemsMap);if(t.eventCenterS.group.fields.value.join(",")){const p=c.intersection(c.keys(t.allTreeItemsMap),t.eventCenterS.group.fields.value);t.selectedRows=[];for(const f of p)t.allTreeItemsMap[f]&&t.selectedRows.push(t.allTreeItemsMap[f]);t.generalS.setDataInSelectedRowsFromIdArr(p,t.selectedRows,t.allTreeItemsMap),t.setDataInEventCenter()}t.loading.grid=!1})()}setReadWriteRecursively(t,s){const n=t?.fields?.[s.instanceName]?.[s.databaseName]?.[s.collectionName];if(!n)return;const a=n[s.path];if(a?(s.allowRead=a.allowRead,s.allowWrite=a.allowWrite):s.allowRead=s.allowWrite=!1,s.children&&s.children.length)for(const r of s.children)this.setReadWriteRecursively(t,r)}resetGridAndUrl(){var t=this;return(0,d.Z)(function*(){t.propertiesListData=[],t.allTreeItemsMap={},t.selectedRows=[],t.checkedKeysMap={},t.eventCenterS.group.schemaFields.next([])})()}checkedChange(){this.setDataInEventCenter()}nodeSelected(t){t.node.allowRead=!0}nodeUnSelected(t){const s=t.node;s.allowRead=!1,s.allowWrite=!1}removeDataItemFromSelectedRows(t){if(!t.allowRead&&!t.allowWrite){const s=this.selectedRows.indexOf(t);s>=0&&this.selectedRows.splice(s,1)}}calculateCheckedKeysMap(){this.checkedKeysMap={};for(const t of this.selectedRows)this.checkedKeysMap[t._id]=t}setDataInEventCenter(){this.calculateCheckedKeysMap(),this.eventCenterS.group.fields.next(c.map(this.selectedRows,"_id"));const t=[];for(const s of this.selectedRows)this.allTreeItemsMap[s._id]&&t.push(s);this.eventCenterS.group.schemaFields.next(t)}generateIdMap(t,s){if(Array.isArray(t))for(const n of t)this.generateIdMap(n,s);else s[t._id]=t,t.children&&this.generateIdMap(t.children,s)}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(s){return new(s||o)(e.Y36(D.E),e.Y36(I.u),e.Y36(P.L),e.Y36(A.b))};static \u0275cmp=e.Xpm({type:o,selectors:[["app-w-schema-fields"]],decls:12,vars:4,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],[1,"fas","fa-indent","text-success","fa-fw","mr-1"],["pTooltip","All Fields",1,"float-right","cursor-pointer"],[1,"mb-0","mt--2px"],[3,"ngModel","binary","ngModelChange"],[1,"card-body","p-0","h-100","overflow-hidden"],[1,"position-relative","border-top","h-100"],[4,"ngIf"],["class","h-100",4,"ngIf"],[1,"p-2","text-center","text-success"],[1,"h-100"],["scrollHeight","flex","selectionMode","checkbox",1,"w-full",3,"value","selection","metaKeySelection","selectionChange","onNodeSelect","onNodeUnselect"],["pTemplate","default"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[1,"w-100","prevent-text-selection","cursor-pointer"],["class","text-monospace font-weight-bold font-italic float-right mr-1","style","font-size: xx-small;",4,"ngIf"],["class","float-right small mr-2",4,"ngIf"],[1,"text-monospace","font-weight-bold","font-italic","float-right","mr-1",2,"font-size","xx-small"],[1,"float-right","small","mr-2"],[1,"align-middle","mb-0","mr-2"],["label","R",3,"ngModel","binary","ngModelChange","click"],[1,"align-middle","mb-0"],["label","W",3,"ngModel","binary","ngModelChange","click"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(s,n){1&s&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"i",2),e._uU(4," Schema Fields"),e.qZA(),e.TgZ(5,"span",3)(6,"label",4)(7,"p-checkbox",5),e.NdJ("ngModelChange",function(r){return n.eventCenterS.group.apisRegex.allFields=r}),e.qZA()()()(),e.TgZ(8,"div",6)(9,"div",7),e.YNc(10,De,3,1,"div",8),e.YNc(11,Fe,4,4,"div",9),e.qZA()()()),2&s&&(e.xp6(7),e.Q6J("ngModel",n.eventCenterS.group.apisRegex.allFields)("binary",!0),e.xp6(3),e.Q6J("ngIf",n.eventCenterS.group.apisRegex.allInstances||n.eventCenterS.group.apisRegex.allDatabases||n.eventCenterS.group.apisRegex.allCollections||n.eventCenterS.group.apisRegex.allFields),e.xp6(1),e.Q6J("ngIf",!(n.eventCenterS.group.apisRegex.allInstances||n.eventCenterS.group.apisRegex.allDatabases||n.eventCenterS.group.apisRegex.allCollections||n.eventCenterS.group.apisRegex.allFields)))},dependencies:[h.JJ,h.On,M.O5,w.jx,Te.mp,T.G,J.u,Ze.XZ],encapsulation:2})}return o})();function Re(o,l){1&o&&(e.TgZ(0,"div",21),e._UZ(1,"app-w-instances",10),e.qZA()),2&o&&(e.xp6(1),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0))}function Ee(o,l){1&o&&(e.TgZ(0,"div",22),e._UZ(1,"app-w-databases",10),e.qZA()),2&o&&(e.xp6(1),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0))}const Oe=function(){return[50,50]};let W=(()=>{class o{eventCenterS;EAPICategory=Z.R;constructor(t){this.eventCenterS=t}ngOnInit(){}ngOnDestroy(){this.eventCenterS.group.apisRegex={}}static \u0275fac=function(s){return new(s||o)(e.Y36(I.u))};static \u0275cmp=e.Xpm({type:o,selectors:[["app-group-layout"]],decls:34,vars:42,consts:[[1,"pt-1","pl-1","pr-1","overflow-auto"],[2,"width","max-content"],[1,"v-div","w-groups"],[1,"vertical-height-max"],[1,"v-div","w-categories"],[3,"typeIsGroup"],[1,"v-div","w-ins-db"],["layout","vertical",3,"panelSizes"],["pTemplate",""],[1,"v-div","w-collection"],[3,"metaKeySelection","IsReadOnly","IsDependentOnGroup"],[1,"v-div","w-ins-apis"],[3,"isLPM","isDependentOnGroup","treeViewId"],[1,"v-div","w-schema-fields"],[1,"v-div","w-third-party"],[3,"IsDependentOnGroup","isLPM"],[1,"v-div","w-custom-apis"],[3,"metaKeySelection","IsReadOnly","IsDependentOnGroup","isLPM"],[1,"v-div","w-system-apis"],[1,"v-div","w-web-sockets"],[3,"metaKeySelection","IsReadOnly","IsDependentOnGroup","showCheckbox","isLPM"],[1,"vertical-height-instances","w-100"],[1,"vertical-height-db","w-100"]],template:function(s,n){1&s&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e._UZ(4,"app-w-groups"),e.qZA()(),e.TgZ(5,"div",4)(6,"div",3),e._UZ(7,"app-w-api-categories",5),e.qZA()(),e.TgZ(8,"div",6)(9,"p-splitter",7),e.YNc(10,Re,2,3,"ng-template",8),e.YNc(11,Ee,2,3,"ng-template",8),e.qZA()(),e.TgZ(12,"div",9)(13,"div",3),e._UZ(14,"app-w-collections",10),e.qZA()(),e.TgZ(15,"div",11)(16,"div",3),e._UZ(17,"app-w-supported-api",12),e.qZA()(),e.TgZ(18,"div",13)(19,"div",3),e._UZ(20,"app-w-schema-fields"),e.qZA()(),e.TgZ(21,"div",14)(22,"div",3),e._UZ(23,"app-w-supported-tp-api",15),e.qZA()(),e.TgZ(24,"div",16)(25,"div",3),e._UZ(26,"app-custom-api-grid",17),e.qZA()(),e.TgZ(27,"div",18)(28,"div",3),e._UZ(29,"app-system-api-w",17),e.qZA()(),e.TgZ(30,"div",19)(31,"div",3),e._UZ(32,"app-web-socket-events-grid",20),e.qZA()()()(),e._UZ(33,"app-create-schema-form")),2&s&&(e.xp6(5),e.Udp("display",n.eventCenterS.group.selectedGroups.value.length?"block":"none"),e.xp6(2),e.Q6J("typeIsGroup","GROUP"),e.xp6(1),e.Udp("display",n.eventCenterS.group.selectedGroups.value.length&&(null==n.eventCenterS.apiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory.value||null==n.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:n.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===n.EAPICategory.INSTANCES?"block":"none"),e.xp6(1),e.Q6J("panelSizes",e.DdM(41,Oe)),e.xp6(3),e.Udp("display",n.eventCenterS.group.selectedGroups.value.length&&(null==n.eventCenterS.apiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory.value||null==n.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:n.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===n.EAPICategory.INSTANCES?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0),e.xp6(1),e.Udp("display",n.eventCenterS.group.selectedGroups.value.length&&(null==n.eventCenterS.apiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory.value||null==n.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:n.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===n.EAPICategory.INSTANCES?"block":"none"),e.xp6(2),e.Q6J("isLPM",!1)("isDependentOnGroup",!0)("treeViewId","treeViewFromGroupLayout"),e.xp6(1),e.Udp("display",n.eventCenterS.group.selectedGroups.value.length&&(null==n.eventCenterS.apiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory.value||null==n.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:n.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===n.EAPICategory.INSTANCES?"block":"none"),e.xp6(3),e.Udp("display",n.eventCenterS.group.selectedGroups.value.length&&(null==n.eventCenterS.apiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory.value||null==n.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:n.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===n.EAPICategory.THIRD_PARTY_APIS?"block":"none"),e.xp6(2),e.Q6J("IsDependentOnGroup",!0)("isLPM",!1),e.xp6(1),e.Udp("display",n.eventCenterS.group.selectedGroups.value.length&&(null==n.eventCenterS.apiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory.value||null==n.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:n.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===n.EAPICategory.CUSTOM_APIS?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0)("isLPM",!1),e.xp6(1),e.Udp("display",n.eventCenterS.group.selectedGroups.value.length&&(null==n.eventCenterS.apiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory.value||null==n.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:n.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===n.EAPICategory.SYSTEM_APIS?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0)("isLPM",!1),e.xp6(1),e.Udp("display",n.eventCenterS.group.selectedGroups.value.length&&(null==n.eventCenterS.apiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory.value||null==n.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:n.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===n.EAPICategory.WEB_SOCKET_EVENT?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0)("showCheckbox",!0)("isLPM",!1))},dependencies:[w.jx,H.q,V.f,j.O,z.n,X.c,ee.G,te.X,ne.T,se.d,ae.A,oe.x,Y,Q],styles:[".vertical-height-instances[_ngcontent-%COMP%]{height:248px}.vertical-height-db[_ngcontent-%COMP%]{height:calc(100vh - 320px)}.vertical-height-max[_ngcontent-%COMP%]{height:calc(100vh - 66px)}.v-div[_ngcontent-%COMP%]{display:inline-block;height:calc(100vh - 62px);float:left}.w-groups[_ngcontent-%COMP%]{width:20rem}.w-categories[_ngcontent-%COMP%]{width:17rem}.w-ins-db[_ngcontent-%COMP%]{width:25rem}.w-collection[_ngcontent-%COMP%]{width:28rem}.w-ins-apis[_ngcontent-%COMP%], .w-schema-fields[_ngcontent-%COMP%]{width:35rem}.w-custom-apis[_ngcontent-%COMP%], .w-system-apis[_ngcontent-%COMP%], .w-third-party[_ngcontent-%COMP%], .w-web-sockets[_ngcontent-%COMP%]{width:calc(100vw - 37.5rem)}"]})}return o})();i(3965);var Ye=i(1678),Qe=i(9208),We=i(4211),qe=i(4186),Be=i(2777),Ke=i(7705),Le=i(1434);const He=[{path:"group-layout",component:W,canActivate:[K.P]}];let Ve=(()=>{class o{static \u0275fac=function(s){return new(s||o)};static \u0275mod=e.oAB({type:o});static \u0275inj=e.cJS({imports:[q.Bz.forChild(He),B.u,Ye.DashboardM,We.DbCellM,Qe.FunctionManM,qe.SystemApiM,Le.B,Be.u,Ke.L,L.WebSocketEventsM]})}return o})()}}]);
1
+ "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[6401],{6401:($e,F,i)=>{i.r(F),i.d(F,{GroupM:()=>Ve});var q=i(7664),B=i(8176),K=i(3726),L=i(1025),Z=i(5085),e=i(4946),I=i(2915),w=i(5219),H=i(5043),V=i(3885),j=i(559),z=i(6937),X=i(740),ee=i(7595),te=i(9329),ne=i(356),se=i(3824),ae=i(8651),oe=i(2726),d=i(5861),C=i(3157),y=i(328),g=i(6212),c=i(6990),m=i(1162),R=i(8883),D=i(3429),ie=i(7629),re=i(2559),le=i(262),A=i(7240),E=i(9961),O=i(2189),N=i(5852),P=i(7414),pe=i(3065),M=i(6814),U=i(5431),T=i(7680),J=i(3259),h=i(95),ce=i(2660);function de(o,l){1&o&&(e.TgZ(0,"span"),e._UZ(1,"i",19),e._uU(2," Add Group"),e.qZA())}function ue(o,l){1&o&&(e.TgZ(0,"span"),e._UZ(1,"i",20),e._uU(2," View Group"),e.qZA())}function ge(o,l){1&o&&(e.TgZ(0,"span"),e._UZ(1,"i",21),e._uU(2," Edit Group"),e.qZA())}function me(o,l){1&o&&(e.TgZ(0,"span"),e._uU(1,"Save Group"),e.qZA())}function he(o,l){1&o&&(e.TgZ(0,"span"),e._uU(1,"Update Group"),e.qZA())}function fe(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"button",22),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.save())}),e._UZ(1,"i",23),e.YNc(2,me,2,0,"span",4),e.YNc(3,he,2,0,"span",4),e.qZA()}if(2&o){const t=e.oxw();e.Q6J("disabled",t.form.invalid),e.xp6(2),e.Q6J("ngIf",t.data.mode===t.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT)}}function ve(o,l){1&o&&e._UZ(0,"p-progressSpinner",24)}let k=(()=>{class o{fb;ns;groupS;generalS;authCS;constantsS;data;loading={form:!1};EFormMode=y.D;form;subscriptions=[];constructor(t,s,n,a,r,u){this.fb=t,this.ns=s,this.groupS=n,this.generalS=a,this.authCS=r,this.constantsS=u}ngOnInit(){var t=this;this.createForm(),this.subscriptions.push(this.data.eventChannel.subscribe(function(){var s=(0,d.Z)(function*(n){if(n)if(t.form.enable(),n.action===C.F.OPEN_FORM_IN_EDIT_MODE){const a=yield t.groupS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(a.data)}else if(n.action===C.F.OPEN_FORM_IN_VIEW_MODE){const a=yield t.groupS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(a.data),t.form.disable()}else n.action===C.F.OPEN_FORM_IN_ADD_MODE&&t.form.reset()});return function(n){return s.apply(this,arguments)}}()))}createForm(){this.form=this.fb.group({name:[null,[h.kI.required]]})}showModal(){$("#idGroupsForm").modal("show")}hideModal(){$("#idGroupsForm").modal("hide")}save(){var t=this;return(0,d.Z)(function*(){const s=t.form.getRawValue();let n;n=t.data.formData&&t.data.formData._id?(yield t.groupS.getById(t.data.formData._id).toPromise()).data:{};const a=Object.assign({},n,s);a.user=t.authCS.getUserId();try{let r;t.loading.form=!0,t.data.mode===y.D.ADD?r=yield t.groupS.post(a).toPromise():t.data.mode===y.D.EDIT&&(r=yield t.groupS.put(t.data.formData._id,a,{select:m.iH._id}).toPromise()),t.ns.showSuccess(t.data.mode===y.D.ADD?t.constantsS.group.addSuccess:t.constantsS.group.editSuccess),t.data.eventChannel.emit({action:t.data.mode===y.D.ADD?C.F.SAVED:C.F.UPDATED}),t.loading.form=!1}catch(r){t.loading.form=!1,t.ns.showErrorFromResponse(r.error||r,"Unable to save group.")}})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(s){return new(s||o)(e.Y36(h.qu),e.Y36(E.W),e.Y36(R.e),e.Y36(A.b),e.Y36(N.D),e.Y36(P.L))};static \u0275cmp=e.Xpm({type:o,selectors:[["app-w-groups-form"]],inputs:{data:"data"},decls:23,vars:6,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idGroupsForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],["aria-label","Close","data-dismiss","modal","type","button",1,"close"],["aria-hidden","true"],[1,"fas","fa-window-close"],[1,"modal-body","overflow-auto"],[1,"container","pt-3",3,"formGroup"],[1,"form-group","row"],[1,"col-4","col-form-label","col-form-label-sm","text-right"],[1,"col-6"],["formControlName","name","name","name","spellcheck","false","type","text","placeholder","Please provide name",1,"form-control","form-control-sm"],[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,"disabled","click",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[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"],["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(s,n){1&s&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.YNc(4,de,3,0,"span",4),e.YNc(5,ue,3,0,"span",4),e.YNc(6,ge,3,0,"span",4),e.TgZ(7,"button",5)(8,"span",6),e._UZ(9,"i",7),e.qZA()()(),e.TgZ(10,"div",8)(11,"form",9)(12,"div",10)(13,"label",11),e._uU(14,"Name"),e.qZA(),e.TgZ(15,"div",12),e._UZ(16,"input",13),e.qZA()()()(),e.TgZ(17,"div",14)(18,"button",15),e._UZ(19,"i",16),e._uU(20," Close"),e.qZA(),e.YNc(21,fe,4,3,"button",17),e.qZA(),e.YNc(22,ve,1,0,"p-progressSpinner",18),e.qZA()()()),2&s&&(e.xp6(4),e.Q6J("ngIf",n.data.mode===n.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",n.data.mode===n.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",n.data.mode===n.EFormMode.EDIT),e.xp6(5),e.Q6J("formGroup",n.form),e.xp6(10),e.Q6J("ngIf",n.data.mode!==n.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",n.loading.form))},dependencies:[h._Y,h.Fj,h.JJ,h.JL,h.sg,h.u,M.O5,ce.y,T.G],encapsulation:2})}return o})();const Ce=["groupsFormC"];function Se(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"span",18),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.edit())}),e._UZ(1,"i",19),e.qZA()}}function ye(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"span",20),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.clone())}),e._UZ(1,"i",21),e.qZA()}}function _e(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"span",22),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.removePermanentDialog())}),e._UZ(1,"i",23),e.qZA()}}function be(o,l){1&o&&(e.TgZ(0,"tr")(1,"th"),e._uU(2,"Name"),e.qZA(),e._UZ(3,"th",24),e.qZA())}function Ie(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"i",27),e.NdJ("click",function(n){e.CHM(t);const a=e.oxw().$implicit,r=e.oxw();return e.KtG(r.saveGroupPermissions(n,a))}),e.qZA()}}function we(o,l){if(1&o&&(e.TgZ(0,"tr",25)(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,Ie,1,0,"i",26),e.qZA()()),2&o){const t=l.$implicit,s=e.oxw();e.Q6J("pSelectableRow",t),e.xp6(2),e.Oqu(t.name),e.xp6(2),e.Q6J("ngIf",s.selectedRows.indexOf(t)>-1)}}function Ae(o,l){1&o&&e._UZ(0,"p-progressSpinner",28)}let Y=(()=>{class o{groupS;instanceS;functionS;tpInstalledApisS;webSocketEventsS;generalS;notificationS;navigationCS;authCS;constantsS;apiS;eventCenterS;confirmationService;loading={grid:!1};subscriptions=[];data={mode:y.D.ADD,eventChannel:new e.vpe,formData:void 0};rows=[];rowsMap={};showAll=!1;selectedRows=[];gridKey=m.iH._id;groupsFormC;constructor(t,s,n,a,r,u,_,p,f,S,v,b,x){this.groupS=t,this.instanceS=s,this.functionS=n,this.tpInstalledApisS=a,this.webSocketEventsS=r,this.generalS=u,this.notificationS=_,this.navigationCS=p,this.authCS=f,this.constantsS=S,this.apiS=v,this.eventCenterS=b,this.confirmationService=x}ngOnInit(){this.eventCenterS.group.selectedGroups.next([]),this.loadGridData(),this.subscriptions.push(this.data.eventChannel.subscribe(t=>{(t.action===C.F.SAVED||t.action===C.F.UPDATED)&&(this.groupsFormC.hideModal(),this.loadGridData())})),this.generalS.setNewTitle("API Maker - Groups")}loadGridData(){var t=this;this.loading.grid=!0;const s={find:{user:this.authCS.getUserId(),active:!0},select:{name:1,active:1},sort:{name:1}};this.showAll&&delete s.find.active,this.subscriptions.push(this.groupS.query(s).subscribe(function(){var n=(0,d.Z)(function*(a){a.success&&(t.selectedRows=[],t.rows=a.data,t.rowsMap=c.keyBy(t.rows,m.iH._id));const r=t.navigationCS.getQueryParam(g.p.group);t.rowsMap[r]&&(t.selectedRows.length=0,t.selectedRows.push(t.rowsMap[r]),yield t.fillData()),t.generalS.setNewTitle("API Maker - Groups"),t.loading.grid=!1});return function(a){return n.apply(this,arguments)}}()))}add(){this.data.formData=void 0,this.data.mode=y.D.ADD,this.data.eventChannel.emit({action:C.F.OPEN_FORM_IN_ADD_MODE}),this.groupsFormC.showModal()}view(){this.data.formData=this.selectedRows[0],this.data.mode=y.D.VIEW,this.data.eventChannel.emit({action:C.F.OPEN_FORM_IN_VIEW_MODE}),this.groupsFormC.showModal()}edit(){this.data.formData=this.selectedRows[0],this.data.mode=y.D.EDIT,this.data.eventChannel.emit({action:C.F.OPEN_FORM_IN_EDIT_MODE}),this.groupsFormC.showModal()}clone(){var t=this;return(0,d.Z)(function*(){try{if(!t.selectedRows[0])return;const s=(yield t.groupS.getById(t.selectedRows[0]._id).toPromise()).data;delete s._id,delete s.queryParamsMap,s.name=`${s.name}-clone`,(yield t.groupS.post(s).toPromise()).success?(t.notificationS.showSuccess(t.constantsS.group.cloneSuccess),t.loadGridData()):t.notificationS.showSuccess(t.constantsS.group.cloneSuccess)}catch{t.notificationS.showError(t.constantsS.group.cloneError)}})()}removePermanentDialog(){var t=this;return(0,d.Z)(function*(){var s;t.confirmationService.confirm({message:t.constantsS.group.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(s=(0,d.Z)(function*(){yield t.removePermanent()}),function(){return s.apply(this,arguments)})})})()}removePermanent(){var t=this;return(0,d.Z)(function*(){t.loading.grid=!0;const s=yield t.groupS.permanentDelete(t.selectedRows[0]._id).toPromise();t.loading.grid=!1,s.success?(t.notificationS.showSuccess(t.constantsS.group.removePermanent),t.resetSelectedRows(),t.loadGridData()):t.notificationS.showErrorFromResponse(s,t.constantsS.group.removePermanentError)})()}resetSelectedRows(){this.selectedRows.length=0,this.eventCenterS.group.selectedGroups.next([])}resetDependents(){var t=this;return(0,d.Z)(function*(){t.eventCenterS.group.selectedGroups.next([]),yield t.generalS.resetUrlParams([g.p.group,g.p.api_category]),t.eventCenterS.apiCategory.selectedApiCategory.next([]),t.eventCenterS.group.instanceIds.next([]),t.eventCenterS.group.databaseNames.next([]),t.eventCenterS.group.collectionNames.next([]),t.eventCenterS.group.supportedApiIds.next([]),t.eventCenterS.group.fields.next([]),t.eventCenterS.group.customApiIds.next([]),t.eventCenterS.group.thirdPartyApiIds.next([]),t.eventCenterS.group.systemApiIds.next([]),t.eventCenterS.group.webSocketIds.next([]),t.eventCenterS.group.apisRegex={}})()}groupSelected(){var t=this;return(0,d.Z)(function*(){yield t.resetDependents(),yield t.fillData()})()}fillData(){var t=this;return(0,d.Z)(function*(){if(!t.selectedRows.length)return void(yield t.resetDependents());const s=(yield t.groupS.getById(t.selectedRows[0]._id).toPromise()).data;s&&s.queryParams&&(t.eventCenterS.group.instanceIds.next((yield t.apiS.getIdArrFromNames(s.queryParams.instanceNames,t.instanceS))||[]),t.eventCenterS.group.databaseNames.next(s.queryParams.databaseNames||[]),t.eventCenterS.group.collectionNames.next(s.queryParams.collectionNames||[]),t.eventCenterS.group.supportedApiIds.next(s.queryParams.supportedApiNames||[]),t.eventCenterS.group.fields.next(s.queryParams.fields||[]),t.eventCenterS.group.customApiIds.next((yield t.apiS.getIdArrFromNames(s.queryParams.customApiNames,t.functionS))||[]),t.eventCenterS.group.systemApiIds.next(s.queryParams.systemApiNames||[]),t.eventCenterS.group.thirdPartyApiIds.next((yield t.apiS.getIdArrFromNames(s.queryParams.thirdPartyApiNames,t.tpInstalledApisS,Z.R.THIRD_PARTY_APIS))||[]),t.eventCenterS.group.webSocketIds.next(yield t.apiS.getIdArrFromNamesWebSocketEvents(s.queryParams.webSocketEventNames))),s&&(t.eventCenterS.group.selectedGroups.next([s]),t.eventCenterS.group.apisRegex=s.apisRegex,yield t.navigationCS.setQueryParam(g.p.group,t.selectedRows[0]._id)),s?.queryParams||t.resetDependents()})()}saveGroupPermissions(t,s){var n=this;return(0,d.Z)(function*(){t.stopImmediatePropagation();const a=JSON.parse(JSON.stringify(s));a.fields=n.getPermissionMap(n.eventCenterS.group.schemaFields.value,["path","allowRead","allowWrite"]),a.apisRegex=n.eventCenterS.group.apisRegex,a.queryParams={},a.user=n.authCS.getUserId(),a.queryParams.instanceNames=yield n.apiS.getNameArrFromIds(n.eventCenterS.group.instanceIds.value,n.instanceS),a.queryParams.databaseNames=c.uniq(n.eventCenterS.group.databaseNames.value),a.queryParams.collectionNames=c.uniq(n.eventCenterS.group.collectionNames.value),a.queryParams.supportedApiNames=c.uniq(n.eventCenterS.group.supportedApiIds.value),a.queryParams.fields=c.uniq(n.eventCenterS.group.fields.value),a.queryParams.customApiNames=yield n.apiS.getNameArrFromIds(n.eventCenterS.group.customApiIds.value,n.functionS),a.queryParams.systemApiNames=c.uniq(n.eventCenterS.group.systemApiIds.value),a.queryParams.thirdPartyApiNames=yield n.apiS.getNameArrFromIds(n.eventCenterS.group.thirdPartyApiIds.value,n.tpInstalledApisS,Z.R.THIRD_PARTY_APIS),a.queryParams.webSocketEventNames=yield n.apiS.getNameArrFromIdsWebSocketEvents(n.eventCenterS.group.webSocketIds.value);const r=yield n.groupS.put(a._id,a,{select:m.iH._id}).toPromise();r&&r.success&&n.notificationS.showSuccess(n.constantsS.group.editSuccess)})()}getPermissionMap(t,s){const n=s.slice(1),a=c.groupBy(t,m.W$.instanceName);for(const r in a){const u=a[r]=c.groupBy(a[r],m.W$.databaseName);for(const _ in u){const p=u[_]=c.groupBy(u[_],m.W$.collectionName);for(const f in p)if(1===s.length){const S={};for(const v of p[f])S[v[s[0]]]=!0;p[f]=S}else{const S={};for(const v of p[f])S[v[s[0]]]=c.pick(v,n);p[f]=S}}}return a}getPermissionMapThirdPartyAPIs(t){const s=c.groupBy(t,m.W$.apiBundleName);for(const n in s){if("undefined"===n){delete s[n];continue}const a=s[n]=c.groupBy(s[n],m.W$.apiVersionName);for(const r in a){if("undefined"===r){delete a[r];continue}const u=a[r]=c.groupBy(a[r],m.W$.apiName);for(const _ in u)"undefined"!==_?u[_]=!0:delete u[_]}}return s}getPermissionMapFunctionsAndWSEventAndSysApis(t){const s={};for(const n of t||[])s[n._id]=!0;return s}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}dblClickGroups(){this.selectedRows.length&&this.edit()}static \u0275fac=function(s){return new(s||o)(e.Y36(R.e),e.Y36(D.E),e.Y36(ie.d),e.Y36(re.d),e.Y36(le.a),e.Y36(A.b),e.Y36(E.W),e.Y36(O.S),e.Y36(N.D),e.Y36(P.L),e.Y36(pe.k),e.Y36(I.u),e.Y36(w.YP))};static \u0275cmp=e.Xpm({type:o,selectors:[["app-w-groups"]],viewQuery:function(s,n){if(1&s&&e.Gf(Ce,5),2&s){let a;e.iGM(a=e.CRH())&&(n.groupsFormC=a.first)}},decls:20,vars:11,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/api-group.svg","alt","API Group Permissions",1,"fa-fw","mr-1"],[1,"float-right"],["href","https://docs.apimaker.dev/v1/docs/apis-security/api-group-permission.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-3","mr-1","mt-n1",2,"font-size","25px"],["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","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Clone",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"],["styleClass","p-datatable-striped log-profile-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"],[3,"data"],["groupsFormC",""],["pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["pTooltip","Clone",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-copy","text-warning","fa-fw"],["pTooltip","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],[2,"width","40px"],[3,"pSelectableRow"],["class","fas fa-save text-success fa-fw cursor-pointer","pTooltip","Save group settings",3,"click",4,"ngIf"],["pTooltip","Save group settings",1,"fas","fa-save","text-success","fa-fw","cursor-pointer",3,"click"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(s,n){1&s&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"img",2),e._uU(4," Groups"),e.qZA(),e.TgZ(5,"div",3)(6,"a",4),e._UZ(7,"img",5),e.qZA()(),e.TgZ(8,"span",6),e.NdJ("click",function(){return n.add()}),e._UZ(9,"i",7),e.qZA(),e.YNc(10,Se,2,0,"span",8),e.YNc(11,ye,2,0,"span",9),e.YNc(12,_e,2,0,"span",10),e.qZA(),e.TgZ(13,"div",11)(14,"p-table",12),e.NdJ("selectionChange",function(r){return n.selectedRows=r})("selectionChange",function(){return n.groupSelected()})("dblclick",function(){return n.dblClickGroups()}),e.YNc(15,be,4,0,"ng-template",13),e.YNc(16,we,5,3,"ng-template",14),e.qZA(),e.YNc(17,Ae,1,0,"p-progressSpinner",15),e.qZA()(),e._UZ(18,"app-w-groups-form",16,17)),2&s&&(e.xp6(10),e.Q6J("ngIf",n.selectedRows.length),e.xp6(1),e.Q6J("ngIf",n.selectedRows.length),e.xp6(1),e.Q6J("ngIf",n.selectedRows.length),e.xp6(2),e.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",n.selectedRows)("dataKey",n.gridKey)("scrollable",!0)("value",n.rows),e.xp6(3),e.Q6J("ngIf",n.loading.grid),e.xp6(1),e.Q6J("data",n.data))},dependencies:[M.O5,U.iA,w.jx,U.Ei,T.G,J.u,k]})}return o})();var Me=i(1426),Te=i(7526),Ze=i(8057);function De(o,l){if(1&o&&(e.TgZ(0,"div")(1,"div",10),e._uU(2),e.qZA()()),2&o){const t=e.oxw();e.xp6(2),e.Oqu(t.constantsS.group.allFieldsPermitted)}}function Ne(o,l){if(1&o&&(e.TgZ(0,"span",18),e._uU(1),e.qZA()),2&o){const t=e.oxw().$implicit;e.xp6(1),e.AsE(" [",t.instanceName.substr(0,3).toUpperCase(),"] [",t.databaseName.substr(0,3).toUpperCase(),"] ")}}function Pe(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"span",19)(1,"label",20)(2,"p-checkbox",21),e.NdJ("ngModelChange",function(n){e.CHM(t);const a=e.oxw().$implicit;return e.KtG(a.allowRead=n)})("click",function(n){e.CHM(t);const a=e.oxw().$implicit,r=e.oxw(2);return r.generalS.stopPropagation(n),e.KtG(r.removeDataItemFromSelectedRows(a))}),e.qZA()(),e.TgZ(3,"label",22)(4,"p-checkbox",23),e.NdJ("ngModelChange",function(n){e.CHM(t);const a=e.oxw().$implicit;return e.KtG(a.allowWrite=n)})("click",function(n){e.CHM(t);const a=e.oxw().$implicit,r=e.oxw(2);return r.generalS.stopPropagation(n),e.KtG(r.removeDataItemFromSelectedRows(a))}),e.qZA()()()}if(2&o){const t=e.oxw().$implicit;e.xp6(2),e.Q6J("ngModel",t.allowRead)("binary",!0),e.xp6(2),e.Q6J("ngModel",t.allowWrite)("binary",!0)}}function xe(o,l){if(1&o&&(e.TgZ(0,"div",15),e._uU(1),e.YNc(2,Ne,2,2,"span",16),e.YNc(3,Pe,5,4,"span",17),e.qZA()),2&o){const t=l.$implicit,s=e.oxw(2);e.xp6(1),e.hij(" ",t.label||t.name," "),e.xp6(1),e.Q6J("ngIf",t.level1),e.xp6(1),e.Q6J("ngIf",!t.level1&&(!t.children||0===t.children.length)&&s.selectedRows.indexOf(t)>=0)}}function Ge(o,l){1&o&&e._UZ(0,"p-progressSpinner",24)}function Fe(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"div",11)(1,"p-tree",12),e.NdJ("selectionChange",function(n){e.CHM(t);const a=e.oxw();return e.KtG(a.selectedRows=n)})("selectionChange",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.checkedChange())})("onNodeSelect",function(n){e.CHM(t);const a=e.oxw();return e.KtG(a.nodeSelected(n))})("onNodeUnselect",function(n){e.CHM(t);const a=e.oxw();return e.KtG(a.nodeUnSelected(n))}),e.YNc(2,xe,4,3,"ng-template",13),e.qZA(),e.YNc(3,Ge,1,0,"p-progressSpinner",14),e.qZA()}if(2&o){const t=e.oxw();e.xp6(1),e.Q6J("value",t.propertiesListData)("selection",t.selectedRows)("metaKeySelection",!1),e.xp6(2),e.Q6J("ngIf",t.loading.grid)}}let Q=(()=>{class o{instanceS;eventCenterS;constantsS;generalS;loading={grid:!1};subscriptions=[];propertiesListData=[];allTreeItemsMap={};selectedRows=[];checkedKeysMap={};key="_id";constructor(t,s,n,a){this.instanceS=t,this.eventCenterS=s,this.constantsS=n,this.generalS=a}ngOnInit(){var t=this;this.subscriptions.push(this.eventCenterS.collection.selectedCollections.pipe((0,Me.b)(300)).subscribe(function(){var s=(0,d.Z)(function*(n){yield t.loadSchemas()});return function(n){return s.apply(this,arguments)}}()))}loadSchemas(){var t=this;return(0,d.Z)(function*(){const s=t.eventCenterS.collection.selectedCollections.value;if(!s.length)return void(yield t.resetGridAndUrl());t.loading.grid=!0;const n=t.eventCenterS.group.selectedGroups.value[0];yield t.resetGridAndUrl(),t.allTreeItemsMap={};const a=(yield t.instanceS.getSchemas(s).toPromise()).data,r=[],u=[];for(const p of a){const f=[];if(p.propertyItems){const b=[];for(const x of p.propertyItems){const G=t.generalS.convertKTreeItemToPrimeNGTreeItem(x);t.setReadWriteRecursively(n,G),b.push(G),f.push(G)}u.push(b)}const S=p.instanceName+":"+p.databaseName+":"+p.collectionName,v={label:`${p.collectionName}`,children:f,_id:S,level1:!0,instanceName:p.instanceName,databaseName:p.databaseName,collectionName:p.collectionName};r.push(v),t.allTreeItemsMap[S]=v;for(const b of v?.children||[])b.parent=v}t.propertiesListData=r;for(const p of u)t.generateIdMap(p,t.allTreeItemsMap);if(t.eventCenterS.group.fields.value.join(",")){const p=c.intersection(c.keys(t.allTreeItemsMap),t.eventCenterS.group.fields.value);t.selectedRows=[];for(const f of p)t.allTreeItemsMap[f]&&t.selectedRows.push(t.allTreeItemsMap[f]);t.generalS.setDataInSelectedRowsFromIdArr(p,t.selectedRows,t.allTreeItemsMap),t.setDataInEventCenter()}t.loading.grid=!1})()}setReadWriteRecursively(t,s){const n=t?.fields?.[s.instanceName]?.[s.databaseName]?.[s.collectionName];if(!n)return;const a=n[s.path];if(a?(s.allowRead=a.allowRead,s.allowWrite=a.allowWrite):s.allowRead=s.allowWrite=!1,s.children&&s.children.length)for(const r of s.children)this.setReadWriteRecursively(t,r)}resetGridAndUrl(){var t=this;return(0,d.Z)(function*(){t.propertiesListData=[],t.allTreeItemsMap={},t.selectedRows=[],t.checkedKeysMap={},t.eventCenterS.group.schemaFields.next([])})()}checkedChange(){this.setDataInEventCenter()}nodeSelected(t){t.node.allowRead=!0}nodeUnSelected(t){const s=t.node;s.allowRead=!1,s.allowWrite=!1}removeDataItemFromSelectedRows(t){if(!t.allowRead&&!t.allowWrite){const s=this.selectedRows.indexOf(t);s>=0&&this.selectedRows.splice(s,1)}}calculateCheckedKeysMap(){this.checkedKeysMap={};for(const t of this.selectedRows)this.checkedKeysMap[t._id]=t}setDataInEventCenter(){this.calculateCheckedKeysMap(),this.eventCenterS.group.fields.next(c.map(this.selectedRows,"_id"));const t=[];for(const s of this.selectedRows)this.allTreeItemsMap[s._id]&&t.push(s);this.eventCenterS.group.schemaFields.next(t)}generateIdMap(t,s){if(Array.isArray(t))for(const n of t)this.generateIdMap(n,s);else s[t._id]=t,t.children&&this.generateIdMap(t.children,s)}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(s){return new(s||o)(e.Y36(D.E),e.Y36(I.u),e.Y36(P.L),e.Y36(A.b))};static \u0275cmp=e.Xpm({type:o,selectors:[["app-w-schema-fields"]],decls:12,vars:4,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],[1,"fas","fa-indent","text-success","fa-fw","mr-1"],["pTooltip","All Fields",1,"float-right","cursor-pointer"],[1,"mb-0","mt--2px"],[3,"ngModel","binary","ngModelChange"],[1,"card-body","p-0","h-100","overflow-hidden"],[1,"position-relative","border-top","h-100"],[4,"ngIf"],["class","h-100",4,"ngIf"],[1,"p-2","text-center","text-success"],[1,"h-100"],["scrollHeight","flex","selectionMode","checkbox",1,"w-full",3,"value","selection","metaKeySelection","selectionChange","onNodeSelect","onNodeUnselect"],["pTemplate","default"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[1,"w-100","prevent-text-selection","cursor-pointer"],["class","text-monospace font-weight-bold font-italic float-right mr-1","style","font-size: xx-small;",4,"ngIf"],["class","float-right small mr-2",4,"ngIf"],[1,"text-monospace","font-weight-bold","font-italic","float-right","mr-1",2,"font-size","xx-small"],[1,"float-right","small","mr-2"],[1,"align-middle","mb-0","mr-2"],["label","R",3,"ngModel","binary","ngModelChange","click"],[1,"align-middle","mb-0"],["label","W",3,"ngModel","binary","ngModelChange","click"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(s,n){1&s&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"i",2),e._uU(4," Schema Fields"),e.qZA(),e.TgZ(5,"span",3)(6,"label",4)(7,"p-checkbox",5),e.NdJ("ngModelChange",function(r){return n.eventCenterS.group.apisRegex.allFields=r}),e.qZA()()()(),e.TgZ(8,"div",6)(9,"div",7),e.YNc(10,De,3,1,"div",8),e.YNc(11,Fe,4,4,"div",9),e.qZA()()()),2&s&&(e.xp6(7),e.Q6J("ngModel",n.eventCenterS.group.apisRegex.allFields)("binary",!0),e.xp6(3),e.Q6J("ngIf",n.eventCenterS.group.apisRegex.allInstances||n.eventCenterS.group.apisRegex.allDatabases||n.eventCenterS.group.apisRegex.allCollections||n.eventCenterS.group.apisRegex.allFields),e.xp6(1),e.Q6J("ngIf",!(n.eventCenterS.group.apisRegex.allInstances||n.eventCenterS.group.apisRegex.allDatabases||n.eventCenterS.group.apisRegex.allCollections||n.eventCenterS.group.apisRegex.allFields)))},dependencies:[h.JJ,h.On,M.O5,w.jx,Te.mp,T.G,J.u,Ze.XZ],encapsulation:2})}return o})();function Re(o,l){1&o&&(e.TgZ(0,"div",21),e._UZ(1,"app-w-instances",10),e.qZA()),2&o&&(e.xp6(1),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0))}function Ee(o,l){1&o&&(e.TgZ(0,"div",22),e._UZ(1,"app-w-databases",10),e.qZA()),2&o&&(e.xp6(1),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0))}const Oe=function(){return[50,50]};let W=(()=>{class o{eventCenterS;EAPICategory=Z.R;constructor(t){this.eventCenterS=t}ngOnInit(){}ngOnDestroy(){this.eventCenterS.group.apisRegex={}}static \u0275fac=function(s){return new(s||o)(e.Y36(I.u))};static \u0275cmp=e.Xpm({type:o,selectors:[["app-group-layout"]],decls:34,vars:42,consts:[[1,"pt-1","pl-1","pr-1","overflow-auto"],[2,"width","max-content"],[1,"v-div","w-groups"],[1,"vertical-height-max"],[1,"v-div","w-categories"],[3,"typeIsGroup"],[1,"v-div","w-ins-db"],["layout","vertical",3,"panelSizes"],["pTemplate",""],[1,"v-div","w-collection"],[3,"metaKeySelection","IsReadOnly","IsDependentOnGroup"],[1,"v-div","w-ins-apis"],[3,"isLPM","isDependentOnGroup","treeViewId"],[1,"v-div","w-schema-fields"],[1,"v-div","w-third-party"],[3,"IsDependentOnGroup","isLPM"],[1,"v-div","w-custom-apis"],[3,"metaKeySelection","IsReadOnly","IsDependentOnGroup","isLPM"],[1,"v-div","w-system-apis"],[1,"v-div","w-web-sockets"],[3,"metaKeySelection","IsReadOnly","IsDependentOnGroup","showCheckbox","isLPM"],[1,"vertical-height-instances","w-100"],[1,"vertical-height-db","w-100"]],template:function(s,n){1&s&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e._UZ(4,"app-w-groups"),e.qZA()(),e.TgZ(5,"div",4)(6,"div",3),e._UZ(7,"app-w-api-categories",5),e.qZA()(),e.TgZ(8,"div",6)(9,"p-splitter",7),e.YNc(10,Re,2,3,"ng-template",8),e.YNc(11,Ee,2,3,"ng-template",8),e.qZA()(),e.TgZ(12,"div",9)(13,"div",3),e._UZ(14,"app-w-collections",10),e.qZA()(),e.TgZ(15,"div",11)(16,"div",3),e._UZ(17,"app-w-supported-api",12),e.qZA()(),e.TgZ(18,"div",13)(19,"div",3),e._UZ(20,"app-w-schema-fields"),e.qZA()(),e.TgZ(21,"div",14)(22,"div",3),e._UZ(23,"app-w-supported-tp-api",15),e.qZA()(),e.TgZ(24,"div",16)(25,"div",3),e._UZ(26,"app-custom-api-grid",17),e.qZA()(),e.TgZ(27,"div",18)(28,"div",3),e._UZ(29,"app-system-api-w",17),e.qZA()(),e.TgZ(30,"div",19)(31,"div",3),e._UZ(32,"app-web-socket-events-grid",20),e.qZA()()()(),e._UZ(33,"app-create-schema-form")),2&s&&(e.xp6(5),e.Udp("display",n.eventCenterS.group.selectedGroups.value.length?"block":"none"),e.xp6(2),e.Q6J("typeIsGroup","GROUP"),e.xp6(1),e.Udp("display",n.eventCenterS.group.selectedGroups.value.length&&(null==n.eventCenterS.apiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory.value||null==n.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:n.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===n.EAPICategory.INSTANCES?"block":"none"),e.xp6(1),e.Q6J("panelSizes",e.DdM(41,Oe)),e.xp6(3),e.Udp("display",n.eventCenterS.group.selectedGroups.value.length&&(null==n.eventCenterS.apiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory.value||null==n.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:n.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===n.EAPICategory.INSTANCES?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0),e.xp6(1),e.Udp("display",n.eventCenterS.group.selectedGroups.value.length&&(null==n.eventCenterS.apiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory.value||null==n.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:n.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===n.EAPICategory.INSTANCES?"block":"none"),e.xp6(2),e.Q6J("isLPM",!1)("isDependentOnGroup",!0)("treeViewId","treeViewFromGroupLayout"),e.xp6(1),e.Udp("display",n.eventCenterS.group.selectedGroups.value.length&&(null==n.eventCenterS.apiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory.value||null==n.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:n.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===n.EAPICategory.INSTANCES?"block":"none"),e.xp6(3),e.Udp("display",n.eventCenterS.group.selectedGroups.value.length&&(null==n.eventCenterS.apiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory.value||null==n.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:n.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===n.EAPICategory.THIRD_PARTY_APIS?"block":"none"),e.xp6(2),e.Q6J("IsDependentOnGroup",!0)("isLPM",!1),e.xp6(1),e.Udp("display",n.eventCenterS.group.selectedGroups.value.length&&(null==n.eventCenterS.apiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory.value||null==n.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:n.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===n.EAPICategory.CUSTOM_APIS?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0)("isLPM",!1),e.xp6(1),e.Udp("display",n.eventCenterS.group.selectedGroups.value.length&&(null==n.eventCenterS.apiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory.value||null==n.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:n.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===n.EAPICategory.SYSTEM_APIS?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0)("isLPM",!1),e.xp6(1),e.Udp("display",n.eventCenterS.group.selectedGroups.value.length&&(null==n.eventCenterS.apiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory.value||null==n.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:n.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===n.EAPICategory.WEB_SOCKET_EVENT?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0)("showCheckbox",!0)("isLPM",!1))},dependencies:[w.jx,H.q,V.f,j.O,z.n,X.c,ee.G,te.X,ne.T,se.d,ae.A,oe.x,Y,Q],styles:[".vertical-height-instances[_ngcontent-%COMP%]{height:248px}.vertical-height-db[_ngcontent-%COMP%]{height:calc(100vh - 320px)}.vertical-height-max[_ngcontent-%COMP%]{height:calc(100vh - 66px)}.v-div[_ngcontent-%COMP%]{display:inline-block;height:calc(100vh - 62px);float:left}.w-groups[_ngcontent-%COMP%]{width:20rem}.w-categories[_ngcontent-%COMP%]{width:17rem}.w-ins-db[_ngcontent-%COMP%]{width:25rem}.w-collection[_ngcontent-%COMP%]{width:28rem}.w-ins-apis[_ngcontent-%COMP%], .w-schema-fields[_ngcontent-%COMP%]{width:35rem}.w-custom-apis[_ngcontent-%COMP%], .w-system-apis[_ngcontent-%COMP%], .w-third-party[_ngcontent-%COMP%], .w-web-sockets[_ngcontent-%COMP%]{width:calc(100vw - 37.5rem)}"]})}return o})();i(3965);var Ye=i(1678),Qe=i(5765),We=i(4211),qe=i(4186),Be=i(2777),Ke=i(7705),Le=i(1434);const He=[{path:"group-layout",component:W,canActivate:[K.P]}];let Ve=(()=>{class o{static \u0275fac=function(s){return new(s||o)};static \u0275mod=e.oAB({type:o});static \u0275inj=e.cJS({imports:[q.Bz.forChild(He),B.u,Ye.DashboardM,We.DbCellM,Qe.FunctionManM,qe.SystemApiM,Le.B,Be.u,Ke.L,L.WebSocketEventsM]})}return o})()}}]);
package/dist/6855.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[6855,6925,8374,8682,1617],{6855:(pt,P,r)=>{r.r(P),r.d(P,{DbMastersM:()=>fe});var E=r(7664),x=r(8176),A=r(3726),d=r(5861),m=r(95),_=r(6990),u=r(3157),f=r(328),v=r(9361),M=r(1162),D=r(553),U=r(5085),s=r(1601),b=r(3531),H=r(9989),t=r(4946),w=r(9961),k=r(7240),y=r(7414),j=r(9729),J=r(5852),z=r(2304),W=r(4795),Y=r(3429),R=r(2915),V=r(2189),K=r(3835),L=r(6814),X=r(2660),tt=r(5860),et=r(756),B=r(7680),Q=r(4844),G=r(3259),_t=r(3965),at=r(5025);const ht=["insertCodeModalC"],gt=["monacoEditorModalC"];function Ct(i,l){1&i&&(t.TgZ(0,"span"),t._UZ(1,"i",37),t._uU(2," Add UI Page"),t.qZA())}function Mt(i,l){1&i&&(t.TgZ(0,"span"),t._UZ(1,"i",38),t._uU(2," View UI Page"),t.qZA())}function bt(i,l){if(1&i&&(t.TgZ(0,"span"),t._UZ(1,"i",39),t._uU(2," Edit UI Page "),t.TgZ(3,"span",40),t._uU(4),t.qZA(),t.TgZ(5,"span",40),t._uU(6),t.qZA(),t.TgZ(7,"span",40),t._uU(8),t.qZA(),t.TgZ(9,"span",40),t._uU(10),t.qZA()()),2&i){const e=t.oxw();t.xp6(4),t.Oqu(null==e.form.get("instanceName").value?null:e.form.get("instanceName").value.name),t.xp6(2),t.hij("| \xa0",null==e.form.get("databaseName").value?null:e.form.get("databaseName").value.db,""),t.xp6(2),t.hij("| \xa0",null==e.form.get("collectionName").value?null:e.form.get("collectionName").value.name,""),t.xp6(2),t.hij("| \xa0",e.form.get("name").value,"")}}function Tt(i,l){if(1&i){const e=t.EpF();t.TgZ(0,"div",41)(1,"app-monaco-editor",42),t.NdJ("editorGenerated",function(o){t.CHM(e);const n=t.oxw();return t.KtG(n.editorGenerated(o))}),t.qZA()()}if(2&i){const e=t.oxw();t.xp6(1),t.Q6J("isSchemaEditor",!0)("isUIMakerEditor",!1)("editorOptions",e.editorOptionsDBMasters)}}function St(i,l){if(1&i){const e=t.EpF();t.TgZ(0,"div",41)(1,"app-monaco-editor",42),t.NdJ("editorGenerated",function(o){t.CHM(e);const n=t.oxw();return t.KtG(n.editorGeneratedJSUtil(o))}),t.qZA()()}if(2&i){const e=t.oxw();t.xp6(1),t.Q6J("isSchemaEditor",!0)("isUIMakerEditor",!0)("editorOptions",e.editorOptionsDBMastersJS)}}function vt(i,l){if(1&i&&(t.TgZ(0,"span",43),t._uU(1),t.qZA()),2&i){const e=t.oxw();t.xp6(1),t.AsE(" You are allowed to use ",null==e.authS.backendSettings?null:e.authS.backendSettings.dbMastersCountForUI," UI pages, and you are using ",e.totalCreatedMasters," UI Pages. ")}}function Dt(i,l){if(1&i){const e=t.EpF();t.TgZ(0,"a",44),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.viewError())}),t._uU(1,"View error"),t.qZA()}}function Ut(i,l){1&i&&(t.TgZ(0,"span"),t._uU(1,"Update"),t.qZA())}function Zt(i,l){if(1&i){const e=t.EpF();t.TgZ(0,"button",45),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.save(!1))}),t._UZ(1,"i",46),t.YNc(2,Ut,2,0,"span",4),t.qZA()}if(2&i){const e=t.oxw();t.Q6J("disabled",e.form.invalid),t.xp6(2),t.Q6J("ngIf",e.data.mode===e.EFormMode.EDIT)}}function It(i,l){1&i&&(t.TgZ(0,"span"),t._uU(1,"Save"),t.qZA())}function xt(i,l){1&i&&(t.TgZ(0,"span"),t._uU(1,"Update & Close"),t.qZA())}function wt(i,l){if(1&i){const e=t.EpF();t.TgZ(0,"button",45),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.save(!0))}),t._UZ(1,"i",46),t.YNc(2,It,2,0,"span",4),t.YNc(3,xt,2,0,"span",4),t.qZA()}if(2&i){const e=t.oxw();t.Q6J("disabled",e.form.invalid||e.totalCreatedMasters>(null==e.authS.backendSettings?null:e.authS.backendSettings.dbMastersCountForUI)),t.xp6(2),t.Q6J("ngIf",e.data.mode===e.EFormMode.ADD),t.xp6(1),t.Q6J("ngIf",e.data.mode===e.EFormMode.EDIT)}}function kt(i,l){1&i&&t._UZ(0,"p-progressSpinner",47)}let ot=(()=>{class i{fb;ns;generalS;constantsS;dbMastersS;authCS;monacoS;authS;instanceS;eventCenterS;generalCS;navigationCS;userS;cd;data;totalCreatedMasters;loading={form:!1};EFormMode=f.D;form;subscriptions=[];formData;IEventData=u.F;id;BE_HOST_PORT=D.N.BE_HOST_PORT;DOCS_HOST_PORT=D.N.DOCS_HOST_PORT;instances=[];editorDBMaster;editorDBMasterJS;editorOptionsDBMasters={readOnly:!1,language:"typescript",contextmenu:!0};editorOptionsDBMastersJS={readOnly:!1,language:"typescript",contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"json",contextmenu:!0};insertCodeModalC;viewDockerfileModelC;shouldLoadMonacoEditor=!1;monacoDecorations=[];tab={};dbIdMap={};colIdMap={};formDataTemp=null;constructor(e,a,o,n,c,p,C,g,h,Z,I,N,O,F){this.fb=e,this.ns=a,this.generalS=o,this.constantsS=n,this.dbMastersS=c,this.authCS=p,this.monacoS=C,this.authS=g,this.instanceS=h,this.eventCenterS=Z,this.generalCS=I,this.navigationCS=N,this.userS=O,this.cd=F}ngOnInit(){var e=this;return(0,d.Z)(function*(){e.createForm(),e.subscriptions.push(e.data.eventChannel.subscribe(function(){var a=(0,d.Z)(function*(o){if(o)if(e.form.enable(),o.action===u.F.OPEN_FORM_IN_EDIT_MODE)yield e.editViewLoadData(),e.cd.detectChanges();else if(o.action===u.F.OPEN_FORM_IN_VIEW_MODE)yield e.editViewLoadData(),e.form.disable(),e.cd.detectChanges();else if(o.action===u.F.OPEN_FORM_IN_ADD_MODE){e.form.reset(),e.resetDependentObjects("INSTANCE"),yield e.loadInstances();const n=yield e.instanceS.getDefaultContent(e.BE_HOST_PORT,U.R.DB_MASTERS_JSON).toPromise();e.editorOptionsDBMasters={readOnly:!1},e.generalCS.setValueInEditor(e,"editorDBMaster",n.data);const c=yield e.instanceS.getDefaultContent(e.BE_HOST_PORT,U.R.DB_MASTERS_JS_UTILS).toPromise();e.editorOptionsDBMastersJS={readOnly:!1},e.generalCS.setValueInEditor(e,"editorDBMasterJS",c.data),e.cd.detectChanges()}});return function(o){return a.apply(this,arguments)}}()))})()}editViewLoadData(){var e=this;return(0,d.Z)(function*(){const a=yield e.dbMastersS.getById(e.data.formData._id).toPromise();e.form.reset(),e.resetDependentObjects("INSTANCE"),e.form.patchValue(a.data),e.formDataTemp=a.data,e.generalCS.setValueInEditor(e,"editorDBMaster",a.data?.dbMasterConfigCode||""),e.generalCS.setValueInEditor(e,"editorDBMasterJS",a.data?.pageUtilsCode||""),yield e.loadInstances(),e.formDataTemp=null})()}createForm(){this.form=this.fb.group({name:[null,[m.kI.required,m.kI.minLength(3),m.kI.maxLength(50),m.kI.pattern("[a-zA-Z0-9_-]*$")]],instanceName:[null,[m.kI.required]],databaseName:[null,[m.kI.required]],collectionName:[null,[m.kI.required]]})}showModal(){this.lastError=void 0,this.shouldLoadMonacoEditor=!0,setTimeout(()=>{$("#idDBMastersForm").modal("show")},100)}hideModal(){$("#idDBMastersForm").modal("hide")}save(e){var a=this;return(0,d.Z)(function*(){const o=a.form.getRawValue();let C;o.instanceName=o.instanceName.name,o.databaseName=o.databaseName.db,o.collectionName=o.collectionName.name,C=a.data.formData&&a.data.formData._id?(yield a.dbMastersS.getById(a.data.formData._id).toPromise()).data:{};const g=Object.assign({},C,o);g.user=a.authCS.getUserId(),g.dbMasterConfigCode=a.editorDBMaster.getValue(),g.pageUtilsCode=a.editorDBMasterJS.getValue();try{let h;a.loading.form=!0,a.lastError=void 0,a.monacoS.clearEditorDecorations(a.editorDBMaster,a.monacoDecorations),a.monacoS.clearEditorDecorations(a.editorDBMasterJS,a.monacoDecorations),a.data.mode===f.D.ADD?h=yield a.dbMastersS.post(g).toPromise():a.data.mode===f.D.EDIT&&(h=yield a.dbMastersS.put(g._id,g,{select:M.iH._id}).toPromise()),a.ns.showSuccess(a.data.mode===f.D.ADD?a.constantsS.dbMaster.addSuccess:a.constantsS.dbMaster.editSuccess),e&&a.data.eventChannel.emit({action:a.data.mode===f.D.ADD?u.F.SAVED:u.F.UPDATED,data:h}),a.loading.form=!1}catch(h){a.loading.form=!1,a.ns.showErrorFromResponse(h.error||h,"Unable to save database master."),a.lastError=h.error,a.tab={axiosResponse:{data:h.error}},a.monacoS.highlightErrorInMonacoEditor(a.editorDBMaster,a.tab,"MainSandbox.ts",a.monacoDecorations)}a.cd.detectChanges()})()}showInsertCodeModel(){this.generalCS.messageReceivedFor=v.H.All,this.insertCodeModalC.showModal(b.b.CodeFinderResultC)}editorGenerated(e){var a=this;return(0,d.Z)(function*(){a.editorDBMaster=e,yield a.monacoS.loadSchemaEditorSettings(a.BE_HOST_PORT,a.authCS.getUserId(),null),a.monacoS.addSaveCodeKeyBinding(e,o=>{a.form.valid&&a.save(!1)}),a.monacoS.addInsertCodeKeyBinding(e,o=>{a.generalCS.messageReceivedFor=v.H.All,a.data.mode!==f.D.VIEW&&a.insertCodeModalC.showModal(b.b.DBMastersFormC)}),a.subscriptions.push(a.generalS.messageReceived.subscribe(o=>{o.type&&o.type===H.g.TEXT_COPIED&&o.componentName===b.b.DBMastersFormC&&(a.monacoS.insertAtCursor(e,o.selectedText),a.insertCodeModalC.hideModal())}))})()}editorGeneratedJSUtil(e){var a=this;return(0,d.Z)(function*(){a.editorDBMasterJS=e,yield a.monacoS.loadSchemaEditorSettings(a.BE_HOST_PORT,a.authCS.getUserId(),null),a.monacoS.addSaveCodeKeyBinding(e,o=>{a.form.valid&&a.save(!1)}),a.monacoS.addInsertCodeKeyBinding(e,o=>{a.generalCS.messageReceivedFor=v.H.All,a.data.mode!==f.D.VIEW&&a.insertCodeModalC.showModal(b.b.DBMastersFormC)}),a.subscriptions.push(a.generalS.messageReceived.subscribe(o=>{o.type&&o.type===H.g.TEXT_COPIED&&o.componentName===b.b.DBMastersFormC&&(a.monacoS.insertAtCursor(e,o.selectedText),a.insertCodeModalC.hideModal())}))})()}viewError(){this.viewDockerfileModelC.showModal(this.generalS.stringify(this.lastError),s.d.json)}loadInstances(){var e=this;return(0,d.Z)(function*(){e.resetDependentObjects("INSTANCE"),e.loading.form=!0;try{const a={find:{user:e.authCS.getUserId(),active:!0},select:{name:1,active:1,user:1},sort:{name:1}};e.tab.allInstances=(yield e.instanceS.query(a).toPromise()).data||[]}catch(a){e.ns.showErrorMessageFromErrorObject(a),e.tab.allInstances=[]}if(e.formDataTemp){const a=e.form.controls.instanceName;e.tab.instance=_.find(e.tab.allInstances,{name:e.formDataTemp.instanceName}),e.tab.instance&&a.setValue(e.tab.instance)}else e.tab.instance=e.tab.allInstances[0];yield e.loadDatabases(),e.loading.form=!1,e.cd.detectChanges()})()}loadDatabases(){var e=this;return(0,d.Z)(function*(){if(e.loading.form=!0,e.resetDependentObjects("DATABASE"),!e.tab.instance)return e.tab.allDatabases=[],void(e.tab.allCollections=[]);try{e.tab.allDatabases=((yield e.instanceS.getDatabases([e.tab.instance]).toPromise()).data||[])[0]||[],e.dbIdMap=_.keyBy(e.tab.allDatabases,M.N7.db)}catch(a){e.ns.showErrorMessageFromErrorObject(a),e.tab.allDatabases=[]}if(e.formDataTemp){const a=e.form.get("databaseName");e.tab.database=_.find(e.tab.allDatabases,{db:e.formDataTemp.databaseName}),e.tab.database&&a.patchValue(e.tab.database)}else e.tab.database=e.tab.allDatabases[0];yield e.loadCollections(),e.loading.form=!1})()}loadCollections(){var e=this;return(0,d.Z)(function*(){if(e.loading.form=!0,e.resetDependentObjects("COLLECTION"),e.tab.instance&&e.tab.database){try{e.tab.allCollections=((yield e.instanceS.getCollections([e.tab.database]).toPromise()).data||[])[0]||[],e.colIdMap=_.keyBy(e.tab.allCollections,M.GR.name)}catch(a){e.ns.showErrorMessageFromErrorObject(a),e.tab.allCollections=[]}if(e.formDataTemp){const a=e.form.get("collectionName");e.tab.collection=_.find(e.tab.allCollections,{name:e.formDataTemp.collectionName}),e.tab.collection&&a.patchValue(e.tab.collection)}else e.tab.collection=e.tab.allCollections[0];e.loading.form=!1,e.cd.detectChanges()}else e.tab.allCollections=[]})()}resetDependentObjects(e){"INSTANCE"===e?(this.tab.allInstances=this.tab.allDatabases=this.tab.allCollections=[],this.tab.instance=this.tab.database=this.tab.collection=this.tab.api=void 0):"DATABASE"===e?(this.tab.allDatabases=this.tab.allCollections=[],this.tab.database=this.tab.collection=this.tab.api=void 0):"COLLECTION"===e&&(this.tab.allCollections=[],this.tab.collection=this.tab.api=void 0)}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(a){return new(a||i)(t.Y36(m.qu),t.Y36(w.W),t.Y36(k.b),t.Y36(y.L),t.Y36(j.z),t.Y36(J.D),t.Y36(z.b),t.Y36(W.e),t.Y36(Y.E),t.Y36(R.u),t.Y36(k.b),t.Y36(V.S),t.Y36(K.K),t.Y36(t.sBO))};static \u0275cmp=t.Xpm({type:i,selectors:[["app-db-masters-form"]],viewQuery:function(a,o){if(1&a&&(t.Gf(ht,5),t.Gf(gt,5)),2&a){let n;t.iGM(n=t.CRH())&&(o.insertCodeModalC=n.first),t.iGM(n=t.CRH())&&(o.viewDockerfileModelC=n.first)}},inputs:{data:"data",totalCreatedMasters:"totalCreatedMasters"},decls:56,vars:23,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idDBMastersForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-full"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],[1,"float-right"],["aria-label","Close","data-dismiss","modal","type","button",1,"close",3,"click"],["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"],["href","https://docs.apimaker.dev/v1/extensions/ui_maker/introduction.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-3","mr-1","mt-n2",2,"font-size","25px"],[1,"modal-body","overflow-auto"],["header","Basic Info"],[1,"container","pt-3",3,"formGroup"],[1,"form-group","row"],[1,"col-3","col-form-label","col-form-label-sm","text-right"],[1,"col-7"],["formControlName","name","name","name","spellcheck","false","type","text","placeholder","Please provide name",1,"form-control","form-control-sm"],["optionLabel","name","filterBy","name","appendTo","body","formControlName","instanceName","styleClass","w-100 p-input-filled",3,"options","filter","onChange"],["formControlName","databaseName","optionLabel","db","filterBy","db","appendTo","body","styleClass","w-100 p-input-filled",3,"options","filter","onChange"],["formControlName","collectionName","optionLabel","name","filterBy","name","appendTo","body","styleClass","w-100 p-input-filled",3,"options","filter","onChange"],["header","Config"],["class","overflow-hidden","style","height: calc(100vh - 206px);",4,"ngIf"],["header","Utility Functions (Main)"],[1,"modal-footer"],["class","mr-3 small text-danger",4,"ngIf"],["href","javascript:;","class","text-danger",3,"click",4,"ngIf"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary",3,"click"],[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,"frameId","modalId","docsHostPort"],["insertCodeModalC",""],[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"],[1,"ml-2","font-weight-normal","small","text-muted"],[1,"overflow-hidden",2,"height","calc(100vh - 206px)"],[3,"isSchemaEditor","isUIMakerEditor","editorOptions","editorGenerated"],[1,"mr-3","small","text-danger"],["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(a,o){1&a&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),t.YNc(4,Ct,3,0,"span",4),t.YNc(5,Mt,3,0,"span",4),t.YNc(6,bt,11,4,"span",4),t.TgZ(7,"div",5)(8,"button",6),t.NdJ("click",function(){return o.hideModal()}),t.TgZ(9,"span",7),t._UZ(10,"i",8),t.qZA()(),t.TgZ(11,"span",9),t.NdJ("click",function(){return o.showInsertCodeModel()}),t._UZ(12,"i",10),t.qZA(),t.TgZ(13,"a",11),t._UZ(14,"img",12),t.qZA()()(),t.TgZ(15,"div",13)(16,"p-tabView")(17,"p-tabPanel",14)(18,"form",15)(19,"div",16)(20,"label",17),t._uU(21,"Name"),t.qZA(),t.TgZ(22,"div",18),t._UZ(23,"input",19),t.qZA()(),t.TgZ(24,"div",16)(25,"label",17),t._uU(26,"Instance"),t.qZA(),t.TgZ(27,"div",18)(28,"p-dropdown",20),t.NdJ("onChange",function(c){return o.tab.instance=c.value,o.loadDatabases()}),t.qZA()()(),t.TgZ(29,"div",16)(30,"label",17),t._uU(31,"Database"),t.qZA(),t.TgZ(32,"div",18)(33,"p-dropdown",21),t.NdJ("onChange",function(c){return o.tab.database=c.value,o.loadCollections()}),t.qZA()()(),t.TgZ(34,"div",16)(35,"label",17),t._uU(36,"Collection"),t.qZA(),t.TgZ(37,"div",18)(38,"p-dropdown",22),t.NdJ("onChange",function(c){return o.tab.collection=c.value}),t.qZA()()()()(),t.TgZ(39,"p-tabPanel",23),t.YNc(40,Tt,2,3,"div",24),t.qZA(),t.TgZ(41,"p-tabPanel",25),t.YNc(42,St,2,3,"div",24),t.qZA()()(),t.TgZ(43,"div",26),t.YNc(44,vt,2,2,"span",27),t.YNc(45,Dt,2,0,"a",28),t.TgZ(46,"button",29),t.NdJ("click",function(){return o.hideModal()}),t._UZ(47,"i",30),t._uU(48," Close"),t.qZA(),t.YNc(49,Zt,3,2,"button",31),t.YNc(50,wt,4,3,"button",31),t.qZA(),t.YNc(51,kt,1,0,"p-progressSpinner",32),t.qZA()()(),t._UZ(52,"app-insert-code-modal",33,34)(54,"app-monaco-editor-modal",35,36)),2&a&&(t.xp6(4),t.Q6J("ngIf",o.data.mode===o.EFormMode.ADD),t.xp6(1),t.Q6J("ngIf",o.data.mode===o.EFormMode.VIEW),t.xp6(1),t.Q6J("ngIf",o.data.mode===o.EFormMode.EDIT),t.xp6(12),t.Q6J("formGroup",o.form),t.xp6(10),t.Q6J("options",o.tab.allInstances)("filter",!0),t.xp6(5),t.Q6J("options",o.tab.allDatabases)("filter",!0),t.xp6(5),t.Q6J("options",o.tab.allCollections)("filter",!0),t.xp6(2),t.Q6J("ngIf",o.shouldLoadMonacoEditor),t.xp6(2),t.Q6J("ngIf",o.shouldLoadMonacoEditor),t.xp6(2),t.Q6J("ngIf",o.totalCreatedMasters>(null==o.authS.backendSettings?null:o.authS.backendSettings.dbMastersCountForUI)),t.xp6(1),t.Q6J("ngIf",o.lastError),t.xp6(4),t.Q6J("ngIf",o.data.mode===o.EFormMode.EDIT),t.xp6(1),t.Q6J("ngIf",o.data.mode!==o.EFormMode.VIEW),t.xp6(1),t.Q6J("ngIf",o.loading.form),t.xp6(1),t.Q6J("frameId","idInsertCodeDbMig")("modalId","idInsertCodeDbMigForm")("docsHostPort",o.DOCS_HOST_PORT),t.xp6(2),t.Q6J("modalId","idMonacoEditorModalDBMaster")("editorOptionsMonacoEditorModal",o.editorOptionsMonacoEditorModal)("modalTitle","Error info"))},dependencies:[m._Y,m.Fj,m.JJ,m.JL,m.sg,m.u,L.O5,X.y,tt.P,et.O,B.G,Q.xf,Q.x4,G.u,_t.Lt,at.A],encapsulation:2,changeDetection:0})}return i})();var it=r(4950);let yt=(()=>{class i{static \u0275fac=function(a){return new(a||i)};static \u0275mod=t.oAB({type:i});static \u0275inj=t.cJS({imports:[x.u,it.A]})}return i})();var T=r(6212),st=r(6925),nt=r(2466),rt=r(921),Et=r(5561),q=r(5219),S=r(5431);const At=["DBMastersFormC"];function Nt(i,l){if(1&i){const e=t.EpF();t.TgZ(0,"span",19),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.edit())}),t._UZ(1,"i",20),t.qZA()}}function Ot(i,l){if(1&i){const e=t.EpF();t.TgZ(0,"span",21),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.removePermanent())}),t._UZ(1,"i",22),t.qZA()}}function Ft(i,l){1&i&&(t.TgZ(0,"th",24),t._UZ(1,"p-tableHeaderCheckbox"),t.qZA())}function Pt(i,l){if(1&i&&(t.TgZ(0,"tr"),t.YNc(1,Ft,2,0,"th",23),t.TgZ(2,"th",24),t._uU(3,"*"),t.qZA(),t.TgZ(4,"th",25),t._uU(5,"Name"),t.qZA(),t.TgZ(6,"th"),t._uU(7,"Instance \u2192 Database \u2192 Collection"),t.qZA(),t.TgZ(8,"th"),t._uU(9,"Required Auth Headers"),t.qZA(),t._UZ(10,"th",26),t.qZA()),2&i){const e=t.oxw();t.xp6(1),t.Q6J("ngIf",e.showCheckbox)}}function Jt(i,l){if(1&i&&(t.TgZ(0,"td"),t._UZ(1,"p-tableCheckbox",32),t.qZA()),2&i){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("value",e)("pSelectableRow",e)}}function Yt(i,l){if(1&i){const e=t.EpF();t.TgZ(0,"tr",27),t.YNc(1,Jt,2,2,"td",28),t.TgZ(2,"td"),t._uU(3),t.qZA(),t.TgZ(4,"td"),t._uU(5),t.qZA(),t.TgZ(6,"td"),t._uU(7),t.qZA(),t.TgZ(8,"td"),t._uU(9),t.qZA(),t.TgZ(10,"td")(11,"div",29)(12,"button",30),t.NdJ("click",function(){const n=t.CHM(e).$implicit,c=t.oxw();return t.KtG(c.openMasterPageInNewTab(n))}),t._UZ(13,"i",31),t.qZA()()()()}if(2&i){const e=l.$implicit,a=l.rowIndex,o=t.oxw();t.Q6J("pSelectableRow",e),t.xp6(1),t.Q6J("ngIf",o.showCheckbox),t.xp6(2),t.Oqu(a+1),t.xp6(2),t.Oqu(e.name),t.xp6(2),t.lnq("",e.instanceName," \u2192 ",e.databaseName," \u2192 ",e.collectionName,""),t.xp6(2),t.Oqu(e.authHeadersGrid)}}function Rt(i,l){1&i&&t._UZ(0,"p-progressSpinner",33)}let lt=(()=>{class i{dbMastersS;generalS;notificationS;navigationCS;navigationS;authCS;authS;constantsS;eventCenterS;router;userS;instanceS;ns;cs;confirmationService;cd;showCheckbox=!0;loading={grid:!1};subscriptions=[];data={mode:f.D.ADD,eventChannel:new t.vpe,formData:void 0};rows=[];rowsMap={};EUserType=rt.dN;gridKey=M.iH._id;EAPICategory=U.R;ENavigationMenu=nt.E;selectedRows=[];dbMastersFormC;constructor(e,a,o,n,c,p,C,g,h,Z,I,N,O,F,pe,_e){this.dbMastersS=e,this.generalS=a,this.notificationS=o,this.navigationCS=n,this.navigationS=c,this.authCS=p,this.authS=C,this.constantsS=g,this.eventCenterS=h,this.router=Z,this.userS=I,this.instanceS=N,this.ns=O,this.cs=F,this.confirmationService=pe,this.cd=_e}ngOnInit(){var e=this;return(0,d.Z)(function*(){if(!e.authS.backendSettings.extensions)return e.navigationS.gotoDashboard();e.eventCenterS.dbMasters.selectedDBMaster.next(void 0),yield e.loadGridData(),e.subscriptions.push(e.data.eventChannel.subscribe(function(){var a=(0,d.Z)(function*(o){(o.action===u.F.SAVED||o.action===u.F.UPDATED)&&(e.dbMastersFormC.hideModal(),yield e.loadGridData())});return function(o){return a.apply(this,arguments)}}())),e.generalS.setNewTitle("UI Maker")})()}loadGridData(){var e=this;return(0,d.Z)(function*(){e.loading.grid=!0;const a=yield e.dbMastersS.getDBMastersGrid({}).toPromise();if(a){e.selectedRows=[],e.rows=a.data,e.rowsMap=_.keyBy(e.rows,M.iH._id);for(const n of e.rows){const c=[];for(const p of n.authHeaders||[])c.push(p.name);n.authHeadersGrid=c.join(", ")}}let o=e.navigationCS.getQueryParam(T.p.am_db_master);o&&!e.rowsMap[o]&&e.rows.length&&(o=e.rows[0]._id),e.rowsMap[o]?yield e.fillData():e.eventCenterS.dbMasters.selectedDBMaster.next(void 0),e.loading.grid=!1,e.cd.detectChanges()})()}add(){this.data.formData={order:(_.max(_.map(this.rows,"order"))||0)+1},this.data.mode=f.D.ADD,this.data.eventChannel.emit({action:u.F.OPEN_FORM_IN_ADD_MODE,data:this.data.formData}),this.dbMastersFormC.showModal()}edit(){this.data.formData=this.rowsMap[_.map(this.selectedRows,"_id")[0]],this.data.mode=f.D.EDIT,this.data.eventChannel.emit({action:u.F.OPEN_FORM_IN_EDIT_MODE}),this.dbMastersFormC.showModal()}removePermanent(){var e=this;return(0,d.Z)(function*(){var a;e.confirmationService.confirm({message:e.cs.dbMaster.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(a=(0,d.Z)(function*(){for(const o of e.selectedRows)yield e.hardDelete(o._id);e.ns.showSuccess(e.cs.dbMaster.removePermanent),yield e.loadGridData()}),function(){return a.apply(this,arguments)})})})()}hardDelete(e){var a=this;return(0,d.Z)(function*(){yield a.dbMastersS.permanentDelete(e).toPromise()})()}resetSelectedRows(){this.selectedRows.length=0,this.eventCenterS.dbMasters.selectedDBMaster.next(void 0)}resetThisUrl(){var e=this;return(0,d.Z)(function*(){e.eventCenterS.dbMasters.selectedDBMaster.next(void 0),yield e.navigationCS.setQueryParam(T.p.am_db_master,null)})()}itemSelected(){var e=this;return(0,d.Z)(function*(){yield e.resetThisUrl(),setTimeout(e.fillData.bind(e))})()}fillData(){var e=this;return(0,d.Z)(function*(){if(!e.selectedRows.length)return yield e.navigationCS.setQueryParam(T.p.am_db_master,""),void e.eventCenterS.dbMasters.selectedDBMaster.next(null);const a=e.selectedRows[0];a?(yield e.navigationCS.setQueryParam(T.p.am_db_master,a._id),e.eventCenterS.dbMasters.selectedDBMaster.next(a)):yield e.resetThisUrl()})()}dblClick(){this.selectedRows.length&&this.edit()}openMasterPageInNewTab(e){const a=this.authCS.getUserPath();let o=[D.N.BE_HOST_PORT,"/dist-db-masters/browser/",`?${st.ZF.ADMIN_PATH}=${a}&`].join("");const n=[`${st.ZF.DB_MASTER_NAME}=${e.name}`];for(const c of e.authHeaders)n.push(`${c.name}=____actual_header_value____`);o+=n.join("&"),window.open(o,"_blank")}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(a){return new(a||i)(t.Y36(j.z),t.Y36(k.b),t.Y36(w.W),t.Y36(V.S),t.Y36(Et.X),t.Y36(J.D),t.Y36(W.e),t.Y36(y.L),t.Y36(R.u),t.Y36(E.F0),t.Y36(K.K),t.Y36(Y.E),t.Y36(w.W),t.Y36(y.L),t.Y36(q.YP),t.Y36(t.sBO))};static \u0275cmp=t.Xpm({type:i,selectors:[["app-db-masters-list"]],viewQuery:function(a,o){if(1&a&&t.Gf(At,5),2&a){let n;t.iGM(n=t.CRH())&&(o.dbMastersFormC=n.first)}},inputs:{showCheckbox:"showCheckbox"},decls:26,vars:16,consts:[[1,"card","shadow-sm","h-100"],["pTooltip","",1,"card-header"],["src","/assets/images/icons/ui-maker.svg","alt","Database master image",1,"fa-fw","mr-1"],[1,"small","ml-3"],["href","https://docs.apimaker.dev/v1/extensions/ui_maker/introduction.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","Common Utilities For UI Pages",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fab","fa-uniregistry","text-info","fa-fw"],["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","Permanent Delete",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["styleClass","p-datatable-striped","scrollHeight","calc(100vh - 82px)",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,"totalCreatedMasters","data"],["DBMastersFormC",""],["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","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],["style","width: 45px;",4,"ngIf"],[2,"width","45px"],[2,"width","25%"],[2,"width","70px"],[3,"pSelectableRow"],[4,"ngIf"],[1,"text-center"],["tooltipPosition","left","pTooltip","Open master page",1,"btn","btn-xsm-custom",3,"click"],[1,"fas","fa-external-link-alt","text-info","fa-fw"],[3,"value","pSelectableRow"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(a,o){1&a&&(t.TgZ(0,"div",0)(1,"div",1)(2,"span")(3,"span"),t._UZ(4,"img",2),t._uU(5," UI Pages"),t.qZA(),t.TgZ(6,"span",3),t._uU(7,"Using "),t.TgZ(8,"span"),t._uU(9),t.qZA(),t._uU(10),t.qZA()(),t.TgZ(11,"a",4),t._UZ(12,"img",5),t.qZA(),t.TgZ(13,"span",6),t.NdJ("click",function(){return o.router.navigate([o.ENavigationMenu.DBMasters,"utils"])}),t._UZ(14,"i",7),t.qZA(),t.TgZ(15,"span",8),t.NdJ("click",function(){return o.add()}),t._UZ(16,"i",9),t.qZA(),t.YNc(17,Nt,2,0,"span",10),t.YNc(18,Ot,2,0,"span",11),t.qZA(),t.TgZ(19,"div",12)(20,"p-table",13),t.NdJ("selectionChange",function(c){return o.selectedRows=c})("selectionChange",function(){return o.itemSelected()})("dblclick",function(){return o.dblClick()}),t.YNc(21,Pt,11,1,"ng-template",14),t.YNc(22,Yt,14,8,"ng-template",15),t.qZA(),t.YNc(23,Rt,1,0,"p-progressSpinner",16),t.qZA()(),t._UZ(24,"app-db-masters-form",17,18)),2&a&&(t.xp6(8),t.Tol((null==o.rows?null:o.rows.length)>(null==o.authS.backendSettings?null:o.authS.backendSettings.dbMastersCountForUI)?"text-danger":""),t.xp6(1),t.hij(" ",o.rows.length,""),t.xp6(1),t.hij("/",o.authS.backendSettings.dbMastersCountForUI," "),t.xp6(7),t.Q6J("ngIf",o.selectedRows.length&&o.selectedRows.length<2),t.xp6(1),t.Q6J("ngIf",o.selectedRows.length),t.xp6(2),t.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",o.selectedRows)("dataKey",o.gridKey)("scrollable",!0)("value",o.rows),t.xp6(3),t.Q6J("ngIf",o.loading.grid),t.xp6(1),t.Q6J("totalCreatedMasters",null==o.rows?null:o.rows.length)("data",o.data))},dependencies:[L.O5,S.iA,q.jx,S.Ei,S.UA,S.Mo,B.G,G.u,ot],encapsulation:2,changeDetection:0})}return i})(),dt=(()=>{class i{constructor(){}ngOnInit(){}static \u0275fac=function(a){return new(a||i)};static \u0275cmp=t.Xpm({type:i,selectors:[["app-db-masters-layout"]],decls:2,vars:0,consts:[[1,"pt-1","pl-1","pr-1","overflow-auto"]],template:function(a,o){1&a&&(t.TgZ(0,"div",0),t._UZ(1,"app-db-masters-list"),t.qZA())},dependencies:[lt],encapsulation:2})}return i})();var ct=r(6125);const Lt=["insertCodeModalC"],Bt=["monacoEditorModalC"];function Qt(i,l){1&i&&(t.TgZ(0,"span"),t._UZ(1,"i",25),t._uU(2," Add Utility"),t.qZA())}function Gt(i,l){1&i&&(t.TgZ(0,"span"),t._UZ(1,"i",26),t._uU(2," View Utility"),t.qZA())}function qt(i,l){if(1&i&&(t.TgZ(0,"span"),t._UZ(1,"i",27),t._uU(2," Edit Utility "),t.TgZ(3,"span",28),t._uU(4),t.qZA()()),2&i){const e=t.oxw();t.xp6(4),t.Oqu(e.form.get("name").value)}}function Ht(i,l){if(1&i&&(t.TgZ(0,"div")(1,"form",29)(2,"div",30)(3,"label",31),t._uU(4,"Name"),t.qZA(),t.TgZ(5,"div",32),t._UZ(6,"input",33),t.qZA()()()()),2&i){const e=t.oxw();t.xp6(1),t.Q6J("formGroup",e.form)}}function Vt(i,l){if(1&i){const e=t.EpF();t.TgZ(0,"div",34)(1,"app-monaco-editor",35),t.NdJ("editorGenerated",function(o){t.CHM(e);const n=t.oxw();return t.KtG(n.editorGenerated(o))}),t.qZA()()}if(2&i){const e=t.oxw();t.xp6(1),t.Q6J("isSchemaEditor",!0)("isUIMakerEditor",!0)("editorOptions",e.editorOptions)}}function Kt(i,l){if(1&i){const e=t.EpF();t.TgZ(0,"a",36),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.viewError())}),t._uU(1,"View error"),t.qZA()}}function jt(i,l){1&i&&(t.TgZ(0,"span"),t._uU(1,"Update"),t.qZA())}function zt(i,l){if(1&i){const e=t.EpF();t.TgZ(0,"button",37),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.save(!1))}),t._UZ(1,"i",38),t.YNc(2,jt,2,0,"span",4),t.qZA()}if(2&i){const e=t.oxw();t.Q6J("disabled",e.form.invalid),t.xp6(2),t.Q6J("ngIf",e.data.mode===e.EFormMode.EDIT)}}function Wt(i,l){1&i&&(t.TgZ(0,"span"),t._uU(1,"Save"),t.qZA())}function Xt(i,l){1&i&&(t.TgZ(0,"span"),t._uU(1,"Update & Close"),t.qZA())}function $t(i,l){if(1&i){const e=t.EpF();t.TgZ(0,"button",37),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.save(!0))}),t._UZ(1,"i",38),t.YNc(2,Wt,2,0,"span",4),t.YNc(3,Xt,2,0,"span",4),t.qZA()}if(2&i){const e=t.oxw();t.Q6J("disabled",e.form.invalid),t.xp6(2),t.Q6J("ngIf",e.data.mode===e.EFormMode.ADD),t.xp6(1),t.Q6J("ngIf",e.data.mode===e.EFormMode.EDIT)}}function te(i,l){1&i&&t._UZ(0,"p-progressSpinner",39)}let mt=(()=>{class i{fb;ns;generalS;constantsS;uiMakerUtilsS;authCS;monacoS;instanceS;eventCenterS;generalCS;cd;data;loading={form:!1};EFormMode=f.D;form;subscriptions=[];formData;IEventData=u.F;id;BE_HOST_PORT=D.N.BE_HOST_PORT;DOCS_HOST_PORT=D.N.DOCS_HOST_PORT;instances=[];editorPI;editorOptions={readOnly:!1,language:"typescript",contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"json",contextmenu:!0};insertCodeModalC;viewDockerfileModelC;shouldLoadMonacoEditor=!1;monacoDecorations=[];tab;constructor(e,a,o,n,c,p,C,g,h,Z,I){this.fb=e,this.ns=a,this.generalS=o,this.constantsS=n,this.uiMakerUtilsS=c,this.authCS=p,this.monacoS=C,this.instanceS=g,this.eventCenterS=h,this.generalCS=Z,this.cd=I}ngOnInit(){var e=this;return(0,d.Z)(function*(){e.createForm(),e.subscriptions.push(e.data.eventChannel.subscribe(function(){var a=(0,d.Z)(function*(o){if(o)if(e.form.enable(),o.action===u.F.OPEN_FORM_IN_EDIT_MODE)yield e.editViewLoadData(),e.cd.detectChanges();else if(o.action===u.F.OPEN_FORM_IN_VIEW_MODE)yield e.editViewLoadData(),e.cd.detectChanges();else if(o.action===u.F.OPEN_FORM_IN_ADD_MODE){e.form.reset(),e.form.patchValue(o.data||{});const n=yield e.instanceS.getDefaultContent(e.BE_HOST_PORT,U.R.UI_MAKER_UTILITY_CLASS).toPromise();e.editorOptions={readOnly:!1},e.generalCS.setValueInEditor(e,"editorPI",n.data),e.cd.detectChanges()}});return function(o){return a.apply(this,arguments)}}()))})()}editViewLoadData(){var e=this;return(0,d.Z)(function*(){const a=yield e.uiMakerUtilsS.getById(e.data.formData._id).toPromise();e.form.reset(),e.form.patchValue(a.data),e.generalCS.setValueInEditor(e,"editorPI",a.data?.utilsCode||"")})()}createForm(){this.form=this.fb.group({name:[null,[m.kI.required]]})}showModal(){this.lastError=void 0,this.shouldLoadMonacoEditor=!0,setTimeout(()=>{$("#idUIMakerUtilForm").modal("show")},100)}hideModal(){$("#idUIMakerUtilForm").modal("hide")}save(e){var a=this;return(0,d.Z)(function*(){const o=a.form.getRawValue();let n;n=a.data.formData&&a.data.formData._id?(yield a.uiMakerUtilsS.getById(a.data.formData._id).toPromise()).data:{};const c=Object.assign({},n,o);c.user=a.authCS.getUserId(),c.utilsCode=a.editorPI.getValue();try{let p;a.loading.form=!0,a.lastError=void 0,a.monacoS.clearEditorDecorations(a.editorPI,a.monacoDecorations),a.data.mode===f.D.ADD?p=yield a.uiMakerUtilsS.post(c).toPromise():a.data.mode===f.D.EDIT&&(p=yield a.uiMakerUtilsS.put(c._id,c,{select:M.iH._id}).toPromise()),a.ns.showSuccess(a.data.mode===f.D.ADD?a.constantsS.uiMakerUtil.addSuccess:a.constantsS.uiMakerUtil.editSuccess),e&&a.data.eventChannel.emit({action:a.data.mode===f.D.ADD?u.F.SAVED:u.F.UPDATED,data:p}),a.eventCenterS.uiMakerUtilsSavedAndUpdate.next(!0),a.loading.form=!1}catch(p){a.loading.form=!1,a.ns.showErrorFromResponse(p.error||p,"Unable to save utility."),a.lastError=p.error,a.tab={axiosResponse:{data:p.error}},a.monacoS.highlightErrorInMonacoEditor(a.editorPI,a.tab,"MainSandbox.ts",a.monacoDecorations)}a.cd.detectChanges()})()}showInsertCodeModel(){this.generalCS.messageReceivedFor=v.H.All,this.insertCodeModalC.showModal(b.b.UiMakerUtilsFormC).then()}editorGenerated(e){var a=this;return(0,d.Z)(function*(){a.editorPI=e,yield a.monacoS.loadSchemaEditorSettings(a.BE_HOST_PORT,a.authCS.getUserId(),null),a.monacoS.addSaveCodeKeyBinding(e,o=>{a.form.valid&&a.save(!1)}),a.monacoS.addInsertCodeKeyBinding(e,o=>{a.generalCS.messageReceivedFor=v.H.All,a.data.mode!==f.D.VIEW&&a.insertCodeModalC.showModal(b.b.UiMakerUtilsFormC)}),a.subscriptions.push(a.generalS.messageReceived.subscribe(o=>{o.type&&o.type===H.g.TEXT_COPIED&&o.componentName===b.b.UiMakerUtilsFormC&&(a.monacoS.insertAtCursor(e,o.selectedText),a.insertCodeModalC.hideModal())}))})()}viewError(){this.viewDockerfileModelC.showModal(this.generalS.stringify(this.lastError),s.d.json)}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions),this.eventCenterS.uiMakerUtilsSavedAndUpdate.next(!1)}static \u0275fac=function(a){return new(a||i)(t.Y36(m.qu),t.Y36(w.W),t.Y36(k.b),t.Y36(y.L),t.Y36(ct.L),t.Y36(J.D),t.Y36(z.b),t.Y36(Y.E),t.Y36(R.u),t.Y36(k.b),t.Y36(t.sBO))};static \u0275cmp=t.Xpm({type:i,selectors:[["app-ui-maker-utils-form"]],viewQuery:function(a,o){if(1&a&&(t.Gf(Lt,5),t.Gf(Bt,5)),2&a){let n;t.iGM(n=t.CRH())&&(o.insertCodeModalC=n.first),t.iGM(n=t.CRH())&&(o.viewDockerfileModelC=n.first)}},inputs:{data:"data"},decls:31,vars:15,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idUIMakerUtilForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-full"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],[1,"float-right"],["aria-label","Close","data-dismiss","modal","type","button",1,"close",3,"click"],["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"],["header","Basic Info"],["header","Code"],["class","overflow-hidden","style","height: calc(100vh - 206px);",4,"ngIf"],[1,"modal-footer"],["href","javascript:;","class","text-danger",3,"click",4,"ngIf"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary",3,"click"],[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,"frameId","modalId","docsHostPort"],["insertCodeModalC",""],[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"],[1,"ml-2","font-weight-normal","small","text-muted"],[1,"container","pt-3",3,"formGroup"],[1,"form-group","row"],[1,"col-3","col-form-label","col-form-label-sm","text-right"],[1,"col-7"],["formControlName","name","name","name","spellcheck","false","type","text","placeholder","Please provide name",1,"form-control","form-control-sm"],[1,"overflow-hidden",2,"height","calc(100vh - 206px)"],[3,"isSchemaEditor","isUIMakerEditor","editorOptions","editorGenerated"],["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(a,o){1&a&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),t.YNc(4,Qt,3,0,"span",4),t.YNc(5,Gt,3,0,"span",4),t.YNc(6,qt,5,1,"span",4),t.TgZ(7,"div",5)(8,"button",6),t.NdJ("click",function(){return o.hideModal()}),t.TgZ(9,"span",7),t._UZ(10,"i",8),t.qZA()(),t.TgZ(11,"span",9),t.NdJ("click",function(){return o.showInsertCodeModel()}),t._UZ(12,"i",10),t.qZA()()(),t.TgZ(13,"div",11)(14,"p-tabView")(15,"p-tabPanel",12),t.YNc(16,Ht,7,1,"div",4),t.qZA(),t.TgZ(17,"p-tabPanel",13),t.YNc(18,Vt,2,3,"div",14),t.qZA()()(),t.TgZ(19,"div",15),t.YNc(20,Kt,2,0,"a",16),t.TgZ(21,"button",17),t.NdJ("click",function(){return o.hideModal()}),t._UZ(22,"i",18),t._uU(23," Close"),t.qZA(),t.YNc(24,zt,3,2,"button",19),t.YNc(25,$t,4,3,"button",19),t.qZA(),t.YNc(26,te,1,0,"p-progressSpinner",20),t.qZA()()(),t._UZ(27,"app-insert-code-modal",21,22)(29,"app-monaco-editor-modal",23,24)),2&a&&(t.xp6(4),t.Q6J("ngIf",o.data.mode===o.EFormMode.ADD),t.xp6(1),t.Q6J("ngIf",o.data.mode===o.EFormMode.VIEW),t.xp6(1),t.Q6J("ngIf",o.data.mode===o.EFormMode.EDIT),t.xp6(10),t.Q6J("ngIf",o.shouldLoadMonacoEditor),t.xp6(2),t.Q6J("ngIf",o.shouldLoadMonacoEditor),t.xp6(2),t.Q6J("ngIf",o.lastError),t.xp6(4),t.Q6J("ngIf",o.data.mode===o.EFormMode.EDIT),t.xp6(1),t.Q6J("ngIf",o.data.mode!==o.EFormMode.VIEW),t.xp6(1),t.Q6J("ngIf",o.loading.form),t.xp6(1),t.Q6J("frameId","idInsertCodeDbMig")("modalId","idInsertCodeDbMigForm")("docsHostPort",o.DOCS_HOST_PORT),t.xp6(2),t.Q6J("modalId","idMonacoEditorModalInSysUIMakerUtility")("editorOptionsMonacoEditorModal",o.editorOptionsMonacoEditorModal)("modalTitle","Error info"))},dependencies:[m._Y,m.Fj,m.JJ,m.JL,m.sg,m.u,L.O5,X.y,tt.P,et.O,B.G,Q.xf,Q.x4,G.u,at.A],encapsulation:2,changeDetection:0})}return i})(),ee=(()=>{class i{static \u0275fac=function(a){return new(a||i)};static \u0275mod=t.oAB({type:i});static \u0275inj=t.cJS({imports:[x.u,it.A]})}return i})();const ae=["uiMakerUtilsFormC"];function oe(i,l){if(1&i){const e=t.EpF();t.TgZ(0,"span",17),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.edit())}),t._UZ(1,"i",18),t.qZA()}}function ie(i,l){if(1&i){const e=t.EpF();t.TgZ(0,"span",19),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.clone())}),t._UZ(1,"i",20),t.qZA()}}function se(i,l){if(1&i){const e=t.EpF();t.TgZ(0,"span",21),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.removePermanent())}),t._UZ(1,"i",22),t.qZA()}}function ne(i,l){1&i&&(t.TgZ(0,"th",25),t._UZ(1,"p-tableHeaderCheckbox"),t.qZA())}function re(i,l){if(1&i&&(t.TgZ(0,"tr"),t.YNc(1,ne,2,0,"th",23),t._UZ(2,"th",24),t.TgZ(3,"th"),t._uU(4,"Name"),t.qZA()()),2&i){const e=t.oxw();t.xp6(1),t.Q6J("ngIf",e.showCheckbox)}}function le(i,l){if(1&i&&(t.TgZ(0,"td"),t._UZ(1,"p-tableCheckbox",29),t.qZA()),2&i){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("value",e)("pSelectableRow",e)}}function de(i,l){1&i&&t._UZ(0,"i",30)}function ce(i,l){if(1&i&&(t.TgZ(0,"tr",26),t.YNc(1,le,2,2,"td",27),t.TgZ(2,"td"),t.YNc(3,de,1,0,"i",28),t.qZA(),t.TgZ(4,"td"),t._uU(5),t.qZA()()),2&i){const e=l.$implicit,a=t.oxw();t.Q6J("pSelectableRow",e),t.xp6(1),t.Q6J("ngIf",a.showCheckbox),t.xp6(2),t.Q6J("ngIf",e.isScriptExecutedCalculated),t.xp6(2),t.Oqu(e.name)}}function me(i,l){1&i&&t._UZ(0,"p-progressSpinner",31)}let ut=(()=>{class i{uiMakerUtilsS;generalS;notificationS;navigationCS;authCS;constantsS;eventCenterS;router;userS;instanceS;ns;cs;confirmationService;cd;showCheckbox=!0;loading={grid:!1};subscriptions=[];data={mode:f.D.ADD,eventChannel:new t.vpe,formData:void 0};rows=[];rowsMap={};showAll=!1;EUserType=rt.dN;gridKey=M.iH._id;EAPICategory=U.R;selectedRows=[];uiMakerUtilsFormC;constructor(e,a,o,n,c,p,C,g,h,Z,I,N,O,F){this.uiMakerUtilsS=e,this.generalS=a,this.notificationS=o,this.navigationCS=n,this.authCS=c,this.constantsS=p,this.eventCenterS=C,this.router=g,this.userS=h,this.instanceS=Z,this.ns=I,this.cs=N,this.confirmationService=O,this.cd=F}ngOnInit(){var e=this;return(0,d.Z)(function*(){e.eventCenterS.uiMakerUtils.selectedUtil.next(void 0),yield e.loadGridData(),e.subscriptions.push(e.data.eventChannel.subscribe(function(){var a=(0,d.Z)(function*(o){(o.action===u.F.SAVED||o.action===u.F.UPDATED)&&(e.uiMakerUtilsFormC.hideModal(),yield e.loadGridData())});return function(o){return a.apply(this,arguments)}}())),e.generalS.setNewTitle("API Maker - UI Maker Utility")})()}loadGridData(){var e=this;return(0,d.Z)(function*(){e.loading.grid=!0;const a={find:{user:e.authCS.getUserId(),active:!0},select:{name:1,label:1,active:1,user:1,order:1},sort:{order:1}};e.showAll&&delete a.find.active;const o=yield e.uiMakerUtilsS.query(a).toPromise();o&&(e.selectedRows=[],e.rows=o.data,e.rowsMap=_.keyBy(e.rows,M.iH._id));let n=e.navigationCS.getQueryParam(T.p.am_ui_maker_util);n&&!e.rowsMap[n]&&e.rows.length&&(n=e.rows[0]._id),e.rowsMap[n]?(e.selectedRows=[e.rowsMap[n]],yield e.fillData()):e.eventCenterS.uiMakerUtils.selectedUtil.next(void 0),e.loading.grid=!1,e.cd.detectChanges()})()}add(){this.data.formData={},this.data.mode=f.D.ADD,this.data.eventChannel.emit({action:u.F.OPEN_FORM_IN_ADD_MODE,data:this.data.formData}),this.uiMakerUtilsFormC.showModal()}edit(){this.data.formData=this.rowsMap[_.map(this.selectedRows,"_id")[0]],this.data.mode=f.D.EDIT,this.data.eventChannel.emit({action:u.F.OPEN_FORM_IN_EDIT_MODE}),this.uiMakerUtilsFormC.showModal()}clone(){var e=this;return(0,d.Z)(function*(){try{if(!e.selectedRows[0]||!e.rowsMap[_.map(e.selectedRows,"_id")[0]])return;const a=e.rowsMap[_.map(e.selectedRows,"_id")[0]]._id,o=(yield e.uiMakerUtilsS.getById(a).toPromise()).data;delete o._id,o.name=`${o.name}-clone`,(yield e.uiMakerUtilsS.post(o).toPromise()).success?(e.notificationS.showSuccess(e.constantsS.uiMakerUtil.cloneSuccess),e.loadGridData()):e.notificationS.showSuccess(e.constantsS.uiMakerUtil.cloneSuccess)}catch{e.notificationS.showError(e.constantsS.uiMakerUtil.cloneError)}})()}removePermanent(){var e=this;return(0,d.Z)(function*(){var a;e.confirmationService.confirm({message:e.cs.uiMakerUtil.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(a=(0,d.Z)(function*(){for(const o of e.selectedRows)yield e.hardDelete(o._id);e.ns.showSuccess(e.cs.uiMakerUtil.removePermanent),yield e.loadGridData()}),function(){return a.apply(this,arguments)})})})()}hardDelete(e){var a=this;return(0,d.Z)(function*(){yield a.uiMakerUtilsS.permanentDelete(e).toPromise()})()}resetSelectedRows(){this.selectedRows.length=0,this.eventCenterS.uiMakerUtils.selectedUtil.next(void 0)}resetThisUrl(){var e=this;return(0,d.Z)(function*(){e.eventCenterS.uiMakerUtils.selectedUtil.next(void 0),yield e.navigationCS.setQueryParam(T.p.am_ui_maker_util,null)})()}itemSelected(){var e=this;return(0,d.Z)(function*(){yield e.resetThisUrl(),setTimeout(e.fillData.bind(e))})()}fillData(){var e=this;return(0,d.Z)(function*(){if(!e.selectedRows.length)return yield e.navigationCS.setQueryParam(T.p.am_ui_maker_util,""),void e.eventCenterS.uiMakerUtils.selectedUtil.next(null);const a=e.selectedRows[0];a?(yield e.navigationCS.setQueryParam(T.p.am_ui_maker_util,a._id),e.eventCenterS.uiMakerUtils.selectedUtil.next(a)):yield e.resetThisUrl()})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}dblClickHandler(){this.selectedRows.length&&this.edit()}ENavigationMenu=nt.E;static \u0275fac=function(a){return new(a||i)(t.Y36(ct.L),t.Y36(k.b),t.Y36(w.W),t.Y36(V.S),t.Y36(J.D),t.Y36(y.L),t.Y36(R.u),t.Y36(E.F0),t.Y36(K.K),t.Y36(Y.E),t.Y36(w.W),t.Y36(y.L),t.Y36(q.YP),t.Y36(t.sBO))};static \u0275cmp=t.Xpm({type:i,selectors:[["app-ui-maker-utils-list"]],viewQuery:function(a,o){if(1&a&&t.Gf(ae,5),2&a){let n;t.iGM(n=t.CRH())&&(o.uiMakerUtilsFormC=n.first)}},inputs:{showCheckbox:"showCheckbox"},decls:19,vars:11,consts:[[1,"card","shadow-sm","h-100"],["pTooltip","",1,"card-header"],[1,"fab","fa-uniregistry","fa-fw","text-white"],["href","javascript:",3,"click"],["tooltipPosition","left","pTooltip","Go back to UI Pages","src","/assets/images/icons/ui-maker.svg",1,"float-right","ml-3","mr-1",2,"height","20px"],["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 - 82px)",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"],["uiMakerUtilsFormC",""],["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"],["style","width: 45px;",4,"ngIf"],[2,"width","30px"],[2,"width","45px"],[3,"pSelectableRow"],[4,"ngIf"],["pTooltip","Script Executed","class","fas fa-solid fa-check fa-fw align-middle text-success text-v-small pr-1",4,"ngIf"],[3,"value","pSelectableRow"],["pTooltip","Script Executed",1,"fas","fa-solid","fa-check","fa-fw","align-middle","text-success","text-v-small","pr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(a,o){1&a&&(t.TgZ(0,"div",0)(1,"div",1)(2,"span"),t._UZ(3,"i",2),t._uU(4," Common Utils For UI Pages"),t.qZA(),t.TgZ(5,"a",3),t.NdJ("click",function(){return o.router.navigate([o.ENavigationMenu.DBMasters,"main"])}),t._UZ(6,"img",4),t.qZA(),t.TgZ(7,"span",5),t.NdJ("click",function(){return o.add()}),t._UZ(8,"i",6),t.qZA(),t.YNc(9,oe,2,0,"span",7),t.YNc(10,ie,2,0,"span",8),t.YNc(11,se,2,0,"span",9),t.qZA(),t.TgZ(12,"div",10)(13,"p-table",11),t.NdJ("selectionChange",function(c){return o.selectedRows=c})("selectionChange",function(){return o.itemSelected()})("dblclick",function(){return o.dblClickHandler()}),t.YNc(14,re,5,1,"ng-template",12),t.YNc(15,ce,6,4,"ng-template",13),t.qZA(),t.YNc(16,me,1,0,"p-progressSpinner",14),t.qZA()(),t._UZ(17,"app-ui-maker-utils-form",15,16)),2&a&&(t.xp6(9),t.Q6J("ngIf",o.selectedRows.length&&o.selectedRows.length<2),t.xp6(1),t.Q6J("ngIf",o.selectedRows.length&&o.selectedRows.length<2),t.xp6(1),t.Q6J("ngIf",o.selectedRows.length),t.xp6(2),t.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",o.selectedRows)("dataKey",o.gridKey)("scrollable",!0)("value",o.rows),t.xp6(3),t.Q6J("ngIf",o.loading.grid),t.xp6(1),t.Q6J("data",o.data))},dependencies:[L.O5,S.iA,q.jx,S.Ei,S.UA,S.Mo,B.G,G.u,mt],encapsulation:2,changeDetection:0})}return i})();const ue=[{path:"main",component:dt,canActivate:[A.P]},{path:"utils",component:(()=>{class i{constructor(){}ngOnInit(){}static \u0275fac=function(a){return new(a||i)};static \u0275cmp=t.Xpm({type:i,selectors:[["app-ui-maker-utils-layout"]],decls:2,vars:0,consts:[[1,"pt-1","pl-1","pr-1","overflow-auto"]],template:function(a,o){1&a&&(t.TgZ(0,"div",0),t._UZ(1,"app-ui-maker-utils-list"),t.qZA())},dependencies:[ut],encapsulation:2})}return i})(),canActivate:[A.P]}];let fe=(()=>{class i{static \u0275fac=function(a){return new(a||i)};static \u0275mod=t.oAB({type:i});static \u0275inj=t.cJS({imports:[E.Bz.forChild(ue),x.u,yt,ee]})}return i})()},6925:(pt,P,r)=>{r.d(P,{Eg:()=>_,Yp:()=>A,ZF:()=>u,vT:()=>x});var x=function(s){return s.FORM_DATA="FORM_DATA",s.JSON="JSON",s.TEXT="TEXT",s}(x||{}),A=function(s){return s.GET="GET",s.POST="POST",s.PUT="PUT",s.DELETE="DELETE",s}(A||{}),_=function(s){return s.CONTENT_TYPE="content-type",s.ACCEPT_ENCODING="accept-encoding",s.NO_COMPRESSION_STD="x-no-compression",s.AUTHORIZATION_AM="x-am-authorization",s.AUTHORIZATION_AM_USER="x-am-user-authorization",s.AUTHORIZATION_AWS="x-aws-authorization",s.AUTHORIZATION_GOOGLE="x-google-authorization",s.AUTHORIZATION_AZURE="x-azure-authorization",s.RUN_IN_SANDBOX="x-am-run-in-sandbox",s.ORIGIN="origin",s.AUTHORIZATION="authorization",s.META="x-am-meta",s.SECRET="x-am-secret",s.CONTENT_TYPE_RESPONSE="x-am-content-type-response",s.CACHE_CONTROL="x-am-cache-control",s.CODE_HASH="x-am-code-hash",s.SANDBOX_TIMEOUT="x-am-sandbox-timeout",s.GET_ENCRYPTED_DATA="x-am-get-encrypted-data",s.ENCRYPTED_PAYLOAD="x-am-encrypted-payload",s.RESPONSE_CASE="x-am-response-case",s.RESPONSE_OBJECT_TYPE="x-am-response-object-type",s.AM_I18N="x-am-internationalization",s.DATA_SOURCE="x-am-data-source",s.TEST_HOOK="x-am-test-hook",s.TEST_EVENT="x-am-test-event",s.INTER_COMM="x-am-inter-comm",s.SEND_ONLY_OBJECTS="x-am-send-only-objects-in-stream",s.AM_REQUEST_ID="x-am-request-id",s.AM_STORE_TOKEN="x-am-store-token",s}(_||{}),u=function(s){return s.DB_MASTER_NAME="db-master-name",s.ADMIN_PATH="admin-path",s}(u||{})}}]);
package/dist/7436.js CHANGED
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[7436],{7436:(se,p,a)=>{a.r(p),a.d(p,{ExtLicensesM:()=>W});var x=a(7664),v=a(7213),Z=a(8176),y=a(3726),r=a(5861),f=a(921),m=a(1162),C=a(5085),e=a(4946),T=a(5852),L=a(4795),S=a(7240),A=a(3429),I=a(9961),U=a(5561),u=a(5219),E=a(7414),w=a(2915),l=a(95),g=a(6814),P=a(2660),h=a(5431),b=a(7680),K=a(3259);function N(n,c){1&n&&(e.TgZ(0,"span",5),e._UZ(1,"i",31),e.qZA())}function M(n,c){1&n&&(e.TgZ(0,"tr")(1,"th",32),e._uU(2,"#"),e.qZA(),e.TgZ(3,"th",32),e._uU(4,"\xa0"),e.qZA(),e.TgZ(5,"th",33),e._uU(6,"License Key"),e.qZA(),e.TgZ(7,"th",34),e._uU(8,"Server Info"),e.qZA(),e.TgZ(9,"th",35),e._uU(10,"Action Required"),e.qZA(),e.TgZ(11,"th",36),e._uU(12,"Actions"),e.qZA()())}function k(n,c){1&n&&(e.TgZ(0,"span"),e._UZ(1,"i",46),e.qZA())}function J(n,c){1&n&&(e.TgZ(0,"span"),e._UZ(1,"i",47),e.qZA())}function Y(n,c){1&n&&(e.TgZ(0,"span"),e._UZ(1,"i",48),e.qZA())}function q(n,c){if(1&n){const t=e.EpF();e.TgZ(0,"div")(1,"span"),e._uU(2),e.qZA(),e.TgZ(3,"a",49),e.NdJ("click",function(){e.CHM(t);const i=e.oxw().$implicit,o=e.oxw();return e.KtG(o.hideLicenseKey(i))}),e._UZ(4,"i",50),e.qZA()()}if(2&n){const t=e.oxw().$implicit;e.xp6(2),e.Oqu(t.licenseKey)}}function F(n,c){if(1&n){const t=e.EpF();e.TgZ(0,"div")(1,"span"),e._uU(2,"\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7"),e.qZA(),e.TgZ(3,"a",49),e.NdJ("click",function(){e.CHM(t);const i=e.oxw().$implicit,o=e.oxw();return e.KtG(o.showLicenseKey(i))}),e._UZ(4,"i",51),e.qZA()()}}function O(n,c){1&n&&(e.TgZ(0,"span"),e._UZ(1,"i",52),e._uU(2," All good"),e.qZA())}function B(n,c){if(1&n&&(e.TgZ(0,"div")(1,"span"),e._uU(2),e.qZA()()),2&n){const t=c.$implicit;e.xp6(2),e.hij("\u274c ",t.message,"")}}function D(n,c){if(1&n&&(e.TgZ(0,"div"),e.YNc(1,B,3,1,"div",53),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("ngForOf",t.licenseError)}}function Q(n,c){if(1&n){const t=e.EpF();e.TgZ(0,"a",54),e.NdJ("click",function(){e.CHM(t);const i=e.oxw().$implicit,o=e.oxw();return e.KtG(o.resetMacAddress(i))}),e._UZ(1,"i",55),e.qZA()}}function R(n,c){if(1&n){const t=e.EpF();e.TgZ(0,"a",56),e.NdJ("click",function(){e.CHM(t);const i=e.oxw().$implicit,o=e.oxw();return e.KtG(o.showDialogToGetNewLicenseKey(i))}),e._UZ(1,"i",57),e.qZA()}}function G(n,c){if(1&n){const t=e.EpF();e.TgZ(0,"a",58),e.NdJ("click",function(){e.CHM(t);const i=e.oxw().$implicit,o=e.oxw();return e.KtG(o.reduceCPUUsageButtonClick(i))}),e._UZ(1,"i",59),e.qZA()}}function H(n,c){if(1&n&&(e.TgZ(0,"tr",37)(1,"td",38),e._uU(2),e.qZA(),e.TgZ(3,"td",38),e.YNc(4,k,2,0,"span",39),e.YNc(5,J,2,0,"span",39),e.YNc(6,Y,2,0,"span",39),e.qZA(),e.TgZ(7,"td",40),e.YNc(8,q,5,1,"div",39),e.YNc(9,F,5,0,"div",39),e.qZA(),e.TgZ(10,"td")(11,"span"),e._uU(12),e.qZA(),e._UZ(13,"br"),e.TgZ(14,"a",41),e._uU(15),e.qZA()(),e.TgZ(16,"td",42),e.YNc(17,O,3,0,"span",39),e.YNc(18,D,2,1,"div",39),e.qZA(),e.TgZ(19,"td",38),e.YNc(20,Q,2,0,"a",43),e.YNc(21,R,2,0,"a",44),e.YNc(22,G,2,0,"a",45),e.qZA()()),2&n){const t=c.$implicit,s=c.rowIndex;e.Q6J("pSelectableRow",t),e.xp6(2),e.Oqu(s+1),e.xp6(2),e.Q6J("ngIf","PENDING"===t.licenseCheckStatus),e.xp6(1),e.Q6J("ngIf","VALID"===t.licenseCheckStatus),e.xp6(1),e.Q6J("ngIf","INVALID"===t.licenseCheckStatus),e.xp6(2),e.Q6J("ngIf",t.showLicenseKey),e.xp6(1),e.Q6J("ngIf",!t.showLicenseKey),e.xp6(3),e.Oqu(t.hostName),e.xp6(2),e.s9C("href",t.beHostPort,e.LSH),e.xp6(1),e.Oqu(t.beHostPort),e.xp6(2),e.Q6J("ngIf","VALID"===t.licenseCheckStatus&&0===t.licenseError.length),e.xp6(1),e.Q6J("ngIf",t.licenseError.length),e.xp6(2),e.Q6J("ngIf",t.licenseActions.indexOf("RESET_MAC")>=0),e.xp6(1),e.Q6J("ngIf",t.licenseActions.indexOf("LICENSE_NOT_FOUND")>=0||t.licenseActions.indexOf("EXPIRED")>=0),e.xp6(1),e.Q6J("ngIf",t.licenseActions.indexOf("REDUCE_CPU_USAGE")>=0)}}function V(n,c){1&n&&e._UZ(0,"p-progressSpinner",60)}const j=[{path:"",component:(()=>{class n{authCS;authS;generalCS;instanceS;ns;navigationS;confirmationService;constantsS;eventCenterS;EUserType=f.dN;EAPICategory=C.R;gridKey=m.iH._id;loading={grid:!1};serverList=[];newLicenseKey="";setLicenseKeyForObj;showValidationInProgress;constructor(t,s,i,o,d,X,z,ee,te){this.authCS=t,this.authS=s,this.generalCS=i,this.instanceS=o,this.ns=d,this.navigationS=X,this.confirmationService=z,this.constantsS=ee,this.eventCenterS=te}ngOnInit(){return this.authS.backendSettings.extensions?this.authCS.gUser?.userType!==f.dN.ADMIN?this.navigationS.gotoDashboard():(this.generalCS.setNewTitle("AM - Extensions Licenses"),void this.loadData().then()):this.navigationS.gotoDashboard()}loadData(){var t=this;return(0,r.Z)(function*(){t.loading.grid=!0;try{t.serverList=[];const s=(yield t.instanceS.getFullSystemInfo().toPromise()).data,i=_.groupBy(s,m.GR.hostName);for(const o in i)t.serverList.push(i[o][0])}catch(s){console.log(s),t.ns.showErrorFromResponse(s.error||s,"Unable to load server information.")}t.loading.grid=!1})()}resetMacAddress(t){var s=this;return(0,r.Z)(function*(){var i;s.confirmationService.confirm({message:s.constantsS.license.resetMacAddressConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(i=(0,r.Z)(function*(){try{yield s.instanceS.resetMacAddressOfLicense({key:t.licenseKey}).toPromise(),s.ns.showSuccess("MAC address reset successfully."),s.setUIAfterFix(1e4)}catch(o){console.log(o),s.ns.showErrorFromResponse(o.error||o,"Unable to reset MAC address of license.")}}),function(){return i.apply(this,arguments)})})})()}showLicenseKey(t){t.showLicenseKey=!0}hideLicenseKey(t){t.showLicenseKey=!1}showModalSetLicenseKey(){$("#idSetLicenseKeyModal").modal("show")}hideModalSetLicenseKey(){$("#idSetLicenseKeyModal").modal("hide")}showDialogToGetNewLicenseKey(t){this.setLicenseKeyForObj=t,this.newLicenseKey=t.licenseKey,this.showModalSetLicenseKey()}setLicenseKeyAPICall(t){var s=this;return(0,r.Z)(function*(){try{yield s.instanceS.setLicenseKeyOnServer({updateMode:"LICENSE_KEY",uniqueServerId:t.uniqueServerId,uniqueProcessId:t.uniqueProcessId,workerId:t.workerId,licenseKey:s.newLicenseKey,serverName:t.hostName}).toPromise(),s.hideModalSetLicenseKey(),s.ns.showSuccess("License key set successfully."),s.setUIAfterFix(6e3)}catch(i){console.log(i),s.ns.showErrorFromResponse(i.error||i,"Unable to reset MAC address of license.")}})()}reduceCPUUsageButtonClick(t){var i,s=this;this.confirmationService.confirm({message:this.constantsS.license.setCPUCoreConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(i=(0,r.Z)(function*(){yield s.setCPUCoreAPICall(t)}),function(){return i.apply(this,arguments)})})}setCPUCoreAPICall(t){var s=this;return(0,r.Z)(function*(){try{const i=(t.licenseError||[]).find(o=>o.licensePermitsCPU)?.licensePermitsCPU;if(!i)return void s.ns.showError("Unable to find CPU core issue in license error.");yield s.instanceS.setLicenseKeyOnServer({updateMode:"CPU_CORE",uniqueServerId:t.uniqueServerId,uniqueProcessId:t.uniqueProcessId,workerId:t.workerId,serverName:t.hostName,cpuCore:i}).toPromise(),s.hideModalSetLicenseKey(),s.ns.showSuccess("CPU core set successfully."),s.setUIAfterFix(1e4)}catch(i){console.log(i),s.ns.showErrorFromResponse(i.error||i,"Unable to reset MAC address of license.")}})()}setUIAfterFix(t){var s=this;this.loadData().then(),this.showValidationInProgress=!0,setTimeout((0,r.Z)(function*(){yield s.loadData(),s.showValidationInProgress=!1,yield s.eventCenterS.headerC.setLicenseHasIssues(s.serverList)}),t)}static \u0275fac=function(s){return new(s||n)(e.Y36(T.D),e.Y36(L.e),e.Y36(S.b),e.Y36(A.E),e.Y36(I.W),e.Y36(U.X),e.Y36(u.YP),e.Y36(E.L),e.Y36(w.u))};static \u0275cmp=e.Xpm({type:n,selectors:[["app-ext-licenses"]],decls:39,vars:7,consts:[[1,"pt-1","pl-1","pr-1"],[1,"full-body","overflow-hidden"],[1,"card"],[1,"card-header"],["src","/assets/images/icons/license.png","alt","Extension license icon",1,"fa-fw","mr-1",2,"vertical-align","text-top"],[1,"float-right"],["class","float-right",4,"ngIf"],[1,"card-body","p-0","overflow-auto","text-center",2,"height","calc(100vh - 88px)"],["styleClass","p-datatable-striped custom-api-grid-height","scrollHeight","flex",3,"selectionMode","dataKey","scrollable","value"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idSetLicenseKeyModal","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-lg"],[1,"modal-content"],[1,"modal-header"],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],["aria-label","Close","data-dismiss","modal","type","button",1,"close"],["aria-hidden","true"],[1,"fas","fa-window-close"],[1,"modal-body","overflow-auto"],[1,"container","pt-3"],[1,"form-group","row"],[1,"col-4","col-form-label","col-form-label-sm","text-right"],[1,"col-6"],["name","licenseKey","spellcheck","false","type","text","autocomplete","off",1,"form-control","form-control-sm","font-monospaced",3,"ngModel","ngModelChange"],[1,"modal-footer"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary"],[1,"fas","fa-times","text-danger","fa-fw"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["tooltipPosition","left","pTooltip","Validation in progress.",1,"fas","fa-sync-alt","text-success","fa-fw","fa-spin"],[1,"text-center","bg-table-header",2,"width","30px"],[1,"bg-table-header",2,"width","300px"],[1,"bg-table-header",2,"width","240px"],[1,"bg-table-header"],[1,"text-center","bg-table-header",2,"width","125px"],[3,"pSelectableRow"],[1,"text-center"],[4,"ngIf"],[1,"small","font-monospaced"],["target","_blank",1,"ml-2","small","text-muted",3,"href"],[1,""],["class","btn btn-xsm-custom ml-1","pTooltip","Reset registered mac address.","tooltipPosition","left","href","javascript:",3,"click",4,"ngIf"],["class","btn btn-xsm-custom ml-1","pTooltip","Set license key","tooltipPosition","left","href","javascript:",3,"click",4,"ngIf"],["class","btn btn-xsm-custom ml-1","pTooltip","Set CPU core usage from license","tooltipPosition","left","href","javascript:",3,"click",4,"ngIf"],["pTooltip","License validation will happen in future.",1,"fas","fa-circle","text-warning"],["pTooltip","Valid license",1,"fas","fa-circle","text-success"],["pTooltip","Invalid license",1,"fas","fa-circle","text-danger"],["href","javascript:",1,"btn","btn-xsm-custom","ml-2",3,"click"],[1,"fas","fa-eye-slash","fa-fw","pt-1"],[1,"fas","fa-eye","fa-fw","pt-1"],[1,"fas","fa-check","fa-fw","text-success"],[4,"ngFor","ngForOf"],["pTooltip","Reset registered mac address.","tooltipPosition","left","href","javascript:",1,"btn","btn-xsm-custom","ml-1",3,"click"],[1,"fas","fa-history","text-info","fa-fw","pt-1"],["pTooltip","Set license key","tooltipPosition","left","href","javascript:",1,"btn","btn-xsm-custom","ml-1",3,"click"],[1,"fas","fa-wrench","text-success","fa-fw","pt-1"],["pTooltip","Set CPU core usage from license","tooltipPosition","left","href","javascript:",1,"btn","btn-xsm-custom","ml-1",3,"click"],[1,"fas","fa-microchip","text-success","fa-fw","pt-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(s,i){1&s&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"span"),e._UZ(5,"img",4),e._uU(6," Server List "),e.qZA(),e.TgZ(7,"div",5),e.YNc(8,N,2,0,"span",6),e.qZA()(),e.TgZ(9,"div",7)(10,"p-table",8),e.YNc(11,M,13,0,"ng-template",9),e.YNc(12,H,23,15,"ng-template",10),e.qZA(),e.YNc(13,V,1,0,"p-progressSpinner",11),e.qZA()()()(),e.TgZ(14,"div",12)(15,"div",13)(16,"div",14)(17,"div",15)(18,"span"),e._UZ(19,"i",16),e._uU(20," Set License Key"),e.qZA(),e.TgZ(21,"button",17)(22,"span",18),e._UZ(23,"i",19),e.qZA()()(),e.TgZ(24,"div",20)(25,"form",21)(26,"div",22)(27,"label",23),e._uU(28,"Name"),e.qZA(),e.TgZ(29,"div",24)(30,"input",25),e.NdJ("ngModelChange",function(d){return i.newLicenseKey=d}),e.qZA()()()()(),e.TgZ(31,"div",26)(32,"button",27),e._UZ(33,"i",28),e._uU(34," Close "),e.qZA(),e.TgZ(35,"button",29),e.NdJ("click",function(){return i.setLicenseKeyAPICall(i.setLicenseKeyForObj)}),e._UZ(36,"i",30),e.TgZ(37,"span"),e._uU(38,"Set Key"),e.qZA()()()()()()),2&s&&(e.xp6(8),e.Q6J("ngIf",i.showValidationInProgress),e.xp6(2),e.Q6J("selectionMode","multiple")("dataKey",i.gridKey)("scrollable",!0)("value",i.serverList),e.xp6(3),e.Q6J("ngIf",i.loading.grid),e.xp6(17),e.Q6J("ngModel",i.newLicenseKey))},dependencies:[l._Y,l.Fj,l.JJ,l.JL,l.On,l.F,g.sg,g.O5,P.y,h.iA,u.jx,h.Ei,b.G,K.u],styles:[".bg-table-header[_ngcontent-%COMP%]{background-color:#272727}"]})}return n})(),canActivate:[y.P]}];let W=(()=>{class n{static \u0275fac=function(s){return new(s||n)};static \u0275mod=e.oAB({type:n});static \u0275inj=e.cJS({imports:[x.Bz.forChild(j),Z.u,v.S]})}return n})()}}]);
1
+ "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[7436],{7436:(ne,f,o)=>{o.r(f),o.d(f,{ExtLicensesM:()=>z});var v=o(7664),C=o(7213),Z=o(8176),y=o(3726),r=o(5861),p=o(921),u=o(1162),U=o(5085),e=o(4946),E=o(5852),S=o(4795),I=o(7240),A=o(3429),T=o(9961),L=o(5561),m=o(5219),P=o(7414),w=o(2915),l=o(95),g=o(6814),b=o(2660),h=o(5431),K=o(7680),N=o(3259);function M(i,c){1&i&&(e.TgZ(0,"span",5),e._UZ(1,"i",31),e.qZA())}function k(i,c){1&i&&(e.TgZ(0,"tr")(1,"th",32),e._uU(2,"#"),e.qZA(),e.TgZ(3,"th",32),e._uU(4,"\xa0"),e.qZA(),e.TgZ(5,"th",33),e._uU(6,"License Key"),e.qZA(),e.TgZ(7,"th",34),e._uU(8,"Server Info"),e.qZA(),e.TgZ(9,"th",35),e._uU(10,"Action Required"),e.qZA(),e.TgZ(11,"th",36),e._uU(12,"Actions"),e.qZA()())}function D(i,c){1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",47),e.qZA())}function F(i,c){1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",48),e.qZA())}function q(i,c){1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",49),e.qZA())}function J(i,c){if(1&i){const t=e.EpF();e.TgZ(0,"div")(1,"span"),e._uU(2),e.qZA(),e.TgZ(3,"a",50),e.NdJ("click",function(){e.CHM(t);const n=e.oxw().$implicit,a=e.oxw();return e.KtG(a.hideLicenseKey(n))}),e._UZ(4,"i",51),e.qZA()()}if(2&i){const t=e.oxw().$implicit;e.xp6(2),e.Oqu(t.licenseKey)}}function Y(i,c){if(1&i){const t=e.EpF();e.TgZ(0,"div")(1,"span"),e._uU(2,"\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7"),e.qZA(),e.TgZ(3,"a",50),e.NdJ("click",function(){e.CHM(t);const n=e.oxw().$implicit,a=e.oxw();return e.KtG(a.showLicenseKey(n))}),e._UZ(4,"i",52),e.qZA()()}}function O(i,c){1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",53),e._uU(2," All good"),e.qZA())}function R(i,c){if(1&i&&(e.TgZ(0,"div")(1,"span"),e._uU(2),e.qZA()()),2&i){const t=c.$implicit;e.xp6(2),e.hij("\u274c ",t.message,"")}}function G(i,c){if(1&i&&(e.TgZ(0,"div"),e.YNc(1,R,3,1,"div",54),e.qZA()),2&i){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("ngForOf",t.licenseError)}}function B(i,c){if(1&i){const t=e.EpF();e.TgZ(0,"a",55),e.NdJ("click",function(){e.CHM(t);const n=e.oxw().$implicit,a=e.oxw();return e.KtG(a.resetMacAddress(n))}),e._UZ(1,"i",56),e.qZA()}}function Q(i,c){if(1&i){const t=e.EpF();e.TgZ(0,"a",57),e.NdJ("click",function(){e.CHM(t);const n=e.oxw().$implicit,a=e.oxw();return e.KtG(a.showDialogToGetNewLicenseKey(n))}),e._UZ(1,"i",58),e.qZA()}}function H(i,c){if(1&i){const t=e.EpF();e.TgZ(0,"a",59),e.NdJ("click",function(){e.CHM(t);const n=e.oxw().$implicit,a=e.oxw();return e.KtG(a.reduceUsage__click(n,"REDUCE_CPU_USAGE"))}),e._UZ(1,"i",60),e.qZA()}}function V(i,c){if(1&i){const t=e.EpF();e.TgZ(0,"a",61),e.NdJ("click",function(){e.CHM(t);const n=e.oxw().$implicit,a=e.oxw();return e.KtG(a.reduceUsage__click(n,"REDUCE_UI_PAGES_USAGE"))}),e._UZ(1,"i",62),e.qZA()}}function j(i,c){if(1&i&&(e.TgZ(0,"tr",37)(1,"td",38),e._uU(2),e.qZA(),e.TgZ(3,"td",38),e.YNc(4,D,2,0,"span",39),e.YNc(5,F,2,0,"span",39),e.YNc(6,q,2,0,"span",39),e.qZA(),e.TgZ(7,"td",40),e.YNc(8,J,5,1,"div",39),e.YNc(9,Y,5,0,"div",39),e.qZA(),e.TgZ(10,"td")(11,"span"),e._uU(12),e.qZA(),e._UZ(13,"br"),e.TgZ(14,"a",41),e._uU(15),e.qZA()(),e.TgZ(16,"td",42),e.YNc(17,O,3,0,"span",39),e.YNc(18,G,2,1,"div",39),e.qZA(),e.TgZ(19,"td",38),e.YNc(20,B,2,0,"a",43),e.YNc(21,Q,2,0,"a",44),e.YNc(22,H,2,0,"a",45),e.YNc(23,V,2,0,"a",46),e.qZA()()),2&i){const t=c.$implicit,s=c.rowIndex;e.Q6J("pSelectableRow",t),e.xp6(2),e.Oqu(s+1),e.xp6(2),e.Q6J("ngIf","PENDING"===t.licenseCheckStatus),e.xp6(1),e.Q6J("ngIf","VALID"===t.licenseCheckStatus),e.xp6(1),e.Q6J("ngIf","INVALID"===t.licenseCheckStatus),e.xp6(2),e.Q6J("ngIf",t.showLicenseKey),e.xp6(1),e.Q6J("ngIf",!t.showLicenseKey),e.xp6(3),e.Oqu(t.hostName),e.xp6(2),e.s9C("href",t.beHostPort,e.LSH),e.xp6(1),e.Oqu(t.beHostPort),e.xp6(2),e.Q6J("ngIf","VALID"===t.licenseCheckStatus&&0===t.licenseError.length),e.xp6(1),e.Q6J("ngIf",t.licenseError.length),e.xp6(2),e.Q6J("ngIf",t.licenseActions.indexOf("RESET_MAC")>=0),e.xp6(1),e.Q6J("ngIf",t.licenseActions.indexOf("LICENSE_NOT_FOUND")>=0||t.licenseActions.indexOf("EXPIRED")>=0),e.xp6(1),e.Q6J("ngIf",t.licenseActions.indexOf("REDUCE_CPU_USAGE")>=0),e.xp6(1),e.Q6J("ngIf",t.licenseActions.indexOf("REDUCE_UI_PAGES_USAGE")>=0)}}function W(i,c){1&i&&e._UZ(0,"p-progressSpinner",63)}const X=[{path:"",component:(()=>{class i{authCS;authS;generalCS;instanceS;ns;navigationS;confirmationService;constantsS;eventCenterS;EUserType=p.dN;EAPICategory=U.R;gridKey=u.iH._id;loading={grid:!1};serverList=[];newLicenseKey="";setLicenseKeyForObj;showValidationInProgress;constructor(t,s,n,a,d,x,ee,te,se){this.authCS=t,this.authS=s,this.generalCS=n,this.instanceS=a,this.ns=d,this.navigationS=x,this.confirmationService=ee,this.constantsS=te,this.eventCenterS=se}ngOnInit(){return this.authS.backendSettings.extensions?this.authCS.gUser?.userType!==p.dN.ADMIN?this.navigationS.gotoDashboard():(this.generalCS.setNewTitle("AM - Extensions Licenses"),void this.loadData().then()):this.navigationS.gotoDashboard()}loadData(){var t=this;return(0,r.Z)(function*(){t.loading.grid=!0;try{t.serverList=[];const s=(yield t.instanceS.getFullSystemInfo().toPromise()).data,n=_.groupBy(s,u.GR.hostName);for(const a in n)t.serverList.push(n[a][0])}catch(s){console.log(s),t.ns.showErrorFromResponse(s.error||s,"Unable to load server information.")}t.loading.grid=!1})()}resetMacAddress(t){var s=this;return(0,r.Z)(function*(){var n;s.confirmationService.confirm({message:s.constantsS.license.resetMacAddressConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(n=(0,r.Z)(function*(){try{yield s.instanceS.resetMacAddressOfLicense({key:t.licenseKey}).toPromise(),s.ns.showSuccess("MAC address reset successfully."),s.setUIAfterFix(1e4)}catch(a){console.log(a),s.ns.showErrorFromResponse(a.error||a,"Unable to reset MAC address of license.")}}),function(){return n.apply(this,arguments)})})})()}showLicenseKey(t){t.showLicenseKey=!0}hideLicenseKey(t){t.showLicenseKey=!1}showModalSetLicenseKey(){$("#idSetLicenseKeyModal").modal("show")}hideModalSetLicenseKey(){$("#idSetLicenseKeyModal").modal("hide")}showDialogToGetNewLicenseKey(t){this.setLicenseKeyForObj=t,this.newLicenseKey=t.licenseKey,this.showModalSetLicenseKey()}setLicenseKeyAPICall(t){var s=this;return(0,r.Z)(function*(){try{yield s.instanceS.setLicenseKeyOnServer({updateMode:"LICENSE_KEY",uniqueServerId:t.uniqueServerId,uniqueProcessId:t.uniqueProcessId,workerId:t.workerId,licenseKey:s.newLicenseKey,serverName:t.hostName}).toPromise(),s.hideModalSetLicenseKey(),s.ns.showSuccess("License key set successfully."),s.setUIAfterFix(6e3)}catch(n){console.log(n),s.ns.showErrorFromResponse(n.error||n,"Unable to reset MAC address of license.")}})()}reduceUsage__click(t,s){var n=this;let a="";var d;"REDUCE_CPU_USAGE"===s?a=this.constantsS.license.setCPUCoreConfirm:"REDUCE_UI_PAGES_USAGE"===s&&(a=this.constantsS.license.setUIPageCountConfirm),this.confirmationService.confirm({message:a,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(d=(0,r.Z)(function*(){"REDUCE_CPU_USAGE"===s?yield n.hitReduceAPICallForCPU(t):"REDUCE_UI_PAGES_USAGE"===s&&(yield n.hitReduceAPICallForDBMasters(t))}),function(){return d.apply(this,arguments)})})}hitReduceAPICallForCPU(t){var s=this;return(0,r.Z)(function*(){try{const n=(t.licenseError||[]).find(a=>a.licensePermitsCPU)?.licensePermitsCPU;if(!n)return void s.ns.showError("Unable to find CPU core issue in license error.");yield s.instanceS.setLicenseKeyOnServer({updateMode:"CPU_CORE",uniqueServerId:t.uniqueServerId,uniqueProcessId:t.uniqueProcessId,workerId:t.workerId,serverName:t.hostName,cpuCore:n}).toPromise(),s.hideModalSetLicenseKey(),s.ns.showSuccess("CPU core set successfully."),s.setUIAfterFix(1e4)}catch(n){console.log(n),s.ns.showErrorFromResponse(n.error||n,"Unable to set CPU core of license.")}})()}hitReduceAPICallForDBMasters(t){var s=this;return(0,r.Z)(function*(){try{const n=(t.licenseError||[]).find(a=>a.licensePermitsDBMasterCount)?.licensePermitsDBMasterCount;if(!n)return void s.ns.showError("Unable to find UI Pages count issue in license error.");yield s.instanceS.setLicenseKeyOnServer({updateMode:"UI_PAGES_COUNT",uniqueServerId:t.uniqueServerId,uniqueProcessId:t.uniqueProcessId,workerId:t.workerId,serverName:t.hostName,dbMasterCount:n}).toPromise(),s.hideModalSetLicenseKey(),s.ns.showSuccess("UI Pages count set successfully."),s.setUIAfterFix(1e4)}catch(n){console.log(n),s.ns.showErrorFromResponse(n.error||n,"Unable to set UI Pages count of license.")}})()}setUIAfterFix(t){var s=this;this.loadData().then(),this.showValidationInProgress=!0,setTimeout((0,r.Z)(function*(){yield s.loadData(),s.showValidationInProgress=!1,yield s.eventCenterS.headerC.setLicenseHasIssues(s.serverList)}),t)}static \u0275fac=function(s){return new(s||i)(e.Y36(E.D),e.Y36(S.e),e.Y36(I.b),e.Y36(A.E),e.Y36(T.W),e.Y36(L.X),e.Y36(m.YP),e.Y36(P.L),e.Y36(w.u))};static \u0275cmp=e.Xpm({type:i,selectors:[["app-ext-licenses"]],decls:39,vars:7,consts:[[1,"pt-1","pl-1","pr-1"],[1,"full-body","overflow-hidden"],[1,"card"],[1,"card-header"],["src","/assets/images/icons/license.svg","alt","Extension license icon",1,"fa-fw","mr-1",2,"vertical-align","text-top"],[1,"float-right"],["class","float-right",4,"ngIf"],[1,"card-body","p-0","overflow-auto","text-center",2,"height","calc(100vh - 88px)"],["styleClass","p-datatable-striped custom-api-grid-height","scrollHeight","flex",3,"selectionMode","dataKey","scrollable","value"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idSetLicenseKeyModal","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-lg"],[1,"modal-content"],[1,"modal-header"],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],["aria-label","Close","data-dismiss","modal","type","button",1,"close"],["aria-hidden","true"],[1,"fas","fa-window-close"],[1,"modal-body","overflow-auto"],[1,"container","pt-3"],[1,"form-group","row"],[1,"col-4","col-form-label","col-form-label-sm","text-right"],[1,"col-6"],["name","licenseKey","spellcheck","false","type","text","autocomplete","off",1,"form-control","form-control-sm","font-monospaced",3,"ngModel","ngModelChange"],[1,"modal-footer"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary"],[1,"fas","fa-times","text-danger","fa-fw"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["tooltipPosition","left","pTooltip","Validation in progress.",1,"fas","fa-sync-alt","text-success","fa-fw","fa-spin"],[1,"text-center","bg-table-header",2,"width","30px"],[1,"bg-table-header",2,"width","300px"],[1,"bg-table-header",2,"width","240px"],[1,"bg-table-header"],[1,"text-center","bg-table-header",2,"width","125px"],[3,"pSelectableRow"],[1,"text-center"],[4,"ngIf"],[1,"small","font-monospaced"],["target","_blank",1,"ml-2","small","text-muted",3,"href"],[1,""],["class","btn btn-xsm-custom ml-1","pTooltip","Reset registered mac address.","tooltipPosition","left","href","javascript:",3,"click",4,"ngIf"],["class","btn btn-xsm-custom ml-1","pTooltip","Set license key","tooltipPosition","left","href","javascript:",3,"click",4,"ngIf"],["class","btn btn-xsm-custom ml-1","pTooltip","Set CPU core usage from license","tooltipPosition","left","href","javascript:",3,"click",4,"ngIf"],["class","btn btn-xsm-custom ml-1","pTooltip","Set UI Pages usage from license","tooltipPosition","left","href","javascript:",3,"click",4,"ngIf"],["pTooltip","License validation will happen in future.",1,"fas","fa-circle","text-warning"],["pTooltip","Valid license",1,"fas","fa-circle","text-success"],["pTooltip","Invalid license",1,"fas","fa-circle","text-danger"],["href","javascript:",1,"btn","btn-xsm-custom","ml-2",3,"click"],[1,"fas","fa-eye-slash","fa-fw","pt-1"],[1,"fas","fa-eye","fa-fw","pt-1"],[1,"fas","fa-check","fa-fw","text-success"],[4,"ngFor","ngForOf"],["pTooltip","Reset registered mac address.","tooltipPosition","left","href","javascript:",1,"btn","btn-xsm-custom","ml-1",3,"click"],[1,"fas","fa-history","text-info","fa-fw","pt-1"],["pTooltip","Set license key","tooltipPosition","left","href","javascript:",1,"btn","btn-xsm-custom","ml-1",3,"click"],[1,"fas","fa-wrench","text-success","fa-fw","pt-1"],["pTooltip","Set CPU core usage from license","tooltipPosition","left","href","javascript:",1,"btn","btn-xsm-custom","ml-1",3,"click"],[1,"fas","fa-microchip","text-success","fa-fw","pt-1"],["pTooltip","Set UI Pages usage from license","tooltipPosition","left","href","javascript:",1,"btn","btn-xsm-custom","ml-1",3,"click"],[1,"fab","fa-html5","text-success","fa-fw","pt-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(s,n){1&s&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"span"),e._UZ(5,"img",4),e._uU(6," Server List "),e.qZA(),e.TgZ(7,"div",5),e.YNc(8,M,2,0,"span",6),e.qZA()(),e.TgZ(9,"div",7)(10,"p-table",8),e.YNc(11,k,13,0,"ng-template",9),e.YNc(12,j,24,16,"ng-template",10),e.qZA(),e.YNc(13,W,1,0,"p-progressSpinner",11),e.qZA()()()(),e.TgZ(14,"div",12)(15,"div",13)(16,"div",14)(17,"div",15)(18,"span"),e._UZ(19,"i",16),e._uU(20," Set License Key"),e.qZA(),e.TgZ(21,"button",17)(22,"span",18),e._UZ(23,"i",19),e.qZA()()(),e.TgZ(24,"div",20)(25,"form",21)(26,"div",22)(27,"label",23),e._uU(28,"Name"),e.qZA(),e.TgZ(29,"div",24)(30,"input",25),e.NdJ("ngModelChange",function(d){return n.newLicenseKey=d}),e.qZA()()()()(),e.TgZ(31,"div",26)(32,"button",27),e._UZ(33,"i",28),e._uU(34," Close "),e.qZA(),e.TgZ(35,"button",29),e.NdJ("click",function(){return n.setLicenseKeyAPICall(n.setLicenseKeyForObj)}),e._UZ(36,"i",30),e.TgZ(37,"span"),e._uU(38,"Set Key"),e.qZA()()()()()()),2&s&&(e.xp6(8),e.Q6J("ngIf",n.showValidationInProgress),e.xp6(2),e.Q6J("selectionMode","multiple")("dataKey",n.gridKey)("scrollable",!0)("value",n.serverList),e.xp6(3),e.Q6J("ngIf",n.loading.grid),e.xp6(17),e.Q6J("ngModel",n.newLicenseKey))},dependencies:[l._Y,l.Fj,l.JJ,l.JL,l.On,l.F,g.sg,g.O5,b.y,h.iA,m.jx,h.Ei,K.G,N.u],styles:[".bg-table-header[_ngcontent-%COMP%]{background-color:#272727}"]})}return i})(),canActivate:[y.P]}];let z=(()=>{class i{static \u0275fac=function(s){return new(s||i)};static \u0275mod=e.oAB({type:i});static \u0275inj=e.cJS({imports:[v.Bz.forChild(X),Z.u,C.S]})}return i})()}}]);