UNPKG

manifest

Version:

The backend for AI code editors

6 lines 440 kB
"use strict";(self.webpackChunkadmin=self.webpackChunkadmin||[]).push([[792],{4783:(Ze,fe,b)=>{b.r(fe),b.d(fe,{AuthModule:()=>nn});var h=b(2943),o=b(8023),X=b(183),q=b(4385),T=b(8284);let ge=(()=>{class ke{constructor(be){this.router=be}canActivate(){return!localStorage.getItem(q.il)||(this.router.navigate(["/"]),!1)}static{this.\u0275fac=function(ze){return new(ze||ke)(T.KVO(X.Ix))}}static{this.\u0275prov=T.jDH({token:ke,factory:ke.\u0275fac,providedIn:"root"})}}return ke})();var J=b(7431),ye=b(9911),ve=b(5442),oe=b(7906),Y=b(2283),pe=b(8428);const Oe=ke=>({name:"email",type:ke}),Q=ke=>({name:"password",type:ke});function me(ke,vn){if(1&ke){const be=T.RV6();T.j41(0,"div",10)(1,"div",11)(2,"div",12)(3,"app-input",13),T.bIt("valueChanged",function(mt){T.eBV(be);const bt=T.XpG(2);return T.Njj(bt.patchValue("email",mt))}),T.k0s()()(),T.j41(4,"div",11)(5,"div",12)(6,"app-input",13),T.bIt("valueChanged",function(mt){T.eBV(be);const bt=T.XpG(2);return T.Njj(bt.patchValue("password",mt))}),T.k0s()()(),T.j41(7,"button",14),T.bIt("click",function(){T.eBV(be);const mt=T.XpG(2);return T.Njj(mt.submit())}),T.EFF(8," Login "),T.k0s(),T.j41(9,"div",15)(10,"span",16),T.EFF(11,"Built with"),T.k0s(),T.nrm(12,"img",17),T.k0s()()}if(2&ke){const be=T.XpG(2);T.R7$(3),T.Y8G("prop",T.eq3(5,Oe,be.PropType.Email))("value",be.suggestedEmail),T.R7$(3),T.Y8G("prop",T.eq3(7,Q,be.PropType.Password))("value",be.suggestedPassword),T.R7$(),T.Y8G("disabled",!be.form.valid)}}function He(ke,vn){if(1&ke&&(T.j41(0,"section",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"div",5)(5,"div")(6,"h1",6),T.EFF(7),T.k0s(),T.j41(8,"h2",7),T.EFF(9,"Sign in to your admin panel"),T.k0s(),T.DNE(10,me,13,9,"div",8),T.k0s()()(),T.nrm(11,"div",9),T.k0s()()()),2&ke){const be=T.XpG();T.R7$(7),T.SpI(" ",be.appName," "),T.R7$(3),T.Y8G("ngIf",be.form)}}let Pe=(()=>{class ke{constructor(be,ze,mt,bt){this.authService=be,this.router=ze,this.activatedRoute=mt,this.manifestService=bt,this.PropType=ve.Kk}ngOnInit(){var be=this;return(0,J.A)(function*(){(yield be.authService.isDbEmpty())&&be.router.navigate(["/auth/welcome"]),be.manifestService.getAppName().then(mt=>{be.appName=mt}),be.activatedRoute.queryParams.subscribe(function(){var mt=(0,J.A)(function*(bt){bt.email&&bt.password?(be.suggestedEmail=bt.email,be.suggestedPassword=bt.password):(yield be.authService.isDefaultAdminExists())&&(be.suggestedEmail=q.Fr.email,be.suggestedPassword=q.Fr.password),be.form=new ye.gE({email:new ye.MJ(be.suggestedEmail||"",[ye.k0.required,ye.k0.email]),password:new ye.MJ(be.suggestedPassword||"",[ye.k0.required])})});return function(bt){return mt.apply(this,arguments)}}())})()}patchValue(be,ze){this.form.get(be)?.patchValue(ze)}submit(){this.authService.login(this.form.value).then(()=>{this.router.navigate(["/"])},be=>{alert(401===be.status?"Error: Incorrect username or password.":be.error.message)})}static{this.\u0275fac=function(ze){return new(ze||ke)(T.rXU(oe.u),T.rXU(X.Ix),T.rXU(X.nX),T.rXU(Y.x))}}static{this.\u0275cmp=T.VBU({type:ke,selectors:[["app-login"]],decls:1,vars:1,consts:[["class","hero is-fullheight",4,"ngIf"],[1,"hero","is-fullheight"],[1,"hero-body"],[1,"container","has-text-centered"],[1,"columns"],[1,"column","col-login"],[1,"is-size-3","has-text-weight-bold"],[1,"title","is-5","mt-2"],["class","has-text-left",4,"ngIf"],[1,"column","col-decoration"],[1,"has-text-left"],[1,"field","mb-5"],[1,"control"],[3,"valueChanged","prop","value"],[1,"button","is-block","is-dark","is-fullwidth","mb-3",3,"click","disabled"],[1,"is-flex","is-align-items-center","is-justify-content-flex-end","my-3"],[2,"margin-top","9px"],["src","/assets/images/logo.svg","alt","manifest logo","width","94",1,"ml-3"]],template:function(ze,mt){1&ze&&T.DNE(0,He,12,2,"section",0),2&ze&&T.Y8G("ngIf",mt.appName)},dependencies:[h.bT,pe.S],styles:['@import"https://fonts.googleapis.com/css?family=Rubik:300,400,400i,500";.container[_ngcontent-%COMP%]{max-width:100%;width:100%}.hero.is-fullheight[_ngcontent-%COMP%]{min-height:calc(100vh - 64px)}.notification[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:auto;border-radius:0;bottom:unset}.col-login[_ngcontent-%COMP%]{position:fixed;display:flex;align-items:center;justify-content:center;background-color:#fff;left:0;top:0;height:100vh}.col-login[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{margin:auto}@media screen and (min-width: 1188px){.col-login[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{max-width:482px;min-width:382px}}@media screen and (min-width: 1000px){.col-login[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{max-width:424px;min-width:360px}}@media screen and (min-width: 768px),print{.col-login[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{max-width:424px;min-width:320px}}@media screen and (max-width: 767px){.col-login[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{min-width:50%;max-width:380px}}@media screen and (max-width: 999px){.col-login[_ngcontent-%COMP%]{width:66.66667%}}@media screen and (max-width: 767px){.col-login[_ngcontent-%COMP%]{width:100%}}@media screen and (min-width: 1000px){.col-login[_ngcontent-%COMP%]{width:40%}}@media screen and (min-width: 1188px){.col-login[_ngcontent-%COMP%]{width:33.33333%}}.col-decoration[_ngcontent-%COMP%]{width:60%}@media screen and (max-width: 999px){.col-decoration[_ngcontent-%COMP%]{width:33.33333%}}@media screen and (min-width: 1188px){.col-decoration[_ngcontent-%COMP%]{width:66.66666%}}']})}}return ke})(),Ye=(()=>{class ke{constructor(be,ze){this.authService=be,this.router=ze}ngOnInit(){this.authService.logout(),this.router.navigate(["/","auth","login"])}static{this.\u0275fac=function(ze){return new(ze||ke)(T.rXU(oe.u),T.rXU(X.Ix))}}static{this.\u0275cmp=T.VBU({type:ke,selectors:[["ng-component"]],decls:1,vars:0,template:function(ze,mt){1&ze&&T.EFF(0,"NO UI TO BE FOUND HERE!")},encapsulation:2})}}return ke})();function lt(ke){return vn=>{const be=vn.parent;if(!be)return null;const ze=be.get(ke);if(!ze)return null;const bt=vn.value;return bt&&ze.value===bt?null:{confirmPasswordMismatch:!0}}}var wt=b(818);const Se=ke=>({name:"email",type:ke}),we=ke=>({name:"password",type:ke}),Ge=ke=>({name:"confirm password",type:ke});function Ke(ke,vn){if(1&ke){const be=T.RV6();T.j41(0,"div",17)(1,"div",18)(2,"div",19)(3,"app-input",20),T.bIt("valueChanged",function(mt){T.eBV(be);const bt=T.XpG(2);return T.Njj(bt.patchValue("email",mt))}),T.k0s()()(),T.j41(4,"div",18)(5,"div",19)(6,"app-input",20),T.bIt("valueChanged",function(mt){T.eBV(be);const bt=T.XpG(2);return T.Njj(bt.patchValue("password",mt))}),T.k0s()()(),T.j41(7,"div",18)(8,"div",19)(9,"app-input",20),T.bIt("valueChanged",function(mt){T.eBV(be);const bt=T.XpG(2);return T.Njj(bt.patchValue("confirmPassword",mt))}),T.k0s()()()()}if(2&ke){const be=T.XpG(2);T.R7$(3),T.Y8G("prop",T.eq3(3,Se,be.PropType.Email)),T.R7$(3),T.Y8G("prop",T.eq3(5,we,be.PropType.Password)),T.R7$(3),T.Y8G("prop",T.eq3(7,Ge,be.PropType.Password))}}function Ve(ke,vn){if(1&ke){const be=T.RV6();T.j41(0,"div",5)(1,"div",6)(2,"div",7)(3,"div",8)(4,"div",9)(5,"h1",10),T.EFF(6),T.k0s(),T.j41(7,"p",11),T.EFF(8," Welcome to your admin panel, please create your first admin account to continue. You can always change those values later. "),T.k0s(),T.DNE(9,Ke,10,9,"div",12),T.j41(10,"button",13),T.bIt("click",function(){T.eBV(be);const mt=T.XpG();return T.Njj(mt.submit())}),T.EFF(11," Signup "),T.k0s()()()(),T.j41(12,"div",14)(13,"span",15),T.EFF(14,"Built with"),T.k0s(),T.nrm(15,"img",16),T.k0s()()()}if(2&ke){const be=T.XpG();T.R7$(6),T.SpI(" ",be.appName," "),T.R7$(3),T.Y8G("ngIf",be.form),T.R7$(),T.Y8G("disabled",!be.form.valid)}}const rt=[{path:"login",component:Pe,canActivate:[ge]},{path:"logout",component:Ye},{path:"welcome",component:(()=>{class ke{constructor(be,ze,mt,bt){this.authService=be,this.router=ze,this.flashMessageService=mt,this.manifestService=bt,this.PropType=ve.Kk}ngOnInit(){this.manifestService.getAppName().then(be=>{this.appName=be}),this.form=new ye.gE({email:new ye.MJ("",[ye.k0.required,ye.k0.email]),password:new ye.MJ("",[ye.k0.required]),confirmPassword:new ye.MJ("",[ye.k0.required,lt("password")])})}patchValue(be,ze){this.form.get(be)?.patchValue(ze)}submit(){var be=this;return(0,J.A)(function*(){if(!(yield be.authService.signup(be.form.value)))return be.flashMessageService.error("Error: Failed to register");be.flashMessageService.success("Welcome! You have successfully registered as an admin."),be.router.navigate(["/"])})()}static{this.\u0275fac=function(ze){return new(ze||ke)(T.rXU(oe.u),T.rXU(X.Ix),T.rXU(wt.L),T.rXU(Y.x))}}static{this.\u0275cmp=T.VBU({type:ke,selectors:[["app-register-first-admin"]],decls:5,vars:1,consts:[[1,"hero","is-fullheight"],[1,"hero-body"],[1,"container","has-text-centered"],[1,"columns"],["class","column col-welcome",4,"ngIf"],[1,"column","col-welcome"],[1,"register-wrap"],[1,"card","is-bordered"],[1,"card-content"],[1,"content"],[1,"is-size-3","has-text-weight-bold","my-3"],[1,"is-size-5"],["class","has-text-left",4,"ngIf"],[1,"button","is-block","is-dark","is-fullwidth","mb-0",3,"click","disabled"],[1,"is-flex","is-align-items-center","is-justify-content-flex-end","my-3"],[2,"margin-top","9px"],["src","/assets/images/logo.svg","alt","manifest logo","width","94",1,"ml-3"],[1,"has-text-left"],[1,"field","mb-5"],[1,"control"],[3,"valueChanged","prop"]],template:function(ze,mt){1&ze&&(T.j41(0,"section",0)(1,"div",1)(2,"div",2)(3,"div",3),T.DNE(4,Ve,16,3,"div",4),T.k0s()()()()),2&ze&&(T.R7$(4),T.Y8G("ngIf",mt.appName))},dependencies:[h.bT,pe.S],styles:['@import"https://fonts.googleapis.com/css?family=Rubik:300,400,400i,500";.container[_ngcontent-%COMP%]{max-width:100%;width:100%}.hero.is-fullheight[_ngcontent-%COMP%]{min-height:calc(100vh - 64px)}.notification[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:auto;border-radius:0;bottom:unset}.col-welcome[_ngcontent-%COMP%]{position:fixed;display:flex;align-items:center;justify-content:center;background-color:#fff;left:0;top:0;height:100vh}.col-welcome[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{margin:auto}@media screen and (min-width: 1188px){.col-welcome[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{max-width:482px;min-width:382px}}@media screen and (min-width: 1000px){.col-welcome[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{max-width:424px;min-width:360px}}@media screen and (min-width: 768px),print{.col-welcome[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{max-width:424px;min-width:320px}}@media screen and (max-width: 767px){.col-welcome[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{min-width:50%;max-width:380px}}.col-welcome[_ngcontent-%COMP%]{width:100vw}']})}}return ke})(),canActivate:[(()=>{class ke{constructor(be,ze){this.authService=be,this.router=ze}canActivate(){var be=this;return(0,J.A)(function*(){return!!(yield be.authService.isDbEmpty())||(be.router.navigate(["/auth/login"]),!1)})()}static{this.\u0275fac=function(ze){return new(ze||ke)(T.KVO(oe.u),T.KVO(X.Ix))}}static{this.\u0275prov=T.jDH({token:ke,factory:ke.\u0275fac,providedIn:"root"})}}return ke})()]}];let Je=(()=>{class ke{static{this.\u0275fac=function(ze){return new(ze||ke)}}static{this.\u0275mod=T.$C({type:ke})}static{this.\u0275inj=T.G2t({imports:[X.iI.forChild(rt),X.iI]})}}return ke})(),nn=(()=>{class ke{static{this.\u0275fac=function(ze){return new(ze||ke)}}static{this.\u0275mod=T.$C({type:ke})}static{this.\u0275inj=T.G2t({imports:[h.MD,Je,o.G]})}}return ke})()},7906:(Ze,fe,b)=>{b.d(fe,{u:()=>Q});var h=b(7431),o=b(2410),X=b(8033),q=b(1467),T=b(6243),ge=b(8919),J=b(1968),ye=b(4385),ve=b(9606),oe=b(8284),Y=b(5640),pe=b(183),Oe=b(818);let Q=(()=>{class me{constructor(Pe,Ye,lt){this.http=Pe,this.router=Ye,this.flashMessageService=lt,this.currentUserSubject=new o.t(null),this.currentUser$=this.currentUserSubject.asObservable(),this.isUserLoaded=!1}login(Pe){var Ye=this;return(0,h.A)(function*(){return(0,X._)(Ye.http.post(`${ve.c.apiBaseUrl}/auth/admins/login`,Pe)).then(lt=>{const wt=lt?.token;return wt&&localStorage.setItem(ye.il,wt),wt})})()}signup(Pe){var Ye=this;return(0,h.A)(function*(){return(0,X._)(Ye.http.post(`${ve.c.apiBaseUrl}/auth/admins/signup`,Pe)).then(lt=>{const wt=lt?.token;return wt&&localStorage.setItem(ye.il,wt),wt})})()}logout(){this.currentUserSubject.next(null),localStorage.removeItem(ye.il),this.isUserLoaded=!1}isLoggedIn(){return!!this.currentUserSubject.value}loadCurrentUser(){return this.isUserLoaded?(0,q.of)(this.currentUserSubject.value):this.http.get(`${ve.c.apiBaseUrl}/auth/admins/me`).pipe((0,T.M)(Pe=>{this.isUserLoaded=!0,this.currentUserSubject.next(Pe)}),(0,ge.W)(Pe=>(this.logout(),this.router.navigate(["/auth/login"]),this.flashMessageService.error("You must be logged in to view that page."),(0,J.$)(()=>Pe))))}getCurrentUserValue(){return this.currentUserSubject.value}isDefaultAdminExists(){var Pe=this;return(0,h.A)(function*(){return(0,X._)(Pe.http.get(`${ve.c.apiBaseUrl}/auth/admins/default-exists`)).then(Ye=>Ye.exists)})()}isDbEmpty(){var Pe=this;return(0,h.A)(function*(){return(0,X._)(Pe.http.get(`${ve.c.apiBaseUrl}/db/is-db-empty`)).then(Ye=>Ye.empty)})()}static{this.\u0275fac=function(Ye){return new(Ye||me)(oe.KVO(Y.Qq),oe.KVO(pe.Ix),oe.KVO(Oe.L))}}static{this.\u0275prov=oe.jDH({token:me,factory:me.\u0275fac,providedIn:"root"})}}return me})()},6119:(Ze,fe,b)=>{b.d(fe,{m:()=>J});var h=b(7431),o=b(8033),X=b(9606),q=b(8284),T=b(5640),ge=b(818);let J=(()=>{class ye{constructor(oe,Y){this.http=oe,this.flashMessageService=Y,this.collectionBaseUrl=X.c.apiBaseUrl+"/collections",this.singleBaseUrl=X.c.apiBaseUrl+"/singles"}handleRequest(oe){var Y=this;return(0,h.A)(function*(){try{return yield oe}catch(pe){throw Y.flashMessageService.error(pe.error?.message||"An error occurred"),pe}})()}list(oe,Y){const pe={page:Y.filters?.page||1,perPage:20};Object.keys(Y.filters||{}).forEach(Q=>{"page"!==Q&&(pe[`${Q}_eq`]=Y.filters[Q])}),Y.relations&&(pe.relations=Y.relations.join(","));const Oe=(0,o._)(this.http.get(`${this.collectionBaseUrl}/${oe}`,{params:pe}));return this.handleRequest(Oe)}listSelectOptions(oe){const Y=(0,o._)(this.http.get(`${this.collectionBaseUrl}/${oe}/select-options`));return this.handleRequest(Y)}show(oe,Y,pe){const Oe=(0,o._)(this.http.get(`${this.collectionBaseUrl}/${oe}/${Y}`,{params:{relations:pe?.relations?.join(",")}}));return this.handleRequest(Oe)}showSingle(oe){const Y=(0,o._)(this.http.get(`${this.singleBaseUrl}/${oe}`));return this.handleRequest(Y)}create(oe,Y){const pe=(0,o._)(this.http.post(`${this.collectionBaseUrl}/${oe}`,Y));return this.handleRequest(pe)}update(oe,Y,pe){const Oe=(0,o._)(this.http.put(`${this.collectionBaseUrl}/${oe}/${Y}`,pe));return this.handleRequest(Oe)}updateSingle(oe,Y){const pe=(0,o._)(this.http.put(`${this.singleBaseUrl}/${oe}`,Y));return this.handleRequest(pe)}delete(oe,Y){const pe=(0,o._)(this.http.delete(`${this.collectionBaseUrl}/${oe}/${Y}`));return this.handleRequest(pe)}static{this.\u0275fac=function(Y){return new(Y||ye)(q.KVO(T.Qq),q.KVO(ge.L))}}static{this.\u0275prov=q.jDH({token:ye,factory:ye.\u0275fac,providedIn:"root"})}}return ye})()},8428:(Ze,fe,b)=>{b.d(fe,{S:()=>Wr});var h=b(2943),o=b(8284),X=b(5442);const q=R=>({"is-danger":R}),T=R=>({"is-checked":R});function ge(R,se){if(1&R&&(o.j41(0,"p",5),o.EFF(1),o.k0s()),2&R){const y=o.XpG();o.R7$(),o.JRh(y.helpText)}}let J=(()=>{class R{constructor(){this.valueChanged=new o.bkB}ngOnChanges(y){this.checked=!!this.value}toggleCheck(){this.checked=!this.checked,this.valueChanged.emit(this.checked)}static{this.\u0275fac=function(N){return new(N||R)}}static{this.\u0275cmp=o.VBU({type:R,selectors:[["app-boolean-input"]],inputs:{prop:"prop",value:"value",helpText:"helpText",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.OA$,o.aNF],decls:6,vars:8,consts:[["input",""],[1,"control","mt-7","mb-4"],["for","",1,"checkbox",3,"click","ngClass"],[1,"checkmark"],["class","help",4,"ngIf"],[1,"help"]],template:function(N,A){if(1&N){const K=o.RV6();o.j41(0,"div",1)(1,"label",2,0),o.bIt("click",function(){return o.eBV(K),o.Njj(A.toggleCheck())}),o.EFF(3),o.nrm(4,"span",3),o.k0s(),o.DNE(5,ge,2,1,"p",4),o.k0s()}2&N&&(o.R7$(),o.Y8G("ngClass",o.eq3(4,q,A.isError))("ngClass",o.eq3(6,T,A.checked)),o.R7$(2),o.SpI("",A.prop.name," "),o.R7$(2),o.Y8G("ngIf",A.helpText))},dependencies:[h.YU,h.bT]})}}return R})();const ye=["input"],ve=R=>({"is-danger":R});let oe=(()=>{class R{constructor(){this.valueChanged=new o.bkB}ngOnInit(){this.symbol=(0,h.Qn)(this.currency||"USD","wide"),void 0!==this.value&&(this.input.nativeElement.value=this.value)}onChange(y){this.valueChanged.emit(Number(y.target.value))}static{this.\u0275fac=function(N){return new(N||R)}}static{this.\u0275cmp=o.VBU({type:R,selectors:[["app-currency-input"]],viewQuery:function(N,A){if(1&N&&o.GBs(ye,7),2&N){let K;o.mGM(K=o.lsd())&&(A.input=K.first)}},inputs:{prop:"prop",value:"value",currency:"currency",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:8,vars:6,consts:[["input",""],[3,"for"],[1,"control","has-icons-left"],[1,"icon","is-left"],[1,"is-family-sans-serif"],["type","number","step","0.01",1,"input",3,"change","ngClass"]],template:function(N,A){if(1&N){const K=o.RV6();o.j41(0,"label",1),o.EFF(1),o.k0s(),o.j41(2,"p",2)(3,"span",3)(4,"span",4),o.EFF(5),o.k0s()(),o.j41(6,"input",5,0),o.bIt("change",function(nt){return o.eBV(K),o.Njj(A.onChange(nt))}),o.k0s()()}2&N&&(o.Y8G("for",A.prop.name),o.R7$(),o.JRh(A.prop.name),o.R7$(4),o.SpI(" ",A.symbol," "),o.R7$(),o.Y8G("ngClass",o.eq3(4,ve,A.isError)))},dependencies:[h.YU]})}}return R})();const Y=["input"],pe=R=>({"is-danger":R});let Oe=(()=>{class R{constructor(){this.valueChanged=new o.bkB,this.today=Date.now()}ngOnInit(){void 0!==this.value&&(this.input.nativeElement.value=this.value)}onChange(y){this.valueChanged.emit(y.target.value)}static{this.\u0275fac=function(N){return new(N||R)}}static{this.\u0275cmp=o.VBU({type:R,selectors:[["app-date-input"]],viewQuery:function(N,A){if(1&N&&o.GBs(Y,7),2&N){let K;o.mGM(K=o.lsd())&&(A.input=K.first)}},inputs:{prop:"prop",value:"value",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:4,vars:6,consts:[["input",""],[3,"for"],["type","date",1,"input",3,"change","ngClass","value"]],template:function(N,A){if(1&N){const K=o.RV6();o.j41(0,"label",1),o.EFF(1),o.k0s(),o.j41(2,"input",2,0),o.bIt("change",function(nt){return o.eBV(K),o.Njj(A.onChange(nt))}),o.k0s()}2&N&&(o.Y8G("for",A.prop.name),o.R7$(),o.JRh(A.prop.name),o.R7$(),o.Y8G("ngClass",o.eq3(4,pe,A.isError))("value",A.value?A.value:A.today))},dependencies:[h.YU]})}}return R})();const Q=["input"],me=R=>({"is-danger":R});let He=(()=>{class R{constructor(){this.valueChanged=new o.bkB}ngOnInit(){void 0!==this.value&&(this.input.nativeElement.value=this.value)}onChange(y){this.valueChanged.emit(y.target.value)}static{this.\u0275fac=function(N){return new(N||R)}}static{this.\u0275cmp=o.VBU({type:R,selectors:[["app-email-input"]],viewQuery:function(N,A){if(1&N&&o.GBs(Q,7),2&N){let K;o.mGM(K=o.lsd())&&(A.input=K.first)}},inputs:{prop:"prop",value:"value",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:4,vars:5,consts:[["input",""],[3,"for"],["type","email","placeholder","Email...","autocomplete","email",1,"input",3,"change","ngClass"]],template:function(N,A){if(1&N){const K=o.RV6();o.j41(0,"label",1),o.EFF(1),o.k0s(),o.j41(2,"input",2,0),o.bIt("change",function(nt){return o.eBV(K),o.Njj(A.onChange(nt))}),o.k0s()}2&N&&(o.Y8G("for",A.prop.name),o.R7$(),o.JRh(A.prop.name),o.R7$(),o.Y8G("ngClass",o.eq3(3,me,A.isError)))},dependencies:[h.YU]})}}return R})();const Pe=["latInput"],Ye=["lngInput"],lt=R=>({"is-danger":R});let wt=(()=>{class R{constructor(){this.valueChanged=new o.bkB}ngOnInit(){void 0!==this.value&&(this.latInput.nativeElement.value=this.value?.lat,this.lngInput.nativeElement.value=this.value?.lng)}onChange(){this.valueChanged.emit({lat:this.latInput.nativeElement.value,lng:this.lngInput.nativeElement.value})}static{this.\u0275fac=function(N){return new(N||R)}}static{this.\u0275cmp=o.VBU({type:R,selectors:[["app-location-input"]],viewQuery:function(N,A){if(1&N&&(o.GBs(Pe,7),o.GBs(Ye,7)),2&N){let K;o.mGM(K=o.lsd())&&(A.latInput=K.first),o.mGM(K=o.lsd())&&(A.lngInput=K.first)}},inputs:{prop:"prop",value:"value",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:21,vars:7,consts:[["latInput",""],["lngInput",""],["for",""],[1,"columns","is-mobile"],[1,"column"],[1,"field"],["for","lat-input"],[1,"control","has-icons-left"],[1,"icon","is-left"],[1,"icon","icon-map-pin"],["type","number","step","0.0001","min","-90","max","90",1,"input","form-control",3,"change","ngClass"],["for","lng-input"],["type","number","step","0.0001","min","-180","max","180",1,"input","form-control",3,"change","ngClass"]],template:function(N,A){if(1&N){const K=o.RV6();o.j41(0,"label",2),o.EFF(1),o.k0s(),o.j41(2,"div",3)(3,"div",4)(4,"div",5)(5,"label",6),o.EFF(6,"Latitude"),o.k0s(),o.j41(7,"p",7)(8,"span",8),o.nrm(9,"i",9),o.k0s(),o.j41(10,"input",10,0),o.bIt("change",function(){return o.eBV(K),o.Njj(A.onChange())}),o.k0s()()()(),o.j41(12,"div",4)(13,"div",5)(14,"label",11),o.EFF(15,"Longitude"),o.k0s(),o.j41(16,"p",7)(17,"span",8),o.nrm(18,"i",9),o.k0s(),o.j41(19,"input",12,1),o.bIt("change",function(){return o.eBV(K),o.Njj(A.onChange())}),o.k0s()()()()()}2&N&&(o.R7$(),o.JRh(A.prop.name),o.R7$(9),o.Y8G("ngClass",o.eq3(3,lt,A.isError)),o.R7$(9),o.Y8G("ngClass",o.eq3(5,lt,A.isError)))},dependencies:[h.YU],styles:["label[for=lat-input][_ngcontent-%COMP%]:not(.file-label):not(.checkbox):not(.image-label), label[for=lng-input][_ngcontent-%COMP%]:not(.file-label):not(.checkbox):not(.image-label){text-transform:unset}"]})}}return R})();var Se=b(7431),we=b(2283),Ge=b(6119);const Ke=R=>({"is-danger":R}),Ve=R=>({"is-checked":R});function je(R,se){if(1&R&&o.EFF(0),2&R){const y=o.XpG(2);o.SpI("No ",y.entityManifest.nameSingular," selected")}}function Qe(R,se){if(1&R&&o.EFF(0),2&R){const y=o.XpG(2);o.SpI("1 ",y.entityManifest.nameSingular," selected")}}function rt(R,se){if(1&R&&o.EFF(0),2&R){const y=o.XpG(2);o.Lme("",y.selectedOptions.length," ",y.entityManifest.namePlural," selected ")}}function Je(R,se){if(1&R&&(o.qex(0,6),o.DNE(1,je,1,1,"ng-template",7)(2,Qe,1,1,"ng-template",8)(3,rt,1,2,"ng-template",9),o.bVm()),2&R){const y=o.XpG();o.Y8G("ngPlural",y.selectedOptions.length)}}function nn(R,se){if(1&R){const y=o.RV6();o.j41(0,"a",14),o.bIt("click",function(){o.eBV(y);const A=o.XpG(2);return o.Njj(A.selectAll())}),o.EFF(1,"Select all"),o.k0s()}}function ke(R,se){if(1&R){const y=o.RV6();o.j41(0,"a",14),o.bIt("click",function(){o.eBV(y);const A=o.XpG(2);return o.Njj(A.selectNone())}),o.EFF(1,"Select none"),o.k0s()}}function vn(R,se){if(1&R){const y=o.RV6();o.j41(0,"div",15)(1,"label",16),o.bIt("click",function(){const A=o.eBV(y).$implicit,K=o.XpG(2);return o.Njj(K.toggleSelected(A))}),o.EFF(2),o.nrm(3,"span",17),o.k0s()()}if(2&R){const y=se.$implicit;o.R7$(),o.Y8G("ngClass",o.eq3(2,Ve,y.selected)),o.R7$(),o.SpI(" ",y.label," ")}}function be(R,se){if(1&R&&(o.j41(0,"div",10)(1,"p",11),o.DNE(2,nn,2,0,"a",12)(3,ke,2,0,"a",12),o.k0s(),o.DNE(4,vn,4,4,"div",13),o.k0s()),2&R){const y=o.XpG();o.Y8G("ngClass",o.eq3(4,Ke,y.isError)),o.R7$(2),o.Y8G("ngIf",y.selectedOptions.length<y.options.length),o.R7$(),o.Y8G("ngIf",y.selectedOptions.length===y.options.length),o.R7$(),o.Y8G("ngForOf",y.options)}}let ze=(()=>{class R{constructor(y,N,A){this.manifestService=y,this.crudService=N,this.elementRef=A,this.valueChanged=new o.bkB,this.selectedOptions=[]}ngOnInit(){var y=this;return(0,Se.A)(function*(){y.label=y.prop?.name||y.relationship.name,y.relationship&&(y.entityManifest=yield y.manifestService.getEntityManifest({className:y.relationship.entity}),y.options=yield y.crudService.listSelectOptions(y.entityManifest.slug)),y.value&&(y.selectedOptions=[],y.options.filter(N=>y.value.map(A=>A.id).find(A=>A===N.id)).forEach(N=>{N.selected=!0,y.selectedOptions.push(N)}))})()}selectAll(){this.options.forEach(y=>y.selected=!0),this.selectedOptions=this.options,this.valueChanged.emit(this.selectedOptions.map(y=>y.id))}selectNone(){this.options.forEach(y=>y.selected=!1),this.selectedOptions=[],this.valueChanged.emit([])}toggleSelected(y){const N=this.selectedOptions.findIndex(A=>A.id===y.id);N>-1?this.selectedOptions.splice(N,1):this.selectedOptions.push(y),y.selected=!y.selected,this.valueChanged.emit(this.selectedOptions.map(A=>A.id))}clickOut(y){this.showList&&!this.elementRef.nativeElement.contains(y)&&!y.className.includes("mass-selection-button")&&(this.showList=!1)}static{this.\u0275fac=function(N){return new(N||R)(o.rXU(we.x),o.rXU(Ge.m),o.rXU(o.aKT))}}static{this.\u0275cmp=o.VBU({type:R,selectors:[["app-multi-select-input"]],hostBindings:function(N,A){1&N&&o.bIt("click",function(Re){return A.clickOut(Re.target)},!1,o.EBC)},inputs:{prop:"prop",relationship:"relationship",value:"value",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:7,vars:3,consts:[[1,"multiselect-box"],[1,"control"],[3,"click"],[1,"select","select--simulate",3,"click"],[3,"ngPlural",4,"ngIf"],["class","box",3,"ngClass",4,"ngIf"],[3,"ngPlural"],["ngPluralCase","=0"],["ngPluralCase","=1"],["ngPluralCase","other"],[1,"box",3,"ngClass"],[1,"pb-2","px-4"],["class","small-meta mass-selection-button has-text-grey-dark is-underlined is-inline-block is-fullwidth",3,"click",4,"ngIf"],["class","control px-4 py-1 is-fullwidth",4,"ngFor","ngForOf"],[1,"small-meta","mass-selection-button","has-text-grey-dark","is-underlined","is-inline-block","is-fullwidth",3,"click"],[1,"control","px-4","py-1","is-fullwidth"],[1,"checkbox",3,"click","ngClass"],[1,"checkmark"]],template:function(N,A){1&N&&(o.j41(0,"div",0)(1,"div",1)(2,"label",2),o.bIt("click",function(){return A.showList=!0}),o.EFF(3),o.k0s(),o.j41(4,"div",3),o.bIt("click",function(){return A.showList=!A.showList}),o.DNE(5,Je,4,1,"ng-container",4),o.k0s(),o.DNE(6,be,5,6,"div",5),o.k0s()()),2&N&&(o.R7$(3),o.SpI("",A.label," "),o.R7$(2),o.Y8G("ngIf",A.entityManifest),o.R7$(),o.Y8G("ngIf",A.showList&&(null==A.options?null:A.options.length)))},dependencies:[h.MD,h.YU,h.Sq,h.bT,h.IJ,h.WO],styles:[".is-disabled[_ngcontent-%COMP%]{cursor:not-allowed}"]})}}return R})();const mt=["input"],bt=R=>({"is-danger":R});let Vn=(()=>{class R{constructor(){this.valueChanged=new o.bkB}ngOnInit(){void 0!==this.value&&(this.input.nativeElement.value=this.value)}onChange(y){this.valueChanged.emit(Number(y.target.value))}static{this.\u0275fac=function(N){return new(N||R)}}static{this.\u0275cmp=o.VBU({type:R,selectors:[["app-number-input"]],viewQuery:function(N,A){if(1&N&&o.GBs(mt,7),2&N){let K;o.mGM(K=o.lsd())&&(A.input=K.first)}},inputs:{prop:"prop",value:"value",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:4,vars:5,consts:[["input",""],[3,"for"],["type","number","step","1",1,"input","form-control",3,"change","ngClass"]],template:function(N,A){if(1&N){const K=o.RV6();o.j41(0,"label",1),o.EFF(1),o.k0s(),o.j41(2,"input",2,0),o.bIt("change",function(nt){return o.eBV(K),o.Njj(A.onChange(nt))}),o.k0s()}2&N&&(o.Y8G("for",A.prop.name),o.R7$(),o.JRh(A.prop.name),o.R7$(),o.Y8G("ngClass",o.eq3(3,bt,A.isError)))},dependencies:[h.YU]})}}return R})();const ne=["input"],re=R=>({"is-danger":R});let ce=(()=>{class R{constructor(){this.valueChanged=new o.bkB}ngOnInit(){void 0!==this.value&&(this.input.nativeElement.value=this.value)}onChange(y){this.valueChanged.emit(y.target.value)}static{this.\u0275fac=function(N){return new(N||R)}}static{this.\u0275cmp=o.VBU({type:R,selectors:[["app-password-input"]],viewQuery:function(N,A){if(1&N&&o.GBs(ne,7),2&N){let K;o.mGM(K=o.lsd())&&(A.input=K.first)}},inputs:{prop:"prop",value:"value",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:4,vars:5,consts:[["input",""],[3,"for"],["placeholder","Password...","type","password","autocomplete","current-password",1,"input","form-control",3,"change","ngClass"]],template:function(N,A){if(1&N){const K=o.RV6();o.j41(0,"label",1),o.EFF(1),o.k0s(),o.j41(2,"input",2,0),o.bIt("change",function(nt){return o.eBV(K),o.Njj(A.onChange(nt))}),o.k0s()}2&N&&(o.Y8G("for",A.prop.name),o.R7$(),o.JRh(A.prop.name),o.R7$(),o.Y8G("ngClass",o.eq3(3,re,A.isError)))},dependencies:[h.YU]})}}return R})();var te=b(9911);const Me=R=>({"is-danger":R});function Te(R,se){if(1&R&&(o.j41(0,"option",7),o.EFF(1),o.k0s()),2&R){const y=se.$implicit;o.Y8G("value",y.id),o.R7$(),o.SpI(" ",y.label," ")}}let tt=(()=>{class R{constructor(y,N,A){this.manifestService=y,this.crudService=N,this.formBuilder=A,this.valueChanged=new o.bkB,this.form=this.formBuilder.group({select:null})}ngOnInit(){var y=this;return(0,Se.A)(function*(){y.label=y.prop?.name||y.relationship.name,y.relationship?(y.entityManifest=yield y.manifestService.getEntityManifest({className:y.relationship.entity}),y.options=yield y.crudService.listSelectOptions(y.entityManifest.slug)):y.prop.type===X.Kk.Choice&&(y.options=(y.prop.options?.values||[]).map(N=>({id:N,label:N}))),y.value&&y.form.patchValue({select:y.relationship?y.value.id:y.value})})()}onChange(y){if(""===y.target.value)return this.form.patchValue({select:null}),void this.valueChanged.emit(null);this.valueChanged.emit(y.target.value)}static{this.\u0275fac=function(N){return new(N||R)(o.rXU(we.x),o.rXU(Ge.m),o.rXU(te.ok))}}static{this.\u0275cmp=o.VBU({type:R,selectors:[["app-select-input"]],inputs:{prop:"prop",relationship:"relationship",value:"value",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:9,vars:8,consts:[[3,"formGroup"],[3,"for"],[1,"control"],[1,"select",3,"ngClass"],["formControlName","select",1,"is-fullwidth",3,"change"],["value",""],[3,"value",4,"ngFor","ngForOf"],[3,"value"]],template:function(N,A){1&N&&(o.j41(0,"div",0)(1,"label",1),o.EFF(2),o.k0s(),o.j41(3,"div",2)(4,"div",3)(5,"select",4),o.bIt("change",function(Re){return A.onChange(Re)}),o.j41(6,"option",5),o.EFF(7),o.k0s(),o.DNE(8,Te,2,2,"option",6),o.k0s()()()()),2&N&&(o.Y8G("formGroup",A.form),o.R7$(),o.Y8G("for",A.label),o.R7$(),o.JRh(A.label),o.R7$(2),o.Y8G("ngClass",o.eq3(6,Me,A.isError)),o.R7$(3),o.SpI("Select ",A.label,"..."),o.R7$(),o.Y8G("ngForOf",A.options))},dependencies:[te.X1,te.xH,te.y7,te.wz,te.BC,te.cb,te.j4,te.JD,h.YU,h.pM]})}}return R})();const Rt=["input"],Zt=R=>({"is-danger":R});let dt=(()=>{class R{constructor(){this.valueChanged=new o.bkB}ngOnInit(){void 0!==this.value&&(this.input.nativeElement.value=this.value)}onChange(y){this.valueChanged.emit(y.target.value)}static{this.\u0275fac=function(N){return new(N||R)}}static{this.\u0275cmp=o.VBU({type:R,selectors:[["app-text-input"]],viewQuery:function(N,A){if(1&N&&o.GBs(Rt,7),2&N){let K;o.mGM(K=o.lsd())&&(A.input=K.first)}},inputs:{prop:"prop",value:"value",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:4,vars:5,consts:[["input",""],[3,"for"],["type","text",1,"input","form-control",3,"change","ngClass"]],template:function(N,A){if(1&N){const K=o.RV6();o.j41(0,"label",1),o.EFF(1),o.k0s(),o.j41(2,"input",2,0),o.bIt("change",function(nt){return o.eBV(K),o.Njj(A.onChange(nt))}),o.k0s()}2&N&&(o.Y8G("for",A.prop.name),o.R7$(),o.JRh(A.prop.name),o.R7$(),o.Y8G("ngClass",o.eq3(3,Zt,A.isError)))},dependencies:[h.YU]})}}return R})();const Ut=["input"],Xe=R=>({"is-danger":R});let cn=(()=>{class R{constructor(){this.valueChanged=new o.bkB}ngOnInit(){void 0!==this.value&&(this.input.nativeElement.value=this.value)}onChange(y){this.valueChanged.emit(y.target.value)}static{this.\u0275fac=function(N){return new(N||R)}}static{this.\u0275cmp=o.VBU({type:R,selectors:[["app-textarea-input"]],viewQuery:function(N,A){if(1&N&&o.GBs(Ut,7),2&N){let K;o.mGM(K=o.lsd())&&(A.input=K.first)}},inputs:{prop:"prop",value:"value",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:5,vars:6,consts:[["input",""],[3,"for"],[1,"textarea",3,"change","ngClass","name"]],template:function(N,A){if(1&N){const K=o.RV6();o.j41(0,"label",1),o.EFF(1),o.k0s(),o.j41(2,"textarea",2,0),o.bIt("change",function(nt){return o.eBV(K),o.Njj(A.onChange(nt))}),o.EFF(4," "),o.k0s()}2&N&&(o.Y8G("for",A.prop.name),o.R7$(),o.JRh(A.prop.name),o.R7$(),o.Y8G("ngClass",o.eq3(4,Xe,A.isError))("name",A.prop.name))},dependencies:[h.YU]})}}return R})();const Bt=["input"],Nt=R=>({"is-danger":R});let sn=(()=>{class R{constructor(){this.valueChanged=new o.bkB}ngOnInit(){void 0!==this.value&&(this.input.nativeElement.value=this.value)}onChange(y){this.valueChanged.emit(y.target.value)}static{this.\u0275fac=function(N){return new(N||R)}}static{this.\u0275cmp=o.VBU({type:R,selectors:[["app-url-input"]],viewQuery:function(N,A){if(1&N&&o.GBs(Bt,7),2&N){let K;o.mGM(K=o.lsd())&&(A.input=K.first)}},inputs:{prop:"prop",value:"value",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:4,vars:5,consts:[["input",""],[3,"for"],["type","url","placeholder","https://example.com",1,"input","form-control",3,"change","ngClass"]],template:function(N,A){if(1&N){const K=o.RV6();o.j41(0,"label",1),o.EFF(1),o.k0s(),o.j41(2,"input",2,0),o.bIt("change",function(nt){return o.eBV(K),o.Njj(A.onChange(nt))}),o.k0s()}2&N&&(o.Y8G("for",A.prop.name),o.R7$(),o.JRh(A.prop.name),o.R7$(),o.Y8G("ngClass",o.eq3(3,Nt,A.isError)))},dependencies:[h.YU]})}}return R})();const Ne=["input"],_t=R=>({"is-danger":R});let yn=(()=>{class R{constructor(){this.valueChanged=new o.bkB}ngOnInit(){this.input.nativeElement.value=null!==this.value?new Date(this.value).toISOString().replace("T"," ").substring(0,19):""}onChange(y){this.valueChanged.emit(new Date(y.target.value))}static{this.\u0275fac=function(N){return new(N||R)}}static{this.\u0275cmp=o.VBU({type:R,selectors:[["app-timestamp-input"]],viewQuery:function(N,A){if(1&N&&o.GBs(Ne,7),2&N){let K;o.mGM(K=o.lsd())&&(A.input=K.first)}},inputs:{prop:"prop",value:"value",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:4,vars:5,consts:[["input",""],[3,"for"],["type","datetime-local",1,"input",3,"change","ngClass"]],template:function(N,A){if(1&N){const K=o.RV6();o.j41(0,"label",1),o.EFF(1),o.k0s(),o.j41(2,"input",2,0),o.bIt("change",function(nt){return o.eBV(K),o.Njj(A.onChange(nt))}),o.k0s()}2&N&&(o.Y8G("for",A.prop.name),o.R7$(),o.JRh(A.prop.name),o.R7$(),o.Y8G("ngClass",o.eq3(3,_t,A.isError)))},dependencies:[h.YU],encapsulation:2})}}return R})();var rr=b(8033),Vr=b(9606),vr=b(5640);let jn=(()=>{class R{constructor(y){this.http=y}uploadImage({entity:y,property:N,fileContent:A}){return this.upload({type:"image",entity:y,property:N,fileContent:A})}uploadFile(y){var N=this;return(0,Se.A)(function*({entity:A,property:K,fileContent:Re}){return N.upload({type:"file",entity:A,property:K,fileContent:Re})}).apply(this,arguments)}upload(y){var N=this;return(0,Se.A)(function*({type:A,entity:K,property:Re,fileContent:nt}){const At=new FormData;return At.append(A,nt),At.append("entity",K),At.append("property",Re),(0,rr._)(N.http.post(`${Vr.c.apiBaseUrl}/upload/${A}`,At)).catch(fn=>{throw new Error(fn.error.message)})}).apply(this,arguments)}static{this.\u0275fac=function(N){return new(N||R)(o.KVO(vr.Qq))}}static{this.\u0275prov=o.jDH({token:R,factory:R.\u0275fac,providedIn:"root"})}}return R})();var pt=b(818);const Ct=["fileInput"],Qn=R=>({"show-errors":R});function zn(R,se){1&R&&(o.j41(0,"span",10)(1,"span",11),o.nrm(2,"i",12),o.k0s(),o.j41(3,"span",6),o.EFF(4," Upload file... "),o.k0s()())}function Tn(R,se){1&R&&(o.j41(0,"button",13),o.EFF(1," Loading "),o.k0s())}function ir(R,se){if(1&R){const y=o.RV6();o.j41(0,"div")(1,"div",5)(2,"label",6)(3,"input",7,0),o.bIt("change",function(){o.eBV(y);const A=o.XpG();return o.Njj(A.onFileInputEvent())}),o.k0s(),o.DNE(5,zn,5,0,"span",8)(6,Tn,2,0,"button",9),o.k0s()()()}if(2&R){const y=o.XpG();o.R7$(),o.Y8G("ngClass",o.eq3(3,Qn,y.isError)),o.R7$(4),o.Y8G("ngIf",!y.loading),o.R7$(),o.Y8G("ngIf",y.loading)}}function _n(R,se){if(1&R){const y=o.RV6();o.j41(0,"div",14)(1,"a",15),o.EFF(2),o.k0s(),o.j41(3,"span",16)(4,"a",17),o.bIt("click",function(){o.eBV(y);const A=o.XpG();return o.Njj(A.removeFile())}),o.nrm(5,"i",18),o.k0s()()()}if(2&R){const y=o.XpG();o.R7$(),o.Y8G("href",y.value,o.B4B),o.R7$(),o.SpI(" ",y.value," ")}}let Ir=(()=>{class R{constructor(y,N){this.uploadService=y,this.flashMessageService=N,this.valueChanged=new o.bkB}onFileInputEvent(){var y=this;return(0,Se.A)(function*(){return y.loading=!0,y.uploadService.uploadFile({entity:y.entitySlug,property:y.prop.name,fileContent:y.fileInputEl.nativeElement.files.item(0)}).then(N=>{y.loading=!1,y.value=N.path,y.valueChanged.emit(y.value)},N=>{y.loading=!1,y.flashMessageService.error("There was an error uploading your file.")})})()}removeFile(){delete this.value,this.valueChanged.emit(null)}static{this.\u0275fac=function(N){return new(N||R)(o.rXU(jn),o.rXU(pt.L))}}static{this.\u0275cmp=o.VBU({type:R,selectors:[["app-file-input"]],viewQuery:function(N,A){if(1&N&&o.GBs(Ct,5),2&N){let K;o.mGM(K=o.lsd())&&(A.fileInputEl=K.first)}},inputs:{prop:"prop",entitySlug:"entitySlug",value:"value",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:5,vars:4,consts:[["fileInput",""],[1,"control"],[3,"for"],[4,"ngIf"],["class","has-current-file is-flex is-justify-content-space-between is-align-items-center mt-1 has-background-white-ter pl-1",4,"ngIf"],[1,"file",3,"ngClass"],[1,"file-label"],["type","file",1,"file-input",3,"change"],["class","file-cta",4,"ngIf"],["class","button is-link is-loading",4,"ngIf"],[1,"file-cta"],[1,"file-icon"],[1,"icon","icon-upload-cloud","is-size-5"],[1,"button","is-link","is-loading"],[1,"has-current-file","is-flex","is-justify-content-space-between","is-align-items-center","mt-1","has-background-white-ter","pl-1"],["target","_blank",3,"href"],[1,"file-cta","file-remove"],[3,"click"],[1,"icon","icon-x","is-size-5"]],template:function(N,A){1&N&&(o.j41(0,"div",1)(1,"label",2),o.EFF(2),o.k0s(),o.DNE(3,ir,7,5,"div",3)(4,_n,6,2,"div",4),o.k0s()),2&N&&(o.R7$(),o.Y8G("for",A.prop.name),o.R7$(),o.JRh(A.prop.name),o.R7$(),o.Y8G("ngIf",!A.value),o.R7$(),o.Y8G("ngIf",A.value))},dependencies:[h.bT,h.YU],encapsulation:2})}}return R})();var at=b(7563);const xt=["imageInput"],Pt=R=>({"show-errors":R});function H(R,se){1&R&&(o.j41(0,"span",11)(1,"span",12),o.nrm(2,"i",13),o.k0s(),o.j41(3,"span",14),o.EFF(4," Upload image..."),o.k0s()())}function ft(R,se){1&R&&(o.j41(0,"button",15),o.EFF(1," Loading "),o.k0s())}function $(R,se){if(1&R){const y=o.RV6();o.j41(0,"div",5)(1,"div",6)(2,"label",7)(3,"input",8,0),o.bIt("change",function(){o.eBV(y);const A=o.XpG();return o.Njj(A.imageInputEvent())}),o.k0s(),o.DNE(5,H,5,0,"span",9)(6,ft,2,0,"button",10),o.k0s()()()}if(2&R){const y=o.XpG();o.R7$(),o.Y8G("ngClass",o.eq3(3,Pt,y.isError)),o.R7$(4),o.Y8G("ngIf",!y.loading),o.R7$(),o.Y8G("ngIf",y.loading)}}function ue(R,se){if(1&R){const y=o.RV6();o.j41(0,"div",16),o.nrm(1,"img",17),o.j41(2,"span",18)(3,"a",19),o.bIt("click",function(){o.eBV(y);const A=o.XpG();return o.Njj(A.removeFile())}),o.nrm(4,"i",20),o.k0s()()()}if(2&R){const y=o.XpG();o.R7$(),o.Y8G("src",y.displayedImage,o.B4B)}}let Be=(()=>{class R{constructor(y,N){this.uploadService=y,this.flashMessageService=N,this.valueChanged=new o.bkB}ngOnInit(){if(this.value){const y=(0,at.Gj)(this.prop.options?.sizes);this.displayedImage=this.value[y]}}imageInputEvent(){this.loading=!0,this.uploadService.uploadImage({entity:this.entitySlug,property:this.prop.name,fileContent:this.imageInputEl.nativeElement.files.item(0)}).then(y=>{this.loading=!1,this.value=y,setTimeout(()=>{this.displayedImage=y[Object.keys(y)[0]],this.valueChanged.emit(this.value)},100)},y=>{this.loading=!1,this.flashMessageService.error("There was an error uploading your image.")})}removeFile(){delete this.value,delete this.displayedImage,this.valueChanged.emit(null)}static{this.\u0275fac=function(N){return new(N||R)(o.rXU(jn),o.rXU(pt.L))}}static{this.\u0275cmp=o.VBU({type:R,selectors:[["app-image-input"]],viewQuery:function(N,A){if(1&N&&o.GBs(xt,5),2&N){let K;o.mGM(K=o.lsd())&&(A.imageInputEl=K.first)}},inputs:{prop:"prop",entitySlug:"entitySlug",value:"value",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:5,vars:4,consts:[["imageInput",""],[1,"control"],[3,"for"],["class","image",4,"ngIf"],["class","has-current-file is-flex is-align-items-center is-justify-content-space-between mt-1 has-background-white-ter pl-1 py-1",4,"ngIf"],[1,"image"],[1,"file",3,"ngClass"],[1,"image-label"],["type","file","accept",".png, .jpg, .jpeg",1,"file-input",3,"change"],["class","file-cta",4,"ngIf"],["class","button is-link is-loading full-width",4,"ngIf"],[1,"file-cta"],[1,"file-icon"],[1,"icon","icon-upload-cloud","is-size-5"],[1,"file-label"],[1,"button","is-link","is-loading","full-width"],[1,"has-current-file","is-flex","is-align-items-center","is-justify-content-space-between","mt-1","has-background-white-ter","pl-1","py-1"],[3,"src"],[1,"file-cta","file-remove"],[3,"click"],[1,"icon","icon-x","is-size-5"]],template:function(N,A){1&N&&(o.j41(0,"div",1)(1,"label",2),o.EFF(2),o.k0s(),o.DNE(3,$,7,5,"div",3)(4,ue,5,1,"div",4),o.k0s()),2&N&&(o.R7$(),o.Y8G("for",A.prop.name),o.R7$(),o.JRh(A.prop.name),o.R7$(),o.Y8G("ngIf",!A.value),o.R7$(),o.Y8G("ngIf",A.displayedImage))},dependencies:[h.bT,h.YU],encapsulation:2})}}return R})();const Gt={toolbar:[["bold","italic","underline","strike"],["blockquote","code-block"],[{header:1},{header:2}],[{list:"ordered"},{list:"bullet"}],[{script:"sub"},{script:"super"}],[{indent:"-1"},{indent:"+1"}],[{direction:"rtl"}],[{size:["small",!1,"large","huge"]}],[{header:[1,2,3,4,5,6,!1]}],[{color:[]},{background:[]}],[{font:[]}],[{align:[]}],["clean"],["link","image","video"],["table"]]},Jt=new o.nKC("config",{providedIn:"root",factory:()=>({modules:Gt})});var F=b(7711),W=b(7787),Ee=b(5719); /** * @license Angular v17.3.12 * (c) 2010-2024 Google LLC. https://angular.io/ * License: MIT */function $e(R){R||((0,o.Af3)($e),R=(0,o.WQX)(o.abz));const se=new W.c(y=>R.onDestroy(y.next.bind(y)));return y=>y.pipe((0,Ee.Q)(se))}var Sn=b(6852),yr=b(7624),Si=b(7233),ji=b(7412),An=b(3575),st=b(5271),Or=b(2097),_r=b(7236);const jr=["addListener","removeListener"],Ur=["addEventListener","removeEventListener"],br=["on","off"];function It(R,se,y,N){if((0,Or.T)(y)&&(N=y,y=void 0),N)return It(R,se,y).pipe((0,_r.I)(N));const[A,K]=function lr(R){return(0,Or.T)(R.addEventListener)&&(0,Or.T)(R.removeEventListener)}(R)?Ur.map(Re=>nt=>R[Re](se,nt,y)):function Br(R){return(0,Or.T)(R.addListener)&&(0,Or.T)(R.removeListener)}(R)?jr.map(Jr(R,se)):function Cr(R){return(0,Or.T)(R.on)&&(0,Or.T)(R.off)}(R)?br.map(Jr(R,se)):[];if(!A&&(0,st.X)(R))return(0,An.Z)(Re=>It(Re,se,y))((0,ji.Tg)(R));if(!A)throw new TypeError("Invalid event target");return new W.c(Re=>{const nt=(...At)=>Re.next(1<At.length?At:At[0]);return A(nt),()=>K(nt)})}function Jr(R,se){return y=>N=>R[y](se,N)}var ur=b(1087);const $r={now:()=>($r.delegate||Date).now(),delegate:void 0};class Hr extends ur.B{constructor(se=1/0,y=1/0,N=$r){super(),this._bufferSize=se,this._windowTime=y,this._timestampProvider=N,this._buffer=[],this._infiniteTimeWindow=!0,this._infiniteTimeWindow=y===1/0,this._bufferSize=Math.max(1,se),this._windowTime=Math.max(1,y)}next(se){const{isStopped:y,_buffer:N,_infiniteTimeWindow:A,_timestampProvider:K,_windowTime:Re}=this;y||(N.push(se),!A&&N.push(K.now()+Re)),this._trimBuffer(),super.next(se)}_subscribe(se){this._throwIfClosed(),this._trimBuffer();const y=this._innerSubscribe(se),{_infiniteTimeWindow:N,_buffer:A}=this,K=A.slice();for(let Re=0;Re<K.length&&!se.closed;Re+=N?1:2)se.next(K[Re]);return this._checkFinalizedStatuses(se),y}_trimBuffer(){const{_bufferSize:se,_timestampProvider:y,_buffer:N,_infiniteTimeWindow:A}=this,K=(A?1:2)*se;if(se<1/0&&K<N.length&&N.splice(0,N.length-K),!A){const Re=y.now();let nt=0;for(let At=1;At<N.length&&N[At]<=Re;At+=2)nt=At;nt&&N.splice(0,nt+1)}}}var P=b(3173),V=b(1524);function he(R,se,...y){if(!0===se)return void R();if(!1===se)return;const N=new P.Ms({next:()=>{N.unsubscribe(),R()}});return(0,ji.Tg)(se(...y)).subscribe(N)}class Fe extends Si.yU{constructor(se,y){super()}schedule(se,y=0){return this}}const Le={setInterval(R,se,...y){const{delegate:N}=Le;return N?.setInterval?N.setInterval(R,se,...y):setInterval(R,se,...y)},clearInterval(R){const{delegate:se}=Le;return(se?.clearInterval||clearInterval)(R)},delegate:void 0};var vt=b(2070);class zt{constructor(se,y=zt.now){this.schedulerActionCtor=se,this.now=y}schedule(se,y=0,N){return new this.schedulerActionCtor(this,se).schedule(N,y)}}zt.now=$r.now;const Wt=new class In extends zt{constructor(se,y=zt.now){super(se,y),this.actions=[],this._active=!1}flush(se){const{actions:y}=this;if(this._active)return void y.push(se);let N;this._active=!0;do{if(N=se.execute(se.state,se.delay))break}while(se=y.shift());if(this._active=!1,N){for(;se=y.shift();)se.unsubscribe();throw N}}}(class it extends Fe{constructor(se,y){super(se,y),this.scheduler=se,this.work=y,this.pending=!1}schedule(se,y=0){var N;if(this.closed)return this;this.state=se;const A=this.id,K=this.scheduler;return null!=A&&(this.id=this.recycleAsyncId(K,A,y)),this.pending=!0,this.delay=y,this.id=null!==(N=this.id)&&void 0!==N?N:this.requestAsyncId(K,this.id,y),this}requestAsyncId(se,y,N=0){return Le.setInterval(se.flush.bind(se,this),N)}recycleAsyncId(se,y,N=0){if(null!=N&&this.delay===N&&!1===this.pending)return y;null!=y&&Le.clearInterval(y)}execute(se,y){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;const N=this._execute(se,y);if(N)return N;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(se,y){let A,N=!1;try{this.work(se)}catch(K){N=!0,A=K||new Error("Scheduled action threw falsy error")}if(N)return this.unsubscribe(),A}unsubscribe(){if(!this.closed){const{id:se,scheduler:y}=this,{actions:N}=y;this.work=this.state=this.scheduler=null,this.pending=!1,(0,vt.o)(N,this),null!=se&&(this.id=this.recycleAsyncId(y,se,null)),this.delay=null,super.unsubscribe()}}});var Un=b(5510);function ct(R,se=Wt){return(0,V.N)((y,N)=>{let A=null,K=null,Re=null;const nt=()=>{if(A){A.unsubscribe(),A=null;const fn=K;K=null,N.next(fn)}};function At(){const fn=Re+R,Cn=se.now();if(Cn<fn)return A=this.schedule(void 0,fn-Cn),void N.add(A);nt()}y.subscribe((0,Un._)(N,fn=>{K=fn,Re=se.now(),A||(A=se.schedule(At,R),N.add(A))},()=>{nt(),N.complete()},void 0,()=>{K=A=null}))})}const gt=[[["","above-quill-editor-toolbar",""]],[["","quill-editor-toolbar",""]],[["","below-quill-editor-toolbar",""]]],Ft=["[above-quill-editor-toolbar]","[quill-editor-toolbar]","[below-quill-editor-toolbar]"];function tn(R,se){1&R&&o.nrm(0,"div",0)}function dn(R,se){1&R&&o.nrm(0,"div",0)}const Kt=(R,se)=>R||se||"html";let Bn=(()=>{class R{constructor(y,N){var A=this;this.config=N,this.quill$=(0,Sn.v)((0,Se.A)(function*(){if(!A.Quill){const K=A.document.addEventListener;A.document.addEventListener=A.document.__zone_symbol__addEventListener||A.document.addEventListener;const Re=yield b.e(256).then(b.bind(b,256));A.document.addEventListener=K,A.Quill=Re.default?.default??Re.default??Re}return A.config.customOptions?.forEach(K=>{const Re=A.Quill.import(K.import);Re.whitelist=K.whitelist,A.Quill.register(Re,!0,A.config.suppressGlobalRegisterWarning)}),yield A.registerCustomModules(A.Quill,A.config.customModules,A.config.suppressGlobalRegisterWarning)})).pipe(function de(R,se,y){let N,A=!1;return R&&"object"==typeof R?({bufferSize:N=1/0,windowTime:se=1/0,refCount:A=!1,scheduler:y}=R):N=R??1/0,function j(R={}){const{connector:se=(()=>new ur.B),resetOnError:y=!0,resetOnComplete:N=!0,resetOnRefCountZero:A=!0}=R;return K=>{let Re,nt,At,fn=0,Cn=!1,cr=!1;const Hn=()=>{nt?.unsubscribe(),nt=void 0},Pn=()=>{Hn(),Re=At=void 0,Cn=cr=!1},Nr=()=>{const xr=Re;Pn(),xr?.unsubscribe()};return(0,V.N)((xr,Fn)=>{fn++,!cr&&!Cn&&Hn();const Gn=At=At??se();Fn.add(()=>{fn--,0===fn&&!cr&&!Cn&&(nt=he(Nr,A))}),Gn.subscribe(Fn),!Re&&fn>0&&(Re=new P.Ms({next:ni=>Gn.next(ni),error:ni=>{cr=!0,Hn(),nt=he(Pn,y,ni),Gn.error(ni)},complete:()=>{Cn=!0,Hn(),nt=he(Pn,N),Gn.complete()}}),(0,ji.Tg)(xr).subscribe(Re))})(K)}}({connector:()=>new Hr(N,se,y),resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:A})}({bufferSize:1,refCount:!0})),this.document=y.get(h.qQ),this.config||(this.config={modules:Gt})}getQuill(){return this.quill$}registerCustomModules(y,N,A){return(0,Se.A)(function*(){if(Array.isArray(N))for(let{implementation:K,path:Re}of N)(0,yr.A)(K)&&(K=yield(0,rr._)(K)),y.register(Re,K,A);return y})()}static{this.\u0275fac=function(N){return new(N||R)(o.KVO(o.zZn),o.KVO(Jt,8))}}static{this.\u0275prov=o.jDH({token:R,factory:R.\u0275fac,providedIn:"root"})}}return R})(),Kn=(()=>{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.onN