@ngageoint/mage.web-app
Version:
The Mage web-app is the UI for interacting with the Mage service in a web browser.
1 lines • 684 kB
JavaScript
(self.webpackChunkapp=self.webpackChunkapp||[]).push([[179],{82524:(ct,De,S)=>{"use strict";S.d(De,{s:()=>j});var y=S(80529),A=S(96213),k=S(94650);let j=(()=>{class K{constructor(ye){this.httpClient=ye}getApi(){return this.httpClient.get("/api",{context:(new y.qT).set(A.h,!0)})}}return K.\u0275fac=function(ye){return new(ye||K)(k.LFG(y.eN))},K.\u0275prov=k.Yz7({token:K,factory:K.\u0275fac,providedIn:"root"}),K})()},38159:(ct,De,S)=>{"use strict";S.d(De,{n:()=>A});var y=S(94650);let A=(()=>{class k{constructor(){this.tokenKey="token",this.pollingIntervalKey="pollingInterval",this.timeIntervalKey="timeInterval",this.teamsKey="teams",this.usersKey="users",this.formsKey="forms",this.mapPositionKey="mapPosition",this.coordinateSystemViewKey="coordinateSystemView",this.coordinateSystemEditKey="coordinateSystemEdit",this.timeZoneViewKey="timeZoneView",this.timeZoneEditKey="timeZoneEdit",this.timeFormatKey="timeFormat"}getToken(){return this.getLocalItem(this.tokenKey)}setToken(K){return this.setLocalItem(this.tokenKey,K)}removeToken(){return this.removeLocalItem(this.tokenKey)}setPollingInterval(K){return this.setLocalItem(this.pollingIntervalKey,K)}getPollingInterval(){return this.getLocalItem(this.pollingIntervalKey)}setTimeInterval(K){return this.setLocalItem(this.timeIntervalKey,JSON.stringify(K))}getTimeInterval(){const K=this.getLocalItem(this.timeIntervalKey);if(K){const J=JSON.parse(K);return J&&J.options&&(J.options.startDate&&(J.options.startDate=new Date(J.options.startDate)),J.options.endDate&&(J.options.endDate=new Date(J.options.endDate))),J}}getTeams(){const K=this.getLocalItem(this.teamsKey);if(K)return JSON.parse(K)}setTeams(K){return this.setLocalItem(this.teamsKey,JSON.stringify(K))}getUsers(){const K=this.getLocalItem(this.usersKey);if(K)return JSON.parse(K)}setUsers(K){return this.setLocalItem(this.usersKey,JSON.stringify(K))}getForms(){const K=this.getLocalItem(this.formsKey);if(K)return JSON.parse(K)}setForms(K){return this.setLocalItem(this.formsKey,JSON.stringify(K))}removeTeams(){return this.removeLocalItem(this.teamsKey)}setMapPosition(K){return this.setLocalItem(this.mapPositionKey,JSON.stringify(K))}getMapPosition(){const K=this.getLocalItem(this.mapPositionKey);if(K)return JSON.parse(K)}getCoordinateSystemView(){return this.getLocalItem(this.coordinateSystemViewKey)||"wgs84"}setCoordinateSystemView(K){return this.setLocalItem(this.coordinateSystemViewKey,K)}getCoordinateSystemEdit(){return this.getLocalItem(this.coordinateSystemEditKey)||this.getCoordinateSystemView()}setCoordinateSystemEdit(K){return this.setLocalItem(this.coordinateSystemEditKey,K)}getTimeZoneView(){return this.getLocalItem(this.timeZoneViewKey)||"local"}setTimeZoneView(K){return this.setLocalItem(this.timeZoneViewKey,K)}getTimeZoneEdit(){return this.getLocalItem(this.timeZoneEditKey)||this.getTimeZoneView()}setTimeZoneEdit(K){return this.setLocalItem(this.timeZoneEditKey,K)}getTimeFormat(){return this.getLocalItem(this.timeFormatKey)||"absolute"}setTimeFormat(K){return this.setLocalItem(this.timeFormatKey,K)}getLocalItem(K){try{if("localStorage"in window&&null!==window.localStorage)return localStorage.getItem(K)}catch{return}}setLocalItem(K,J){try{if("localStorage"in window&&null!==window.localStorage)return localStorage.setItem(K,J)}catch{return}}removeLocalItem(K){try{if("localStorage"in window&&null!==window.localStorage)return localStorage.removeItem(K)}catch{return!1}}}return k.\u0275fac=function(K){return new(K||k)},k.\u0275prov=y.Yz7({token:k,factory:k.\u0275fac,providedIn:"root"}),k})()},96213:(ct,De,S)=>{"use strict";S.d(De,{N:()=>ee,h:()=>se});var y=S(80529),A=S(77579),k=S(70262),j=S(63900),K=S(62843),J=S(28383),ye=S(94650),Y=S(65938),ae=S(1584),ne=S(38159);const se=new y.Xk(()=>!1);let ee=(()=>{class He{constructor(Ae,Te,Ee){this.dialog=Ae,this.userService=Te,this.localStorageService=Ee,this.isRefreshingToken=!1,this.tokenSubject=new A.x}intercept(Ae,Te){return!0===Ae.context.get(se)?Te.handle(Ae):Ae.url.startsWith("/api/")?Te.handle(this.tokenRequest(Ae)).pipe((0,k.K)(it=>it instanceof y.UA&&401===it.status?(this.userService.setUser(null),this.isRefreshingToken||(this.isRefreshingToken=!0,this.dialog.open(J.h,{width:"600px",disableClose:!0,autoFocus:!1}).afterClosed().subscribe(()=>{this.isRefreshingToken=!1,this.tokenSubject.next()})),this.tokenSubject.pipe((0,j.w)(()=>Te.handle(this.tokenRequest(Ae))))):(0,K._)(()=>it))):Te.handle(Ae)}tokenRequest(Ae){const Te=this.localStorageService.getToken();return Ae.clone({headers:Ae.headers.set("Authorization",`Bearer ${Te}`)})}}return He.\u0275fac=function(Ae){return new(Ae||He)(ye.LFG(Y.uw),ye.LFG(ae.K),ye.LFG(ne.n))},He.\u0275prov=ye.Yz7({token:He,factory:He.\u0275fac,providedIn:"root"}),He})()},28383:(ct,De,S)=>{"use strict";S.d(De,{h:()=>j});var y=S(94650),A=S(82524),k=S(65938);let j=(()=>{class K{constructor(ye,Y){this.apiService=ye,this.dialogRef=Y}ngOnInit(){this.apiService.getApi().subscribe(ye=>{this.api=ye})}onIngress(){this.dialogRef.close()}}return K.\u0275fac=function(ye){return new(ye||K)(y.Y36(A.s),y.Y36(k.so))},K.\u0275cmp=y.Xpm({type:K,selectors:[["authentication-dialog"]],decls:6,vars:2,consts:[[1,"mat-dialog-title"],["mat-dialog-content",""],[1,"ingress"],[3,"landing","api","complete"]],template:function(ye,Y){1&ye&&(y.TgZ(0,"div")(1,"h3",0),y._uU(2,"Please signin to continue to Mage"),y.qZA(),y.TgZ(3,"div",1)(4,"div",2)(5,"ingress",3),y.NdJ("complete",function(){return Y.onIngress()}),y.qZA()()()()),2&ye&&(y.xp6(5),y.Q6J("landing",!1)("api",Y.api))},styles:[".ingress[_ngcontent-%COMP%]{width:100%;height:100%}"]}),K})()},1584:(ct,De,S)=>{"use strict";S.d(De,{K:()=>Y});var y=S(80529),A=S(61135),k=S(77579),j=S(18505),K=S(96213),J=S(94650),ye=S(38159);let Y=(()=>{class ae{constructor(se,ee){this.httpClient=se,this.localStorageService=ee,this._myself=new A.X(null),this.myself$=this._myself.asObservable()}signup(se){return this.httpClient.post("/api/users/signups",{username:se},{context:(new y.qT).set(K.h,!0)})}signupVerify(se,ee){return this.httpClient.post("/api/users/signups/verifications",se,{headers:{Authorization:`Bearer ${ee}`},context:(new y.qT).set(K.h,!0)})}signin(se,ee){return this.httpClient.post("/auth/local/signin",{username:se,password:ee,appVersion:"Web Client"})}idpSignin(se){let ee=new k.x;const nt=window.open("/auth/"+se+"/signin","_blank");return window.addEventListener("message",function Ae(Te){window.removeEventListener("message",Ae,!1),Te.origin===window.location.origin&&(ee.next(Te.data),nt.close())},!1),ee.asObservable()}ldapSignin(se,ee){return this.httpClient.post("/auth/ldap/signin",{username:se,password:ee,appVersion:"Web Client"},{context:(new y.qT).set(K.h,!0)})}authorize(se,ee){return this.httpClient.post("/auth/token?createDevice=false",{uid:ee,appVersion:"Web Client"},{headers:{Authorization:`Bearer ${se}`}}).pipe((0,j.b)(He=>{this.setUser(He.user)}))}getMyself(){return this.httpClient.get("/api/users/myself").pipe((0,j.b)(se=>{this.setUser(se)}))}setUser(se){this._myself.next(se),this.myself=se,this.amAdmin=this.myself&&this.myself.role&&("ADMIN_ROLE"===this.myself.role.name||"EVENT_MANAGER_ROLE"===this.myself.role.name)}getUser(se,ee){const He={};return(ee=ee||{}).populate&&(He.populate=ee.populate),this.httpClient.post(`/api/users/${se}`,{params:He})}hasPermission(se){return this.myself.role.permissions.includes(se)}addRecentEvent(se){return this.httpClient.post(`/api/users/${this.myself.id}/events/${se.id}/recent`,{})}getRecentEventId(){var se=this.myself.recentEventIds;return se.length>0?se[0]:null}logout(){return this.httpClient.post("/api/logout",null,{responseType:"text"}).pipe((0,j.b)(()=>{this.clearUser()}))}saveProfile(se){const ee=new FormData;for(var He in se)null!=se[He]&&ee.append(He,se[He]);return this.httpClient.put("/api/users/myself",ee,{reportProgress:!0,observe:"events"})}updatePassword(se,ee){return this.httpClient.put("/api/users/myself/password",{username:this.myself.username,password:se,newPassword:ee,newPasswordConfirm:ee},{context:(new y.qT).set(K.h,!0),responseType:"text"})}clearUser(){this.myself=null,this.amAdmin=null,this.localStorageService.removeToken()}}return ae.\u0275fac=function(se){return new(se||ae)(J.LFG(y.eN),J.LFG(ye.n))},ae.\u0275prov=J.Yz7({token:ae,factory:ae.\u0275fac,providedIn:"root"}),ae})()},34224:(ct,De,S)=>{"use strict";var y=S(11481),A=S(94650),k=S(37340);function K(I){return new A.vHH(3e3,!1)}function me(){return typeof window<"u"&&typeof window.document<"u"}function he(){return typeof process<"u"&&"[object process]"==={}.toString.call(process)}function Ct(I){switch(I.length){case 0:return new k.ZN;case 1:return I[0];default:return new k.ZE(I)}}function on(I,i,o,l,d=new Map,h=new Map){const b=[],O=[];let $=-1,Z=null;if(l.forEach(Ke=>{const yt=Ke.get("offset"),bt=yt==$,Ut=bt&&Z||new Map;Ke.forEach((Xt,cn)=>{let jn=cn,Wn=Xt;if("offset"!==cn)switch(jn=i.normalizePropertyName(jn,b),Wn){case k.k1:Wn=d.get(cn);break;case k.l3:Wn=h.get(cn);break;default:Wn=i.normalizeStyleValue(cn,jn,Wn,b)}Ut.set(jn,Wn)}),bt||O.push(Ut),Z=Ut,$=yt}),b.length)throw function $e(I){return new A.vHH(3502,!1)}();return O}function pn(I,i,o,l){switch(i){case"start":I.onStart(()=>l(o&&Yt(o,"start",I)));break;case"done":I.onDone(()=>l(o&&Yt(o,"done",I)));break;case"destroy":I.onDestroy(()=>l(o&&Yt(o,"destroy",I)))}}function Yt(I,i,o){const h=mn(I.element,I.triggerName,I.fromState,I.toState,i||I.phaseName,o.totalTime??I.totalTime,!!o.disabled),b=I._data;return null!=b&&(h._data=b),h}function mn(I,i,o,l,d="",h=0,b){return{element:I,triggerName:i,fromState:o,toState:l,phaseName:d,totalTime:h,disabled:!!b}}function ln(I,i,o){let l=I.get(i);return l||I.set(i,l=o),l}function Hn(I){const i=I.indexOf(":");return[I.substring(1,i),I.slice(i+1)]}let Mn=(I,i)=>!1,An=(I,i,o)=>[],Gn=null;function et(I){const i=I.parentNode||I.host;return i===Gn?null:i}(he()||typeof Element<"u")&&(me()?(Gn=(()=>document.documentElement)(),Mn=(I,i)=>{for(;i;){if(i===I)return!0;i=et(i)}return!1}):Mn=(I,i)=>I.contains(i),An=(I,i,o)=>{if(o)return Array.from(I.querySelectorAll(i));const l=I.querySelector(i);return l?[l]:[]});let P=null,V=!1;const H=Mn,z=An;let rt=(()=>{class I{validateStyleProperty(o){return function re(I){P||(P=function oe(){return typeof document<"u"?document.body:null}()||{},V=!!P.style&&"WebkitAppearance"in P.style);let i=!0;return P.style&&!function N(I){return"ebkit"==I.substring(1,6)}(I)&&(i=I in P.style,!i&&V&&(i="Webkit"+I.charAt(0).toUpperCase()+I.slice(1)in P.style)),i}(o)}matchesElement(o,l){return!1}containsElement(o,l){return H(o,l)}getParentElement(o){return et(o)}query(o,l,d){return z(o,l,d)}computeStyle(o,l,d){return d||""}animate(o,l,d,h,b,O=[],$){return new k.ZN(d,h)}}return I.\u0275fac=function(o){return new(o||I)},I.\u0275prov=A.Yz7({token:I,factory:I.\u0275fac}),I})(),gt=(()=>{class I{}return I.NOOP=new rt,I})();const Dn="ng-enter",yn="ng-leave",hr="ng-trigger",Cn=".ng-trigger",Ye="ng-animating",Se=".ng-animating";function we(I){if("number"==typeof I)return I;const i=I.match(/^(-?[\.\d]+)(m?s)/);return!i||i.length<2?0:ie(parseFloat(i[1]),i[2])}function ie(I,i){return"s"===i?1e3*I:I}function de(I,i,o){return I.hasOwnProperty("duration")?I:function X(I,i,o){let d,h=0,b="";if("string"==typeof I){const O=I.match(/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i);if(null===O)return i.push(K()),{duration:0,delay:0,easing:""};d=ie(parseFloat(O[1]),O[2]);const $=O[3];null!=$&&(h=ie(parseFloat($),O[4]));const Z=O[5];Z&&(b=Z)}else d=I;if(!o){let O=!1,$=i.length;d<0&&(i.push(function J(){return new A.vHH(3100,!1)}()),O=!0),h<0&&(i.push(function ye(){return new A.vHH(3101,!1)}()),O=!0),O&&i.splice($,0,K())}return{duration:d,delay:h,easing:b}}(I,i,o)}function Oe(I,i={}){return Object.keys(I).forEach(o=>{i[o]=I[o]}),i}function tt(I){const i=new Map;return Object.keys(I).forEach(o=>{i.set(o,I[o])}),i}function xn(I,i=new Map,o){if(o)for(let[l,d]of o)i.set(l,d);for(let[l,d]of I)i.set(l,d);return i}function _i(I,i,o){return o?i+":"+o+";":""}function $n(I){let i="";for(let o=0;o<I.style.length;o++){const l=I.style.item(o);i+=_i(0,l,I.style.getPropertyValue(l))}for(const o in I.style)I.style.hasOwnProperty(o)&&!o.startsWith("_")&&(i+=_i(0,Jt(o),I.style[o]));I.setAttribute("style",i)}function lr(I,i,o){I.style&&(i.forEach((l,d)=>{const h=Dt(d);o&&!o.has(d)&&o.set(d,I.style[h]),I.style[h]=l}),he()&&$n(I))}function ur(I,i){I.style&&(i.forEach((o,l)=>{const d=Dt(l);I.style[d]=""}),he()&&$n(I))}function Cr(I){return Array.isArray(I)?1==I.length?I[0]:(0,k.vP)(I):I}const Ar=new RegExp("{{\\s*(.+?)\\s*}}","g");function fe(I){let i=[];if("string"==typeof I){let o;for(;o=Ar.exec(I);)i.push(o[1]);Ar.lastIndex=0}return i}function pe(I,i,o){const l=I.toString(),d=l.replace(Ar,(h,b)=>{let O=i[b];return null==O&&(o.push(function ae(I){return new A.vHH(3003,!1)}()),O=""),O.toString()});return d==l?I:d}function q(I){const i=[];let o=I.next();for(;!o.done;)i.push(o.value),o=I.next();return i}const je=/-+([a-z0-9])/g;function Dt(I){return I.replace(je,(...i)=>i[1].toUpperCase())}function Jt(I){return I.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Vn(I,i,o){switch(i.type){case 7:return I.visitTrigger(i,o);case 0:return I.visitState(i,o);case 1:return I.visitTransition(i,o);case 2:return I.visitSequence(i,o);case 3:return I.visitGroup(i,o);case 4:return I.visitAnimate(i,o);case 5:return I.visitKeyframes(i,o);case 6:return I.visitStyle(i,o);case 8:return I.visitReference(i,o);case 9:return I.visitAnimateChild(i,o);case 10:return I.visitAnimateRef(i,o);case 11:return I.visitQuery(i,o);case 12:return I.visitStagger(i,o);default:throw function ne(I){return new A.vHH(3004,!1)}()}}function ri(I,i){return window.getComputedStyle(I)[i]}function hi(I,i){const o=[];return"string"==typeof I?I.split(/\s*,\s*/).forEach(l=>function Vs(I,i,o){if(":"==I[0]){const $=function Gi(I,i){switch(I){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(o,l)=>parseFloat(l)>parseFloat(o);case":decrement":return(o,l)=>parseFloat(l)<parseFloat(o);default:return i.push(function Xe(I){return new A.vHH(3016,!1)}()),"* => *"}}(I,o);if("function"==typeof $)return void i.push($);I=$}const l=I.match(/^(\*|[-\w]+)\s*(<?[=-]>)\s*(\*|[-\w]+)$/);if(null==l||l.length<4)return o.push(function Ie(I){return new A.vHH(3015,!1)}()),i;const d=l[1],h=l[2],b=l[3];i.push($i(d,b));"<"==h[0]&&!("*"==d&&"*"==b)&&i.push($i(b,d))}(l,o,i)):o.push(I),o}const Xn=new Set(["true","1"]),as=new Set(["false","0"]);function $i(I,i){const o=Xn.has(I)||as.has(I),l=Xn.has(i)||as.has(i);return(d,h)=>{let b="*"==I||I==d,O="*"==i||i==h;return!b&&o&&"boolean"==typeof d&&(b=d?Xn.has(I):as.has(I)),!O&&l&&"boolean"==typeof h&&(O=h?Xn.has(i):as.has(i)),b&&O}}const qs=new RegExp("s*:selfs*,?","g");function Li(I,i,o,l){return new pi(I).build(i,o,l)}class pi{constructor(i){this._driver=i}build(i,o,l){const d=new Vr(o);return this._resetContextStyleTimingState(d),Vn(this,Cr(i),d)}_resetContextStyleTimingState(i){i.currentQuerySelector="",i.collectedStyles=new Map,i.collectedStyles.set("",new Map),i.currentTime=0}visitTrigger(i,o){let l=o.queryCount=0,d=o.depCount=0;const h=[],b=[];return"@"==i.name.charAt(0)&&o.errors.push(function ee(){return new A.vHH(3006,!1)}()),i.definitions.forEach(O=>{if(this._resetContextStyleTimingState(o),0==O.type){const $=O,Z=$.name;Z.toString().split(/\s*,\s*/).forEach(Ke=>{$.name=Ke,h.push(this.visitState($,o))}),$.name=Z}else if(1==O.type){const $=this.visitTransition(O,o);l+=$.queryCount,d+=$.depCount,b.push($)}else o.errors.push(function He(){return new A.vHH(3007,!1)}())}),{type:7,name:i.name,states:h,transitions:b,queryCount:l,depCount:d,options:null}}visitState(i,o){const l=this.visitStyle(i.styles,o),d=i.options&&i.options.params||null;if(l.containsDynamicStyles){const h=new Set,b=d||{};l.styles.forEach(O=>{O instanceof Map&&O.forEach($=>{fe($).forEach(Z=>{b.hasOwnProperty(Z)||h.add(Z)})})}),h.size&&(q(h.values()),o.errors.push(function nt(I,i){return new A.vHH(3008,!1)}()))}return{type:0,name:i.name,style:l,options:d?{params:d}:null}}visitTransition(i,o){o.queryCount=0,o.depCount=0;const l=Vn(this,Cr(i.animation),o);return{type:1,matchers:hi(i.expr,o.errors),animation:l,queryCount:o.queryCount,depCount:o.depCount,options:Tr(i.options)}}visitSequence(i,o){return{type:2,steps:i.steps.map(l=>Vn(this,l,o)),options:Tr(i.options)}}visitGroup(i,o){const l=o.currentTime;let d=0;const h=i.steps.map(b=>{o.currentTime=l;const O=Vn(this,b,o);return d=Math.max(d,o.currentTime),O});return o.currentTime=d,{type:3,steps:h,options:Tr(i.options)}}visitAnimate(i,o){const l=function js(I,i){if(I.hasOwnProperty("duration"))return I;if("number"==typeof I)return Ki(de(I,i).duration,0,"");const o=I;if(o.split(/\s+/).some(h=>"{"==h.charAt(0)&&"{"==h.charAt(1))){const h=Ki(0,0,"");return h.dynamic=!0,h.strValue=o,h}const d=de(o,i);return Ki(d.duration,d.delay,d.easing)}(i.timings,o.errors);o.currentAnimateTimings=l;let d,h=i.styles?i.styles:(0,k.oB)({});if(5==h.type)d=this.visitKeyframes(h,o);else{let b=i.styles,O=!1;if(!b){O=!0;const Z={};l.easing&&(Z.easing=l.easing),b=(0,k.oB)(Z)}o.currentTime+=l.duration+l.delay;const $=this.visitStyle(b,o);$.isEmptyStep=O,d=$}return o.currentAnimateTimings=null,{type:4,timings:l,style:d,options:null}}visitStyle(i,o){const l=this._makeStyleAst(i,o);return this._validateStyleAst(l,o),l}_makeStyleAst(i,o){const l=[],d=Array.isArray(i.styles)?i.styles:[i.styles];for(let O of d)"string"==typeof O?O===k.l3?l.push(O):o.errors.push(new A.vHH(3002,!1)):l.push(tt(O));let h=!1,b=null;return l.forEach(O=>{if(O instanceof Map&&(O.has("easing")&&(b=O.get("easing"),O.delete("easing")),!h))for(let $ of O.values())if($.toString().indexOf("{{")>=0){h=!0;break}}),{type:6,styles:l,easing:b,offset:i.offset,containsDynamicStyles:h,options:null}}_validateStyleAst(i,o){const l=o.currentAnimateTimings;let d=o.currentTime,h=o.currentTime;l&&h>0&&(h-=l.duration+l.delay),i.styles.forEach(b=>{"string"!=typeof b&&b.forEach((O,$)=>{const Z=o.collectedStyles.get(o.currentQuerySelector),Ke=Z.get($);let yt=!0;Ke&&(h!=d&&h>=Ke.startTime&&d<=Ke.endTime&&(o.errors.push(function Ee(I,i,o,l,d){return new A.vHH(3010,!1)}()),yt=!1),h=Ke.startTime),yt&&Z.set($,{startTime:h,endTime:d}),o.options&&function Pr(I,i,o){const l=i.params||{},d=fe(I);d.length&&d.forEach(h=>{l.hasOwnProperty(h)||o.push(function Y(I){return new A.vHH(3001,!1)}())})}(O,o.options,o.errors)})})}visitKeyframes(i,o){const l={type:5,styles:[],options:null};if(!o.currentAnimateTimings)return o.errors.push(function it(){return new A.vHH(3011,!1)}()),l;let h=0;const b=[];let O=!1,$=!1,Z=0;const Ke=i.steps.map(Wn=>{const Or=this._makeStyleAst(Wn,o);let br=null!=Or.offset?Or.offset:function gi(I){if("string"==typeof I)return null;let i=null;if(Array.isArray(I))I.forEach(o=>{if(o instanceof Map&&o.has("offset")){const l=o;i=parseFloat(l.get("offset")),l.delete("offset")}});else if(I instanceof Map&&I.has("offset")){const o=I;i=parseFloat(o.get("offset")),o.delete("offset")}return i}(Or.styles),wr=0;return null!=br&&(h++,wr=Or.offset=br),$=$||wr<0||wr>1,O=O||wr<Z,Z=wr,b.push(wr),Or});$&&o.errors.push(function Ft(){return new A.vHH(3012,!1)}()),O&&o.errors.push(function Ce(){return new A.vHH(3200,!1)}());const yt=i.steps.length;let bt=0;h>0&&h<yt?o.errors.push(function qe(){return new A.vHH(3202,!1)}()):0==h&&(bt=1/(yt-1));const Ut=yt-1,Xt=o.currentTime,cn=o.currentAnimateTimings,jn=cn.duration;return Ke.forEach((Wn,Or)=>{const br=bt>0?Or==Ut?1:bt*Or:b[Or],wr=br*jn;o.currentTime=Xt+cn.delay+wr,cn.duration=wr,this._validateStyleAst(Wn,o),Wn.offset=br,l.styles.push(Wn)}),l}visitReference(i,o){return{type:8,animation:Vn(this,Cr(i.animation),o),options:Tr(i.options)}}visitAnimateChild(i,o){return o.depCount++,{type:9,options:Tr(i.options)}}visitAnimateRef(i,o){return{type:10,animation:this.visitReference(i.animation,o),options:Tr(i.options)}}visitQuery(i,o){const l=o.currentQuerySelector,d=i.options||{};o.queryCount++,o.currentQuery=i;const[h,b]=function nr(I){const i=!!I.split(/\s*,\s*/).find(o=>":self"==o);return i&&(I=I.replace(qs,"")),I=I.replace(/@\*/g,Cn).replace(/@\w+/g,o=>Cn+"-"+o.slice(1)).replace(/:animating/g,Se),[I,i]}(i.selector);o.currentQuerySelector=l.length?l+" "+h:h,ln(o.collectedStyles,o.currentQuerySelector,new Map);const O=Vn(this,Cr(i.animation),o);return o.currentQuery=null,o.currentQuerySelector=l,{type:11,selector:h,limit:d.limit||0,optional:!!d.optional,includeSelf:b,animation:O,originalSelector:i.selector,options:Tr(i.options)}}visitStagger(i,o){o.currentQuery||o.errors.push(function le(){return new A.vHH(3013,!1)}());const l="full"===i.timings?{duration:0,delay:0,easing:"full"}:de(i.timings,o.errors,!0);return{type:12,animation:Vn(this,Cr(i.animation),o),timings:l,options:null}}}class Vr{constructor(i){this.errors=i,this.queryCount=0,this.depCount=0,this.currentTransition=null,this.currentQuery=null,this.currentQuerySelector=null,this.currentAnimateTimings=null,this.currentTime=0,this.collectedStyles=new Map,this.options=null,this.unsupportedCSSPropertiesFound=new Set}}function Tr(I){return I?(I=Oe(I)).params&&(I.params=function ws(I){return I?Oe(I):null}(I.params)):I={},I}function Ki(I,i,o){return{duration:I,delay:i,easing:o}}function mi(I,i,o,l,d,h,b=null,O=!1){return{type:1,element:I,keyframes:i,preStyleProps:o,postStyleProps:l,duration:d,delay:h,totalTime:d+h,easing:b,subTimeline:O}}class Js{constructor(){this._map=new Map}get(i){return this._map.get(i)||[]}append(i,o){let l=this._map.get(i);l||this._map.set(i,l=[]),l.push(...o)}has(i){return this._map.has(i)}clear(){this._map.clear()}}const wa=new RegExp(":enter","g"),Fi=new RegExp(":leave","g");function yr(I,i,o,l,d,h=new Map,b=new Map,O,$,Z=[]){return(new Sa).buildKeyframes(I,i,o,l,d,h,b,O,$,Z)}class Sa{buildKeyframes(i,o,l,d,h,b,O,$,Z,Ke=[]){Z=Z||new Js;const yt=new eo(i,o,Z,d,h,Ke,[]);yt.options=$;const bt=$.delay?we($.delay):0;yt.currentTimeline.delayNextStep(bt),yt.currentTimeline.setStyles([b],null,yt.errors,$),Vn(this,l,yt);const Ut=yt.timelines.filter(Xt=>Xt.containsAnimation());if(Ut.length&&O.size){let Xt;for(let cn=Ut.length-1;cn>=0;cn--){const jn=Ut[cn];if(jn.element===o){Xt=jn;break}}Xt&&!Xt.allowOnlyTimelineStyles()&&Xt.setStyles([O],null,yt.errors,$)}return Ut.length?Ut.map(Xt=>Xt.buildKeyframes()):[mi(o,[],[],[],0,bt,"",!1)]}visitTrigger(i,o){}visitState(i,o){}visitTransition(i,o){}visitAnimateChild(i,o){const l=o.subInstructions.get(o.element);if(l){const d=o.createSubContext(i.options),h=o.currentTimeline.currentTime,b=this._visitSubInstructions(l,d,d.options);h!=b&&o.transformIntoNewTimeline(b)}o.previousNode=i}visitAnimateRef(i,o){const l=o.createSubContext(i.options);l.transformIntoNewTimeline(),this._applyAnimationRefDelays([i.options,i.animation.options],o,l),this.visitReference(i.animation,l),o.transformIntoNewTimeline(l.currentTimeline.currentTime),o.previousNode=i}_applyAnimationRefDelays(i,o,l){for(const d of i){const h=d?.delay;if(h){const b="number"==typeof h?h:we(pe(h,d?.params??{},o.errors));l.delayNextStep(b)}}}_visitSubInstructions(i,o,l){let h=o.currentTimeline.currentTime;const b=null!=l.duration?we(l.duration):null,O=null!=l.delay?we(l.delay):null;return 0!==b&&i.forEach($=>{const Z=o.appendInstructionToTimeline($,b,O);h=Math.max(h,Z.duration+Z.delay)}),h}visitReference(i,o){o.updateOptions(i.options,!0),Vn(this,i.animation,o),o.previousNode=i}visitSequence(i,o){const l=o.subContextCount;let d=o;const h=i.options;if(h&&(h.params||h.delay)&&(d=o.createSubContext(h),d.transformIntoNewTimeline(),null!=h.delay)){6==d.previousNode.type&&(d.currentTimeline.snapshotCurrentStyles(),d.previousNode=Ss);const b=we(h.delay);d.delayNextStep(b)}i.steps.length&&(i.steps.forEach(b=>Vn(this,b,d)),d.currentTimeline.applyStylesToKeyframe(),d.subContextCount>l&&d.transformIntoNewTimeline()),o.previousNode=i}visitGroup(i,o){const l=[];let d=o.currentTimeline.currentTime;const h=i.options&&i.options.delay?we(i.options.delay):0;i.steps.forEach(b=>{const O=o.createSubContext(i.options);h&&O.delayNextStep(h),Vn(this,b,O),d=Math.max(d,O.currentTimeline.currentTime),l.push(O.currentTimeline)}),l.forEach(b=>o.currentTimeline.mergeTimelineCollectedStyles(b)),o.transformIntoNewTimeline(d),o.previousNode=i}_visitTiming(i,o){if(i.dynamic){const l=i.strValue;return de(o.params?pe(l,o.params,o.errors):l,o.errors)}return{duration:i.duration,delay:i.delay,easing:i.easing}}visitAnimate(i,o){const l=o.currentAnimateTimings=this._visitTiming(i.timings,o),d=o.currentTimeline;l.delay&&(o.incrementTime(l.delay),d.snapshotCurrentStyles());const h=i.style;5==h.type?this.visitKeyframes(h,o):(o.incrementTime(l.duration),this.visitStyle(h,o),d.applyStylesToKeyframe()),o.currentAnimateTimings=null,o.previousNode=i}visitStyle(i,o){const l=o.currentTimeline,d=o.currentAnimateTimings;!d&&l.hasCurrentStyleProperties()&&l.forwardFrame();const h=d&&d.easing||i.easing;i.isEmptyStep?l.applyEmptyStep(h):l.setStyles(i.styles,h,o.errors,o.options),o.previousNode=i}visitKeyframes(i,o){const l=o.currentAnimateTimings,d=o.currentTimeline.duration,h=l.duration,O=o.createSubContext().currentTimeline;O.easing=l.easing,i.styles.forEach($=>{O.forwardTime(($.offset||0)*h),O.setStyles($.styles,$.easing,o.errors,o.options),O.applyStylesToKeyframe()}),o.currentTimeline.mergeTimelineCollectedStyles(O),o.transformIntoNewTimeline(d+h),o.previousNode=i}visitQuery(i,o){const l=o.currentTimeline.currentTime,d=i.options||{},h=d.delay?we(d.delay):0;h&&(6===o.previousNode.type||0==l&&o.currentTimeline.hasCurrentStyleProperties())&&(o.currentTimeline.snapshotCurrentStyles(),o.previousNode=Ss);let b=l;const O=o.invokeQuery(i.selector,i.originalSelector,i.limit,i.includeSelf,!!d.optional,o.errors);o.currentQueryTotal=O.length;let $=null;O.forEach((Z,Ke)=>{o.currentQueryIndex=Ke;const yt=o.createSubContext(i.options,Z);h&&yt.delayNextStep(h),Z===o.element&&($=yt.currentTimeline),Vn(this,i.animation,yt),yt.currentTimeline.applyStylesToKeyframe(),b=Math.max(b,yt.currentTimeline.currentTime)}),o.currentQueryIndex=0,o.currentQueryTotal=0,o.transformIntoNewTimeline(b),$&&(o.currentTimeline.mergeTimelineCollectedStyles($),o.currentTimeline.snapshotCurrentStyles()),o.previousNode=i}visitStagger(i,o){const l=o.parentContext,d=o.currentTimeline,h=i.timings,b=Math.abs(h.duration),O=b*(o.currentQueryTotal-1);let $=b*o.currentQueryIndex;switch(h.duration<0?"reverse":h.easing){case"reverse":$=O-$;break;case"full":$=l.currentStaggerTime}const Ke=o.currentTimeline;$&&Ke.delayNextStep($);const yt=Ke.currentTime;Vn(this,i.animation,o),o.previousNode=i,l.currentStaggerTime=d.currentTime-yt+(d.startTime-l.currentTimeline.startTime)}}const Ss={};class eo{constructor(i,o,l,d,h,b,O,$){this._driver=i,this.element=o,this.subInstructions=l,this._enterClassName=d,this._leaveClassName=h,this.errors=b,this.timelines=O,this.parentContext=null,this.currentAnimateTimings=null,this.previousNode=Ss,this.subContextCount=0,this.options={},this.currentQueryIndex=0,this.currentQueryTotal=0,this.currentStaggerTime=0,this.currentTimeline=$||new ki(this._driver,o,0),O.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(i,o){if(!i)return;const l=i;let d=this.options;null!=l.duration&&(d.duration=we(l.duration)),null!=l.delay&&(d.delay=we(l.delay));const h=l.params;if(h){let b=d.params;b||(b=this.options.params={}),Object.keys(h).forEach(O=>{(!o||!b.hasOwnProperty(O))&&(b[O]=pe(h[O],b,this.errors))})}}_copyOptions(){const i={};if(this.options){const o=this.options.params;if(o){const l=i.params={};Object.keys(o).forEach(d=>{l[d]=o[d]})}}return i}createSubContext(i=null,o,l){const d=o||this.element,h=new eo(this._driver,d,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(d,l||0));return h.previousNode=this.previousNode,h.currentAnimateTimings=this.currentAnimateTimings,h.options=this._copyOptions(),h.updateOptions(i),h.currentQueryIndex=this.currentQueryIndex,h.currentQueryTotal=this.currentQueryTotal,h.parentContext=this,this.subContextCount++,h}transformIntoNewTimeline(i){return this.previousNode=Ss,this.currentTimeline=this.currentTimeline.fork(this.element,i),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(i,o,l){const d={duration:o??i.duration,delay:this.currentTimeline.currentTime+(l??0)+i.delay,easing:""},h=new Mi(this._driver,i.element,i.keyframes,i.preStyleProps,i.postStyleProps,d,i.stretchStartingKeyframe);return this.timelines.push(h),d}incrementTime(i){this.currentTimeline.forwardTime(this.currentTimeline.duration+i)}delayNextStep(i){i>0&&this.currentTimeline.delayNextStep(i)}invokeQuery(i,o,l,d,h,b){let O=[];if(d&&O.push(this.element),i.length>0){i=(i=i.replace(wa,"."+this._enterClassName)).replace(Fi,"."+this._leaveClassName);let Z=this._driver.query(this.element,i,1!=l);0!==l&&(Z=l<0?Z.slice(Z.length+l,Z.length):Z.slice(0,l)),O.push(...Z)}return!h&&0==O.length&&b.push(function ke(I){return new A.vHH(3014,!1)}()),O}}class ki{constructor(i,o,l,d){this._driver=i,this.element=o,this.startTime=l,this._elementTimelineStylesLookup=d,this.duration=0,this._previousKeyframe=new Map,this._currentKeyframe=new Map,this._keyframes=new Map,this._styleSummary=new Map,this._localTimelineStyles=new Map,this._pendingStyles=new Map,this._backFill=new Map,this._currentEmptyStepKeyframe=null,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(o),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(o,this._localTimelineStyles)),this._loadKeyframe()}containsAnimation(){switch(this._keyframes.size){case 0:return!1;case 1:return this.hasCurrentStyleProperties();default:return!0}}hasCurrentStyleProperties(){return this._currentKeyframe.size>0}get currentTime(){return this.startTime+this.duration}delayNextStep(i){const o=1===this._keyframes.size&&this._pendingStyles.size;this.duration||o?(this.forwardTime(this.currentTime+i),o&&this.snapshotCurrentStyles()):this.startTime+=i}fork(i,o){return this.applyStylesToKeyframe(),new ki(this._driver,i,o||this.currentTime,this._elementTimelineStylesLookup)}_loadKeyframe(){this._currentKeyframe&&(this._previousKeyframe=this._currentKeyframe),this._currentKeyframe=this._keyframes.get(this.duration),this._currentKeyframe||(this._currentKeyframe=new Map,this._keyframes.set(this.duration,this._currentKeyframe))}forwardFrame(){this.duration+=1,this._loadKeyframe()}forwardTime(i){this.applyStylesToKeyframe(),this.duration=i,this._loadKeyframe()}_updateStyle(i,o){this._localTimelineStyles.set(i,o),this._globalTimelineStyles.set(i,o),this._styleSummary.set(i,{time:this.currentTime,value:o})}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(i){i&&this._previousKeyframe.set("easing",i);for(let[o,l]of this._globalTimelineStyles)this._backFill.set(o,l||k.l3),this._currentKeyframe.set(o,k.l3);this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(i,o,l,d){o&&this._previousKeyframe.set("easing",o);const h=d&&d.params||{},b=function Ao(I,i){const o=new Map;let l;return I.forEach(d=>{if("*"===d){l=l||i.keys();for(let h of l)o.set(h,k.l3)}else xn(d,o)}),o}(i,this._globalTimelineStyles);for(let[O,$]of b){const Z=pe($,h,l);this._pendingStyles.set(O,Z),this._localTimelineStyles.has(O)||this._backFill.set(O,this._globalTimelineStyles.get(O)??k.l3),this._updateStyle(O,Z)}}applyStylesToKeyframe(){0!=this._pendingStyles.size&&(this._pendingStyles.forEach((i,o)=>{this._currentKeyframe.set(o,i)}),this._pendingStyles.clear(),this._localTimelineStyles.forEach((i,o)=>{this._currentKeyframe.has(o)||this._currentKeyframe.set(o,i)}))}snapshotCurrentStyles(){for(let[i,o]of this._localTimelineStyles)this._pendingStyles.set(i,o),this._updateStyle(i,o)}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){const i=[];for(let o in this._currentKeyframe)i.push(o);return i}mergeTimelineCollectedStyles(i){i._styleSummary.forEach((o,l)=>{const d=this._styleSummary.get(l);(!d||o.time>d.time)&&this._updateStyle(l,o.value)})}buildKeyframes(){this.applyStylesToKeyframe();const i=new Set,o=new Set,l=1===this._keyframes.size&&0===this.duration;let d=[];this._keyframes.forEach((O,$)=>{const Z=xn(O,new Map,this._backFill);Z.forEach((Ke,yt)=>{Ke===k.k1?i.add(yt):Ke===k.l3&&o.add(yt)}),l||Z.set("offset",$/this.duration),d.push(Z)});const h=i.size?q(i.values()):[],b=o.size?q(o.values()):[];if(l){const O=d[0],$=new Map(O);O.set("offset",0),$.set("offset",1),d=[O,$]}return mi(this.element,d,h,b,this.duration,this.startTime,this.easing,!1)}}class Mi extends ki{constructor(i,o,l,d,h,b,O=!1){super(i,o,b.delay),this.keyframes=l,this.preStyleProps=d,this.postStyleProps=h,this._stretchStartingKeyframe=O,this.timings={duration:b.duration,delay:b.delay,easing:b.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let i=this.keyframes,{delay:o,duration:l,easing:d}=this.timings;if(this._stretchStartingKeyframe&&o){const h=[],b=l+o,O=o/b,$=xn(i[0]);$.set("offset",0),h.push($);const Z=xn(i[0]);Z.set("offset",ls(O)),h.push(Z);const Ke=i.length-1;for(let yt=1;yt<=Ke;yt++){let bt=xn(i[yt]);const Ut=bt.get("offset");bt.set("offset",ls((o+Ut*l)/b)),h.push(bt)}l=b,o=0,d="",i=h}return mi(this.element,i,this.preStyleProps,this.postStyleProps,l,o,d,!0)}}function ls(I,i=3){const o=Math.pow(10,i-1);return Math.round(I*o)/o}class to{}const Ma=new Set(["width","height","minWidth","minHeight","maxWidth","maxHeight","left","top","bottom","right","fontSize","outlineWidth","outlineOffset","paddingTop","paddingLeft","paddingBottom","paddingRight","marginTop","marginLeft","marginBottom","marginRight","borderRadius","borderWidth","borderTopWidth","borderLeftWidth","borderRightWidth","borderBottomWidth","textIndent","perspective"]);class no extends to{normalizePropertyName(i,o){return Dt(i)}normalizeStyleValue(i,o,l,d){let h="";const b=l.toString().trim();if(Ma.has(o)&&0!==l&&"0"!==l)if("number"==typeof l)h="px";else{const O=l.match(/^[+-]?[\d\.]+([a-z]*)$/);O&&0==O[1].length&&d.push(function se(I,i){return new A.vHH(3005,!1)}())}return b+h}}function cs(I,i,o,l,d,h,b,O,$,Z,Ke,yt,bt){return{type:0,element:I,triggerName:i,isRemovalTransition:d,fromState:o,fromStyles:h,toState:l,toStyles:b,timelines:O,queriedElements:$,preStyleProps:Z,postStyleProps:Ke,totalTime:yt,errors:bt}}const Hs={};class ta{constructor(i,o,l){this._triggerName=i,this.ast=o,this._stateStyles=l}match(i,o,l,d){return function vi(I,i,o,l,d){return I.some(h=>h(i,o,l,d))}(this.ast.matchers,i,o,l,d)}buildStyles(i,o,l){let d=this._stateStyles.get("*");return void 0!==i&&(d=this._stateStyles.get(i?.toString())||d),d?d.buildStyles(o,l):new Map}build(i,o,l,d,h,b,O,$,Z,Ke){const yt=[],bt=this.ast.options&&this.ast.options.params||Hs,Xt=this.buildStyles(l,O&&O.params||Hs,yt),cn=$&&$.params||Hs,jn=this.buildStyles(d,cn,yt),Wn=new Set,Or=new Map,br=new Map,wr="void"===d,Oi={params:io(cn,bt),delay:this.ast.options?.delay},Br=Ke?[]:yr(i,o,this.ast.animation,h,b,Xt,jn,Oi,Z,yt);let Zr=0;if(Br.forEach(ys=>{Zr=Math.max(ys.duration+ys.delay,Zr)}),yt.length)return cs(o,this._triggerName,l,d,wr,Xt,jn,[],[],Or,br,Zr,yt);Br.forEach(ys=>{const bi=ys.element,Il=ln(Or,bi,new Set);ys.preStyleProps.forEach(Ns=>Il.add(Ns));const Na=ln(br,bi,new Set);ys.postStyleProps.forEach(Ns=>Na.add(Ns)),bi!==o&&Wn.add(bi)});const ci=q(Wn.values());return cs(o,this._triggerName,l,d,wr,Xt,jn,Br,ci,Or,br,Zr)}}function io(I,i){const o=Oe(i);for(const l in I)I.hasOwnProperty(l)&&null!=I[l]&&(o[l]=I[l]);return o}class To{constructor(i,o,l){this.styles=i,this.defaultParams=o,this.normalizer=l}buildStyles(i,o){const l=new Map,d=Oe(this.defaultParams);return Object.keys(i).forEach(h=>{const b=i[h];null!==b&&(d[h]=b)}),this.styles.styles.forEach(h=>{"string"!=typeof h&&h.forEach((b,O)=>{b&&(b=pe(b,d,o));const $=this.normalizer.normalizePropertyName(O,o);b=this.normalizer.normalizeStyleValue(O,$,b,o),l.set($,b)})}),l}}class na{constructor(i,o,l){this.name=i,this.ast=o,this._normalizer=l,this.transitionFactories=[],this.states=new Map,o.states.forEach(d=>{this.states.set(d.name,new To(d.style,d.options&&d.options.params||{},l))}),so(this.states,"true","1"),so(this.states,"false","0"),o.transitions.forEach(d=>{this.transitionFactories.push(new ta(i,d,this.states))}),this.fallbackTransition=function ra(I,i,o){return new ta(I,{type:1,animation:{type:2,steps:[],options:null},matchers:[(b,O)=>!0],options:null,queryCount:0,depCount:0},i)}(i,this.states)}get containsQueries(){return this.ast.queryCount>0}matchTransition(i,o,l,d){return this.transitionFactories.find(b=>b.match(i,o,l,d))||null}matchStyles(i,o,l){return this.fallbackTransition.buildStyles(i,o,l)}}function so(I,i,o){I.has(i)?I.has(o)||I.set(o,I.get(i)):I.has(o)&&I.set(i,I.get(o))}const Aa=new Js;class Ta{constructor(i,o,l){this.bodyNode=i,this._driver=o,this._normalizer=l,this._animations=new Map,this._playersById=new Map,this.players=[]}register(i,o){const l=[],h=Li(this._driver,o,l,[]);if(l.length)throw function dt(I){return new A.vHH(3503,!1)}();this._animations.set(i,h)}_buildPlayer(i,o,l){const d=i.element,h=on(0,this._normalizer,0,i.keyframes,o,l);return this._driver.animate(d,h,i.duration,i.delay,i.easing,[],!0)}create(i,o,l={}){const d=[],h=this._animations.get(i);let b;const O=new Map;if(h?(b=yr(this._driver,o,h,Dn,yn,new Map,new Map,l,Aa,d),b.forEach(Ke=>{const yt=ln(O,Ke.element,new Map);Ke.postStyleProps.forEach(bt=>yt.set(bt,null))})):(d.push(function ze(){return new A.vHH(3300,!1)}()),b=[]),d.length)throw function en(I){return new A.vHH(3504,!1)}();O.forEach((Ke,yt)=>{Ke.forEach((bt,Ut)=>{Ke.set(Ut,this._driver.computeStyle(yt,Ut,k.l3))})});const Z=Ct(b.map(Ke=>{const yt=O.get(Ke.element);return this._buildPlayer(Ke,new Map,yt)}));return this._playersById.set(i,Z),Z.onDestroy(()=>this.destroy(i)),this.players.push(Z),Z}destroy(i){const o=this._getPlayer(i);o.destroy(),this._playersById.delete(i);const l=this.players.indexOf(o);l>=0&&this.players.splice(l,1)}_getPlayer(i){const o=this._playersById.get(i);if(!o)throw function En(I){return new A.vHH(3301,!1)}();return o}listen(i,o,l,d){const h=mn(o,"","","");return pn(this._getPlayer(i),l,h,d),()=>{}}command(i,o,l,d){if("register"==l)return void this.register(i,d[0]);if("create"==l)return void this.create(i,o,d[0]||{});const h=this._getPlayer(i);switch(l){case"play":h.play();break;case"pause":h.pause();break;case"reset":h.reset();break;case"restart":h.restart();break;case"finish":h.finish();break;case"init":h.init();break;case"setPosition":h.setPosition(parseFloat(d[0]));break;case"destroy":this.destroy(i)}}}const Ei="ng-animate-queued",ii="ng-animate-disabled",_l=[],El={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},fr={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},si="__ng_removed";class Ia{constructor(i,o=""){this.namespaceId=o;const l=i&&i.hasOwnProperty("value");if(this.value=function Xa(I){return I??null}(l?i.value:i),l){const h=Oe(i);delete h.value,this.options=h}else this.options={};this.options.params||(this.options.params={})}get params(){return this.options.params}absorbOptions(i){const o=i.params;if(o){const l=this.options.params;Object.keys(o).forEach(d=>{null==l[d]&&(l[d]=o[d])})}}}const ds="void",oi=new Ia(ds);class ia{constructor(i,o,l){this.id=i,this.hostElement=o,this._engine=l,this.players=[],this._triggers=new Map,this._queue=[],this._elementListeners=new Map,this._hostClassName="ng-tns-"+i,an(o,this._hostClassName)}listen(i,o,l,d){if(!this._triggers.has(o))throw function hn(I,i){return new A.vHH(3302,!1)}();if(null==l||0==l.length)throw function Lt(I){return new A.vHH(3303,!1)}();if(!function Di(I){return"start"==I||"done"==I}(l))throw function xt(I,i){return new A.vHH(3400,!1)}();const h=ln(this._elementListeners,i,[]),b={name:o,phase:l,callback:d};h.push(b);const O=ln(this._engine.statesByElement,i,new Map);return O.has(o)||(an(i,hr),an(i,hr+"-"+o),O.set(o,oi)),()=>{this._engine.afterFlush(()=>{const $=h.indexOf(b);$>=0&&h.splice($,1),this._triggers.has(o)||O.delete(o)})}}register(i,o){return!this._triggers.has(i)&&(this._triggers.set(i,o),!0)}_getTrigger(i){const o=this._triggers.get(i);if(!o)throw function kt(I){return new A.vHH(3401,!1)}();return o}trigger(i,o,l,d=!0){const h=this._getTrigger(o),b=new fs(this.id,o,i);let O=this._engine.statesByElement.get(i);O||(an(i,hr),an(i,hr+"-"+o),this._engine.statesByElement.set(i,O=new Map));let $=O.get(o);const Z=new Ia(l,this.id);if(!(l&&l.hasOwnProperty("value"))&&$&&Z.absorbOptions($.options),O.set(o,Z),$||($=oi),Z.value!==ds&&$.value===Z.value){if(!function Ws(I,i){const o=Object.keys(I),l=Object.keys(i);if(o.length!=l.length)return!1;for(let d=0;d<o.length;d++){const h=o[d];if(!i.hasOwnProperty(h)||I[h]!==i[h])return!1}return!0}($.params,Z.params)){const cn=[],jn=h.matchStyles($.value,$.params,cn),Wn=h.matchStyles(Z.value,Z.params,cn);cn.length?this._engine.reportError(cn):this._engine.afterFlush(()=>{ur(i,jn),lr(i,Wn)})}return}const bt=ln(this._engine.playersByElement,i,[]);bt.forEach(cn=>{cn.namespaceId==this.id&&cn.triggerName==o&&cn.queued&&cn.destroy()});let Ut=h.matchTransition($.value,Z.value,i,Z.params),Xt=!1;if(!Ut){if(!d)return;Ut=h.fallbackTransition,Xt=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:i,triggerName:o,transition:Ut,fromState:$,toState:Z,player:b,isFallbackTransition:Xt}),Xt||(an(i,Ei),b.onStart(()=>{hs(i,Ei)})),b.onDone(()=>{let cn=this.players.indexOf(b);cn>=0&&this.players.splice(cn,1);const jn=this._engine.playersByElement.get(i);if(jn){let Wn=jn.indexOf(b);Wn>=0&&jn.splice(Wn,1)}}),this.players.push(b),bt.push(b),b}deregister(i){this._triggers.delete(i),this._engine.statesByElement.forEach(o=>o.delete(i)),this._elementListeners.forEach((o,l)=>{this._elementListeners.set(l,o.filter(d=>d.name!=i))})}clearElementCache(i){this._engine.statesByElement.delete(i),this._elementListeners.delete(i);const o=this._engine.playersByElement.get(i);o&&(o.forEach(l=>l.destroy()),this._engine.playersByElement.delete(i))}_signalRemovalForInnerTriggers(i,o){const l=this._engine.driver.query(i,Cn,!0);l.forEach(d=>{if(d[si])return;const h=this._engine.fetchNamespacesByElement(d);h.size?h.forEach(b=>b.triggerLeaveAnimation(d,o,!1,!0)):this.clearElementCache(d)}),this._engine.afterFlushAnimationsDone(()=>l.forEach(d=>this.clearElementCache(d)))}triggerLeaveAnimation(i,o,l,d){const h=this._engine.statesByElement.get(i),b=new Map;if(h){const O=[];if(h.forEach(($,Z)=>{if(b.set(Z,$.value),this._triggers.has(Z)){const Ke=this.trigger(i,Z,ds,d);Ke&&O.push(Ke)}}),O.length)return this._engine.markElementAsRemoved(this.id,i,!0,o,b),l&&Ct(O).onDone(()=>this._engine.processLeaveNode(i)),!0}return!1}prepareLeaveAnimationListeners(i){const o=this._elementListeners.get(i),l=this._engine.statesByElement.get(i);if(o&&l){const d=new Set;o.forEach(h=>{const b=h.name;if(d.has(b))return;d.add(b);const $=this._triggers.get(b).fallbackTransition,Z=l.get(b)||oi,Ke=new Ia(ds),yt=new fs(this.id,b,i);this._engine.totalQueuedPlayers++,this._queue.push({element:i,triggerName:b,transition:$,fromState:Z,toState:Ke,player:yt,isFallbackTransition:!0})})}}removeNode(i,o){const l=this._engine;if(i.childElementCount&&this._signalRemovalForInnerTriggers(i,o),this.triggerLeaveAnimation(i,o,!0))return;let d=!1;if(l.totalAnimations){const h=l.players.length?l.playersByQueriedElement.get(i):[];if(h&&h.length)d=!0;else{let b=i;for(;b=b.parentNode;)if(l.statesByElement.get(b)){d=!0;break}}}if(this.prepareLeaveAnimationListeners(i),d)l.markElementAsRemoved(this.id,i,!1,o);else{const h=i[si];(!h||h===El)&&(l.afterFlush(()=>this.clearElementCache(i)),l.destroyInnerAnimations(i),l._onRemovalComplete(i,o))}}insertNode(i,o){an(i,this._hostClassName)}drainQueuedTransitions(i){const o=[];return this._queue.forEach(l=>{const d=l.player;if(d.destroyed)return;const h=l.element,b=this._elementListeners.get(h);b&&b.forEach(O=>{if(O.name==l.triggerName){const $=mn(h,l.triggerName,l.fromState.value,l.toState.value);$._data=i,pn(l.player,O.phase,$,O.callback)}}),d.markedForDestroy?this._engine.afterFlush(()=>{d.destroy()}):o.push(l)}),this._queue=[],o.sort((l,d)=>{const h=l.transition.ast.depCount,b=d.transition.ast.depCount;return 0==h||0==b?h-b:this._engine.driver.containsElement(l.element,d.element)?1:-1})}destroy(i){this.players.forEach(o=>o.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,i)}elementContainsData(i){let o=!1;return this._elementListeners.has(i)&&(o=!0),o=!!this._queue.find(l=>l.element===i)||o,o}}class ao{constructor(i,o,l){this.bodyNode=i,this.driver=o,this._normalizer=l,this.players=[],this.newHostElements=new Map,this.playersByElement=new Map,this.playersByQueriedElement=new Map,this.statesByElement=new Map,this.disabledNodes=new Set,this.totalAnimations=0,this.totalQueuedPlayers=0,this._namespaceLookup={},this._namespaceList=[],this._flushFns=[],this._whenQuietFns=[],this.namespacesByHostElement=new Map,this.collectedEnterElements=[],this.collectedLeaveElements=[],this.onRemovalComplete=(d,h)=>{}}_onRemovalComplete(i,o){this.onRemovalComplete(i,o)}get queuedPlayers(){const i=[];return this._namespaceList.forEach(o=>{o.players.forEach(l=>{l.queued&&i.push(l)})}),i}createNamespace(i,o){const l=new ia(i,o,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,o)?this._balanceNamespaceList(l,o):(this.newHostElements.set(o,l),this.collectEnterElement(o)),this._namespaceLookup[i]=l}_balanceNamespaceList(i,o){const l=this._namespaceList,d=this.namespacesByHostElement;if(l.length-1>=0){let b=!1,O=this.driver.getParentElement(o);for(;O;){const $=d.get(O);if($){const Z=l.indexOf($);l.splice(Z+1,0,i),b=!0;break}O=this.driver.getParentElement(O)}b||l.unshift(i)}else l.push(i);return d.set(o,i),i}register(i,o){let l=this._namespaceLookup[i];return l||(l=this.createNamespace(i,o)),l}registerTrigger(i,o,l){let d=this._namespaceLookup[i];d&&d.register(o,l)&&this.totalAnimations++}destroy(i,o){if(!i)return;const l=this._fetchNamespace(i);this.afterFlush(()=>{this.namespacesByHostElement.delete(l.hostElement),delete this._namespaceLookup[i];const d=this._namespaceList.indexOf(l);d>=0&&this._namespaceList.splice(d,1)}),this.afterFlushAnimationsDone(()=>l.destroy(o))}_fetchNamespace(i){return this._namespaceLookup[i]}fetchNamespacesByElement(i){const o=new Set,l=this.statesByElement.get(i);if(l)for(let d of l.values())if(d.namespaceId){const h=this._fetchNamespace(d.namespaceId);h&&o.add(h)}return o}trigger(i,o,l,d){if(yi(o)){const h=this._fetchNamespace(i);if(h)return h.trigger(o,l,d),!0}return!1}insertNode(i,o,l,d){if(!yi(o))return;const h=o[si];if(h&&h.setForRemoval){h.setForRemoval=!1,h.setForMove=!0;const b=this.collectedLeaveElements.indexOf(o);b>=0&&this.collectedLeaveElements.splice(b,1)}if(i){const b=this._fetchNamespace(i);b&&b.insertNode(o,l)}d&&this.collectEnterElement(o)}collectEnterElement(i){this.collectedEnterElements.push(i)}markElementAsDisabled(i,o){o?this.disabledNodes.has(i)||(this.disabledNodes.add(i),an(i,ii)):this.disabledNodes.has(i)&&(this.disabledNodes.delete(i),hs(i,ii))}removeNode(i,o,l,d){if(yi(o)){const h=i?this._fetchNamespace(i):null;if(h?h.removeNode(o,d):this.markElementAsRemoved(i,o,!1,d),l){const b=this.namespacesByHostElement.get(o);b&&b.id!==i&&b.removeNode(o,d)}}else this._onRemovalComplete(o,d)}markElementAsRemoved(i,o,l,d,h){this.collectedLeaveElements.push(o),o[si]={namespaceId:i,setForRemoval:d,hasAnimation:l,removedBeforeQueried:!1,previousTriggersValues:h}}listen(i,o,l,d,h){return yi(o)?this._fetchNamespace(i).listen(o,l,d,h):()=>{}}_buildInstruction(i,o,l,d,h){return i.transition.build(this.driver,i.element,i.fromState.value,i.toState.value,l,d,i.fromState.options,i.toState.options,o,h)}destroyInnerAnimations(i){let o=this.driver.query(i,Cn,!0);o.forEach(l=>this.destroyActiveAnimationsForElement(l)),0!=this.playersByQueriedElement.size&&(o=this.driver.query(i,Se,!0),o.forEach(l=>this.finishActiveQueriedAnimationOnElement(l)))}destroyActiveAnimationsForElement(i){const o=this.playersByElement.get(i);o&&o.forEach(l=>{l.queued?l.markedForDestroy=!0:l.destroy()})}finishActiveQueriedAnimationOnElement(i){const o=this.playersByQueriedElement.get(i);o&&o.forEach(l=>l.finish())}whenRenderingDone(){return new Promise(i=>{if(this.players.length)return Ct(this.players).onDone(()=>i());i()})}processLeaveNode(i){const o=i[si];if(o&&o.setForRemoval){if(i[si]=El,o.namespaceId){this.destroyInnerAnimations(i);const l=this._fetchNamespace(o.namespaceId);l&&l.clearElementCache(i)}this._onRemovalComplete(i,o.setForRemoval)}i.classList?.contains(ii)&&this.markElementAsDisabled(i,!1),this.driver.query(i,".ng-animate-disabled",!0).forEach(l=>{this.markElementAsDisabled(l,!1)})}flush(i=-1){let o=[];if(this.newHostElements.size&&(this.newHostElements.forEach((l,d)=>this._balanceNamespaceList(l,d)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let l=0;l<this.collectedEnterElements.length;l++)an(this.collectedEnterElements[l],"ng-star-inserted");if(this._namespaceList.length&&(this.totalQueuedPlayers||this.collectedLeaveElements.length)){const l=[];try{o=this._flushAnimations(l,i)}finally{for(let d=0;d<l.length;d++)l[d]()}}else for(let l=0;l<this.collectedLeaveElements.length;l++)this.processLeaveNode(this.collectedLeaveElements[l]);if(this.totalQueuedPlayers=0,this.collectedEnterElements.length=0,this.collectedLeaveElements.length=0,this._flushFns.forEach(l=>l()),this._flushFns=[],this._whenQuietFns.length){const l=this._whenQuietFns;this._whenQuietFns=[],o.length?Ct(o).onDone(()=>{l.forEach(d=>d())}):l.forEach(d=>d())}}reportError(i){throw function Je(I){return new A.vHH(3402,!1)}()}_flushAnimations(i,o){const l=new Js,d=[],h=new Map,b=[],O=new Map,$=new Map,Z=new Map,Ke=new Set;this.disabledNodes.forEach(Gt=>{Ke.add(Gt);const bn=this.driver.query(Gt,".ng-animate-queued",!0);for(let Sn=0;Sn<bn.length;Sn++)Ke.ad