manifest 4.12.4-beta → 4.13.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.
- package/dist/admin/{69.9b3570b98630c452.js → 69.3a06102c8e39ae88.js} +1 -1
- package/dist/admin/index.html +1 -1
- package/dist/admin/{main.882a4d5946b0bdee.js → main.5610a8a9ad1b3356.js} +1 -1
- package/dist/admin/runtime.b0ecb6141ff09499.js +1 -0
- package/dist/common/src/Helpers.js +2 -2
- package/dist/json-schema/src/schema/definitions/policies/policy-schema.json +5 -0
- package/dist/manifest/src/crud/services/crud.service.d.ts +1 -0
- package/dist/manifest/src/crud/services/crud.service.js +31 -9
- package/dist/manifest/src/endpoint/endpoint.module.js +2 -0
- package/dist/manifest/src/policy/policies.d.ts +18 -4
- package/dist/manifest/src/policy/policies.js +57 -11
- package/dist/manifest/src/policy/policy.guard.d.ts +3 -1
- package/dist/manifest/src/policy/policy.guard.js +34 -6
- package/dist/manifest/src/policy/policy.module.js +2 -0
- package/dist/manifest/src/policy/policy.service.js +4 -1
- package/dist/types/src/manifests/ManifestSchema.d.ts +2 -0
- package/dist/types/src/manifests/PolicyManifest.d.ts +1 -0
- package/package.json +1 -1
- package/dist/admin/runtime.0d8c8b10edb1c9e2.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkadmin=self.webpackChunkadmin||[]).push([[69],{4493:(X,D,p)=>{p.d(D,{B:()=>G});var m=p(2943),E=p(9911),n=p(8428),e=p(8785),I=p(6631),i=p(183),R=p(8284);let G=(()=>{class g{static{this.\u0275fac=function(M){return new(M||g)}}static{this.\u0275mod=R.$C({type:g})}static{this.\u0275inj=R.G2t({imports:[m.MD,i.iI,E.X1,I.L,n.S,e.x]})}}return g})()},1424:(X,D,p)=>{p.d(D,{O:()=>r});var m=p(7431),E=p(9911),n=p(5442),e=p(4782),I=p(7563),i=p(8284),R=p(6119),G=p(2283),g=p(183),P=p(9879),y=p(818),M=p(2943),Y=p(8428);const x=c=>({"is-loading":c});function O(c,v){if(1&c&&(i.qex(0),i.EFF(1),i.bVm()),2&c){const o=i.XpG(3);i.R7$(),i.SpI("Edit ",o.entityManifest.nameSingular,"")}}function k(c,v){if(1&c&&(i.qex(0),i.EFF(1),i.bVm()),2&c){const o=i.XpG(3);i.R7$(),i.SpI("Edit an existing ",o.entityManifest.nameSingular,"")}}function b(c,v){if(1&c&&(i.qex(0),i.DNE(1,O,2,1,"ng-container",0)(2,k,2,1,"ng-container",0),i.bVm()),2&c){const o=i.XpG(2);i.R7$(),i.Y8G("ngIf",o.singleMode),i.R7$(),i.Y8G("ngIf",!o.singleMode)}}function $(c,v){if(1&c&&(i.qex(0),i.EFF(1),i.bVm()),2&c){const o=i.XpG(2);i.R7$(),i.SpI(" Create a new ",o.entityManifest.nameSingular," ")}}function B(c,v){if(1&c){const o=i.RV6();i.j41(0,"div",15)(1,"div",16)(2,"app-input",17),i.bIt("valueChanged",function(h){const F=i.eBV(o).$implicit,d=i.XpG(3);return i.Njj(d.onChange({propName:F.name,newValue:h}))}),i.k0s()()()}if(2&c){const o=v.$implicit,f=i.XpG(3);i.R7$(2),i.Y8G("prop",o)("entityManifest",f.entityManifest)("value",f.edit?f.item[o.name]:null)("errors",f.errors[o.name])}}function U(c,v){if(1&c){const o=i.RV6();i.j41(0,"div",16)(1,"app-input",19),i.bIt("valueChanged",function(h){i.eBV(o);const F=i.XpG().$implicit,d=i.XpG(3);return i.Njj(d.onRelationChange({relationship:F,newValue:h}))}),i.k0s()()}if(2&c){const o=i.XpG().$implicit,f=i.XpG(3);i.R7$(),i.Y8G("relationship",o)("value",f.edit?f.item[o.name]:null)("errors",f.errors[o.name])}}function L(c,v){if(1&c&&(i.j41(0,"div",15),i.DNE(1,U,2,3,"div",18),i.k0s()),2&c){const o=v.$implicit;i.R7$(),i.Y8G("ngIf","many-to-one"===o.type||"many-to-many"===o.type&&o.owningSide)}}function u(c,v){if(1&c&&(i.j41(0,"form",9)(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13),i.DNE(5,B,3,4,"div",14)(6,L,2,1,"div",14),i.k0s()()()()()),2&c){const o=i.XpG(2);i.Y8G("formGroup",o.form),i.R7$(5),i.Y8G("ngForOf",o.entityManifest.properties),i.R7$(),i.Y8G("ngForOf",o.entityManifest.relationships)}}function C(c,v){if(1&c){const o=i.RV6();i.qex(0),i.j41(1,"section")(2,"div",1)(3,"div",2)(4,"h1",3),i.DNE(5,b,3,2,"ng-container",0)(6,$,2,1,"ng-container",0),i.k0s()(),i.j41(7,"div",4)(8,"button",5),i.bIt("click",function(){i.eBV(o);const h=i.XpG();return i.Njj(h.submit())}),i.EFF(9," Submit "),i.k0s(),i.j41(10,"button",6),i.bIt("click",function(){i.eBV(o);const h=i.XpG();return i.Njj(h.submit())}),i.nrm(11,"i",7),i.k0s()()(),i.DNE(12,u,7,3,"form",8),i.k0s(),i.bVm()}if(2&c){const o=i.XpG();i.R7$(5),i.Y8G("ngIf",o.edit),i.R7$(),i.Y8G("ngIf",!o.edit),i.R7$(2),i.Y8G("ngClass",i.eq3(5,x,o.loading)),i.R7$(2),i.Y8G("ngClass",i.eq3(7,x,o.loading)),i.R7$(2),i.Y8G("ngIf",o.item||!o.edit)}}let r=(()=>{class c{constructor(o,f,h,F,d,T,j){this.crudService=o,this.manifestService=f,this.activatedRoute=h,this.router=F,this.formBuilder=d,this.metaService=T,this.flashMessageService=j,this.errors={},this.form=this.formBuilder.group({}),this.PropType=n.Kk}ngOnInit(){var o=this;return(0,m.A)(function*(){(0,e.z)([o.activatedRoute.params,o.activatedRoute.data]).subscribe(function(){var f=(0,m.A)(function*([h,F]){if(o.edit=F.edit,o.entityManifest=yield o.manifestService.getEntityManifest({slug:h.entitySlug}),o.entityManifest||o.router.navigate(["/404"]),o.singleMode="single"===o.activatedRoute.snapshot.data.mode,o.edit){try{o.item=o.singleMode?yield o.crudService.showSingle(o.entityManifest.slug):yield o.crudService.show(o.entityManifest.slug,h.id,{relations:o.entityManifest.relationships.filter(d=>"one-to-many"!==d.type).filter(d=>"many-to-many"!==d.type||d.owningSide).map(d=>d.name)})}catch{o.router.navigate(["/404"])}o.metaService.setTitle(`Edit ${o.entityManifest.nameSingular}`)}else o.metaService.setTitle(`Create a new ${o.entityManifest.nameSingular}`);o.entityManifest.properties.forEach(d=>{let T=null;o.item?T=o.item[d.name]:d.type===n.Kk.Boolean&&(T=!1),o.form.addControl(d.name,new E.MJ(T))}),o.entityManifest.relationships.filter(d=>"one-to-many"!==d.type).filter(d=>"many-to-many"!==d.type||d.owningSide).forEach(d=>{let T=null;"many-to-one"===d.type?T=o.item?o.item[d.name]?.id:null:"many-to-many"===d.type&&(T=o.item?o.item[d.name].map(j=>j.id):[]),o.form.addControl((0,I.yk)(d),new E.MJ(T))})});return function(h){return f.apply(this,arguments)}}())})()}onChange(o){this.form.controls[o.propName].setValue(o.newValue)}onRelationChange(o){return this.onChange({newValue:o.newValue,propName:(0,I.yk)(o.relationship)})}submit(){this.loading=!0,this.edit?(this.singleMode?this.crudService.updateSingle(this.entityManifest.slug,this.form.value):this.crudService.update(this.entityManifest.slug,this.item.id,this.form.value)).then(()=>{this.loading=!1,this.flashMessageService.success(`The ${this.entityManifest.nameSingular} has been updated`),this.router.navigate([this.singleMode?"/singles":"/collections",this.entityManifest.slug])}).catch(f=>{400===f.status&&(this.errors=this.getErrorMessages(f.error)),this.loading=!1,this.flashMessageService.error(`The ${this.entityManifest.nameSingular} could not be updated`)}):this.crudService.create(this.entityManifest.slug,this.form.value).then(o=>{this.loading=!1,this.flashMessageService.success(`The ${this.entityManifest.nameSingular} has been created successfully`),this.router.navigate(["/collections",this.entityManifest.slug,o.id])}).catch(o=>{400===o.status&&(this.errors=this.getErrorMessages(o.error)),this.loading=!1,this.flashMessageService.error(`Error: the ${this.entityManifest.nameSingular} could not be created:\n ${Object.values(this.errors).join(", ")}\n `)})}getErrorMessages(o){const f={};return o.forEach(h=>{f[h.property]=Object.values(h.constraints)}),f}static{this.\u0275fac=function(f){return new(f||c)(i.rXU(R.m),i.rXU(G.x),i.rXU(g.nX),i.rXU(g.Ix),i.rXU(E.ok),i.rXU(P.R),i.rXU(y.L))}}static{this.\u0275cmp=i.VBU({type:c,selectors:[["app-create-edit"]],decls:1,vars:1,consts:[[4,"ngIf"],[1,"is-flex","is-justify-content-space-between","is-align-items-center","mb-5"],[1,"left-part"],[1,"title","is-2","has-text-weight-light"],[1,"right-part"],["type","submit",1,"button","is-link","is-hidden-touch",3,"click","ngClass"],["type","submit",1,"button","is-link","is-hidden-desktop","is-circle",3,"click","ngClass"],[1,"icon","icon-save"],[3,"formGroup",4,"ngIf"],[3,"formGroup"],[1,"card","is-shadowless","p-4"],[1,"columns"],[1,"column","is-12-touch","is-8-desktop","is-offset-2-desktop","is-6-widescreen","is-offset-3-widescreen","is-6-fullhd","is-offset-3-fullhd"],[1,"form-group"],["class","field mt-2 mb-4",4,"ngFor","ngForOf"],[1,"field","mt-2","mb-4"],[1,"control"],[3,"valueChanged","prop","entityManifest","value","errors"],["class","control",4,"ngIf"],[3,"valueChanged","relationship","value","errors"]],template:function(f,h){1&f&&i.DNE(0,C,13,9,"ng-container",0),2&f&&i.Y8G("ngIf",h.entityManifest)},dependencies:[M.YU,M.Sq,M.bT,E.qT,E.cb,E.j4,Y.S]})}}return c})()},992:(X,D,p)=>{p.d(D,{R:()=>L});var m=p(7431),E=p(9e3),n=p(8284),e=p(6119),I=p(2283),i=p(183),R=p(9879),G=p(2943),g=p(6631),P=p(8785);const y=u=>["/collections",u];function M(u,C){if(1&u&&(n.j41(0,"a",17),n.nrm(1,"i",18),n.k0s()),2&u){const r=n.XpG(2);n.Y8G("routerLink",n.eq3(1,y,r.entityManifest.namePlural))}}function Y(u,C){if(1&u&&(n.j41(0,"div",19)(1,"p",20),n.EFF(2),n.k0s(),n.j41(3,"p",21),n.nrm(4,"app-yield",22),n.k0s()()),2&u){const r=C.$implicit,c=n.XpG(2);n.R7$(2),n.SpI(" ",r.name," "),n.R7$(2),n.Y8G("value",c.item[r.name])("prop",r)}}function x(u,C){if(1&u&&n.nrm(0,"app-relation-yield",25),2&u){const r=n.XpG(2).$implicit,c=n.XpG(2);n.Y8G("item",c.item[r.name])("relationship",r)}}function O(u,C){1&u&&(n.qex(0),n.EFF(1,", "),n.bVm())}function k(u,C){if(1&u&&(n.qex(0),n.nrm(1,"app-relation-yield",25),n.DNE(2,O,2,0,"ng-container",0),n.bVm()),2&u){const r=C.$implicit,c=C.last,v=n.XpG(3).$implicit;n.R7$(),n.Y8G("item",r)("relationship",v),n.R7$(),n.Y8G("ngIf",!c)}}function b(u,C){if(1&u&&(n.qex(0),n.DNE(1,k,3,3,"ng-container",26),n.bVm()),2&u){const r=n.XpG(2).$implicit,c=n.XpG(2);n.R7$(),n.Y8G("ngForOf",c.getManyToManyRelations(c.item,r))}}function $(u,C){if(1&u&&(n.qex(0),n.j41(1,"p",20),n.EFF(2),n.k0s(),n.j41(3,"p",21),n.DNE(4,x,1,2,"app-relation-yield",24)(5,b,2,1,"ng-container",0),n.k0s(),n.bVm()),2&u){const r=n.XpG().$implicit;n.R7$(2),n.SpI(" ",r.name," "),n.R7$(2),n.Y8G("ngIf","many-to-one"===r.type),n.R7$(),n.Y8G("ngIf","many-to-many"===r.type)}}function B(u,C){if(1&u&&(n.j41(0,"div",23),n.DNE(1,$,6,3,"ng-container",0),n.k0s()),2&u){const r=C.$implicit;n.R7$(),n.Y8G("ngIf","many-to-one"===r.type||"many-to-many"===r.type&&r.owningSide)}}function U(u,C){if(1&u&&(n.j41(0,"section")(1,"div",1)(2,"div",2),n.DNE(3,M,2,3,"a",3),n.j41(4,"h1",4),n.EFF(5),n.k0s()(),n.j41(6,"div",5)(7,"a",6),n.nrm(8,"i",7),n.k0s(),n.j41(9,"a",8),n.EFF(10,"Edit "),n.k0s(),n.j41(11,"a",9),n.nrm(12,"i",10),n.k0s()()(),n.j41(13,"div",11)(14,"div",12)(15,"div",13)(16,"div",14),n.DNE(17,Y,5,3,"div",15)(18,B,2,1,"div",16),n.k0s()()()()()),2&u){const r=n.XpG();n.R7$(3),n.Y8G("ngIf",!r.entityManifest.single),n.R7$(2),n.SpI(" ",r.singleMode?r.entityManifest.nameSingular:r.item[r.entityManifest.mainProp]," "),n.R7$(12),n.Y8G("ngForOf",r.entityManifest.properties),n.R7$(),n.Y8G("ngForOf",r.entityManifest.relationships)}}let L=(()=>{class u{constructor(r,c,v,o,f){this.crudService=r,this.manifestService=c,this.activatedRoute=v,this.metaService=o,this.router=f}ngOnInit(){var r=this;this.activatedRoute.params.subscribe(function(){var c=(0,m.A)(function*(v){r.entityManifest=yield r.manifestService.getEntityManifest({slug:v.entitySlug}),r.entityManifest||r.router.navigate(["/404"]),r.singleMode="single"===r.activatedRoute.snapshot.data.mode;try{r.item=r.singleMode?yield r.crudService.showSingle(r.entityManifest.slug):yield r.crudService.show(r.entityManifest.slug,v.id,{relations:r.entityManifest.relationships?.filter(o=>"one-to-many"!==o.type).filter(o=>"many-to-many"!==o.type||o.owningSide).map(o=>o.name)})}catch{r.router.navigate(["/404"])}r.metaService.setTitle((new E.X).transform(r.entityManifest.nameSingular))});return function(v){return c.apply(this,arguments)}}())}getManyToManyRelations(r,c){return r[c.name]}static{this.\u0275fac=function(c){return new(c||u)(n.rXU(e.m),n.rXU(I.x),n.rXU(i.nX),n.rXU(R.R),n.rXU(i.Ix))}}static{this.\u0275cmp=n.VBU({type:u,selectors:[["app-detail"]],decls:1,vars:1,consts:[[4,"ngIf"],[1,"is-flex","is-justify-content-space-between","is-align-items-center","mb-5"],[1,"left-part","is-flex","is-flex-wrap-wrap","is-align-items-center"],["class","button is-circle mr-2 button--back",3,"routerLink",4,"ngIf"],[1,"title","is-2","has-text-weight-light"],[1,"right-part","is-flex","is-flex-direction-row"],[1,"button","is-link","is-light","is-hidden-desktop","is-circle"],[1,"icon","icon-trash-2"],["routerLink","edit",1,"button","is-link","ml-2","is-hidden-touch"],["routerLink","edit",1,"button","is-link","ml-2","is-hidden-desktop","is-circle"],[1,"icon","icon-edit"],[1,"card","p-0","mb-6","is-shadowless"],[1,"card-content"],[1,"columns"],[1,"column","is-12-touch","is-8-desktop","is-offset-2-desktop","is-6-widescreen","is-offset-3-widescreen","is-6-fullhd","is-offset-3-fullhd"],["class","properties",4,"ngFor","ngForOf"],["class","relations",4,"ngFor","ngForOf"],[1,"button","is-circle","mr-2","button--back",3,"routerLink"],[1,"icon","icon-arrow-right"],[1,"properties"],[1,"is-property-label","mb-1","is-size-5","has-text-dark","has-text-weight-medium"],[1,"is-property-value"],[3,"value","prop"],[1,"relations"],[3,"item","relationship",4,"ngIf"],[3,"item","relationship"],[4,"ngFor","ngForOf"]],template:function(c,v){1&c&&n.DNE(0,U,19,4,"section",0),2&c&&n.Y8G("ngIf",v.item&&v.entityManifest)},dependencies:[G.Sq,G.bT,i.Wk,g.L,P.x],styles:['@import"https://fonts.googleapis.com/css?family=Rubik:300,400,400i,500";.properties[_ngcontent-%COMP%] + div[_ngcontent-%COMP%], .relations[_ngcontent-%COMP%] + div[_ngcontent-%COMP%]{margin-top:16px}@media screen and (min-width: 1000px){.card.is-single-card[_ngcontent-%COMP%]{padding-right:25%!important;padding-left:25%!important}}@media screen and (min-width: 1458px){.card.is-single-card[_ngcontent-%COMP%]{padding-right:33%!important;padding-left:33%!important}}']})}}return u})()},8785:(X,D,p)=>{p.d(D,{x:()=>G});var m=p(2943),E=p(183),n=p(8284),e=p(2283);const I=(g,P)=>["/","collections",g,P];function i(g,P){if(1&g&&(n.j41(0,"a",2)(1,"span"),n.EFF(2),n.k0s()()),2&g){const y=n.XpG();n.Y8G("routerLink",n.l_i(2,I,y.entityManifest.slug,y.item.id)),n.R7$(2),n.JRh(y.item[y.entityManifest.mainProp])}}function R(g,P){1&g&&(n.j41(0,"span"),n.EFF(1,"-"),n.k0s())}let G=(()=>{class g{constructor(y){this.manifestService=y}ngOnInit(){this.manifestService.getEntityManifest({className:this.relationship.entity}).then(y=>{this.entityManifest=y})}static{this.\u0275fac=function(M){return new(M||g)(n.rXU(e.x))}}static{this.\u0275cmp=n.VBU({type:g,selectors:[["app-relation-yield"]],inputs:{item:"item",relationship:"relationship"},standalone:!0,features:[n.aNF],decls:2,vars:2,consts:[[3,"routerLink",4,"ngIf"],[4,"ngIf"],[3,"routerLink"]],template:function(M,Y){1&M&&n.DNE(0,i,3,5,"a",0)(1,R,2,0,"span",1),2&M&&(n.Y8G("ngIf",Y.item&&Y.entityManifest),n.R7$(),n.Y8G("ngIf",!Y.item||!Y.entityManifest))},dependencies:[E.iI,E.Wk,m.MD,m.bT]})}}return g})()},6631:(X,D,p)=>{p.d(D,{L:()=>ue});var m=p(2943),E=p(5442),n=function(t){return t[t.Text=0]="Text",t[t.Number=1]="Number",t[t.Link=2]="Link",t[t.Currency=3]="Currency",t[t.Date=4]="Date",t[t.Boolean=5]="Boolean",t[t.Email=6]="Email",t[t.ProgressBar=7]="ProgressBar",t[t.Label=8]="Label",t[t.Location=9]="Location",t}(n||{}),e=p(8284);function I(t,_){1&t&&(e.j41(0,"span"),e.nrm(1,"i",1),e.k0s())}function i(t,_){1&t&&(e.j41(0,"span"),e.EFF(1," - "),e.k0s())}let R=(()=>{class t{static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["app-boolean-yield"]],inputs:{value:"value"},standalone:!0,features:[e.aNF],decls:3,vars:2,consts:[[4,"ngIf"],[1,"icon","icon-check-circle","has-text-success"]],template:function(l,s){1&l&&(e.j41(0,"div"),e.DNE(1,I,2,0,"span",0)(2,i,2,0,"span",0),e.k0s()),2&l&&(e.R7$(),e.Y8G("ngIf",s.value),e.R7$(),e.Y8G("ngIf",!s.value))},dependencies:[m.MD,m.bT]})}}return t})();function G(t,_){if(1&t&&(e.j41(0,"span",1),e.EFF(1),e.nI1(2,"currency"),e.k0s()),2&t){const a=e.XpG();e.R7$(),e.SpI(" ",e.i5U(2,1,a.value,a.currency),"")}}function g(t,_){1&t&&(e.j41(0,"span",1),e.EFF(1," - "),e.k0s())}let P=(()=>{class t{static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["app-currency-yield"]],inputs:{value:"value",currency:"currency"},standalone:!0,features:[e.aNF],decls:2,vars:2,consts:[["class","is-nowrap",4,"ngIf"],[1,"is-nowrap"]],template:function(l,s){1&l&&e.DNE(0,G,3,4,"span",0)(1,g,2,0,"span",0),2&l&&(e.Y8G("ngIf",s.value),e.R7$(),e.Y8G("ngIf",!s.value))},dependencies:[m.bT,m.oe]})}}return t})();function y(t,_){1&t&&(e.j41(0,"span",0),e.EFF(1," - "),e.k0s())}let M=(()=>{class t{static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["app-date-yield"]],inputs:{value:"value"},standalone:!0,features:[e.aNF],decls:4,vars:5,consts:[[1,"is-nowrap"],["class","is-nowrap",4,"ngIf"]],template:function(l,s){1&l&&(e.j41(0,"span",0),e.EFF(1),e.nI1(2,"date"),e.k0s(),e.DNE(3,y,2,0,"span",1)),2&l&&(e.R7$(),e.JRh(e.i5U(2,2,s.value,"MM/dd/yy")),e.R7$(2),e.Y8G("ngIf",!s.value))},dependencies:[m.vh,m.bT]})}}return t})(),Y=(()=>{class t{static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["app-email-yield"]],inputs:{value:"value"},standalone:!0,features:[e.aNF],decls:3,vars:1,consts:[[1,"yield"],[1,"yield__value"]],template:function(l,s){1&l&&(e.j41(0,"div",0)(1,"div",1),e.EFF(2),e.k0s()()),2&l&&(e.R7$(2),e.JRh(s.value))}})}}return t})();function x(t,_){if(1&t&&(e.j41(0,"span"),e.EFF(1),e.k0s()),2&t){const a=e.XpG();e.ZvI("tag is-rounded is-color-",a.index,""),e.R7$(),e.JRh(a.value)}}function O(t,_){1&t&&(e.j41(0,"span"),e.EFF(1,"-"),e.k0s())}let k=(()=>{class t{ngOnInit(){this.index=this.values.indexOf(this.value)}static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["app-label-yield"]],inputs:{value:"value",values:"values"},standalone:!0,features:[e.aNF],decls:2,vars:2,consts:[[3,"class",4,"ngIf"],[4,"ngIf"]],template:function(l,s){1&l&&e.DNE(0,x,2,4,"span",0)(1,O,2,0,"span",1),2&l&&(e.Y8G("ngIf",s.value),e.R7$(),e.Y8G("ngIf",!s.value))},dependencies:[m.MD,m.bT],styles:[".is-color-3[_ngcontent-%COMP%]{background-color:#f50057;color:#fff}.is-color-1[_ngcontent-%COMP%]{background-color:#ff6d00;color:#fff}.is-color-2[_ngcontent-%COMP%]{background-color:#ffd600;color:#000}.is-color-4[_ngcontent-%COMP%]{background-color:#d500f9;color:#fff}.is-color-5[_ngcontent-%COMP%]{background-color:#651fff;color:#fff}.is-color-6[_ngcontent-%COMP%]{background-color:#3d5afe;color:#fff}.is-color-7[_ngcontent-%COMP%]{background-color:#00b0ff;color:#fff}.is-color-8[_ngcontent-%COMP%]{background-color:#00c853;color:#fff}.is-color-9[_ngcontent-%COMP%]{background-color:#64dd17;color:#000}.is-color-10[_ngcontent-%COMP%]{background-color:#a1887f;color:#fff}.is-color-11[_ngcontent-%COMP%]{background-color:#607d8b;color:#fff}.is-color-12[_ngcontent-%COMP%]{background-color:#9e9e9e;color:#fff}"]})}}return t})(),b=(()=>{class t{transform(a,l){return a?.length>l?a.substring(0,l)+"...":a}static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275pipe=e.EJ8({name:"truncate",type:t,pure:!0,standalone:!0})}}return t})();const $=(t,_)=>({"icon-external-link":t,"icon-download":_});function B(t,_){if(1&t&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"truncate"),e.k0s()),2&t){const a=e.XpG(2);e.R7$(),e.JRh(e.i5U(2,1,a.value,44))}}function U(t,_){if(1&t&&(e.j41(0,"span"),e.EFF(1),e.k0s()),2&t){const a=e.XpG(2);e.R7$(),e.JRh(a.value)}}function L(t,_){if(1&t&&(e.j41(0,"a",2),e.nrm(1,"i",3),e.DNE(2,B,3,4,"span",4)(3,U,2,1,"span",4),e.k0s()),2&t){const a=e.XpG();e.Y8G("href",a.value,e.B4B)("download",a.isDownload),e.R7$(),e.Y8G("ngClass",e.l_i(5,$,!a.isDownload,a.isDownload)),e.R7$(),e.Y8G("ngIf",a.compact),e.R7$(),e.Y8G("ngIf",!a.compact)}}function u(t,_){1&t&&(e.j41(0,"span",5),e.EFF(1," - "),e.k0s())}let C=(()=>{class t{constructor(){this.compact=!0,this.isDownload=!1}static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["app-link-yield"]],inputs:{value:"value",compact:"compact",isDownload:"isDownload"},standalone:!0,features:[e.aNF],decls:2,vars:2,consts:[["target","_blank","class","is-inline-flex is-align-items-center",3,"href","download",4,"ngIf"],["class","is-nowrap",4,"ngIf"],["target","_blank",1,"is-inline-flex","is-align-items-center",3,"href","download"],[1,"icon","icon-external-link","mr-1",3,"ngClass"],[4,"ngIf"],[1,"is-nowrap"]],template:function(l,s){1&l&&e.DNE(0,L,4,8,"a",0)(1,u,2,0,"span",1),2&l&&(e.Y8G("ngIf",s.value),e.R7$(),e.Y8G("ngIf",!s.value))},dependencies:[m.bT,m.YU,b]})}}return t})();function r(t,_){if(1&t&&(e.j41(0,"a",2),e.nrm(1,"i",3),e.j41(2,"span"),e.EFF(3,"View on map"),e.k0s()()),2&t){const a=e.XpG();e.FCK("href","https://www.openstreetmap.org/?mlat=",a.value.lat,"&mlon=",a.value.lng,"",e.B4B)}}function c(t,_){1&t&&(e.j41(0,"span"),e.EFF(1,"-"),e.k0s())}let v=(()=>{class t{static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["app-location-yield"]],inputs:{value:"value"},standalone:!0,features:[e.aNF],decls:2,vars:2,consts:[["target","_blank",3,"href",4,"ngIf"],[4,"ngIf"],["target","_blank",3,"href"],[1,"icon","icon-map-pin","mr-1"]],template:function(l,s){1&l&&e.DNE(0,r,4,3,"a",0)(1,c,2,0,"span",1),2&l&&(e.Y8G("ngIf",(null==s.value?null:s.value.lat)&&(null==s.value?null:s.value.lng)),e.R7$(),e.Y8G("ngIf",!(null!=s.value&&s.value.lat&&null!=s.value&&s.value.lng)))},dependencies:[m.bT]})}}return t})();function o(t,_){if(1&t&&(e.j41(0,"span",1),e.EFF(1),e.k0s()),2&t){const a=e.XpG();e.R7$(),e.SpI(" ",a.value," ")}}function f(t,_){1&t&&(e.j41(0,"span",1),e.EFF(1," - "),e.k0s())}let h=(()=>{class t{static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["app-number-yield"]],inputs:{value:"value"},standalone:!0,features:[e.aNF],decls:2,vars:2,consts:[["class","is-nowrap",4,"ngIf"],[1,"is-nowrap"]],template:function(l,s){1&l&&e.DNE(0,o,2,1,"span",0)(1,f,2,0,"span",0),2&l&&(e.Y8G("ngIf",null!==s.value),e.R7$(),e.Y8G("ngIf",null===s.value))},dependencies:[m.bT]})}}return t})();function F(t,_){1&t&&e.nrm(0,"span",4)}function d(t,_){1&t&&e.nrm(0,"span",5)}function T(t,_){if(1&t&&(e.qex(0),e.DNE(1,F,1,0,"span",2)(2,d,1,0,"span",3),e.bVm()),2&t){const a=_.index,l=e.XpG();e.R7$(),e.Y8G("ngIf",l.index>=a),e.R7$(),e.Y8G("ngIf",l.index<a)}}let j=(()=>{class t{constructor(){this.enumAsArray=[]}ngOnInit(){this.index=this.values.indexOf(this.value)}static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["app-progress-bar-yield"]],inputs:{value:"value",values:"values"},standalone:!0,features:[e.aNF],decls:2,vars:5,consts:[[1,"is-flex","is-align-items-center","is-white-space-nowrap","tooltip","has-tooltip-left"],[4,"ngFor","ngForOf"],["class","bullet",4,"ngIf"],["class","bullet is-grey",4,"ngIf"],[1,"bullet"],[1,"bullet","is-grey"]],template:function(l,s){1&l&&(e.j41(0,"div",0),e.DNE(1,T,3,2,"ng-container",1),e.k0s()),2&l&&(e.ZvI("is-color-",s.index,""),e.BMQ("data-tooltip",s.value||"Unknown"),e.R7$(),e.Y8G("ngForOf",s.values))},dependencies:[m.MD,m.Sq,m.bT]})}}return t})();function S(t,_){if(1&t&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"truncate"),e.k0s()),2&t){const a=e.XpG();e.R7$(),e.JRh(e.i5U(2,1,a.value,44))}}function w(t,_){if(1&t&&(e.j41(0,"span"),e.EFF(1),e.k0s()),2&t){const a=e.XpG();e.R7$(),e.JRh(a.value)}}function N(t,_){1&t&&(e.j41(0,"span"),e.EFF(1," - "),e.k0s())}let A=(()=>{class t{constructor(){this.compact=!0}static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["app-text-yield"]],inputs:{value:"value",compact:"compact"},standalone:!0,features:[e.aNF],decls:3,vars:3,consts:[[4,"ngIf"]],template:function(l,s){1&l&&e.DNE(0,S,3,4,"span",0)(1,w,2,1,"span",0)(2,N,2,0,"span",0),2&l&&(e.Y8G("ngIf",s.compact),e.R7$(),e.Y8G("ngIf",!s.compact),e.R7$(),e.Y8G("ngIf",!s.value))},dependencies:[m.MD,m.bT,b]})}}return t})(),V=(()=>{class t{static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["app-timestamp-yield"]],inputs:{value:"value"},standalone:!0,features:[e.aNF],decls:3,vars:4,consts:[[1,"is-nowrap"]],template:function(l,s){1&l&&(e.j41(0,"span",0),e.EFF(1),e.nI1(2,"date"),e.k0s()),2&l&&(e.R7$(),e.JRh(e.i5U(2,1,s.value,"yyyy-MM-dd HH:mm:ss")))},dependencies:[m.vh],encapsulation:2})}}return t})();var K=p(7563);function W(t,_){if(1&t&&e.nrm(0,"img",2),2&t){const a=e.XpG();e.Y8G("src",a.image,e.B4B)}}function J(t,_){1&t&&(e.j41(0,"span"),e.EFF(1,"-"),e.k0s())}let z=(()=>{class t{ngOnInit(){if(this.value){const a=(0,K.Gj)(this.sizes);this.image=this.value[a]}}static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["app-image-yield"]],inputs:{value:"value",sizes:"sizes",label:"label"},standalone:!0,features:[e.aNF],decls:2,vars:2,consts:[["alt","image","width","36","height","36",3,"src",4,"ngIf"],[4,"ngIf"],["alt","image","width","36","height","36",3,"src"]],template:function(l,s){1&l&&e.DNE(0,W,1,1,"img",0)(1,J,2,0,"span",1),2&l&&(e.Y8G("ngIf",s.image),e.R7$(),e.Y8G("ngIf",!s.image))},dependencies:[m.bT],encapsulation:2})}}return t})();function H(t,_){if(1&t&&(e.j41(0,"div",2)(1,"div",3),e.nrm(2,"div",4),e.k0s()()),2&t){const a=e.XpG();e.R7$(2),e.Y8G("innerHTML",a.value,e.npT)}}function Z(t,_){1&t&&(e.j41(0,"span"),e.EFF(1,"-"),e.k0s())}let Q=(()=>{class t{static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["app-rich-text-yield"]],inputs:{value:"value"},standalone:!0,features:[e.aNF],decls:2,vars:2,consts:[["class","wrapper",4,"ngIf"],[4,"ngIf"],[1,"wrapper"],[1,"content","is-normal"],[3,"innerHTML"]],template:function(l,s){1&l&&e.DNE(0,H,3,1,"div",0)(1,Z,2,0,"span",1),2&l&&(e.Y8G("ngIf",s.value),e.R7$(),e.Y8G("ngIf",!s.value))},dependencies:[m.bT],styles:['@import"https://fonts.googleapis.com/css?family=Rubik:300,400,400i,500";.wrapper[_ngcontent-%COMP%]{border:1px solid #dddde2;background-color:#fff;padding:32px;border-radius:6px}.content[_ngcontent-%COMP%] blockquote[_ngcontent-%COMP%]{border-left:4px solid #39393c;background-color:#fff}']})}}return t})();function q(t,_){if(1&t&&e.nrm(0,"app-text-yield",6),2&t){const a=e.XpG();e.Y8G("value",a.value)("compact",a.compact)}}function ee(t,_){if(1&t&&e.nrm(0,"app-rich-text-yield",7),2&t){const a=e.XpG();e.Y8G("value",a.value)}}function te(t,_){if(1&t&&e.nrm(0,"app-number-yield",7),2&t){const a=e.XpG();e.Y8G("value",a.value)}}function ne(t,_){if(1&t&&e.nrm(0,"app-link-yield",8),2&t){const a=e.XpG();e.Y8G("value",a.value)("isDownload",a.prop.type===a.PropType.File)("compact",a.compact)}}function ie(t,_){if(1&t&&e.nrm(0,"app-boolean-yield",7),2&t){const a=e.XpG();e.Y8G("value",a.value)}}function ae(t,_){if(1&t&&e.nrm(0,"app-currency-yield",9),2&t){const a=e.XpG();e.Y8G("currency",null==a.prop.options?null:a.prop.options.currency)("value",a.value)}}function oe(t,_){if(1&t&&e.nrm(0,"app-date-yield",7),2&t){const a=e.XpG();e.Y8G("value",a.value)}}function se(t,_){if(1&t&&e.nrm(0,"app-timestamp-yield",7),2&t){const a=e.XpG();e.Y8G("value",a.value)}}function le(t,_){if(1&t&&e.nrm(0,"app-email-yield",7),2&t){const a=e.XpG();e.Y8G("value",a.value)}}function re(t,_){if(1&t&&e.nrm(0,"app-label-yield",10),2&t){const a=e.XpG();e.Y8G("values",null==a.prop.options?null:a.prop.options.values)("value",a.value)}}function ce(t,_){if(1&t&&e.nrm(0,"app-progress-bar-yield",10),2&t){const a=e.XpG();e.Y8G("values",null==a.prop.options?null:a.prop.options.values)("value",a.value)}}function pe(t,_){if(1&t&&e.nrm(0,"app-location-yield",7),2&t){const a=e.XpG();e.Y8G("value",a.value)}}function _e(t,_){if(1&t&&e.nrm(0,"app-image-yield",11),2&t){const a=e.XpG();e.Y8G("value",a.value)("sizes",null==a.prop.options?null:a.prop.options.sizes)}}let ue=(()=>{class t{constructor(){this.compact=!1,this.PropType=E.Kk,this.YieldType=n}static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["app-yield"]],inputs:{prop:"prop",value:"value",compact:"compact"},standalone:!0,features:[e.aNF],decls:13,vars:13,consts:[[3,"value","compact",4,"ngIf"],[3,"value",4,"ngIf"],[3,"value","isDownload","compact",4,"ngIf"],[3,"currency","value",4,"ngIf"],[3,"values","value",4,"ngIf"],[3,"value","sizes",4,"ngIf"],[3,"value","compact"],[3,"value"],[3,"value","isDownload","compact"],[3,"currency","value"],[3,"values","value"],[3,"value","sizes"]],template:function(l,s){1&l&&e.DNE(0,q,1,2,"app-text-yield",0)(1,ee,1,1,"app-rich-text-yield",1)(2,te,1,1,"app-number-yield",1)(3,ne,1,3,"app-link-yield",2)(4,ie,1,1,"app-boolean-yield",1)(5,ae,1,2,"app-currency-yield",3)(6,oe,1,1,"app-date-yield",1)(7,se,1,1,"app-timestamp-yield",1)(8,le,1,1,"app-email-yield",1)(9,re,1,2,"app-label-yield",4)(10,ce,1,2,"app-progress-bar-yield",4)(11,pe,1,1,"app-location-yield",1)(12,_e,1,2,"app-image-yield",5),2&l&&(e.Y8G("ngIf",s.prop.type===s.PropType.String||s.prop.type===s.PropType.Text),e.R7$(),e.Y8G("ngIf",s.prop.type===s.PropType.RichText),e.R7$(),e.Y8G("ngIf",s.prop.type===s.PropType.Number),e.R7$(),e.Y8G("ngIf",s.prop.type===s.PropType.Link||s.prop.type===s.PropType.File),e.R7$(),e.Y8G("ngIf",s.prop.type===s.PropType.Boolean),e.R7$(),e.Y8G("ngIf",s.prop.type===s.PropType.Money),e.R7$(),e.Y8G("ngIf",s.prop.type===s.PropType.Date),e.R7$(),e.Y8G("ngIf",s.prop.type===s.PropType.Timestamp),e.R7$(),e.Y8G("ngIf",s.prop.type===s.PropType.Email),e.R7$(),e.Y8G("ngIf",s.prop.type===s.PropType.Choice&&!0!==(null==s.prop.options?null:s.prop.options.sequential)),e.R7$(),e.Y8G("ngIf",s.prop.type===s.PropType.Choice&&!0===(null==s.prop.options?null:s.prop.options.sequential)),e.R7$(),e.Y8G("ngIf",s.prop.type===s.PropType.Location),e.R7$(),e.Y8G("ngIf",s.prop.type===s.PropType.Image))},dependencies:[m.MD,m.bT,R,P,M,V,Y,h,C,A,k,j,v,z,Q],encapsulation:2})}}return t})()}}]);
|
|
1
|
+
"use strict";(self.webpackChunkadmin=self.webpackChunkadmin||[]).push([[69],{4493:(X,D,p)=>{p.d(D,{B:()=>G});var m=p(2943),E=p(9911),n=p(8428),e=p(8785),I=p(6631),i=p(183),R=p(8284);let G=(()=>{class g{static{this.\u0275fac=function(M){return new(M||g)}}static{this.\u0275mod=R.$C({type:g})}static{this.\u0275inj=R.G2t({imports:[m.MD,i.iI,E.X1,I.L,n.S,e.x]})}}return g})()},1424:(X,D,p)=>{p.d(D,{O:()=>r});var m=p(7431),E=p(9911),n=p(5442),e=p(4782),I=p(7563),i=p(8284),R=p(6119),G=p(2283),g=p(183),P=p(9879),y=p(818),M=p(2943),Y=p(8428);const x=c=>({"is-loading":c});function b(c,v){if(1&c&&(i.qex(0),i.EFF(1),i.bVm()),2&c){const o=i.XpG(3);i.R7$(),i.SpI("Edit ",o.entityManifest.nameSingular,"")}}function k(c,v){if(1&c&&(i.qex(0),i.EFF(1),i.bVm()),2&c){const o=i.XpG(3);i.R7$(),i.SpI("Edit an existing ",o.entityManifest.nameSingular,"")}}function O(c,v){if(1&c&&(i.qex(0),i.DNE(1,b,2,1,"ng-container",0)(2,k,2,1,"ng-container",0),i.bVm()),2&c){const o=i.XpG(2);i.R7$(),i.Y8G("ngIf",o.singleMode),i.R7$(),i.Y8G("ngIf",!o.singleMode)}}function $(c,v){if(1&c&&(i.qex(0),i.EFF(1),i.bVm()),2&c){const o=i.XpG(2);i.R7$(),i.SpI(" Create a new ",o.entityManifest.nameSingular," ")}}function B(c,v){if(1&c){const o=i.RV6();i.j41(0,"div",15)(1,"div",16)(2,"app-input",17),i.bIt("valueChanged",function(h){const F=i.eBV(o).$implicit,d=i.XpG(3);return i.Njj(d.onChange({propName:F.name,newValue:h}))}),i.k0s()()()}if(2&c){const o=v.$implicit,f=i.XpG(3);i.R7$(2),i.Y8G("prop",o)("entityManifest",f.entityManifest)("value",f.edit?f.item[o.name]:null)("errors",f.errors[o.name])}}function U(c,v){if(1&c){const o=i.RV6();i.j41(0,"div",16)(1,"app-input",19),i.bIt("valueChanged",function(h){i.eBV(o);const F=i.XpG().$implicit,d=i.XpG(3);return i.Njj(d.onRelationChange({relationship:F,newValue:h}))}),i.k0s()()}if(2&c){const o=i.XpG().$implicit,f=i.XpG(3);i.R7$(),i.Y8G("relationship",o)("value",f.edit?f.item[o.name]:null)("errors",f.errors[o.name])}}function L(c,v){if(1&c&&(i.j41(0,"div",15),i.DNE(1,U,2,3,"div",18),i.k0s()),2&c){const o=v.$implicit;i.R7$(),i.Y8G("ngIf","many-to-one"===o.type||"many-to-many"===o.type&&o.owningSide)}}function u(c,v){if(1&c&&(i.j41(0,"form",9)(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13),i.DNE(5,B,3,4,"div",14)(6,L,2,1,"div",14),i.k0s()()()()()),2&c){const o=i.XpG(2);i.Y8G("formGroup",o.form),i.R7$(5),i.Y8G("ngForOf",o.entityManifest.properties),i.R7$(),i.Y8G("ngForOf",o.entityManifest.relationships)}}function C(c,v){if(1&c){const o=i.RV6();i.qex(0),i.j41(1,"section")(2,"div",1)(3,"div",2)(4,"h1",3),i.DNE(5,O,3,2,"ng-container",0)(6,$,2,1,"ng-container",0),i.k0s()(),i.j41(7,"div",4)(8,"button",5),i.bIt("click",function(){i.eBV(o);const h=i.XpG();return i.Njj(h.submit())}),i.EFF(9," Submit "),i.k0s(),i.j41(10,"button",6),i.bIt("click",function(){i.eBV(o);const h=i.XpG();return i.Njj(h.submit())}),i.nrm(11,"i",7),i.k0s()()(),i.DNE(12,u,7,3,"form",8),i.k0s(),i.bVm()}if(2&c){const o=i.XpG();i.R7$(5),i.Y8G("ngIf",o.edit),i.R7$(),i.Y8G("ngIf",!o.edit),i.R7$(2),i.Y8G("ngClass",i.eq3(5,x,o.loading)),i.R7$(2),i.Y8G("ngClass",i.eq3(7,x,o.loading)),i.R7$(2),i.Y8G("ngIf",o.item||!o.edit)}}let r=(()=>{class c{constructor(o,f,h,F,d,T,j){this.crudService=o,this.manifestService=f,this.activatedRoute=h,this.router=F,this.formBuilder=d,this.metaService=T,this.flashMessageService=j,this.errors={},this.form=this.formBuilder.group({}),this.PropType=n.Kk}ngOnInit(){var o=this;return(0,m.A)(function*(){(0,e.z)([o.activatedRoute.params,o.activatedRoute.data]).subscribe(function(){var f=(0,m.A)(function*([h,F]){if(o.edit=F.edit,o.entityManifest=yield o.manifestService.getEntityManifest({slug:h.entitySlug}),o.entityManifest||o.router.navigate(["/404"]),o.singleMode="single"===o.activatedRoute.snapshot.data.mode,o.edit){try{o.item=o.singleMode?yield o.crudService.showSingle(o.entityManifest.slug):yield o.crudService.show(o.entityManifest.slug,h.id,{relations:o.entityManifest.relationships.filter(d=>"one-to-many"!==d.type).filter(d=>"many-to-many"!==d.type||d.owningSide).map(d=>d.name)})}catch{o.router.navigate(["/404"])}o.metaService.setTitle(`Edit ${o.entityManifest.nameSingular}`)}else o.metaService.setTitle(`Create a new ${o.entityManifest.nameSingular}`);o.entityManifest.properties.forEach(d=>{let T=null;o.item?T=o.item[d.name]:d.type===n.Kk.Boolean&&(T=!1),o.form.addControl(d.name,new E.MJ(T))}),o.entityManifest.relationships.filter(d=>"one-to-many"!==d.type).filter(d=>"many-to-many"!==d.type||d.owningSide).forEach(d=>{let T=null;"many-to-one"===d.type?T=o.item?o.item[d.name]?.id:null:"many-to-many"===d.type&&(T=o.item?o.item[d.name].map(j=>j.id):[]),o.form.addControl((0,I.yk)(d),new E.MJ(T))})});return function(h){return f.apply(this,arguments)}}())})()}onChange(o){this.form.controls[o.propName].setValue(o.newValue)}onRelationChange(o){return this.onChange({newValue:o.newValue,propName:(0,I.yk)(o.relationship)})}submit(){this.loading=!0,this.edit?(this.singleMode?this.crudService.updateSingle(this.entityManifest.slug,this.form.value):this.crudService.update(this.entityManifest.slug,this.item.id,this.form.value)).then(()=>{this.loading=!1,this.flashMessageService.success(`The ${this.entityManifest.nameSingular} has been updated`),this.router.navigate([this.singleMode?"/singles":"/collections",this.entityManifest.slug])}).catch(f=>{400===f.status&&(this.errors=this.getErrorMessages(f.error)),this.loading=!1,this.flashMessageService.error(`The ${this.entityManifest.nameSingular} could not be updated`)}):this.crudService.create(this.entityManifest.slug,this.form.value).then(o=>{this.loading=!1,this.flashMessageService.success(`The ${this.entityManifest.nameSingular} has been created successfully`),this.router.navigate(["/collections",this.entityManifest.slug,o.id])}).catch(o=>{400===o.status&&(this.errors=this.getErrorMessages(o.error)),this.loading=!1,this.flashMessageService.error(`Error: the ${this.entityManifest.nameSingular} could not be created:\n ${Object.values(this.errors).join(", ")}\n `)})}getErrorMessages(o){const f={};return o.forEach(h=>{f[h.property]=Object.values(h.constraints)}),f}static{this.\u0275fac=function(f){return new(f||c)(i.rXU(R.m),i.rXU(G.x),i.rXU(g.nX),i.rXU(g.Ix),i.rXU(E.ok),i.rXU(P.R),i.rXU(y.L))}}static{this.\u0275cmp=i.VBU({type:c,selectors:[["app-create-edit"]],decls:1,vars:1,consts:[[4,"ngIf"],[1,"is-flex","is-justify-content-space-between","is-align-items-center","mb-5"],[1,"left-part"],[1,"title","is-2","has-text-weight-light"],[1,"right-part"],["type","submit",1,"button","is-link","is-hidden-touch",3,"click","ngClass"],["type","submit",1,"button","is-link","is-hidden-desktop","is-circle",3,"click","ngClass"],[1,"icon","icon-save"],[3,"formGroup",4,"ngIf"],[3,"formGroup"],[1,"card","is-shadowless","p-4"],[1,"columns"],[1,"column","is-12-touch","is-8-desktop","is-offset-2-desktop","is-6-widescreen","is-offset-3-widescreen","is-6-fullhd","is-offset-3-fullhd"],[1,"form-group"],["class","field mt-2 mb-4",4,"ngFor","ngForOf"],[1,"field","mt-2","mb-4"],[1,"control"],[3,"valueChanged","prop","entityManifest","value","errors"],["class","control",4,"ngIf"],[3,"valueChanged","relationship","value","errors"]],template:function(f,h){1&f&&i.DNE(0,C,13,9,"ng-container",0),2&f&&i.Y8G("ngIf",h.entityManifest)},dependencies:[M.YU,M.Sq,M.bT,E.qT,E.cb,E.j4,Y.S]})}}return c})()},992:(X,D,p)=>{p.d(D,{R:()=>L});var m=p(7431),E=p(9e3),n=p(8284),e=p(6119),I=p(2283),i=p(183),R=p(9879),G=p(2943),g=p(6631),P=p(8785);const y=u=>["/collections",u];function M(u,C){if(1&u&&(n.j41(0,"a",17),n.nrm(1,"i",18),n.k0s()),2&u){const r=n.XpG(2);n.Y8G("routerLink",n.eq3(1,y,r.entityManifest.namePlural))}}function Y(u,C){if(1&u&&(n.j41(0,"div",19)(1,"p",20),n.EFF(2),n.k0s(),n.j41(3,"p",21),n.nrm(4,"app-yield",22),n.k0s()()),2&u){const r=C.$implicit,c=n.XpG(2);n.R7$(2),n.SpI(" ",r.name," "),n.R7$(2),n.Y8G("value",c.item[r.name])("prop",r)}}function x(u,C){if(1&u&&n.nrm(0,"app-relation-yield",25),2&u){const r=n.XpG(2).$implicit,c=n.XpG(2);n.Y8G("item",c.item[r.name])("relationship",r)}}function b(u,C){1&u&&(n.qex(0),n.EFF(1,", "),n.bVm())}function k(u,C){if(1&u&&(n.qex(0),n.nrm(1,"app-relation-yield",25),n.DNE(2,b,2,0,"ng-container",0),n.bVm()),2&u){const r=C.$implicit,c=C.last,v=n.XpG(3).$implicit;n.R7$(),n.Y8G("item",r)("relationship",v),n.R7$(),n.Y8G("ngIf",!c)}}function O(u,C){if(1&u&&(n.qex(0),n.DNE(1,k,3,3,"ng-container",26),n.bVm()),2&u){const r=n.XpG(2).$implicit,c=n.XpG(2);n.R7$(),n.Y8G("ngForOf",c.getManyToManyRelations(c.item,r))}}function $(u,C){if(1&u&&(n.qex(0),n.j41(1,"p",20),n.EFF(2),n.k0s(),n.j41(3,"p",21),n.DNE(4,x,1,2,"app-relation-yield",24)(5,O,2,1,"ng-container",0),n.k0s(),n.bVm()),2&u){const r=n.XpG().$implicit;n.R7$(2),n.SpI(" ",r.name," "),n.R7$(2),n.Y8G("ngIf","many-to-one"===r.type),n.R7$(),n.Y8G("ngIf","many-to-many"===r.type)}}function B(u,C){if(1&u&&(n.j41(0,"div",23),n.DNE(1,$,6,3,"ng-container",0),n.k0s()),2&u){const r=C.$implicit;n.R7$(),n.Y8G("ngIf","many-to-one"===r.type||"many-to-many"===r.type&&r.owningSide)}}function U(u,C){if(1&u&&(n.j41(0,"section")(1,"div",1)(2,"div",2),n.DNE(3,M,2,3,"a",3),n.j41(4,"h1",4),n.EFF(5),n.k0s()(),n.j41(6,"div",5)(7,"a",6),n.nrm(8,"i",7),n.k0s(),n.j41(9,"a",8),n.EFF(10,"Edit "),n.k0s(),n.j41(11,"a",9),n.nrm(12,"i",10),n.k0s()()(),n.j41(13,"div",11)(14,"div",12)(15,"div",13)(16,"div",14),n.DNE(17,Y,5,3,"div",15)(18,B,2,1,"div",16),n.k0s()()()()()),2&u){const r=n.XpG();n.R7$(3),n.Y8G("ngIf",!r.entityManifest.single),n.R7$(2),n.SpI(" ",r.singleMode?r.entityManifest.nameSingular:r.item[r.entityManifest.mainProp]," "),n.R7$(12),n.Y8G("ngForOf",r.entityManifest.properties),n.R7$(),n.Y8G("ngForOf",r.entityManifest.relationships)}}let L=(()=>{class u{constructor(r,c,v,o,f){this.crudService=r,this.manifestService=c,this.activatedRoute=v,this.metaService=o,this.router=f}ngOnInit(){var r=this;this.activatedRoute.params.subscribe(function(){var c=(0,m.A)(function*(v){r.entityManifest=yield r.manifestService.getEntityManifest({slug:v.entitySlug}),r.entityManifest||r.router.navigate(["/404"]),r.singleMode="single"===r.activatedRoute.snapshot.data.mode;try{r.item=r.singleMode?yield r.crudService.showSingle(r.entityManifest.slug):yield r.crudService.show(r.entityManifest.slug,v.id,{relations:r.entityManifest.relationships?.filter(o=>"one-to-many"!==o.type).filter(o=>"many-to-many"!==o.type||o.owningSide).map(o=>o.name)})}catch{r.router.navigate(["/404"])}r.metaService.setTitle((new E.X).transform(r.entityManifest.nameSingular))});return function(v){return c.apply(this,arguments)}}())}getManyToManyRelations(r,c){return r[c.name]}static{this.\u0275fac=function(c){return new(c||u)(n.rXU(e.m),n.rXU(I.x),n.rXU(i.nX),n.rXU(R.R),n.rXU(i.Ix))}}static{this.\u0275cmp=n.VBU({type:u,selectors:[["app-detail"]],decls:1,vars:1,consts:[[4,"ngIf"],[1,"is-flex","is-justify-content-space-between","is-align-items-center","mb-5"],[1,"left-part","is-flex","is-flex-wrap-wrap","is-align-items-center"],["class","button is-circle mr-2 button--back",3,"routerLink",4,"ngIf"],[1,"title","is-2","has-text-weight-light"],[1,"right-part","is-flex","is-flex-direction-row"],[1,"button","is-link","is-light","is-hidden-desktop","is-circle"],[1,"icon","icon-trash-2"],["routerLink","edit",1,"button","is-link","ml-2","is-hidden-touch"],["routerLink","edit",1,"button","is-link","ml-2","is-hidden-desktop","is-circle"],[1,"icon","icon-edit"],[1,"card","p-0","mb-6","is-shadowless"],[1,"card-content"],[1,"columns"],[1,"column","is-12-touch","is-8-desktop","is-offset-2-desktop","is-6-widescreen","is-offset-3-widescreen","is-6-fullhd","is-offset-3-fullhd"],["class","properties",4,"ngFor","ngForOf"],["class","relations",4,"ngFor","ngForOf"],[1,"button","is-circle","mr-2","button--back",3,"routerLink"],[1,"icon","icon-arrow-right"],[1,"properties"],[1,"is-property-label","mb-1","is-size-5","has-text-dark","has-text-weight-medium"],[1,"is-property-value"],[3,"value","prop"],[1,"relations"],[3,"item","relationship",4,"ngIf"],[3,"item","relationship"],[4,"ngFor","ngForOf"]],template:function(c,v){1&c&&n.DNE(0,U,19,4,"section",0),2&c&&n.Y8G("ngIf",v.item&&v.entityManifest)},dependencies:[G.Sq,G.bT,i.Wk,g.L,P.x],styles:['@import"https://fonts.googleapis.com/css?family=Rubik:300,400,400i,500";.properties[_ngcontent-%COMP%] + div[_ngcontent-%COMP%], .relations[_ngcontent-%COMP%] + div[_ngcontent-%COMP%]{margin-top:16px}@media screen and (min-width: 1000px){.card.is-single-card[_ngcontent-%COMP%]{padding-right:25%!important;padding-left:25%!important}}@media screen and (min-width: 1458px){.card.is-single-card[_ngcontent-%COMP%]{padding-right:33%!important;padding-left:33%!important}}']})}}return u})()},8785:(X,D,p)=>{p.d(D,{x:()=>G});var m=p(2943),E=p(183),n=p(8284),e=p(2283);const I=(g,P)=>["/","collections",g,P];function i(g,P){if(1&g&&(n.j41(0,"a",2)(1,"span"),n.EFF(2),n.k0s()()),2&g){const y=n.XpG();n.Y8G("routerLink",n.l_i(2,I,y.entityManifest.slug,y.item.id)),n.R7$(2),n.JRh(y.item[y.entityManifest.mainProp])}}function R(g,P){1&g&&(n.j41(0,"span"),n.EFF(1,"-"),n.k0s())}let G=(()=>{class g{constructor(y){this.manifestService=y}ngOnInit(){this.manifestService.getEntityManifest({className:this.relationship.entity}).then(y=>{this.entityManifest=y})}static{this.\u0275fac=function(M){return new(M||g)(n.rXU(e.x))}}static{this.\u0275cmp=n.VBU({type:g,selectors:[["app-relation-yield"]],inputs:{item:"item",relationship:"relationship"},standalone:!0,features:[n.aNF],decls:2,vars:2,consts:[[3,"routerLink",4,"ngIf"],[4,"ngIf"],[3,"routerLink"]],template:function(M,Y){1&M&&n.DNE(0,i,3,5,"a",0)(1,R,2,0,"span",1),2&M&&(n.Y8G("ngIf",Y.item&&Y.entityManifest),n.R7$(),n.Y8G("ngIf",!Y.item||!Y.entityManifest))},dependencies:[E.iI,E.Wk,m.MD,m.bT]})}}return g})()},6631:(X,D,p)=>{p.d(D,{L:()=>ue});var m=p(2943),E=p(5442),n=function(t){return t[t.Text=0]="Text",t[t.Number=1]="Number",t[t.Link=2]="Link",t[t.Currency=3]="Currency",t[t.Date=4]="Date",t[t.Boolean=5]="Boolean",t[t.Email=6]="Email",t[t.ProgressBar=7]="ProgressBar",t[t.Label=8]="Label",t[t.Location=9]="Location",t}(n||{}),e=p(8284);function I(t,_){1&t&&(e.j41(0,"span"),e.nrm(1,"i",1),e.k0s())}function i(t,_){1&t&&(e.j41(0,"span"),e.EFF(1," - "),e.k0s())}let R=(()=>{class t{static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["app-boolean-yield"]],inputs:{value:"value"},standalone:!0,features:[e.aNF],decls:3,vars:2,consts:[[4,"ngIf"],[1,"icon","icon-check-circle","has-text-success"]],template:function(l,s){1&l&&(e.j41(0,"div"),e.DNE(1,I,2,0,"span",0)(2,i,2,0,"span",0),e.k0s()),2&l&&(e.R7$(),e.Y8G("ngIf",s.value),e.R7$(),e.Y8G("ngIf",!s.value))},dependencies:[m.MD,m.bT]})}}return t})();function G(t,_){if(1&t&&(e.j41(0,"span",1),e.EFF(1),e.nI1(2,"currency"),e.k0s()),2&t){const a=e.XpG();e.R7$(),e.SpI(" ",e.i5U(2,1,a.value,a.currency),"")}}function g(t,_){1&t&&(e.j41(0,"span",1),e.EFF(1," - "),e.k0s())}let P=(()=>{class t{static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["app-currency-yield"]],inputs:{value:"value",currency:"currency"},standalone:!0,features:[e.aNF],decls:2,vars:2,consts:[["class","is-nowrap",4,"ngIf"],[1,"is-nowrap"]],template:function(l,s){1&l&&e.DNE(0,G,3,4,"span",0)(1,g,2,0,"span",0),2&l&&(e.Y8G("ngIf",s.value),e.R7$(),e.Y8G("ngIf",!s.value))},dependencies:[m.bT,m.oe]})}}return t})();function y(t,_){1&t&&(e.j41(0,"span",0),e.EFF(1," - "),e.k0s())}let M=(()=>{class t{static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["app-date-yield"]],inputs:{value:"value"},standalone:!0,features:[e.aNF],decls:4,vars:5,consts:[[1,"is-nowrap"],["class","is-nowrap",4,"ngIf"]],template:function(l,s){1&l&&(e.j41(0,"span",0),e.EFF(1),e.nI1(2,"date"),e.k0s(),e.DNE(3,y,2,0,"span",1)),2&l&&(e.R7$(),e.JRh(e.i5U(2,2,s.value,"MM/dd/yy")),e.R7$(2),e.Y8G("ngIf",!s.value))},dependencies:[m.vh,m.bT]})}}return t})(),Y=(()=>{class t{static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["app-email-yield"]],inputs:{value:"value"},standalone:!0,features:[e.aNF],decls:3,vars:1,consts:[[1,"yield"],[1,"yield__value"]],template:function(l,s){1&l&&(e.j41(0,"div",0)(1,"div",1),e.EFF(2),e.k0s()()),2&l&&(e.R7$(2),e.JRh(s.value))}})}}return t})();function x(t,_){if(1&t&&(e.j41(0,"span"),e.EFF(1),e.k0s()),2&t){const a=e.XpG();e.ZvI("tag is-rounded is-color-",a.index,""),e.R7$(),e.JRh(a.value)}}function b(t,_){1&t&&(e.j41(0,"span"),e.EFF(1,"-"),e.k0s())}let k=(()=>{class t{ngOnInit(){this.index=this.values.indexOf(this.value)}static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["app-label-yield"]],inputs:{value:"value",values:"values"},standalone:!0,features:[e.aNF],decls:2,vars:2,consts:[[3,"class",4,"ngIf"],[4,"ngIf"]],template:function(l,s){1&l&&e.DNE(0,x,2,4,"span",0)(1,b,2,0,"span",1),2&l&&(e.Y8G("ngIf",s.value),e.R7$(),e.Y8G("ngIf",!s.value))},dependencies:[m.MD,m.bT],styles:[".is-color-3[_ngcontent-%COMP%]{background-color:#f50057;color:#fff}.is-color-1[_ngcontent-%COMP%]{background-color:#ff6d00;color:#fff}.is-color-2[_ngcontent-%COMP%]{background-color:#ffd600;color:#000}.is-color-4[_ngcontent-%COMP%]{background-color:#d500f9;color:#fff}.is-color-5[_ngcontent-%COMP%]{background-color:#651fff;color:#fff}.is-color-6[_ngcontent-%COMP%]{background-color:#3d5afe;color:#fff}.is-color-7[_ngcontent-%COMP%]{background-color:#00b0ff;color:#fff}.is-color-8[_ngcontent-%COMP%]{background-color:#00c853;color:#fff}.is-color-9[_ngcontent-%COMP%]{background-color:#64dd17;color:#000}.is-color-10[_ngcontent-%COMP%]{background-color:#a1887f;color:#fff}.is-color-11[_ngcontent-%COMP%]{background-color:#607d8b;color:#fff}.is-color-12[_ngcontent-%COMP%]{background-color:#9e9e9e;color:#fff}"]})}}return t})(),O=(()=>{class t{transform(a,l){return a?.length>l?a.substring(0,l)+"...":a}static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275pipe=e.EJ8({name:"truncate",type:t,pure:!0,standalone:!0})}}return t})();const $=(t,_)=>({"icon-external-link":t,"icon-download":_});function B(t,_){if(1&t&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"truncate"),e.k0s()),2&t){const a=e.XpG(2);e.R7$(),e.JRh(e.i5U(2,1,a.value,44))}}function U(t,_){if(1&t&&(e.j41(0,"span"),e.EFF(1),e.k0s()),2&t){const a=e.XpG(2);e.R7$(),e.JRh(a.value)}}function L(t,_){if(1&t&&(e.j41(0,"a",2),e.nrm(1,"i",3),e.DNE(2,B,3,4,"span",4)(3,U,2,1,"span",4),e.k0s()),2&t){const a=e.XpG();e.Y8G("href",a.value,e.B4B)("download",a.isDownload),e.R7$(),e.Y8G("ngClass",e.l_i(5,$,!a.isDownload,a.isDownload)),e.R7$(),e.Y8G("ngIf",a.compact),e.R7$(),e.Y8G("ngIf",!a.compact)}}function u(t,_){1&t&&(e.j41(0,"span",5),e.EFF(1," - "),e.k0s())}let C=(()=>{class t{constructor(){this.compact=!0,this.isDownload=!1}static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["app-link-yield"]],inputs:{value:"value",compact:"compact",isDownload:"isDownload"},standalone:!0,features:[e.aNF],decls:2,vars:2,consts:[["target","_blank","class","is-inline-flex is-align-items-center",3,"href","download",4,"ngIf"],["class","is-nowrap",4,"ngIf"],["target","_blank",1,"is-inline-flex","is-align-items-center",3,"href","download"],[1,"icon","icon-external-link","mr-1",3,"ngClass"],[4,"ngIf"],[1,"is-nowrap"]],template:function(l,s){1&l&&e.DNE(0,L,4,8,"a",0)(1,u,2,0,"span",1),2&l&&(e.Y8G("ngIf",s.value),e.R7$(),e.Y8G("ngIf",!s.value))},dependencies:[m.bT,m.YU,O]})}}return t})();function r(t,_){if(1&t&&(e.j41(0,"a",2),e.nrm(1,"i",3),e.j41(2,"span"),e.EFF(3,"View on map"),e.k0s()()),2&t){const a=e.XpG();e.FCK("href","https://www.openstreetmap.org/?mlat=",a.value.lat,"&mlon=",a.value.lng,"",e.B4B)}}function c(t,_){1&t&&(e.j41(0,"span"),e.EFF(1,"-"),e.k0s())}let v=(()=>{class t{static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["app-location-yield"]],inputs:{value:"value"},standalone:!0,features:[e.aNF],decls:2,vars:2,consts:[["target","_blank",3,"href",4,"ngIf"],[4,"ngIf"],["target","_blank",3,"href"],[1,"icon","icon-map-pin","mr-1"]],template:function(l,s){1&l&&e.DNE(0,r,4,3,"a",0)(1,c,2,0,"span",1),2&l&&(e.Y8G("ngIf",(null==s.value?null:s.value.lat)&&(null==s.value?null:s.value.lng)),e.R7$(),e.Y8G("ngIf",!(null!=s.value&&s.value.lat&&null!=s.value&&s.value.lng)))},dependencies:[m.bT]})}}return t})();function o(t,_){if(1&t&&(e.j41(0,"span",1),e.EFF(1),e.k0s()),2&t){const a=e.XpG();e.R7$(),e.SpI(" ",a.value," ")}}function f(t,_){1&t&&(e.j41(0,"span",1),e.EFF(1," - "),e.k0s())}let h=(()=>{class t{static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["app-number-yield"]],inputs:{value:"value"},standalone:!0,features:[e.aNF],decls:2,vars:2,consts:[["class","is-nowrap",4,"ngIf"],[1,"is-nowrap"]],template:function(l,s){1&l&&e.DNE(0,o,2,1,"span",0)(1,f,2,0,"span",0),2&l&&(e.Y8G("ngIf",null!==s.value),e.R7$(),e.Y8G("ngIf",null===s.value))},dependencies:[m.bT]})}}return t})();function F(t,_){1&t&&e.nrm(0,"span",4)}function d(t,_){1&t&&e.nrm(0,"span",5)}function T(t,_){if(1&t&&(e.qex(0),e.DNE(1,F,1,0,"span",2)(2,d,1,0,"span",3),e.bVm()),2&t){const a=_.index,l=e.XpG();e.R7$(),e.Y8G("ngIf",l.index>=a),e.R7$(),e.Y8G("ngIf",l.index<a)}}let j=(()=>{class t{constructor(){this.enumAsArray=[]}ngOnInit(){this.index=this.values.indexOf(this.value)}static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["app-progress-bar-yield"]],inputs:{value:"value",values:"values"},standalone:!0,features:[e.aNF],decls:2,vars:5,consts:[[1,"is-flex","is-align-items-center","is-white-space-nowrap","tooltip","has-tooltip-left"],[4,"ngFor","ngForOf"],["class","bullet",4,"ngIf"],["class","bullet is-grey",4,"ngIf"],[1,"bullet"],[1,"bullet","is-grey"]],template:function(l,s){1&l&&(e.j41(0,"div",0),e.DNE(1,T,3,2,"ng-container",1),e.k0s()),2&l&&(e.ZvI("is-color-",s.index,""),e.BMQ("data-tooltip",s.value||"Unknown"),e.R7$(),e.Y8G("ngForOf",s.values))},dependencies:[m.MD,m.Sq,m.bT]})}}return t})();function S(t,_){if(1&t&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"truncate"),e.k0s()),2&t){const a=e.XpG();e.R7$(),e.JRh(e.i5U(2,1,a.value,44))}}function w(t,_){if(1&t&&(e.j41(0,"span"),e.EFF(1),e.k0s()),2&t){const a=e.XpG();e.R7$(),e.JRh(a.value)}}function N(t,_){1&t&&(e.j41(0,"span"),e.EFF(1," - "),e.k0s())}let A=(()=>{class t{constructor(){this.compact=!0}static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["app-text-yield"]],inputs:{value:"value",compact:"compact"},standalone:!0,features:[e.aNF],decls:3,vars:3,consts:[[4,"ngIf"]],template:function(l,s){1&l&&e.DNE(0,S,3,4,"span",0)(1,w,2,1,"span",0)(2,N,2,0,"span",0),2&l&&(e.Y8G("ngIf",s.compact),e.R7$(),e.Y8G("ngIf",!s.compact),e.R7$(),e.Y8G("ngIf",!s.value))},dependencies:[m.MD,m.bT,O]})}}return t})(),V=(()=>{class t{static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["app-timestamp-yield"]],inputs:{value:"value"},standalone:!0,features:[e.aNF],decls:3,vars:4,consts:[[1,"is-nowrap"]],template:function(l,s){1&l&&(e.j41(0,"span",0),e.EFF(1),e.nI1(2,"date"),e.k0s()),2&l&&(e.R7$(),e.JRh(e.i5U(2,1,s.value,"yyyy-MM-dd HH:mm:ss")))},dependencies:[m.vh],encapsulation:2})}}return t})();var K=p(7563);function W(t,_){if(1&t&&e.nrm(0,"img",2),2&t){const a=e.XpG();e.Y8G("src",a.image,e.B4B)}}function J(t,_){1&t&&(e.j41(0,"span"),e.EFF(1,"-"),e.k0s())}let z=(()=>{class t{ngOnInit(){if(this.value){const a=(0,K.Gj)(this.sizes);this.image=this.value[a]}}static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["app-image-yield"]],inputs:{value:"value",sizes:"sizes",label:"label"},standalone:!0,features:[e.aNF],decls:2,vars:2,consts:[["alt","image","width","36","height","36",3,"src",4,"ngIf"],[4,"ngIf"],["alt","image","width","36","height","36",3,"src"]],template:function(l,s){1&l&&e.DNE(0,W,1,1,"img",0)(1,J,2,0,"span",1),2&l&&(e.Y8G("ngIf",s.image),e.R7$(),e.Y8G("ngIf",!s.image))},dependencies:[m.bT],encapsulation:2})}}return t})();function H(t,_){if(1&t&&(e.j41(0,"div",2)(1,"div",3),e.nrm(2,"div",4),e.k0s()()),2&t){const a=e.XpG();e.R7$(2),e.Y8G("innerHTML",a.value,e.npT)}}function Z(t,_){1&t&&(e.j41(0,"span"),e.EFF(1,"-"),e.k0s())}let Q=(()=>{class t{static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["app-rich-text-yield"]],inputs:{value:"value"},standalone:!0,features:[e.aNF],decls:2,vars:2,consts:[["class","wrapper",4,"ngIf"],[4,"ngIf"],[1,"wrapper"],[1,"content","is-normal"],[3,"innerHTML"]],template:function(l,s){1&l&&e.DNE(0,H,3,1,"div",0)(1,Z,2,0,"span",1),2&l&&(e.Y8G("ngIf",s.value),e.R7$(),e.Y8G("ngIf",!s.value))},dependencies:[m.bT],styles:['@import"https://fonts.googleapis.com/css?family=Rubik:300,400,400i,500";.wrapper[_ngcontent-%COMP%]{border:1px solid #dddde2;background-color:#fff;padding:32px;border-radius:6px}.content[_ngcontent-%COMP%] blockquote[_ngcontent-%COMP%]{border-left:4px solid #39393c;background-color:#fff}']})}}return t})();function q(t,_){if(1&t&&e.nrm(0,"app-text-yield",6),2&t){const a=e.XpG();e.Y8G("value",a.value)("compact",a.compact)}}function ee(t,_){if(1&t&&e.nrm(0,"app-rich-text-yield",7),2&t){const a=e.XpG();e.Y8G("value",a.value)}}function te(t,_){if(1&t&&e.nrm(0,"app-number-yield",7),2&t){const a=e.XpG();e.Y8G("value",a.value)}}function ne(t,_){if(1&t&&e.nrm(0,"app-link-yield",8),2&t){const a=e.XpG();e.Y8G("value",a.value)("isDownload",a.prop.type===a.PropType.File)("compact",a.compact)}}function ie(t,_){if(1&t&&e.nrm(0,"app-boolean-yield",7),2&t){const a=e.XpG();e.Y8G("value",a.value)}}function ae(t,_){if(1&t&&e.nrm(0,"app-currency-yield",9),2&t){const a=e.XpG();e.Y8G("currency",null==a.prop.options?null:a.prop.options.currency)("value",a.value)}}function oe(t,_){if(1&t&&e.nrm(0,"app-date-yield",7),2&t){const a=e.XpG();e.Y8G("value",a.value)}}function se(t,_){if(1&t&&e.nrm(0,"app-timestamp-yield",7),2&t){const a=e.XpG();e.Y8G("value",a.value)}}function le(t,_){if(1&t&&e.nrm(0,"app-email-yield",7),2&t){const a=e.XpG();e.Y8G("value",a.value)}}function re(t,_){if(1&t&&e.nrm(0,"app-label-yield",10),2&t){const a=e.XpG();e.Y8G("values",null==a.prop.options?null:a.prop.options.values)("value",a.value)}}function ce(t,_){if(1&t&&e.nrm(0,"app-progress-bar-yield",10),2&t){const a=e.XpG();e.Y8G("values",null==a.prop.options?null:a.prop.options.values)("value",a.value)}}function pe(t,_){if(1&t&&e.nrm(0,"app-location-yield",7),2&t){const a=e.XpG();e.Y8G("value",a.value)}}function _e(t,_){if(1&t&&e.nrm(0,"app-image-yield",11),2&t){const a=e.XpG();e.Y8G("value",a.value)("sizes",null==a.prop.options?null:a.prop.options.sizes)}}let ue=(()=>{class t{constructor(){this.compact=!1,this.PropType=E.Kk,this.YieldType=n}static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["app-yield"]],inputs:{prop:"prop",value:"value",compact:"compact"},standalone:!0,features:[e.aNF],decls:13,vars:13,consts:[[3,"value","compact",4,"ngIf"],[3,"value",4,"ngIf"],[3,"value","isDownload","compact",4,"ngIf"],[3,"currency","value",4,"ngIf"],[3,"values","value",4,"ngIf"],[3,"value","sizes",4,"ngIf"],[3,"value","compact"],[3,"value"],[3,"value","isDownload","compact"],[3,"currency","value"],[3,"values","value"],[3,"value","sizes"]],template:function(l,s){1&l&&e.DNE(0,q,1,2,"app-text-yield",0)(1,ee,1,1,"app-rich-text-yield",1)(2,te,1,1,"app-number-yield",1)(3,ne,1,3,"app-link-yield",2)(4,ie,1,1,"app-boolean-yield",1)(5,ae,1,2,"app-currency-yield",3)(6,oe,1,1,"app-date-yield",1)(7,se,1,1,"app-timestamp-yield",1)(8,le,1,1,"app-email-yield",1)(9,re,1,2,"app-label-yield",4)(10,ce,1,2,"app-progress-bar-yield",4)(11,pe,1,1,"app-location-yield",1)(12,_e,1,2,"app-image-yield",5),2&l&&(e.Y8G("ngIf",s.prop.type===s.PropType.String||s.prop.type===s.PropType.Text),e.R7$(),e.Y8G("ngIf",s.prop.type===s.PropType.RichText),e.R7$(),e.Y8G("ngIf",s.prop.type===s.PropType.Number),e.R7$(),e.Y8G("ngIf",s.prop.type===s.PropType.Link||s.prop.type===s.PropType.File),e.R7$(),e.Y8G("ngIf",s.prop.type===s.PropType.Boolean),e.R7$(),e.Y8G("ngIf",s.prop.type===s.PropType.Money),e.R7$(),e.Y8G("ngIf",s.prop.type===s.PropType.Date),e.R7$(),e.Y8G("ngIf",s.prop.type===s.PropType.Timestamp),e.R7$(),e.Y8G("ngIf",s.prop.type===s.PropType.Email),e.R7$(),e.Y8G("ngIf",s.prop.type===s.PropType.Choice&&!0!==(null==s.prop.options?null:s.prop.options.sequential)),e.R7$(),e.Y8G("ngIf",s.prop.type===s.PropType.Choice&&!0===(null==s.prop.options?null:s.prop.options.sequential)),e.R7$(),e.Y8G("ngIf",s.prop.type===s.PropType.Location),e.R7$(),e.Y8G("ngIf",s.prop.type===s.PropType.Image))},dependencies:[m.MD,m.bT,R,P,M,V,Y,h,C,A,k,j,v,z,Q],encapsulation:2})}}return t})()}}]);
|
package/dist/admin/index.html
CHANGED
|
@@ -9,5 +9,5 @@
|
|
|
9
9
|
<style>@import"https://fonts.googleapis.com/css?family=Rubik:300,400,400i,500";@charset "UTF-8";html,body{margin:0;padding:0}html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit}html{background-color:#fff;font-size:10px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;min-width:300px;overflow-x:hidden;overflow-y:scroll;text-rendering:optimizeLegibility;-webkit-text-size-adjust:100%;text-size-adjust:100%}body{font-family:Rubik,sans-serif}body{color:#535356;font-size:1em;font-weight:400;line-height:1.5}*:focus{outline:none}html{overflow-x:hidden;overflow-y:scroll;text-rendering:optimizeLegibility;-webkit-text-size-adjust:100%;text-size-adjust:100%;scroll-behavior:smooth}@media screen and (max-width: 999px){html{font-size:10.22px}}body{text-rendering:optimizeLegibility;overflow:hidden;background:#f5f7f9;color:#303032;font-size:1.2rem}*[href]{cursor:pointer}</style><link rel="stylesheet" href="styles.8ccfc17311992374.css" media="print" onload="this.media='all'"><noscript><link rel="stylesheet" href="styles.8ccfc17311992374.css"></noscript></head>
|
|
10
10
|
<body>
|
|
11
11
|
<app-root></app-root>
|
|
12
|
-
<script src="runtime.
|
|
12
|
+
<script src="runtime.b0ecb6141ff09499.js" type="module"></script><script src="polyfills.2aefc0784c3d32a6.js" type="module"></script><script src="main.5610a8a9ad1b3356.js" type="module"></script></body>
|
|
13
13
|
</html>
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @license Angular v17.3.12
|
|
4
4
|
* (c) 2010-2024 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
|
-
*/function $e(R){R||((0,o.Af3)($e),R=(0,o.WQX)(o.abz));const te=new $.c(C=>R.onDestroy(C.next.bind(C)));return C=>C.pipe((0,Ee.Q)(te))}var Mn=I(6852),yr=I(7624),Mi=I(7233),Vi=I(7412),Tn=I(3575),at=I(5271),Ar=I(2097),Cr=I(7236);const kr=["addListener","removeListener"],Lr=["addEventListener","removeEventListener"],br=["on","off"];function Mt(R,te,C,S){if((0,Ar.T)(C)&&(S=C,C=void 0),S)return Mt(R,te,C).pipe((0,Cr.I)(S));const[O,z]=function ur(R){return(0,Ar.T)(R.addEventListener)&&(0,Ar.T)(R.removeEventListener)}(R)?Lr.map(Se=>rt=>R[Se](te,rt,C)):function Vr(R){return(0,Ar.T)(R.addListener)&&(0,Ar.T)(R.removeListener)}(R)?kr.map(Yr(R,te)):function _r(R){return(0,Ar.T)(R.on)&&(0,Ar.T)(R.off)}(R)?br.map(Yr(R,te)):[];if(!O&&(0,at.X)(R))return(0,Tn.Z)(Se=>Mt(Se,te,C))((0,Vi.Tg)(R));if(!O)throw new TypeError("Invalid event target");return new $.c(Se=>{const rt=(...Ot)=>Se.next(1<Ot.length?Ot:Ot[0]);return O(rt),()=>z(rt)})}function Yr(R,te){return C=>S=>R[C](te,S)}var cr=I(1087);const jr={now:()=>(jr.delegate||Date).now(),delegate:void 0};class Ur extends cr.B{constructor(te=1/0,C=1/0,S=jr){super(),this._bufferSize=te,this._windowTime=C,this._timestampProvider=S,this._buffer=[],this._infiniteTimeWindow=!0,this._infiniteTimeWindow=C===1/0,this._bufferSize=Math.max(1,te),this._windowTime=Math.max(1,C)}next(te){const{isStopped:C,_buffer:S,_infiniteTimeWindow:O,_timestampProvider:z,_windowTime:Se}=this;C||(S.push(te),!O&&S.push(z.now()+Se)),this._trimBuffer(),super.next(te)}_subscribe(te){this._throwIfClosed(),this._trimBuffer();const C=this._innerSubscribe(te),{_infiniteTimeWindow:S,_buffer:O}=this,z=O.slice();for(let Se=0;Se<z.length&&!te.closed;Se+=S?1:2)te.next(z[Se]);return this._checkFinalizedStatuses(te),C}_trimBuffer(){const{_bufferSize:te,_timestampProvider:C,_buffer:S,_infiniteTimeWindow:O}=this,z=(O?1:2)*te;if(te<1/0&&z<S.length&&S.splice(0,S.length-z),!O){const Se=C.now();let rt=0;for(let Ot=1;Ot<S.length&&S[Ot]<=Se;Ot+=2)rt=Ot;rt&&S.splice(0,rt+1)}}}var P=I(3173),V=I(1524);function me(R,te,...C){if(!0===te)return void R();if(!1===te)return;const S=new P.Ms({next:()=>{S.unsubscribe(),R()}});return(0,Vi.Tg)(te(...C)).subscribe(S)}class Fe extends Mi.yU{constructor(te,C){super()}schedule(te,C=0){return this}}const Le={setInterval(R,te,...C){const{delegate:S}=Le;return S?.setInterval?S.setInterval(R,te,...C):setInterval(R,te,...C)},clearInterval(R){const{delegate:te}=Le;return(te?.clearInterval||clearInterval)(R)},delegate:void 0};var yt=I(2070);class zt{constructor(te,C=zt.now){this.schedulerActionCtor=te,this.now=C}schedule(te,C=0,S){return new this.schedulerActionCtor(this,te).schedule(S,C)}}zt.now=jr.now;const Wt=new class En extends zt{constructor(te,C=zt.now){super(te,C),this.actions=[],this._active=!1}flush(te){const{actions:C}=this;if(this._active)return void C.push(te);let S;this._active=!0;do{if(S=te.execute(te.state,te.delay))break}while(te=C.shift());if(this._active=!1,S){for(;te=C.shift();)te.unsubscribe();throw S}}}(class ot extends Fe{constructor(te,C){super(te,C),this.scheduler=te,this.work=C,this.pending=!1}schedule(te,C=0){var S;if(this.closed)return this;this.state=te;const O=this.id,z=this.scheduler;return null!=O&&(this.id=this.recycleAsyncId(z,O,C)),this.pending=!0,this.delay=C,this.id=null!==(S=this.id)&&void 0!==S?S:this.requestAsyncId(z,this.id,C),this}requestAsyncId(te,C,S=0){return Le.setInterval(te.flush.bind(te,this),S)}recycleAsyncId(te,C,S=0){if(null!=S&&this.delay===S&&!1===this.pending)return C;null!=C&&Le.clearInterval(C)}execute(te,C){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;const S=this._execute(te,C);if(S)return S;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(te,C){let O,S=!1;try{this.work(te)}catch(z){S=!0,O=z||new Error("Scheduled action threw falsy error")}if(S)return this.unsubscribe(),O}unsubscribe(){if(!this.closed){const{id:te,scheduler:C}=this,{actions:S}=C;this.work=this.state=this.scheduler=null,this.pending=!1,(0,yt.o)(S,this),null!=te&&(this.id=this.recycleAsyncId(C,te,null)),this.delay=null,super.unsubscribe()}}});var Vn=I(5510);function ct(R,te=Wt){return(0,V.N)((C,S)=>{let O=null,z=null,Se=null;const rt=()=>{if(O){O.unsubscribe(),O=null;const an=z;z=null,S.next(an)}};function Ot(){const an=Se+R,Wn=te.now();if(Wn<an)return O=this.schedule(void 0,an-Wn),void S.add(O);rt()}C.subscribe((0,Vn._)(S,an=>{z=an,Se=te.now(),O||(O=te.schedule(Ot,R),S.add(O))},()=>{rt(),S.complete()},void 0,()=>{z=O=null}))})}const mt=[[["","above-quill-editor-toolbar",""]],[["","quill-editor-toolbar",""]],[["","below-quill-editor-toolbar",""]]],Ft=["[above-quill-editor-toolbar]","[quill-editor-toolbar]","[below-quill-editor-toolbar]"];function en(R,te){1&R&&o.nrm(0,"div",0)}function dn(R,te){1&R&&o.nrm(0,"div",0)}const Kt=(R,te)=>R||te||"html";let jn=(()=>{class R{constructor(C,S){var O=this;this.config=S,this.quill$=(0,Mn.v)((0,Oe.A)(function*(){if(!O.Quill){const z=O.document.addEventListener;O.document.addEventListener=O.document.__zone_symbol__addEventListener||O.document.addEventListener;const Se=yield I.e(256).then(I.bind(I,256));O.document.addEventListener=z,O.Quill=Se.default?.default??Se.default??Se}return O.config.customOptions?.forEach(z=>{const Se=O.Quill.import(z.import);Se.whitelist=z.whitelist,O.Quill.register(Se,!0,O.config.suppressGlobalRegisterWarning)}),yield O.registerCustomModules(O.Quill,O.config.customModules,O.config.suppressGlobalRegisterWarning)})).pipe(function ce(R,te,C){let S,O=!1;return R&&"object"==typeof R?({bufferSize:S=1/0,windowTime:te=1/0,refCount:O=!1,scheduler:C}=R):S=R??1/0,function j(R={}){const{connector:te=(()=>new cr.B),resetOnError:C=!0,resetOnComplete:S=!0,resetOnRefCountZero:O=!0}=R;return z=>{let Se,rt,Ot,an=0,Wn=!1,Rn=!1;const Bn=()=>{rt?.unsubscribe(),rt=void 0},Zn=()=>{Bn(),Se=Ot=void 0,Wn=Rn=!1},$r=()=>{const Jn=Se;Zn(),Jn?.unsubscribe()};return(0,V.N)((Jn,Ai)=>{an++,!Rn&&!Wn&&Bn();const bn=Ot=Ot??te();Ai.add(()=>{an--,0===an&&!Rn&&!Wn&&(rt=me($r,O))}),bn.subscribe(Ai),!Se&&an>0&&(Se=new P.Ms({next:$n=>bn.next($n),error:$n=>{Rn=!0,Bn(),rt=me(Zn,C,$n),bn.error($n)},complete:()=>{Wn=!0,Bn(),rt=me(Zn,S),bn.complete()}}),(0,Vi.Tg)(Jn).subscribe(Se))})(z)}}({connector:()=>new Ur(S,te,C),resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:O})}({bufferSize:1,refCount:!0})),this.document=C.get(h.qQ),this.config||(this.config={modules:Qr})}getQuill(){return this.quill$}registerCustomModules(C,S,O){return(0,Oe.A)(function*(){if(Array.isArray(S))for(let{implementation:z,path:Se}of S)(0,yr.A)(z)&&(z=yield(0,ar._)(z)),C.register(Se,z,O);return C})()}static{this.\u0275fac=function(S){return new(S||R)(o.KVO(o.zZn),o.KVO(Yn,8))}}static{this.\u0275prov=o.jDH({token:R,factory:R.\u0275fac,providedIn:"root"})}}return R})(),Gn=(()=>{class R{constructor(){this.format=(0,o.hFB)(void 0),this.theme=(0,o.hFB)(void 0),this.modules=(0,o.hFB)(void 0),this.debug=(0,o.hFB)(!1),this.readOnly=(0,o.hFB)(!1),this.placeholder=(0,o.hFB)(void 0),this.maxLength=(0,o.hFB)(void 0),this.minLength=(0,o.hFB)(void 0),this.required=(0,o.hFB)(!1),this.formats=(0,o.hFB)(void 0),this.customToolbarPosition=(0,o.hFB)("top"),this.sanitize=(0,o.hFB)(!1),this.beforeRender=(0,o.hFB)(void 0),this.styles=(0,o.hFB)(null),this.registry=(0,o.hFB)(void 0),this.bounds=(0,o.hFB)(void 0),this.customOptions=(0,o.hFB)([]),this.customModules=(0,o.hFB)([]),this.trackChanges=(0,o.hFB)(void 0),this.classes=(0,o.hFB)(void 0),this.trimOnValidation=(0,o.hFB)(!1),this.linkPlaceholder=(0,o.hFB)(void 0),this.compareValues=(0,o.hFB)(!1),this.filterNull=(0,o.hFB)(!1),this.debounceTime=(0,o.hFB)(void 0),this.defaultEmptyValue=(0,o.hFB)(null),this.onEditorCreated=new o.bkB,this.onEditorChanged=new o.bkB,this.onContentChanged=new o.bkB,this.onSelectionChanged=new o.bkB,this.onFocus=new o.bkB,this.onBlur=new o.bkB,this.onNativeFocus=new o.bkB,this.onNativeBlur=new o.bkB,this.disabled=!1,this.toolbarPosition=(0,o.vPA)("top"),this.subscription=null,this.quillSubscription=null,this.elementRef=(0,o.WQX)(o.aKT),this.document=(0,o.WQX)(h.qQ),this.cd=(0,o.WQX)(o.gRc),this.domSanitizer=(0,o.WQX)(F.up),this.platformId=(0,o.WQX)(o.Agw),this.renderer=(0,o.WQX)(o.sFG),this.zone=(0,o.WQX)(o.SKi),this.service=(0,o.WQX)(jn),this.destroyRef=(0,o.WQX)(o.abz),this.valueGetter=(0,o.hFB)(C=>{let S=C.getSemanticHTML();this.isEmptyValue(S)&&(S=this.defaultEmptyValue());let O=S;const z=Kt(this.format(),this.service.config.format);if("text"===z)O=C.getText();else if("object"===z)O=C.getContents();else if("json"===z)try{O=JSON.stringify(C.getContents())}catch{O=C.getText()}return O}),this.valueSetter=(0,o.hFB)((C,S)=>{const O=Kt(this.format(),this.service.config.format);if("html"===O)return([!0,!1].includes(this.sanitize())?this.sanitize():this.service.config.sanitize||!1)&&(S=this.domSanitizer.sanitize(o.WPN.HTML,S)),C.clipboard.convert({html:S});if("json"===O)try{return JSON.parse(S)}catch{return[{insert:S}]}return S}),this.selectionChangeHandler=(C,S,O)=>{const z=this.trackChanges()||this.service.config.trackChanges,Se=!C&&!!this.onModelTouched&&("user"===O||z&&"all"===z);!this.onBlur.observed&&!this.onFocus.observed&&!this.onSelectionChanged.observed&&!Se||this.zone.run(()=>{null===C?this.onBlur.emit({editor:this.quillEditor,source:O}):null===S&&this.onFocus.emit({editor:this.quillEditor,source:O}),this.onSelectionChanged.emit({editor:this.quillEditor,oldRange:S,range:C,source:O}),Se&&this.onModelTouched(),this.cd.markForCheck()})},this.textChangeHandler=(C,S,O)=>{const z=this.quillEditor.getText(),Se=this.quillEditor.getContents();let rt=this.quillEditor.getSemanticHTML();this.isEmptyValue(rt)&&(rt=this.defaultEmptyValue());const Ot=this.trackChanges()||this.service.config.trackChanges,an=("user"===O||Ot&&"all"===Ot)&&!!this.onModelChange;!this.onContentChanged.observed&&!an||this.zone.run(()=>{if(an){const Wn=this.valueGetter();this.onModelChange(Wn(this.quillEditor))}this.onContentChanged.emit({content:Se,delta:C,editor:this.quillEditor,html:rt,oldDelta:S,source:O,text:z}),this.cd.markForCheck()})},this.editorChangeHandler=(C,S,O,z)=>{if(this.onEditorChanged.observed)if("text-change"===C){const Se=this.quillEditor.getText(),rt=this.quillEditor.getContents();let Ot=this.quillEditor.getSemanticHTML();this.isEmptyValue(Ot)&&(Ot=this.defaultEmptyValue()),this.zone.run(()=>{this.onEditorChanged.emit({content:rt,delta:S,editor:this.quillEditor,event:C,html:Ot,oldDelta:O,source:z,text:Se}),this.cd.markForCheck()})}else this.zone.run(()=>{this.onEditorChanged.emit({editor:this.quillEditor,event:C,oldRange:O,range:S,source:z}),this.cd.markForCheck()})}}static normalizeClassNames(C){return C.trim().split(" ").reduce((O,z)=>{const Se=z.trim();return Se&&O.push(Se),O},[])}ngOnInit(){this.toolbarPosition.set(this.customToolbarPosition())}ngAfterViewInit(){(0,h.Vy)(this.platformId)||(this.quillSubscription=this.service.getQuill().pipe((0,Tn.Z)(C=>{const S=[this.service.registerCustomModules(C,this.customModules())],O=this.beforeRender()??this.service.config.beforeRender;return O&&S.push(O()),Promise.all(S).then(()=>C)})).subscribe(C=>{this.editorElem=this.elementRef.nativeElement.querySelector("[quill-editor-element]");const S=this.elementRef.nativeElement.querySelector("[quill-editor-toolbar]"),O=Object.assign({},this.modules()||this.service.config.modules);S?O.toolbar=S:void 0===O.toolbar&&(O.toolbar=Qr.toolbar);let z=void 0!==this.placeholder()?this.placeholder():this.service.config.placeholder;void 0===z&&(z="Insert text here ...");const Se=this.styles();Se&&Object.keys(Se).forEach(Bn=>{this.renderer.setStyle(this.editorElem,Bn,Se[Bn])}),this.classes()&&this.addClasses(this.classes()),this.customOptions().forEach(Bn=>{const Zn=C.import(Bn.import);Zn.whitelist=Bn.whitelist,C.register(Zn,!0)});let rt=this.bounds()&&"self"===this.bounds()?this.editorElem:this.bounds();rt||(rt=this.service.config.bounds?this.service.config.bounds:this.document.body);let Ot=this.debug();!Ot&&!1!==Ot&&this.service.config.debug&&(Ot=this.service.config.debug);let an=this.readOnly();!an&&!1!==this.readOnly()&&(an=void 0!==this.service.config.readOnly&&this.service.config.readOnly);let Wn=this.defaultEmptyValue;this.service.config.hasOwnProperty("defaultEmptyValue")&&(Wn=this.service.config.defaultEmptyValue);let Rn=this.formats();if(!Rn&&void 0===Rn&&(Rn=this.service.config.formats?[...this.service.config.formats]:null===this.service.config.formats?null:void 0),this.zone.runOutsideAngular(()=>{if(this.quillEditor=new C(this.editorElem,{bounds:rt,debug:Ot,formats:Rn,modules:O,placeholder:z,readOnly:an,defaultEmptyValue:Wn,registry:this.registry(),theme:this.theme()||(this.service.config.theme?this.service.config.theme:"snow")}),this.onNativeBlur.observed&&(this.quillEditor.scroll.domNode.addEventListener("blur",()=>this.onNativeBlur.next({editor:this.quillEditor,source:"dom"})),this.quillEditor.getModule("toolbar").container?.addEventListener("mousedown",Zn=>Zn.preventDefault())),this.onNativeFocus.observed&&this.quillEditor.scroll.domNode.addEventListener("focus",()=>this.onNativeFocus.next({editor:this.quillEditor,source:"dom"})),this.linkPlaceholder()){const Zn=this.quillEditor?.theme?.tooltip?.root?.querySelector("input[data-link]");Zn?.dataset&&(Zn.dataset.link=this.linkPlaceholder())}}),this.content){if("text"===Kt(this.format(),this.service.config.format))this.quillEditor.setText(this.content,"silent");else{const Jn=this.valueSetter()(this.quillEditor,this.content);this.quillEditor.setContents(Jn,"silent")}this.quillEditor.getModule("history").clear()}this.setDisabledState(),this.addQuillEventListeners(),(this.onEditorCreated.observed||this.onValidatorChanged)&&new $.c(R=>{const te=requestAnimationFrame(()=>{R.next(),R.complete()});return()=>cancelAnimationFrame(te)}).pipe($e(this.destroyRef)).subscribe(()=>{this.onValidatorChanged&&this.onValidatorChanged(),this.onEditorCreated.emit(this.quillEditor)})}))}ngOnDestroy(){this.dispose(),this.quillSubscription?.unsubscribe(),this.quillSubscription=null}ngOnChanges(C){if(this.quillEditor){if(C.readOnly&&this.quillEditor.enable(!C.readOnly.currentValue),C.placeholder&&(this.quillEditor.root.dataset.placeholder=C.placeholder.currentValue),C.defaultEmptyValue&&(this.quillEditor.root.dataset.defaultEmptyValue=C.defaultEmptyValue.currentValue),C.styles){const S=C.styles.currentValue,O=C.styles.previousValue;O&&Object.keys(O).forEach(z=>{this.renderer.removeStyle(this.editorElem,z)}),S&&Object.keys(S).forEach(z=>{this.renderer.setStyle(this.editorElem,z,this.styles()[z])})}if(C.classes){const S=C.classes.currentValue,O=C.classes.previousValue;O&&this.removeClasses(O),S&&this.addClasses(S)}C.debounceTime&&this.addQuillEventListeners()}}addClasses(C){R.normalizeClassNames(C).forEach(S=>{this.renderer.addClass(this.editorElem,S)})}removeClasses(C){R.normalizeClassNames(C).forEach(S=>{this.renderer.removeClass(this.editorElem,S)})}writeValue(C){if(this.filterNull()&&null===C||(this.content=C,!this.quillEditor))return;const S=Kt(this.format(),this.service.config.format),z=this.valueSetter()(this.quillEditor,C);if(this.compareValues()){const Se=this.quillEditor.getContents();if(JSON.stringify(Se)===JSON.stringify(z))return}C?"text"===S?this.quillEditor.setText(C):this.quillEditor.setContents(z):this.quillEditor.setText("")}setDisabledState(C=this.disabled){this.disabled=C,this.quillEditor&&(C?(this.quillEditor.disable(),this.renderer.setAttribute(this.elementRef.nativeElement,"disabled","disabled")):(this.readOnly()||this.quillEditor.enable(),this.renderer.removeAttribute(this.elementRef.nativeElement,"disabled")))}registerOnChange(C){this.onModelChange=C}registerOnTouched(C){this.onModelTouched=C}registerOnValidatorChange(C){this.onValidatorChanged=C}validate(){if(!this.quillEditor)return null;const C={};let S=!0;const O=this.quillEditor.getText(),z=this.trimOnValidation()?O.trim().length:1===O.length&&0===O.trim().length?0:O.length-1,Se=this.quillEditor.getContents().ops,rt=!!Se&&1===Se.length&&["\n",""].includes(Se[0].insert?.toString());return this.minLength()&&z&&z<this.minLength()&&(C.minLengthError={given:z,minLength:this.minLength()},S=!1),this.maxLength()&&z>this.maxLength()&&(C.maxLengthError={given:z,maxLength:this.maxLength()},S=!1),this.required()&&!z&&rt&&(C.requiredError={empty:!0},S=!1),S?null:C}addQuillEventListeners(){this.dispose(),this.zone.runOutsideAngular(()=>{this.subscription=new Mi.yU,this.subscription.add(Mt(this.quillEditor,"selection-change").subscribe(([O,z,Se])=>{this.selectionChangeHandler(O,z,Se)}));let C=Mt(this.quillEditor,"text-change"),S=Mt(this.quillEditor,"editor-change");"number"==typeof this.debounceTime()&&(C=C.pipe(ct(this.debounceTime())),S=S.pipe(ct(this.debounceTime()))),this.subscription.add(C.subscribe(([O,z,Se])=>{this.textChangeHandler(O,z,Se)})),this.subscription.add(S.subscribe(([O,z,Se,rt])=>{this.editorChangeHandler(O,z,Se,rt)}))})}dispose(){null!==this.subscription&&(this.subscription.unsubscribe(),this.subscription=null)}isEmptyValue(C){return"<p></p>"===C||"<div></div>"===C||"<p><br></p>"===C||"<div><br></div>"===C}static{this.\u0275fac=function(S){return new(S||R)}}static{this.\u0275dir=o.FsC({type:R,inputs:{format:[o.Mj6.SignalBased,"format"],theme:[o.Mj6.SignalBased,"theme"],modules:[o.Mj6.SignalBased,"modules"],debug:[o.Mj6.SignalBased,"debug"],readOnly:[o.Mj6.SignalBased,"readOnly"],placeholder:[o.Mj6.SignalBased,"placeholder"],maxLength:[o.Mj6.SignalBased,"maxLength"],minLength:[o.Mj6.SignalBased,"minLength"],required:[o.Mj6.SignalBased,"required"],formats:[o.Mj6.SignalBased,"formats"],customToolbarPosition:[o.Mj6.SignalBased,"customToolbarPosition"],sanitize:[o.Mj6.SignalBased,"sanitize"],beforeRender:[o.Mj6.SignalBased,"beforeRender"],styles:[o.Mj6.SignalBased,"styles"],registry:[o.Mj6.SignalBased,"registry"],bounds:[o.Mj6.SignalBased,"bounds"],customOptions:[o.Mj6.SignalBased,"customOptions"],customModules:[o.Mj6.SignalBased,"customModules"],trackChanges:[o.Mj6.SignalBased,"trackChanges"],classes:[o.Mj6.SignalBased,"classes"],trimOnValidation:[o.Mj6.SignalBased,"trimOnValidation"],linkPlaceholder:[o.Mj6.SignalBased,"linkPlaceholder"],compareValues:[o.Mj6.SignalBased,"compareValues"],filterNull:[o.Mj6.SignalBased,"filterNull"],debounceTime:[o.Mj6.SignalBased,"debounceTime"],defaultEmptyValue:[o.Mj6.SignalBased,"defaultEmptyValue"],valueGetter:[o.Mj6.SignalBased,"valueGetter"],valueSetter:[o.Mj6.SignalBased,"valueSetter"]},outputs:{onEditorCreated:"onEditorCreated",onEditorChanged:"onEditorChanged",onContentChanged:"onContentChanged",onSelectionChanged:"onSelectionChanged",onFocus:"onFocus",onBlur:"onBlur",onNativeFocus:"onNativeFocus",onNativeBlur:"onNativeBlur"},features:[o.OA$]})}}return R})(),ht=(()=>{class R extends Gn{static{this.\u0275fac=(()=>{let C;return function(O){return(C||(C=o.xGo(R)))(O||R)}})()}static{this.\u0275cmp=o.VBU({type:R,selectors:[["quill-editor"]],standalone:!0,features:[o.Jv_([{multi:!0,provide:ee.kq,useExisting:(0,o.Rfq)(()=>R)},{multi:!0,provide:ee.cz,useExisting:(0,o.Rfq)(()=>R)}]),o.Vt3,o.aNF],ngContentSelectors:Ft,decls:5,vars:2,consts:[["quill-editor-element",""]],template:function(S,O){1&S&&(o.NAR(mt),o.DNE(0,en,1,0,"div",0),o.SdG(1),o.SdG(2,1),o.SdG(3,2),o.DNE(4,dn,1,0,"div",0)),2&S&&(o.vxM(0,"top"!==O.toolbarPosition()?0:-1),o.R7$(4),o.vxM(4,"top"===O.toolbarPosition()?4:-1))},styles:["[_nghost-%COMP%]{display:inline-block}"]})}}return R})(),Dr=(()=>{class R{static forRoot(C){return{ngModule:R,providers:[{provide:Yn,useValue:C}]}}static{this.\u0275fac=function(S){return new(S||R)}}static{this.\u0275mod=o.$C({type:R})}static{this.\u0275inj=o.G2t({})}}return R})();const Ji=R=>({"is-danger":R});let eo=(()=>{class R{constructor(C){this.formBuilder=C,this.valueChanged=new o.bkB,this.modules={toolbar:[["bold","italic","underline","strike"],["link","blockquote","code-block"],[{list:"ordered"},{list:"bullet"}],[{header:[1,2,3,4,5,6,!1]}]]}}ngOnInit(){this.form=this.formBuilder.group({editor:[this.value||""]}),this.form.valueChanges.subscribe(C=>{this.valueChanged.emit(C.editor)})}static{this.\u0275fac=function(S){return new(S||R)(o.rXU(ee.ok))}}static{this.\u0275cmp=o.VBU({type:R,selectors:[["app-rich-text-input"]],inputs:{prop:"prop",value:"value",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:5,vars:7,consts:[[3,"for"],[3,"formGroup"],[1,"control",3,"ngClass"],["placeholder","","formControlName","editor",3,"modules"]],template:function(S,O){1&S&&(o.j41(0,"label",0),o.EFF(1),o.k0s(),o.j41(2,"form",1)(3,"div",2),o.nrm(4,"quill-editor",3),o.k0s()()),2&S&&(o.Y8G("for",O.prop.name),o.R7$(),o.JRh(O.prop.name),o.R7$(),o.Y8G("formGroup",O.form),o.R7$(),o.Y8G("ngClass",o.eq3(5,Ji,O.isError)),o.R7$(),o.Y8G("modules",O.modules))},dependencies:[h.YU,Dr,ht,ee.X1,ee.qT,ee.BC,ee.cb,ee.j4,ee.JD],styles:['@import"https://fonts.googleapis.com/css?family=Rubik:300,400,400i,500";.control[_ngcontent-%COMP%]{min-height:200px}']})}}return R})();function to(R,te){if(1&R){const C=o.RV6();o.j41(0,"app-text-input",5),o.bIt("valueChanged",function(O){o.eBV(C);const z=o.XpG();return o.Njj(z.onChange(O))}),o.k0s()}if(2&R){const C=o.XpG();o.Y8G("prop",C.prop)("value",C.value)("isError",C.isError)}}function pi(R,te){if(1&R){const C=o.RV6();o.j41(0,"app-rich-text-input",5),o.bIt("valueChanged",function(O){o.eBV(C);const z=o.XpG();return o.Njj(z.onChange(O))}),o.k0s()}if(2&R){const C=o.XpG();o.Y8G("prop",C.prop)("value",C.value)("isError",C.isError)}}function kt(R,te){if(1&R){const C=o.RV6();o.j41(0,"app-number-input",5),o.bIt("valueChanged",function(O){o.eBV(C);const z=o.XpG();return o.Njj(z.onChange(O))}),o.k0s()}if(2&R){const C=o.XpG();o.Y8G("prop",C.prop)("value",C.value)("isError",C.isError)}}function gi(R,te){if(1&R){const C=o.RV6();o.j41(0,"app-url-input",5),o.bIt("valueChanged",function(O){o.eBV(C);const z=o.XpG();return o.Njj(z.onChange(O))}),o.k0s()}if(2&R){const C=o.XpG();o.Y8G("prop",C.prop)("value",C.value)("isError",C.isError)}}function ji(R,te){if(1&R){const C=o.RV6();o.j41(0,"app-textarea-input",5),o.bIt("valueChanged",function(O){o.eBV(C);const z=o.XpG();return o.Njj(z.onChange(O))}),o.k0s()}if(2&R){const C=o.XpG();o.Y8G("prop",C.prop)("value",C.value)("isError",C.isError)}}function Un(R,te){if(1&R){const C=o.RV6();o.j41(0,"app-select-input",6),o.bIt("valueChanged",function(O){o.eBV(C);const z=o.XpG();return o.Njj(z.onChange(O))}),o.k0s()}if(2&R){const C=o.XpG();o.Y8G("prop",C.prop)("relationship",C.relationship)("value",C.value)("isError",C.isError)}}function mi(R,te){if(1&R){const C=o.RV6();o.j41(0,"app-multi-select-input",6),o.bIt("valueChanged",function(O){o.eBV(C);const z=o.XpG();return o.Njj(z.onChange(O))}),o.k0s()}if(2&R){const C=o.XpG();o.Y8G("prop",C.prop)("relationship",C.relationship)("value",C.value)("isError",C.isError)}}function no(R,te){if(1&R){const C=o.RV6();o.j41(0,"app-currency-input",7),o.bIt("valueChanged",function(O){o.eBV(C);const z=o.XpG();return o.Njj(z.onChange(O))}),o.k0s()}if(2&R){const C=o.XpG();o.Y8G("prop",C.prop)("value",C.value)("currency",null==C.prop||null==C.prop.options?null:C.prop.options.currency)("isError",C.isError)}}function Wo(R,te){if(1&R){const C=o.RV6();o.j41(0,"app-boolean-input",5),o.bIt("valueChanged",function(O){o.eBV(C);const z=o.XpG();return o.Njj(z.onChange(O))}),o.k0s()}if(2&R){const C=o.XpG();o.Y8G("prop",C.prop)("value",C.value)("isError",C.isError)}}function Zr(R,te){if(1&R){const C=o.RV6();o.j41(0,"app-email-input",5),o.bIt("valueChanged",function(O){o.eBV(C);const z=o.XpG();return o.Njj(z.onChange(O))}),o.k0s()}if(2&R){const C=o.XpG();o.Y8G("prop",C.prop)("value",C.value)("isError",C.isError)}}function Or(R,te){if(1&R){const C=o.RV6();o.j41(0,"app-date-input",5),o.bIt("valueChanged",function(O){o.eBV(C);const z=o.XpG();return o.Njj(z.onChange(O))}),o.k0s()}if(2&R){const C=o.XpG();o.Y8G("prop",C.prop)("value",C.value)("isError",C.isError)}}function Jr(R,te){if(1&R){const C=o.RV6();o.j41(0,"app-timestamp-input",5),o.bIt("valueChanged",function(O){o.eBV(C);const z=o.XpG();return o.Njj(z.onChange(O))}),o.k0s()}if(2&R){const C=o.XpG();o.Y8G("prop",C.prop)("value",C.value)("isError",C.isError)}}function si(R,te){if(1&R){const C=o.RV6();o.j41(0,"app-password-input",5),o.bIt("valueChanged",function(O){o.eBV(C);const z=o.XpG();return o.Njj(z.onChange(O))}),o.k0s()}if(2&R){const C=o.XpG();o.Y8G("prop",C.prop)("value",C.value)("isError",C.isError)}}function Ti(R,te){if(1&R){const C=o.RV6();o.j41(0,"app-location-input",5),o.bIt("valueChanged",function(O){o.eBV(C);const z=o.XpG();return o.Njj(z.onChange(O))}),o.k0s()}if(2&R){const C=o.XpG();o.Y8G("prop",C.prop)("value",C.value)("isError",C.isError)}}function or(R,te){if(1&R){const C=o.RV6();o.j41(0,"app-file-input",8),o.bIt("valueChanged",function(O){o.eBV(C);const z=o.XpG();return o.Njj(z.onChange(O))}),o.k0s()}if(2&R){const C=o.XpG();o.Y8G("prop",C.prop)("entitySlug",C.entityManifest.slug)("value",C.value)("isError",C.isError)}}function Br(R,te){if(1&R){const C=o.RV6();o.j41(0,"app-image-input",8),o.bIt("valueChanged",function(O){o.eBV(C);const z=o.XpG();return o.Njj(z.onChange(O))}),o.k0s()}if(2&R){const C=o.XpG();o.Y8G("prop",C.prop)("entitySlug",C.entityManifest.slug)("value",C.value)("isError",C.isError)}}function Er(R,te){if(1&R&&(o.j41(0,"li",10),o.EFF(1),o.k0s()),2&R){const C=te.$implicit;o.R7$(),o.JRh(C)}}function Si(R,te){if(1&R&&(o.j41(0,"ul"),o.DNE(1,Er,2,1,"li",9),o.k0s()),2&R){const C=o.XpG();o.R7$(),o.Y8G("ngForOf",C.errors)}}let wr=(()=>{class R{constructor(){this.valueChanged=new o.bkB,this.PropType=W.Kk}onChange(C){this.valueChanged.emit(C)}ngOnChanges(){this.isError=!!this.errors?.length}static{this.\u0275fac=function(S){return new(S||R)}}static{this.\u0275cmp=o.VBU({type:R,selectors:[["app-input"]],inputs:{prop:"prop",entityManifest:"entityManifest",relationship:"relationship",value:"value",errors:"errors"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.OA$,o.aNF],decls:17,vars:17,consts:[[3,"prop","value","isError","valueChanged",4,"ngIf"],[3,"prop","relationship","value","isError","valueChanged",4,"ngIf"],[3,"prop","value","currency","isError","valueChanged",4,"ngIf"],[3,"prop","entitySlug","value","isError","valueChanged",4,"ngIf"],[4,"ngIf"],[3,"valueChanged","prop","value","isError"],[3,"valueChanged","prop","relationship","value","isError"],[3,"valueChanged","prop","value","currency","isError"],[3,"valueChanged","prop","entitySlug","value","isError"],["class","has-text-danger",4,"ngFor","ngForOf"],[1,"has-text-danger"]],template:function(S,O){1&S&&o.DNE(0,to,1,3,"app-text-input",0)(1,pi,1,3,"app-rich-text-input",0)(2,kt,1,3,"app-number-input",0)(3,gi,1,3,"app-url-input",0)(4,ji,1,3,"app-textarea-input",0)(5,Un,1,4,"app-select-input",1)(6,mi,1,4,"app-multi-select-input",1)(7,no,1,4,"app-currency-input",2)(8,Wo,1,3,"app-boolean-input",0)(9,Zr,1,3,"app-email-input",0)(10,Or,1,3,"app-date-input",0)(11,Jr,1,3,"app-timestamp-input",0)(12,si,1,3,"app-password-input",0)(13,Ti,1,3,"app-location-input",0)(14,or,1,4,"app-file-input",3)(15,Br,1,4,"app-image-input",3)(16,Si,2,1,"ul",4),2&S&&(o.Y8G("ngIf",(null==O.prop?null:O.prop.type)===O.PropType.String),o.R7$(),o.Y8G("ngIf",(null==O.prop?null:O.prop.type)===O.PropType.RichText),o.R7$(),o.Y8G("ngIf",(null==O.prop?null:O.prop.type)===O.PropType.Number),o.R7$(),o.Y8G("ngIf",(null==O.prop?null:O.prop.type)===O.PropType.Link),o.R7$(),o.Y8G("ngIf",(null==O.prop?null:O.prop.type)===O.PropType.Text),o.R7$(),o.Y8G("ngIf",(null==O.prop?null:O.prop.type)===O.PropType.Choice||"many-to-one"===(null==O.relationship?null:O.relationship.type)),o.R7$(),o.Y8G("ngIf","many-to-many"===(null==O.relationship?null:O.relationship.type)),o.R7$(),o.Y8G("ngIf",(null==O.prop?null:O.prop.type)===O.PropType.Money),o.R7$(),o.Y8G("ngIf",(null==O.prop?null:O.prop.type)===O.PropType.Boolean),o.R7$(),o.Y8G("ngIf",(null==O.prop?null:O.prop.type)===O.PropType.Email),o.R7$(),o.Y8G("ngIf",(null==O.prop?null:O.prop.type)===O.PropType.Date),o.R7$(),o.Y8G("ngIf",(null==O.prop?null:O.prop.type)===O.PropType.Timestamp),o.R7$(),o.Y8G("ngIf",(null==O.prop?null:O.prop.type)===O.PropType.Password),o.R7$(),o.Y8G("ngIf",(null==O.prop?null:O.prop.type)===O.PropType.Location),o.R7$(),o.Y8G("ngIf",(null==O.prop?null:O.prop.type)===O.PropType.File),o.R7$(),o.Y8G("ngIf",(null==O.prop?null:O.prop.type)===O.PropType.Image),o.R7$(),o.Y8G("ngIf",null==O.errors?null:O.errors.length))},dependencies:[h.MD,h.Sq,h.bT,J,de,xe,yn,He,on,Xe,Fn,ue,nt,cn,dt,Dt,We,oi,eo],encapsulation:2})}}return R})()},9e3:(Je,he,I)=>{I.d(he,{X:()=>o});var h=I(8284);let o=(()=>{class W{transform(T){return typeof T>"u"||null===T||""===T?"":T[0].toUpperCase()+T.substr(1).toLowerCase()}static{this.\u0275fac=function(pe){return new(pe||W)}}static{this.\u0275pipe=h.EJ8({name:"capitalizeFirstLetter",type:W,pure:!0,standalone:!0})}}return W})()},818:(Je,he,I)=>{I.d(he,{L:()=>W});var h=I(1087),o=I(8284);let W=(()=>{class X{constructor(){this.flashMessageTimeOut=5e3,this.flashMessage=new h.B}success(pe){this.flashMessage.next({message:pe,className:"notification is-success"}),this.clear()}error(pe){this.flashMessage.next({message:pe,className:"notification is-danger"}),this.clear()}warning(pe){this.flashMessage.next({message:pe,className:"notification is-warning"}),this.clear()}info(pe){this.flashMessage.next({message:pe,className:"notification is-info"}),this.clear()}clear(){setTimeout(()=>{this.flashMessage.next(null)},this.flashMessageTimeOut)}static{this.\u0275fac=function(J){return new(J||X)}}static{this.\u0275prov=o.jDH({token:X,factory:X.\u0275fac,providedIn:"root"})}}return X})()},2283:(Je,he,I)=>{I.d(he,{x:()=>le});var h=I(7431),o=I(8033),W=I(4534),X=I(8128),T=I(9606),pe=I(8284),J=I(7906),fe=I(5640);let le=(()=>{class de{constructor(_e,xe){this.authService=_e,this.http=xe,this.manifestPromise=null}getManifest(){return this.manifestPromise||(this.manifestPromise=(0,o._)(this.authService.currentUser$.pipe((0,W.p)(_e=>!!_e),(0,X.n)(()=>this.http.get(`${T.c.apiBaseUrl}/manifest`)))).catch(_e=>{throw this.manifestPromise=null,_e})),this.manifestPromise}getAppName(){var _e=this;return(0,h.A)(function*(){return(0,o._)(_e.http.get(`${T.c.apiBaseUrl}/manifest/app-name`)).then(xe=>xe.name).catch(xe=>{throw xe})})()}getEntityManifest(_e){var xe=this;return(0,h.A)(function*({slug:Q,className:ve}){if(!Q&&!ve)throw new Error("Either slug or className must be provided");return xe.manifestPromise?xe.manifestPromise.then(He=>Object.values(He.entities).find(Pe=>Pe.slug===Q||Pe.className===ve)):(0,o._)(xe.http.get(`${T.c.apiBaseUrl}/manifest/entities/${Q}`))}).apply(this,arguments)}static{this.\u0275fac=function(xe){return new(xe||de)(pe.KVO(J.u),pe.KVO(fe.Qq))}}static{this.\u0275prov=pe.jDH({token:de,factory:de.\u0275fac,providedIn:"root"})}}return de})()},9879:(Je,he,I)=>{I.d(he,{R:()=>X});var h=I(8284),o=I(2283),W=I(7711);let X=(()=>{class T{constructor(J,fe){this.title=fe,this.appName="Manifest",J.getManifest().then(le=>{this.appName=le.name})}setTitle(J){this.title.setTitle(`${J} | ${this.appName}`)}static{this.\u0275fac=function(fe){return new(fe||T)(h.KVO(o.x),h.KVO(W.hE))}}static{this.\u0275prov=h.jDH({token:T,factory:T.\u0275fac,providedIn:"root"})}}return T})()},8023:(Je,he,I)=>{I.d(he,{G:()=>pe});var h=I(2943),o=I(5640),W=I(8428),X=I(818),T=I(8284);let pe=(()=>{class J{static{this.\u0275fac=function(de){return new(de||J)}}static{this.\u0275mod=T.$C({type:J})}static{this.\u0275inj=T.G2t({providers:[X.L],imports:[h.MD,o.q1,W.S]})}}return J})()},4385:(Je,he,I)=>{I.d(he,{Fr:()=>W,Xw:()=>o,il:()=>h});const h="manifestToken",o="Admin",W={email:"admin@manifest.build",password:"admin"}},9606:(Je,he,I)=>{I.d(he,{c:()=>h});const h={production:!0,apiBaseUrl:"/api"}},6543:(Je,he,I)=>{var h=I(7711),o=I(8284),W=I(2943),X=I(2816),T=I(3575),pe=I(6852),J=I(1467),fe=I(5640);const le=new o.nKC("JWT_OPTIONS");let de=(()=>{class q{constructor(K=null){this.tokenGetter=K&&K.tokenGetter||function(){}}urlBase64Decode(K){let ge=K.replace(/-/g,"+").replace(/_/g,"/");switch(ge.length%4){case 0:break;case 2:ge+="==";break;case 3:ge+="=";break;default:throw new Error("Illegal base64url string!")}return this.b64DecodeUnicode(ge)}b64decode(K){let We="";if((K=String(K).replace(/=+$/,"")).length%4==1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(let Ct,gt,Be=0,Gt=0;gt=K.charAt(Gt++);~gt&&(Ct=Be%4?64*Ct+gt:gt,Be++%4)?We+=String.fromCharCode(255&Ct>>(-2*Be&6)):0)gt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(gt);return We}b64DecodeUnicode(K){return decodeURIComponent(Array.prototype.map.call(this.b64decode(K),ge=>"%"+("00"+ge.charCodeAt(0).toString(16)).slice(-2)).join(""))}decodeToken(K=this.tokenGetter()){return K instanceof Promise?K.then(ge=>this._decodeToken(ge)):this._decodeToken(K)}_decodeToken(K){if(!K||""===K)return null;const ge=K.split(".");if(3!==ge.length)throw new Error("The inspected token doesn't appear to be a JWT. Check to make sure it has three parts and see https://jwt.io for more.");const We=this.urlBase64Decode(ge[1]);if(!We)throw new Error("Cannot decode the token.");return JSON.parse(We)}getTokenExpirationDate(K=this.tokenGetter()){return K instanceof Promise?K.then(ge=>this._getTokenExpirationDate(ge)):this._getTokenExpirationDate(K)}_getTokenExpirationDate(K){let ge;if(ge=this.decodeToken(K),!ge||!ge.hasOwnProperty("exp"))return null;const We=new Date(0);return We.setUTCSeconds(ge.exp),We}isTokenExpired(K=this.tokenGetter(),ge){return K instanceof Promise?K.then(We=>this._isTokenExpired(We,ge)):this._isTokenExpired(K,ge)}_isTokenExpired(K,ge){if(!K||""===K)return!0;const We=this.getTokenExpirationDate(K);return ge=ge||0,null!==We&&!(We.valueOf()>(new Date).valueOf()+1e3*ge)}getAuthScheme(K,ge){return"function"==typeof K?K(ge):K}}return q.\u0275fac=function(K){return new(K||q)(o.KVO(le))},q.\u0275prov=o.jDH({token:q,factory:q.\u0275fac}),q})();const oe=q=>q instanceof Promise?(0,pe.v)(()=>q):(0,J.of)(q);let _e=(()=>{class q{constructor(K,ge,We){this.jwtHelper=ge,this.document=We,this.standardPorts=["80","443"],this.tokenGetter=K.tokenGetter,this.headerName=K.headerName||"Authorization",this.authScheme=K.authScheme||""===K.authScheme?K.authScheme:"Bearer ",this.allowedDomains=K.allowedDomains||[],this.disallowedRoutes=K.disallowedRoutes||[],this.throwNoTokenError=K.throwNoTokenError||!1,this.skipWhenExpired=K.skipWhenExpired}isAllowedDomain(K){const ge=new URL(K.url,this.document.location.origin);if(ge.host===this.document.location.host)return!0;const We=`${ge.hostname}${ge.port&&!this.standardPorts.includes(ge.port)?":"+ge.port:""}`;return this.allowedDomains.findIndex(Be=>"string"==typeof Be?Be===We:Be instanceof RegExp&&Be.test(We))>-1}isDisallowedRoute(K){const ge=new URL(K.url,this.document.location.origin);return this.disallowedRoutes.findIndex(We=>{if("string"==typeof We){const Be=new URL(We,this.document.location.origin);return Be.hostname===ge.hostname&&Be.pathname===ge.pathname}return We instanceof RegExp&&We.test(K.url)})>-1}handleInterception(K,ge,We){const Be=this.jwtHelper.getAuthScheme(this.authScheme,ge);if(!K&&this.throwNoTokenError)throw new Error("Could not get token from tokenGetter function.");let Ct=(0,J.of)(!1);return this.skipWhenExpired&&(Ct=K?oe(this.jwtHelper.isTokenExpired(K)):(0,J.of)(!0)),K?Ct.pipe((0,X.T)(gt=>gt&&this.skipWhenExpired?ge.clone():ge.clone({setHeaders:{[this.headerName]:`${Be}${K}`}})),(0,T.Z)(gt=>We.handle(gt))):We.handle(ge)}intercept(K,ge){if(!this.isAllowedDomain(K)||this.isDisallowedRoute(K))return ge.handle(K);const We=this.tokenGetter(K);return oe(We).pipe((0,T.Z)(Be=>this.handleInterception(Be,K,ge)))}}return q.\u0275fac=function(K){return new(K||q)(o.KVO(le),o.KVO(de),o.KVO(W.qQ))},q.\u0275prov=o.jDH({token:q,factory:q.\u0275fac}),q})(),xe=(()=>{class q{constructor(K){if(K)throw new Error("JwtModule is already loaded. It should only be imported in your application's main module.")}static forRoot(K){return{ngModule:q,providers:[{provide:fe.a7,useClass:_e,multi:!0},K.jwtOptionsProvider||{provide:le,useValue:K.config},de]}}}return q.\u0275fac=function(K){return new(K||q)(o.KVO(q,12))},q.\u0275mod=o.$C({type:q}),q.\u0275inj=o.G2t({}),q})();var Q=I(4385),ve=I(183),He=I(818);let Pe=(()=>{class q{constructor(K,ge){this.router=K,this.flashMessageService=ge}canActivate(){return!!localStorage.getItem(Q.il)||(this.router.navigate(["/","auth","login"]),this.flashMessageService.info("You need to be logged in to access this page."),!1)}static{this.\u0275fac=function(ge){return new(ge||q)(o.KVO(ve.Ix),o.KVO(He.L))}}static{this.\u0275prov=o.jDH({token:q,factory:q.\u0275fac,providedIn:"root"})}}return q})();var Ze=I(9879);let lt=(()=>{class q{constructor(K){K.setTitle("Page not found")}static{this.\u0275fac=function(ge){return new(ge||q)(o.rXU(Ze.R))}}static{this.\u0275cmp=o.VBU({type:q,selectors:[["app-error404"]],decls:10,vars:0,consts:[[1,"wrapper--basic"],[1,"title","is-1"],[1,"is-size-5","mb-4"],["routerLink","/",1,"button","is-link","mt-3"]],template:function(ge,We){1&ge&&(o.j41(0,"div",0)(1,"span"),o.EFF(2,"404"),o.k0s(),o.j41(3,"h1",1),o.EFF(4,"Page not found"),o.k0s(),o.j41(5,"p",2),o.EFF(6," The page you are looking for doesn't exist or has been moved "),o.k0s(),o.j41(7,"p")(8,"a",3),o.EFF(9," Back to Homepage "),o.k0s()()())},dependencies:[ve.Wk],styles:["span[_ngcontent-%COMP%]{font-size:11rem}"]})}}return q})();var Dt=I(2283),Oe=I(9e3);const we=q=>["/collections",q],Ge=q=>["/singles",q,"edit"];function Ke(q,pt){1&q&&(o.j41(0,"div",0),o.nrm(1,"hr"),o.j41(2,"div",7)(3,"p",8),o.EFF(4," Resources "),o.k0s()(),o.j41(5,"div",9)(6,"a",10)(7,"div",11)(8,"div",12)(9,"article",13)(10,"figure",14)(11,"p",15),o.nrm(12,"img",16),o.k0s()(),o.j41(13,"div",17)(14,"div",3)(15,"p",18),o.EFF(16," Documentation "),o.k0s(),o.j41(17,"p"),o.EFF(18,"Find out how how to to play with Manifest"),o.k0s()()(),o.j41(19,"figure",19),o.nrm(20,"i",20),o.k0s()()()()()(),o.j41(21,"div",7)(22,"p",8),o.EFF(23," Feedback & Support "),o.k0s()(),o.j41(24,"div",9)(25,"a",21)(26,"div",11)(27,"div",12)(28,"article",13)(29,"figure",14)(30,"p",15),o.nrm(31,"img",22),o.k0s()(),o.j41(32,"div",17)(33,"div",3)(34,"p",18),o.EFF(35," We need you \u{1f64f} "),o.k0s(),o.j41(36,"p"),o.EFF(37,"Share your feedback and suggestions"),o.k0s()()(),o.j41(38,"figure",19),o.nrm(39,"i",20),o.k0s()()()()()(),o.j41(40,"div",9)(41,"a",23)(42,"div",11)(43,"div",12)(44,"article",13)(45,"figure",14)(46,"p",15),o.nrm(47,"img",24),o.k0s()(),o.j41(48,"div",17)(49,"div",3)(50,"p",18),o.EFF(51," Stuck ? "),o.k0s(),o.j41(52,"p"),o.EFF(53,"Get help from the community on our Discord"),o.k0s()()(),o.j41(54,"figure",19),o.nrm(55,"i",20),o.k0s()()()()()()())}function Ve(q,pt){if(1&q&&(o.j41(0,"div",26)(1,"a",27)(2,"div",28)(3,"div",12)(4,"article",13)(5,"div",17)(6,"div",3)(7,"p",18)(8,"span"),o.EFF(9),o.nI1(10,"capitalizeFirstLetter"),o.k0s()()()(),o.j41(11,"figure",19),o.nrm(12,"i",20),o.k0s()()()()()()),2&q){const K=pt.$implicit;o.R7$(),o.Y8G("routerLink",o.eq3(4,we,K.slug)),o.R7$(8),o.JRh(o.bMT(10,2,K.namePlural))}}function je(q,pt){if(1&q&&(o.j41(0,"div",0)(1,"div",7),o.nrm(2,"hr"),o.j41(3,"p",8),o.EFF(4," Start navigating through your collections "),o.k0s()(),o.DNE(5,Ve,13,6,"div",25),o.k0s()),2&q){const K=o.XpG(2);o.R7$(5),o.Y8G("ngForOf",K.collections)}}function Ye(q,pt){if(1&q&&(o.j41(0,"div",26)(1,"a",27)(2,"div",28)(3,"div",12)(4,"article",13)(5,"div",17)(6,"div",3)(7,"p",18)(8,"span"),o.EFF(9),o.nI1(10,"capitalizeFirstLetter"),o.k0s()()()(),o.j41(11,"figure",19),o.nrm(12,"i",20),o.k0s()()()()()()),2&q){const K=pt.$implicit;o.R7$(),o.Y8G("routerLink",o.eq3(4,Ge,K.slug)),o.R7$(8),o.JRh(o.bMT(10,2,K.nameSingular))}}function it(q,pt){if(1&q&&(o.j41(0,"div",0)(1,"div",7),o.nrm(2,"hr"),o.j41(3,"p",8),o.EFF(4," Edit your single entities "),o.k0s()(),o.DNE(5,Ye,13,6,"div",25),o.k0s()),2&q){const K=o.XpG(2);o.R7$(5),o.Y8G("ngForOf",K.singles)}}function et(q,pt){if(1&q&&(o.j41(0,"div",3)(1,"h1"),o.EFF(2),o.k0s(),o.j41(3,"p",4),o.EFF(4," Proudly built with "),o.j41(5,"a",5),o.EFF(6,"Manifest"),o.k0s(),o.EFF(7,". "),o.k0s(),o.j41(8,"div"),o.DNE(9,Ke,56,0,"div",6)(10,je,6,1,"div",6)(11,it,6,1,"div",6),o.k0s()()),2&q){const K=o.XpG();o.R7$(2),o.JRh(K.appManifest.name),o.R7$(7),o.Y8G("ngIf",!K.appManifest.production),o.R7$(),o.Y8G("ngIf",null==K.collections?null:K.collections.length),o.R7$(),o.Y8G("ngIf",null==K.singles?null:K.singles.length)}}const ke=[{path:"",component:(()=>{class q{constructor(K,ge){this.manifestService=K,this.metaService=ge}ngOnInit(){this.manifestService.getManifest().then(K=>{this.appManifest=K,this.collections=Object.values(K.entities||{}).filter(ge=>!ge.single),this.singles=Object.values(K.entities||{}).filter(ge=>ge.single),this.metaService.setTitle("Admin panel")})}static{this.\u0275fac=function(ge){return new(ge||q)(o.rXU(Dt.x),o.rXU(Ze.R))}}static{this.\u0275cmp=o.VBU({type:q,selectors:[["app-home"]],decls:3,vars:1,consts:[[1,"columns","is-multiline"],[1,"column","is-10-tablet","is-offset-1-tablet","is-8-widescreen","is-offset-2-widescreen","is-6-fullhd","is-offset-3-fullhd"],["class","content",4,"ngIf"],[1,"content"],[1,"is-size-5"],["href","https://manifest.build","target","_blank"],["class","columns is-multiline",4,"ngIf"],[1,"column","is-12","pb-0"],[1,"is-uppercase","has-text-dark","has-text-weight-medium"],[1,"column","is-12"],["href","https://manifest.build/docs","target","_blank",1,"card-link"],[1,"card","p-0","is-overflow-hidden","is-shadowless","is-bordered"],[1,"card-content","p-0"],[1,"media","is-flex","is-align-items-center"],[1,"media-left","m-0"],[1,"image","is-64x64"],["src","/assets/images/ext-link-01.svg"],[1,"media-content","is-flex","is-align-items-center","is-justify-content-flex-start","pl-4","is-fullheight"],[1,"is-size-5","has-text-weight-bold","mb-0"],[1,"media-right","my-0","ml-1","mr-4","is-inline-flex","is-justify-content-center"],[1,"icon","icon-arrow-right"],["href","https://github.com/mnfst/manifest/discussions/categories/feedback","target","_blank",1,"card-link"],["src","/assets/images/ext-link-gh.svg"],["href","https://discord.com/invite/FepAked3W7","target","_blank",1,"card-link"],["src","/assets/images/ext-link-dc.svg"],["class","column is-6",4,"ngFor","ngForOf"],[1,"column","is-6"],["routerLinkActive","is-active",1,"card-link",3,"routerLink"],[1,"card","p-0","is-overflow-hidden","is-shadowless","is-bordered","is-entity-link"]],template:function(ge,We){1&ge&&(o.j41(0,"div",0)(1,"div",1),o.DNE(2,et,12,4,"div",2),o.k0s()()),2&ge&&(o.R7$(2),o.Y8G("ngIf",We.appManifest))},dependencies:[W.Sq,W.bT,ve.Wk,ve.wQ,Oe.X],styles:['@import"https://fonts.googleapis.com/css?family=Rubik:300,400,400i,500";.is-entity-link[_ngcontent-%COMP%]{height:64px;display:flex;align-items:center}.card-link[_ngcontent-%COMP%]{border-color:#dddde2;transition:border-color .54s cubic-bezier(.165,.84,.44,1)}.card-link[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:before{display:none}.card-link[_ngcontent-%COMP%]:hover .card[_ngcontent-%COMP%]{transition:border-color .54s cubic-bezier(.165,.84,.44,1);color:#000;border-color:#39393c}']})}}return q})(),canActivate:[Pe]},{path:"auth",loadChildren:()=>Promise.resolve().then(I.bind(I,4783)).then(q=>q.AuthModule)},{path:"collections",loadChildren:()=>Promise.all([I.e(69),I.e(45)]).then(I.bind(I,4045)).then(q=>q.CrudCollectionModule),canActivate:[Pe],data:{mode:"collection"}},{path:"singles",loadChildren:()=>Promise.all([I.e(69),I.e(693)]).then(I.bind(I,8693)).then(q=>q.CrudSingleModule),canActivate:[Pe]},{path:"404",component:lt,canActivate:[Pe]},{path:"**",redirectTo:"/404"}];let vn=(()=>{class q{static{this.\u0275fac=function(ge){return new(ge||q)}}static{this.\u0275mod=o.$C({type:q})}static{this.\u0275inj=o.G2t({imports:[ve.iI.forRoot(ke),ve.iI]})}}return q})();var Ie=I(7906);function Xe(q,pt){if(1&q&&(o.j41(0,"div",1)(1,"p",2),o.EFF(2),o.k0s()()),2&q){const K=o.XpG();o.Y8G("ngClass",K.flashMessage.className),o.R7$(2),o.JRh(K.flashMessage.message)}}let vt=(()=>{class q{constructor(K){this.flashMessageService=K}ngOnInit(){this.flashMessageService.flashMessage.subscribe(K=>{this.flashMessage=K})}static{this.\u0275fac=function(ge){return new(ge||q)(o.rXU(He.L))}}static{this.\u0275cmp=o.VBU({type:q,selectors:[["app-flash-message"]],decls:1,vars:1,consts:[["class","flash-messages notification",3,"ngClass",4,"ngIf"],[1,"flash-messages","notification",3,"ngClass"],[1,"is-size-5"]],template:function(ge,We){1&ge&&o.DNE(0,Xe,3,2,"div",0),2&ge&&o.Y8G("ngIf",We.flashMessage)},dependencies:[W.YU,W.bT]})}}return q})();var Tt=I(4534);const Fn=q=>({"is-active":q});function ne(q,pt){if(1&q&&(o.j41(0,"span",9)(1,"strong"),o.EFF(2),o.k0s()()),2&q){const K=o.XpG();o.R7$(2),o.JRh(K.currentUser.email)}}let re=(()=>{class q{constructor(K,ge){this.authService=K,this.elementRef=ge,this.showUserMenu=!1}ngOnInit(){this.authService.currentUser$.pipe((0,Tt.p)(K=>!!K)).subscribe(K=>{this.currentUser=K})}onClick(K){this.elementRef.nativeElement.contains(K)||(this.showUserMenu=!1)}static{this.\u0275fac=function(ge){return new(ge||q)(o.rXU(Ie.u),o.rXU(o.aKT))}}static{this.\u0275cmp=o.VBU({type:q,selectors:[["app-user-menu-item"]],hostBindings:function(ge,We){1&ge&&o.bIt("click",function(Ct){return We.onClick(Ct.target)},!1,o.EBC)},decls:10,vars:4,consts:[[1,"is-flex","is-align-items-center","is-justify-content-flex-start"],[1,"dropdown","is-up",3,"ngClass"],[1,"dropdown-trigger"],[1,"is-flex","is-align-items-center","is-justify-content-flex-start",3,"click"],["src","/assets/images/avatar-default.svg","title","currentUser.name","alt","currentUser.name",1,"avatar"],["class","dropdown-item pr-0",4,"ngIf"],["role","menu",1,"dropdown-menu","is-small"],[1,"dropdown-content"],["routerLink","/auth/logout",1,"dropdown-item",3,"click"],[1,"dropdown-item","pr-0"]],template:function(ge,We){1&ge&&(o.nrm(0,"div",0),o.j41(1,"div",1)(2,"div",2)(3,"a",3),o.bIt("click",function(){return We.showUserMenu=!We.showUserMenu}),o.nrm(4,"img",4),o.DNE(5,ne,3,1,"span",5),o.k0s()(),o.j41(6,"div",6)(7,"div",7)(8,"a",8),o.bIt("click",function(){return We.showUserMenu=!1}),o.EFF(9," Sign out "),o.k0s()()()()),2&ge&&(o.R7$(),o.Y8G("ngClass",o.eq3(2,Fn,We.showUserMenu)),o.R7$(4),o.Y8G("ngIf",We.currentUser))},dependencies:[W.YU,W.bT,ve.Wk],styles:['@import"https://fonts.googleapis.com/css?family=Rubik:300,400,400i,500";.dropdown-trigger[_ngcontent-%COMP%]{max-width:100%;min-width:100%}@media screen and (max-width: 1023px){.dropdown-trigger[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]{width:100%;height:100%;display:inline-flex;box-sizing:content-box;align-items:center;justify-content:center;margin-right:32px}}@media screen and (max-width: 767px){.dropdown-trigger[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]{margin-right:30px}}.dropdown[_ngcontent-%COMP%]{max-width:100%;min-width:100%}.dropdown-item[_ngcontent-%COMP%]{white-space:nowrap;text-overflow:ellipsis;width:100%;overflow:hidden}.avatar[_ngcontent-%COMP%]{border-radius:6px}']})}}return q})();const ue=q=>["/singles",q],ee=q=>["/collections",q];function Me(q,pt){if(1&q&&(o.j41(0,"li")(1,"a",14)(2,"span"),o.EFF(3),o.nI1(4,"capitalizeFirstLetter"),o.k0s()()()),2&q){const K=pt.$implicit;o.R7$(),o.Y8G("routerLink",o.eq3(4,ue,K.slug)),o.R7$(2),o.JRh(o.bMT(4,2,K.nameSingular))}}function Te(q,pt){if(1&q&&(o.qex(0),o.DNE(1,Me,5,6,"li",13),o.nrm(2,"hr"),o.bVm()),2&q){const K=o.XpG();o.R7$(),o.Y8G("ngForOf",K.singles)}}function nt(q,pt){1&q&&o.nrm(0,"i",16)}function xt(q,pt){1&q&&o.nrm(0,"i",17)}function Zt(q,pt){if(1&q&&(o.j41(0,"li")(1,"a",14)(2,"span"),o.EFF(3),o.nI1(4,"capitalizeFirstLetter"),o.k0s()()()),2&q){const K=pt.$implicit;o.R7$(),o.Y8G("routerLink",o.eq3(4,ee,K.slug)),o.R7$(2),o.JRh(o.bMT(4,2,K.namePlural))}}function dt(q,pt){1&q&&(o.j41(0,"li")(1,"a",18)(2,"span"),o.EFF(3,"No collection yet"),o.k0s()()())}function Ut(q,pt){if(1&q&&(o.j41(0,"ul"),o.DNE(1,Zt,5,6,"li",13)(2,dt,4,0,"li",5),o.k0s()),2&q){const K=o.XpG(2);o.R7$(),o.Y8G("ngForOf",K.collections),o.R7$(),o.Y8G("ngIf",0===K.collections.length)}}function qe(q,pt){if(1&q){const K=o.RV6();o.j41(0,"li")(1,"a",6),o.bIt("click",function(){o.eBV(K);const We=o.XpG();return o.Njj(We.isCollectionsOpen=!We.isCollectionsOpen)}),o.j41(2,"span",7),o.nrm(3,"i",15),o.j41(4,"span",9),o.EFF(5,"Collections"),o.k0s()(),o.DNE(6,nt,1,0,"i",10)(7,xt,1,0,"i",11),o.k0s(),o.DNE(8,Ut,3,2,"ul",5),o.k0s()}if(2&q){const K=o.XpG();o.R7$(6),o.Y8G("ngIf",!K.isCollectionsOpen),o.R7$(),o.Y8G("ngIf",K.isCollectionsOpen),o.R7$(),o.Y8G("ngIf",K.isCollectionsOpen)}}function cn(q,pt){1&q&&o.nrm(0,"i",16)}function Bt(q,pt){1&q&&o.nrm(0,"i",17)}function Pt(q,pt){1&q&&(o.j41(0,"ul")(1,"li")(2,"a",19),o.EFF(3,"Admins"),o.k0s()()())}function on(q,pt){1&q&&(o.j41(0,"div",20)(1,"div",21)(2,"div",22)(3,"div",23)(4,"p",24)(5,"span",25),o.EFF(6,"\u{1f469}\u200d\u{1f4bb} Be one of 50 developers"),o.k0s(),o.EFF(7," for a quick video call and shape the product with your insights! "),o.k0s(),o.j41(8,"a",26),o.EFF(9,"Get involved"),o.k0s()()()()())}let Ne=(()=>{class q{constructor(K){this.manifestService=K,this.isCollectionsOpen=!1,this.isSettingsOpen=!1}ngOnInit(){this.manifestService.getManifest().then(K=>{this.production=K.production,this.collections=Object.values(K.entities||{}).filter(ge=>ge.className!==Q.Xw).filter(ge=>!ge.single),this.singles=Object.values(K.entities||{}).filter(ge=>ge.single)})}static{this.\u0275fac=function(ge){return new(ge||q)(o.rXU(Dt.x))}}static{this.\u0275cmp=o.VBU({type:q,selectors:[["app-side-menu"]],decls:19,vars:6,consts:[[1,"side-menu-wrapper","is-flex","is-flex-direction-column","is-justify-content-space-between"],[1,"logo-wrapper","is-hidden-touch"],["routerLink","/",1,"logo"],["src","/assets/images/logo.svg","width","155",1,"logo--image"],[1,"menu-list"],[4,"ngIf"],[1,"has-submenu","is-flex","is-justify-content-space-between",3,"click"],[1,"is-inline-flex","is-align-items-center","is-justify-content-space-between"],[1,"icon","mr-2","icon-sliders","is-size-4"],[1,"pl-1"],["class","icon icon-chevron-down",4,"ngIf"],["class","icon icon-chevron-up",4,"ngIf"],["class","ad",4,"ngIf"],[4,"ngFor","ngForOf"],["routerLinkActive","is-active",3,"routerLink"],[1,"icon","mr-2","icon-database","is-size-4"],[1,"icon","icon-chevron-down"],[1,"icon","icon-chevron-up"],[1,"has-background-white-bis","has-text-grey",2,"pointer-events","none"],["routerLink","/collections/admins"],[1,"ad"],[1,"card","is-bordered","is-shadowless","has-background-primary"],[1,"card-content","is-size-6"],[1,"content"],[1,"subtitle","is-5","has-text-light"],[1,"has-text-weight-bold"],["href","https://forms.gle/yKgUTYhuEacgx8i26","target","_blank",1,"button","is-white","is-outlined"]],template:function(ge,We){1&ge&&(o.j41(0,"div",0)(1,"div",1)(2,"a",2),o.nrm(3,"img",3),o.k0s()(),o.j41(4,"ul",4),o.DNE(5,Te,3,1,"ng-container",5)(6,qe,9,3,"li",5),o.nrm(7,"hr"),o.j41(8,"li")(9,"a",6),o.bIt("click",function(){return We.isSettingsOpen=!We.isSettingsOpen}),o.j41(10,"span",7),o.nrm(11,"i",8),o.j41(12,"span",9),o.EFF(13,"Settings"),o.k0s()(),o.DNE(14,cn,1,0,"i",10)(15,Bt,1,0,"i",11),o.k0s(),o.DNE(16,Pt,4,0,"ul",5),o.k0s()(),o.DNE(17,on,10,0,"div",12),o.nrm(18,"app-user-menu-item"),o.k0s()),2&ge&&(o.R7$(5),o.Y8G("ngIf",null==We.singles?null:We.singles.length),o.R7$(),o.Y8G("ngIf",We.collections),o.R7$(8),o.Y8G("ngIf",!We.isSettingsOpen),o.R7$(),o.Y8G("ngIf",We.isSettingsOpen),o.R7$(),o.Y8G("ngIf",We.isSettingsOpen),o.R7$(),o.Y8G("ngIf",!1===We.production))},dependencies:[W.Sq,W.bT,ve.Wk,ve.wQ,re,Oe.X],styles:['@import"https://fonts.googleapis.com/css?family=Rubik:300,400,400i,500";.menu-list[_ngcontent-%COMP%] a.is-active[_ngcontent-%COMP%], .menu-list[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{background-color:#f5f7f9;color:#000}.menu-list[_ngcontent-%COMP%]{--logo-height: 94px;--footer-height: 54px;--margin: 16px;scrollbar-width:none;padding-top:var(--margin);padding-bottom:var(--margin);margin-bottom:var(--footer-height);overflow-y:overlay;overflow-x:hidden}@media screen and (min-width: 1024px){.menu-list[_ngcontent-%COMP%]{height:calc(100vh - var(--logo-height) - var(--footer-height) + 1px - 220px)}}@media screen and (max-width: 1023px){.menu-list[_ngcontent-%COMP%]{height:calc(100vh - 8rem - var(--footer-height) + 1px - 220px)}}.menu-list[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{position:relative;display:inline-block;width:100%;font-size:1.5rem;padding:1px 8px}.menu-list[_ngcontent-%COMP%] li[_ngcontent-%COMP%] ul[_ngcontent-%COMP%]{margin:5px 0 0;border-left:0;padding-left:0}.menu-list[_ngcontent-%COMP%] li[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{padding:0}.menu-list[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{border-radius:6px;position:relative;color:#303032;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;align-items:center;justify-content:flex-start;width:100%;min-height:36px;line-height:36px;padding:0 16px;transition:color .35s ease,background-color .05s ease-out}.menu-list[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{transition:color .35s ease,background-color .05s ease-in}.menu-list[_ngcontent-%COMP%] a.is-active[_ngcontent-%COMP%]:before{background-color:#39393c}.menu-list[_ngcontent-%COMP%] a.logo[_ngcontent-%COMP%]{display:flex;align-items:center;height:98px;justify-content:flex-start}.logo-wrapper[_ngcontent-%COMP%]{padding:1.6rem;border-bottom:1px solid #eaeaef}.flex[_ngcontent-%COMP%]{display:flex}app-user-menu-item[_ngcontent-%COMP%]{border-top:1px solid #eaeaef;border-right:1px solid #eaeaef;z-index:99;padding:8px}@media screen and (min-width: 769px),print{app-user-menu-item[_ngcontent-%COMP%]{position:fixed;bottom:0}}.side-menu-wrapper[_ngcontent-%COMP%]{height:100%}']})}}return q})();const Et=q=>({"is-open":q});let yn=(()=>{class q{constructor(K,ge){this.renderer=K,this.isOpen=!1,ge.events.subscribe(We=>{We instanceof ve.wF&&(this.isOpen=!1)})}toggleMenu(){this.isOpen?(this.isOpen=!1,this.renderer.removeClass(document.querySelector("html"),"is-clipped")):(this.isOpen=!0,this.renderer.addClass(document.querySelector("html"),"is-clipped"))}static{this.\u0275fac=function(ge){return new(ge||q)(o.rXU(o.sFG),o.rXU(ve.Ix))}}static{this.\u0275cmp=o.VBU({type:q,selectors:[["app-touch-menu"]],decls:12,vars:3,consts:[["role","navigation","aria-label","main navigation",1,"navbar",3,"ngClass"],[1,"navbar-wrapper","is-flex","is-align-items-center","is-justify-content-space-between","is-flex-direction-row-reverse","is-fullheight"],["routerLink","/",1,"logo","is-flex","is-align-items-center","is-justify-content-center","px-0"],["src","/assets/images/logo.svg","width","180",1,"logo-image"],["role","button",1,"navbar-burger","burger","ml-0",3,"click"],["aria-hidden","true"],[1,"hiding-layer",3,"click"],["id","create-dropdown",1,"navbar-menu"],[1,"navbar-end"]],template:function(ge,We){1&ge&&(o.j41(0,"nav",0)(1,"div",1)(2,"a",2),o.nrm(3,"img",3),o.k0s(),o.j41(4,"a",4),o.bIt("click",function(){return We.toggleMenu()}),o.nrm(5,"span",5)(6,"span",5)(7,"span",5),o.k0s()(),o.j41(8,"div",6),o.bIt("click",function(){return We.toggleMenu()}),o.k0s(),o.j41(9,"div",7)(10,"div",8),o.nrm(11,"app-side-menu"),o.k0s()()()),2&ge&&o.Y8G("ngClass",o.eq3(1,Et,We.isOpen))},dependencies:[W.YU,ve.Wk,Ne],styles:['@import"https://fonts.googleapis.com/css?family=Rubik:300,400,400i,500";nav.navbar[_ngcontent-%COMP%]{position:relative;z-index:9;height:8rem;width:100vw;background-color:#fff}nav.navbar[_ngcontent-%COMP%]:before{position:absolute;content:"";top:0;z-index:-1;height:100%;width:100%;border-bottom:1px solid rgba(48,48,50,.1)}@media screen and (min-width: 769px),print{nav.navbar[_ngcontent-%COMP%]:before{left:0;width:100%}}nav.navbar[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%]{margin-right:8rem}nav.navbar[_ngcontent-%COMP%] .navbar-burger[_ngcontent-%COMP%]{height:8rem;width:8rem;min-width:8rem;color:#303032}@media screen and (min-width: 769px),print{nav.navbar[_ngcontent-%COMP%] .navbar-burger[_ngcontent-%COMP%]{width:8rem}}nav.navbar[_ngcontent-%COMP%] .navbar-burger[_ngcontent-%COMP%]:hover{background-color:transparent;color:#303032}.navbar-item[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-height:unset}.buttons[_ngcontent-%COMP%]{padding-right:110px}.dropdown-menu.is-small[_ngcontent-%COMP%]{border:1px solid #eaeaef}.navbar-menu[_ngcontent-%COMP%]{display:block;height:calc(100vh - 8rem);width:260px;position:absolute;top:8rem;left:-261px;z-index:99999;opacity:0;box-shadow:1px 0 #ffffff1a;padding-bottom:0;background-color:#fff;transition:all .16s cubic-bezier(.53,.25,.75,.5)}@media screen and (max-width: 768px){.navbar-menu[_ngcontent-%COMP%]{width:100vw;left:-100vw}}.is-open[_ngcontent-%COMP%] .navbar-menu[_ngcontent-%COMP%]{left:0;opacity:1;transition:all .16s cubic-bezier(.25,.53,.42,.71)}.navbar-end[_ngcontent-%COMP%]{height:100%;display:flex;flex-direction:column;justify-content:space-between}.hiding-layer[_ngcontent-%COMP%]{display:block;position:absolute;top:8rem;left:0;width:100vw;opacity:0;z-index:9999;visibility:hidden;height:calc(100vh - 8rem);background:#303032;transition:opacity .16s ease-in-out,visibility .01s linear .16s}.is-open[_ngcontent-%COMP%] .hiding-layer[_ngcontent-%COMP%]{opacity:.2;visibility:visible;transition:opacity .16s ease-in-out .01s,visibility .01s linear}app-side-menu[_ngcontent-%COMP%]{height:100%}']})}}return q})();function ar(q,pt){1&q&&(o.qex(0),o.nrm(1,"app-touch-menu",5),o.bVm())}function Fr(q,pt){1&q&&(o.j41(0,"aside",6),o.nrm(1,"app-side-menu"),o.k0s())}let vr=(()=>{class q{constructor(K,ge){this.authService=K,this.router=ge,this.isLogin=!0}ngOnInit(){this.router.events.subscribe(K=>{K instanceof ve.wF&&(window.scrollTo(0,0),this.isLogin=K.url.includes("/auth/login")||K.url.includes("/auth/welcome"),this.currentUserSubscription=this.authService.currentUser$.subscribe(ge=>{!ge&&localStorage.getItem(Q.il)&&this.authService.loadCurrentUser().subscribe()}))})}ngOnDestroy(){this.currentUserSubscription&&this.currentUserSubscription.unsubscribe()}static{this.\u0275fac=function(ge){return new(ge||q)(o.rXU(Ie.u),o.rXU(ve.Ix))}}static{this.\u0275cmp=o.VBU({type:q,selectors:[["app-root"]],decls:8,vars:2,consts:[[4,"ngIf"],[1,"wrapper"],[1,"columns"],["class","column aside menu px-0 is-hidden-touch",4,"ngIf"],[1,"column","main"],[1,"is-hidden-desktop"],[1,"column","aside","menu","px-0","is-hidden-touch"]],template:function(ge,We){1&ge&&(o.DNE(0,ar,2,0,"ng-container",0),o.nrm(1,"app-flash-message"),o.j41(2,"div",1)(3,"div",2),o.DNE(4,Fr,2,0,"aside",3),o.j41(5,"div",4)(6,"main"),o.nrm(7,"router-outlet"),o.k0s()()()()),2&ge&&(o.Y8G("ngIf",!We.isLogin),o.R7$(4),o.Y8G("ngIf",!We.isLogin))},dependencies:[W.bT,ve.n3,vt,Ne,yn],encapsulation:2})}}return q})();var kn=I(4783),ft=I(8023);let wt=(()=>{class q{static{this.\u0275fac=function(ge){return new(ge||q)}}static{this.\u0275mod=o.$C({type:q})}static{this.\u0275inj=o.G2t({imports:[W.MD,ve.iI,ft.G]})}}return q})(),Xn=(()=>{class q{static{this.\u0275fac=function(ge){return new(ge||q)}}static{this.\u0275mod=o.$C({type:q,bootstrap:[vr]})}static{this.\u0275inj=o.G2t({imports:[h.Bb,xe.forRoot({config:{tokenGetter:()=>localStorage.getItem(Q.il),allowedDomains:["localhost:1111"]}}),vn,ft.G,wt,kn.AuthModule]})}}return q})();h.sG().bootstrapModule(Xn).catch(q=>console.error(q))},7563:(Je,he,I)=>{function J(Q){if("many-to-one"===Q.type)return Q.name+"Id";if("many-to-many"===Q.type)return Q.name.endsWith("s")?Q.name.slice(0,-1)+"Ids":Q.name+"Id";throw new Error("Unknown relationship")}function de(Q){return Object.keys(Q).reduce((ve,He)=>{const Pe=Q?.[He],Ze=Q?.[ve];return void 0!==Pe?.width&&void 0!==Ze?.width&&Pe.width<Ze.width?He:ve})}I.d(he,{yk:()=>J,Gj:()=>de}),I(5442)},5442:(Je,he,I)=>{I.d(he,{Kk:()=>h});var h=function(T){return T.String="string",T.Text="text",T.RichText="richText",T.Number="number",T.Link="link",T.Money="money",T.Date="date",T.Timestamp="timestamp",T.Email="email",T.Boolean="boolean",T.Password="password",T.Choice="choice",T.Location="location",T.File="file",T.Image="image",T}(h||{})},2410:(Je,he,I)=>{I.d(he,{t:()=>o});var h=I(1087);class o extends h.B{constructor(X){super(),this._value=X}get value(){return this.getValue()}_subscribe(X){const T=super._subscribe(X);return!T.closed&&X.next(this._value),T}getValue(){const{hasError:X,thrownError:T,_value:pe}=this;if(X)throw T;return this._throwIfClosed(),pe}next(X){super.next(this._value=X)}}},7787:(Je,he,I)=>{I.d(he,{c:()=>fe});var h=I(3173),o=I(7233),W=I(1852),X=I(9493),T=I(2904),pe=I(2097),J=I(7112);let fe=(()=>{class _e{constructor(Q){Q&&(this._subscribe=Q)}lift(Q){const ve=new _e;return ve.source=this,ve.operator=Q,ve}subscribe(Q,ve,He){const Pe=function oe(_e){return _e&&_e instanceof h.vU||function de(_e){return _e&&(0,pe.T)(_e.next)&&(0,pe.T)(_e.error)&&(0,pe.T)(_e.complete)}(_e)&&(0,o.Uv)(_e)}(Q)?Q:new h.Ms(Q,ve,He);return(0,J.Y)(()=>{const{operator:Ze,source:lt}=this;Pe.add(Ze?Ze.call(Pe,lt):lt?this._subscribe(Pe):this._trySubscribe(Pe))}),Pe}_trySubscribe(Q){try{return this._subscribe(Q)}catch(ve){Q.error(ve)}}forEach(Q,ve){return new(ve=le(ve))((He,Pe)=>{const Ze=new h.Ms({next:lt=>{try{Q(lt)}catch(Dt){Pe(Dt),Ze.unsubscribe()}},error:Pe,complete:He});this.subscribe(Ze)})}_subscribe(Q){var ve;return null===(ve=this.source)||void 0===ve?void 0:ve.subscribe(Q)}[W.s](){return this}pipe(...Q){return(0,X.m)(Q)(this)}toPromise(Q){return new(Q=le(Q))((ve,He)=>{let Pe;this.subscribe(Ze=>Pe=Ze,Ze=>He(Ze),()=>ve(Pe))})}}return _e.create=xe=>new _e(xe),_e})();function le(_e){var xe;return null!==(xe=_e??T.$.Promise)&&void 0!==xe?xe:Promise}},1087:(Je,he,I)=>{I.d(he,{B:()=>J});var h=I(7787),o=I(7233);const X=(0,I(1531).L)(le=>function(){le(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"});var T=I(2070),pe=I(7112);let J=(()=>{class le extends h.c{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(oe){const _e=new fe(this,this);return _e.operator=oe,_e}_throwIfClosed(){if(this.closed)throw new X}next(oe){(0,pe.Y)(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(const _e of this.currentObservers)_e.next(oe)}})}error(oe){(0,pe.Y)(()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=oe;const{observers:_e}=this;for(;_e.length;)_e.shift().error(oe)}})}complete(){(0,pe.Y)(()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;const{observers:oe}=this;for(;oe.length;)oe.shift().complete()}})}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var oe;return(null===(oe=this.observers)||void 0===oe?void 0:oe.length)>0}_trySubscribe(oe){return this._throwIfClosed(),super._trySubscribe(oe)}_subscribe(oe){return this._throwIfClosed(),this._checkFinalizedStatuses(oe),this._innerSubscribe(oe)}_innerSubscribe(oe){const{hasError:_e,isStopped:xe,observers:Q}=this;return _e||xe?o.Kn:(this.currentObservers=null,Q.push(oe),new o.yU(()=>{this.currentObservers=null,(0,T.o)(Q,oe)}))}_checkFinalizedStatuses(oe){const{hasError:_e,thrownError:xe,isStopped:Q}=this;_e?oe.error(xe):Q&&oe.complete()}asObservable(){const oe=new h.c;return oe.source=this,oe}}return le.create=(de,oe)=>new fe(de,oe),le})();class fe extends J{constructor(de,oe){super(),this.destination=de,this.source=oe}next(de){var oe,_e;null===(_e=null===(oe=this.destination)||void 0===oe?void 0:oe.next)||void 0===_e||_e.call(oe,de)}error(de){var oe,_e;null===(_e=null===(oe=this.destination)||void 0===oe?void 0:oe.error)||void 0===_e||_e.call(oe,de)}complete(){var de,oe;null===(oe=null===(de=this.destination)||void 0===de?void 0:de.complete)||void 0===oe||oe.call(de)}_subscribe(de){var oe,_e;return null!==(_e=null===(oe=this.source)||void 0===oe?void 0:oe.subscribe(de))&&void 0!==_e?_e:o.Kn}}},3173:(Je,he,I)=>{I.d(he,{Ms:()=>He,vU:()=>_e});var h=I(2097),o=I(7233),W=I(2904),X=I(8508),T=I(9405);const pe=le("C",void 0,void 0);function le(Oe,we,Ge){return{kind:Oe,value:we,error:Ge}}var de=I(7680),oe=I(7112);class _e extends o.yU{constructor(we){super(),this.isStopped=!1,we?(this.destination=we,(0,o.Uv)(we)&&we.add(this)):this.destination=Dt}static create(we,Ge,Ke){return new He(we,Ge,Ke)}next(we){this.isStopped?lt(function fe(Oe){return le("N",Oe,void 0)}(we),this):this._next(we)}error(we){this.isStopped?lt(function J(Oe){return le("E",void 0,Oe)}(we),this):(this.isStopped=!0,this._error(we))}complete(){this.isStopped?lt(pe,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(we){this.destination.next(we)}_error(we){try{this.destination.error(we)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}}const xe=Function.prototype.bind;function Q(Oe,we){return xe.call(Oe,we)}class ve{constructor(we){this.partialObserver=we}next(we){const{partialObserver:Ge}=this;if(Ge.next)try{Ge.next(we)}catch(Ke){Pe(Ke)}}error(we){const{partialObserver:Ge}=this;if(Ge.error)try{Ge.error(we)}catch(Ke){Pe(Ke)}else Pe(we)}complete(){const{partialObserver:we}=this;if(we.complete)try{we.complete()}catch(Ge){Pe(Ge)}}}class He extends _e{constructor(we,Ge,Ke){let Ve;if(super(),(0,h.T)(we)||!we)Ve={next:we??void 0,error:Ge??void 0,complete:Ke??void 0};else{let je;this&&W.$.useDeprecatedNextContext?(je=Object.create(we),je.unsubscribe=()=>this.unsubscribe(),Ve={next:we.next&&Q(we.next,je),error:we.error&&Q(we.error,je),complete:we.complete&&Q(we.complete,je)}):Ve=we}this.destination=new ve(Ve)}}function Pe(Oe){W.$.useDeprecatedSynchronousErrorHandling?(0,oe.l)(Oe):(0,X.m)(Oe)}function lt(Oe,we){const{onStoppedNotification:Ge}=W.$;Ge&&de.f.setTimeout(()=>Ge(Oe,we))}const Dt={closed:!0,next:T.l,error:function Ze(Oe){throw Oe},complete:T.l}},7233:(Je,he,I)=>{I.d(he,{Kn:()=>pe,yU:()=>T,Uv:()=>J});var h=I(2097);const W=(0,I(1531).L)(le=>function(oe){le(this),this.message=oe?`${oe.length} errors occurred during unsubscription:\n${oe.map((_e,xe)=>`${xe+1}) ${_e.toString()}`).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=oe});var X=I(2070);class T{constructor(de){this.initialTeardown=de,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let de;if(!this.closed){this.closed=!0;const{_parentage:oe}=this;if(oe)if(this._parentage=null,Array.isArray(oe))for(const Q of oe)Q.remove(this);else oe.remove(this);const{initialTeardown:_e}=this;if((0,h.T)(_e))try{_e()}catch(Q){de=Q instanceof W?Q.errors:[Q]}const{_finalizers:xe}=this;if(xe){this._finalizers=null;for(const Q of xe)try{fe(Q)}catch(ve){de=de??[],ve instanceof W?de=[...de,...ve.errors]:de.push(ve)}}if(de)throw new W(de)}}add(de){var oe;if(de&&de!==this)if(this.closed)fe(de);else{if(de instanceof T){if(de.closed||de._hasParent(this))return;de._addParent(this)}(this._finalizers=null!==(oe=this._finalizers)&&void 0!==oe?oe:[]).push(de)}}_hasParent(de){const{_parentage:oe}=this;return oe===de||Array.isArray(oe)&&oe.includes(de)}_addParent(de){const{_parentage:oe}=this;this._parentage=Array.isArray(oe)?(oe.push(de),oe):oe?[oe,de]:de}_removeParent(de){const{_parentage:oe}=this;oe===de?this._parentage=null:Array.isArray(oe)&&(0,X.o)(oe,de)}remove(de){const{_finalizers:oe}=this;oe&&(0,X.o)(oe,de),de instanceof T&&de._removeParent(this)}}T.EMPTY=(()=>{const le=new T;return le.closed=!0,le})();const pe=T.EMPTY;function J(le){return le instanceof T||le&&"closed"in le&&(0,h.T)(le.remove)&&(0,h.T)(le.add)&&(0,h.T)(le.unsubscribe)}function fe(le){(0,h.T)(le)?le():le.unsubscribe()}},2904:(Je,he,I)=>{I.d(he,{$:()=>h});const h={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1}},8033:(Je,he,I)=>{I.d(he,{_:()=>W});var h=I(4392),o=I(3173);function W(X,T){const pe="object"==typeof T;return new Promise((J,fe)=>{const le=new o.Ms({next:de=>{J(de),le.unsubscribe()},error:fe,complete:()=>{pe?J(T.defaultValue):fe(new h.G)}});X.subscribe(le)})}},4782:(Je,he,I)=>{I.d(he,{z:()=>de});var h=I(7787),o=I(4047),W=I(4850),X=I(3867),T=I(7236),pe=I(1315),J=I(8746),fe=I(5510),le=I(1203);function de(...xe){const Q=(0,pe.lI)(xe),ve=(0,pe.ms)(xe),{args:He,keys:Pe}=(0,o.D)(xe);if(0===He.length)return(0,W.H)([],Q);const Ze=new h.c(function oe(xe,Q,ve=X.D){return He=>{_e(Q,()=>{const{length:Pe}=xe,Ze=new Array(Pe);let lt=Pe,Dt=Pe;for(let Oe=0;Oe<Pe;Oe++)_e(Q,()=>{const we=(0,W.H)(xe[Oe],Q);let Ge=!1;we.subscribe((0,fe._)(He,Ke=>{Ze[Oe]=Ke,Ge||(Ge=!0,Dt--),Dt||He.next(ve(Ze.slice()))},()=>{--lt||He.complete()}))},He)},He)}}(He,Q,Pe?lt=>(0,J.e)(Pe,lt):X.D));return ve?Ze.pipe((0,T.I)(ve)):Ze}function _e(xe,Q,ve){xe?(0,le.N)(ve,xe,Q):Q()}},6852:(Je,he,I)=>{I.d(he,{v:()=>W});var h=I(7787),o=I(7412);function W(X){return new h.c(T=>{(0,o.Tg)(X()).subscribe(T)})}},4850:(Je,he,I)=>{I.d(he,{H:()=>Ke});var h=I(7412),o=I(1203),W=I(1524),X=I(5510);function T(Ve,je=0){return(0,W.N)((Ye,it)=>{Ye.subscribe((0,X._)(it,et=>(0,o.N)(it,Ve,()=>it.next(et),je),()=>(0,o.N)(it,Ve,()=>it.complete(),je),et=>(0,o.N)(it,Ve,()=>it.error(et),je)))})}function pe(Ve,je=0){return(0,W.N)((Ye,it)=>{it.add(Ve.schedule(()=>Ye.subscribe(it),je))})}var le=I(7787),oe=I(979),_e=I(2097);function Q(Ve,je){if(!Ve)throw new Error("Iterable cannot be null");return new le.c(Ye=>{(0,o.N)(Ye,je,()=>{const it=Ve[Symbol.asyncIterator]();(0,o.N)(Ye,je,()=>{it.next().then(et=>{et.done?Ye.complete():Ye.next(et.value)})},0,!0)})})}var ve=I(9533),He=I(4760),Pe=I(5271),Ze=I(8419),lt=I(1391),Dt=I(3985),Oe=I(8030);function Ke(Ve,je){return je?function Ge(Ve,je){if(null!=Ve){if((0,ve.l)(Ve))return function J(Ve,je){return(0,h.Tg)(Ve).pipe(pe(je),T(je))}(Ve,je);if((0,Pe.X)(Ve))return function de(Ve,je){return new le.c(Ye=>{let it=0;return je.schedule(function(){it===Ve.length?Ye.complete():(Ye.next(Ve[it++]),Ye.closed||this.schedule())})})}(Ve,je);if((0,He.y)(Ve))return function fe(Ve,je){return(0,h.Tg)(Ve).pipe(pe(je),T(je))}(Ve,je);if((0,lt.T)(Ve))return Q(Ve,je);if((0,Ze.x)(Ve))return function xe(Ve,je){return new le.c(Ye=>{let it;return(0,o.N)(Ye,je,()=>{it=Ve[oe.l](),(0,o.N)(Ye,je,()=>{let et,tn;try{({value:et,done:tn}=it.next())}catch(ke){return void Ye.error(ke)}tn?Ye.complete():Ye.next(et)},0,!0)}),()=>(0,_e.T)(it?.return)&&it.return()})}(Ve,je);if((0,Oe.U)(Ve))return function we(Ve,je){return Q((0,Oe.C)(Ve),je)}(Ve,je)}throw(0,Dt.L)(Ve)}(Ve,je):(0,h.Tg)(Ve)}},7412:(Je,he,I)=>{I.d(he,{Tg:()=>xe});var h=I(5823),o=I(5271),W=I(4760),X=I(7787),T=I(9533),pe=I(1391),J=I(3985),fe=I(8419),le=I(8030),de=I(2097),oe=I(8508),_e=I(1852);function xe(Oe){if(Oe instanceof X.c)return Oe;if(null!=Oe){if((0,T.l)(Oe))return function Q(Oe){return new X.c(we=>{const Ge=Oe[_e.s]();if((0,de.T)(Ge.subscribe))return Ge.subscribe(we);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}(Oe);if((0,o.X)(Oe))return function ve(Oe){return new X.c(we=>{for(let Ge=0;Ge<Oe.length&&!we.closed;Ge++)we.next(Oe[Ge]);we.complete()})}(Oe);if((0,W.y)(Oe))return function He(Oe){return new X.c(we=>{Oe.then(Ge=>{we.closed||(we.next(Ge),we.complete())},Ge=>we.error(Ge)).then(null,oe.m)})}(Oe);if((0,pe.T)(Oe))return Ze(Oe);if((0,fe.x)(Oe))return function Pe(Oe){return new X.c(we=>{for(const Ge of Oe)if(we.next(Ge),we.closed)return;we.complete()})}(Oe);if((0,le.U)(Oe))return function lt(Oe){return Ze((0,le.C)(Oe))}(Oe)}throw(0,J.L)(Oe)}function Ze(Oe){return new X.c(we=>{(function Dt(Oe,we){var Ge,Ke,Ve,je;return(0,h.sH)(this,void 0,void 0,function*(){try{for(Ge=(0,h.xN)(Oe);!(Ke=yield Ge.next()).done;)if(we.next(Ke.value),we.closed)return}catch(Ye){Ve={error:Ye}}finally{try{Ke&&!Ke.done&&(je=Ge.return)&&(yield je.call(Ge))}finally{if(Ve)throw Ve.error}}we.complete()})})(Oe,we).catch(Ge=>we.error(Ge))})}},1467:(Je,he,I)=>{I.d(he,{of:()=>W});var h=I(1315),o=I(4850);function W(...X){const T=(0,h.lI)(X);return(0,o.H)(X,T)}},1968:(Je,he,I)=>{I.d(he,{$:()=>W});var h=I(7787),o=I(2097);function W(X,T){const pe=(0,o.T)(X)?X:()=>X,J=fe=>fe.error(pe());return new h.c(T?fe=>T.schedule(J,0,fe):J)}},5510:(Je,he,I)=>{I.d(he,{_:()=>o});var h=I(3173);function o(X,T,pe,J,fe){return new W(X,T,pe,J,fe)}class W extends h.vU{constructor(T,pe,J,fe,le,de){super(T),this.onFinalize=le,this.shouldUnsubscribe=de,this._next=pe?function(oe){try{pe(oe)}catch(_e){T.error(_e)}}:super._next,this._error=fe?function(oe){try{fe(oe)}catch(_e){T.error(_e)}finally{this.unsubscribe()}}:super._error,this._complete=J?function(){try{J()}catch(oe){T.error(oe)}finally{this.unsubscribe()}}:super._complete}unsubscribe(){var T;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){const{closed:pe}=this;super.unsubscribe(),!pe&&(null===(T=this.onFinalize)||void 0===T||T.call(this))}}}},8919:(Je,he,I)=>{I.d(he,{W:()=>X});var h=I(7412),o=I(5510),W=I(1524);function X(T){return(0,W.N)((pe,J)=>{let de,fe=null,le=!1;fe=pe.subscribe((0,o._)(J,void 0,void 0,oe=>{de=(0,h.Tg)(T(oe,X(T)(pe))),fe?(fe.unsubscribe(),fe=null,de.subscribe(J)):le=!0})),le&&(fe.unsubscribe(),fe=null,de.subscribe(J))})}},6944:(Je,he,I)=>{I.d(he,{H:()=>W});var h=I(3575),o=I(2097);function W(X,T){return(0,o.T)(T)?(0,h.Z)(X,T,1):(0,h.Z)(X,1)}},4534:(Je,he,I)=>{I.d(he,{p:()=>W});var h=I(1524),o=I(5510);function W(X,T){return(0,h.N)((pe,J)=>{let fe=0;pe.subscribe((0,o._)(J,le=>X.call(T,le,fe++)&&J.next(le)))})}},1554:(Je,he,I)=>{I.d(he,{j:()=>o});var h=I(1524);function o(W){return(0,h.N)((X,T)=>{try{X.subscribe(T)}finally{T.add(W)}})}},2816:(Je,he,I)=>{I.d(he,{T:()=>W});var h=I(1524),o=I(5510);function W(X,T){return(0,h.N)((pe,J)=>{let fe=0;pe.subscribe((0,o._)(J,le=>{J.next(X.call(T,le,fe++))}))})}},3575:(Je,he,I)=>{I.d(he,{Z:()=>fe});var h=I(2816),o=I(7412),W=I(1524),X=I(1203),T=I(5510),J=I(2097);function fe(le,de,oe=1/0){return(0,J.T)(de)?fe((_e,xe)=>(0,h.T)((Q,ve)=>de(_e,Q,xe,ve))((0,o.Tg)(le(_e,xe))),oe):("number"==typeof de&&(oe=de),(0,W.N)((_e,xe)=>function pe(le,de,oe,_e,xe,Q,ve,He){const Pe=[];let Ze=0,lt=0,Dt=!1;const Oe=()=>{Dt&&!Pe.length&&!Ze&&de.complete()},we=Ke=>Ze<_e?Ge(Ke):Pe.push(Ke),Ge=Ke=>{Q&&de.next(Ke),Ze++;let Ve=!1;(0,o.Tg)(oe(Ke,lt++)).subscribe((0,T._)(de,je=>{xe?.(je),Q?we(je):de.next(je)},()=>{Ve=!0},void 0,()=>{if(Ve)try{for(Ze--;Pe.length&&Ze<_e;){const je=Pe.shift();ve?(0,X.N)(de,ve,()=>Ge(je)):Ge(je)}Oe()}catch(je){de.error(je)}}))};return le.subscribe((0,T._)(de,we,()=>{Dt=!0,Oe()})),()=>{He?.()}}(_e,xe,le,oe)))}},8128:(Je,he,I)=>{I.d(he,{n:()=>X});var h=I(7412),o=I(1524),W=I(5510);function X(T,pe){return(0,o.N)((J,fe)=>{let le=null,de=0,oe=!1;const _e=()=>oe&&!le&&fe.complete();J.subscribe((0,W._)(fe,xe=>{le?.unsubscribe();let Q=0;const ve=de++;(0,h.Tg)(T(xe,ve)).subscribe(le=(0,W._)(fe,He=>fe.next(pe?pe(xe,He,ve,Q++):He),()=>{le=null,_e()}))},()=>{oe=!0,_e()}))})}},5719:(Je,he,I)=>{I.d(he,{Q:()=>T});var h=I(1524),o=I(5510),W=I(7412),X=I(9405);function T(pe){return(0,h.N)((J,fe)=>{(0,W.Tg)(pe).subscribe((0,o._)(fe,()=>fe.complete(),X.l)),!fe.closed&&J.subscribe(fe)})}},6243:(Je,he,I)=>{I.d(he,{M:()=>T});var h=I(2097),o=I(1524),W=I(5510),X=I(3867);function T(pe,J,fe){const le=(0,h.T)(pe)||J||fe?{next:pe,error:J,complete:fe}:pe;return le?(0,o.N)((de,oe)=>{var _e;null===(_e=le.subscribe)||void 0===_e||_e.call(le);let xe=!0;de.subscribe((0,W._)(oe,Q=>{var ve;null===(ve=le.next)||void 0===ve||ve.call(le,Q),oe.next(Q)},()=>{var Q;xe=!1,null===(Q=le.complete)||void 0===Q||Q.call(le),oe.complete()},Q=>{var ve;xe=!1,null===(ve=le.error)||void 0===ve||ve.call(le,Q),oe.error(Q)},()=>{var Q,ve;xe&&(null===(Q=le.unsubscribe)||void 0===Q||Q.call(le)),null===(ve=le.finalize)||void 0===ve||ve.call(le)}))}):X.D}},7680:(Je,he,I)=>{I.d(he,{f:()=>h});const h={setTimeout(o,W,...X){const{delegate:T}=h;return T?.setTimeout?T.setTimeout(o,W,...X):setTimeout(o,W,...X)},clearTimeout(o){const{delegate:W}=h;return(W?.clearTimeout||clearTimeout)(o)},delegate:void 0}},979:(Je,he,I)=>{I.d(he,{l:()=>o});const o=function h(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}()},1852:(Je,he,I)=>{I.d(he,{s:()=>h});const h="function"==typeof Symbol&&Symbol.observable||"@@observable"},4392:(Je,he,I)=>{I.d(he,{G:()=>o});const o=(0,I(1531).L)(W=>function(){W(this),this.name="EmptyError",this.message="no elements in sequence"})},1315:(Je,he,I)=>{I.d(he,{ms:()=>X,lI:()=>T});var h=I(2097);function W(J){return J[J.length-1]}function X(J){return(0,h.T)(W(J))?J.pop():void 0}function T(J){return function o(J){return J&&(0,h.T)(J.schedule)}(W(J))?J.pop():void 0}},4047:(Je,he,I)=>{I.d(he,{D:()=>T});const{isArray:h}=Array,{getPrototypeOf:o,prototype:W,keys:X}=Object;function T(J){if(1===J.length){const fe=J[0];if(h(fe))return{args:fe,keys:null};if(function pe(J){return J&&"object"==typeof J&&o(J)===W}(fe)){const le=X(fe);return{args:le.map(de=>fe[de]),keys:le}}}return{args:J,keys:null}}},2070:(Je,he,I)=>{function h(o,W){if(o){const X=o.indexOf(W);0<=X&&o.splice(X,1)}}I.d(he,{o:()=>h})},1531:(Je,he,I)=>{function h(o){const X=o(T=>{Error.call(T),T.stack=(new Error).stack});return X.prototype=Object.create(Error.prototype),X.prototype.constructor=X,X}I.d(he,{L:()=>h})},8746:(Je,he,I)=>{function h(o,W){return o.reduce((X,T,pe)=>(X[T]=W[pe],X),{})}I.d(he,{e:()=>h})},7112:(Je,he,I)=>{I.d(he,{Y:()=>W,l:()=>X});var h=I(2904);let o=null;function W(T){if(h.$.useDeprecatedSynchronousErrorHandling){const pe=!o;if(pe&&(o={errorThrown:!1,error:null}),T(),pe){const{errorThrown:J,error:fe}=o;if(o=null,J)throw fe}}else T()}function X(T){h.$.useDeprecatedSynchronousErrorHandling&&o&&(o.errorThrown=!0,o.error=T)}},1203:(Je,he,I)=>{function h(o,W,X,T=0,pe=!1){const J=W.schedule(function(){X(),pe?o.add(this.schedule(null,T)):this.unsubscribe()},T);if(o.add(J),!pe)return J}I.d(he,{N:()=>h})},3867:(Je,he,I)=>{function h(o){return o}I.d(he,{D:()=>h})},5271:(Je,he,I)=>{I.d(he,{X:()=>h});const h=o=>o&&"number"==typeof o.length&&"function"!=typeof o},1391:(Je,he,I)=>{I.d(he,{T:()=>o});var h=I(2097);function o(W){return Symbol.asyncIterator&&(0,h.T)(W?.[Symbol.asyncIterator])}},2097:(Je,he,I)=>{function h(o){return"function"==typeof o}I.d(he,{T:()=>h})},9533:(Je,he,I)=>{I.d(he,{l:()=>W});var h=I(1852),o=I(2097);function W(X){return(0,o.T)(X[h.s])}},8419:(Je,he,I)=>{I.d(he,{x:()=>W});var h=I(979),o=I(2097);function W(X){return(0,o.T)(X?.[h.l])}},7624:(Je,he,I)=>{I.d(he,{A:()=>W});var h=I(7787),o=I(2097);function W(X){return!!X&&(X instanceof h.c||(0,o.T)(X.lift)&&(0,o.T)(X.subscribe))}},4760:(Je,he,I)=>{I.d(he,{y:()=>o});var h=I(2097);function o(W){return(0,h.T)(W?.then)}},8030:(Je,he,I)=>{I.d(he,{C:()=>W,U:()=>X});var h=I(5823),o=I(2097);function W(T){return(0,h.AQ)(this,arguments,function*(){const J=T.getReader();try{for(;;){const{value:fe,done:le}=yield(0,h.N3)(J.read());if(le)return yield(0,h.N3)(void 0);yield yield(0,h.N3)(fe)}}finally{J.releaseLock()}})}function X(T){return(0,o.T)(T?.getReader)}},1524:(Je,he,I)=>{I.d(he,{N:()=>W,S:()=>o});var h=I(2097);function o(X){return(0,h.T)(X?.lift)}function W(X){return T=>{if(o(T))return T.lift(function(pe){try{return X(pe,this)}catch(J){this.error(J)}});throw new TypeError("Unable to lift unknown Observable type")}}},7236:(Je,he,I)=>{I.d(he,{I:()=>X});var h=I(2816);const{isArray:o}=Array;function X(T){return(0,h.T)(pe=>function W(T,pe){return o(pe)?T(...pe):T(pe)}(T,pe))}},9405:(Je,he,I)=>{function h(){}I.d(he,{l:()=>h})},9493:(Je,he,I)=>{I.d(he,{F:()=>o,m:()=>W});var h=I(3867);function o(...X){return W(X)}function W(X){return 0===X.length?h.D:1===X.length?X[0]:function(pe){return X.reduce((J,fe)=>fe(J),pe)}}},8508:(Je,he,I)=>{I.d(he,{m:()=>W});var h=I(2904),o=I(7680);function W(X){o.f.setTimeout(()=>{const{onUnhandledError:T}=h.$;if(!T)throw X;T(X)})}},3985:(Je,he,I)=>{function h(o){return new TypeError(`You provided ${null!==o&&"object"==typeof o?"an invalid object":`'${o}'`} where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}I.d(he,{L:()=>h})},2943:(Je,he,I)=>{I.d(he,{AJ:()=>rt,IJ:()=>jn,MD:()=>Se,N0:()=>Oi,QT:()=>W,Qn:()=>Ne,Sm:()=>He,Sq:()=>ot,VF:()=>T,Vy:()=>Bn,WO:()=>Gn,Xr:()=>Ai,YU:()=>ce,ZD:()=>X,_b:()=>V,aZ:()=>Ze,bT:()=>Wt,fw:()=>Pe,hb:()=>Q,hj:()=>le,oe:()=>te,pM:()=>ot,qQ:()=>J,vh:()=>Or});var h=I(8284);
|
|
6
|
+
*/function $e(R){R||((0,o.Af3)($e),R=(0,o.WQX)(o.abz));const te=new $.c(C=>R.onDestroy(C.next.bind(C)));return C=>C.pipe((0,Ee.Q)(te))}var Mn=I(6852),yr=I(7624),Mi=I(7233),Vi=I(7412),Tn=I(3575),at=I(5271),Ar=I(2097),Cr=I(7236);const kr=["addListener","removeListener"],Lr=["addEventListener","removeEventListener"],br=["on","off"];function Mt(R,te,C,S){if((0,Ar.T)(C)&&(S=C,C=void 0),S)return Mt(R,te,C).pipe((0,Cr.I)(S));const[O,z]=function ur(R){return(0,Ar.T)(R.addEventListener)&&(0,Ar.T)(R.removeEventListener)}(R)?Lr.map(Se=>rt=>R[Se](te,rt,C)):function Vr(R){return(0,Ar.T)(R.addListener)&&(0,Ar.T)(R.removeListener)}(R)?kr.map(Yr(R,te)):function _r(R){return(0,Ar.T)(R.on)&&(0,Ar.T)(R.off)}(R)?br.map(Yr(R,te)):[];if(!O&&(0,at.X)(R))return(0,Tn.Z)(Se=>Mt(Se,te,C))((0,Vi.Tg)(R));if(!O)throw new TypeError("Invalid event target");return new $.c(Se=>{const rt=(...Ot)=>Se.next(1<Ot.length?Ot:Ot[0]);return O(rt),()=>z(rt)})}function Yr(R,te){return C=>S=>R[C](te,S)}var cr=I(1087);const jr={now:()=>(jr.delegate||Date).now(),delegate:void 0};class Ur extends cr.B{constructor(te=1/0,C=1/0,S=jr){super(),this._bufferSize=te,this._windowTime=C,this._timestampProvider=S,this._buffer=[],this._infiniteTimeWindow=!0,this._infiniteTimeWindow=C===1/0,this._bufferSize=Math.max(1,te),this._windowTime=Math.max(1,C)}next(te){const{isStopped:C,_buffer:S,_infiniteTimeWindow:O,_timestampProvider:z,_windowTime:Se}=this;C||(S.push(te),!O&&S.push(z.now()+Se)),this._trimBuffer(),super.next(te)}_subscribe(te){this._throwIfClosed(),this._trimBuffer();const C=this._innerSubscribe(te),{_infiniteTimeWindow:S,_buffer:O}=this,z=O.slice();for(let Se=0;Se<z.length&&!te.closed;Se+=S?1:2)te.next(z[Se]);return this._checkFinalizedStatuses(te),C}_trimBuffer(){const{_bufferSize:te,_timestampProvider:C,_buffer:S,_infiniteTimeWindow:O}=this,z=(O?1:2)*te;if(te<1/0&&z<S.length&&S.splice(0,S.length-z),!O){const Se=C.now();let rt=0;for(let Ot=1;Ot<S.length&&S[Ot]<=Se;Ot+=2)rt=Ot;rt&&S.splice(0,rt+1)}}}var P=I(3173),V=I(1524);function me(R,te,...C){if(!0===te)return void R();if(!1===te)return;const S=new P.Ms({next:()=>{S.unsubscribe(),R()}});return(0,Vi.Tg)(te(...C)).subscribe(S)}class Fe extends Mi.yU{constructor(te,C){super()}schedule(te,C=0){return this}}const Le={setInterval(R,te,...C){const{delegate:S}=Le;return S?.setInterval?S.setInterval(R,te,...C):setInterval(R,te,...C)},clearInterval(R){const{delegate:te}=Le;return(te?.clearInterval||clearInterval)(R)},delegate:void 0};var yt=I(2070);class zt{constructor(te,C=zt.now){this.schedulerActionCtor=te,this.now=C}schedule(te,C=0,S){return new this.schedulerActionCtor(this,te).schedule(S,C)}}zt.now=jr.now;const Wt=new class En extends zt{constructor(te,C=zt.now){super(te,C),this.actions=[],this._active=!1}flush(te){const{actions:C}=this;if(this._active)return void C.push(te);let S;this._active=!0;do{if(S=te.execute(te.state,te.delay))break}while(te=C.shift());if(this._active=!1,S){for(;te=C.shift();)te.unsubscribe();throw S}}}(class ot extends Fe{constructor(te,C){super(te,C),this.scheduler=te,this.work=C,this.pending=!1}schedule(te,C=0){var S;if(this.closed)return this;this.state=te;const O=this.id,z=this.scheduler;return null!=O&&(this.id=this.recycleAsyncId(z,O,C)),this.pending=!0,this.delay=C,this.id=null!==(S=this.id)&&void 0!==S?S:this.requestAsyncId(z,this.id,C),this}requestAsyncId(te,C,S=0){return Le.setInterval(te.flush.bind(te,this),S)}recycleAsyncId(te,C,S=0){if(null!=S&&this.delay===S&&!1===this.pending)return C;null!=C&&Le.clearInterval(C)}execute(te,C){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;const S=this._execute(te,C);if(S)return S;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(te,C){let O,S=!1;try{this.work(te)}catch(z){S=!0,O=z||new Error("Scheduled action threw falsy error")}if(S)return this.unsubscribe(),O}unsubscribe(){if(!this.closed){const{id:te,scheduler:C}=this,{actions:S}=C;this.work=this.state=this.scheduler=null,this.pending=!1,(0,yt.o)(S,this),null!=te&&(this.id=this.recycleAsyncId(C,te,null)),this.delay=null,super.unsubscribe()}}});var Vn=I(5510);function ct(R,te=Wt){return(0,V.N)((C,S)=>{let O=null,z=null,Se=null;const rt=()=>{if(O){O.unsubscribe(),O=null;const an=z;z=null,S.next(an)}};function Ot(){const an=Se+R,Wn=te.now();if(Wn<an)return O=this.schedule(void 0,an-Wn),void S.add(O);rt()}C.subscribe((0,Vn._)(S,an=>{z=an,Se=te.now(),O||(O=te.schedule(Ot,R),S.add(O))},()=>{rt(),S.complete()},void 0,()=>{z=O=null}))})}const mt=[[["","above-quill-editor-toolbar",""]],[["","quill-editor-toolbar",""]],[["","below-quill-editor-toolbar",""]]],Ft=["[above-quill-editor-toolbar]","[quill-editor-toolbar]","[below-quill-editor-toolbar]"];function en(R,te){1&R&&o.nrm(0,"div",0)}function dn(R,te){1&R&&o.nrm(0,"div",0)}const Kt=(R,te)=>R||te||"html";let jn=(()=>{class R{constructor(C,S){var O=this;this.config=S,this.quill$=(0,Mn.v)((0,Oe.A)(function*(){if(!O.Quill){const z=O.document.addEventListener;O.document.addEventListener=O.document.__zone_symbol__addEventListener||O.document.addEventListener;const Se=yield I.e(256).then(I.bind(I,256));O.document.addEventListener=z,O.Quill=Se.default?.default??Se.default??Se}return O.config.customOptions?.forEach(z=>{const Se=O.Quill.import(z.import);Se.whitelist=z.whitelist,O.Quill.register(Se,!0,O.config.suppressGlobalRegisterWarning)}),yield O.registerCustomModules(O.Quill,O.config.customModules,O.config.suppressGlobalRegisterWarning)})).pipe(function ce(R,te,C){let S,O=!1;return R&&"object"==typeof R?({bufferSize:S=1/0,windowTime:te=1/0,refCount:O=!1,scheduler:C}=R):S=R??1/0,function j(R={}){const{connector:te=(()=>new cr.B),resetOnError:C=!0,resetOnComplete:S=!0,resetOnRefCountZero:O=!0}=R;return z=>{let Se,rt,Ot,an=0,Wn=!1,Rn=!1;const Bn=()=>{rt?.unsubscribe(),rt=void 0},Zn=()=>{Bn(),Se=Ot=void 0,Wn=Rn=!1},$r=()=>{const Jn=Se;Zn(),Jn?.unsubscribe()};return(0,V.N)((Jn,Ai)=>{an++,!Rn&&!Wn&&Bn();const bn=Ot=Ot??te();Ai.add(()=>{an--,0===an&&!Rn&&!Wn&&(rt=me($r,O))}),bn.subscribe(Ai),!Se&&an>0&&(Se=new P.Ms({next:$n=>bn.next($n),error:$n=>{Rn=!0,Bn(),rt=me(Zn,C,$n),bn.error($n)},complete:()=>{Wn=!0,Bn(),rt=me(Zn,S),bn.complete()}}),(0,Vi.Tg)(Jn).subscribe(Se))})(z)}}({connector:()=>new Ur(S,te,C),resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:O})}({bufferSize:1,refCount:!0})),this.document=C.get(h.qQ),this.config||(this.config={modules:Qr})}getQuill(){return this.quill$}registerCustomModules(C,S,O){return(0,Oe.A)(function*(){if(Array.isArray(S))for(let{implementation:z,path:Se}of S)(0,yr.A)(z)&&(z=yield(0,ar._)(z)),C.register(Se,z,O);return C})()}static{this.\u0275fac=function(S){return new(S||R)(o.KVO(o.zZn),o.KVO(Yn,8))}}static{this.\u0275prov=o.jDH({token:R,factory:R.\u0275fac,providedIn:"root"})}}return R})(),Gn=(()=>{class R{constructor(){this.format=(0,o.hFB)(void 0),this.theme=(0,o.hFB)(void 0),this.modules=(0,o.hFB)(void 0),this.debug=(0,o.hFB)(!1),this.readOnly=(0,o.hFB)(!1),this.placeholder=(0,o.hFB)(void 0),this.maxLength=(0,o.hFB)(void 0),this.minLength=(0,o.hFB)(void 0),this.required=(0,o.hFB)(!1),this.formats=(0,o.hFB)(void 0),this.customToolbarPosition=(0,o.hFB)("top"),this.sanitize=(0,o.hFB)(!1),this.beforeRender=(0,o.hFB)(void 0),this.styles=(0,o.hFB)(null),this.registry=(0,o.hFB)(void 0),this.bounds=(0,o.hFB)(void 0),this.customOptions=(0,o.hFB)([]),this.customModules=(0,o.hFB)([]),this.trackChanges=(0,o.hFB)(void 0),this.classes=(0,o.hFB)(void 0),this.trimOnValidation=(0,o.hFB)(!1),this.linkPlaceholder=(0,o.hFB)(void 0),this.compareValues=(0,o.hFB)(!1),this.filterNull=(0,o.hFB)(!1),this.debounceTime=(0,o.hFB)(void 0),this.defaultEmptyValue=(0,o.hFB)(null),this.onEditorCreated=new o.bkB,this.onEditorChanged=new o.bkB,this.onContentChanged=new o.bkB,this.onSelectionChanged=new o.bkB,this.onFocus=new o.bkB,this.onBlur=new o.bkB,this.onNativeFocus=new o.bkB,this.onNativeBlur=new o.bkB,this.disabled=!1,this.toolbarPosition=(0,o.vPA)("top"),this.subscription=null,this.quillSubscription=null,this.elementRef=(0,o.WQX)(o.aKT),this.document=(0,o.WQX)(h.qQ),this.cd=(0,o.WQX)(o.gRc),this.domSanitizer=(0,o.WQX)(F.up),this.platformId=(0,o.WQX)(o.Agw),this.renderer=(0,o.WQX)(o.sFG),this.zone=(0,o.WQX)(o.SKi),this.service=(0,o.WQX)(jn),this.destroyRef=(0,o.WQX)(o.abz),this.valueGetter=(0,o.hFB)(C=>{let S=C.getSemanticHTML();this.isEmptyValue(S)&&(S=this.defaultEmptyValue());let O=S;const z=Kt(this.format(),this.service.config.format);if("text"===z)O=C.getText();else if("object"===z)O=C.getContents();else if("json"===z)try{O=JSON.stringify(C.getContents())}catch{O=C.getText()}return O}),this.valueSetter=(0,o.hFB)((C,S)=>{const O=Kt(this.format(),this.service.config.format);if("html"===O)return([!0,!1].includes(this.sanitize())?this.sanitize():this.service.config.sanitize||!1)&&(S=this.domSanitizer.sanitize(o.WPN.HTML,S)),C.clipboard.convert({html:S});if("json"===O)try{return JSON.parse(S)}catch{return[{insert:S}]}return S}),this.selectionChangeHandler=(C,S,O)=>{const z=this.trackChanges()||this.service.config.trackChanges,Se=!C&&!!this.onModelTouched&&("user"===O||z&&"all"===z);!this.onBlur.observed&&!this.onFocus.observed&&!this.onSelectionChanged.observed&&!Se||this.zone.run(()=>{null===C?this.onBlur.emit({editor:this.quillEditor,source:O}):null===S&&this.onFocus.emit({editor:this.quillEditor,source:O}),this.onSelectionChanged.emit({editor:this.quillEditor,oldRange:S,range:C,source:O}),Se&&this.onModelTouched(),this.cd.markForCheck()})},this.textChangeHandler=(C,S,O)=>{const z=this.quillEditor.getText(),Se=this.quillEditor.getContents();let rt=this.quillEditor.getSemanticHTML();this.isEmptyValue(rt)&&(rt=this.defaultEmptyValue());const Ot=this.trackChanges()||this.service.config.trackChanges,an=("user"===O||Ot&&"all"===Ot)&&!!this.onModelChange;!this.onContentChanged.observed&&!an||this.zone.run(()=>{if(an){const Wn=this.valueGetter();this.onModelChange(Wn(this.quillEditor))}this.onContentChanged.emit({content:Se,delta:C,editor:this.quillEditor,html:rt,oldDelta:S,source:O,text:z}),this.cd.markForCheck()})},this.editorChangeHandler=(C,S,O,z)=>{if(this.onEditorChanged.observed)if("text-change"===C){const Se=this.quillEditor.getText(),rt=this.quillEditor.getContents();let Ot=this.quillEditor.getSemanticHTML();this.isEmptyValue(Ot)&&(Ot=this.defaultEmptyValue()),this.zone.run(()=>{this.onEditorChanged.emit({content:rt,delta:S,editor:this.quillEditor,event:C,html:Ot,oldDelta:O,source:z,text:Se}),this.cd.markForCheck()})}else this.zone.run(()=>{this.onEditorChanged.emit({editor:this.quillEditor,event:C,oldRange:O,range:S,source:z}),this.cd.markForCheck()})}}static normalizeClassNames(C){return C.trim().split(" ").reduce((O,z)=>{const Se=z.trim();return Se&&O.push(Se),O},[])}ngOnInit(){this.toolbarPosition.set(this.customToolbarPosition())}ngAfterViewInit(){(0,h.Vy)(this.platformId)||(this.quillSubscription=this.service.getQuill().pipe((0,Tn.Z)(C=>{const S=[this.service.registerCustomModules(C,this.customModules())],O=this.beforeRender()??this.service.config.beforeRender;return O&&S.push(O()),Promise.all(S).then(()=>C)})).subscribe(C=>{this.editorElem=this.elementRef.nativeElement.querySelector("[quill-editor-element]");const S=this.elementRef.nativeElement.querySelector("[quill-editor-toolbar]"),O=Object.assign({},this.modules()||this.service.config.modules);S?O.toolbar=S:void 0===O.toolbar&&(O.toolbar=Qr.toolbar);let z=void 0!==this.placeholder()?this.placeholder():this.service.config.placeholder;void 0===z&&(z="Insert text here ...");const Se=this.styles();Se&&Object.keys(Se).forEach(Bn=>{this.renderer.setStyle(this.editorElem,Bn,Se[Bn])}),this.classes()&&this.addClasses(this.classes()),this.customOptions().forEach(Bn=>{const Zn=C.import(Bn.import);Zn.whitelist=Bn.whitelist,C.register(Zn,!0)});let rt=this.bounds()&&"self"===this.bounds()?this.editorElem:this.bounds();rt||(rt=this.service.config.bounds?this.service.config.bounds:this.document.body);let Ot=this.debug();!Ot&&!1!==Ot&&this.service.config.debug&&(Ot=this.service.config.debug);let an=this.readOnly();!an&&!1!==this.readOnly()&&(an=void 0!==this.service.config.readOnly&&this.service.config.readOnly);let Wn=this.defaultEmptyValue;this.service.config.hasOwnProperty("defaultEmptyValue")&&(Wn=this.service.config.defaultEmptyValue);let Rn=this.formats();if(!Rn&&void 0===Rn&&(Rn=this.service.config.formats?[...this.service.config.formats]:null===this.service.config.formats?null:void 0),this.zone.runOutsideAngular(()=>{if(this.quillEditor=new C(this.editorElem,{bounds:rt,debug:Ot,formats:Rn,modules:O,placeholder:z,readOnly:an,defaultEmptyValue:Wn,registry:this.registry(),theme:this.theme()||(this.service.config.theme?this.service.config.theme:"snow")}),this.onNativeBlur.observed&&(this.quillEditor.scroll.domNode.addEventListener("blur",()=>this.onNativeBlur.next({editor:this.quillEditor,source:"dom"})),this.quillEditor.getModule("toolbar").container?.addEventListener("mousedown",Zn=>Zn.preventDefault())),this.onNativeFocus.observed&&this.quillEditor.scroll.domNode.addEventListener("focus",()=>this.onNativeFocus.next({editor:this.quillEditor,source:"dom"})),this.linkPlaceholder()){const Zn=this.quillEditor?.theme?.tooltip?.root?.querySelector("input[data-link]");Zn?.dataset&&(Zn.dataset.link=this.linkPlaceholder())}}),this.content){if("text"===Kt(this.format(),this.service.config.format))this.quillEditor.setText(this.content,"silent");else{const Jn=this.valueSetter()(this.quillEditor,this.content);this.quillEditor.setContents(Jn,"silent")}this.quillEditor.getModule("history").clear()}this.setDisabledState(),this.addQuillEventListeners(),(this.onEditorCreated.observed||this.onValidatorChanged)&&new $.c(R=>{const te=requestAnimationFrame(()=>{R.next(),R.complete()});return()=>cancelAnimationFrame(te)}).pipe($e(this.destroyRef)).subscribe(()=>{this.onValidatorChanged&&this.onValidatorChanged(),this.onEditorCreated.emit(this.quillEditor)})}))}ngOnDestroy(){this.dispose(),this.quillSubscription?.unsubscribe(),this.quillSubscription=null}ngOnChanges(C){if(this.quillEditor){if(C.readOnly&&this.quillEditor.enable(!C.readOnly.currentValue),C.placeholder&&(this.quillEditor.root.dataset.placeholder=C.placeholder.currentValue),C.defaultEmptyValue&&(this.quillEditor.root.dataset.defaultEmptyValue=C.defaultEmptyValue.currentValue),C.styles){const S=C.styles.currentValue,O=C.styles.previousValue;O&&Object.keys(O).forEach(z=>{this.renderer.removeStyle(this.editorElem,z)}),S&&Object.keys(S).forEach(z=>{this.renderer.setStyle(this.editorElem,z,this.styles()[z])})}if(C.classes){const S=C.classes.currentValue,O=C.classes.previousValue;O&&this.removeClasses(O),S&&this.addClasses(S)}C.debounceTime&&this.addQuillEventListeners()}}addClasses(C){R.normalizeClassNames(C).forEach(S=>{this.renderer.addClass(this.editorElem,S)})}removeClasses(C){R.normalizeClassNames(C).forEach(S=>{this.renderer.removeClass(this.editorElem,S)})}writeValue(C){if(this.filterNull()&&null===C||(this.content=C,!this.quillEditor))return;const S=Kt(this.format(),this.service.config.format),z=this.valueSetter()(this.quillEditor,C);if(this.compareValues()){const Se=this.quillEditor.getContents();if(JSON.stringify(Se)===JSON.stringify(z))return}C?"text"===S?this.quillEditor.setText(C):this.quillEditor.setContents(z):this.quillEditor.setText("")}setDisabledState(C=this.disabled){this.disabled=C,this.quillEditor&&(C?(this.quillEditor.disable(),this.renderer.setAttribute(this.elementRef.nativeElement,"disabled","disabled")):(this.readOnly()||this.quillEditor.enable(),this.renderer.removeAttribute(this.elementRef.nativeElement,"disabled")))}registerOnChange(C){this.onModelChange=C}registerOnTouched(C){this.onModelTouched=C}registerOnValidatorChange(C){this.onValidatorChanged=C}validate(){if(!this.quillEditor)return null;const C={};let S=!0;const O=this.quillEditor.getText(),z=this.trimOnValidation()?O.trim().length:1===O.length&&0===O.trim().length?0:O.length-1,Se=this.quillEditor.getContents().ops,rt=!!Se&&1===Se.length&&["\n",""].includes(Se[0].insert?.toString());return this.minLength()&&z&&z<this.minLength()&&(C.minLengthError={given:z,minLength:this.minLength()},S=!1),this.maxLength()&&z>this.maxLength()&&(C.maxLengthError={given:z,maxLength:this.maxLength()},S=!1),this.required()&&!z&&rt&&(C.requiredError={empty:!0},S=!1),S?null:C}addQuillEventListeners(){this.dispose(),this.zone.runOutsideAngular(()=>{this.subscription=new Mi.yU,this.subscription.add(Mt(this.quillEditor,"selection-change").subscribe(([O,z,Se])=>{this.selectionChangeHandler(O,z,Se)}));let C=Mt(this.quillEditor,"text-change"),S=Mt(this.quillEditor,"editor-change");"number"==typeof this.debounceTime()&&(C=C.pipe(ct(this.debounceTime())),S=S.pipe(ct(this.debounceTime()))),this.subscription.add(C.subscribe(([O,z,Se])=>{this.textChangeHandler(O,z,Se)})),this.subscription.add(S.subscribe(([O,z,Se,rt])=>{this.editorChangeHandler(O,z,Se,rt)}))})}dispose(){null!==this.subscription&&(this.subscription.unsubscribe(),this.subscription=null)}isEmptyValue(C){return"<p></p>"===C||"<div></div>"===C||"<p><br></p>"===C||"<div><br></div>"===C}static{this.\u0275fac=function(S){return new(S||R)}}static{this.\u0275dir=o.FsC({type:R,inputs:{format:[o.Mj6.SignalBased,"format"],theme:[o.Mj6.SignalBased,"theme"],modules:[o.Mj6.SignalBased,"modules"],debug:[o.Mj6.SignalBased,"debug"],readOnly:[o.Mj6.SignalBased,"readOnly"],placeholder:[o.Mj6.SignalBased,"placeholder"],maxLength:[o.Mj6.SignalBased,"maxLength"],minLength:[o.Mj6.SignalBased,"minLength"],required:[o.Mj6.SignalBased,"required"],formats:[o.Mj6.SignalBased,"formats"],customToolbarPosition:[o.Mj6.SignalBased,"customToolbarPosition"],sanitize:[o.Mj6.SignalBased,"sanitize"],beforeRender:[o.Mj6.SignalBased,"beforeRender"],styles:[o.Mj6.SignalBased,"styles"],registry:[o.Mj6.SignalBased,"registry"],bounds:[o.Mj6.SignalBased,"bounds"],customOptions:[o.Mj6.SignalBased,"customOptions"],customModules:[o.Mj6.SignalBased,"customModules"],trackChanges:[o.Mj6.SignalBased,"trackChanges"],classes:[o.Mj6.SignalBased,"classes"],trimOnValidation:[o.Mj6.SignalBased,"trimOnValidation"],linkPlaceholder:[o.Mj6.SignalBased,"linkPlaceholder"],compareValues:[o.Mj6.SignalBased,"compareValues"],filterNull:[o.Mj6.SignalBased,"filterNull"],debounceTime:[o.Mj6.SignalBased,"debounceTime"],defaultEmptyValue:[o.Mj6.SignalBased,"defaultEmptyValue"],valueGetter:[o.Mj6.SignalBased,"valueGetter"],valueSetter:[o.Mj6.SignalBased,"valueSetter"]},outputs:{onEditorCreated:"onEditorCreated",onEditorChanged:"onEditorChanged",onContentChanged:"onContentChanged",onSelectionChanged:"onSelectionChanged",onFocus:"onFocus",onBlur:"onBlur",onNativeFocus:"onNativeFocus",onNativeBlur:"onNativeBlur"},features:[o.OA$]})}}return R})(),ht=(()=>{class R extends Gn{static{this.\u0275fac=(()=>{let C;return function(O){return(C||(C=o.xGo(R)))(O||R)}})()}static{this.\u0275cmp=o.VBU({type:R,selectors:[["quill-editor"]],standalone:!0,features:[o.Jv_([{multi:!0,provide:ee.kq,useExisting:(0,o.Rfq)(()=>R)},{multi:!0,provide:ee.cz,useExisting:(0,o.Rfq)(()=>R)}]),o.Vt3,o.aNF],ngContentSelectors:Ft,decls:5,vars:2,consts:[["quill-editor-element",""]],template:function(S,O){1&S&&(o.NAR(mt),o.DNE(0,en,1,0,"div",0),o.SdG(1),o.SdG(2,1),o.SdG(3,2),o.DNE(4,dn,1,0,"div",0)),2&S&&(o.vxM(0,"top"!==O.toolbarPosition()?0:-1),o.R7$(4),o.vxM(4,"top"===O.toolbarPosition()?4:-1))},styles:["[_nghost-%COMP%]{display:inline-block}"]})}}return R})(),Dr=(()=>{class R{static forRoot(C){return{ngModule:R,providers:[{provide:Yn,useValue:C}]}}static{this.\u0275fac=function(S){return new(S||R)}}static{this.\u0275mod=o.$C({type:R})}static{this.\u0275inj=o.G2t({})}}return R})();const Ji=R=>({"is-danger":R});let eo=(()=>{class R{constructor(C){this.formBuilder=C,this.valueChanged=new o.bkB,this.modules={toolbar:[["bold","italic","underline","strike"],["link","blockquote","code-block"],[{list:"ordered"},{list:"bullet"}],[{header:[1,2,3,4,5,6,!1]}]]}}ngOnInit(){this.form=this.formBuilder.group({editor:[this.value||""]}),this.form.valueChanges.subscribe(C=>{this.valueChanged.emit(C.editor)})}static{this.\u0275fac=function(S){return new(S||R)(o.rXU(ee.ok))}}static{this.\u0275cmp=o.VBU({type:R,selectors:[["app-rich-text-input"]],inputs:{prop:"prop",value:"value",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:5,vars:7,consts:[[3,"for"],[3,"formGroup"],[1,"control",3,"ngClass"],["placeholder","","formControlName","editor",3,"modules"]],template:function(S,O){1&S&&(o.j41(0,"label",0),o.EFF(1),o.k0s(),o.j41(2,"form",1)(3,"div",2),o.nrm(4,"quill-editor",3),o.k0s()()),2&S&&(o.Y8G("for",O.prop.name),o.R7$(),o.JRh(O.prop.name),o.R7$(),o.Y8G("formGroup",O.form),o.R7$(),o.Y8G("ngClass",o.eq3(5,Ji,O.isError)),o.R7$(),o.Y8G("modules",O.modules))},dependencies:[h.YU,Dr,ht,ee.X1,ee.qT,ee.BC,ee.cb,ee.j4,ee.JD],styles:['@import"https://fonts.googleapis.com/css?family=Rubik:300,400,400i,500";.control[_ngcontent-%COMP%]{min-height:200px}']})}}return R})();function to(R,te){if(1&R){const C=o.RV6();o.j41(0,"app-text-input",5),o.bIt("valueChanged",function(O){o.eBV(C);const z=o.XpG();return o.Njj(z.onChange(O))}),o.k0s()}if(2&R){const C=o.XpG();o.Y8G("prop",C.prop)("value",C.value)("isError",C.isError)}}function pi(R,te){if(1&R){const C=o.RV6();o.j41(0,"app-rich-text-input",5),o.bIt("valueChanged",function(O){o.eBV(C);const z=o.XpG();return o.Njj(z.onChange(O))}),o.k0s()}if(2&R){const C=o.XpG();o.Y8G("prop",C.prop)("value",C.value)("isError",C.isError)}}function kt(R,te){if(1&R){const C=o.RV6();o.j41(0,"app-number-input",5),o.bIt("valueChanged",function(O){o.eBV(C);const z=o.XpG();return o.Njj(z.onChange(O))}),o.k0s()}if(2&R){const C=o.XpG();o.Y8G("prop",C.prop)("value",C.value)("isError",C.isError)}}function gi(R,te){if(1&R){const C=o.RV6();o.j41(0,"app-url-input",5),o.bIt("valueChanged",function(O){o.eBV(C);const z=o.XpG();return o.Njj(z.onChange(O))}),o.k0s()}if(2&R){const C=o.XpG();o.Y8G("prop",C.prop)("value",C.value)("isError",C.isError)}}function ji(R,te){if(1&R){const C=o.RV6();o.j41(0,"app-textarea-input",5),o.bIt("valueChanged",function(O){o.eBV(C);const z=o.XpG();return o.Njj(z.onChange(O))}),o.k0s()}if(2&R){const C=o.XpG();o.Y8G("prop",C.prop)("value",C.value)("isError",C.isError)}}function Un(R,te){if(1&R){const C=o.RV6();o.j41(0,"app-select-input",6),o.bIt("valueChanged",function(O){o.eBV(C);const z=o.XpG();return o.Njj(z.onChange(O))}),o.k0s()}if(2&R){const C=o.XpG();o.Y8G("prop",C.prop)("relationship",C.relationship)("value",C.value)("isError",C.isError)}}function mi(R,te){if(1&R){const C=o.RV6();o.j41(0,"app-multi-select-input",6),o.bIt("valueChanged",function(O){o.eBV(C);const z=o.XpG();return o.Njj(z.onChange(O))}),o.k0s()}if(2&R){const C=o.XpG();o.Y8G("prop",C.prop)("relationship",C.relationship)("value",C.value)("isError",C.isError)}}function no(R,te){if(1&R){const C=o.RV6();o.j41(0,"app-currency-input",7),o.bIt("valueChanged",function(O){o.eBV(C);const z=o.XpG();return o.Njj(z.onChange(O))}),o.k0s()}if(2&R){const C=o.XpG();o.Y8G("prop",C.prop)("value",C.value)("currency",null==C.prop||null==C.prop.options?null:C.prop.options.currency)("isError",C.isError)}}function Wo(R,te){if(1&R){const C=o.RV6();o.j41(0,"app-boolean-input",5),o.bIt("valueChanged",function(O){o.eBV(C);const z=o.XpG();return o.Njj(z.onChange(O))}),o.k0s()}if(2&R){const C=o.XpG();o.Y8G("prop",C.prop)("value",C.value)("isError",C.isError)}}function Zr(R,te){if(1&R){const C=o.RV6();o.j41(0,"app-email-input",5),o.bIt("valueChanged",function(O){o.eBV(C);const z=o.XpG();return o.Njj(z.onChange(O))}),o.k0s()}if(2&R){const C=o.XpG();o.Y8G("prop",C.prop)("value",C.value)("isError",C.isError)}}function Or(R,te){if(1&R){const C=o.RV6();o.j41(0,"app-date-input",5),o.bIt("valueChanged",function(O){o.eBV(C);const z=o.XpG();return o.Njj(z.onChange(O))}),o.k0s()}if(2&R){const C=o.XpG();o.Y8G("prop",C.prop)("value",C.value)("isError",C.isError)}}function Jr(R,te){if(1&R){const C=o.RV6();o.j41(0,"app-timestamp-input",5),o.bIt("valueChanged",function(O){o.eBV(C);const z=o.XpG();return o.Njj(z.onChange(O))}),o.k0s()}if(2&R){const C=o.XpG();o.Y8G("prop",C.prop)("value",C.value)("isError",C.isError)}}function si(R,te){if(1&R){const C=o.RV6();o.j41(0,"app-password-input",5),o.bIt("valueChanged",function(O){o.eBV(C);const z=o.XpG();return o.Njj(z.onChange(O))}),o.k0s()}if(2&R){const C=o.XpG();o.Y8G("prop",C.prop)("value",C.value)("isError",C.isError)}}function Ti(R,te){if(1&R){const C=o.RV6();o.j41(0,"app-location-input",5),o.bIt("valueChanged",function(O){o.eBV(C);const z=o.XpG();return o.Njj(z.onChange(O))}),o.k0s()}if(2&R){const C=o.XpG();o.Y8G("prop",C.prop)("value",C.value)("isError",C.isError)}}function or(R,te){if(1&R){const C=o.RV6();o.j41(0,"app-file-input",8),o.bIt("valueChanged",function(O){o.eBV(C);const z=o.XpG();return o.Njj(z.onChange(O))}),o.k0s()}if(2&R){const C=o.XpG();o.Y8G("prop",C.prop)("entitySlug",C.entityManifest.slug)("value",C.value)("isError",C.isError)}}function Br(R,te){if(1&R){const C=o.RV6();o.j41(0,"app-image-input",8),o.bIt("valueChanged",function(O){o.eBV(C);const z=o.XpG();return o.Njj(z.onChange(O))}),o.k0s()}if(2&R){const C=o.XpG();o.Y8G("prop",C.prop)("entitySlug",C.entityManifest.slug)("value",C.value)("isError",C.isError)}}function Er(R,te){if(1&R&&(o.j41(0,"li",10),o.EFF(1),o.k0s()),2&R){const C=te.$implicit;o.R7$(),o.JRh(C)}}function Si(R,te){if(1&R&&(o.j41(0,"ul"),o.DNE(1,Er,2,1,"li",9),o.k0s()),2&R){const C=o.XpG();o.R7$(),o.Y8G("ngForOf",C.errors)}}let wr=(()=>{class R{constructor(){this.valueChanged=new o.bkB,this.PropType=W.Kk}onChange(C){this.valueChanged.emit(C)}ngOnChanges(){this.isError=!!this.errors?.length}static{this.\u0275fac=function(S){return new(S||R)}}static{this.\u0275cmp=o.VBU({type:R,selectors:[["app-input"]],inputs:{prop:"prop",entityManifest:"entityManifest",relationship:"relationship",value:"value",errors:"errors"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.OA$,o.aNF],decls:17,vars:17,consts:[[3,"prop","value","isError","valueChanged",4,"ngIf"],[3,"prop","relationship","value","isError","valueChanged",4,"ngIf"],[3,"prop","value","currency","isError","valueChanged",4,"ngIf"],[3,"prop","entitySlug","value","isError","valueChanged",4,"ngIf"],[4,"ngIf"],[3,"valueChanged","prop","value","isError"],[3,"valueChanged","prop","relationship","value","isError"],[3,"valueChanged","prop","value","currency","isError"],[3,"valueChanged","prop","entitySlug","value","isError"],["class","has-text-danger",4,"ngFor","ngForOf"],[1,"has-text-danger"]],template:function(S,O){1&S&&o.DNE(0,to,1,3,"app-text-input",0)(1,pi,1,3,"app-rich-text-input",0)(2,kt,1,3,"app-number-input",0)(3,gi,1,3,"app-url-input",0)(4,ji,1,3,"app-textarea-input",0)(5,Un,1,4,"app-select-input",1)(6,mi,1,4,"app-multi-select-input",1)(7,no,1,4,"app-currency-input",2)(8,Wo,1,3,"app-boolean-input",0)(9,Zr,1,3,"app-email-input",0)(10,Or,1,3,"app-date-input",0)(11,Jr,1,3,"app-timestamp-input",0)(12,si,1,3,"app-password-input",0)(13,Ti,1,3,"app-location-input",0)(14,or,1,4,"app-file-input",3)(15,Br,1,4,"app-image-input",3)(16,Si,2,1,"ul",4),2&S&&(o.Y8G("ngIf",(null==O.prop?null:O.prop.type)===O.PropType.String),o.R7$(),o.Y8G("ngIf",(null==O.prop?null:O.prop.type)===O.PropType.RichText),o.R7$(),o.Y8G("ngIf",(null==O.prop?null:O.prop.type)===O.PropType.Number),o.R7$(),o.Y8G("ngIf",(null==O.prop?null:O.prop.type)===O.PropType.Link),o.R7$(),o.Y8G("ngIf",(null==O.prop?null:O.prop.type)===O.PropType.Text),o.R7$(),o.Y8G("ngIf",(null==O.prop?null:O.prop.type)===O.PropType.Choice||"many-to-one"===(null==O.relationship?null:O.relationship.type)),o.R7$(),o.Y8G("ngIf","many-to-many"===(null==O.relationship?null:O.relationship.type)),o.R7$(),o.Y8G("ngIf",(null==O.prop?null:O.prop.type)===O.PropType.Money),o.R7$(),o.Y8G("ngIf",(null==O.prop?null:O.prop.type)===O.PropType.Boolean),o.R7$(),o.Y8G("ngIf",(null==O.prop?null:O.prop.type)===O.PropType.Email),o.R7$(),o.Y8G("ngIf",(null==O.prop?null:O.prop.type)===O.PropType.Date),o.R7$(),o.Y8G("ngIf",(null==O.prop?null:O.prop.type)===O.PropType.Timestamp),o.R7$(),o.Y8G("ngIf",(null==O.prop?null:O.prop.type)===O.PropType.Password),o.R7$(),o.Y8G("ngIf",(null==O.prop?null:O.prop.type)===O.PropType.Location),o.R7$(),o.Y8G("ngIf",(null==O.prop?null:O.prop.type)===O.PropType.File),o.R7$(),o.Y8G("ngIf",(null==O.prop?null:O.prop.type)===O.PropType.Image),o.R7$(),o.Y8G("ngIf",null==O.errors?null:O.errors.length))},dependencies:[h.MD,h.Sq,h.bT,J,de,xe,yn,He,on,Xe,Fn,ue,nt,cn,dt,Dt,We,oi,eo],encapsulation:2})}}return R})()},9e3:(Je,he,I)=>{I.d(he,{X:()=>o});var h=I(8284);let o=(()=>{class W{transform(T){return typeof T>"u"||null===T||""===T?"":T[0].toUpperCase()+T.substr(1).toLowerCase()}static{this.\u0275fac=function(pe){return new(pe||W)}}static{this.\u0275pipe=h.EJ8({name:"capitalizeFirstLetter",type:W,pure:!0,standalone:!0})}}return W})()},818:(Je,he,I)=>{I.d(he,{L:()=>W});var h=I(1087),o=I(8284);let W=(()=>{class X{constructor(){this.flashMessageTimeOut=5e3,this.flashMessage=new h.B}success(pe){this.flashMessage.next({message:pe,className:"notification is-success"}),this.clear()}error(pe){this.flashMessage.next({message:pe,className:"notification is-danger"}),this.clear()}warning(pe){this.flashMessage.next({message:pe,className:"notification is-warning"}),this.clear()}info(pe){this.flashMessage.next({message:pe,className:"notification is-info"}),this.clear()}clear(){setTimeout(()=>{this.flashMessage.next(null)},this.flashMessageTimeOut)}static{this.\u0275fac=function(J){return new(J||X)}}static{this.\u0275prov=o.jDH({token:X,factory:X.\u0275fac,providedIn:"root"})}}return X})()},2283:(Je,he,I)=>{I.d(he,{x:()=>le});var h=I(7431),o=I(8033),W=I(4534),X=I(8128),T=I(9606),pe=I(8284),J=I(7906),fe=I(5640);let le=(()=>{class de{constructor(_e,xe){this.authService=_e,this.http=xe,this.manifestPromise=null}getManifest(){return this.manifestPromise||(this.manifestPromise=(0,o._)(this.authService.currentUser$.pipe((0,W.p)(_e=>!!_e),(0,X.n)(()=>this.http.get(`${T.c.apiBaseUrl}/manifest`)))).catch(_e=>{throw this.manifestPromise=null,_e})),this.manifestPromise}getAppName(){var _e=this;return(0,h.A)(function*(){return(0,o._)(_e.http.get(`${T.c.apiBaseUrl}/manifest/app-name`)).then(xe=>xe.name).catch(xe=>{throw xe})})()}getEntityManifest(_e){var xe=this;return(0,h.A)(function*({slug:Q,className:ve}){if(!Q&&!ve)throw new Error("Either slug or className must be provided");return xe.manifestPromise?xe.manifestPromise.then(He=>Object.values(He.entities).find(Pe=>Pe.slug===Q||Pe.className===ve)):(0,o._)(xe.http.get(`${T.c.apiBaseUrl}/manifest/entities/${Q}`))}).apply(this,arguments)}static{this.\u0275fac=function(xe){return new(xe||de)(pe.KVO(J.u),pe.KVO(fe.Qq))}}static{this.\u0275prov=pe.jDH({token:de,factory:de.\u0275fac,providedIn:"root"})}}return de})()},9879:(Je,he,I)=>{I.d(he,{R:()=>X});var h=I(8284),o=I(2283),W=I(7711);let X=(()=>{class T{constructor(J,fe){this.title=fe,this.appName="Manifest",J.getManifest().then(le=>{this.appName=le.name})}setTitle(J){this.title.setTitle(`${J} | ${this.appName}`)}static{this.\u0275fac=function(fe){return new(fe||T)(h.KVO(o.x),h.KVO(W.hE))}}static{this.\u0275prov=h.jDH({token:T,factory:T.\u0275fac,providedIn:"root"})}}return T})()},8023:(Je,he,I)=>{I.d(he,{G:()=>pe});var h=I(2943),o=I(5640),W=I(8428),X=I(818),T=I(8284);let pe=(()=>{class J{static{this.\u0275fac=function(de){return new(de||J)}}static{this.\u0275mod=T.$C({type:J})}static{this.\u0275inj=T.G2t({providers:[X.L],imports:[h.MD,o.q1,W.S]})}}return J})()},4385:(Je,he,I)=>{I.d(he,{Fr:()=>W,Xw:()=>o,il:()=>h});const h="manifestToken",o="Admin",W={email:"admin@manifest.build",password:"admin"}},9606:(Je,he,I)=>{I.d(he,{c:()=>h});const h={production:!0,apiBaseUrl:"/api"}},6543:(Je,he,I)=>{var h=I(7711),o=I(8284),W=I(2943),X=I(2816),T=I(3575),pe=I(6852),J=I(1467),fe=I(5640);const le=new o.nKC("JWT_OPTIONS");let de=(()=>{class q{constructor(K=null){this.tokenGetter=K&&K.tokenGetter||function(){}}urlBase64Decode(K){let ge=K.replace(/-/g,"+").replace(/_/g,"/");switch(ge.length%4){case 0:break;case 2:ge+="==";break;case 3:ge+="=";break;default:throw new Error("Illegal base64url string!")}return this.b64DecodeUnicode(ge)}b64decode(K){let We="";if((K=String(K).replace(/=+$/,"")).length%4==1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(let Ct,gt,Be=0,Gt=0;gt=K.charAt(Gt++);~gt&&(Ct=Be%4?64*Ct+gt:gt,Be++%4)?We+=String.fromCharCode(255&Ct>>(-2*Be&6)):0)gt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(gt);return We}b64DecodeUnicode(K){return decodeURIComponent(Array.prototype.map.call(this.b64decode(K),ge=>"%"+("00"+ge.charCodeAt(0).toString(16)).slice(-2)).join(""))}decodeToken(K=this.tokenGetter()){return K instanceof Promise?K.then(ge=>this._decodeToken(ge)):this._decodeToken(K)}_decodeToken(K){if(!K||""===K)return null;const ge=K.split(".");if(3!==ge.length)throw new Error("The inspected token doesn't appear to be a JWT. Check to make sure it has three parts and see https://jwt.io for more.");const We=this.urlBase64Decode(ge[1]);if(!We)throw new Error("Cannot decode the token.");return JSON.parse(We)}getTokenExpirationDate(K=this.tokenGetter()){return K instanceof Promise?K.then(ge=>this._getTokenExpirationDate(ge)):this._getTokenExpirationDate(K)}_getTokenExpirationDate(K){let ge;if(ge=this.decodeToken(K),!ge||!ge.hasOwnProperty("exp"))return null;const We=new Date(0);return We.setUTCSeconds(ge.exp),We}isTokenExpired(K=this.tokenGetter(),ge){return K instanceof Promise?K.then(We=>this._isTokenExpired(We,ge)):this._isTokenExpired(K,ge)}_isTokenExpired(K,ge){if(!K||""===K)return!0;const We=this.getTokenExpirationDate(K);return ge=ge||0,null!==We&&!(We.valueOf()>(new Date).valueOf()+1e3*ge)}getAuthScheme(K,ge){return"function"==typeof K?K(ge):K}}return q.\u0275fac=function(K){return new(K||q)(o.KVO(le))},q.\u0275prov=o.jDH({token:q,factory:q.\u0275fac}),q})();const oe=q=>q instanceof Promise?(0,pe.v)(()=>q):(0,J.of)(q);let _e=(()=>{class q{constructor(K,ge,We){this.jwtHelper=ge,this.document=We,this.standardPorts=["80","443"],this.tokenGetter=K.tokenGetter,this.headerName=K.headerName||"Authorization",this.authScheme=K.authScheme||""===K.authScheme?K.authScheme:"Bearer ",this.allowedDomains=K.allowedDomains||[],this.disallowedRoutes=K.disallowedRoutes||[],this.throwNoTokenError=K.throwNoTokenError||!1,this.skipWhenExpired=K.skipWhenExpired}isAllowedDomain(K){const ge=new URL(K.url,this.document.location.origin);if(ge.host===this.document.location.host)return!0;const We=`${ge.hostname}${ge.port&&!this.standardPorts.includes(ge.port)?":"+ge.port:""}`;return this.allowedDomains.findIndex(Be=>"string"==typeof Be?Be===We:Be instanceof RegExp&&Be.test(We))>-1}isDisallowedRoute(K){const ge=new URL(K.url,this.document.location.origin);return this.disallowedRoutes.findIndex(We=>{if("string"==typeof We){const Be=new URL(We,this.document.location.origin);return Be.hostname===ge.hostname&&Be.pathname===ge.pathname}return We instanceof RegExp&&We.test(K.url)})>-1}handleInterception(K,ge,We){const Be=this.jwtHelper.getAuthScheme(this.authScheme,ge);if(!K&&this.throwNoTokenError)throw new Error("Could not get token from tokenGetter function.");let Ct=(0,J.of)(!1);return this.skipWhenExpired&&(Ct=K?oe(this.jwtHelper.isTokenExpired(K)):(0,J.of)(!0)),K?Ct.pipe((0,X.T)(gt=>gt&&this.skipWhenExpired?ge.clone():ge.clone({setHeaders:{[this.headerName]:`${Be}${K}`}})),(0,T.Z)(gt=>We.handle(gt))):We.handle(ge)}intercept(K,ge){if(!this.isAllowedDomain(K)||this.isDisallowedRoute(K))return ge.handle(K);const We=this.tokenGetter(K);return oe(We).pipe((0,T.Z)(Be=>this.handleInterception(Be,K,ge)))}}return q.\u0275fac=function(K){return new(K||q)(o.KVO(le),o.KVO(de),o.KVO(W.qQ))},q.\u0275prov=o.jDH({token:q,factory:q.\u0275fac}),q})(),xe=(()=>{class q{constructor(K){if(K)throw new Error("JwtModule is already loaded. It should only be imported in your application's main module.")}static forRoot(K){return{ngModule:q,providers:[{provide:fe.a7,useClass:_e,multi:!0},K.jwtOptionsProvider||{provide:le,useValue:K.config},de]}}}return q.\u0275fac=function(K){return new(K||q)(o.KVO(q,12))},q.\u0275mod=o.$C({type:q}),q.\u0275inj=o.G2t({}),q})();var Q=I(4385),ve=I(183),He=I(818);let Pe=(()=>{class q{constructor(K,ge){this.router=K,this.flashMessageService=ge}canActivate(){return!!localStorage.getItem(Q.il)||(this.router.navigate(["/","auth","login"]),this.flashMessageService.info("You need to be logged in to access this page."),!1)}static{this.\u0275fac=function(ge){return new(ge||q)(o.KVO(ve.Ix),o.KVO(He.L))}}static{this.\u0275prov=o.jDH({token:q,factory:q.\u0275fac,providedIn:"root"})}}return q})();var Ze=I(9879);let lt=(()=>{class q{constructor(K){K.setTitle("Page not found")}static{this.\u0275fac=function(ge){return new(ge||q)(o.rXU(Ze.R))}}static{this.\u0275cmp=o.VBU({type:q,selectors:[["app-error404"]],decls:10,vars:0,consts:[[1,"wrapper--basic"],[1,"title","is-1"],[1,"is-size-5","mb-4"],["routerLink","/",1,"button","is-link","mt-3"]],template:function(ge,We){1&ge&&(o.j41(0,"div",0)(1,"span"),o.EFF(2,"404"),o.k0s(),o.j41(3,"h1",1),o.EFF(4,"Page not found"),o.k0s(),o.j41(5,"p",2),o.EFF(6," The page you are looking for doesn't exist or has been moved "),o.k0s(),o.j41(7,"p")(8,"a",3),o.EFF(9," Back to Homepage "),o.k0s()()())},dependencies:[ve.Wk],styles:["span[_ngcontent-%COMP%]{font-size:11rem}"]})}}return q})();var Dt=I(2283),Oe=I(9e3);const we=q=>["/collections",q],Ge=q=>["/singles",q,"edit"];function Ke(q,pt){1&q&&(o.j41(0,"div",0),o.nrm(1,"hr"),o.j41(2,"div",7)(3,"p",8),o.EFF(4," Resources "),o.k0s()(),o.j41(5,"div",9)(6,"a",10)(7,"div",11)(8,"div",12)(9,"article",13)(10,"figure",14)(11,"p",15),o.nrm(12,"img",16),o.k0s()(),o.j41(13,"div",17)(14,"div",3)(15,"p",18),o.EFF(16," Documentation "),o.k0s(),o.j41(17,"p"),o.EFF(18,"Find out how how to to play with Manifest"),o.k0s()()(),o.j41(19,"figure",19),o.nrm(20,"i",20),o.k0s()()()()()(),o.j41(21,"div",7)(22,"p",8),o.EFF(23," Feedback & Support "),o.k0s()(),o.j41(24,"div",9)(25,"a",21)(26,"div",11)(27,"div",12)(28,"article",13)(29,"figure",14)(30,"p",15),o.nrm(31,"img",22),o.k0s()(),o.j41(32,"div",17)(33,"div",3)(34,"p",18),o.EFF(35," We need you \u{1f64f} "),o.k0s(),o.j41(36,"p"),o.EFF(37,"Share your feedback and suggestions"),o.k0s()()(),o.j41(38,"figure",19),o.nrm(39,"i",20),o.k0s()()()()()(),o.j41(40,"div",9)(41,"a",23)(42,"div",11)(43,"div",12)(44,"article",13)(45,"figure",14)(46,"p",15),o.nrm(47,"img",24),o.k0s()(),o.j41(48,"div",17)(49,"div",3)(50,"p",18),o.EFF(51," Stuck ? "),o.k0s(),o.j41(52,"p"),o.EFF(53,"Get help from the community on our Discord"),o.k0s()()(),o.j41(54,"figure",19),o.nrm(55,"i",20),o.k0s()()()()()()())}function Ve(q,pt){if(1&q&&(o.j41(0,"div",26)(1,"a",27)(2,"div",28)(3,"div",12)(4,"article",13)(5,"div",17)(6,"div",3)(7,"p",18)(8,"span"),o.EFF(9),o.nI1(10,"capitalizeFirstLetter"),o.k0s()()()(),o.j41(11,"figure",19),o.nrm(12,"i",20),o.k0s()()()()()()),2&q){const K=pt.$implicit;o.R7$(),o.Y8G("routerLink",o.eq3(4,we,K.slug)),o.R7$(8),o.JRh(o.bMT(10,2,K.namePlural))}}function je(q,pt){if(1&q&&(o.j41(0,"div",0)(1,"div",7),o.nrm(2,"hr"),o.j41(3,"p",8),o.EFF(4," Start navigating through your collections "),o.k0s()(),o.DNE(5,Ve,13,6,"div",25),o.k0s()),2&q){const K=o.XpG(2);o.R7$(5),o.Y8G("ngForOf",K.collections)}}function Ye(q,pt){if(1&q&&(o.j41(0,"div",26)(1,"a",27)(2,"div",28)(3,"div",12)(4,"article",13)(5,"div",17)(6,"div",3)(7,"p",18)(8,"span"),o.EFF(9),o.nI1(10,"capitalizeFirstLetter"),o.k0s()()()(),o.j41(11,"figure",19),o.nrm(12,"i",20),o.k0s()()()()()()),2&q){const K=pt.$implicit;o.R7$(),o.Y8G("routerLink",o.eq3(4,Ge,K.slug)),o.R7$(8),o.JRh(o.bMT(10,2,K.nameSingular))}}function it(q,pt){if(1&q&&(o.j41(0,"div",0)(1,"div",7),o.nrm(2,"hr"),o.j41(3,"p",8),o.EFF(4," Edit your single entities "),o.k0s()(),o.DNE(5,Ye,13,6,"div",25),o.k0s()),2&q){const K=o.XpG(2);o.R7$(5),o.Y8G("ngForOf",K.singles)}}function et(q,pt){if(1&q&&(o.j41(0,"div",3)(1,"h1"),o.EFF(2),o.k0s(),o.j41(3,"p",4),o.EFF(4," Proudly built with "),o.j41(5,"a",5),o.EFF(6,"Manifest"),o.k0s(),o.EFF(7,". "),o.k0s(),o.j41(8,"div"),o.DNE(9,Ke,56,0,"div",6)(10,je,6,1,"div",6)(11,it,6,1,"div",6),o.k0s()()),2&q){const K=o.XpG();o.R7$(2),o.JRh(K.appManifest.name),o.R7$(7),o.Y8G("ngIf",!K.appManifest.production),o.R7$(),o.Y8G("ngIf",null==K.collections?null:K.collections.length),o.R7$(),o.Y8G("ngIf",null==K.singles?null:K.singles.length)}}const ke=[{path:"",component:(()=>{class q{constructor(K,ge){this.manifestService=K,this.metaService=ge}ngOnInit(){this.manifestService.getManifest().then(K=>{this.appManifest=K,this.collections=Object.values(K.entities||{}).filter(ge=>!ge.single),this.singles=Object.values(K.entities||{}).filter(ge=>ge.single),this.metaService.setTitle("Admin panel")})}static{this.\u0275fac=function(ge){return new(ge||q)(o.rXU(Dt.x),o.rXU(Ze.R))}}static{this.\u0275cmp=o.VBU({type:q,selectors:[["app-home"]],decls:3,vars:1,consts:[[1,"columns","is-multiline"],[1,"column","is-10-tablet","is-offset-1-tablet","is-8-widescreen","is-offset-2-widescreen","is-6-fullhd","is-offset-3-fullhd"],["class","content",4,"ngIf"],[1,"content"],[1,"is-size-5"],["href","https://manifest.build","target","_blank"],["class","columns is-multiline",4,"ngIf"],[1,"column","is-12","pb-0"],[1,"is-uppercase","has-text-dark","has-text-weight-medium"],[1,"column","is-12"],["href","https://manifest.build/docs","target","_blank",1,"card-link"],[1,"card","p-0","is-overflow-hidden","is-shadowless","is-bordered"],[1,"card-content","p-0"],[1,"media","is-flex","is-align-items-center"],[1,"media-left","m-0"],[1,"image","is-64x64"],["src","/assets/images/ext-link-01.svg"],[1,"media-content","is-flex","is-align-items-center","is-justify-content-flex-start","pl-4","is-fullheight"],[1,"is-size-5","has-text-weight-bold","mb-0"],[1,"media-right","my-0","ml-1","mr-4","is-inline-flex","is-justify-content-center"],[1,"icon","icon-arrow-right"],["href","https://github.com/mnfst/manifest/discussions/categories/feedback","target","_blank",1,"card-link"],["src","/assets/images/ext-link-gh.svg"],["href","https://discord.com/invite/FepAked3W7","target","_blank",1,"card-link"],["src","/assets/images/ext-link-dc.svg"],["class","column is-6",4,"ngFor","ngForOf"],[1,"column","is-6"],["routerLinkActive","is-active",1,"card-link",3,"routerLink"],[1,"card","p-0","is-overflow-hidden","is-shadowless","is-bordered","is-entity-link"]],template:function(ge,We){1&ge&&(o.j41(0,"div",0)(1,"div",1),o.DNE(2,et,12,4,"div",2),o.k0s()()),2&ge&&(o.R7$(2),o.Y8G("ngIf",We.appManifest))},dependencies:[W.Sq,W.bT,ve.Wk,ve.wQ,Oe.X],styles:['@import"https://fonts.googleapis.com/css?family=Rubik:300,400,400i,500";.is-entity-link[_ngcontent-%COMP%]{height:64px;display:flex;align-items:center}.card-link[_ngcontent-%COMP%]{border-color:#dddde2;transition:border-color .54s cubic-bezier(.165,.84,.44,1)}.card-link[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:before{display:none}.card-link[_ngcontent-%COMP%]:hover .card[_ngcontent-%COMP%]{transition:border-color .54s cubic-bezier(.165,.84,.44,1);color:#000;border-color:#39393c}']})}}return q})(),canActivate:[Pe]},{path:"auth",loadChildren:()=>Promise.resolve().then(I.bind(I,4783)).then(q=>q.AuthModule)},{path:"collections",loadChildren:()=>Promise.all([I.e(69),I.e(45)]).then(I.bind(I,4045)).then(q=>q.CrudCollectionModule),canActivate:[Pe],data:{mode:"collection"}},{path:"singles",loadChildren:()=>Promise.all([I.e(69),I.e(693)]).then(I.bind(I,8693)).then(q=>q.CrudSingleModule),canActivate:[Pe]},{path:"404",component:lt,canActivate:[Pe]},{path:"**",redirectTo:"/404"}];let vn=(()=>{class q{static{this.\u0275fac=function(ge){return new(ge||q)}}static{this.\u0275mod=o.$C({type:q})}static{this.\u0275inj=o.G2t({imports:[ve.iI.forRoot(ke),ve.iI]})}}return q})();var Ie=I(7906);function Xe(q,pt){if(1&q&&(o.j41(0,"div",1)(1,"p",2),o.EFF(2),o.k0s()()),2&q){const K=o.XpG();o.Y8G("ngClass",K.flashMessage.className),o.R7$(2),o.JRh(K.flashMessage.message)}}let vt=(()=>{class q{constructor(K){this.flashMessageService=K}ngOnInit(){this.flashMessageService.flashMessage.subscribe(K=>{this.flashMessage=K})}static{this.\u0275fac=function(ge){return new(ge||q)(o.rXU(He.L))}}static{this.\u0275cmp=o.VBU({type:q,selectors:[["app-flash-message"]],decls:1,vars:1,consts:[["class","flash-messages notification",3,"ngClass",4,"ngIf"],[1,"flash-messages","notification",3,"ngClass"],[1,"is-size-5"]],template:function(ge,We){1&ge&&o.DNE(0,Xe,3,2,"div",0),2&ge&&o.Y8G("ngIf",We.flashMessage)},dependencies:[W.YU,W.bT]})}}return q})();var Tt=I(4534);const Fn=q=>({"is-active":q});function ne(q,pt){if(1&q&&(o.j41(0,"span",9)(1,"strong"),o.EFF(2),o.k0s()()),2&q){const K=o.XpG();o.R7$(2),o.JRh(K.currentUser.email)}}let re=(()=>{class q{constructor(K,ge){this.authService=K,this.elementRef=ge,this.showUserMenu=!1}ngOnInit(){this.authService.currentUser$.pipe((0,Tt.p)(K=>!!K)).subscribe(K=>{this.currentUser=K})}onClick(K){this.elementRef.nativeElement.contains(K)||(this.showUserMenu=!1)}static{this.\u0275fac=function(ge){return new(ge||q)(o.rXU(Ie.u),o.rXU(o.aKT))}}static{this.\u0275cmp=o.VBU({type:q,selectors:[["app-user-menu-item"]],hostBindings:function(ge,We){1&ge&&o.bIt("click",function(Ct){return We.onClick(Ct.target)},!1,o.EBC)},decls:10,vars:4,consts:[[1,"is-flex","is-align-items-center","is-justify-content-flex-start"],[1,"dropdown","is-up",3,"ngClass"],[1,"dropdown-trigger"],[1,"is-flex","is-align-items-center","is-justify-content-flex-start",3,"click"],["src","/assets/images/avatar-default.svg","title","currentUser.name","alt","currentUser.name",1,"avatar"],["class","dropdown-item pr-0",4,"ngIf"],["role","menu",1,"dropdown-menu","is-small"],[1,"dropdown-content"],["routerLink","/auth/logout",1,"dropdown-item",3,"click"],[1,"dropdown-item","pr-0"]],template:function(ge,We){1&ge&&(o.nrm(0,"div",0),o.j41(1,"div",1)(2,"div",2)(3,"a",3),o.bIt("click",function(){return We.showUserMenu=!We.showUserMenu}),o.nrm(4,"img",4),o.DNE(5,ne,3,1,"span",5),o.k0s()(),o.j41(6,"div",6)(7,"div",7)(8,"a",8),o.bIt("click",function(){return We.showUserMenu=!1}),o.EFF(9," Sign out "),o.k0s()()()()),2&ge&&(o.R7$(),o.Y8G("ngClass",o.eq3(2,Fn,We.showUserMenu)),o.R7$(4),o.Y8G("ngIf",We.currentUser))},dependencies:[W.YU,W.bT,ve.Wk],styles:['@import"https://fonts.googleapis.com/css?family=Rubik:300,400,400i,500";.dropdown-trigger[_ngcontent-%COMP%]{max-width:100%;min-width:100%}@media screen and (max-width: 1023px){.dropdown-trigger[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]{width:100%;height:100%;display:inline-flex;box-sizing:content-box;align-items:center;justify-content:center;margin-right:32px}}@media screen and (max-width: 767px){.dropdown-trigger[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]{margin-right:30px}}.dropdown[_ngcontent-%COMP%]{max-width:100%;min-width:100%}.dropdown-item[_ngcontent-%COMP%]{white-space:nowrap;text-overflow:ellipsis;width:100%;overflow:hidden}.avatar[_ngcontent-%COMP%]{border-radius:6px}']})}}return q})();const ue=q=>["/singles",q],ee=q=>["/collections",q];function Me(q,pt){if(1&q&&(o.j41(0,"li")(1,"a",14)(2,"span"),o.EFF(3),o.nI1(4,"capitalizeFirstLetter"),o.k0s()()()),2&q){const K=pt.$implicit;o.R7$(),o.Y8G("routerLink",o.eq3(4,ue,K.slug)),o.R7$(2),o.JRh(o.bMT(4,2,K.nameSingular))}}function Te(q,pt){if(1&q&&(o.qex(0),o.DNE(1,Me,5,6,"li",13),o.nrm(2,"hr"),o.bVm()),2&q){const K=o.XpG();o.R7$(),o.Y8G("ngForOf",K.singles)}}function nt(q,pt){1&q&&o.nrm(0,"i",16)}function xt(q,pt){1&q&&o.nrm(0,"i",17)}function Zt(q,pt){if(1&q&&(o.j41(0,"li")(1,"a",14)(2,"span"),o.EFF(3),o.nI1(4,"capitalizeFirstLetter"),o.k0s()()()),2&q){const K=pt.$implicit;o.R7$(),o.Y8G("routerLink",o.eq3(4,ee,K.slug)),o.R7$(2),o.JRh(o.bMT(4,2,K.namePlural))}}function dt(q,pt){1&q&&(o.j41(0,"li")(1,"a",18)(2,"span"),o.EFF(3,"No collection yet"),o.k0s()()())}function Ut(q,pt){if(1&q&&(o.j41(0,"ul"),o.DNE(1,Zt,5,6,"li",13)(2,dt,4,0,"li",5),o.k0s()),2&q){const K=o.XpG(2);o.R7$(),o.Y8G("ngForOf",K.collections),o.R7$(),o.Y8G("ngIf",0===K.collections.length)}}function qe(q,pt){if(1&q){const K=o.RV6();o.j41(0,"li")(1,"a",6),o.bIt("click",function(){o.eBV(K);const We=o.XpG();return o.Njj(We.isCollectionsOpen=!We.isCollectionsOpen)}),o.j41(2,"span",7),o.nrm(3,"i",15),o.j41(4,"span",9),o.EFF(5,"Collections"),o.k0s()(),o.DNE(6,nt,1,0,"i",10)(7,xt,1,0,"i",11),o.k0s(),o.DNE(8,Ut,3,2,"ul",5),o.k0s()}if(2&q){const K=o.XpG();o.R7$(6),o.Y8G("ngIf",!K.isCollectionsOpen),o.R7$(),o.Y8G("ngIf",K.isCollectionsOpen),o.R7$(),o.Y8G("ngIf",K.isCollectionsOpen)}}function cn(q,pt){1&q&&o.nrm(0,"i",16)}function Bt(q,pt){1&q&&o.nrm(0,"i",17)}function Pt(q,pt){1&q&&(o.j41(0,"ul")(1,"li")(2,"a",19),o.EFF(3,"Admins"),o.k0s()()())}function on(q,pt){1&q&&(o.j41(0,"div",20)(1,"div",21)(2,"div",22)(3,"div",23)(4,"p",24)(5,"span",25),o.EFF(6,"\u{1f469}\u200d\u{1f4bb} Be one of 50 developers"),o.k0s(),o.EFF(7," for a quick video call and shape the product with your insights! "),o.k0s(),o.j41(8,"a",26),o.EFF(9,"Get involved"),o.k0s()()()()())}let Ne=(()=>{class q{constructor(K){this.manifestService=K,this.isCollectionsOpen=!1,this.isSettingsOpen=!1}ngOnInit(){this.manifestService.getManifest().then(K=>{this.production=K.production,this.collections=Object.values(K.entities||{}).filter(ge=>ge.className!==Q.Xw).filter(ge=>!ge.single),this.singles=Object.values(K.entities||{}).filter(ge=>ge.single)})}static{this.\u0275fac=function(ge){return new(ge||q)(o.rXU(Dt.x))}}static{this.\u0275cmp=o.VBU({type:q,selectors:[["app-side-menu"]],decls:19,vars:6,consts:[[1,"side-menu-wrapper","is-flex","is-flex-direction-column","is-justify-content-space-between"],[1,"logo-wrapper","is-hidden-touch"],["routerLink","/",1,"logo"],["src","/assets/images/logo.svg","width","155",1,"logo--image"],[1,"menu-list"],[4,"ngIf"],[1,"has-submenu","is-flex","is-justify-content-space-between",3,"click"],[1,"is-inline-flex","is-align-items-center","is-justify-content-space-between"],[1,"icon","mr-2","icon-sliders","is-size-4"],[1,"pl-1"],["class","icon icon-chevron-down",4,"ngIf"],["class","icon icon-chevron-up",4,"ngIf"],["class","ad",4,"ngIf"],[4,"ngFor","ngForOf"],["routerLinkActive","is-active",3,"routerLink"],[1,"icon","mr-2","icon-database","is-size-4"],[1,"icon","icon-chevron-down"],[1,"icon","icon-chevron-up"],[1,"has-background-white-bis","has-text-grey",2,"pointer-events","none"],["routerLink","/collections/admins"],[1,"ad"],[1,"card","is-bordered","is-shadowless","has-background-primary"],[1,"card-content","is-size-6"],[1,"content"],[1,"subtitle","is-5","has-text-light"],[1,"has-text-weight-bold"],["href","https://forms.gle/yKgUTYhuEacgx8i26","target","_blank",1,"button","is-white","is-outlined"]],template:function(ge,We){1&ge&&(o.j41(0,"div",0)(1,"div",1)(2,"a",2),o.nrm(3,"img",3),o.k0s()(),o.j41(4,"ul",4),o.DNE(5,Te,3,1,"ng-container",5)(6,qe,9,3,"li",5),o.nrm(7,"hr"),o.j41(8,"li")(9,"a",6),o.bIt("click",function(){return We.isSettingsOpen=!We.isSettingsOpen}),o.j41(10,"span",7),o.nrm(11,"i",8),o.j41(12,"span",9),o.EFF(13,"Settings"),o.k0s()(),o.DNE(14,cn,1,0,"i",10)(15,Bt,1,0,"i",11),o.k0s(),o.DNE(16,Pt,4,0,"ul",5),o.k0s()(),o.DNE(17,on,10,0,"div",12),o.nrm(18,"app-user-menu-item"),o.k0s()),2&ge&&(o.R7$(5),o.Y8G("ngIf",null==We.singles?null:We.singles.length),o.R7$(),o.Y8G("ngIf",We.collections),o.R7$(8),o.Y8G("ngIf",!We.isSettingsOpen),o.R7$(),o.Y8G("ngIf",We.isSettingsOpen),o.R7$(),o.Y8G("ngIf",We.isSettingsOpen),o.R7$(),o.Y8G("ngIf",!1===We.production))},dependencies:[W.Sq,W.bT,ve.Wk,ve.wQ,re,Oe.X],styles:['@import"https://fonts.googleapis.com/css?family=Rubik:300,400,400i,500";.menu-list[_ngcontent-%COMP%] a.is-active[_ngcontent-%COMP%], .menu-list[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{background-color:#f5f7f9;color:#000}.menu-list[_ngcontent-%COMP%]{--logo-height: 94px;--footer-height: 54px;--margin: 16px;scrollbar-width:none;padding-top:var(--margin);padding-bottom:var(--margin);margin-bottom:var(--footer-height);overflow-y:overlay;overflow-x:hidden}@media screen and (min-width: 1024px){.menu-list[_ngcontent-%COMP%]{height:calc(100vh - var(--logo-height) - var(--footer-height) + 1px - 220px)}}@media screen and (max-width: 1023px){.menu-list[_ngcontent-%COMP%]{height:calc(100vh - 8rem - var(--footer-height) + 1px - 220px)}}.menu-list[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{position:relative;display:inline-block;width:100%;font-size:1.5rem;padding:1px 8px}.menu-list[_ngcontent-%COMP%] li[_ngcontent-%COMP%] ul[_ngcontent-%COMP%]{margin:5px 0 0;border-left:0;padding-left:0}.menu-list[_ngcontent-%COMP%] li[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{padding:0}.menu-list[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{border-radius:6px;position:relative;color:#303032;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;align-items:center;justify-content:flex-start;width:100%;min-height:36px;line-height:36px;padding:0 16px;transition:color .35s ease,background-color .05s ease-out}.menu-list[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{transition:color .35s ease,background-color .05s ease-in}.menu-list[_ngcontent-%COMP%] a.is-active[_ngcontent-%COMP%]:before{background-color:#39393c}.menu-list[_ngcontent-%COMP%] a.logo[_ngcontent-%COMP%]{display:flex;align-items:center;height:98px;justify-content:flex-start}.logo-wrapper[_ngcontent-%COMP%]{padding:1.6rem;border-bottom:1px solid #eaeaef}.flex[_ngcontent-%COMP%]{display:flex}app-user-menu-item[_ngcontent-%COMP%]{border-top:1px solid #eaeaef;border-right:1px solid #eaeaef;z-index:99;padding:8px}@media screen and (min-width: 769px),print{app-user-menu-item[_ngcontent-%COMP%]{position:fixed;bottom:0}}.side-menu-wrapper[_ngcontent-%COMP%]{height:100%}']})}}return q})();const Et=q=>({"is-open":q});let yn=(()=>{class q{constructor(K,ge){this.renderer=K,this.isOpen=!1,ge.events.subscribe(We=>{We instanceof ve.wF&&(this.isOpen=!1)})}toggleMenu(){this.isOpen?(this.isOpen=!1,this.renderer.removeClass(document.querySelector("html"),"is-clipped")):(this.isOpen=!0,this.renderer.addClass(document.querySelector("html"),"is-clipped"))}static{this.\u0275fac=function(ge){return new(ge||q)(o.rXU(o.sFG),o.rXU(ve.Ix))}}static{this.\u0275cmp=o.VBU({type:q,selectors:[["app-touch-menu"]],decls:12,vars:3,consts:[["role","navigation","aria-label","main navigation",1,"navbar",3,"ngClass"],[1,"navbar-wrapper","is-flex","is-align-items-center","is-justify-content-space-between","is-flex-direction-row-reverse","is-fullheight"],["routerLink","/",1,"logo","is-flex","is-align-items-center","is-justify-content-center","px-0"],["src","/assets/images/logo.svg","width","180",1,"logo-image"],["role","button",1,"navbar-burger","burger","ml-0",3,"click"],["aria-hidden","true"],[1,"hiding-layer",3,"click"],["id","create-dropdown",1,"navbar-menu"],[1,"navbar-end"]],template:function(ge,We){1&ge&&(o.j41(0,"nav",0)(1,"div",1)(2,"a",2),o.nrm(3,"img",3),o.k0s(),o.j41(4,"a",4),o.bIt("click",function(){return We.toggleMenu()}),o.nrm(5,"span",5)(6,"span",5)(7,"span",5),o.k0s()(),o.j41(8,"div",6),o.bIt("click",function(){return We.toggleMenu()}),o.k0s(),o.j41(9,"div",7)(10,"div",8),o.nrm(11,"app-side-menu"),o.k0s()()()),2&ge&&o.Y8G("ngClass",o.eq3(1,Et,We.isOpen))},dependencies:[W.YU,ve.Wk,Ne],styles:['@import"https://fonts.googleapis.com/css?family=Rubik:300,400,400i,500";nav.navbar[_ngcontent-%COMP%]{position:relative;z-index:9;height:8rem;width:100vw;background-color:#fff}nav.navbar[_ngcontent-%COMP%]:before{position:absolute;content:"";top:0;z-index:-1;height:100%;width:100%;border-bottom:1px solid rgba(48,48,50,.1)}@media screen and (min-width: 769px),print{nav.navbar[_ngcontent-%COMP%]:before{left:0;width:100%}}nav.navbar[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%]{margin-right:8rem}nav.navbar[_ngcontent-%COMP%] .navbar-burger[_ngcontent-%COMP%]{height:8rem;width:8rem;min-width:8rem;color:#303032}@media screen and (min-width: 769px),print{nav.navbar[_ngcontent-%COMP%] .navbar-burger[_ngcontent-%COMP%]{width:8rem}}nav.navbar[_ngcontent-%COMP%] .navbar-burger[_ngcontent-%COMP%]:hover{background-color:transparent;color:#303032}.navbar-item[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-height:unset}.buttons[_ngcontent-%COMP%]{padding-right:110px}.dropdown-menu.is-small[_ngcontent-%COMP%]{border:1px solid #eaeaef}.navbar-menu[_ngcontent-%COMP%]{display:block;height:calc(100vh - 8rem);width:260px;position:absolute;top:8rem;left:-261px;z-index:99999;opacity:0;box-shadow:1px 0 #ffffff1a;padding-bottom:0;background-color:#fff;transition:all .16s cubic-bezier(.53,.25,.75,.5)}@media screen and (max-width: 768px){.navbar-menu[_ngcontent-%COMP%]{width:100vw;left:-100vw}}.is-open[_ngcontent-%COMP%] .navbar-menu[_ngcontent-%COMP%]{left:0;opacity:1;transition:all .16s cubic-bezier(.25,.53,.42,.71)}.navbar-end[_ngcontent-%COMP%]{height:100%;display:flex;flex-direction:column;justify-content:space-between}.hiding-layer[_ngcontent-%COMP%]{display:block;position:absolute;top:8rem;left:0;width:100vw;opacity:0;z-index:9999;visibility:hidden;height:calc(100vh - 8rem);background:#303032;transition:opacity .16s ease-in-out,visibility .01s linear .16s}.is-open[_ngcontent-%COMP%] .hiding-layer[_ngcontent-%COMP%]{opacity:.2;visibility:visible;transition:opacity .16s ease-in-out .01s,visibility .01s linear}app-side-menu[_ngcontent-%COMP%]{height:100%}']})}}return q})();function ar(q,pt){1&q&&(o.qex(0),o.nrm(1,"app-touch-menu",5),o.bVm())}function Fr(q,pt){1&q&&(o.j41(0,"aside",6),o.nrm(1,"app-side-menu"),o.k0s())}let vr=(()=>{class q{constructor(K,ge){this.authService=K,this.router=ge,this.isLogin=!0}ngOnInit(){this.router.events.subscribe(K=>{K instanceof ve.wF&&(window.scrollTo(0,0),this.isLogin=K.url.includes("/auth/login")||K.url.includes("/auth/welcome"),this.currentUserSubscription=this.authService.currentUser$.subscribe(ge=>{!ge&&localStorage.getItem(Q.il)&&this.authService.loadCurrentUser().subscribe()}))})}ngOnDestroy(){this.currentUserSubscription&&this.currentUserSubscription.unsubscribe()}static{this.\u0275fac=function(ge){return new(ge||q)(o.rXU(Ie.u),o.rXU(ve.Ix))}}static{this.\u0275cmp=o.VBU({type:q,selectors:[["app-root"]],decls:8,vars:2,consts:[[4,"ngIf"],[1,"wrapper"],[1,"columns"],["class","column aside menu px-0 is-hidden-touch",4,"ngIf"],[1,"column","main"],[1,"is-hidden-desktop"],[1,"column","aside","menu","px-0","is-hidden-touch"]],template:function(ge,We){1&ge&&(o.DNE(0,ar,2,0,"ng-container",0),o.nrm(1,"app-flash-message"),o.j41(2,"div",1)(3,"div",2),o.DNE(4,Fr,2,0,"aside",3),o.j41(5,"div",4)(6,"main"),o.nrm(7,"router-outlet"),o.k0s()()()()),2&ge&&(o.Y8G("ngIf",!We.isLogin),o.R7$(4),o.Y8G("ngIf",!We.isLogin))},dependencies:[W.bT,ve.n3,vt,Ne,yn],encapsulation:2})}}return q})();var kn=I(4783),ft=I(8023);let wt=(()=>{class q{static{this.\u0275fac=function(ge){return new(ge||q)}}static{this.\u0275mod=o.$C({type:q})}static{this.\u0275inj=o.G2t({imports:[W.MD,ve.iI,ft.G]})}}return q})(),Xn=(()=>{class q{static{this.\u0275fac=function(ge){return new(ge||q)}}static{this.\u0275mod=o.$C({type:q,bootstrap:[vr]})}static{this.\u0275inj=o.G2t({imports:[h.Bb,xe.forRoot({config:{tokenGetter:()=>localStorage.getItem(Q.il),allowedDomains:["localhost:1111"]}}),vn,ft.G,wt,kn.AuthModule]})}}return q})();h.sG().bootstrapModule(Xn).catch(q=>console.error(q))},7563:(Je,he,I)=>{function J(Q){if("many-to-one"===Q?.type)return Q.name+"Id";if("many-to-many"===Q?.type)return Q.name.endsWith("s")?Q.name.slice(0,-1)+"Ids":Q.name+"Id";throw new Error("Unknown relationship")}function de(Q){return Object.keys(Q).reduce((ve,He)=>{const Pe=Q?.[He],Ze=Q?.[ve];return void 0!==Pe?.width&&void 0!==Ze?.width&&Pe.width<Ze.width?He:ve})}I.d(he,{yk:()=>J,Gj:()=>de}),I(5442)},5442:(Je,he,I)=>{I.d(he,{Kk:()=>h});var h=function(T){return T.String="string",T.Text="text",T.RichText="richText",T.Number="number",T.Link="link",T.Money="money",T.Date="date",T.Timestamp="timestamp",T.Email="email",T.Boolean="boolean",T.Password="password",T.Choice="choice",T.Location="location",T.File="file",T.Image="image",T}(h||{})},2410:(Je,he,I)=>{I.d(he,{t:()=>o});var h=I(1087);class o extends h.B{constructor(X){super(),this._value=X}get value(){return this.getValue()}_subscribe(X){const T=super._subscribe(X);return!T.closed&&X.next(this._value),T}getValue(){const{hasError:X,thrownError:T,_value:pe}=this;if(X)throw T;return this._throwIfClosed(),pe}next(X){super.next(this._value=X)}}},7787:(Je,he,I)=>{I.d(he,{c:()=>fe});var h=I(3173),o=I(7233),W=I(1852),X=I(9493),T=I(2904),pe=I(2097),J=I(7112);let fe=(()=>{class _e{constructor(Q){Q&&(this._subscribe=Q)}lift(Q){const ve=new _e;return ve.source=this,ve.operator=Q,ve}subscribe(Q,ve,He){const Pe=function oe(_e){return _e&&_e instanceof h.vU||function de(_e){return _e&&(0,pe.T)(_e.next)&&(0,pe.T)(_e.error)&&(0,pe.T)(_e.complete)}(_e)&&(0,o.Uv)(_e)}(Q)?Q:new h.Ms(Q,ve,He);return(0,J.Y)(()=>{const{operator:Ze,source:lt}=this;Pe.add(Ze?Ze.call(Pe,lt):lt?this._subscribe(Pe):this._trySubscribe(Pe))}),Pe}_trySubscribe(Q){try{return this._subscribe(Q)}catch(ve){Q.error(ve)}}forEach(Q,ve){return new(ve=le(ve))((He,Pe)=>{const Ze=new h.Ms({next:lt=>{try{Q(lt)}catch(Dt){Pe(Dt),Ze.unsubscribe()}},error:Pe,complete:He});this.subscribe(Ze)})}_subscribe(Q){var ve;return null===(ve=this.source)||void 0===ve?void 0:ve.subscribe(Q)}[W.s](){return this}pipe(...Q){return(0,X.m)(Q)(this)}toPromise(Q){return new(Q=le(Q))((ve,He)=>{let Pe;this.subscribe(Ze=>Pe=Ze,Ze=>He(Ze),()=>ve(Pe))})}}return _e.create=xe=>new _e(xe),_e})();function le(_e){var xe;return null!==(xe=_e??T.$.Promise)&&void 0!==xe?xe:Promise}},1087:(Je,he,I)=>{I.d(he,{B:()=>J});var h=I(7787),o=I(7233);const X=(0,I(1531).L)(le=>function(){le(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"});var T=I(2070),pe=I(7112);let J=(()=>{class le extends h.c{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(oe){const _e=new fe(this,this);return _e.operator=oe,_e}_throwIfClosed(){if(this.closed)throw new X}next(oe){(0,pe.Y)(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(const _e of this.currentObservers)_e.next(oe)}})}error(oe){(0,pe.Y)(()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=oe;const{observers:_e}=this;for(;_e.length;)_e.shift().error(oe)}})}complete(){(0,pe.Y)(()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;const{observers:oe}=this;for(;oe.length;)oe.shift().complete()}})}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var oe;return(null===(oe=this.observers)||void 0===oe?void 0:oe.length)>0}_trySubscribe(oe){return this._throwIfClosed(),super._trySubscribe(oe)}_subscribe(oe){return this._throwIfClosed(),this._checkFinalizedStatuses(oe),this._innerSubscribe(oe)}_innerSubscribe(oe){const{hasError:_e,isStopped:xe,observers:Q}=this;return _e||xe?o.Kn:(this.currentObservers=null,Q.push(oe),new o.yU(()=>{this.currentObservers=null,(0,T.o)(Q,oe)}))}_checkFinalizedStatuses(oe){const{hasError:_e,thrownError:xe,isStopped:Q}=this;_e?oe.error(xe):Q&&oe.complete()}asObservable(){const oe=new h.c;return oe.source=this,oe}}return le.create=(de,oe)=>new fe(de,oe),le})();class fe extends J{constructor(de,oe){super(),this.destination=de,this.source=oe}next(de){var oe,_e;null===(_e=null===(oe=this.destination)||void 0===oe?void 0:oe.next)||void 0===_e||_e.call(oe,de)}error(de){var oe,_e;null===(_e=null===(oe=this.destination)||void 0===oe?void 0:oe.error)||void 0===_e||_e.call(oe,de)}complete(){var de,oe;null===(oe=null===(de=this.destination)||void 0===de?void 0:de.complete)||void 0===oe||oe.call(de)}_subscribe(de){var oe,_e;return null!==(_e=null===(oe=this.source)||void 0===oe?void 0:oe.subscribe(de))&&void 0!==_e?_e:o.Kn}}},3173:(Je,he,I)=>{I.d(he,{Ms:()=>He,vU:()=>_e});var h=I(2097),o=I(7233),W=I(2904),X=I(8508),T=I(9405);const pe=le("C",void 0,void 0);function le(Oe,we,Ge){return{kind:Oe,value:we,error:Ge}}var de=I(7680),oe=I(7112);class _e extends o.yU{constructor(we){super(),this.isStopped=!1,we?(this.destination=we,(0,o.Uv)(we)&&we.add(this)):this.destination=Dt}static create(we,Ge,Ke){return new He(we,Ge,Ke)}next(we){this.isStopped?lt(function fe(Oe){return le("N",Oe,void 0)}(we),this):this._next(we)}error(we){this.isStopped?lt(function J(Oe){return le("E",void 0,Oe)}(we),this):(this.isStopped=!0,this._error(we))}complete(){this.isStopped?lt(pe,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(we){this.destination.next(we)}_error(we){try{this.destination.error(we)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}}const xe=Function.prototype.bind;function Q(Oe,we){return xe.call(Oe,we)}class ve{constructor(we){this.partialObserver=we}next(we){const{partialObserver:Ge}=this;if(Ge.next)try{Ge.next(we)}catch(Ke){Pe(Ke)}}error(we){const{partialObserver:Ge}=this;if(Ge.error)try{Ge.error(we)}catch(Ke){Pe(Ke)}else Pe(we)}complete(){const{partialObserver:we}=this;if(we.complete)try{we.complete()}catch(Ge){Pe(Ge)}}}class He extends _e{constructor(we,Ge,Ke){let Ve;if(super(),(0,h.T)(we)||!we)Ve={next:we??void 0,error:Ge??void 0,complete:Ke??void 0};else{let je;this&&W.$.useDeprecatedNextContext?(je=Object.create(we),je.unsubscribe=()=>this.unsubscribe(),Ve={next:we.next&&Q(we.next,je),error:we.error&&Q(we.error,je),complete:we.complete&&Q(we.complete,je)}):Ve=we}this.destination=new ve(Ve)}}function Pe(Oe){W.$.useDeprecatedSynchronousErrorHandling?(0,oe.l)(Oe):(0,X.m)(Oe)}function lt(Oe,we){const{onStoppedNotification:Ge}=W.$;Ge&&de.f.setTimeout(()=>Ge(Oe,we))}const Dt={closed:!0,next:T.l,error:function Ze(Oe){throw Oe},complete:T.l}},7233:(Je,he,I)=>{I.d(he,{Kn:()=>pe,yU:()=>T,Uv:()=>J});var h=I(2097);const W=(0,I(1531).L)(le=>function(oe){le(this),this.message=oe?`${oe.length} errors occurred during unsubscription:\n${oe.map((_e,xe)=>`${xe+1}) ${_e.toString()}`).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=oe});var X=I(2070);class T{constructor(de){this.initialTeardown=de,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let de;if(!this.closed){this.closed=!0;const{_parentage:oe}=this;if(oe)if(this._parentage=null,Array.isArray(oe))for(const Q of oe)Q.remove(this);else oe.remove(this);const{initialTeardown:_e}=this;if((0,h.T)(_e))try{_e()}catch(Q){de=Q instanceof W?Q.errors:[Q]}const{_finalizers:xe}=this;if(xe){this._finalizers=null;for(const Q of xe)try{fe(Q)}catch(ve){de=de??[],ve instanceof W?de=[...de,...ve.errors]:de.push(ve)}}if(de)throw new W(de)}}add(de){var oe;if(de&&de!==this)if(this.closed)fe(de);else{if(de instanceof T){if(de.closed||de._hasParent(this))return;de._addParent(this)}(this._finalizers=null!==(oe=this._finalizers)&&void 0!==oe?oe:[]).push(de)}}_hasParent(de){const{_parentage:oe}=this;return oe===de||Array.isArray(oe)&&oe.includes(de)}_addParent(de){const{_parentage:oe}=this;this._parentage=Array.isArray(oe)?(oe.push(de),oe):oe?[oe,de]:de}_removeParent(de){const{_parentage:oe}=this;oe===de?this._parentage=null:Array.isArray(oe)&&(0,X.o)(oe,de)}remove(de){const{_finalizers:oe}=this;oe&&(0,X.o)(oe,de),de instanceof T&&de._removeParent(this)}}T.EMPTY=(()=>{const le=new T;return le.closed=!0,le})();const pe=T.EMPTY;function J(le){return le instanceof T||le&&"closed"in le&&(0,h.T)(le.remove)&&(0,h.T)(le.add)&&(0,h.T)(le.unsubscribe)}function fe(le){(0,h.T)(le)?le():le.unsubscribe()}},2904:(Je,he,I)=>{I.d(he,{$:()=>h});const h={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1}},8033:(Je,he,I)=>{I.d(he,{_:()=>W});var h=I(4392),o=I(3173);function W(X,T){const pe="object"==typeof T;return new Promise((J,fe)=>{const le=new o.Ms({next:de=>{J(de),le.unsubscribe()},error:fe,complete:()=>{pe?J(T.defaultValue):fe(new h.G)}});X.subscribe(le)})}},4782:(Je,he,I)=>{I.d(he,{z:()=>de});var h=I(7787),o=I(4047),W=I(4850),X=I(3867),T=I(7236),pe=I(1315),J=I(8746),fe=I(5510),le=I(1203);function de(...xe){const Q=(0,pe.lI)(xe),ve=(0,pe.ms)(xe),{args:He,keys:Pe}=(0,o.D)(xe);if(0===He.length)return(0,W.H)([],Q);const Ze=new h.c(function oe(xe,Q,ve=X.D){return He=>{_e(Q,()=>{const{length:Pe}=xe,Ze=new Array(Pe);let lt=Pe,Dt=Pe;for(let Oe=0;Oe<Pe;Oe++)_e(Q,()=>{const we=(0,W.H)(xe[Oe],Q);let Ge=!1;we.subscribe((0,fe._)(He,Ke=>{Ze[Oe]=Ke,Ge||(Ge=!0,Dt--),Dt||He.next(ve(Ze.slice()))},()=>{--lt||He.complete()}))},He)},He)}}(He,Q,Pe?lt=>(0,J.e)(Pe,lt):X.D));return ve?Ze.pipe((0,T.I)(ve)):Ze}function _e(xe,Q,ve){xe?(0,le.N)(ve,xe,Q):Q()}},6852:(Je,he,I)=>{I.d(he,{v:()=>W});var h=I(7787),o=I(7412);function W(X){return new h.c(T=>{(0,o.Tg)(X()).subscribe(T)})}},4850:(Je,he,I)=>{I.d(he,{H:()=>Ke});var h=I(7412),o=I(1203),W=I(1524),X=I(5510);function T(Ve,je=0){return(0,W.N)((Ye,it)=>{Ye.subscribe((0,X._)(it,et=>(0,o.N)(it,Ve,()=>it.next(et),je),()=>(0,o.N)(it,Ve,()=>it.complete(),je),et=>(0,o.N)(it,Ve,()=>it.error(et),je)))})}function pe(Ve,je=0){return(0,W.N)((Ye,it)=>{it.add(Ve.schedule(()=>Ye.subscribe(it),je))})}var le=I(7787),oe=I(979),_e=I(2097);function Q(Ve,je){if(!Ve)throw new Error("Iterable cannot be null");return new le.c(Ye=>{(0,o.N)(Ye,je,()=>{const it=Ve[Symbol.asyncIterator]();(0,o.N)(Ye,je,()=>{it.next().then(et=>{et.done?Ye.complete():Ye.next(et.value)})},0,!0)})})}var ve=I(9533),He=I(4760),Pe=I(5271),Ze=I(8419),lt=I(1391),Dt=I(3985),Oe=I(8030);function Ke(Ve,je){return je?function Ge(Ve,je){if(null!=Ve){if((0,ve.l)(Ve))return function J(Ve,je){return(0,h.Tg)(Ve).pipe(pe(je),T(je))}(Ve,je);if((0,Pe.X)(Ve))return function de(Ve,je){return new le.c(Ye=>{let it=0;return je.schedule(function(){it===Ve.length?Ye.complete():(Ye.next(Ve[it++]),Ye.closed||this.schedule())})})}(Ve,je);if((0,He.y)(Ve))return function fe(Ve,je){return(0,h.Tg)(Ve).pipe(pe(je),T(je))}(Ve,je);if((0,lt.T)(Ve))return Q(Ve,je);if((0,Ze.x)(Ve))return function xe(Ve,je){return new le.c(Ye=>{let it;return(0,o.N)(Ye,je,()=>{it=Ve[oe.l](),(0,o.N)(Ye,je,()=>{let et,tn;try{({value:et,done:tn}=it.next())}catch(ke){return void Ye.error(ke)}tn?Ye.complete():Ye.next(et)},0,!0)}),()=>(0,_e.T)(it?.return)&&it.return()})}(Ve,je);if((0,Oe.U)(Ve))return function we(Ve,je){return Q((0,Oe.C)(Ve),je)}(Ve,je)}throw(0,Dt.L)(Ve)}(Ve,je):(0,h.Tg)(Ve)}},7412:(Je,he,I)=>{I.d(he,{Tg:()=>xe});var h=I(5823),o=I(5271),W=I(4760),X=I(7787),T=I(9533),pe=I(1391),J=I(3985),fe=I(8419),le=I(8030),de=I(2097),oe=I(8508),_e=I(1852);function xe(Oe){if(Oe instanceof X.c)return Oe;if(null!=Oe){if((0,T.l)(Oe))return function Q(Oe){return new X.c(we=>{const Ge=Oe[_e.s]();if((0,de.T)(Ge.subscribe))return Ge.subscribe(we);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}(Oe);if((0,o.X)(Oe))return function ve(Oe){return new X.c(we=>{for(let Ge=0;Ge<Oe.length&&!we.closed;Ge++)we.next(Oe[Ge]);we.complete()})}(Oe);if((0,W.y)(Oe))return function He(Oe){return new X.c(we=>{Oe.then(Ge=>{we.closed||(we.next(Ge),we.complete())},Ge=>we.error(Ge)).then(null,oe.m)})}(Oe);if((0,pe.T)(Oe))return Ze(Oe);if((0,fe.x)(Oe))return function Pe(Oe){return new X.c(we=>{for(const Ge of Oe)if(we.next(Ge),we.closed)return;we.complete()})}(Oe);if((0,le.U)(Oe))return function lt(Oe){return Ze((0,le.C)(Oe))}(Oe)}throw(0,J.L)(Oe)}function Ze(Oe){return new X.c(we=>{(function Dt(Oe,we){var Ge,Ke,Ve,je;return(0,h.sH)(this,void 0,void 0,function*(){try{for(Ge=(0,h.xN)(Oe);!(Ke=yield Ge.next()).done;)if(we.next(Ke.value),we.closed)return}catch(Ye){Ve={error:Ye}}finally{try{Ke&&!Ke.done&&(je=Ge.return)&&(yield je.call(Ge))}finally{if(Ve)throw Ve.error}}we.complete()})})(Oe,we).catch(Ge=>we.error(Ge))})}},1467:(Je,he,I)=>{I.d(he,{of:()=>W});var h=I(1315),o=I(4850);function W(...X){const T=(0,h.lI)(X);return(0,o.H)(X,T)}},1968:(Je,he,I)=>{I.d(he,{$:()=>W});var h=I(7787),o=I(2097);function W(X,T){const pe=(0,o.T)(X)?X:()=>X,J=fe=>fe.error(pe());return new h.c(T?fe=>T.schedule(J,0,fe):J)}},5510:(Je,he,I)=>{I.d(he,{_:()=>o});var h=I(3173);function o(X,T,pe,J,fe){return new W(X,T,pe,J,fe)}class W extends h.vU{constructor(T,pe,J,fe,le,de){super(T),this.onFinalize=le,this.shouldUnsubscribe=de,this._next=pe?function(oe){try{pe(oe)}catch(_e){T.error(_e)}}:super._next,this._error=fe?function(oe){try{fe(oe)}catch(_e){T.error(_e)}finally{this.unsubscribe()}}:super._error,this._complete=J?function(){try{J()}catch(oe){T.error(oe)}finally{this.unsubscribe()}}:super._complete}unsubscribe(){var T;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){const{closed:pe}=this;super.unsubscribe(),!pe&&(null===(T=this.onFinalize)||void 0===T||T.call(this))}}}},8919:(Je,he,I)=>{I.d(he,{W:()=>X});var h=I(7412),o=I(5510),W=I(1524);function X(T){return(0,W.N)((pe,J)=>{let de,fe=null,le=!1;fe=pe.subscribe((0,o._)(J,void 0,void 0,oe=>{de=(0,h.Tg)(T(oe,X(T)(pe))),fe?(fe.unsubscribe(),fe=null,de.subscribe(J)):le=!0})),le&&(fe.unsubscribe(),fe=null,de.subscribe(J))})}},6944:(Je,he,I)=>{I.d(he,{H:()=>W});var h=I(3575),o=I(2097);function W(X,T){return(0,o.T)(T)?(0,h.Z)(X,T,1):(0,h.Z)(X,1)}},4534:(Je,he,I)=>{I.d(he,{p:()=>W});var h=I(1524),o=I(5510);function W(X,T){return(0,h.N)((pe,J)=>{let fe=0;pe.subscribe((0,o._)(J,le=>X.call(T,le,fe++)&&J.next(le)))})}},1554:(Je,he,I)=>{I.d(he,{j:()=>o});var h=I(1524);function o(W){return(0,h.N)((X,T)=>{try{X.subscribe(T)}finally{T.add(W)}})}},2816:(Je,he,I)=>{I.d(he,{T:()=>W});var h=I(1524),o=I(5510);function W(X,T){return(0,h.N)((pe,J)=>{let fe=0;pe.subscribe((0,o._)(J,le=>{J.next(X.call(T,le,fe++))}))})}},3575:(Je,he,I)=>{I.d(he,{Z:()=>fe});var h=I(2816),o=I(7412),W=I(1524),X=I(1203),T=I(5510),J=I(2097);function fe(le,de,oe=1/0){return(0,J.T)(de)?fe((_e,xe)=>(0,h.T)((Q,ve)=>de(_e,Q,xe,ve))((0,o.Tg)(le(_e,xe))),oe):("number"==typeof de&&(oe=de),(0,W.N)((_e,xe)=>function pe(le,de,oe,_e,xe,Q,ve,He){const Pe=[];let Ze=0,lt=0,Dt=!1;const Oe=()=>{Dt&&!Pe.length&&!Ze&&de.complete()},we=Ke=>Ze<_e?Ge(Ke):Pe.push(Ke),Ge=Ke=>{Q&&de.next(Ke),Ze++;let Ve=!1;(0,o.Tg)(oe(Ke,lt++)).subscribe((0,T._)(de,je=>{xe?.(je),Q?we(je):de.next(je)},()=>{Ve=!0},void 0,()=>{if(Ve)try{for(Ze--;Pe.length&&Ze<_e;){const je=Pe.shift();ve?(0,X.N)(de,ve,()=>Ge(je)):Ge(je)}Oe()}catch(je){de.error(je)}}))};return le.subscribe((0,T._)(de,we,()=>{Dt=!0,Oe()})),()=>{He?.()}}(_e,xe,le,oe)))}},8128:(Je,he,I)=>{I.d(he,{n:()=>X});var h=I(7412),o=I(1524),W=I(5510);function X(T,pe){return(0,o.N)((J,fe)=>{let le=null,de=0,oe=!1;const _e=()=>oe&&!le&&fe.complete();J.subscribe((0,W._)(fe,xe=>{le?.unsubscribe();let Q=0;const ve=de++;(0,h.Tg)(T(xe,ve)).subscribe(le=(0,W._)(fe,He=>fe.next(pe?pe(xe,He,ve,Q++):He),()=>{le=null,_e()}))},()=>{oe=!0,_e()}))})}},5719:(Je,he,I)=>{I.d(he,{Q:()=>T});var h=I(1524),o=I(5510),W=I(7412),X=I(9405);function T(pe){return(0,h.N)((J,fe)=>{(0,W.Tg)(pe).subscribe((0,o._)(fe,()=>fe.complete(),X.l)),!fe.closed&&J.subscribe(fe)})}},6243:(Je,he,I)=>{I.d(he,{M:()=>T});var h=I(2097),o=I(1524),W=I(5510),X=I(3867);function T(pe,J,fe){const le=(0,h.T)(pe)||J||fe?{next:pe,error:J,complete:fe}:pe;return le?(0,o.N)((de,oe)=>{var _e;null===(_e=le.subscribe)||void 0===_e||_e.call(le);let xe=!0;de.subscribe((0,W._)(oe,Q=>{var ve;null===(ve=le.next)||void 0===ve||ve.call(le,Q),oe.next(Q)},()=>{var Q;xe=!1,null===(Q=le.complete)||void 0===Q||Q.call(le),oe.complete()},Q=>{var ve;xe=!1,null===(ve=le.error)||void 0===ve||ve.call(le,Q),oe.error(Q)},()=>{var Q,ve;xe&&(null===(Q=le.unsubscribe)||void 0===Q||Q.call(le)),null===(ve=le.finalize)||void 0===ve||ve.call(le)}))}):X.D}},7680:(Je,he,I)=>{I.d(he,{f:()=>h});const h={setTimeout(o,W,...X){const{delegate:T}=h;return T?.setTimeout?T.setTimeout(o,W,...X):setTimeout(o,W,...X)},clearTimeout(o){const{delegate:W}=h;return(W?.clearTimeout||clearTimeout)(o)},delegate:void 0}},979:(Je,he,I)=>{I.d(he,{l:()=>o});const o=function h(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}()},1852:(Je,he,I)=>{I.d(he,{s:()=>h});const h="function"==typeof Symbol&&Symbol.observable||"@@observable"},4392:(Je,he,I)=>{I.d(he,{G:()=>o});const o=(0,I(1531).L)(W=>function(){W(this),this.name="EmptyError",this.message="no elements in sequence"})},1315:(Je,he,I)=>{I.d(he,{ms:()=>X,lI:()=>T});var h=I(2097);function W(J){return J[J.length-1]}function X(J){return(0,h.T)(W(J))?J.pop():void 0}function T(J){return function o(J){return J&&(0,h.T)(J.schedule)}(W(J))?J.pop():void 0}},4047:(Je,he,I)=>{I.d(he,{D:()=>T});const{isArray:h}=Array,{getPrototypeOf:o,prototype:W,keys:X}=Object;function T(J){if(1===J.length){const fe=J[0];if(h(fe))return{args:fe,keys:null};if(function pe(J){return J&&"object"==typeof J&&o(J)===W}(fe)){const le=X(fe);return{args:le.map(de=>fe[de]),keys:le}}}return{args:J,keys:null}}},2070:(Je,he,I)=>{function h(o,W){if(o){const X=o.indexOf(W);0<=X&&o.splice(X,1)}}I.d(he,{o:()=>h})},1531:(Je,he,I)=>{function h(o){const X=o(T=>{Error.call(T),T.stack=(new Error).stack});return X.prototype=Object.create(Error.prototype),X.prototype.constructor=X,X}I.d(he,{L:()=>h})},8746:(Je,he,I)=>{function h(o,W){return o.reduce((X,T,pe)=>(X[T]=W[pe],X),{})}I.d(he,{e:()=>h})},7112:(Je,he,I)=>{I.d(he,{Y:()=>W,l:()=>X});var h=I(2904);let o=null;function W(T){if(h.$.useDeprecatedSynchronousErrorHandling){const pe=!o;if(pe&&(o={errorThrown:!1,error:null}),T(),pe){const{errorThrown:J,error:fe}=o;if(o=null,J)throw fe}}else T()}function X(T){h.$.useDeprecatedSynchronousErrorHandling&&o&&(o.errorThrown=!0,o.error=T)}},1203:(Je,he,I)=>{function h(o,W,X,T=0,pe=!1){const J=W.schedule(function(){X(),pe?o.add(this.schedule(null,T)):this.unsubscribe()},T);if(o.add(J),!pe)return J}I.d(he,{N:()=>h})},3867:(Je,he,I)=>{function h(o){return o}I.d(he,{D:()=>h})},5271:(Je,he,I)=>{I.d(he,{X:()=>h});const h=o=>o&&"number"==typeof o.length&&"function"!=typeof o},1391:(Je,he,I)=>{I.d(he,{T:()=>o});var h=I(2097);function o(W){return Symbol.asyncIterator&&(0,h.T)(W?.[Symbol.asyncIterator])}},2097:(Je,he,I)=>{function h(o){return"function"==typeof o}I.d(he,{T:()=>h})},9533:(Je,he,I)=>{I.d(he,{l:()=>W});var h=I(1852),o=I(2097);function W(X){return(0,o.T)(X[h.s])}},8419:(Je,he,I)=>{I.d(he,{x:()=>W});var h=I(979),o=I(2097);function W(X){return(0,o.T)(X?.[h.l])}},7624:(Je,he,I)=>{I.d(he,{A:()=>W});var h=I(7787),o=I(2097);function W(X){return!!X&&(X instanceof h.c||(0,o.T)(X.lift)&&(0,o.T)(X.subscribe))}},4760:(Je,he,I)=>{I.d(he,{y:()=>o});var h=I(2097);function o(W){return(0,h.T)(W?.then)}},8030:(Je,he,I)=>{I.d(he,{C:()=>W,U:()=>X});var h=I(5823),o=I(2097);function W(T){return(0,h.AQ)(this,arguments,function*(){const J=T.getReader();try{for(;;){const{value:fe,done:le}=yield(0,h.N3)(J.read());if(le)return yield(0,h.N3)(void 0);yield yield(0,h.N3)(fe)}}finally{J.releaseLock()}})}function X(T){return(0,o.T)(T?.getReader)}},1524:(Je,he,I)=>{I.d(he,{N:()=>W,S:()=>o});var h=I(2097);function o(X){return(0,h.T)(X?.lift)}function W(X){return T=>{if(o(T))return T.lift(function(pe){try{return X(pe,this)}catch(J){this.error(J)}});throw new TypeError("Unable to lift unknown Observable type")}}},7236:(Je,he,I)=>{I.d(he,{I:()=>X});var h=I(2816);const{isArray:o}=Array;function X(T){return(0,h.T)(pe=>function W(T,pe){return o(pe)?T(...pe):T(pe)}(T,pe))}},9405:(Je,he,I)=>{function h(){}I.d(he,{l:()=>h})},9493:(Je,he,I)=>{I.d(he,{F:()=>o,m:()=>W});var h=I(3867);function o(...X){return W(X)}function W(X){return 0===X.length?h.D:1===X.length?X[0]:function(pe){return X.reduce((J,fe)=>fe(J),pe)}}},8508:(Je,he,I)=>{I.d(he,{m:()=>W});var h=I(2904),o=I(7680);function W(X){o.f.setTimeout(()=>{const{onUnhandledError:T}=h.$;if(!T)throw X;T(X)})}},3985:(Je,he,I)=>{function h(o){return new TypeError(`You provided ${null!==o&&"object"==typeof o?"an invalid object":`'${o}'`} where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}I.d(he,{L:()=>h})},2943:(Je,he,I)=>{I.d(he,{AJ:()=>rt,IJ:()=>jn,MD:()=>Se,N0:()=>Oi,QT:()=>W,Qn:()=>Ne,Sm:()=>He,Sq:()=>ot,VF:()=>T,Vy:()=>Bn,WO:()=>Gn,Xr:()=>Ai,YU:()=>ce,ZD:()=>X,_b:()=>V,aZ:()=>Ze,bT:()=>Wt,fw:()=>Pe,hb:()=>Q,hj:()=>le,oe:()=>te,pM:()=>ot,qQ:()=>J,vh:()=>Or});var h=I(8284);
|
|
7
7
|
/**
|
|
8
8
|
* @license Angular v17.3.12
|
|
9
9
|
* (c) 2010-2024 Google LLC. https://angular.io/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";var e,v={},m={};function r(e){var d=m[e];if(void 0!==d)return d.exports;var t=m[e]={id:e,loaded:!1,exports:{}};return v[e](t,t.exports,r),t.loaded=!0,t.exports}r.m=v,e=[],r.O=(d,t,i,f)=>{if(!t){var a=1/0;for(n=0;n<e.length;n++){for(var[t,i,f]=e[n],s=!0,o=0;o<t.length;o++)(!1&f||a>=f)&&Object.keys(r.O).every(b=>r.O[b](t[o]))?t.splice(o--,1):(s=!1,f<a&&(a=f));if(s){e.splice(n--,1);var l=i();void 0!==l&&(d=l)}}return d}f=f||0;for(var n=e.length;n>0&&e[n-1][2]>f;n--)e[n]=e[n-1];e[n]=[t,i,f]},r.d=(e,d)=>{for(var t in d)r.o(d,t)&&!r.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:d[t]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((d,t)=>(r.f[t](e,d),d),[])),r.u=e=>e+"."+{45:"a8f252c4d479ea1c",69:"3a06102c8e39ae88",256:"cf479e10e4de8f41",693:"78d2d5a546c5c39a"}[e]+".js",r.miniCssF=e=>{},r.o=(e,d)=>Object.prototype.hasOwnProperty.call(e,d),(()=>{var e={},d="admin:";r.l=(t,i,f,n)=>{if(e[t])e[t].push(i);else{var a,s;if(void 0!==f)for(var o=document.getElementsByTagName("script"),l=0;l<o.length;l++){var u=o[l];if(u.getAttribute("src")==t||u.getAttribute("data-webpack")==d+f){a=u;break}}a||(s=!0,(a=document.createElement("script")).type="module",a.charset="utf-8",a.timeout=120,r.nc&&a.setAttribute("nonce",r.nc),a.setAttribute("data-webpack",d+f),a.src=r.tu(t)),e[t]=[i];var c=(g,b)=>{a.onerror=a.onload=null,clearTimeout(p);var h=e[t];if(delete e[t],a.parentNode&&a.parentNode.removeChild(a),h&&h.forEach(y=>y(b)),g)return g(b)},p=setTimeout(c.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=c.bind(null,a.onerror),a.onload=c.bind(null,a.onload),s&&document.head.appendChild(a)}}})(),r.r=e=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;r.tt=()=>(void 0===e&&(e={createScriptURL:d=>d},typeof trustedTypes<"u"&&trustedTypes.createPolicy&&(e=trustedTypes.createPolicy("angular#bundler",e))),e)})(),r.tu=e=>r.tt().createScriptURL(e),r.p="",(()=>{var e={121:0};r.f.j=(i,f)=>{var n=r.o(e,i)?e[i]:void 0;if(0!==n)if(n)f.push(n[2]);else if(121!=i){var a=new Promise((u,c)=>n=e[i]=[u,c]);f.push(n[2]=a);var s=r.p+r.u(i),o=new Error;r.l(s,u=>{if(r.o(e,i)&&(0!==(n=e[i])&&(e[i]=void 0),n)){var c=u&&("load"===u.type?"missing":u.type),p=u&&u.target&&u.target.src;o.message="Loading chunk "+i+" failed.\n("+c+": "+p+")",o.name="ChunkLoadError",o.type=c,o.request=p,n[1](o)}},"chunk-"+i,i)}else e[i]=0},r.O.j=i=>0===e[i];var d=(i,f)=>{var o,l,[n,a,s]=f,u=0;if(n.some(p=>0!==e[p])){for(o in a)r.o(a,o)&&(r.m[o]=a[o]);if(s)var c=s(r)}for(i&&i(f);u<n.length;u++)r.o(e,l=n[u])&&e[l]&&e[l][0](),e[l]=0;return r.O(c)},t=self.webpackChunkadmin=self.webpackChunkadmin||[];t.forEach(d.bind(null,0)),t.push=d.bind(null,t.push.bind(t))})()})();
|
|
@@ -45,10 +45,10 @@ function getRandomIntExcluding({ min, max, exclude }) {
|
|
|
45
45
|
: randomInt;
|
|
46
46
|
}
|
|
47
47
|
function getDtoPropertyNameFromRelationship(relationship) {
|
|
48
|
-
if (relationship
|
|
48
|
+
if (relationship?.type === 'many-to-one') {
|
|
49
49
|
return relationship.name + 'Id';
|
|
50
50
|
}
|
|
51
|
-
else if (relationship
|
|
51
|
+
else if (relationship?.type === 'many-to-many') {
|
|
52
52
|
return relationship.name.endsWith('s')
|
|
53
53
|
? relationship.name.slice(0, -1) + 'Ids'
|
|
54
54
|
: relationship.name + 'Id';
|
|
@@ -13,6 +13,7 @@ export declare class CrudService {
|
|
|
13
13
|
private readonly validationService;
|
|
14
14
|
private readonly relationshipService;
|
|
15
15
|
constructor(entityService: EntityService, entityManifestService: EntityManifestService, paginationService: PaginationService, validationService: ValidationService, relationshipService: RelationshipService);
|
|
16
|
+
private filterValidProperties;
|
|
16
17
|
findAll({ entitySlug, queryParams, fullVersion }: {
|
|
17
18
|
entitySlug: string;
|
|
18
19
|
queryParams?: {
|
|
@@ -31,6 +31,22 @@ let CrudService = class CrudService {
|
|
|
31
31
|
this.validationService = validationService;
|
|
32
32
|
this.relationshipService = relationshipService;
|
|
33
33
|
}
|
|
34
|
+
filterValidProperties(itemDto, entityRepository) {
|
|
35
|
+
const entityMetadata = entityRepository.metadata;
|
|
36
|
+
const allColumns = entityMetadata.columns.map((col) => col.propertyName);
|
|
37
|
+
const validRelationships = entityMetadata.relations.map((rel) => rel.propertyName);
|
|
38
|
+
const validProperties = allColumns.filter((col) => !validRelationships.includes(col));
|
|
39
|
+
return Object.fromEntries(Object.entries(itemDto).filter(([key]) => {
|
|
40
|
+
if (validProperties.includes(key)) {
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
if (key.endsWith('Id') &&
|
|
44
|
+
validRelationships.includes(key.slice(0, -2))) {
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
return false;
|
|
48
|
+
}));
|
|
49
|
+
}
|
|
34
50
|
async findAll({ entitySlug, queryParams, fullVersion }) {
|
|
35
51
|
const entityManifest = this.entityManifestService.getEntityManifest({
|
|
36
52
|
slug: entitySlug,
|
|
@@ -112,6 +128,11 @@ let CrudService = class CrudService {
|
|
|
112
128
|
relationships: entityManifest.relationships,
|
|
113
129
|
requestedRelations: queryParams?.relations?.toString().split(',')
|
|
114
130
|
});
|
|
131
|
+
this.filterQuery({
|
|
132
|
+
query,
|
|
133
|
+
queryParams,
|
|
134
|
+
entityManifest
|
|
135
|
+
});
|
|
115
136
|
const item = await query.getOne();
|
|
116
137
|
if (!item) {
|
|
117
138
|
throw new common_1.NotFoundException('Item not found');
|
|
@@ -124,17 +145,17 @@ let CrudService = class CrudService {
|
|
|
124
145
|
slug: entitySlug,
|
|
125
146
|
fullVersion: true
|
|
126
147
|
});
|
|
127
|
-
const newItem = this.createWithDefaults({
|
|
128
|
-
repository,
|
|
129
|
-
entityManifest,
|
|
130
|
-
itemDto
|
|
131
|
-
});
|
|
132
148
|
const relationItems = await this.relationshipService.fetchRelationItemsFromDto({
|
|
133
149
|
itemDto,
|
|
134
150
|
relationships: entityManifest.relationships
|
|
135
151
|
.filter((r) => r.type !== 'one-to-many')
|
|
136
152
|
.filter((r) => r.type !== 'many-to-many' || r.owningSide)
|
|
137
153
|
});
|
|
154
|
+
const newItem = this.createWithDefaults({
|
|
155
|
+
repository,
|
|
156
|
+
entityManifest,
|
|
157
|
+
itemDto: this.filterValidProperties(itemDto, repository)
|
|
158
|
+
});
|
|
138
159
|
entityManifest.properties
|
|
139
160
|
.filter((prop) => prop.type === types_1.PropType.Password)
|
|
140
161
|
.forEach((prop) => {
|
|
@@ -176,8 +197,9 @@ let CrudService = class CrudService {
|
|
|
176
197
|
.filter((r) => r.type !== 'many-to-many' || r.owningSide),
|
|
177
198
|
emptyMissing: !partialReplacement
|
|
178
199
|
});
|
|
200
|
+
let filteredItemDto = this.filterValidProperties(itemDto, entityRepository);
|
|
179
201
|
if (partialReplacement) {
|
|
180
|
-
|
|
202
|
+
filteredItemDto = { ...item, ...filteredItemDto };
|
|
181
203
|
Object.keys(relationItems).forEach((key) => {
|
|
182
204
|
if (relationItems[key] === undefined ||
|
|
183
205
|
relationItems[key]?.length === 0) {
|
|
@@ -187,10 +209,10 @@ let CrudService = class CrudService {
|
|
|
187
209
|
}
|
|
188
210
|
const updatedItem = entityRepository.create({
|
|
189
211
|
id: item.id,
|
|
190
|
-
...
|
|
212
|
+
...filteredItemDto
|
|
191
213
|
});
|
|
192
|
-
if (entityManifest.authenticable &&
|
|
193
|
-
updatedItem.password = bcryptjs_1.default.hashSync(
|
|
214
|
+
if (entityManifest.authenticable && filteredItemDto.password) {
|
|
215
|
+
updatedItem.password = bcryptjs_1.default.hashSync(filteredItemDto['password'], constants_1.SALT_ROUNDS);
|
|
194
216
|
}
|
|
195
217
|
const errors = this.validationService.validate(updatedItem, entityManifest, {
|
|
196
218
|
isUpdate: true
|
|
@@ -15,6 +15,7 @@ const manifest_module_1 = require("../manifest/manifest.module");
|
|
|
15
15
|
const auth_module_1 = require("../auth/auth.module");
|
|
16
16
|
const policy_module_1 = require("../policy/policy.module");
|
|
17
17
|
const handler_module_1 = require("../handler/handler.module");
|
|
18
|
+
const entity_module_1 = require("../entity/entity.module");
|
|
18
19
|
let EndpointModule = class EndpointModule {
|
|
19
20
|
configure(consumer) {
|
|
20
21
|
consumer.apply(match_endpoint_middleware_1.MatchEndpointMiddleware).forRoutes(endpoint_controller_1.EndpointController);
|
|
@@ -26,6 +27,7 @@ exports.EndpointModule = EndpointModule = __decorate([
|
|
|
26
27
|
imports: [
|
|
27
28
|
(0, common_1.forwardRef)(() => manifest_module_1.ManifestModule),
|
|
28
29
|
(0, common_1.forwardRef)(() => auth_module_1.AuthModule),
|
|
30
|
+
(0, common_1.forwardRef)(() => entity_module_1.EntityModule),
|
|
29
31
|
policy_module_1.PolicyModule,
|
|
30
32
|
handler_module_1.HandlerModule
|
|
31
33
|
],
|
|
@@ -1,4 +1,18 @@
|
|
|
1
|
-
import { AccessPolicy, AuthenticableEntity, EntityManifest } from '@repo/types';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
1
|
+
import { AccessPolicy, AuthenticableEntity, BaseEntity, EntityManifest } from '@repo/types';
|
|
2
|
+
import { Rule } from './types/rule.type';
|
|
3
|
+
import { Request } from 'express';
|
|
4
|
+
import { Repository } from 'typeorm';
|
|
5
|
+
interface PolicyParams {
|
|
6
|
+
user: AuthenticableEntity;
|
|
7
|
+
entityManifest: EntityManifest;
|
|
8
|
+
entityRepository?: Repository<BaseEntity>;
|
|
9
|
+
userEntityManifest: EntityManifest;
|
|
10
|
+
rule?: Rule;
|
|
11
|
+
request?: Request;
|
|
12
|
+
options?: {
|
|
13
|
+
allow?: string[];
|
|
14
|
+
condition?: 'self';
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export declare const policies: Record<AccessPolicy, (params: PolicyParams) => Promise<boolean>>;
|
|
18
|
+
export {};
|
|
@@ -1,21 +1,67 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.policies = void 0;
|
|
4
|
+
const types_1 = require("../../../types/src");
|
|
4
5
|
const constants_1 = require("../constants");
|
|
6
|
+
const src_1 = require("../../../common/src");
|
|
5
7
|
exports.policies = {
|
|
6
|
-
admin: (user,
|
|
7
|
-
public: (
|
|
8
|
-
forbidden: (
|
|
9
|
-
restricted: (
|
|
10
|
-
if (!user) {
|
|
11
|
-
return false;
|
|
8
|
+
admin: ({ user, userEntityManifest }) => Promise.resolve(user && userEntityManifest.slug === constants_1.ADMIN_ENTITY_MANIFEST.slug),
|
|
9
|
+
public: () => Promise.resolve(true),
|
|
10
|
+
forbidden: () => Promise.resolve(false),
|
|
11
|
+
restricted: async (params) => {
|
|
12
|
+
if (!params.user) {
|
|
13
|
+
return Promise.resolve(false);
|
|
12
14
|
}
|
|
13
|
-
if (exports.policies.admin(
|
|
14
|
-
return true;
|
|
15
|
+
if (await exports.policies.admin(params)) {
|
|
16
|
+
return Promise.resolve(true);
|
|
15
17
|
}
|
|
16
|
-
if (options
|
|
17
|
-
|
|
18
|
+
if (params.options?.allow &&
|
|
19
|
+
!params.options.allow.includes(params.userEntityManifest.className)) {
|
|
20
|
+
return Promise.resolve(false);
|
|
18
21
|
}
|
|
19
|
-
|
|
22
|
+
if (params.options?.condition === 'self') {
|
|
23
|
+
const relationshipWithUser = params.entityManifest.relationships.find((r) => r.entity === params.userEntityManifest.className);
|
|
24
|
+
if (!relationshipWithUser) {
|
|
25
|
+
return Promise.resolve(false);
|
|
26
|
+
}
|
|
27
|
+
const dtoOwnershipPropertyName = (0, src_1.getDtoPropertyNameFromRelationship)(relationshipWithUser);
|
|
28
|
+
if (params.rule === 'create') {
|
|
29
|
+
if (params.request.body[dtoOwnershipPropertyName] !== params.user.id) {
|
|
30
|
+
return Promise.resolve(false);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
if (params.rule === 'update' || params.rule === 'delete') {
|
|
34
|
+
const requestedRecord = await params.entityRepository.findOneOrFail({
|
|
35
|
+
where: {
|
|
36
|
+
id: params.request.params.id
|
|
37
|
+
},
|
|
38
|
+
relations: [relationshipWithUser.name]
|
|
39
|
+
});
|
|
40
|
+
if (requestedRecord[relationshipWithUser.name]?.id !==
|
|
41
|
+
params.user.id) {
|
|
42
|
+
return Promise.resolve(false);
|
|
43
|
+
}
|
|
44
|
+
if (params.rule === 'update') {
|
|
45
|
+
if (params.request.body[dtoOwnershipPropertyName] &&
|
|
46
|
+
params.request.body[dtoOwnershipPropertyName] !==
|
|
47
|
+
requestedRecord[relationshipWithUser.name]?.id) {
|
|
48
|
+
return Promise.resolve(false);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
if (params.rule === 'read') {
|
|
53
|
+
const relationQueryParam = params.request.query['relations'] || '';
|
|
54
|
+
if (!relationQueryParam.includes(relationshipWithUser.name)) {
|
|
55
|
+
params.request.query['relations'] = relationQueryParam
|
|
56
|
+
? relationQueryParam + ',' + relationshipWithUser.name
|
|
57
|
+
: relationshipWithUser.name;
|
|
58
|
+
}
|
|
59
|
+
params.request.query = {
|
|
60
|
+
...params.request.query,
|
|
61
|
+
[relationshipWithUser.name + '.id' + types_1.WhereKeySuffix.Equal]: params.user.id
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return Promise.resolve(true);
|
|
20
66
|
}
|
|
21
67
|
};
|
|
@@ -2,11 +2,13 @@ import { CanActivate, ExecutionContext } from '@nestjs/common';
|
|
|
2
2
|
import { Reflector } from '@nestjs/core';
|
|
3
3
|
import { AuthService } from '../auth/auth.service';
|
|
4
4
|
import { EntityManifestService } from '../manifest/services/entity-manifest.service';
|
|
5
|
+
import { EntityService } from '../entity/services/entity.service';
|
|
5
6
|
export declare class PolicyGuard implements CanActivate {
|
|
6
7
|
private readonly reflector;
|
|
7
8
|
private readonly entityManifestService;
|
|
9
|
+
private readonly entityService;
|
|
8
10
|
private readonly authService;
|
|
9
|
-
constructor(reflector: Reflector, entityManifestService: EntityManifestService, authService: AuthService);
|
|
11
|
+
constructor(reflector: Reflector, entityManifestService: EntityManifestService, entityService: EntityService, authService: AuthService);
|
|
10
12
|
canActivate(context: ExecutionContext): Promise<boolean>;
|
|
11
13
|
private getCrudPolicies;
|
|
12
14
|
}
|
|
@@ -15,10 +15,12 @@ const core_1 = require("@nestjs/core");
|
|
|
15
15
|
const auth_service_1 = require("../auth/auth.service");
|
|
16
16
|
const entity_manifest_service_1 = require("../manifest/services/entity-manifest.service");
|
|
17
17
|
const policies_1 = require("./policies");
|
|
18
|
+
const entity_service_1 = require("../entity/services/entity.service");
|
|
18
19
|
let PolicyGuard = class PolicyGuard {
|
|
19
|
-
constructor(reflector, entityManifestService, authService) {
|
|
20
|
+
constructor(reflector, entityManifestService, entityService, authService) {
|
|
20
21
|
this.reflector = reflector;
|
|
21
22
|
this.entityManifestService = entityManifestService;
|
|
23
|
+
this.entityService = entityService;
|
|
22
24
|
this.authService = authService;
|
|
23
25
|
}
|
|
24
26
|
async canActivate(context) {
|
|
@@ -26,15 +28,19 @@ let PolicyGuard = class PolicyGuard {
|
|
|
26
28
|
if (!rule) {
|
|
27
29
|
return true;
|
|
28
30
|
}
|
|
29
|
-
const
|
|
31
|
+
const request = context.switchToHttp().getRequest();
|
|
30
32
|
let routePolicies;
|
|
33
|
+
let entityManifest;
|
|
31
34
|
if (rule === 'dynamic-endpoint') {
|
|
32
|
-
routePolicies =
|
|
35
|
+
routePolicies = request['endpoint']?.policies || [];
|
|
33
36
|
}
|
|
34
37
|
else {
|
|
35
38
|
routePolicies = await this.getCrudPolicies(rule, context.getArgs()[0].params.entity);
|
|
39
|
+
entityManifest = this.entityManifestService.getEntityManifest({
|
|
40
|
+
slug: context.getArgs()[0].params.entity
|
|
41
|
+
});
|
|
36
42
|
}
|
|
37
|
-
const { user, entitySlug: userEntitySlug } = (await this.authService.getUserFromRequest(
|
|
43
|
+
const { user, entitySlug: userEntitySlug } = (await this.authService.getUserFromRequest(request)) || {};
|
|
38
44
|
let userEntityManifest;
|
|
39
45
|
if (userEntitySlug) {
|
|
40
46
|
userEntityManifest = this.entityManifestService.getEntityManifest({
|
|
@@ -44,9 +50,30 @@ let PolicyGuard = class PolicyGuard {
|
|
|
44
50
|
else {
|
|
45
51
|
userEntityManifest = null;
|
|
46
52
|
}
|
|
47
|
-
return routePolicies.
|
|
53
|
+
return Promise.all(routePolicies.map((policy) => {
|
|
48
54
|
const policyFn = policies_1.policies[policy.access];
|
|
49
|
-
return policyFn(
|
|
55
|
+
return policyFn({
|
|
56
|
+
entityManifest,
|
|
57
|
+
entityRepository: entityManifest
|
|
58
|
+
? this.entityService.getEntityRepository({
|
|
59
|
+
entitySlug: entityManifest.slug
|
|
60
|
+
})
|
|
61
|
+
: null,
|
|
62
|
+
user,
|
|
63
|
+
userEntityManifest,
|
|
64
|
+
rule,
|
|
65
|
+
request,
|
|
66
|
+
options: {
|
|
67
|
+
allow: policy.allow,
|
|
68
|
+
condition: policy.condition
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}))
|
|
72
|
+
.then((results) => {
|
|
73
|
+
return results.every((result) => result === true);
|
|
74
|
+
})
|
|
75
|
+
.catch(() => {
|
|
76
|
+
return false;
|
|
50
77
|
});
|
|
51
78
|
}
|
|
52
79
|
async getCrudPolicies(rule, entitySlug) {
|
|
@@ -59,5 +86,6 @@ exports.PolicyGuard = PolicyGuard = __decorate([
|
|
|
59
86
|
(0, common_1.Injectable)(),
|
|
60
87
|
__metadata("design:paramtypes", [core_1.Reflector,
|
|
61
88
|
entity_manifest_service_1.EntityManifestService,
|
|
89
|
+
entity_service_1.EntityService,
|
|
62
90
|
auth_service_1.AuthService])
|
|
63
91
|
], PolicyGuard);
|
|
@@ -9,11 +9,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
exports.PolicyModule = void 0;
|
|
10
10
|
const common_1 = require("@nestjs/common");
|
|
11
11
|
const policy_service_1 = require("./policy.service");
|
|
12
|
+
const entity_module_1 = require("../entity/entity.module");
|
|
12
13
|
let PolicyModule = class PolicyModule {
|
|
13
14
|
};
|
|
14
15
|
exports.PolicyModule = PolicyModule;
|
|
15
16
|
exports.PolicyModule = PolicyModule = __decorate([
|
|
16
17
|
(0, common_1.Module)({
|
|
18
|
+
imports: [(0, common_1.forwardRef)(() => entity_module_1.EntityModule)],
|
|
17
19
|
providers: [policy_service_1.PolicyService],
|
|
18
20
|
exports: [policy_service_1.PolicyService]
|
|
19
21
|
})
|
|
@@ -10,7 +10,7 @@ exports.PolicyService = void 0;
|
|
|
10
10
|
const common_1 = require("@nestjs/common");
|
|
11
11
|
let PolicyService = class PolicyService {
|
|
12
12
|
transformPolicies(policySchemas, defaultPolicy) {
|
|
13
|
-
if (!policySchemas) {
|
|
13
|
+
if (!policySchemas?.length) {
|
|
14
14
|
return [defaultPolicy];
|
|
15
15
|
}
|
|
16
16
|
return policySchemas.map((policySchema) => {
|
|
@@ -40,6 +40,9 @@ let PolicyService = class PolicyService {
|
|
|
40
40
|
? [policySchema.allow]
|
|
41
41
|
: policySchema.allow;
|
|
42
42
|
}
|
|
43
|
+
if (policySchema.condition) {
|
|
44
|
+
policyManifest.condition = policySchema.condition;
|
|
45
|
+
}
|
|
43
46
|
return policyManifest;
|
|
44
47
|
});
|
|
45
48
|
}
|
|
@@ -83,6 +83,7 @@ export interface PoliciesSchema {
|
|
|
83
83
|
export interface PolicySchema {
|
|
84
84
|
access: 'public' | 'restricted' | 'forbidden' | 'admin' | '🌐' | '🚫' | '🔒' | '️👨🏻💻';
|
|
85
85
|
allow?: string | string[];
|
|
86
|
+
condition?: 'self';
|
|
86
87
|
}
|
|
87
88
|
export interface ValidationSchema1 {
|
|
88
89
|
isDefined?: boolean;
|
|
@@ -147,4 +148,5 @@ export interface EndpointSchema {
|
|
|
147
148
|
export interface PolicySchema1 {
|
|
148
149
|
access: 'public' | 'restricted' | 'forbidden' | 'admin' | '🌐' | '🚫' | '🔒' | '️👨🏻💻';
|
|
149
150
|
allow?: string | string[];
|
|
151
|
+
condition?: 'self';
|
|
150
152
|
}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(()=>{"use strict";var e,v={},m={};function r(e){var o=m[e];if(void 0!==o)return o.exports;var t=m[e]={id:e,loaded:!1,exports:{}};return v[e](t,t.exports,r),t.loaded=!0,t.exports}r.m=v,e=[],r.O=(o,t,i,d)=>{if(!t){var a=1/0;for(n=0;n<e.length;n++){for(var[t,i,d]=e[n],s=!0,f=0;f<t.length;f++)(!1&d||a>=d)&&Object.keys(r.O).every(b=>r.O[b](t[f]))?t.splice(f--,1):(s=!1,d<a&&(a=d));if(s){e.splice(n--,1);var l=i();void 0!==l&&(o=l)}}return o}d=d||0;for(var n=e.length;n>0&&e[n-1][2]>d;n--)e[n]=e[n-1];e[n]=[t,i,d]},r.d=(e,o)=>{for(var t in o)r.o(o,t)&&!r.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:o[t]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((o,t)=>(r.f[t](e,o),o),[])),r.u=e=>e+"."+{45:"a8f252c4d479ea1c",69:"9b3570b98630c452",256:"cf479e10e4de8f41",693:"78d2d5a546c5c39a"}[e]+".js",r.miniCssF=e=>{},r.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),(()=>{var e={},o="admin:";r.l=(t,i,d,n)=>{if(e[t])e[t].push(i);else{var a,s;if(void 0!==d)for(var f=document.getElementsByTagName("script"),l=0;l<f.length;l++){var u=f[l];if(u.getAttribute("src")==t||u.getAttribute("data-webpack")==o+d){a=u;break}}a||(s=!0,(a=document.createElement("script")).type="module",a.charset="utf-8",a.timeout=120,r.nc&&a.setAttribute("nonce",r.nc),a.setAttribute("data-webpack",o+d),a.src=r.tu(t)),e[t]=[i];var c=(g,b)=>{a.onerror=a.onload=null,clearTimeout(p);var h=e[t];if(delete e[t],a.parentNode&&a.parentNode.removeChild(a),h&&h.forEach(y=>y(b)),g)return g(b)},p=setTimeout(c.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=c.bind(null,a.onerror),a.onload=c.bind(null,a.onload),s&&document.head.appendChild(a)}}})(),r.r=e=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;r.tt=()=>(void 0===e&&(e={createScriptURL:o=>o},typeof trustedTypes<"u"&&trustedTypes.createPolicy&&(e=trustedTypes.createPolicy("angular#bundler",e))),e)})(),r.tu=e=>r.tt().createScriptURL(e),r.p="",(()=>{var e={121:0};r.f.j=(i,d)=>{var n=r.o(e,i)?e[i]:void 0;if(0!==n)if(n)d.push(n[2]);else if(121!=i){var a=new Promise((u,c)=>n=e[i]=[u,c]);d.push(n[2]=a);var s=r.p+r.u(i),f=new Error;r.l(s,u=>{if(r.o(e,i)&&(0!==(n=e[i])&&(e[i]=void 0),n)){var c=u&&("load"===u.type?"missing":u.type),p=u&&u.target&&u.target.src;f.message="Loading chunk "+i+" failed.\n("+c+": "+p+")",f.name="ChunkLoadError",f.type=c,f.request=p,n[1](f)}},"chunk-"+i,i)}else e[i]=0},r.O.j=i=>0===e[i];var o=(i,d)=>{var f,l,[n,a,s]=d,u=0;if(n.some(p=>0!==e[p])){for(f in a)r.o(a,f)&&(r.m[f]=a[f]);if(s)var c=s(r)}for(i&&i(d);u<n.length;u++)r.o(e,l=n[u])&&e[l]&&e[l][0](),e[l]=0;return r.O(c)},t=self.webpackChunkadmin=self.webpackChunkadmin||[];t.forEach(o.bind(null,0)),t.push=o.bind(null,t.push.bind(t))})()})();
|