diff --git a/160.3ead4d088fdc4328.js b/160.8112c9ad05c43621.js similarity index 96% rename from 160.3ead4d088fdc4328.js rename to 160.8112c9ad05c43621.js index 8c2c2da..653c154 100644 --- a/160.3ead4d088fdc4328.js +++ b/160.8112c9ad05c43621.js @@ -1 +1 @@ -"use strict";(self.webpackChunkngx_sub_form_demo=self.webpackChunkngx_sub_form_demo||[]).push([[160],{3160:(Ke,W,c)=>{c.r(W),c.d(W,{MainModule:()=>tc});var m=c(177),v=c(1971),T=c(4062),i=c(9417),Y=c(7673),N=c(6354),pe=c(5558),t=c(4438),ir=c(4412),C=function(e){return e.VEHICLE="Vehicle",e.DROID="Droid",e}(C||{}),h=function(e){return e.PROTOCOL="Protocol",e.MEDICAL="Medical",e.ASTROMECH="Astromech",e.ASSASSIN="Assassin",e}(h||{}),ue=function(e){return e.DROIDSPEAK="Droidspeak",e.EWOKESE="Ewokese",e.HUTTESE="Huttese",e.JAWAESE="Jawaese",e.SITH="Sith",e.SHYRIIWOOK="Shyriiwook",e}(ue||{}),Ee=function(e){return e.REGULAR="Regular",e.SPHERE="Sphere",e}(Ee||{}),D=function(e){return e.SABER="Saber",e.FLAME_THROWER="FlameThrower",e.GUN="Gun",e.AXE="Axe",e}(D||{}),S=function(e){return e.SPACESHIP="Spaceship",e.SPEEDER="Speeder",e}(S||{});const sr=[{id:"3f71b7eb-4a4f-40e6-9fca-e8cc7c0199c3",price:45e6,title:"Millenium Falcon",imageUrl:"https://vignette.wikia.nocookie.net/starwars/images/4/43/MillenniumFalconTFA-Fathead.png/revision/latest/scale-to-width-down/1000?cb=20161110011442",listingType:C.VEHICLE,product:{color:"#cec80d",canFire:!0,crewMembers:[{firstName:"Obi-Wan",lastName:"Kenobi"},{firstName:"R2",lastName:"D2"}],wingCount:0,vehicleType:S.SPACESHIP}},{id:"c01ad30c-d686-4db2-9a3c-6cf91c494bf0",price:5e5,title:"X-34 landspeeder",imageUrl:"https://vignette.wikia.nocookie.net/starwars/images/5/54/X34-landspeeder.jpg/revision/latest?cb=20080316031428",listingType:C.VEHICLE,product:{color:"#2468f7",canFire:!0,crewMembers:[{firstName:"Anakin",lastName:"Skywalker"}],vehicleType:S.SPEEDER,maximumSpeed:250}},{id:"99178909-7db2-4b75-99e5-028b2d4f6755",price:15e4,title:"C-3PO Protocol Droid",imageUrl:"https://vignette.wikia.nocookie.net/starwars/images/5/51/C-3PO_EP3.png/revision/latest?cb=20131005124036",listingType:C.DROID,product:{color:"#b38d03",name:"Proto",droidType:h.PROTOCOL,spokenLanguages:[ue.DROIDSPEAK,ue.HUTTESE]}},{id:"8aa98e18-838c-4a19-975e-2366c2566544",price:21e4,title:"2-1B Medial Droid",imageUrl:"https://vignette.wikia.nocookie.net/starwars/images/b/b6/2-1B_negtd.jpg/revision/latest/scale-to-width-down/200?cb=20100616170941",listingType:C.DROID,product:{color:"#07c911",name:"Medic",droidType:h.MEDICAL,canHealHumans:!0,canFixRobots:!0}},{id:"08c2c071-f03e-4a63-93b7-bd3df0f2987c",price:215e3,title:"R2D2 Astromech Droid",imageUrl:"https://vignette.wikia.nocookie.net/starwars/images/e/eb/ArtooTFA2-Fathead.png/revision/latest/scale-to-width-down/1000?cb=20161108040914",listingType:C.DROID,product:{color:"#ff0a0a",name:"Test",droidType:h.ASTROMECH,toolCount:15,shape:Ee.REGULAR}},{id:"0258166e-13b5-4580-a63b-7c1914ef660f",price:35e4,title:"K2-S0 Security Droid",imageUrl:"https://vignette.wikia.nocookie.net/starwars/images/f/fd/K-2SO_Sideshow.png/revision/latest?cb=20170302003128",listingType:C.DROID,product:{color:"#cc6969",name:"acwer fg",droidType:h.ASSASSIN,weapons:[D.AXE,D.FLAME_THROWER]}}];let ze=(()=>{class e{constructor(){this.listings$=new ir.t(sr)}getListings(){return this.listings$.asObservable().pipe((0,N.T)(this.listingsDeepCopy.bind(this)))}upsertListing(r){const n=this.listings$.getValue(),a=n.findIndex(s=>s.id===r.id);if(a>-1){const s=n.slice(0,a),l=n.slice(a+1);this.listings$.next([...s,r,...l])}else this.listings$.next([r,...this.listings$.getValue()])}getOneListing(r){return this.listings$.pipe((0,N.T)(n=>{const a=n.find(s=>s.id===r);if(!a)throw new Error("not found");return a}),(0,N.T)(this.listingDeepCopy))}listingDeepCopy(r){return JSON.parse(JSON.stringify(r))}listingsDeepCopy(r){return r.map(this.listingDeepCopy)}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275prov=t.jDH({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();const qe={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let fe;const lr=new Uint8Array(16);function cr(){if(!fe&&(fe=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!fe))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return fe(lr)}const y=[];for(let e=0;e<256;++e)y.push((e+256).toString(16).slice(1));const pr=function mr(e,o,r){if(qe.randomUUID&&!o&&!e)return qe.randomUUID();const n=(e=e||{}).random||(e.rng||cr)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,o){r=r||0;for(let a=0;a<16;++a)o[r+a]=n[a];return o}return function We(e,o=0){return(y[e[o+0]]+y[e[o+1]]+y[e[o+2]]+y[e[o+3]]+"-"+y[e[o+4]]+y[e[o+5]]+"-"+y[e[o+6]]+y[e[o+7]]+"-"+y[e[o+8]]+y[e[o+9]]+"-"+y[e[o+10]]+y[e[o+11]]+y[e[o+12]]+y[e[o+13]]+y[e[o+14]]+y[e[o+15]]).toLowerCase()}(n)};let ur=(()=>{class e{generate(){return pr()}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275prov=t.jDH({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();var de=c(450),Oe=c(1584),je=c(9974),Ae=c(5343),Q=c(4360),Qe=c(8750);function E(e){return[{provide:i.kq,useExisting:e,multi:!0},{provide:i.cz,useExisting:e,multi:!0}]}function Ze(e){return null==e}Error;var gr=c(362),hr=c.n(gr),Z=c(1413);const R=Symbol("ngx-observable-lifecycle-hooks"),ge=Symbol("ngx-observable-lifecycle-hooks-decorator");function et(e){return new Proxy({},{get:(o,r)=>function _r(e,o){e[R]||(e[R]={}),e[R][o]||(e[R][o]=new Z.B);const r=e.constructor.prototype;if(r[ge]||(r[ge]={}),!r[ge][o]){const n=r[o];r[o]=function(){n?.call(this),this[R]?.[o]?.next()};const a=r.ngOnDestroy;r.ngOnDestroy=function(){a?.call(this),this[R]?.[o]?.complete(),delete this[R]?.[o]},r[ge][o]=!0}return e[R][o]}(e,r).asObservable()})}var tt=c(3669),Ne=c(7786),rt=c(983),ot=c(8793),yr=c(4572),he=c(6697),Cr=c(9172),nt=c(4668),br=c(3236),at=c(3703),Tr=c(1397);function it(e,o){return o?r=>(0,ot.x)(o.pipe((0,he.s)(1),function vr(){return(0,je.N)((e,o)=>{e.subscribe((0,Q._)(o,Ae.l))})}()),r.pipe(it(e))):(0,Tr.Z)((r,n)=>e(r,n).pipe((0,he.s)(1),(0,at.u)(r)))}function ee(e,o=br.E){const r=(0,Oe.O)(e,o);return it(()=>r)}var Sr=c(9326),st=c(5964),$=c(8141),lt=c(6977);const ct=function Er(e,o){return e===o||e!=e&&o!=o},_e=function Or(e,o){for(var r=e.length;r--;)if(ct(e[r][0],o))return r;return-1};var Ar=Array.prototype.splice;function U(e){var o=-1,r=null==e?0:e.length;for(this.clear();++o-1},U.prototype.set=function Mr(e,o){var r=this.__data__,n=_e(r,e);return n<0?(++this.size,r.push([e,o])):r[n][1]=o,this};const ye=U,mt="object"==typeof global&&global&&global.Object===Object&&global;var Kr="object"==typeof self&&self&&self.Object===Object&&self;const O=mt||Kr||Function("return this")(),B=O.Symbol;var pt=Object.prototype,Wr=pt.hasOwnProperty,Qr=pt.toString,te=B?B.toStringTag:void 0;var ro=Object.prototype.toString;var ut=B?B.toStringTag:void 0;const re=function so(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":ut&&ut in Object(e)?function Zr(e){var o=Wr.call(e,te),r=e[te];try{e[te]=void 0;var n=!0}catch{}var a=Qr.call(e);return n&&(o?e[te]=r:delete e[te]),a}(e):function oo(e){return ro.call(e)}(e)},oe=function lo(e){var o=typeof e;return null!=e&&("object"==o||"function"==o)},ft=function fo(e){if(!oe(e))return!1;var o=re(e);return"[object Function]"==o||"[object GeneratorFunction]"==o||"[object AsyncFunction]"==o||"[object Proxy]"==o};var e,go=O["__core-js_shared__"],dt=(e=/[^.]+$/.exec(go&&go.keys&&go.keys.IE_PROTO||""))?"Symbol(src)_1."+e:"";var Co=Function.prototype.toString;const P=function bo(e){if(null!=e){try{return Co.call(e)}catch{}try{return e+""}catch{}}return""};var To=/^\[object .+?Constructor\]$/,Eo=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const jo=function Oo(e){return!(!oe(e)||function ho(e){return!!dt&&dt in e}(e))&&(ft(e)?Eo:To).test(P(e))},M=function Do(e,o){var r=function Ao(e,o){return e?.[o]}(e,o);return jo(r)?r:void 0},ne=M(O,"Map"),ae=M(Object,"create");var Yo=Object.prototype.hasOwnProperty;var Ho=Object.prototype.hasOwnProperty;function V(e){var o=-1,r=null==e?0:e.length;for(this.clear();++o-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991};var f={};f["[object Float32Array]"]=f["[object Float64Array]"]=f["[object Int8Array]"]=f["[object Int16Array]"]=f["[object Int32Array]"]=f["[object Uint8Array]"]=f["[object Uint8ClampedArray]"]=f["[object Uint16Array]"]=f["[object Uint32Array]"]=!0,f["[object Arguments]"]=f["[object Array]"]=f["[object ArrayBuffer]"]=f["[object Boolean]"]=f["[object DataView]"]=f["[object Date]"]=f["[object Error]"]=f["[object Function]"]=f["[object Map]"]=f["[object Number]"]=f["[object Object]"]=f["[object RegExp]"]=f["[object Set]"]=f["[object String]"]=f["[object WeakMap]"]=!1;const Ie=function _a(e){return function(o){return e(o)}};var Ft="object"==typeof exports&&exports&&!exports.nodeType&&exports,se=Ft&&"object"==typeof module&&module&&!module.nodeType&&module,$e=se&&se.exports===Ft&&mt.process;const J=function(){try{return se&&se.require&&se.require("util").types||$e&&$e.binding&&$e.binding("util")}catch{}}();var Et=J&&J.isTypedArray;const va=Et?Ie(Et):function ga(e){return ie(e)&&Gt(e.length)&&!!f[re(e)]};var Sa=Object.prototype.hasOwnProperty;const Ot=function wa(e,o){var r=Re(e),n=!r&&Dn(e),a=!r&&!n&&wt(e),s=!r&&!n&&!a&&va(e),l=r||n||a||s,p=l?function wn(e,o){for(var r=-1,n=Array(e);++r{Object.entries(o).forEach(([r,n])=>{e[r]=n})},rr=e=>{const o=Object.entries(e.controls).reduce((r,[n,a])=>{if(a.errors&&(r[n]=a.errors),a instanceof i.Bm){const s={};for(let l=0;l0){const l=r;n in l||(l[n]={}),Object.assign(l[n],s)}}return r},{});return e.errors||Object.values(o).length?Object.assign({},e.errors?{formGroup:e.errors}:{},o):null};var b=function(e){return e.SUB="Sub",e.ROOT="Root",e}(b||{});const Se=e=>e.formType===b.ROOT;function w(e,o){const{formGroup:r,defaultValues:n,formControlNames:a,formArrays:s}=function tl(e){const o=new i.J3(e.formControls,e.formGroupOptions),r=function Qs(e){return zs(e,5)}(o.value),n=Object.keys(e.formControls),a=n.reduce((l,p)=>(l[p]=p,l),{}),s=n.reduce((l,p)=>{const d=o.get(p);return d instanceof i.Bm&&l.push({key:p,control:d}),l},[]);return{formGroup:o,defaultValues:r,formControlNames:a,formArrays:s}}(o);let l=!1;const p=o.componentHooks??{onDestroy:et(e).ngOnDestroy,afterViewInit:et(e).ngAfterViewInit},d=(0,t.WQX)(t.gRc);p.onDestroy.pipe((0,he.s)(1)).subscribe(()=>{l=!0}),tr(e,{validate:()=>l||r.valid?null:rr(r)});const _=(0,Oe.O)(0),L=(e=>{const o=new Te.m(1),r=new Te.m(1),n=new Te.m(1),a=new Te.m(1);return tr(e,{writeValue:l=>{o.next(l)},registerOnChange:l=>{r.next(l)},registerOnTouched:l=>{n.next(l)},setDisabledState:l=>{a.next(!!l)}}),{writeValue$:o.asObservable(),registerOnChange$:r.asObservable(),registerOnTouched$:n.asObservable(),setDisabledState$:a.asObservable()}})(e),j=Se(o)?o.input$.pipe((0,Cr.Z)(null)):L.writeValue$,le=Se(o)?(0,Y.of)(g=>{g&&o.output$.next(g)}):L.registerOnChange$,ce=Se(o)?o.disabled$??(0,Y.of)(!1):L.setDisabledState$,Fe=j.pipe((0,N.T)(g=>Ze(g)?n:o.toFormGroup?o.toFormGroup(g):g),(0,nt.t)({refCount:!0,bufferSize:1})),me=Fe.pipe((0,pe.n)(g=>Se(o)?(o.manualSave$?o.manualSave$.pipe(function wr(...e){const o=(0,Sr.ms)(e);return(0,je.N)((r,n)=>{const a=e.length,s=new Array(a);let l=e.map(()=>!1),p=!1;for(let d=0;d{s[d]=_,!p&&!l[d]&&(l[d]=!0,(p=l.every(tt.D))&&(l=null))},Ae.l));r.subscribe((0,Q._)(n,d=>{if(p){const _=[d,...s];n.next(o?o(..._):_)}}))})}(r.valueChanges),(0,N.T)(([Je,oc])=>oc)):r.valueChanges).pipe((0,st.p)(()=>r.valid),ee(0),(0,st.p)(Je=>!r.invalid&&(o.outputFilterPredicate?o.outputFilterPredicate(g,Je):!hr()(g,Je))),o.handleEmissionRate??tt.D):r.valueChanges.pipe(ee(0))),(0,N.T)(g=>o.fromFormGroup?o.fromFormGroup(g):g)),F=(0,Ne.h)(j,me).pipe((0,nt.t)({bufferSize:1,refCount:!0})),A=Ze(o.emitNullOnDestroy)||o.emitNullOnDestroy?p.onDestroy.pipe((0,at.u)(null)):rt.w,ar=(e=>!!e.createFormArrayControl)(o)&&o.createFormArrayControl?o.createFormArrayControl:(g,q)=>new i.hs(q),rc={broadcastValueToParent$:le.pipe((0,pe.n)(g=>me.pipe((0,$.M)(q=>g(q))))),applyUpstreamUpdateOnLocalForm$:Fe.pipe((0,$.M)(g=>{((e,o,r)=>{e.length&&e.forEach(({key:n,control:a})=>{const s=o[n];if(Array.isArray(s)){for(;a.length>s.length;)a.removeAt(a.length-1);for(let l=a.length;l{d.markForCheck()}))),setDisabledState$:ce.pipe((0,$.M)(g=>{g?r.disable({emitEvent:!1}):r.enable({emitEvent:!1})})),updateValue$:_.pipe((0,$.M)(()=>{r.updateValueAndValidity({emitEvent:!1})})),bindTouched$:(0,yr.z)([L.registerOnTouched$,o.touched$??rt.w]).pipe(ee(0),(0,$.M)(([g])=>g()))};return(0,Ne.h)(...Object.values(rc)).pipe((0,lt.Q)(p.onDestroy)).subscribe(),le.pipe((0,pe.n)(g=>A.pipe((0,$.M)(q=>g(q)))),(0,lt.Q)(p.onDestroy.pipe(ee(0)))).subscribe(),{formGroup:r,formControlNames:a,get formGroupErrors(){return rr(r)},createFormArrayControl:ar,controlValue$:F}}class Xe{constructor(o){}}var we=c(8834),G=c(2102),I=c(9631),K=c(1756),z=c(6600),x=c(5596),nl=c(1801);let al=(()=>{class e{constructor(){this.form=w(this,{formType:b.SUB,formControls:{firstName:new i.hs(null,[i.k0.required]),lastName:new i.hs(null,[i.k0.required])}})}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275cmp=t.VBU({type:e,selectors:[["app-crew-member"]],features:[t.Jv_(E(e))],decls:7,vars:3,consts:[["data-crew-member","",1,"container",3,"formGroup"],["matInput","","data-input-crew-member-first-name","","type","text","placeholder","First name","autocomplete","off",3,"formControlName"],["matInput","","data-input-crew-member-last-name","","type","text","placeholder","Last name","autocomplete","off",3,"formControlName"]],template:function(n,a){1&n&&(t.j41(0,"fieldset",0)(1,"legend"),t.EFF(2,"Crew member form"),t.k0s(),t.j41(3,"mat-form-field"),t.nrm(4,"input",1),t.k0s(),t.j41(5,"mat-form-field"),t.nrm(6,"input",2),t.k0s()()),2&n&&(t.Y8G("formGroup",a.form.formGroup),t.R7$(4),t.Y8G("formControlName",a.form.formControlNames.firstName),t.R7$(2),t.Y8G("formControlName",a.form.formControlNames.lastName))},dependencies:[i.me,i.BC,i.cb,i.j4,i.JD,G.rl,I.fg],changeDetection:0})}return e})();function il(e,o){if(1&e){const r=t.RV6();t.j41(0,"div",3),t.nrm(1,"app-crew-member",4),t.j41(2,"button",5),t.bIt("click",function(){const a=t.eBV(r).index,s=t.XpG();return t.Njj(s.removeCrewMember(a))}),t.j41(3,"mat-icon"),t.EFF(4,"delete"),t.k0s()()()}if(2&e){const r=o.$implicit,n=t.XpG();t.Y8G("formArrayName",n.form.formControlNames.crewMembers),t.R7$(),t.Y8G("formControl",r),t.R7$(),t.Y8G("disabled",n.form.formGroup.disabled)}}let or=(()=>{class e{constructor(){this.form=w(this,{formType:b.SUB,formControls:{crewMembers:new i.Bm([],{validators:r=>r.value.length>=2?null:{minimumCrewMemberCount:2}})},toFormGroup:r=>({crewMembers:r||[]}),fromFormGroup:r=>r.crewMembers,createFormArrayControl:(r,n)=>"crewMembers"===r?new i.hs(n,[i.k0.required]):new i.hs(n)})}removeCrewMember(r){this.form.formGroup.controls.crewMembers.removeAt(r)}addCrewMember(){this.form.formGroup.controls.crewMembers.push(this.form.createFormArrayControl("crewMembers",{firstName:"",lastName:""}))}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275cmp=t.VBU({type:e,selectors:[["app-crew-members"]],features:[t.Jv_(E(e))],decls:8,vars:3,consts:[[1,"container",3,"formGroup"],["class","crew-member",3,"formArrayName",4,"ngFor","ngForOf"],["mat-raised-button","","data-btn-add-crew-member","","color","primary",1,"add-crew-member",3,"click","disabled"],[1,"crew-member",3,"formArrayName"],[3,"formControl"],["mat-mini-fab","","color","primary",3,"click","disabled"]],template:function(n,a){1&n&&(t.j41(0,"fieldset",0)(1,"legend"),t.EFF(2," Crew members form "),t.j41(3,"small"),t.EFF(4,"(Minimum 2)"),t.k0s()(),t.DNE(5,il,5,3,"div",1),t.j41(6,"button",2),t.bIt("click",function(){return a.addCrewMember()}),t.EFF(7," Add a crew member "),t.k0s()()),2&n&&(t.Y8G("formGroup",a.form.formGroup),t.R7$(5),t.Y8G("ngForOf",a.form.formGroup.controls.crewMembers.controls),t.R7$(),t.Y8G("disabled",a.form.formGroup.disabled))},dependencies:[m.Sq,i.BC,i.cb,i.l_,i.j4,i.v8,we.$z,we.$0,nl.An,al],styles:[".crew-member[_ngcontent-%COMP%]{display:flex;align-items:center}app-crew-member[_ngcontent-%COMP%]{margin-bottom:15px}.add-crew-member[_ngcontent-%COMP%]{margin-top:15px}"],changeDetection:0})}return e})(),sl=(()=>{class e{constructor(){this.form=w(this,{formType:b.SUB,formControls:{color:new i.hs(null,{validators:[i.k0.required]}),canFire:new i.hs(!1,{validators:[i.k0.required]}),crewMembers:new i.hs(null,{validators:[i.k0.required]}),wingCount:new i.hs(null,{validators:[i.k0.required]}),vehicleType:new i.hs(S.SPACESHIP,{validators:[i.k0.required]})}})}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275cmp=t.VBU({type:e,selectors:[["app-spaceship"]],features:[t.Jv_(E(e))],decls:10,vars:5,consts:[[1,"container",3,"formGroup"],["matInput","","data-input-color","","type","color","placeholder","Color","autocomplete","off",3,"formControlName"],["data-input-can-fire","",3,"formControlName"],["matInput","","data-input-number-of-wings","","type","number","placeholder","Number of wings","autocomplete","off",3,"formControlName"],[3,"formControlName"]],template:function(n,a){1&n&&(t.j41(0,"fieldset",0)(1,"legend"),t.EFF(2,"Spaceship form"),t.k0s(),t.j41(3,"mat-form-field"),t.nrm(4,"input",1),t.k0s(),t.j41(5,"mat-slide-toggle",2),t.EFF(6,"Can fire"),t.k0s(),t.j41(7,"mat-form-field"),t.nrm(8,"input",3),t.k0s(),t.nrm(9,"app-crew-members",4),t.k0s()),2&n&&(t.Y8G("formGroup",a.form.formGroup),t.R7$(4),t.Y8G("formControlName",a.form.formControlNames.color),t.R7$(),t.Y8G("formControlName",a.form.formControlNames.canFire),t.R7$(3),t.Y8G("formControlName",a.form.formControlNames.wingCount),t.R7$(),t.Y8G("formControlName",a.form.formControlNames.crewMembers))},dependencies:[i.me,i.Q0,i.BC,i.cb,i.j4,i.JD,G.rl,I.fg,de.sG,or],styles:[".container[_ngcontent-%COMP%]{display:flex;flex-direction:column}"],changeDetection:0})}return e})(),ll=(()=>{class e{constructor(){this.form=w(this,{formType:b.SUB,formControls:{color:new i.hs(null,{validators:[i.k0.required]}),canFire:new i.hs(!1,{validators:[i.k0.required]}),crewMembers:new i.hs(null,{validators:[i.k0.required]}),vehicleType:new i.hs(S.SPEEDER,{validators:[i.k0.required]}),maximumSpeed:new i.hs(null,{validators:[i.k0.required]})}})}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275cmp=t.VBU({type:e,selectors:[["app-speeder"]],features:[t.Jv_(E(e))],decls:10,vars:5,consts:[[1,"container",3,"formGroup"],["matInput","","data-input-color","","type","color","placeholder","Color","autocomplete","off",3,"formControlName"],["data-input-can-fire","",3,"formControlName"],[3,"formControlName"],["matInput","","data-input-maximum-speed","","type","number","placeholder","Maximum speed","autocomplete","off",3,"formControlName"]],template:function(n,a){1&n&&(t.j41(0,"fieldset",0)(1,"legend"),t.EFF(2,"Speeder form"),t.k0s(),t.j41(3,"mat-form-field"),t.nrm(4,"input",1),t.k0s(),t.j41(5,"mat-slide-toggle",2),t.EFF(6,"Can fire"),t.k0s(),t.nrm(7,"app-crew-members",3),t.j41(8,"mat-form-field"),t.nrm(9,"input",4),t.k0s()()),2&n&&(t.Y8G("formGroup",a.form.formGroup),t.R7$(4),t.Y8G("formControlName",a.form.formControlNames.color),t.R7$(),t.Y8G("formControlName",a.form.formControlNames.canFire),t.R7$(2),t.Y8G("formControlName",a.form.formControlNames.crewMembers),t.R7$(2),t.Y8G("formControlName",a.form.formControlNames.maximumSpeed))},dependencies:[i.me,i.Q0,i.BC,i.cb,i.j4,i.JD,G.rl,I.fg,de.sG,or],styles:[".container[_ngcontent-%COMP%]{display:flex;flex-direction:column}"],changeDetection:0})}return e})();function cl(e,o){if(1&e&&(t.j41(0,"mat-option",5),t.EFF(1),t.k0s()),2&e){const r=o.$implicit;t.Y8G("value",r.value),t.R7$(),t.SpI(" ",r.value," ")}}function ml(e,o){if(1&e&&t.nrm(0,"app-spaceship",6),2&e){const r=t.XpG();t.Y8G("formControlName",r.form.formControlNames.spaceship)}}function pl(e,o){if(1&e&&t.nrm(0,"app-speeder",6),2&e){const r=t.XpG();t.Y8G("formControlName",r.form.formControlNames.speeder)}}let ul=(()=>{class e{constructor(){this.VehicleType=S,this.form=w(this,{formType:b.SUB,formControls:{speeder:new i.hs(null),spaceship:new i.hs(null),vehicleType:new i.hs(null,{validators:[i.k0.required]})},toFormGroup:r=>({speeder:r.vehicleType===S.SPEEDER?r:null,spaceship:r.vehicleType===S.SPACESHIP?r:null,vehicleType:r.vehicleType}),fromFormGroup:r=>{switch(r.vehicleType){case S.SPEEDER:return r.speeder;case S.SPACESHIP:return r.spaceship;case null:return null;default:throw new Xe(r.vehicleType)}}})}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275cmp=t.VBU({type:e,selectors:[["app-vehicle-product"]],features:[t.Jv_(E(e))],decls:10,vars:8,consts:[[1,"container",3,"formGroup"],["data-select-vehicle-type","","placeholder","Select vehicle type",3,"formControlName"],["data-select-vehicle-type-option","",3,"value",4,"ngFor","ngForOf"],[3,"ngSwitch"],[3,"formControlName",4,"ngSwitchCase"],["data-select-vehicle-type-option","",3,"value"],[3,"formControlName"]],template:function(n,a){1&n&&(t.j41(0,"fieldset",0)(1,"legend"),t.EFF(2,"Vehicle form"),t.k0s(),t.j41(3,"mat-form-field")(4,"mat-select",1),t.DNE(5,cl,2,2,"mat-option",2),t.nI1(6,"keyvalue"),t.k0s()(),t.j41(7,"div",3),t.DNE(8,ml,1,1,"app-spaceship",4)(9,pl,1,1,"app-speeder",4),t.k0s()()),2&n&&(t.Y8G("formGroup",a.form.formGroup),t.R7$(4),t.Y8G("formControlName",a.form.formControlNames.vehicleType),t.R7$(),t.Y8G("ngForOf",t.bMT(6,6,a.VehicleType)),t.R7$(2),t.Y8G("ngSwitch",a.form.formGroup.value.vehicleType),t.R7$(),t.Y8G("ngSwitchCase",a.VehicleType.SPACESHIP),t.R7$(),t.Y8G("ngSwitchCase",a.VehicleType.SPEEDER))},dependencies:[m.Sq,m.ux,m.e1,i.BC,i.cb,i.j4,i.JD,G.rl,K.VO,z.wT,sl,ll,m.lG],styles:[".container[_ngcontent-%COMP%]{display:flex;flex-direction:column}"],changeDetection:0})}return e})();function fl(e,o){if(1&e&&(t.j41(0,"mat-option",5),t.EFF(1),t.k0s()),2&e){const r=o.$implicit;t.Y8G("value",r.value),t.R7$(),t.SpI(" ",r.value," ")}}let dl=(()=>{class e{constructor(){this.Languages=ue,this.form=w(this,{formType:b.SUB,formControls:{color:new i.hs(null,{validators:[i.k0.required]}),name:new i.hs(null,{validators:[i.k0.required]}),droidType:new i.hs(h.PROTOCOL,{validators:[i.k0.required]}),spokenLanguages:new i.hs(null,{validators:[i.k0.required]})}})}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275cmp=t.VBU({type:e,selectors:[["app-protocol-droid"]],features:[t.Jv_(E(e))],decls:11,vars:7,consts:[[1,"container",3,"formGroup"],["matInput","","type","color","placeholder","Color","autocomplete","off",3,"formControlName"],["matInput","","type","text","placeholder","Name","autocomplete","off",3,"formControlName"],["placeholder","Select spoken languages","multiple","",3,"formControlName"],[3,"value",4,"ngFor","ngForOf"],[3,"value"]],template:function(n,a){1&n&&(t.j41(0,"fieldset",0)(1,"legend"),t.EFF(2,"Protocol Droid form"),t.k0s(),t.j41(3,"mat-form-field"),t.nrm(4,"input",1),t.k0s(),t.j41(5,"mat-form-field"),t.nrm(6,"input",2),t.k0s(),t.j41(7,"mat-form-field")(8,"mat-select",3),t.DNE(9,fl,2,2,"mat-option",4),t.nI1(10,"keyvalue"),t.k0s()()()),2&n&&(t.Y8G("formGroup",a.form.formGroup),t.R7$(4),t.Y8G("formControlName",a.form.formControlNames.color),t.R7$(2),t.Y8G("formControlName",a.form.formControlNames.name),t.R7$(2),t.Y8G("formControlName",a.form.formControlNames.spokenLanguages),t.R7$(),t.Y8G("ngForOf",t.bMT(10,5,a.Languages)))},dependencies:[m.Sq,i.me,i.BC,i.cb,i.j4,i.JD,G.rl,I.fg,K.VO,z.wT,m.lG],styles:[".container[_ngcontent-%COMP%]{display:flex;flex-direction:column}"],changeDetection:0})}return e})(),gl=(()=>{class e{constructor(){this.form=w(this,{formType:b.SUB,formControls:{color:new i.hs(null,{validators:[i.k0.required]}),name:new i.hs(null,{validators:[i.k0.required]}),droidType:new i.hs(h.MEDICAL,{validators:[i.k0.required]}),canHealHumans:new i.hs(!1,{validators:[i.k0.required]}),canFixRobots:new i.hs(!1,{validators:[i.k0.required]})}})}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275cmp=t.VBU({type:e,selectors:[["app-medical-droid"]],features:[t.Jv_(E(e))],decls:11,vars:5,consts:[[1,"container",3,"formGroup"],["matInput","","type","color","placeholder","Color","autocomplete","off",3,"formControlName"],["matInput","","type","text","placeholder","Name","autocomplete","off",3,"formControlName"],[3,"formControlName"]],template:function(n,a){1&n&&(t.j41(0,"fieldset",0)(1,"legend"),t.EFF(2,"Medical Droid form"),t.k0s(),t.j41(3,"mat-form-field"),t.nrm(4,"input",1),t.k0s(),t.j41(5,"mat-form-field"),t.nrm(6,"input",2),t.k0s(),t.j41(7,"mat-slide-toggle",3),t.EFF(8,"Can heal humans"),t.k0s(),t.j41(9,"mat-slide-toggle",3),t.EFF(10,"Can fix robots"),t.k0s()()),2&n&&(t.Y8G("formGroup",a.form.formGroup),t.R7$(4),t.Y8G("formControlName",a.form.formControlNames.color),t.R7$(2),t.Y8G("formControlName",a.form.formControlNames.name),t.R7$(),t.Y8G("formControlName",a.form.formControlNames.canHealHumans),t.R7$(2),t.Y8G("formControlName",a.form.formControlNames.canFixRobots))},dependencies:[i.me,i.BC,i.cb,i.j4,i.JD,G.rl,I.fg,de.sG],styles:[".container[_ngcontent-%COMP%]{display:flex;flex-direction:column}"],changeDetection:0})}return e})();function hl(e,o){if(1&e&&(t.j41(0,"mat-option",6),t.EFF(1),t.k0s()),2&e){const r=o.$implicit;t.Y8G("value",r.value),t.R7$(),t.SpI(" ",r.value," ")}}let _l=(()=>{class e{constructor(){this.AstromechDroidShape=Ee,this.form=w(this,{formType:b.SUB,formControls:{color:new i.hs(null,{validators:[i.k0.required]}),name:new i.hs(null,{validators:[i.k0.required]}),droidType:new i.hs(h.ASTROMECH,{validators:[i.k0.required]}),toolCount:new i.hs(null,{validators:[i.k0.required]}),shape:new i.hs(null,{validators:[i.k0.required]})}})}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275cmp=t.VBU({type:e,selectors:[["app-astromech-droid"]],features:[t.Jv_(E(e))],decls:13,vars:8,consts:[[1,"container",3,"formGroup"],["matInput","","type","color","placeholder","Color","autocomplete","off",3,"formControlName"],["matInput","","type","text","placeholder","Name","autocomplete","off",3,"formControlName"],["matInput","","type","number","placeholder","Number of tools carried","autocomplete","off",3,"formControlName"],["placeholder","Select the droid shape",3,"formControlName"],[3,"value",4,"ngFor","ngForOf"],[3,"value"]],template:function(n,a){1&n&&(t.j41(0,"fieldset",0)(1,"legend"),t.EFF(2,"Astromech Droid form"),t.k0s(),t.j41(3,"mat-form-field"),t.nrm(4,"input",1),t.k0s(),t.j41(5,"mat-form-field"),t.nrm(6,"input",2),t.k0s(),t.j41(7,"mat-form-field"),t.nrm(8,"input",3),t.k0s(),t.j41(9,"mat-form-field")(10,"mat-select",4),t.DNE(11,hl,2,2,"mat-option",5),t.nI1(12,"keyvalue"),t.k0s()()()),2&n&&(t.Y8G("formGroup",a.form.formGroup),t.R7$(4),t.Y8G("formControlName",a.form.formControlNames.color),t.R7$(2),t.Y8G("formControlName",a.form.formControlNames.name),t.R7$(2),t.Y8G("formControlName",a.form.formControlNames.toolCount),t.R7$(2),t.Y8G("formControlName",a.form.formControlNames.shape),t.R7$(),t.Y8G("ngForOf",t.bMT(12,6,a.AstromechDroidShape)))},dependencies:[m.Sq,i.me,i.Q0,i.BC,i.cb,i.j4,i.JD,G.rl,I.fg,K.VO,z.wT,m.lG],styles:[".container[_ngcontent-%COMP%]{display:flex;flex-direction:column}"],changeDetection:0})}return e})();function yl(e,o){if(1&e&&(t.j41(0,"mat-option",5),t.EFF(1),t.k0s()),2&e){const r=o.$implicit,n=t.XpG();t.Y8G("value",r.value),t.R7$(),t.SpI(" ",n.assassinDroidWeaponText[r.value]," ")}}const Cl={[D.SABER]:"Saber",[D.FLAME_THROWER]:"Flame thrower",[D.GUN]:"Gun",[D.AXE]:"Axe"};let bl=(()=>{class e{constructor(){this.AssassinDroidWeapon=D,this.assassinDroidWeaponText=Cl,this.form=w(this,{formType:b.SUB,formControls:{color:new i.hs(null,{validators:[i.k0.required]}),name:new i.hs(null,{validators:[i.k0.required]}),droidType:new i.hs(h.ASSASSIN,{validators:[i.k0.required]}),weapons:new i.hs([],{validators:[i.k0.required]})}})}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275cmp=t.VBU({type:e,selectors:[["app-assassin-droid"]],features:[t.Jv_(E(e))],decls:11,vars:7,consts:[[1,"container",3,"formGroup"],["matInput","","data-input-color","","type","color","placeholder","Color","autocomplete","off",3,"formControlName"],["matInput","","data-input-name","","type","text","placeholder","Name","autocomplete","off",3,"formControlName"],["data-select-weapons","","placeholder","Select weapons","multiple","",3,"formControlName"],["data-select-weapons-option","",3,"value",4,"ngFor","ngForOf"],["data-select-weapons-option","",3,"value"]],template:function(n,a){1&n&&(t.j41(0,"fieldset",0)(1,"legend"),t.EFF(2,"Assassin Droid form"),t.k0s(),t.j41(3,"mat-form-field"),t.nrm(4,"input",1),t.k0s(),t.j41(5,"mat-form-field"),t.nrm(6,"input",2),t.k0s(),t.j41(7,"mat-form-field")(8,"mat-select",3),t.DNE(9,yl,2,2,"mat-option",4),t.nI1(10,"keyvalue"),t.k0s()()()),2&n&&(t.Y8G("formGroup",a.form.formGroup),t.R7$(4),t.Y8G("formControlName",a.form.formControlNames.color),t.R7$(2),t.Y8G("formControlName",a.form.formControlNames.name),t.R7$(2),t.Y8G("formControlName",a.form.formControlNames.weapons),t.R7$(),t.Y8G("ngForOf",t.bMT(10,5,a.AssassinDroidWeapon)))},dependencies:[m.Sq,i.me,i.BC,i.cb,i.j4,i.JD,G.rl,I.fg,K.VO,z.wT,m.lG],styles:[".container[_ngcontent-%COMP%]{display:flex;flex-direction:column}"],changeDetection:0})}return e})();function vl(e,o){if(1&e&&(t.j41(0,"mat-option",5),t.EFF(1),t.k0s()),2&e){const r=o.$implicit;t.Y8G("value",r.value),t.R7$(),t.SpI(" ",r.value," ")}}function Tl(e,o){if(1&e&&t.nrm(0,"app-protocol-droid",6),2&e){const r=t.XpG();t.Y8G("formControlName",r.form.formControlNames.protocolDroid)}}function Sl(e,o){if(1&e&&t.nrm(0,"app-medical-droid",6),2&e){const r=t.XpG();t.Y8G("formControlName",r.form.formControlNames.medicalDroid)}}function wl(e,o){if(1&e&&t.nrm(0,"app-astromech-droid",6),2&e){const r=t.XpG();t.Y8G("formControlName",r.form.formControlNames.astromechDroid)}}function Gl(e,o){if(1&e&&t.nrm(0,"app-assassin-droid",6),2&e){const r=t.XpG();t.Y8G("formControlName",r.form.formControlNames.assassinDroid)}}let Fl=(()=>{class e{constructor(){this.DroidType=h,this.form=w(this,{formType:b.SUB,formControls:{protocolDroid:new i.hs(null),medicalDroid:new i.hs(null),astromechDroid:new i.hs(null),assassinDroid:new i.hs(null),droidType:new i.hs(null,{validators:[i.k0.required]})},toFormGroup:r=>({protocolDroid:r.droidType===h.PROTOCOL?r:null,medicalDroid:r.droidType===h.MEDICAL?r:null,astromechDroid:r.droidType===h.ASTROMECH?r:null,assassinDroid:r.droidType===h.ASSASSIN?r:null,droidType:r.droidType}),fromFormGroup:r=>{switch(r.droidType){case h.PROTOCOL:return r.protocolDroid;case h.MEDICAL:return r.medicalDroid;case h.ASTROMECH:return r.astromechDroid;case h.ASSASSIN:return r.assassinDroid;case null:return null;default:throw new Xe(r.droidType)}}})}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275cmp=t.VBU({type:e,selectors:[["app-droid-product"]],features:[t.Jv_(E(e))],decls:12,vars:10,consts:[[1,"container",3,"formGroup"],["data-select-droid-type","","placeholder","Select droid type",3,"formControlName"],["data-select-droid-type-option","",3,"value",4,"ngFor","ngForOf"],[3,"ngSwitch"],[3,"formControlName",4,"ngSwitchCase"],["data-select-droid-type-option","",3,"value"],[3,"formControlName"]],template:function(n,a){1&n&&(t.j41(0,"fieldset",0)(1,"legend"),t.EFF(2,"Droid form"),t.k0s(),t.j41(3,"mat-form-field")(4,"mat-select",1),t.DNE(5,vl,2,2,"mat-option",2),t.nI1(6,"keyvalue"),t.k0s()(),t.j41(7,"div",3),t.DNE(8,Tl,1,1,"app-protocol-droid",4)(9,Sl,1,1,"app-medical-droid",4)(10,wl,1,1,"app-astromech-droid",4)(11,Gl,1,1,"app-assassin-droid",4),t.k0s()()),2&n&&(t.Y8G("formGroup",a.form.formGroup),t.R7$(4),t.Y8G("formControlName",a.form.formControlNames.droidType),t.R7$(),t.Y8G("ngForOf",t.bMT(6,8,a.DroidType)),t.R7$(2),t.Y8G("ngSwitch",a.form.formGroup.value.droidType),t.R7$(),t.Y8G("ngSwitchCase",a.DroidType.PROTOCOL),t.R7$(),t.Y8G("ngSwitchCase",a.DroidType.MEDICAL),t.R7$(),t.Y8G("ngSwitchCase",a.DroidType.ASTROMECH),t.R7$(),t.Y8G("ngSwitchCase",a.DroidType.ASSASSIN))},dependencies:[m.Sq,m.ux,m.e1,i.BC,i.cb,i.j4,i.JD,G.rl,K.VO,z.wT,dl,gl,_l,bl,m.lG],styles:[".container[_ngcontent-%COMP%]{display:flex;flex-direction:column}"],changeDetection:0})}return e})();function El(e,o){if(1&e&&t.nrm(0,"img",23),2&e){const r=t.XpG();t.Mz_("alt","Photo of ",r.form.formGroup.value.title,""),t.Y8G("src",r.form.formGroup.value.imageUrl,t.B4B)}}function Ol(e,o){1&e&&(t.j41(0,"mat-error",24),t.EFF(1,"ID is required"),t.k0s())}function jl(e,o){1&e&&(t.j41(0,"mat-error",25),t.EFF(1,"Title is required"),t.k0s())}function Al(e,o){1&e&&(t.j41(0,"mat-error",26),t.EFF(1," Image url is required "),t.k0s())}function Nl(e,o){1&e&&(t.j41(0,"mat-error",27),t.EFF(1,"Price is required"),t.k0s())}function Dl(e,o){if(1&e&&(t.j41(0,"mat-option",28),t.EFF(1),t.k0s()),2&e){const r=o.$implicit;t.Y8G("value",r.value),t.R7$(),t.SpI(" ",r.value," ")}}function Rl(e,o){if(1&e&&t.nrm(0,"app-droid-product",29),2&e){const r=t.XpG();t.Y8G("formControlName",r.form.formControlNames.droidProduct)}}function Il(e,o){if(1&e&&t.nrm(0,"app-vehicle-product",29),2&e){const r=t.XpG();t.Y8G("formControlName",r.form.formControlNames.vehicleProduct)}}function $l(e,o){1&e&&(t.j41(0,"div",32),t.EFF(1,"Form is invalid"),t.k0s())}function Pl(e,o){if(1&e){const r=t.RV6();t.j41(0,"div")(1,"button",30),t.bIt("click",function(){t.eBV(r);const a=t.XpG();return t.Njj(a.manualSave$$.next())}),t.EFF(2," Upsert "),t.k0s(),t.DNE(3,$l,2,0,"div",31),t.k0s()}if(2&e){const r=t.XpG();t.R7$(),t.Y8G("disabled",r.form.formGroup.invalid||r.form.formGroup.disabled),t.R7$(2),t.Y8G("ngIf",r.form.formGroup.invalid)}}function Ml(e,o){if(1&e&&(t.j41(0,"pre",33),t.EFF(1),t.nI1(2,"json"),t.k0s()),2&e){const r=o.ngIf;t.R7$(),t.JRh(t.bMT(2,1,r))}}function kl(e,o){1&e&&(t.j41(0,"span",34),t.EFF(1,"Form is valid, no error!"),t.k0s())}let xl=(()=>{class e{constructor(){this.ListingType=C,this.input$=new Z.B,this.disabled$=new Z.B,this.listingUpdated=new Z.B,this.manualSave$$=new Z.B,this.form=w(this,{formType:b.ROOT,disabled$:this.disabled$,input$:this.input$,output$:this.listingUpdated,manualSave$:this.manualSave$$,formControls:{vehicleProduct:new i.hs(null),droidProduct:new i.hs(null),listingType:new i.hs(null,i.k0.required),id:new i.hs(null,i.k0.required),title:new i.hs(null,i.k0.required),imageUrl:new i.hs(null,i.k0.required),price:new i.hs(null,i.k0.required)},toFormGroup:r=>{const{listingType:n,product:a,...s}=r;return{vehicleProduct:r.listingType===C.VEHICLE?r.product:null,droidProduct:r.listingType===C.DROID?r.product:null,listingType:r.listingType,...s}},fromFormGroup:r=>{const{vehicleProduct:n,droidProduct:a,listingType:s,...l}=r;switch(s){case C.DROID:return a?{product:a,listingType:s,...l}:null;case C.VEHICLE:return n?{product:n,listingType:s,...l}:null;case null:return null;default:throw new Xe(s)}}})}set listing(r){this.input$.next(r)}set disabled(r){this.disabled$.next(r||!1)}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275cmp=t.VBU({type:e,selectors:[["app-listing-form"]],inputs:{listing:"listing",disabled:"disabled"},outputs:{listingUpdated:"listingUpdated"},decls:46,vars:31,consts:[["noError",""],["appearance","outlined","data-card-form",""],["data-title",""],["data-price",""],[1,"img-container"],["mat-card-image","",3,"src","alt",4,"ngIf"],[3,"formGroup"],["matInput","","data-input-id","","type","text","placeholder","ID","autocomplete","off",3,"formControlName"],["data-input-id-error","",4,"ngIf"],["matInput","","data-input-title","","type","text","placeholder","Title","autocomplete","off",3,"formControlName"],["data-input-title-error","",4,"ngIf"],["matInput","","data-input-image-url","","type","text","placeholder","Image Url","autocomplete","off",3,"formControlName"],["data-input-image-url-error","",4,"ngIf"],["matInput","","data-input-price","","type","number","placeholder","Price","autocomplete","off",3,"formControlName"],["data-input-price-error","",4,"ngIf"],["data-select-listing-type","","placeholder","Select listing type",3,"formControlName"],["data-select-listing-type-option","",3,"value",4,"ngFor","ngForOf"],[3,"ngSwitch"],[3,"formControlName",4,"ngSwitchCase"],[4,"ngIf"],["appearance","outlined","data-card-errors","",1,"errors"],["data-errors","",4,"ngIf","ngIfElse"],["appearance","outlined","data-card-values","",1,"values"],["mat-card-image","",3,"src","alt"],["data-input-id-error",""],["data-input-title-error",""],["data-input-image-url-error",""],["data-input-price-error",""],["data-select-listing-type-option","",3,"value"],[3,"formControlName"],["mat-raised-button","","color","primary",3,"click","disabled"],["class","invalid-form",4,"ngIf"],[1,"invalid-form"],["data-errors",""],["data-no-error",""]],template:function(n,a){if(1&n&&(t.j41(0,"mat-card",1)(1,"mat-card-header")(2,"mat-card-title",2),t.EFF(3),t.k0s(),t.j41(4,"mat-card-subtitle",3),t.EFF(5),t.nI1(6,"number"),t.k0s()(),t.j41(7,"div",4),t.DNE(8,El,1,3,"img",5),t.k0s(),t.j41(9,"mat-card-content")(10,"form",6)(11,"mat-form-field"),t.nrm(12,"input",7),t.k0s(),t.DNE(13,Ol,2,0,"mat-error",8),t.j41(14,"mat-form-field"),t.nrm(15,"input",9),t.k0s(),t.DNE(16,jl,2,0,"mat-error",10),t.j41(17,"mat-form-field"),t.nrm(18,"input",11),t.k0s(),t.DNE(19,Al,2,0,"mat-error",12),t.j41(20,"mat-form-field"),t.nrm(21,"input",13),t.k0s(),t.DNE(22,Nl,2,0,"mat-error",14),t.j41(23,"mat-form-field")(24,"mat-select",15),t.DNE(25,Dl,2,2,"mat-option",16),t.nI1(26,"keyvalue"),t.k0s()(),t.j41(27,"div",17),t.DNE(28,Rl,1,1,"app-droid-product",18)(29,Il,1,1,"app-vehicle-product",18),t.k0s()()(),t.j41(30,"mat-card-actions"),t.DNE(31,Pl,4,2,"div",19),t.k0s()(),t.j41(32,"mat-card",20)(33,"mat-card-title"),t.EFF(34,"Form errors"),t.k0s(),t.j41(35,"mat-card-content"),t.DNE(36,Ml,3,3,"pre",21)(37,kl,2,0,"ng-template",null,0,t.C5r),t.k0s()(),t.j41(39,"mat-card",22)(40,"mat-card-title"),t.EFF(41,"Form values"),t.k0s(),t.j41(42,"mat-card-content")(43,"pre"),t.EFF(44),t.nI1(45,"json"),t.k0s()()()),2&n){const s=t.sdS(38);t.R7$(2),t.AVh("not-visible",!a.form.formGroup.value.title),t.R7$(),t.SpI(" ",a.form.formGroup.value.title," "),t.R7$(),t.AVh("not-visible",!a.form.formGroup.value.price),t.R7$(),t.SpI(" \xa3",t.bMT(6,25,a.form.formGroup.value.price)," "),t.R7$(3),t.Y8G("ngIf",a.form.formGroup.value.imageUrl),t.R7$(2),t.Y8G("formGroup",a.form.formGroup),t.R7$(2),t.Y8G("formControlName",a.form.formControlNames.id),t.R7$(),t.Y8G("ngIf",null==a.form.formGroupErrors||null==a.form.formGroupErrors.id?null:a.form.formGroupErrors.id.required),t.R7$(2),t.Y8G("formControlName",a.form.formControlNames.title),t.R7$(),t.Y8G("ngIf",null==a.form.formGroupErrors||null==a.form.formGroupErrors.title?null:a.form.formGroupErrors.title.required),t.R7$(2),t.Y8G("formControlName",a.form.formControlNames.imageUrl),t.R7$(),t.Y8G("ngIf",null==a.form.formGroupErrors||null==a.form.formGroupErrors.imageUrl?null:a.form.formGroupErrors.imageUrl.required),t.R7$(2),t.Y8G("formControlName",a.form.formControlNames.price),t.R7$(),t.Y8G("ngIf",null==a.form.formGroupErrors||null==a.form.formGroupErrors.price?null:a.form.formGroupErrors.price.required),t.R7$(2),t.Y8G("formControlName",a.form.formControlNames.listingType),t.R7$(),t.Y8G("ngForOf",t.bMT(26,27,a.ListingType)),t.R7$(2),t.Y8G("ngSwitch",a.form.formGroup.value.listingType),t.R7$(),t.Y8G("ngSwitchCase",a.ListingType.DROID),t.R7$(),t.Y8G("ngSwitchCase",a.ListingType.VEHICLE),t.R7$(2),t.Y8G("ngIf",!0),t.R7$(5),t.Y8G("ngIf",a.form.formGroupErrors)("ngIfElse",s),t.R7$(8),t.JRh(t.bMT(45,29,a.form.formGroup.value))}},dependencies:[m.Sq,m.bT,m.ux,m.e1,i.qT,i.me,i.Q0,i.BC,i.cb,i.j4,i.JD,we.$z,G.rl,G.TL,I.fg,K.VO,z.wT,x.RN,x.YY,x.m2,x.MM,x.kF,x.Lc,x.dh,ul,Fl,m.TG,m.QX,m.lG],styles:["img[_ngcontent-%COMP%]{max-width:300px;max-height:500px;object-fit:contain}.img-container[_ngcontent-%COMP%]{width:100%;text-align:center}mat-card[_ngcontent-%COMP%]{margin-bottom:15px;max-width:500px}mat-card[_ngcontent-%COMP%] mat-card-title[_ngcontent-%COMP%], mat-card[_ngcontent-%COMP%] mat-card-subtitle[_ngcontent-%COMP%]{min-height:25px}mat-card.errors[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%], mat-card.values[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%]{overflow:auto}mat-form-field[_ngcontent-%COMP%]{width:100%}.invalid-form[_ngcontent-%COMP%]{padding:15px 0}"],changeDetection:0})}return e})(),nr=(()=>{class e{constructor(r,n,a){this.route=r,this.listingService=n,this.uuidService=a,this.readonlyFormControl=new i.hs(!1),this.listing$=this.route.paramMap.pipe((0,N.T)(s=>s.get("listingId")),(0,pe.n)(s=>"new"!==s&&s?this.listingService.getOneListing(s):(0,Y.of)(null)),(0,N.T)(s=>s||this.emptyListing()))}emptyListing(){return{id:this.uuidService.generate(),listingType:null,title:null,imageUrl:null,price:null,product:null}}upsertListing(r){this.listingService.upsertListing(r)}static#e=this.\u0275fac=function(n){return new(n||e)(t.rXU(v.nX),t.rXU(ze),t.rXU(ur))};static#t=this.\u0275cmp=t.VBU({type:e,selectors:[["app-listing"]],decls:4,vars:5,consts:[["data-readonly","",1,"readonly",3,"formControl"],[3,"listingUpdated","listing","disabled"]],template:function(n,a){1&n&&(t.j41(0,"mat-slide-toggle",0),t.EFF(1,"Readonly"),t.k0s(),t.j41(2,"app-listing-form",1),t.nI1(3,"async"),t.bIt("listingUpdated",function(l){return a.upsertListing(l)}),t.k0s()),2&n&&(t.Y8G("formControl",a.readonlyFormControl),t.R7$(2),t.Y8G("listing",t.bMT(3,3,a.listing$))("disabled",a.readonlyFormControl.value))},dependencies:[i.BC,i.l_,de.sG,xl,m.Jj],styles:[".readonly[_ngcontent-%COMP%]{padding:15px 0}"],changeDetection:0})}return e})();var Ll=c(5911),Ge=c(105);let Yl=(()=>{class e{transform(r){return r.map(n=>`${n.firstName} ${n.lastName}`).join(", ")}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275pipe=t.EJ8({name:"displayCrewMembers",type:e,pure:!0})}return e})();const Ul=()=>["listings","new"],Bl=e=>["listings",e];function Vl(e,o){if(1&e&&(t.j41(0,"span"),t.EFF(1),t.k0s()),2&e){const r=t.XpG(2).$implicit;t.R7$(),t.SpI("Weapons: ",r.product.weapons.join(", "),"")}}function Hl(e,o){if(1&e&&(t.j41(0,"span"),t.EFF(1),t.k0s()),2&e){const r=t.XpG(2).$implicit;t.R7$(),t.SpI("Number of tools: ",r.product.toolCount,"")}}function Xl(e,o){if(1&e&&(t.j41(0,"span"),t.EFF(1),t.k0s()),2&e){const r=t.XpG(2).$implicit;t.R7$(),t.Lme(" ",r.product.canHealHumans?"Can":"Can't"," heal humans, ",r.product.canFixRobots?"can":"can't"," fix robots ")}}function Jl(e,o){if(1&e&&(t.j41(0,"span"),t.EFF(1),t.k0s()),2&e){const r=t.XpG(2).$implicit;t.R7$(),t.SpI(" Spoken languages: ",r.product.spokenLanguages.join(", ")," ")}}function Kl(e,o){if(1&e&&(t.j41(0,"span")(1,"span",9),t.EFF(2),t.k0s(),t.EFF(3," - "),t.j41(4,"span",10),t.DNE(5,Vl,2,1,"span",8)(6,Hl,2,1,"span",8)(7,Xl,2,2,"span",8)(8,Jl,2,1,"span",8),t.k0s()()),2&e){const r=t.XpG().$implicit,n=t.XpG();t.R7$(),t.xc7("background-color",r.product.color),t.R7$(),t.JRh(r.product.droidType),t.R7$(2),t.Y8G("ngSwitch",r.product.droidType),t.R7$(),t.Y8G("ngSwitchCase",n.DroidType.ASSASSIN),t.R7$(),t.Y8G("ngSwitchCase",n.DroidType.ASTROMECH),t.R7$(),t.Y8G("ngSwitchCase",n.DroidType.MEDICAL),t.R7$(),t.Y8G("ngSwitchCase",n.DroidType.PROTOCOL)}}function zl(e,o){if(1&e&&(t.j41(0,"span"),t.EFF(1),t.k0s()),2&e){const r=t.XpG(2).$implicit;t.R7$(),t.SpI("maximum speed: ",r.product.maximumSpeed,"kph")}}function ql(e,o){if(1&e&&(t.j41(0,"span"),t.EFF(1),t.k0s()),2&e){const r=t.XpG(2).$implicit;t.R7$(),t.SpI("number of wings: ",r.product.wingCount,"")}}function Wl(e,o){if(1&e&&(t.j41(0,"span")(1,"span",9),t.EFF(2),t.k0s(),t.EFF(3," - "),t.j41(4,"span",10),t.EFF(5),t.nI1(6,"displayCrewMembers"),t.DNE(7,zl,2,1,"span",8)(8,ql,2,1,"span",8),t.k0s()()),2&e){const r=t.XpG().$implicit,n=t.XpG();t.R7$(),t.xc7("background-color",r.product.color),t.R7$(),t.JRh(r.product.vehicleType),t.R7$(2),t.Y8G("ngSwitch",r.product.vehicleType),t.R7$(),t.Lme(" Crew members: ",t.bMT(6,8,r.product.crewMembers),", ",r.product.canFire?"can":"can't"," fire, "),t.R7$(2),t.Y8G("ngSwitchCase",n.VehicleType.SPEEDER),t.R7$(),t.Y8G("ngSwitchCase",n.VehicleType.SPACESHIP)}}function Ql(e,o){if(1&e&&(t.j41(0,"a",2)(1,"span",3)(2,"span",4),t.EFF(3),t.k0s(),t.EFF(4," ( "),t.j41(5,"span",5),t.EFF(6),t.k0s(),t.EFF(7," ) \xa3 "),t.j41(8,"span",6),t.EFF(9),t.nI1(10,"number"),t.k0s()(),t.j41(11,"span",7),t.DNE(12,Kl,9,8,"span",8)(13,Wl,9,10,"span",8),t.k0s()()),2&e){const r=o.$implicit,n=t.XpG();t.Y8G("routerLink",t.eq3(9,Bl,r.id)),t.R7$(3),t.JRh(r.title),t.R7$(3),t.JRh(r.listingType),t.R7$(3),t.JRh(t.bMT(10,7,r.price)),t.R7$(2),t.Y8G("ngSwitch",r.listingType),t.R7$(),t.Y8G("ngSwitchCase",n.ListingType.DROID),t.R7$(),t.Y8G("ngSwitchCase",n.ListingType.VEHICLE)}}let Zl=(()=>{class e{constructor(){this.listings=[],this.ListingType=C,this.DroidType=h,this.VehicleType=S}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275cmp=t.VBU({type:e,selectors:[["app-listings"]],inputs:{listings:"listings"},decls:4,vars:3,consts:[["data-list-item","","mat-list-item","",3,"routerLink",4,"ngFor","ngForOf"],["mat-raised-button","","data-create-new","","color","primary",3,"routerLink"],["data-list-item","","mat-list-item","",3,"routerLink"],["matListItemTitle",""],["data-title",""],["data-type",""],["data-price",""],["matListItemLine","",3,"ngSwitch"],[4,"ngSwitchCase"],["data-sub-type",""],["data-details","",3,"ngSwitch"]],template:function(n,a){1&n&&(t.j41(0,"mat-nav-list"),t.DNE(1,Ql,14,11,"a",0),t.k0s(),t.j41(2,"a",1),t.EFF(3,"Create new"),t.k0s()),2&n&&(t.R7$(),t.Y8G("ngForOf",a.listings),t.R7$(),t.Y8G("routerLink",t.lJ4(2,Ul)))},dependencies:[m.Sq,m.ux,m.e1,we.It,Ge._L,Ge.YE,Ge.C_,Ge.yE,v.Wk,m.QX,Yl],styles:["mat-nav-list[_ngcontent-%COMP%]{padding:0}"],changeDetection:0})}return e})(),ec=(()=>{class e{constructor(r){this.listingService=r,this.listings$=this.listingService.getListings()}static#e=this.\u0275fac=function(n){return new(n||e)(t.rXU(ze))};static#t=this.\u0275cmp=t.VBU({type:e,selectors:[["app-main"]],decls:7,vars:3,consts:[["color","primary"],["src","/assets/ewok-no-bg.png","alt","EWOK",1,"logo"],[1,"container"],[1,"left-part",3,"listings"],[1,"right-part"],[1,"router-flex"]],template:function(n,a){1&n&&(t.j41(0,"mat-toolbar",0),t.nrm(1,"img",1),t.k0s(),t.j41(2,"div",2),t.nrm(3,"app-listings",3),t.nI1(4,"async"),t.j41(5,"div",4),t.nrm(6,"router-outlet",5),t.k0s()()),2&n&&(t.R7$(3),t.Y8G("listings",t.bMT(4,1,a.listings$)))},dependencies:[Ll.KQ,v.n3,Zl,m.Jj],styles:[".container[_ngcontent-%COMP%]{height:calc(100% - 64px);display:flex}.container[_ngcontent-%COMP%] .left-part[_ngcontent-%COMP%], .container[_ngcontent-%COMP%] .right-part[_ngcontent-%COMP%]{flex-grow:1;height:100%}.logo[_ngcontent-%COMP%]{max-width:200px}"],changeDetection:0})}return e})(),tc=(()=>{class e{static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275mod=t.$C({type:e});static#r=this.\u0275inj=t.G2t({imports:[m.MD,T.G,v.iI.forChild([{path:"",component:ec,children:[{path:"listings",children:[{path:":listingId",component:nr},{path:"new",component:nr,pathMatch:"full"}]}]},{path:"**",pathMatch:"full",redirectTo:"/"}])]})}return e})()},362:Ke=>{Ke.exports=function W(c,m){if(c===m)return!0;if(c&&m&&"object"==typeof c&&"object"==typeof m){if(c.constructor!==m.constructor)return!1;var v,T,i;if(Array.isArray(c)){if((v=c.length)!=m.length)return!1;for(T=v;0!=T--;)if(!W(c[T],m[T]))return!1;return!0}if(c.constructor===RegExp)return c.source===m.source&&c.flags===m.flags;if(c.valueOf!==Object.prototype.valueOf)return c.valueOf()===m.valueOf();if(c.toString!==Object.prototype.toString)return c.toString()===m.toString();if((v=(i=Object.keys(c)).length)!==Object.keys(m).length)return!1;for(T=v;0!=T--;)if(!Object.prototype.hasOwnProperty.call(m,i[T]))return!1;for(T=v;0!=T--;){var Y=i[T];if(!W(c[Y],m[Y]))return!1}return!0}return c!=c&&m!=m}}}]); \ No newline at end of file +"use strict";(self.webpackChunkngx_sub_form_demo=self.webpackChunkngx_sub_form_demo||[]).push([[160],{3160:(Ke,W,c)=>{c.r(W),c.d(W,{MainModule:()=>tc});var m=c(177),v=c(1971),T=c(4062),i=c(9417),Y=c(7673),N=c(6354),pe=c(5558),t=c(4438),ir=c(4412),C=function(e){return e.VEHICLE="Vehicle",e.DROID="Droid",e}(C||{}),h=function(e){return e.PROTOCOL="Protocol",e.MEDICAL="Medical",e.ASTROMECH="Astromech",e.ASSASSIN="Assassin",e}(h||{}),ue=function(e){return e.DROIDSPEAK="Droidspeak",e.EWOKESE="Ewokese",e.HUTTESE="Huttese",e.JAWAESE="Jawaese",e.SITH="Sith",e.SHYRIIWOOK="Shyriiwook",e}(ue||{}),Ee=function(e){return e.REGULAR="Regular",e.SPHERE="Sphere",e}(Ee||{}),D=function(e){return e.SABER="Saber",e.FLAME_THROWER="FlameThrower",e.GUN="Gun",e.AXE="Axe",e}(D||{}),S=function(e){return e.SPACESHIP="Spaceship",e.SPEEDER="Speeder",e}(S||{});const sr=[{id:"3f71b7eb-4a4f-40e6-9fca-e8cc7c0199c3",price:45e6,title:"Millenium Falcon",imageUrl:"https://vignette.wikia.nocookie.net/starwars/images/4/43/MillenniumFalconTFA-Fathead.png/revision/latest/scale-to-width-down/1000?cb=20161110011442",listingType:C.VEHICLE,product:{color:"#cec80d",canFire:!0,crewMembers:[{firstName:"Obi-Wan",lastName:"Kenobi"},{firstName:"R2",lastName:"D2"}],wingCount:0,vehicleType:S.SPACESHIP}},{id:"c01ad30c-d686-4db2-9a3c-6cf91c494bf0",price:5e5,title:"X-34 landspeeder",imageUrl:"https://vignette.wikia.nocookie.net/starwars/images/5/54/X34-landspeeder.jpg/revision/latest?cb=20080316031428",listingType:C.VEHICLE,product:{color:"#2468f7",canFire:!0,crewMembers:[{firstName:"Anakin",lastName:"Skywalker"}],vehicleType:S.SPEEDER,maximumSpeed:250}},{id:"99178909-7db2-4b75-99e5-028b2d4f6755",price:15e4,title:"C-3PO Protocol Droid",imageUrl:"https://vignette.wikia.nocookie.net/starwars/images/5/51/C-3PO_EP3.png/revision/latest?cb=20131005124036",listingType:C.DROID,product:{color:"#b38d03",name:"Proto",droidType:h.PROTOCOL,spokenLanguages:[ue.DROIDSPEAK,ue.HUTTESE]}},{id:"8aa98e18-838c-4a19-975e-2366c2566544",price:21e4,title:"2-1B Medial Droid",imageUrl:"https://vignette.wikia.nocookie.net/starwars/images/b/b6/2-1B_negtd.jpg/revision/latest/scale-to-width-down/200?cb=20100616170941",listingType:C.DROID,product:{color:"#07c911",name:"Medic",droidType:h.MEDICAL,canHealHumans:!0,canFixRobots:!0}},{id:"08c2c071-f03e-4a63-93b7-bd3df0f2987c",price:215e3,title:"R2D2 Astromech Droid",imageUrl:"https://vignette.wikia.nocookie.net/starwars/images/e/eb/ArtooTFA2-Fathead.png/revision/latest/scale-to-width-down/1000?cb=20161108040914",listingType:C.DROID,product:{color:"#ff0a0a",name:"Test",droidType:h.ASTROMECH,toolCount:15,shape:Ee.REGULAR}},{id:"0258166e-13b5-4580-a63b-7c1914ef660f",price:35e4,title:"K2-S0 Security Droid",imageUrl:"https://vignette.wikia.nocookie.net/starwars/images/f/fd/K-2SO_Sideshow.png/revision/latest?cb=20170302003128",listingType:C.DROID,product:{color:"#cc6969",name:"acwer fg",droidType:h.ASSASSIN,weapons:[D.AXE,D.FLAME_THROWER]}}];let ze=(()=>{class e{constructor(){this.listings$=new ir.t(sr)}getListings(){return this.listings$.asObservable().pipe((0,N.T)(this.listingsDeepCopy.bind(this)))}upsertListing(r){const n=this.listings$.getValue(),a=n.findIndex(s=>s.id===r.id);if(a>-1){const s=n.slice(0,a),l=n.slice(a+1);this.listings$.next([...s,r,...l])}else this.listings$.next([r,...this.listings$.getValue()])}getOneListing(r){return this.listings$.pipe((0,N.T)(n=>{const a=n.find(s=>s.id===r);if(!a)throw new Error("not found");return a}),(0,N.T)(this.listingDeepCopy))}listingDeepCopy(r){return JSON.parse(JSON.stringify(r))}listingsDeepCopy(r){return r.map(this.listingDeepCopy)}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275prov=t.jDH({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();const qe={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let fe;const lr=new Uint8Array(16);function cr(){if(!fe&&(fe=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!fe))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return fe(lr)}const y=[];for(let e=0;e<256;++e)y.push((e+256).toString(16).slice(1));const pr=function mr(e,o,r){if(qe.randomUUID&&!o&&!e)return qe.randomUUID();const n=(e=e||{}).random||(e.rng||cr)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,o){r=r||0;for(let a=0;a<16;++a)o[r+a]=n[a];return o}return function We(e,o=0){return(y[e[o+0]]+y[e[o+1]]+y[e[o+2]]+y[e[o+3]]+"-"+y[e[o+4]]+y[e[o+5]]+"-"+y[e[o+6]]+y[e[o+7]]+"-"+y[e[o+8]]+y[e[o+9]]+"-"+y[e[o+10]]+y[e[o+11]]+y[e[o+12]]+y[e[o+13]]+y[e[o+14]]+y[e[o+15]]).toLowerCase()}(n)};let ur=(()=>{class e{generate(){return pr()}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275prov=t.jDH({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();var de=c(450),Oe=c(1584),je=c(9974),Ae=c(5343),Q=c(4360),Qe=c(8750);function E(e){return[{provide:i.kq,useExisting:e,multi:!0},{provide:i.cz,useExisting:e,multi:!0}]}function Ze(e){return null==e}Error;var gr=c(362),hr=c.n(gr),Z=c(1413);const R=Symbol("ngx-observable-lifecycle-hooks"),ge=Symbol("ngx-observable-lifecycle-hooks-decorator");function et(e){return new Proxy({},{get:(o,r)=>function _r(e,o){e[R]||(e[R]={}),e[R][o]||(e[R][o]=new Z.B);const r=e.constructor.prototype;if(r[ge]||(r[ge]={}),!r[ge][o]){const n=r[o];r[o]=function(){n?.call(this),this[R]?.[o]?.next()};const a=r.ngOnDestroy;r.ngOnDestroy=function(){a?.call(this),this[R]?.[o]?.complete(),delete this[R]?.[o]},r[ge][o]=!0}return e[R][o]}(e,r).asObservable()})}var tt=c(3669),Ne=c(7786),rt=c(983),ot=c(8793),yr=c(4572),he=c(6697),Cr=c(9172),nt=c(4668),br=c(3236),at=c(3703),Tr=c(1397);function it(e,o){return o?r=>(0,ot.x)(o.pipe((0,he.s)(1),function vr(){return(0,je.N)((e,o)=>{e.subscribe((0,Q._)(o,Ae.l))})}()),r.pipe(it(e))):(0,Tr.Z)((r,n)=>e(r,n).pipe((0,he.s)(1),(0,at.u)(r)))}function ee(e,o=br.E){const r=(0,Oe.O)(e,o);return it(()=>r)}var Sr=c(9326),st=c(5964),$=c(8141),lt=c(6977);const ct=function Er(e,o){return e===o||e!=e&&o!=o},_e=function Or(e,o){for(var r=e.length;r--;)if(ct(e[r][0],o))return r;return-1};var Ar=Array.prototype.splice;function U(e){var o=-1,r=null==e?0:e.length;for(this.clear();++o-1},U.prototype.set=function Mr(e,o){var r=this.__data__,n=_e(r,e);return n<0?(++this.size,r.push([e,o])):r[n][1]=o,this};const ye=U,mt="object"==typeof global&&global&&global.Object===Object&&global;var Kr="object"==typeof self&&self&&self.Object===Object&&self;const O=mt||Kr||Function("return this")(),B=O.Symbol;var pt=Object.prototype,Wr=pt.hasOwnProperty,Qr=pt.toString,te=B?B.toStringTag:void 0;var ro=Object.prototype.toString;var ut=B?B.toStringTag:void 0;const re=function so(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":ut&&ut in Object(e)?function Zr(e){var o=Wr.call(e,te),r=e[te];try{e[te]=void 0;var n=!0}catch{}var a=Qr.call(e);return n&&(o?e[te]=r:delete e[te]),a}(e):function oo(e){return ro.call(e)}(e)},oe=function lo(e){var o=typeof e;return null!=e&&("object"==o||"function"==o)},ft=function fo(e){if(!oe(e))return!1;var o=re(e);return"[object Function]"==o||"[object GeneratorFunction]"==o||"[object AsyncFunction]"==o||"[object Proxy]"==o};var e,go=O["__core-js_shared__"],dt=(e=/[^.]+$/.exec(go&&go.keys&&go.keys.IE_PROTO||""))?"Symbol(src)_1."+e:"";var Co=Function.prototype.toString;const P=function bo(e){if(null!=e){try{return Co.call(e)}catch{}try{return e+""}catch{}}return""};var To=/^\[object .+?Constructor\]$/,Eo=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const jo=function Oo(e){return!(!oe(e)||function ho(e){return!!dt&&dt in e}(e))&&(ft(e)?Eo:To).test(P(e))},M=function Do(e,o){var r=function Ao(e,o){return e?.[o]}(e,o);return jo(r)?r:void 0},ne=M(O,"Map"),ae=M(Object,"create");var Yo=Object.prototype.hasOwnProperty;var Ho=Object.prototype.hasOwnProperty;function V(e){var o=-1,r=null==e?0:e.length;for(this.clear();++o-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991};var f={};f["[object Float32Array]"]=f["[object Float64Array]"]=f["[object Int8Array]"]=f["[object Int16Array]"]=f["[object Int32Array]"]=f["[object Uint8Array]"]=f["[object Uint8ClampedArray]"]=f["[object Uint16Array]"]=f["[object Uint32Array]"]=!0,f["[object Arguments]"]=f["[object Array]"]=f["[object ArrayBuffer]"]=f["[object Boolean]"]=f["[object DataView]"]=f["[object Date]"]=f["[object Error]"]=f["[object Function]"]=f["[object Map]"]=f["[object Number]"]=f["[object Object]"]=f["[object RegExp]"]=f["[object Set]"]=f["[object String]"]=f["[object WeakMap]"]=!1;const Ie=function _a(e){return function(o){return e(o)}};var Ft="object"==typeof exports&&exports&&!exports.nodeType&&exports,se=Ft&&"object"==typeof module&&module&&!module.nodeType&&module,$e=se&&se.exports===Ft&&mt.process;const J=function(){try{return se&&se.require&&se.require("util").types||$e&&$e.binding&&$e.binding("util")}catch{}}();var Et=J&&J.isTypedArray;const va=Et?Ie(Et):function ga(e){return ie(e)&&Gt(e.length)&&!!f[re(e)]};var Sa=Object.prototype.hasOwnProperty;const Ot=function wa(e,o){var r=Re(e),n=!r&&Dn(e),a=!r&&!n&&wt(e),s=!r&&!n&&!a&&va(e),l=r||n||a||s,p=l?function wn(e,o){for(var r=-1,n=Array(e);++r{Object.entries(o).forEach(([r,n])=>{e[r]=n})},rr=e=>{const o=Object.entries(e.controls).reduce((r,[n,a])=>{if(a.errors&&(r[n]=a.errors),a instanceof i.Bm){const s={};for(let l=0;l0){const l=r;n in l||(l[n]={}),Object.assign(l[n],s)}}return r},{});return e.errors||Object.values(o).length?Object.assign({},e.errors?{formGroup:e.errors}:{},o):null};var b=function(e){return e.SUB="Sub",e.ROOT="Root",e}(b||{});const Se=e=>e.formType===b.ROOT;function w(e,o){const{formGroup:r,defaultValues:n,formControlNames:a,formArrays:s}=function tl(e){const o=new i.J3(e.formControls,e.formGroupOptions),r=function Qs(e){return zs(e,5)}(o.value),n=Object.keys(e.formControls),a=n.reduce((l,p)=>(l[p]=p,l),{}),s=n.reduce((l,p)=>{const d=o.get(p);return d instanceof i.Bm&&l.push({key:p,control:d}),l},[]);return{formGroup:o,defaultValues:r,formControlNames:a,formArrays:s}}(o);let l=!1;const p=o.componentHooks??{onDestroy:et(e).ngOnDestroy,afterViewInit:et(e).ngAfterViewInit},d=(0,t.WQX)(t.gRc);p.onDestroy.pipe((0,he.s)(1)).subscribe(()=>{l=!0}),tr(e,{validate:()=>l||r.valid?null:rr(r)});const _=(0,Oe.O)(0),L=(e=>{const o=new Te.m(1),r=new Te.m(1),n=new Te.m(1),a=new Te.m(1);return tr(e,{writeValue:l=>{o.next(l)},registerOnChange:l=>{r.next(l)},registerOnTouched:l=>{n.next(l)},setDisabledState:l=>{a.next(!!l)}}),{writeValue$:o.asObservable(),registerOnChange$:r.asObservable(),registerOnTouched$:n.asObservable(),setDisabledState$:a.asObservable()}})(e),j=Se(o)?o.input$.pipe((0,Cr.Z)(null)):L.writeValue$,le=Se(o)?(0,Y.of)(g=>{g&&o.output$.next(g)}):L.registerOnChange$,ce=Se(o)?o.disabled$??(0,Y.of)(!1):L.setDisabledState$,Fe=j.pipe((0,N.T)(g=>Ze(g)?n:o.toFormGroup?o.toFormGroup(g):g),(0,nt.t)({refCount:!0,bufferSize:1})),me=Fe.pipe((0,pe.n)(g=>Se(o)?(o.manualSave$?o.manualSave$.pipe(function wr(...e){const o=(0,Sr.ms)(e);return(0,je.N)((r,n)=>{const a=e.length,s=new Array(a);let l=e.map(()=>!1),p=!1;for(let d=0;d{s[d]=_,!p&&!l[d]&&(l[d]=!0,(p=l.every(tt.D))&&(l=null))},Ae.l));r.subscribe((0,Q._)(n,d=>{if(p){const _=[d,...s];n.next(o?o(..._):_)}}))})}(r.valueChanges),(0,N.T)(([Je,oc])=>oc)):r.valueChanges).pipe((0,st.p)(()=>r.valid),ee(0),(0,st.p)(Je=>!r.invalid&&(o.outputFilterPredicate?o.outputFilterPredicate(g,Je):!hr()(g,Je))),o.handleEmissionRate??tt.D):r.valueChanges.pipe(ee(0))),(0,N.T)(g=>o.fromFormGroup?o.fromFormGroup(g):g)),F=(0,Ne.h)(j,me).pipe((0,nt.t)({bufferSize:1,refCount:!0})),A=Ze(o.emitNullOnDestroy)||o.emitNullOnDestroy?p.onDestroy.pipe((0,at.u)(null)):rt.w,ar=(e=>!!e.createFormArrayControl)(o)&&o.createFormArrayControl?o.createFormArrayControl:(g,q)=>new i.hs(q),rc={broadcastValueToParent$:le.pipe((0,pe.n)(g=>me.pipe((0,$.M)(q=>g(q))))),applyUpstreamUpdateOnLocalForm$:Fe.pipe((0,$.M)(g=>{((e,o,r)=>{e.length&&e.forEach(({key:n,control:a})=>{const s=o[n];if(Array.isArray(s)){for(;a.length>s.length;)a.removeAt(a.length-1);for(let l=a.length;l{d.markForCheck()}))),setDisabledState$:ce.pipe((0,$.M)(g=>{g?r.disable({emitEvent:!1}):r.enable({emitEvent:!1})})),updateValue$:_.pipe((0,$.M)(()=>{r.updateValueAndValidity({emitEvent:!1})})),bindTouched$:(0,yr.z)([L.registerOnTouched$,o.touched$??rt.w]).pipe(ee(0),(0,$.M)(([g])=>g()))};return(0,Ne.h)(...Object.values(rc)).pipe((0,lt.Q)(p.onDestroy)).subscribe(),le.pipe((0,pe.n)(g=>A.pipe((0,$.M)(q=>g(q)))),(0,lt.Q)(p.onDestroy.pipe(ee(0)))).subscribe(),{formGroup:r,formControlNames:a,get formGroupErrors(){return rr(r)},createFormArrayControl:ar,controlValue$:F}}class Xe{constructor(o){}}var we=c(8834),G=c(2102),I=c(9631),K=c(1756),z=c(6600),x=c(5596),nl=c(1801);let al=(()=>{class e{constructor(){this.form=w(this,{formType:b.SUB,formControls:{firstName:new i.hs(null,[i.k0.required]),lastName:new i.hs(null,[i.k0.required])}})}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275cmp=t.VBU({type:e,selectors:[["app-crew-member"]],features:[t.Jv_(E(e))],decls:7,vars:3,consts:[["data-crew-member","",1,"container",3,"formGroup"],["matInput","","data-input-crew-member-first-name","","type","text","placeholder","First name","autocomplete","off",3,"formControlName"],["matInput","","data-input-crew-member-last-name","","type","text","placeholder","Last name","autocomplete","off",3,"formControlName"]],template:function(n,a){1&n&&(t.j41(0,"fieldset",0)(1,"legend"),t.EFF(2,"Crew member form"),t.k0s(),t.j41(3,"mat-form-field"),t.nrm(4,"input",1),t.k0s(),t.j41(5,"mat-form-field"),t.nrm(6,"input",2),t.k0s()()),2&n&&(t.Y8G("formGroup",a.form.formGroup),t.R7$(4),t.Y8G("formControlName",a.form.formControlNames.firstName),t.R7$(2),t.Y8G("formControlName",a.form.formControlNames.lastName))},dependencies:[i.me,i.BC,i.cb,i.j4,i.JD,G.rl,I.fg],changeDetection:0})}return e})();function il(e,o){if(1&e){const r=t.RV6();t.j41(0,"div",3),t.nrm(1,"app-crew-member",4),t.j41(2,"button",5),t.bIt("click",function(){const a=t.eBV(r).index,s=t.XpG();return t.Njj(s.removeCrewMember(a))}),t.j41(3,"mat-icon"),t.EFF(4,"delete"),t.k0s()()()}if(2&e){const r=o.$implicit,n=t.XpG();t.Y8G("formArrayName",n.form.formControlNames.crewMembers),t.R7$(),t.Y8G("formControl",r),t.R7$(),t.Y8G("disabled",n.form.formGroup.disabled)}}let or=(()=>{class e{constructor(){this.form=w(this,{formType:b.SUB,formControls:{crewMembers:new i.Bm([],{validators:r=>r.value.length>=2?null:{minimumCrewMemberCount:2}})},toFormGroup:r=>({crewMembers:r||[]}),fromFormGroup:r=>r.crewMembers,createFormArrayControl:(r,n)=>"crewMembers"===r?new i.hs(n,[i.k0.required]):new i.hs(n)})}removeCrewMember(r){this.form.formGroup.controls.crewMembers.removeAt(r)}addCrewMember(){this.form.formGroup.controls.crewMembers.push(this.form.createFormArrayControl("crewMembers",{firstName:"",lastName:""}))}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275cmp=t.VBU({type:e,selectors:[["app-crew-members"]],features:[t.Jv_(E(e))],decls:8,vars:3,consts:[[1,"container",3,"formGroup"],["class","crew-member",3,"formArrayName",4,"ngFor","ngForOf"],["mat-raised-button","","data-btn-add-crew-member","","color","primary",1,"add-crew-member",3,"click","disabled"],[1,"crew-member",3,"formArrayName"],[3,"formControl"],["mat-mini-fab","","color","primary",3,"click","disabled"]],template:function(n,a){1&n&&(t.j41(0,"fieldset",0)(1,"legend"),t.EFF(2," Crew members form "),t.j41(3,"small"),t.EFF(4,"(Minimum 2)"),t.k0s()(),t.DNE(5,il,5,3,"div",1),t.j41(6,"button",2),t.bIt("click",function(){return a.addCrewMember()}),t.EFF(7," Add a crew member "),t.k0s()()),2&n&&(t.Y8G("formGroup",a.form.formGroup),t.R7$(5),t.Y8G("ngForOf",a.form.formGroup.controls.crewMembers.controls),t.R7$(),t.Y8G("disabled",a.form.formGroup.disabled))},dependencies:[m.Sq,i.BC,i.cb,i.l_,i.j4,i.v8,we.$z,we.$0,nl.An,al],styles:[".crew-member[_ngcontent-%COMP%]{display:flex;align-items:center}app-crew-member[_ngcontent-%COMP%]{margin-bottom:15px}.add-crew-member[_ngcontent-%COMP%]{margin-top:15px}"],changeDetection:0})}return e})(),sl=(()=>{class e{constructor(){this.form=w(this,{formType:b.SUB,formControls:{color:new i.hs(null,{validators:[i.k0.required]}),canFire:new i.hs(!1,{validators:[i.k0.required]}),crewMembers:new i.hs(null,{validators:[i.k0.required]}),wingCount:new i.hs(null,{validators:[i.k0.required]}),vehicleType:new i.hs(S.SPACESHIP,{validators:[i.k0.required]})}})}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275cmp=t.VBU({type:e,selectors:[["app-spaceship"]],features:[t.Jv_(E(e))],decls:10,vars:5,consts:[[1,"container",3,"formGroup"],["matInput","","data-input-color","","type","color","placeholder","Color","autocomplete","off",3,"formControlName"],["data-input-can-fire","",3,"formControlName"],["matInput","","data-input-number-of-wings","","type","number","placeholder","Number of wings","autocomplete","off",3,"formControlName"],[3,"formControlName"]],template:function(n,a){1&n&&(t.j41(0,"fieldset",0)(1,"legend"),t.EFF(2,"Spaceship form"),t.k0s(),t.j41(3,"mat-form-field"),t.nrm(4,"input",1),t.k0s(),t.j41(5,"mat-slide-toggle",2),t.EFF(6,"Can fire"),t.k0s(),t.j41(7,"mat-form-field"),t.nrm(8,"input",3),t.k0s(),t.nrm(9,"app-crew-members",4),t.k0s()),2&n&&(t.Y8G("formGroup",a.form.formGroup),t.R7$(4),t.Y8G("formControlName",a.form.formControlNames.color),t.R7$(),t.Y8G("formControlName",a.form.formControlNames.canFire),t.R7$(3),t.Y8G("formControlName",a.form.formControlNames.wingCount),t.R7$(),t.Y8G("formControlName",a.form.formControlNames.crewMembers))},dependencies:[i.me,i.Q0,i.BC,i.cb,i.j4,i.JD,G.rl,I.fg,de.sG,or],styles:[".container[_ngcontent-%COMP%]{display:flex;flex-direction:column}"],changeDetection:0})}return e})(),ll=(()=>{class e{constructor(){this.form=w(this,{formType:b.SUB,formControls:{color:new i.hs(null,{validators:[i.k0.required]}),canFire:new i.hs(!1,{validators:[i.k0.required]}),crewMembers:new i.hs(null,{validators:[i.k0.required]}),vehicleType:new i.hs(S.SPEEDER,{validators:[i.k0.required]}),maximumSpeed:new i.hs(null,{validators:[i.k0.required]})}})}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275cmp=t.VBU({type:e,selectors:[["app-speeder"]],features:[t.Jv_(E(e))],decls:10,vars:5,consts:[[1,"container",3,"formGroup"],["matInput","","data-input-color","","type","color","placeholder","Color","autocomplete","off",3,"formControlName"],["data-input-can-fire","",3,"formControlName"],[3,"formControlName"],["matInput","","data-input-maximum-speed","","type","number","placeholder","Maximum speed","autocomplete","off",3,"formControlName"]],template:function(n,a){1&n&&(t.j41(0,"fieldset",0)(1,"legend"),t.EFF(2,"Speeder form"),t.k0s(),t.j41(3,"mat-form-field"),t.nrm(4,"input",1),t.k0s(),t.j41(5,"mat-slide-toggle",2),t.EFF(6,"Can fire"),t.k0s(),t.nrm(7,"app-crew-members",3),t.j41(8,"mat-form-field"),t.nrm(9,"input",4),t.k0s()()),2&n&&(t.Y8G("formGroup",a.form.formGroup),t.R7$(4),t.Y8G("formControlName",a.form.formControlNames.color),t.R7$(),t.Y8G("formControlName",a.form.formControlNames.canFire),t.R7$(2),t.Y8G("formControlName",a.form.formControlNames.crewMembers),t.R7$(2),t.Y8G("formControlName",a.form.formControlNames.maximumSpeed))},dependencies:[i.me,i.Q0,i.BC,i.cb,i.j4,i.JD,G.rl,I.fg,de.sG,or],styles:[".container[_ngcontent-%COMP%]{display:flex;flex-direction:column}"],changeDetection:0})}return e})();function cl(e,o){if(1&e&&(t.j41(0,"mat-option",5),t.EFF(1),t.k0s()),2&e){const r=o.$implicit;t.Y8G("value",r.value),t.R7$(),t.SpI(" ",r.value," ")}}function ml(e,o){if(1&e&&t.nrm(0,"app-spaceship",6),2&e){const r=t.XpG();t.Y8G("formControlName",r.form.formControlNames.spaceship)}}function pl(e,o){if(1&e&&t.nrm(0,"app-speeder",6),2&e){const r=t.XpG();t.Y8G("formControlName",r.form.formControlNames.speeder)}}let ul=(()=>{class e{constructor(){this.VehicleType=S,this.form=w(this,{formType:b.SUB,formControls:{speeder:new i.hs(null),spaceship:new i.hs(null),vehicleType:new i.hs(null,{validators:[i.k0.required]})},toFormGroup:r=>({speeder:r.vehicleType===S.SPEEDER?r:null,spaceship:r.vehicleType===S.SPACESHIP?r:null,vehicleType:r.vehicleType}),fromFormGroup:r=>{switch(r.vehicleType){case S.SPEEDER:return r.speeder;case S.SPACESHIP:return r.spaceship;case null:return null;default:throw new Xe(r.vehicleType)}}})}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275cmp=t.VBU({type:e,selectors:[["app-vehicle-product"]],features:[t.Jv_(E(e))],decls:10,vars:8,consts:[[1,"container",3,"formGroup"],["data-select-vehicle-type","","placeholder","Select vehicle type",3,"formControlName"],["data-select-vehicle-type-option","",3,"value",4,"ngFor","ngForOf"],[3,"ngSwitch"],[3,"formControlName",4,"ngSwitchCase"],["data-select-vehicle-type-option","",3,"value"],[3,"formControlName"]],template:function(n,a){1&n&&(t.j41(0,"fieldset",0)(1,"legend"),t.EFF(2,"Vehicle form"),t.k0s(),t.j41(3,"mat-form-field")(4,"mat-select",1),t.DNE(5,cl,2,2,"mat-option",2),t.nI1(6,"keyvalue"),t.k0s()(),t.j41(7,"div",3),t.DNE(8,ml,1,1,"app-spaceship",4)(9,pl,1,1,"app-speeder",4),t.k0s()()),2&n&&(t.Y8G("formGroup",a.form.formGroup),t.R7$(4),t.Y8G("formControlName",a.form.formControlNames.vehicleType),t.R7$(),t.Y8G("ngForOf",t.bMT(6,6,a.VehicleType)),t.R7$(2),t.Y8G("ngSwitch",a.form.formGroup.value.vehicleType),t.R7$(),t.Y8G("ngSwitchCase",a.VehicleType.SPACESHIP),t.R7$(),t.Y8G("ngSwitchCase",a.VehicleType.SPEEDER))},dependencies:[m.Sq,m.ux,m.e1,i.BC,i.cb,i.j4,i.JD,G.rl,K.VO,z.wT,sl,ll,m.lG],styles:[".container[_ngcontent-%COMP%]{display:flex;flex-direction:column}"],changeDetection:0})}return e})();function fl(e,o){if(1&e&&(t.j41(0,"mat-option",5),t.EFF(1),t.k0s()),2&e){const r=o.$implicit;t.Y8G("value",r.value),t.R7$(),t.SpI(" ",r.value," ")}}let dl=(()=>{class e{constructor(){this.Languages=ue,this.form=w(this,{formType:b.SUB,formControls:{color:new i.hs(null,{validators:[i.k0.required]}),name:new i.hs(null,{validators:[i.k0.required]}),droidType:new i.hs(h.PROTOCOL,{validators:[i.k0.required]}),spokenLanguages:new i.hs(null,{validators:[i.k0.required]})}})}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275cmp=t.VBU({type:e,selectors:[["app-protocol-droid"]],features:[t.Jv_(E(e))],decls:11,vars:7,consts:[[1,"container",3,"formGroup"],["matInput","","type","color","placeholder","Color","autocomplete","off",3,"formControlName"],["matInput","","type","text","placeholder","Name","autocomplete","off",3,"formControlName"],["placeholder","Select spoken languages","multiple","",3,"formControlName"],[3,"value",4,"ngFor","ngForOf"],[3,"value"]],template:function(n,a){1&n&&(t.j41(0,"fieldset",0)(1,"legend"),t.EFF(2,"Protocol Droid form"),t.k0s(),t.j41(3,"mat-form-field"),t.nrm(4,"input",1),t.k0s(),t.j41(5,"mat-form-field"),t.nrm(6,"input",2),t.k0s(),t.j41(7,"mat-form-field")(8,"mat-select",3),t.DNE(9,fl,2,2,"mat-option",4),t.nI1(10,"keyvalue"),t.k0s()()()),2&n&&(t.Y8G("formGroup",a.form.formGroup),t.R7$(4),t.Y8G("formControlName",a.form.formControlNames.color),t.R7$(2),t.Y8G("formControlName",a.form.formControlNames.name),t.R7$(2),t.Y8G("formControlName",a.form.formControlNames.spokenLanguages),t.R7$(),t.Y8G("ngForOf",t.bMT(10,5,a.Languages)))},dependencies:[m.Sq,i.me,i.BC,i.cb,i.j4,i.JD,G.rl,I.fg,K.VO,z.wT,m.lG],styles:[".container[_ngcontent-%COMP%]{display:flex;flex-direction:column}"],changeDetection:0})}return e})(),gl=(()=>{class e{constructor(){this.form=w(this,{formType:b.SUB,formControls:{color:new i.hs(null,{validators:[i.k0.required]}),name:new i.hs(null,{validators:[i.k0.required]}),droidType:new i.hs(h.MEDICAL,{validators:[i.k0.required]}),canHealHumans:new i.hs(!1,{validators:[i.k0.required]}),canFixRobots:new i.hs(!1,{validators:[i.k0.required]})}})}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275cmp=t.VBU({type:e,selectors:[["app-medical-droid"]],features:[t.Jv_(E(e))],decls:11,vars:5,consts:[[1,"container",3,"formGroup"],["matInput","","type","color","placeholder","Color","autocomplete","off",3,"formControlName"],["matInput","","type","text","placeholder","Name","autocomplete","off",3,"formControlName"],[3,"formControlName"]],template:function(n,a){1&n&&(t.j41(0,"fieldset",0)(1,"legend"),t.EFF(2,"Medical Droid form"),t.k0s(),t.j41(3,"mat-form-field"),t.nrm(4,"input",1),t.k0s(),t.j41(5,"mat-form-field"),t.nrm(6,"input",2),t.k0s(),t.j41(7,"mat-slide-toggle",3),t.EFF(8,"Can heal humans"),t.k0s(),t.j41(9,"mat-slide-toggle",3),t.EFF(10,"Can fix robots"),t.k0s()()),2&n&&(t.Y8G("formGroup",a.form.formGroup),t.R7$(4),t.Y8G("formControlName",a.form.formControlNames.color),t.R7$(2),t.Y8G("formControlName",a.form.formControlNames.name),t.R7$(),t.Y8G("formControlName",a.form.formControlNames.canHealHumans),t.R7$(2),t.Y8G("formControlName",a.form.formControlNames.canFixRobots))},dependencies:[i.me,i.BC,i.cb,i.j4,i.JD,G.rl,I.fg,de.sG],styles:[".container[_ngcontent-%COMP%]{display:flex;flex-direction:column}"],changeDetection:0})}return e})();function hl(e,o){if(1&e&&(t.j41(0,"mat-option",6),t.EFF(1),t.k0s()),2&e){const r=o.$implicit;t.Y8G("value",r.value),t.R7$(),t.SpI(" ",r.value," ")}}let _l=(()=>{class e{constructor(){this.AstromechDroidShape=Ee,this.form=w(this,{formType:b.SUB,formControls:{color:new i.hs(null,{validators:[i.k0.required]}),name:new i.hs(null,{validators:[i.k0.required]}),droidType:new i.hs(h.ASTROMECH,{validators:[i.k0.required]}),toolCount:new i.hs(null,{validators:[i.k0.required]}),shape:new i.hs(null,{validators:[i.k0.required]})}})}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275cmp=t.VBU({type:e,selectors:[["app-astromech-droid"]],features:[t.Jv_(E(e))],decls:13,vars:8,consts:[[1,"container",3,"formGroup"],["matInput","","type","color","placeholder","Color","autocomplete","off",3,"formControlName"],["matInput","","type","text","placeholder","Name","autocomplete","off",3,"formControlName"],["matInput","","type","number","placeholder","Number of tools carried","autocomplete","off",3,"formControlName"],["placeholder","Select the droid shape",3,"formControlName"],[3,"value",4,"ngFor","ngForOf"],[3,"value"]],template:function(n,a){1&n&&(t.j41(0,"fieldset",0)(1,"legend"),t.EFF(2,"Astromech Droid form"),t.k0s(),t.j41(3,"mat-form-field"),t.nrm(4,"input",1),t.k0s(),t.j41(5,"mat-form-field"),t.nrm(6,"input",2),t.k0s(),t.j41(7,"mat-form-field"),t.nrm(8,"input",3),t.k0s(),t.j41(9,"mat-form-field")(10,"mat-select",4),t.DNE(11,hl,2,2,"mat-option",5),t.nI1(12,"keyvalue"),t.k0s()()()),2&n&&(t.Y8G("formGroup",a.form.formGroup),t.R7$(4),t.Y8G("formControlName",a.form.formControlNames.color),t.R7$(2),t.Y8G("formControlName",a.form.formControlNames.name),t.R7$(2),t.Y8G("formControlName",a.form.formControlNames.toolCount),t.R7$(2),t.Y8G("formControlName",a.form.formControlNames.shape),t.R7$(),t.Y8G("ngForOf",t.bMT(12,6,a.AstromechDroidShape)))},dependencies:[m.Sq,i.me,i.Q0,i.BC,i.cb,i.j4,i.JD,G.rl,I.fg,K.VO,z.wT,m.lG],styles:[".container[_ngcontent-%COMP%]{display:flex;flex-direction:column}"],changeDetection:0})}return e})();function yl(e,o){if(1&e&&(t.j41(0,"mat-option",5),t.EFF(1),t.k0s()),2&e){const r=o.$implicit,n=t.XpG();t.Y8G("value",r.value),t.R7$(),t.SpI(" ",n.assassinDroidWeaponText[r.value]," ")}}const Cl={[D.SABER]:"Saber",[D.FLAME_THROWER]:"Flame thrower",[D.GUN]:"Gun",[D.AXE]:"Axe"};let bl=(()=>{class e{constructor(){this.AssassinDroidWeapon=D,this.assassinDroidWeaponText=Cl,this.form=w(this,{formType:b.SUB,formControls:{color:new i.hs(null,{validators:[i.k0.required]}),name:new i.hs(null,{validators:[i.k0.required]}),droidType:new i.hs(h.ASSASSIN,{validators:[i.k0.required]}),weapons:new i.hs([],{validators:[i.k0.required]})}})}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275cmp=t.VBU({type:e,selectors:[["app-assassin-droid"]],features:[t.Jv_(E(e))],decls:11,vars:7,consts:[[1,"container",3,"formGroup"],["matInput","","data-input-color","","type","color","placeholder","Color","autocomplete","off",3,"formControlName"],["matInput","","data-input-name","","type","text","placeholder","Name","autocomplete","off",3,"formControlName"],["data-select-weapons","","placeholder","Select weapons","multiple","",3,"formControlName"],["data-select-weapons-option","",3,"value",4,"ngFor","ngForOf"],["data-select-weapons-option","",3,"value"]],template:function(n,a){1&n&&(t.j41(0,"fieldset",0)(1,"legend"),t.EFF(2,"Assassin Droid form"),t.k0s(),t.j41(3,"mat-form-field"),t.nrm(4,"input",1),t.k0s(),t.j41(5,"mat-form-field"),t.nrm(6,"input",2),t.k0s(),t.j41(7,"mat-form-field")(8,"mat-select",3),t.DNE(9,yl,2,2,"mat-option",4),t.nI1(10,"keyvalue"),t.k0s()()()),2&n&&(t.Y8G("formGroup",a.form.formGroup),t.R7$(4),t.Y8G("formControlName",a.form.formControlNames.color),t.R7$(2),t.Y8G("formControlName",a.form.formControlNames.name),t.R7$(2),t.Y8G("formControlName",a.form.formControlNames.weapons),t.R7$(),t.Y8G("ngForOf",t.bMT(10,5,a.AssassinDroidWeapon)))},dependencies:[m.Sq,i.me,i.BC,i.cb,i.j4,i.JD,G.rl,I.fg,K.VO,z.wT,m.lG],styles:[".container[_ngcontent-%COMP%]{display:flex;flex-direction:column}"],changeDetection:0})}return e})();function vl(e,o){if(1&e&&(t.j41(0,"mat-option",5),t.EFF(1),t.k0s()),2&e){const r=o.$implicit;t.Y8G("value",r.value),t.R7$(),t.SpI(" ",r.value," ")}}function Tl(e,o){if(1&e&&t.nrm(0,"app-protocol-droid",6),2&e){const r=t.XpG();t.Y8G("formControlName",r.form.formControlNames.protocolDroid)}}function Sl(e,o){if(1&e&&t.nrm(0,"app-medical-droid",6),2&e){const r=t.XpG();t.Y8G("formControlName",r.form.formControlNames.medicalDroid)}}function wl(e,o){if(1&e&&t.nrm(0,"app-astromech-droid",6),2&e){const r=t.XpG();t.Y8G("formControlName",r.form.formControlNames.astromechDroid)}}function Gl(e,o){if(1&e&&t.nrm(0,"app-assassin-droid",6),2&e){const r=t.XpG();t.Y8G("formControlName",r.form.formControlNames.assassinDroid)}}let Fl=(()=>{class e{constructor(){this.DroidType=h,this.form=w(this,{formType:b.SUB,formControls:{protocolDroid:new i.hs(null),medicalDroid:new i.hs(null),astromechDroid:new i.hs(null),assassinDroid:new i.hs(null),droidType:new i.hs(null,{validators:[i.k0.required]})},toFormGroup:r=>({protocolDroid:r.droidType===h.PROTOCOL?r:null,medicalDroid:r.droidType===h.MEDICAL?r:null,astromechDroid:r.droidType===h.ASTROMECH?r:null,assassinDroid:r.droidType===h.ASSASSIN?r:null,droidType:r.droidType}),fromFormGroup:r=>{switch(r.droidType){case h.PROTOCOL:return r.protocolDroid;case h.MEDICAL:return r.medicalDroid;case h.ASTROMECH:return r.astromechDroid;case h.ASSASSIN:return r.assassinDroid;case null:return null;default:throw new Xe(r.droidType)}}})}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275cmp=t.VBU({type:e,selectors:[["app-droid-product"]],features:[t.Jv_(E(e))],decls:12,vars:10,consts:[[1,"container",3,"formGroup"],["data-select-droid-type","","placeholder","Select droid type",3,"formControlName"],["data-select-droid-type-option","",3,"value",4,"ngFor","ngForOf"],[3,"ngSwitch"],[3,"formControlName",4,"ngSwitchCase"],["data-select-droid-type-option","",3,"value"],[3,"formControlName"]],template:function(n,a){1&n&&(t.j41(0,"fieldset",0)(1,"legend"),t.EFF(2,"Droid form"),t.k0s(),t.j41(3,"mat-form-field")(4,"mat-select",1),t.DNE(5,vl,2,2,"mat-option",2),t.nI1(6,"keyvalue"),t.k0s()(),t.j41(7,"div",3),t.DNE(8,Tl,1,1,"app-protocol-droid",4)(9,Sl,1,1,"app-medical-droid",4)(10,wl,1,1,"app-astromech-droid",4)(11,Gl,1,1,"app-assassin-droid",4),t.k0s()()),2&n&&(t.Y8G("formGroup",a.form.formGroup),t.R7$(4),t.Y8G("formControlName",a.form.formControlNames.droidType),t.R7$(),t.Y8G("ngForOf",t.bMT(6,8,a.DroidType)),t.R7$(2),t.Y8G("ngSwitch",a.form.formGroup.value.droidType),t.R7$(),t.Y8G("ngSwitchCase",a.DroidType.PROTOCOL),t.R7$(),t.Y8G("ngSwitchCase",a.DroidType.MEDICAL),t.R7$(),t.Y8G("ngSwitchCase",a.DroidType.ASTROMECH),t.R7$(),t.Y8G("ngSwitchCase",a.DroidType.ASSASSIN))},dependencies:[m.Sq,m.ux,m.e1,i.BC,i.cb,i.j4,i.JD,G.rl,K.VO,z.wT,dl,gl,_l,bl,m.lG],styles:[".container[_ngcontent-%COMP%]{display:flex;flex-direction:column}"],changeDetection:0})}return e})();function El(e,o){if(1&e&&t.nrm(0,"img",23),2&e){const r=t.XpG();t.Mz_("alt","Photo of ",r.form.formGroup.value.title,""),t.Y8G("src",r.form.formGroup.value.imageUrl,t.B4B)}}function Ol(e,o){1&e&&(t.j41(0,"mat-error",24),t.EFF(1,"ID is required"),t.k0s())}function jl(e,o){1&e&&(t.j41(0,"mat-error",25),t.EFF(1,"Title is required"),t.k0s())}function Al(e,o){1&e&&(t.j41(0,"mat-error",26),t.EFF(1," Image url is required "),t.k0s())}function Nl(e,o){1&e&&(t.j41(0,"mat-error",27),t.EFF(1,"Price is required"),t.k0s())}function Dl(e,o){if(1&e&&(t.j41(0,"mat-option",28),t.EFF(1),t.k0s()),2&e){const r=o.$implicit;t.Y8G("value",r.value),t.R7$(),t.SpI(" ",r.value," ")}}function Rl(e,o){if(1&e&&t.nrm(0,"app-droid-product",29),2&e){const r=t.XpG();t.Y8G("formControlName",r.form.formControlNames.droidProduct)}}function Il(e,o){if(1&e&&t.nrm(0,"app-vehicle-product",29),2&e){const r=t.XpG();t.Y8G("formControlName",r.form.formControlNames.vehicleProduct)}}function $l(e,o){1&e&&(t.j41(0,"div",32),t.EFF(1,"Form is invalid"),t.k0s())}function Pl(e,o){if(1&e){const r=t.RV6();t.j41(0,"div")(1,"button",30),t.bIt("click",function(){t.eBV(r);const a=t.XpG();return t.Njj(a.manualSave$$.next())}),t.EFF(2," Upsert "),t.k0s(),t.DNE(3,$l,2,0,"div",31),t.k0s()}if(2&e){const r=t.XpG();t.R7$(),t.Y8G("disabled",r.form.formGroup.invalid||r.form.formGroup.disabled),t.R7$(2),t.Y8G("ngIf",r.form.formGroup.invalid)}}function Ml(e,o){if(1&e&&(t.j41(0,"pre",33),t.EFF(1),t.nI1(2,"json"),t.k0s()),2&e){const r=o.ngIf;t.R7$(),t.JRh(t.bMT(2,1,r))}}function kl(e,o){1&e&&(t.j41(0,"span",34),t.EFF(1,"Form is valid, no error!"),t.k0s())}let xl=(()=>{class e{constructor(){this.ListingType=C,this.input$=new Z.B,this.disabled$=new Z.B,this.listingUpdated=new Z.B,this.manualSave$$=new Z.B,this.form=w(this,{formType:b.ROOT,disabled$:this.disabled$,input$:this.input$,output$:this.listingUpdated,manualSave$:this.manualSave$$,formControls:{vehicleProduct:new i.hs(null),droidProduct:new i.hs(null),listingType:new i.hs(null,i.k0.required),id:new i.hs(null,i.k0.required),title:new i.hs(null,i.k0.required),imageUrl:new i.hs(null,i.k0.required),price:new i.hs(null,i.k0.required)},toFormGroup:r=>{const{listingType:n,product:a,...s}=r;return{vehicleProduct:r.listingType===C.VEHICLE?r.product:null,droidProduct:r.listingType===C.DROID?r.product:null,listingType:r.listingType,...s}},fromFormGroup:r=>{const{vehicleProduct:n,droidProduct:a,listingType:s,...l}=r;switch(s){case C.DROID:return a?{product:a,listingType:s,...l}:null;case C.VEHICLE:return n?{product:n,listingType:s,...l}:null;case null:return null;default:throw new Xe(s)}}})}set listing(r){this.input$.next(r)}set disabled(r){this.disabled$.next(r||!1)}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275cmp=t.VBU({type:e,selectors:[["app-listing-form"]],inputs:{listing:"listing",disabled:"disabled"},outputs:{listingUpdated:"listingUpdated"},decls:46,vars:31,consts:[["noError",""],["appearance","outlined","data-card-form",""],["data-title",""],["data-price",""],[1,"img-container"],["mat-card-image","",3,"src","alt",4,"ngIf"],[3,"formGroup"],["matInput","","data-input-id","","type","text","placeholder","ID","autocomplete","off",3,"formControlName"],["data-input-id-error","",4,"ngIf"],["matInput","","data-input-title","","type","text","placeholder","Title","autocomplete","off",3,"formControlName"],["data-input-title-error","",4,"ngIf"],["matInput","","data-input-image-url","","type","text","placeholder","Image Url","autocomplete","off",3,"formControlName"],["data-input-image-url-error","",4,"ngIf"],["matInput","","data-input-price","","type","number","placeholder","Price","autocomplete","off",3,"formControlName"],["data-input-price-error","",4,"ngIf"],["data-select-listing-type","","placeholder","Select listing type",3,"formControlName"],["data-select-listing-type-option","",3,"value",4,"ngFor","ngForOf"],[3,"ngSwitch"],[3,"formControlName",4,"ngSwitchCase"],[4,"ngIf"],["appearance","outlined","data-card-errors","",1,"errors"],["data-errors","",4,"ngIf","ngIfElse"],["appearance","outlined","data-card-values","",1,"values"],["mat-card-image","",3,"src","alt"],["data-input-id-error",""],["data-input-title-error",""],["data-input-image-url-error",""],["data-input-price-error",""],["data-select-listing-type-option","",3,"value"],[3,"formControlName"],["mat-raised-button","","color","primary",3,"click","disabled"],["class","invalid-form",4,"ngIf"],[1,"invalid-form"],["data-errors",""],["data-no-error",""]],template:function(n,a){if(1&n&&(t.j41(0,"mat-card",1)(1,"mat-card-header")(2,"mat-card-title",2),t.EFF(3),t.k0s(),t.j41(4,"mat-card-subtitle",3),t.EFF(5),t.nI1(6,"number"),t.k0s()(),t.j41(7,"div",4),t.DNE(8,El,1,3,"img",5),t.k0s(),t.j41(9,"mat-card-content")(10,"form",6)(11,"mat-form-field"),t.nrm(12,"input",7),t.k0s(),t.DNE(13,Ol,2,0,"mat-error",8),t.j41(14,"mat-form-field"),t.nrm(15,"input",9),t.k0s(),t.DNE(16,jl,2,0,"mat-error",10),t.j41(17,"mat-form-field"),t.nrm(18,"input",11),t.k0s(),t.DNE(19,Al,2,0,"mat-error",12),t.j41(20,"mat-form-field"),t.nrm(21,"input",13),t.k0s(),t.DNE(22,Nl,2,0,"mat-error",14),t.j41(23,"mat-form-field")(24,"mat-select",15),t.DNE(25,Dl,2,2,"mat-option",16),t.nI1(26,"keyvalue"),t.k0s()(),t.j41(27,"div",17),t.DNE(28,Rl,1,1,"app-droid-product",18)(29,Il,1,1,"app-vehicle-product",18),t.k0s()()(),t.j41(30,"mat-card-actions"),t.DNE(31,Pl,4,2,"div",19),t.k0s()(),t.j41(32,"mat-card",20)(33,"mat-card-title"),t.EFF(34,"Form errors"),t.k0s(),t.j41(35,"mat-card-content"),t.DNE(36,Ml,3,3,"pre",21)(37,kl,2,0,"ng-template",null,0,t.C5r),t.k0s()(),t.j41(39,"mat-card",22)(40,"mat-card-title"),t.EFF(41,"Form values"),t.k0s(),t.j41(42,"mat-card-content")(43,"pre"),t.EFF(44),t.nI1(45,"json"),t.k0s()()()),2&n){const s=t.sdS(38);t.R7$(2),t.AVh("not-visible",!a.form.formGroup.value.title),t.R7$(),t.SpI(" ",a.form.formGroup.value.title," "),t.R7$(),t.AVh("not-visible",!a.form.formGroup.value.price),t.R7$(),t.SpI(" \xa3",t.bMT(6,25,a.form.formGroup.value.price)," "),t.R7$(3),t.Y8G("ngIf",a.form.formGroup.value.imageUrl),t.R7$(2),t.Y8G("formGroup",a.form.formGroup),t.R7$(2),t.Y8G("formControlName",a.form.formControlNames.id),t.R7$(),t.Y8G("ngIf",null==a.form.formGroupErrors||null==a.form.formGroupErrors.id?null:a.form.formGroupErrors.id.required),t.R7$(2),t.Y8G("formControlName",a.form.formControlNames.title),t.R7$(),t.Y8G("ngIf",null==a.form.formGroupErrors||null==a.form.formGroupErrors.title?null:a.form.formGroupErrors.title.required),t.R7$(2),t.Y8G("formControlName",a.form.formControlNames.imageUrl),t.R7$(),t.Y8G("ngIf",null==a.form.formGroupErrors||null==a.form.formGroupErrors.imageUrl?null:a.form.formGroupErrors.imageUrl.required),t.R7$(2),t.Y8G("formControlName",a.form.formControlNames.price),t.R7$(),t.Y8G("ngIf",null==a.form.formGroupErrors||null==a.form.formGroupErrors.price?null:a.form.formGroupErrors.price.required),t.R7$(2),t.Y8G("formControlName",a.form.formControlNames.listingType),t.R7$(),t.Y8G("ngForOf",t.bMT(26,27,a.ListingType)),t.R7$(2),t.Y8G("ngSwitch",a.form.formGroup.value.listingType),t.R7$(),t.Y8G("ngSwitchCase",a.ListingType.DROID),t.R7$(),t.Y8G("ngSwitchCase",a.ListingType.VEHICLE),t.R7$(2),t.Y8G("ngIf",!0),t.R7$(5),t.Y8G("ngIf",a.form.formGroupErrors)("ngIfElse",s),t.R7$(8),t.JRh(t.bMT(45,29,a.form.formGroup.value))}},dependencies:[m.Sq,m.bT,m.ux,m.e1,i.qT,i.me,i.Q0,i.BC,i.cb,i.j4,i.JD,we.$z,G.rl,G.TL,I.fg,K.VO,z.wT,x.RN,x.YY,x.m2,x.MM,x.kF,x.Lc,x.dh,ul,Fl,m.TG,m.QX,m.lG],styles:["img[_ngcontent-%COMP%]{max-width:300px;max-height:500px;object-fit:contain}.img-container[_ngcontent-%COMP%]{width:100%;text-align:center}mat-card[_ngcontent-%COMP%]{margin-bottom:15px;max-width:500px}mat-card[_ngcontent-%COMP%] mat-card-title[_ngcontent-%COMP%], mat-card[_ngcontent-%COMP%] mat-card-subtitle[_ngcontent-%COMP%]{min-height:25px}mat-card.errors[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%], mat-card.values[_ngcontent-%COMP%] mat-card-content[_ngcontent-%COMP%]{overflow:auto}mat-form-field[_ngcontent-%COMP%]{width:100%}.invalid-form[_ngcontent-%COMP%]{padding:15px 0}"],changeDetection:0})}return e})(),nr=(()=>{class e{constructor(r,n,a){this.route=r,this.listingService=n,this.uuidService=a,this.readonlyFormControl=new i.hs(!1),this.listing$=this.route.paramMap.pipe((0,N.T)(s=>s.get("listingId")),(0,pe.n)(s=>"new"!==s&&s?this.listingService.getOneListing(s):(0,Y.of)(null)),(0,N.T)(s=>s||this.emptyListing()))}emptyListing(){return{id:this.uuidService.generate(),listingType:null,title:null,imageUrl:null,price:null,product:null}}upsertListing(r){this.listingService.upsertListing(r)}static#e=this.\u0275fac=function(n){return new(n||e)(t.rXU(v.nX),t.rXU(ze),t.rXU(ur))};static#t=this.\u0275cmp=t.VBU({type:e,selectors:[["app-listing"]],decls:4,vars:5,consts:[["data-readonly","",1,"readonly",3,"formControl"],[3,"listingUpdated","listing","disabled"]],template:function(n,a){1&n&&(t.j41(0,"mat-slide-toggle",0),t.EFF(1,"Readonly"),t.k0s(),t.j41(2,"app-listing-form",1),t.nI1(3,"async"),t.bIt("listingUpdated",function(l){return a.upsertListing(l)}),t.k0s()),2&n&&(t.Y8G("formControl",a.readonlyFormControl),t.R7$(2),t.Y8G("listing",t.bMT(3,3,a.listing$))("disabled",a.readonlyFormControl.value))},dependencies:[i.BC,i.l_,de.sG,xl,m.Jj],styles:[".readonly[_ngcontent-%COMP%]{padding:15px 0}"],changeDetection:0})}return e})();var Ll=c(5911),Ge=c(105);let Yl=(()=>{class e{transform(r){return r.map(n=>`${n.firstName} ${n.lastName}`).join(", ")}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275pipe=t.EJ8({name:"displayCrewMembers",type:e,pure:!0})}return e})();const Ul=()=>["listings","new"],Bl=e=>["listings",e];function Vl(e,o){if(1&e&&(t.j41(0,"span"),t.EFF(1),t.k0s()),2&e){const r=t.XpG(2).$implicit;t.R7$(),t.SpI("Weapons: ",r.product.weapons.join(", "),"")}}function Hl(e,o){if(1&e&&(t.j41(0,"span"),t.EFF(1),t.k0s()),2&e){const r=t.XpG(2).$implicit;t.R7$(),t.SpI("Number of tools: ",r.product.toolCount,"")}}function Xl(e,o){if(1&e&&(t.j41(0,"span"),t.EFF(1),t.k0s()),2&e){const r=t.XpG(2).$implicit;t.R7$(),t.Lme(" ",r.product.canHealHumans?"Can":"Can't"," heal humans, ",r.product.canFixRobots?"can":"can't"," fix robots ")}}function Jl(e,o){if(1&e&&(t.j41(0,"span"),t.EFF(1),t.k0s()),2&e){const r=t.XpG(2).$implicit;t.R7$(),t.SpI(" Spoken languages: ",r.product.spokenLanguages.join(", ")," ")}}function Kl(e,o){if(1&e&&(t.j41(0,"span")(1,"span",9),t.EFF(2),t.k0s(),t.EFF(3," - "),t.j41(4,"span",10),t.DNE(5,Vl,2,1,"span",8)(6,Hl,2,1,"span",8)(7,Xl,2,2,"span",8)(8,Jl,2,1,"span",8),t.k0s()()),2&e){const r=t.XpG().$implicit,n=t.XpG();t.R7$(),t.xc7("background-color",r.product.color),t.R7$(),t.JRh(r.product.droidType),t.R7$(2),t.Y8G("ngSwitch",r.product.droidType),t.R7$(),t.Y8G("ngSwitchCase",n.DroidType.ASSASSIN),t.R7$(),t.Y8G("ngSwitchCase",n.DroidType.ASTROMECH),t.R7$(),t.Y8G("ngSwitchCase",n.DroidType.MEDICAL),t.R7$(),t.Y8G("ngSwitchCase",n.DroidType.PROTOCOL)}}function zl(e,o){if(1&e&&(t.j41(0,"span"),t.EFF(1),t.k0s()),2&e){const r=t.XpG(2).$implicit;t.R7$(),t.SpI("maximum speed: ",r.product.maximumSpeed,"kph")}}function ql(e,o){if(1&e&&(t.j41(0,"span"),t.EFF(1),t.k0s()),2&e){const r=t.XpG(2).$implicit;t.R7$(),t.SpI("number of wings: ",r.product.wingCount,"")}}function Wl(e,o){if(1&e&&(t.j41(0,"span")(1,"span",9),t.EFF(2),t.k0s(),t.EFF(3," - "),t.j41(4,"span",10),t.EFF(5),t.nI1(6,"displayCrewMembers"),t.DNE(7,zl,2,1,"span",8)(8,ql,2,1,"span",8),t.k0s()()),2&e){const r=t.XpG().$implicit,n=t.XpG();t.R7$(),t.xc7("background-color",r.product.color),t.R7$(),t.JRh(r.product.vehicleType),t.R7$(2),t.Y8G("ngSwitch",r.product.vehicleType),t.R7$(),t.Lme(" Crew members: ",t.bMT(6,8,r.product.crewMembers),", ",r.product.canFire?"can":"can't"," fire, "),t.R7$(2),t.Y8G("ngSwitchCase",n.VehicleType.SPEEDER),t.R7$(),t.Y8G("ngSwitchCase",n.VehicleType.SPACESHIP)}}function Ql(e,o){if(1&e&&(t.j41(0,"a",2)(1,"span",3)(2,"span",4),t.EFF(3),t.k0s(),t.EFF(4," ( "),t.j41(5,"span",5),t.EFF(6),t.k0s(),t.EFF(7," ) \xa3 "),t.j41(8,"span",6),t.EFF(9),t.nI1(10,"number"),t.k0s()(),t.j41(11,"span",7),t.DNE(12,Kl,9,8,"span",8)(13,Wl,9,10,"span",8),t.k0s()()),2&e){const r=o.$implicit,n=t.XpG();t.Y8G("routerLink",t.eq3(9,Bl,r.id)),t.R7$(3),t.JRh(r.title),t.R7$(3),t.JRh(r.listingType),t.R7$(3),t.JRh(t.bMT(10,7,r.price)),t.R7$(2),t.Y8G("ngSwitch",r.listingType),t.R7$(),t.Y8G("ngSwitchCase",n.ListingType.DROID),t.R7$(),t.Y8G("ngSwitchCase",n.ListingType.VEHICLE)}}let Zl=(()=>{class e{constructor(){this.listings=[],this.ListingType=C,this.DroidType=h,this.VehicleType=S}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275cmp=t.VBU({type:e,selectors:[["app-listings"]],inputs:{listings:"listings"},decls:4,vars:3,consts:[["data-list-item","","mat-list-item","",3,"routerLink",4,"ngFor","ngForOf"],["mat-raised-button","","data-create-new","","color","primary",3,"routerLink"],["data-list-item","","mat-list-item","",3,"routerLink"],["matListItemTitle",""],["data-title",""],["data-type",""],["data-price",""],["matListItemLine","",3,"ngSwitch"],[4,"ngSwitchCase"],["data-sub-type",""],["data-details","",3,"ngSwitch"]],template:function(n,a){1&n&&(t.j41(0,"mat-nav-list"),t.DNE(1,Ql,14,11,"a",0),t.k0s(),t.j41(2,"a",1),t.EFF(3,"Create new"),t.k0s()),2&n&&(t.R7$(),t.Y8G("ngForOf",a.listings),t.R7$(),t.Y8G("routerLink",t.lJ4(2,Ul)))},dependencies:[m.Sq,m.ux,m.e1,we.It,Ge._L,Ge.YE,Ge.C_,Ge.yE,v.Wk,m.QX,Yl],styles:["mat-nav-list[_ngcontent-%COMP%]{padding:0}"],changeDetection:0})}return e})(),ec=(()=>{class e{constructor(r){this.listingService=r,this.listings$=this.listingService.getListings()}static#e=this.\u0275fac=function(n){return new(n||e)(t.rXU(ze))};static#t=this.\u0275cmp=t.VBU({type:e,selectors:[["app-main"]],decls:7,vars:3,consts:[["color","primary",1,"top-toolbar"],["src","/assets/ewok-no-bg.png","alt","EWOK",1,"logo"],[1,"container"],[1,"left-part",3,"listings"],[1,"right-part"],[1,"router-flex"]],template:function(n,a){1&n&&(t.j41(0,"mat-toolbar",0),t.nrm(1,"img",1),t.k0s(),t.j41(2,"div",2),t.nrm(3,"app-listings",3),t.nI1(4,"async"),t.j41(5,"div",4),t.nrm(6,"router-outlet",5),t.k0s()()),2&n&&(t.R7$(3),t.Y8G("listings",t.bMT(4,1,a.listings$)))},dependencies:[Ll.KQ,v.n3,Zl,m.Jj],styles:[".container[_ngcontent-%COMP%]{height:calc(100% - 64px);display:flex}.container[_ngcontent-%COMP%] .left-part[_ngcontent-%COMP%], .container[_ngcontent-%COMP%] .right-part[_ngcontent-%COMP%]{flex-grow:1;height:100%}.logo[_ngcontent-%COMP%]{max-width:200px}"],changeDetection:0})}return e})(),tc=(()=>{class e{static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275mod=t.$C({type:e});static#r=this.\u0275inj=t.G2t({imports:[m.MD,T.G,v.iI.forChild([{path:"",component:ec,children:[{path:"listings",children:[{path:":listingId",component:nr},{path:"new",component:nr,pathMatch:"full"}]}]},{path:"**",pathMatch:"full",redirectTo:"/"}])]})}return e})()},362:Ke=>{Ke.exports=function W(c,m){if(c===m)return!0;if(c&&m&&"object"==typeof c&&"object"==typeof m){if(c.constructor!==m.constructor)return!1;var v,T,i;if(Array.isArray(c)){if((v=c.length)!=m.length)return!1;for(T=v;0!=T--;)if(!W(c[T],m[T]))return!1;return!0}if(c.constructor===RegExp)return c.source===m.source&&c.flags===m.flags;if(c.valueOf!==Object.prototype.valueOf)return c.valueOf()===m.valueOf();if(c.toString!==Object.prototype.toString)return c.toString()===m.toString();if((v=(i=Object.keys(c)).length)!==Object.keys(m).length)return!1;for(T=v;0!=T--;)if(!Object.prototype.hasOwnProperty.call(m,i[T]))return!1;for(T=v;0!=T--;){var Y=i[T];if(!W(c[Y],m[Y]))return!1}return!0}return c!=c&&m!=m}}}]); \ No newline at end of file diff --git a/index.html b/index.html index b1b135e..53a943e 100644 --- a/index.html +++ b/index.html @@ -8,8 +8,8 @@ - + - + diff --git a/runtime.fa0a3dbe2399c3f4.js b/runtime.a4a3d0dd69977727.js similarity index 97% rename from runtime.fa0a3dbe2399c3f4.js rename to runtime.a4a3d0dd69977727.js index e52abcc..1df67f5 100644 --- a/runtime.fa0a3dbe2399c3f4.js +++ b/runtime.a4a3d0dd69977727.js @@ -1 +1 @@ -(()=>{"use strict";var e,v={},m={};function r(e){var n=m[e];if(void 0!==n)return n.exports;var t=m[e]={exports:{}};return v[e](t,t.exports,r),t.exports}r.m=v,e=[],r.O=(n,t,i,u)=>{if(!t){var a=1/0;for(o=0;o=u)&&Object.keys(r.O).every(b=>r.O[b](t[f]))?t.splice(f--,1):(s=!1,u0&&e[o-1][2]>u;o--)e[o]=e[o-1];e[o]=[t,i,u]},r.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return r.d(n,{a:n}),n},r.d=(e,n)=>{for(var t in n)r.o(n,t)&&!r.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((n,t)=>(r.f[t](e,n),n),[])),r.u=e=>e+".3ead4d088fdc4328.js",r.miniCssF=e=>{},r.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),(()=>{var e={},n="ngx-sub-form-demo:";r.l=(t,i,u,o)=>{if(e[t])e[t].push(i);else{var a,s;if(void 0!==u)for(var f=document.getElementsByTagName("script"),l=0;l{a.onerror=a.onload=null,clearTimeout(p);var _=e[t];if(delete e[t],a.parentNode&&a.parentNode.removeChild(a),_&&_.forEach(h=>h(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})},(()=>{var e;r.tt=()=>(void 0===e&&(e={createScriptURL:n=>n},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,u)=>{var o=r.o(e,i)?e[i]:void 0;if(0!==o)if(o)u.push(o[2]);else if(121!=i){var a=new Promise((d,c)=>o=e[i]=[d,c]);u.push(o[2]=a);var s=r.p+r.u(i),f=new Error;r.l(s,d=>{if(r.o(e,i)&&(0!==(o=e[i])&&(e[i]=void 0),o)){var c=d&&("load"===d.type?"missing":d.type),p=d&&d.target&&d.target.src;f.message="Loading chunk "+i+" failed.\n("+c+": "+p+")",f.name="ChunkLoadError",f.type=c,f.request=p,o[1](f)}},"chunk-"+i,i)}else e[i]=0},r.O.j=i=>0===e[i];var n=(i,u)=>{var f,l,[o,a,s]=u,d=0;if(o.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(u);d{"use strict";var e,v={},m={};function r(e){var n=m[e];if(void 0!==n)return n.exports;var t=m[e]={exports:{}};return v[e](t,t.exports,r),t.exports}r.m=v,e=[],r.O=(n,t,i,u)=>{if(!t){var a=1/0;for(o=0;o=u)&&Object.keys(r.O).every(b=>r.O[b](t[f]))?t.splice(f--,1):(s=!1,u0&&e[o-1][2]>u;o--)e[o]=e[o-1];e[o]=[t,i,u]},r.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return r.d(n,{a:n}),n},r.d=(e,n)=>{for(var t in n)r.o(n,t)&&!r.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((n,t)=>(r.f[t](e,n),n),[])),r.u=e=>e+".8112c9ad05c43621.js",r.miniCssF=e=>{},r.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),(()=>{var e={},n="ngx-sub-form-demo:";r.l=(t,i,u,o)=>{if(e[t])e[t].push(i);else{var a,s;if(void 0!==u)for(var f=document.getElementsByTagName("script"),l=0;l{a.onerror=a.onload=null,clearTimeout(p);var _=e[t];if(delete e[t],a.parentNode&&a.parentNode.removeChild(a),_&&_.forEach(h=>h(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})},(()=>{var e;r.tt=()=>(void 0===e&&(e={createScriptURL:n=>n},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,u)=>{var o=r.o(e,i)?e[i]:void 0;if(0!==o)if(o)u.push(o[2]);else if(121!=i){var a=new Promise((d,c)=>o=e[i]=[d,c]);u.push(o[2]=a);var s=r.p+r.u(i),f=new Error;r.l(s,d=>{if(r.o(e,i)&&(0!==(o=e[i])&&(e[i]=void 0),o)){var c=d&&("load"===d.type?"missing":d.type),p=d&&d.target&&d.target.src;f.message="Loading chunk "+i+" failed.\n("+c+": "+p+")",f.name="ChunkLoadError",f.type=c,f.request=p,o[1](f)}},"chunk-"+i,i)}else e[i]=0},r.O.j=i=>0===e[i];var n=(i,u)=>{var f,l,[o,a,s]=u,d=0;if(o.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(u);d