homebridge-config-ui-x 5.12.1-alpha.1 → 5.12.1-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/public/{chunk-HGMPY62U.js → chunk-2AJXG25V.js} +1 -1
- package/public/{chunk-YQ3TDI7C.js → chunk-2ZAXV4YC.js} +1 -1
- package/public/{chunk-MEX6GNBR.js → chunk-3OHVXX6B.js} +1 -1
- package/public/{chunk-2OFBHOS4.js → chunk-4BEKQY2O.js} +1 -1
- package/public/{chunk-XOT3W4PF.js → chunk-4BWNO6KH.js} +1 -1
- package/public/{chunk-OBR76AWV.js → chunk-5DFV4KN6.js} +1 -1
- package/public/{chunk-YIUTOVQO.js → chunk-5E262IZY.js} +1 -1
- package/public/{chunk-NFQE76CE.js → chunk-5IJ7WJ7D.js} +1 -1
- package/public/{chunk-GP4KDKBH.js → chunk-AHMTEEWV.js} +1 -1
- package/public/{chunk-M2TL4QGG.js → chunk-AMA5KYHI.js} +1 -1
- package/public/{chunk-M62WKFKF.js → chunk-D7BCWWSP.js} +1 -1
- package/public/{chunk-VZNH7H6M.js → chunk-DXT7NLKJ.js} +1 -1
- package/public/{chunk-KILWF5J6.js → chunk-EMAIV5V4.js} +1 -1
- package/public/{chunk-PMANWQSB.js → chunk-EMTQLND2.js} +1 -1
- package/public/{chunk-E6HNGTLD.js → chunk-F3HXP7VF.js} +1 -1
- package/public/{chunk-V22CFYHU.js → chunk-FOCYUW3Q.js} +1 -1
- package/public/{chunk-SC5ZNCG5.js → chunk-FTKEUELX.js} +1 -1
- package/public/{chunk-UKZECEPF.js → chunk-H2SGUM2A.js} +1 -1
- package/public/{chunk-6NUTFCFF.js → chunk-HDGCOO6N.js} +1 -1
- package/public/{chunk-YA7H2FDZ.js → chunk-HWZEDUYR.js} +1 -1
- package/public/{chunk-ZIERYCMT.js → chunk-HYK7MYI4.js} +1 -1
- package/public/{chunk-3LSRPBCH.js → chunk-JMLLNMVV.js} +1 -1
- package/public/{chunk-RJA5DWXC.js → chunk-JTQUK76J.js} +1 -1
- package/public/{chunk-Q6DWCZZR.js → chunk-KZDX7DML.js} +1 -1
- package/public/{chunk-3V45R2IO.js → chunk-LP4J3P2M.js} +1 -1
- package/public/{chunk-HSDZKEAS.js → chunk-LY2WH7XJ.js} +1 -1
- package/public/{chunk-YAKM4NKJ.js → chunk-LYBXKFGZ.js} +1 -1
- package/public/{chunk-R75NMVH4.js → chunk-MWO4XHMK.js} +1 -1
- package/public/{chunk-LPWHUUMS.js → chunk-NPF6UAYU.js} +1 -1
- package/public/{chunk-PXA52XD6.js → chunk-OD5BLW73.js} +1 -1
- package/public/{chunk-DNCHN5MY.js → chunk-OKKX5II3.js} +1 -1
- package/public/{chunk-67NDBD3O.js → chunk-P5NUDX6Y.js} +1 -1
- package/public/{chunk-7X2JJHYE.js → chunk-PTJ2WHN2.js} +1 -1
- package/public/{chunk-L72SOSJN.js → chunk-PXX46N67.js} +1 -1
- package/public/{chunk-WNO2VXXQ.js → chunk-QAMTKHGP.js} +1 -1
- package/public/{chunk-WISMAU6J.js → chunk-QESYIXUR.js} +1 -1
- package/public/{chunk-JEQ5JQRP.js → chunk-QHBHZIPJ.js} +1 -1
- package/public/{chunk-3V7HHVHU.js → chunk-R4D64BTL.js} +1 -1
- package/public/{chunk-G67CSWKM.js → chunk-REAVFWBE.js} +1 -1
- package/public/{chunk-B2LQOEWE.js → chunk-SUZMQF44.js} +1 -1
- package/public/{chunk-QP2DYZ52.js → chunk-T5FIMD5K.js} +1 -1
- package/public/{chunk-ABYHZSIZ.js → chunk-TIVCIPD3.js} +1 -1
- package/public/{chunk-6ZIKRWSF.js → chunk-U3VPHA7X.js} +1 -1
- package/public/{chunk-POGEGLDZ.js → chunk-U5CDHG4J.js} +1 -1
- package/public/{chunk-HGLLMJ7J.js → chunk-U6OOUZY4.js} +1 -1
- package/public/{chunk-QHMT6OOY.js → chunk-UC6DGFOX.js} +1 -1
- package/public/{chunk-6F7FL4N2.js → chunk-ULHOVOCI.js} +1 -1
- package/public/{chunk-XZ4YGENI.js → chunk-ULIXJ6WW.js} +1 -1
- package/public/{chunk-TXQH2OVO.js → chunk-VWDC2WDK.js} +1 -1
- package/public/{chunk-GFIXJZEO.js → chunk-WPMAY5Z5.js} +1 -1
- package/public/{chunk-DPMCM3OO.js → chunk-XOZXUAP4.js} +1 -1
- package/public/{chunk-FVHWAEZA.js → chunk-YDZJF4EY.js} +1 -1
- package/public/{chunk-KSNKFFQP.js → chunk-ZHCPTG5R.js} +1 -1
- package/public/index.html +2 -2
- package/public/{main-HEICJNRU.js → main-XJKFV7IC.js} +1 -1
- package/public/{styles-IW6HR5PX.css → styles-FEDC3CMK.css} +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A,C as G,D as Q,c as $,d as C,e as B,f as O,g as T,j as w,m as q,q as z,r as D,y as H}from"./chunk-LZU5VVW4.js";import{b as K}from"./chunk-
|
|
1
|
+
import{A,C as G,D as Q,c as $,d as C,e as B,f as O,g as T,j as w,m as q,q as z,r as D,y as H}from"./chunk-LZU5VVW4.js";import{b as K}from"./chunk-D7BCWWSP.js";import{e as U}from"./chunk-O7FV4MLW.js";import{b as J}from"./chunk-U6OOUZY4.js";import{l as j,p as W}from"./chunk-VWDC2WDK.js";import{Ab as a,Bb as s,Ec as b,Gc as L,Na as x,Nb as E,Pb as M,R as I,Rc as N,Sa as i,Tc as V,Wb as v,Xb as F,ac as g,bc as h,bd as P,cc as R,fb as k,h as y,nc as f,pa as p,sb as u,tb as c,tc as l,uc as d,yb as m,z as S,zb as r}from"./chunk-UUXRTS4O.js";var Y=["password"],Z=["username"],ee=["otp"],te=e=>({background:e}),ie=e=>({anim:e}),X=e=>({"is-invalid":e});function ne(e,_){if(e&1&&(r(0,"div",8)(1,"span",12),s(2,"i",13),a(),s(3,"input",14,0),l(5,"translate"),a(),r(6,"div",8)(7,"span",12),s(8,"i",15),a(),s(9,"input",16,1),l(11,"translate"),a()),e&2){let n=M();i(3),m("placeholder",d(5,4,"users.label_username"))("ngClass",f(8,X,n.form.controls.username.dirty&&n.form.controls.username.errors)),i(6),m("placeholder",d(11,6,"users.label_password"))("ngClass",f(10,X,n.form.controls.password.dirty&&n.form.controls.password.errors))}}function oe(e,_){e&1&&(r(0,"div",8)(1,"span",12),s(2,"i",17),a(),s(3,"input",18,2),l(5,"translate"),a()),e&2&&(i(3),m("placeholder",d(5,1,"login.label_2fa_code")))}function ae(e,_){e&1&&(r(0,"div",9)(1,"div",12),s(2,"i",19),a(),r(3,"div",20)(4,"div",21),g(5),l(6,"translate"),a(),s(7,"div",22),l(8,"translate"),a()()),e&2&&(i(5),h(d(6,2,"login.invalid_credentials")),i(2),m("innerHTML",d(8,4,"login.invalid_credentials_2"),x))}function re(e,_){e&1&&(r(0,"div",9)(1,"div",12),s(2,"i",19),a(),r(3,"div",20)(4,"div",21),g(5),l(6,"translate"),a(),s(7,"div",22),l(8,"translate"),a()()),e&2&&(i(5),h(d(6,2,"login.invalid_code")),i(2),m("innerHTML",d(8,4,"login.invalid_credentials_2"),x))}var _e=(()=>{class e{$auth=p(K);$cdr=p(L);$router=p(U);$settings=p(J);targetRoute;validNonAdminRoutes=["/accessories","/plugins","/logs","/support"];passwordInput=b("password");usernameInput=b("username");otpInput=b("otp");backgroundStyle;invalidCredentials=!1;invalid2faCode=!1;twoFactorCodeRequired=!1;inProgress=!1;form;ngOnInit(){this.form=new T({username:new w(""),password:new w("")}),this.form.valueChanges.pipe(I(500)).subscribe(n=>{let o=this.passwordInput()?.nativeElement.value;o&&o!==n.password&&this.form.controls.password.setValue(o)}),this.targetRoute=window.sessionStorage.getItem("target_route")||"",this.setBackground()}ngAfterViewChecked(){this.$cdr.detectChanges()}onSubmit(){return y(this,null,function*(){this.invalidCredentials=!1,this.invalid2faCode=!1,this.inProgress=!0,document.getElementById("submit-button")?.blur();let n=this.passwordInput()?.nativeElement.value;n&&n!==this.form.get("password").value&&this.form.controls.password.setValue(n);let o=this.usernameInput()?.nativeElement.value;if(o&&o!==this.form.get("username").value&&this.form.controls.username.setValue(o),this.twoFactorCodeRequired){let t=this.otpInput()?.nativeElement.value;t&&t!==this.form.get("otp").value&&this.form.controls.username.setValue(t)}try{yield this.$auth.login(this.form.getRawValue()),!this.$auth.user.admin&&!this.validNonAdminRoutes.includes(this.targetRoute)&&(this.targetRoute="/"),this.$router.navigateByUrl(this.targetRoute),window.sessionStorage.removeItem("target_route")}catch(t){t.status===412?(this.form.controls.otp?(this.form.controls.otp.setErrors(["Invalid Code"]),this.invalid2faCode=!0):this.form.addControl("otp",new w("",[C.required,C.minLength(6),C.maxLength(6)])),this.twoFactorCodeRequired=!0,setTimeout(()=>{document.getElementById("form-ota").focus()},100)):this.invalidCredentials=!0}this.inProgress=!1})}setBackground(){return y(this,null,function*(){if(this.$settings.settingsLoaded||(yield S(this.$settings.onSettingsLoaded)),this.$settings.env.customWallpaperHash){let n=`${W.api.base}/auth/wallpaper/${this.$settings.env.customWallpaperHash}`;this.backgroundStyle=`url('${n}') center/cover`}})}static \u0275fac=function(o){return new(o||e)};static \u0275cmp=k({type:e,selectors:[["ng-component"]],viewQuery:function(o,t){o&1&&(v(t.passwordInput,Y,5),v(t.usernameInput,Z,5),v(t.otpInput,ee,5)),o&2&&F(3)},decls:15,vars:18,consts:[["username",""],["password",""],["otp",""],[1,"login-container","gradient","d-flex","align-items-start","justify-content-center",3,"ngStyle","ngClass"],[1,"w-100","login-card","d-flex","py-4","flex-column"],["ngSrc","assets/homebridge-color-round.svg","alt","Homebridge Logo","height","100","width","100","priority","true",1,"homebridge-logo","mx-auto","my-3"],["novalidate","",3,"ngSubmit","formGroup"],[1,"mb-4","text-center"],[1,"input-group","mb-4"],[1,"input-group","no-border","mb-4"],[1,"text-center"],["tabindex","3","id","submit-button","type","submit",1,"btn","btn-primary","mb-2",3,"disabled"],[1,"input-group-text","custom-input"],[1,"fas","fa-user","primary-text","fa-lg"],["formControlName","username","type","text","id","form-username","autofocus","","autocomplete","username","autocapitalize","none","tabindex","1","required","",1,"form-control","custom-input",3,"placeholder","ngClass"],[1,"fas","fa-lock","primary-text","fa-lg"],["formControlName","password","type","password","id","form-pass","autocomplete","current-password","tabindex","2","required","",1,"form-control","custom-input",3,"placeholder","ngClass"],[1,"fas","fa-key","primary-text","fa-lg"],["formControlName","otp","type","text","id","form-ota","autofocus","","autocomplete","one-time-code","autocapitalize","none","inputmode","numeric","pattern","[0-9]*","tabindex","1",1,"form-control","custom-input",3,"placeholder"],[1,"fas","fa-exclamation-triangle","pink-text","fa-lg"],[1,"form-control","custom-input"],[1,"small","grey-text","fw-semibold"],[1,"small","grey-text",3,"innerHTML"]],template:function(o,t){o&1&&(r(0,"div",3)(1,"div",4),s(2,"img",5),r(3,"form",6),E("ngSubmit",function(){return t.onSubmit()}),r(4,"h4",7),g(5),l(6,"translate"),a(),u(7,ne,12,12),u(8,oe,6,3,"div",8),u(9,ae,9,6,"div",9),u(10,re,9,6,"div",9),r(11,"div",10)(12,"button",11),g(13),l(14,"translate"),a()()()()()),o&2&&(m("ngStyle",f(14,te,t.backgroundStyle))("ngClass",f(16,ie,!t.backgroundStyle)),i(3),m("formGroup",t.form),i(2),h(d(6,10,"setup.welcome_to_homebridge")),i(2),c(t.twoFactorCodeRequired?-1:7),i(),c(t.twoFactorCodeRequired?8:-1),i(),c(t.invalidCredentials?9:-1),i(),c(t.invalid2faCode?10:-1),i(2),m("disabled",t.form.invalid),i(),R(" ",d(14,12,"form.button_continue")," "))},dependencies:[V,G,q,$,B,O,H,A,Q,z,D,N,P,j],styles:["body{overflow:scroll!important} body.dark-mode .login-card{background-color:#2b2b2b;color:#fff}.login-container[_ngcontent-%COMP%]{z-index:-1;padding-top:2em;padding-bottom:2em;min-height:100%;background-size:300% 300%}.anim[_ngcontent-%COMP%]{-webkit-animation:_ngcontent-%COMP%_gradient 20s ease infinite;-moz-animation:gradient 20s ease infinite;-o-animation:gradient 20s ease infinite;animation:_ngcontent-%COMP%_gradient 20s ease infinite}@keyframes _ngcontent-%COMP%_gradient{0%{background-position:0 50%}50%{background-position:100% 50%}to{background-position:0 50%}}.login-card[_ngcontent-%COMP%]{max-width:550px;border-radius:1rem;padding-right:25px;padding-left:25px;background-color:#ffffffe6}.login-card[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]:focus{background-color:inherit!important}@media screen and (max-width: 575px){.login-card[_ngcontent-%COMP%]{margin-left:1em;margin-right:1em}}.homebridge-logo[_ngcontent-%COMP%]{margin-bottom:10px}"]})}return e})();export{_e as LoginComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as $}from"./chunk-
|
|
1
|
+
import{b as $}from"./chunk-U6OOUZY4.js";import{p as h,q as S}from"./chunk-VWDC2WDK.js";import{A as k,C as w,F as T,gb as E,gd as j,h as a,ka as d,la as v,na as y,oa as l,pa as p,u as f,z as c,za as I}from"./chunk-UUXRTS4O.js";var g=new y("JWT_OPTIONS"),m=(()=>{class i{constructor(e=null){this.tokenGetter=e&&e.tokenGetter||function(){}}urlBase64Decode(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:{t+="==";break}case 3:{t+="=";break}default:throw new Error("Illegal base64url string!")}return this.b64DecodeUnicode(t)}b64decode(e){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",o="";if(e=String(e).replace(/=+$/,""),e.length%4===1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(let r=0,s,n,D=0;n=e.charAt(D++);~n&&(s=r%4?s*64+n:n,r++%4)?o+=String.fromCharCode(255&s>>(-2*r&6)):0)n=t.indexOf(n);return o}b64DecodeUnicode(e){return decodeURIComponent(Array.prototype.map.call(this.b64decode(e),t=>"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)).join(""))}decodeToken(e=this.tokenGetter()){return e instanceof Promise?e.then(t=>this._decodeToken(t)):this._decodeToken(e)}_decodeToken(e){if(!e||e==="")return null;let t=e.split(".");if(t.length!==3)throw new Error("The inspected token doesn't appear to be a JWT. Check to make sure it has three parts and see https://jwt.io for more.");let o=this.urlBase64Decode(t[1]);if(!o)throw new Error("Cannot decode the token.");return JSON.parse(o)}getTokenExpirationDate(e=this.tokenGetter()){return e instanceof Promise?e.then(t=>this._getTokenExpirationDate(t)):this._getTokenExpirationDate(e)}_getTokenExpirationDate(e){let t;if(t=this.decodeToken(e),!t||!t.hasOwnProperty("exp"))return null;let o=new Date(0);return o.setUTCSeconds(t.exp),o}isTokenExpired(e=this.tokenGetter(),t){return e instanceof Promise?e.then(o=>this._isTokenExpired(o,t)):this._isTokenExpired(e,t)}_isTokenExpired(e,t){if(!e||e==="")return!0;let o=this.getTokenExpirationDate(e);return t=t||0,o===null?!1:!(o.valueOf()>new Date().valueOf()+t*1e3)}getAuthScheme(e,t){return typeof e=="function"?e(t):e}}return i.\u0275fac=function(e){return new(e||i)(l(g))},i.\u0275prov=d({token:i,factory:i.\u0275fac}),i})(),x=i=>i instanceof Promise?T(()=>i):f(i),b=(()=>{class i{constructor(e,t,o){this.jwtHelper=t,this.document=o,this.standardPorts=["80","443"],this.tokenGetter=e.tokenGetter,this.headerName=e.headerName||"Authorization",this.authScheme=e.authScheme||e.authScheme===""?e.authScheme:"Bearer ",this.allowedDomains=e.allowedDomains||[],this.disallowedRoutes=e.disallowedRoutes||[],this.throwNoTokenError=e.throwNoTokenError||!1,this.skipWhenExpired=e.skipWhenExpired}isAllowedDomain(e){let t=new URL(e.url,this.document.location.origin);if(t.host===this.document.location.host)return!0;let o=`${t.hostname}${t.port&&!this.standardPorts.includes(t.port)?":"+t.port:""}`;return this.allowedDomains.findIndex(r=>typeof r=="string"?r===o:r instanceof RegExp?r.test(o):!1)>-1}isDisallowedRoute(e){let t=new URL(e.url,this.document.location.origin);return this.disallowedRoutes.findIndex(o=>{if(typeof o=="string"){let r=new URL(o,this.document.location.origin);return r.hostname===t.hostname&&r.pathname===t.pathname}return o instanceof RegExp?o.test(e.url):!1})>-1}handleInterception(e,t,o){let r=this.jwtHelper.getAuthScheme(this.authScheme,t);if(!e&&this.throwNoTokenError)throw new Error("Could not get token from tokenGetter function.");let s=f(!1);return this.skipWhenExpired&&(s=e?x(this.jwtHelper.isTokenExpired(e)):f(!0)),e?s.pipe(k(n=>n&&this.skipWhenExpired?t.clone():t.clone({setHeaders:{[this.headerName]:`${r}${e}`}})),w(n=>o.handle(n))):o.handle(t)}intercept(e,t){if(!this.isAllowedDomain(e)||this.isDisallowedRoute(e))return t.handle(e);let o=this.tokenGetter(e);return x(o).pipe(w(r=>this.handleInterception(r,e,t)))}}return i.\u0275fac=function(e){return new(e||i)(l(g),l(m),l(I))},i.\u0275prov=d({token:i,factory:i.\u0275fac}),i})(),U=(()=>{class i{constructor(e){if(e)throw new Error("JwtModule is already loaded. It should only be imported in your application's main module.")}static forRoot(e){return{ngModule:i,providers:[{provide:j,useClass:b,multi:!0},e.jwtOptionsProvider||{provide:g,useValue:e.config},m]}}}return i.\u0275fac=function(e){return new(e||i)(l(i,12))},i.\u0275mod=E({type:i}),i.\u0275inj=v({}),i})();var X=(()=>{class i{$api=p(S);$jwtHelper=p(m);$settings=p($);token;user={};logoutTimer;lastRefreshTime=Date.now();isRefreshing=!1;constructor(){this.loadToken()}login(e){return a(this,null,function*(){let t=yield c(this.$api.post("/auth/login",e));if(!this.validateToken(t.access_token))throw new Error("Invalid username or password.");window.localStorage.setItem(h.jwt.tokenKey,t.access_token),yield this.$settings.getAppSettings()})}noauth(){return a(this,null,function*(){let e=yield c(this.$api.post("/auth/noauth",{}));if(this.validateToken(e.access_token))window.localStorage.setItem(h.jwt.tokenKey,e.access_token),yield this.$settings.getAppSettings();else throw new Error("Invalid username or password.")})}logout(){this.user=null,this.token=null,clearTimeout(this.logoutTimer),window.localStorage.removeItem(h.jwt.tokenKey),window.location.reload()}loadToken(){return a(this,null,function*(){this.$settings.settingsLoaded||(yield c(this.$settings.onSettingsLoaded));let e=window.localStorage.getItem(h.jwt.tokenKey);e&&this.validateToken(e)})}checkToken(){return a(this,null,function*(){if(!this.token||this.$jwtHelper.isTokenExpired(this.token,this.$settings.serverTimeOffset)){console.warn("Token expired on client side, logging out immediately"),this.logout();return}try{return yield c(this.$api.get("/auth/check"))}catch(e){throw e.status===401&&(console.warn("Current token is not valid on server"),this.logout()),e}})}isLoggedIn(){return this.$settings.env.instanceId!==this.user.instanceId?(console.error("Token does not match instance"),!1):this.user&&this.token&&!this.$jwtHelper.isTokenExpired(this.token,this.$settings.serverTimeOffset)}validateToken(e){try{return this.$jwtHelper.isTokenExpired(e,this.$settings.serverTimeOffset)&&this.logout(),this.user=this.$jwtHelper.decodeToken(e),this.token=e,this.setLogoutTimer(),!0}catch{return window.localStorage.removeItem(h.jwt.tokenKey),this.token=null,!1}}setLogoutTimer(){if(clearTimeout(this.logoutTimer),!this.$jwtHelper.isTokenExpired(this.token,this.$settings.serverTimeOffset)){let e=this.$settings.sessionTimeout*1e3;e<=2147483647&&(this.logoutTimer=setTimeout(()=>a(this,null,function*(){this.$settings.formAuth===!1?(yield this.noauth(),window.location.reload()):this.logout()}),e))}}checkAndRefreshIfNeeded(){return a(this,null,function*(){if(!this.$settings.formAuth||!this.$settings.sessionTimeoutInactivityBased||!this.token||!this.isLoggedIn()||this.isRefreshing)return;let t=Date.now()-this.lastRefreshTime,r=this.$settings.sessionTimeout*1e3*.7;if(t>r)try{yield this.refreshSession()}catch(s){console.error("Failed to refresh session:",s)}})}refreshSession(){return a(this,null,function*(){if(!this.isRefreshing){this.isRefreshing=!0;try{let e=yield c(this.$api.post("/auth/refresh",{}));e.access_token&&(this.token=e.access_token,window.localStorage.setItem(h.jwt.tokenKey,e.access_token),this.lastRefreshTime=Date.now(),this.setLogoutTimer())}finally{this.isRefreshing=!1}}})}static \u0275fac=function(t){return new(t||i)};static \u0275prov=d({token:i,factory:i.\u0275fac})}return i})();export{U as a,X as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as n}from"./chunk-
|
|
1
|
+
import{a as n}from"./chunk-F3HXP7VF.js";import"./chunk-EMTQLND2.js";import"./chunk-D7BCWWSP.js";import{h as r}from"./chunk-O7FV4MLW.js";import"./chunk-U6OOUZY4.js";import"./chunk-VWDC2WDK.js";import{gb as e,la as o}from"./chunk-UUXRTS4O.js";var c=[{path:"",loadComponent:()=>import("./chunk-U5CDHG4J.js").then(t=>t.SettingsComponent),canActivate:[n]}],m=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=e({type:t});static \u0275inj=o({imports:[r.forChild(c),r]})}return t})();var l=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=e({type:t});static \u0275inj=o({imports:[m]})}return t})();export{l as SettingsModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as T}from"./chunk-
|
|
1
|
+
import{a as T}from"./chunk-4BWNO6KH.js";import"./chunk-D7BCWWSP.js";import{e as $}from"./chunk-O7FV4MLW.js";import{b as S}from"./chunk-U6OOUZY4.js";import{k as g,l as _,n as E,q as y}from"./chunk-VWDC2WDK.js";import{Cb as r,Db as i,Eb as u,Pb as v,Sa as n,ac as a,bc as s,fb as x,pa as o,sb as c,tb as d,tc as m,uc as l}from"./chunk-UUXRTS4O.js";function C(t,f){if(t&1&&(r(0,"div",7),a(1),i()),t&2){let e=v();n(),s(e.error)}}function w(t,f){t&1&&(r(0,"p",9),a(1),m(2,"translate"),i(),r(3,"div",10)(4,"div",11),u(5,"i",12),i()()),t&2&&(n(),s(l(2,1,"restart.please_wait_while_server_restarts")))}function k(t,f){t&1&&(r(0,"div",8),a(1),m(2,"translate"),i()),t&2&&(n(),s(l(2,1,"platform.linux.long_time")))}var z=(()=>{class t{$api=o(y);$router=o($);$settings=o(S);$toastr=o(E);$translate=o(g);$ws=o(T);checkTimeout;checkDelay;io;resp={};timeout=!1;error=!1;ngOnInit(){this.io=this.$ws.connectToNamespace("status"),this.io.connected.subscribe(()=>{this.io.socket.emit("monitor-server-status"),this.$settings.getAppSettings().catch(()=>{})}),this.$api.put("/platform-tools/linux/restart-host",{}).subscribe({next:e=>{this.resp=e,this.checkIfServerUp()},error:e=>{console.error(e),this.error=this.$translate.instant("platform.linux.server_restart_error"),this.$toastr.error(this.$translate.instant("platform.linux.server_restart_error"),this.$translate.instant("toast.title_error"))}})}ngOnDestroy(){this.io.end(),clearTimeout(this.checkDelay),clearTimeout(this.checkTimeout)}checkIfServerUp(){this.checkDelay=setTimeout(()=>{this.io.socket.on("homebridge-status",e=>{(e.status==="ok"||e.status==="pending")&&(this.$toastr.success(this.$translate.instant("platform.linux.server_restarted"),this.$translate.instant("toast.title_success")),this.$router.navigate(["/"]))})},3e4),this.checkTimeout=setTimeout(()=>{this.$toastr.warning(this.$translate.instant("platform.linux.server_taking_long_time"),this.$translate.instant("toast.title_warning"),{timeOut:1e4}),this.timeout=!0},12e4)}static \u0275fac=function(p){return new(p||t)};static \u0275cmp=x({type:t,selectors:[["ng-component"]],decls:14,vars:8,consts:[[1,"d-flex","justify-content-between"],[1,"primary-text","m-0"],[1,"my-4","align-items-center",2,"max-width","1000px","margin","auto"],[1,"w-100","text-center","primary-text","mb-5"],[1,"fas","fa-power-off",2,"font-size","75px"],[1,"text-center"],[1,"primary-text","mb-4"],[1,"alert","alert-error","my-4"],[1,"alert","alert-warning","my-4"],[1,"grey-text"],[1,"justify-content-center","my-4"],[1,"restart-progress-box","primary-text"],[1,"fas","fa-circle-notch","fa-spin"]],template:function(p,h){p&1&&(r(0,"div",0)(1,"h3",1),a(2),m(3,"translate"),i()(),r(4,"div",2)(5,"div",3),u(6,"i",4),i(),r(7,"div",5)(8,"h4",6),a(9),m(10,"translate"),i(),c(11,C,2,1,"div",7)(12,w,6,3),c(13,k,3,3,"div",8),i()()),p&2&&(n(2),s(l(3,4,"menu.restart.title")),n(7),s(l(10,6,"platform.linux.restarting_server")),n(2),d(h.error?11:12),n(2),d(h.timeout?13:-1))},dependencies:[_],styles:[".restart-progress-box[_ngcontent-%COMP%]{font-size:22px;font-weight:300;margin-top:15px}"]})}return t})();export{z as RestartLinuxComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as c}from"./chunk-
|
|
1
|
+
import{b as c}from"./chunk-D7BCWWSP.js";import{p as r}from"./chunk-VWDC2WDK.js";import{h as i,ka as a,pa as o}from"./chunk-UUXRTS4O.js";var h=(()=>{class t{cache=null;CACHE_DURATION_MS=6e4;getToken(){let n=Date.now();if(this.cache&&n-this.cache.timestamp<this.CACHE_DURATION_MS)return this.cache.token;let e=window.localStorage.getItem(r.jwt.tokenKey);return this.cache={token:e,timestamp:n},e}invalidateCache(){this.cache=null}static \u0275fac=function(e){return new(e||t)};static \u0275prov=a({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var p=(()=>{class t{$auth=o(c);$tokenCache=o(h);isAuthenticated(){return i(this,null,function*(){if(!this.$tokenCache.getToken())return this.$auth.token=null,this.$auth.user={},this.$tokenCache.invalidateCache(),!1;try{let e=this.$auth.isLoggedIn();return e||(this.$auth.token=null,this.$auth.user={},this.$tokenCache.invalidateCache()),e}catch{return console.warn("Token validation error, clearing auth state"),this.$auth.logout(),this.$tokenCache.invalidateCache(),!1}})}static \u0275fac=function(e){return new(e||t)};static \u0275prov=a({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();export{h as a,p as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as c}from"./chunk-
|
|
1
|
+
import{b as c}from"./chunk-EMTQLND2.js";import{b as f}from"./chunk-D7BCWWSP.js";import{e as u}from"./chunk-O7FV4MLW.js";import{b as h}from"./chunk-U6OOUZY4.js";import{k as o,n}from"./chunk-VWDC2WDK.js";import{h as i,ka as s,pa as t,z as a}from"./chunk-UUXRTS4O.js";var j=(()=>{class e{$auth=t(f);$authHelper=t(c);$router=t(u);$settings=t(h);$translate=t(o);$toastr=t(n);canActivate(m,r){return i(this,null,function*(){return this.$settings.settingsLoaded||(yield a(this.$settings.onSettingsLoaded)),this.$settings.formAuth===!1?(yield this.$auth.noauth(),!0):(yield this.$authHelper.isAuthenticated())?(yield this.$auth.checkAndRefreshIfNeeded(),this.$auth.user?.admin?!0:(this.$toastr.error(this.$translate.instant("toast.no_auth"),this.$translate.instant("toast.title_error")),yield this.$router.navigate(["/"]),!1)):(window.sessionStorage.setItem("target_route",r.url),yield this.$router.navigate(["/login"]),!1)})}static \u0275fac=function(r){return new(r||e)};static \u0275prov=s({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();export{j as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as J}from"./chunk-YHD44ZXJ.js";import{C as H,e as O,l as W,s as z,t as q,v as G}from"./chunk-LZU5VVW4.js";import{e as Y}from"./chunk-O7FV4MLW.js";import{k as K,l as Q,n as X,q as Z}from"./chunk-
|
|
1
|
+
import{m as J}from"./chunk-YHD44ZXJ.js";import{C as H,e as O,l as W,s as z,t as q,v as G}from"./chunk-LZU5VVW4.js";import{e as Y}from"./chunk-O7FV4MLW.js";import{k as K,l as Q,n as X,q as Z}from"./chunk-VWDC2WDK.js";import{Ab as a,Bb as b,Kb as B,Nb as h,Pb as d,Rc as j,Sa as s,a as T,ac as c,b as R,bc as g,cc as I,dc as V,fb as D,h as M,hc as F,ic as U,jc as L,oc as N,pa as w,pc as P,rb as A,sb as _,tb as u,tc as m,ua as v,uc as p,va as f,vb as E,wb as k,xb as $,yb as C,z as S,zb as o}from"./chunk-UUXRTS4O.js";var te=(t,l)=>({"btn-danger":t,"btn-elegant":l}),ie=(t,l,e)=>({"fa-trash":t,"fa-undo":l,"fa-circle-notch fa-spin":e});function ne(t,l){t&1&&(o(0,"div",12),b(1,"i",13),a(),o(2,"p",14),c(3),m(4,"translate"),a()),t&2&&(s(3),g(p(4,1,"reset.no_accessories")))}function se(t,l){if(t&1&&(o(0,"option",24),c(1),a()),t&2){let e=l.$implicit;C("value",e._id),s(),V("",e.name," (",e._username,")")}}function oe(t,l){if(t&1){let e=B();o(0,"li",20),c(1),m(2,"translate"),a(),o(3,"li",18)(4,"label",21),c(5),m(6,"translate"),a(),o(7,"div",22)(8,"select",23),L("ngModelChange",function(i){v(e);let r=d(2);return U(r.selectedBridge,i)||(r.selectedBridge=i),f(i)}),h("change",function(i){v(e);let r=d(2);return f(r.onBridgeChange(i.target.value))}),k(9,se,2,3,"option",24,E),a()()()}if(t&2){let e=d(2);s(),g(p(2,3,"form.label.changes_kept")),s(4),g(p(6,5,"reset.accessory_ind.bridge")),s(3),F("ngModel",e.selectedBridge),s(),$(e.pairings)}}function ae(t,l){if(t&1&&(o(0,"li",18)(1,"label",25),c(2),m(3,"translate"),a(),o(4,"div",26),c(5),a()()),t&2){let e=d(2);s(2),g(p(3,2,"reset.accessory_ind.bridge")),s(3),I(" ",e.getCurrentlySelectedBridge()," ")}}function re(t,l){if(t&1){let e=B();o(0,"li",19)(1,"span",27),b(2,"i",28),a(),o(3,"span",29),c(4),b(5,"br"),o(6,"small")(7,"span",30),c(8),a()()(),o(9,"button",31),m(10,"translate"),h("click",function(){let i=v(e).$implicit,r=d(2);return f(r.toggleList(i.UUID,i.$cacheFile))}),b(11,"i",32),a()()}if(t&2){let e=l.$implicit,n=d(2);s(4),I(" ",e.displayName," "),s(4),g(e.UUID),s(),C("disabled",n.clicked)("ngClass",N(8,te,!n.isInList(e.UUID,e.$cacheFile),n.isInList(e.UUID,e.$cacheFile))),A("aria-label",p(10,6,"form.button_delete")),s(2),C("ngClass",P(11,ie,!n.isInList(e.UUID,e.$cacheFile),n.isInList(e.UUID,e.$cacheFile)&&!n.clicked,n.isInList(e.UUID,e.$cacheFile)&&n.clicked))}}function le(t,l){if(t&1&&(o(0,"div",12),b(1,"i",15),a(),o(2,"ul",16)(3,"li"),c(4),m(5,"translate"),a(),o(6,"li"),c(7),m(8,"translate"),a(),o(9,"li"),c(10),m(11,"translate"),a()(),o(12,"ul",17),_(13,oe,11,7),_(14,ae,6,4,"li",18),k(15,re,12,15,"li",19,E),a()),t&2){let e=d();s(4),g(p(5,5,"reset.accessory_ind.list_1")),s(3),g(p(8,7,"reset.accessory_ind.list_2")),s(3),g(p(11,9,"reset.accessory_ind.list_3")),s(3),u(e.pairings.length>1?13:-1),s(),u(e.pairings.length===1?14:-1),s(),$(e.selectedBridgeAccessories)}}function ce(t,l){if(t&1){let e=B();o(0,"button",33),h("click",function(){v(e);let i=d();return f(i.dismissModal())}),c(1),m(2,"translate"),a()}if(t&2){let e=d();C("disabled",e.clicked),s(),I(" ",p(2,2,"form.button_close")," ")}}function de(t,l){if(t&1){let e=B();o(0,"button",34),h("click",function(){v(e);let i=d();return f(i.dismissModal())}),c(1),m(2,"translate"),a()}t&2&&(s(),I(" ",p(2,1,"form.button_close")," "))}function me(t,l){if(t&1&&c(0),t&2){let e=d(3);I(" (",e.toDelete.length,") ")}}function pe(t,l){if(t&1&&(c(0),m(1,"translate"),_(2,me,1,1)),t&2){let e=d(2);I(" ",p(1,2,"form.button_remove")," "),s(2),u(e.toDelete.length>0?2:-1)}}function _e(t,l){t&1&&b(0,"i",36)}function ue(t,l){if(t&1){let e=B();o(0,"button",35),h("click",function(){v(e);let i=d();return f(i.removeAccessories())}),_(1,pe,3,4),_(2,_e,1,0,"i",36),a()}if(t&2){let e=d();C("disabled",!e.toDelete.length||e.clicked),s(),u(e.clicked?-1:1),s(),u(e.clicked?2:-1)}}var Ee=(()=>{class t{$activeModal=w(J);$api=w(Z);$router=w(Y);$toastr=w(X);$translate=w(K);selectedBridge="";pairings=[];clicked=!1;selectedBridgeAccessories=[];accessoriesExist=!1;toDelete=[];ngOnInit(){this.loadCachedAccessories()}onBridgeChange(e){this.selectedBridge=e,this.selectedBridgeAccessories=this.pairings.find(n=>n._id===this.selectedBridge)?.accessories}getCurrentlySelectedBridge(){let e=this.pairings.find(n=>n._id===this.selectedBridge);return`${e.name} - ${e._username}`}toggleList(e,n){this.toDelete.some(i=>i.uuid===e&&i.cacheFile===n)?this.toDelete=this.toDelete.filter(i=>i.uuid!==e||i.cacheFile!==n):this.toDelete.push({cacheFile:n,uuid:e})}isInList(e,n){return this.toDelete.some(i=>i.uuid===e&&i.cacheFile===n)}removeAccessories(){return this.clicked=!0,this.$api.delete("/server/cached-accessories",{body:this.toDelete}).subscribe({next:()=>{this.$toastr.success(this.$translate.instant("reset.accessory_ind.done"),this.$translate.instant("toast.title_success")),this.$activeModal.close(),this.$router.navigate(["/restart"],{queryParams:{restarting:!0}})},error:e=>{this.clicked=!1,console.error(e),this.$toastr.error(this.$translate.instant("reset.accessory_ind.fail"),this.$translate.instant("toast.title_error"))}})}dismissModal(){this.$activeModal.dismiss("Dismiss")}loadCachedAccessories(){return M(this,null,function*(){try{let[e,n]=yield Promise.all([S(this.$api.get("/server/cached-accessories")),S(this.$api.get("/server/pairings"))]),i=new Map(n.map(r=>[r._id,R(T({},r),{accessories:[]})]));e.sort((r,x)=>r.displayName.localeCompare(x.displayName)).forEach(r=>{let x=n.find(ee=>ee._main),y=r.$cacheFile?.split(".")?.[1]||x._id;(!this.selectedBridge||this.selectedBridge===y)&&(i.has(y)||i.set(y,{_id:y,_username:y.match(/.{1,2}/g).join(":"),name:this.$translate.instant("reset.accessory_ind.unknown"),accessories:[]}),i.get(y).accessories.push(r))}),this.pairings=Array.from(i.values()).filter(r=>r.accessories.length>0).sort((r,x)=>r._main&&!x._main?-1:!r._main&&x._main?1:r.name.localeCompare(x.name)),this.selectedBridge=this.selectedBridge||this.pairings[0]?._id,this.selectedBridge&&(this.accessoriesExist=!0,this.selectedBridgeAccessories=this.pairings[0].accessories)}catch(e){console.error(e),this.$toastr.error(this.$translate.instant("reset.error_message"),this.$translate.instant("toast.title_error")),this.$activeModal.close()}})}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=D({type:t,selectors:[["ng-component"]],inputs:{selectedBridge:"selectedBridge"},decls:17,vars:12,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click","disabled"],[1,"modal-body"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"disabled"],[1,"text-center"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant"],[1,"text-end"],["type","button","data-bs-dismiss","modal",1,"btn","btn-danger",3,"disabled"],[1,"text-center","mb-3"],[1,"fas","fa-circle-check","primary-text",2,"font-size","75px"],[1,"mb-0","text-center"],[1,"fas","fa-network-wired","primary-text",2,"font-size","75px"],[1,"mb-3"],[1,"list-group","list-group-box","mb-0"],[1,"list-group-item","d-flex","flex-column","flex-md-row","align-items-center"],[1,"list-group-item","d-flex","justify-content-between","align-items-center"],[1,"list-group-item","text-center","grey-text","small"],["for","bridgeSelect",1,"mb-2","mb-md-0","w-100","w-md-50"],[1,"text-start","text-md-end","w-100","w-md-50"],["id","bridgeSelect",1,"custom-select",3,"ngModelChange","change","ngModel"],[3,"value"],[1,"mb-2","mb-md-0","w-100","w-md-50"],[1,"text-start","text-md-end","w-100","w-md-50","grey-text","font-monospace"],[1,"me-3"],[1,"fas","fa-lg","fa-hap"],[1,"flex-grow-1"],[1,"font-monospace","grey-text"],[1,"btn","btn-danger","m-0","ms-3",3,"click","disabled","ngClass"],[1,"fas",3,"ngClass"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],["type","button","data-bs-dismiss","modal",1,"btn","btn-danger",3,"click","disabled"],[1,"fas","fa-circle-notch","fa-spin"]],template:function(n,i){n&1&&(o(0,"div",0)(1,"div",1)(2,"h5",2),c(3),m(4,"translate"),a(),o(5,"button",3),m(6,"translate"),h("click",function(){return i.dismissModal()}),a()(),o(7,"div",4),_(8,ne,5,3),_(9,le,17,11),a(),o(10,"div",5)(11,"div",6),_(12,ce,3,4,"button",7),a(),o(13,"div",8),_(14,de,3,3,"button",9),a(),o(15,"div",10),_(16,ue,3,3,"button",11),a()()()),n&2&&(s(3),g(p(4,8,"reset.accessory_ind.title")),s(2),C("disabled",i.clicked),A("aria-label",p(6,10,"form.button_close")),s(3),u(i.accessoriesExist?-1:8),s(),u(i.accessoriesExist?9:-1),s(3),u(i.accessoriesExist?12:-1),s(2),u(i.accessoriesExist?-1:14),s(2),u(i.accessoriesExist?16:-1))},dependencies:[j,H,q,G,z,O,W,Q],encapsulation:2})}return t})();export{Ee as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as n}from"./chunk-O7FV4MLW.js";import{gb as i,ka as a,la as r}from"./chunk-UUXRTS4O.js";var u=(()=>{class t{canDeactivate(e,o,p,m){return e.canDeactivate?e.canDeactivate(m?.url):!0}static \u0275fac=function(o){return new(o||t)};static \u0275prov=a({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var f=[{path:"",loadComponent:()=>import("./chunk-
|
|
1
|
+
import{h as n}from"./chunk-O7FV4MLW.js";import{gb as i,ka as a,la as r}from"./chunk-UUXRTS4O.js";var u=(()=>{class t{canDeactivate(e,o,p,m){return e.canDeactivate?e.canDeactivate(m?.url):!0}static \u0275fac=function(o){return new(o||t)};static \u0275prov=a({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var f=[{path:"",loadComponent:()=>import("./chunk-HDGCOO6N.js").then(t=>t.LogsComponent),canDeactivate:[u]}],s=(()=>{class t{static \u0275fac=function(o){return new(o||t)};static \u0275mod=i({type:t});static \u0275inj=r({imports:[n.forChild(f),n]})}return t})();var v=(()=>{class t{static \u0275fac=function(o){return new(o||t)};static \u0275mod=i({type:t});static \u0275inj=r({imports:[s]})}return t})();export{v as LogsModule};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{M as ne,P as oe,a as pe,b as E,c as te,d as C,e as M,f as ie,g as W,h as j,i as q,j as N}from"./chunk-
|
|
1
|
+
import{M as ne,P as oe,a as pe,b as E,c as te,d as C,e as M,f as ie,g as W,h as j,i as q,j as N}from"./chunk-JTQUK76J.js";import{b as R}from"./chunk-PCFKF3RR.js";import{$b as _,Ab as h,Bb as g,Dc as k,Ea as O,Fc as ee,Gc as A,Kb as X,Na as I,Nb as Y,Pb as c,Sa as a,Zc as D,_b as F,a as $,ac as x,b as V,bc as Z,fb as L,g as ce,gb as w,ka as T,la as v,na as G,oa as K,pa as f,q as J,rb as z,sb as p,tb as u,ua as Q,va as U,yb as y,zb as d}from"./chunk-UUXRTS4O.js";var m=ce(pe(),1);function ue(i,n){if(i&1){let s=X();d(0,"button",5),Y("click",function(){Q(s);let o=c();return U(o.removeItem())}),d(1,"span",6),x(2,"\xD7"),h(),d(3,"span"),x(4,"Close"),h()()}if(i&2){let s=c();_(s.widgetStyles().__remove_item__),a(3),_(s.widgetStyles().__screen_reader__)}}function he(i,n){if(i&1&&g(0,"p",7),i&2){let s=c(2);_(s.widgetStyles().__help_block__),y("innerHTML",s.options==null?null:s.options.helpBlock,I)}}function me(i,n){if(i&1&&(d(0,"div"),p(1,he,1,3,"p",2),h()),i&2){let s=c();a(),u(s.options!=null&&s.options.helpBlock?1:-1)}}function fe(i,n){if(i&1&&g(0,"label",7),i&2){let s,t=c();_((t.options==null?null:t.options.labelHtmlClass)||""),F("sr-only",t.options==null?null:t.options.notitle),y("innerHTML",t.dynamicTitle,I),z("for","control"+((s=t.layoutNode())==null?null:s._id))}}function ge(i,n){if(i&1&&(d(0,"p")(1,"strong"),x(2,"*"),h(),x(3," = required fields "),h()),i&2){let s=c();a(),_(s.widgetStyles().__required_asterisk__)}}function _e(i,n){if(i&1&&g(0,"span",7),i&2){let s=c();_(s.widgetStyles().__field_addon_left__),y("innerHTML",s.options==null?null:s.options.fieldAddonLeft,I)}}function be(i,n){if(i&1&&g(0,"span",7),i&2){let s=c();_(s.widgetStyles().__field_addon_right__),y("innerHTML",s.options==null?null:s.options.fieldAddonRight,I)}}function ye(i,n){if(i&1&&g(0,"span",8),i&2){let s=c();F("glyphicon-ok",(s.options==null?null:s.options.enableSuccessState)&&!(s.formControl!=null&&s.formControl.errors))("glyphicon-remove",(s.options==null?null:s.options.enableErrorState)&&(s.formControl==null?null:s.formControl.errors))}}function Ce(i,n){if(i&1&&g(0,"p",7),i&2){let s=c(2);_(s.widgetStyles().__help_block__),y("innerHTML",s.options==null?null:s.options.helpBlock,I)}}function ve(i,n){if(i&1&&(d(0,"div"),p(1,Ce,1,3,"p",2),h()),i&2){let s=c();a(),u(s.options!=null&&s.options.helpBlock?1:-1)}}function we(i,n){if(i&1&&(d(0,"div"),x(1,"debug: "),d(2,"pre"),x(3),h()()),i&2){let s=c();a(3),Z(s.debugOutput)}}var H=(()=>{let n=class n{constructor(){this.frameworkThemeSubject=new J("default"),this.frameworkTheme$=this.frameworkThemeSubject.asObservable()}requestThemeChange(t){this.frameworkThemeSubject.next(t),this.activeRequestedTheme=t}getActiveRequestedTheme(){return this.activeRequestedTheme}};n.\u0275fac=function(o){return new(o||n)},n.\u0275prov=T({token:n,factory:n.\u0275fac,providedIn:"root"});let i=n;return i})(),P=(()=>{let n=class n{applyCssClasses(t,o,e){let r=this.widgetStyles()[t];(!r||m.default.isEmpty(r))&&(r=this.widgetStyles().default),Object.keys(r).forEach(l=>{let b=r[l];b.length&&(o[l]=C(o[l],b)),e&&(o[l]=C(o[l],e))})}flattenWidgetStyles(t){var o={};let e=["__themes__"];return Object.keys(t).forEach(r=>{let l=t[r];if(e.indexOf(r)>=0){o[r]=l;return}m.default.isArray(l)&&(o[r]=l.join(" ")),m.default.isObject(l)&&(o[r]=o[r]||{},Object.keys(l).forEach(b=>{let S=l[b];m.default.isArray(S)?o[r][b]=S.join(" "):o[r][b]=S})),m.default.isString(l)&&(o[r]=l)}),o}constructor(){this.cdr=f(A),this.jsf=f(M),this.jsfFLService=f(j),this.cssFWService=f(H),this.frameworkInitialized=!1,this.formControl=null,this.debugOutput="",this.debug="",this.parentArray=null,this.isOrderable=!1,this.dynamicTitle=null,this.layoutNode=k(void 0),this.layoutIndex=k(void 0),this.dataIndex=k(void 0),this.widgetStyles=ee(void 0),this.defaultStyling={array:{},default:{fieldHtmlClass:"cssfw-form-control"},__themes__:[{name:"notheme",text:"None"}],__remove_item__:"cssfw-remove-item",__array_item_nonref__:{htmlClass:"cssfw-array-item-nonref"},__active__:{activeClass:"cssfw-active"},__array__:{htmlClass:"cssfw-array"},__control_label__:{labelHtmlClass:"cssfw-control-label"},__form_group__:{htmlClass:"cssfw-form-group"},__field_addon_left__:"cssfw-addon-left",__field_addon_right__:"cssfw-addon-right",__help_block__:"cssfw-help-block",__required_asterisk__:"cssfw-required-astersisk",__screen_reader__:"cssfw-screen-reader"};let t=this.cssFWService,e=this.jsfFLService.activeFramework.config||{};this.widgetStyles.set(Object.assign(this.defaultStyling,e.widgetstyles));let r=this.widgetStyles().__themes__[0],l=t.activeRequestedTheme||r.name;this.theme=this.options?.theme||l}ngOnDestroy(){this.frameworkThemeSubs?.unsubscribe(),this.frameworkThemeSubs=null}get showRemoveButton(){let t=this.layoutNode();return!this.options.removable||this.options.readonly||t.type==="$ref"?!1:t.recursiveReference?!0:!t.arrayItem||!this.parentArray||this.parentArray.items.length-1<=this.parentArray.options.minItems?!1:t.arrayItemType==="list"?!0:this.layoutIndex()[this.layoutIndex().length-1]===this.parentArray.items.length-2}ngOnInit(){let t=this.cssFWService;this.frameworkThemeSubs=t.frameworkTheme$.subscribe(e=>{this.theme=e,this.cdr.detectChanges()}),this.initializeFramework();let o=this.layoutNode();o.arrayItem&&o.type!=="$ref"&&(this.parentArray=this.jsf.getParentNode(this),this.parentArray&&(this.isOrderable=o.arrayItemType==="list"&&!this.options.readonly&&this.parentArray.options.orderable))}ngOnChanges(t){this.frameworkInitialized||this.initializeFramework(),this.isDynamicTitle&&this.updateTitle()}initializeFramework(){let t=this.layoutNode();if(t){if(this.options=(0,m.cloneDeep)(t.options),this.widgetLayoutNode=V($({},t),{options:(0,m.cloneDeep)(t.options)}),this.widgetOptions=this.widgetLayoutNode.options,this.formControl=this.jsf.getFormControl(this),this.options.isInputWidget=te(t.type,["button","checkbox","checkboxes-inline","checkboxes","color","date","datetime-local","datetime","email","file","hidden","image","integer","month","number","password","radio","radiobuttons","radios-inline","radios","range","reset","search","select","submit","tel","text","textarea","time","url","week"]),this.isDynamicTitle=this.options?.title&&/{{.+?}}/.test(this.options.title),this.dynamicTitle=this.options?.title,!["$ref","advancedfieldset","authfieldset","button","card","checkbox","expansion-panel","help","message","msg","section","submit","tabarray","tabs"].includes(t.type)&&/{{.+?}}/.test(this.widgetOptions.title||"")&&this.updateTitle(),this.options.title=this.setTitle(),this.widgetOptions.title&&(this.dynamicTitle=""),this.options.htmlClass=C(this.options.htmlClass,"schema-form-"+t.type),t.type==="array"?this.options.htmlClass=C(this.options.htmlClass,this.widgetStyles().__array__.htmlClass):t.arrayItem&&t.type!=="$ref"?this.options.htmlClass=C(this.options.htmlClass,this.widgetStyles().__array_item_nonref__.htmlClass):this.options.htmlClass=C(this.options.htmlClass,this.widgetStyles().__form_group__.htmlClass),this.widgetOptions.htmlClass="",this.options.labelHtmlClass=C(this.options.labelHtmlClass,this.widgetStyles().__control_label__.labelHtmlClass),this.widgetOptions.activeClass=C(this.widgetOptions.activeClass,this.widgetStyles().__active__.activeClass),this.options.fieldAddonLeft=this.options.fieldAddonLeft||this.options.prepend,this.options.fieldAddonRight=this.options.fieldAddonRight||this.options.append,this.options.title&&t.type!=="tab"&&!this.options.notitle&&this.options.required&&!this.options.title.includes("*")){let o=this.widgetStyles().__required_asterisk__||"text-danger";this.options.title+=`<strong class="${o}">◦</strong>`}if(t.type=="optionfieldset"&&(this.options.messageLocation="top"),this.applyCssClasses(t.type,this.widgetOptions,this.options.style),this.formControl&&(this.updateHelpBlock(this.formControl.status),this.formControl.statusChanges.subscribe(o=>this.updateHelpBlock(o)),this.options.debug)){let o=[];this.debugOutput=(0,m.map)(o,e=>JSON.stringify(e,null,2)).join(`
|
|
2
2
|
`)}this.updateTitle(),this.frameworkInitialized=!0}}updateHelpBlock(t){this.options.helpBlock=t==="INVALID"&&this.options.enableErrorState&&this.formControl.errors&&(this.formControl.dirty||this.options.feedbackOnRender)?this.jsf.formatErrors(this.formControl.errors,this.options.validationMessages):this.options.description||this.options.help||null}setTitle(){switch(this.layoutNode().type){case"button":case"checkbox":case"section":case"help":case"msg":case"submit":case"message":case"tabarray":case"tabs":case"$ref":return null;case"advancedfieldset":return this.widgetOptions.expandable=!0,this.widgetOptions.title="Advanced options",null;case"authfieldset":return this.widgetOptions.expandable=!0,this.widgetOptions.title="Authentication settings",null;case"fieldset":return this.widgetOptions.title=this.options.title,null;case"array":return this.widgetOptions.title=this.options.title,null;default:return this.widgetOptions.title=null,this.jsf.setItemTitle(this)}}updateTitle(){this.dynamicTitle=this.jsf.parseText(this.options?.title,this.jsf.getFormControlValue(this),this.jsf.getFormControlGroup(this)?.value,this.dataIndex()[this.dataIndex().length-1])}removeItem(){this.jsf.removeItem(this)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=L({type:n,selectors:[["css-framework"]],inputs:{layoutNode:[1,"layoutNode"],layoutIndex:[1,"layoutIndex"],dataIndex:[1,"dataIndex"],widgetStyles:[1,"widgetStyles"]},outputs:{widgetStyles:"widgetStylesChange"},standalone:!1,features:[O],decls:12,vars:24,consts:[["type","button",3,"class"],[3,"class","sr-only","innerHTML"],[3,"class","innerHTML"],[3,"layoutNode","dataIndex","layoutIndex"],["aria-hidden","true",1,"form-control-feedback","glyphicon",3,"glyphicon-ok","glyphicon-remove"],["type","button",3,"click"],["aria-hidden","true"],[3,"innerHTML"],["aria-hidden","true",1,"form-control-feedback","glyphicon"]],template:function(o,e){if(o&1&&(d(0,"div"),p(1,ue,5,4,"button",0),p(2,me,2,1,"div"),p(3,fe,1,6,"label",1),p(4,ge,4,2,"p"),d(5,"div"),p(6,_e,1,3,"span",2),g(7,"select-widget-widget",3),p(8,be,1,3,"span",2),h(),p(9,ye,1,4,"span",4),p(10,ve,2,1,"div"),h(),p(11,we,4,1,"div")),o&2){let r,l,b,S;_((e.options==null?null:e.options.htmlClass)||""),F("has-feedback",(e.options==null?null:e.options.feedback)&&(e.options==null?null:e.options.isInputWidget)&&((e.formControl==null?null:e.formControl.dirty)||(e.options==null?null:e.options.feedbackOnRender)))("has-error",(e.options==null?null:e.options.enableErrorState)&&(e.formControl==null?null:e.formControl.errors)&&((e.formControl==null?null:e.formControl.dirty)||(e.options==null?null:e.options.feedbackOnRender)))("has-success",(e.options==null?null:e.options.enableSuccessState)&&!(e.formControl!=null&&e.formControl.errors)&&((e.formControl==null?null:e.formControl.dirty)||(e.options==null?null:e.options.feedbackOnRender))),z("data-bs-theme",e.theme)("data-theme",e.theme),a(),u(e.showRemoveButton?1:-1),a(),u((e.options==null?null:e.options.messageLocation)==="top"&&((r=e.layoutNode())==null?null:r.type)!=="array"?2:-1),a(),u(e.options!=null&&e.options.title&&((l=e.layoutNode())==null?null:l.type)!=="tab"&&((l=e.layoutNode())==null?null:l.type)!=="array"?3:-1),a(),u(((b=e.layoutNode())==null?null:b.type)==="submit"&&(!(e.jsf==null||e.jsf.formOptions==null)&&e.jsf.formOptions.fieldsRequired)?4:-1),a(),F("input-group",(e.options==null?null:e.options.fieldAddonLeft)||(e.options==null?null:e.options.fieldAddonRight)),a(),u(e.options!=null&&e.options.fieldAddonLeft?6:-1),a(),y("layoutNode",e.widgetLayoutNode)("dataIndex",e.dataIndex())("layoutIndex",e.layoutIndex()),a(),u(e.options!=null&&e.options.fieldAddonRight?8:-1),a(),u(e.options!=null&&e.options.feedback&&(e.options!=null&&e.options.isInputWidget)&&!(e.options!=null&&e.options.fieldAddonRight)&&!e.layoutNode().arrayItem&&(e.formControl!=null&&e.formControl.dirty||e.options!=null&&e.options.feedbackOnRender)?9:-1),a(),u((e.options==null?null:e.options.messageLocation)!=="top"&&((S=e.layoutNode())==null?null:S.type)!=="array"?10:-1),a(),u(e.debug&&e.debugOutput?11:-1)}},dependencies:[ie],styles:[`:host ::ng-deep .list-group-item .form-control-feedback{top:40px}:host ::ng-deep .checkbox,:host ::ng-deep .radio{margin-top:0;margin-bottom:0}:host ::ng-deep .checkbox-inline,:host ::ng-deep .checkbox-inline+.checkbox-inline,:host ::ng-deep .checkbox-inline+.radio-inline,:host ::ng-deep .radio-inline,:host ::ng-deep .radio-inline+.radio-inline,:host ::ng-deep .radio-inline+.checkbox-inline{margin-left:0;margin-right:10px}:host ::ng-deep .checkbox-inline:last-child,:host ::ng-deep .radio-inline:last-child{margin-right:0}:host ::ng-deep .ng-invalid.ng-touched{border:1px solid #f44336}.checkbox-inline,.checkbox-inline+.checkbox-inline,.checkbox-inline+.radio-inline,.radio-inline,.radio-inline+.radio-inline,.radio-inline+.checkbox-inline{margin-left:0;margin-right:10px}.checkbox-inline:last-child,.radio-inline:last-child{margin-right:0}.ng-invalid.ng-touched{border:1px solid #f44336}
|
|
3
3
|
`],encapsulation:2});let i=n;return i})(),ke=new G("CSS_FRAMEWORK_CFG"),se;(function(i){class n{}i.csscategories=n})(se||(se={}));var le=(()=>{let n=class n{};n.\u0275fac=function(o){return new(o||n)},n.\u0275mod=w({type:n}),n.\u0275inj=v({providers:[M,j,W,H],imports:[N,D,q]});let i=n;return i})(),re=(()=>{let n=class n extends E{constructor(t){super(),this.cssFWService=f(H),this.name="css",this.framework=P,this.name=t.name,this.text=t.text||this.name,this.stylesheets=t.stylesheets,this.scripts=t.scripts,this.config=t,this.widgets=t.widgets}getActiveTheme(){let t=this.cssFWService.getActiveRequestedTheme(),o=this.config?.widgetstyles?.__themes__,e=o&&o[0];if(t&&(e={name:t,text:t},o)){let r=o.filter(l=>l.name==t);e=r&&r[0]||e}return e}requestThemeChange(t){this.cssFWService.requestThemeChange(t)}registerTheme(t,o=!0){let r=(this.config?.widgetstyles?.__themes__||[]).filter(l=>t.name==l.name);if(r&&r[0]){if(o)return r[0].text=t.text,!0;if(!o)return!1}if(!r||r.length==0){let l=this.config;return l.widgetstyles=this.config.widgetstyles||{},l.widgetstyles.__themes__=l.widgetstyles.__themes__||[],l.widgetstyles.__themes__.push(t),!0}}unregisterTheme(t){let o=this.config?.widgetstyles?.__themes__,e=-1;return o&&(o.forEach((r,l)=>{t==r.name&&(e=l)}),e>=0)?(o.splice(e,1),!0):!1}getConfig(){return this.config}};n.\u0275fac=function(o){return new(o||n)(K(ke))},n.\u0275prov=T({token:n,factory:n.\u0275fac});let i=n;return i})();var Se=(()=>{let n=class n{constructor(){this.changeDetector=f(A),this.jsf=f(M),this.frameworkInitialized=!1,this.formControl=null,this.debugOutput="",this.debug="",this.parentArray=null,this.isOrderable=!1,this.layoutNode=k(void 0),this.layoutIndex=k(void 0),this.dataIndex=k(void 0)}ngOnInit(){}ngOnChanges(){}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=L({type:n,selectors:[["bootstrap-5-framework"]],inputs:{layoutNode:[1,"layoutNode"],layoutIndex:[1,"layoutIndex"],dataIndex:[1,"dataIndex"]},standalone:!1,features:[O],decls:2,vars:3,consts:[[3,"layoutNode","layoutIndex","dataIndex"]],template:function(o,e){o&1&&(d(0,"div"),g(1,"css-framework",0),h()),o&2&&(a(),y("layoutNode",e.layoutNode())("layoutIndex",e.layoutIndex())("dataIndex",e.dataIndex()))},dependencies:[P],styles:[`:host ::ng-deep .list-group-item .list-group-item-hb .form-control-feedback{top:40px}:host ::ng-deep .checkbox,:host ::ng-deep .radio{margin-top:0;margin-bottom:0}:host ::ng-deep .checkbox-inline,:host ::ng-deep .checkbox-inline+.checkbox-inline,:host ::ng-deep .checkbox-inline+.radio-inline,:host ::ng-deep .radio-inline,:host ::ng-deep .radio-inline+.radio-inline,:host ::ng-deep .radio-inline+.checkbox-inline{margin-left:0;margin-right:10px}:host ::ng-deep .checkbox-inline:last-child,:host ::ng-deep .radio-inline:last-child{margin-right:0}:host ::ng-deep .ng-invalid.ng-touched{border:1px solid #f44336}.input-group .form-control:first-child,.input-group-text:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle),.input-group-btn:last-child>.btn-group:not(:last-child)>.btn{border-top-right-radius:0;border-bottom-right-radius:0}.input-group-text:first-child{border-right:0}.input-group .form-control:last-child,.input-group-text:last-child,.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:first-child>.btn-group:not(:first-child)>.btn{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-text:last-child{border-left:0}.input-group .form-control:not(:first-child):not(:last-child),.input-group-text:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child){border-radius:0}.btn-close>span:first-child{display:none}
|
|
4
4
|
`],encapsulation:2});let i=n;return i})(),Ie={name:"bootstrap-5",text:"Bootstrap 5",scripts:["//cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"],stylesheets:["//cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css"],widgetstyles:{__themes__:[{name:"bootstrap5_default",text:"Bootstrap5 default"},{name:"dark",text:"Dark"},{name:"light",text:"Light"}],$ref:{fieldHtmlClass:"btn btn-primary"},__array_item_nonref__:{htmlClass:"list-group-item list-group-item-hb"},__form_group__:{htmlClass:"form-group"},__control_label__:{labelHtmlClass:"control-label"},__active__:{activeClass:"active"},__required_asterisk__:"text-danger",__screen_reader__:"visually-hidden",__remove_item__:"btn-close float-end",__help_block__:"help-block grey-text small",__field_addon_left__:"input-group-text",__field_addon_right__:"input-group-text","alt-date":{},"alt-datetime":{},__array__:{htmlClass:"list-group list-group-hb"},array:{},authfieldset:{},advancedfieldset:{},button:{fieldHtmlClass:"btn btn-sm btn-primary"},checkbox:{fieldHtmlClass:"form-check-input"},checkboxes:{fieldHtmlClass:"form-check-input"},checkboxbuttons:{fieldHtmlClass:"visually-hidden",htmlClass:"btn-group",itemLabelHtmlClass:"btn"},"checkboxes-inline":{htmlClass:"form-check-input",itemLabelHtmlClass:"form-check-inline"},date:{},"datetime-local":{},fieldset:{},integer:{},number:{},optionfieldset:{},password:{},radiobuttons:{fieldHtmlClass:"visually-hidden",htmlClass:"btn-group",itemLabelHtmlClass:"btn"},radio:{fieldHtmlClass:"form-check-input"},radios:{fieldHtmlClass:"form-check-input"},"radios-inline":{htmlClass:"form-check form-check-inline",itemLabelHtmlClass:"form-check-label"},range:{},section:{},selectfieldset:{},select:{fieldHtmlClass:"form-select"},submit:{fieldHtmlClass:"btn btn-primary"},text:{},tabs:{labelHtmlClass:"nav nav-tabs",htmlClass:"tab-content",fieldHtmlClass:"tab-pane",widget_radioClass:"form-check-input"},tabarray:{labelHtmlClass:"nav nav-tabs",htmlClass:"tab-content",fieldHtmlClass:"tab-pane",widget_radioClass:"form-check-input"},"one-of":{labelHtmlClass:"nav nav-tabs",htmlClass:"tab-content",fieldHtmlClass:"tab-pane",widget_radioClass:"form-check-input"},textarea:{},default:{fieldHtmlClass:"form-control"}}},Me=(()=>{let n=class n extends re{constructor(){let t=f(H);super(Ie),this.framework=Se,this.cssFWService=t}};n.\u0275fac=function(o){return new(o||n)},n.\u0275prov=T({token:n,factory:n.\u0275fac});let i=n;return i})(),ae=(()=>{let n=class n{};n.\u0275fac=function(o){return new(o||n)},n.\u0275mod=w({type:n}),n.\u0275inj=v({providers:[M,j,W,{provide:E,useClass:Me,multi:!0}],imports:[N,D,q,le,N]});let i=n;return i})();var de=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275mod=w({type:i});static \u0275inj=v({providers:[ne],imports:[ae,R]})}return i})();var tt=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275mod=w({type:i});static \u0275inj=v({providers:[oe],imports:[R,de]})}return i})();export{tt as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as et}from"./chunk-JEQ5JQRP.js";import"./chunk-VCZ6KBM7.js";import{a as rt}from"./chunk-MGZVKFCX.js";import{a as L}from"./chunk-HSDZKEAS.js";import{n as R,t as J}from"./chunk-YHD44ZXJ.js";import{D as W,c as D,e as z,f as N,g as A,j,m as G,q as H,r as Q}from"./chunk-LZU5VVW4.js";import"./chunk-XOT3W4PF.js";import{b as tt}from"./chunk-M62WKFKF.js";import{b as U}from"./chunk-HGLLMJ7J.js";import{k as K,l as X,n as Y,q as Z}from"./chunk-TXQH2OVO.js";import{$b as V,Ab as l,Bb as p,Ca as y,Ec as T,Kb as v,Nb as u,Pb as d,R as M,Ra as k,Sa as n,V as P,Wb as x,Xb as q,_b as S,ac as $,bc as B,fb as O,g as nt,h as E,kc as F,p as I,pa as m,rb as b,sb as _,tb as w,tc as a,ua as h,uc as s,va as g,yb as f,zb as c}from"./chunk-UUXRTS4O.js";var ot=nt(rt(),1);var at=["logoutput"],st=["searchInput"];function lt(i,C){if(i&1){let t=v();c(0,"div",5)(1,"button",9),a(2,"translate"),a(3,"translate"),u("click",function(){h(t);let o=d();return g(o.showSearch())}),p(4,"i"),l(),c(5,"button",9),a(6,"translate"),a(7,"translate"),u("click",function(){h(t);let o=d();return g(o.downloadLogFile())}),p(8,"i",10),l(),c(9,"button",11),a(10,"translate"),a(11,"translate"),u("click",function(){h(t);let o=d();return g(o.truncateLogFile())}),p(12,"i",12),l()()}if(i&2){let t=d();n(),f("openDelay",150)("ngbTooltip",s(2,12,"form.search")),b("aria-label",s(3,14,"form.search")),n(3),V(F("fas",t.showSearchBar()?" primary-text":""," fa-search")),n(),f("openDelay",150)("ngbTooltip",s(6,16,"form.button_download")),b("aria-label",s(7,18,"form.button_download")),n(4),f("openDelay",150)("ngbTooltip",s(10,20,"form.button_delete")),b("aria-label",s(11,22,"form.button_delete"))}}function ct(i,C){if(i&1){let t=v();c(0,"button",18),a(1,"translate"),u("click",function(){h(t);let o=d(2);return g(o.onClearSearch())}),p(2,"i",19),l()}i&2&&b("aria-label",s(1,1,"form.button_clear"))}function mt(i,C){i&1&&(c(0,"span",17),$(1),a(2,"translate"),l()),i&2&&(n(),B(s(2,1,"common.labels.beta")))}function dt(i,C){if(i&1){let t=v();c(0,"div",6)(1,"div",13)(2,"form",14),u("ngSubmit",function(){h(t);let o=d();return g(o.onSubmit(o.form.value))}),p(3,"input",15,1),a(5,"translate"),_(6,ct,3,3,"button",16)(7,mt,3,3,"span",17),l()()()}if(i&2){let t,e=d();n(2),f("formGroup",e.form),n(),S("is-invalid",e.searchInputInvalid),f("placeholder",s(5,5,"logs.placeholder_search_logs")),n(3),w((t=e.form.get("query"))!=null&&t.value?6:7)}}var Lt=(()=>{class i{$api=m(Z);$auth=m(tt);$log=m(et);$modal=m(R);$settings=m(U);$toastr=m(Y);$translate=m(K);termTarget=T("logoutput");searchInput=T("searchInput");resizeEvent=new I;valueChangesSubscription;isAdmin=this.$auth.user.admin;showSearchBar=y(!1);showExitButton=y(!1);form=new A({query:new j("")});get searchInputInvalid(){let t=(this.form.get("query")?.value||"").trim();return t.length>0&&t.length<3}onWindowResize(){this.resizeEvent.next(void 0)}ngOnInit(){let t=this.$translate.instant("menu.linux.label_logs");if(this.$settings.setPageTitle(t),window.document.querySelector("body").classList.add("bg-black"),this.$settings.actualLightingMode==="light"){window.document.querySelector("body").classList.add("light-mode");let e=this.termTarget()?.nativeElement;e&&e.classList.add("light-mode")}this.$log.startTerminal(this.termTarget(),{allowProposedApi:!0,allowTransparency:!1,fontSize:13,fontWeight:400,lineHeight:1.25},this.resizeEvent),this.valueChangesSubscription=this.form.get("query")?.valueChanges.pipe(M(500),P()).subscribe(e=>{let o=e||"",r=o.trim();r!==o&&this.form.get("query")?.setValue(r,{emitEvent:!1}),r.length>=3?(this.showExitButton.set(!0),this.$log.setSearchFilter(r),this.$log.scrollToBottom()):r.length<3&&this.showExitButton()&&(this.showExitButton.set(!1),this.$log.clearSearchFilter(),this.$log.scrollToBottom())})}showSearch(){if(this.showSearchBar())this.showSearchBar.set(!1),this.showExitButton.set(!1),this.form.setValue({query:""}),this.$log.clearSearchFilter();else{this.showSearchBar.set(!0);let t=this.searchInput();t&&setTimeout(()=>t.nativeElement.focus(),10)}setTimeout(()=>this.resizeEvent.next(void 0),10),this.$log.scrollToBottom()}onSubmit(t){let e=(t.query||"").trim();!e.length||e.length<3?(e.length||this.showSearchBar.set(!1),this.form.setValue({query:""}),this.showExitButton.set(!1),this.$log.clearSearchFilter()):(this.showExitButton.set(!0),this.$log.setSearchFilter(e)),this.$log.scrollToBottom()}onClearSearch(){this.form.setValue({query:""}),this.showExitButton.set(!1),this.$log.clearSearchFilter(),this.$log.scrollToBottom()}canDeactivate(t){return this.$settings.actualLightingMode!=="light"?(window.document.querySelector("body").classList.remove("bg-black"),Promise.resolve(!0)):(this.showSearchBar()&&this.showSearchBar.set(!1),window.document.querySelector("body").classList.remove("light-mode"),new Promise(e=>{let o=t&&(t.includes("/platform-tools/terminal")||t.includes("/logs")),r=this.termTarget()?.nativeElement;r&&r.classList.add("fade-out"),o?setTimeout(()=>{e(!0)},250):(setTimeout(()=>{window.document.querySelector("body").classList.remove("bg-black")},250),setTimeout(()=>{e(!0)},500))}))}ngOnDestroy(){window.document.querySelector("body").classList.remove("light-mode"),this.valueChangesSubscription&&this.valueChangesSubscription.unsubscribe(),this.resizeEvent.complete(),this.$log.destroyTerminal()}downloadLogFile(){let t=this.$modal.open(L,{size:"lg",backdrop:"static"});t.componentInstance.title=this.$translate.instant("logs.title_download_log_file"),t.componentInstance.message=this.$translate.instant("logs.download_warning"),t.componentInstance.confirmButtonLabel=this.$translate.instant("form.button_download"),t.componentInstance.faIconClass="fas fa-user-secret primary-text",t.result.then(()=>{this.$api.get("/platform-tools/hb-service/log/download",{observe:"response",responseType:"blob"}).subscribe({next:e=>{(0,ot.saveAs)(e.body,"homebridge.log.txt")},error:e=>E(this,null,function*(){let o;try{o=JSON.parse(yield e.error.text()).message}catch(r){console.error(r)}this.$toastr.error(o||this.$translate.instant("logs.download.error"),this.$translate.instant("toast.title_error"))})})}).catch(()=>{})}truncateLogFile(){let t=this.$modal.open(L,{size:"lg",backdrop:"static"});t.componentInstance.title=this.$translate.instant("logs.title_truncate_log_file"),t.componentInstance.message=this.$translate.instant("logs.truncate_log_warning"),t.componentInstance.confirmButtonLabel=this.$translate.instant("form.button_delete"),t.componentInstance.confirmButtonClass="btn-danger",t.componentInstance.faIconClass="fas fa-circle-exclamation primary-text",t.result.then(()=>{this.$api.put("/platform-tools/hb-service/log/truncate",{}).subscribe({next:()=>{this.$toastr.success(this.$translate.instant("logs.log_file_truncated"),this.$translate.instant("toast.title_success")),this.$log.term.clear()},error:e=>{console.error(e),this.$toastr.error(e.error?.message||this.$translate.instant("logs.truncate.error"),this.$translate.instant("toast.title_error"))}})}).catch(()=>{})}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=O({type:i,selectors:[["ng-component"]],viewQuery:function(e,o){e&1&&(x(o.termTarget,at,5),x(o.searchInput,st,5)),e&2&&q(2)},hostBindings:function(e,o){e&1&&u("resize",function(it){return o.onWindowResize(it)},k)},decls:10,vars:9,consts:[["logoutput",""],["searchInput",""],[1,"row","mb-3"],[1,"col-6"],[1,"primary-text","m-0"],[1,"col-6","text-end"],[1,"row"],[1,"flex-column","d-flex","align-items-stretch"],["id","log-output",1,"align-self-end","w-100","h-100","mb-1"],["container","body","placement","bottom","triggers","hover",1,"btn","btn-elegant","my-0","me-2",3,"click","openDelay","ngbTooltip"],[1,"fas","fa-download"],["container","body","placement","bottom","triggers","hover",1,"btn","btn-elegant","my-0","me-0",3,"click","openDelay","ngbTooltip"],[1,"fas","fa-trash-alt"],[1,"col-md-12"],["novalidate","",3,"ngSubmit","formGroup"],["type","text","id","logs-search","formControlName","query",1,"search-bar",3,"placeholder"],["type","button",1,"search-bar-clear"],[1,"search-bar-badge","badge","badge-primary","badge-beta"],["type","button",1,"search-bar-clear",3,"click"],["aria-hidden","true",1,"fas","fa-square-xmark"]],template:function(e,o){e&1&&(c(0,"div",2)(1,"div",3)(2,"h3",4),$(3),a(4,"translate"),l()(),_(5,lt,13,24,"div",5),l(),_(6,dt,8,7,"div",6),c(7,"div",7),p(8,"div",8,0),l()),e&2&&(n(3),B(s(4,7,"menu.linux.label_logs")),n(2),w(o.isAdmin?5:-1),n(),w(o.showSearchBar()?6:-1),n(),S("adjust-for-mobile",!o.showSearchBar())("adjust-for-mobile-with-search",o.showSearchBar()))},dependencies:[J,W,G,D,z,N,H,Q,X],styles:["body.light-mode{transition:background-color .25s ease-in-out}#log-output.light-mode[_ngcontent-%COMP%]{opacity:0;animation:_ngcontent-%COMP%_fadeIn .25s ease-in-out .25s forwards}#log-output.light-mode.fade-out[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_fadeOut .25s ease-in-out forwards!important;opacity:1}@keyframes _ngcontent-%COMP%_fadeIn{to{opacity:1}}@keyframes _ngcontent-%COMP%_fadeOut{to{opacity:0}}.search-bar[_ngcontent-%COMP%]{background-color:#111!important;color:#999!important;border:0 #242424!important}@media (hover: hover){.search-bar[_ngcontent-%COMP%]:hover{border:1px solid #242424!important}}.search-bar[_ngcontent-%COMP%]:focus{border:1px solid #242424!important;box-shadow:inherit!important;color:#eee!important}.search-bar[_ngcontent-%COMP%]::placeholder{color:#636363!important;opacity:1!important}.search-bar.is-invalid[_ngcontent-%COMP%]{border:1px solid #d32f2f!important;box-shadow:0 1px #d32f2f!important}@media (hover: hover){.search-bar.is-invalid[_ngcontent-%COMP%]:hover{border:1px solid #d32f2f!important;box-shadow:0 1px #d32f2f!important}}.search-bar.is-invalid[_ngcontent-%COMP%]:focus{border:1px solid #d32f2f!important;box-shadow:0 1px #d32f2f!important}.search-bar-badge[_ngcontent-%COMP%]{position:absolute;right:10px;top:16px;font-size:.75rem;padding:.25em .5em}.adjust-for-mobile-with-search[_ngcontent-%COMP%]{height:calc(100% - 97px);width:calc(100% + 17px);overflow:hidden}@media (max-width: 767px){.adjust-for-mobile-with-search[_ngcontent-%COMP%]{height:calc(100% - 125px);width:calc(100% + 16px)}}"]})}return i})();export{Lt as LogsComponent};
|
|
1
|
+
import{a as et}from"./chunk-QHBHZIPJ.js";import"./chunk-VCZ6KBM7.js";import{a as rt}from"./chunk-MGZVKFCX.js";import{a as L}from"./chunk-LY2WH7XJ.js";import{n as R,t as J}from"./chunk-YHD44ZXJ.js";import{D as W,c as D,e as z,f as N,g as A,j,m as G,q as H,r as Q}from"./chunk-LZU5VVW4.js";import"./chunk-4BWNO6KH.js";import{b as tt}from"./chunk-D7BCWWSP.js";import{b as U}from"./chunk-U6OOUZY4.js";import{k as K,l as X,n as Y,q as Z}from"./chunk-VWDC2WDK.js";import{$b as V,Ab as l,Bb as p,Ca as y,Ec as T,Kb as v,Nb as u,Pb as d,R as M,Ra as k,Sa as n,V as P,Wb as x,Xb as q,_b as S,ac as $,bc as B,fb as O,g as nt,h as E,kc as F,p as I,pa as m,rb as b,sb as _,tb as w,tc as a,ua as h,uc as s,va as g,yb as f,zb as c}from"./chunk-UUXRTS4O.js";var ot=nt(rt(),1);var at=["logoutput"],st=["searchInput"];function lt(i,C){if(i&1){let t=v();c(0,"div",5)(1,"button",9),a(2,"translate"),a(3,"translate"),u("click",function(){h(t);let o=d();return g(o.showSearch())}),p(4,"i"),l(),c(5,"button",9),a(6,"translate"),a(7,"translate"),u("click",function(){h(t);let o=d();return g(o.downloadLogFile())}),p(8,"i",10),l(),c(9,"button",11),a(10,"translate"),a(11,"translate"),u("click",function(){h(t);let o=d();return g(o.truncateLogFile())}),p(12,"i",12),l()()}if(i&2){let t=d();n(),f("openDelay",150)("ngbTooltip",s(2,12,"form.search")),b("aria-label",s(3,14,"form.search")),n(3),V(F("fas",t.showSearchBar()?" primary-text":""," fa-search")),n(),f("openDelay",150)("ngbTooltip",s(6,16,"form.button_download")),b("aria-label",s(7,18,"form.button_download")),n(4),f("openDelay",150)("ngbTooltip",s(10,20,"form.button_delete")),b("aria-label",s(11,22,"form.button_delete"))}}function ct(i,C){if(i&1){let t=v();c(0,"button",18),a(1,"translate"),u("click",function(){h(t);let o=d(2);return g(o.onClearSearch())}),p(2,"i",19),l()}i&2&&b("aria-label",s(1,1,"form.button_clear"))}function mt(i,C){i&1&&(c(0,"span",17),$(1),a(2,"translate"),l()),i&2&&(n(),B(s(2,1,"common.labels.beta")))}function dt(i,C){if(i&1){let t=v();c(0,"div",6)(1,"div",13)(2,"form",14),u("ngSubmit",function(){h(t);let o=d();return g(o.onSubmit(o.form.value))}),p(3,"input",15,1),a(5,"translate"),_(6,ct,3,3,"button",16)(7,mt,3,3,"span",17),l()()()}if(i&2){let t,e=d();n(2),f("formGroup",e.form),n(),S("is-invalid",e.searchInputInvalid),f("placeholder",s(5,5,"logs.placeholder_search_logs")),n(3),w((t=e.form.get("query"))!=null&&t.value?6:7)}}var Lt=(()=>{class i{$api=m(Z);$auth=m(tt);$log=m(et);$modal=m(R);$settings=m(U);$toastr=m(Y);$translate=m(K);termTarget=T("logoutput");searchInput=T("searchInput");resizeEvent=new I;valueChangesSubscription;isAdmin=this.$auth.user.admin;showSearchBar=y(!1);showExitButton=y(!1);form=new A({query:new j("")});get searchInputInvalid(){let t=(this.form.get("query")?.value||"").trim();return t.length>0&&t.length<3}onWindowResize(){this.resizeEvent.next(void 0)}ngOnInit(){let t=this.$translate.instant("menu.linux.label_logs");if(this.$settings.setPageTitle(t),window.document.querySelector("body").classList.add("bg-black"),this.$settings.actualLightingMode==="light"){window.document.querySelector("body").classList.add("light-mode");let e=this.termTarget()?.nativeElement;e&&e.classList.add("light-mode")}this.$log.startTerminal(this.termTarget(),{allowProposedApi:!0,allowTransparency:!1,fontSize:13,fontWeight:400,lineHeight:1.25},this.resizeEvent),this.valueChangesSubscription=this.form.get("query")?.valueChanges.pipe(M(500),P()).subscribe(e=>{let o=e||"",r=o.trim();r!==o&&this.form.get("query")?.setValue(r,{emitEvent:!1}),r.length>=3?(this.showExitButton.set(!0),this.$log.setSearchFilter(r),this.$log.scrollToBottom()):r.length<3&&this.showExitButton()&&(this.showExitButton.set(!1),this.$log.clearSearchFilter(),this.$log.scrollToBottom())})}showSearch(){if(this.showSearchBar())this.showSearchBar.set(!1),this.showExitButton.set(!1),this.form.setValue({query:""}),this.$log.clearSearchFilter();else{this.showSearchBar.set(!0);let t=this.searchInput();t&&setTimeout(()=>t.nativeElement.focus(),10)}setTimeout(()=>this.resizeEvent.next(void 0),10),this.$log.scrollToBottom()}onSubmit(t){let e=(t.query||"").trim();!e.length||e.length<3?(e.length||this.showSearchBar.set(!1),this.form.setValue({query:""}),this.showExitButton.set(!1),this.$log.clearSearchFilter()):(this.showExitButton.set(!0),this.$log.setSearchFilter(e)),this.$log.scrollToBottom()}onClearSearch(){this.form.setValue({query:""}),this.showExitButton.set(!1),this.$log.clearSearchFilter(),this.$log.scrollToBottom()}canDeactivate(t){return this.$settings.actualLightingMode!=="light"?(window.document.querySelector("body").classList.remove("bg-black"),Promise.resolve(!0)):(this.showSearchBar()&&this.showSearchBar.set(!1),window.document.querySelector("body").classList.remove("light-mode"),new Promise(e=>{let o=t&&(t.includes("/platform-tools/terminal")||t.includes("/logs")),r=this.termTarget()?.nativeElement;r&&r.classList.add("fade-out"),o?setTimeout(()=>{e(!0)},250):(setTimeout(()=>{window.document.querySelector("body").classList.remove("bg-black")},250),setTimeout(()=>{e(!0)},500))}))}ngOnDestroy(){window.document.querySelector("body").classList.remove("light-mode"),this.valueChangesSubscription&&this.valueChangesSubscription.unsubscribe(),this.resizeEvent.complete(),this.$log.destroyTerminal()}downloadLogFile(){let t=this.$modal.open(L,{size:"lg",backdrop:"static"});t.componentInstance.title=this.$translate.instant("logs.title_download_log_file"),t.componentInstance.message=this.$translate.instant("logs.download_warning"),t.componentInstance.confirmButtonLabel=this.$translate.instant("form.button_download"),t.componentInstance.faIconClass="fas fa-user-secret primary-text",t.result.then(()=>{this.$api.get("/platform-tools/hb-service/log/download",{observe:"response",responseType:"blob"}).subscribe({next:e=>{(0,ot.saveAs)(e.body,"homebridge.log.txt")},error:e=>E(this,null,function*(){let o;try{o=JSON.parse(yield e.error.text()).message}catch(r){console.error(r)}this.$toastr.error(o||this.$translate.instant("logs.download.error"),this.$translate.instant("toast.title_error"))})})}).catch(()=>{})}truncateLogFile(){let t=this.$modal.open(L,{size:"lg",backdrop:"static"});t.componentInstance.title=this.$translate.instant("logs.title_truncate_log_file"),t.componentInstance.message=this.$translate.instant("logs.truncate_log_warning"),t.componentInstance.confirmButtonLabel=this.$translate.instant("form.button_delete"),t.componentInstance.confirmButtonClass="btn-danger",t.componentInstance.faIconClass="fas fa-circle-exclamation primary-text",t.result.then(()=>{this.$api.put("/platform-tools/hb-service/log/truncate",{}).subscribe({next:()=>{this.$toastr.success(this.$translate.instant("logs.log_file_truncated"),this.$translate.instant("toast.title_success")),this.$log.term.clear()},error:e=>{console.error(e),this.$toastr.error(e.error?.message||this.$translate.instant("logs.truncate.error"),this.$translate.instant("toast.title_error"))}})}).catch(()=>{})}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=O({type:i,selectors:[["ng-component"]],viewQuery:function(e,o){e&1&&(x(o.termTarget,at,5),x(o.searchInput,st,5)),e&2&&q(2)},hostBindings:function(e,o){e&1&&u("resize",function(it){return o.onWindowResize(it)},k)},decls:10,vars:9,consts:[["logoutput",""],["searchInput",""],[1,"row","mb-3"],[1,"col-6"],[1,"primary-text","m-0"],[1,"col-6","text-end"],[1,"row"],[1,"flex-column","d-flex","align-items-stretch"],["id","log-output",1,"align-self-end","w-100","h-100","mb-1"],["container","body","placement","bottom","triggers","hover",1,"btn","btn-elegant","my-0","me-2",3,"click","openDelay","ngbTooltip"],[1,"fas","fa-download"],["container","body","placement","bottom","triggers","hover",1,"btn","btn-elegant","my-0","me-0",3,"click","openDelay","ngbTooltip"],[1,"fas","fa-trash-alt"],[1,"col-md-12"],["novalidate","",3,"ngSubmit","formGroup"],["type","text","id","logs-search","formControlName","query",1,"search-bar",3,"placeholder"],["type","button",1,"search-bar-clear"],[1,"search-bar-badge","badge","badge-primary","badge-beta"],["type","button",1,"search-bar-clear",3,"click"],["aria-hidden","true",1,"fas","fa-square-xmark"]],template:function(e,o){e&1&&(c(0,"div",2)(1,"div",3)(2,"h3",4),$(3),a(4,"translate"),l()(),_(5,lt,13,24,"div",5),l(),_(6,dt,8,7,"div",6),c(7,"div",7),p(8,"div",8,0),l()),e&2&&(n(3),B(s(4,7,"menu.linux.label_logs")),n(2),w(o.isAdmin?5:-1),n(),w(o.showSearchBar()?6:-1),n(),S("adjust-for-mobile",!o.showSearchBar())("adjust-for-mobile-with-search",o.showSearchBar()))},dependencies:[J,W,G,D,z,N,H,Q,X],styles:["body.light-mode{transition:background-color .25s ease-in-out}#log-output.light-mode[_ngcontent-%COMP%]{opacity:0;animation:_ngcontent-%COMP%_fadeIn .25s ease-in-out .25s forwards}#log-output.light-mode.fade-out[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_fadeOut .25s ease-in-out forwards!important;opacity:1}@keyframes _ngcontent-%COMP%_fadeIn{to{opacity:1}}@keyframes _ngcontent-%COMP%_fadeOut{to{opacity:0}}.search-bar[_ngcontent-%COMP%]{background-color:#111!important;color:#999!important;border:0 #242424!important}@media (hover: hover){.search-bar[_ngcontent-%COMP%]:hover{border:1px solid #242424!important}}.search-bar[_ngcontent-%COMP%]:focus{border:1px solid #242424!important;box-shadow:inherit!important;color:#eee!important}.search-bar[_ngcontent-%COMP%]::placeholder{color:#636363!important;opacity:1!important}.search-bar.is-invalid[_ngcontent-%COMP%]{border:1px solid #d32f2f!important;box-shadow:0 1px #d32f2f!important}@media (hover: hover){.search-bar.is-invalid[_ngcontent-%COMP%]:hover{border:1px solid #d32f2f!important;box-shadow:0 1px #d32f2f!important}}.search-bar.is-invalid[_ngcontent-%COMP%]:focus{border:1px solid #d32f2f!important;box-shadow:0 1px #d32f2f!important}.search-bar-badge[_ngcontent-%COMP%]{position:absolute;right:10px;top:16px;font-size:.75rem;padding:.25em .5em}.adjust-for-mobile-with-search[_ngcontent-%COMP%]{height:calc(100% - 97px);width:calc(100% + 17px);overflow:hidden}@media (max-width: 767px){.adjust-for-mobile-with-search[_ngcontent-%COMP%]{height:calc(100% - 127px)}}"]})}return i})();export{Lt as LogsComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as c}from"./chunk-
|
|
1
|
+
import{a as c}from"./chunk-H2SGUM2A.js";import"./chunk-JTQUK76J.js";import"./chunk-3OHVXX6B.js";import"./chunk-PTJ2WHN2.js";import"./chunk-JT7SPTVG.js";import"./chunk-N6D52WI6.js";import"./chunk-QHBHZIPJ.js";import"./chunk-VCZ6KBM7.js";import"./chunk-MGZVKFCX.js";import"./chunk-DDJU52K4.js";import"./chunk-KSI5RFA4.js";import"./chunk-PCFKF3RR.js";import"./chunk-LY2WH7XJ.js";import"./chunk-YHD44ZXJ.js";import"./chunk-LZU5VVW4.js";import"./chunk-4BWNO6KH.js";import"./chunk-D7BCWWSP.js";import{h as n}from"./chunk-O7FV4MLW.js";import"./chunk-U6OOUZY4.js";import"./chunk-VWDC2WDK.js";import{gb as i,ka as a,la as r}from"./chunk-UUXRTS4O.js";var s=(()=>{class t{canDeactivate(o,e,p,m){return o.canDeactivate?o.canDeactivate(m?.url):!0}static \u0275fac=function(e){return new(e||t)};static \u0275prov=a({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var f=[{path:"",loadComponent:()=>import("./chunk-P5NUDX6Y.js").then(t=>t.PluginsComponent),canDeactivate:[s]}],l=(()=>{class t{static \u0275fac=function(e){return new(e||t)};static \u0275mod=i({type:t});static \u0275inj=r({imports:[n.forChild(f),n]})}return t})();var P=(()=>{class t{static \u0275fac=function(e){return new(e||t)};static \u0275mod=i({type:t});static \u0275inj=r({imports:[c,l]})}return t})();export{P as PluginsModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as C}from"./chunk-
|
|
1
|
+
import{b as C}from"./chunk-U6OOUZY4.js";import{k as I,l as y,p as S}from"./chunk-VWDC2WDK.js";import{Ab as a,Bb as p,Nb as x,Oa as _,Pb as B,Rc as E,Sa as e,ac as r,bc as d,cc as s,fb as k,oc as w,pa as g,rb as o,sb as f,tb as h,tc as i,uc as n,yb as v,zb as t}from"./chunk-UUXRTS4O.js";var F=(l,b)=>({"fa-chevron-down":l,"fa-chevron-right":b});function $(l,b){l&1&&(t(0,"ul",6)(1,"li",9)(2,"span",10),r(3),i(4,"translate"),p(5,"br"),t(6,"small",11),r(7),i(8,"translate"),a()(),t(9,"a",12),i(10,"translate"),p(11,"i",13),a()(),t(12,"li",9)(13,"span",10),r(14),i(15,"translate"),p(16,"br"),t(17,"small",11),r(18),i(19,"translate"),a()(),t(20,"a",14),i(21,"translate"),p(22,"i",13),a()(),t(23,"li",9)(24,"span",10),r(25),i(26,"translate"),p(27,"br"),t(28,"small",11),r(29),i(30,"translate"),a()(),t(31,"a",15),i(32,"translate"),p(33,"i",13),a()(),t(34,"li",9)(35,"span",10),r(36),i(37,"translate"),p(38,"br"),t(39,"small",11),r(40),i(41,"translate"),a()(),t(42,"a",16),i(43,"translate"),p(44,"i",13),a()()()),l&2&&(e(3),s(" ",n(4,12,"support.links.documentation")),e(4),d(n(8,14,"support.links.documentation_sub")),e(2),o("aria-label",n(10,16,"support.links.documentation")),e(5),s(" ",n(15,18,"support.links.issue")),e(4),d(n(19,20,"support.links.issue_sub")),e(2),o("aria-label",n(21,22,"support.links.issue")),e(5),s(" ",n(26,24,"support.links.discord")),e(4),d(n(30,26,"support.links.discord_sub")),e(2),o("aria-label",n(32,28,"support.links.discord")),e(5),s(" ",n(37,30,"support.links.reddit")),e(4),d(n(41,32,"support.links.reddit_sub")),e(2),o("aria-label",n(43,34,"support.links.reddit")))}function P(l,b){if(l&1&&(t(0,"ul",8)(1,"li",9)(2,"span",10),r(3),i(4,"translate"),p(5,"br"),t(6,"small",11),r(7),i(8,"translate"),a()(),t(9,"a",17),i(10,"translate"),p(11,"i",13),a()(),t(12,"li",9)(13,"span",10),r(14),i(15,"translate"),p(16,"br"),t(17,"small",11),r(18),i(19,"translate"),a()(),t(20,"a",18),i(21,"translate"),p(22,"i",13),a()(),t(23,"li",9)(24,"span",10),r(25),i(26,"translate"),p(27,"br"),t(28,"small",11),r(29),i(30,"translate"),a()(),t(31,"a",19),i(32,"translate"),p(33,"i",13),a()(),t(34,"li",9)(35,"span",10),r(36),i(37,"translate"),p(38,"br"),t(39,"small",11),r(40),i(41,"translate"),a()(),t(42,"a",20),i(43,"translate"),p(44,"i",13),a()(),t(45,"li",9)(46,"span",10),r(47),i(48,"translate"),p(49,"br"),t(50,"small",11),r(51),i(52,"translate"),a()(),t(53,"a",21),i(54,"translate"),p(55,"i",13),a()()()),l&2){let u=B();e(3),s(" ",n(4,16,"support.dev.item_swagger")),e(4),d(n(8,18,"support.dev.item_swagger_sub")),e(2),v("href",u.swaggerUrl,_),o("aria-label",n(10,20,"support.dev.item_swagger")),e(5),s(" ",n(15,22,"support.dev.api")),e(4),d(n(19,24,"support.dev.api_sub")),e(2),o("aria-label",n(21,26,"support.dev.api")),e(5),s(" ",n(26,28,"support.dev.api_hap")),e(4),d(n(30,30,"support.dev.api_hap_sub")),e(2),o("aria-label",n(32,32,"support.dev.api_hap")),e(5),s(" ",n(37,34,"support.dev.template")),e(4),d(n(41,36,"support.dev.template_sub")),e(2),o("aria-label",n(43,38,"support.dev.template")),e(5),s(" ",n(48,40,"support.dev.verified")),e(4),d(n(52,42,"support.dev.verified_sub")),e(2),o("aria-label",n(54,44,"support.dev.verified"))}}var z=(()=>{class l{$settings=g(C);$translate=g(I);swaggerEndpoint="/swagger";showFields={general:!0,dev:!0};ngOnInit(){let u=this.$translate.instant("support.title");this.$settings.setPageTitle(u)}get swaggerUrl(){return S.production?this.swaggerEndpoint:`${S.api.origin}${this.swaggerEndpoint}`}toggleSection(u){this.showFields[u]=!this.showFields[u]}static \u0275fac=function(c){return new(c||l)};static \u0275cmp=k({type:l,selectors:[["ng-component"]],decls:18,vars:23,consts:[[1,"d-flex","justify-content-between"],[1,"primary-text","m-0"],[1,"mb-4"],["role","button","tabindex","0",1,"mt-3","hover-pointer",3,"click"],[1,"primary-text"],[1,"fa",3,"ngClass"],["id","fieldsGeneral",1,"list-group","list-group-box","mt-2","mx-0"],[1,"pb-3"],["id","fieldsDev",1,"list-group","list-group-box","mt-2","mx-0"],[1,"list-group-item","d-flex","justify-content-between","align-items-center"],[1,"pe-2"],[1,"grey-text","pe-2"],["href","https://github.com/homebridge/homebridge/wiki","target","_blank","rel","noopener noreferrer",1,"btn","btn-primary","waves-effect","m-0",2,"min-width","50px"],[1,"fas","fa-external-link-alt"],["href","https://github.com/homebridge/homebridge-config-ui-x/issues/new/choose","target","_blank","rel","noopener noreferrer",1,"btn","btn-primary","waves-effect","m-0",2,"min-width","50px"],["href","https://discord.gg/C87Pvq3","target","_blank","rel","noopener noreferrer",1,"btn","btn-primary","waves-effect","m-0",2,"min-width","50px"],["href","https://www.reddit.com/r/homebridge/","target","_blank","rel","noopener noreferrer",1,"btn","btn-primary","waves-effect","m-0",2,"min-width","50px"],["target","_blank","rel","noopener noreferrer",1,"btn","btn-primary","waves-effect","m-0",2,"min-width","50px",3,"href"],["href","https://developers.homebridge.io/#/","target","_blank","rel","noopener noreferrer",1,"btn","btn-primary","waves-effect","m-0",2,"min-width","50px"],["href","https://developers.homebridge.io/HAP-NodeJS/","target","_blank","rel","noopener noreferrer",1,"btn","btn-primary","waves-effect","m-0",2,"min-width","50px"],["href","https://github.com/homebridge/homebridge-plugin-template","target","_blank","rel","noopener noreferrer",1,"btn","btn-primary","waves-effect","m-0",2,"min-width","50px"],["href","https://github.com/homebridge/homebridge/wiki/Verified-Plugins","target","_blank","rel","noopener noreferrer",1,"btn","btn-primary","waves-effect","m-0",2,"min-width","50px"]],template:function(c,m){c&1&&(t(0,"div",0)(1,"h3",1),r(2),i(3,"translate"),a()(),t(4,"div",2)(5,"div",3),x("click",function(){return m.toggleSection("general")}),t(6,"h5",4),p(7,"i",5),r(8),i(9,"translate"),a()(),f(10,$,45,36,"ul",6),a(),t(11,"div",7)(12,"div",3),x("click",function(){return m.toggleSection("dev")}),t(13,"h5",4),p(14,"i",5),r(15),i(16,"translate"),a()(),f(17,P,56,46,"ul",8),a()),c&2&&(e(2),d(n(3,11,"support.title")),e(3),o("aria-expanded",m.showFields.general?"true":"false")("aria-controls","fieldsGeneral"),e(2),v("ngClass",w(17,F,m.showFields.general,!m.showFields.general)),e(),s(" ",n(9,13,"support.links.title")," "),e(2),h(m.showFields.general?10:-1),e(2),o("aria-expanded",m.showFields.dev?"true":"false")("aria-controls","fieldsDev"),e(2),v("ngClass",w(20,F,m.showFields.dev,!m.showFields.dev)),e(),s(" ",n(16,15,"support.dev.title")," "),e(2),h(m.showFields.dev?17:-1))},dependencies:[E,y],encapsulation:2})}return l})();export{z as SupportComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as u,h as s}from"./chunk-O7FV4MLW.js";import{k as p,n as l,q as d}from"./chunk-
|
|
1
|
+
import{e as u,h as s}from"./chunk-O7FV4MLW.js";import{k as p,n as l,q as d}from"./chunk-VWDC2WDK.js";import{gb as n,h as f,ka as c,la as i,pa as e,z as m}from"./chunk-UUXRTS4O.js";var a=(()=>{class t{$api=e(d);$router=e(u);$toastr=e(l);$translate=e(p);resolve(){return f(this,null,function*(){try{let o=yield m(this.$api.get("/config-editor"));return JSON.stringify(o,null,4)}catch(o){console.error(o),this.$toastr.error(o.message,this.$translate.instant("toast.title_error")),this.$router.navigate(["/"])}})}static \u0275fac=function(r){return new(r||t)};static \u0275prov=c({token:t,factory:t.\u0275fac})}return t})();var y=[{path:"",loadComponent:()=>import("./chunk-ZHCPTG5R.js").then(t=>t.ConfigEditorComponent),resolve:{config:a}}],v=(()=>{class t{static \u0275fac=function(r){return new(r||t)};static \u0275mod=n({type:t});static \u0275inj=i({imports:[s.forChild(y),s]})}return t})();var T=(()=>{class t{static \u0275fac=function(r){return new(r||t)};static \u0275mod=n({type:t});static \u0275inj=i({providers:[a],imports:[v]})}return t})();export{T as ConfigEditorModule};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as $v}from"./chunk-MEX6GNBR.js";import{a as gp,c as Fv,d as Ov,e as Ys,f as Lv,g as QU,h as pp}from"./chunk-7X2JJHYE.js";import{a as Bv}from"./chunk-JT7SPTVG.js";import{a as Uv}from"./chunk-N6D52WI6.js";import{a as qv}from"./chunk-JEQ5JQRP.js";import{a as Jc,b as Zc,c as Qc}from"./chunk-VCZ6KBM7.js";import{a as da}from"./chunk-MGZVKFCX.js";import{a as Vv}from"./chunk-DDJU52K4.js";import{a as Yc,b as Lo}from"./chunk-KSI5RFA4.js";import{a as Vo,b as qo}from"./chunk-PCFKF3RR.js";import{a as Mv}from"./chunk-HSDZKEAS.js";import{a as qc,b as Lc,c as $c,d as Kc,e as Gc,f as Wc,g as Oo,m as It,n as vi,o as jv,p as Dv,q as Nv,r as Rv,s as Ev,t as xr}from"./chunk-YHD44ZXJ.js";import{B as Av,C as us,D as ca,a as vv,b as kr,c as ro,e as Qt,f as wv,h as kv,i as Hv,j as Sv,k as Cv,l as Wi,m as xv,n as Iv,o as Pv,p as Hr,s as Fo,t as Sr,u as up,v as Cr,w as Tv,x as zv}from"./chunk-LZU5VVW4.js";import{a as Pr}from"./chunk-XOT3W4PF.js";import{e as Is}from"./chunk-O7FV4MLW.js";import{b as Tt}from"./chunk-HGLLMJ7J.js";import{k as rt,l as Pt,n as ot,p as Ir,q as Xe}from"./chunk-TXQH2OVO.js";import{$a as Nc,$b as he,$c as fv,A as Ac,Ab as b,Bb as U,Ca as Ss,Cb as oa,Cc as di,Db as na,Dc as ae,Ea as cs,Eb as aa,Ec as wr,Fa as nv,Fb as uv,G as Xy,Gb as gv,Gc as ds,Ha as Cs,Hc as so,Ia as av,Ic as _v,J as ev,Ja as lv,Jc as hv,K as jc,Kb as ie,L as tv,Na as Me,Nb as Q,O as sp,Oa as cv,Ob as Ec,Pb as S,R as _r,Ra as dv,Rc as yi,Sa as m,T as iv,Tb as Bc,Ua as Ni,Ub as Mc,V as rp,Va as Gs,Vb as Uc,Wb as br,Xa as lp,Xb as yr,Yb as Fc,Zb as bi,Zc as Vc,_a as Bo,_b as Ri,a as pe,ab as ra,ac as D,b as Fe,ba as op,bc as re,bd as bv,c as Jy,ca as Dc,cb as xs,cc as oe,da as np,dc as vr,e as v,ea as ls,ec as Oc,fa as sv,fb as ve,fd as yv,g as xt,gb as fr,h as ge,hb as Ws,hc as at,ib as Rc,ic as lt,ja as ap,jc as ct,k as eo,ka as pt,kc as pv,la as hr,lb as cp,lc as Mo,m as to,mc as st,na as Ks,nc as li,oa as rv,oc as la,p as Re,pa as j,pc as ci,q as Tc,qb as dp,qc as Uo,r as ip,rb as me,rc as mv,sa as ov,sb as T,t as Zy,tb as z,tc as R,u as zc,ua as J,uc as O,va as Z,vb as Je,vc as mt,wb as Ze,xb as Qe,y as Qy,ya as sa,yb as N,z as Ae,za as io,zb as y}from"./chunk-UUXRTS4O.js";var Xv=v(Ts=>{"use strict";Object.defineProperty(Ts,"__esModule",{value:!0});Ts.formatNames=Ts.fastFormats=Ts.fullFormats=void 0;function Ps(e,i){return{validate:e,compare:i}}Ts.fullFormats={date:Ps(Yv,fp),time:Ps(_p(!0),bp),"date-time":Ps(Kv(!0),Zv),"iso-time":Ps(_p(),Jv),"iso-date-time":Ps(Kv(),Qv),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:rF,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:uF,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:oF,int32:{type:"number",validate:lF},int64:{type:"number",validate:cF},float:{type:"number",validate:Wv},double:{type:"number",validate:Wv},password:!0,binary:!0};Ts.fastFormats=Fe(pe({},Ts.fullFormats),{date:Ps(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,fp),time:Ps(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,bp),"date-time":Ps(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Zv),"iso-time":Ps(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Jv),"iso-date-time":Ps(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Qv),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i});Ts.formatNames=Object.keys(Ts.fullFormats);function XU(e){return e%4===0&&(e%100!==0||e%400===0)}var eF=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,tF=[0,31,28,31,30,31,30,31,31,30,31,30,31];function Yv(e){let i=eF.exec(e);if(!i)return!1;let t=+i[1],s=+i[2],r=+i[3];return s>=1&&s<=12&&r>=1&&r<=(s===2&&XU(t)?29:tF[s])}function fp(e,i){if(e&&i)return e>i?1:e<i?-1:0}var mp=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function _p(e){return function(t){let s=mp.exec(t);if(!s)return!1;let r=+s[1],o=+s[2],l=+s[3],c=s[4],u=s[5]==="-"?-1:1,p=+(s[6]||0),_=+(s[7]||0);if(p>23||_>59||e&&!c)return!1;if(r<=23&&o<=59&&l<60)return!0;let f=o-_*u,H=r-p*u-(f<0?1:0);return(H===23||H===-1)&&(f===59||f===-1)&&l<61}}function bp(e,i){if(!(e&&i))return;let t=new Date("2020-01-01T"+e).valueOf(),s=new Date("2020-01-01T"+i).valueOf();if(t&&s)return t-s}function Jv(e,i){if(!(e&&i))return;let t=mp.exec(e),s=mp.exec(i);if(t&&s)return e=t[1]+t[2]+t[3],i=s[1]+s[2]+s[3],e>i?1:e<i?-1:0}var hp=/t|\s/i;function Kv(e){let i=_p(e);return function(s){let r=s.split(hp);return r.length===2&&Yv(r[0])&&i(r[1])}}function Zv(e,i){if(!(e&&i))return;let t=new Date(e).valueOf(),s=new Date(i).valueOf();if(t&&s)return t-s}function Qv(e,i){if(!(e&&i))return;let[t,s]=e.split(hp),[r,o]=i.split(hp),l=fp(t,r);if(l!==void 0)return l||bp(s,o)}var iF=/\/|:/,sF=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function rF(e){return iF.test(e)&&sF.test(e)}var Gv=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function oF(e){return Gv.lastIndex=0,Gv.test(e)}var nF=-(2**31),aF=2**31-1;function lF(e){return Number.isInteger(e)&&e<=aF&&e>=nF}function cF(e){return Number.isInteger(e)}function Wv(){return!0}var dF=/[^\\]\\Z/;function uF(e){if(dF.test(e))return!1;try{return new RegExp(e),!0}catch{return!1}}});var pa=v(We=>{"use strict";Object.defineProperty(We,"__esModule",{value:!0});We.regexpCode=We.getEsmExportName=We.getProperty=We.safeStringify=We.stringify=We.strConcat=We.addCodeArg=We.str=We._=We.nil=We._Code=We.Name=We.IDENTIFIER=We._CodeOrName=void 0;var ua=class{};We._CodeOrName=ua;We.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var oo=class extends ua{constructor(i){if(super(),!We.IDENTIFIER.test(i))throw new Error("CodeGen: name must be a valid identifier");this.str=i}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};We.Name=oo;var Yi=class extends ua{constructor(i){super(),this._items=typeof i=="string"?[i]:i}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let i=this._items[0];return i===""||i==='""'}get str(){var i;return(i=this._str)!==null&&i!==void 0?i:this._str=this._items.reduce((t,s)=>`${t}${s}`,"")}get names(){var i;return(i=this._names)!==null&&i!==void 0?i:this._names=this._items.reduce((t,s)=>(s instanceof oo&&(t[s.str]=(t[s.str]||0)+1),t),{})}};We._Code=Yi;We.nil=new Yi("");function ew(e,...i){let t=[e[0]],s=0;for(;s<i.length;)vp(t,i[s]),t.push(e[++s]);return new Yi(t)}We._=ew;var yp=new Yi("+");function tw(e,...i){let t=[ga(e[0])],s=0;for(;s<i.length;)t.push(yp),vp(t,i[s]),t.push(yp,ga(e[++s]));return gF(t),new Yi(t)}We.str=tw;function vp(e,i){i instanceof Yi?e.push(...i._items):i instanceof oo?e.push(i):e.push(_F(i))}We.addCodeArg=vp;function gF(e){let i=1;for(;i<e.length-1;){if(e[i]===yp){let t=pF(e[i-1],e[i+1]);if(t!==void 0){e.splice(i-1,3,t);continue}e[i++]="+"}i++}}function pF(e,i){if(i==='""')return e;if(e==='""')return i;if(typeof e=="string")return i instanceof oo||e[e.length-1]!=='"'?void 0:typeof i!="string"?`${e.slice(0,-1)}${i}"`:i[0]==='"'?e.slice(0,-1)+i.slice(1):void 0;if(typeof i=="string"&&i[0]==='"'&&!(e instanceof oo))return`"${e}${i.slice(1)}`}function mF(e,i){return i.emptyStr()?e:e.emptyStr()?i:tw`${e}${i}`}We.strConcat=mF;function _F(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:ga(Array.isArray(e)?e.join(","):e)}function hF(e){return new Yi(ga(e))}We.stringify=hF;function ga(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}We.safeStringify=ga;function fF(e){return typeof e=="string"&&We.IDENTIFIER.test(e)?new Yi(`.${e}`):ew`[${e}]`}We.getProperty=fF;function bF(e){if(typeof e=="string"&&We.IDENTIFIER.test(e))return new Yi(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}We.getEsmExportName=bF;function yF(e){return new Yi(e.toString())}We.regexpCode=yF});var Hp=v(ki=>{"use strict";Object.defineProperty(ki,"__esModule",{value:!0});ki.ValueScope=ki.ValueScopeName=ki.Scope=ki.varKinds=ki.UsedValueState=void 0;var wi=pa(),wp=class extends Error{constructor(i){super(`CodeGen: "code" for ${i} not defined`),this.value=i.value}},Xc=(function(e){return e[e.Started=0]="Started",e[e.Completed=1]="Completed",e})(Xc||(ki.UsedValueState=Xc={}));ki.varKinds={const:new wi.Name("const"),let:new wi.Name("let"),var:new wi.Name("var")};var ed=class{constructor({prefixes:i,parent:t}={}){this._names={},this._prefixes=i,this._parent=t}toName(i){return i instanceof wi.Name?i:this.name(i)}name(i){return new wi.Name(this._newName(i))}_newName(i){let t=this._names[i]||this._nameGroup(i);return`${i}${t.index++}`}_nameGroup(i){var t,s;if(!((s=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||s===void 0)&&s.has(i)||this._prefixes&&!this._prefixes.has(i))throw new Error(`CodeGen: prefix "${i}" is not allowed in this scope`);return this._names[i]={prefix:i,index:0}}};ki.Scope=ed;var td=class extends wi.Name{constructor(i,t){super(t),this.prefix=i}setValue(i,{property:t,itemIndex:s}){this.value=i,this.scopePath=(0,wi._)`.${new wi.Name(t)}[${s}]`}};ki.ValueScopeName=td;var vF=(0,wi._)`\n`,kp=class extends ed{constructor(i){super(i),this._values={},this._scope=i.scope,this.opts=Fe(pe({},i),{_n:i.lines?vF:wi.nil})}get(){return this._scope}name(i){return new td(i,this._newName(i))}value(i,t){var s;if(t.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let r=this.toName(i),{prefix:o}=r,l=(s=t.key)!==null&&s!==void 0?s:t.ref,c=this._values[o];if(c){let _=c.get(l);if(_)return _}else c=this._values[o]=new Map;c.set(l,r);let u=this._scope[o]||(this._scope[o]=[]),p=u.length;return u[p]=t.ref,r.setValue(t,{property:o,itemIndex:p}),r}getValue(i,t){let s=this._values[i];if(s)return s.get(t)}scopeRefs(i,t=this._values){return this._reduceValues(t,s=>{if(s.scopePath===void 0)throw new Error(`CodeGen: name "${s}" has no value`);return(0,wi._)`${i}${s.scopePath}`})}scopeCode(i=this._values,t,s){return this._reduceValues(i,r=>{if(r.value===void 0)throw new Error(`CodeGen: name "${r}" has no value`);return r.value.code},t,s)}_reduceValues(i,t,s={},r){let o=wi.nil;for(let l in i){let c=i[l];if(!c)continue;let u=s[l]=s[l]||new Map;c.forEach(p=>{if(u.has(p))return;u.set(p,Xc.Started);let _=t(p);if(_){let f=this.opts.es5?ki.varKinds.var:ki.varKinds.const;o=(0,wi._)`${o}${f} ${p} = ${_};${this.opts._n}`}else if(_=r?.(p))o=(0,wi._)`${o}${_}${this.opts._n}`;else throw new wp(p);u.set(p,Xc.Completed)})}return o}};ki.ValueScope=kp});var we=v(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});Ue.or=Ue.and=Ue.not=Ue.CodeGen=Ue.operators=Ue.varKinds=Ue.ValueScopeName=Ue.ValueScope=Ue.Scope=Ue.Name=Ue.regexpCode=Ue.stringify=Ue.getProperty=Ue.nil=Ue.strConcat=Ue.str=Ue._=void 0;var Ke=pa(),gs=Hp(),Tr=pa();Object.defineProperty(Ue,"_",{enumerable:!0,get:function(){return Tr._}});Object.defineProperty(Ue,"str",{enumerable:!0,get:function(){return Tr.str}});Object.defineProperty(Ue,"strConcat",{enumerable:!0,get:function(){return Tr.strConcat}});Object.defineProperty(Ue,"nil",{enumerable:!0,get:function(){return Tr.nil}});Object.defineProperty(Ue,"getProperty",{enumerable:!0,get:function(){return Tr.getProperty}});Object.defineProperty(Ue,"stringify",{enumerable:!0,get:function(){return Tr.stringify}});Object.defineProperty(Ue,"regexpCode",{enumerable:!0,get:function(){return Tr.regexpCode}});Object.defineProperty(Ue,"Name",{enumerable:!0,get:function(){return Tr.Name}});var nd=Hp();Object.defineProperty(Ue,"Scope",{enumerable:!0,get:function(){return nd.Scope}});Object.defineProperty(Ue,"ValueScope",{enumerable:!0,get:function(){return nd.ValueScope}});Object.defineProperty(Ue,"ValueScopeName",{enumerable:!0,get:function(){return nd.ValueScopeName}});Object.defineProperty(Ue,"varKinds",{enumerable:!0,get:function(){return nd.varKinds}});Ue.operators={GT:new Ke._Code(">"),GTE:new Ke._Code(">="),LT:new Ke._Code("<"),LTE:new Ke._Code("<="),EQ:new Ke._Code("==="),NEQ:new Ke._Code("!=="),NOT:new Ke._Code("!"),OR:new Ke._Code("||"),AND:new Ke._Code("&&"),ADD:new Ke._Code("+")};var Js=class{optimizeNodes(){return this}optimizeNames(i,t){return this}},Sp=class extends Js{constructor(i,t,s){super(),this.varKind=i,this.name=t,this.rhs=s}render({es5:i,_n:t}){let s=i?gs.varKinds.var:this.varKind,r=this.rhs===void 0?"":` = ${this.rhs}`;return`${s} ${this.name}${r};`+t}optimizeNames(i,t){if(i[this.name.str])return this.rhs&&(this.rhs=Ko(this.rhs,i,t)),this}get names(){return this.rhs instanceof Ke._CodeOrName?this.rhs.names:{}}},sd=class extends Js{constructor(i,t,s){super(),this.lhs=i,this.rhs=t,this.sideEffects=s}render({_n:i}){return`${this.lhs} = ${this.rhs};`+i}optimizeNames(i,t){if(!(this.lhs instanceof Ke.Name&&!i[this.lhs.str]&&!this.sideEffects))return this.rhs=Ko(this.rhs,i,t),this}get names(){let i=this.lhs instanceof Ke.Name?{}:pe({},this.lhs.names);return od(i,this.rhs)}},Cp=class extends sd{constructor(i,t,s,r){super(i,s,r),this.op=t}render({_n:i}){return`${this.lhs} ${this.op}= ${this.rhs};`+i}},xp=class extends Js{constructor(i){super(),this.label=i,this.names={}}render({_n:i}){return`${this.label}:`+i}},Ip=class extends Js{constructor(i){super(),this.label=i,this.names={}}render({_n:i}){return`break${this.label?` ${this.label}`:""};`+i}},Pp=class extends Js{constructor(i){super(),this.error=i}render({_n:i}){return`throw ${this.error};`+i}get names(){return this.error.names}},Tp=class extends Js{constructor(i){super(),this.code=i}render({_n:i}){return`${this.code};`+i}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(i,t){return this.code=Ko(this.code,i,t),this}get names(){return this.code instanceof Ke._CodeOrName?this.code.names:{}}},ma=class extends Js{constructor(i=[]){super(),this.nodes=i}render(i){return this.nodes.reduce((t,s)=>t+s.render(i),"")}optimizeNodes(){let{nodes:i}=this,t=i.length;for(;t--;){let s=i[t].optimizeNodes();Array.isArray(s)?i.splice(t,1,...s):s?i[t]=s:i.splice(t,1)}return i.length>0?this:void 0}optimizeNames(i,t){let{nodes:s}=this,r=s.length;for(;r--;){let o=s[r];o.optimizeNames(i,t)||(wF(i,o.names),s.splice(r,1))}return s.length>0?this:void 0}get names(){return this.nodes.reduce((i,t)=>no(i,t.names),{})}},Zs=class extends ma{render(i){return"{"+i._n+super.render(i)+"}"+i._n}},zp=class extends ma{},Ap=(()=>{class e extends Zs{}return e.kind="else",e})(),id=(()=>{class e extends Zs{constructor(t,s){super(s),this.condition=t}render(t){let s=`if(${this.condition})`+super.render(t);return this.else&&(s+="else "+this.else.render(t)),s}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let s=this.else;if(s){let r=s.optimizeNodes();s=this.else=Array.isArray(r)?new Ap(r):r}if(s)return t===!1?s instanceof e?s:s.nodes:this.nodes.length?this:new e(nw(t),s instanceof e?[s]:s.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(t,s){var r;if(this.else=(r=this.else)===null||r===void 0?void 0:r.optimizeNames(t,s),!!(super.optimizeNames(t,s)||this.else))return this.condition=Ko(this.condition,t,s),this}get names(){let t=super.names;return od(t,this.condition),this.else&&no(t,this.else.names),t}}return e.kind="if",e})(),ad=(()=>{class e extends Zs{}return e.kind="for",e})(),jp=class extends ad{constructor(i){super(),this.iteration=i}render(i){return`for(${this.iteration})`+super.render(i)}optimizeNames(i,t){if(super.optimizeNames(i,t))return this.iteration=Ko(this.iteration,i,t),this}get names(){return no(super.names,this.iteration.names)}},Dp=class extends ad{constructor(i,t,s,r){super(),this.varKind=i,this.name=t,this.from=s,this.to=r}render(i){let t=i.es5?gs.varKinds.var:this.varKind,{name:s,from:r,to:o}=this;return`for(${t} ${s}=${r}; ${s}<${o}; ${s}++)`+super.render(i)}get names(){let i=od(super.names,this.from);return od(i,this.to)}},rd=class extends ad{constructor(i,t,s,r){super(),this.loop=i,this.varKind=t,this.name=s,this.iterable=r}render(i){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(i)}optimizeNames(i,t){if(super.optimizeNames(i,t))return this.iterable=Ko(this.iterable,i,t),this}get names(){return no(super.names,this.iterable.names)}},iw=(()=>{class e extends Zs{constructor(t,s,r){super(),this.name=t,this.args=s,this.async=r}render(t){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(t)}}return e.kind="func",e})(),sw=(()=>{class e extends ma{render(t){return"return "+super.render(t)}}return e.kind="return",e})(),Np=class extends Zs{render(i){let t="try"+super.render(i);return this.catch&&(t+=this.catch.render(i)),this.finally&&(t+=this.finally.render(i)),t}optimizeNodes(){var i,t;return super.optimizeNodes(),(i=this.catch)===null||i===void 0||i.optimizeNodes(),(t=this.finally)===null||t===void 0||t.optimizeNodes(),this}optimizeNames(i,t){var s,r;return super.optimizeNames(i,t),(s=this.catch)===null||s===void 0||s.optimizeNames(i,t),(r=this.finally)===null||r===void 0||r.optimizeNames(i,t),this}get names(){let i=super.names;return this.catch&&no(i,this.catch.names),this.finally&&no(i,this.finally.names),i}},rw=(()=>{class e extends Zs{constructor(t){super(),this.error=t}render(t){return`catch(${this.error})`+super.render(t)}}return e.kind="catch",e})(),ow=(()=>{class e extends Zs{render(t){return"finally"+super.render(t)}}return e.kind="finally",e})(),Rp=class{constructor(i,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts=Fe(pe({},t),{_n:t.lines?`
|
|
1
|
+
import{a as $v}from"./chunk-3OHVXX6B.js";import{a as gp,c as Fv,d as Ov,e as Ys,f as Lv,g as QU,h as pp}from"./chunk-PTJ2WHN2.js";import{a as Bv}from"./chunk-JT7SPTVG.js";import{a as Uv}from"./chunk-N6D52WI6.js";import{a as qv}from"./chunk-QHBHZIPJ.js";import{a as Jc,b as Zc,c as Qc}from"./chunk-VCZ6KBM7.js";import{a as da}from"./chunk-MGZVKFCX.js";import{a as Vv}from"./chunk-DDJU52K4.js";import{a as Yc,b as Lo}from"./chunk-KSI5RFA4.js";import{a as Vo,b as qo}from"./chunk-PCFKF3RR.js";import{a as Mv}from"./chunk-LY2WH7XJ.js";import{a as qc,b as Lc,c as $c,d as Kc,e as Gc,f as Wc,g as Oo,m as It,n as vi,o as jv,p as Dv,q as Nv,r as Rv,s as Ev,t as xr}from"./chunk-YHD44ZXJ.js";import{B as Av,C as us,D as ca,a as vv,b as kr,c as ro,e as Qt,f as wv,h as kv,i as Hv,j as Sv,k as Cv,l as Wi,m as xv,n as Iv,o as Pv,p as Hr,s as Fo,t as Sr,u as up,v as Cr,w as Tv,x as zv}from"./chunk-LZU5VVW4.js";import{a as Pr}from"./chunk-4BWNO6KH.js";import{e as Is}from"./chunk-O7FV4MLW.js";import{b as Tt}from"./chunk-U6OOUZY4.js";import{k as rt,l as Pt,n as ot,p as Ir,q as Xe}from"./chunk-VWDC2WDK.js";import{$a as Nc,$b as he,$c as fv,A as Ac,Ab as b,Bb as U,Ca as Ss,Cb as oa,Cc as di,Db as na,Dc as ae,Ea as cs,Eb as aa,Ec as wr,Fa as nv,Fb as uv,G as Xy,Gb as gv,Gc as ds,Ha as Cs,Hc as so,Ia as av,Ic as _v,J as ev,Ja as lv,Jc as hv,K as jc,Kb as ie,L as tv,Na as Me,Nb as Q,O as sp,Oa as cv,Ob as Ec,Pb as S,R as _r,Ra as dv,Rc as yi,Sa as m,T as iv,Tb as Bc,Ua as Ni,Ub as Mc,V as rp,Va as Gs,Vb as Uc,Wb as br,Xa as lp,Xb as yr,Yb as Fc,Zb as bi,Zc as Vc,_a as Bo,_b as Ri,a as pe,ab as ra,ac as D,b as Fe,ba as op,bc as re,bd as bv,c as Jy,ca as Dc,cb as xs,cc as oe,da as np,dc as vr,e as v,ea as ls,ec as Oc,fa as sv,fb as ve,fd as yv,g as xt,gb as fr,h as ge,hb as Ws,hc as at,ib as Rc,ic as lt,ja as ap,jc as ct,k as eo,ka as pt,kc as pv,la as hr,lb as cp,lc as Mo,m as to,mc as st,na as Ks,nc as li,oa as rv,oc as la,p as Re,pa as j,pc as ci,q as Tc,qb as dp,qc as Uo,r as ip,rb as me,rc as mv,sa as ov,sb as T,t as Zy,tb as z,tc as R,u as zc,ua as J,uc as O,va as Z,vb as Je,vc as mt,wb as Ze,xb as Qe,y as Qy,ya as sa,yb as N,z as Ae,za as io,zb as y}from"./chunk-UUXRTS4O.js";var Xv=v(Ts=>{"use strict";Object.defineProperty(Ts,"__esModule",{value:!0});Ts.formatNames=Ts.fastFormats=Ts.fullFormats=void 0;function Ps(e,i){return{validate:e,compare:i}}Ts.fullFormats={date:Ps(Yv,fp),time:Ps(_p(!0),bp),"date-time":Ps(Kv(!0),Zv),"iso-time":Ps(_p(),Jv),"iso-date-time":Ps(Kv(),Qv),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:rF,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:uF,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:oF,int32:{type:"number",validate:lF},int64:{type:"number",validate:cF},float:{type:"number",validate:Wv},double:{type:"number",validate:Wv},password:!0,binary:!0};Ts.fastFormats=Fe(pe({},Ts.fullFormats),{date:Ps(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,fp),time:Ps(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,bp),"date-time":Ps(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Zv),"iso-time":Ps(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Jv),"iso-date-time":Ps(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Qv),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i});Ts.formatNames=Object.keys(Ts.fullFormats);function XU(e){return e%4===0&&(e%100!==0||e%400===0)}var eF=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,tF=[0,31,28,31,30,31,30,31,31,30,31,30,31];function Yv(e){let i=eF.exec(e);if(!i)return!1;let t=+i[1],s=+i[2],r=+i[3];return s>=1&&s<=12&&r>=1&&r<=(s===2&&XU(t)?29:tF[s])}function fp(e,i){if(e&&i)return e>i?1:e<i?-1:0}var mp=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function _p(e){return function(t){let s=mp.exec(t);if(!s)return!1;let r=+s[1],o=+s[2],l=+s[3],c=s[4],u=s[5]==="-"?-1:1,p=+(s[6]||0),_=+(s[7]||0);if(p>23||_>59||e&&!c)return!1;if(r<=23&&o<=59&&l<60)return!0;let f=o-_*u,H=r-p*u-(f<0?1:0);return(H===23||H===-1)&&(f===59||f===-1)&&l<61}}function bp(e,i){if(!(e&&i))return;let t=new Date("2020-01-01T"+e).valueOf(),s=new Date("2020-01-01T"+i).valueOf();if(t&&s)return t-s}function Jv(e,i){if(!(e&&i))return;let t=mp.exec(e),s=mp.exec(i);if(t&&s)return e=t[1]+t[2]+t[3],i=s[1]+s[2]+s[3],e>i?1:e<i?-1:0}var hp=/t|\s/i;function Kv(e){let i=_p(e);return function(s){let r=s.split(hp);return r.length===2&&Yv(r[0])&&i(r[1])}}function Zv(e,i){if(!(e&&i))return;let t=new Date(e).valueOf(),s=new Date(i).valueOf();if(t&&s)return t-s}function Qv(e,i){if(!(e&&i))return;let[t,s]=e.split(hp),[r,o]=i.split(hp),l=fp(t,r);if(l!==void 0)return l||bp(s,o)}var iF=/\/|:/,sF=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function rF(e){return iF.test(e)&&sF.test(e)}var Gv=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function oF(e){return Gv.lastIndex=0,Gv.test(e)}var nF=-(2**31),aF=2**31-1;function lF(e){return Number.isInteger(e)&&e<=aF&&e>=nF}function cF(e){return Number.isInteger(e)}function Wv(){return!0}var dF=/[^\\]\\Z/;function uF(e){if(dF.test(e))return!1;try{return new RegExp(e),!0}catch{return!1}}});var pa=v(We=>{"use strict";Object.defineProperty(We,"__esModule",{value:!0});We.regexpCode=We.getEsmExportName=We.getProperty=We.safeStringify=We.stringify=We.strConcat=We.addCodeArg=We.str=We._=We.nil=We._Code=We.Name=We.IDENTIFIER=We._CodeOrName=void 0;var ua=class{};We._CodeOrName=ua;We.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var oo=class extends ua{constructor(i){if(super(),!We.IDENTIFIER.test(i))throw new Error("CodeGen: name must be a valid identifier");this.str=i}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};We.Name=oo;var Yi=class extends ua{constructor(i){super(),this._items=typeof i=="string"?[i]:i}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let i=this._items[0];return i===""||i==='""'}get str(){var i;return(i=this._str)!==null&&i!==void 0?i:this._str=this._items.reduce((t,s)=>`${t}${s}`,"")}get names(){var i;return(i=this._names)!==null&&i!==void 0?i:this._names=this._items.reduce((t,s)=>(s instanceof oo&&(t[s.str]=(t[s.str]||0)+1),t),{})}};We._Code=Yi;We.nil=new Yi("");function ew(e,...i){let t=[e[0]],s=0;for(;s<i.length;)vp(t,i[s]),t.push(e[++s]);return new Yi(t)}We._=ew;var yp=new Yi("+");function tw(e,...i){let t=[ga(e[0])],s=0;for(;s<i.length;)t.push(yp),vp(t,i[s]),t.push(yp,ga(e[++s]));return gF(t),new Yi(t)}We.str=tw;function vp(e,i){i instanceof Yi?e.push(...i._items):i instanceof oo?e.push(i):e.push(_F(i))}We.addCodeArg=vp;function gF(e){let i=1;for(;i<e.length-1;){if(e[i]===yp){let t=pF(e[i-1],e[i+1]);if(t!==void 0){e.splice(i-1,3,t);continue}e[i++]="+"}i++}}function pF(e,i){if(i==='""')return e;if(e==='""')return i;if(typeof e=="string")return i instanceof oo||e[e.length-1]!=='"'?void 0:typeof i!="string"?`${e.slice(0,-1)}${i}"`:i[0]==='"'?e.slice(0,-1)+i.slice(1):void 0;if(typeof i=="string"&&i[0]==='"'&&!(e instanceof oo))return`"${e}${i.slice(1)}`}function mF(e,i){return i.emptyStr()?e:e.emptyStr()?i:tw`${e}${i}`}We.strConcat=mF;function _F(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:ga(Array.isArray(e)?e.join(","):e)}function hF(e){return new Yi(ga(e))}We.stringify=hF;function ga(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}We.safeStringify=ga;function fF(e){return typeof e=="string"&&We.IDENTIFIER.test(e)?new Yi(`.${e}`):ew`[${e}]`}We.getProperty=fF;function bF(e){if(typeof e=="string"&&We.IDENTIFIER.test(e))return new Yi(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}We.getEsmExportName=bF;function yF(e){return new Yi(e.toString())}We.regexpCode=yF});var Hp=v(ki=>{"use strict";Object.defineProperty(ki,"__esModule",{value:!0});ki.ValueScope=ki.ValueScopeName=ki.Scope=ki.varKinds=ki.UsedValueState=void 0;var wi=pa(),wp=class extends Error{constructor(i){super(`CodeGen: "code" for ${i} not defined`),this.value=i.value}},Xc=(function(e){return e[e.Started=0]="Started",e[e.Completed=1]="Completed",e})(Xc||(ki.UsedValueState=Xc={}));ki.varKinds={const:new wi.Name("const"),let:new wi.Name("let"),var:new wi.Name("var")};var ed=class{constructor({prefixes:i,parent:t}={}){this._names={},this._prefixes=i,this._parent=t}toName(i){return i instanceof wi.Name?i:this.name(i)}name(i){return new wi.Name(this._newName(i))}_newName(i){let t=this._names[i]||this._nameGroup(i);return`${i}${t.index++}`}_nameGroup(i){var t,s;if(!((s=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||s===void 0)&&s.has(i)||this._prefixes&&!this._prefixes.has(i))throw new Error(`CodeGen: prefix "${i}" is not allowed in this scope`);return this._names[i]={prefix:i,index:0}}};ki.Scope=ed;var td=class extends wi.Name{constructor(i,t){super(t),this.prefix=i}setValue(i,{property:t,itemIndex:s}){this.value=i,this.scopePath=(0,wi._)`.${new wi.Name(t)}[${s}]`}};ki.ValueScopeName=td;var vF=(0,wi._)`\n`,kp=class extends ed{constructor(i){super(i),this._values={},this._scope=i.scope,this.opts=Fe(pe({},i),{_n:i.lines?vF:wi.nil})}get(){return this._scope}name(i){return new td(i,this._newName(i))}value(i,t){var s;if(t.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let r=this.toName(i),{prefix:o}=r,l=(s=t.key)!==null&&s!==void 0?s:t.ref,c=this._values[o];if(c){let _=c.get(l);if(_)return _}else c=this._values[o]=new Map;c.set(l,r);let u=this._scope[o]||(this._scope[o]=[]),p=u.length;return u[p]=t.ref,r.setValue(t,{property:o,itemIndex:p}),r}getValue(i,t){let s=this._values[i];if(s)return s.get(t)}scopeRefs(i,t=this._values){return this._reduceValues(t,s=>{if(s.scopePath===void 0)throw new Error(`CodeGen: name "${s}" has no value`);return(0,wi._)`${i}${s.scopePath}`})}scopeCode(i=this._values,t,s){return this._reduceValues(i,r=>{if(r.value===void 0)throw new Error(`CodeGen: name "${r}" has no value`);return r.value.code},t,s)}_reduceValues(i,t,s={},r){let o=wi.nil;for(let l in i){let c=i[l];if(!c)continue;let u=s[l]=s[l]||new Map;c.forEach(p=>{if(u.has(p))return;u.set(p,Xc.Started);let _=t(p);if(_){let f=this.opts.es5?ki.varKinds.var:ki.varKinds.const;o=(0,wi._)`${o}${f} ${p} = ${_};${this.opts._n}`}else if(_=r?.(p))o=(0,wi._)`${o}${_}${this.opts._n}`;else throw new wp(p);u.set(p,Xc.Completed)})}return o}};ki.ValueScope=kp});var we=v(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});Ue.or=Ue.and=Ue.not=Ue.CodeGen=Ue.operators=Ue.varKinds=Ue.ValueScopeName=Ue.ValueScope=Ue.Scope=Ue.Name=Ue.regexpCode=Ue.stringify=Ue.getProperty=Ue.nil=Ue.strConcat=Ue.str=Ue._=void 0;var Ke=pa(),gs=Hp(),Tr=pa();Object.defineProperty(Ue,"_",{enumerable:!0,get:function(){return Tr._}});Object.defineProperty(Ue,"str",{enumerable:!0,get:function(){return Tr.str}});Object.defineProperty(Ue,"strConcat",{enumerable:!0,get:function(){return Tr.strConcat}});Object.defineProperty(Ue,"nil",{enumerable:!0,get:function(){return Tr.nil}});Object.defineProperty(Ue,"getProperty",{enumerable:!0,get:function(){return Tr.getProperty}});Object.defineProperty(Ue,"stringify",{enumerable:!0,get:function(){return Tr.stringify}});Object.defineProperty(Ue,"regexpCode",{enumerable:!0,get:function(){return Tr.regexpCode}});Object.defineProperty(Ue,"Name",{enumerable:!0,get:function(){return Tr.Name}});var nd=Hp();Object.defineProperty(Ue,"Scope",{enumerable:!0,get:function(){return nd.Scope}});Object.defineProperty(Ue,"ValueScope",{enumerable:!0,get:function(){return nd.ValueScope}});Object.defineProperty(Ue,"ValueScopeName",{enumerable:!0,get:function(){return nd.ValueScopeName}});Object.defineProperty(Ue,"varKinds",{enumerable:!0,get:function(){return nd.varKinds}});Ue.operators={GT:new Ke._Code(">"),GTE:new Ke._Code(">="),LT:new Ke._Code("<"),LTE:new Ke._Code("<="),EQ:new Ke._Code("==="),NEQ:new Ke._Code("!=="),NOT:new Ke._Code("!"),OR:new Ke._Code("||"),AND:new Ke._Code("&&"),ADD:new Ke._Code("+")};var Js=class{optimizeNodes(){return this}optimizeNames(i,t){return this}},Sp=class extends Js{constructor(i,t,s){super(),this.varKind=i,this.name=t,this.rhs=s}render({es5:i,_n:t}){let s=i?gs.varKinds.var:this.varKind,r=this.rhs===void 0?"":` = ${this.rhs}`;return`${s} ${this.name}${r};`+t}optimizeNames(i,t){if(i[this.name.str])return this.rhs&&(this.rhs=Ko(this.rhs,i,t)),this}get names(){return this.rhs instanceof Ke._CodeOrName?this.rhs.names:{}}},sd=class extends Js{constructor(i,t,s){super(),this.lhs=i,this.rhs=t,this.sideEffects=s}render({_n:i}){return`${this.lhs} = ${this.rhs};`+i}optimizeNames(i,t){if(!(this.lhs instanceof Ke.Name&&!i[this.lhs.str]&&!this.sideEffects))return this.rhs=Ko(this.rhs,i,t),this}get names(){let i=this.lhs instanceof Ke.Name?{}:pe({},this.lhs.names);return od(i,this.rhs)}},Cp=class extends sd{constructor(i,t,s,r){super(i,s,r),this.op=t}render({_n:i}){return`${this.lhs} ${this.op}= ${this.rhs};`+i}},xp=class extends Js{constructor(i){super(),this.label=i,this.names={}}render({_n:i}){return`${this.label}:`+i}},Ip=class extends Js{constructor(i){super(),this.label=i,this.names={}}render({_n:i}){return`break${this.label?` ${this.label}`:""};`+i}},Pp=class extends Js{constructor(i){super(),this.error=i}render({_n:i}){return`throw ${this.error};`+i}get names(){return this.error.names}},Tp=class extends Js{constructor(i){super(),this.code=i}render({_n:i}){return`${this.code};`+i}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(i,t){return this.code=Ko(this.code,i,t),this}get names(){return this.code instanceof Ke._CodeOrName?this.code.names:{}}},ma=class extends Js{constructor(i=[]){super(),this.nodes=i}render(i){return this.nodes.reduce((t,s)=>t+s.render(i),"")}optimizeNodes(){let{nodes:i}=this,t=i.length;for(;t--;){let s=i[t].optimizeNodes();Array.isArray(s)?i.splice(t,1,...s):s?i[t]=s:i.splice(t,1)}return i.length>0?this:void 0}optimizeNames(i,t){let{nodes:s}=this,r=s.length;for(;r--;){let o=s[r];o.optimizeNames(i,t)||(wF(i,o.names),s.splice(r,1))}return s.length>0?this:void 0}get names(){return this.nodes.reduce((i,t)=>no(i,t.names),{})}},Zs=class extends ma{render(i){return"{"+i._n+super.render(i)+"}"+i._n}},zp=class extends ma{},Ap=(()=>{class e extends Zs{}return e.kind="else",e})(),id=(()=>{class e extends Zs{constructor(t,s){super(s),this.condition=t}render(t){let s=`if(${this.condition})`+super.render(t);return this.else&&(s+="else "+this.else.render(t)),s}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let s=this.else;if(s){let r=s.optimizeNodes();s=this.else=Array.isArray(r)?new Ap(r):r}if(s)return t===!1?s instanceof e?s:s.nodes:this.nodes.length?this:new e(nw(t),s instanceof e?[s]:s.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(t,s){var r;if(this.else=(r=this.else)===null||r===void 0?void 0:r.optimizeNames(t,s),!!(super.optimizeNames(t,s)||this.else))return this.condition=Ko(this.condition,t,s),this}get names(){let t=super.names;return od(t,this.condition),this.else&&no(t,this.else.names),t}}return e.kind="if",e})(),ad=(()=>{class e extends Zs{}return e.kind="for",e})(),jp=class extends ad{constructor(i){super(),this.iteration=i}render(i){return`for(${this.iteration})`+super.render(i)}optimizeNames(i,t){if(super.optimizeNames(i,t))return this.iteration=Ko(this.iteration,i,t),this}get names(){return no(super.names,this.iteration.names)}},Dp=class extends ad{constructor(i,t,s,r){super(),this.varKind=i,this.name=t,this.from=s,this.to=r}render(i){let t=i.es5?gs.varKinds.var:this.varKind,{name:s,from:r,to:o}=this;return`for(${t} ${s}=${r}; ${s}<${o}; ${s}++)`+super.render(i)}get names(){let i=od(super.names,this.from);return od(i,this.to)}},rd=class extends ad{constructor(i,t,s,r){super(),this.loop=i,this.varKind=t,this.name=s,this.iterable=r}render(i){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(i)}optimizeNames(i,t){if(super.optimizeNames(i,t))return this.iterable=Ko(this.iterable,i,t),this}get names(){return no(super.names,this.iterable.names)}},iw=(()=>{class e extends Zs{constructor(t,s,r){super(),this.name=t,this.args=s,this.async=r}render(t){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(t)}}return e.kind="func",e})(),sw=(()=>{class e extends ma{render(t){return"return "+super.render(t)}}return e.kind="return",e})(),Np=class extends Zs{render(i){let t="try"+super.render(i);return this.catch&&(t+=this.catch.render(i)),this.finally&&(t+=this.finally.render(i)),t}optimizeNodes(){var i,t;return super.optimizeNodes(),(i=this.catch)===null||i===void 0||i.optimizeNodes(),(t=this.finally)===null||t===void 0||t.optimizeNodes(),this}optimizeNames(i,t){var s,r;return super.optimizeNames(i,t),(s=this.catch)===null||s===void 0||s.optimizeNames(i,t),(r=this.finally)===null||r===void 0||r.optimizeNames(i,t),this}get names(){let i=super.names;return this.catch&&no(i,this.catch.names),this.finally&&no(i,this.finally.names),i}},rw=(()=>{class e extends Zs{constructor(t){super(),this.error=t}render(t){return`catch(${this.error})`+super.render(t)}}return e.kind="catch",e})(),ow=(()=>{class e extends Zs{render(t){return"finally"+super.render(t)}}return e.kind="finally",e})(),Rp=class{constructor(i,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts=Fe(pe({},t),{_n:t.lines?`
|
|
2
2
|
`:""}),this._extScope=i,this._scope=new gs.Scope({parent:i}),this._nodes=[new zp]}toString(){return this._root.render(this.opts)}name(i){return this._scope.name(i)}scopeName(i){return this._extScope.name(i)}scopeValue(i,t){let s=this._extScope.value(i,t);return(this._values[s.prefix]||(this._values[s.prefix]=new Set)).add(s),s}getScopeValue(i,t){return this._extScope.getValue(i,t)}scopeRefs(i){return this._extScope.scopeRefs(i,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(i,t,s,r){let o=this._scope.toName(t);return s!==void 0&&r&&(this._constants[o.str]=s),this._leafNode(new Sp(i,o,s)),o}const(i,t,s){return this._def(gs.varKinds.const,i,t,s)}let(i,t,s){return this._def(gs.varKinds.let,i,t,s)}var(i,t,s){return this._def(gs.varKinds.var,i,t,s)}assign(i,t,s){return this._leafNode(new sd(i,t,s))}add(i,t){return this._leafNode(new Cp(i,Ue.operators.ADD,t))}code(i){return typeof i=="function"?i():i!==Ke.nil&&this._leafNode(new Tp(i)),this}object(...i){let t=["{"];for(let[s,r]of i)t.length>1&&t.push(","),t.push(s),(s!==r||this.opts.es5)&&(t.push(":"),(0,Ke.addCodeArg)(t,r));return t.push("}"),new Ke._Code(t)}if(i,t,s){if(this._blockNode(new id(i)),t&&s)this.code(t).else().code(s).endIf();else if(t)this.code(t).endIf();else if(s)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(i){return this._elseNode(new id(i))}else(){return this._elseNode(new Ap)}endIf(){return this._endBlockNode(id,Ap)}_for(i,t){return this._blockNode(i),t&&this.code(t).endFor(),this}for(i,t){return this._for(new jp(i),t)}forRange(i,t,s,r,o=this.opts.es5?gs.varKinds.var:gs.varKinds.let){let l=this._scope.toName(i);return this._for(new Dp(o,l,t,s),()=>r(l))}forOf(i,t,s,r=gs.varKinds.const){let o=this._scope.toName(i);if(this.opts.es5){let l=t instanceof Ke.Name?t:this.var("_arr",t);return this.forRange("_i",0,(0,Ke._)`${l}.length`,c=>{this.var(o,(0,Ke._)`${l}[${c}]`),s(o)})}return this._for(new rd("of",r,o,t),()=>s(o))}forIn(i,t,s,r=this.opts.es5?gs.varKinds.var:gs.varKinds.const){if(this.opts.ownProperties)return this.forOf(i,(0,Ke._)`Object.keys(${t})`,s);let o=this._scope.toName(i);return this._for(new rd("in",r,o,t),()=>s(o))}endFor(){return this._endBlockNode(ad)}label(i){return this._leafNode(new xp(i))}break(i){return this._leafNode(new Ip(i))}return(i){let t=new sw;if(this._blockNode(t),this.code(i),t.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(sw)}try(i,t,s){if(!t&&!s)throw new Error('CodeGen: "try" without "catch" and "finally"');let r=new Np;if(this._blockNode(r),this.code(i),t){let o=this.name("e");this._currNode=r.catch=new rw(o),t(o)}return s&&(this._currNode=r.finally=new ow,this.code(s)),this._endBlockNode(rw,ow)}throw(i){return this._leafNode(new Pp(i))}block(i,t){return this._blockStarts.push(this._nodes.length),i&&this.code(i).endBlock(t),this}endBlock(i){let t=this._blockStarts.pop();if(t===void 0)throw new Error("CodeGen: not in self-balancing block");let s=this._nodes.length-t;if(s<0||i!==void 0&&s!==i)throw new Error(`CodeGen: wrong number of nodes: ${s} vs ${i} expected`);return this._nodes.length=t,this}func(i,t=Ke.nil,s,r){return this._blockNode(new iw(i,t,s)),r&&this.code(r).endFunc(),this}endFunc(){return this._endBlockNode(iw)}optimize(i=1){for(;i-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(i){return this._currNode.nodes.push(i),this}_blockNode(i){this._currNode.nodes.push(i),this._nodes.push(i)}_endBlockNode(i,t){let s=this._currNode;if(s instanceof i||t&&s instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${i.kind}/${t.kind}`:i.kind}"`)}_elseNode(i){let t=this._currNode;if(!(t instanceof id))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=i,this}get _root(){return this._nodes[0]}get _currNode(){let i=this._nodes;return i[i.length-1]}set _currNode(i){let t=this._nodes;t[t.length-1]=i}};Ue.CodeGen=Rp;function no(e,i){for(let t in i)e[t]=(e[t]||0)+(i[t]||0);return e}function od(e,i){return i instanceof Ke._CodeOrName?no(e,i.names):e}function Ko(e,i,t){if(e instanceof Ke.Name)return s(e);if(!r(e))return e;return new Ke._Code(e._items.reduce((o,l)=>(l instanceof Ke.Name&&(l=s(l)),l instanceof Ke._Code?o.push(...l._items):o.push(l),o),[]));function s(o){let l=t[o.str];return l===void 0||i[o.str]!==1?o:(delete i[o.str],l)}function r(o){return o instanceof Ke._Code&&o._items.some(l=>l instanceof Ke.Name&&i[l.str]===1&&t[l.str]!==void 0)}}function wF(e,i){for(let t in i)e[t]=(e[t]||0)-(i[t]||0)}function nw(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,Ke._)`!${Ep(e)}`}Ue.not=nw;var kF=aw(Ue.operators.AND);function HF(...e){return e.reduce(kF)}Ue.and=HF;var SF=aw(Ue.operators.OR);function CF(...e){return e.reduce(SF)}Ue.or=CF;function aw(e){return(i,t)=>i===Ke.nil?t:t===Ke.nil?i:(0,Ke._)`${Ep(i)} ${e} ${Ep(t)}`}function Ep(e){return e instanceof Ke.Name?e:(0,Ke._)`(${e})`}});var qe=v(Oe=>{"use strict";Object.defineProperty(Oe,"__esModule",{value:!0});Oe.checkStrictMode=Oe.getErrorPath=Oe.Type=Oe.useFunc=Oe.setEvaluated=Oe.evaluatedPropsToName=Oe.mergeEvaluated=Oe.eachItem=Oe.unescapeJsonPointer=Oe.escapeJsonPointer=Oe.escapeFragment=Oe.unescapeFragment=Oe.schemaRefOrVal=Oe.schemaHasRulesButRef=Oe.schemaHasRules=Oe.checkUnknownRules=Oe.alwaysValidSchema=Oe.toHash=void 0;var _t=we(),xF=pa();function IF(e){let i={};for(let t of e)i[t]=!0;return i}Oe.toHash=IF;function PF(e,i){return typeof i=="boolean"?i:Object.keys(i).length===0?!0:(dw(e,i),!uw(i,e.self.RULES.all))}Oe.alwaysValidSchema=PF;function dw(e,i=e.schema){let{opts:t,self:s}=e;if(!t.strictSchema||typeof i=="boolean")return;let r=s.RULES.keywords;for(let o in i)r[o]||mw(e,`unknown keyword: "${o}"`)}Oe.checkUnknownRules=dw;function uw(e,i){if(typeof e=="boolean")return!e;for(let t in e)if(i[t])return!0;return!1}Oe.schemaHasRules=uw;function TF(e,i){if(typeof e=="boolean")return!e;for(let t in e)if(t!=="$ref"&&i.all[t])return!0;return!1}Oe.schemaHasRulesButRef=TF;function zF({topSchemaRef:e,schemaPath:i},t,s,r){if(!r){if(typeof t=="number"||typeof t=="boolean")return t;if(typeof t=="string")return(0,_t._)`${t}`}return(0,_t._)`${e}${i}${(0,_t.getProperty)(s)}`}Oe.schemaRefOrVal=zF;function AF(e){return gw(decodeURIComponent(e))}Oe.unescapeFragment=AF;function jF(e){return encodeURIComponent(Mp(e))}Oe.escapeFragment=jF;function Mp(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}Oe.escapeJsonPointer=Mp;function gw(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}Oe.unescapeJsonPointer=gw;function DF(e,i){if(Array.isArray(e))for(let t of e)i(t);else i(e)}Oe.eachItem=DF;function lw({mergeNames:e,mergeToName:i,mergeValues:t,resultToName:s}){return(r,o,l,c)=>{let u=l===void 0?o:l instanceof _t.Name?(o instanceof _t.Name?e(r,o,l):i(r,o,l),l):o instanceof _t.Name?(i(r,l,o),o):t(o,l);return c===_t.Name&&!(u instanceof _t.Name)?s(r,u):u}}Oe.mergeEvaluated={props:lw({mergeNames:(e,i,t)=>e.if((0,_t._)`${t} !== true && ${i} !== undefined`,()=>{e.if((0,_t._)`${i} === true`,()=>e.assign(t,!0),()=>e.assign(t,(0,_t._)`${t} || {}`).code((0,_t._)`Object.assign(${t}, ${i})`))}),mergeToName:(e,i,t)=>e.if((0,_t._)`${t} !== true`,()=>{i===!0?e.assign(t,!0):(e.assign(t,(0,_t._)`${t} || {}`),Up(e,t,i))}),mergeValues:(e,i)=>e===!0?!0:pe(pe({},e),i),resultToName:pw}),items:lw({mergeNames:(e,i,t)=>e.if((0,_t._)`${t} !== true && ${i} !== undefined`,()=>e.assign(t,(0,_t._)`${i} === true ? true : ${t} > ${i} ? ${t} : ${i}`)),mergeToName:(e,i,t)=>e.if((0,_t._)`${t} !== true`,()=>e.assign(t,i===!0?!0:(0,_t._)`${t} > ${i} ? ${t} : ${i}`)),mergeValues:(e,i)=>e===!0?!0:Math.max(e,i),resultToName:(e,i)=>e.var("items",i)})};function pw(e,i){if(i===!0)return e.var("props",!0);let t=e.var("props",(0,_t._)`{}`);return i!==void 0&&Up(e,t,i),t}Oe.evaluatedPropsToName=pw;function Up(e,i,t){Object.keys(t).forEach(s=>e.assign((0,_t._)`${i}${(0,_t.getProperty)(s)}`,!0))}Oe.setEvaluated=Up;var cw={};function NF(e,i){return e.scopeValue("func",{ref:i,code:cw[i.code]||(cw[i.code]=new xF._Code(i.code))})}Oe.useFunc=NF;var Bp=(function(e){return e[e.Num=0]="Num",e[e.Str=1]="Str",e})(Bp||(Oe.Type=Bp={}));function RF(e,i,t){if(e instanceof _t.Name){let s=i===Bp.Num;return t?s?(0,_t._)`"[" + ${e} + "]"`:(0,_t._)`"['" + ${e} + "']"`:s?(0,_t._)`"/" + ${e}`:(0,_t._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return t?(0,_t.getProperty)(e).toString():"/"+Mp(e)}Oe.getErrorPath=RF;function mw(e,i,t=e.opts.strictSchema){if(t){if(i=`strict mode: ${i}`,t===!0)throw new Error(i);e.self.logger.warn(i)}}Oe.checkStrictMode=mw});var Ji=v(Fp=>{"use strict";Object.defineProperty(Fp,"__esModule",{value:!0});var Xt=we(),EF={data:new Xt.Name("data"),valCxt:new Xt.Name("valCxt"),instancePath:new Xt.Name("instancePath"),parentData:new Xt.Name("parentData"),parentDataProperty:new Xt.Name("parentDataProperty"),rootData:new Xt.Name("rootData"),dynamicAnchors:new Xt.Name("dynamicAnchors"),vErrors:new Xt.Name("vErrors"),errors:new Xt.Name("errors"),this:new Xt.Name("this"),self:new Xt.Name("self"),scope:new Xt.Name("scope"),json:new Xt.Name("json"),jsonPos:new Xt.Name("jsonPos"),jsonLen:new Xt.Name("jsonLen"),jsonPart:new Xt.Name("jsonPart")};Fp.default=EF});var _a=v(ei=>{"use strict";Object.defineProperty(ei,"__esModule",{value:!0});ei.extendErrors=ei.resetErrorsCount=ei.reportExtraError=ei.reportError=ei.keyword$DataError=ei.keywordError=void 0;var Ge=we(),ld=qe(),ui=Ji();ei.keywordError={message:({keyword:e})=>(0,Ge.str)`must pass "${e}" keyword validation`};ei.keyword$DataError={message:({keyword:e,schemaType:i})=>i?(0,Ge.str)`"${e}" keyword must be ${i} ($data)`:(0,Ge.str)`"${e}" keyword is invalid ($data)`};function BF(e,i=ei.keywordError,t,s){let{it:r}=e,{gen:o,compositeRule:l,allErrors:c}=r,u=fw(e,i,t);s??(l||c)?_w(o,u):hw(r,(0,Ge._)`[${u}]`)}ei.reportError=BF;function MF(e,i=ei.keywordError,t){let{it:s}=e,{gen:r,compositeRule:o,allErrors:l}=s,c=fw(e,i,t);_w(r,c),o||l||hw(s,ui.default.vErrors)}ei.reportExtraError=MF;function UF(e,i){e.assign(ui.default.errors,i),e.if((0,Ge._)`${ui.default.vErrors} !== null`,()=>e.if(i,()=>e.assign((0,Ge._)`${ui.default.vErrors}.length`,i),()=>e.assign(ui.default.vErrors,null)))}ei.resetErrorsCount=UF;function FF({gen:e,keyword:i,schemaValue:t,data:s,errsCount:r,it:o}){if(r===void 0)throw new Error("ajv implementation error");let l=e.name("err");e.forRange("i",r,ui.default.errors,c=>{e.const(l,(0,Ge._)`${ui.default.vErrors}[${c}]`),e.if((0,Ge._)`${l}.instancePath === undefined`,()=>e.assign((0,Ge._)`${l}.instancePath`,(0,Ge.strConcat)(ui.default.instancePath,o.errorPath))),e.assign((0,Ge._)`${l}.schemaPath`,(0,Ge.str)`${o.errSchemaPath}/${i}`),o.opts.verbose&&(e.assign((0,Ge._)`${l}.schema`,t),e.assign((0,Ge._)`${l}.data`,s))})}ei.extendErrors=FF;function _w(e,i){let t=e.const("err",i);e.if((0,Ge._)`${ui.default.vErrors} === null`,()=>e.assign(ui.default.vErrors,(0,Ge._)`[${t}]`),(0,Ge._)`${ui.default.vErrors}.push(${t})`),e.code((0,Ge._)`${ui.default.errors}++`)}function hw(e,i){let{gen:t,validateName:s,schemaEnv:r}=e;r.$async?t.throw((0,Ge._)`new ${e.ValidationError}(${i})`):(t.assign((0,Ge._)`${s}.errors`,i),t.return(!1))}var ao={keyword:new Ge.Name("keyword"),schemaPath:new Ge.Name("schemaPath"),params:new Ge.Name("params"),propertyName:new Ge.Name("propertyName"),message:new Ge.Name("message"),schema:new Ge.Name("schema"),parentSchema:new Ge.Name("parentSchema")};function fw(e,i,t){let{createErrors:s}=e.it;return s===!1?(0,Ge._)`{}`:OF(e,i,t)}function OF(e,i,t={}){let{gen:s,it:r}=e,o=[VF(r,t),qF(e,t)];return LF(e,i,o),s.object(...o)}function VF({errorPath:e},{instancePath:i}){let t=i?(0,Ge.str)`${e}${(0,ld.getErrorPath)(i,ld.Type.Str)}`:e;return[ui.default.instancePath,(0,Ge.strConcat)(ui.default.instancePath,t)]}function qF({keyword:e,it:{errSchemaPath:i}},{schemaPath:t,parentSchema:s}){let r=s?i:(0,Ge.str)`${i}/${e}`;return t&&(r=(0,Ge.str)`${r}${(0,ld.getErrorPath)(t,ld.Type.Str)}`),[ao.schemaPath,r]}function LF(e,{params:i,message:t},s){let{keyword:r,data:o,schemaValue:l,it:c}=e,{opts:u,propertyName:p,topSchemaRef:_,schemaPath:f}=c;s.push([ao.keyword,r],[ao.params,typeof i=="function"?i(e):i||(0,Ge._)`{}`]),u.messages&&s.push([ao.message,typeof t=="function"?t(e):t]),u.verbose&&s.push([ao.schema,l],[ao.parentSchema,(0,Ge._)`${_}${f}`],[ui.default.data,o]),p&&s.push([ao.propertyName,p])}});var yw=v(Go=>{"use strict";Object.defineProperty(Go,"__esModule",{value:!0});Go.boolOrEmptySchema=Go.topBoolOrEmptySchema=void 0;var $F=_a(),KF=we(),GF=Ji(),WF={message:"boolean schema is false"};function YF(e){let{gen:i,schema:t,validateName:s}=e;t===!1?bw(e,!1):typeof t=="object"&&t.$async===!0?i.return(GF.default.data):(i.assign((0,KF._)`${s}.errors`,null),i.return(!0))}Go.topBoolOrEmptySchema=YF;function JF(e,i){let{gen:t,schema:s}=e;s===!1?(t.var(i,!1),bw(e)):t.var(i,!0)}Go.boolOrEmptySchema=JF;function bw(e,i){let{gen:t,data:s}=e,r={gen:t,keyword:"false schema",data:s,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,$F.reportError)(r,WF,void 0,i)}});var Op=v(Wo=>{"use strict";Object.defineProperty(Wo,"__esModule",{value:!0});Wo.getRules=Wo.isJSONType=void 0;var ZF=["string","number","integer","boolean","null","object","array"],QF=new Set(ZF);function XF(e){return typeof e=="string"&&QF.has(e)}Wo.isJSONType=XF;function eO(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:Fe(pe({},e),{integer:!0,boolean:!0,null:!0}),rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}Wo.getRules=eO});var Vp=v(zr=>{"use strict";Object.defineProperty(zr,"__esModule",{value:!0});zr.shouldUseRule=zr.shouldUseGroup=zr.schemaHasRulesForType=void 0;function tO({schema:e,self:i},t){let s=i.RULES.types[t];return s&&s!==!0&&vw(e,s)}zr.schemaHasRulesForType=tO;function vw(e,i){return i.rules.some(t=>ww(e,t))}zr.shouldUseGroup=vw;function ww(e,i){var t;return e[i.keyword]!==void 0||((t=i.definition.implements)===null||t===void 0?void 0:t.some(s=>e[s]!==void 0))}zr.shouldUseRule=ww});var ha=v(ti=>{"use strict";Object.defineProperty(ti,"__esModule",{value:!0});ti.reportTypeError=ti.checkDataTypes=ti.checkDataType=ti.coerceAndCheckDataType=ti.getJSONTypes=ti.getSchemaTypes=ti.DataType=void 0;var iO=Op(),sO=Vp(),rO=_a(),De=we(),kw=qe(),Yo=(function(e){return e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong",e})(Yo||(ti.DataType=Yo={}));function oO(e){let i=Hw(e.type);if(i.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!i.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&i.push("null")}return i}ti.getSchemaTypes=oO;function Hw(e){let i=Array.isArray(e)?e:e?[e]:[];if(i.every(iO.isJSONType))return i;throw new Error("type must be JSONType or JSONType[]: "+i.join(","))}ti.getJSONTypes=Hw;function nO(e,i){let{gen:t,data:s,opts:r}=e,o=aO(i,r.coerceTypes),l=i.length>0&&!(o.length===0&&i.length===1&&(0,sO.schemaHasRulesForType)(e,i[0]));if(l){let c=Lp(i,s,r.strictNumbers,Yo.Wrong);t.if(c,()=>{o.length?lO(e,i,o):$p(e)})}return l}ti.coerceAndCheckDataType=nO;var Sw=new Set(["string","number","integer","boolean","null"]);function aO(e,i){return i?e.filter(t=>Sw.has(t)||i==="array"&&t==="array"):[]}function lO(e,i,t){let{gen:s,data:r,opts:o}=e,l=s.let("dataType",(0,De._)`typeof ${r}`),c=s.let("coerced",(0,De._)`undefined`);o.coerceTypes==="array"&&s.if((0,De._)`${l} == 'object' && Array.isArray(${r}) && ${r}.length == 1`,()=>s.assign(r,(0,De._)`${r}[0]`).assign(l,(0,De._)`typeof ${r}`).if(Lp(i,r,o.strictNumbers),()=>s.assign(c,r))),s.if((0,De._)`${c} !== undefined`);for(let p of t)(Sw.has(p)||p==="array"&&o.coerceTypes==="array")&&u(p);s.else(),$p(e),s.endIf(),s.if((0,De._)`${c} !== undefined`,()=>{s.assign(r,c),cO(e,c)});function u(p){switch(p){case"string":s.elseIf((0,De._)`${l} == "number" || ${l} == "boolean"`).assign(c,(0,De._)`"" + ${r}`).elseIf((0,De._)`${r} === null`).assign(c,(0,De._)`""`);return;case"number":s.elseIf((0,De._)`${l} == "boolean" || ${r} === null
|
|
3
3
|
|| (${l} == "string" && ${r} && ${r} == +${r})`).assign(c,(0,De._)`+${r}`);return;case"integer":s.elseIf((0,De._)`${l} === "boolean" || ${r} === null
|
|
4
4
|
|| (${l} === "string" && ${r} && ${r} == +${r} && !(${r} % 1))`).assign(c,(0,De._)`+${r}`);return;case"boolean":s.elseIf((0,De._)`${r} === "false" || ${r} === 0 || ${r} === null`).assign(c,!1).elseIf((0,De._)`${r} === "true" || ${r} === 1`).assign(c,!0);return;case"null":s.elseIf((0,De._)`${r} === "" || ${r} === 0 || ${r} === false`),s.assign(c,null);return;case"array":s.elseIf((0,De._)`${l} === "string" || ${l} === "number"
|