acbridge 1.0.0 → 1.0.1
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/README.md +10 -0
- package/dist/acbridge.mjs +67 -63
- package/hub/dist/hub.cjs +20 -20
- package/package.json +1 -1
- package/plugin/plugins/alexa/dist/channel.mjs +6 -6
package/dist/acbridge.mjs
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __acbridgeCreateRequire } from "node:module";
|
|
3
3
|
const require = __acbridgeCreateRequire(import.meta.url);
|
|
4
|
-
var B_=Object.create;var fl=Object.defineProperty;var H_=Object.getOwnPropertyDescriptor;var Z_=Object.getOwnPropertyNames;var G_=Object.getPrototypeOf,W_=Object.prototype.hasOwnProperty;var te=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var q=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},Jt=(e,t)=>{for(var r in t)fl(e,r,{get:t[r],enumerable:!0})},V_=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Z_(t))!W_.call(e,n)&&n!==r&&fl(e,n,{get:()=>t[n],enumerable:!(o=H_(t,n))||o.enumerable});return e};var qt=(e,t,r)=>(r=e!=null?B_(G_(e)):{},V_(t||!e||!e.__esModule?fl(r,"default",{value:e,enumerable:!0}):r,e));var Nc=q(hg=>{"use strict";Object.defineProperty(hg,"__esModule",{value:!0});hg.default=OR;var y0=/[A-Z]/g;function b0(e){return e.toLowerCase()}function OR(e,t){let r=e.replace(y0,b0),o=t.replace(y0,b0);return r===o}});var vg=q(Li=>{"use strict";Object.defineProperty(Li,"__esModule",{value:!0});Li.DnsTxt=void 0;var Lc=class{constructor(t={}){this.binary=t?t.binary:!1}encode(t={}){return Object.entries(t).map(([r,o])=>{let n=`${r}=${o}`;return Buffer.from(n)})}decode(t){var r={};try{let n=t.toString().split(/=(.+)/),i=n[0],a=n[1];r[i]=a}catch{}return r}decodeAll(t){return t.filter(r=>r.length>1).map(r=>this.decode(r)).reduce((r,o)=>{var n=r;let[i]=Object.keys(o),[a]=Object.values(o);return n[i]=a,n},{})}};Li.DnsTxt=Lc;Li.default=Lc});var yg=q(yo=>{"use strict";Object.defineProperty(yo,"__esModule",{value:!0});yo.toType=yo.toString=void 0;var x0=e=>"_"+e,DR=e=>["name","protocol","subtype"].includes(e),NR=e=>{let t={name:e.name,protocol:e.protocol,subtype:e.subtype};return Object.entries(t).filter(([o,n])=>DR(o)&&n!==void 0).reduce((o,[n,i])=>(typeof i==="object"?i.map(a=>o.push(x0(a))):o.push(x0(i)),o),[]).join(".")};yo.toString=NR;var LR=e=>{let t=e.split("."),r;for(let o in t)t[o][0]==="_"&&(t[o]=t[o].slice(1));return t.includes("sub")&&(r=t.shift(),t.shift()),{name:t.shift(),protocol:t.shift()||null,subtype:r}};yo.toType=LR});var bg=q(lr=>{"use strict";var w0=lr&&lr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(lr,"__esModule",{value:!0});lr.Service=void 0;var k0=w0(te("os")),UR=w0(vg()),zR=te("events"),jR=yg(),bo=".local",Uc=class extends zR.EventEmitter{constructor(t,r,o){if(super(),this.start=r,this.stop=o,this.probe=!0,this.published=!1,this.activated=!1,this.destroyed=!1,this.txtService=new UR.default,!t.name)throw new Error("ServiceConfig requires `name` property to be set");if(!t.type)throw new Error("ServiceConfig requires `type` property to be set");if(!t.port)throw new Error("ServiceConfig requires `port` property to be set");this.name=t.name.split(".").join("-"),this.protocol=t.protocol||"tcp",this.type=(0,jR.toString)({name:t.type,protocol:this.protocol}),this.port=t.port,this.host=t.host||k0.default.hostname(),this.fqdn=`${this.name}.${this.type}${bo}`,this.txt=t.txt,this.subtypes=t.subtypes,this.disableIPv6=!!t.disableIPv6}records(){var t=[this.RecordPTR(this),this.RecordSRV(this),this.RecordTXT(this),this.RecordServicePTR(this)];for(let o of this.subtypes||[])t.push(this.RecordSubtypePTR(this,o));let r=Object.values(k0.default.networkInterfaces());for(let o of r){let n=o;for(let i of n)if(!(i.internal||i.mac==="00:00:00:00:00:00"))switch(i.family){case"IPv4":t.push(this.RecordA(this,i.address));break;case"IPv6":if(this.disableIPv6)break;t.push(this.RecordAAAA(this,i.address));break}}return t}RecordPTR(t){return{name:`${t.type}${bo}`,type:"PTR",ttl:28800,data:t.fqdn}}RecordServicePTR(t){return{name:`_services._dns-sd._udp${bo}`,type:"PTR",ttl:120,data:`${t.type}${bo}`}}RecordSubtypePTR(t,r){return{name:`_${r}._sub.${t.type}${bo}`,type:"PTR",ttl:28800,data:`${t.name}.${t.type}${bo}`}}RecordSRV(t){return{name:t.fqdn,type:"SRV",ttl:120,data:{port:t.port,target:t.host}}}RecordTXT(t){return{name:t.fqdn,type:"TXT",ttl:4500,data:this.txtService.encode(t.txt)}}RecordA(t,r){return{name:t.host,type:"A",ttl:120,data:r}}RecordAAAA(t,r){return{name:t.host,type:"AAAA",ttl:120,data:r}}};lr.Service=Uc;lr.default=Uc});var _0=q(ur=>{"use strict";var S0=ur&&ur.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ur,"__esModule",{value:!0});ur.Registry=void 0;var FR=S0(Nc()),xg=S0(bg()),MR=3600*1e3,BR=3,HR=function(){},zc=class{constructor(t){this.services=[],this.server=t}publish(t){let r=t.probe!==!1,o=new xg.default(t,n.bind(null,this),i.bind(null,this));function n(a,{probe:s=r}={}){o.activated||(o.activated=!0,a.services.push(o),o instanceof xg.default&&(s?a.probe(a.server.mdns,o,l=>{if(l){o.stop!==void 0&&o.stop(),console.log(new Error("Service name is already in use on the network"));return}a.announce(a.server,o)}):a.announce(a.server,o)))}function i(a,s){if(s||(s=HR),!o.activated||!(o instanceof xg.default))return process.nextTick(s);a.teardown(a.server,o,s);let l=a.services.indexOf(o);l!==-1&&a.services.splice(l,1)}return o.start(),o}unpublishAll(t){this.teardown(this.server,this.services,t),this.services=[]}destroy(){this.services.map(t=>t.destroyed=!0)}probe(t,r,o){var n=!1,i=0,a;let s=()=>{!r.activated||r.destroyed||t.query(r.fqdn,"ANY",function(){n=!0,a=setTimeout(++i<3?s:d,250),a.unref()})},l=p=>{n&&(p.answers.some(u)||p.additionals.some(u))&&d(!0)},u=p=>(0,FR.default)(p.name,r.fqdn),d=p=>{t.removeListener("response",l),clearTimeout(a),o(!!p)};t.on("response",l),setTimeout(s,Math.random()*250)}announce(t,r){var o=1e3,n=r.records();t.register(n);let i=()=>{!r.activated||r.destroyed||t.mdns.respond(n,function(){r.published||(r.activated=!0,r.published=!0,r.emit("up")),o=o*BR,o<MR&&!r.destroyed&&setTimeout(i,o).unref()})};i()}teardown(t,r,o){Array.isArray(r)||(r=[r]),r=r.filter(i=>i.activated);var n=r.flatMap(function(i){i.activated=!1;var a=i.records();return a.forEach(s=>{s.ttl=0}),a});if(n.length===0)return o&&process.nextTick(o);t.unregister(n),t.mdns.respond(n,function(){r.forEach(function(i){i.published=!1}),typeof o=="function"&&o.apply(null,arguments)})}};ur.Registry=zc;ur.default=zc});var $0=q(kg=>{"use strict";kg.toString=function(e){switch(e){case 1:return"A";case 10:return"NULL";case 28:return"AAAA";case 18:return"AFSDB";case 42:return"APL";case 257:return"CAA";case 60:return"CDNSKEY";case 59:return"CDS";case 37:return"CERT";case 5:return"CNAME";case 49:return"DHCID";case 32769:return"DLV";case 39:return"DNAME";case 48:return"DNSKEY";case 43:return"DS";case 55:return"HIP";case 13:return"HINFO";case 45:return"IPSECKEY";case 25:return"KEY";case 36:return"KX";case 29:return"LOC";case 15:return"MX";case 35:return"NAPTR";case 2:return"NS";case 47:return"NSEC";case 50:return"NSEC3";case 51:return"NSEC3PARAM";case 12:return"PTR";case 46:return"RRSIG";case 17:return"RP";case 24:return"SIG";case 6:return"SOA";case 99:return"SPF";case 33:return"SRV";case 44:return"SSHFP";case 32768:return"TA";case 249:return"TKEY";case 52:return"TLSA";case 250:return"TSIG";case 16:return"TXT";case 252:return"AXFR";case 251:return"IXFR";case 41:return"OPT";case 255:return"ANY"}return"UNKNOWN_"+e};kg.toType=function(e){switch(e.toUpperCase()){case"A":return 1;case"NULL":return 10;case"AAAA":return 28;case"AFSDB":return 18;case"APL":return 42;case"CAA":return 257;case"CDNSKEY":return 60;case"CDS":return 59;case"CERT":return 37;case"CNAME":return 5;case"DHCID":return 49;case"DLV":return 32769;case"DNAME":return 39;case"DNSKEY":return 48;case"DS":return 43;case"HIP":return 55;case"HINFO":return 13;case"IPSECKEY":return 45;case"KEY":return 25;case"KX":return 36;case"LOC":return 29;case"MX":return 15;case"NAPTR":return 35;case"NS":return 2;case"NSEC":return 47;case"NSEC3":return 50;case"NSEC3PARAM":return 51;case"PTR":return 12;case"RRSIG":return 46;case"RP":return 17;case"SIG":return 24;case"SOA":return 6;case"SPF":return 99;case"SRV":return 33;case"SSHFP":return 44;case"TA":return 32768;case"TKEY":return 249;case"TLSA":return 52;case"TSIG":return 250;case"TXT":return 16;case"AXFR":return 252;case"IXFR":return 251;case"OPT":return 41;case"ANY":return 255;case"*":return 255}return e.toUpperCase().startsWith("UNKNOWN_")?parseInt(e.slice(8)):0}});var I0=q(wg=>{"use strict";wg.toString=function(e){switch(e){case 0:return"NOERROR";case 1:return"FORMERR";case 2:return"SERVFAIL";case 3:return"NXDOMAIN";case 4:return"NOTIMP";case 5:return"REFUSED";case 6:return"YXDOMAIN";case 7:return"YXRRSET";case 8:return"NXRRSET";case 9:return"NOTAUTH";case 10:return"NOTZONE";case 11:return"RCODE_11";case 12:return"RCODE_12";case 13:return"RCODE_13";case 14:return"RCODE_14";case 15:return"RCODE_15"}return"RCODE_"+e};wg.toRcode=function(e){switch(e.toUpperCase()){case"NOERROR":return 0;case"FORMERR":return 1;case"SERVFAIL":return 2;case"NXDOMAIN":return 3;case"NOTIMP":return 4;case"REFUSED":return 5;case"YXDOMAIN":return 6;case"YXRRSET":return 7;case"NXRRSET":return 8;case"NOTAUTH":return 9;case"NOTZONE":return 10;case"RCODE_11":return 11;case"RCODE_12":return 12;case"RCODE_13":return 13;case"RCODE_14":return 14;case"RCODE_15":return 15}return 0}});var A0=q(Sg=>{"use strict";Sg.toString=function(e){switch(e){case 0:return"QUERY";case 1:return"IQUERY";case 2:return"STATUS";case 3:return"OPCODE_3";case 4:return"NOTIFY";case 5:return"UPDATE";case 6:return"OPCODE_6";case 7:return"OPCODE_7";case 8:return"OPCODE_8";case 9:return"OPCODE_9";case 10:return"OPCODE_10";case 11:return"OPCODE_11";case 12:return"OPCODE_12";case 13:return"OPCODE_13";case 14:return"OPCODE_14";case 15:return"OPCODE_15"}return"OPCODE_"+e};Sg.toOpcode=function(e){switch(e.toUpperCase()){case"QUERY":return 0;case"IQUERY":return 1;case"STATUS":return 2;case"OPCODE_3":return 3;case"NOTIFY":return 4;case"UPDATE":return 5;case"OPCODE_6":return 6;case"OPCODE_7":return 7;case"OPCODE_8":return 8;case"OPCODE_9":return 9;case"OPCODE_10":return 10;case"OPCODE_11":return 11;case"OPCODE_12":return 12;case"OPCODE_13":return 13;case"OPCODE_14":return 14;case"OPCODE_15":return 15}return 0}});var E0=q(_g=>{"use strict";_g.toString=function(e){switch(e){case 1:return"IN";case 2:return"CS";case 3:return"CH";case 4:return"HS";case 255:return"ANY"}return"UNKNOWN_"+e};_g.toClass=function(e){switch(e.toUpperCase()){case"IN":return 1;case"CS":return 2;case"CH":return 3;case"HS":return 4;case"ANY":return 255}return 0}});var P0=q($g=>{"use strict";$g.toString=function(e){switch(e){case 1:return"LLQ";case 2:return"UL";case 3:return"NSID";case 5:return"DAU";case 6:return"DHU";case 7:return"N3U";case 8:return"CLIENT_SUBNET";case 9:return"EXPIRE";case 10:return"COOKIE";case 11:return"TCP_KEEPALIVE";case 12:return"PADDING";case 13:return"CHAIN";case 14:return"KEY_TAG";case 26946:return"DEVICEID"}return e<0?null:`OPTION_${e}`};$g.toCode=function(e){if(typeof e=="number")return e;if(!e)return-1;switch(e.toUpperCase()){case"OPTION_0":return 0;case"LLQ":return 1;case"UL":return 2;case"NSID":return 3;case"OPTION_4":return 4;case"DAU":return 5;case"DHU":return 6;case"N3U":return 7;case"CLIENT_SUBNET":return 8;case"EXPIRE":return 9;case"COOKIE":return 10;case"TCP_KEEPALIVE":return 11;case"PADDING":return 12;case"CHAIN":return 13;case"KEY_TAG":return 14;case"DEVICEID":return 26946;case"OPTION_65535":return 65535}let t=e.match(/_(\d+)$/);return t?parseInt(t[1],10):-1}});var R0=q((T0,Ig)=>{var C0=(function(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decode=p,e.encode=d,e.familyOf=u,e.name=void 0,e.sizeOf=l,e.v6=e.v4=void 0;let t=/^(\d{1,3}\.){3,3}\d{1,3}$/,r=4,o=/^(::)?(((\d{1,3}\.){3}(\d{1,3}){1})?([0-9a-f]){0,4}:{0,2}){1,8}(::)?$/i,n=16,i={name:"v4",size:r,isFormat:m=>t.test(m),encode(m,f,g){g=~~g,f=f||new Uint8Array(g+r);let y=m.length,k=0;for(let _=0;_<y;){let P=m.charCodeAt(_++);P===46?(f[g++]=k,k=0):k=k*10+(P-48)}return f[g]=k,f},decode(m,f){return f=~~f,`${m[f++]}.${m[f++]}.${m[f++]}.${m[f]}`}};e.v4=i;let a={name:"v6",size:n,isFormat:m=>m.length>0&&o.test(m),encode(m,f,g){g=~~g;let y=g+n,k=-1,_=0,P=0,C=!0,E=!1;f=f||new Uint8Array(g+n);for(let D=0;D<m.length;D++){let G=m.charCodeAt(D);G===58?(C?k!==-1?(g<y&&(f[g]=0),g<y-1&&(f[g+1]=0),g+=2):g<y&&(k=g):(E===!0?(g<y&&(f[g]=P),g++):(g<y&&(f[g]=_>>8),g<y-1&&(f[g+1]=_&255),g+=2),_=0,P=0),C=!0,E=!1):G===46?(g<y&&(f[g]=P),g++,P=0,_=0,C=!1,E=!0):(C=!1,G>=97?G-=87:G>=65?G-=55:(G-=48,P=P*10+G),_=(_<<4)+G)}if(C===!1)E===!0?(g<y&&(f[g]=P),g++):(g<y&&(f[g]=_>>8),g<y-1&&(f[g+1]=_&255),g+=2);else if(k===0)g<y&&(f[g]=0),g<y-1&&(f[g+1]=0),g+=2;else if(k!==-1){g+=2;for(let D=Math.min(g-1,y-1);D>=k+2;D--)f[D]=f[D-2];f[k]=0,f[k+1]=0,k=g}if(k!==g&&k!==-1)for(g>y-2&&(g=y-2);y>k;)f[--y]=g<y&&g>k?f[--g]:0;else for(;g<y;)f[g++]=0;return f},decode(m,f){f=~~f;let g="";for(let y=0;y<n;y+=2)y!==0&&(g+=":"),g+=(m[f+y]<<8|m[f+y+1]).toString(16);return g.replace(/(^|:)0(:0)*:0(:|$)/,"$1::$3").replace(/:{3,4}/,"::")}};e.v6=a;let s="ip";e.name=s;function l(m){if(i.isFormat(m))return i.size;if(a.isFormat(m))return a.size;throw Error(`Invalid ip address: ${m}`)}function u(m){return l(m)===i.size?1:2}function d(m,f,g){g=~~g;let y=l(m);return typeof f=="function"&&(f=f(g+y)),y===i.size?i.encode(m,f,g):a.encode(m,f,g)}function p(m,f,g){if(f=~~f,g=g||m.length-f,g===i.size)return i.decode(m,f,g);if(g===a.size)return a.decode(m,f,g);throw Error(`Invalid buffer size needs to be ${i.size} for v4 or ${a.size} for v6.`)}return"default"in e?e.default:e})({});typeof define=="function"&&define.amd?define([],function(){return C0}):typeof Ig=="object"&&typeof T0=="object"&&(Ig.exports=C0)});var N0=q(N=>{"use strict";var L=te("buffer").Buffer,yn=$0(),ZR=I0(),GR=A0(),Fc=E0(),Ag=P0(),dr=R0(),WR=0,O0=32768,Eg=32768,VR=~Eg,D0=32768,JR=~D0,R=N.name={};R.encode=function(e,t,r,{mail:o=!1}={}){t||(t=L.alloc(R.encodingLength(e))),r||(r=0);let n=r,i=e.replace(/^\.|\.$/gm,"");if(i.length){let a=[];if(o){let s="";i.split(".").forEach(l=>{l.endsWith("\\")?s+=(s.length?".":"")+l.slice(0,-1):a.length===0&&s.length?a.push(s+"."+l):a.push(l)})}else a=i.split(".");for(let s=0;s<a.length;s++){let l=t.write(a[s],r+1);t[r]=l,r+=l+1}}return t[r++]=0,R.encode.bytes=r-n,t};R.encode.bytes=0;R.decode=function(e,t,{mail:r=!1}={}){t||(t=0);let o=[],n=t,i=0,a=0,s=!1;for(;;){if(t>=e.length)throw new Error("Cannot decode name (buffer overflow)");let l=e[t++];if(a+=s?0:1,l===0)break;if((l&192)===0){if(t+l>e.length)throw new Error("Cannot decode name (buffer overflow)");if(i+=l+1,i>254)throw new Error("Cannot decode name (name too long)");let u=e.toString("utf-8",t,t+l);r&&(u=u.replace(/\./g,"\\.")),o.push(u),t+=l,a+=s?0:l}else if((l&192)===192){if(t+1>e.length)throw new Error("Cannot decode name (buffer overflow)");let u=e.readUInt16BE(t-1)-49152;if(u>=n)throw new Error("Cannot decode name (bad pointer)");t=u,n=u,a+=s?0:1,s=!0}else throw new Error("Cannot decode name (bad label)")}return R.decode.bytes=a,o.length===0?".":o.join(".")};R.decode.bytes=0;R.encodingLength=function(e){return e==="."||e===".."?1:L.byteLength(e.replace(/^\.|\.$/gm,""))+2};var J={};J.encode=function(e,t,r){t||(t=L.alloc(J.encodingLength(e))),r||(r=0);let o=t.write(e,r+1);return t[r]=o,J.encode.bytes=o+1,t};J.encode.bytes=0;J.decode=function(e,t){t||(t=0);let r=e[t],o=e.toString("utf-8",t+1,t+1+r);return J.decode.bytes=r+1,o};J.decode.bytes=0;J.encodingLength=function(e){return L.byteLength(e)+1};var Et={};Et.encode=function(e,t,r){t||(t=Et.encodingLength(e)),r||(r=0);let o=(e.flags||0)&32767,n=e.type==="response"?O0:WR;return t.writeUInt16BE(e.id||0,r),t.writeUInt16BE(o|n,r+2),t.writeUInt16BE(e.questions.length,r+4),t.writeUInt16BE(e.answers.length,r+6),t.writeUInt16BE(e.authorities.length,r+8),t.writeUInt16BE(e.additionals.length,r+10),t};Et.encode.bytes=12;Et.decode=function(e,t){if(t||(t=0),e.length<12)throw new Error("Header must be 12 bytes");let r=e.readUInt16BE(t+2);return{id:e.readUInt16BE(t),type:r&O0?"response":"query",flags:r&32767,flag_qr:(r>>15&1)===1,opcode:GR.toString(r>>11&15),flag_aa:(r>>10&1)===1,flag_tc:(r>>9&1)===1,flag_rd:(r>>8&1)===1,flag_ra:(r>>7&1)===1,flag_z:(r>>6&1)===1,flag_ad:(r>>5&1)===1,flag_cd:(r>>4&1)===1,rcode:ZR.toString(r&15),questions:new Array(e.readUInt16BE(t+4)),answers:new Array(e.readUInt16BE(t+6)),authorities:new Array(e.readUInt16BE(t+8)),additionals:new Array(e.readUInt16BE(t+10))}};Et.decode.bytes=12;Et.encodingLength=function(){return 12};var ln=N.unknown={};ln.encode=function(e,t,r){return t||(t=L.alloc(ln.encodingLength(e))),r||(r=0),t.writeUInt16BE(e.length,r),e.copy(t,r+2),ln.encode.bytes=e.length+2,t};ln.encode.bytes=0;ln.decode=function(e,t){t||(t=0);let r=e.readUInt16BE(t),o=e.slice(t+2,t+2+r);return ln.decode.bytes=r+2,o};ln.decode.bytes=0;ln.encodingLength=function(e){return e.length+2};var un=N.ns={};un.encode=function(e,t,r){return t||(t=L.alloc(un.encodingLength(e))),r||(r=0),R.encode(e,t,r+2),t.writeUInt16BE(R.encode.bytes,r),un.encode.bytes=R.encode.bytes+2,t};un.encode.bytes=0;un.decode=function(e,t){t||(t=0);let r=e.readUInt16BE(t),o=R.decode(e,t+2);return un.decode.bytes=r+2,o};un.decode.bytes=0;un.encodingLength=function(e){return R.encodingLength(e)+2};var dn=N.soa={};dn.encode=function(e,t,r){t||(t=L.alloc(dn.encodingLength(e))),r||(r=0);let o=r;return r+=2,R.encode(e.mname,t,r),r+=R.encode.bytes,R.encode(e.rname,t,r,{mail:!0}),r+=R.encode.bytes,t.writeUInt32BE(e.serial||0,r),r+=4,t.writeUInt32BE(e.refresh||0,r),r+=4,t.writeUInt32BE(e.retry||0,r),r+=4,t.writeUInt32BE(e.expire||0,r),r+=4,t.writeUInt32BE(e.minimum||0,r),r+=4,t.writeUInt16BE(r-o-2,o),dn.encode.bytes=r-o,t};dn.encode.bytes=0;dn.decode=function(e,t){t||(t=0);let r=t,o={};return t+=2,o.mname=R.decode(e,t),t+=R.decode.bytes,o.rname=R.decode(e,t,{mail:!0}),t+=R.decode.bytes,o.serial=e.readUInt32BE(t),t+=4,o.refresh=e.readUInt32BE(t),t+=4,o.retry=e.readUInt32BE(t),t+=4,o.expire=e.readUInt32BE(t),t+=4,o.minimum=e.readUInt32BE(t),t+=4,dn.decode.bytes=t-r,o};dn.decode.bytes=0;dn.encodingLength=function(e){return 22+R.encodingLength(e.mname)+R.encodingLength(e.rname)};var pn=N.txt={};pn.encode=function(e,t,r){Array.isArray(e)||(e=[e]);for(let n=0;n<e.length;n++)if(typeof e[n]=="string"&&(e[n]=L.from(e[n])),!L.isBuffer(e[n]))throw new Error("Must be a Buffer");t||(t=L.alloc(pn.encodingLength(e))),r||(r=0);let o=r;return r+=2,e.forEach(function(n){t[r++]=n.length,n.copy(t,r,0,n.length),r+=n.length}),t.writeUInt16BE(r-o-2,o),pn.encode.bytes=r-o,t};pn.encode.bytes=0;pn.decode=function(e,t){t||(t=0);let r=t,o=e.readUInt16BE(t);t+=2;let n=[];for(;o>0;){let i=e[t++];if(--o,o<i)throw new Error("Buffer overflow");n.push(e.slice(t,t+i)),t+=i,o-=i}return pn.decode.bytes=t-r,n};pn.decode.bytes=0;pn.encodingLength=function(e){Array.isArray(e)||(e=[e]);let t=2;return e.forEach(function(r){typeof r=="string"?t+=L.byteLength(r)+1:t+=r.length+1}),t};var mn=N.null={};mn.encode=function(e,t,r){t||(t=L.alloc(mn.encodingLength(e))),r||(r=0),typeof e=="string"&&(e=L.from(e)),e||(e=L.alloc(0));let o=r;r+=2;let n=e.length;return e.copy(t,r,0,n),r+=n,t.writeUInt16BE(r-o-2,o),mn.encode.bytes=r-o,t};mn.encode.bytes=0;mn.decode=function(e,t){t||(t=0);let r=t,o=e.readUInt16BE(t);t+=2;let n=e.slice(t,t+o);return t+=o,mn.decode.bytes=t-r,n};mn.decode.bytes=0;mn.encodingLength=function(e){return e?(L.isBuffer(e)?e.length:L.byteLength(e))+2:2};var fn=N.hinfo={};fn.encode=function(e,t,r){t||(t=L.alloc(fn.encodingLength(e))),r||(r=0);let o=r;return r+=2,J.encode(e.cpu,t,r),r+=J.encode.bytes,J.encode(e.os,t,r),r+=J.encode.bytes,t.writeUInt16BE(r-o-2,o),fn.encode.bytes=r-o,t};fn.encode.bytes=0;fn.decode=function(e,t){t||(t=0);let r=t,o={};return t+=2,o.cpu=J.decode(e,t),t+=J.decode.bytes,o.os=J.decode(e,t),t+=J.decode.bytes,fn.decode.bytes=t-r,o};fn.decode.bytes=0;fn.encodingLength=function(e){return J.encodingLength(e.cpu)+J.encodingLength(e.os)+2};var It=N.ptr={},qR=N.cname=It,KR=N.dname=It;It.encode=function(e,t,r){return t||(t=L.alloc(It.encodingLength(e))),r||(r=0),R.encode(e,t,r+2),t.writeUInt16BE(R.encode.bytes,r),It.encode.bytes=R.encode.bytes+2,t};It.encode.bytes=0;It.decode=function(e,t){t||(t=0);let r=R.decode(e,t+2);return It.decode.bytes=R.decode.bytes+2,r};It.decode.bytes=0;It.encodingLength=function(e){return R.encodingLength(e)+2};var gn=N.srv={};gn.encode=function(e,t,r){t||(t=L.alloc(gn.encodingLength(e))),r||(r=0),t.writeUInt16BE(e.priority||0,r+2),t.writeUInt16BE(e.weight||0,r+4),t.writeUInt16BE(e.port||0,r+6),R.encode(e.target,t,r+8);let o=R.encode.bytes+6;return t.writeUInt16BE(o,r),gn.encode.bytes=o+2,t};gn.encode.bytes=0;gn.decode=function(e,t){t||(t=0);let r=e.readUInt16BE(t),o={};return o.priority=e.readUInt16BE(t+2),o.weight=e.readUInt16BE(t+4),o.port=e.readUInt16BE(t+6),o.target=R.decode(e,t+8),gn.decode.bytes=r+2,o};gn.decode.bytes=0;gn.encodingLength=function(e){return 8+R.encodingLength(e.target)};var at=N.caa={};at.ISSUER_CRITICAL=128;at.encode=function(e,t,r){let o=at.encodingLength(e);return t||(t=L.alloc(at.encodingLength(e))),r||(r=0),e.issuerCritical&&(e.flags=at.ISSUER_CRITICAL),t.writeUInt16BE(o-2,r),r+=2,t.writeUInt8(e.flags||0,r),r+=1,J.encode(e.tag,t,r),r+=J.encode.bytes,t.write(e.value,r),r+=L.byteLength(e.value),at.encode.bytes=o,t};at.encode.bytes=0;at.decode=function(e,t){t||(t=0);let r=e.readUInt16BE(t);t+=2;let o=t,n={};return n.flags=e.readUInt8(t),t+=1,n.tag=J.decode(e,t),t+=J.decode.bytes,n.value=e.toString("utf-8",t,o+r),n.issuerCritical=!!(n.flags&at.ISSUER_CRITICAL),at.decode.bytes=r+2,n};at.decode.bytes=0;at.encodingLength=function(e){return J.encodingLength(e.tag)+J.encodingLength(e.value)+2};var Hn=N.mx={};Hn.encode=function(e,t,r){t||(t=L.alloc(Hn.encodingLength(e))),r||(r=0);let o=r;return r+=2,t.writeUInt16BE(e.preference||0,r),r+=2,R.encode(e.exchange,t,r),r+=R.encode.bytes,t.writeUInt16BE(r-o-2,o),Hn.encode.bytes=r-o,t};Hn.encode.bytes=0;Hn.decode=function(e,t){t||(t=0);let r=t,o={};return t+=2,o.preference=e.readUInt16BE(t),t+=2,o.exchange=R.decode(e,t),t+=R.decode.bytes,Hn.decode.bytes=t-r,o};Hn.encodingLength=function(e){return 4+R.encodingLength(e.exchange)};var hn=N.a={};hn.encode=function(e,t,r){return t||(t=L.alloc(hn.encodingLength(e))),r||(r=0),t.writeUInt16BE(4,r),r+=2,dr.v4.encode(e,t,r),hn.encode.bytes=6,t};hn.encode.bytes=0;hn.decode=function(e,t){t||(t=0),t+=2;let r=dr.v4.decode(e,t);return hn.decode.bytes=6,r};hn.decode.bytes=0;hn.encodingLength=function(){return 6};var vn=N.aaaa={};vn.encode=function(e,t,r){return t||(t=L.alloc(vn.encodingLength(e))),r||(r=0),t.writeUInt16BE(16,r),r+=2,dr.v6.encode(e,t,r),vn.encode.bytes=18,t};vn.encode.bytes=0;vn.decode=function(e,t){t||(t=0),t+=2;let r=dr.v6.decode(e,t);return vn.decode.bytes=18,r};vn.decode.bytes=0;vn.encodingLength=function(){return 18};var Ye=N.option={};Ye.encode=function(e,t,r){t||(t=L.alloc(Ye.encodingLength(e))),r||(r=0);let o=r,n=Ag.toCode(e.code);if(t.writeUInt16BE(n,r),r+=2,e.data)t.writeUInt16BE(e.data.length,r),r+=2,e.data.copy(t,r),r+=e.data.length;else switch(n){case 8:let i=e.sourcePrefixLength||0,a=e.family||dr.familyOf(e.ip),s=dr.encode(e.ip,L.alloc),l=Math.ceil(i/8);t.writeUInt16BE(l+4,r),r+=2,t.writeUInt16BE(a,r),r+=2,t.writeUInt8(i,r++),t.writeUInt8(e.scopePrefixLength||0,r++),s.copy(t,r,0,l),r+=l;break;case 11:e.timeout?(t.writeUInt16BE(2,r),r+=2,t.writeUInt16BE(e.timeout,r),r+=2):(t.writeUInt16BE(0,r),r+=2);break;case 12:let u=e.length||0;t.writeUInt16BE(u,r),r+=2,t.fill(0,r,r+u),r+=u;break;case 14:let d=e.tags.length*2;t.writeUInt16BE(d,r),r+=2;for(let p of e.tags)t.writeUInt16BE(p,r),r+=2;break;default:throw new Error(`Unknown roption code: ${e.code}`)}return Ye.encode.bytes=r-o,t};Ye.encode.bytes=0;Ye.decode=function(e,t){t||(t=0);let r={};r.code=e.readUInt16BE(t),r.type=Ag.toString(r.code),t+=2;let o=e.readUInt16BE(t);switch(t+=2,r.data=e.slice(t,t+o),r.code){case 8:r.family=e.readUInt16BE(t),t+=2,r.sourcePrefixLength=e.readUInt8(t++),r.scopePrefixLength=e.readUInt8(t++);let n=L.alloc(r.family===1?4:16);e.copy(n,0,t,t+o-4),r.ip=dr.decode(n);break;case 11:o>0&&(r.timeout=e.readUInt16BE(t),t+=2);break;case 14:r.tags=[];for(let i=0;i<o;i+=2)r.tags.push(e.readUInt16BE(t)),t+=2}return Ye.decode.bytes=o+4,r};Ye.decode.bytes=0;Ye.encodingLength=function(e){if(e.data)return e.data.length+4;switch(Ag.toCode(e.code)){case 8:let r=e.sourcePrefixLength||0;return Math.ceil(r/8)+8;case 11:return typeof e.timeout=="number"?6:4;case 12:return e.length+4;case 14:return 4+e.tags.length*2}throw new Error(`Unknown roption code: ${e.code}`)};var ct=N.opt={};ct.encode=function(e,t,r){t||(t=L.alloc(ct.encodingLength(e))),r||(r=0);let o=r,n=xo(e,Ye);return t.writeUInt16BE(n,r),r=Ui(e,Ye,t,r+2),ct.encode.bytes=r-o,t};ct.encode.bytes=0;ct.decode=function(e,t){t||(t=0);let r=t,o=[],n=e.readUInt16BE(t);t+=2;let i=0;for(;n>0;)o[i++]=Ye.decode(e,t),t+=Ye.decode.bytes,n-=Ye.decode.bytes;return ct.decode.bytes=t-r,o};ct.decode.bytes=0;ct.encodingLength=function(e){return 2+xo(e||[],Ye)};var Be=N.dnskey={};Be.PROTOCOL_DNSSEC=3;Be.ZONE_KEY=128;Be.SECURE_ENTRYPOINT=32768;Be.encode=function(e,t,r){t||(t=L.alloc(Be.encodingLength(e))),r||(r=0);let o=r,n=e.key;if(!L.isBuffer(n))throw new Error("Key must be a Buffer");return r+=2,t.writeUInt16BE(e.flags,r),r+=2,t.writeUInt8(Be.PROTOCOL_DNSSEC,r),r+=1,t.writeUInt8(e.algorithm,r),r+=1,n.copy(t,r,0,n.length),r+=n.length,Be.encode.bytes=r-o,t.writeUInt16BE(Be.encode.bytes-2,o),t};Be.encode.bytes=0;Be.decode=function(e,t){t||(t=0);let r=t;var o={},n=e.readUInt16BE(t);if(t+=2,o.flags=e.readUInt16BE(t),t+=2,e.readUInt8(t)!==Be.PROTOCOL_DNSSEC)throw new Error("Protocol must be 3");return t+=1,o.algorithm=e.readUInt8(t),t+=1,o.key=e.slice(t,r+n+2),t+=o.key.length,Be.decode.bytes=t-r,o};Be.decode.bytes=0;Be.encodingLength=function(e){return 6+L.byteLength(e.key)};var jt=N.rrsig={};jt.encode=function(e,t,r){t||(t=L.alloc(jt.encodingLength(e))),r||(r=0);let o=r,n=e.signature;if(!L.isBuffer(n))throw new Error("Signature must be a Buffer");return r+=2,t.writeUInt16BE(yn.toType(e.typeCovered),r),r+=2,t.writeUInt8(e.algorithm,r),r+=1,t.writeUInt8(e.labels,r),r+=1,t.writeUInt32BE(e.originalTTL,r),r+=4,t.writeUInt32BE(e.expiration,r),r+=4,t.writeUInt32BE(e.inception,r),r+=4,t.writeUInt16BE(e.keyTag,r),r+=2,R.encode(e.signersName,t,r),r+=R.encode.bytes,n.copy(t,r,0,n.length),r+=n.length,jt.encode.bytes=r-o,t.writeUInt16BE(jt.encode.bytes-2,o),t};jt.encode.bytes=0;jt.decode=function(e,t){t||(t=0);let r=t;var o={},n=e.readUInt16BE(t);return t+=2,o.typeCovered=yn.toString(e.readUInt16BE(t)),t+=2,o.algorithm=e.readUInt8(t),t+=1,o.labels=e.readUInt8(t),t+=1,o.originalTTL=e.readUInt32BE(t),t+=4,o.expiration=e.readUInt32BE(t),t+=4,o.inception=e.readUInt32BE(t),t+=4,o.keyTag=e.readUInt16BE(t),t+=2,o.signersName=R.decode(e,t),t+=R.decode.bytes,o.signature=e.slice(t,r+n+2),t+=o.signature.length,jt.decode.bytes=t-r,o};jt.decode.bytes=0;jt.encodingLength=function(e){return 20+R.encodingLength(e.signersName)+L.byteLength(e.signature)};var Ft=N.rp={};Ft.encode=function(e,t,r){t||(t=L.alloc(Ft.encodingLength(e))),r||(r=0);let o=r;return r+=2,R.encode(e.mbox||".",t,r,{mail:!0}),r+=R.encode.bytes,R.encode(e.txt||".",t,r),r+=R.encode.bytes,Ft.encode.bytes=r-o,t.writeUInt16BE(Ft.encode.bytes-2,o),t};Ft.encode.bytes=0;Ft.decode=function(e,t){t||(t=0);let r=t,o={};return t+=2,o.mbox=R.decode(e,t,{mail:!0})||".",t+=R.decode.bytes,o.txt=R.decode(e,t)||".",t+=R.decode.bytes,Ft.decode.bytes=t-r,o};Ft.decode.bytes=0;Ft.encodingLength=function(e){return 2+R.encodingLength(e.mbox||".")+R.encodingLength(e.txt||".")};var Ie={};Ie.encode=function(e,t,r){t||(t=L.alloc(Ie.encodingLength(e))),r||(r=0);let o=r;for(var n=[],i=0;i<e.length;i++){var a=yn.toType(e[i]);n[a>>8]===void 0&&(n[a>>8]=[]),n[a>>8][a>>3&31]|=1<<7-(a&7)}for(i=0;i<n.length;i++)if(n[i]!==void 0){var s=L.from(n[i]);t.writeUInt8(i,r),r+=1,t.writeUInt8(s.length,r),r+=1,s.copy(t,r),r+=s.length}return Ie.encode.bytes=r-o,t};Ie.encode.bytes=0;Ie.decode=function(e,t,r){t||(t=0);let o=t;for(var n=[];t-o<r;){var i=e.readUInt8(t);t+=1;var a=e.readUInt8(t);t+=1;for(var s=0;s<a;s++)for(var l=e.readUInt8(t+s),u=0;u<8;u++)if(l&1<<7-u){var d=yn.toString(i<<8|s<<3|u);n.push(d)}t+=a}return Ie.decode.bytes=t-o,n};Ie.decode.bytes=0;Ie.encodingLength=function(e){for(var t=[],r=0;r<e.length;r++){var o=yn.toType(e[r]);t[o>>8]=Math.max(t[o>>8]||0,o&255)}var n=0;for(r=0;r<t.length;r++)t[r]!==void 0&&(n+=2+Math.ceil((t[r]+1)/8));return n};var Mt=N.nsec={};Mt.encode=function(e,t,r){t||(t=L.alloc(Mt.encodingLength(e))),r||(r=0);let o=r;return r+=2,R.encode(e.nextDomain,t,r),r+=R.encode.bytes,Ie.encode(e.rrtypes,t,r),r+=Ie.encode.bytes,Mt.encode.bytes=r-o,t.writeUInt16BE(Mt.encode.bytes-2,o),t};Mt.encode.bytes=0;Mt.decode=function(e,t){t||(t=0);let r=t;var o={},n=e.readUInt16BE(t);return t+=2,o.nextDomain=R.decode(e,t),t+=R.decode.bytes,o.rrtypes=Ie.decode(e,t,n-(t-r)),t+=Ie.decode.bytes,Mt.decode.bytes=t-r,o};Mt.decode.bytes=0;Mt.encodingLength=function(e){return 2+R.encodingLength(e.nextDomain)+Ie.encodingLength(e.rrtypes)};var Bt=N.nsec3={};Bt.encode=function(e,t,r){t||(t=L.alloc(Bt.encodingLength(e))),r||(r=0);let o=r,n=e.salt;if(!L.isBuffer(n))throw new Error("salt must be a Buffer");let i=e.nextDomain;if(!L.isBuffer(i))throw new Error("nextDomain must be a Buffer");return r+=2,t.writeUInt8(e.algorithm,r),r+=1,t.writeUInt8(e.flags,r),r+=1,t.writeUInt16BE(e.iterations,r),r+=2,t.writeUInt8(n.length,r),r+=1,n.copy(t,r,0,n.length),r+=n.length,t.writeUInt8(i.length,r),r+=1,i.copy(t,r,0,i.length),r+=i.length,Ie.encode(e.rrtypes,t,r),r+=Ie.encode.bytes,Bt.encode.bytes=r-o,t.writeUInt16BE(Bt.encode.bytes-2,o),t};Bt.encode.bytes=0;Bt.decode=function(e,t){t||(t=0);let r=t;var o={},n=e.readUInt16BE(t);t+=2,o.algorithm=e.readUInt8(t),t+=1,o.flags=e.readUInt8(t),t+=1,o.iterations=e.readUInt16BE(t),t+=2;let i=e.readUInt8(t);t+=1,o.salt=e.slice(t,t+i),t+=i;let a=e.readUInt8(t);return t+=1,o.nextDomain=e.slice(t,t+a),t+=a,o.rrtypes=Ie.decode(e,t,n-(t-r)),t+=Ie.decode.bytes,Bt.decode.bytes=t-r,o};Bt.decode.bytes=0;Bt.encodingLength=function(e){return 8+e.salt.length+e.nextDomain.length+Ie.encodingLength(e.rrtypes)};var Ht=N.ds={};Ht.encode=function(e,t,r){t||(t=L.alloc(Ht.encodingLength(e))),r||(r=0);let o=r,n=e.digest;if(!L.isBuffer(n))throw new Error("Digest must be a Buffer");return r+=2,t.writeUInt16BE(e.keyTag,r),r+=2,t.writeUInt8(e.algorithm,r),r+=1,t.writeUInt8(e.digestType,r),r+=1,n.copy(t,r,0,n.length),r+=n.length,Ht.encode.bytes=r-o,t.writeUInt16BE(Ht.encode.bytes-2,o),t};Ht.encode.bytes=0;Ht.decode=function(e,t){t||(t=0);let r=t;var o={},n=e.readUInt16BE(t);return t+=2,o.keyTag=e.readUInt16BE(t),t+=2,o.algorithm=e.readUInt8(t),t+=1,o.digestType=e.readUInt8(t),t+=1,o.digest=e.slice(t,r+n+2),t+=o.digest.length,Ht.decode.bytes=t-r,o};Ht.decode.bytes=0;Ht.encodingLength=function(e){return 6+L.byteLength(e.digest)};var st=N.sshfp={};st.getFingerprintLengthForHashType=function(t){switch(t){case 1:return 20;case 2:return 32}};st.encode=function(t,r,o){r||(r=L.alloc(st.encodingLength(t))),o||(o=0);let n=o;o+=2,r[o]=t.algorithm,o+=1,r[o]=t.hash,o+=1;let i=L.from(t.fingerprint.toUpperCase(),"hex");if(i.length!==st.getFingerprintLengthForHashType(t.hash))throw new Error("Invalid fingerprint length");return i.copy(r,o),o+=i.byteLength,st.encode.bytes=o-n,r.writeUInt16BE(st.encode.bytes-2,n),r};st.encode.bytes=0;st.decode=function(t,r){r||(r=0);let o=r,n={};r+=2,n.algorithm=t[r],r+=1,n.hash=t[r],r+=1;let i=st.getFingerprintLengthForHashType(n.hash);return n.fingerprint=t.slice(r,r+i).toString("hex").toUpperCase(),r+=i,st.decode.bytes=r-o,n};st.decode.bytes=0;st.encodingLength=function(e){return 4+L.from(e.fingerprint,"hex").byteLength};var Zt=N.naptr={};Zt.encode=function(e,t,r){t||(t=L.alloc(Zt.encodingLength(e))),r||(r=0);let o=r;return r+=2,t.writeUInt16BE(e.order||0,r),r+=2,t.writeUInt16BE(e.preference||0,r),r+=2,J.encode(e.flags,t,r),r+=J.encode.bytes,J.encode(e.services,t,r),r+=J.encode.bytes,J.encode(e.regexp,t,r),r+=J.encode.bytes,R.encode(e.replacement,t,r),r+=R.encode.bytes,Zt.encode.bytes=r-o,t.writeUInt16BE(Zt.encode.bytes-2,o),t};Zt.encode.bytes=0;Zt.decode=function(e,t){t||(t=0);let r=t,o={};return t+=2,o.order=e.readUInt16BE(t),t+=2,o.preference=e.readUInt16BE(t),t+=2,o.flags=J.decode(e,t),t+=J.decode.bytes,o.services=J.decode(e,t),t+=J.decode.bytes,o.regexp=J.decode(e,t),t+=J.decode.bytes,o.replacement=R.decode(e,t),t+=R.decode.bytes,Zt.decode.bytes=t-r,o};Zt.decode.bytes=0;Zt.encodingLength=function(e){return J.encodingLength(e.flags)+J.encodingLength(e.services)+J.encodingLength(e.regexp)+R.encodingLength(e.replacement)+6};var Gt=N.tlsa={};Gt.encode=function(e,t,r){t||(t=L.alloc(Gt.encodingLength(e))),r||(r=0);let o=r,n=e.certificate;if(!L.isBuffer(n))throw new Error("Certificate must be a Buffer");return r+=2,t.writeUInt8(e.usage,r),r+=1,t.writeUInt8(e.selector,r),r+=1,t.writeUInt8(e.matchingType,r),r+=1,n.copy(t,r,0,n.length),r+=n.length,Gt.encode.bytes=r-o,t.writeUInt16BE(Gt.encode.bytes-2,o),t};Gt.encode.bytes=0;Gt.decode=function(e,t){t||(t=0);let r=t,o={},n=e.readUInt16BE(t);return t+=2,o.usage=e.readUInt8(t),t+=1,o.selector=e.readUInt8(t),t+=1,o.matchingType=e.readUInt8(t),t+=1,o.certificate=e.slice(t,r+n+2),t+=o.certificate.length,Gt.decode.bytes=t-r,o};Gt.decode.bytes=0;Gt.encodingLength=function(e){return 5+L.byteLength(e.certificate)};var Pg=N.record=function(e){switch(e.toUpperCase()){case"A":return hn;case"PTR":return It;case"CNAME":return qR;case"DNAME":return KR;case"TXT":return pn;case"NULL":return mn;case"AAAA":return vn;case"SRV":return gn;case"HINFO":return fn;case"CAA":return at;case"NS":return un;case"SOA":return dn;case"MX":return Hn;case"OPT":return ct;case"DNSKEY":return Be;case"RRSIG":return jt;case"RP":return Ft;case"NSEC":return Mt;case"NSEC3":return Bt;case"SSHFP":return st;case"DS":return Ht;case"NAPTR":return Zt;case"TLSA":return Gt}return ln},Re=N.answer={};Re.encode=function(e,t,r){t||(t=L.alloc(Re.encodingLength(e))),r||(r=0);let o=r;if(R.encode(e.name,t,r),r+=R.encode.bytes,t.writeUInt16BE(yn.toType(e.type),r),e.type.toUpperCase()==="OPT"){if(e.name!==".")throw new Error("OPT name must be root.");t.writeUInt16BE(e.udpPayloadSize||4096,r+2),t.writeUInt8(e.extendedRcode||0,r+4),t.writeUInt8(e.ednsVersion||0,r+5),t.writeUInt16BE(e.flags||0,r+6),r+=8,ct.encode(e.options||[],t,r),r+=ct.encode.bytes}else{let n=Fc.toClass(e.class===void 0?"IN":e.class);e.flush&&(n|=Eg),t.writeUInt16BE(n,r+2),t.writeUInt32BE(e.ttl||0,r+4),r+=8;let i=Pg(e.type);i.encode(e.data,t,r),r+=i.encode.bytes}return Re.encode.bytes=r-o,t};Re.encode.bytes=0;Re.decode=function(e,t){t||(t=0);let r={},o=t;if(r.name=R.decode(e,t),t+=R.decode.bytes,r.type=yn.toString(e.readUInt16BE(t)),r.type==="OPT")r.udpPayloadSize=e.readUInt16BE(t+2),r.extendedRcode=e.readUInt8(t+4),r.ednsVersion=e.readUInt8(t+5),r.flags=e.readUInt16BE(t+6),r.flag_do=(r.flags>>15&1)===1,r.options=ct.decode(e,t+8),t+=8+ct.decode.bytes;else{let n=e.readUInt16BE(t+2);r.ttl=e.readUInt32BE(t+4),r.class=Fc.toString(n&VR),r.flush=!!(n&Eg);let i=Pg(r.type);r.data=i.decode(e,t+8),t+=8+i.decode.bytes}return Re.decode.bytes=t-o,r};Re.decode.bytes=0;Re.encodingLength=function(e){let t=e.data!==null&&e.data!==void 0?e.data:e.options;return R.encodingLength(e.name)+8+Pg(e.type).encodingLength(t)};var At=N.question={};At.encode=function(e,t,r){t||(t=L.alloc(At.encodingLength(e))),r||(r=0);let o=r;return R.encode(e.name,t,r),r+=R.encode.bytes,t.writeUInt16BE(yn.toType(e.type),r),r+=2,t.writeUInt16BE(Fc.toClass(e.class===void 0?"IN":e.class),r),r+=2,At.encode.bytes=r-o,e};At.encode.bytes=0;At.decode=function(e,t){t||(t=0);let r=t,o={};return o.name=R.decode(e,t),t+=R.decode.bytes,o.type=yn.toString(e.readUInt16BE(t)),t+=2,o.class=Fc.toString(e.readUInt16BE(t)),t+=2,o.class&D0&&(o.class&=JR),At.decode.bytes=t-r,o};At.decode.bytes=0;At.encodingLength=function(e){return R.encodingLength(e.name)+4};N.AUTHORITATIVE_ANSWER=1024;N.TRUNCATED_RESPONSE=512;N.RECURSION_DESIRED=256;N.RECURSION_AVAILABLE=128;N.AUTHENTIC_DATA=32;N.CHECKING_DISABLED=16;N.DNSSEC_OK=32768;N.encode=function(e,t,r){let o=!t;o&&(t=L.alloc(N.encodingLength(e))),r||(r=0);let n=r;return e.questions||(e.questions=[]),e.answers||(e.answers=[]),e.authorities||(e.authorities=[]),e.additionals||(e.additionals=[]),Et.encode(e,t,r),r+=Et.encode.bytes,r=Ui(e.questions,At,t,r),r=Ui(e.answers,Re,t,r),r=Ui(e.authorities,Re,t,r),r=Ui(e.additionals,Re,t,r),N.encode.bytes=r-n,o&&N.encode.bytes!==t.length?t.slice(0,N.encode.bytes):t};N.encode.bytes=0;N.decode=function(e,t){t||(t=0);let r=t,o=Et.decode(e,t);return t+=Et.decode.bytes,t=jc(o.questions,At,e,t),t=jc(o.answers,Re,e,t),t=jc(o.authorities,Re,e,t),t=jc(o.additionals,Re,e,t),N.decode.bytes=t-r,o};N.decode.bytes=0;N.encodingLength=function(e){return Et.encodingLength(e)+xo(e.questions||[],At)+xo(e.answers||[],Re)+xo(e.authorities||[],Re)+xo(e.additionals||[],Re)};N.streamEncode=function(e){let t=N.encode(e),r=L.alloc(2);r.writeUInt16BE(t.byteLength);let o=L.concat([r,t]);return N.streamEncode.bytes=o.byteLength,o};N.streamEncode.bytes=0;N.streamDecode=function(e){let t=e.readUInt16BE(0);if(e.byteLength<t+2)return null;let r=N.decode(e.slice(2));return N.streamDecode.bytes=N.decode.bytes,r};N.streamDecode.bytes=0;function xo(e,t){let r=0;for(let o=0;o<e.length;o++)r+=t.encodingLength(e[o]);return r}function Ui(e,t,r,o){for(let n=0;n<e.length;n++)t.encode(e[n],r,o),o+=t.encode.bytes;return o}function jc(e,t,r,o){for(let n=0;n<e.length;n++)e[n]=t.decode(r,o),o+=t.decode.bytes;return o}});var z0=q((BH,U0)=>{"use strict";var L0=nO;process.nextTick(tO,42);U0.exports=XR;function XR(e){var t=o;return r;function r(n){t(n||QR)}function o(n){var i=[n];t=a,e(s);function a(l){i.push(l)}function s(l){var u=arguments;for(t=YR(l)?o:d;i.length;)d(i.shift());function d(p){L0(eO,p,u)}}}}function YR(e){return Object.prototype.toString.call(e)==="[object Error]"}function QR(){}function eO(e,t){e.apply(null,t)}function tO(e){e===42&&(L0=process.nextTick)}function nO(e,t,r){process.nextTick(function(){e(t,r)})}});var M0=q((HH,F0)=>{var Cg=N0(),rO=te("dgram"),oO=z0(),iO=te("events"),Rg=te("os"),Tg=function(){};F0.exports=function(e){e||(e={});var t=new iO.EventEmitter,r=typeof e.port=="number"?e.port:5353,o=e.type||"udp4",n=e.ip||e.host||(o==="udp4"?"224.0.0.251":null),i={address:n,port:r},a={},s=!1,l=null;if(o==="udp6"&&(!n||!e.interface))throw new Error("For IPv6 multicast you must specify `ip` and `interface`");var u=e.socket||rO.createSocket({type:o,reuseAddr:e.reuseAddr!==!1,toString:function(){return o}});u.on("error",function(p){p.code==="EACCES"||p.code==="EADDRINUSE"?t.emit("error",p):t.emit("warning",p)}),u.on("message",function(p,m){try{p=Cg.decode(p)}catch(f){t.emit("warning",f);return}t.emit("packet",p,m),p.type==="query"&&t.emit("query",p,m),p.type==="response"&&t.emit("response",p,m)}),u.on("listening",function(){r||(r=i.port=u.address().port),e.multicast!==!1&&(t.update(),l=setInterval(t.update,5e3),u.setMulticastTTL(e.ttl||255),u.setMulticastLoopback(e.loopback!==!1))});var d=oO(function(p){if(!r||e.bind===!1)return p(null);u.once("error",p),u.bind(r,e.bind||e.interface,function(){u.removeListener("error",p),p(null)})});return d(function(p){if(p)return t.emit("error",p);t.emit("ready")}),t.send=function(p,m,f){if(typeof m=="function")return t.send(p,null,m);f||(f=Tg),m?!m.host&&!m.address&&(m.address=i.address):m=i,d(g);function g(y){if(s)return f();if(y)return f(y);var k=Cg.encode(p);u.send(k,0,k.length,m.port,m.address||m.host,f)}},t.response=t.respond=function(p,m,f){Array.isArray(p)&&(p={answers:p}),p.type="response",p.flags=(p.flags||0)|Cg.AUTHORITATIVE_ANSWER,t.send(p,m,f)},t.query=function(p,m,f,g){if(typeof m=="function")return t.query(p,null,null,m);if(typeof m=="object"&&m&&m.port)return t.query(p,null,m,f);if(typeof f=="function")return t.query(p,m,null,f);g||(g=Tg),typeof p=="string"&&(p=[{name:p,type:m||"ANY"}]),Array.isArray(p)&&(p={type:"query",questions:p}),p.type="query",t.send(p,f,g)},t.destroy=function(p){if(p||(p=Tg),s)return process.nextTick(p);s=!0,clearInterval(l);for(var m in a)try{u.dropMembership(n,m)}catch{}a={},u.close(p)},t.update=function(){for(var p=e.interface?[].concat(e.interface):sO(),m=!1,f=0;f<p.length;f++){var g=p[f];if(!a[g])try{u.addMembership(n,g),a[g]=!0,m=!0}catch(y){t.emit("warning",y)}}if(m){if(u.setMulticastInterface)try{u.setMulticastInterface(e.interface||aO())}catch(y){t.emit("warning",y)}t.emit("networkInterface")}},t};function aO(){for(var e=Rg.networkInterfaces(),t=Object.keys(e),r=0;r<t.length;r++)for(var o=e[t[r]],n=0;n<o.length;n++){var i=o[n];if(j0(i.family)&&!i.internal)return Rg.platform()==="darwin"&&t[r]==="en0"?i.address:"0.0.0.0"}return"127.0.0.1"}function sO(){for(var e=Rg.networkInterfaces(),t=Object.keys(e),r=[],o=0;o<t.length;o++)for(var n=e[t[o]],i=0;i<n.length;i++){var a=n[i];if(j0(a.family)){r.push(a.address);break}}return r}function j0(e){return e===4||e==="IPv4"}});var H0=q((ZH,B0)=>{"use strict";B0.exports=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var o,n,i;if(Array.isArray(t)){if(o=t.length,o!=r.length)return!1;for(n=o;n--!==0;)if(!e(t[n],r[n]))return!1;return!0}if(t instanceof Map&&r instanceof Map){if(t.size!==r.size)return!1;for(n of t.entries())if(!r.has(n[0]))return!1;for(n of t.entries())if(!e(n[1],r.get(n[0])))return!1;return!0}if(t instanceof Set&&r instanceof Set){if(t.size!==r.size)return!1;for(n of t.entries())if(!r.has(n[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(r)){if(o=t.length,o!=r.length)return!1;for(n=o;n--!==0;)if(t[n]!==r[n])return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(i=Object.keys(t),o=i.length,o!==Object.keys(r).length)return!1;for(n=o;n--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[n]))return!1;for(n=o;n--!==0;){var a=i[n];if(!e(t[a],r[a]))return!1}return!0}return t!==t&&r!==r}});var Z0=q(pr=>{"use strict";var Og=pr&&pr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(pr,"__esModule",{value:!0});pr.Server=void 0;var cO=Og(M0()),lO=Og(H0()),uO=Og(Nc()),Mc=class{constructor(t,r){this.registry={},this.mdns=(0,cO.default)(t),this.mdns.setMaxListeners(0),this.mdns.on("query",this.respondToQuery.bind(this)),this.errorCallback=r??function(o){throw o}}register(t){let r=o=>{var n=this.registry[o.type];if(!n)n=this.registry[o.type]=[];else if(n.some(this.isDuplicateRecord(o)))return;n.push(o)};Array.isArray(t)?t.forEach(r):r(t)}unregister(t){let r=o=>{let n=o.type;n in this.registry&&(this.registry[n]=this.registry[n].filter(i=>i.name!==o.name))};Array.isArray(t)?t.forEach(r):r(t)}respondToQuery(t){let r=this;t.questions.forEach(o=>{var n=o.type,i=o.name,a=n==="ANY"?Object.keys(r.registry).map(r.recordsFor.bind(r,i)).flat(1):r.recordsFor(i,n);if(a.length!==0){var s=[];n!=="ANY"&&(a.forEach(l=>{l.type==="PTR"&&(s=s.concat(r.recordsFor(l.data,"SRV")).concat(r.recordsFor(l.data,"TXT")))}),s.filter(function(l){return l.type==="SRV"}).map(function(l){return l.data.target}).filter(this.unique()).forEach(function(l){s=s.concat(r.recordsFor(l,"A")).concat(r.recordsFor(l,"AAAA"))})),r.mdns.respond({answers:a,additionals:s},l=>{l&&this.errorCallback(l)})}})}recordsFor(t,r){return r in this.registry?this.registry[r].filter(o=>{var n=~t.indexOf(".")?o.name:o.name.split(".")[0];return(0,uO.default)(n,t)}):[]}isDuplicateRecord(t){return r=>t.type===r.type&&t.name===r.name&&(0,lO.default)(t.data,r.data)}unique(){var t=[];return r=>~t.indexOf(r)?!1:(t.push(r),!0)}};pr.Server=Mc;pr.default=Mc});var G0=q(Dg=>{"use strict";Object.defineProperty(Dg,"__esModule",{value:!0});Dg.default=(e,t)=>{if(t===void 0)return!0;let r=e.txt,o=Object.entries(t).map(([n,i])=>{let a=r[n];return!(a===void 0||i!=a)});return o.length==0?!0:!o.includes(!1)}});var W0=q(Ng=>{"use strict";Object.defineProperty(Ng,"__esModule",{value:!0});Ng.default=e=>Object.keys(e).filter(t=>!t.includes("binary")).reduce((t,r)=>Object.assign(t,{[r]:e[r]}),{})});var V0=q(Lg=>{"use strict";Object.defineProperty(Lg,"__esModule",{value:!0});Lg.default=dO;function dO(e,t){if(e===void 0||t===void 0)return!1;let r=Object.keys(e),o=Object.keys(t);if(r.length!=o.length)return!1;for(let n of r)if(e[n]!=t[n])return!1;return!0}});var K0=q(mr=>{"use strict";var zi=mr&&mr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(mr,"__esModule",{value:!0});mr.Browser=void 0;var pO=zi(vg()),Zn=zi(Nc()),mO=te("events"),Ug=yg(),J0=zi(G0()),fO=zi(W0()),gO=zi(V0()),q0=".local",hO="_services._dns-sd._udp"+q0,Bc=class e extends mO.EventEmitter{constructor(t,r,o){if(super(),this.onresponse=void 0,this.serviceMap={},this.wildcard=!1,this._services=[],typeof r=="function")return new e(t,null,r);this.mdns=t,this.txt=new pO.default(r!==null&&r.txt!=null?r.txt:void 0),r===null||r.type===void 0?(this.name=hO,this.wildcard=!0):(this.name=(0,Ug.toString)({name:r.type,protocol:r.protocol||"tcp"})+q0,r.name&&(this.name=r.name+"."+this.name),this.wildcard=!1),r!=null&&r.txt!==void 0&&(this.txtQuery=(0,fO.default)(r.txt)),o&&this.on("up",o),this.start()}start(){if(!(this.onresponse||this.name===void 0)){var t=this,r={};this.wildcard||(r[this.name]=!0),this.onresponse=(o,n)=>{t.wildcard&&o.answers.forEach(a=>{a.type!=="PTR"||a.name!==t.name||a.name in r||(r[a.data]=!0,t.mdns.query(a.data,"PTR"))});let i=Date.now();Object.keys(r).forEach(function(a){t.goodbyes(a,o).forEach(t.removeService.bind(t));var s=t.buildServicesFor(a,o,t.txt,n,i);s.length!==0&&s.forEach(l=>{let u=t._services.find(d=>(0,Zn.default)(d.fqdn,l.fqdn));if(u){t.updateServiceSrv(u,l),t.updateServiceTxt(u,l);return}t.addService(l)})})},this.mdns.on("response",this.onresponse),this.update()}}stop(){this.onresponse&&(this.mdns.removeListener("response",this.onresponse),this.onresponse=void 0)}update(){this.mdns.query(this.name,"PTR")}expire(){let t=Date.now();this._services=this._services.filter(r=>!r.ttl||r.lastSeen===void 0?!0:r.lastSeen+r.ttl*1e3<t?(this.emit("down",r),!1):!0)}get services(){return this._services}addService(t){(0,J0.default)(t,this.txtQuery)!==!1&&(this._services.push(t),this.serviceMap[t.fqdn]=!0,this.emit("up",t))}updateServiceSrv(t,r){(t.name!==r.name||t.host!==r.host||t.port!==r.port||t.type!==r.type||t.protocol!==r.protocol)&&(this.replaceService(r),this.emit("srv-update",r,t))}updateServiceTxt(t,r){if(!(0,gO.default)(r.txt,t?.txt||{})){if(!(0,J0.default)(r,this.txtQuery)){this.removeService(r.fqdn);return}this.replaceService(r),this.emit("txt-update",r,t)}}replaceService(t){this._services=this._services.map(r=>(0,Zn.default)(r.fqdn,t.fqdn)?t:r)}removeService(t){var r,o;this._services.some(function(n,i){if((0,Zn.default)(n.fqdn,t))return r=n,o=i,!0}),!(!r||o===void 0)&&(this._services.splice(o,1),delete this.serviceMap[t],this.emit("down",r))}goodbyes(t,r){return r.answers.concat(r.additionals).filter(o=>o.type==="PTR"&&o.ttl===0&&(0,Zn.default)(o.name,t)).map(o=>o.data)}buildServicesFor(t,r,o,n,i){var a=r.answers.concat(r.additionals).filter(s=>s.ttl>0);return a.filter(s=>s.type==="PTR"&&(0,Zn.default)(s.name,t)).map(s=>{let l={addresses:[],subtypes:[],ttl:s.ttl,lastSeen:i};if(a.filter(u=>u.type==="PTR"&&(0,Zn.default)(u.data,s.data)&&u.name.includes("._sub")).forEach(u=>{let d=(0,Ug.toType)(u.name);l.subtypes.push(d.subtype)}),a.filter(u=>(u.type==="SRV"||u.type==="TXT")&&(0,Zn.default)(u.name,s.data)).forEach(u=>{if(u.type==="SRV"){var d=u.name.split("."),p=d[0],m=(0,Ug.toType)(d.slice(1,-1).join("."));l.name=p,l.fqdn=u.name,l.host=u.data.target,l.referer=n,l.port=u.data.port,l.type=m.name,l.protocol=m.protocol}else u.type==="TXT"&&(l.rawTxt=u.data,l.txt=this.txt.decodeAll(u.data))}),!!l.name)return a.filter(u=>(u.type==="A"||u.type==="AAAA")&&(0,Zn.default)(u.name,l.host)).forEach(u=>l.addresses.push(u.data)),l}).filter(s=>!!s)}};mr.Browser=Bc;mr.default=Bc});var X0=q(bn=>{"use strict";var Hc=bn&&bn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(bn,"__esModule",{value:!0});bn.Browser=bn.Service=void 0;var vO=Hc(_0()),yO=Hc(Z0()),zg=Hc(K0());bn.Browser=zg.default;var bO=Hc(bg());bn.Service=bO.default;var jg=class{constructor(t={},r){this.server=new yO.default(t,r),this.registry=new vO.default(this.server)}publish(t){return this.registry.publish(t)}unpublishAll(t){return this.registry.unpublishAll(t)}find(t=null,r){return new zg.default(this.server.mdns,t,r)}findOne(t=null,r=1e4,o){let n=new zg.default(this.server.mdns,t);var i;return n.once("up",a=>{i!==void 0&&clearTimeout(i),n.stop(),o&&o(a)}),i=setTimeout(()=>{n.stop(),o&&o(null)},r),n}destroy(t){this.registry.destroy(),this.server.mdns.destroy(t)}};bn.default=jg});var Q0=q((He,Y0)=>{"use strict";var xO=He&&He.__createBinding||(Object.create?(function(e,t,r,o){o===void 0&&(o=r);var n=Object.getOwnPropertyDescriptor(t,r);(!n||("get"in n?!t.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,o,n)}):(function(e,t,r,o){o===void 0&&(o=r),e[o]=t[r]})),kO=He&&He.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),wO=He&&He.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var o=[];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(o[o.length]=n);return o},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var o=e(t),n=0;n<o.length;n++)o[n]!=="default"&&xO(r,t,o[n]);return kO(r,t),r}})();Object.defineProperty(He,"__esModule",{value:!0});He.Browser=He.Service=He.Bonjour=void 0;var ji=wO(X0());Object.defineProperty(He,"Service",{enumerable:!0,get:function(){return ji.Service}});Object.defineProperty(He,"Browser",{enumerable:!0,get:function(){return ji.Browser}});var fr=class extends ji.default{};He.Bonjour=fr;He.default=fr;Y0.exports=Object.assign(fr,{Bonjour:fr,Service:ji.Service,Browser:ji.Browser,default:fr})});var kn=q((nW,Zw)=>{"use strict";var Bw=["nodebuffer","arraybuffer","fragments"],Hw=typeof Blob<"u";Hw&&Bw.push("blob");Zw.exports={BINARY_TYPES:Bw,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:Hw,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var Fi=q((rW,qc)=>{"use strict";var{EMPTY_BUFFER:uN}=kn(),Zg=Buffer[Symbol.species];function dN(e,t){if(e.length===0)return uN;if(e.length===1)return e[0];let r=Buffer.allocUnsafe(t),o=0;for(let n=0;n<e.length;n++){let i=e[n];r.set(i,o),o+=i.length}return o<t?new Zg(r.buffer,r.byteOffset,o):r}function Gw(e,t,r,o,n){for(let i=0;i<n;i++)r[o+i]=e[i]^t[i&3]}function Ww(e,t){for(let r=0;r<e.length;r++)e[r]^=t[r&3]}function pN(e){return e.length===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.length)}function Gg(e){if(Gg.readOnly=!0,Buffer.isBuffer(e))return e;let t;return e instanceof ArrayBuffer?t=new Zg(e):ArrayBuffer.isView(e)?t=new Zg(e.buffer,e.byteOffset,e.byteLength):(t=Buffer.from(e),Gg.readOnly=!1),t}qc.exports={concat:dN,mask:Gw,toArrayBuffer:pN,toBuffer:Gg,unmask:Ww};if(!process.env.WS_NO_BUFFER_UTIL)try{let e=te("bufferutil");qc.exports.mask=function(t,r,o,n,i){i<48?Gw(t,r,o,n,i):e.mask(t,r,o,n,i)},qc.exports.unmask=function(t,r){t.length<32?Ww(t,r):e.unmask(t,r)}}catch{}});var qw=q((oW,Jw)=>{"use strict";var Vw=Symbol("kDone"),Wg=Symbol("kRun"),Vg=class{constructor(t){this[Vw]=()=>{this.pending--,this[Wg]()},this.concurrency=t||1/0,this.jobs=[],this.pending=0}add(t){this.jobs.push(t),this[Wg]()}[Wg](){if(this.pending!==this.concurrency&&this.jobs.length){let t=this.jobs.shift();this.pending++,t(this[Vw])}}};Jw.exports=Vg});var $o=q((iW,Qw)=>{"use strict";var Mi=te("zlib"),Kw=Fi(),mN=qw(),{kStatusCode:Xw}=kn(),fN=Buffer[Symbol.species],gN=Buffer.from([0,0,255,255]),Xc=Symbol("permessage-deflate"),wn=Symbol("total-length"),So=Symbol("callback"),Gn=Symbol("buffers"),_o=Symbol("error"),Kc,Jg=class{constructor(t){if(this._options=t||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._maxPayload=this._options.maxPayload|0,this._isServer=!!this._options.isServer,this._deflate=null,this._inflate=null,this.params=null,!Kc){let r=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;Kc=new mN(r)}}static get extensionName(){return"permessage-deflate"}offer(){let t={};return this._options.serverNoContextTakeover&&(t.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(t.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(t.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?t.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(t.client_max_window_bits=!0),t}accept(t){return t=this.normalizeParams(t),this.params=this._isServer?this.acceptAsServer(t):this.acceptAsClient(t),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let t=this._deflate[So];this._deflate.close(),this._deflate=null,t&&t(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(t){let r=this._options,o=t.find(n=>!(r.serverNoContextTakeover===!1&&n.server_no_context_takeover||n.server_max_window_bits&&(r.serverMaxWindowBits===!1||typeof r.serverMaxWindowBits=="number"&&r.serverMaxWindowBits>n.server_max_window_bits)||typeof r.clientMaxWindowBits=="number"&&!n.client_max_window_bits));if(!o)throw new Error("None of the extension offers can be accepted");return r.serverNoContextTakeover&&(o.server_no_context_takeover=!0),r.clientNoContextTakeover&&(o.client_no_context_takeover=!0),typeof r.serverMaxWindowBits=="number"&&(o.server_max_window_bits=r.serverMaxWindowBits),typeof r.clientMaxWindowBits=="number"?o.client_max_window_bits=r.clientMaxWindowBits:(o.client_max_window_bits===!0||r.clientMaxWindowBits===!1)&&delete o.client_max_window_bits,o}acceptAsClient(t){let r=t[0];if(this._options.clientNoContextTakeover===!1&&r.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!r.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(r.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&r.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return r}normalizeParams(t){return t.forEach(r=>{Object.keys(r).forEach(o=>{let n=r[o];if(n.length>1)throw new Error(`Parameter "${o}" must have only a single value`);if(n=n[0],o==="client_max_window_bits"){if(n!==!0){let i=+n;if(!Number.isInteger(i)||i<8||i>15)throw new TypeError(`Invalid value for parameter "${o}": ${n}`);n=i}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${o}": ${n}`)}else if(o==="server_max_window_bits"){let i=+n;if(!Number.isInteger(i)||i<8||i>15)throw new TypeError(`Invalid value for parameter "${o}": ${n}`);n=i}else if(o==="client_no_context_takeover"||o==="server_no_context_takeover"){if(n!==!0)throw new TypeError(`Invalid value for parameter "${o}": ${n}`)}else throw new Error(`Unknown parameter "${o}"`);r[o]=n})}),t}decompress(t,r,o){Kc.add(n=>{this._decompress(t,r,(i,a)=>{n(),o(i,a)})})}compress(t,r,o){Kc.add(n=>{this._compress(t,r,(i,a)=>{n(),o(i,a)})})}_decompress(t,r,o){let n=this._isServer?"client":"server";if(!this._inflate){let i=`${n}_max_window_bits`,a=typeof this.params[i]!="number"?Mi.Z_DEFAULT_WINDOWBITS:this.params[i];this._inflate=Mi.createInflateRaw({...this._options.zlibInflateOptions,windowBits:a}),this._inflate[Xc]=this,this._inflate[wn]=0,this._inflate[Gn]=[],this._inflate.on("error",vN),this._inflate.on("data",Yw)}this._inflate[So]=o,this._inflate.write(t),r&&this._inflate.write(gN),this._inflate.flush(()=>{let i=this._inflate[_o];if(i){this._inflate.close(),this._inflate=null,o(i);return}let a=Kw.concat(this._inflate[Gn],this._inflate[wn]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[wn]=0,this._inflate[Gn]=[],r&&this.params[`${n}_no_context_takeover`]&&this._inflate.reset()),o(null,a)})}_compress(t,r,o){let n=this._isServer?"server":"client";if(!this._deflate){let i=`${n}_max_window_bits`,a=typeof this.params[i]!="number"?Mi.Z_DEFAULT_WINDOWBITS:this.params[i];this._deflate=Mi.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:a}),this._deflate[wn]=0,this._deflate[Gn]=[],this._deflate.on("data",hN)}this._deflate[So]=o,this._deflate.write(t),this._deflate.flush(Mi.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let i=Kw.concat(this._deflate[Gn],this._deflate[wn]);r&&(i=new fN(i.buffer,i.byteOffset,i.length-4)),this._deflate[So]=null,this._deflate[wn]=0,this._deflate[Gn]=[],r&&this.params[`${n}_no_context_takeover`]&&this._deflate.reset(),o(null,i)})}};Qw.exports=Jg;function hN(e){this[Gn].push(e),this[wn]+=e.length}function Yw(e){if(this[wn]+=e.length,this[Xc]._maxPayload<1||this[wn]<=this[Xc]._maxPayload){this[Gn].push(e);return}this[_o]=new RangeError("Max payload size exceeded"),this[_o].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[_o][Xw]=1009,this.removeListener("data",Yw),this.reset()}function vN(e){if(this[Xc]._inflate=null,this[_o]){this[So](this[_o]);return}e[Xw]=1007,this[So](e)}});var Io=q((aW,Yc)=>{"use strict";var{isUtf8:eS}=te("buffer"),{hasBlob:yN}=kn(),bN=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function xN(e){return e>=1e3&&e<=1014&&e!==1004&&e!==1005&&e!==1006||e>=3e3&&e<=4999}function qg(e){let t=e.length,r=0;for(;r<t;)if((e[r]&128)===0)r++;else if((e[r]&224)===192){if(r+1===t||(e[r+1]&192)!==128||(e[r]&254)===192)return!1;r+=2}else if((e[r]&240)===224){if(r+2>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||e[r]===224&&(e[r+1]&224)===128||e[r]===237&&(e[r+1]&224)===160)return!1;r+=3}else if((e[r]&248)===240){if(r+3>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||(e[r+3]&192)!==128||e[r]===240&&(e[r+1]&240)===128||e[r]===244&&e[r+1]>143||e[r]>244)return!1;r+=4}else return!1;return!0}function kN(e){return yN&&typeof e=="object"&&typeof e.arrayBuffer=="function"&&typeof e.type=="string"&&typeof e.stream=="function"&&(e[Symbol.toStringTag]==="Blob"||e[Symbol.toStringTag]==="File")}Yc.exports={isBlob:kN,isValidStatusCode:xN,isValidUTF8:qg,tokenChars:bN};if(eS)Yc.exports.isValidUTF8=function(e){return e.length<24?qg(e):eS(e)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let e=te("utf-8-validate");Yc.exports.isValidUTF8=function(t){return t.length<32?qg(t):e(t)}}catch{}});var eh=q((sW,sS)=>{"use strict";var{Writable:wN}=te("stream"),tS=$o(),{BINARY_TYPES:SN,EMPTY_BUFFER:nS,kStatusCode:_N,kWebSocket:$N}=kn(),{concat:Kg,toArrayBuffer:IN,unmask:AN}=Fi(),{isValidStatusCode:EN,isValidUTF8:rS}=Io(),Qc=Buffer[Symbol.species],gt=0,oS=1,iS=2,aS=3,Xg=4,Yg=5,el=6,Qg=class extends wN{constructor(t={}){super(),this._allowSynchronousEvents=t.allowSynchronousEvents!==void 0?t.allowSynchronousEvents:!0,this._binaryType=t.binaryType||SN[0],this._extensions=t.extensions||{},this._isServer=!!t.isServer,this._maxBufferedChunks=t.maxBufferedChunks|0,this._maxFragments=t.maxFragments|0,this._maxPayload=t.maxPayload|0,this._skipUTF8Validation=!!t.skipUTF8Validation,this[$N]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=gt}_write(t,r,o){if(this._opcode===8&&this._state==gt)return o();if(this._maxBufferedChunks>0&&this._buffers.length>=this._maxBufferedChunks){o(this.createError(RangeError,"Too many buffered chunks",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS"));return}this._bufferedBytes+=t.length,this._buffers.push(t),this.startLoop(o)}consume(t){if(this._bufferedBytes-=t,t===this._buffers[0].length)return this._buffers.shift();if(t<this._buffers[0].length){let o=this._buffers[0];return this._buffers[0]=new Qc(o.buffer,o.byteOffset+t,o.length-t),new Qc(o.buffer,o.byteOffset,t)}let r=Buffer.allocUnsafe(t);do{let o=this._buffers[0],n=r.length-t;t>=o.length?r.set(this._buffers.shift(),n):(r.set(new Uint8Array(o.buffer,o.byteOffset,t),n),this._buffers[0]=new Qc(o.buffer,o.byteOffset+t,o.length-t)),t-=o.length}while(t>0);return r}startLoop(t){this._loop=!0;do switch(this._state){case gt:this.getInfo(t);break;case oS:this.getPayloadLength16(t);break;case iS:this.getPayloadLength64(t);break;case aS:this.getMask();break;case Xg:this.getData(t);break;case Yg:case el:this._loop=!1;return}while(this._loop);this._errored||t()}getInfo(t){if(this._bufferedBytes<2){this._loop=!1;return}let r=this.consume(2);if((r[0]&48)!==0){let n=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");t(n);return}let o=(r[0]&64)===64;if(o&&!this._extensions[tS.extensionName]){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(n);return}if(this._fin=(r[0]&128)===128,this._opcode=r[0]&15,this._payloadLength=r[1]&127,this._opcode===0){if(o){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(n);return}if(!this._fragmented){let n=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");t(n);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let n=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(n);return}this._compressed=o}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let n=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");t(n);return}if(o){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(n);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let n=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");t(n);return}}else{let n=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(n);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(r[1]&128)===128,this._isServer){if(!this._masked){let n=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");t(n);return}}else if(this._masked){let n=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");t(n);return}this._payloadLength===126?this._state=oS:this._payloadLength===127?this._state=iS:this.haveLength(t)}getPayloadLength16(t){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(t)}getPayloadLength64(t){if(this._bufferedBytes<8){this._loop=!1;return}let r=this.consume(8),o=r.readUInt32BE(0);if(o>Math.pow(2,21)-1){let n=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");t(n);return}this._payloadLength=o*Math.pow(2,32)+r.readUInt32BE(4),this.haveLength(t)}haveLength(t){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let r=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");t(r);return}this._masked?this._state=aS:this._state=Xg}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=Xg}getData(t){let r=nS;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}r=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&AN(r,this._mask)}if(this._opcode>7){this.controlMessage(r,t);return}if(this._compressed){this._state=Yg,this.decompress(r,t);return}if(r.length){if(this._maxFragments>0&&this._fragments.length>=this._maxFragments){let o=this.createError(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS");t(o);return}this._messageLength=this._totalPayloadLength,this._fragments.push(r)}this.dataMessage(t)}decompress(t,r){this._extensions[tS.extensionName].decompress(t,this._fin,(n,i)=>{if(n)return r(n);if(i.length){if(this._messageLength+=i.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let a=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");r(a);return}if(this._maxFragments>0&&this._fragments.length>=this._maxFragments){let a=this.createError(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS");r(a);return}this._fragments.push(i)}this.dataMessage(r),this._state===gt&&this.startLoop(r)})}dataMessage(t){if(!this._fin){this._state=gt;return}let r=this._messageLength,o=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let n;this._binaryType==="nodebuffer"?n=Kg(o,r):this._binaryType==="arraybuffer"?n=IN(Kg(o,r)):this._binaryType==="blob"?n=new Blob(o):n=o,this._allowSynchronousEvents?(this.emit("message",n,!0),this._state=gt):(this._state=el,setImmediate(()=>{this.emit("message",n,!0),this._state=gt,this.startLoop(t)}))}else{let n=Kg(o,r);if(!this._skipUTF8Validation&&!rS(n)){let i=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(i);return}this._state===Yg||this._allowSynchronousEvents?(this.emit("message",n,!1),this._state=gt):(this._state=el,setImmediate(()=>{this.emit("message",n,!1),this._state=gt,this.startLoop(t)}))}}controlMessage(t,r){if(this._opcode===8){if(t.length===0)this._loop=!1,this.emit("conclude",1005,nS),this.end();else{let o=t.readUInt16BE(0);if(!EN(o)){let i=this.createError(RangeError,`invalid status code ${o}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");r(i);return}let n=new Qc(t.buffer,t.byteOffset+2,t.length-2);if(!this._skipUTF8Validation&&!rS(n)){let i=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");r(i);return}this._loop=!1,this.emit("conclude",o,n),this.end()}this._state=gt;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",t),this._state=gt):(this._state=el,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",t),this._state=gt,this.startLoop(r)}))}createError(t,r,o,n,i){this._loop=!1,this._errored=!0;let a=new t(o?`Invalid WebSocket frame: ${r}`:r);return Error.captureStackTrace(a,this.createError),a.code=i,a[_N]=n,a}};sS.exports=Qg});var rh=q((lW,uS)=>{"use strict";var{Duplex:cW}=te("stream"),{randomFillSync:PN}=te("crypto"),{types:{isUint8Array:CN}}=te("util"),cS=$o(),{EMPTY_BUFFER:TN,kWebSocket:RN,NOOP:ON}=kn(),{isBlob:Ao,isValidStatusCode:DN}=Io(),{mask:lS,toBuffer:hr}=Fi(),ht=Symbol("kByteLength"),NN=Buffer.alloc(4),tl=8*1024,vr,Eo=tl,Pt=0,LN=1,UN=2,th=class e{constructor(t,r,o){this._extensions=r||{},o&&(this._generateMask=o,this._maskBuffer=Buffer.alloc(4)),this._socket=t,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=Pt,this.onerror=ON,this[RN]=void 0}static frame(t,r){let o,n=!1,i=2,a=!1;r.mask&&(o=r.maskBuffer||NN,r.generateMask?r.generateMask(o):(Eo===tl&&(vr===void 0&&(vr=Buffer.alloc(tl)),PN(vr,0,tl),Eo=0),o[0]=vr[Eo++],o[1]=vr[Eo++],o[2]=vr[Eo++],o[3]=vr[Eo++]),a=(o[0]|o[1]|o[2]|o[3])===0,i=6);let s;typeof t=="string"?(!r.mask||a)&&r[ht]!==void 0?s=r[ht]:(t=Buffer.from(t),s=t.length):(s=t.length,n=r.mask&&r.readOnly&&!a);let l=s;s>=65536?(i+=8,l=127):s>125&&(i+=2,l=126);let u=Buffer.allocUnsafe(n?s+i:i);return u[0]=r.fin?r.opcode|128:r.opcode,r.rsv1&&(u[0]|=64),u[1]=l,l===126?u.writeUInt16BE(s,2):l===127&&(u[2]=u[3]=0,u.writeUIntBE(s,4,6)),r.mask?(u[1]|=128,u[i-4]=o[0],u[i-3]=o[1],u[i-2]=o[2],u[i-1]=o[3],a?[u,t]:n?(lS(t,o,u,i,s),[u]):(lS(t,o,t,0,s),[u,t])):[u,t]}close(t,r,o,n){let i;if(t===void 0)i=TN;else{if(typeof t!="number"||!DN(t))throw new TypeError("First argument must be a valid error code number");if(r===void 0||!r.length)i=Buffer.allocUnsafe(2),i.writeUInt16BE(t,0);else{let s=Buffer.byteLength(r);if(s>123)throw new RangeError("The message must not be greater than 123 bytes");if(i=Buffer.allocUnsafe(2+s),i.writeUInt16BE(t,0),typeof r=="string")i.write(r,2);else if(CN(r))i.set(r,2);else throw new TypeError("Second argument must be a string or a Uint8Array")}}let a={[ht]:i.length,fin:!0,generateMask:this._generateMask,mask:o,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==Pt?this.enqueue([this.dispatch,i,!1,a,n]):this.sendFrame(e.frame(i,a),n)}ping(t,r,o){let n,i;if(typeof t=="string"?(n=Buffer.byteLength(t),i=!1):Ao(t)?(n=t.size,i=!1):(t=hr(t),n=t.length,i=hr.readOnly),n>125)throw new RangeError("The data size must not be greater than 125 bytes");let a={[ht]:n,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:9,readOnly:i,rsv1:!1};Ao(t)?this._state!==Pt?this.enqueue([this.getBlobData,t,!1,a,o]):this.getBlobData(t,!1,a,o):this._state!==Pt?this.enqueue([this.dispatch,t,!1,a,o]):this.sendFrame(e.frame(t,a),o)}pong(t,r,o){let n,i;if(typeof t=="string"?(n=Buffer.byteLength(t),i=!1):Ao(t)?(n=t.size,i=!1):(t=hr(t),n=t.length,i=hr.readOnly),n>125)throw new RangeError("The data size must not be greater than 125 bytes");let a={[ht]:n,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:10,readOnly:i,rsv1:!1};Ao(t)?this._state!==Pt?this.enqueue([this.getBlobData,t,!1,a,o]):this.getBlobData(t,!1,a,o):this._state!==Pt?this.enqueue([this.dispatch,t,!1,a,o]):this.sendFrame(e.frame(t,a),o)}send(t,r,o){let n=this._extensions[cS.extensionName],i=r.binary?2:1,a=r.compress,s,l;typeof t=="string"?(s=Buffer.byteLength(t),l=!1):Ao(t)?(s=t.size,l=!1):(t=hr(t),s=t.length,l=hr.readOnly),this._firstFragment?(this._firstFragment=!1,a&&n&&n.params[n._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(a=s>=n._threshold),this._compress=a):(a=!1,i=0),r.fin&&(this._firstFragment=!0);let u={[ht]:s,fin:r.fin,generateMask:this._generateMask,mask:r.mask,maskBuffer:this._maskBuffer,opcode:i,readOnly:l,rsv1:a};Ao(t)?this._state!==Pt?this.enqueue([this.getBlobData,t,this._compress,u,o]):this.getBlobData(t,this._compress,u,o):this._state!==Pt?this.enqueue([this.dispatch,t,this._compress,u,o]):this.dispatch(t,this._compress,u,o)}getBlobData(t,r,o,n){this._bufferedBytes+=o[ht],this._state=UN,t.arrayBuffer().then(i=>{if(this._socket.destroyed){let s=new Error("The socket was closed while the blob was being read");process.nextTick(nh,this,s,n);return}this._bufferedBytes-=o[ht];let a=hr(i);r?this.dispatch(a,r,o,n):(this._state=Pt,this.sendFrame(e.frame(a,o),n),this.dequeue())}).catch(i=>{process.nextTick(zN,this,i,n)})}dispatch(t,r,o,n){if(!r){this.sendFrame(e.frame(t,o),n);return}let i=this._extensions[cS.extensionName];this._bufferedBytes+=o[ht],this._state=LN,i.compress(t,o.fin,(a,s)=>{if(this._socket.destroyed){let l=new Error("The socket was closed while data was being compressed");nh(this,l,n);return}this._bufferedBytes-=o[ht],this._state=Pt,o.readOnly=!1,this.sendFrame(e.frame(s,o),n),this.dequeue()})}dequeue(){for(;this._state===Pt&&this._queue.length;){let t=this._queue.shift();this._bufferedBytes-=t[3][ht],Reflect.apply(t[0],this,t.slice(1))}}enqueue(t){this._bufferedBytes+=t[3][ht],this._queue.push(t)}sendFrame(t,r){t.length===2?(this._socket.cork(),this._socket.write(t[0]),this._socket.write(t[1],r),this._socket.uncork()):this._socket.write(t[0],r)}};uS.exports=th;function nh(e,t,r){typeof r=="function"&&r(t);for(let o=0;o<e._queue.length;o++){let n=e._queue[o],i=n[n.length-1];typeof i=="function"&&i(t)}}function zN(e,t,r){nh(e,t,r),e.onerror(t)}});var bS=q((uW,yS)=>{"use strict";var{kForOnEventAttribute:Bi,kListener:oh}=kn(),dS=Symbol("kCode"),pS=Symbol("kData"),mS=Symbol("kError"),fS=Symbol("kMessage"),gS=Symbol("kReason"),Po=Symbol("kTarget"),hS=Symbol("kType"),vS=Symbol("kWasClean"),Sn=class{constructor(t){this[Po]=null,this[hS]=t}get target(){return this[Po]}get type(){return this[hS]}};Object.defineProperty(Sn.prototype,"target",{enumerable:!0});Object.defineProperty(Sn.prototype,"type",{enumerable:!0});var yr=class extends Sn{constructor(t,r={}){super(t),this[dS]=r.code===void 0?0:r.code,this[gS]=r.reason===void 0?"":r.reason,this[vS]=r.wasClean===void 0?!1:r.wasClean}get code(){return this[dS]}get reason(){return this[gS]}get wasClean(){return this[vS]}};Object.defineProperty(yr.prototype,"code",{enumerable:!0});Object.defineProperty(yr.prototype,"reason",{enumerable:!0});Object.defineProperty(yr.prototype,"wasClean",{enumerable:!0});var Co=class extends Sn{constructor(t,r={}){super(t),this[mS]=r.error===void 0?null:r.error,this[fS]=r.message===void 0?"":r.message}get error(){return this[mS]}get message(){return this[fS]}};Object.defineProperty(Co.prototype,"error",{enumerable:!0});Object.defineProperty(Co.prototype,"message",{enumerable:!0});var Hi=class extends Sn{constructor(t,r={}){super(t),this[pS]=r.data===void 0?null:r.data}get data(){return this[pS]}};Object.defineProperty(Hi.prototype,"data",{enumerable:!0});var jN={addEventListener(e,t,r={}){for(let n of this.listeners(e))if(!r[Bi]&&n[oh]===t&&!n[Bi])return;let o;if(e==="message")o=function(i,a){let s=new Hi("message",{data:a?i:i.toString()});s[Po]=this,nl(t,this,s)};else if(e==="close")o=function(i,a){let s=new yr("close",{code:i,reason:a.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});s[Po]=this,nl(t,this,s)};else if(e==="error")o=function(i){let a=new Co("error",{error:i,message:i.message});a[Po]=this,nl(t,this,a)};else if(e==="open")o=function(){let i=new Sn("open");i[Po]=this,nl(t,this,i)};else return;o[Bi]=!!r[Bi],o[oh]=t,r.once?this.once(e,o):this.on(e,o)},removeEventListener(e,t){for(let r of this.listeners(e))if(r[oh]===t&&!r[Bi]){this.removeListener(e,r);break}}};yS.exports={CloseEvent:yr,ErrorEvent:Co,Event:Sn,EventTarget:jN,MessageEvent:Hi};function nl(e,t,r){typeof e=="object"&&e.handleEvent?e.handleEvent.call(e,r):e.call(t,r)}});var rl=q((dW,xS)=>{"use strict";var{tokenChars:Zi}=Io();function Wt(e,t,r){e[t]===void 0?e[t]=[r]:e[t].push(r)}function FN(e){let t=Object.create(null),r=Object.create(null),o=!1,n=!1,i=!1,a,s,l=-1,u=-1,d=-1,p=0;for(;p<e.length;p++)if(u=e.charCodeAt(p),a===void 0)if(d===-1&&Zi[u]===1)l===-1&&(l=p);else if(p!==0&&(u===32||u===9))d===-1&&l!==-1&&(d=p);else if(u===59||u===44){if(l===-1)throw new SyntaxError(`Unexpected character at index ${p}`);d===-1&&(d=p);let f=e.slice(l,d);u===44?(Wt(t,f,r),r=Object.create(null)):a=f,l=d=-1}else throw new SyntaxError(`Unexpected character at index ${p}`);else if(s===void 0)if(d===-1&&Zi[u]===1)l===-1&&(l=p);else if(u===32||u===9)d===-1&&l!==-1&&(d=p);else if(u===59||u===44){if(l===-1)throw new SyntaxError(`Unexpected character at index ${p}`);d===-1&&(d=p),Wt(r,e.slice(l,d),!0),u===44&&(Wt(t,a,r),r=Object.create(null),a=void 0),l=d=-1}else if(u===61&&l!==-1&&d===-1)s=e.slice(l,p),l=d=-1;else throw new SyntaxError(`Unexpected character at index ${p}`);else if(n){if(Zi[u]!==1)throw new SyntaxError(`Unexpected character at index ${p}`);l===-1?l=p:o||(o=!0),n=!1}else if(i)if(Zi[u]===1)l===-1&&(l=p);else if(u===34&&l!==-1)i=!1,d=p;else if(u===92)n=!0;else throw new SyntaxError(`Unexpected character at index ${p}`);else if(u===34&&e.charCodeAt(p-1)===61)i=!0;else if(d===-1&&Zi[u]===1)l===-1&&(l=p);else if(l!==-1&&(u===32||u===9))d===-1&&(d=p);else if(u===59||u===44){if(l===-1)throw new SyntaxError(`Unexpected character at index ${p}`);d===-1&&(d=p);let f=e.slice(l,d);o&&(f=f.replace(/\\/g,""),o=!1),Wt(r,s,f),u===44&&(Wt(t,a,r),r=Object.create(null),a=void 0),s=void 0,l=d=-1}else throw new SyntaxError(`Unexpected character at index ${p}`);if(l===-1||i||u===32||u===9)throw new SyntaxError("Unexpected end of input");d===-1&&(d=p);let m=e.slice(l,d);return a===void 0?Wt(t,m,r):(s===void 0?Wt(r,m,!0):o?Wt(r,s,m.replace(/\\/g,"")):Wt(r,s,m),Wt(t,a,r)),t}function MN(e){return Object.keys(e).map(t=>{let r=e[t];return Array.isArray(r)||(r=[r]),r.map(o=>[t].concat(Object.keys(o).map(n=>{let i=o[n];return Array.isArray(i)||(i=[i]),i.map(a=>a===!0?n:`${n}=${a}`).join("; ")})).join("; ")).join(", ")}).join(", ")}xS.exports={format:MN,parse:FN}});var sl=q((fW,RS)=>{"use strict";var BN=te("events"),HN=te("https"),ZN=te("http"),SS=te("net"),GN=te("tls"),{randomBytes:WN,createHash:VN}=te("crypto"),{Duplex:pW,Readable:mW}=te("stream"),{URL:ih}=te("url"),Wn=$o(),JN=eh(),qN=rh(),{isBlob:KN}=Io(),{BINARY_TYPES:kS,CLOSE_TIMEOUT:XN,EMPTY_BUFFER:ol,GUID:YN,kForOnEventAttribute:ah,kListener:QN,kStatusCode:eL,kWebSocket:Ae,NOOP:_S}=kn(),{EventTarget:{addEventListener:tL,removeEventListener:nL}}=bS(),{format:rL,parse:oL}=rl(),{toBuffer:iL}=Fi(),$S=Symbol("kAborted"),sh=[8,13],_n=["CONNECTING","OPEN","CLOSING","CLOSED"],aL=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,fe=class e extends BN{constructor(t,r,o){super(),this._binaryType=kS[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=ol,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=e.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,t!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,r===void 0?r=[]:Array.isArray(r)||(typeof r=="object"&&r!==null?(o=r,r=[]):r=[r]),IS(this,t,r,o)):(this._autoPong=o.autoPong,this._closeTimeout=o.closeTimeout,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(t){kS.includes(t)&&(this._binaryType=t,this._receiver&&(this._receiver._binaryType=t))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(t,r,o){let n=new JN({allowSynchronousEvents:o.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxBufferedChunks:o.maxBufferedChunks,maxFragments:o.maxFragments,maxPayload:o.maxPayload,skipUTF8Validation:o.skipUTF8Validation}),i=new qN(t,this._extensions,o.generateMask);this._receiver=n,this._sender=i,this._socket=t,n[Ae]=this,i[Ae]=this,t[Ae]=this,n.on("conclude",lL),n.on("drain",uL),n.on("error",dL),n.on("message",pL),n.on("ping",mL),n.on("pong",fL),i.onerror=gL,t.setTimeout&&t.setTimeout(0),t.setNoDelay&&t.setNoDelay(),r.length>0&&t.unshift(r),t.on("close",PS),t.on("data",al),t.on("end",CS),t.on("error",TS),this._readyState=e.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[Wn.extensionName]&&this._extensions[Wn.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(t,r){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){lt(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===e.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=e.CLOSING,this._sender.close(t,r,!this._isServer,o=>{o||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),ES(this)}}pause(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!0,this._socket.pause())}ping(t,r,o){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(o=t,t=r=void 0):typeof r=="function"&&(o=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){ch(this,t,o);return}r===void 0&&(r=!this._isServer),this._sender.ping(t||ol,r,o)}pong(t,r,o){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(o=t,t=r=void 0):typeof r=="function"&&(o=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){ch(this,t,o);return}r===void 0&&(r=!this._isServer),this._sender.pong(t||ol,r,o)}resume(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(t,r,o){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof r=="function"&&(o=r,r={}),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){ch(this,t,o);return}let n={binary:typeof t!="string",mask:!this._isServer,compress:!0,fin:!0,...r};this._extensions[Wn.extensionName]||(n.compress=!1),this._sender.send(t||ol,n,o)}terminate(){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){lt(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=e.CLOSING,this._socket.destroy())}}};Object.defineProperty(fe,"CONNECTING",{enumerable:!0,value:_n.indexOf("CONNECTING")});Object.defineProperty(fe.prototype,"CONNECTING",{enumerable:!0,value:_n.indexOf("CONNECTING")});Object.defineProperty(fe,"OPEN",{enumerable:!0,value:_n.indexOf("OPEN")});Object.defineProperty(fe.prototype,"OPEN",{enumerable:!0,value:_n.indexOf("OPEN")});Object.defineProperty(fe,"CLOSING",{enumerable:!0,value:_n.indexOf("CLOSING")});Object.defineProperty(fe.prototype,"CLOSING",{enumerable:!0,value:_n.indexOf("CLOSING")});Object.defineProperty(fe,"CLOSED",{enumerable:!0,value:_n.indexOf("CLOSED")});Object.defineProperty(fe.prototype,"CLOSED",{enumerable:!0,value:_n.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(e=>{Object.defineProperty(fe.prototype,e,{enumerable:!0})});["open","error","close","message"].forEach(e=>{Object.defineProperty(fe.prototype,`on${e}`,{enumerable:!0,get(){for(let t of this.listeners(e))if(t[ah])return t[QN];return null},set(t){for(let r of this.listeners(e))if(r[ah]){this.removeListener(e,r);break}typeof t=="function"&&this.addEventListener(e,t,{[ah]:!0})}})});fe.prototype.addEventListener=tL;fe.prototype.removeEventListener=nL;RS.exports=fe;function IS(e,t,r,o){let n={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:XN,protocolVersion:sh[1],maxBufferedChunks:1048576,maxFragments:131072,maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...o,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(e._autoPong=n.autoPong,e._closeTimeout=n.closeTimeout,!sh.includes(n.protocolVersion))throw new RangeError(`Unsupported protocol version: ${n.protocolVersion} (supported versions: ${sh.join(", ")})`);let i;if(t instanceof ih)i=t;else try{i=new ih(t)}catch{throw new SyntaxError(`Invalid URL: ${t}`)}i.protocol==="http:"?i.protocol="ws:":i.protocol==="https:"&&(i.protocol="wss:"),e._url=i.href;let a=i.protocol==="wss:",s=i.protocol==="ws+unix:",l;if(i.protocol!=="ws:"&&!a&&!s?l=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:s&&!i.pathname?l="The URL's pathname is empty":i.hash&&(l="The URL contains a fragment identifier"),l){let y=new SyntaxError(l);if(e._redirects===0)throw y;il(e,y);return}let u=a?443:80,d=WN(16).toString("base64"),p=a?HN.request:ZN.request,m=new Set,f;if(n.createConnection=n.createConnection||(a?cL:sL),n.defaultPort=n.defaultPort||u,n.port=i.port||u,n.host=i.hostname.startsWith("[")?i.hostname.slice(1,-1):i.hostname,n.headers={...n.headers,"Sec-WebSocket-Version":n.protocolVersion,"Sec-WebSocket-Key":d,Connection:"Upgrade",Upgrade:"websocket"},n.path=i.pathname+i.search,n.timeout=n.handshakeTimeout,n.perMessageDeflate&&(f=new Wn({...n.perMessageDeflate,isServer:!1,maxPayload:n.maxPayload}),n.headers["Sec-WebSocket-Extensions"]=rL({[Wn.extensionName]:f.offer()})),r.length){for(let y of r){if(typeof y!="string"||!aL.test(y)||m.has(y))throw new SyntaxError("An invalid or duplicated subprotocol was specified");m.add(y)}n.headers["Sec-WebSocket-Protocol"]=r.join(",")}if(n.origin&&(n.protocolVersion<13?n.headers["Sec-WebSocket-Origin"]=n.origin:n.headers.Origin=n.origin),(i.username||i.password)&&(n.auth=`${i.username}:${i.password}`),s){let y=n.path.split(":");n.socketPath=y[0],n.path=y[1]}let g;if(n.followRedirects){if(e._redirects===0){e._originalIpc=s,e._originalSecure=a,e._originalHostOrSocketPath=s?n.socketPath:i.host;let y=o&&o.headers;if(o={...o,headers:{}},y)for(let[k,_]of Object.entries(y))o.headers[k.toLowerCase()]=_}else if(e.listenerCount("redirect")===0){let y=s?e._originalIpc?n.socketPath===e._originalHostOrSocketPath:!1:e._originalIpc?!1:i.host===e._originalHostOrSocketPath;(!y||e._originalSecure&&!a)&&(delete n.headers.authorization,delete n.headers.cookie,y||delete n.headers.host,n.auth=void 0)}n.auth&&!o.headers.authorization&&(o.headers.authorization="Basic "+Buffer.from(n.auth).toString("base64")),g=e._req=p(n),e._redirects&&e.emit("redirect",e.url,g)}else g=e._req=p(n);n.timeout&&g.on("timeout",()=>{lt(e,g,"Opening handshake has timed out")}),g.on("error",y=>{g===null||g[$S]||(g=e._req=null,il(e,y))}),g.on("response",y=>{let k=y.headers.location,_=y.statusCode;if(k&&n.followRedirects&&_>=300&&_<400){if(++e._redirects>n.maxRedirects){lt(e,g,"Maximum redirects exceeded");return}g.abort();let P;try{P=new ih(k,t)}catch{let E=new SyntaxError(`Invalid URL: ${k}`);il(e,E);return}IS(e,P,r,o)}else e.emit("unexpected-response",g,y)||lt(e,g,`Unexpected server response: ${y.statusCode}`)}),g.on("upgrade",(y,k,_)=>{if(e.emit("upgrade",y),e.readyState!==fe.CONNECTING)return;g=e._req=null;let P=y.headers.upgrade;if(P===void 0||P.toLowerCase()!=="websocket"){lt(e,k,"Invalid Upgrade header");return}let C=VN("sha1").update(d+YN).digest("base64");if(y.headers["sec-websocket-accept"]!==C){lt(e,k,"Invalid Sec-WebSocket-Accept header");return}let E=y.headers["sec-websocket-protocol"],D;if(E!==void 0?m.size?m.has(E)||(D="Server sent an invalid subprotocol"):D="Server sent a subprotocol but none was requested":m.size&&(D="Server sent no subprotocol"),D){lt(e,k,D);return}E&&(e._protocol=E);let G=y.headers["sec-websocket-extensions"];if(G!==void 0){if(!f){lt(e,k,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let ae;try{ae=oL(G)}catch{lt(e,k,"Invalid Sec-WebSocket-Extensions header");return}let X=Object.keys(ae);if(X.length!==1||X[0]!==Wn.extensionName){lt(e,k,"Server indicated an extension that was not requested");return}try{f.accept(ae[Wn.extensionName])}catch{lt(e,k,"Invalid Sec-WebSocket-Extensions header");return}e._extensions[Wn.extensionName]=f}e.setSocket(k,_,{allowSynchronousEvents:n.allowSynchronousEvents,generateMask:n.generateMask,maxBufferedChunks:n.maxBufferedChunks,maxFragments:n.maxFragments,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation})}),n.finishRequest?n.finishRequest(g,e):g.end()}function il(e,t){e._readyState=fe.CLOSING,e._errorEmitted=!0,e.emit("error",t),e.emitClose()}function sL(e){return e.path=e.socketPath,SS.connect(e)}function cL(e){return e.path=void 0,!e.servername&&e.servername!==""&&(e.servername=SS.isIP(e.host)?"":e.host),GN.connect(e)}function lt(e,t,r){e._readyState=fe.CLOSING;let o=new Error(r);Error.captureStackTrace(o,lt),t.setHeader?(t[$S]=!0,t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),process.nextTick(il,e,o)):(t.destroy(o),t.once("error",e.emit.bind(e,"error")),t.once("close",e.emitClose.bind(e)))}function ch(e,t,r){if(t){let o=KN(t)?t.size:iL(t).length;e._socket?e._sender._bufferedBytes+=o:e._bufferedAmount+=o}if(r){let o=new Error(`WebSocket is not open: readyState ${e.readyState} (${_n[e.readyState]})`);process.nextTick(r,o)}}function lL(e,t){let r=this[Ae];r._closeFrameReceived=!0,r._closeMessage=t,r._closeCode=e,r._socket[Ae]!==void 0&&(r._socket.removeListener("data",al),process.nextTick(AS,r._socket),e===1005?r.close():r.close(e,t))}function uL(){let e=this[Ae];e.isPaused||e._socket.resume()}function dL(e){let t=this[Ae];t._socket[Ae]!==void 0&&(t._socket.removeListener("data",al),process.nextTick(AS,t._socket),t.close(e[eL])),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e))}function wS(){this[Ae].emitClose()}function pL(e,t){this[Ae].emit("message",e,t)}function mL(e){let t=this[Ae];t._autoPong&&t.pong(e,!this._isServer,_S),t.emit("ping",e)}function fL(e){this[Ae].emit("pong",e)}function AS(e){e.resume()}function gL(e){let t=this[Ae];t.readyState!==fe.CLOSED&&(t.readyState===fe.OPEN&&(t._readyState=fe.CLOSING,ES(t)),this._socket.end(),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e)))}function ES(e){e._closeTimer=setTimeout(e._socket.destroy.bind(e._socket),e._closeTimeout)}function PS(){let e=this[Ae];if(this.removeListener("close",PS),this.removeListener("data",al),this.removeListener("end",CS),e._readyState=fe.CLOSING,!this._readableState.endEmitted&&!e._closeFrameReceived&&!e._receiver._writableState.errorEmitted&&this._readableState.length!==0){let t=this.read(this._readableState.length);e._receiver.write(t)}e._receiver.end(),this[Ae]=void 0,clearTimeout(e._closeTimer),e._receiver._writableState.finished||e._receiver._writableState.errorEmitted?e.emitClose():(e._receiver.on("error",wS),e._receiver.on("finish",wS))}function al(e){this[Ae]._receiver.write(e)||this.pause()}function CS(){let e=this[Ae];e._readyState=fe.CLOSING,e._receiver.end(),this.end()}function TS(){let e=this[Ae];this.removeListener("error",TS),this.on("error",_S),e&&(e._readyState=fe.CLOSING,this.destroy())}});var LS=q((hW,NS)=>{"use strict";var gW=sl(),{Duplex:hL}=te("stream");function OS(e){e.emit("close")}function vL(){!this.destroyed&&this._writableState.finished&&this.destroy()}function DS(e){this.removeListener("error",DS),this.destroy(),this.listenerCount("error")===0&&this.emit("error",e)}function yL(e,t){let r=!0,o=new hL({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return e.on("message",function(i,a){let s=!a&&o._readableState.objectMode?i.toString():i;o.push(s)||e.pause()}),e.once("error",function(i){o.destroyed||(r=!1,o.destroy(i))}),e.once("close",function(){o.destroyed||o.push(null)}),o._destroy=function(n,i){if(e.readyState===e.CLOSED){i(n),process.nextTick(OS,o);return}let a=!1;e.once("error",function(l){a=!0,i(l)}),e.once("close",function(){a||i(n),process.nextTick(OS,o)}),r&&e.terminate()},o._final=function(n){if(e.readyState===e.CONNECTING){e.once("open",function(){o._final(n)});return}e._socket!==null&&(e._socket._writableState.finished?(n(),o._readableState.endEmitted&&o.destroy()):(e._socket.once("finish",function(){n()}),e.close()))},o._read=function(){e.isPaused&&e.resume()},o._write=function(n,i,a){if(e.readyState===e.CONNECTING){e.once("open",function(){o._write(n,i,a)});return}e.send(n,a)},o.on("end",vL),o.on("error",DS),o}NS.exports=yL});var lh=q((vW,US)=>{"use strict";var{tokenChars:bL}=Io();function xL(e){let t=new Set,r=-1,o=-1,n=0;for(n;n<e.length;n++){let a=e.charCodeAt(n);if(o===-1&&bL[a]===1)r===-1&&(r=n);else if(n!==0&&(a===32||a===9))o===-1&&r!==-1&&(o=n);else if(a===44){if(r===-1)throw new SyntaxError(`Unexpected character at index ${n}`);o===-1&&(o=n);let s=e.slice(r,o);if(t.has(s))throw new SyntaxError(`The "${s}" subprotocol is duplicated`);t.add(s),r=o=-1}else throw new SyntaxError(`Unexpected character at index ${n}`)}if(r===-1||o!==-1)throw new SyntaxError("Unexpected end of input");let i=e.slice(r,n);if(t.has(i))throw new SyntaxError(`The "${i}" subprotocol is duplicated`);return t.add(i),t}US.exports={parse:xL}});var ZS=q((bW,HS)=>{"use strict";var kL=te("events"),cl=te("http"),{Duplex:yW}=te("stream"),{createHash:wL}=te("crypto"),zS=rl(),br=$o(),SL=lh(),_L=sl(),{CLOSE_TIMEOUT:$L,GUID:IL,kWebSocket:AL}=kn(),EL=/^[+/0-9A-Za-z]{22}==$/,jS=0,FS=1,BS=2,uh=class extends kL{constructor(t,r){if(super(),t={allowSynchronousEvents:!0,autoPong:!0,maxBufferedChunks:1024*1024,maxFragments:128*1024,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:$L,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:_L,...t},t.port==null&&!t.server&&!t.noServer||t.port!=null&&(t.server||t.noServer)||t.server&&t.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(t.port!=null?(this._server=cl.createServer((o,n)=>{let i=cl.STATUS_CODES[426];n.writeHead(426,{"Content-Length":i.length,"Content-Type":"text/plain"}),n.end(i)}),this._server.listen(t.port,t.host,t.backlog,r)):t.server&&(this._server=t.server),this._server){let o=this.emit.bind(this,"connection");this._removeListeners=PL(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(n,i,a)=>{this.handleUpgrade(n,i,a,o)}})}t.perMessageDeflate===!0&&(t.perMessageDeflate={}),t.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=t,this._state=jS}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(t){if(this._state===BS){t&&this.once("close",()=>{t(new Error("The server is not running"))}),process.nextTick(Gi,this);return}if(t&&this.once("close",t),this._state!==FS)if(this._state=FS,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(Gi,this):process.nextTick(Gi,this);else{let r=this._server;this._removeListeners(),this._removeListeners=this._server=null,r.close(()=>{Gi(this)})}}shouldHandle(t){if(this.options.path){let r=t.url.indexOf("?");if((r!==-1?t.url.slice(0,r):t.url)!==this.options.path)return!1}return!0}handleUpgrade(t,r,o,n){r.on("error",MS);let i=t.headers["sec-websocket-key"],a=t.headers.upgrade,s=+t.headers["sec-websocket-version"];if(t.method!=="GET"){xr(this,t,r,405,"Invalid HTTP method");return}if(a===void 0||a.toLowerCase()!=="websocket"){xr(this,t,r,400,"Invalid Upgrade header");return}if(i===void 0||!EL.test(i)){xr(this,t,r,400,"Missing or invalid Sec-WebSocket-Key header");return}if(s!==13&&s!==8){xr(this,t,r,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(t)){Wi(r,400);return}let l=t.headers["sec-websocket-protocol"],u=new Set;if(l!==void 0)try{u=SL.parse(l)}catch{xr(this,t,r,400,"Invalid Sec-WebSocket-Protocol header");return}let d=t.headers["sec-websocket-extensions"],p={};if(this.options.perMessageDeflate&&d!==void 0){let m=new br({...this.options.perMessageDeflate,isServer:!0,maxPayload:this.options.maxPayload});try{let f=zS.parse(d);f[br.extensionName]&&(m.accept(f[br.extensionName]),p[br.extensionName]=m)}catch{xr(this,t,r,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let m={origin:t.headers[`${s===8?"sec-websocket-origin":"origin"}`],secure:!!(t.socket.authorized||t.socket.encrypted),req:t};if(this.options.verifyClient.length===2){this.options.verifyClient(m,(f,g,y,k)=>{if(!f)return Wi(r,g||401,y,k);this.completeUpgrade(p,i,u,t,r,o,n)});return}if(!this.options.verifyClient(m))return Wi(r,401)}this.completeUpgrade(p,i,u,t,r,o,n)}completeUpgrade(t,r,o,n,i,a,s){if(!i.readable||!i.writable)return i.destroy();if(i[AL])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>jS)return Wi(i,503);let u=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${wL("sha1").update(r+IL).digest("base64")}`],d=new this.options.WebSocket(null,void 0,this.options);if(o.size){let p=this.options.handleProtocols?this.options.handleProtocols(o,n):o.values().next().value;p&&(u.push(`Sec-WebSocket-Protocol: ${p}`),d._protocol=p)}if(t[br.extensionName]){let p=t[br.extensionName].params,m=zS.format({[br.extensionName]:[p]});u.push(`Sec-WebSocket-Extensions: ${m}`),d._extensions=t}this.emit("headers",u,n),i.write(u.concat(`\r
|
|
4
|
+
var X_=Object.create;var wl=Object.defineProperty;var Y_=Object.getOwnPropertyDescriptor;var Q_=Object.getOwnPropertyNames;var e$=Object.getPrototypeOf,t$=Object.prototype.hasOwnProperty;var te=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var q=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},Jt=(e,t)=>{for(var r in t)wl(e,r,{get:t[r],enumerable:!0})},n$=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Q_(t))!t$.call(e,n)&&n!==r&&wl(e,n,{get:()=>t[n],enumerable:!(o=Y_(t,n))||o.enumerable});return e};var qt=(e,t,r)=>(r=e!=null?X_(e$(e)):{},n$(t||!e||!e.__esModule?wl(r,"default",{value:e,enumerable:!0}):r,e));var Fc=q(kg=>{"use strict";Object.defineProperty(kg,"__esModule",{value:!0});kg.default=MR;var I0=/[A-Z]/g;function A0(e){return e.toLowerCase()}function MR(e,t){let r=e.replace(I0,A0),o=t.replace(I0,A0);return r===o}});var wg=q(Fi=>{"use strict";Object.defineProperty(Fi,"__esModule",{value:!0});Fi.DnsTxt=void 0;var Bc=class{constructor(t={}){this.binary=t?t.binary:!1}encode(t={}){return Object.entries(t).map(([r,o])=>{let n=`${r}=${o}`;return Buffer.from(n)})}decode(t){var r={};try{let n=t.toString().split(/=(.+)/),i=n[0],a=n[1];r[i]=a}catch{}return r}decodeAll(t){return t.filter(r=>r.length>1).map(r=>this.decode(r)).reduce((r,o)=>{var n=r;let[i]=Object.keys(o),[a]=Object.values(o);return n[i]=a,n},{})}};Fi.DnsTxt=Bc;Fi.default=Bc});var Sg=q(wo=>{"use strict";Object.defineProperty(wo,"__esModule",{value:!0});wo.toType=wo.toString=void 0;var E0=e=>"_"+e,HR=e=>["name","protocol","subtype"].includes(e),ZR=e=>{let t={name:e.name,protocol:e.protocol,subtype:e.subtype};return Object.entries(t).filter(([o,n])=>HR(o)&&n!==void 0).reduce((o,[n,i])=>(typeof i==="object"?i.map(a=>o.push(E0(a))):o.push(E0(i)),o),[]).join(".")};wo.toString=ZR;var GR=e=>{let t=e.split("."),r;for(let o in t)t[o][0]==="_"&&(t[o]=t[o].slice(1));return t.includes("sub")&&(r=t.shift(),t.shift()),{name:t.shift(),protocol:t.shift()||null,subtype:r}};wo.toType=GR});var _g=q(dr=>{"use strict";var C0=dr&&dr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(dr,"__esModule",{value:!0});dr.Service=void 0;var P0=C0(te("os")),WR=C0(wg()),VR=te("events"),JR=Sg(),So=".local",Mc=class extends VR.EventEmitter{constructor(t,r,o){if(super(),this.start=r,this.stop=o,this.probe=!0,this.published=!1,this.activated=!1,this.destroyed=!1,this.txtService=new WR.default,!t.name)throw new Error("ServiceConfig requires `name` property to be set");if(!t.type)throw new Error("ServiceConfig requires `type` property to be set");if(!t.port)throw new Error("ServiceConfig requires `port` property to be set");this.name=t.name.split(".").join("-"),this.protocol=t.protocol||"tcp",this.type=(0,JR.toString)({name:t.type,protocol:this.protocol}),this.port=t.port,this.host=t.host||P0.default.hostname(),this.fqdn=`${this.name}.${this.type}${So}`,this.txt=t.txt,this.subtypes=t.subtypes,this.disableIPv6=!!t.disableIPv6}records(){var t=[this.RecordPTR(this),this.RecordSRV(this),this.RecordTXT(this),this.RecordServicePTR(this)];for(let o of this.subtypes||[])t.push(this.RecordSubtypePTR(this,o));let r=Object.values(P0.default.networkInterfaces());for(let o of r){let n=o;for(let i of n)if(!(i.internal||i.mac==="00:00:00:00:00:00"))switch(i.family){case"IPv4":t.push(this.RecordA(this,i.address));break;case"IPv6":if(this.disableIPv6)break;t.push(this.RecordAAAA(this,i.address));break}}return t}RecordPTR(t){return{name:`${t.type}${So}`,type:"PTR",ttl:28800,data:t.fqdn}}RecordServicePTR(t){return{name:`_services._dns-sd._udp${So}`,type:"PTR",ttl:120,data:`${t.type}${So}`}}RecordSubtypePTR(t,r){return{name:`_${r}._sub.${t.type}${So}`,type:"PTR",ttl:28800,data:`${t.name}.${t.type}${So}`}}RecordSRV(t){return{name:t.fqdn,type:"SRV",ttl:120,data:{port:t.port,target:t.host}}}RecordTXT(t){return{name:t.fqdn,type:"TXT",ttl:4500,data:this.txtService.encode(t.txt)}}RecordA(t,r){return{name:t.host,type:"A",ttl:120,data:r}}RecordAAAA(t,r){return{name:t.host,type:"AAAA",ttl:120,data:r}}};dr.Service=Mc;dr.default=Mc});var R0=q(pr=>{"use strict";var T0=pr&&pr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(pr,"__esModule",{value:!0});pr.Registry=void 0;var qR=T0(Fc()),$g=T0(_g()),KR=3600*1e3,XR=3,YR=function(){},Hc=class{constructor(t){this.services=[],this.server=t}publish(t){let r=t.probe!==!1,o=new $g.default(t,n.bind(null,this),i.bind(null,this));function n(a,{probe:s=r}={}){o.activated||(o.activated=!0,a.services.push(o),o instanceof $g.default&&(s?a.probe(a.server.mdns,o,l=>{if(l){o.stop!==void 0&&o.stop(),console.log(new Error("Service name is already in use on the network"));return}a.announce(a.server,o)}):a.announce(a.server,o)))}function i(a,s){if(s||(s=YR),!o.activated||!(o instanceof $g.default))return process.nextTick(s);a.teardown(a.server,o,s);let l=a.services.indexOf(o);l!==-1&&a.services.splice(l,1)}return o.start(),o}unpublishAll(t){this.teardown(this.server,this.services,t),this.services=[]}destroy(){this.services.map(t=>t.destroyed=!0)}probe(t,r,o){var n=!1,i=0,a;let s=()=>{!r.activated||r.destroyed||t.query(r.fqdn,"ANY",function(){n=!0,a=setTimeout(++i<3?s:d,250),a.unref()})},l=p=>{n&&(p.answers.some(u)||p.additionals.some(u))&&d(!0)},u=p=>(0,qR.default)(p.name,r.fqdn),d=p=>{t.removeListener("response",l),clearTimeout(a),o(!!p)};t.on("response",l),setTimeout(s,Math.random()*250)}announce(t,r){var o=1e3,n=r.records();t.register(n);let i=()=>{!r.activated||r.destroyed||t.mdns.respond(n,function(){r.published||(r.activated=!0,r.published=!0,r.emit("up")),o=o*XR,o<KR&&!r.destroyed&&setTimeout(i,o).unref()})};i()}teardown(t,r,o){Array.isArray(r)||(r=[r]),r=r.filter(i=>i.activated);var n=r.flatMap(function(i){i.activated=!1;var a=i.records();return a.forEach(s=>{s.ttl=0}),a});if(n.length===0)return o&&process.nextTick(o);t.unregister(n),t.mdns.respond(n,function(){r.forEach(function(i){i.published=!1}),typeof o=="function"&&o.apply(null,arguments)})}};pr.Registry=Hc;pr.default=Hc});var O0=q(Ig=>{"use strict";Ig.toString=function(e){switch(e){case 1:return"A";case 10:return"NULL";case 28:return"AAAA";case 18:return"AFSDB";case 42:return"APL";case 257:return"CAA";case 60:return"CDNSKEY";case 59:return"CDS";case 37:return"CERT";case 5:return"CNAME";case 49:return"DHCID";case 32769:return"DLV";case 39:return"DNAME";case 48:return"DNSKEY";case 43:return"DS";case 55:return"HIP";case 13:return"HINFO";case 45:return"IPSECKEY";case 25:return"KEY";case 36:return"KX";case 29:return"LOC";case 15:return"MX";case 35:return"NAPTR";case 2:return"NS";case 47:return"NSEC";case 50:return"NSEC3";case 51:return"NSEC3PARAM";case 12:return"PTR";case 46:return"RRSIG";case 17:return"RP";case 24:return"SIG";case 6:return"SOA";case 99:return"SPF";case 33:return"SRV";case 44:return"SSHFP";case 32768:return"TA";case 249:return"TKEY";case 52:return"TLSA";case 250:return"TSIG";case 16:return"TXT";case 252:return"AXFR";case 251:return"IXFR";case 41:return"OPT";case 255:return"ANY"}return"UNKNOWN_"+e};Ig.toType=function(e){switch(e.toUpperCase()){case"A":return 1;case"NULL":return 10;case"AAAA":return 28;case"AFSDB":return 18;case"APL":return 42;case"CAA":return 257;case"CDNSKEY":return 60;case"CDS":return 59;case"CERT":return 37;case"CNAME":return 5;case"DHCID":return 49;case"DLV":return 32769;case"DNAME":return 39;case"DNSKEY":return 48;case"DS":return 43;case"HIP":return 55;case"HINFO":return 13;case"IPSECKEY":return 45;case"KEY":return 25;case"KX":return 36;case"LOC":return 29;case"MX":return 15;case"NAPTR":return 35;case"NS":return 2;case"NSEC":return 47;case"NSEC3":return 50;case"NSEC3PARAM":return 51;case"PTR":return 12;case"RRSIG":return 46;case"RP":return 17;case"SIG":return 24;case"SOA":return 6;case"SPF":return 99;case"SRV":return 33;case"SSHFP":return 44;case"TA":return 32768;case"TKEY":return 249;case"TLSA":return 52;case"TSIG":return 250;case"TXT":return 16;case"AXFR":return 252;case"IXFR":return 251;case"OPT":return 41;case"ANY":return 255;case"*":return 255}return e.toUpperCase().startsWith("UNKNOWN_")?parseInt(e.slice(8)):0}});var D0=q(Ag=>{"use strict";Ag.toString=function(e){switch(e){case 0:return"NOERROR";case 1:return"FORMERR";case 2:return"SERVFAIL";case 3:return"NXDOMAIN";case 4:return"NOTIMP";case 5:return"REFUSED";case 6:return"YXDOMAIN";case 7:return"YXRRSET";case 8:return"NXRRSET";case 9:return"NOTAUTH";case 10:return"NOTZONE";case 11:return"RCODE_11";case 12:return"RCODE_12";case 13:return"RCODE_13";case 14:return"RCODE_14";case 15:return"RCODE_15"}return"RCODE_"+e};Ag.toRcode=function(e){switch(e.toUpperCase()){case"NOERROR":return 0;case"FORMERR":return 1;case"SERVFAIL":return 2;case"NXDOMAIN":return 3;case"NOTIMP":return 4;case"REFUSED":return 5;case"YXDOMAIN":return 6;case"YXRRSET":return 7;case"NXRRSET":return 8;case"NOTAUTH":return 9;case"NOTZONE":return 10;case"RCODE_11":return 11;case"RCODE_12":return 12;case"RCODE_13":return 13;case"RCODE_14":return 14;case"RCODE_15":return 15}return 0}});var N0=q(Eg=>{"use strict";Eg.toString=function(e){switch(e){case 0:return"QUERY";case 1:return"IQUERY";case 2:return"STATUS";case 3:return"OPCODE_3";case 4:return"NOTIFY";case 5:return"UPDATE";case 6:return"OPCODE_6";case 7:return"OPCODE_7";case 8:return"OPCODE_8";case 9:return"OPCODE_9";case 10:return"OPCODE_10";case 11:return"OPCODE_11";case 12:return"OPCODE_12";case 13:return"OPCODE_13";case 14:return"OPCODE_14";case 15:return"OPCODE_15"}return"OPCODE_"+e};Eg.toOpcode=function(e){switch(e.toUpperCase()){case"QUERY":return 0;case"IQUERY":return 1;case"STATUS":return 2;case"OPCODE_3":return 3;case"NOTIFY":return 4;case"UPDATE":return 5;case"OPCODE_6":return 6;case"OPCODE_7":return 7;case"OPCODE_8":return 8;case"OPCODE_9":return 9;case"OPCODE_10":return 10;case"OPCODE_11":return 11;case"OPCODE_12":return 12;case"OPCODE_13":return 13;case"OPCODE_14":return 14;case"OPCODE_15":return 15}return 0}});var L0=q(Pg=>{"use strict";Pg.toString=function(e){switch(e){case 1:return"IN";case 2:return"CS";case 3:return"CH";case 4:return"HS";case 255:return"ANY"}return"UNKNOWN_"+e};Pg.toClass=function(e){switch(e.toUpperCase()){case"IN":return 1;case"CS":return 2;case"CH":return 3;case"HS":return 4;case"ANY":return 255}return 0}});var U0=q(Cg=>{"use strict";Cg.toString=function(e){switch(e){case 1:return"LLQ";case 2:return"UL";case 3:return"NSID";case 5:return"DAU";case 6:return"DHU";case 7:return"N3U";case 8:return"CLIENT_SUBNET";case 9:return"EXPIRE";case 10:return"COOKIE";case 11:return"TCP_KEEPALIVE";case 12:return"PADDING";case 13:return"CHAIN";case 14:return"KEY_TAG";case 26946:return"DEVICEID"}return e<0?null:`OPTION_${e}`};Cg.toCode=function(e){if(typeof e=="number")return e;if(!e)return-1;switch(e.toUpperCase()){case"OPTION_0":return 0;case"LLQ":return 1;case"UL":return 2;case"NSID":return 3;case"OPTION_4":return 4;case"DAU":return 5;case"DHU":return 6;case"N3U":return 7;case"CLIENT_SUBNET":return 8;case"EXPIRE":return 9;case"COOKIE":return 10;case"TCP_KEEPALIVE":return 11;case"PADDING":return 12;case"CHAIN":return 13;case"KEY_TAG":return 14;case"DEVICEID":return 26946;case"OPTION_65535":return 65535}let t=e.match(/_(\d+)$/);return t?parseInt(t[1],10):-1}});var F0=q((j0,Tg)=>{var z0=(function(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decode=p,e.encode=d,e.familyOf=u,e.name=void 0,e.sizeOf=l,e.v6=e.v4=void 0;let t=/^(\d{1,3}\.){3,3}\d{1,3}$/,r=4,o=/^(::)?(((\d{1,3}\.){3}(\d{1,3}){1})?([0-9a-f]){0,4}:{0,2}){1,8}(::)?$/i,n=16,i={name:"v4",size:r,isFormat:m=>t.test(m),encode(m,f,g){g=~~g,f=f||new Uint8Array(g+r);let y=m.length,k=0;for(let _=0;_<y;){let P=m.charCodeAt(_++);P===46?(f[g++]=k,k=0):k=k*10+(P-48)}return f[g]=k,f},decode(m,f){return f=~~f,`${m[f++]}.${m[f++]}.${m[f++]}.${m[f]}`}};e.v4=i;let a={name:"v6",size:n,isFormat:m=>m.length>0&&o.test(m),encode(m,f,g){g=~~g;let y=g+n,k=-1,_=0,P=0,C=!0,E=!1;f=f||new Uint8Array(g+n);for(let D=0;D<m.length;D++){let W=m.charCodeAt(D);W===58?(C?k!==-1?(g<y&&(f[g]=0),g<y-1&&(f[g+1]=0),g+=2):g<y&&(k=g):(E===!0?(g<y&&(f[g]=P),g++):(g<y&&(f[g]=_>>8),g<y-1&&(f[g+1]=_&255),g+=2),_=0,P=0),C=!0,E=!1):W===46?(g<y&&(f[g]=P),g++,P=0,_=0,C=!1,E=!0):(C=!1,W>=97?W-=87:W>=65?W-=55:(W-=48,P=P*10+W),_=(_<<4)+W)}if(C===!1)E===!0?(g<y&&(f[g]=P),g++):(g<y&&(f[g]=_>>8),g<y-1&&(f[g+1]=_&255),g+=2);else if(k===0)g<y&&(f[g]=0),g<y-1&&(f[g+1]=0),g+=2;else if(k!==-1){g+=2;for(let D=Math.min(g-1,y-1);D>=k+2;D--)f[D]=f[D-2];f[k]=0,f[k+1]=0,k=g}if(k!==g&&k!==-1)for(g>y-2&&(g=y-2);y>k;)f[--y]=g<y&&g>k?f[--g]:0;else for(;g<y;)f[g++]=0;return f},decode(m,f){f=~~f;let g="";for(let y=0;y<n;y+=2)y!==0&&(g+=":"),g+=(m[f+y]<<8|m[f+y+1]).toString(16);return g.replace(/(^|:)0(:0)*:0(:|$)/,"$1::$3").replace(/:{3,4}/,"::")}};e.v6=a;let s="ip";e.name=s;function l(m){if(i.isFormat(m))return i.size;if(a.isFormat(m))return a.size;throw Error(`Invalid ip address: ${m}`)}function u(m){return l(m)===i.size?1:2}function d(m,f,g){g=~~g;let y=l(m);return typeof f=="function"&&(f=f(g+y)),y===i.size?i.encode(m,f,g):a.encode(m,f,g)}function p(m,f,g){if(f=~~f,g=g||m.length-f,g===i.size)return i.decode(m,f,g);if(g===a.size)return a.decode(m,f,g);throw Error(`Invalid buffer size needs to be ${i.size} for v4 or ${a.size} for v6.`)}return"default"in e?e.default:e})({});typeof define=="function"&&define.amd?define([],function(){return z0}):typeof Tg=="object"&&typeof j0=="object"&&(Tg.exports=z0)});var H0=q(N=>{"use strict";var L=te("buffer").Buffer,bn=O0(),QR=D0(),eO=N0(),Gc=L0(),Rg=U0(),mr=F0(),tO=0,B0=32768,Og=32768,nO=~Og,M0=32768,rO=~M0,R=N.name={};R.encode=function(e,t,r,{mail:o=!1}={}){t||(t=L.alloc(R.encodingLength(e))),r||(r=0);let n=r,i=e.replace(/^\.|\.$/gm,"");if(i.length){let a=[];if(o){let s="";i.split(".").forEach(l=>{l.endsWith("\\")?s+=(s.length?".":"")+l.slice(0,-1):a.length===0&&s.length?a.push(s+"."+l):a.push(l)})}else a=i.split(".");for(let s=0;s<a.length;s++){let l=t.write(a[s],r+1);t[r]=l,r+=l+1}}return t[r++]=0,R.encode.bytes=r-n,t};R.encode.bytes=0;R.decode=function(e,t,{mail:r=!1}={}){t||(t=0);let o=[],n=t,i=0,a=0,s=!1;for(;;){if(t>=e.length)throw new Error("Cannot decode name (buffer overflow)");let l=e[t++];if(a+=s?0:1,l===0)break;if((l&192)===0){if(t+l>e.length)throw new Error("Cannot decode name (buffer overflow)");if(i+=l+1,i>254)throw new Error("Cannot decode name (name too long)");let u=e.toString("utf-8",t,t+l);r&&(u=u.replace(/\./g,"\\.")),o.push(u),t+=l,a+=s?0:l}else if((l&192)===192){if(t+1>e.length)throw new Error("Cannot decode name (buffer overflow)");let u=e.readUInt16BE(t-1)-49152;if(u>=n)throw new Error("Cannot decode name (bad pointer)");t=u,n=u,a+=s?0:1,s=!0}else throw new Error("Cannot decode name (bad label)")}return R.decode.bytes=a,o.length===0?".":o.join(".")};R.decode.bytes=0;R.encodingLength=function(e){return e==="."||e===".."?1:L.byteLength(e.replace(/^\.|\.$/gm,""))+2};var J={};J.encode=function(e,t,r){t||(t=L.alloc(J.encodingLength(e))),r||(r=0);let o=t.write(e,r+1);return t[r]=o,J.encode.bytes=o+1,t};J.encode.bytes=0;J.decode=function(e,t){t||(t=0);let r=e[t],o=e.toString("utf-8",t+1,t+1+r);return J.decode.bytes=r+1,o};J.decode.bytes=0;J.encodingLength=function(e){return L.byteLength(e)+1};var Et={};Et.encode=function(e,t,r){t||(t=Et.encodingLength(e)),r||(r=0);let o=(e.flags||0)&32767,n=e.type==="response"?B0:tO;return t.writeUInt16BE(e.id||0,r),t.writeUInt16BE(o|n,r+2),t.writeUInt16BE(e.questions.length,r+4),t.writeUInt16BE(e.answers.length,r+6),t.writeUInt16BE(e.authorities.length,r+8),t.writeUInt16BE(e.additionals.length,r+10),t};Et.encode.bytes=12;Et.decode=function(e,t){if(t||(t=0),e.length<12)throw new Error("Header must be 12 bytes");let r=e.readUInt16BE(t+2);return{id:e.readUInt16BE(t),type:r&B0?"response":"query",flags:r&32767,flag_qr:(r>>15&1)===1,opcode:eO.toString(r>>11&15),flag_aa:(r>>10&1)===1,flag_tc:(r>>9&1)===1,flag_rd:(r>>8&1)===1,flag_ra:(r>>7&1)===1,flag_z:(r>>6&1)===1,flag_ad:(r>>5&1)===1,flag_cd:(r>>4&1)===1,rcode:QR.toString(r&15),questions:new Array(e.readUInt16BE(t+4)),answers:new Array(e.readUInt16BE(t+6)),authorities:new Array(e.readUInt16BE(t+8)),additionals:new Array(e.readUInt16BE(t+10))}};Et.decode.bytes=12;Et.encodingLength=function(){return 12};var un=N.unknown={};un.encode=function(e,t,r){return t||(t=L.alloc(un.encodingLength(e))),r||(r=0),t.writeUInt16BE(e.length,r),e.copy(t,r+2),un.encode.bytes=e.length+2,t};un.encode.bytes=0;un.decode=function(e,t){t||(t=0);let r=e.readUInt16BE(t),o=e.slice(t+2,t+2+r);return un.decode.bytes=r+2,o};un.decode.bytes=0;un.encodingLength=function(e){return e.length+2};var dn=N.ns={};dn.encode=function(e,t,r){return t||(t=L.alloc(dn.encodingLength(e))),r||(r=0),R.encode(e,t,r+2),t.writeUInt16BE(R.encode.bytes,r),dn.encode.bytes=R.encode.bytes+2,t};dn.encode.bytes=0;dn.decode=function(e,t){t||(t=0);let r=e.readUInt16BE(t),o=R.decode(e,t+2);return dn.decode.bytes=r+2,o};dn.decode.bytes=0;dn.encodingLength=function(e){return R.encodingLength(e)+2};var pn=N.soa={};pn.encode=function(e,t,r){t||(t=L.alloc(pn.encodingLength(e))),r||(r=0);let o=r;return r+=2,R.encode(e.mname,t,r),r+=R.encode.bytes,R.encode(e.rname,t,r,{mail:!0}),r+=R.encode.bytes,t.writeUInt32BE(e.serial||0,r),r+=4,t.writeUInt32BE(e.refresh||0,r),r+=4,t.writeUInt32BE(e.retry||0,r),r+=4,t.writeUInt32BE(e.expire||0,r),r+=4,t.writeUInt32BE(e.minimum||0,r),r+=4,t.writeUInt16BE(r-o-2,o),pn.encode.bytes=r-o,t};pn.encode.bytes=0;pn.decode=function(e,t){t||(t=0);let r=t,o={};return t+=2,o.mname=R.decode(e,t),t+=R.decode.bytes,o.rname=R.decode(e,t,{mail:!0}),t+=R.decode.bytes,o.serial=e.readUInt32BE(t),t+=4,o.refresh=e.readUInt32BE(t),t+=4,o.retry=e.readUInt32BE(t),t+=4,o.expire=e.readUInt32BE(t),t+=4,o.minimum=e.readUInt32BE(t),t+=4,pn.decode.bytes=t-r,o};pn.decode.bytes=0;pn.encodingLength=function(e){return 22+R.encodingLength(e.mname)+R.encodingLength(e.rname)};var mn=N.txt={};mn.encode=function(e,t,r){Array.isArray(e)||(e=[e]);for(let n=0;n<e.length;n++)if(typeof e[n]=="string"&&(e[n]=L.from(e[n])),!L.isBuffer(e[n]))throw new Error("Must be a Buffer");t||(t=L.alloc(mn.encodingLength(e))),r||(r=0);let o=r;return r+=2,e.forEach(function(n){t[r++]=n.length,n.copy(t,r,0,n.length),r+=n.length}),t.writeUInt16BE(r-o-2,o),mn.encode.bytes=r-o,t};mn.encode.bytes=0;mn.decode=function(e,t){t||(t=0);let r=t,o=e.readUInt16BE(t);t+=2;let n=[];for(;o>0;){let i=e[t++];if(--o,o<i)throw new Error("Buffer overflow");n.push(e.slice(t,t+i)),t+=i,o-=i}return mn.decode.bytes=t-r,n};mn.decode.bytes=0;mn.encodingLength=function(e){Array.isArray(e)||(e=[e]);let t=2;return e.forEach(function(r){typeof r=="string"?t+=L.byteLength(r)+1:t+=r.length+1}),t};var fn=N.null={};fn.encode=function(e,t,r){t||(t=L.alloc(fn.encodingLength(e))),r||(r=0),typeof e=="string"&&(e=L.from(e)),e||(e=L.alloc(0));let o=r;r+=2;let n=e.length;return e.copy(t,r,0,n),r+=n,t.writeUInt16BE(r-o-2,o),fn.encode.bytes=r-o,t};fn.encode.bytes=0;fn.decode=function(e,t){t||(t=0);let r=t,o=e.readUInt16BE(t);t+=2;let n=e.slice(t,t+o);return t+=o,fn.decode.bytes=t-r,n};fn.decode.bytes=0;fn.encodingLength=function(e){return e?(L.isBuffer(e)?e.length:L.byteLength(e))+2:2};var gn=N.hinfo={};gn.encode=function(e,t,r){t||(t=L.alloc(gn.encodingLength(e))),r||(r=0);let o=r;return r+=2,J.encode(e.cpu,t,r),r+=J.encode.bytes,J.encode(e.os,t,r),r+=J.encode.bytes,t.writeUInt16BE(r-o-2,o),gn.encode.bytes=r-o,t};gn.encode.bytes=0;gn.decode=function(e,t){t||(t=0);let r=t,o={};return t+=2,o.cpu=J.decode(e,t),t+=J.decode.bytes,o.os=J.decode(e,t),t+=J.decode.bytes,gn.decode.bytes=t-r,o};gn.decode.bytes=0;gn.encodingLength=function(e){return J.encodingLength(e.cpu)+J.encodingLength(e.os)+2};var It=N.ptr={},oO=N.cname=It,iO=N.dname=It;It.encode=function(e,t,r){return t||(t=L.alloc(It.encodingLength(e))),r||(r=0),R.encode(e,t,r+2),t.writeUInt16BE(R.encode.bytes,r),It.encode.bytes=R.encode.bytes+2,t};It.encode.bytes=0;It.decode=function(e,t){t||(t=0);let r=R.decode(e,t+2);return It.decode.bytes=R.decode.bytes+2,r};It.decode.bytes=0;It.encodingLength=function(e){return R.encodingLength(e)+2};var hn=N.srv={};hn.encode=function(e,t,r){t||(t=L.alloc(hn.encodingLength(e))),r||(r=0),t.writeUInt16BE(e.priority||0,r+2),t.writeUInt16BE(e.weight||0,r+4),t.writeUInt16BE(e.port||0,r+6),R.encode(e.target,t,r+8);let o=R.encode.bytes+6;return t.writeUInt16BE(o,r),hn.encode.bytes=o+2,t};hn.encode.bytes=0;hn.decode=function(e,t){t||(t=0);let r=e.readUInt16BE(t),o={};return o.priority=e.readUInt16BE(t+2),o.weight=e.readUInt16BE(t+4),o.port=e.readUInt16BE(t+6),o.target=R.decode(e,t+8),hn.decode.bytes=r+2,o};hn.decode.bytes=0;hn.encodingLength=function(e){return 8+R.encodingLength(e.target)};var at=N.caa={};at.ISSUER_CRITICAL=128;at.encode=function(e,t,r){let o=at.encodingLength(e);return t||(t=L.alloc(at.encodingLength(e))),r||(r=0),e.issuerCritical&&(e.flags=at.ISSUER_CRITICAL),t.writeUInt16BE(o-2,r),r+=2,t.writeUInt8(e.flags||0,r),r+=1,J.encode(e.tag,t,r),r+=J.encode.bytes,t.write(e.value,r),r+=L.byteLength(e.value),at.encode.bytes=o,t};at.encode.bytes=0;at.decode=function(e,t){t||(t=0);let r=e.readUInt16BE(t);t+=2;let o=t,n={};return n.flags=e.readUInt8(t),t+=1,n.tag=J.decode(e,t),t+=J.decode.bytes,n.value=e.toString("utf-8",t,o+r),n.issuerCritical=!!(n.flags&at.ISSUER_CRITICAL),at.decode.bytes=r+2,n};at.decode.bytes=0;at.encodingLength=function(e){return J.encodingLength(e.tag)+J.encodingLength(e.value)+2};var Hn=N.mx={};Hn.encode=function(e,t,r){t||(t=L.alloc(Hn.encodingLength(e))),r||(r=0);let o=r;return r+=2,t.writeUInt16BE(e.preference||0,r),r+=2,R.encode(e.exchange,t,r),r+=R.encode.bytes,t.writeUInt16BE(r-o-2,o),Hn.encode.bytes=r-o,t};Hn.encode.bytes=0;Hn.decode=function(e,t){t||(t=0);let r=t,o={};return t+=2,o.preference=e.readUInt16BE(t),t+=2,o.exchange=R.decode(e,t),t+=R.decode.bytes,Hn.decode.bytes=t-r,o};Hn.encodingLength=function(e){return 4+R.encodingLength(e.exchange)};var vn=N.a={};vn.encode=function(e,t,r){return t||(t=L.alloc(vn.encodingLength(e))),r||(r=0),t.writeUInt16BE(4,r),r+=2,mr.v4.encode(e,t,r),vn.encode.bytes=6,t};vn.encode.bytes=0;vn.decode=function(e,t){t||(t=0),t+=2;let r=mr.v4.decode(e,t);return vn.decode.bytes=6,r};vn.decode.bytes=0;vn.encodingLength=function(){return 6};var yn=N.aaaa={};yn.encode=function(e,t,r){return t||(t=L.alloc(yn.encodingLength(e))),r||(r=0),t.writeUInt16BE(16,r),r+=2,mr.v6.encode(e,t,r),yn.encode.bytes=18,t};yn.encode.bytes=0;yn.decode=function(e,t){t||(t=0),t+=2;let r=mr.v6.decode(e,t);return yn.decode.bytes=18,r};yn.decode.bytes=0;yn.encodingLength=function(){return 18};var Qe=N.option={};Qe.encode=function(e,t,r){t||(t=L.alloc(Qe.encodingLength(e))),r||(r=0);let o=r,n=Rg.toCode(e.code);if(t.writeUInt16BE(n,r),r+=2,e.data)t.writeUInt16BE(e.data.length,r),r+=2,e.data.copy(t,r),r+=e.data.length;else switch(n){case 8:let i=e.sourcePrefixLength||0,a=e.family||mr.familyOf(e.ip),s=mr.encode(e.ip,L.alloc),l=Math.ceil(i/8);t.writeUInt16BE(l+4,r),r+=2,t.writeUInt16BE(a,r),r+=2,t.writeUInt8(i,r++),t.writeUInt8(e.scopePrefixLength||0,r++),s.copy(t,r,0,l),r+=l;break;case 11:e.timeout?(t.writeUInt16BE(2,r),r+=2,t.writeUInt16BE(e.timeout,r),r+=2):(t.writeUInt16BE(0,r),r+=2);break;case 12:let u=e.length||0;t.writeUInt16BE(u,r),r+=2,t.fill(0,r,r+u),r+=u;break;case 14:let d=e.tags.length*2;t.writeUInt16BE(d,r),r+=2;for(let p of e.tags)t.writeUInt16BE(p,r),r+=2;break;default:throw new Error(`Unknown roption code: ${e.code}`)}return Qe.encode.bytes=r-o,t};Qe.encode.bytes=0;Qe.decode=function(e,t){t||(t=0);let r={};r.code=e.readUInt16BE(t),r.type=Rg.toString(r.code),t+=2;let o=e.readUInt16BE(t);switch(t+=2,r.data=e.slice(t,t+o),r.code){case 8:r.family=e.readUInt16BE(t),t+=2,r.sourcePrefixLength=e.readUInt8(t++),r.scopePrefixLength=e.readUInt8(t++);let n=L.alloc(r.family===1?4:16);e.copy(n,0,t,t+o-4),r.ip=mr.decode(n);break;case 11:o>0&&(r.timeout=e.readUInt16BE(t),t+=2);break;case 14:r.tags=[];for(let i=0;i<o;i+=2)r.tags.push(e.readUInt16BE(t)),t+=2}return Qe.decode.bytes=o+4,r};Qe.decode.bytes=0;Qe.encodingLength=function(e){if(e.data)return e.data.length+4;switch(Rg.toCode(e.code)){case 8:let r=e.sourcePrefixLength||0;return Math.ceil(r/8)+8;case 11:return typeof e.timeout=="number"?6:4;case 12:return e.length+4;case 14:return 4+e.tags.length*2}throw new Error(`Unknown roption code: ${e.code}`)};var ct=N.opt={};ct.encode=function(e,t,r){t||(t=L.alloc(ct.encodingLength(e))),r||(r=0);let o=r,n=_o(e,Qe);return t.writeUInt16BE(n,r),r=Bi(e,Qe,t,r+2),ct.encode.bytes=r-o,t};ct.encode.bytes=0;ct.decode=function(e,t){t||(t=0);let r=t,o=[],n=e.readUInt16BE(t);t+=2;let i=0;for(;n>0;)o[i++]=Qe.decode(e,t),t+=Qe.decode.bytes,n-=Qe.decode.bytes;return ct.decode.bytes=t-r,o};ct.decode.bytes=0;ct.encodingLength=function(e){return 2+_o(e||[],Qe)};var He=N.dnskey={};He.PROTOCOL_DNSSEC=3;He.ZONE_KEY=128;He.SECURE_ENTRYPOINT=32768;He.encode=function(e,t,r){t||(t=L.alloc(He.encodingLength(e))),r||(r=0);let o=r,n=e.key;if(!L.isBuffer(n))throw new Error("Key must be a Buffer");return r+=2,t.writeUInt16BE(e.flags,r),r+=2,t.writeUInt8(He.PROTOCOL_DNSSEC,r),r+=1,t.writeUInt8(e.algorithm,r),r+=1,n.copy(t,r,0,n.length),r+=n.length,He.encode.bytes=r-o,t.writeUInt16BE(He.encode.bytes-2,o),t};He.encode.bytes=0;He.decode=function(e,t){t||(t=0);let r=t;var o={},n=e.readUInt16BE(t);if(t+=2,o.flags=e.readUInt16BE(t),t+=2,e.readUInt8(t)!==He.PROTOCOL_DNSSEC)throw new Error("Protocol must be 3");return t+=1,o.algorithm=e.readUInt8(t),t+=1,o.key=e.slice(t,r+n+2),t+=o.key.length,He.decode.bytes=t-r,o};He.decode.bytes=0;He.encodingLength=function(e){return 6+L.byteLength(e.key)};var jt=N.rrsig={};jt.encode=function(e,t,r){t||(t=L.alloc(jt.encodingLength(e))),r||(r=0);let o=r,n=e.signature;if(!L.isBuffer(n))throw new Error("Signature must be a Buffer");return r+=2,t.writeUInt16BE(bn.toType(e.typeCovered),r),r+=2,t.writeUInt8(e.algorithm,r),r+=1,t.writeUInt8(e.labels,r),r+=1,t.writeUInt32BE(e.originalTTL,r),r+=4,t.writeUInt32BE(e.expiration,r),r+=4,t.writeUInt32BE(e.inception,r),r+=4,t.writeUInt16BE(e.keyTag,r),r+=2,R.encode(e.signersName,t,r),r+=R.encode.bytes,n.copy(t,r,0,n.length),r+=n.length,jt.encode.bytes=r-o,t.writeUInt16BE(jt.encode.bytes-2,o),t};jt.encode.bytes=0;jt.decode=function(e,t){t||(t=0);let r=t;var o={},n=e.readUInt16BE(t);return t+=2,o.typeCovered=bn.toString(e.readUInt16BE(t)),t+=2,o.algorithm=e.readUInt8(t),t+=1,o.labels=e.readUInt8(t),t+=1,o.originalTTL=e.readUInt32BE(t),t+=4,o.expiration=e.readUInt32BE(t),t+=4,o.inception=e.readUInt32BE(t),t+=4,o.keyTag=e.readUInt16BE(t),t+=2,o.signersName=R.decode(e,t),t+=R.decode.bytes,o.signature=e.slice(t,r+n+2),t+=o.signature.length,jt.decode.bytes=t-r,o};jt.decode.bytes=0;jt.encodingLength=function(e){return 20+R.encodingLength(e.signersName)+L.byteLength(e.signature)};var Ft=N.rp={};Ft.encode=function(e,t,r){t||(t=L.alloc(Ft.encodingLength(e))),r||(r=0);let o=r;return r+=2,R.encode(e.mbox||".",t,r,{mail:!0}),r+=R.encode.bytes,R.encode(e.txt||".",t,r),r+=R.encode.bytes,Ft.encode.bytes=r-o,t.writeUInt16BE(Ft.encode.bytes-2,o),t};Ft.encode.bytes=0;Ft.decode=function(e,t){t||(t=0);let r=t,o={};return t+=2,o.mbox=R.decode(e,t,{mail:!0})||".",t+=R.decode.bytes,o.txt=R.decode(e,t)||".",t+=R.decode.bytes,Ft.decode.bytes=t-r,o};Ft.decode.bytes=0;Ft.encodingLength=function(e){return 2+R.encodingLength(e.mbox||".")+R.encodingLength(e.txt||".")};var Ie={};Ie.encode=function(e,t,r){t||(t=L.alloc(Ie.encodingLength(e))),r||(r=0);let o=r;for(var n=[],i=0;i<e.length;i++){var a=bn.toType(e[i]);n[a>>8]===void 0&&(n[a>>8]=[]),n[a>>8][a>>3&31]|=1<<7-(a&7)}for(i=0;i<n.length;i++)if(n[i]!==void 0){var s=L.from(n[i]);t.writeUInt8(i,r),r+=1,t.writeUInt8(s.length,r),r+=1,s.copy(t,r),r+=s.length}return Ie.encode.bytes=r-o,t};Ie.encode.bytes=0;Ie.decode=function(e,t,r){t||(t=0);let o=t;for(var n=[];t-o<r;){var i=e.readUInt8(t);t+=1;var a=e.readUInt8(t);t+=1;for(var s=0;s<a;s++)for(var l=e.readUInt8(t+s),u=0;u<8;u++)if(l&1<<7-u){var d=bn.toString(i<<8|s<<3|u);n.push(d)}t+=a}return Ie.decode.bytes=t-o,n};Ie.decode.bytes=0;Ie.encodingLength=function(e){for(var t=[],r=0;r<e.length;r++){var o=bn.toType(e[r]);t[o>>8]=Math.max(t[o>>8]||0,o&255)}var n=0;for(r=0;r<t.length;r++)t[r]!==void 0&&(n+=2+Math.ceil((t[r]+1)/8));return n};var Bt=N.nsec={};Bt.encode=function(e,t,r){t||(t=L.alloc(Bt.encodingLength(e))),r||(r=0);let o=r;return r+=2,R.encode(e.nextDomain,t,r),r+=R.encode.bytes,Ie.encode(e.rrtypes,t,r),r+=Ie.encode.bytes,Bt.encode.bytes=r-o,t.writeUInt16BE(Bt.encode.bytes-2,o),t};Bt.encode.bytes=0;Bt.decode=function(e,t){t||(t=0);let r=t;var o={},n=e.readUInt16BE(t);return t+=2,o.nextDomain=R.decode(e,t),t+=R.decode.bytes,o.rrtypes=Ie.decode(e,t,n-(t-r)),t+=Ie.decode.bytes,Bt.decode.bytes=t-r,o};Bt.decode.bytes=0;Bt.encodingLength=function(e){return 2+R.encodingLength(e.nextDomain)+Ie.encodingLength(e.rrtypes)};var Mt=N.nsec3={};Mt.encode=function(e,t,r){t||(t=L.alloc(Mt.encodingLength(e))),r||(r=0);let o=r,n=e.salt;if(!L.isBuffer(n))throw new Error("salt must be a Buffer");let i=e.nextDomain;if(!L.isBuffer(i))throw new Error("nextDomain must be a Buffer");return r+=2,t.writeUInt8(e.algorithm,r),r+=1,t.writeUInt8(e.flags,r),r+=1,t.writeUInt16BE(e.iterations,r),r+=2,t.writeUInt8(n.length,r),r+=1,n.copy(t,r,0,n.length),r+=n.length,t.writeUInt8(i.length,r),r+=1,i.copy(t,r,0,i.length),r+=i.length,Ie.encode(e.rrtypes,t,r),r+=Ie.encode.bytes,Mt.encode.bytes=r-o,t.writeUInt16BE(Mt.encode.bytes-2,o),t};Mt.encode.bytes=0;Mt.decode=function(e,t){t||(t=0);let r=t;var o={},n=e.readUInt16BE(t);t+=2,o.algorithm=e.readUInt8(t),t+=1,o.flags=e.readUInt8(t),t+=1,o.iterations=e.readUInt16BE(t),t+=2;let i=e.readUInt8(t);t+=1,o.salt=e.slice(t,t+i),t+=i;let a=e.readUInt8(t);return t+=1,o.nextDomain=e.slice(t,t+a),t+=a,o.rrtypes=Ie.decode(e,t,n-(t-r)),t+=Ie.decode.bytes,Mt.decode.bytes=t-r,o};Mt.decode.bytes=0;Mt.encodingLength=function(e){return 8+e.salt.length+e.nextDomain.length+Ie.encodingLength(e.rrtypes)};var Ht=N.ds={};Ht.encode=function(e,t,r){t||(t=L.alloc(Ht.encodingLength(e))),r||(r=0);let o=r,n=e.digest;if(!L.isBuffer(n))throw new Error("Digest must be a Buffer");return r+=2,t.writeUInt16BE(e.keyTag,r),r+=2,t.writeUInt8(e.algorithm,r),r+=1,t.writeUInt8(e.digestType,r),r+=1,n.copy(t,r,0,n.length),r+=n.length,Ht.encode.bytes=r-o,t.writeUInt16BE(Ht.encode.bytes-2,o),t};Ht.encode.bytes=0;Ht.decode=function(e,t){t||(t=0);let r=t;var o={},n=e.readUInt16BE(t);return t+=2,o.keyTag=e.readUInt16BE(t),t+=2,o.algorithm=e.readUInt8(t),t+=1,o.digestType=e.readUInt8(t),t+=1,o.digest=e.slice(t,r+n+2),t+=o.digest.length,Ht.decode.bytes=t-r,o};Ht.decode.bytes=0;Ht.encodingLength=function(e){return 6+L.byteLength(e.digest)};var st=N.sshfp={};st.getFingerprintLengthForHashType=function(t){switch(t){case 1:return 20;case 2:return 32}};st.encode=function(t,r,o){r||(r=L.alloc(st.encodingLength(t))),o||(o=0);let n=o;o+=2,r[o]=t.algorithm,o+=1,r[o]=t.hash,o+=1;let i=L.from(t.fingerprint.toUpperCase(),"hex");if(i.length!==st.getFingerprintLengthForHashType(t.hash))throw new Error("Invalid fingerprint length");return i.copy(r,o),o+=i.byteLength,st.encode.bytes=o-n,r.writeUInt16BE(st.encode.bytes-2,n),r};st.encode.bytes=0;st.decode=function(t,r){r||(r=0);let o=r,n={};r+=2,n.algorithm=t[r],r+=1,n.hash=t[r],r+=1;let i=st.getFingerprintLengthForHashType(n.hash);return n.fingerprint=t.slice(r,r+i).toString("hex").toUpperCase(),r+=i,st.decode.bytes=r-o,n};st.decode.bytes=0;st.encodingLength=function(e){return 4+L.from(e.fingerprint,"hex").byteLength};var Zt=N.naptr={};Zt.encode=function(e,t,r){t||(t=L.alloc(Zt.encodingLength(e))),r||(r=0);let o=r;return r+=2,t.writeUInt16BE(e.order||0,r),r+=2,t.writeUInt16BE(e.preference||0,r),r+=2,J.encode(e.flags,t,r),r+=J.encode.bytes,J.encode(e.services,t,r),r+=J.encode.bytes,J.encode(e.regexp,t,r),r+=J.encode.bytes,R.encode(e.replacement,t,r),r+=R.encode.bytes,Zt.encode.bytes=r-o,t.writeUInt16BE(Zt.encode.bytes-2,o),t};Zt.encode.bytes=0;Zt.decode=function(e,t){t||(t=0);let r=t,o={};return t+=2,o.order=e.readUInt16BE(t),t+=2,o.preference=e.readUInt16BE(t),t+=2,o.flags=J.decode(e,t),t+=J.decode.bytes,o.services=J.decode(e,t),t+=J.decode.bytes,o.regexp=J.decode(e,t),t+=J.decode.bytes,o.replacement=R.decode(e,t),t+=R.decode.bytes,Zt.decode.bytes=t-r,o};Zt.decode.bytes=0;Zt.encodingLength=function(e){return J.encodingLength(e.flags)+J.encodingLength(e.services)+J.encodingLength(e.regexp)+R.encodingLength(e.replacement)+6};var Gt=N.tlsa={};Gt.encode=function(e,t,r){t||(t=L.alloc(Gt.encodingLength(e))),r||(r=0);let o=r,n=e.certificate;if(!L.isBuffer(n))throw new Error("Certificate must be a Buffer");return r+=2,t.writeUInt8(e.usage,r),r+=1,t.writeUInt8(e.selector,r),r+=1,t.writeUInt8(e.matchingType,r),r+=1,n.copy(t,r,0,n.length),r+=n.length,Gt.encode.bytes=r-o,t.writeUInt16BE(Gt.encode.bytes-2,o),t};Gt.encode.bytes=0;Gt.decode=function(e,t){t||(t=0);let r=t,o={},n=e.readUInt16BE(t);return t+=2,o.usage=e.readUInt8(t),t+=1,o.selector=e.readUInt8(t),t+=1,o.matchingType=e.readUInt8(t),t+=1,o.certificate=e.slice(t,r+n+2),t+=o.certificate.length,Gt.decode.bytes=t-r,o};Gt.decode.bytes=0;Gt.encodingLength=function(e){return 5+L.byteLength(e.certificate)};var Dg=N.record=function(e){switch(e.toUpperCase()){case"A":return vn;case"PTR":return It;case"CNAME":return oO;case"DNAME":return iO;case"TXT":return mn;case"NULL":return fn;case"AAAA":return yn;case"SRV":return hn;case"HINFO":return gn;case"CAA":return at;case"NS":return dn;case"SOA":return pn;case"MX":return Hn;case"OPT":return ct;case"DNSKEY":return He;case"RRSIG":return jt;case"RP":return Ft;case"NSEC":return Bt;case"NSEC3":return Mt;case"SSHFP":return st;case"DS":return Ht;case"NAPTR":return Zt;case"TLSA":return Gt}return un},Re=N.answer={};Re.encode=function(e,t,r){t||(t=L.alloc(Re.encodingLength(e))),r||(r=0);let o=r;if(R.encode(e.name,t,r),r+=R.encode.bytes,t.writeUInt16BE(bn.toType(e.type),r),e.type.toUpperCase()==="OPT"){if(e.name!==".")throw new Error("OPT name must be root.");t.writeUInt16BE(e.udpPayloadSize||4096,r+2),t.writeUInt8(e.extendedRcode||0,r+4),t.writeUInt8(e.ednsVersion||0,r+5),t.writeUInt16BE(e.flags||0,r+6),r+=8,ct.encode(e.options||[],t,r),r+=ct.encode.bytes}else{let n=Gc.toClass(e.class===void 0?"IN":e.class);e.flush&&(n|=Og),t.writeUInt16BE(n,r+2),t.writeUInt32BE(e.ttl||0,r+4),r+=8;let i=Dg(e.type);i.encode(e.data,t,r),r+=i.encode.bytes}return Re.encode.bytes=r-o,t};Re.encode.bytes=0;Re.decode=function(e,t){t||(t=0);let r={},o=t;if(r.name=R.decode(e,t),t+=R.decode.bytes,r.type=bn.toString(e.readUInt16BE(t)),r.type==="OPT")r.udpPayloadSize=e.readUInt16BE(t+2),r.extendedRcode=e.readUInt8(t+4),r.ednsVersion=e.readUInt8(t+5),r.flags=e.readUInt16BE(t+6),r.flag_do=(r.flags>>15&1)===1,r.options=ct.decode(e,t+8),t+=8+ct.decode.bytes;else{let n=e.readUInt16BE(t+2);r.ttl=e.readUInt32BE(t+4),r.class=Gc.toString(n&nO),r.flush=!!(n&Og);let i=Dg(r.type);r.data=i.decode(e,t+8),t+=8+i.decode.bytes}return Re.decode.bytes=t-o,r};Re.decode.bytes=0;Re.encodingLength=function(e){let t=e.data!==null&&e.data!==void 0?e.data:e.options;return R.encodingLength(e.name)+8+Dg(e.type).encodingLength(t)};var At=N.question={};At.encode=function(e,t,r){t||(t=L.alloc(At.encodingLength(e))),r||(r=0);let o=r;return R.encode(e.name,t,r),r+=R.encode.bytes,t.writeUInt16BE(bn.toType(e.type),r),r+=2,t.writeUInt16BE(Gc.toClass(e.class===void 0?"IN":e.class),r),r+=2,At.encode.bytes=r-o,e};At.encode.bytes=0;At.decode=function(e,t){t||(t=0);let r=t,o={};return o.name=R.decode(e,t),t+=R.decode.bytes,o.type=bn.toString(e.readUInt16BE(t)),t+=2,o.class=Gc.toString(e.readUInt16BE(t)),t+=2,o.class&M0&&(o.class&=rO),At.decode.bytes=t-r,o};At.decode.bytes=0;At.encodingLength=function(e){return R.encodingLength(e.name)+4};N.AUTHORITATIVE_ANSWER=1024;N.TRUNCATED_RESPONSE=512;N.RECURSION_DESIRED=256;N.RECURSION_AVAILABLE=128;N.AUTHENTIC_DATA=32;N.CHECKING_DISABLED=16;N.DNSSEC_OK=32768;N.encode=function(e,t,r){let o=!t;o&&(t=L.alloc(N.encodingLength(e))),r||(r=0);let n=r;return e.questions||(e.questions=[]),e.answers||(e.answers=[]),e.authorities||(e.authorities=[]),e.additionals||(e.additionals=[]),Et.encode(e,t,r),r+=Et.encode.bytes,r=Bi(e.questions,At,t,r),r=Bi(e.answers,Re,t,r),r=Bi(e.authorities,Re,t,r),r=Bi(e.additionals,Re,t,r),N.encode.bytes=r-n,o&&N.encode.bytes!==t.length?t.slice(0,N.encode.bytes):t};N.encode.bytes=0;N.decode=function(e,t){t||(t=0);let r=t,o=Et.decode(e,t);return t+=Et.decode.bytes,t=Zc(o.questions,At,e,t),t=Zc(o.answers,Re,e,t),t=Zc(o.authorities,Re,e,t),t=Zc(o.additionals,Re,e,t),N.decode.bytes=t-r,o};N.decode.bytes=0;N.encodingLength=function(e){return Et.encodingLength(e)+_o(e.questions||[],At)+_o(e.answers||[],Re)+_o(e.authorities||[],Re)+_o(e.additionals||[],Re)};N.streamEncode=function(e){let t=N.encode(e),r=L.alloc(2);r.writeUInt16BE(t.byteLength);let o=L.concat([r,t]);return N.streamEncode.bytes=o.byteLength,o};N.streamEncode.bytes=0;N.streamDecode=function(e){let t=e.readUInt16BE(0);if(e.byteLength<t+2)return null;let r=N.decode(e.slice(2));return N.streamDecode.bytes=N.decode.bytes,r};N.streamDecode.bytes=0;function _o(e,t){let r=0;for(let o=0;o<e.length;o++)r+=t.encodingLength(e[o]);return r}function Bi(e,t,r,o){for(let n=0;n<e.length;n++)t.encode(e[n],r,o),o+=t.encode.bytes;return o}function Zc(e,t,r,o){for(let n=0;n<e.length;n++)e[n]=t.decode(r,o),o+=t.decode.bytes;return o}});var W0=q((QH,G0)=>{"use strict";var Z0=dO;process.nextTick(uO,42);G0.exports=aO;function aO(e){var t=o;return r;function r(n){t(n||cO)}function o(n){var i=[n];t=a,e(s);function a(l){i.push(l)}function s(l){var u=arguments;for(t=sO(l)?o:d;i.length;)d(i.shift());function d(p){Z0(lO,p,u)}}}}function sO(e){return Object.prototype.toString.call(e)==="[object Error]"}function cO(){}function lO(e,t){e.apply(null,t)}function uO(e){e===42&&(Z0=process.nextTick)}function dO(e,t,r){process.nextTick(function(){e(t,r)})}});var q0=q((eZ,J0)=>{var Ng=H0(),pO=te("dgram"),mO=W0(),fO=te("events"),Ug=te("os"),Lg=function(){};J0.exports=function(e){e||(e={});var t=new fO.EventEmitter,r=typeof e.port=="number"?e.port:5353,o=e.type||"udp4",n=e.ip||e.host||(o==="udp4"?"224.0.0.251":null),i={address:n,port:r},a={},s=!1,l=null;if(o==="udp6"&&(!n||!e.interface))throw new Error("For IPv6 multicast you must specify `ip` and `interface`");var u=e.socket||pO.createSocket({type:o,reuseAddr:e.reuseAddr!==!1,toString:function(){return o}});u.on("error",function(p){p.code==="EACCES"||p.code==="EADDRINUSE"?t.emit("error",p):t.emit("warning",p)}),u.on("message",function(p,m){try{p=Ng.decode(p)}catch(f){t.emit("warning",f);return}t.emit("packet",p,m),p.type==="query"&&t.emit("query",p,m),p.type==="response"&&t.emit("response",p,m)}),u.on("listening",function(){r||(r=i.port=u.address().port),e.multicast!==!1&&(t.update(),l=setInterval(t.update,5e3),u.setMulticastTTL(e.ttl||255),u.setMulticastLoopback(e.loopback!==!1))});var d=mO(function(p){if(!r||e.bind===!1)return p(null);u.once("error",p),u.bind(r,e.bind||e.interface,function(){u.removeListener("error",p),p(null)})});return d(function(p){if(p)return t.emit("error",p);t.emit("ready")}),t.send=function(p,m,f){if(typeof m=="function")return t.send(p,null,m);f||(f=Lg),m?!m.host&&!m.address&&(m.address=i.address):m=i,d(g);function g(y){if(s)return f();if(y)return f(y);var k=Ng.encode(p);u.send(k,0,k.length,m.port,m.address||m.host,f)}},t.response=t.respond=function(p,m,f){Array.isArray(p)&&(p={answers:p}),p.type="response",p.flags=(p.flags||0)|Ng.AUTHORITATIVE_ANSWER,t.send(p,m,f)},t.query=function(p,m,f,g){if(typeof m=="function")return t.query(p,null,null,m);if(typeof m=="object"&&m&&m.port)return t.query(p,null,m,f);if(typeof f=="function")return t.query(p,m,null,f);g||(g=Lg),typeof p=="string"&&(p=[{name:p,type:m||"ANY"}]),Array.isArray(p)&&(p={type:"query",questions:p}),p.type="query",t.send(p,f,g)},t.destroy=function(p){if(p||(p=Lg),s)return process.nextTick(p);s=!0,clearInterval(l);for(var m in a)try{u.dropMembership(n,m)}catch{}a={},u.close(p)},t.update=function(){for(var p=e.interface?[].concat(e.interface):hO(),m=!1,f=0;f<p.length;f++){var g=p[f];if(!a[g])try{u.addMembership(n,g),a[g]=!0,m=!0}catch(y){t.emit("warning",y)}}if(m){if(u.setMulticastInterface)try{u.setMulticastInterface(e.interface||gO())}catch(y){t.emit("warning",y)}t.emit("networkInterface")}},t};function gO(){for(var e=Ug.networkInterfaces(),t=Object.keys(e),r=0;r<t.length;r++)for(var o=e[t[r]],n=0;n<o.length;n++){var i=o[n];if(V0(i.family)&&!i.internal)return Ug.platform()==="darwin"&&t[r]==="en0"?i.address:"0.0.0.0"}return"127.0.0.1"}function hO(){for(var e=Ug.networkInterfaces(),t=Object.keys(e),r=[],o=0;o<t.length;o++)for(var n=e[t[o]],i=0;i<n.length;i++){var a=n[i];if(V0(a.family)){r.push(a.address);break}}return r}function V0(e){return e===4||e==="IPv4"}});var X0=q((tZ,K0)=>{"use strict";K0.exports=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var o,n,i;if(Array.isArray(t)){if(o=t.length,o!=r.length)return!1;for(n=o;n--!==0;)if(!e(t[n],r[n]))return!1;return!0}if(t instanceof Map&&r instanceof Map){if(t.size!==r.size)return!1;for(n of t.entries())if(!r.has(n[0]))return!1;for(n of t.entries())if(!e(n[1],r.get(n[0])))return!1;return!0}if(t instanceof Set&&r instanceof Set){if(t.size!==r.size)return!1;for(n of t.entries())if(!r.has(n[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(r)){if(o=t.length,o!=r.length)return!1;for(n=o;n--!==0;)if(t[n]!==r[n])return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(i=Object.keys(t),o=i.length,o!==Object.keys(r).length)return!1;for(n=o;n--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[n]))return!1;for(n=o;n--!==0;){var a=i[n];if(!e(t[a],r[a]))return!1}return!0}return t!==t&&r!==r}});var Y0=q(fr=>{"use strict";var zg=fr&&fr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(fr,"__esModule",{value:!0});fr.Server=void 0;var vO=zg(q0()),yO=zg(X0()),bO=zg(Fc()),Wc=class{constructor(t,r){this.registry={},this.mdns=(0,vO.default)(t),this.mdns.setMaxListeners(0),this.mdns.on("query",this.respondToQuery.bind(this)),this.errorCallback=r??function(o){throw o}}register(t){let r=o=>{var n=this.registry[o.type];if(!n)n=this.registry[o.type]=[];else if(n.some(this.isDuplicateRecord(o)))return;n.push(o)};Array.isArray(t)?t.forEach(r):r(t)}unregister(t){let r=o=>{let n=o.type;n in this.registry&&(this.registry[n]=this.registry[n].filter(i=>i.name!==o.name))};Array.isArray(t)?t.forEach(r):r(t)}respondToQuery(t){let r=this;t.questions.forEach(o=>{var n=o.type,i=o.name,a=n==="ANY"?Object.keys(r.registry).map(r.recordsFor.bind(r,i)).flat(1):r.recordsFor(i,n);if(a.length!==0){var s=[];n!=="ANY"&&(a.forEach(l=>{l.type==="PTR"&&(s=s.concat(r.recordsFor(l.data,"SRV")).concat(r.recordsFor(l.data,"TXT")))}),s.filter(function(l){return l.type==="SRV"}).map(function(l){return l.data.target}).filter(this.unique()).forEach(function(l){s=s.concat(r.recordsFor(l,"A")).concat(r.recordsFor(l,"AAAA"))})),r.mdns.respond({answers:a,additionals:s},l=>{l&&this.errorCallback(l)})}})}recordsFor(t,r){return r in this.registry?this.registry[r].filter(o=>{var n=~t.indexOf(".")?o.name:o.name.split(".")[0];return(0,bO.default)(n,t)}):[]}isDuplicateRecord(t){return r=>t.type===r.type&&t.name===r.name&&(0,yO.default)(t.data,r.data)}unique(){var t=[];return r=>~t.indexOf(r)?!1:(t.push(r),!0)}};fr.Server=Wc;fr.default=Wc});var Q0=q(jg=>{"use strict";Object.defineProperty(jg,"__esModule",{value:!0});jg.default=(e,t)=>{if(t===void 0)return!0;let r=e.txt,o=Object.entries(t).map(([n,i])=>{let a=r[n];return!(a===void 0||i!=a)});return o.length==0?!0:!o.includes(!1)}});var ew=q(Fg=>{"use strict";Object.defineProperty(Fg,"__esModule",{value:!0});Fg.default=e=>Object.keys(e).filter(t=>!t.includes("binary")).reduce((t,r)=>Object.assign(t,{[r]:e[r]}),{})});var tw=q(Bg=>{"use strict";Object.defineProperty(Bg,"__esModule",{value:!0});Bg.default=xO;function xO(e,t){if(e===void 0||t===void 0)return!1;let r=Object.keys(e),o=Object.keys(t);if(r.length!=o.length)return!1;for(let n of r)if(e[n]!=t[n])return!1;return!0}});var ow=q(gr=>{"use strict";var Mi=gr&&gr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(gr,"__esModule",{value:!0});gr.Browser=void 0;var kO=Mi(wg()),Zn=Mi(Fc()),wO=te("events"),Mg=Sg(),nw=Mi(Q0()),SO=Mi(ew()),_O=Mi(tw()),rw=".local",$O="_services._dns-sd._udp"+rw,Vc=class e extends wO.EventEmitter{constructor(t,r,o){if(super(),this.onresponse=void 0,this.serviceMap={},this.wildcard=!1,this._services=[],typeof r=="function")return new e(t,null,r);this.mdns=t,this.txt=new kO.default(r!==null&&r.txt!=null?r.txt:void 0),r===null||r.type===void 0?(this.name=$O,this.wildcard=!0):(this.name=(0,Mg.toString)({name:r.type,protocol:r.protocol||"tcp"})+rw,r.name&&(this.name=r.name+"."+this.name),this.wildcard=!1),r!=null&&r.txt!==void 0&&(this.txtQuery=(0,SO.default)(r.txt)),o&&this.on("up",o),this.start()}start(){if(!(this.onresponse||this.name===void 0)){var t=this,r={};this.wildcard||(r[this.name]=!0),this.onresponse=(o,n)=>{t.wildcard&&o.answers.forEach(a=>{a.type!=="PTR"||a.name!==t.name||a.name in r||(r[a.data]=!0,t.mdns.query(a.data,"PTR"))});let i=Date.now();Object.keys(r).forEach(function(a){t.goodbyes(a,o).forEach(t.removeService.bind(t));var s=t.buildServicesFor(a,o,t.txt,n,i);s.length!==0&&s.forEach(l=>{let u=t._services.find(d=>(0,Zn.default)(d.fqdn,l.fqdn));if(u){t.updateServiceSrv(u,l),t.updateServiceTxt(u,l);return}t.addService(l)})})},this.mdns.on("response",this.onresponse),this.update()}}stop(){this.onresponse&&(this.mdns.removeListener("response",this.onresponse),this.onresponse=void 0)}update(){this.mdns.query(this.name,"PTR")}expire(){let t=Date.now();this._services=this._services.filter(r=>!r.ttl||r.lastSeen===void 0?!0:r.lastSeen+r.ttl*1e3<t?(this.emit("down",r),!1):!0)}get services(){return this._services}addService(t){(0,nw.default)(t,this.txtQuery)!==!1&&(this._services.push(t),this.serviceMap[t.fqdn]=!0,this.emit("up",t))}updateServiceSrv(t,r){(t.name!==r.name||t.host!==r.host||t.port!==r.port||t.type!==r.type||t.protocol!==r.protocol)&&(this.replaceService(r),this.emit("srv-update",r,t))}updateServiceTxt(t,r){if(!(0,_O.default)(r.txt,t?.txt||{})){if(!(0,nw.default)(r,this.txtQuery)){this.removeService(r.fqdn);return}this.replaceService(r),this.emit("txt-update",r,t)}}replaceService(t){this._services=this._services.map(r=>(0,Zn.default)(r.fqdn,t.fqdn)?t:r)}removeService(t){var r,o;this._services.some(function(n,i){if((0,Zn.default)(n.fqdn,t))return r=n,o=i,!0}),!(!r||o===void 0)&&(this._services.splice(o,1),delete this.serviceMap[t],this.emit("down",r))}goodbyes(t,r){return r.answers.concat(r.additionals).filter(o=>o.type==="PTR"&&o.ttl===0&&(0,Zn.default)(o.name,t)).map(o=>o.data)}buildServicesFor(t,r,o,n,i){var a=r.answers.concat(r.additionals).filter(s=>s.ttl>0);return a.filter(s=>s.type==="PTR"&&(0,Zn.default)(s.name,t)).map(s=>{let l={addresses:[],subtypes:[],ttl:s.ttl,lastSeen:i};if(a.filter(u=>u.type==="PTR"&&(0,Zn.default)(u.data,s.data)&&u.name.includes("._sub")).forEach(u=>{let d=(0,Mg.toType)(u.name);l.subtypes.push(d.subtype)}),a.filter(u=>(u.type==="SRV"||u.type==="TXT")&&(0,Zn.default)(u.name,s.data)).forEach(u=>{if(u.type==="SRV"){var d=u.name.split("."),p=d[0],m=(0,Mg.toType)(d.slice(1,-1).join("."));l.name=p,l.fqdn=u.name,l.host=u.data.target,l.referer=n,l.port=u.data.port,l.type=m.name,l.protocol=m.protocol}else u.type==="TXT"&&(l.rawTxt=u.data,l.txt=this.txt.decodeAll(u.data))}),!!l.name)return a.filter(u=>(u.type==="A"||u.type==="AAAA")&&(0,Zn.default)(u.name,l.host)).forEach(u=>l.addresses.push(u.data)),l}).filter(s=>!!s)}};gr.Browser=Vc;gr.default=Vc});var iw=q(xn=>{"use strict";var Jc=xn&&xn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(xn,"__esModule",{value:!0});xn.Browser=xn.Service=void 0;var IO=Jc(R0()),AO=Jc(Y0()),Hg=Jc(ow());xn.Browser=Hg.default;var EO=Jc(_g());xn.Service=EO.default;var Zg=class{constructor(t={},r){this.server=new AO.default(t,r),this.registry=new IO.default(this.server)}publish(t){return this.registry.publish(t)}unpublishAll(t){return this.registry.unpublishAll(t)}find(t=null,r){return new Hg.default(this.server.mdns,t,r)}findOne(t=null,r=1e4,o){let n=new Hg.default(this.server.mdns,t);var i;return n.once("up",a=>{i!==void 0&&clearTimeout(i),n.stop(),o&&o(a)}),i=setTimeout(()=>{n.stop(),o&&o(null)},r),n}destroy(t){this.registry.destroy(),this.server.mdns.destroy(t)}};xn.default=Zg});var sw=q((Ze,aw)=>{"use strict";var PO=Ze&&Ze.__createBinding||(Object.create?(function(e,t,r,o){o===void 0&&(o=r);var n=Object.getOwnPropertyDescriptor(t,r);(!n||("get"in n?!t.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,o,n)}):(function(e,t,r,o){o===void 0&&(o=r),e[o]=t[r]})),CO=Ze&&Ze.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),TO=Ze&&Ze.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var o=[];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(o[o.length]=n);return o},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var o=e(t),n=0;n<o.length;n++)o[n]!=="default"&&PO(r,t,o[n]);return CO(r,t),r}})();Object.defineProperty(Ze,"__esModule",{value:!0});Ze.Browser=Ze.Service=Ze.Bonjour=void 0;var Hi=TO(iw());Object.defineProperty(Ze,"Service",{enumerable:!0,get:function(){return Hi.Service}});Object.defineProperty(Ze,"Browser",{enumerable:!0,get:function(){return Hi.Browser}});var hr=class extends Hi.default{};Ze.Bonjour=hr;Ze.default=hr;aw.exports=Object.assign(hr,{Bonjour:hr,Service:Hi.Service,Browser:Hi.Browser,default:hr})});var wn=q((mW,Yw)=>{"use strict";var Kw=["nodebuffer","arraybuffer","fragments"],Xw=typeof Blob<"u";Xw&&Kw.push("blob");Yw.exports={BINARY_TYPES:Kw,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:Xw,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var Zi=q((fW,nl)=>{"use strict";var{EMPTY_BUFFER:yN}=wn(),qg=Buffer[Symbol.species];function bN(e,t){if(e.length===0)return yN;if(e.length===1)return e[0];let r=Buffer.allocUnsafe(t),o=0;for(let n=0;n<e.length;n++){let i=e[n];r.set(i,o),o+=i.length}return o<t?new qg(r.buffer,r.byteOffset,o):r}function Qw(e,t,r,o,n){for(let i=0;i<n;i++)r[o+i]=e[i]^t[i&3]}function eS(e,t){for(let r=0;r<e.length;r++)e[r]^=t[r&3]}function xN(e){return e.length===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.length)}function Kg(e){if(Kg.readOnly=!0,Buffer.isBuffer(e))return e;let t;return e instanceof ArrayBuffer?t=new qg(e):ArrayBuffer.isView(e)?t=new qg(e.buffer,e.byteOffset,e.byteLength):(t=Buffer.from(e),Kg.readOnly=!1),t}nl.exports={concat:bN,mask:Qw,toArrayBuffer:xN,toBuffer:Kg,unmask:eS};if(!process.env.WS_NO_BUFFER_UTIL)try{let e=te("bufferutil");nl.exports.mask=function(t,r,o,n,i){i<48?Qw(t,r,o,n,i):e.mask(t,r,o,n,i)},nl.exports.unmask=function(t,r){t.length<32?eS(t,r):e.unmask(t,r)}}catch{}});var rS=q((gW,nS)=>{"use strict";var tS=Symbol("kDone"),Xg=Symbol("kRun"),Yg=class{constructor(t){this[tS]=()=>{this.pending--,this[Xg]()},this.concurrency=t||1/0,this.jobs=[],this.pending=0}add(t){this.jobs.push(t),this[Xg]()}[Xg](){if(this.pending!==this.concurrency&&this.jobs.length){let t=this.jobs.shift();this.pending++,t(this[tS])}}};nS.exports=Yg});var Eo=q((hW,sS)=>{"use strict";var Gi=te("zlib"),oS=Zi(),kN=rS(),{kStatusCode:iS}=wn(),wN=Buffer[Symbol.species],SN=Buffer.from([0,0,255,255]),ol=Symbol("permessage-deflate"),Sn=Symbol("total-length"),Io=Symbol("callback"),Wn=Symbol("buffers"),Ao=Symbol("error"),rl,Qg=class{constructor(t){if(this._options=t||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._maxPayload=this._options.maxPayload|0,this._isServer=!!this._options.isServer,this._deflate=null,this._inflate=null,this.params=null,!rl){let r=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;rl=new kN(r)}}static get extensionName(){return"permessage-deflate"}offer(){let t={};return this._options.serverNoContextTakeover&&(t.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(t.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(t.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?t.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(t.client_max_window_bits=!0),t}accept(t){return t=this.normalizeParams(t),this.params=this._isServer?this.acceptAsServer(t):this.acceptAsClient(t),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let t=this._deflate[Io];this._deflate.close(),this._deflate=null,t&&t(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(t){let r=this._options,o=t.find(n=>!(r.serverNoContextTakeover===!1&&n.server_no_context_takeover||n.server_max_window_bits&&(r.serverMaxWindowBits===!1||typeof r.serverMaxWindowBits=="number"&&r.serverMaxWindowBits>n.server_max_window_bits)||typeof r.clientMaxWindowBits=="number"&&!n.client_max_window_bits));if(!o)throw new Error("None of the extension offers can be accepted");return r.serverNoContextTakeover&&(o.server_no_context_takeover=!0),r.clientNoContextTakeover&&(o.client_no_context_takeover=!0),typeof r.serverMaxWindowBits=="number"&&(o.server_max_window_bits=r.serverMaxWindowBits),typeof r.clientMaxWindowBits=="number"?o.client_max_window_bits=r.clientMaxWindowBits:(o.client_max_window_bits===!0||r.clientMaxWindowBits===!1)&&delete o.client_max_window_bits,o}acceptAsClient(t){let r=t[0];if(this._options.clientNoContextTakeover===!1&&r.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!r.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(r.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&r.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return r}normalizeParams(t){return t.forEach(r=>{Object.keys(r).forEach(o=>{let n=r[o];if(n.length>1)throw new Error(`Parameter "${o}" must have only a single value`);if(n=n[0],o==="client_max_window_bits"){if(n!==!0){let i=+n;if(!Number.isInteger(i)||i<8||i>15)throw new TypeError(`Invalid value for parameter "${o}": ${n}`);n=i}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${o}": ${n}`)}else if(o==="server_max_window_bits"){let i=+n;if(!Number.isInteger(i)||i<8||i>15)throw new TypeError(`Invalid value for parameter "${o}": ${n}`);n=i}else if(o==="client_no_context_takeover"||o==="server_no_context_takeover"){if(n!==!0)throw new TypeError(`Invalid value for parameter "${o}": ${n}`)}else throw new Error(`Unknown parameter "${o}"`);r[o]=n})}),t}decompress(t,r,o){rl.add(n=>{this._decompress(t,r,(i,a)=>{n(),o(i,a)})})}compress(t,r,o){rl.add(n=>{this._compress(t,r,(i,a)=>{n(),o(i,a)})})}_decompress(t,r,o){let n=this._isServer?"client":"server";if(!this._inflate){let i=`${n}_max_window_bits`,a=typeof this.params[i]!="number"?Gi.Z_DEFAULT_WINDOWBITS:this.params[i];this._inflate=Gi.createInflateRaw({...this._options.zlibInflateOptions,windowBits:a}),this._inflate[ol]=this,this._inflate[Sn]=0,this._inflate[Wn]=[],this._inflate.on("error",$N),this._inflate.on("data",aS)}this._inflate[Io]=o,this._inflate.write(t),r&&this._inflate.write(SN),this._inflate.flush(()=>{let i=this._inflate[Ao];if(i){this._inflate.close(),this._inflate=null,o(i);return}let a=oS.concat(this._inflate[Wn],this._inflate[Sn]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[Sn]=0,this._inflate[Wn]=[],r&&this.params[`${n}_no_context_takeover`]&&this._inflate.reset()),o(null,a)})}_compress(t,r,o){let n=this._isServer?"server":"client";if(!this._deflate){let i=`${n}_max_window_bits`,a=typeof this.params[i]!="number"?Gi.Z_DEFAULT_WINDOWBITS:this.params[i];this._deflate=Gi.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:a}),this._deflate[Sn]=0,this._deflate[Wn]=[],this._deflate.on("data",_N)}this._deflate[Io]=o,this._deflate.write(t),this._deflate.flush(Gi.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let i=oS.concat(this._deflate[Wn],this._deflate[Sn]);r&&(i=new wN(i.buffer,i.byteOffset,i.length-4)),this._deflate[Io]=null,this._deflate[Sn]=0,this._deflate[Wn]=[],r&&this.params[`${n}_no_context_takeover`]&&this._deflate.reset(),o(null,i)})}};sS.exports=Qg;function _N(e){this[Wn].push(e),this[Sn]+=e.length}function aS(e){if(this[Sn]+=e.length,this[ol]._maxPayload<1||this[Sn]<=this[ol]._maxPayload){this[Wn].push(e);return}this[Ao]=new RangeError("Max payload size exceeded"),this[Ao].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[Ao][iS]=1009,this.removeListener("data",aS),this.reset()}function $N(e){if(this[ol]._inflate=null,this[Ao]){this[Io](this[Ao]);return}e[iS]=1007,this[Io](e)}});var Po=q((vW,il)=>{"use strict";var{isUtf8:cS}=te("buffer"),{hasBlob:IN}=wn(),AN=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function EN(e){return e>=1e3&&e<=1014&&e!==1004&&e!==1005&&e!==1006||e>=3e3&&e<=4999}function eh(e){let t=e.length,r=0;for(;r<t;)if((e[r]&128)===0)r++;else if((e[r]&224)===192){if(r+1===t||(e[r+1]&192)!==128||(e[r]&254)===192)return!1;r+=2}else if((e[r]&240)===224){if(r+2>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||e[r]===224&&(e[r+1]&224)===128||e[r]===237&&(e[r+1]&224)===160)return!1;r+=3}else if((e[r]&248)===240){if(r+3>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||(e[r+3]&192)!==128||e[r]===240&&(e[r+1]&240)===128||e[r]===244&&e[r+1]>143||e[r]>244)return!1;r+=4}else return!1;return!0}function PN(e){return IN&&typeof e=="object"&&typeof e.arrayBuffer=="function"&&typeof e.type=="string"&&typeof e.stream=="function"&&(e[Symbol.toStringTag]==="Blob"||e[Symbol.toStringTag]==="File")}il.exports={isBlob:PN,isValidStatusCode:EN,isValidUTF8:eh,tokenChars:AN};if(cS)il.exports.isValidUTF8=function(e){return e.length<24?eh(e):cS(e)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let e=te("utf-8-validate");il.exports.isValidUTF8=function(t){return t.length<32?eh(t):e(t)}}catch{}});var ih=q((yW,gS)=>{"use strict";var{Writable:CN}=te("stream"),lS=Eo(),{BINARY_TYPES:TN,EMPTY_BUFFER:uS,kStatusCode:RN,kWebSocket:ON}=wn(),{concat:th,toArrayBuffer:DN,unmask:NN}=Zi(),{isValidStatusCode:LN,isValidUTF8:dS}=Po(),al=Buffer[Symbol.species],gt=0,pS=1,mS=2,fS=3,nh=4,rh=5,sl=6,oh=class extends CN{constructor(t={}){super(),this._allowSynchronousEvents=t.allowSynchronousEvents!==void 0?t.allowSynchronousEvents:!0,this._binaryType=t.binaryType||TN[0],this._extensions=t.extensions||{},this._isServer=!!t.isServer,this._maxBufferedChunks=t.maxBufferedChunks|0,this._maxFragments=t.maxFragments|0,this._maxPayload=t.maxPayload|0,this._skipUTF8Validation=!!t.skipUTF8Validation,this[ON]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=gt}_write(t,r,o){if(this._opcode===8&&this._state==gt)return o();if(this._maxBufferedChunks>0&&this._buffers.length>=this._maxBufferedChunks){o(this.createError(RangeError,"Too many buffered chunks",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS"));return}this._bufferedBytes+=t.length,this._buffers.push(t),this.startLoop(o)}consume(t){if(this._bufferedBytes-=t,t===this._buffers[0].length)return this._buffers.shift();if(t<this._buffers[0].length){let o=this._buffers[0];return this._buffers[0]=new al(o.buffer,o.byteOffset+t,o.length-t),new al(o.buffer,o.byteOffset,t)}let r=Buffer.allocUnsafe(t);do{let o=this._buffers[0],n=r.length-t;t>=o.length?r.set(this._buffers.shift(),n):(r.set(new Uint8Array(o.buffer,o.byteOffset,t),n),this._buffers[0]=new al(o.buffer,o.byteOffset+t,o.length-t)),t-=o.length}while(t>0);return r}startLoop(t){this._loop=!0;do switch(this._state){case gt:this.getInfo(t);break;case pS:this.getPayloadLength16(t);break;case mS:this.getPayloadLength64(t);break;case fS:this.getMask();break;case nh:this.getData(t);break;case rh:case sl:this._loop=!1;return}while(this._loop);this._errored||t()}getInfo(t){if(this._bufferedBytes<2){this._loop=!1;return}let r=this.consume(2);if((r[0]&48)!==0){let n=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");t(n);return}let o=(r[0]&64)===64;if(o&&!this._extensions[lS.extensionName]){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(n);return}if(this._fin=(r[0]&128)===128,this._opcode=r[0]&15,this._payloadLength=r[1]&127,this._opcode===0){if(o){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(n);return}if(!this._fragmented){let n=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");t(n);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let n=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(n);return}this._compressed=o}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let n=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");t(n);return}if(o){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(n);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let n=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");t(n);return}}else{let n=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(n);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(r[1]&128)===128,this._isServer){if(!this._masked){let n=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");t(n);return}}else if(this._masked){let n=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");t(n);return}this._payloadLength===126?this._state=pS:this._payloadLength===127?this._state=mS:this.haveLength(t)}getPayloadLength16(t){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(t)}getPayloadLength64(t){if(this._bufferedBytes<8){this._loop=!1;return}let r=this.consume(8),o=r.readUInt32BE(0);if(o>Math.pow(2,21)-1){let n=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");t(n);return}this._payloadLength=o*Math.pow(2,32)+r.readUInt32BE(4),this.haveLength(t)}haveLength(t){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let r=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");t(r);return}this._masked?this._state=fS:this._state=nh}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=nh}getData(t){let r=uS;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}r=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&NN(r,this._mask)}if(this._opcode>7){this.controlMessage(r,t);return}if(this._compressed){this._state=rh,this.decompress(r,t);return}if(r.length){if(this._maxFragments>0&&this._fragments.length>=this._maxFragments){let o=this.createError(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS");t(o);return}this._messageLength=this._totalPayloadLength,this._fragments.push(r)}this.dataMessage(t)}decompress(t,r){this._extensions[lS.extensionName].decompress(t,this._fin,(n,i)=>{if(n)return r(n);if(i.length){if(this._messageLength+=i.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let a=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");r(a);return}if(this._maxFragments>0&&this._fragments.length>=this._maxFragments){let a=this.createError(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS");r(a);return}this._fragments.push(i)}this.dataMessage(r),this._state===gt&&this.startLoop(r)})}dataMessage(t){if(!this._fin){this._state=gt;return}let r=this._messageLength,o=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let n;this._binaryType==="nodebuffer"?n=th(o,r):this._binaryType==="arraybuffer"?n=DN(th(o,r)):this._binaryType==="blob"?n=new Blob(o):n=o,this._allowSynchronousEvents?(this.emit("message",n,!0),this._state=gt):(this._state=sl,setImmediate(()=>{this.emit("message",n,!0),this._state=gt,this.startLoop(t)}))}else{let n=th(o,r);if(!this._skipUTF8Validation&&!dS(n)){let i=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(i);return}this._state===rh||this._allowSynchronousEvents?(this.emit("message",n,!1),this._state=gt):(this._state=sl,setImmediate(()=>{this.emit("message",n,!1),this._state=gt,this.startLoop(t)}))}}controlMessage(t,r){if(this._opcode===8){if(t.length===0)this._loop=!1,this.emit("conclude",1005,uS),this.end();else{let o=t.readUInt16BE(0);if(!LN(o)){let i=this.createError(RangeError,`invalid status code ${o}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");r(i);return}let n=new al(t.buffer,t.byteOffset+2,t.length-2);if(!this._skipUTF8Validation&&!dS(n)){let i=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");r(i);return}this._loop=!1,this.emit("conclude",o,n),this.end()}this._state=gt;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",t),this._state=gt):(this._state=sl,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",t),this._state=gt,this.startLoop(r)}))}createError(t,r,o,n,i){this._loop=!1,this._errored=!0;let a=new t(o?`Invalid WebSocket frame: ${r}`:r);return Error.captureStackTrace(a,this.createError),a.code=i,a[RN]=n,a}};gS.exports=oh});var ch=q((xW,yS)=>{"use strict";var{Duplex:bW}=te("stream"),{randomFillSync:UN}=te("crypto"),{types:{isUint8Array:zN}}=te("util"),hS=Eo(),{EMPTY_BUFFER:jN,kWebSocket:FN,NOOP:BN}=wn(),{isBlob:Co,isValidStatusCode:MN}=Po(),{mask:vS,toBuffer:yr}=Zi(),ht=Symbol("kByteLength"),HN=Buffer.alloc(4),cl=8*1024,br,To=cl,Pt=0,ZN=1,GN=2,ah=class e{constructor(t,r,o){this._extensions=r||{},o&&(this._generateMask=o,this._maskBuffer=Buffer.alloc(4)),this._socket=t,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=Pt,this.onerror=BN,this[FN]=void 0}static frame(t,r){let o,n=!1,i=2,a=!1;r.mask&&(o=r.maskBuffer||HN,r.generateMask?r.generateMask(o):(To===cl&&(br===void 0&&(br=Buffer.alloc(cl)),UN(br,0,cl),To=0),o[0]=br[To++],o[1]=br[To++],o[2]=br[To++],o[3]=br[To++]),a=(o[0]|o[1]|o[2]|o[3])===0,i=6);let s;typeof t=="string"?(!r.mask||a)&&r[ht]!==void 0?s=r[ht]:(t=Buffer.from(t),s=t.length):(s=t.length,n=r.mask&&r.readOnly&&!a);let l=s;s>=65536?(i+=8,l=127):s>125&&(i+=2,l=126);let u=Buffer.allocUnsafe(n?s+i:i);return u[0]=r.fin?r.opcode|128:r.opcode,r.rsv1&&(u[0]|=64),u[1]=l,l===126?u.writeUInt16BE(s,2):l===127&&(u[2]=u[3]=0,u.writeUIntBE(s,4,6)),r.mask?(u[1]|=128,u[i-4]=o[0],u[i-3]=o[1],u[i-2]=o[2],u[i-1]=o[3],a?[u,t]:n?(vS(t,o,u,i,s),[u]):(vS(t,o,t,0,s),[u,t])):[u,t]}close(t,r,o,n){let i;if(t===void 0)i=jN;else{if(typeof t!="number"||!MN(t))throw new TypeError("First argument must be a valid error code number");if(r===void 0||!r.length)i=Buffer.allocUnsafe(2),i.writeUInt16BE(t,0);else{let s=Buffer.byteLength(r);if(s>123)throw new RangeError("The message must not be greater than 123 bytes");if(i=Buffer.allocUnsafe(2+s),i.writeUInt16BE(t,0),typeof r=="string")i.write(r,2);else if(zN(r))i.set(r,2);else throw new TypeError("Second argument must be a string or a Uint8Array")}}let a={[ht]:i.length,fin:!0,generateMask:this._generateMask,mask:o,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==Pt?this.enqueue([this.dispatch,i,!1,a,n]):this.sendFrame(e.frame(i,a),n)}ping(t,r,o){let n,i;if(typeof t=="string"?(n=Buffer.byteLength(t),i=!1):Co(t)?(n=t.size,i=!1):(t=yr(t),n=t.length,i=yr.readOnly),n>125)throw new RangeError("The data size must not be greater than 125 bytes");let a={[ht]:n,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:9,readOnly:i,rsv1:!1};Co(t)?this._state!==Pt?this.enqueue([this.getBlobData,t,!1,a,o]):this.getBlobData(t,!1,a,o):this._state!==Pt?this.enqueue([this.dispatch,t,!1,a,o]):this.sendFrame(e.frame(t,a),o)}pong(t,r,o){let n,i;if(typeof t=="string"?(n=Buffer.byteLength(t),i=!1):Co(t)?(n=t.size,i=!1):(t=yr(t),n=t.length,i=yr.readOnly),n>125)throw new RangeError("The data size must not be greater than 125 bytes");let a={[ht]:n,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:10,readOnly:i,rsv1:!1};Co(t)?this._state!==Pt?this.enqueue([this.getBlobData,t,!1,a,o]):this.getBlobData(t,!1,a,o):this._state!==Pt?this.enqueue([this.dispatch,t,!1,a,o]):this.sendFrame(e.frame(t,a),o)}send(t,r,o){let n=this._extensions[hS.extensionName],i=r.binary?2:1,a=r.compress,s,l;typeof t=="string"?(s=Buffer.byteLength(t),l=!1):Co(t)?(s=t.size,l=!1):(t=yr(t),s=t.length,l=yr.readOnly),this._firstFragment?(this._firstFragment=!1,a&&n&&n.params[n._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(a=s>=n._threshold),this._compress=a):(a=!1,i=0),r.fin&&(this._firstFragment=!0);let u={[ht]:s,fin:r.fin,generateMask:this._generateMask,mask:r.mask,maskBuffer:this._maskBuffer,opcode:i,readOnly:l,rsv1:a};Co(t)?this._state!==Pt?this.enqueue([this.getBlobData,t,this._compress,u,o]):this.getBlobData(t,this._compress,u,o):this._state!==Pt?this.enqueue([this.dispatch,t,this._compress,u,o]):this.dispatch(t,this._compress,u,o)}getBlobData(t,r,o,n){this._bufferedBytes+=o[ht],this._state=GN,t.arrayBuffer().then(i=>{if(this._socket.destroyed){let s=new Error("The socket was closed while the blob was being read");process.nextTick(sh,this,s,n);return}this._bufferedBytes-=o[ht];let a=yr(i);r?this.dispatch(a,r,o,n):(this._state=Pt,this.sendFrame(e.frame(a,o),n),this.dequeue())}).catch(i=>{process.nextTick(WN,this,i,n)})}dispatch(t,r,o,n){if(!r){this.sendFrame(e.frame(t,o),n);return}let i=this._extensions[hS.extensionName];this._bufferedBytes+=o[ht],this._state=ZN,i.compress(t,o.fin,(a,s)=>{if(this._socket.destroyed){let l=new Error("The socket was closed while data was being compressed");sh(this,l,n);return}this._bufferedBytes-=o[ht],this._state=Pt,o.readOnly=!1,this.sendFrame(e.frame(s,o),n),this.dequeue()})}dequeue(){for(;this._state===Pt&&this._queue.length;){let t=this._queue.shift();this._bufferedBytes-=t[3][ht],Reflect.apply(t[0],this,t.slice(1))}}enqueue(t){this._bufferedBytes+=t[3][ht],this._queue.push(t)}sendFrame(t,r){t.length===2?(this._socket.cork(),this._socket.write(t[0]),this._socket.write(t[1],r),this._socket.uncork()):this._socket.write(t[0],r)}};yS.exports=ah;function sh(e,t,r){typeof r=="function"&&r(t);for(let o=0;o<e._queue.length;o++){let n=e._queue[o],i=n[n.length-1];typeof i=="function"&&i(t)}}function WN(e,t,r){sh(e,t,r),e.onerror(t)}});var AS=q((kW,IS)=>{"use strict";var{kForOnEventAttribute:Wi,kListener:lh}=wn(),bS=Symbol("kCode"),xS=Symbol("kData"),kS=Symbol("kError"),wS=Symbol("kMessage"),SS=Symbol("kReason"),Ro=Symbol("kTarget"),_S=Symbol("kType"),$S=Symbol("kWasClean"),_n=class{constructor(t){this[Ro]=null,this[_S]=t}get target(){return this[Ro]}get type(){return this[_S]}};Object.defineProperty(_n.prototype,"target",{enumerable:!0});Object.defineProperty(_n.prototype,"type",{enumerable:!0});var xr=class extends _n{constructor(t,r={}){super(t),this[bS]=r.code===void 0?0:r.code,this[SS]=r.reason===void 0?"":r.reason,this[$S]=r.wasClean===void 0?!1:r.wasClean}get code(){return this[bS]}get reason(){return this[SS]}get wasClean(){return this[$S]}};Object.defineProperty(xr.prototype,"code",{enumerable:!0});Object.defineProperty(xr.prototype,"reason",{enumerable:!0});Object.defineProperty(xr.prototype,"wasClean",{enumerable:!0});var Oo=class extends _n{constructor(t,r={}){super(t),this[kS]=r.error===void 0?null:r.error,this[wS]=r.message===void 0?"":r.message}get error(){return this[kS]}get message(){return this[wS]}};Object.defineProperty(Oo.prototype,"error",{enumerable:!0});Object.defineProperty(Oo.prototype,"message",{enumerable:!0});var Vi=class extends _n{constructor(t,r={}){super(t),this[xS]=r.data===void 0?null:r.data}get data(){return this[xS]}};Object.defineProperty(Vi.prototype,"data",{enumerable:!0});var VN={addEventListener(e,t,r={}){for(let n of this.listeners(e))if(!r[Wi]&&n[lh]===t&&!n[Wi])return;let o;if(e==="message")o=function(i,a){let s=new Vi("message",{data:a?i:i.toString()});s[Ro]=this,ll(t,this,s)};else if(e==="close")o=function(i,a){let s=new xr("close",{code:i,reason:a.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});s[Ro]=this,ll(t,this,s)};else if(e==="error")o=function(i){let a=new Oo("error",{error:i,message:i.message});a[Ro]=this,ll(t,this,a)};else if(e==="open")o=function(){let i=new _n("open");i[Ro]=this,ll(t,this,i)};else return;o[Wi]=!!r[Wi],o[lh]=t,r.once?this.once(e,o):this.on(e,o)},removeEventListener(e,t){for(let r of this.listeners(e))if(r[lh]===t&&!r[Wi]){this.removeListener(e,r);break}}};IS.exports={CloseEvent:xr,ErrorEvent:Oo,Event:_n,EventTarget:VN,MessageEvent:Vi};function ll(e,t,r){typeof e=="object"&&e.handleEvent?e.handleEvent.call(e,r):e.call(t,r)}});var ul=q((wW,ES)=>{"use strict";var{tokenChars:Ji}=Po();function Wt(e,t,r){e[t]===void 0?e[t]=[r]:e[t].push(r)}function JN(e){let t=Object.create(null),r=Object.create(null),o=!1,n=!1,i=!1,a,s,l=-1,u=-1,d=-1,p=0;for(;p<e.length;p++)if(u=e.charCodeAt(p),a===void 0)if(d===-1&&Ji[u]===1)l===-1&&(l=p);else if(p!==0&&(u===32||u===9))d===-1&&l!==-1&&(d=p);else if(u===59||u===44){if(l===-1)throw new SyntaxError(`Unexpected character at index ${p}`);d===-1&&(d=p);let f=e.slice(l,d);u===44?(Wt(t,f,r),r=Object.create(null)):a=f,l=d=-1}else throw new SyntaxError(`Unexpected character at index ${p}`);else if(s===void 0)if(d===-1&&Ji[u]===1)l===-1&&(l=p);else if(u===32||u===9)d===-1&&l!==-1&&(d=p);else if(u===59||u===44){if(l===-1)throw new SyntaxError(`Unexpected character at index ${p}`);d===-1&&(d=p),Wt(r,e.slice(l,d),!0),u===44&&(Wt(t,a,r),r=Object.create(null),a=void 0),l=d=-1}else if(u===61&&l!==-1&&d===-1)s=e.slice(l,p),l=d=-1;else throw new SyntaxError(`Unexpected character at index ${p}`);else if(n){if(Ji[u]!==1)throw new SyntaxError(`Unexpected character at index ${p}`);l===-1?l=p:o||(o=!0),n=!1}else if(i)if(Ji[u]===1)l===-1&&(l=p);else if(u===34&&l!==-1)i=!1,d=p;else if(u===92)n=!0;else throw new SyntaxError(`Unexpected character at index ${p}`);else if(u===34&&e.charCodeAt(p-1)===61)i=!0;else if(d===-1&&Ji[u]===1)l===-1&&(l=p);else if(l!==-1&&(u===32||u===9))d===-1&&(d=p);else if(u===59||u===44){if(l===-1)throw new SyntaxError(`Unexpected character at index ${p}`);d===-1&&(d=p);let f=e.slice(l,d);o&&(f=f.replace(/\\/g,""),o=!1),Wt(r,s,f),u===44&&(Wt(t,a,r),r=Object.create(null),a=void 0),s=void 0,l=d=-1}else throw new SyntaxError(`Unexpected character at index ${p}`);if(l===-1||i||u===32||u===9)throw new SyntaxError("Unexpected end of input");d===-1&&(d=p);let m=e.slice(l,d);return a===void 0?Wt(t,m,r):(s===void 0?Wt(r,m,!0):o?Wt(r,s,m.replace(/\\/g,"")):Wt(r,s,m),Wt(t,a,r)),t}function qN(e){return Object.keys(e).map(t=>{let r=e[t];return Array.isArray(r)||(r=[r]),r.map(o=>[t].concat(Object.keys(o).map(n=>{let i=o[n];return Array.isArray(i)||(i=[i]),i.map(a=>a===!0?n:`${n}=${a}`).join("; ")})).join("; ")).join(", ")}).join(", ")}ES.exports={format:qN,parse:JN}});var fl=q(($W,FS)=>{"use strict";var KN=te("events"),XN=te("https"),YN=te("http"),TS=te("net"),QN=te("tls"),{randomBytes:eL,createHash:tL}=te("crypto"),{Duplex:SW,Readable:_W}=te("stream"),{URL:uh}=te("url"),Vn=Eo(),nL=ih(),rL=ch(),{isBlob:oL}=Po(),{BINARY_TYPES:PS,CLOSE_TIMEOUT:iL,EMPTY_BUFFER:dl,GUID:aL,kForOnEventAttribute:dh,kListener:sL,kStatusCode:cL,kWebSocket:Ae,NOOP:RS}=wn(),{EventTarget:{addEventListener:lL,removeEventListener:uL}}=AS(),{format:dL,parse:pL}=ul(),{toBuffer:mL}=Zi(),OS=Symbol("kAborted"),ph=[8,13],$n=["CONNECTING","OPEN","CLOSING","CLOSED"],fL=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,fe=class e extends KN{constructor(t,r,o){super(),this._binaryType=PS[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=dl,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=e.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,t!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,r===void 0?r=[]:Array.isArray(r)||(typeof r=="object"&&r!==null?(o=r,r=[]):r=[r]),DS(this,t,r,o)):(this._autoPong=o.autoPong,this._closeTimeout=o.closeTimeout,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(t){PS.includes(t)&&(this._binaryType=t,this._receiver&&(this._receiver._binaryType=t))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(t,r,o){let n=new nL({allowSynchronousEvents:o.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxBufferedChunks:o.maxBufferedChunks,maxFragments:o.maxFragments,maxPayload:o.maxPayload,skipUTF8Validation:o.skipUTF8Validation}),i=new rL(t,this._extensions,o.generateMask);this._receiver=n,this._sender=i,this._socket=t,n[Ae]=this,i[Ae]=this,t[Ae]=this,n.on("conclude",vL),n.on("drain",yL),n.on("error",bL),n.on("message",xL),n.on("ping",kL),n.on("pong",wL),i.onerror=SL,t.setTimeout&&t.setTimeout(0),t.setNoDelay&&t.setNoDelay(),r.length>0&&t.unshift(r),t.on("close",US),t.on("data",ml),t.on("end",zS),t.on("error",jS),this._readyState=e.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[Vn.extensionName]&&this._extensions[Vn.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(t,r){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){lt(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===e.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=e.CLOSING,this._sender.close(t,r,!this._isServer,o=>{o||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),LS(this)}}pause(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!0,this._socket.pause())}ping(t,r,o){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(o=t,t=r=void 0):typeof r=="function"&&(o=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){mh(this,t,o);return}r===void 0&&(r=!this._isServer),this._sender.ping(t||dl,r,o)}pong(t,r,o){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(o=t,t=r=void 0):typeof r=="function"&&(o=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){mh(this,t,o);return}r===void 0&&(r=!this._isServer),this._sender.pong(t||dl,r,o)}resume(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(t,r,o){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof r=="function"&&(o=r,r={}),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){mh(this,t,o);return}let n={binary:typeof t!="string",mask:!this._isServer,compress:!0,fin:!0,...r};this._extensions[Vn.extensionName]||(n.compress=!1),this._sender.send(t||dl,n,o)}terminate(){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){lt(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=e.CLOSING,this._socket.destroy())}}};Object.defineProperty(fe,"CONNECTING",{enumerable:!0,value:$n.indexOf("CONNECTING")});Object.defineProperty(fe.prototype,"CONNECTING",{enumerable:!0,value:$n.indexOf("CONNECTING")});Object.defineProperty(fe,"OPEN",{enumerable:!0,value:$n.indexOf("OPEN")});Object.defineProperty(fe.prototype,"OPEN",{enumerable:!0,value:$n.indexOf("OPEN")});Object.defineProperty(fe,"CLOSING",{enumerable:!0,value:$n.indexOf("CLOSING")});Object.defineProperty(fe.prototype,"CLOSING",{enumerable:!0,value:$n.indexOf("CLOSING")});Object.defineProperty(fe,"CLOSED",{enumerable:!0,value:$n.indexOf("CLOSED")});Object.defineProperty(fe.prototype,"CLOSED",{enumerable:!0,value:$n.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(e=>{Object.defineProperty(fe.prototype,e,{enumerable:!0})});["open","error","close","message"].forEach(e=>{Object.defineProperty(fe.prototype,`on${e}`,{enumerable:!0,get(){for(let t of this.listeners(e))if(t[dh])return t[sL];return null},set(t){for(let r of this.listeners(e))if(r[dh]){this.removeListener(e,r);break}typeof t=="function"&&this.addEventListener(e,t,{[dh]:!0})}})});fe.prototype.addEventListener=lL;fe.prototype.removeEventListener=uL;FS.exports=fe;function DS(e,t,r,o){let n={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:iL,protocolVersion:ph[1],maxBufferedChunks:1048576,maxFragments:131072,maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...o,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(e._autoPong=n.autoPong,e._closeTimeout=n.closeTimeout,!ph.includes(n.protocolVersion))throw new RangeError(`Unsupported protocol version: ${n.protocolVersion} (supported versions: ${ph.join(", ")})`);let i;if(t instanceof uh)i=t;else try{i=new uh(t)}catch{throw new SyntaxError(`Invalid URL: ${t}`)}i.protocol==="http:"?i.protocol="ws:":i.protocol==="https:"&&(i.protocol="wss:"),e._url=i.href;let a=i.protocol==="wss:",s=i.protocol==="ws+unix:",l;if(i.protocol!=="ws:"&&!a&&!s?l=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:s&&!i.pathname?l="The URL's pathname is empty":i.hash&&(l="The URL contains a fragment identifier"),l){let y=new SyntaxError(l);if(e._redirects===0)throw y;pl(e,y);return}let u=a?443:80,d=eL(16).toString("base64"),p=a?XN.request:YN.request,m=new Set,f;if(n.createConnection=n.createConnection||(a?hL:gL),n.defaultPort=n.defaultPort||u,n.port=i.port||u,n.host=i.hostname.startsWith("[")?i.hostname.slice(1,-1):i.hostname,n.headers={...n.headers,"Sec-WebSocket-Version":n.protocolVersion,"Sec-WebSocket-Key":d,Connection:"Upgrade",Upgrade:"websocket"},n.path=i.pathname+i.search,n.timeout=n.handshakeTimeout,n.perMessageDeflate&&(f=new Vn({...n.perMessageDeflate,isServer:!1,maxPayload:n.maxPayload}),n.headers["Sec-WebSocket-Extensions"]=dL({[Vn.extensionName]:f.offer()})),r.length){for(let y of r){if(typeof y!="string"||!fL.test(y)||m.has(y))throw new SyntaxError("An invalid or duplicated subprotocol was specified");m.add(y)}n.headers["Sec-WebSocket-Protocol"]=r.join(",")}if(n.origin&&(n.protocolVersion<13?n.headers["Sec-WebSocket-Origin"]=n.origin:n.headers.Origin=n.origin),(i.username||i.password)&&(n.auth=`${i.username}:${i.password}`),s){let y=n.path.split(":");n.socketPath=y[0],n.path=y[1]}let g;if(n.followRedirects){if(e._redirects===0){e._originalIpc=s,e._originalSecure=a,e._originalHostOrSocketPath=s?n.socketPath:i.host;let y=o&&o.headers;if(o={...o,headers:{}},y)for(let[k,_]of Object.entries(y))o.headers[k.toLowerCase()]=_}else if(e.listenerCount("redirect")===0){let y=s?e._originalIpc?n.socketPath===e._originalHostOrSocketPath:!1:e._originalIpc?!1:i.host===e._originalHostOrSocketPath;(!y||e._originalSecure&&!a)&&(delete n.headers.authorization,delete n.headers.cookie,y||delete n.headers.host,n.auth=void 0)}n.auth&&!o.headers.authorization&&(o.headers.authorization="Basic "+Buffer.from(n.auth).toString("base64")),g=e._req=p(n),e._redirects&&e.emit("redirect",e.url,g)}else g=e._req=p(n);n.timeout&&g.on("timeout",()=>{lt(e,g,"Opening handshake has timed out")}),g.on("error",y=>{g===null||g[OS]||(g=e._req=null,pl(e,y))}),g.on("response",y=>{let k=y.headers.location,_=y.statusCode;if(k&&n.followRedirects&&_>=300&&_<400){if(++e._redirects>n.maxRedirects){lt(e,g,"Maximum redirects exceeded");return}g.abort();let P;try{P=new uh(k,t)}catch{let E=new SyntaxError(`Invalid URL: ${k}`);pl(e,E);return}DS(e,P,r,o)}else e.emit("unexpected-response",g,y)||lt(e,g,`Unexpected server response: ${y.statusCode}`)}),g.on("upgrade",(y,k,_)=>{if(e.emit("upgrade",y),e.readyState!==fe.CONNECTING)return;g=e._req=null;let P=y.headers.upgrade;if(P===void 0||P.toLowerCase()!=="websocket"){lt(e,k,"Invalid Upgrade header");return}let C=tL("sha1").update(d+aL).digest("base64");if(y.headers["sec-websocket-accept"]!==C){lt(e,k,"Invalid Sec-WebSocket-Accept header");return}let E=y.headers["sec-websocket-protocol"],D;if(E!==void 0?m.size?m.has(E)||(D="Server sent an invalid subprotocol"):D="Server sent a subprotocol but none was requested":m.size&&(D="Server sent no subprotocol"),D){lt(e,k,D);return}E&&(e._protocol=E);let W=y.headers["sec-websocket-extensions"];if(W!==void 0){if(!f){lt(e,k,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let ce;try{ce=pL(W)}catch{lt(e,k,"Invalid Sec-WebSocket-Extensions header");return}let Y=Object.keys(ce);if(Y.length!==1||Y[0]!==Vn.extensionName){lt(e,k,"Server indicated an extension that was not requested");return}try{f.accept(ce[Vn.extensionName])}catch{lt(e,k,"Invalid Sec-WebSocket-Extensions header");return}e._extensions[Vn.extensionName]=f}e.setSocket(k,_,{allowSynchronousEvents:n.allowSynchronousEvents,generateMask:n.generateMask,maxBufferedChunks:n.maxBufferedChunks,maxFragments:n.maxFragments,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation})}),n.finishRequest?n.finishRequest(g,e):g.end()}function pl(e,t){e._readyState=fe.CLOSING,e._errorEmitted=!0,e.emit("error",t),e.emitClose()}function gL(e){return e.path=e.socketPath,TS.connect(e)}function hL(e){return e.path=void 0,!e.servername&&e.servername!==""&&(e.servername=TS.isIP(e.host)?"":e.host),QN.connect(e)}function lt(e,t,r){e._readyState=fe.CLOSING;let o=new Error(r);Error.captureStackTrace(o,lt),t.setHeader?(t[OS]=!0,t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),process.nextTick(pl,e,o)):(t.destroy(o),t.once("error",e.emit.bind(e,"error")),t.once("close",e.emitClose.bind(e)))}function mh(e,t,r){if(t){let o=oL(t)?t.size:mL(t).length;e._socket?e._sender._bufferedBytes+=o:e._bufferedAmount+=o}if(r){let o=new Error(`WebSocket is not open: readyState ${e.readyState} (${$n[e.readyState]})`);process.nextTick(r,o)}}function vL(e,t){let r=this[Ae];r._closeFrameReceived=!0,r._closeMessage=t,r._closeCode=e,r._socket[Ae]!==void 0&&(r._socket.removeListener("data",ml),process.nextTick(NS,r._socket),e===1005?r.close():r.close(e,t))}function yL(){let e=this[Ae];e.isPaused||e._socket.resume()}function bL(e){let t=this[Ae];t._socket[Ae]!==void 0&&(t._socket.removeListener("data",ml),process.nextTick(NS,t._socket),t.close(e[cL])),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e))}function CS(){this[Ae].emitClose()}function xL(e,t){this[Ae].emit("message",e,t)}function kL(e){let t=this[Ae];t._autoPong&&t.pong(e,!this._isServer,RS),t.emit("ping",e)}function wL(e){this[Ae].emit("pong",e)}function NS(e){e.resume()}function SL(e){let t=this[Ae];t.readyState!==fe.CLOSED&&(t.readyState===fe.OPEN&&(t._readyState=fe.CLOSING,LS(t)),this._socket.end(),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e)))}function LS(e){e._closeTimer=setTimeout(e._socket.destroy.bind(e._socket),e._closeTimeout)}function US(){let e=this[Ae];if(this.removeListener("close",US),this.removeListener("data",ml),this.removeListener("end",zS),e._readyState=fe.CLOSING,!this._readableState.endEmitted&&!e._closeFrameReceived&&!e._receiver._writableState.errorEmitted&&this._readableState.length!==0){let t=this.read(this._readableState.length);e._receiver.write(t)}e._receiver.end(),this[Ae]=void 0,clearTimeout(e._closeTimer),e._receiver._writableState.finished||e._receiver._writableState.errorEmitted?e.emitClose():(e._receiver.on("error",CS),e._receiver.on("finish",CS))}function ml(e){this[Ae]._receiver.write(e)||this.pause()}function zS(){let e=this[Ae];e._readyState=fe.CLOSING,e._receiver.end(),this.end()}function jS(){let e=this[Ae];this.removeListener("error",jS),this.on("error",RS),e&&(e._readyState=fe.CLOSING,this.destroy())}});var ZS=q((AW,HS)=>{"use strict";var IW=fl(),{Duplex:_L}=te("stream");function BS(e){e.emit("close")}function $L(){!this.destroyed&&this._writableState.finished&&this.destroy()}function MS(e){this.removeListener("error",MS),this.destroy(),this.listenerCount("error")===0&&this.emit("error",e)}function IL(e,t){let r=!0,o=new _L({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return e.on("message",function(i,a){let s=!a&&o._readableState.objectMode?i.toString():i;o.push(s)||e.pause()}),e.once("error",function(i){o.destroyed||(r=!1,o.destroy(i))}),e.once("close",function(){o.destroyed||o.push(null)}),o._destroy=function(n,i){if(e.readyState===e.CLOSED){i(n),process.nextTick(BS,o);return}let a=!1;e.once("error",function(l){a=!0,i(l)}),e.once("close",function(){a||i(n),process.nextTick(BS,o)}),r&&e.terminate()},o._final=function(n){if(e.readyState===e.CONNECTING){e.once("open",function(){o._final(n)});return}e._socket!==null&&(e._socket._writableState.finished?(n(),o._readableState.endEmitted&&o.destroy()):(e._socket.once("finish",function(){n()}),e.close()))},o._read=function(){e.isPaused&&e.resume()},o._write=function(n,i,a){if(e.readyState===e.CONNECTING){e.once("open",function(){o._write(n,i,a)});return}e.send(n,a)},o.on("end",$L),o.on("error",MS),o}HS.exports=IL});var fh=q((EW,GS)=>{"use strict";var{tokenChars:AL}=Po();function EL(e){let t=new Set,r=-1,o=-1,n=0;for(n;n<e.length;n++){let a=e.charCodeAt(n);if(o===-1&&AL[a]===1)r===-1&&(r=n);else if(n!==0&&(a===32||a===9))o===-1&&r!==-1&&(o=n);else if(a===44){if(r===-1)throw new SyntaxError(`Unexpected character at index ${n}`);o===-1&&(o=n);let s=e.slice(r,o);if(t.has(s))throw new SyntaxError(`The "${s}" subprotocol is duplicated`);t.add(s),r=o=-1}else throw new SyntaxError(`Unexpected character at index ${n}`)}if(r===-1||o!==-1)throw new SyntaxError("Unexpected end of input");let i=e.slice(r,n);if(t.has(i))throw new SyntaxError(`The "${i}" subprotocol is duplicated`);return t.add(i),t}GS.exports={parse:EL}});var YS=q((CW,XS)=>{"use strict";var PL=te("events"),gl=te("http"),{Duplex:PW}=te("stream"),{createHash:CL}=te("crypto"),WS=ul(),kr=Eo(),TL=fh(),RL=fl(),{CLOSE_TIMEOUT:OL,GUID:DL,kWebSocket:NL}=wn(),LL=/^[+/0-9A-Za-z]{22}==$/,VS=0,JS=1,KS=2,gh=class extends PL{constructor(t,r){if(super(),t={allowSynchronousEvents:!0,autoPong:!0,maxBufferedChunks:1024*1024,maxFragments:128*1024,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:OL,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:RL,...t},t.port==null&&!t.server&&!t.noServer||t.port!=null&&(t.server||t.noServer)||t.server&&t.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(t.port!=null?(this._server=gl.createServer((o,n)=>{let i=gl.STATUS_CODES[426];n.writeHead(426,{"Content-Length":i.length,"Content-Type":"text/plain"}),n.end(i)}),this._server.listen(t.port,t.host,t.backlog,r)):t.server&&(this._server=t.server),this._server){let o=this.emit.bind(this,"connection");this._removeListeners=UL(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(n,i,a)=>{this.handleUpgrade(n,i,a,o)}})}t.perMessageDeflate===!0&&(t.perMessageDeflate={}),t.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=t,this._state=VS}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(t){if(this._state===KS){t&&this.once("close",()=>{t(new Error("The server is not running"))}),process.nextTick(qi,this);return}if(t&&this.once("close",t),this._state!==JS)if(this._state=JS,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(qi,this):process.nextTick(qi,this);else{let r=this._server;this._removeListeners(),this._removeListeners=this._server=null,r.close(()=>{qi(this)})}}shouldHandle(t){if(this.options.path){let r=t.url.indexOf("?");if((r!==-1?t.url.slice(0,r):t.url)!==this.options.path)return!1}return!0}handleUpgrade(t,r,o,n){r.on("error",qS);let i=t.headers["sec-websocket-key"],a=t.headers.upgrade,s=+t.headers["sec-websocket-version"];if(t.method!=="GET"){wr(this,t,r,405,"Invalid HTTP method");return}if(a===void 0||a.toLowerCase()!=="websocket"){wr(this,t,r,400,"Invalid Upgrade header");return}if(i===void 0||!LL.test(i)){wr(this,t,r,400,"Missing or invalid Sec-WebSocket-Key header");return}if(s!==13&&s!==8){wr(this,t,r,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(t)){Ki(r,400);return}let l=t.headers["sec-websocket-protocol"],u=new Set;if(l!==void 0)try{u=TL.parse(l)}catch{wr(this,t,r,400,"Invalid Sec-WebSocket-Protocol header");return}let d=t.headers["sec-websocket-extensions"],p={};if(this.options.perMessageDeflate&&d!==void 0){let m=new kr({...this.options.perMessageDeflate,isServer:!0,maxPayload:this.options.maxPayload});try{let f=WS.parse(d);f[kr.extensionName]&&(m.accept(f[kr.extensionName]),p[kr.extensionName]=m)}catch{wr(this,t,r,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let m={origin:t.headers[`${s===8?"sec-websocket-origin":"origin"}`],secure:!!(t.socket.authorized||t.socket.encrypted),req:t};if(this.options.verifyClient.length===2){this.options.verifyClient(m,(f,g,y,k)=>{if(!f)return Ki(r,g||401,y,k);this.completeUpgrade(p,i,u,t,r,o,n)});return}if(!this.options.verifyClient(m))return Ki(r,401)}this.completeUpgrade(p,i,u,t,r,o,n)}completeUpgrade(t,r,o,n,i,a,s){if(!i.readable||!i.writable)return i.destroy();if(i[NL])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>VS)return Ki(i,503);let u=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${CL("sha1").update(r+DL).digest("base64")}`],d=new this.options.WebSocket(null,void 0,this.options);if(o.size){let p=this.options.handleProtocols?this.options.handleProtocols(o,n):o.values().next().value;p&&(u.push(`Sec-WebSocket-Protocol: ${p}`),d._protocol=p)}if(t[kr.extensionName]){let p=t[kr.extensionName].params,m=WS.format({[kr.extensionName]:[p]});u.push(`Sec-WebSocket-Extensions: ${m}`),d._extensions=t}this.emit("headers",u,n),i.write(u.concat(`\r
|
|
5
5
|
`).join(`\r
|
|
6
|
-
`)),i.removeListener("error",
|
|
6
|
+
`)),i.removeListener("error",qS),d.setSocket(i,a,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxBufferedChunks:this.options.maxBufferedChunks,maxFragments:this.options.maxFragments,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(d),d.on("close",()=>{this.clients.delete(d),this._shouldEmitClose&&!this.clients.size&&process.nextTick(qi,this)})),s(d,n)}};XS.exports=gh;function UL(e,t){for(let r of Object.keys(t))e.on(r,t[r]);return function(){for(let o of Object.keys(t))e.removeListener(o,t[o])}}function qi(e){e._state=KS,e.emit("close")}function qS(){this.destroy()}function Ki(e,t,r,o){r=r||gl.STATUS_CODES[t],o={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(r),...o},e.once("finish",e.destroy),e.end(`HTTP/1.1 ${t} ${gl.STATUS_CODES[t]}\r
|
|
7
7
|
`+Object.keys(o).map(n=>`${n}: ${o[n]}`).join(`\r
|
|
8
8
|
`)+`\r
|
|
9
9
|
\r
|
|
10
|
-
`+r)}function
|
|
11
|
-
`).map(t=>t.trim()).filter(Boolean))]}function
|
|
10
|
+
`+r)}function wr(e,t,r,o,n,i){if(e.listenerCount("wsClientError")){let a=new Error(n);Error.captureStackTrace(a,wr),e.emit("wsClientError",a,r,t)}else Ki(r,o,n,i)}});import{createHash as nE}from"node:crypto";import{chmodSync as oy,mkdirSync as rE,readFileSync as oE,renameSync as iE,rmSync as iy,writeFileSync as ay}from"node:fs";import aE from"node:os";import ze from"node:path";import r$ from"node:os";import o$ from"node:path";var M=process.env.BRIDGE_SECRET_DIR||o$.join(r$.homedir(),".claude-bridge");import{existsSync as h$,readdirSync as v$,readFileSync as y$}from"node:fs";import b$ from"node:os";import _r from"node:path";import{createHash as p$}from"node:crypto";import{readFileSync as Ah,rmSync as m$}from"node:fs";import Jn from"node:path";import{mkdirSync as i$,readFileSync as a$,renameSync as s$,rmSync as c$,writeFileSync as l$}from"node:fs";import u$ from"node:path";function d$(e){return[...new Set(e.split(`
|
|
11
|
+
`).map(t=>t.trim()).filter(Boolean))]}function Sl(e){try{return d$(a$(e,"utf8"))}catch{return[]}}function $h(e){let t=r=>{try{if(r.length===0){c$(e,{force:!0});return}i$(u$.dirname(e),{recursive:!0,mode:448});let o=`${e}.tmp`;l$(o,`${r.join(`
|
|
12
12
|
`)}
|
|
13
|
-
`,{mode:384}),Y_(o,e)}catch{}};return{add(r){let o=gl(e);o.includes(r)||t([...o,r])},remove(r){let o=gl(e);o.includes(r)&&t(o.filter(n=>n!==r))}}}function kh(e,t){if(!t)return 0;let r=0;for(let o of gl(e))try{t.delete(o),r++}catch{}return r}var i$=/^[A-Za-z0-9][A-Za-z0-9_.-]{0,79}$/;function ut(e){return i$.test(e)&&!e.includes("..")?e:`h_${r$("sha256").update(e,"utf8").digest("hex").slice(0,24)}`}function ea(e){return Vn.join(W,"users",e)}function Ze(e){try{let t=JSON.parse(Buffer.from(e.split(".")[1]??"","base64url").toString("utf8"));return typeof t.sub=="string"&&t.sub?t.sub:null}catch{return null}}var Lo=Vn.join(W,"active-user.json");function Sh(){try{let e=JSON.parse(wh(Lo,"utf8"));return typeof e.sub=="string"&&e.sub?e.sub:null}catch{return null}}var a$="layout-version.json";function Kt(){try{let e=JSON.parse(wh(Vn.join(W,a$),"utf8"));return typeof e.version=="number"&&Number.isFinite(e.version)?e.version:0}catch{return 0}}var Xt=3;function _h(e){if(!e||e.includes("/")||e.includes("\\")||e.includes("..")||e.includes("\0"))throw new Error(`unsafe credential segment: ${JSON.stringify(e)}`)}function yt(e){_h(e);let t=ea(e);return{accessFile:Vn.join(t,"relay-access-token"),refreshFile:Vn.join(t,"relay-refresh-token")}}function hl(e,t){_h(e);let r=Vn.join(ea(e),"providers"),o=kh(Vn.join(r,".keyring-index"),t??null);return o$(r,{recursive:!0,force:!0}),o}var vl=e=>{try{return l$(e,"utf8").trim()||null}catch{return null}},Jn="hub-endpoint.json",d$=24,p$=new Set(["public","default","default user","all users","defaultapppool","administrator"]);function yl(e){if(!e)return null;try{let t=JSON.parse(e);return typeof t?.pid!="number"||typeof t?.port!="number"?null:{pid:t.pid,port:t.port,startedAt:typeof t.startedAt=="number"?t.startedAt:0,...typeof t.sub=="string"&&t.sub?{sub:t.sub}:{}}}catch{return null}}function m$(e){let o=e.readFile("/etc/wsl.conf")?.match(/^\s*root\s*=\s*(\S+)\s*$/m)?.[1]??"/mnt";return o.length>1&&o.endsWith("/")?o.slice(0,-1):o}function bl(e){let t=[],r=n=>{t.length<d$&&!t.includes(n)&&t.push(n)},o=n=>!p$.has(n.toLowerCase());if(e.isWsl){let n=m$(e);for(let i of e.listDir(n).filter(a=>/^[a-zA-Z]$/.test(a))){let a=`${n}/${i}/Users`;o(e.userName)&&r(`${a}/${e.userName}`);for(let s of e.listDir(a))o(s)&&r(`${a}/${s}`)}return t}if(e.platform==="win32")for(let n of["\\\\wsl.localhost","\\\\wsl$"])for(let i of e.listDir(`${n}\\`)){let a=`${n}\\${i}\\home`;r(`${a}\\${e.userName}`);for(let s of e.listDir(a))r(`${a}\\${s}`)}return t}function f$(e){let t=e.isWsl?"/":"\\";return bl(e).map(r=>`${r}${t}.claude-bridge`)}function g$(e){let t=i=>yl(e.readFile(i.endsWith("\\")||i.endsWith("/")?`${i}${Jn}`:`${i}${e.platform==="win32"?"\\":"/"}${Jn}`)),r=e.env.BRIDGE_SECRET_DIR;if(r)return{dir:r,source:"env",beacon:t(r)};let o=t(e.secretDir);if(o&&e.pidAlive(o.pid))return{dir:e.secretDir,source:"local",beacon:o};let n=null;for(let i of f$(e)){let a=t(i);a&&(!n||a.startedAt>n.beacon.startedAt)&&(n={dir:i,beacon:a})}return n?{dir:n.dir,source:e.isWsl?"peer-wsl":"peer-windows",beacon:n.beacon}:{dir:e.secretDir,source:"local",beacon:null}}function $h(e,t,r){return t!=="linux"?!1:e.WSL_DISTRO_NAME||e.WSL_INTEROP?!0:/microsoft/i.test(r("/proc/version")??"")}function na(){return $h(process.env,process.platform,vl)}var ta=null;function Sr(e={}){if(ta&&!e.fresh)return ta;let t=n=>vl(n),r=n=>{try{return c$(n)}catch{return[]}},o="";try{o=u$.userInfo().username}catch{o=process.env.USER??process.env.USERNAME??""}return ta=g$({secretDir:W,env:process.env,platform:process.platform,userName:o,isWsl:$h(process.env,process.platform,t),pidAlive:n=>{try{return process.kill(n,0),!0}catch(i){return i.code==="EPERM"}},readFile:t,listDir:r}),ta}function Ih(e){return{hubTokenFile:wr.join(e,"hub-token"),activeUserFile:wr.join(e,"active-user.json"),sessionsDir:wr.join(e,"sessions"),configFile:wr.join(e,"config.json"),beaconFile:wr.join(e,Jn)}}function h$(e){let t=vl(Ih(e).activeUserFile);if(!t)return null;try{let r=JSON.parse(t);return typeof r.sub=="string"&&r.sub?r.sub:null}catch{return null}}function Ah(e){let t=h$(e);if(t){let r=wr.join(e,"users",ut(t),"hub-token");if(s$(r))return r}return Ih(e).hubTokenFile}function ra(e){if(e?.isDevBuild!==!0)return!1;let t=e.env??process.env;return t.BRIDGE_VOICE==="1"||t.BRIDGE_VOICE==="true"}var hz=256*1024;import{readFileSync as v$}from"node:fs";import Uo from"node:path";var y$=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(?:\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?$/;function xl(e){if(typeof e!="string")return{kind:"invalid"};let t=y$.exec(e);return t?t[1]==="0"&&t[2]==="0"&&t[3]==="0"?{kind:"dev"}:{kind:"release",version:e}:{kind:"invalid"}}function Eh(e){let t=xl(e);return t.kind==="release"?t.version:null}function Ct(e=process.env,t=process.argv){let r=xl(e.BRIDGE_CLIENT_VERSION);if(r.kind==="release")return r.version;if(r.kind==="dev")return null;let o=Uo.join(W,"payload"),n=t[1];if(!n)return null;let i=Uo.relative(o,Uo.resolve(n));if(i===""||i.startsWith("..")||Uo.isAbsolute(i))return null;try{let a=JSON.parse(v$(Uo.join(o,"version.json"),"utf8")),s=xl(a.version);return s.kind==="release"?s.version:null}catch{return null}}import{readdirSync as b$}from"node:fs";import x$ from"node:path";var qn=class extends Error{constructor(r,o){super(r);this.status=o;this.name="RelayError"}status},k$=e=>e.replace(/\/+$/,"");async function kl(e,t,r,o){return fetch(`${k$(e)}${t}`,{method:"POST",headers:{"content-type":"application/json",...o?{authorization:`Bearer ${o}`}:{}},body:r===void 0?void 0:JSON.stringify(r)})}async function Ph(e,t){let r=await kl(e,"/node/provision",{},t);if(!r.ok)throw new qn(`provision failed (${r.status}): ${(await r.text().catch(()=>"")).slice(0,200)}`,r.status);let o=await r.json().catch(()=>({}));if(typeof o.claim_code!="string")throw new qn("provision returned no claim_code",r.status);return o.claim_code}async function Ch(e,t){let r=await kl(e,"/node/claim",{claim_code:t});if(!r.ok)throw new qn(`pairing failed (${r.status}): ${(await r.text().catch(()=>"")).slice(0,200)}`,r.status);return await r.json()}async function w$(e,t){let r=await kl(e,"/node/token",void 0,t);if(!r.ok)throw new qn(`refresh rejected (${r.status})`,r.status);return await r.json()}function zo(e,t={}){let r=t.log??(l=>console.warn(l)),o=Ze(e.refresh_token),n=Ze(e.access_token),i=o??n;if(o&&n&&o!==n&&r(`credential: access-token sub (${n}) differs from refresh-token sub (${o}) \u2014 trusting the refresh sub (the refresh loop re-mints the access token)`),!i)throw new Error("credential: refusing to persist an unattributable token pair (no decodable sub in refresh or access token)");let a=ut(i),s=yt(a);return ge(s.refreshFile,e.refresh_token),ge(s.accessFile,e.access_token),{sub:i,segment:a}}var S$="__none__";function he(){let e=Sh();if(e)return yt(ut(e));let[t,r]=dt();return t&&!r?yt(t.segment):yt(S$)}function Th(e){let t;try{t=b$(x$.join(W,"users"),{withFileTypes:!0})}catch{return[]}let r=[];for(let o of t){if(!o.isDirectory())continue;let n;try{n=yt(o.name)}catch{continue}let i=O(n.refreshFile),a=i?Ze(i):null;if(e){if(!a)continue;r.push({sub:a,segment:o.name});continue}let s=a?null:O(n.accessFile),l=a??(s?Ze(s):null);l&&r.push({sub:l,segment:o.name})}return r}function dt(){return Th(!1)}function oa(){return Th(!0)}function _$(e=he()){return O(e.refreshFile)}function jo(e=he()){ue(e.accessFile),ue(e.refreshFile)}function $$(e=he()){let t=O(e.accessFile);if(!t)return null;try{let r=JSON.parse(Buffer.from(t.split(".")[1]??"","base64url").toString());return typeof r.exp=="number"?r.exp-Math.floor(Date.now()/1e3):null}catch{return null}}async function Tt(e,t=60,r,o=he()){let n=$$(o);if(n!==null&&n>t)return!0;let i=_$(o);if(!i)return n!==null&&n>0;try{return zo(await w$(e,i)),!0}catch(a){return r?.(`token refresh failed: ${a instanceof Error?a.message:String(a)}`),a instanceof qn&&(a.status===400||a.status===401)&&jo(o),!1}}function wl(e){return e==="node_superseded"?"This machine was unpaired when AC Bridge was set up on another computer \u2014 only one machine can be paired at a time. Run `acbridge pair` here to take the pairing back.":e==="node_revoked"?"This machine's pairing has been revoked. Run `acbridge pair` to set it up again.":null}import Sl from"node:path";function _l(e){if(!e)return!1;try{return e.available()}catch{return!1}}function $l(e){return _l(e)?"keyring":"file"}function I$(e){let{file:t,account:r}=e,o=()=>O(t);return{backend(){return $l(e.keyring)},read(){if(_l(e.keyring))try{let n=e.keyring.get(r);if(n!==null)return n;let i=o();if(i===null)return null;try{e.keyring.set(r,i),ue(t),e.index?.add(r)}catch{}return i}catch{}return o()},write(n){if(_l(e.keyring))try{e.keyring.set(r,n),ue(t),e.index?.add(r);return}catch{}ge(t,n,384)},delete(){if(e.keyring){try{e.keyring.delete(r)}catch{}e.index?.remove(r)}ue(t)}}}function _r(e,t,r){let o=e.providerSecretFile(t,r);return I$({keyring:Fo(),file:o,account:`${t}/${r}`,index:xh(Sl.join(Sl.dirname(Sl.dirname(o)),".keyring-index"))})}var A$="AC Bridge",In,E$=new Set(["win32","darwin"]);function Fo(e={}){if(In!==void 0)return In;In=null;let t=e.require??null;if(!E$.has(e.platform??process.platform))return In;try{let r=t??P$();if(!r)return In;let{Entry:o}=r("@napi-rs/keyring"),n=i=>new o(A$,i);In={available(){try{return n("__acb_probe__").getPassword(),!0}catch{return!1}},get:i=>n(i).getPassword(),set:(i,a)=>n(i).setPassword(a),delete:i=>{n(i).deletePassword()}}}catch{In=null}return In}function P$(){try{return typeof te=="function"?te:null}catch{return null}}import{spawnSync as C$}from"node:child_process";import{existsSync as T$}from"node:fs";import R$ from"node:os";import Rh from"node:path";function ia(e){if(e==="win32"){let r="irm https://claude.ai/install.ps1 | iex";return{file:"powershell",args:["-NoProfile","-ExecutionPolicy","Bypass","-Command",r],manualCommand:r,altCommands:["winget install Anthropic.ClaudeCode"]}}let t="curl -fsSL https://claude.ai/install.sh | bash";return{file:"sh",args:["-c",t],manualCommand:t,altCommands:[]}}function Oh(e,t){if(e==="win32"){let o=Rh.win32;return[o.join(t,".local","bin","claude.exe"),o.join(t,".claude","local","claude.exe")]}let r=Rh.posix;return[r.join(t,".local","bin","claude"),r.join(t,".claude","local","claude"),"/opt/homebrew/bin/claude","/usr/local/bin/claude"]}var Dh=/\.(cmd|bat)$/i,O$=/^\/mnt\/[a-z]\//i;function Nh(e){let t=e.split(/\r?\n/).map(a=>a.trim()).filter(Boolean);if(t.length===0)return null;let r=t.filter(a=>!O$.test(a)),o=r.length>0?r:t,n=o.find(a=>/\.exe$/i.test(a));if(n)return n;let i=o.find(a=>Dh.test(a));return i||(o[0]??null)}function aa(e){return Dh.test(e)?{file:"cmd.exe",argsPrefix:["/c",e]}:{file:e,argsPrefix:[]}}function Lh(e){let r=C$(e,e==="which"?["-a","claude"]:["claude"],{encoding:"utf8"});return{status:r.status??1,stdout:r.stdout??""}}function Uh(e,t){let r=t.home??R$.homedir(),o=t.fileExists??T$;for(let n of Oh(e,r))if(o(n))return n;return null}function An(e,t={}){let r=e?.trim();if(r)return aa(r);let o=t.platform??process.platform,n=t.runFinder??Lh,i=o==="win32"?"where":"which";try{let s=n(i);if(s.status===0){let l=Nh(s.stdout);if(l)return aa(l)}}catch{}let a=Uh(o,t);return aa(a||"claude")}function zh(e,t={}){if(e?.trim())return!0;let r=t.platform??process.platform,o=t.runFinder??Lh;try{let n=o(r==="win32"?"where":"which");if(n.status===0&&Nh(n.stdout)!==null)return!0}catch{}return Uh(r,t)!==null}import{spawnSync as D$}from"node:child_process";import{existsSync as jh,readdirSync as N$}from"node:fs";import Fh from"node:os";import ca from"node:path";var Mh=/\.(cmd|bat)$/i,L$=/^\/mnt\/[a-z]\//i;function U$(e){let t=e.split(/\r?\n/).map(a=>a.trim()).filter(Boolean);if(t.length===0)return null;let r=t.filter(a=>!L$.test(a)),o=r.length>0?r:t,n=o.find(a=>/\.exe$/i.test(a));if(n)return n;let i=o.find(a=>Mh.test(a));return i||(o[0]??null)}function sa(e){return Mh.test(e)?{file:"cmd.exe",argsPrefix:["/c",e]}:{file:e,argsPrefix:[]}}function z$(e,t,r=[]){if(e==="win32"){let n=ca.win32;return[n.join(t,"AppData","Roaming","npm","codex.cmd"),n.join(t,"AppData","Roaming","npm","codex.exe"),n.join(t,".local","bin","codex.exe")]}let o=ca.posix;return[...[...r].sort().reverse().map(n=>o.join(t,".nvm","versions","node",n,"bin","codex")),"/opt/homebrew/bin/codex","/usr/local/bin/codex",o.join(t,".local","bin","codex")]}function j$(e){try{return N$(ca.posix.join(e,".nvm","versions","node"))}catch{return[]}}function F$(e,t){let r=t.home??Fh.homedir(),o=t.fileExists??jh,n=e==="win32"?[]:(t.nodeVersions??j$)(r);for(let i of z$(e,r,n))if(o(i))return i;return null}function M$(e){let r=D$(e,e==="which"?["-a","codex"]:["codex"],{encoding:"utf8"});return{status:r.status??1,stdout:r.stdout??""}}function $r(e,t={}){let r=e?.trim();if(r)return sa(r);let o=t.platform??process.platform,n=t.runFinder??M$,i=o==="win32"?"where":"which";try{let s=n(i);if(s.status===0){let l=U$(s.stdout);if(l)return sa(l)}}catch{}let a=F$(o,t);return sa(a||"codex")}function la(e){let t=e?.home??Fh.homedir();return jh(ca.join(t,".codex","auth.json"))}import{spawnSync as B$}from"node:child_process";import{readFileSync as Bh}from"node:fs";import Hh from"node:path";function H$(e){try{let t=Number(Bh(e,"utf8").trim());return Number.isInteger(t)&&t>0?t:null}catch{return null}}function Z$(e){B$("pkill",["-f",e])}function G$(){try{return yl(Bh(Hh.join(W,Jn),"utf8"))?.pid??null}catch{return null}}function Zh(e={}){let t=e.platform??process.platform,r=e.pidFile??Mo,o=e.readPid??H$,n=e.readBeaconPid??G$,i=e.kill??(l=>process.kill(l)),a=e.sweep??Z$,s=o(r);if(s!==null&&n()===s)try{i(s)}catch{}if(t!=="win32"){for(let l of e.sweepPatterns??[])if(Hh.isAbsolute(l))try{a(l)}catch{}}}import{accessSync as W$,constants as V$,mkdtempSync as J$,readFileSync as q$,writeFileSync as Gh}from"node:fs";import K$ from"node:os";import ua from"node:path";var Ge="bridge",tt="alexa";function Kn(e=process.platform){switch(e){case"darwin":return"/Library/Application Support/ClaudeCode/managed-settings.json";case"win32":return"C:\\Program Files\\ClaudeCode\\managed-settings.json";default:return"/etc/claude-code/managed-settings.json"}}function Wh(e,t=!1){let r={...e};if(t){r.channelsEnabled=!0;let o={marketplace:Ge,plugin:tt},n=Array.isArray(e.allowedChannelPlugins)?[...e.allowedChannelPlugins]:[];n.some(i=>i.marketplace===o.marketplace&&i.plugin===o.plugin)||n.push(o),r.allowedChannelPlugins=n}return r}function Ir(e){return`'${e.replace(/'/g,"'\\''")}'`}function Ar(e){return`"${e}"`}function X$(e){return`'${e.replace(/'/g,"''")}'`}function Y$(e,t,r){return`mkdir -p ${Ir(e)} && install -m 0644 ${Ir(t)} ${Ir(r)}`}function Al(e,t){return(e==="win32"?ua.win32:ua.posix).dirname(t)}function Q$(e,t,r){let o=Al(e,r);return e==="win32"?`md ${Ar(o)} 2>nul & copy /y ${Ar(t)} ${Ar(r)}`:Y$(o,t,r)}function eI(e,t){return e==="darwin"?[{method:"osascript",file:"osascript",args:["-e",`do shell script "${t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}" with administrator privileges`]}]:e==="win32"?[{method:"uac",file:"powershell",args:["-NoProfile","-Command",`Start-Process -Verb RunAs -Wait -FilePath cmd.exe -ArgumentList '/c',${X$(t)}`]}]:[{method:"pkexec",file:"pkexec",args:["sh","-c",t]},{method:"sudo",file:"sudo",args:["sh","-c",t]}]}function Vh(e,t,r){return eI(e,Q$(e,t,r))}function Jh(e,t,r){let o=Al(e,r);return e==="win32"?`md ${Ar(o)} & copy /y ${Ar(t)} ${Ar(r)}`:`sudo mkdir -p ${Ir(o)} && sudo install -m 0644 ${Ir(t)} ${Ir(r)}`}function tI(e){try{return q$(e,"utf8")}catch{return""}}function nI(e){try{return W$(e,V$.W_OK),!0}catch{return!1}}function rI(e,t){Gh(e,t,{mode:420})}function oI(e,t,r){let o=t(e),n={};try{n=JSON.parse(o)}catch{}let i=Wh(n,r),a=JSON.stringify(i,null,2)+`
|
|
14
|
-
`;return!r&&JSON.stringify(i)===JSON.stringify(n)?{existing:n,json:a,changed:!1}:{existing:n,json:a,changed:o.trim()!==a.trim()}}function
|
|
15
|
-
${
|
|
16
|
-
${s.out}`);i=!0}let a=!1;if(i||!
|
|
17
|
-
${s.out}`);a=!0}return{marketplaceRepointed:i,pluginReinstalled:a}}import{mkdirSync as
|
|
18
|
-
`;try{if(
|
|
19
|
-
`}function
|
|
20
|
-
`,384),o}import{createHash as oA,randomBytes as Pv}from"node:crypto";var jl=e=>e.toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");function Cv(){let e=jl(Pv(32)),t=jl(oA("sha256").update(e).digest());return{verifier:e,challenge:t}}function Tv(){return jl(Pv(24))}var iA="https://api.workos.com";var aA="client_01KW2CY31D0NZKCDKNHF2XQ7VC",sA="org_01KW0DNZ14H6JMK8RHA0WSKNVZ";function Rv(e=t=>process.env[t]){let t=e("WORKOS_CLIENT_ID")??aA,r=Number(e("WORKOS_REDIRECT_PORT")??8765)||8765,o=(e("WORKOS_API_HOST")??iA).replace(/\/+$/,""),n=e("WORKOS_REDIRECT_URI")??`http://127.0.0.1:${r}/callback`;return{clientId:t,apiHost:o,redirectUri:n,port:r,organizationId:e("WORKOS_ORG_ID")??sA,configured:!!t}}var cA={google:"GoogleOAuth",github:"GitHubOAuth",microsoft:"MicrosoftOAuth"},ya=class extends Error{constructor(r,o){super(o);this.kind=r;this.name="AuthError"}kind};function ba({cfg:e,opts:t,state:r,codeChallenge:o}){let n=new URL(`${e.apiHost}/user_management/authorize`),i=n.searchParams;return i.set("response_type","code"),i.set("client_id",e.clientId),i.set("redirect_uri",e.redirectUri),i.set("state",r),i.set("code_challenge",o),i.set("code_challenge_method","S256"),t.provider==="google"||t.provider==="github"||t.provider==="microsoft"?i.set("provider",cA[t.provider]):(i.set("provider","authkit"),t.screenHint&&i.set("screen_hint",t.screenHint),t.provider==="sso"&&e.organizationId&&i.set("organization_id",e.organizationId),t.email&&i.set("login_hint",t.email)),n.toString()}function lA(e){return{id:e.id,email:e.email,firstName:e.first_name,lastName:e.last_name,profilePictureUrl:e.profile_picture_url}}async function uA(e,t,r){try{return await r(`${e.apiHost}/user_management/authenticate`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({client_id:e.clientId,...t})})}catch(o){throw new ya("network",o instanceof Error?o.message:"Network error reaching WorkOS.")}}async function dA(e,t,r){let o=await uA(e,t,r),n=await o.text().catch(()=>"");if(!o.ok)throw new ya("rejected",`WorkOS ${o.status}: ${pA(n)}`);let i=JSON.parse(n);return{user:lA(i.user),accessToken:i.access_token,refreshToken:i.refresh_token}}function Ov(e,t,r,o=fetch){return dA(e,{grant_type:"authorization_code",code:t,code_verifier:r},o)}function pA(e){try{let t=JSON.parse(e);return t.error_description??t.message??t.error??e.slice(0,200)}catch{return e.slice(0,200)||"request failed"}}import{createServer as yA}from"node:http";var Cr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAD9CAYAAABTCakVAAA+DElEQVR42u1dd7wdVfFP6L0pTUoABZGqIB1CBAICQghpgCACIQgo6E8RUEKNoCDFghCUngoSVARBQoBEaSKELkoHAUFqSPLevbs7vz3cOb5z550yZ+/e93bvnj/m85LbdveU75nynZkBADAgSJAg1ZQwCEGCBAAIUlJZNJV1U9k2leGpHJbK91P5TSrTU7kjlRdTeT+Vhal0p1JHiZR/C+lK5YNUnk/lIfzuTalMTuWXqXwzlRGp7JHKZ1JZPIx/AIAgfSNLp7JbKl9L5XLcmC/ipq7hxu7Cvwvx32KDx7i5Y0US5W+i/D/WfE6CRE25Tg1fE//+MJV/Idj8NJWvprJXKiuGOQsAECSbLJ/KvqmcmcqMVN5UTmwpiWZDS4kMr9PvJBoQcL2u/k5kAA8JHP9J5XepTEhl71SWCHMbACBIb1kfT06htv9TObEj8ld3gseWUzxhfIcrLgDRaRQR0UKEVjI7lXNT2RO1mjD/AQAqJ+IkPCiVSam8ihukptjisWXzuTZjbPl+3hIzNAodeMnnXJDKozgOh6eySlgbAQA6VdZJ5RhUiRcqKr3tpE4YQBAZQCE2gELcwkZPmKaES/OINc8gAHA+mjzjUvlkWDMBAMosn0CPvPCeP6ac8DFRjxOGeh47bHGfU7mV0z7JYErEjN+i5o50OArt4LJUxiCAhnUVAKDQMjCVoRg2W6g5nblqeZzRNk+Ym1+8Dxk3fxatwgVgNr+F6vi8FSMMi4S1FgCgSCLi8Gen8pISMos04TfI4cT0OZld1wNozfbPw88QM8yMmDgTX0nlrFTWCmsvAEB/EnBGp3IXcd6Z4ul5ONVsm76dTr/Y42TP8l2T38IU6pTgKrSs36YyBLWvsC4DAPSJmj8OvfcR8XKbNnTUYijO9p3IQejhnN6tOgFjyO4ETCwbPbGAKvWlCDLSiaksFdZoAIB2yOLoxX9GUfFdaisNg0EG1TpxgEfEDAXqfg8yqvxxBhMlZpgtNm6DbWwjJarybCpHBZpyAIC8ZMlUvqfE613U2azEGd1nIaeTOWaYDe0yEbjhQpcJYHIWRobXXsGciEA2CgCQmazzbdz4NQ0FN3FQbaknuxWnWWRQ9yWpJnFsklY2MUcLyeIHcAFXFqG/LcbmjVROChpBAACurJTKaam8rsmaa3WxZnUAxuDnjc8rxOgr0AIPgKMB+DgQqcPwDeRkfDqs8QAAOhHOo9MxbTYyeJ5jhvoaW2xV7gkaA98J6Lpeqw5An1i+Dgg4Dj+OEzDxAFnbs3dh1uLKYc0HAJByOKbWdms2D01q4XiubTx4zsbgpuq6Tr88Tn3XaZvVqcl9Bs64+mhXkpH5VionYDg3AEBFZQdoFL6IDIvK5M3P4gRsxRa3/XakkTqJVNQNn7P9hqo+14k5FFl+z9dM4ZgAEUPb0WlsLjMrRuD/cgCAasmKmHpbJ4s9Ypw4rhPMFqvmbmrXe+rG7Fb486JuwKxUrk/lJ6kcm8pIaBQS+RzmJ7hotAPRASpqEmwAjeo/e+LviPDa+Uh1vg3t6roCOImn6dKKBpB4Oj1ddOObUxkUAKDzZTcMEdUZarqNzBNnVNu54TAdgIh/z0vl9lSuwQ05GDdrf3m5F0tlM0zY+TU0yoh9BM3VhGynNjf27wMeiQVUIsP91PC+T4GKFS6pEoPvuxY731VIw+VY82X6xZpQX0ROd7Eo70vlEmjUD/hsicZ7TWjUKDwbk3i68HlisFc1ckUKErKJI+BXPeJEWsQ9/qVKeQZVeEixcf4KPXXyIsbm57zPobuakoHod2tKost1qRzaYTnxK6AZIUJxTxv8LlwWYpYcBI45kijzIMqZfS0AQPkTds6ARuWZmkEd5XjZIyb1l2NzUqebSGj5YypHp7JxhVRPWSDlD4p2QB2QrRCBXCaAaa7qxJEqCrisEQCgfCKKaj5l8G5zNr6PeeBagJSv/g90pu0KoVCmrHi8OzounyYRh9ihsXFCnjFT09CZF0LeSWU8+loCAJSAu389OVHqHqE+HycgJ1NNXltQin+cyoZhwztlA2RjPkfGkGuy2cwzFylLt0YkIL2cyk4BAIory6AXmtbbizRkHl+GmcleNYGKDNFNwzBayFfP5rj9MppI3QbzIAIeNyO2mHEmDUAnwlw5IABA8UR0qnmCbH4TAEQWGz9h2I6xIzVVLJILUvlU2MS5agW/UYDAh2XJIRu5AF2+JxuwfCMAQHFkWCrvWSiiNB6dWMJKJvtdx56jav6b6HQM5a3b20PhYujpiOTiGiSO9OHEcVjQ79cV3sBVnUAlLvuC+D64y3HFnj6A2JEMpP5fLATRS+94NEHCJu0bEXF60XHoXYVfkEUL8DUB6PsPlJ0zUOZ8/SmWEyCxoLor2YdjAsgyVMciGy5syv6RldFD/4EjIsAtaRaBu0IxPQBEPsF2AQD6tub+3YwMMWoCRB48APqeSh1+E0/8UJ66OLIqpvl2KTF8myPQpgFETE0yIX6fkQEA2i9DEXE5seHYQubh5pOrAPAqhqdCLnlxRYRZL0WfkIub0YoJoAOVbrz2CgEA2iMjNCG+VjSAyJEgIr/3dionB9JO6UyDCw18EB8nIEcDoKFfUZh09QAA+YpgzX0I7vp6WZ2AOi+/mNArUlktbKjSyuaYB1LXRIISh53v0iRt0aTZSEoLAJCD7I9psN2GSeSq/xFzUsW/56aybdhAHSNHo+8mYmYeRox1lIC9TPkdZTAHij5xI3Hj22ywLCZAonlfOo9+FjZMR4rQ5GYqZkFiiAL4agCRhWMwu+ggUPTNXwNe+a3YAQARAwBEnbhRYaN0tCyGiVj1DExAV2k4U9n2hzFyFQDAU+3v1iBs5AkAsQMA5OafUibHTZCW5YsKdZzjK0rA3NbdlYMgrvFoUddXUTf/QgcyJx5RAN3ESjrnf8savw2SSyn4X5FsQ1u5MhNARMCrTfA48hUCAFhEZH99pJz+Ols/yagB1Mlr9yO3PGyGasvB6GSOHGHAyOKDShwORskanFs0HknRQn0fgbmKblYNQJ1UMQmi3NO3ApMviCIic/Nq6F2ZyIcH4GIZSiez4AmsGQCgWdbDjRkxHX1ZnIBiAp6BChV8DOIteyssQheblOME1OWciHV4b1EOoKKg7/OErBF58rhtoRuJvKIU1zolXZiiQOghqexVwHsbginZnVL0ZDeFdFZ3rEFuiTLqjBa/e20AAIBlU3nMwcpztehKQF8ySr4m/Al3lThPX9iMLysL54KC2c9yXm7tsCjBq5owtIkHwKkPqStMc2HVAeBmaG5jZVKnIk8noKr6i042ZWkPPQb9E2oX2xPI4pmnUR/bnZIs4tjfSWUcgrZ8/XZlzAXQbqa8JzSWK6HRe7GMILA2moy+TEAuAMQY7Tq8qgDwc4fqngC/SaeumqtYkD8u0YI7X0koeU+JG19Dnq1biV6ISrVzFOfSlm26t/vxGjVkt8nX34XmphpfwdePUUyvGmZxlhEEhNY4yxEh8AWAmDgGBQjsWTUAOMJCqOC24jY1i5De/mNKtNAGIhNRJScdgu9N1jyb3OjHQ3MT0NltuLdBmhCq9KXMh+bOuwcomoFaY//0kvMFfmehk+sqSbkAgB5eIuN0g6oAwM5KYg+3BTU3DCg3yEElW2QraUJQ4/G9SeT5xNhtje9NI4tyfhvMgcGElyGutx/RAOS97Y6v/5OcmD8hv1m2EKyo/XdVRhMgYSQYibl/qj/yBvp6IHdA9p0LKTmluyjdUvx9HQGmDE6mbRXP+Wc0DqLx+P55mqjGevi9O8l4LVDCnOK7h0GjbiK3H4HognMuOhpH4Gs7aZxhwxTTQNUApO/iBaLN/ERRqX+HgPIMrocyaWmnQqP6T8JMBuIUplFBYHZfE4X6cgAHKWpuzNj8piytxAAOwpbasQQLaSpOttgE1yljQxeH1AC2VgCujhx2+VtzSOh0gaJKTsBrCPkAeHUNHlFU3W6kZUuNTTU1hivMTfnedcrvPEFMgFPx9ZOIpnNPCU2C77WgAego6THxl9zZlyHVvszC+hu4mzP4OgHl4ImFv29JPMsRcVSKjbmcspEkH+I4ooYLFfQK5fQfgKE31ZQS47AivvcOMYuOYPAxIqJpTMLrdUFzy64toLlC7xCyaK/E55GLem98/SriT/hvSf0C1xjCepwu05HhNTUl/cxOA4ATLCc4tye8CRy6lROp6LIX0WhquLnFe38hC2Ebxu9dRjSAV5X3FhL1fLzjtzbSgOvviabRjeq9y4bfAL8jNL6J0FM//3qyDt4rKQAsgv4XUyKRSwPQ5bhQzWDLTgGAldA2j0j6JZdNZSvqGJXM4bc/meganp6yoKVQwd9P5RLm722KJ70Ek2OVBTqfhJvOdfzWJhqQvlmx3Segb2A9T7tZ/f+15BpvlDg6IMZ4BsMH4HICmnwDd3YKAFznoPJyQoG65h3dGAYr06IZrgGAXXMg6QxDx6L6ek0BSfHvcxy/s5lmzG/J+fnPg+b2XnM6IKV4jobMxuEB2DJW5XePKDsAjAG/fu4ub6qKmD8q4YL5EvSuUrtem67VRez5sxnaBNWy/tiG6If0DdQZoFSWUmPPgr1DkU3Vt7EM32l3/ko7B2YtJeRnqsHmovOasqmuL+liWRo98vJZ/t7Ga3WTsZvA1ADaCQDyOqcgBbZTuiqtm8prFie3LlyYMGjGAlRuKysA3Gng87uce7Z6AGLzz4RyN2UUYb0HU3kolc+38To1spBcGsDmmgV4R0gRZstWmKdhWuOcdOJIE/4Wa/6osgHAGZpUSo7t79IAZqFTMSw4PgBIJ+AEBgBQs+tPYRy9U6PfAX7FYZcJIF8TWuP2ZQGAHZRQlqnvmg0IdBqA+K0XMfmligtrdXR4HknUZuGd/y2mC4u2VMtoTACuE3BzzYINGoC/DAV9NeuICQIm7eAlkolZSABYAimeNjXeRQDSaQACAEZXYPGIbLqRhLUnNv/zCknkUuU9lVlXQ16AzgnIMQE20SzO28OGzpzpWnfQ2WNNlqGt7ZiYw4uKDgBngbkza9ayXmJQpldg0ZyrUIRfg55a8t8mlFGhDsr6BjeTBfU2AQCVLenSAHRRgAAA2Ss4/VuTRanrQmV6j/q+pD9g66ICwHqEfRYznYA2TrV44H9VQPUXav1HyjPXMYQq2XPq+HRh0o54by5570OFpbeAUIHPYnjn6YK8K2zmzLIHyXuIHMlAJicgPRDvLyoA3AT6cl6JJ82Xqj7bV2CxbESyGsUY/hB66gHQfgYb4XtPk037rsK+W0CYgGcxNACqgs4MG7klOUc5vaMMPADTnhhbNAD4Apg78CSOTL/EMhgndejC2IVkLm6nbG41HZgCgGRAfg7fm01MrhctuQAuH8CWGhMgOAFbTyGeA/py4z4mAN0vL0NOZe7yetCrHCm7nI6sMckhv69DF8X1iq1/uhJDrpNxOA3fu5SMjTABZOGIX5DFdZNynQWeTMAtNCGoAACty/qE/MVpX+dyjou/hxYFADYhpw2nMIKLL/0SlLeEt002JJmA7yOSr6ikzsr3xykbc4FCn51E8gAuRFv9JjJmCwiZ5BwmAAQnYP4yTJk/Uz0AW99BnVn9FORQWSmPh/sruJtwJgbtQEeJFCfjzh26EA7QTOyqRJ2XabeDCNX05FS+6sGCnE+YgC4i0KYaDeDOsHlzkx+BuQK2jxNQfe//+hsAdteEOmIL3TF2RALqmD/eqYvgMM14yY0uCnL8EhoVg4blcK0FxAdwDkOTo/ZpMAHy5cg8RXw2Lh6AK9X4DUL+6nMAeJC50W0AoLIERfx75Q5eBMcQAKiTkz5PWUCYgC4fwGZ9mAswsKIgsCM0l1eLDAxYsDgBgRyY3+8vANg9Q0afyUEo7dRvdvgCOA56NyttFwDMJ0BzFkMDoDbon9vAd5iEPqOnlHBmleQqgy+A4wTURc7+Cy10vWrlQWYT50SU0QSQn3mmApN/HNEABACs3eJvrogU4nUtJgAnCvA5DUst72Sgo0mo84YKAsAncNNGYK4IZCPK6ajFZ/Q1AOxKsv04JkBkAQC1nFUny+EapmMrDSE2RvpvhCzAbTUAwE0G2lQzZ2q/v3UUenJWmUJA5uGKmgIXMjSAxLJf6PtvZfUFZH2AWzXJDhGD7GP69zvQU822k+Vg6N0ldg3l/UGYTbYU8/cuJuzBqcp7H3maABtrnIC3KHkKXWi/XsG8t8Whdyny28g1nqwoAKwHzaXRspgA9HA9pa8AYEdiw5jKdrmcgOrnD6/IxO9P1D5hCy+tqMeyjr9IJFkLehdXpbbe3WS8n7f4AFwawLoayul0dMp2EdByNfQQ/oQX8FnmQk8vwxtJmvgDFY4KjCdJPnXgtR9PDAfrW1kc6Flu/B7gNem0OQFVraFKsealka8v4/0PKe+9Rk7zccp7VyosQLVQ5FwCpO8RDcAnCrAYLiLVQXk+9NR3UOf3cOV5LsasRLUB6NWgbwxygRILT9AkqDJN+HFCEOIyAU0AcXa7AWAT6F3swMcJqIv7f75iEy9i/K8gb3+ospFq5HQcr/hbasp4CXNpSXzvMbI531Ku8yEhAp3FuDeRgTgPf1MkGq0JjUKmdM5PhOYqvzW8L1mt6WGyqC+EnjqRTynPsWOFAUDI3tDTJ9PGBOT20xAHwLLtBIDziRc78TABdOrNbRVfAFLW1rDEZJ7AEdC7pfSu0FMPQN2cswgA+KQDq1qKWql4Gw15RWonc4jJcADSU/9BDoWfayIOq4V5/1gLuE+TLMTlz+j22YntAoDF0eOctYOvTrYLi+BjWVnRAGgy0MmabMC9lbBit7LJVR7Fm8qCqilqeJZIA2UvSqbic+T1w/D1R4nP4MIwx0bZTfGxxBlNAPW1J9oFAEdCc62/xFMDoNGCe8LkN50E/yGq4LeUnHKaK7G38j3hoZ+hcfLNVuar3oKjdRGMW0uAWqhEbF4kGoC8xlToKWMl/n4nzLFV7mM4AROHE1A194a0AwDuz3DKJ4bEhrrPTVZELlI2q9jkstX2DzQawO6M3xuCm7WG0YFWKNZ7obovnFaHKK8/S7QM+d4ueO1uNEU2CPPrTBJTfQGmZCCVCpwYXo98nKvcG/y0JlRhcgK6CAwRqohh4nvb3mchVXYf5fV9yfgKJx23RJqoM/A1aF8p9RkkpfWLJLdAtEJbPcwtSx6F5u5CcUYNQIaXV8oTAM4Ce+8+lwmQkBNsbIkn6gvovBQ02QP7yDy4UQHgiwo0Ftsh41Dc1+Q2/P46mCEpOhR9vcMBYCz0VHLmOgFtPTa+mRcACBvwZQYycSoCxag2lrUl1Epoq6v2+MF9dO3PIvgUkdu+A+RQnILIIEx3VYkywzsYABZFB14E7ma5CQMYnsgLAHYAfaMDHx+A+tq4kttqNZLMc2NQX9siY6B3Qc3LOvyZDyVcEO6e0gGA0Ca2zgMATgFzDbPEkgtAMwUl+WPZEk/QCPJcdaTjhg2bvxyhWU+/6vBnXhKZopwQIMfXdlIeAHArmIsZcpmAEgB+VvIJGqlJ550VNmtb5EhNyuxlFXjun4C5VZ6LB+Dd25Fjl3yUgZesK23UjV7pASXXAGhFnwAA7ZGjKqgBSOJVxMytSRwawPvgqL7kupk9wK9CiekzUYekfo7SmDYBANqnAdTJZri0Is/+gMehq9v8oIzZkFYA4CImP9lVFFRM5A87BAAoLTa0z2qfD6BOAPdXFXn24zScG1voz/S60+x23cgLLfL91RvZsAMmZqTGCRg0gPbFxWmzlKoAwKqGyBt386vyelYA2JLw/mNH+CEGc0+AhzpkYlQnYOIwAb6AefGisu5Ehdob8h4a9v0MdDCfaLBTx2ocYJdVaJxuA7+CIDYtYHAWADgH3HX/OBqAmMAzO2RSdGFAXQNNWlxDfO4lJY+/ynIqGRfhHB4P+gKiND/+8gqN07csuQDgoQHUbcBpu4F7wa88UWwIF9aZyStlcgK6fABfhObqt3KxbxUA4OMWZlSbnKT53DhNNKlKAPAFhh/AlCREowH/8gWAJZUcZY6X38YDEL+zRIeaACYNYHeF1x0rqbE7BwD4mNdP28VNtmgA6hqbWDFT6S0LvT5magEy/2ZjHwDYHfzKftsAopOYcqM02s1s0Jd6opxu8dkdAwA0AYA8OK51AEBcQR+AkCtIhqAPE5ACwPE+AHAS9FSa4fgATMlAQr7bQRMymkkF3kfjwQ4A0JBbNABwjcUJGFcwDKjWj6xlTAaiXbem+wDAjdC77r9L9TD1Pd+iwzQA2j3nboMGQMM44v87BQD4GADomrmOaQJUTQNYSmOK+4o8fN70AYCXDASgxJGeSCfsvZIMtEhl3QtlMYYJoA6srrTZVzTqa/AB9JgA1LdkAgBKBJroSKTZ3xbyKqncZ9hv3ChAoozj2hwAWMGgdnDSE6nde1MJBlhU4rkfkbbuYPaN1vAAdBrAfmhCqaBYd2gAh0Ojlt6vkYNRtoX6DaSwigV7gocPwAQAR5GxtmkAq6CnW9YNmNFBADCBaJO+IKBGoQ7hAMC+wOvuYwtLyIV/dAkG+Dzo3ZxhFwcTMHZoAF/WUIbFNXY1/O4l0NxIQ4DRtiVapIeQcRHP+gMHwcXlBByr0aImMijrcl727BAA2I5hjrtMADk2V3EA4FTI3qmUOr3WLMEAT9EknRzISAaS6HqvwwmodtoxqacLNOBZptyJszWnzhyPKMA1Fg2AwwScqll/B3aQFvBWCxqAugb/yQGASRang0868GslGVwfABjZghOwbtEsapoJG++4b9FYYwyaG4u2aWw+hb+/vuNzP9Zkoj1oAQC6ZlwagIsINF2zNjupfNh0jRbgwwNQNbMlXQDwACP/WOeUiMhpV5a+b1M16rpLA1A/e49BA4g8AYBqWKdZ7llsSLWPwKPou8lzXA6CRnVZaVfbinJeonE6/Q3sBWa4PICIYQJMJwBe7zAN4FiDGcBtH15X+AC72gBgIE461wGoYwJKAPh2SQZ3GlE1bQDAdQLuS5yAclHu7NAA1HG1aQDXE62lDvbGkKIn3y/xXoW6vZFjTARz80Ny7/PA3M7rIs3C+3uLADBW4wS8nGECyHnpJA1gGzA35YmZp7/cl0fZAGAdcPf+c5kAkvY6tEQAwLUfR2mcTXcZTIC6JmS4s0MD4ALA3Zr7mGIJcT4Dzf3n3nWo9dtr7qeG5oDu8xdr1sLDHkQgUxSAywScrtG2OkkDWBQdw75EoFgTiZpoA4D9wF7Xn5MOLJFmqQ7UAKgT0AQA+3oyAWsam85mAswm6nEdn0P32d1AX7D1R5bf30UzvzXo6Qno0gAiSwr4Hzw0AHrPJgC4QfPZTish/pAm8ScmvpfEwc+powZmBICxFu4xBwDkxV4p0cBOzWACqAv9LgMRqJuMifjeDjmZAH8hExvhc5hSmBOiItd1ISFFdjZoAMM9TIC/WQCA4wQ8yoMJWAUAuI5hArhC80LetgHAZR5xfhPS1EpGxNDZjzYAoKf6TEsyELW/BudkAszR3IdJAzhYo0rrWnar8iUDk3E40wlo0wCy+ABcNQFv7HAn4ABM5vF1AtIeg7I47+ImALgZeH3KbeBQw7BQGTUA1+kxRqMBzPTgAZiYgN2eGsBs6F10ZaoDtGgSkw0ABmvmW9zjATmYALd6EoHU+760whrAUA8noK3NeITkIi0APMtwLrhMALFQvlqQQVuVEcOeolk8HB6AywlY0zgBTUzAumZcuQDg0gBGGyI2tgq7O3maABdrAOCRFpmAPk7AGzXz4gIAQVL7LOTf0qxdsrwhRd+nX6Ccx1EmAOhibPCEYQLs1s+DtRguKqkOPoShMJsJEDFCSCM1TMBZDB6AvI/BDCJQwnAC3qsBgKmWe6YORpcGsC3o+87bACBmAsCfNCbANcwwYB4+ALHhr1aiIg+VhLE6AEOztuo/nFCgGNNv6QBgCeA3IlAFNAizXD8P1ClK3LSGWslMDwCwaQCUB2CKAujSgXexaAAU0cd7AEBk0QD2NSwEWxRgK8PJwTUBYgcRiK4lbj0AEwD81oMHcJSS+CVrEv6pJABwb4tMwIRGU6hKFEG25p+0N/nAfh6oyeS0qyGRxUYFVjfHCKYTMAJ7RSBqAgx2AEDCNAFmaSZ1uuGzK6DnV130kUNL28oQBrRFAWImANzG1AB8OgPdqDnlhltIVFRbmV8SU2BGC7kA6rqdqgOAnYjjygUAprTDZwrC76eLbH4OVODRmpNmtsEEqJGxtGkA3ZrxtZkAMzUm2VTL5wW/4w1l87sKa2wIvQtS2ohAOicgVwOIUCXnhAE5AODyAUzRzGGTZ7zAclUOPoAI8zF6AcB+BAC4KgWd+FsL4tmnzRUXeJgAIxhEoNgjGShyAEDNEwCmkPTlGrjbZi2GKbIbM8ZvWQRM9RpCg9jE8PkLPUwAbk1AHxPgRrImbQAwSWPGdUE5SrYfn4MJIP4+rgOA0WBu7WVr/kk1gKkF0wCkSugCAG4ykDo2NU8egIkK3OUJAOvjid6N8lwq6+Y8hkfib8taCTaT5EKNymkDgDrwawJy0oFv0PAAhjPMQ7VoZhmYq6OZxB+XCfCeDgDGgr4rqU9Z8DoUo3TzFA1gfZQDD2A09O4O/GeDCdCtSZAyUYEXegKADHHuhlpFu04vETn5MiN56KceGsAt5PTl+AA46cARUwOYrNEAukuiAQz11ABMZntNBwAToHdJL18egPj+D9o4ACJZaQjGRNuhASQeGoAEgHvBXlWJ4wTs0gDq6SUiqZwPvYtQ2jQAGko1pQPTMOBESxQgJvM9wmEeqvfb5dAAVsO5W7qfx3mDHHwAcoyWoABwuUMDcAGAHPjD2/TwslR5HVWYYY4oANcJOK1FJ+C9BqebLhloV4cGkDCZgEWTczycgH/UHDRcE+ByBwBwIjnTNQBkMgFEFt4VCBDi1BSVefqzy9WyjJwczn6NZWq3+uPXGOx+Xw1gRJtO/nnQXKz0fTAXwZhMwMwVBeDyAEZrGGezGNmArpqAdxFzQXxnXIkA4GCNTT2J6QT0SQa6nOkEtM3hVEMUYBmwFyaVc/hkP47zIsw96soXEP/fggLAlBZNAKkBDGvDgx9A7HRpx+zgmGSOCeBTD4A6YeoWJqCOSDPYkn//usJZEG3ZVykRAAxER+B8hV03yOID4PIAqBZlqwhEta0RlvmmG6gbT1cdZ4Dea1c/j3U3+FcE0jkOd6QAMJVB9EkcpkEdnUbtaMhRI6pbt+VEzcID8NEAXOnA+2pi+7aSYEJWxOseWABbs5XCFa57b0UDmGiJAnA1gGmaOawbNIBJGodldz+P8QcZiEC6zw2lADCNucldJsBObQYAVQPYmekEtPEAfJKBuJ2B9tE4sEJjkNYrArlMAI4pOkXDBOw20NenaBy5/Q0A72RIB9Z95isUAKaDu/S3ywQQ8vkM6uNyDvowDb+5TIApmgWxgMEEzKIBzHJEAaIAAL0AgFKfr2MkA0UWALhBsz5tGoCOB7CchTMQk3z6AQ5NbrM2UotfBf/WYDrezjAOAGQJA27u8TBnQKO6rbCrXsSNY9p4NY39vTMDACIlRyFPAIgtJsA+4FcWvGqtweg6u57JBJyYoxOQAsDyDtIQBwAuwoNGzP2/MXks7/F7oUUmoBEAbmD6AChAALGltvJkNdEkjk+DvhBHpCF77MSYZI4GQNV6k/o4RrOpTZ2BdBzsIQEAtE7ASeCuCMSNAriKgk7TcC5qeHLbOAMuJ+AI4ktK8NDJ25n7HGSvCKTu42G+PgCXdiA38DbMB7laY+N1YbxfV6NeFwXgAkDskQtgaypxkOZ3ZzFyAeTiGRwAAH6vWUuTGCaAiwocM/040zQaQN2gAeh8SSYN4DLNGu1qQ1TseQYdmOMEPMAUBWjFBKh72Lk3GUJll1hMAAoAO+bABJyiASJuOrApDLgn6MuC7xoA4H/jrcpkCxMwYWgA0z2IQFM1fpyaAQB0mmQN7L0aYhKpOjjn8Xvd8/Q3gcRwHQ+AowEkDgDYg/kgNxgAYALYC3FwnYBZwoAcJiD1Q+hMgD0MTMDgA2g0jKlBcw8J3ZyP0zgLObkAHA1AFwVYlmkCdDM02kTRAA7KefzmGTY5eJKBepkA13smGJhMgH2YD3Ia6CvP7sPkAbh8ADRzcT4jtTZLWXCdBrAb0Vjk2GwXAOBj77ikX3fh+C1vAAC6oSbmZALU2wAAJ2vutx1zvjAHHkCMdPUBlPQQQWtFQesens9PYkhDppwKmW0IB442+AB2ZEYBuCaACwDGaNR6HQBsQRJ85En3qQAA/5NlHBl4R3jwAKZD76rHIxiHgysKoAMAkwmwBuYKdClr7u9tGLeoxWQg+Z39TclACZgrAuk0ABoFOMLjYcSGuAAaNdl+asnIGmmwqbdnePa5UQCuCUC1kJkGbsMsaK5LeGfY9F5yhEcuwDTNfI9gmAuuXADdOrKFAbfC9HBRq+FSTNnOm2kZEXU/azLQXhQAxmfMBQCCkKe2YTEcmNEJGDN4AFM0UQCf1mAzLQQn8Tun4GJcImxqL9ExAV25AFwNIGKaADo+Sa0fx2QFzwiAzV+3AwWAozUDbutHbjIB2lEQZJjGqWYLA/pQgXW5ALbGIJzegEFal7Gak9pVEShh8ACma0hDXQYNYIom+7M/qcDbeHj+bfT9WPJtbPYtN55IqcCT2/Dg+0FzfbqYSQTi1ASc4hEFoJ2B6kG1bzsAcKIAPk7A6ZroQpdBA5isCSf3ZzbgMOCn7LtMgOUoAIwAfYca32SgdtRYXx9V+Drh1q8O7oIgeQIAlwcQpHXRaaRXMAHApyJQZAGA88i6qCERp7/GZIzG/s/iAxDjsxgFgD01PgCf/oByo7WrM/A06ClQKa5zJYNsEjN4AD5hwDGa3w0mQN+YANx0YJcTcJrGtKgZ0pjXhkZPhUhR/8/vxzH5bsZMQLpn/3cY0lM2An6RAdN7C9v08CJkdCii8n6ObCtfJ6CPBsCpBxCkbwFgukcykKkvgKmOwSCMVF2HDu7+rB48sUUAkK+9AobWYHXw7wwE5H3xGysVhG7KSeLwKQo6RqM+3h02a9sBgEsFTpgaQKLxASxTgjH5rWbP+VKBxb/n6ABAsow4BUFtSNNdAM67zgToytEECBpA34YBXclA04Ff1m26IR24DFWYHgG/1mCmCMANJgB4y4MDYGsPPrpAABA5wje+yUA0JTk4AdvrBEw8fACcsuCTNSDeVRIAWGjQun3SgZt6LNILzAR3D0BXFEAM/o/6eaCu0ywIrg+gzggDxo5cgCD5RgGytAc3zeEkDbDMR5ZdkcdjQ4vZzQkBqib6WBMATAJ98QAfDUBcYEY/D9ZoEi7stsTrJ0PvRpgcHkAcAKAwGsB0jc/HNIeHE1+XWB93lGA8DsF7baU3YEwT9uhFTrX4ALhhQCH/LMCAfTOVp6DREuxuDOnYNABOCOkg4FUECpKPE7AO/q3B5BzaktLOTuW/qBUKrXfNEozHhY7T3qYBUC7DeiYAGKXJu/dtD160dsuu4oyTPZyABwGvMUjWRI8NoBxtqvvKCUiB+TJHFIDT4VnN1Vi0ROPxO9B37eb661Qf3SImANgZmktZJRlNAHGRL5VkYCdncALmTQUWSU0v4m+Lv5sGAPBKBroBeteWPLDDxuNtpgZgqgosgfFx9XfpRZa2cAE4FYHUjKlvl2Rgp0Dv4h3DPaIAM3O4hzuU3+1GtA8mQG/vtY8JMLyDxmJt6F1uzLczkDycp9kAYACyhCLLho8NDgjaCnt6iQCA2x58lEYtbVUDGIheaBVA3woA4N0ZqJMBYCT0rjjs8gPo+niI75/pAoAbQV8QhGsCyO++UGIAaLU5qI8srUll7QoAAEdCa70BOwkALlDWSJZkoMjE0dFd7AwwVwTiOAHVSdikQwFAfeY/t3j9ZUlosY6RC7XUlKguIxpqTCgJZTXPikCc9uDTOlwDeNDhl+NsfgkA67sA4MsZIwFU1RByUgkG91porjXgqwG0CgDCI/s+iUu/Sby/dcW0OrtCGgA3HXgy9K4VMaJDxmEtaK5f4CsqCLxOf193wRURKSLPdOBYM2G3lGCAjyVpxuLv1h5RgD/ncA8zyeJV/QofQPvrLRTdBHBpAGcrn5Vz2ClNWA42OACz1AOYwQEAIY8ZAMCnVoCkWC5S8AEWhRFuU0DgdrAXZKiTKEAeLLKhCujWFBLLKtBcXbgoJKu+1gBcALByKnOhpwjrlA4ah6sMGjm3epe6dn7EBYBroXczTl8NQCLx0JIMtKgwPMRBDhmlMQHyKgkm8s5Fyactif1Pqcf/Jt8TrK5PViQd+ArHd/aAzuu/+HLG7Fxaq1PrGLWhb7eGi82hAlNv7EUdNBljCBrnpQGYZHVCzKojIUS+f7kSNfhuB4YBaZGPiRXRfqR8HnpXwzYBAFjelwCwBhcANlNUYm5z0NjAPX62gyZklCaR5NY2Xm8pNKNUDUCGVzdV5khGDpbtcB7ArysGACdrNPEsyUBifTypu4bt4m84NnrE0ACkGbB+hwGA6gRst1Pub2Q8b1eiNVQ72L5Dw4BSrqwYAMyxROS4yUAyN+dKXwC4Dnp3ZzWZAboIgLowj+yQCTlQYwL8sQ9OATVC8X9KYlIXiR7sQ6I5ok35SiUd60M0h0qVAGA5Ep3y5QHEJAPwq74AMEJjAviGAXuVICq5bKT4RiSyXtjmawqqsOjicgJuaDUzsUYmWvai3zWVDxVacRm7Em+AZk1d2QTjKgQAY8Ddq5PLAhQHxWq+ALAY9JQg4jQjiCw3LMoQL9khEyNO4HcwPi8KqKzQT/exLwKQCgBDDNlxvynpWB+AXvAuDO0NrBAAXGs5cMGTBjzHdB3XTdzqSAoyZQPS98RJ9fUOmpyBBViMn0YAkCfkQgWMniN+iqklH+9FoFq2/wAM93Io+C4QEPM/PisAjNN4Ym25ALa+gneHBJfc5WdKGHCCwYEr5uUmTXQhtCovrgwmJjUn689WEHT7rACwiiYji2P/67yRNTy1wgTnrwlsQF57icyLCgDfQ5NMvH5uGL9CyjUWp7pvMtAHNm2VczOPGzQAn5qBMhPpvDC5fSL3EvNrosI2VP0Gb4axKpwsAz31IWJwl+l32f/WuhycG7qUkQuQGLz/9Gb+U1F7rq/lh4pvoAudaQOQCloj6uGSYbwKJcdYTn+bBgAG+/+wVgFgFAk3ZfUByAU5Kkxy20UUFv0Oov9xJJuRhnY/EcarUDLXElL30QKk2b18qwAgMq3mtcgDUCMETwUtoE9kYwxZDiPkGlpbfvkwVoVK/Y2YoXWOCeCsV+mTkuhKB7bdbEz4818Pk91WGYp2ZA3Dg0fj6/soySVSRVw0jFehTv/Iklvj4wQUc3tiXgCwGzRXzeFUBIoN2oH4+3CY7LbKJGiuWSCjAMui40/O5ewwVoWRPaGn9gO3ApcLAD6fFwCIMMIzDHWE21YsIrTWIPnKX8lYP6C8tx00Cr8KUNgijFWhIjc1S8TNlwfwHw5ZzecGvwf6UmE+uQKqs/DvYdJblsOh0eLqTfQeqxWdVFAOY11s2QH3lq4ID8fW1732c861fW5yNWguT+XLA9A5Bw8Mk99SvHgBNFd8lQUf7iaOpPvCeBVa7lSyPWNwd+KmApqI21Z5A4CQaWCuTxYD32Mp33+yYgkeecp2ikNPLh5Z8ulqMifTwngVVnZScjoiDxPAZmo/xL2+783uAu4CBTYNgN64WMBHhkWQ2WmklouqYxhJvLcfJxc8SCHkHgLkiUMDAIcJIH7r2HYBgJBHwNw4xKYB6ByEEfLWlwgLwSrrY374UEVj2luJ6UsAGEnSlh/BhKEwhsWUL0FzxSOO6eyy/0UNheXaCQBfAXujQq7KolbV+U1YDEY5DGP5ddzwE5TFQ0uCBZ9KuXw4T0JzwZPIY/ProgDa0t95A8AAjB9HDAAA4NUSiLhOiwrK38kYvqAw/WqKml9DezKMWTnkXEKgiyz8GVfRD/l3gS+zsxX7s86wVxIGAMjTa3JYFFp5h5hX85T35igOpJeCQ7U0shaJ4OgAgKv+q38v9b2XVh7iAeD3DYjBXU5MLOTNK7ogVsVQkAiziirAanOQeWQMP1TeEwU/T0/lMmiUcg+bqzynf42wY1UAAM8woPyNDfsSAIZqAICTC2B7gEcqmij0C2XsaoQqPY+M00dtuP7KBkfsYhatQqdqirn7LH5PfX0J9B2FgjCNsm1vQ+8uWiYTgKtV35Xlflp9mPvBXhXIRVukGoPQAsZXcFE8Dc19FLqVDfkW0ZTyLOIxEDkCNQSascRDLerSvU+ci5+DRn9CcZ9PpLIuvr4i0sW78f1BynfU3ou7VxwALlXmOQJ7LU3ag8PEEhS/NaQ/AGAo6JuBuDoL27SABRXjqA8k6dbSK7wyvv8g5NuOXJXNCZFIBZe/KJtW7Uf4G3I/v8DXvwPNbcx/ha9vRKIVd1V4828O+toaPhqAzjy4P+s95ZXEkLV2mamRyGMVSlMdiLa/esrXlBP0UGUjdiEfIK9r765xxsp7+pBoJUvjezPIwr0RX/81mcM/4OvDCHnstYpu/kWQoVfPCACx5dDctz8BYCPlBOPkLbvajckFN70iC2NR6N0CvK6o1gPQdhabdZOcrz1cAwDC9FhSiS7I11fH79xOwOp3Bs3gLiVhST31XqkoAPxS0e5oYhwnCmAyD2a0cl952jV1B6PJJ1VYboKzK7I4Xofm/P3uPmJHDiNzsABPKhWUZGeZZfA7t5C5moSv/1yxVcXf32s0gKgVdbXEcjTZ5LpCOhwAoHtKzMvaRQCADUlYw5UIZNIMdEDwpQoskN+S039uH133i2T8/0Ick2oZN+oDkGB1krLI1Y1+Cb6+gaIBqK9Xicb9Lpib58YacABwVwQSr/201fvL80Evt4CAyzywlUB6DYkTnbxIPo200G5k+g3uw2tfj/P2GuEf7A+NsmLz8N/y9XVSeR6/82gqn8TXhdlwB55K/8TPye/8BF+/TdEkqmL33+845V1MQJMJIKIzqxQJAFbTxDc5TEDb5pef+6smttyp/oD+Wqim+1nU4Lg09URcPMT6/yc/JRtbpwXEBvPABQCX5XGPeT/w8WCvFxA7Yp2mwiHi9DgtLKggJZL9SJqvaY3rgAEcPgDxd9MiAsBADHV0Q+/y0xHwqgmZCBFCHd0uLKwgJRCpDccadd92+tcdB6eu1VuhAECGBRdokoWSFgEgwhDSemGBBSm4XMXwg8UGH4DLBJif5x5oZw57DXiVgjgxz0ghyLwCoZptkOLK98Fc+yJ2mAAmJ6D6/tfzvN92DsQllvCfbYBcnOgIU2S3DYstSMFkHPRuveZqnsOpCCTNgxvzvud2DsbSGC5yOTNMiBhbCBOys23QBIIUyenXhf4vXeTLtfltJoA89NYuEwAI2YowymKmBhA50FO+9gamn4YFGKS/k3zec8TxIwYI1EHfU7MGPe3dSgUAQr4N7tbhHA3ApD28jYy2sBCD9IcIwtPLYK+TaXIC0s2vW/d1pF8PKCsADEAijynn2UQDThxMQjXxRLRB2jksxiB9LJ9SWJEu/ktk0IRjR56AMHXXKDsAbA/NXWk5GYE+RKIaUiO3D4sySB/J6kh5jgwJb7Z1bfMB0EIfo9r5HH05YD9mcAPoJgdmiFCmWb6GPISwQIO0U1bGPIiageXH9QFEliiA+P817X6Wvi58cSvTDLDFQ3UIW4fmqjbBHAjSzpp+fzNsZlsdDB1QRBYQEIfZip0EALKQ5Ezg9RRIwC+XQFXDRCONMyuWeRak/fIJaJRit0WxXJV7I0YugPj3yL54pv4YxCUw7zzKsMltZZHogHZjHnsIEwbJQ8Q6eg7XlS0qlVh4ABwmoJDz++q5+tOB8iJxoHCZgNyehPK3RT77mLCAg7ToxH7Lks/P7Ydh0wCkH+vP0Iel8fu7UsrrmsgAxwSIGe9RbeDCkKseJIOMgEYvBlf/vsiS6+LKB5C/+xKaGQOqAAADMKf5bYcnNfF8T9eBWKKrSKNcNCzqIEz5ATSXObPV7YsYJoApDCiu8UEqX+jrZyzCIA9GhI0YA8nxD8QW1UsM9MMhVBjEIUtBo9ipTd3nagC05L0uCtDd7nh/kQFArZ7CVfNdGoAOeaUWUEPe9jFhoQfRiKg/OdfAzecAALfUnQoAp/bX8xZp4MdD79LitmQgk3NQBwB1g/p1N/oiwsIPIkRUMH6BYatnMQF0ICAOo6v685mLNPiCKHQ6YVdxw4CulOPIoiWI6kWiwGJoXFldEanrP0Q6ua02f5bOPabDSvz9OfRzM9wiTsYBSOTh9BzkAIAu08rkiLm8L9hXQQol22J8n9Ogg6MB2MKAasivEE1wizopX8GTOc5BA7BxrXXFRp6FajQjqbqIMvMTwNyl12YCmPxPkYOsJmVGUcahyBM0FHqKLHDIFtx6a5zPCQ3kT9BohR02S2cSe+ZC70adtlh+lDEKQOtaivThVQIA8EQU+ngVmpsq2qIAOiIRFwBMoCDadm0SNk1HyHKpXGGgoSceh0TCcBAmGoefSB9es0hjUoZJGwQ9RRe4LEGdE7DO2PA6VK9hnHZyKluHTVRaEfUjnzBs0sQDAEyefZd/SkQX1i7auJSp+MJjBhDg8gC4GkCiAY66AgTTQoJRqURU07kEzbpugyPPpS0mjChAZNE+hV9p3SKOT5kmchCiqAwTQkYASBzMwYQBMOL/d6YyGqrRs7CsefsiJXy+B5M0YpqFru/I367j5l+jqONUtkkVLZdmGxIyIgYAcE0GDtFImgf/hkb322AeFENWSuVkaNSJjMDelNYnYYejAdDfe7poNn/ZAWAAEifEBL/r2NytOgET5smgmgkinnxtKl9NZdWwGftUdkBW3UILmcxVjSryIJTZOAJiLfwMSlCQpswTvi76BepgL84Qe4RwXN2KuJEDCQiPILtxh/5mfHWorI4Ze0+DubtOYkkzp8I1JV1Vf88syxh2AoXzSk0OAaf1kuvU5+Qa2JyH1IEo0p5vSOWEVLYJgNASZXxPzNZbAD0VekyqvcnLb/osp/CMDgDkXF+A9xgAoA/la8jjrnvmAiQep3rM8AybuAi6BSYW7z0IYKLry46pLBs2uFE2xs31MhPUXZ2pYw8egO0wUMljR5ZtXDtpgXwObfA60wmYgB8ngFv7LfHQENSKRfIUEZGOqamcmMouFY8yfAY1prugp/kGx7HH0QZ8eACJgwr8Mmp1AwIA9H8u96MEBGzJQNySYhHwy5D5VjE2dYipKyeLKGJyMTTqJnRyRSPhwT8Qk7JeUCItHB+MT/FYjg9ABx6RZl39tchhvqoBgEzy+LFCGnJleOkonq5ipFz/QWKxJ23/d7VG/1WHkJFEjUbRw+F7qdzu8OX4OmRdoGvzAbiuLe/xirIDcqcnfDzLWFSRh7qeME56zoJ0tUezEVWkKrwA88nXKtm8bJnKWdAoDS9Ddl0e9jyHt5FYnHgJ+BfupMlAglx0RCfsk063IUUPgm+ijdZtcdhFDnU+8rDxk4ybn6MJJAaq8vUFz1wUlXbOTeUfDB9L4jm2HB9NwpwPVxhQrKFZJQTdygKAWuTxPIM96aIJc2nEHJUUGIuUu3CpSlpDzkHR4vSX4glv875zfDKJp83v0q5sYUIdENSQ8dlRPpiqeZX3hkaDh5oj8SPxIBH5nja+GkDsoK4mBARuKEDkQFxfFLr8yOF4izNEUbJoWLaKUqb+ffLf3eiQ3LET90RV2WNXQu+e7pwwITe2zP0eh6XmYxZIEJjaj0SjzUjaLdfpxjm1XQxNjhbF/ZwkcP0CGj0tBwQA6CzZKZUHLad74kEV5vIKXNmHPpsltgBAHR2EfT2mwjE2j3nqu56bqxlwtQsXCYjOt6AXD+70fRAYZgBfh0ZLphrY67f7OKpcC5xjsybAJ7iY7mnLPhzHy8GvkrPLCeijYXEiARyNrIYe/tOhIh2kAgD05BScodCJfW3NmOFsapWpFhuIKzat4vo+Gr9zPEAqcfAmuE6/GPxCrpzW3c+hZliZtR82f7N8MpVrNA7CCPw99D4e6sTzs9xwl3BgrdbmMTuOgGYWrSXJyQTg/Bb9TB1P/dPwIBgQACCI4ODfqziCIiYpxdeRlWXDcOxp9d/tDA2Oc2TXcYtwJMAjWvmy/mzAIQFe1G/4VFXXetjsdtkKvcCvOFhkPmQWjs3rS2CxObtealNE4PsOTz8H/GLwr8oTt6hhCfkvNAp2VL5JbNjk/CpEh0GjwIcpKy3x4J/7aAU+GoCpLt0eOY/H4dC7tHaSQVWPoTWCEDdFW4b13kZ+wlJhTQcAyCqH4qkaGTYBt7gEV2V2Za+5gKcG+Xaf3QidpVnYd1yeRZwRBExjVENVf92wfgMA5CEiRDQSGgU9uPUGs9r7ruo1rg1XR2JQXtV4Hm2Bfpt4mD6u77u0qzomGwkT7jNhzQYAaGelGrHI3iQU49iyYH3CfdwQo41W+1BOz3ommLvq2Oi1XM++Kwc/NoQ+I7LxRTepU1JZOazPAAB9qRWMgUa/gDo0NzExbXgAv4o1PixB9TPv5vB8m+KJWvfUZnzYeglkq9AkQfdxNNFCvcUAAP0qYrNcBI3a9HVDFqJPXJ9LojF9vrvFTSG+O9fg94jBP4Tpk/NvCt+p3ZpugUa1pIFh7QUAKFr0YN9UrlPAwFZgJGHYvKYCF7bqRWKjLNnCc4wHcy0+HyKUTzjTVLmpG5/nPiQhrRjWWQCAsoDBttBoanIbpsq6Ohv70INNmy5qEQDEPS8w8CCyMhU5QEHZmK8gS1PkbgwK6ykAQCcAwh5ISHkcmvsIZKHVxpYU4a4Wklse8WD4ZeFA2BqriHbal+A4BfU+AEBHi2gldjA02pC/aslD4PQeoADwfgs8f1s33bw0ALnpRcHTGakcn8rmYU0EAKiybIb59cJ/8Dz0rmJk4x9QHsCTGa7/Wczt5+Q6cJiA6v3IZ/kwlT+gj2FwOOUDAASxZyoeiKm3N6NTUTrEpDdcV75MbLgbMhB+HvTgHSSGTV5TqNOChvtHaPQ3ODiQcwIABGldRHXaYdBoLSYKcszCWD0lxpzt+bsna/IdODH7eegzEAAleheMhUYdxtApOQBAkD4UUQ59DQSHH6aynafpMR9P7oVIIpqLtGehSVwNjeq4AnQOSmV//M7iYdwDAAQpv6yGSTOLhbEIABAkSJAOlv8HOib1/JuFBpoAAAAASUVORK5CYII=";var xa="linear-gradient(135deg,#3aa0ff 0%,#6a6ff6 52%,#8a4ff0 100%)",mA=[58,160,255],Dv=[106,111,246],fA=[138,79,240];function gA(e){let[t,r]=e<=.5?[mA,Dv]:[Dv,fA],o=e<=.5?e/.5:(e-.5)/.5,n=(i,a)=>Math.round(i+(a-i)*o);return`rgb(${n(t[0],r[0])},${n(t[1],r[1])},${n(t[2],r[2])})`}var Fl=Array.from({length:65},(e,t)=>{let r=t/64,o=Math.exp(-(((r-.5)/.16)**2)),n=Math.round((3+o*(.8+.2*Math.abs(Math.sin(t*1.9)))*153)*10)/10,i=(1.5+t%5*.2).toFixed(1),a=(Math.abs(r-.5)*.7).toFixed(2);return`<span style="height:${n}px;background:${gA(r)};opacity:${n<6?.92:1};animation:wave ${i}s ease-in-out ${a}s infinite"></span>`}).join("");function hA(e){let t=e.markUri??Cr,r=t?`<span class="mark" style="-webkit-mask:url("${t}") center/contain no-repeat;mask:url("${t}") center/contain no-repeat"></span>`:'<span class="mono">AC</span>',o=e.compact?"body{overflow:auto;align-items:flex-start}.card{margin:auto;padding:30px 28px 44px}.badge{height:140px;margin-bottom:22px}.orb{width:104px;height:104px}.mark{width:78px;height:78px}.glow{width:114px;height:114px;margin:-57px 0 0 -57px;background:radial-gradient(circle,rgba(34,197,94,0) 35px,rgba(34,197,94,.34) 40px,rgba(34,197,94,.12) 47px,rgba(34,197,94,0) 56px)}.bars{-webkit-mask-image:radial-gradient(circle at 50% 50%,transparent 40px,#000 62px);mask-image:radial-gradient(circle at 50% 50%,transparent 40px,#000 62px)}h1{font-size:32px}p{font-size:15px}":"";return`<!doctype html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>${Rt(e.title)}</title>
|
|
13
|
+
`,{mode:384}),s$(o,e)}catch{}};return{add(r){let o=Sl(e);o.includes(r)||t([...o,r])},remove(r){let o=Sl(e);o.includes(r)&&t(o.filter(n=>n!==r))}}}function Ih(e,t){if(!t)return 0;let r=0;for(let o of Sl(e))try{t.delete(o),r++}catch{}return r}var f$=/^[A-Za-z0-9][A-Za-z0-9_.-]{0,79}$/;function ut(e){return f$.test(e)&&!e.includes("..")?e:`h_${p$("sha256").update(e,"utf8").digest("hex").slice(0,24)}`}function oa(e){return Jn.join(M,"users",e)}function Ge(e){try{let t=JSON.parse(Buffer.from(e.split(".")[1]??"","base64url").toString("utf8"));return typeof t.sub=="string"&&t.sub?t.sub:null}catch{return null}}var jo=Jn.join(M,"active-user.json");function Eh(){try{let e=JSON.parse(Ah(jo,"utf8"));return typeof e.sub=="string"&&e.sub?e.sub:null}catch{return null}}var g$="layout-version.json";function Kt(){try{let e=JSON.parse(Ah(Jn.join(M,g$),"utf8"));return typeof e.version=="number"&&Number.isFinite(e.version)?e.version:0}catch{return 0}}var Xt=3;function Ph(e){if(!e||e.includes("/")||e.includes("\\")||e.includes("..")||e.includes("\0"))throw new Error(`unsafe credential segment: ${JSON.stringify(e)}`)}function yt(e){Ph(e);let t=oa(e);return{accessFile:Jn.join(t,"relay-access-token"),refreshFile:Jn.join(t,"relay-refresh-token")}}function _l(e,t){Ph(e);let r=Jn.join(oa(e),"providers"),o=Ih(Jn.join(r,".keyring-index"),t??null);return m$(r,{recursive:!0,force:!0}),o}var $l=e=>{try{return y$(e,"utf8").trim()||null}catch{return null}},qn="hub-endpoint.json",x$=24,k$=new Set(["public","default","default user","all users","defaultapppool","administrator"]);function Il(e){if(!e)return null;try{let t=JSON.parse(e);return typeof t?.pid!="number"||typeof t?.port!="number"?null:{pid:t.pid,port:t.port,startedAt:typeof t.startedAt=="number"?t.startedAt:0,...typeof t.sub=="string"&&t.sub?{sub:t.sub}:{}}}catch{return null}}function w$(e){let o=e.readFile("/etc/wsl.conf")?.match(/^\s*root\s*=\s*(\S+)\s*$/m)?.[1]??"/mnt";return o.length>1&&o.endsWith("/")?o.slice(0,-1):o}function Al(e){let t=[],r=n=>{t.length<x$&&!t.includes(n)&&t.push(n)},o=n=>!k$.has(n.toLowerCase());if(e.isWsl){let n=w$(e);for(let i of e.listDir(n).filter(a=>/^[a-zA-Z]$/.test(a))){let a=`${n}/${i}/Users`;o(e.userName)&&r(`${a}/${e.userName}`);for(let s of e.listDir(a))o(s)&&r(`${a}/${s}`)}return t}if(e.platform==="win32")for(let n of["\\\\wsl.localhost","\\\\wsl$"])for(let i of e.listDir(`${n}\\`)){let a=`${n}\\${i}\\home`;r(`${a}\\${e.userName}`);for(let s of e.listDir(a))r(`${a}\\${s}`)}return t}function S$(e){let t=e.isWsl?"/":"\\";return Al(e).map(r=>`${r}${t}.claude-bridge`)}function _$(e){let t=i=>Il(e.readFile(i.endsWith("\\")||i.endsWith("/")?`${i}${qn}`:`${i}${e.platform==="win32"?"\\":"/"}${qn}`)),r=e.env.BRIDGE_SECRET_DIR;if(r)return{dir:r,source:"env",beacon:t(r)};let o=t(e.secretDir);if(o&&e.pidAlive(o.pid))return{dir:e.secretDir,source:"local",beacon:o};let n=null;for(let i of S$(e)){let a=t(i);a&&(!n||a.startedAt>n.beacon.startedAt)&&(n={dir:i,beacon:a})}return n?{dir:n.dir,source:e.isWsl?"peer-wsl":"peer-windows",beacon:n.beacon}:{dir:e.secretDir,source:"local",beacon:null}}function Ch(e,t,r){return t!=="linux"?!1:e.WSL_DISTRO_NAME||e.WSL_INTEROP?!0:/microsoft/i.test(r("/proc/version")??"")}function aa(){return Ch(process.env,process.platform,$l)}var ia=null;function $r(e={}){if(ia&&!e.fresh)return ia;let t=n=>$l(n),r=n=>{try{return v$(n)}catch{return[]}},o="";try{o=b$.userInfo().username}catch{o=process.env.USER??process.env.USERNAME??""}return ia=_$({secretDir:M,env:process.env,platform:process.platform,userName:o,isWsl:Ch(process.env,process.platform,t),pidAlive:n=>{try{return process.kill(n,0),!0}catch(i){return i.code==="EPERM"}},readFile:t,listDir:r}),ia}function Th(e){return{hubTokenFile:_r.join(e,"hub-token"),activeUserFile:_r.join(e,"active-user.json"),sessionsDir:_r.join(e,"sessions"),configFile:_r.join(e,"config.json"),beaconFile:_r.join(e,qn)}}function $$(e){let t=$l(Th(e).activeUserFile);if(!t)return null;try{let r=JSON.parse(t);return typeof r.sub=="string"&&r.sub?r.sub:null}catch{return null}}function Rh(e){let t=$$(e);if(t){let r=_r.join(e,"users",ut(t),"hub-token");if(h$(r))return r}return Th(e).hubTokenFile}function sa(e){if(e?.isDevBuild!==!0)return!1;let t=e.env??process.env;return t.BRIDGE_VOICE==="1"||t.BRIDGE_VOICE==="true"}var Az=256*1024;import{readFileSync as I$}from"node:fs";import Fo from"node:path";var A$=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(?:\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?$/;function El(e){if(typeof e!="string")return{kind:"invalid"};let t=A$.exec(e);return t?t[1]==="0"&&t[2]==="0"&&t[3]==="0"?{kind:"dev"}:{kind:"release",version:e}:{kind:"invalid"}}function Oh(e){let t=El(e);return t.kind==="release"?t.version:null}function Ct(e=process.env,t=process.argv){let r=El(e.BRIDGE_CLIENT_VERSION);if(r.kind==="release")return r.version;if(r.kind==="dev")return null;let o=Fo.join(M,"payload"),n=t[1];if(!n)return null;let i=Fo.relative(o,Fo.resolve(n));if(i===""||i.startsWith("..")||Fo.isAbsolute(i))return null;try{let a=JSON.parse(I$(Fo.join(o,"version.json"),"utf8")),s=El(a.version);return s.kind==="release"?s.version:null}catch{return null}}import{readdirSync as E$}from"node:fs";import P$ from"node:path";var Kn=class extends Error{constructor(r,o){super(r);this.status=o;this.name="RelayError"}status},C$=e=>e.replace(/\/+$/,"");async function Pl(e,t,r,o){return fetch(`${C$(e)}${t}`,{method:"POST",headers:{"content-type":"application/json",...o?{authorization:`Bearer ${o}`}:{}},body:r===void 0?void 0:JSON.stringify(r)})}async function Dh(e,t){let r=await Pl(e,"/node/provision",{},t);if(!r.ok)throw new Kn(`provision failed (${r.status}): ${(await r.text().catch(()=>"")).slice(0,200)}`,r.status);let o=await r.json().catch(()=>({}));if(typeof o.claim_code!="string")throw new Kn("provision returned no claim_code",r.status);return o.claim_code}async function Nh(e,t){let r=await Pl(e,"/node/claim",{claim_code:t});if(!r.ok)throw new Kn(`pairing failed (${r.status}): ${(await r.text().catch(()=>"")).slice(0,200)}`,r.status);return await r.json()}async function T$(e,t){let r=await Pl(e,"/node/token",void 0,t);if(!r.ok)throw new Kn(`refresh rejected (${r.status})`,r.status);return await r.json()}function Bo(e,t={}){let r=t.log??(l=>console.warn(l)),o=Ge(e.refresh_token),n=Ge(e.access_token),i=o??n;if(o&&n&&o!==n&&r(`credential: access-token sub (${n}) differs from refresh-token sub (${o}) \u2014 trusting the refresh sub (the refresh loop re-mints the access token)`),!i)throw new Error("credential: refusing to persist an unattributable token pair (no decodable sub in refresh or access token)");let a=ut(i),s=yt(a);return ge(s.refreshFile,e.refresh_token),ge(s.accessFile,e.access_token),{sub:i,segment:a}}var R$="__none__";function ve(){let e=Eh();if(e)return yt(ut(e));let[t,r]=dt();return t&&!r?yt(t.segment):yt(R$)}function Lh(e){let t;try{t=E$(P$.join(M,"users"),{withFileTypes:!0})}catch{return[]}let r=[];for(let o of t){if(!o.isDirectory())continue;let n;try{n=yt(o.name)}catch{continue}let i=O(n.refreshFile),a=i?Ge(i):null;if(e){if(!a)continue;r.push({sub:a,segment:o.name});continue}let s=a?null:O(n.accessFile),l=a??(s?Ge(s):null);l&&r.push({sub:l,segment:o.name})}return r}function dt(){return Lh(!1)}function ca(){return Lh(!0)}function O$(e=ve()){return O(e.refreshFile)}function Mo(e=ve()){de(e.accessFile),de(e.refreshFile)}function D$(e=ve()){let t=O(e.accessFile);if(!t)return null;try{let r=JSON.parse(Buffer.from(t.split(".")[1]??"","base64url").toString());return typeof r.exp=="number"?r.exp-Math.floor(Date.now()/1e3):null}catch{return null}}async function Tt(e,t=60,r,o=ve()){let n=D$(o);if(n!==null&&n>t)return!0;let i=O$(o);if(!i)return n!==null&&n>0;try{return Bo(await T$(e,i)),!0}catch(a){return r?.(`token refresh failed: ${a instanceof Error?a.message:String(a)}`),a instanceof Kn&&(a.status===400||a.status===401)&&Mo(o),!1}}function Cl(e){return e==="node_superseded"?"This machine was unpaired when AC Bridge was set up on another computer \u2014 only one machine can be paired at a time. Run `acbridge pair` here to take the pairing back.":e==="node_revoked"?"This machine's pairing has been revoked. Run `acbridge pair` to set it up again.":null}import Tl from"node:path";function Rl(e){if(!e)return!1;try{return e.available()}catch{return!1}}function Ol(e){return Rl(e)?"keyring":"file"}function N$(e){let{file:t,account:r}=e,o=()=>O(t);return{backend(){return Ol(e.keyring)},read(){if(Rl(e.keyring))try{let n=e.keyring.get(r);if(n!==null)return n;let i=o();if(i===null)return null;try{e.keyring.set(r,i),de(t),e.index?.add(r)}catch{}return i}catch{}return o()},write(n){if(Rl(e.keyring))try{e.keyring.set(r,n),de(t),e.index?.add(r);return}catch{}ge(t,n,384)},delete(){if(e.keyring){try{e.keyring.delete(r)}catch{}e.index?.remove(r)}de(t)}}}function Ir(e,t,r){let o=e.providerSecretFile(t,r);return N$({keyring:Ho(),file:o,account:`${t}/${r}`,index:$h(Tl.join(Tl.dirname(Tl.dirname(o)),".keyring-index"))})}var L$="AC Bridge",An,U$=new Set(["win32","darwin"]);function Ho(e={}){if(An!==void 0)return An;An=null;let t=e.require??null;if(!U$.has(e.platform??process.platform))return An;try{let r=t??z$();if(!r)return An;let{Entry:o}=r("@napi-rs/keyring"),n=i=>new o(L$,i);An={available(){try{return n("__acb_probe__").getPassword(),!0}catch{return!1}},get:i=>n(i).getPassword(),set:(i,a)=>n(i).setPassword(a),delete:i=>{n(i).deletePassword()}}}catch{An=null}return An}function z$(){try{return typeof te=="function"?te:null}catch{return null}}import{spawnSync as j$}from"node:child_process";import{existsSync as F$}from"node:fs";import B$ from"node:os";import Uh from"node:path";function la(e){if(e==="win32"){let r="irm https://claude.ai/install.ps1 | iex";return{file:"powershell",args:["-NoProfile","-ExecutionPolicy","Bypass","-Command",r],manualCommand:r,altCommands:["winget install Anthropic.ClaudeCode"]}}let t="curl -fsSL https://claude.ai/install.sh | bash";return{file:"sh",args:["-c",t],manualCommand:t,altCommands:[]}}function zh(e,t){if(e==="win32"){let o=Uh.win32;return[o.join(t,".local","bin","claude.exe"),o.join(t,".claude","local","claude.exe")]}let r=Uh.posix;return[r.join(t,".local","bin","claude"),r.join(t,".claude","local","claude"),"/opt/homebrew/bin/claude","/usr/local/bin/claude"]}var jh=/\.(cmd|bat)$/i,M$=/^\/mnt\/[a-z]\//i;function Fh(e){let t=e.split(/\r?\n/).map(a=>a.trim()).filter(Boolean);if(t.length===0)return null;let r=t.filter(a=>!M$.test(a)),o=r.length>0?r:t,n=o.find(a=>/\.exe$/i.test(a));if(n)return n;let i=o.find(a=>jh.test(a));return i||(o[0]??null)}function ua(e){return jh.test(e)?{file:"cmd.exe",argsPrefix:["/c",e]}:{file:e,argsPrefix:[]}}function Bh(e){let r=j$(e,e==="which"?["-a","claude"]:["claude"],{encoding:"utf8"});return{status:r.status??1,stdout:r.stdout??""}}function Mh(e,t){let r=t.home??B$.homedir(),o=t.fileExists??F$;for(let n of zh(e,r))if(o(n))return n;return null}function Yt(e,t={}){let r=e?.trim();if(r)return ua(r);let o=t.platform??process.platform,n=t.runFinder??Bh,i=o==="win32"?"where":"which";try{let s=n(i);if(s.status===0){let l=Fh(s.stdout);if(l)return ua(l)}}catch{}let a=Mh(o,t);return ua(a||"claude")}function da(e,t={}){if(e?.trim())return!0;let r=t.platform??process.platform,o=t.runFinder??Bh;try{let n=o(r==="win32"?"where":"which");if(n.status===0&&Fh(n.stdout)!==null)return!0}catch{}return Mh(r,t)!==null}import{spawnSync as H$}from"node:child_process";import{existsSync as Hh,readdirSync as Z$}from"node:fs";import Zh from"node:os";import ma from"node:path";var Gh=/\.(cmd|bat)$/i,G$=/^\/mnt\/[a-z]\//i;function W$(e){let t=e.split(/\r?\n/).map(a=>a.trim()).filter(Boolean);if(t.length===0)return null;let r=t.filter(a=>!G$.test(a)),o=r.length>0?r:t,n=o.find(a=>/\.exe$/i.test(a));if(n)return n;let i=o.find(a=>Gh.test(a));return i||(o[0]??null)}function pa(e){return Gh.test(e)?{file:"cmd.exe",argsPrefix:["/c",e]}:{file:e,argsPrefix:[]}}function V$(e,t,r=[]){if(e==="win32"){let n=ma.win32;return[n.join(t,"AppData","Roaming","npm","codex.cmd"),n.join(t,"AppData","Roaming","npm","codex.exe"),n.join(t,".local","bin","codex.exe")]}let o=ma.posix;return[...[...r].sort().reverse().map(n=>o.join(t,".nvm","versions","node",n,"bin","codex")),"/opt/homebrew/bin/codex","/usr/local/bin/codex",o.join(t,".local","bin","codex")]}function J$(e){try{return Z$(ma.posix.join(e,".nvm","versions","node"))}catch{return[]}}function q$(e,t){let r=t.home??Zh.homedir(),o=t.fileExists??Hh,n=e==="win32"?[]:(t.nodeVersions??J$)(r);for(let i of V$(e,r,n))if(o(i))return i;return null}function K$(e){let r=H$(e,e==="which"?["-a","codex"]:["codex"],{encoding:"utf8"});return{status:r.status??1,stdout:r.stdout??""}}function Ar(e,t={}){let r=e?.trim();if(r)return pa(r);let o=t.platform??process.platform,n=t.runFinder??K$,i=o==="win32"?"where":"which";try{let s=n(i);if(s.status===0){let l=W$(s.stdout);if(l)return pa(l)}}catch{}let a=q$(o,t);return pa(a||"codex")}function fa(e){let t=e?.home??Zh.homedir();return Hh(ma.join(t,".codex","auth.json"))}import{spawnSync as X$}from"node:child_process";import{readFileSync as Wh}from"node:fs";import Vh from"node:path";function Y$(e){try{let t=Number(Wh(e,"utf8").trim());return Number.isInteger(t)&&t>0?t:null}catch{return null}}function Q$(e){X$("pkill",["-f",e])}function eI(){try{return Il(Wh(Vh.join(M,qn),"utf8"))?.pid??null}catch{return null}}function Jh(e={}){let t=e.platform??process.platform,r=e.pidFile??Zo,o=e.readPid??Y$,n=e.readBeaconPid??eI,i=e.kill??(l=>process.kill(l)),a=e.sweep??Q$,s=o(r);if(s!==null&&n()===s)try{i(s)}catch{}if(t!=="win32"){for(let l of e.sweepPatterns??[])if(Vh.isAbsolute(l))try{a(l)}catch{}}}import{accessSync as tI,constants as nI,mkdtempSync as rI,readFileSync as oI,writeFileSync as qh}from"node:fs";import iI from"node:os";import ga from"node:path";var Oe="bridge",We="alexa";function Xn(e=process.platform){switch(e){case"darwin":return"/Library/Application Support/ClaudeCode/managed-settings.json";case"win32":return"C:\\Program Files\\ClaudeCode\\managed-settings.json";default:return"/etc/claude-code/managed-settings.json"}}function Kh(e,t=!1){let r={...e};if(t){r.channelsEnabled=!0;let o={marketplace:Oe,plugin:We},n=Array.isArray(e.allowedChannelPlugins)?[...e.allowedChannelPlugins]:[];n.some(i=>i.marketplace===o.marketplace&&i.plugin===o.plugin)||n.push(o),r.allowedChannelPlugins=n}return r}function Er(e){return`'${e.replace(/'/g,"'\\''")}'`}function Pr(e){return`"${e}"`}function aI(e){return`'${e.replace(/'/g,"''")}'`}function sI(e,t,r){return`mkdir -p ${Er(e)} && install -m 0644 ${Er(t)} ${Er(r)}`}function Nl(e,t){return(e==="win32"?ga.win32:ga.posix).dirname(t)}function cI(e,t,r){let o=Nl(e,r);return e==="win32"?`md ${Pr(o)} 2>nul & copy /y ${Pr(t)} ${Pr(r)}`:sI(o,t,r)}function lI(e,t){return e==="darwin"?[{method:"osascript",file:"osascript",args:["-e",`do shell script "${t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}" with administrator privileges`]}]:e==="win32"?[{method:"uac",file:"powershell",args:["-NoProfile","-Command",`Start-Process -Verb RunAs -Wait -FilePath cmd.exe -ArgumentList '/c',${aI(t)}`]}]:[{method:"pkexec",file:"pkexec",args:["sh","-c",t]},{method:"sudo",file:"sudo",args:["sh","-c",t]}]}function Xh(e,t,r){return lI(e,cI(e,t,r))}function Yh(e,t,r){let o=Nl(e,r);return e==="win32"?`md ${Pr(o)} & copy /y ${Pr(t)} ${Pr(r)}`:`sudo mkdir -p ${Er(o)} && sudo install -m 0644 ${Er(t)} ${Er(r)}`}function uI(e){try{return oI(e,"utf8")}catch{return""}}function dI(e){try{return tI(e,nI.W_OK),!0}catch{return!1}}function pI(e,t){qh(e,t,{mode:420})}function mI(e,t,r){let o=t(e),n={};try{n=JSON.parse(o)}catch{}let i=Kh(n,r),a=JSON.stringify(i,null,2)+`
|
|
14
|
+
`;return!r&&JSON.stringify(i)===JSON.stringify(n)?{existing:n,json:a,changed:!1}:{existing:n,json:a,changed:o.trim()!==a.trim()}}function Qh(e){let t=e.platform??process.platform,r=e.settingsPath??Xn(t),o=e.readDest??uI,n=e.dirWritable??dI,i=e.writeDirect??pI,a=e.tmpDir??iI.tmpdir(),s=e.stage??(g=>{let y=rI(ga.join(a,"acbridge-")),k=ga.join(y,"managed-settings.json");return qh(k,g,{mode:420}),k}),l=e.voice??!1,{existing:u,json:d,changed:p}=mI(r,o,l),m=l&&u.allowedChannelPlugins===void 0;if(!p)return{path:r,changed:!1,json:d,usedSudo:!1,method:"unchanged",replacedDefaultAllowlist:m};if(n(Nl(t,r)))return i(r,d),{path:r,changed:!0,json:d,usedSudo:!1,method:"direct",replacedDefaultAllowlist:m};let f=s(d);for(let g of Xh(t,f,r))if(e.runElevated(g),o(r).trim()===d.trim())return{path:r,changed:!0,json:d,usedSudo:g.method==="sudo",method:g.method,replacedDefaultAllowlist:m};throw new Error(`could not write ${r} with elevation (canceled or unavailable). Run it manually:
|
|
15
|
+
${Yh(t,f,r)}`)}var Ll={udpDstFixed:[4002,6666,6667],udpDstMulticast:[5353],udpSrcBroadcastReply:[9999,20002,38899,56700,1900,1982]},Go=[...Ll.udpDstFixed,...Ll.udpDstMulticast],Wo=Ll.udpSrcBroadcastReply;function ev(e){return e==="app"?"AC Bridge (App)":"AC Bridge (CLI)"}var Ul=["domain","private"],tv="AC Bridge discovery",nv="AC Bridge replies",fI="macOS will still show one 'Local Network' permission prompt on your first scan \u2014 that prompt cannot be pre-granted; click Allow.";function Cr(e){return/you need to be root|need(?:s)? to be root|must be run as root|requires? (?:super\s?user|root)|operation not permitted|permission denied|are you root/i.test(e)}function Yn(e,t,r={}){if(e==="win32")return"windows";let o=r.isWsl??aa();if(e==="linux"&&o)return"wsl-host";if(e==="darwin"){let i=t.alfGlobalStateOut??"";return/firewall is enabled/i.test(i)||Cr(i)?"macos-alf":"none"}let n=t.ufwStatusOut??"";return/status:\s*active/i.test(n)?"ufw":(t.firewallCmdStateOut??"").trim()==="running"?"firewalld":Cr(n)?"ufw":"none"}function ha(e,t){if(e==="win32")return{};if(e==="darwin")return{alfGlobalStateOut:t("/usr/libexec/ApplicationFirewall/socketfilterfw --getglobalstate")};let r=t("ufw status");return/status:\s*active/i.test(r)?{ufwStatusOut:r}:{ufwStatusOut:r,firewallCmdStateOut:t("firewall-cmd --state")}}function gI(e,t){if(e.length===0)return{state:"nothing-to-do"};let r=e.map((a,s)=>e.length>1?`${t} (${s+1})`:t),n=e.map((a,s)=>{let l=r[s];return`netsh advfirewall firewall delete rule name="${l}" >nul 2>&1 & netsh advfirewall firewall add rule name="${l}" dir=in action=allow program="${a}" protocol=udp profile=${Ul.join(",")} remoteip=localsubnet enable=yes`}).join(" & "),i=r.map(a=>`netsh advfirewall firewall show rule name="${a}" verbose`);return{applyScript:n,checkCommands:i,evalCheck:a=>a.every((s,l)=>bI(s,e[l])),manualCommand:n,needsElevation:!0}}function hI(e){if(e.length===0)return{state:"nothing-to-do"};let t=e.flatMap(o=>[`/usr/libexec/ApplicationFirewall/socketfilterfw --add "${o}"`,`/usr/libexec/ApplicationFirewall/socketfilterfw --unblockapp "${o}"`]),r=e.map(o=>`/usr/libexec/ApplicationFirewall/socketfilterfw --getappblocked "${o}"`);return{applyScript:t.join(" && "),checkCommands:r,evalCheck:o=>o.every((n,i)=>kI(n,e[i])),manualCommand:t.map(o=>`sudo ${o}`).join(" && "),needsElevation:!0,userNote:fI}}function vI(){let e=Go.join(","),t=Wo.join(","),r=`ufw allow in proto udp to any port ${e} comment '${tv}'`,o=`ufw allow in proto udp from any port ${t} comment '${nv}'`;return{applyScript:`${r} && ${o}`,checkCommands:["ufw status"],evalCheck:n=>wI(n[0]??""),manualCommand:`sudo ${r} && sudo ${o}`,needsElevation:!0}}function yI(){let e=Go.map(o=>`firewall-cmd --permanent --add-port=${o}/udp`),t=Wo.map(o=>`firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source-port port="${o}" protocol="udp" accept'`),r=[...e,...t,"firewall-cmd --reload"];return{applyScript:r.join(" && "),checkCommands:["firewall-cmd --list-ports","firewall-cmd --list-rich-rules"],evalCheck:o=>SI(o[0]??"",Go)&&_I(o[1]??"",Wo),manualCommand:r.map(o=>`sudo ${o}`).join(" && "),needsElevation:!0}}function va(e,t){switch(e){case"windows":return gI(t.programs,t.ruleName);case"macos-alf":return hI(t.programs);case"ufw":return vI();case"firewalld":return yI();case"wsl-host":return{state:"nothing-to-do"};case"none":return{state:"nothing-to-do"}}}var zl="You're running inside WSL, so LAN device discovery is governed by the WINDOWS firewall on the host, not by ufw/firewalld inside this distro \u2014 changing those here has no effect on scanning. If scanning misses devices, allow the bridge through Windows Defender Firewall on the Windows side (and check that the network is set to Private, not Public).";function bI(e,t){if(/no rules match/i.test(e))return!1;let r=/Enabled:\s*Yes/i.test(e),n=/Program:\s*(.+)/i.exec(e)?.[1]?.trim().toLowerCase();return r&&n===t.trim().toLowerCase()}function rv(e){let t=[],r=/^(Domain|Private|Public) Profile Settings:/gim,o,n=[];for(;(o=r.exec(e))!==null;)n.push({profile:o[1].toLowerCase(),at:o.index});for(let i=0;i<n.length;i++){let a=e.slice(n[i].at,n[i+1]?.at??e.length);t.push({profile:n[i].profile,firewallOn:!/^\s*State\s+OFF/im.test(a)})}return t}function xI(e,t=Ul){let r=new Set(t.map(o=>o.toLowerCase()));return e.filter(o=>o.firewallOn&&!r.has(o.profile)).map(o=>o.profile)}function ov(e,t){let r=t.toLowerCase(),o=new Set;for(let n of e.split(/^Rule Name:/m).slice(1)){let i=a=>new RegExp(`^${a}:\\s*(.*)$`,"m").exec(n)?.[1]?.trim()??"";if(i("Program").toLowerCase()===r&&/^yes$/i.test(i("Enabled"))&&/^in$/i.test(i("Direction"))&&/^allow$/i.test(i("Action")))for(let a of i("Profiles").split(",")){let s=a.trim().toLowerCase();(s==="domain"||s==="private"||s==="public")&&o.add(s)}}return[...o]}function iv(e,t=Ul){if(xI(e,t).length!==0)return"This network is set to Public, and the LAN-discovery rule only covers Domain and Private networks \u2014 so Windows is still dropping the replies device scanning needs. In Settings \u2192 Network & internet, open this network and set its profile to Private, then scan again."}function kI(e,t){return e.includes(t)&&/is not blocked/i.test(e)}function wI(e){return/status:\s*active/i.test(e)&&e.includes(tv)&&e.includes(nv)}function SI(e,t){return t.every(r=>e.includes(`${r}/udp`))}function _I(e,t){return t.every(r=>e.includes(`source-port port="${r}"`))}function av(e){let{platform:t,programs:r,ruleName:o,runElevated:n,runCheck:i}=e,a=e.isWsl===void 0?{}:{isWsl:e.isWsl};if(Yn(t,{},a)==="wsl-host")return{backend:"wsl-host",status:"nothing-to-do",changed:!1,userNote:zl};let l=Yn(t,ha(t,i),a);if(l==="none")return{backend:l,status:"nothing-to-do",changed:!1};let u=va(l,{programs:r,ruleName:o});if("state"in u)return{backend:l,status:"nothing-to-do",changed:!1};let d=u.checkCommands.map(i);if(u.evalCheck(d))return{backend:l,status:"unchanged",changed:!1,userNote:u.userNote};let p=d.some(Cr);n(u.applyScript);let m=u.checkCommands.map(i);return u.evalCheck(m)?{backend:l,status:"changed",changed:!0,userNote:u.userNote}:p||m.some(Cr)?{backend:l,status:"changed",changed:!0,userNote:$I(u)}:{backend:l,status:"needs-elevation",changed:!1,manualCommand:u.manualCommand,userNote:u.userNote}}function $I(e){let t=`Added the LAN-discovery firewall rule, but couldn't verify it without root. If device scanning still misses devices, re-run: ${e.manualCommand}`;return e.userNote?`${e.userNote} ${t}`:t}function II(e,t){switch(e){case"windows":return t.programs.length===0?null:t.programs.map((o,n)=>t.programs.length>1?`${t.ruleName} (${n+1})`:t.ruleName).map(o=>`netsh advfirewall firewall delete rule name="${o}" >nul 2>&1`).join(" & ");case"macos-alf":return t.programs.length===0?null:t.programs.map(r=>`/usr/libexec/ApplicationFirewall/socketfilterfw --remove "${r}"`).join(" && ");case"ufw":return`ufw delete allow in proto udp to any port ${Go.join(",")} && ufw delete allow in proto udp from any port ${Wo.join(",")}`;case"firewalld":return[...Go.map(r=>`firewall-cmd --permanent --remove-port=${r}/udp`),...Wo.map(r=>`firewall-cmd --permanent --remove-rich-rule='rule family="ipv4" source-port port="${r}" protocol="udp" accept'`),"firewall-cmd --reload"].join(" && ");case"wsl-host":case"none":return null}}function sv(e){let{platform:t,programs:r,ruleName:o,runElevated:n,runCheck:i}=e,a=e.isWsl===void 0?{}:{isWsl:e.isWsl};if(Yn(t,{},a)==="wsl-host")return{backend:"wsl-host",status:"nothing-to-do",changed:!1};let s=Yn(t,ha(t,i),a);if(s==="none")return{backend:s,status:"nothing-to-do",changed:!1};let l=va(s,{programs:r,ruleName:o}),u=II(s,{programs:r,ruleName:o});if("state"in l||u===null)return{backend:s,status:"nothing-to-do",changed:!1};let d=l.checkCommands.map(i);if(!l.evalCheck(d)&&!d.some(Cr))return{backend:s,status:"unchanged",changed:!1};n(u);let p=l.checkCommands.map(i);if(!l.evalCheck(p)||p.some(Cr))return{backend:s,status:"changed",changed:!0};let m=t==="win32"?u:u.split(" && ").map(f=>`sudo ${f}`).join(" && ");return{backend:s,status:"needs-elevation",changed:!1,manualCommand:m}}import{spawnSync as AI}from"node:child_process";import{existsSync as EI,readFileSync as ya,readdirSync as PI}from"node:fs";import{homedir as CI}from"node:os";import{join as bt,resolve as TI}from"node:path";var lv=()=>bt(CI(),".claude","plugins"),cv=e=>{let t=TI(e).replace(/[/\\]+$/,"");return process.platform==="win32"||process.platform==="darwin"?t.toLowerCase():t};function uv(){try{let t=JSON.parse(ya(bt(lv(),"known_marketplaces.json"),"utf8"))?.[Oe]?.source;return typeof t?.path=="string"?t.path:null}catch{return null}}function Fl(){try{let t=JSON.parse(ya(bt(lv(),"installed_plugins.json"),"utf8"))?.plugins?.[`${We}@${Oe}`]?.[0];return typeof t?.installPath=="string"?t.installPath:null}catch{return null}}var jl=(e,t)=>{try{return ya(e,"utf8")===ya(t,"utf8")}catch{return!1}};function RI(){return["hooks/hooks.json",".mcp.json"]}function OI(e){let t=Fl();if(!t)return!1;let r=bt(e,"plugins",We);for(let i of RI())if(!jl(bt(r,i),bt(t,i)))return!1;let o=bt(r,"dist","channel.mjs");if(EI(o)&&!jl(o,bt(t,"dist","channel.mjs")))return!1;let n;try{n=PI(bt(r,"scripts"))}catch{return!1}return n.every(i=>jl(bt(r,"scripts",i),bt(t,"scripts",i)))}function dv(e){return t=>{let r=AI(e.file,[...e.argsPrefix,...t],{encoding:"utf8"});return{ok:r.status===0,out:`${r.stdout??""}${r.stderr??""}${r.error?r.error.message:""}`}}}function pv(e){let t=dv(e.claudeCmd),r=(e.installedDir??Fl)(),o=(e.registeredDir??uv)(),n=r!==null&&t(["plugin","uninstall",`${We}@${Oe}`]).ok,i=o!==null&&t(["plugin","marketplace","remove",Oe]).ok;return{pluginUninstalled:n,marketplaceRemoved:i}}function mv(e){let{marketplaceDir:t,claudeCmd:r}=e,o=dv(r),n=uv(),i=!1;if(n===null||cv(n)!==cv(t)){n!==null&&o(["plugin","marketplace","remove",Oe]);let s=o(["plugin","marketplace","add",t]);if(!s.ok)throw new Error(`marketplace add failed:
|
|
16
|
+
${s.out}`);i=!0}let a=!1;if(i||!OI(t)){o(["plugin","marketplace","update",Oe]),Fl()!==null&&o(["plugin","uninstall",`${We}@${Oe}`]);let s=o(["plugin","install",`${We}@${Oe}`]);if(!s.ok)throw new Error(`plugin install failed:
|
|
17
|
+
${s.out}`);a=!0}return{marketplaceRepointed:i,pluginReinstalled:a}}import{mkdirSync as DI,readFileSync as hv,writeFileSync as NI}from"node:fs";import LI from"node:os";import Bl from"node:path";function vv(e,t="node"){return`${t} "${Bl.join(e,"plugins","alexa","scripts","statusline.mjs")}"`}function yv(){return Bl.join(LI.homedir(),".claude","settings.json")}var bv=e=>{let t=e.statusLine,r=t&&typeof t=="object"?t.command:void 0;return typeof r=="string"&&r?r:void 0},UI="plugins/alexa/scripts/statusline.mjs",zI="plugins\\alexa\\scripts\\statusline.mjs";function Ml(e){return e.includes(UI)||e.includes(zI)}function fv(e){let t=e.statusline,r=t&&typeof t=="object"&&!Array.isArray(t)?t.prev:void 0,o=typeof r=="string"&&r?r:null;return o!==null&&Ml(o)?{prev:null,poisoned:!0}:{prev:o,poisoned:!1}}function jI(e){let t=e.statusline,r=t&&typeof t=="object"&&!Array.isArray(t)?{...t}:{};return delete r.prev,{...e,statusline:r}}function xv(e,t){let r=bv(e);return r===t?{settings:e,prev:void 0,changed:!1}:r!==void 0&&Ml(r)?{settings:{...e,statusLine:{type:"command",command:t}},prev:void 0,changed:!0}:{settings:{...e,statusLine:{type:"command",command:t}},prev:r??null,changed:!0}}function kv(e,t){let r=t?.settingsFile??yv(),o=t?.configFile??we,n=t?.env??process.env,i=gv(o),s=!(n.BRIDGE_STATUSLINE==="0"||n.BRIDGE_STATUSLINE==="false")&&i.autoStatusline!==!1,l=gv(r),u=vv(e,t?.nodeCommand);if(s){let g=xv(l,u),{poisoned:y}=fv(i);return!g.changed&&!y?{enabled:s,changed:!1}:(g.changed&&Vo(r,g.settings),g.prev!==void 0?Vo(o,{...i,statusline:{prev:g.prev}}):y&&Vo(o,jI(i)),{enabled:s,changed:!0})}let d=bv(l);if(!d||!Ml(d))return{enabled:s,changed:!1};let{prev:p}=fv(i),m={...l};p?m.statusLine={type:"command",command:p}:delete m.statusLine,Vo(r,m);let f={...i};return delete f.statusline,Vo(o,f),{enabled:s,changed:!0}}function gv(e){try{let t=JSON.parse(hv(e,"utf8"));return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}catch{return{}}}function Vo(e,t){let r=JSON.stringify(t,null,2)+`
|
|
18
|
+
`;try{if(hv(e,"utf8")===r)return}catch{}DI(Bl.dirname(e),{recursive:!0}),NI(e,r)}import{existsSync as FI,mkdirSync as BI,readFileSync as MI,writeFileSync as HI}from"node:fs";import Sv from"node:os";import ba from"node:path";function xa(e=Sv.homedir()){return ba.join(e,".codex","hooks.json")}function _v(e,t="node"){return`${t} "${ba.join(e,"plugins","alexa","scripts","codex-signal.mjs")}"`}var ZI=["SessionStart","UserPromptSubmit","Stop","PermissionRequest","PreCompact","PostCompact","SubagentStart","SubagentStop","PostToolUse"],GI="plugins/alexa/scripts/codex-signal.mjs",WI="plugins\\alexa\\scripts\\codex-signal.mjs";function VI(e){return e.includes(GI)||e.includes(WI)}function $v(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;let t=e.hooks;return Array.isArray(t)?t.some(r=>{if(!r||typeof r!="object")return!1;let o=r.command;return typeof o=="string"&&VI(o)}):!1}var JI=e=>({hooks:[{type:"command",command:e,timeout:10}]});function Iv(e){let t=e&&typeof e=="object"&&!Array.isArray(e)?e.hooks:void 0;return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}function Av(e){let t=new Map;for(let[r,o]of Object.entries(Iv(e))){if(!Array.isArray(o))continue;let n=o.filter(i=>!$v(i));n.length>0&&t.set(r,n)}return t}function qI(e,t){let r=Av(e);for(let o of ZI){let n=r.get(o)??[];n.push(JI(t)),r.set(o,n)}return{hooks:Object.fromEntries(r)}}function KI(e){return{hooks:Object.fromEntries(Av(e))}}function XI(e){return Object.values(Iv(e)).some(t=>Array.isArray(t)&&t.some(r=>$v(r)))}function YI(e){return JSON.stringify(e,null,2)+`
|
|
19
|
+
`}function Hl(e){try{return MI(e,"utf8")}catch{return null}}function QI(e){if(e===null||typeof e!="object"||Array.isArray(e))return!1;let t=e.hooks;return t===void 0||typeof t=="object"&&t!==null&&!Array.isArray(t)}function eA(e){if(e===null)return{value:void 0,corrupt:!1};let t;try{t=JSON.parse(e)}catch{return{value:void 0,corrupt:!0}}return QI(t)?{value:t,corrupt:!1}:{value:void 0,corrupt:!0}}function tA(e){return eA(Hl(e))}function nA(e){let t=Hl(e);if(t===null)return{};try{let r=JSON.parse(t);return r&&typeof r=="object"&&!Array.isArray(r)?r:{}}catch{return{}}}function rA(e){let t=nA(e?.configFile??we),r=e?.env??process.env;return!(r.BRIDGE_CODEX_HOOKS==="0"||r.BRIDGE_CODEX_HOOKS==="false")&&t.autoCodexHooks!==!1}function Ev(e,t){let r=t?.home??Sv.homedir(),o=xa(r),n=t?.configFile??we,i=t?.env??process.env,a=rA({configFile:n,env:i});if(!FI(ba.dirname(o)))return{enabled:a,skipped:!0,changed:!1,corrupt:!1};let{value:s,corrupt:l}=tA(o);if(l)return{enabled:a,skipped:!1,changed:!1,corrupt:!0};if(!a)return XI(s)?wv(o,KI(s),a,l):{enabled:a,skipped:!1,changed:!1,corrupt:l};let u=_v(e,t?.nodeCommand);return wv(o,qI(s,u),a,l)}function wv(e,t,r,o){let n=YI(t);return Hl(e)===n?{enabled:r,skipped:!1,changed:!1,corrupt:o}:(BI(ba.dirname(e),{recursive:!0}),HI(e,n),{enabled:r,skipped:!1,changed:!0,corrupt:o})}function Pv(e){let t=/(\d+)\.(\d+)\.(\d+)/.exec(e??""),r=Number(t?.[1]??0),o=Number(t?.[2]??0),n=Number(t?.[3]??0);return{ok:r>2||r===2&&(o>1||o===1&&n>=80),version:t?.[0]??null}}function Cv(e){return{ok:new RegExp(`${We}@${Oe}`).test(e??"")}}function Tv(e){if(e===null)return{present:!1,allowed:!1};let t;try{t=JSON.parse(e)}catch{return{present:!1,allowed:!1}}return{present:!0,allowed:t.channelsEnabled===!0&&Array.isArray(t.allowedChannelPlugins)&&t.allowedChannelPlugins.some(o=>o.marketplace===Oe&&o.plugin===We)}}import{existsSync as oA,readdirSync as iA,readFileSync as aA}from"node:fs";import Rv from"node:os";function sA(e,t,r){let o=r.readFile(`${e}${t}plugins${t}installed_plugins.json`);if(!o)return!1;try{return!!JSON.parse(o)?.plugins?.[`${We}@${Oe}`]}catch{return!1}}function cA(e){return/^\\\\(?:wsl\.localhost|wsl\$)\\([^\\]+)\\/i.exec(e)?.[1]??null}function lA(e){let t=e.platform==="win32"?"\\":"/",r=(a,s,l,u,d)=>{let p=`${a}${t}.claude`;return{id:l,label:u,kind:s,home:a,claudeDir:p,claudePresent:e.exists(p),pluginInstalled:sA(p,t,e),setupHint:d}},o=e.env.WSL_DISTRO_NAME,n=e.isWsl?`this environment (WSL${o?`: ${o}`:""})`:e.platform==="win32"?"this environment (Windows)":"this environment",i=[r(e.homeDir,"current","current",n,"acbridge setup")];for(let a of Al(e)){let s=`${a}${t}.claude`;if(e.exists(s))if(e.isWsl){let l=a.split("/").pop()??e.userName;i.push(r(a,"windows",`windows:${l}`,`Windows (user ${l})`,"run `acbridge setup` in a Windows terminal"))}else{let l=cA(a)??"wsl";i.push(r(a,"wsl",`wsl:${l}`,`WSL: ${l}`,`wsl.exe -d ${l} -- acbridge setup`))}}return i}function Ov(){let e=n=>{try{return aA(n,"utf8")}catch{return null}},t=n=>{try{return iA(n)}catch{return[]}},r="";try{r=Rv.userInfo().username}catch{r=process.env.USER??process.env.USERNAME??""}let o=process.platform==="linux"&&!!(process.env.WSL_DISTRO_NAME||process.env.WSL_INTEROP||/microsoft/i.test(e("/proc/version")??""));return lA({homeDir:Rv.homedir(),env:process.env,platform:process.platform,userName:r,isWsl:o,readFile:e,listDir:t,exists:n=>oA(n)})}import{spawnSync as uA}from"node:child_process";import{existsSync as dA}from"node:fs";import Dv from"node:path";function pA(e,t){let r=e==="win32"?Dv.win32:Dv.posix,o=e==="win32"?"bridge-node.cmd":"bridge-node";return r.join(t,"bin",o)}function Nv(e){let t=/(\d+)\.(\d+)\.(\d+)/.exec(e??"");return t?{major:Number(t[1]),full:t[0]}:null}function Tr(e){if(e.shimExists()&&Nv(e.runShimVersion())!==null)return{kind:"shim",command:e.shimPath};let t=Nv(e.runNodeVersion());return t!==null&&t.major>=20?{kind:"system",command:"node",version:t.full}:{kind:"none"}}function ka(e){return e.kind==="shim"?`"${e.command}"`:void 0}function Rr(e,t=process.platform){let r=pA(t,e),o=(n,i)=>{try{let a=uA(n,i,{encoding:"utf8"});return a.status===0?a.stdout??"":null}catch{return null}};return{platform:t,shimPath:r,shimExists:()=>dA(r),runShimVersion:()=>t==="win32"?o("cmd.exe",["/c",r,"--version"]):o(r,["--version"]),runNodeVersion:()=>o("node",["--version"])}}function wa(e={}){let t=e.configFile??we,r={},o=O(t);if(o)try{r=JSON.parse(o)}catch{r={}}return{claudeBin:typeof r.claudeBin=="string"?r.claudeBin:null,relayUrl:typeof r.relayUrl=="string"?r.relayUrl:null,hubPort:typeof r.hubPort=="number"?r.hubPort:null,onboardedAt:typeof r.onboardedAt=="number"?r.onboardedAt:null}}function Sa(e,t={}){let r=t.configFile??we,o={},n=O(r);if(n)try{o=JSON.parse(n)}catch{o={}}for(let[i,a]of Object.entries(e))a===null?delete o[i]:a!==void 0&&(o[i]=a);return ge(r,JSON.stringify(o,null,2)+`
|
|
20
|
+
`,384),o}import{createHash as mA,randomBytes as Lv}from"node:crypto";var Zl=e=>e.toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");function Uv(){let e=Zl(Lv(32)),t=Zl(mA("sha256").update(e).digest());return{verifier:e,challenge:t}}function zv(){return Zl(Lv(24))}var fA="https://api.workos.com";var gA="client_01KW2CY31D0NZKCDKNHF2XQ7VC",hA="org_01KW0DNZ14H6JMK8RHA0WSKNVZ";function jv(e=t=>process.env[t]){let t=e("WORKOS_CLIENT_ID")??gA,r=Number(e("WORKOS_REDIRECT_PORT")??8765)||8765,o=(e("WORKOS_API_HOST")??fA).replace(/\/+$/,""),n=e("WORKOS_REDIRECT_URI")??`http://127.0.0.1:${r}/callback`;return{clientId:t,apiHost:o,redirectUri:n,port:r,organizationId:e("WORKOS_ORG_ID")??hA,configured:!!t}}var vA={google:"GoogleOAuth",github:"GitHubOAuth",microsoft:"MicrosoftOAuth"},_a=class extends Error{constructor(r,o){super(o);this.kind=r;this.name="AuthError"}kind};function $a({cfg:e,opts:t,state:r,codeChallenge:o}){let n=new URL(`${e.apiHost}/user_management/authorize`),i=n.searchParams;return i.set("response_type","code"),i.set("client_id",e.clientId),i.set("redirect_uri",e.redirectUri),i.set("state",r),i.set("code_challenge",o),i.set("code_challenge_method","S256"),t.provider==="google"||t.provider==="github"||t.provider==="microsoft"?i.set("provider",vA[t.provider]):(i.set("provider","authkit"),t.screenHint&&i.set("screen_hint",t.screenHint),t.provider==="sso"&&e.organizationId&&i.set("organization_id",e.organizationId),t.email&&i.set("login_hint",t.email)),n.toString()}function yA(e){return{id:e.id,email:e.email,firstName:e.first_name,lastName:e.last_name,profilePictureUrl:e.profile_picture_url}}async function bA(e,t,r){try{return await r(`${e.apiHost}/user_management/authenticate`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({client_id:e.clientId,...t})})}catch(o){throw new _a("network",o instanceof Error?o.message:"Network error reaching WorkOS.")}}async function xA(e,t,r){let o=await bA(e,t,r),n=await o.text().catch(()=>"");if(!o.ok)throw new _a("rejected",`WorkOS ${o.status}: ${kA(n)}`);let i=JSON.parse(n);return{user:yA(i.user),accessToken:i.access_token,refreshToken:i.refresh_token}}function Fv(e,t,r,o=fetch){return xA(e,{grant_type:"authorization_code",code:t,code_verifier:r},o)}function kA(e){try{let t=JSON.parse(e);return t.error_description??t.message??t.error??e.slice(0,200)}catch{return e.slice(0,200)||"request failed"}}import{createServer as AA}from"node:http";var Or="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAD9CAYAAABTCakVAAA+DElEQVR42u1dd7wdVfFP6L0pTUoABZGqIB1CBAICQghpgCACIQgo6E8RUEKNoCDFghCUngoSVARBQoBEaSKELkoHAUFqSPLevbs7vz3cOb5z550yZ+/e93bvnj/m85LbdveU75nynZkBADAgSJAg1ZQwCEGCBAAIUlJZNJV1U9k2leGpHJbK91P5TSrTU7kjlRdTeT+Vhal0p1JHiZR/C+lK5YNUnk/lIfzuTalMTuWXqXwzlRGp7JHKZ1JZPIx/AIAgfSNLp7JbKl9L5XLcmC/ipq7hxu7Cvwvx32KDx7i5Y0US5W+i/D/WfE6CRE25Tg1fE//+MJV/Idj8NJWvprJXKiuGOQsAECSbLJ/KvqmcmcqMVN5UTmwpiWZDS4kMr9PvJBoQcL2u/k5kAA8JHP9J5XepTEhl71SWCHMbACBIb1kfT06htv9TObEj8ld3gseWUzxhfIcrLgDRaRQR0UKEVjI7lXNT2RO1mjD/AQAqJ+IkPCiVSam8ihukptjisWXzuTZjbPl+3hIzNAodeMnnXJDKozgOh6eySlgbAQA6VdZJ5RhUiRcqKr3tpE4YQBAZQCE2gELcwkZPmKaES/OINc8gAHA+mjzjUvlkWDMBAMosn0CPvPCeP6ac8DFRjxOGeh47bHGfU7mV0z7JYErEjN+i5o50OArt4LJUxiCAhnUVAKDQMjCVoRg2W6g5nblqeZzRNk+Ym1+8Dxk3fxatwgVgNr+F6vi8FSMMi4S1FgCgSCLi8Gen8pISMos04TfI4cT0OZld1wNozfbPw88QM8yMmDgTX0nlrFTWCmsvAEB/EnBGp3IXcd6Z4ul5ONVsm76dTr/Y42TP8l2T38IU6pTgKrSs36YyBLWvsC4DAPSJmj8OvfcR8XKbNnTUYijO9p3IQejhnN6tOgFjyO4ETCwbPbGAKvWlCDLSiaksFdZoAIB2yOLoxX9GUfFdaisNg0EG1TpxgEfEDAXqfg8yqvxxBhMlZpgtNm6DbWwjJarybCpHBZpyAIC8ZMlUvqfE613U2azEGd1nIaeTOWaYDe0yEbjhQpcJYHIWRobXXsGciEA2CgCQmazzbdz4NQ0FN3FQbaknuxWnWWRQ9yWpJnFsklY2MUcLyeIHcAFXFqG/LcbmjVROChpBAACurJTKaam8rsmaa3WxZnUAxuDnjc8rxOgr0AIPgKMB+DgQqcPwDeRkfDqs8QAAOhHOo9MxbTYyeJ5jhvoaW2xV7gkaA98J6Lpeqw5An1i+Dgg4Dj+OEzDxAFnbs3dh1uLKYc0HAJByOKbWdms2D01q4XiubTx4zsbgpuq6Tr88Tn3XaZvVqcl9Bs64+mhXkpH5VionYDg3AEBFZQdoFL6IDIvK5M3P4gRsxRa3/XakkTqJVNQNn7P9hqo+14k5FFl+z9dM4ZgAEUPb0WlsLjMrRuD/cgCAasmKmHpbJ4s9Ypw4rhPMFqvmbmrXe+rG7Fb486JuwKxUrk/lJ6kcm8pIaBQS+RzmJ7hotAPRASpqEmwAjeo/e+LviPDa+Uh1vg3t6roCOImn6dKKBpB4Oj1ddOObUxkUAKDzZTcMEdUZarqNzBNnVNu54TAdgIh/z0vl9lSuwQ05GDdrf3m5F0tlM0zY+TU0yoh9BM3VhGynNjf27wMeiQVUIsP91PC+T4GKFS6pEoPvuxY731VIw+VY82X6xZpQX0ROd7Eo70vlEmjUD/hsicZ7TWjUKDwbk3i68HlisFc1ckUKErKJI+BXPeJEWsQ9/qVKeQZVeEixcf4KPXXyIsbm57zPobuakoHod2tKost1qRzaYTnxK6AZIUJxTxv8LlwWYpYcBI45kijzIMqZfS0AQPkTds6ARuWZmkEd5XjZIyb1l2NzUqebSGj5YypHp7JxhVRPWSDlD4p2QB2QrRCBXCaAaa7qxJEqCrisEQCgfCKKaj5l8G5zNr6PeeBagJSv/g90pu0KoVCmrHi8OzounyYRh9ihsXFCnjFT09CZF0LeSWU8+loCAJSAu389OVHqHqE+HycgJ1NNXltQin+cyoZhwztlA2RjPkfGkGuy2cwzFylLt0YkIL2cyk4BAIory6AXmtbbizRkHl+GmcleNYGKDNFNwzBayFfP5rj9MppI3QbzIAIeNyO2mHEmDUAnwlw5IABA8UR0qnmCbH4TAEQWGz9h2I6xIzVVLJILUvlU2MS5agW/UYDAh2XJIRu5AF2+JxuwfCMAQHFkWCrvWSiiNB6dWMJKJvtdx56jav6b6HQM5a3b20PhYujpiOTiGiSO9OHEcVjQ79cV3sBVnUAlLvuC+D64y3HFnj6A2JEMpP5fLATRS+94NEHCJu0bEXF60XHoXYVfkEUL8DUB6PsPlJ0zUOZ8/SmWEyCxoLor2YdjAsgyVMciGy5syv6RldFD/4EjIsAtaRaBu0IxPQBEPsF2AQD6tub+3YwMMWoCRB48APqeSh1+E0/8UJ66OLIqpvl2KTF8myPQpgFETE0yIX6fkQEA2i9DEXE5seHYQubh5pOrAPAqhqdCLnlxRYRZL0WfkIub0YoJoAOVbrz2CgEA2iMjNCG+VjSAyJEgIr/3dionB9JO6UyDCw18EB8nIEcDoKFfUZh09QAA+YpgzX0I7vp6WZ2AOi+/mNArUlktbKjSyuaYB1LXRIISh53v0iRt0aTZSEoLAJCD7I9psN2GSeSq/xFzUsW/56aybdhAHSNHo+8mYmYeRox1lIC9TPkdZTAHij5xI3Hj22ywLCZAonlfOo9+FjZMR4rQ5GYqZkFiiAL4agCRhWMwu+ggUPTNXwNe+a3YAQARAwBEnbhRYaN0tCyGiVj1DExAV2k4U9n2hzFyFQDAU+3v1iBs5AkAsQMA5OafUibHTZCW5YsKdZzjK0rA3NbdlYMgrvFoUddXUTf/QgcyJx5RAN3ESjrnf8savw2SSyn4X5FsQ1u5MhNARMCrTfA48hUCAFhEZH99pJz+Ols/yagB1Mlr9yO3PGyGasvB6GSOHGHAyOKDShwORskanFs0HknRQn0fgbmKblYNQJ1UMQmi3NO3ApMviCIic/Nq6F2ZyIcH4GIZSiez4AmsGQCgWdbDjRkxHX1ZnIBiAp6BChV8DOIteyssQheblOME1OWciHV4b1EOoKKg7/OErBF58rhtoRuJvKIU1zolXZiiQOghqexVwHsbginZnVL0ZDeFdFZ3rEFuiTLqjBa/e20AAIBlU3nMwcpztehKQF8ySr4m/Al3lThPX9iMLysL54KC2c9yXm7tsCjBq5owtIkHwKkPqStMc2HVAeBmaG5jZVKnIk8noKr6i042ZWkPPQb9E2oX2xPI4pmnUR/bnZIs4tjfSWUcgrZ8/XZlzAXQbqa8JzSWK6HRe7GMILA2moy+TEAuAMQY7Tq8qgDwc4fqngC/SaeumqtYkD8u0YI7X0koeU+JG19Dnq1biV6ISrVzFOfSlm26t/vxGjVkt8nX34XmphpfwdePUUyvGmZxlhEEhNY4yxEh8AWAmDgGBQjsWTUAOMJCqOC24jY1i5De/mNKtNAGIhNRJScdgu9N1jyb3OjHQ3MT0NltuLdBmhCq9KXMh+bOuwcomoFaY//0kvMFfmehk+sqSbkAgB5eIuN0g6oAwM5KYg+3BTU3DCg3yEElW2QraUJQ4/G9SeT5xNhtje9NI4tyfhvMgcGElyGutx/RAOS97Y6v/5OcmD8hv1m2EKyo/XdVRhMgYSQYibl/qj/yBvp6IHdA9p0LKTmluyjdUvx9HQGmDE6mbRXP+Wc0DqLx+P55mqjGevi9O8l4LVDCnOK7h0GjbiK3H4HognMuOhpH4Gs7aZxhwxTTQNUApO/iBaLN/ERRqX+HgPIMrocyaWmnQqP6T8JMBuIUplFBYHZfE4X6cgAHKWpuzNj8piytxAAOwpbasQQLaSpOttgE1yljQxeH1AC2VgCujhx2+VtzSOh0gaJKTsBrCPkAeHUNHlFU3W6kZUuNTTU1hivMTfnedcrvPEFMgFPx9ZOIpnNPCU2C77WgAego6THxl9zZlyHVvszC+hu4mzP4OgHl4ImFv29JPMsRcVSKjbmcspEkH+I4ooYLFfQK5fQfgKE31ZQS47AivvcOMYuOYPAxIqJpTMLrdUFzy64toLlC7xCyaK/E55GLem98/SriT/hvSf0C1xjCepwu05HhNTUl/cxOA4ATLCc4tye8CRy6lROp6LIX0WhquLnFe38hC2Ebxu9dRjSAV5X3FhL1fLzjtzbSgOvviabRjeq9y4bfAL8jNL6J0FM//3qyDt4rKQAsgv4XUyKRSwPQ5bhQzWDLTgGAldA2j0j6JZdNZSvqGJXM4bc/meganp6yoKVQwd9P5RLm722KJ70Ek2OVBTqfhJvOdfzWJhqQvlmx3Segb2A9T7tZ/f+15BpvlDg6IMZ4BsMH4HICmnwDd3YKAFznoPJyQoG65h3dGAYr06IZrgGAXXMg6QxDx6L6ek0BSfHvcxy/s5lmzG/J+fnPg+b2XnM6IKV4jobMxuEB2DJW5XePKDsAjAG/fu4ub6qKmD8q4YL5EvSuUrtem67VRez5sxnaBNWy/tiG6If0DdQZoFSWUmPPgr1DkU3Vt7EM32l3/ko7B2YtJeRnqsHmovOasqmuL+liWRo98vJZ/t7Ga3WTsZvA1ADaCQDyOqcgBbZTuiqtm8prFie3LlyYMGjGAlRuKysA3Gng87uce7Z6AGLzz4RyN2UUYb0HU3kolc+38To1spBcGsDmmgV4R0gRZstWmKdhWuOcdOJIE/4Wa/6osgHAGZpUSo7t79IAZqFTMSw4PgBIJ+AEBgBQs+tPYRy9U6PfAX7FYZcJIF8TWuP2ZQGAHZRQlqnvmg0IdBqA+K0XMfmligtrdXR4HknUZuGd/y2mC4u2VMtoTACuE3BzzYINGoC/DAV9NeuICQIm7eAlkolZSABYAimeNjXeRQDSaQACAEZXYPGIbLqRhLUnNv/zCknkUuU9lVlXQ16AzgnIMQE20SzO28OGzpzpWnfQ2WNNlqGt7ZiYw4uKDgBngbkza9ayXmJQpldg0ZyrUIRfg55a8t8mlFGhDsr6BjeTBfU2AQCVLenSAHRRgAAA2Ss4/VuTRanrQmV6j/q+pD9g66ICwHqEfRYznYA2TrV44H9VQPUXav1HyjPXMYQq2XPq+HRh0o54by5570OFpbeAUIHPYnjn6YK8K2zmzLIHyXuIHMlAJicgPRDvLyoA3AT6cl6JJ82Xqj7bV2CxbESyGsUY/hB66gHQfgYb4XtPk037rsK+W0CYgGcxNACqgs4MG7klOUc5vaMMPADTnhhbNAD4Apg78CSOTL/EMhgndejC2IVkLm6nbG41HZgCgGRAfg7fm01MrhctuQAuH8CWGhMgOAFbTyGeA/py4z4mAN0vL0NOZe7yetCrHCm7nI6sMckhv69DF8X1iq1/uhJDrpNxOA3fu5SMjTABZOGIX5DFdZNynQWeTMAtNCGoAACty/qE/MVpX+dyjou/hxYFADYhpw2nMIKLL/0SlLeEt002JJmA7yOSr6ikzsr3xykbc4FCn51E8gAuRFv9JjJmCwiZ5BwmAAQnYP4yTJk/Uz0AW99BnVn9FORQWSmPh/sruJtwJgbtQEeJFCfjzh26EA7QTOyqRJ2XabeDCNX05FS+6sGCnE+YgC4i0KYaDeDOsHlzkx+BuQK2jxNQfe//+hsAdteEOmIL3TF2RALqmD/eqYvgMM14yY0uCnL8EhoVg4blcK0FxAdwDkOTo/ZpMAHy5cg8RXw2Lh6AK9X4DUL+6nMAeJC50W0AoLIERfx75Q5eBMcQAKiTkz5PWUCYgC4fwGZ9mAswsKIgsCM0l1eLDAxYsDgBgRyY3+8vANg9Q0afyUEo7dRvdvgCOA56NyttFwDMJ0BzFkMDoDbon9vAd5iEPqOnlHBmleQqgy+A4wTURc7+Cy10vWrlQWYT50SU0QSQn3mmApN/HNEABACs3eJvrogU4nUtJgAnCvA5DUst72Sgo0mo84YKAsAncNNGYK4IZCPK6ajFZ/Q1AOxKsv04JkBkAQC1nFUny+EapmMrDSE2RvpvhCzAbTUAwE0G2lQzZ2q/v3UUenJWmUJA5uGKmgIXMjSAxLJf6PtvZfUFZH2AWzXJDhGD7GP69zvQU822k+Vg6N0ldg3l/UGYTbYU8/cuJuzBqcp7H3maABtrnIC3KHkKXWi/XsG8t8Whdyny28g1nqwoAKwHzaXRspgA9HA9pa8AYEdiw5jKdrmcgOrnD6/IxO9P1D5hCy+tqMeyjr9IJFkLehdXpbbe3WS8n7f4AFwawLoayul0dMp2EdByNfQQ/oQX8FnmQk8vwxtJmvgDFY4KjCdJPnXgtR9PDAfrW1kc6Flu/B7gNem0OQFVraFKsealka8v4/0PKe+9Rk7zccp7VyosQLVQ5FwCpO8RDcAnCrAYLiLVQXk+9NR3UOf3cOV5LsasRLUB6NWgbwxygRILT9AkqDJN+HFCEOIyAU0AcXa7AWAT6F3swMcJqIv7f75iEy9i/K8gb3+ospFq5HQcr/hbasp4CXNpSXzvMbI531Ku8yEhAp3FuDeRgTgPf1MkGq0JjUKmdM5PhOYqvzW8L1mt6WGyqC+EnjqRTynPsWOFAUDI3tDTJ9PGBOT20xAHwLLtBIDziRc78TABdOrNbRVfAFLW1rDEZJ7AEdC7pfSu0FMPQN2cswgA+KQDq1qKWql4Gw15RWonc4jJcADSU/9BDoWfayIOq4V5/1gLuE+TLMTlz+j22YntAoDF0eOctYOvTrYLi+BjWVnRAGgy0MmabMC9lbBit7LJVR7Fm8qCqilqeJZIA2UvSqbic+T1w/D1R4nP4MIwx0bZTfGxxBlNAPW1J9oFAEdCc62/xFMDoNGCe8LkN50E/yGq4LeUnHKaK7G38j3hoZ+hcfLNVuar3oKjdRGMW0uAWqhEbF4kGoC8xlToKWMl/n4nzLFV7mM4AROHE1A194a0AwDuz3DKJ4bEhrrPTVZELlI2q9jkstX2DzQawO6M3xuCm7WG0YFWKNZ7obovnFaHKK8/S7QM+d4ueO1uNEU2CPPrTBJTfQGmZCCVCpwYXo98nKvcG/y0JlRhcgK6CAwRqohh4nvb3mchVXYf5fV9yfgKJx23RJqoM/A1aF8p9RkkpfWLJLdAtEJbPcwtSx6F5u5CcUYNQIaXV8oTAM4Ce+8+lwmQkBNsbIkn6gvovBQ02QP7yDy4UQHgiwo0Ftsh41Dc1+Q2/P46mCEpOhR9vcMBYCz0VHLmOgFtPTa+mRcACBvwZQYycSoCxag2lrUl1Epoq6v2+MF9dO3PIvgUkdu+A+RQnILIIEx3VYkywzsYABZFB14E7ma5CQMYnsgLAHYAfaMDHx+A+tq4kttqNZLMc2NQX9siY6B3Qc3LOvyZDyVcEO6e0gGA0Ca2zgMATgFzDbPEkgtAMwUl+WPZEk/QCPJcdaTjhg2bvxyhWU+/6vBnXhKZopwQIMfXdlIeAHArmIsZcpmAEgB+VvIJGqlJ550VNmtb5EhNyuxlFXjun4C5VZ6LB+Dd25Fjl3yUgZesK23UjV7pASXXAGhFnwAA7ZGjKqgBSOJVxMytSRwawPvgqL7kupk9wK9CiekzUYekfo7SmDYBANqnAdTJZri0Is/+gMehq9v8oIzZkFYA4CImP9lVFFRM5A87BAAoLTa0z2qfD6BOAPdXFXn24zScG1voz/S60+x23cgLLfL91RvZsAMmZqTGCRg0gPbFxWmzlKoAwKqGyBt386vyelYA2JLw/mNH+CEGc0+AhzpkYlQnYOIwAb6AefGisu5Ehdob8h4a9v0MdDCfaLBTx2ocYJdVaJxuA7+CIDYtYHAWADgH3HX/OBqAmMAzO2RSdGFAXQNNWlxDfO4lJY+/ynIqGRfhHB4P+gKiND/+8gqN07csuQDgoQHUbcBpu4F7wa88UWwIF9aZyStlcgK6fABfhObqt3KxbxUA4OMWZlSbnKT53DhNNKlKAPAFhh/AlCREowH/8gWAJZUcZY6X38YDEL+zRIeaACYNYHeF1x0rqbE7BwD4mNdP28VNtmgA6hqbWDFT6S0LvT5magEy/2ZjHwDYHfzKftsAopOYcqM02s1s0Jd6opxu8dkdAwA0AYA8OK51AEBcQR+AkCtIhqAPE5ACwPE+AHAS9FSa4fgATMlAQr7bQRMymkkF3kfjwQ4A0JBbNABwjcUJGFcwDKjWj6xlTAaiXbem+wDAjdC77r9L9TD1Pd+iwzQA2j3nboMGQMM44v87BQD4GADomrmOaQJUTQNYSmOK+4o8fN70AYCXDASgxJGeSCfsvZIMtEhl3QtlMYYJoA6srrTZVzTqa/AB9JgA1LdkAgBKBJroSKTZ3xbyKqncZ9hv3ChAoozj2hwAWMGgdnDSE6nde1MJBlhU4rkfkbbuYPaN1vAAdBrAfmhCqaBYd2gAh0Ojlt6vkYNRtoX6DaSwigV7gocPwAQAR5GxtmkAq6CnW9YNmNFBADCBaJO+IKBGoQ7hAMC+wOvuYwtLyIV/dAkG+Dzo3ZxhFwcTMHZoAF/WUIbFNXY1/O4l0NxIQ4DRtiVapIeQcRHP+gMHwcXlBByr0aImMijrcl727BAA2I5hjrtMADk2V3EA4FTI3qmUOr3WLMEAT9EknRzISAaS6HqvwwmodtoxqacLNOBZptyJszWnzhyPKMA1Fg2AwwScqll/B3aQFvBWCxqAugb/yQGASRang0868GslGVwfABjZghOwbtEsapoJG++4b9FYYwyaG4u2aWw+hb+/vuNzP9Zkoj1oAQC6ZlwagIsINF2zNjupfNh0jRbgwwNQNbMlXQDwACP/WOeUiMhpV5a+b1M16rpLA1A/e49BA4g8AYBqWKdZ7llsSLWPwKPou8lzXA6CRnVZaVfbinJeonE6/Q3sBWa4PICIYQJMJwBe7zAN4FiDGcBtH15X+AC72gBgIE461wGoYwJKAPh2SQZ3GlE1bQDAdQLuS5yAclHu7NAA1HG1aQDXE62lDvbGkKIn3y/xXoW6vZFjTARz80Ny7/PA3M7rIs3C+3uLADBW4wS8nGECyHnpJA1gGzA35YmZp7/cl0fZAGAdcPf+c5kAkvY6tEQAwLUfR2mcTXcZTIC6JmS4s0MD4ALA3Zr7mGIJcT4Dzf3n3nWo9dtr7qeG5oDu8xdr1sLDHkQgUxSAywScrtG2OkkDWBQdw75EoFgTiZpoA4D9wF7Xn5MOLJFmqQ7UAKgT0AQA+3oyAWsam85mAswm6nEdn0P32d1AX7D1R5bf30UzvzXo6Qno0gAiSwr4Hzw0AHrPJgC4QfPZTish/pAm8ScmvpfEwc+powZmBICxFu4xBwDkxV4p0cBOzWACqAv9LgMRqJuMifjeDjmZAH8hExvhc5hSmBOiItd1ISFFdjZoAMM9TIC/WQCA4wQ8yoMJWAUAuI5hArhC80LetgHAZR5xfhPS1EpGxNDZjzYAoKf6TEsyELW/BudkAszR3IdJAzhYo0rrWnar8iUDk3E40wlo0wCy+ABcNQFv7HAn4ABM5vF1AtIeg7I47+ImALgZeH3KbeBQw7BQGTUA1+kxRqMBzPTgAZiYgN2eGsBs6F10ZaoDtGgSkw0ABmvmW9zjATmYALd6EoHU+760whrAUA8noK3NeITkIi0APMtwLrhMALFQvlqQQVuVEcOeolk8HB6AywlY0zgBTUzAumZcuQDg0gBGGyI2tgq7O3maABdrAOCRFpmAPk7AGzXz4gIAQVL7LOTf0qxdsrwhRd+nX6Ccx1EmAOhibPCEYQLs1s+DtRguKqkOPoShMJsJEDFCSCM1TMBZDB6AvI/BDCJQwnAC3qsBgKmWe6YORpcGsC3o+87bACBmAsCfNCbANcwwYB4+ALHhr1aiIg+VhLE6AEOztuo/nFCgGNNv6QBgCeA3IlAFNAizXD8P1ClK3LSGWslMDwCwaQCUB2CKAujSgXexaAAU0cd7AEBk0QD2NSwEWxRgK8PJwTUBYgcRiK4lbj0AEwD81oMHcJSS+CVrEv6pJABwb4tMwIRGU6hKFEG25p+0N/nAfh6oyeS0qyGRxUYFVjfHCKYTMAJ7RSBqAgx2AEDCNAFmaSZ1uuGzK6DnV130kUNL28oQBrRFAWImANzG1AB8OgPdqDnlhltIVFRbmV8SU2BGC7kA6rqdqgOAnYjjygUAprTDZwrC76eLbH4OVODRmpNmtsEEqJGxtGkA3ZrxtZkAMzUm2VTL5wW/4w1l87sKa2wIvQtS2ohAOicgVwOIUCXnhAE5AODyAUzRzGGTZ7zAclUOPoAI8zF6AcB+BAC4KgWd+FsL4tmnzRUXeJgAIxhEoNgjGShyAEDNEwCmkPTlGrjbZi2GKbIbM8ZvWQRM9RpCg9jE8PkLPUwAbk1AHxPgRrImbQAwSWPGdUE5SrYfn4MJIP4+rgOA0WBu7WVr/kk1gKkF0wCkSugCAG4ykDo2NU8egIkK3OUJAOvjid6N8lwq6+Y8hkfib8taCTaT5EKNymkDgDrwawJy0oFv0PAAhjPMQ7VoZhmYq6OZxB+XCfCeDgDGgr4rqU9Z8DoUo3TzFA1gfZQDD2A09O4O/GeDCdCtSZAyUYEXegKADHHuhlpFu04vETn5MiN56KceGsAt5PTl+AA46cARUwOYrNEAukuiAQz11ABMZntNBwAToHdJL18egPj+D9o4ACJZaQjGRNuhASQeGoAEgHvBXlWJ4wTs0gDq6SUiqZwPvYtQ2jQAGko1pQPTMOBESxQgJvM9wmEeqvfb5dAAVsO5W7qfx3mDHHwAcoyWoABwuUMDcAGAHPjD2/TwslR5HVWYYY4oANcJOK1FJ+C9BqebLhloV4cGkDCZgEWTczycgH/UHDRcE+ByBwBwIjnTNQBkMgFEFt4VCBDi1BSVefqzy9WyjJwczn6NZWq3+uPXGOx+Xw1gRJtO/nnQXKz0fTAXwZhMwMwVBeDyAEZrGGezGNmArpqAdxFzQXxnXIkA4GCNTT2J6QT0SQa6nOkEtM3hVEMUYBmwFyaVc/hkP47zIsw96soXEP/fggLAlBZNAKkBDGvDgx9A7HRpx+zgmGSOCeBTD4A6YeoWJqCOSDPYkn//usJZEG3ZVykRAAxER+B8hV03yOID4PIAqBZlqwhEta0RlvmmG6gbT1cdZ4Dea1c/j3U3+FcE0jkOd6QAMJVB9EkcpkEdnUbtaMhRI6pbt+VEzcID8NEAXOnA+2pi+7aSYEJWxOseWABbs5XCFa57b0UDmGiJAnA1gGmaOawbNIBJGodldz+P8QcZiEC6zw2lADCNucldJsBObQYAVQPYmekEtPEAfJKBuJ2B9tE4sEJjkNYrArlMAI4pOkXDBOw20NenaBy5/Q0A72RIB9Z95isUAKaDu/S3ywQQ8vkM6uNyDvowDb+5TIApmgWxgMEEzKIBzHJEAaIAAL0AgFKfr2MkA0UWALhBsz5tGoCOB7CchTMQk3z6AQ5NbrM2UotfBf/WYDrezjAOAGQJA27u8TBnQKO6rbCrXsSNY9p4NY39vTMDACIlRyFPAIgtJsA+4FcWvGqtweg6u57JBJyYoxOQAsDyDtIQBwAuwoNGzP2/MXks7/F7oUUmoBEAbmD6AChAALGltvJkNdEkjk+DvhBHpCF77MSYZI4GQNV6k/o4RrOpTZ2BdBzsIQEAtE7ASeCuCMSNAriKgk7TcC5qeHLbOAMuJ+AI4ktK8NDJ25n7HGSvCKTu42G+PgCXdiA38DbMB7laY+N1YbxfV6NeFwXgAkDskQtgaypxkOZ3ZzFyAeTiGRwAAH6vWUuTGCaAiwocM/040zQaQN2gAeh8SSYN4DLNGu1qQ1TseQYdmOMEPMAUBWjFBKh72Lk3GUJll1hMAAoAO+bABJyiASJuOrApDLgn6MuC7xoA4H/jrcpkCxMwYWgA0z2IQFM1fpyaAQB0mmQN7L0aYhKpOjjn8Xvd8/Q3gcRwHQ+AowEkDgDYg/kgNxgAYALYC3FwnYBZwoAcJiD1Q+hMgD0MTMDgA2g0jKlBcw8J3ZyP0zgLObkAHA1AFwVYlmkCdDM02kTRAA7KefzmGTY5eJKBepkA13smGJhMgH2YD3Ia6CvP7sPkAbh8ADRzcT4jtTZLWXCdBrAb0Vjk2GwXAOBj77ikX3fh+C1vAAC6oSbmZALU2wAAJ2vutx1zvjAHHkCMdPUBlPQQQWtFQesens9PYkhDppwKmW0IB442+AB2ZEYBuCaACwDGaNR6HQBsQRJ85En3qQAA/5NlHBl4R3jwAKZD76rHIxiHgysKoAMAkwmwBuYKdClr7u9tGLeoxWQg+Z39TclACZgrAuk0ABoFOMLjYcSGuAAaNdl+asnIGmmwqbdnePa5UQCuCUC1kJkGbsMsaK5LeGfY9F5yhEcuwDTNfI9gmAuuXADdOrKFAbfC9HBRq+FSTNnOm2kZEXU/azLQXhQAxmfMBQCCkKe2YTEcmNEJGDN4AFM0UQCf1mAzLQQn8Tun4GJcImxqL9ExAV25AFwNIGKaADo+Sa0fx2QFzwiAzV+3AwWAozUDbutHbjIB2lEQZJjGqWYLA/pQgXW5ALbGIJzegEFal7Gak9pVEShh8ACma0hDXQYNYIom+7M/qcDbeHj+bfT9WPJtbPYtN55IqcCT2/Dg+0FzfbqYSQTi1ASc4hEFoJ2B6kG1bzsAcKIAPk7A6ZroQpdBA5isCSf3ZzbgMOCn7LtMgOUoAIwAfYca32SgdtRYXx9V+Drh1q8O7oIgeQIAlwcQpHXRaaRXMAHApyJQZAGA88i6qCERp7/GZIzG/s/iAxDjsxgFgD01PgCf/oByo7WrM/A06ClQKa5zJYNsEjN4AD5hwDGa3w0mQN+YANx0YJcTcJrGtKgZ0pjXhkZPhUhR/8/vxzH5bsZMQLpn/3cY0lM2An6RAdN7C9v08CJkdCii8n6ObCtfJ6CPBsCpBxCkbwFgukcykKkvgKmOwSCMVF2HDu7+rB48sUUAkK+9AobWYHXw7wwE5H3xGysVhG7KSeLwKQo6RqM+3h02a9sBgEsFTpgaQKLxASxTgjH5rWbP+VKBxb/n6ABAsow4BUFtSNNdAM67zgToytEECBpA34YBXclA04Ff1m26IR24DFWYHgG/1mCmCMANJgB4y4MDYGsPPrpAABA5wje+yUA0JTk4AdvrBEw8fACcsuCTNSDeVRIAWGjQun3SgZt6LNILzAR3D0BXFEAM/o/6eaCu0ywIrg+gzggDxo5cgCD5RgGytAc3zeEkDbDMR5ZdkcdjQ4vZzQkBqib6WBMATAJ98QAfDUBcYEY/D9ZoEi7stsTrJ0PvRpgcHkAcAKAwGsB0jc/HNIeHE1+XWB93lGA8DsF7baU3YEwT9uhFTrX4ALhhQCH/LMCAfTOVp6DREuxuDOnYNABOCOkg4FUECpKPE7AO/q3B5BzaktLOTuW/qBUKrXfNEozHhY7T3qYBUC7DeiYAGKXJu/dtD160dsuu4oyTPZyABwGvMUjWRI8NoBxtqvvKCUiB+TJHFIDT4VnN1Vi0ROPxO9B37eb661Qf3SImANgZmktZJRlNAHGRL5VkYCdncALmTQUWSU0v4m+Lv5sGAPBKBroBeteWPLDDxuNtpgZgqgosgfFx9XfpRZa2cAE4FYHUjKlvl2Rgp0Dv4h3DPaIAM3O4hzuU3+1GtA8mQG/vtY8JMLyDxmJt6F1uzLczkDycp9kAYACyhCLLho8NDgjaCnt6iQCA2x58lEYtbVUDGIheaBVA3woA4N0ZqJMBYCT0rjjs8gPo+niI75/pAoAbQV8QhGsCyO++UGIAaLU5qI8srUll7QoAAEdCa70BOwkALlDWSJZkoMjE0dFd7AwwVwTiOAHVSdikQwFAfeY/t3j9ZUlosY6RC7XUlKguIxpqTCgJZTXPikCc9uDTOlwDeNDhl+NsfgkA67sA4MsZIwFU1RByUgkG91porjXgqwG0CgDCI/s+iUu/Sby/dcW0OrtCGgA3HXgy9K4VMaJDxmEtaK5f4CsqCLxOf193wRURKSLPdOBYM2G3lGCAjyVpxuLv1h5RgD/ncA8zyeJV/QofQPvrLRTdBHBpAGcrn5Vz2ClNWA42OACz1AOYwQEAIY8ZAMCnVoCkWC5S8AEWhRFuU0DgdrAXZKiTKEAeLLKhCujWFBLLKtBcXbgoJKu+1gBcALByKnOhpwjrlA4ah6sMGjm3epe6dn7EBYBroXczTl8NQCLx0JIMtKgwPMRBDhmlMQHyKgkm8s5Fyactif1Pqcf/Jt8TrK5PViQd+ArHd/aAzuu/+HLG7Fxaq1PrGLWhb7eGi82hAlNv7EUdNBljCBrnpQGYZHVCzKojIUS+f7kSNfhuB4YBaZGPiRXRfqR8HnpXwzYBAFjelwCwBhcANlNUYm5z0NjAPX62gyZklCaR5NY2Xm8pNKNUDUCGVzdV5khGDpbtcB7ArysGACdrNPEsyUBifTypu4bt4m84NnrE0ACkGbB+hwGA6gRst1Pub2Q8b1eiNVQ72L5Dw4BSrqwYAMyxROS4yUAyN+dKXwC4Dnp3ZzWZAboIgLowj+yQCTlQYwL8sQ9OATVC8X9KYlIXiR7sQ6I5ok35SiUd60M0h0qVAGA5Ep3y5QHEJAPwq74AMEJjAviGAXuVICq5bKT4RiSyXtjmawqqsOjicgJuaDUzsUYmWvai3zWVDxVacRm7Em+AZk1d2QTjKgQAY8Ddq5PLAhQHxWq+ALAY9JQg4jQjiCw3LMoQL9khEyNO4HcwPi8KqKzQT/exLwKQCgBDDNlxvynpWB+AXvAuDO0NrBAAXGs5cMGTBjzHdB3XTdzqSAoyZQPS98RJ9fUOmpyBBViMn0YAkCfkQgWMniN+iqklH+9FoFq2/wAM93Io+C4QEPM/PisAjNN4Ym25ALa+gneHBJfc5WdKGHCCwYEr5uUmTXQhtCovrgwmJjUn689WEHT7rACwiiYji2P/67yRNTy1wgTnrwlsQF57icyLCgDfQ5NMvH5uGL9CyjUWp7pvMtAHNm2VczOPGzQAn5qBMhPpvDC5fSL3EvNrosI2VP0Gb4axKpwsAz31IWJwl+l32f/WuhycG7qUkQuQGLz/9Gb+U1F7rq/lh4pvoAudaQOQCloj6uGSYbwKJcdYTn+bBgAG+/+wVgFgFAk3ZfUByAU5Kkxy20UUFv0Oov9xJJuRhnY/EcarUDLXElL30QKk2b18qwAgMq3mtcgDUCMETwUtoE9kYwxZDiPkGlpbfvkwVoVK/Y2YoXWOCeCsV+mTkuhKB7bdbEz4818Pk91WGYp2ZA3Dg0fj6/soySVSRVw0jFehTv/Iklvj4wQUc3tiXgCwGzRXzeFUBIoN2oH4+3CY7LbKJGiuWSCjAMui40/O5ewwVoWRPaGn9gO3ApcLAD6fFwCIMMIzDHWE21YsIrTWIPnKX8lYP6C8tx00Cr8KUNgijFWhIjc1S8TNlwfwHw5ZzecGvwf6UmE+uQKqs/DvYdJblsOh0eLqTfQeqxWdVFAOY11s2QH3lq4ID8fW1732c861fW5yNWguT+XLA9A5Bw8Mk99SvHgBNFd8lQUf7iaOpPvCeBVa7lSyPWNwd+KmApqI21Z5A4CQaWCuTxYD32Mp33+yYgkeecp2ikNPLh5Z8ulqMifTwngVVnZScjoiDxPAZmo/xL2+783uAu4CBTYNgN64WMBHhkWQ2WmklouqYxhJvLcfJxc8SCHkHgLkiUMDAIcJIH7r2HYBgJBHwNw4xKYB6ByEEfLWlwgLwSrrY374UEVj2luJ6UsAGEnSlh/BhKEwhsWUL0FzxSOO6eyy/0UNheXaCQBfAXujQq7KolbV+U1YDEY5DGP5ddzwE5TFQ0uCBZ9KuXw4T0JzwZPIY/ProgDa0t95A8AAjB9HDAAA4NUSiLhOiwrK38kYvqAw/WqKml9DezKMWTnkXEKgiyz8GVfRD/l3gS+zsxX7s86wVxIGAMjTa3JYFFp5h5hX85T35igOpJeCQ7U0shaJ4OgAgKv+q38v9b2XVh7iAeD3DYjBXU5MLOTNK7ogVsVQkAiziirAanOQeWQMP1TeEwU/T0/lMmiUcg+bqzynf42wY1UAAM8woPyNDfsSAIZqAICTC2B7gEcqmij0C2XsaoQqPY+M00dtuP7KBkfsYhatQqdqirn7LH5PfX0J9B2FgjCNsm1vQ+8uWiYTgKtV35Xlflp9mPvBXhXIRVukGoPQAsZXcFE8Dc19FLqVDfkW0ZTyLOIxEDkCNQSascRDLerSvU+ci5+DRn9CcZ9PpLIuvr4i0sW78f1BynfU3ou7VxwALlXmOQJ7LU3ag8PEEhS/NaQ/AGAo6JuBuDoL27SABRXjqA8k6dbSK7wyvv8g5NuOXJXNCZFIBZe/KJtW7Uf4G3I/v8DXvwPNbcx/ha9vRKIVd1V4828O+toaPhqAzjy4P+s95ZXEkLV2mamRyGMVSlMdiLa/esrXlBP0UGUjdiEfIK9r765xxsp7+pBoJUvjezPIwr0RX/81mcM/4OvDCHnstYpu/kWQoVfPCACx5dDctz8BYCPlBOPkLbvajckFN70iC2NR6N0CvK6o1gPQdhabdZOcrz1cAwDC9FhSiS7I11fH79xOwOp3Bs3gLiVhST31XqkoAPxS0e5oYhwnCmAyD2a0cl952jV1B6PJJ1VYboKzK7I4Xofm/P3uPmJHDiNzsABPKhWUZGeZZfA7t5C5moSv/1yxVcXf32s0gKgVdbXEcjTZ5LpCOhwAoHtKzMvaRQCADUlYw5UIZNIMdEDwpQoskN+S039uH133i2T8/0Ick2oZN+oDkGB1krLI1Y1+Cb6+gaIBqK9Xicb9Lpib58YacABwVwQSr/201fvL80Evt4CAyzywlUB6DYkTnbxIPo200G5k+g3uw2tfj/P2GuEf7A+NsmLz8N/y9XVSeR6/82gqn8TXhdlwB55K/8TPye/8BF+/TdEkqmL33+845V1MQJMJIKIzqxQJAFbTxDc5TEDb5pef+6smttyp/oD+Wqim+1nU4Lg09URcPMT6/yc/JRtbpwXEBvPABQCX5XGPeT/w8WCvFxA7Yp2mwiHi9DgtLKggJZL9SJqvaY3rgAEcPgDxd9MiAsBADHV0Q+/y0xHwqgmZCBFCHd0uLKwgJRCpDccadd92+tcdB6eu1VuhAECGBRdokoWSFgEgwhDSemGBBSm4XMXwg8UGH4DLBJif5x5oZw57DXiVgjgxz0ghyLwCoZptkOLK98Fc+yJ2mAAmJ6D6/tfzvN92DsQllvCfbYBcnOgIU2S3DYstSMFkHPRuveZqnsOpCCTNgxvzvud2DsbSGC5yOTNMiBhbCBOys23QBIIUyenXhf4vXeTLtfltJoA89NYuEwAI2YowymKmBhA50FO+9gamn4YFGKS/k3zec8TxIwYI1EHfU7MGPe3dSgUAQr4N7tbhHA3ApD28jYy2sBCD9IcIwtPLYK+TaXIC0s2vW/d1pF8PKCsADEAijynn2UQDThxMQjXxRLRB2jksxiB9LJ9SWJEu/ktk0IRjR56AMHXXKDsAbA/NXWk5GYE+RKIaUiO3D4sySB/J6kh5jgwJb7Z1bfMB0EIfo9r5HH05YD9mcAPoJgdmiFCmWb6GPISwQIO0U1bGPIiageXH9QFEliiA+P817X6Wvi58cSvTDLDFQ3UIW4fmqjbBHAjSzpp+fzNsZlsdDB1QRBYQEIfZip0EALKQ5Ezg9RRIwC+XQFXDRCONMyuWeRak/fIJaJRit0WxXJV7I0YugPj3yL54pv4YxCUw7zzKsMltZZHogHZjHnsIEwbJQ8Q6eg7XlS0qlVh4ABwmoJDz++q5+tOB8iJxoHCZgNyehPK3RT77mLCAg7ToxH7Lks/P7Ydh0wCkH+vP0Iel8fu7UsrrmsgAxwSIGe9RbeDCkKseJIOMgEYvBlf/vsiS6+LKB5C/+xKaGQOqAAADMKf5bYcnNfF8T9eBWKKrSKNcNCzqIEz5ATSXObPV7YsYJoApDCiu8UEqX+jrZyzCIA9GhI0YA8nxD8QW1UsM9MMhVBjEIUtBo9ipTd3nagC05L0uCtDd7nh/kQFArZ7CVfNdGoAOeaUWUEPe9jFhoQfRiKg/OdfAzecAALfUnQoAp/bX8xZp4MdD79LitmQgk3NQBwB1g/p1N/oiwsIPIkRUMH6BYatnMQF0ICAOo6v685mLNPiCKHQ6YVdxw4CulOPIoiWI6kWiwGJoXFldEanrP0Q6ua02f5bOPabDSvz9OfRzM9wiTsYBSOTh9BzkAIAu08rkiLm8L9hXQQol22J8n9Ogg6MB2MKAasivEE1wizopX8GTOc5BA7BxrXXFRp6FajQjqbqIMvMTwNyl12YCmPxPkYOsJmVGUcahyBM0FHqKLHDIFtx6a5zPCQ3kT9BohR02S2cSe+ZC70adtlh+lDEKQOtaivThVQIA8EQU+ngVmpsq2qIAOiIRFwBMoCDadm0SNk1HyHKpXGGgoSceh0TCcBAmGoefSB9es0hjUoZJGwQ9RRe4LEGdE7DO2PA6VK9hnHZyKluHTVRaEfUjnzBs0sQDAEyefZd/SkQX1i7auJSp+MJjBhDg8gC4GkCiAY66AgTTQoJRqURU07kEzbpugyPPpS0mjChAZNE+hV9p3SKOT5kmchCiqAwTQkYASBzMwYQBMOL/d6YyGqrRs7CsefsiJXy+B5M0YpqFru/I367j5l+jqONUtkkVLZdmGxIyIgYAcE0GDtFImgf/hkb322AeFENWSuVkaNSJjMDelNYnYYejAdDfe7poNn/ZAWAAEifEBL/r2NytOgET5smgmgkinnxtKl9NZdWwGftUdkBW3UILmcxVjSryIJTZOAJiLfwMSlCQpswTvi76BepgL84Qe4RwXN2KuJEDCQiPILtxh/5mfHWorI4Ze0+DubtOYkkzp8I1JV1Vf88syxh2AoXzSk0OAaf1kuvU5+Qa2JyH1IEo0p5vSOWEVLYJgNASZXxPzNZbAD0VekyqvcnLb/osp/CMDgDkXF+A9xgAoA/la8jjrnvmAiQep3rM8AybuAi6BSYW7z0IYKLry46pLBs2uFE2xs31MhPUXZ2pYw8egO0wUMljR5ZtXDtpgXwObfA60wmYgB8ngFv7LfHQENSKRfIUEZGOqamcmMouFY8yfAY1prugp/kGx7HH0QZ8eACJgwr8Mmp1AwIA9H8u96MEBGzJQNySYhHwy5D5VjE2dYipKyeLKGJyMTTqJnRyRSPhwT8Qk7JeUCItHB+MT/FYjg9ABx6RZl39tchhvqoBgEzy+LFCGnJleOkonq5ipFz/QWKxJ23/d7VG/1WHkJFEjUbRw+F7qdzu8OX4OmRdoGvzAbiuLe/xirIDcqcnfDzLWFSRh7qeME56zoJ0tUezEVWkKrwA88nXKtm8bJnKWdAoDS9Ddl0e9jyHt5FYnHgJ+BfupMlAglx0RCfsk063IUUPgm+ijdZtcdhFDnU+8rDxk4ybn6MJJAaq8vUFz1wUlXbOTeUfDB9L4jm2HB9NwpwPVxhQrKFZJQTdygKAWuTxPIM96aIJc2nEHJUUGIuUu3CpSlpDzkHR4vSX4glv875zfDKJp83v0q5sYUIdENSQ8dlRPpiqeZX3hkaDh5oj8SPxIBH5nja+GkDsoK4mBARuKEDkQFxfFLr8yOF4izNEUbJoWLaKUqb+ffLf3eiQ3LET90RV2WNXQu+e7pwwITe2zP0eh6XmYxZIEJjaj0SjzUjaLdfpxjm1XQxNjhbF/ZwkcP0CGj0tBwQA6CzZKZUHLad74kEV5vIKXNmHPpsltgBAHR2EfT2mwjE2j3nqu56bqxlwtQsXCYjOt6AXD+70fRAYZgBfh0ZLphrY67f7OKpcC5xjsybAJ7iY7mnLPhzHy8GvkrPLCeijYXEiARyNrIYe/tOhIh2kAgD05BScodCJfW3NmOFsapWpFhuIKzat4vo+Gr9zPEAqcfAmuE6/GPxCrpzW3c+hZliZtR82f7N8MpVrNA7CCPw99D4e6sTzs9xwl3BgrdbmMTuOgGYWrSXJyQTg/Bb9TB1P/dPwIBgQACCI4ODfqziCIiYpxdeRlWXDcOxp9d/tDA2Oc2TXcYtwJMAjWvmy/mzAIQFe1G/4VFXXetjsdtkKvcCvOFhkPmQWjs3rS2CxObtealNE4PsOTz8H/GLwr8oTt6hhCfkvNAp2VL5JbNjk/CpEh0GjwIcpKy3x4J/7aAU+GoCpLt0eOY/H4dC7tHaSQVWPoTWCEDdFW4b13kZ+wlJhTQcAyCqH4qkaGTYBt7gEV2V2Za+5gKcG+Xaf3QidpVnYd1yeRZwRBExjVENVf92wfgMA5CEiRDQSGgU9uPUGs9r7ruo1rg1XR2JQXtV4Hm2Bfpt4mD6u77u0qzomGwkT7jNhzQYAaGelGrHI3iQU49iyYH3CfdwQo41W+1BOz3ommLvq2Oi1XM++Kwc/NoQ+I7LxRTepU1JZOazPAAB9qRWMgUa/gDo0NzExbXgAv4o1PixB9TPv5vB8m+KJWvfUZnzYeglkq9AkQfdxNNFCvcUAAP0qYrNcBI3a9HVDFqJPXJ9LojF9vrvFTSG+O9fg94jBP4Tpk/NvCt+p3ZpugUa1pIFh7QUAKFr0YN9UrlPAwFZgJGHYvKYCF7bqRWKjLNnCc4wHcy0+HyKUTzjTVLmpG5/nPiQhrRjWWQCAsoDBttBoanIbpsq6Ohv70INNmy5qEQDEPS8w8CCyMhU5QEHZmK8gS1PkbgwK6ykAQCcAwh5ISHkcmvsIZKHVxpYU4a4Wklse8WD4ZeFA2BqriHbal+A4BfU+AEBHi2gldjA02pC/aslD4PQeoADwfgs8f1s33bw0ALnpRcHTGakcn8rmYU0EAKiybIb59cJ/8Dz0rmJk4x9QHsCTGa7/Wczt5+Q6cJiA6v3IZ/kwlT+gj2FwOOUDAASxZyoeiKm3N6NTUTrEpDdcV75MbLgbMhB+HvTgHSSGTV5TqNOChvtHaPQ3ODiQcwIABGldRHXaYdBoLSYKcszCWD0lxpzt+bsna/IdODH7eegzEAAleheMhUYdxtApOQBAkD4UUQ59DQSHH6aynafpMR9P7oVIIpqLtGehSVwNjeq4AnQOSmV//M7iYdwDAAQpv6yGSTOLhbEIABAkSJAOlv8HOib1/JuFBpoAAAAASUVORK5CYII=";var Ia="linear-gradient(135deg,#3aa0ff 0%,#6a6ff6 52%,#8a4ff0 100%)",wA=[58,160,255],Bv=[106,111,246],SA=[138,79,240];function _A(e){let[t,r]=e<=.5?[wA,Bv]:[Bv,SA],o=e<=.5?e/.5:(e-.5)/.5,n=(i,a)=>Math.round(i+(a-i)*o);return`rgb(${n(t[0],r[0])},${n(t[1],r[1])},${n(t[2],r[2])})`}var Gl=Array.from({length:65},(e,t)=>{let r=t/64,o=Math.exp(-(((r-.5)/.16)**2)),n=Math.round((3+o*(.8+.2*Math.abs(Math.sin(t*1.9)))*153)*10)/10,i=(1.5+t%5*.2).toFixed(1),a=(Math.abs(r-.5)*.7).toFixed(2);return`<span style="height:${n}px;background:${_A(r)};opacity:${n<6?.92:1};animation:wave ${i}s ease-in-out ${a}s infinite"></span>`}).join("");function $A(e){let t=e.markUri??Or,r=t?`<span class="mark" style="-webkit-mask:url("${t}") center/contain no-repeat;mask:url("${t}") center/contain no-repeat"></span>`:'<span class="mono">AC</span>',o=e.compact?"body{overflow:auto;align-items:flex-start}.card{margin:auto;padding:30px 28px 44px}.badge{height:140px;margin-bottom:22px}.orb{width:104px;height:104px}.mark{width:78px;height:78px}.glow{width:114px;height:114px;margin:-57px 0 0 -57px;background:radial-gradient(circle,rgba(34,197,94,0) 35px,rgba(34,197,94,.34) 40px,rgba(34,197,94,.12) 47px,rgba(34,197,94,0) 56px)}.bars{-webkit-mask-image:radial-gradient(circle at 50% 50%,transparent 40px,#000 62px);mask-image:radial-gradient(circle at 50% 50%,transparent 40px,#000 62px)}h1{font-size:32px}p{font-size:15px}":"";return`<!doctype html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>${Rt(e.title)}</title>
|
|
21
21
|
<style>
|
|
22
22
|
html,body{height:100%;margin:0}
|
|
23
23
|
body{background:#07070f;color:#e9e8f4;font-family:'Sora','Segoe UI',system-ui,sans-serif;display:flex;align-items:center;justify-content:center;overflow:hidden}
|
|
@@ -31,8 +31,8 @@ body{background:#07070f;color:#e9e8f4;font-family:'Sora','Segoe UI',system-ui,sa
|
|
|
31
31
|
.bars span{width:4px;border-radius:4px;flex:0 0 auto;transform-origin:center}
|
|
32
32
|
.orb{position:absolute;left:50%;top:50%;width:140px;height:140px;transform:translate(-50%,-50%);display:flex;align-items:center;justify-content:center}
|
|
33
33
|
.glow{position:absolute;left:50%;top:50%;width:154px;height:154px;margin:-77px 0 0 -77px;border-radius:50%;background:radial-gradient(circle,rgba(34,197,94,0) 49px,rgba(34,197,94,.34) 55px,rgba(34,197,94,.12) 63px,rgba(34,197,94,0) 74px);filter:blur(2px);animation:glow 2.6s ease-in-out infinite}
|
|
34
|
-
.mark{position:relative;width:106px;height:106px;background:${
|
|
35
|
-
.mono{position:relative;font-weight:800;font-size:44px;letter-spacing:-1px;background:${
|
|
34
|
+
.mark{position:relative;width:106px;height:106px;background:${Ia};filter:drop-shadow(0 6px 16px rgba(0,0,0,.55))}
|
|
35
|
+
.mono{position:relative;font-weight:800;font-size:44px;letter-spacing:-1px;background:${Ia};-webkit-background-clip:text;background-clip:text;color:transparent}
|
|
36
36
|
.eyebrow{font-family:'JetBrains Mono',ui-monospace,monospace;font-weight:700;font-size:13px;letter-spacing:2.6px;text-transform:uppercase;color:#7dd3fc;margin-bottom:14px}
|
|
37
37
|
h1{font-size:40px;font-weight:700;line-height:1.1;letter-spacing:-.02em;margin:0 0 14px}
|
|
38
38
|
p{font-size:17px;color:#9b9ab3;margin:0 auto;max-width:460px;line-height:1.65}
|
|
@@ -44,11 +44,11 @@ ${o}${e.extraCss??""}
|
|
|
44
44
|
</style></head>
|
|
45
45
|
<body><div class="aur a"></div><div class="aur b"></div><div class="dots"></div>
|
|
46
46
|
<div class="card">
|
|
47
|
-
<div class="badge" aria-hidden="true"><div class="bars">${
|
|
47
|
+
<div class="badge" aria-hidden="true"><div class="bars">${Gl}</div><div class="orb"><span class="glow"></span>${r}</div></div>
|
|
48
48
|
<div class="eyebrow">AC Bridge</div>
|
|
49
49
|
<h1>${Rt(e.headline)}</h1><p>${Rt(e.sub)}</p>${e.extraBody??""}
|
|
50
|
-
</div>${
|
|
51
|
-
:root{--ac-bg:#07070f;--ac-surface-2:rgba(255,255,255,.03);--ac-border:rgba(148,132,255,.16);--ac-hairline:rgba(255,255,255,.06);--ac-text:#e9e8f4;--ac-dim:#9b9ab3;--ac-mute:#80809d;--ac-accent:#38bdf8;--ac-accent-soft:#7dd3fc;--ac-accent-3:#34d399;--ac-input:rgba(148,132,255,.16);--ac-brand-grad:${
|
|
50
|
+
</div>${IA(e.cleanPath)}</body></html>`}function IA(e){return!e||!/^\/[a-z0-9-]+$/.test(e)?"":`<script>try{history.replaceState(null,"","${e}")}catch(e){}</script>`}function Wl(e,t,r=Or,o){return $A({title:e,headline:e,sub:t,markUri:r,...o?{cleanPath:o}:{}})}function Rt(e){return e.replace(/[&<>"']/g,t=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[t]??t)}var EA=(e,t,r)=>Wl(e,t,void 0,r);function Mv(e,t,r,o=12e4,n="/callback",i=EA,a){let s,l,u=new Promise((p,m)=>{s=p,l=m});u.catch(()=>{});let d=new Promise((p,m)=>{let f=e,g=AA((C,E)=>{let D=C.headers.host;if(D!==`127.0.0.1:${f}`&&D!==`localhost:${f}`){E.writeHead(400,{"content-type":"text/plain"}),E.end("bad host");return}let W=new URL(C.url??"/",`http://127.0.0.1:${f}`);if(a!==void 0&&W.pathname==="/"){Jo(E,200,a);return}if(W.pathname!==n){E.writeHead(404,{"content-type":"text/plain"}),E.end("not found");return}if(W.searchParams.get("state")!==t){Jo(E,400,i("Invalid request","This sign-in link isn\u2019t valid for this session.","/sign-in-failed"));return}let ce=W.searchParams.get("code"),Y=W.searchParams.get("error_description")??W.searchParams.get("error");Y?(Jo(E,400,i("Sign-in failed","You can return to AC Bridge and try again.","/sign-in-failed")),_(()=>m(new Error(Y)))):ce?(Jo(E,200,i("Signed in","You're connected. Return to AC Bridge \u2014 you can close this tab.","/signed-in")),_(()=>p({code:ce}))):(Jo(E,400,i("Sign-in failed","You can return to AC Bridge and try again.","/sign-in-failed")),_(()=>m(new Error("No authorization code returned."))))}),y=setTimeout(()=>_(()=>m(new Error("Sign-in timed out."))),o),k=!1;function _(C){k||(k=!0,clearTimeout(y),r?.removeEventListener("abort",P),g.close(),C())}function P(){_(()=>m(new Error("Sign-in cancelled.")))}if(r?.aborted){_(()=>m(new Error("Sign-in cancelled."))),l(new Error("Sign-in cancelled."));return}r?.addEventListener("abort",P),g.on("error",C=>{l(C instanceof Error?C:new Error(String(C))),_(()=>m(C))}),g.listen(e,"127.0.0.1",()=>{let C=g.address();f=typeof C=="object"&&C!==null?C.port:e,s(f)})});return{port:u,result:d}}function Jo(e,t,r){e.writeHead(t,{"content-type":"text/html; charset=utf-8"}),e.end(r)}function Hv(e){let t=e;return t?.code==="EADDRINUSE"?"Port 8765 is in use \u2014 a sign-in may already be open in the AC Bridge app. Finish it there, or close it and retry.":t?.code==="EACCES"||t?.code==="EPERM"?"AC Bridge was blocked from opening port 8765 on this machine \u2014 permission was denied. Security software or a group policy is the usual cause; allow it, or sign in on another machine.":t?.message??String(e)}var PA=[{provider:"google",label:"Continue with Google"},{provider:"github",label:"Continue with GitHub"},{provider:"microsoft",label:"Continue with Microsoft"},{provider:"email",label:"Log in"}];function Gv({cfg:e,state:t,codeChallenge:r,email:o,screenHint:n}){return PA.map(({provider:i,label:a})=>{let s=i!=="email"&&i!=="sso";return{provider:i,label:a,direct:s,url:$a({cfg:e,opts:s?{provider:i}:{provider:i,...o?{email:o}:{},...n?{screenHint:n}:{}},state:t,codeChallenge:r})}})}var CA={google:'<svg width="18" height="18" viewBox="0 0 24 24" fill="none" aria-hidden="true"><path d="M21.6 12.23c0-.68-.06-1.36-.18-2.02H12v3.82h5.4a4.6 4.6 0 0 1-2 3.02v2.5h3.24c1.9-1.75 2.96-4.33 2.96-7.32z" fill="#4285F4"/><path d="M12 22c2.7 0 4.96-.9 6.62-2.43l-3.24-2.5c-.9.6-2.05.96-3.38.96-2.6 0-4.8-1.76-5.58-4.12H3.06v2.58A10 10 0 0 0 12 22z" fill="#34A853"/><path d="M6.42 13.9a6 6 0 0 1 0-3.8V7.52H3.06a10 10 0 0 0 0 8.96z" fill="#FBBC05"/><path d="M12 5.98c1.47 0 2.79.5 3.83 1.5l2.86-2.86A10 10 0 0 0 3.06 7.52L6.42 10.1C7.2 7.74 9.4 5.98 12 5.98z" fill="#EA4335"/></svg>',github:'<svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M12 2a10 10 0 0 0-3.16 19.49c.5.09.68-.22.68-.48v-1.7c-2.78.6-3.37-1.34-3.37-1.34-.45-1.16-1.11-1.47-1.11-1.47-.91-.62.07-.6.07-.6 1 .07 1.53 1.03 1.53 1.03.9 1.53 2.34 1.09 2.91.83.09-.65.35-1.09.63-1.34-2.22-.25-4.55-1.11-4.55-4.94 0-1.09.39-1.98 1.03-2.68-.1-.25-.45-1.27.1-2.65 0 0 .84-.27 2.75 1.02a9.5 9.5 0 0 1 5 0c1.91-1.29 2.75-1.02 2.75-1.02.55 1.38.2 2.4.1 2.65.64.7 1.03 1.59 1.03 2.68 0 3.84-2.34 4.68-4.57 4.93.36.31.68.92.68 1.85v2.74c0 .27.18.58.69.48A10 10 0 0 0 12 2z"/></svg>',microsoft:'<svg width="18" height="18" viewBox="0 0 24 24" fill="none" aria-hidden="true"><path d="M3 3h8.5v8.5H3z" fill="#F25022"/><path d="M12.5 3H21v8.5h-8.5z" fill="#7FBA00"/><path d="M3 12.5h8.5V21H3z" fill="#00A4EF"/><path d="M12.5 12.5H21V21h-8.5z" fill="#FFB900"/></svg>'},TA='<svg class="arw" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14M13 6l6 6-6 6"/></svg>',Zv=`-webkit-mask:url("${Or}") center/contain no-repeat;mask:url("${Or}") center/contain no-repeat`,qo="https://ac-bridge.com",RA=`*{box-sizing:border-box}
|
|
51
|
+
:root{--ac-bg:#07070f;--ac-surface-2:rgba(255,255,255,.03);--ac-border:rgba(148,132,255,.16);--ac-hairline:rgba(255,255,255,.06);--ac-text:#e9e8f4;--ac-dim:#9b9ab3;--ac-mute:#80809d;--ac-accent:#38bdf8;--ac-accent-soft:#7dd3fc;--ac-accent-3:#34d399;--ac-input:rgba(148,132,255,.16);--ac-brand-grad:${Ia};--ac-brand-grad-text:linear-gradient(92deg,#67e8f9,#38bdf8 40%,#a78bfa 75%,#c084fc)}
|
|
52
52
|
html{background:var(--ac-bg)}
|
|
53
53
|
body{margin:0;min-height:100vh;background:var(--ac-bg);color:var(--ac-text);font-family:'Sora',ui-sans-serif,system-ui,sans-serif;-webkit-font-smoothing:antialiased}
|
|
54
54
|
.mono{font-family:'Space Mono',ui-monospace,'SFMono-Regular',monospace}
|
|
@@ -65,7 +65,7 @@ body{margin:0;min-height:100vh;background:var(--ac-bg);color:var(--ac-text);font
|
|
|
65
65
|
.mesh .aur.a{left:8%;background:radial-gradient(closest-side,rgba(56,189,248,.16),transparent)}
|
|
66
66
|
.mesh .aur.b{left:24%;background:radial-gradient(closest-side,rgba(139,92,246,.18),transparent);animation-delay:-7s}
|
|
67
67
|
.lockup{position:relative;display:inline-flex;width:fit-content;align-items:center;gap:10px;color:var(--ac-text);text-decoration:none}
|
|
68
|
-
.lockup .mk{display:block;flex-shrink:0;width:30px;height:30px;background:var(--ac-brand-grad);${
|
|
68
|
+
.lockup .mk{display:block;flex-shrink:0;width:30px;height:30px;background:var(--ac-brand-grad);${Zv}}
|
|
69
69
|
.lockup .wm{font-weight:700;font-size:15px;letter-spacing:-.01em;line-height:1}
|
|
70
70
|
.mid{position:relative;display:flex;flex:1;flex-direction:column;justify-content:center;padding:40px 0}
|
|
71
71
|
|
|
@@ -75,7 +75,7 @@ body{margin:0;min-height:100vh;background:var(--ac-bg);color:var(--ac-text);font
|
|
|
75
75
|
.bars span{width:4px;border-radius:4px;flex:0 0 auto;transform-origin:center}
|
|
76
76
|
.orb{position:absolute;left:50%;top:50%;display:flex;width:140px;height:140px;transform:translate(-50%,-50%);align-items:center;justify-content:center}
|
|
77
77
|
.orb .glow{position:absolute;width:154px;height:154px;border-radius:50%;background:radial-gradient(circle,rgba(34,197,94,0) 49px,rgba(34,197,94,.34) 55px,rgba(34,197,94,.12) 63px,rgba(34,197,94,0) 74px);filter:blur(2px);animation:glow 2.6s ease-in-out infinite}
|
|
78
|
-
.orb .mk{position:relative;width:106px;height:106px;background:var(--ac-brand-grad);${
|
|
78
|
+
.orb .mk{position:relative;width:106px;height:106px;background:var(--ac-brand-grad);${Zv};filter:drop-shadow(0 6px 16px rgba(0,0,0,.55))}
|
|
79
79
|
|
|
80
80
|
.eyebrow{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.16em;color:var(--ac-accent-soft)}
|
|
81
81
|
.aside .eyebrow{margin-bottom:16px}
|
|
@@ -131,15 +131,15 @@ form.email .flt{font-size:10.5px;text-transform:uppercase;letter-spacing:.1em;co
|
|
|
131
131
|
@keyframes glow{0%,100%{opacity:1;transform:scale(1)}50%{opacity:.8;transform:scale(1.04)}}
|
|
132
132
|
@keyframes aur{0%,5%{opacity:0}12%,28%{opacity:1}38%,100%{opacity:0}}
|
|
133
133
|
@keyframes pulse{0%,100%{opacity:1;box-shadow:0 0 0 0 rgba(56,189,248,.6)}50%{opacity:.5;box-shadow:0 0 0 7px rgba(56,189,248,0)}}
|
|
134
|
-
@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}`,
|
|
135
|
-
<style>${
|
|
134
|
+
@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}`,OA=`<a class="lockup" href="${qo}/" data-testid="nav-brand" aria-label="AC Bridge home"><span class="mk"></span><span class="wm">AC Bridge</span></a>`,DA='<span class="lockup"><span class="mk"></span><span class="wm">AC Bridge</span></span>';function NA(e){return`<a class="sso" data-testid="oauth-${e.provider}" href="${Rt(e.url)}">${CA[e.provider]??""}<span>${Rt(e.label)}</span>${TA}</a>`}function LA(e){let t=new URL(e.url),r=[...t.searchParams].filter(([o])=>o!=="login_hint").map(([o,n])=>`<input type="hidden" name="${Rt(o)}" value="${Rt(n)}">`).join("");return`<form class="email" method="get" action="${Rt(`${t.origin}${t.pathname}`)}">${r}<label><span class="flt mono">Email</span><input class="inp" data-testid="email-input" name="login_hint" type="email" placeholder="you@email.com" autocomplete="email" required></label><button class="cta" data-testid="continue-email" type="submit">${Rt(e.label)}</button></form>`}function Wv(e){let t=e.filter(o=>o.direct),r=e.find(o=>o.provider==="email");return`<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Log in | AC Bridge</title>
|
|
135
|
+
<style>${RA}</style></head>
|
|
136
136
|
<body><div class="page" data-testid="login-page"><div class="split">
|
|
137
137
|
|
|
138
138
|
<aside class="aside" data-testid="login-session-panel">
|
|
139
139
|
<div class="mesh" aria-hidden="true"><div class="dots"></div><div class="aur a"></div><div class="aur b"></div></div>
|
|
140
|
-
${
|
|
140
|
+
${OA}
|
|
141
141
|
<div class="mid">
|
|
142
|
-
<div class="badge" aria-hidden="true"><div class="bars">${
|
|
142
|
+
<div class="badge" aria-hidden="true"><div class="bars">${Gl}</div><div class="orb"><span class="glow"></span><span class="mk"></span></div></div>
|
|
143
143
|
<div class="eyebrow mono">CLAUDE CODE + CODEX</div>
|
|
144
144
|
<h1>Welcome back to<br><span class="grad">the bridge.</span></h1>
|
|
145
145
|
<p class="lede">Your sessions are still running. Log in to pick up exactly where you left off, and see at a glance what your agents did while you were away.</p>
|
|
@@ -149,31 +149,31 @@ ${_A}
|
|
|
149
149
|
</aside>
|
|
150
150
|
|
|
151
151
|
<div class="right">
|
|
152
|
-
<div class="topright"><span>New here? <a href="${
|
|
152
|
+
<div class="topright"><span>New here? <a href="${qo}/register" data-testid="nav-register">Sign up free</a></span></div>
|
|
153
153
|
<div class="center"><div class="card">
|
|
154
154
|
<div class="eyebrow mono">WELCOME BACK</div>
|
|
155
155
|
<h2>Log in</h2>
|
|
156
156
|
<p class="sub">Pick up your sessions right where you left them.</p>
|
|
157
|
-
<div class="ssos">${t.map(
|
|
157
|
+
<div class="ssos">${t.map(NA).join("")}</div>
|
|
158
158
|
<div class="rule"><span class="hair"></span><span class="rl mono">or with email</span><span class="hair"></span></div>
|
|
159
|
-
${r?
|
|
160
|
-
<p class="newto">New to AC Bridge? <a href="${
|
|
159
|
+
${r?LA(r):""}
|
|
160
|
+
<p class="newto">New to AC Bridge? <a href="${qo}/register">Create a free account</a></p>
|
|
161
161
|
</div></div>
|
|
162
162
|
</div>
|
|
163
163
|
|
|
164
164
|
</div>
|
|
165
165
|
<footer class="foot" data-testid="site-footer"><div class="inner">
|
|
166
|
-
<div class="row">${
|
|
166
|
+
<div class="row">${DA}<nav aria-label="Footer"><a href="mailto:support@ac-bridge.com">support@ac-bridge.com</a><a href="${qo}/privacy">Privacy</a><a href="${qo}/terms">Terms</a></nav><span class="cr mono">(c) 2026 AC BRIDGE</span></div>
|
|
167
167
|
<span class="disc">Works with Claude Code and Codex. Not affiliated with or endorsed by Anthropic or OpenAI.</span>
|
|
168
168
|
</div></footer>
|
|
169
|
-
</div></body></html>`}import{spawn as
|
|
170
|
-
`)})}function
|
|
171
|
-
`,384)}function
|
|
172
|
-
`,384)}var
|
|
173
|
-
`,384)}function lE(e){try{let t=JSON.parse(Buffer.from(e.split(".")[1]??"","base64url").toString("utf8"));return typeof t.nid=="string"?t.nid:null}catch{return null}}var uE=()=>Or({notSignedIn:{message:"This machine isn't paired yet \u2014 run `acbridge pair <code>` first.",exitCode:3}});async function gy(e,t={}){let r=e[0];if(r!=="on"&&r!=="off"&&r!=="status")return b("usage: acbridge capture on|off|status"),2;let o=(t.requireToken??uE)();if(!o.ok)return b(o.message),o.exitCode;let n=o.token;if(r==="status"){let u=await(t.fetchEntitlement??Ot)(n);u?(h(`plan: ${u.plan}`),h(`capture.telemetry: ${u.capture.telemetry}`),h(`capture.transcripts: ${u.capture.transcripts}`)):b("couldn't fetch entitlement from the relay (signed out, or the relay is unreachable)");let p=(t.entitlementFileRaw??dE)();if(!p)return h("local entitlement file: absent (capture fail-closed until the hub next syncs)"),0;try{let m=JSON.parse(p),f=(Date.now()-(m.fetchedAt??0))/36e5;h(`local entitlement file: ${f.toFixed(1)}h old (${f<=24?"fresh":"STALE \u2014 capture fail-closed"})`)}catch{h("local entitlement file: unreadable (capture fail-closed)")}return 0}let i=lE(n);if(!i)return b("Couldn't read this machine's node id from its access token \u2014 re-pair with `acbridge pair`."),1;let s=await(t.patchNode??dy)(n,i,{captureEnabled:r==="on"});return s.ok?(h(`Capture ${r==="on"?"enabled":"disabled"} for this machine.`),r==="on"&&h("Note: capture is on by default for every account \u2014 this only re-enables it for THIS machine (still subject to the global capture switch)."),0):(b(`capture ${r} failed${s.status?` (${s.status})`:""}: ${s.error??"unknown"}`),1)}function dE(){let e=kt();return e?O(e.entitlementFile):null}import{readFileSync as M1}from"node:fs";import{createInterface as B1}from"node:readline";var c={};Jt(c,{$brand:()=>Xl,$input:()=>yp,$output:()=>vp,NEVER:()=>Kl,TimePrecision:()=>wp,ZodAny:()=>pf,ZodArray:()=>hf,ZodBase64:()=>sc,ZodBase64URL:()=>cc,ZodBigInt:()=>po,ZodBigIntFormat:()=>dc,ZodBoolean:()=>uo,ZodCIDRv4:()=>ic,ZodCIDRv6:()=>ac,ZodCUID:()=>Ys,ZodCUID2:()=>Qs,ZodCatch:()=>zf,ZodCodec:()=>Pi,ZodCustom:()=>Ci,ZodCustomStringFormat:()=>co,ZodDate:()=>_i,ZodDefault:()=>Rf,ZodDiscriminatedUnion:()=>yf,ZodE164:()=>lc,ZodEmail:()=>qs,ZodEmoji:()=>Ks,ZodEnum:()=>ao,ZodError:()=>BC,ZodExactOptional:()=>Pf,ZodFile:()=>Af,ZodFirstPartyTypeKind:()=>Xf,ZodFunction:()=>Jf,ZodGUID:()=>bi,ZodIPv4:()=>rc,ZodIPv6:()=>oc,ZodISODate:()=>Hs,ZodISODateTime:()=>Bs,ZodISODuration:()=>Gs,ZodISOTime:()=>Zs,ZodIntersection:()=>bf,ZodIssueCode:()=>ZC,ZodJWT:()=>uc,ZodKSUID:()=>nc,ZodLazy:()=>Gf,ZodLiteral:()=>If,ZodMAC:()=>of,ZodMap:()=>_f,ZodNaN:()=>Ff,ZodNanoID:()=>Xs,ZodNever:()=>ff,ZodNonOptional:()=>vc,ZodNull:()=>uf,ZodNullable:()=>Tf,ZodNumber:()=>lo,ZodNumberFormat:()=>ir,ZodObject:()=>Ii,ZodOptional:()=>hc,ZodPipe:()=>Ei,ZodPrefault:()=>Df,ZodPreprocess:()=>Mf,ZodPromise:()=>Vf,ZodReadonly:()=>Bf,ZodRealError:()=>Xe,ZodRecord:()=>io,ZodSet:()=>$f,ZodString:()=>so,ZodStringFormat:()=>ce,ZodSuccess:()=>Uf,ZodSymbol:()=>cf,ZodTemplateLiteral:()=>Zf,ZodTransform:()=>Ef,ZodTuple:()=>kf,ZodType:()=>B,ZodULID:()=>ec,ZodURL:()=>Si,ZodUUID:()=>Ut,ZodUndefined:()=>lf,ZodUnion:()=>Ai,ZodUnknown:()=>mf,ZodVoid:()=>gf,ZodXID:()=>tc,ZodXor:()=>vf,_ZodString:()=>Js,_default:()=>Of,_function:()=>rk,any:()=>Dx,array:()=>$i,base64:()=>vx,base64url:()=>yx,bigint:()=>Px,boolean:()=>sf,catch:()=>jf,check:()=>ok,cidrv4:()=>gx,cidrv6:()=>hx,clone:()=>ze,codec:()=>Qx,coerce:()=>Yf,config:()=>ve,core:()=>rn,cuid:()=>sx,cuid2:()=>cx,custom:()=>ik,date:()=>Lx,decode:()=>Xm,decodeAsync:()=>Qm,describe:()=>ak,discriminatedUnion:()=>Bx,e164:()=>bx,email:()=>Xb,emoji:()=>ix,encode:()=>Km,encodeAsync:()=>Ym,endsWith:()=>qr,enum:()=>fc,exactOptional:()=>Cf,file:()=>qx,flattenError:()=>ii,float32:()=>$x,float64:()=>Ix,formatError:()=>ai,fromJSONSchema:()=>mk,function:()=>rk,getErrorMap:()=>WC,globalRegistry:()=>Ce,gt:()=>Nt,gte:()=>Fe,guid:()=>Yb,hash:()=>_x,hex:()=>Sx,hostname:()=>wx,httpUrl:()=>ox,includes:()=>Vr,instanceof:()=>ck,int:()=>Ws,int32:()=>Ax,int64:()=>Cx,intersection:()=>xf,invertCodec:()=>ek,ipv4:()=>px,ipv6:()=>fx,iso:()=>oo,json:()=>uk,jwt:()=>xx,keyof:()=>Ux,ksuid:()=>dx,lazy:()=>Wf,length:()=>rr,literal:()=>Jx,locales:()=>fi,looseObject:()=>Fx,looseRecord:()=>Zx,lowercase:()=>Gr,lt:()=>Dt,lte:()=>ot,mac:()=>mx,map:()=>Gx,maxLength:()=>nr,maxSize:()=>Ln,meta:()=>sk,mime:()=>Kr,minLength:()=>nn,minSize:()=>Lt,multipleOf:()=>Nn,nan:()=>Yx,nanoid:()=>ax,nativeEnum:()=>Vx,negative:()=>Rs,never:()=>pc,nonnegative:()=>Ds,nonoptional:()=>Lf,nonpositive:()=>Os,normalize:()=>Xr,null:()=>df,nullable:()=>ki,nullish:()=>Kx,number:()=>af,object:()=>zx,optional:()=>xi,overwrite:()=>St,parse:()=>Wm,parseAsync:()=>Vm,partialRecord:()=>Hx,pipe:()=>Vs,positive:()=>Ts,prefault:()=>Nf,preprocess:()=>dk,prettifyError:()=>uu,promise:()=>nk,property:()=>Ns,readonly:()=>Hf,record:()=>Sf,refine:()=>qf,regex:()=>Zr,regexes:()=>rt,registry:()=>us,safeDecode:()=>tf,safeDecodeAsync:()=>rf,safeEncode:()=>ef,safeEncodeAsync:()=>nf,safeParse:()=>Jm,safeParseAsync:()=>qm,set:()=>Wx,setErrorMap:()=>GC,size:()=>tr,slugify:()=>to,startsWith:()=>Jr,strictObject:()=>jx,string:()=>yi,stringFormat:()=>kx,stringbool:()=>lk,success:()=>Xx,superRefine:()=>Kf,symbol:()=>Rx,templateLiteral:()=>tk,toJSONSchema:()=>js,toLowerCase:()=>Qr,toUpperCase:()=>eo,transform:()=>gc,treeifyError:()=>lu,trim:()=>Yr,tuple:()=>wf,uint32:()=>Ex,uint64:()=>Tx,ulid:()=>lx,undefined:()=>Ox,union:()=>mc,unknown:()=>or,uppercase:()=>Wr,url:()=>rx,util:()=>$,uuid:()=>Qb,uuidv4:()=>ex,uuidv6:()=>tx,uuidv7:()=>nx,void:()=>Nx,xid:()=>ux,xor:()=>Mx});var rn={};Jt(rn,{$ZodAny:()=>jd,$ZodArray:()=>Zd,$ZodAsyncError:()=>wt,$ZodBase64:()=>Pd,$ZodBase64URL:()=>Cd,$ZodBigInt:()=>ns,$ZodBigIntFormat:()=>Nd,$ZodBoolean:()=>ui,$ZodCIDRv4:()=>Id,$ZodCIDRv6:()=>Ad,$ZodCUID:()=>fd,$ZodCUID2:()=>gd,$ZodCatch:()=>cp,$ZodCheck:()=>de,$ZodCheckBigIntFormat:()=>Zu,$ZodCheckEndsWith:()=>nd,$ZodCheckGreaterThan:()=>Ka,$ZodCheckIncludes:()=>ed,$ZodCheckLengthEquals:()=>Ku,$ZodCheckLessThan:()=>qa,$ZodCheckLowerCase:()=>Yu,$ZodCheckMaxLength:()=>Ju,$ZodCheckMaxSize:()=>Gu,$ZodCheckMimeType:()=>od,$ZodCheckMinLength:()=>qu,$ZodCheckMinSize:()=>Wu,$ZodCheckMultipleOf:()=>Bu,$ZodCheckNumberFormat:()=>Hu,$ZodCheckOverwrite:()=>id,$ZodCheckProperty:()=>rd,$ZodCheckRegex:()=>Xu,$ZodCheckSizeEquals:()=>Vu,$ZodCheckStartsWith:()=>td,$ZodCheckStringFormat:()=>Br,$ZodCheckUpperCase:()=>Qu,$ZodCodec:()=>pi,$ZodCustom:()=>hp,$ZodCustomStringFormat:()=>Od,$ZodDate:()=>Hd,$ZodDefault:()=>op,$ZodDiscriminatedUnion:()=>Vd,$ZodE164:()=>Td,$ZodEmail:()=>ud,$ZodEmoji:()=>pd,$ZodEncodeError:()=>Cn,$ZodEnum:()=>Yd,$ZodError:()=>oi,$ZodExactOptional:()=>np,$ZodFile:()=>ep,$ZodFunction:()=>mp,$ZodGUID:()=>cd,$ZodIPv4:()=>Sd,$ZodIPv6:()=>_d,$ZodISODate:()=>xd,$ZodISODateTime:()=>bd,$ZodISODuration:()=>wd,$ZodISOTime:()=>kd,$ZodIntersection:()=>Jd,$ZodJWT:()=>Rd,$ZodKSUID:()=>yd,$ZodLazy:()=>gp,$ZodLiteral:()=>Qd,$ZodMAC:()=>$d,$ZodMap:()=>Kd,$ZodNaN:()=>lp,$ZodNanoID:()=>md,$ZodNever:()=>Md,$ZodNonOptional:()=>ap,$ZodNull:()=>zd,$ZodNullable:()=>rp,$ZodNumber:()=>ts,$ZodNumberFormat:()=>Dd,$ZodObject:()=>Wy,$ZodObjectJIT:()=>Gd,$ZodOptional:()=>os,$ZodPipe:()=>is,$ZodPrefault:()=>ip,$ZodPreprocess:()=>up,$ZodPromise:()=>fp,$ZodReadonly:()=>dp,$ZodRealError:()=>Ke,$ZodRecord:()=>qd,$ZodRegistry:()=>ls,$ZodSet:()=>Xd,$ZodString:()=>er,$ZodStringFormat:()=>se,$ZodSuccess:()=>sp,$ZodSymbol:()=>Ld,$ZodTemplateLiteral:()=>pp,$ZodTransform:()=>tp,$ZodTuple:()=>rs,$ZodType:()=>F,$ZodULID:()=>hd,$ZodURL:()=>dd,$ZodUUID:()=>ld,$ZodUndefined:()=>Ud,$ZodUnion:()=>di,$ZodUnknown:()=>Fd,$ZodVoid:()=>Bd,$ZodXID:()=>vd,$ZodXor:()=>Wd,$brand:()=>Xl,$constructor:()=>v,$input:()=>yp,$output:()=>vp,Doc:()=>li,JSONSchema:()=>Jb,JSONSchemaGenerator:()=>Fs,NEVER:()=>Kl,TimePrecision:()=>wp,_any:()=>Hp,_array:()=>Kp,_base64:()=>As,_base64url:()=>Es,_bigint:()=>Lp,_boolean:()=>Dp,_catch:()=>DC,_check:()=>Vb,_cidrv4:()=>$s,_cidrv6:()=>Is,_coercedBigint:()=>Up,_coercedBoolean:()=>Np,_coercedDate:()=>Jp,_coercedNumber:()=>Ep,_coercedString:()=>xp,_cuid:()=>ys,_cuid2:()=>bs,_custom:()=>Yp,_date:()=>Vp,_decode:()=>Fa,_decodeAsync:()=>Ba,_default:()=>TC,_discriminatedUnion:()=>bC,_e164:()=>Ps,_email:()=>ds,_emoji:()=>hs,_encode:()=>ja,_encodeAsync:()=>Ma,_endsWith:()=>qr,_enum:()=>$C,_file:()=>Xp,_float32:()=>Cp,_float64:()=>Tp,_gt:()=>Nt,_gte:()=>Fe,_guid:()=>gi,_includes:()=>Vr,_int:()=>Pp,_int32:()=>Rp,_int64:()=>zp,_intersection:()=>xC,_ipv4:()=>Ss,_ipv6:()=>_s,_isoDate:()=>_p,_isoDateTime:()=>Sp,_isoDuration:()=>Ip,_isoTime:()=>$p,_jwt:()=>Cs,_ksuid:()=>ws,_lazy:()=>zC,_length:()=>rr,_literal:()=>AC,_lowercase:()=>Gr,_lt:()=>Dt,_lte:()=>ot,_mac:()=>kp,_map:()=>SC,_max:()=>ot,_maxLength:()=>nr,_maxSize:()=>Ln,_mime:()=>Kr,_min:()=>Fe,_minLength:()=>nn,_minSize:()=>Lt,_multipleOf:()=>Nn,_nan:()=>qp,_nanoid:()=>vs,_nativeEnum:()=>IC,_negative:()=>Rs,_never:()=>Gp,_nonnegative:()=>Ds,_nonoptional:()=>RC,_nonpositive:()=>Os,_normalize:()=>Xr,_null:()=>Bp,_nullable:()=>CC,_number:()=>Ap,_optional:()=>PC,_overwrite:()=>St,_parse:()=>zr,_parseAsync:()=>jr,_pipe:()=>NC,_positive:()=>Ts,_promise:()=>jC,_property:()=>Ns,_readonly:()=>LC,_record:()=>wC,_refine:()=>Qp,_regex:()=>Zr,_safeDecode:()=>Za,_safeDecodeAsync:()=>Wa,_safeEncode:()=>Ha,_safeEncodeAsync:()=>Ga,_safeParse:()=>Fr,_safeParseAsync:()=>Mr,_set:()=>_C,_size:()=>tr,_slugify:()=>to,_startsWith:()=>Jr,_string:()=>bp,_stringFormat:()=>no,_stringbool:()=>rm,_success:()=>OC,_superRefine:()=>em,_symbol:()=>Fp,_templateLiteral:()=>UC,_toLowerCase:()=>Qr,_toUpperCase:()=>eo,_transform:()=>EC,_trim:()=>Yr,_tuple:()=>kC,_uint32:()=>Op,_uint64:()=>jp,_ulid:()=>xs,_undefined:()=>Mp,_union:()=>vC,_unknown:()=>Zp,_uppercase:()=>Wr,_url:()=>hi,_uuid:()=>ps,_uuidv4:()=>ms,_uuidv6:()=>fs,_uuidv7:()=>gs,_void:()=>Wp,_xid:()=>ks,_xor:()=>yC,clone:()=>ze,config:()=>ve,createStandardJSONSchemaMethod:()=>ro,createToJSONSchemaMethod:()=>om,decode:()=>jE,decodeAsync:()=>ME,describe:()=>tm,encode:()=>zE,encodeAsync:()=>FE,extractDefs:()=>zn,finalize:()=>jn,flattenError:()=>ii,formatError:()=>ai,globalConfig:()=>Xn,globalRegistry:()=>Ce,initializeContext:()=>Un,isValidBase64:()=>Ed,isValidBase64URL:()=>By,isValidJWT:()=>Hy,locales:()=>fi,meta:()=>nm,parse:()=>Ua,parseAsync:()=>za,prettifyError:()=>uu,process:()=>oe,regexes:()=>rt,registry:()=>us,safeDecode:()=>HE,safeDecodeAsync:()=>GE,safeEncode:()=>BE,safeEncodeAsync:()=>ZE,safeParse:()=>du,safeParseAsync:()=>pu,toDotPath:()=>ky,toJSONSchema:()=>js,treeifyError:()=>lu,util:()=>$,version:()=>ad});var hy,Kl=Object.freeze({status:"aborted"});function v(e,t,r){function o(s,l){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:l,constr:a,traits:new Set},enumerable:!1}),s._zod.traits.has(e))return;s._zod.traits.add(e),t(s,l);let u=a.prototype,d=Object.keys(u);for(let p=0;p<d.length;p++){let m=d[p];m in s||(s[m]=u[m].bind(s))}}let n=r?.Parent??Object;class i extends n{}Object.defineProperty(i,"name",{value:e});function a(s){var l;let u=r?.Parent?new i:this;o(u,s),(l=u._zod).deferred??(l.deferred=[]);for(let d of u._zod.deferred)d();return u}return Object.defineProperty(a,"init",{value:o}),Object.defineProperty(a,Symbol.hasInstance,{value:s=>r?.Parent&&s instanceof r.Parent?!0:s?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}var Xl=Symbol("zod_brand"),wt=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Cn=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(hy=globalThis).__zod_globalConfig??(hy.__zod_globalConfig={});var Xn=globalThis.__zod_globalConfig;function ve(e){return e&&Object.assign(Xn,e),Xn}var $={};Jt($,{BIGINT_FORMAT_RANGES:()=>su,Class:()=>Ql,NUMBER_FORMAT_RANGES:()=>au,aborted:()=>Dn,allowsEval:()=>nu,assert:()=>hE,assertEqual:()=>pE,assertIs:()=>fE,assertNever:()=>gE,assertNotEqual:()=>mE,assignProp:()=>Rn,base64ToUint8Array:()=>yy,base64urlToUint8Array:()=>OE,cached:()=>Lr,captureStackTrace:()=>La,cleanEnum:()=>RE,cleanRegex:()=>ei,clone:()=>ze,cloneDef:()=>yE,createTransparentProxy:()=>_E,defineLazy:()=>V,esc:()=>Na,escapeRegex:()=>mt,explicitlyAborted:()=>cu,extend:()=>AE,finalizeIssue:()=>je,floatSafeRemainder:()=>eu,getElementAtPath:()=>bE,getEnumValues:()=>Qo,getLengthableOrigin:()=>ri,getParsedType:()=>SE,getSizableOrigin:()=>ni,hexToUint8Array:()=>NE,isObject:()=>Yn,isPlainObject:()=>On,issue:()=>Ur,joinValues:()=>x,jsonStringifyReplacer:()=>Nr,merge:()=>PE,mergeDefs:()=>tn,normalizeParams:()=>I,nullish:()=>Tn,numKeys:()=>wE,objectClone:()=>vE,omit:()=>IE,optionalKeys:()=>iu,parsedType:()=>S,partial:()=>CE,pick:()=>$E,prefixIssues:()=>qe,primitiveTypes:()=>ou,promiseAllObject:()=>xE,propertyKeyTypes:()=>ti,randomString:()=>kE,required:()=>TE,safeExtend:()=>EE,shallowClone:()=>ru,slugify:()=>tu,stringifyPrimitive:()=>w,uint8ArrayToBase64:()=>by,uint8ArrayToBase64url:()=>DE,uint8ArrayToHex:()=>LE,unwrapMessage:()=>Yo});function pE(e){return e}function mE(e){return e}function fE(e){}function gE(e){throw new Error("Unexpected value in exhaustive check")}function hE(e){}function Qo(e){let t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,n])=>t.indexOf(+o)===-1).map(([o,n])=>n)}function x(e,t="|"){return e.map(r=>w(r)).join(t)}function Nr(e,t){return typeof t=="bigint"?t.toString():t}function Lr(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function Tn(e){return e==null}function ei(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function eu(e,t){let r=e/t,o=Math.round(r),n=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-o)<n?0:r-o}var vy=Symbol("evaluating");function V(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==vy)return o===void 0&&(o=vy,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function vE(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Rn(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function tn(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function yE(e){return tn(e._zod.def)}function bE(e,t){return t?t.reduce((r,o)=>r?.[o],e):e}function xE(e){let t=Object.keys(e),r=t.map(o=>e[o]);return Promise.all(r).then(o=>{let n={};for(let i=0;i<t.length;i++)n[t[i]]=o[i];return n})}function kE(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let o=0;o<e;o++)r+=t[Math.floor(Math.random()*t.length)];return r}function Na(e){return JSON.stringify(e)}function tu(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var La="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Yn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var nu=Lr(()=>{if(Xn.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function On(e){if(Yn(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Yn(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function ru(e){return On(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function wE(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var SE=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},ti=new Set(["string","number","symbol"]),ou=new Set(["string","number","bigint","boolean","symbol","undefined"]);function mt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ze(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function I(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function _E(e){let t;return new Proxy({},{get(r,o,n){return t??(t=e()),Reflect.get(t,o,n)},set(r,o,n,i){return t??(t=e()),Reflect.set(t,o,n,i)},has(r,o){return t??(t=e()),Reflect.has(t,o)},deleteProperty(r,o){return t??(t=e()),Reflect.deleteProperty(t,o)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,o){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(r,o,n){return t??(t=e()),Reflect.defineProperty(t,o,n)}})}function w(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function iu(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var au={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},su={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function $E(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let i=tn(e._zod.def,{get shape(){let a={};for(let s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&(a[s]=r.shape[s])}return Rn(this,"shape",a),a},checks:[]});return ze(e,i)}function IE(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let i=tn(e._zod.def,{get shape(){let a={...e._zod.def.shape};for(let s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&delete a[s]}return Rn(this,"shape",a),a},checks:[]});return ze(e,i)}function AE(e,t){if(!On(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let i=e._zod.def.shape;for(let a in t)if(Object.getOwnPropertyDescriptor(i,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=tn(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return Rn(this,"shape",i),i}});return ze(e,n)}function EE(e,t){if(!On(t))throw new Error("Invalid input to safeExtend: expected a plain object");let r=tn(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return Rn(this,"shape",o),o}});return ze(e,r)}function PE(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=tn(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t._zod.def.shape};return Rn(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return ze(e,r)}function CE(e,t,r){let n=t._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let a=tn(t._zod.def,{get shape(){let s=t._zod.def.shape,l={...s};if(r)for(let u in r){if(!(u in s))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(l[u]=e?new e({type:"optional",innerType:s[u]}):s[u])}else for(let u in s)l[u]=e?new e({type:"optional",innerType:s[u]}):s[u];return Rn(this,"shape",l),l},checks:[]});return ze(t,a)}function TE(e,t,r){let o=tn(t._zod.def,{get shape(){let n=t._zod.def.shape,i={...n};if(r)for(let a in r){if(!(a in i))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(i[a]=new e({type:"nonoptional",innerType:n[a]}))}else for(let a in n)i[a]=new e({type:"nonoptional",innerType:n[a]});return Rn(this,"shape",i),i}});return ze(t,o)}function Dn(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function cu(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function qe(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function Yo(e){return typeof e=="string"?e:e?.message}function je(e,t,r){let o=e.message?e.message:Yo(e.inst?._zod.def?.error?.(e))??Yo(t?.error?.(e))??Yo(r.customError?.(e))??Yo(r.localeError?.(e))??"Invalid input",{inst:n,continue:i,input:a,...s}=e;return s.path??(s.path=[]),s.message=o,t?.reportInput&&(s.input=a),s}function ni(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function ri(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function S(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function Ur(...e){let[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}function RE(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function yy(e){let t=atob(e),r=new Uint8Array(t.length);for(let o=0;o<t.length;o++)r[o]=t.charCodeAt(o);return r}function by(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function OE(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return yy(t+r)}function DE(e){return by(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function NE(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)r[o/2]=Number.parseInt(t.slice(o,o+2),16);return r}function LE(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var Ql=class{constructor(...t){}};var xy=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Nr,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},oi=v("$ZodError",xy),Ke=v("$ZodError",xy,{Parent:Error});function ii(e,t=r=>r.message){let r={},o=[];for(let n of e.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):o.push(t(n));return{formErrors:o,fieldErrors:r}}function ai(e,t=r=>r.message){let r={_errors:[]},o=(n,i=[])=>{for(let a of n.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(s=>o({issues:s},[...i,...a.path]));else if(a.code==="invalid_key")o({issues:a.issues},[...i,...a.path]);else if(a.code==="invalid_element")o({issues:a.issues},[...i,...a.path]);else{let s=[...i,...a.path];if(s.length===0)r._errors.push(t(a));else{let l=r,u=0;for(;u<s.length;){let d=s[u];u===s.length-1?(l[d]=l[d]||{_errors:[]},l[d]._errors.push(t(a))):l[d]=l[d]||{_errors:[]},l=l[d],u++}}}};return o(e),r}function lu(e,t=r=>r.message){let r={errors:[]},o=(n,i=[])=>{var a,s;for(let l of n.issues)if(l.code==="invalid_union"&&l.errors.length)l.errors.map(u=>o({issues:u},[...i,...l.path]));else if(l.code==="invalid_key")o({issues:l.issues},[...i,...l.path]);else if(l.code==="invalid_element")o({issues:l.issues},[...i,...l.path]);else{let u=[...i,...l.path];if(u.length===0){r.errors.push(t(l));continue}let d=r,p=0;for(;p<u.length;){let m=u[p],f=p===u.length-1;typeof m=="string"?(d.properties??(d.properties={}),(a=d.properties)[m]??(a[m]={errors:[]}),d=d.properties[m]):(d.items??(d.items=[]),(s=d.items)[m]??(s[m]={errors:[]}),d=d.items[m]),f&&d.errors.push(t(l)),p++}}};return o(e),r}function ky(e){let t=[],r=e.map(o=>typeof o=="object"?o.key:o);for(let o of r)typeof o=="number"?t.push(`[${o}]`):typeof o=="symbol"?t.push(`[${JSON.stringify(String(o))}]`):/[^\w$]/.test(o)?t.push(`[${JSON.stringify(o)}]`):(t.length&&t.push("."),t.push(o));return t.join("")}function uu(e){let t=[],r=[...e.issues].sort((o,n)=>(o.path??[]).length-(n.path??[]).length);for(let o of r)t.push(`\u2716 ${o.message}`),o.path?.length&&t.push(` \u2192 at ${ky(o.path)}`);return t.join(`
|
|
174
|
-
`)}var zr=e=>(t,r,o,n)=>{let i=o?{...o,async:!1}:{async:!1},a=t._zod.run({value:r,issues:[]},i);if(a instanceof Promise)throw new wt;if(a.issues.length){let s=new(n?.Err??e)(a.issues.map(l=>je(l,i,ve())));throw La(s,n?.callee),s}return a.value},Ua=zr(Ke),jr=e=>async(t,r,o,n)=>{let i=o?{...o,async:!0}:{async:!0},a=t._zod.run({value:r,issues:[]},i);if(a instanceof Promise&&(a=await a),a.issues.length){let s=new(n?.Err??e)(a.issues.map(l=>je(l,i,ve())));throw La(s,n?.callee),s}return a.value},za=jr(Ke),Fr=e=>(t,r,o)=>{let n=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},n);if(i instanceof Promise)throw new wt;return i.issues.length?{success:!1,error:new(e??oi)(i.issues.map(a=>je(a,n,ve())))}:{success:!0,data:i.value}},du=Fr(Ke),Mr=e=>async(t,r,o)=>{let n=o?{...o,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},n);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(a=>je(a,n,ve())))}:{success:!0,data:i.value}},pu=Mr(Ke),ja=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return zr(e)(t,r,n)},zE=ja(Ke),Fa=e=>(t,r,o)=>zr(e)(t,r,o),jE=Fa(Ke),Ma=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return jr(e)(t,r,n)},FE=Ma(Ke),Ba=e=>async(t,r,o)=>jr(e)(t,r,o),ME=Ba(Ke),Ha=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Fr(e)(t,r,n)},BE=Ha(Ke),Za=e=>(t,r,o)=>Fr(e)(t,r,o),HE=Za(Ke),Ga=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Mr(e)(t,r,n)},ZE=Ga(Ke),Wa=e=>async(t,r,o)=>Mr(e)(t,r,o),GE=Wa(Ke);var rt={};Jt(rt,{base64:()=>Eu,base64url:()=>Va,bigint:()=>Nu,boolean:()=>Uu,browserEmail:()=>QE,cidrv4:()=>Iu,cidrv6:()=>Au,cuid:()=>mu,cuid2:()=>fu,date:()=>Tu,datetime:()=>Ou,domain:()=>nP,duration:()=>bu,e164:()=>Cu,email:()=>ku,emoji:()=>wu,extendedDuration:()=>WE,guid:()=>xu,hex:()=>rP,hostname:()=>tP,html5Email:()=>KE,httpProtocol:()=>Pu,idnEmail:()=>YE,integer:()=>Lu,ipv4:()=>Su,ipv6:()=>_u,ksuid:()=>vu,lowercase:()=>Fu,mac:()=>$u,md5_base64:()=>iP,md5_base64url:()=>aP,md5_hex:()=>oP,nanoid:()=>yu,null:()=>zu,number:()=>Ja,rfc5322Email:()=>XE,sha1_base64:()=>cP,sha1_base64url:()=>lP,sha1_hex:()=>sP,sha256_base64:()=>dP,sha256_base64url:()=>pP,sha256_hex:()=>uP,sha384_base64:()=>fP,sha384_base64url:()=>gP,sha384_hex:()=>mP,sha512_base64:()=>vP,sha512_base64url:()=>yP,sha512_hex:()=>hP,string:()=>Du,time:()=>Ru,ulid:()=>gu,undefined:()=>ju,unicodeEmail:()=>wy,uppercase:()=>Mu,uuid:()=>Qn,uuid4:()=>VE,uuid6:()=>JE,uuid7:()=>qE,xid:()=>hu});var mu=/^[cC][0-9a-z]{6,}$/,fu=/^[0-9a-z]+$/,gu=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,hu=/^[0-9a-vA-V]{20}$/,vu=/^[A-Za-z0-9]{27}$/,yu=/^[a-zA-Z0-9_-]{21}$/,bu=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,WE=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,xu=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Qn=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,VE=Qn(4),JE=Qn(6),qE=Qn(7),ku=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,KE=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,XE=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,wy=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,YE=wy,QE=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,eP="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function wu(){return new RegExp(eP,"u")}var Su=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,_u=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,$u=e=>{let t=mt(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},Iu=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Au=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Eu=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Va=/^[A-Za-z0-9_-]*$/,tP=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,nP=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Pu=/^https?$/,Cu=/^\+[1-9]\d{6,14}$/,Sy="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Tu=new RegExp(`^${Sy}$`);function _y(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Ru(e){return new RegExp(`^${_y(e)}$`)}function Ou(e){let t=_y({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${t}(?:${r.join("|")})`;return new RegExp(`^${Sy}T(?:${o})$`)}var Du=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Nu=/^-?\d+n?$/,Lu=/^-?\d+$/,Ja=/^-?\d+(?:\.\d+)?$/,Uu=/^(?:true|false)$/i,zu=/^null$/i;var ju=/^undefined$/i;var Fu=/^[^A-Z]*$/,Mu=/^[^a-z]*$/,rP=/^[0-9a-fA-F]*$/;function si(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function ci(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var oP=/^[0-9a-fA-F]{32}$/,iP=si(22,"=="),aP=ci(22),sP=/^[0-9a-fA-F]{40}$/,cP=si(27,"="),lP=ci(27),uP=/^[0-9a-fA-F]{64}$/,dP=si(43,"="),pP=ci(43),mP=/^[0-9a-fA-F]{96}$/,fP=si(64,""),gP=ci(64),hP=/^[0-9a-fA-F]{128}$/,vP=si(86,"=="),yP=ci(86);var de=v("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Iy={number:"number",bigint:"bigint",object:"date"},qa=v("$ZodCheckLessThan",(e,t)=>{de.init(e,t);let r=Iy[typeof t.value];e._zod.onattach.push(o=>{let n=o._zod.bag,i=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ka=v("$ZodCheckGreaterThan",(e,t)=>{de.init(e,t);let r=Iy[typeof t.value];e._zod.onattach.push(o=>{let n=o._zod.bag,i=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Bu=v("$ZodCheckMultipleOf",(e,t)=>{de.init(e,t),e._zod.onattach.push(r=>{var o;(o=r._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):eu(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),Hu=v("$ZodCheckNumberFormat",(e,t)=>{de.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,i]=au[t.format];e._zod.onattach.push(a=>{let s=a._zod.bag;s.format=t.format,s.minimum=n,s.maximum=i,r&&(s.pattern=Lu)}),e._zod.check=a=>{let s=a.value;if(r){if(!Number.isInteger(s)){a.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}s<n&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),s>i&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),Zu=v("$ZodCheckBigIntFormat",(e,t)=>{de.init(e,t);let[r,o]=su[t.format];e._zod.onattach.push(n=>{let i=n._zod.bag;i.format=t.format,i.minimum=r,i.maximum=o}),e._zod.check=n=>{let i=n.value;i<r&&n.issues.push({origin:"bigint",input:i,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),i>o&&n.issues.push({origin:"bigint",input:i,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),Gu=v("$ZodCheckMaxSize",(e,t)=>{var r;de.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Tn(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let n=o.value;n.size<=t.maximum||o.issues.push({origin:ni(n),code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Wu=v("$ZodCheckMinSize",(e,t)=>{var r;de.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Tn(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let n=o.value;n.size>=t.minimum||o.issues.push({origin:ni(n),code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Vu=v("$ZodCheckSizeEquals",(e,t)=>{var r;de.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Tn(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=o=>{let n=o.value,i=n.size;if(i===t.size)return;let a=i>t.size;o.issues.push({origin:ni(n),...a?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Ju=v("$ZodCheckMaxLength",(e,t)=>{var r;de.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Tn(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let n=o.value;if(n.length<=t.maximum)return;let a=ri(n);o.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),qu=v("$ZodCheckMinLength",(e,t)=>{var r;de.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Tn(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let n=o.value;if(n.length>=t.minimum)return;let a=ri(n);o.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Ku=v("$ZodCheckLengthEquals",(e,t)=>{var r;de.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Tn(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=o=>{let n=o.value,i=n.length;if(i===t.length)return;let a=ri(n),s=i>t.length;o.issues.push({origin:a,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Br=v("$ZodCheckStringFormat",(e,t)=>{var r,o;de.init(e,t),e._zod.onattach.push(n=>{let i=n._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),Xu=v("$ZodCheckRegex",(e,t)=>{Br.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Yu=v("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Fu),Br.init(e,t)}),Qu=v("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Mu),Br.init(e,t)}),ed=v("$ZodCheckIncludes",(e,t)=>{de.init(e,t);let r=mt(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=o,e._zod.onattach.push(n=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(o)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),td=v("$ZodCheckStartsWith",(e,t)=>{de.init(e,t);let r=new RegExp(`^${mt(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),nd=v("$ZodCheckEndsWith",(e,t)=>{de.init(e,t);let r=new RegExp(`.*${mt(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});function $y(e,t,r){e.issues.length&&t.issues.push(...qe(r,e.issues))}var rd=v("$ZodCheckProperty",(e,t)=>{de.init(e,t),e._zod.check=r=>{let o=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(o instanceof Promise)return o.then(n=>$y(n,r,t.property));$y(o,r,t.property)}}),od=v("$ZodCheckMimeType",(e,t)=>{de.init(e,t);let r=new Set(t.mime);e._zod.onattach.push(o=>{o._zod.bag.mime=t.mime}),e._zod.check=o=>{r.has(o.value.type)||o.issues.push({code:"invalid_value",values:t.mime,input:o.value.type,inst:e,continue:!t.abort})}}),id=v("$ZodCheckOverwrite",(e,t)=>{de.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var li=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let o=t.split(`
|
|
169
|
+
</div></body></html>`}import{spawn as Vl}from"node:child_process";function UA(e,t=Vl){return new Promise(r=>{let o=!1,n=s=>{o||(o=!0,r(s))},i=t("powershell.exe",["-NoProfile","-NonInteractive","-Command","$u=[Console]::In.ReadLine(); try { Start-Process $u -ErrorAction Stop } catch { exit 1 }"],{stdio:["pipe","ignore","ignore"]}),a=setTimeout(()=>{try{i.kill()}catch{}n(!1)},8e3);a.unref?.(),i.on("error",()=>{clearTimeout(a),n(!1)}),i.on("exit",s=>{clearTimeout(a),n(s===0)}),i.stdin?.on("error",()=>{}),i.stdin?.end(`${e}
|
|
170
|
+
`)})}function zA(e,t=Vl){return new Promise(r=>{let o=t("cmd.exe",["/c","start","",e.replace(/&/g,"^&")],{detached:!0,stdio:"ignore"});o.on("error",()=>r(!1)),o.on("spawn",()=>{o.unref(),r(!0)})})}var jA=1200;function Vv(e,t,r,o){return new Promise(n=>{let i=!1,a=u=>{i||(i=!0,n(u))},s=r(e,[t],{detached:!0,stdio:"ignore"}),l=setTimeout(()=>a(!0),o);l.unref?.(),s.on("error",()=>{clearTimeout(l),a(!1)}),s.on("exit",u=>{clearTimeout(l),a(u===0)}),s.on("spawn",()=>s.unref())})}async function Aa(e,t){let r=t.platform??process.platform,o=t.spawnImpl??Vl;if(r==="win32"||t.isWsl)return await UA(e,o)?!0:zA(e,o);let n=t.graceMs??jA;return Vv(r==="darwin"?"open":"xdg-open",e,o,n)}function Xo(){return ca().length>0}function FA(){Mo()}async function Jv(e,t,r){let o=(e??"").replace(/\/+$/,""),n=r?.fetchImpl??fetch;if(o&&t)try{await n(`${o}/node/revoke`,{method:"POST",headers:{"content-type":"application/json",authorization:`Bearer ${t}`},body:"{}",signal:AbortSignal.timeout(3e3)})}catch{}(r?.clear??FA)()}var BA=4,MA=1500,HA=e=>new Promise(t=>setTimeout(t,e)),Ko=null;function qv(e,t,r={}){if((r.hasCredential??Xo)())return Promise.resolve(!0);if(Ko)return Ko;let n=r.attempts??BA,i=r.retryMs??MA,a=r.provision??Dh,s=r.claim??Nh,l=r.store??Bo,u=r.log??(d=>console.error(d));return Ko=(async()=>{let d="no attempt made";try{for(let p=1;p<=n;p++){p>1&&await HA(i);let m=t();if(!m){d="no sign-in token available yet";continue}try{let f=await a(e,m),g=await s(e,f);if(!g.access_token||!g.refresh_token)throw new Error("claim returned an incomplete pair");return l(g),!0}catch(f){d=f instanceof Error?f.message:String(f)}}return u(`[auth] node-credential provisioning failed after ${n} attempts (hub will fall back to the app-refreshed token): ${d}`),!1}finally{Ko=null}})(),Ko}async function Kv(e){let t=Uv(),r=zv(),o=e.chooser?Wv(Gv({cfg:e.cfg,state:r,codeChallenge:t.challenge,...e.opts.email?{email:e.opts.email}:{},...e.opts.screenHint?{screenHint:e.opts.screenHint}:{}})):void 0,i=(e.listen??((d,p,m,f,g)=>Mv(d,p,m,f,void 0,void 0,g)))(e.cfg.port,r,e.signal,e.timeoutMs??18e4,o),a=e.openUrl??(d=>Aa(d,{isWsl:!1})),s;o?(i.result.catch(()=>{}),s=`http://127.0.0.1:${await i.port}/`):s=$a({cfg:e.cfg,opts:e.opts,state:r,codeChallenge:t.challenge}),await a(s)||e.onBrowserFail?.(s);let{code:l}=await i.result;return(e.exchange??((d,p,m)=>Fv(d,p,m)))(e.cfg,l,t.verifier)}import{spawn as ZA}from"node:child_process";import{existsSync as Xv}from"node:fs";import Ea from"node:path";function Dr(e={}){let t=e.platform??process.platform,r=e.env??(u=>process.env[u]),o=e.read??O,n=e.exists??Xv,i=u=>({path:u,darwinBundle:t==="darwin"&&u.endsWith(".app")}),a=r("BRIDGE_APP_PATH")?.trim();if(a&&n(a))return i(a);let s=o(Yv)?.trim();if(s&&n(s))return i(s);if(t==="win32"){let u=r("LOCALAPPDATA");if(u){let d=Ea.win32.join(u,"Programs","AC Bridge","ac-bridge.exe");if(n(d))return i(d)}return null}if(t==="darwin"){let u=r("HOME");for(let d of["/Applications/AC Bridge.app",...u?[Ea.join(u,"Applications","AC Bridge.app")]:[]])if(n(d))return i(d);return null}let l=r("PATH")??"";for(let u of l.split(Ea.delimiter).filter(Boolean)){let d=Ea.join(u,"ac-bridge");if(n(d))return i(d)}return null}function Pa(e,t=ZA){return new Promise(r=>{let o=e.darwinBundle?t("open",["-a",e.path],{detached:!0,stdio:"ignore"}):t(e.path,[],{detached:!0,stdio:"ignore"});o.on("error",()=>r(!1)),o.on("spawn",()=>{o.unref(),r(!0)})})}async function Ca(e){let t=e?.timeoutMs??18e4,r=e?.pollMs??1e3,o=e?.exists??Xv,n=e?.exists||e?.file?()=>o(e?.file??""):Xo,i=Date.now()+t;for(;;){if(n())return!0;if(Date.now()>=i)return!1;await new Promise(a=>setTimeout(a,r))}}import Ve from"node:path";function $e(e={}){let t=O(e.file??jo);if(!t)return null;try{let r=JSON.parse(t);return typeof r.sub!="string"||!r.sub?null:{sub:r.sub,...typeof r.email=="string"?{email:r.email}:{},updatedAt:typeof r.updatedAt=="number"?r.updatedAt:0}}catch{return null}}function Qt(e,t={}){let r={sub:e.sub,...e.email?{email:e.email}:{},updatedAt:Date.now()};ge(t.file??jo,`${JSON.stringify(r,null,2)}
|
|
171
|
+
`,384)}function Qv(e={}){de(e.file??jo)}function GA(){let e=$e()?.sub;if(!e)return null;let t=yt(ut(e)),r=O(t.refreshFile),o=r?Ge(r):null;if(o)return o;let n=O(t.accessFile);return n?Ge(n):null}function pt(e={}){let t=e.readActiveUser??(()=>$e()),r=e.readCredentialSub??GA,o=e.log??(s=>console.warn(s)),n=t()?.sub??null,i=r();if(!n||!i)return null;if(n!==i)return o(`user-scope: active-user pointer sub (${n}) does not match the credential sub (${i}) \u2014 refusing to resolve a scope (stale-pointer guard)`),null;let a=ut(n);return{sub:n,segment:a,dir:oa(a)}}function Qo(e){let t=e.dir;return{dir:t,providerSecretFile(r,o){return Yo("provider",r),Yo("secret name",o),Ve.join(t,"providers",r,`${o}.json`)},providerAccountsFile(r){return Yo("provider",r),Ve.join(t,"providers",r,"accounts.json")},localConfigFile:Ve.join(t,"local-config.json"),localDiscoveredFile:Ve.join(t,"local-discovered.json"),entitlementFile:Ve.join(t,"entitlement.json"),revertSessionFile:Ve.join(t,"revert-session.json"),telemetrySpoolDir:Ve.join(t,"telemetry","spool"),userConfigFile:Ve.join(t,"config.json"),relayAccessFile:Ve.join(t,"relay-access-token"),relayRefreshFile:Ve.join(t,"relay-refresh-token"),hubTokenFile:Ve.join(t,"hub-token"),workspaceFile:Ve.join(t,"workspace.json")}}function Jl(e,t){if((t?.layout??Kt())>=Xt){let o=(t?.resolveScope??(()=>pt()))();if(o)return Ve.join(e,"users",o.segment,"hub-token")}return Ve.join(e,"hub-token")}import{existsSync as WA,mkdirSync as ty,renameSync as ql}from"node:fs";import Ue from"node:path";var VA="layout-version.json",ny=3,JA=["providers","local-config.json","local-discovered.json","entitlement.json","revert-session.json","telemetry"];function ry(e={}){let t=e.secretDir??M,r=e.now??(()=>new Date),o=Ue.join(t,VA);if(eE(o))return{archived:[],skipped:!0,credentialRelocated:null,credentialArchived:!1};let n=Ue.join(t,`legacy-${QA(r())}`),i=!1,a=()=>(i||(ty(n,{recursive:!0,mode:448}),i=!0),n),s=JA.filter(p=>WA(Ue.join(t,p))),l=[];for(let p of s)try{a(),ql(Ue.join(t,p),Ue.join(n,p)),l.push(p)}catch(m){if(m.code==="ENOENT")continue;console.warn(`archiveLegacyUserState: failed to archive "${p}": ${m.message}`)}let u=l.length===s.length;de(Ue.join(t,"hub-token"));let d=u?YA(t,a):{relocated:null,archived:!1,ok:!0};return u&&d.ok&&(Sa({onboardedAt:null},{configFile:Ue.join(t,"config.json")}),tE(o,r)),{archived:l,skipped:!1,credentialRelocated:d.relocated,credentialArchived:d.archived}}function qA(e){return{accessFile:Ue.join(e,"relay-access-token"),refreshFile:Ue.join(e,"relay-refresh-token")}}function KA(e,t){let r=Ue.join(e,"users",t);return{accessFile:Ue.join(r,"relay-access-token"),refreshFile:Ue.join(r,"relay-refresh-token")}}function ey(e,t){try{return ty(Ue.dirname(t),{recursive:!0,mode:448}),ql(e,t),"moved"}catch(r){return r.code==="ENOENT"?"absent":(console.warn(`archiveLegacyUserState: failed to relocate credential to "${t}": ${r.message}`),"failed")}}function Ta(e,t,r){try{let o=e();return ql(t,Ue.join(o,r)),"moved"}catch(o){return o.code==="ENOENT"?"absent":(console.warn(`archiveLegacyUserState: failed to archive credential "${r}": ${o.message}`),"failed")}}function XA(e,t){let r=Ue.join(e,"active-user.json");if($e({file:r})===null)try{Qt({sub:t},{file:r})}catch(o){console.warn(`archiveLegacyUserState: failed to heal the active-user pointer to "${t}": ${o.message}`)}}function YA(e,t){let r=qA(e),o=O(r.refreshFile),n=O(r.accessFile);if(!o&&!n)return{relocated:null,archived:!1,ok:!0};let i=o?Ge(o):null,a=n?Ge(n):null,s=i??a;if(!s){let m=o?Ta(t,r.refreshFile,"relay-refresh-token"):"absent",f=n?Ta(t,r.accessFile,"relay-access-token"):"absent";return{relocated:null,archived:m==="moved"||f==="moved",ok:m!=="failed"&&f!=="failed"}}i&&a&&i!==a&&console.warn(`archiveLegacyUserState: access-token sub (${a}) differs from refresh-token sub (${i}) \u2014 relocating the refresh to its sub and archiving the access (the refresh loop re-mints a matching access)`);let l=ut(s),u=KA(e,l),d=!0,p=!1;if(o){let m=i===s?ey(r.refreshFile,u.refreshFile):Ta(t,r.refreshFile,"relay-refresh-token");m==="failed"?d=!1:m==="moved"&&i!==s&&(p=!0)}if(n){let m=a===s?ey(r.accessFile,u.accessFile):Ta(t,r.accessFile,"relay-access-token");m==="failed"?d=!1:m==="moved"&&a!==s&&(p=!0)}return d&&XA(e,s),{relocated:{sub:s,segment:l},archived:p,ok:d}}function QA(e){return e.toISOString().replace(/[:.]/g,"-")}function eE(e){let t=O(e);if(!t)return!1;try{let r=JSON.parse(t);return typeof r.version=="number"&&r.version>=ny}catch{return!1}}function tE(e,t){let r={version:ny,migratedAt:t().toISOString()};ge(e,`${JSON.stringify(r,null,2)}
|
|
172
|
+
`,384)}var sE=ze.join(M,"hub-token"),V2=Number(process.env.BRIDGE_HUB_PORT)||8790,we=ze.join(M,"config.json"),xt=ze.join(M,"hub.log"),Zo=ze.join(M,"hub.pid"),J2=ze.join(M,qn),Je=ze.join(M,"daemon.pid"),Ra=ze.join(M,"daemon-beacon.json"),En=ze.join(M,"daemon.log"),ei=ze.join(M,"hub-stop-reason.json"),Yv=ze.join(M,"app-path"),sy=ze.join(M,"hub-relay-status.json"),q2=ze.join(M,"hub-holders.json"),cy=ze.join(M,"sessions"),Kl=e=>ze.join(cy,`${e}.json`);function ge(e,t,r=384){let o=ze.dirname(e),n=(r&63)===0;if(rE(o,{recursive:!0,...n?{mode:448}:{}}),n)try{oy(o,448)}catch{}let i=`${e}.tmp-${process.pid}-${process.hrtime.bigint()}`;ay(i,t,{mode:r});try{iE(i,e)}catch(a){try{iy(i,{force:!0})}catch{}throw a}}function O(e){try{return oE(e,"utf8").trim()||null}catch{return null}}function ly(e,t){let r=t?.write??((n,i)=>ge(n,i,384)),o=t?.now??Date.now;try{r(ei,JSON.stringify({signal:e,ts:o()}))}catch{}}function Oa(){let e={};try{let t=O(we);t&&(e=JSON.parse(t))}catch{}return process.env.BRIDGE_MACHINE||e.machine||aE.hostname().split(".")[0]||"node"}function uy(){let e=Number(process.env.BRIDGE_HUB_PORT);if(e)return e;try{let t=O(we);if(t){let r=JSON.parse(t);if(r.hubPort)return Number(r.hubPort)}}catch{}return 8790}function Xl(e){try{ay(e,"",{mode:384}),oy(e,384)}catch{}}function de(e){try{iy(e,{force:!0})}catch{}}function Da(e){try{return process.kill(e,0),!0}catch(t){return t.code!=="ESRCH"}}function Yo(e,t){if(!t||t.includes("/")||t.includes("\\")||t.includes("..")||t.includes("\0"))throw new Error(`unsafe ${e}: ${JSON.stringify(t)}`)}function Na(e,t){return Yo("provider",e),`${e}_${nE("sha256").update(t).digest("hex").slice(0,12)}`}import{readFileSync as dE}from"node:fs";import{existsSync as cE}from"node:fs";import en from"node:path";import{fileURLToPath as lE}from"node:url";function uE(e){let t=process.env.BRIDGE_PKG_ROOT;if(t&&t.trim())return t.trim();let r=o=>cE(en.join(o,"plugin",".claude-plugin","marketplace.json"));for(let o of[en.join(e,".."),en.join(e,"..","..")])if(r(o))return o;return en.join(e,"..","..")}var tn=uE(en.dirname(lE(import.meta.url))),Nr=en.join(tn,"plugin"),ti=en.join(tn,"hub","dist","hub.cjs"),dy=en.join(tn,"hub","src","index.ts"),La=en.join(tn,"node_modules",".bin","tsx");var pE="https://relay.ac-bridge.com",mE=8790;function ne(){let e={};try{e=JSON.parse(dE(we,"utf8"))}catch{}return{relayUrl:process.env.BRIDGE_RELAY_URL||e.relayUrl||pE,hubPort:Number(process.env.BRIDGE_HUB_PORT||e.hubPort||mE),machine:Oa()}}var Yl=class extends Error{constructor(r,o){super(r);this.status=o}status};async function Ql(e,t,r){let{relayUrl:o}=ne();return fetch(`${o}${e}`,{method:"POST",headers:{"content-type":"application/json",...r?{authorization:`Bearer ${r}`}:{}},body:t===void 0?void 0:JSON.stringify(t)})}async function py(e){let t=await Ql("/node/claim",{claim_code:e});if(!t.ok)throw new Yl(`pairing failed (${t.status}): ${(await t.text()).slice(0,200)}`,t.status);return await t.json()}async function Ot(e){let{relayUrl:t}=ne();try{let r=await fetch(`${t}/entitlement`,{headers:{authorization:`Bearer ${e}`},signal:AbortSignal.timeout(6e3)});return r.ok?await r.json():null}catch{return null}}async function my(e,t=fetch){let{relayUrl:r}=ne();try{let o=await t(`${r}/sessions`,{headers:{authorization:`Bearer ${e}`},signal:AbortSignal.timeout(15e3)});return o.ok?(await o.text()).trim()||"(none)":null}catch{return null}}async function fy(e){let{relayUrl:t}=ne();try{let r=await fetch(`${t}/devices`,{headers:{authorization:`Bearer ${e}`},signal:AbortSignal.timeout(1e4)});return r.ok?await r.json():null}catch{return null}}async function gy(e,t){try{let r=await Ql("/device/command",t,e),o=await r.json().catch(()=>({})),n=typeof o.error=="string"?o.error:void 0,i=Cl(n)??n;return{ok:r.ok&&o.ok===!0,status:r.status,...i?{error:i}:{},...typeof o.verified=="boolean"?{verified:o.verified}:{},...typeof o.note=="string"?{note:o.note}:{}}}catch(r){return{ok:!1,status:0,error:r instanceof Error?r.message:"command failed"}}}async function hy(e){let{relayUrl:t}=ne();try{let r=await fetch(`${t}/device-config`,{headers:{authorization:`Bearer ${e}`},signal:AbortSignal.timeout(1e4)});if(!r.ok)return null;let o=await r.json();return o.config&&typeof o.config=="object"?o.config:{}}catch{return null}}async function vy(e){let{relayUrl:t}=ne();try{let r=await fetch(`${t}/connected-accounts`,{headers:{authorization:`Bearer ${e}`},signal:AbortSignal.timeout(1e4)});if(!r.ok)return null;let o=await r.json();return Array.isArray(o.accounts)?o.accounts:[]}catch{return null}}async function yy(e,t,r){let{relayUrl:o}=ne();try{let n=await fetch(`${o}/node/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"content-type":"application/json",authorization:`Bearer ${e}`},body:JSON.stringify(r)});if(n.ok)return{ok:!0,status:n.status};let i=await n.json().catch(()=>({})),a=typeof i.error=="string"?i.error:void 0;return{ok:!1,status:n.status,error:Cl(a)??a??`patch failed (${n.status})`}}catch(n){return{ok:!1,status:0,error:n instanceof Error?n.message:"patch failed"}}}async function by(e){let t=O(ve().accessFile)?.trim();if(!t)return{ok:!1,error:"This machine isn't paired yet \u2014 run `acbridge pair` first."};try{let r=await Ql(`/link/${encodeURIComponent(e)}/start`,{},t),o=await r.json().catch(()=>({}));return r.ok&&typeof o.authorize_url=="string"?{ok:!0,authorizeUrl:o.authorize_url}:{ok:!1,error:typeof o.error=="string"?o.error:`link start failed (${r.status})`}}catch(r){return{ok:!1,error:r instanceof Error?r.message:"link start failed"}}}var fE=!!process.stdout.isTTY&&!process.env.NO_COLOR,Ua=e=>t=>fE?`\x1B[${e}m${t}\x1B[0m`:t,gE=Ua("32"),hE=Ua("33"),vE=Ua("31"),Se=Ua("2"),eu=!1,ye=(e=!0)=>{eu=e};var za=e=>{eu?console.error(e):console.log(e)},he=e=>console.log(JSON.stringify(e)),A=e=>za(`${gE("\u2714")} ${e}`),U=e=>za(`${hE("\u26A0")} ${e}`),b=e=>console.error(`${vE("\u2717")} ${e}`),h=e=>za(e),X=e=>za(Se(`\u2022 ${e}`)),Pe=(e,t)=>(b(e),eu&&he({error:e,exit:t}),t);var qe={logoutFirst:(e="sign in")=>`This machine is already signed in as another account. Run \`acbridge logout\` first, then ${e}.`,pointerMismatch:"This machine's signed-in account doesn't match its stored account pointer \u2014 run `acbridge logout` then `acbridge login` to reset it.",unresolved:"Couldn't resolve this machine's signed-in account \u2014 run `acbridge login` again."};function xy(e,t="sign in"){return e.length===0?{ok:!0}:{ok:!1,message:qe.logoutFirst(t),ambiguous:e.length>=2}}function nt(e,t=U){return e.length<2?!1:(t(`found ${e.length} relay credentials on this machine (${e.map(r=>r.sub).join(", ")}) \u2014 a crash during an account switch can leave residue; run \`acbridge logout\` to clear it.`),!0)}function ja(e,t=ut){return e.segment===t(e.sub)}function ky(e){let t=e.layout??Kt(),r=e.read??O,o=e.paths??ve(),n=r(o.accessFile)?.trim()||"",i=e.resolveScope??(()=>pt());if(t<Xt)return n?{state:"ok",token:n,scope:i()}:{state:"signed-out"};let a=i();if(a)return n?{state:"ok",token:n,scope:a}:{state:"signed-out"};let s=(e.scan??dt)();return(e.warnAmbiguous??nt)(s),!!(e.readPointer??(()=>$e()))()||s.length>0?{state:"mismatch",message:qe.pointerMismatch}:{state:"signed-out"}}function Lr(e){let t=ky(e);return t.state==="ok"?{ok:!0,token:t.token,scope:t.scope}:t.state==="mismatch"?{ok:!1,message:t.message,exitCode:3}:{ok:!1,message:e.notSignedIn.message,exitCode:e.notSignedIn.exitCode}}function Pn(e={}){return ky(e)}function kt(){let e=pt();return e?Qo(e):null}function Ur(e,t){let r=O(e.providerAccountsFile(t));if(!r)return[];try{let o=JSON.parse(r);return Array.isArray(o)?o.filter(n=>typeof n=="object"&&n!==null):[]}catch{return[]}}function Fa(e,t,r){ge(e.providerAccountsFile(t),`${JSON.stringify(r,null,2)}
|
|
173
|
+
`,384)}function yE(e){try{let t=JSON.parse(Buffer.from(e.split(".")[1]??"","base64url").toString("utf8"));return typeof t.nid=="string"?t.nid:null}catch{return null}}var bE=()=>Lr({notSignedIn:{message:"This machine isn't paired yet \u2014 run `acbridge pair <code>` first.",exitCode:3}});async function wy(e,t={}){let r=e[0];if(r!=="on"&&r!=="off"&&r!=="status")return b("usage: acbridge capture on|off|status"),2;let o=(t.requireToken??bE)();if(!o.ok)return b(o.message),o.exitCode;let n=o.token;if(r==="status"){let u=await(t.fetchEntitlement??Ot)(n);u?(h(`plan: ${u.plan}`),h(`capture.telemetry: ${u.capture.telemetry}`),h(`capture.transcripts: ${u.capture.transcripts}`)):b("couldn't fetch entitlement from the relay (signed out, or the relay is unreachable)");let p=(t.entitlementFileRaw??xE)();if(!p)return h("local entitlement file: absent (capture fail-closed until the hub next syncs)"),0;try{let m=JSON.parse(p),f=(Date.now()-(m.fetchedAt??0))/36e5;h(`local entitlement file: ${f.toFixed(1)}h old (${f<=24?"fresh":"STALE \u2014 capture fail-closed"})`)}catch{h("local entitlement file: unreadable (capture fail-closed)")}return 0}let i=yE(n);if(!i)return b("Couldn't read this machine's node id from its access token \u2014 re-pair with `acbridge pair`."),1;let s=await(t.patchNode??yy)(n,i,{captureEnabled:r==="on"});return s.ok?(h(`Capture ${r==="on"?"enabled":"disabled"} for this machine.`),r==="on"&&h("Note: capture is on by default for every account \u2014 this only re-enables it for THIS machine (still subject to the global capture switch)."),0):(b(`capture ${r} failed${s.status?` (${s.status})`:""}: ${s.error??"unknown"}`),1)}function xE(){let e=kt();return e?O(e.entitlementFile):null}import{readFileSync as K1}from"node:fs";import{createInterface as X1}from"node:readline";var c={};Jt(c,{$brand:()=>nu,$input:()=>Sp,$output:()=>wp,NEVER:()=>tu,TimePrecision:()=>Ap,ZodAny:()=>vf,ZodArray:()=>kf,ZodBase64:()=>mc,ZodBase64URL:()=>fc,ZodBigInt:()=>go,ZodBigIntFormat:()=>vc,ZodBoolean:()=>fo,ZodCIDRv4:()=>dc,ZodCIDRv6:()=>pc,ZodCUID:()=>oc,ZodCUID2:()=>ic,ZodCatch:()=>Hf,ZodCodec:()=>Oi,ZodCustom:()=>Di,ZodCustomStringFormat:()=>po,ZodDate:()=>Ei,ZodDefault:()=>Uf,ZodDiscriminatedUnion:()=>Sf,ZodE164:()=>gc,ZodEmail:()=>tc,ZodEmoji:()=>nc,ZodEnum:()=>lo,ZodError:()=>XC,ZodExactOptional:()=>Df,ZodFile:()=>Rf,ZodFirstPartyTypeKind:()=>ng,ZodFunction:()=>Qf,ZodGUID:()=>Si,ZodIPv4:()=>lc,ZodIPv6:()=>uc,ZodISODate:()=>qs,ZodISODateTime:()=>Js,ZodISODuration:()=>Xs,ZodISOTime:()=>Ks,ZodIntersection:()=>_f,ZodIssueCode:()=>QC,ZodJWT:()=>hc,ZodKSUID:()=>cc,ZodLazy:()=>Kf,ZodLiteral:()=>Tf,ZodMAC:()=>uf,ZodMap:()=>Pf,ZodNaN:()=>Gf,ZodNanoID:()=>rc,ZodNever:()=>bf,ZodNonOptional:()=>Sc,ZodNull:()=>gf,ZodNullable:()=>Lf,ZodNumber:()=>mo,ZodNumberFormat:()=>sr,ZodObject:()=>Ci,ZodOptional:()=>wc,ZodPipe:()=>Ri,ZodPrefault:()=>jf,ZodPreprocess:()=>Wf,ZodPromise:()=>Yf,ZodReadonly:()=>Vf,ZodRealError:()=>Ye,ZodRecord:()=>co,ZodSet:()=>Cf,ZodString:()=>uo,ZodStringFormat:()=>ue,ZodSuccess:()=>Mf,ZodSymbol:()=>mf,ZodTemplateLiteral:()=>qf,ZodTransform:()=>Of,ZodTuple:()=>If,ZodType:()=>H,ZodULID:()=>ac,ZodURL:()=>Ai,ZodUUID:()=>Ut,ZodUndefined:()=>ff,ZodUnion:()=>Ti,ZodUnknown:()=>yf,ZodVoid:()=>xf,ZodXID:()=>sc,ZodXor:()=>wf,_ZodString:()=>ec,_default:()=>zf,_function:()=>uk,any:()=>Bx,array:()=>Pi,base64:()=>_x,base64url:()=>$x,bigint:()=>Lx,boolean:()=>pf,catch:()=>Zf,check:()=>dk,cidrv4:()=>wx,cidrv6:()=>Sx,clone:()=>je,codec:()=>ak,coerce:()=>rg,config:()=>be,core:()=>on,cuid:()=>fx,cuid2:()=>gx,custom:()=>pk,date:()=>Hx,decode:()=>nf,decodeAsync:()=>of,describe:()=>mk,discriminatedUnion:()=>qx,e164:()=>Ix,email:()=>ox,emoji:()=>px,encode:()=>tf,encodeAsync:()=>rf,endsWith:()=>Yr,enum:()=>xc,exactOptional:()=>Nf,file:()=>nk,flattenError:()=>li,float32:()=>Rx,float64:()=>Ox,formatError:()=>ui,fromJSONSchema:()=>xk,function:()=>uk,getErrorMap:()=>tT,globalRegistry:()=>Ce,gt:()=>Nt,gte:()=>Be,guid:()=>ix,hash:()=>Tx,hex:()=>Cx,hostname:()=>Px,httpUrl:()=>dx,includes:()=>Kr,instanceof:()=>gk,int:()=>Ys,int32:()=>Dx,int64:()=>Ux,intersection:()=>$f,invertCodec:()=>sk,ipv4:()=>bx,ipv6:()=>kx,iso:()=>so,json:()=>vk,jwt:()=>Ax,keyof:()=>Zx,ksuid:()=>yx,lazy:()=>Xf,length:()=>ir,literal:()=>tk,locales:()=>yi,looseObject:()=>Vx,looseRecord:()=>Xx,lowercase:()=>Jr,lt:()=>Dt,lte:()=>ot,mac:()=>xx,map:()=>Yx,maxLength:()=>or,maxSize:()=>Ln,meta:()=>fk,mime:()=>Qr,minLength:()=>rn,minSize:()=>Lt,multipleOf:()=>Nn,nan:()=>ik,nanoid:()=>mx,nativeEnum:()=>ek,negative:()=>zs,never:()=>yc,nonnegative:()=>Fs,nonoptional:()=>Bf,nonpositive:()=>js,normalize:()=>eo,null:()=>hf,nullable:()=>$i,nullish:()=>rk,number:()=>df,object:()=>Gx,optional:()=>_i,overwrite:()=>St,parse:()=>Xm,parseAsync:()=>Ym,partialRecord:()=>Kx,pipe:()=>Qs,positive:()=>Us,prefault:()=>Ff,preprocess:()=>yk,prettifyError:()=>gu,promise:()=>lk,property:()=>Bs,readonly:()=>Jf,record:()=>Ef,refine:()=>eg,regex:()=>Vr,regexes:()=>rt,registry:()=>hs,safeDecode:()=>sf,safeDecodeAsync:()=>lf,safeEncode:()=>af,safeEncodeAsync:()=>cf,safeParse:()=>Qm,safeParseAsync:()=>ef,set:()=>Qx,setErrorMap:()=>eT,size:()=>rr,slugify:()=>oo,startsWith:()=>Xr,strictObject:()=>Wx,string:()=>wi,stringFormat:()=>Ex,stringbool:()=>hk,success:()=>ok,superRefine:()=>tg,symbol:()=>jx,templateLiteral:()=>ck,toJSONSchema:()=>Gs,toLowerCase:()=>no,toUpperCase:()=>ro,transform:()=>kc,treeifyError:()=>fu,trim:()=>to,tuple:()=>Af,uint32:()=>Nx,uint64:()=>zx,ulid:()=>hx,undefined:()=>Fx,union:()=>bc,unknown:()=>ar,uppercase:()=>qr,url:()=>ux,util:()=>$,uuid:()=>ax,uuidv4:()=>sx,uuidv6:()=>cx,uuidv7:()=>lx,void:()=>Mx,xid:()=>vx,xor:()=>Jx});var on={};Jt(on,{$ZodAny:()=>Zd,$ZodArray:()=>qd,$ZodAsyncError:()=>wt,$ZodBase64:()=>Dd,$ZodBase64URL:()=>Nd,$ZodBigInt:()=>cs,$ZodBigIntFormat:()=>Fd,$ZodBoolean:()=>fi,$ZodCIDRv4:()=>Td,$ZodCIDRv6:()=>Rd,$ZodCUID:()=>bd,$ZodCUID2:()=>xd,$ZodCatch:()=>mp,$ZodCheck:()=>pe,$ZodCheckBigIntFormat:()=>qu,$ZodCheckEndsWith:()=>sd,$ZodCheckGreaterThan:()=>ns,$ZodCheckIncludes:()=>id,$ZodCheckLengthEquals:()=>td,$ZodCheckLessThan:()=>ts,$ZodCheckLowerCase:()=>rd,$ZodCheckMaxLength:()=>Qu,$ZodCheckMaxSize:()=>Ku,$ZodCheckMimeType:()=>ld,$ZodCheckMinLength:()=>ed,$ZodCheckMinSize:()=>Xu,$ZodCheckMultipleOf:()=>Vu,$ZodCheckNumberFormat:()=>Ju,$ZodCheckOverwrite:()=>ud,$ZodCheckProperty:()=>cd,$ZodCheckRegex:()=>nd,$ZodCheckSizeEquals:()=>Yu,$ZodCheckStartsWith:()=>ad,$ZodCheckStringFormat:()=>Gr,$ZodCheckUpperCase:()=>od,$ZodCodec:()=>hi,$ZodCustom:()=>kp,$ZodCustomStringFormat:()=>zd,$ZodDate:()=>Jd,$ZodDefault:()=>lp,$ZodDiscriminatedUnion:()=>Yd,$ZodE164:()=>Ld,$ZodEmail:()=>gd,$ZodEmoji:()=>vd,$ZodEncodeError:()=>Cn,$ZodEnum:()=>rp,$ZodError:()=>ci,$ZodExactOptional:()=>sp,$ZodFile:()=>ip,$ZodFunction:()=>yp,$ZodGUID:()=>md,$ZodIPv4:()=>Ed,$ZodIPv6:()=>Pd,$ZodISODate:()=>$d,$ZodISODateTime:()=>_d,$ZodISODuration:()=>Ad,$ZodISOTime:()=>Id,$ZodIntersection:()=>Qd,$ZodJWT:()=>Ud,$ZodKSUID:()=>Sd,$ZodLazy:()=>xp,$ZodLiteral:()=>op,$ZodMAC:()=>Cd,$ZodMap:()=>tp,$ZodNaN:()=>fp,$ZodNanoID:()=>yd,$ZodNever:()=>Wd,$ZodNonOptional:()=>dp,$ZodNull:()=>Hd,$ZodNullable:()=>cp,$ZodNumber:()=>ss,$ZodNumberFormat:()=>jd,$ZodObject:()=>Qy,$ZodObjectJIT:()=>Kd,$ZodOptional:()=>us,$ZodPipe:()=>ds,$ZodPrefault:()=>up,$ZodPreprocess:()=>gp,$ZodPromise:()=>bp,$ZodReadonly:()=>hp,$ZodRealError:()=>Xe,$ZodRecord:()=>ep,$ZodRegistry:()=>gs,$ZodSet:()=>np,$ZodString:()=>nr,$ZodStringFormat:()=>le,$ZodSuccess:()=>pp,$ZodSymbol:()=>Bd,$ZodTemplateLiteral:()=>vp,$ZodTransform:()=>ap,$ZodTuple:()=>ls,$ZodType:()=>F,$ZodULID:()=>kd,$ZodURL:()=>hd,$ZodUUID:()=>fd,$ZodUndefined:()=>Md,$ZodUnion:()=>gi,$ZodUnknown:()=>Gd,$ZodVoid:()=>Vd,$ZodXID:()=>wd,$ZodXor:()=>Xd,$brand:()=>nu,$constructor:()=>v,$input:()=>Sp,$output:()=>wp,Doc:()=>mi,JSONSchema:()=>tx,JSONSchemaGenerator:()=>Ws,NEVER:()=>tu,TimePrecision:()=>Ap,_any:()=>Jp,_array:()=>tm,_base64:()=>Os,_base64url:()=>Ds,_bigint:()=>Bp,_boolean:()=>jp,_catch:()=>HC,_check:()=>ex,_cidrv4:()=>Ts,_cidrv6:()=>Rs,_coercedBigint:()=>Mp,_coercedBoolean:()=>Fp,_coercedDate:()=>Qp,_coercedNumber:()=>Op,_coercedString:()=>$p,_cuid:()=>_s,_cuid2:()=>$s,_custom:()=>rm,_date:()=>Yp,_decode:()=>Wa,_decodeAsync:()=>Ja,_default:()=>FC,_discriminatedUnion:()=>EC,_e164:()=>Ns,_email:()=>vs,_emoji:()=>ws,_encode:()=>Ga,_encodeAsync:()=>Va,_endsWith:()=>Yr,_enum:()=>DC,_file:()=>nm,_float32:()=>Np,_float64:()=>Lp,_gt:()=>Nt,_gte:()=>Be,_guid:()=>bi,_includes:()=>Kr,_int:()=>Dp,_int32:()=>Up,_int64:()=>Hp,_intersection:()=>PC,_ipv4:()=>Ps,_ipv6:()=>Cs,_isoDate:()=>Pp,_isoDateTime:()=>Ep,_isoDuration:()=>Tp,_isoTime:()=>Cp,_jwt:()=>Ls,_ksuid:()=>Es,_lazy:()=>VC,_length:()=>ir,_literal:()=>LC,_lowercase:()=>Jr,_lt:()=>Dt,_lte:()=>ot,_mac:()=>Ip,_map:()=>RC,_max:()=>ot,_maxLength:()=>or,_maxSize:()=>Ln,_mime:()=>Qr,_min:()=>Be,_minLength:()=>rn,_minSize:()=>Lt,_multipleOf:()=>Nn,_nan:()=>em,_nanoid:()=>Ss,_nativeEnum:()=>NC,_negative:()=>zs,_never:()=>Kp,_nonnegative:()=>Fs,_nonoptional:()=>BC,_nonpositive:()=>js,_normalize:()=>eo,_null:()=>Vp,_nullable:()=>jC,_number:()=>Rp,_optional:()=>zC,_overwrite:()=>St,_parse:()=>Br,_parseAsync:()=>Mr,_pipe:()=>ZC,_positive:()=>Us,_promise:()=>JC,_property:()=>Bs,_readonly:()=>GC,_record:()=>TC,_refine:()=>om,_regex:()=>Vr,_safeDecode:()=>Ka,_safeDecodeAsync:()=>Ya,_safeEncode:()=>qa,_safeEncodeAsync:()=>Xa,_safeParse:()=>Hr,_safeParseAsync:()=>Zr,_set:()=>OC,_size:()=>rr,_slugify:()=>oo,_startsWith:()=>Xr,_string:()=>_p,_stringFormat:()=>io,_stringbool:()=>cm,_success:()=>MC,_superRefine:()=>im,_symbol:()=>Gp,_templateLiteral:()=>WC,_toLowerCase:()=>no,_toUpperCase:()=>ro,_transform:()=>UC,_trim:()=>to,_tuple:()=>CC,_uint32:()=>zp,_uint64:()=>Zp,_ulid:()=>Is,_undefined:()=>Wp,_union:()=>IC,_unknown:()=>qp,_uppercase:()=>qr,_url:()=>xi,_uuid:()=>ys,_uuidv4:()=>bs,_uuidv6:()=>xs,_uuidv7:()=>ks,_void:()=>Xp,_xid:()=>As,_xor:()=>AC,clone:()=>je,config:()=>be,createStandardJSONSchemaMethod:()=>ao,createToJSONSchemaMethod:()=>lm,decode:()=>JE,decodeAsync:()=>KE,describe:()=>am,encode:()=>VE,encodeAsync:()=>qE,extractDefs:()=>zn,finalize:()=>jn,flattenError:()=>li,formatError:()=>ui,globalConfig:()=>Qn,globalRegistry:()=>Ce,initializeContext:()=>Un,isValidBase64:()=>Od,isValidBase64URL:()=>qy,isValidJWT:()=>Ky,locales:()=>yi,meta:()=>sm,parse:()=>Ha,parseAsync:()=>Za,prettifyError:()=>gu,process:()=>oe,regexes:()=>rt,registry:()=>hs,safeDecode:()=>YE,safeDecodeAsync:()=>eP,safeEncode:()=>XE,safeEncodeAsync:()=>QE,safeParse:()=>hu,safeParseAsync:()=>vu,toDotPath:()=>Ey,toJSONSchema:()=>Gs,treeifyError:()=>fu,util:()=>$,version:()=>dd});var Sy,tu=Object.freeze({status:"aborted"});function v(e,t,r){function o(s,l){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:l,constr:a,traits:new Set},enumerable:!1}),s._zod.traits.has(e))return;s._zod.traits.add(e),t(s,l);let u=a.prototype,d=Object.keys(u);for(let p=0;p<d.length;p++){let m=d[p];m in s||(s[m]=u[m].bind(s))}}let n=r?.Parent??Object;class i extends n{}Object.defineProperty(i,"name",{value:e});function a(s){var l;let u=r?.Parent?new i:this;o(u,s),(l=u._zod).deferred??(l.deferred=[]);for(let d of u._zod.deferred)d();return u}return Object.defineProperty(a,"init",{value:o}),Object.defineProperty(a,Symbol.hasInstance,{value:s=>r?.Parent&&s instanceof r.Parent?!0:s?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}var nu=Symbol("zod_brand"),wt=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Cn=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(Sy=globalThis).__zod_globalConfig??(Sy.__zod_globalConfig={});var Qn=globalThis.__zod_globalConfig;function be(e){return e&&Object.assign(Qn,e),Qn}var $={};Jt($,{BIGINT_FORMAT_RANGES:()=>pu,Class:()=>ou,NUMBER_FORMAT_RANGES:()=>du,aborted:()=>Dn,allowsEval:()=>su,assert:()=>$E,assertEqual:()=>kE,assertIs:()=>SE,assertNever:()=>_E,assertNotEqual:()=>wE,assignProp:()=>Rn,base64ToUint8Array:()=>$y,base64urlToUint8Array:()=>ME,cached:()=>jr,captureStackTrace:()=>Ma,cleanEnum:()=>BE,cleanRegex:()=>oi,clone:()=>je,cloneDef:()=>AE,createTransparentProxy:()=>OE,defineLazy:()=>V,esc:()=>Ba,escapeRegex:()=>mt,explicitlyAborted:()=>mu,extend:()=>LE,finalizeIssue:()=>Fe,floatSafeRemainder:()=>iu,getElementAtPath:()=>EE,getEnumValues:()=>ri,getLengthableOrigin:()=>si,getParsedType:()=>RE,getSizableOrigin:()=>ai,hexToUint8Array:()=>ZE,isObject:()=>er,isPlainObject:()=>On,issue:()=>Fr,joinValues:()=>x,jsonStringifyReplacer:()=>zr,merge:()=>zE,mergeDefs:()=>nn,normalizeParams:()=>I,nullish:()=>Tn,numKeys:()=>TE,objectClone:()=>IE,omit:()=>NE,optionalKeys:()=>uu,parsedType:()=>S,partial:()=>jE,pick:()=>DE,prefixIssues:()=>Ke,primitiveTypes:()=>lu,promiseAllObject:()=>PE,propertyKeyTypes:()=>ii,randomString:()=>CE,required:()=>FE,safeExtend:()=>UE,shallowClone:()=>cu,slugify:()=>au,stringifyPrimitive:()=>w,uint8ArrayToBase64:()=>Iy,uint8ArrayToBase64url:()=>HE,uint8ArrayToHex:()=>GE,unwrapMessage:()=>ni});function kE(e){return e}function wE(e){return e}function SE(e){}function _E(e){throw new Error("Unexpected value in exhaustive check")}function $E(e){}function ri(e){let t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,n])=>t.indexOf(+o)===-1).map(([o,n])=>n)}function x(e,t="|"){return e.map(r=>w(r)).join(t)}function zr(e,t){return typeof t=="bigint"?t.toString():t}function jr(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function Tn(e){return e==null}function oi(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function iu(e,t){let r=e/t,o=Math.round(r),n=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-o)<n?0:r-o}var _y=Symbol("evaluating");function V(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==_y)return o===void 0&&(o=_y,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function IE(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Rn(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function nn(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function AE(e){return nn(e._zod.def)}function EE(e,t){return t?t.reduce((r,o)=>r?.[o],e):e}function PE(e){let t=Object.keys(e),r=t.map(o=>e[o]);return Promise.all(r).then(o=>{let n={};for(let i=0;i<t.length;i++)n[t[i]]=o[i];return n})}function CE(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let o=0;o<e;o++)r+=t[Math.floor(Math.random()*t.length)];return r}function Ba(e){return JSON.stringify(e)}function au(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Ma="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function er(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var su=jr(()=>{if(Qn.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function On(e){if(er(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(er(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function cu(e){return On(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function TE(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var RE=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},ii=new Set(["string","number","symbol"]),lu=new Set(["string","number","bigint","boolean","symbol","undefined"]);function mt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function je(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function I(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function OE(e){let t;return new Proxy({},{get(r,o,n){return t??(t=e()),Reflect.get(t,o,n)},set(r,o,n,i){return t??(t=e()),Reflect.set(t,o,n,i)},has(r,o){return t??(t=e()),Reflect.has(t,o)},deleteProperty(r,o){return t??(t=e()),Reflect.deleteProperty(t,o)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,o){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(r,o,n){return t??(t=e()),Reflect.defineProperty(t,o,n)}})}function w(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function uu(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var du={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},pu={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function DE(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let i=nn(e._zod.def,{get shape(){let a={};for(let s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&(a[s]=r.shape[s])}return Rn(this,"shape",a),a},checks:[]});return je(e,i)}function NE(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let i=nn(e._zod.def,{get shape(){let a={...e._zod.def.shape};for(let s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&delete a[s]}return Rn(this,"shape",a),a},checks:[]});return je(e,i)}function LE(e,t){if(!On(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let i=e._zod.def.shape;for(let a in t)if(Object.getOwnPropertyDescriptor(i,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=nn(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return Rn(this,"shape",i),i}});return je(e,n)}function UE(e,t){if(!On(t))throw new Error("Invalid input to safeExtend: expected a plain object");let r=nn(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return Rn(this,"shape",o),o}});return je(e,r)}function zE(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=nn(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t._zod.def.shape};return Rn(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return je(e,r)}function jE(e,t,r){let n=t._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let a=nn(t._zod.def,{get shape(){let s=t._zod.def.shape,l={...s};if(r)for(let u in r){if(!(u in s))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(l[u]=e?new e({type:"optional",innerType:s[u]}):s[u])}else for(let u in s)l[u]=e?new e({type:"optional",innerType:s[u]}):s[u];return Rn(this,"shape",l),l},checks:[]});return je(t,a)}function FE(e,t,r){let o=nn(t._zod.def,{get shape(){let n=t._zod.def.shape,i={...n};if(r)for(let a in r){if(!(a in i))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(i[a]=new e({type:"nonoptional",innerType:n[a]}))}else for(let a in n)i[a]=new e({type:"nonoptional",innerType:n[a]});return Rn(this,"shape",i),i}});return je(t,o)}function Dn(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function mu(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function Ke(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function ni(e){return typeof e=="string"?e:e?.message}function Fe(e,t,r){let o=e.message?e.message:ni(e.inst?._zod.def?.error?.(e))??ni(t?.error?.(e))??ni(r.customError?.(e))??ni(r.localeError?.(e))??"Invalid input",{inst:n,continue:i,input:a,...s}=e;return s.path??(s.path=[]),s.message=o,t?.reportInput&&(s.input=a),s}function ai(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function si(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function S(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function Fr(...e){let[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}function BE(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function $y(e){let t=atob(e),r=new Uint8Array(t.length);for(let o=0;o<t.length;o++)r[o]=t.charCodeAt(o);return r}function Iy(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function ME(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return $y(t+r)}function HE(e){return Iy(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function ZE(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)r[o/2]=Number.parseInt(t.slice(o,o+2),16);return r}function GE(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var ou=class{constructor(...t){}};var Ay=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,zr,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ci=v("$ZodError",Ay),Xe=v("$ZodError",Ay,{Parent:Error});function li(e,t=r=>r.message){let r={},o=[];for(let n of e.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):o.push(t(n));return{formErrors:o,fieldErrors:r}}function ui(e,t=r=>r.message){let r={_errors:[]},o=(n,i=[])=>{for(let a of n.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(s=>o({issues:s},[...i,...a.path]));else if(a.code==="invalid_key")o({issues:a.issues},[...i,...a.path]);else if(a.code==="invalid_element")o({issues:a.issues},[...i,...a.path]);else{let s=[...i,...a.path];if(s.length===0)r._errors.push(t(a));else{let l=r,u=0;for(;u<s.length;){let d=s[u];u===s.length-1?(l[d]=l[d]||{_errors:[]},l[d]._errors.push(t(a))):l[d]=l[d]||{_errors:[]},l=l[d],u++}}}};return o(e),r}function fu(e,t=r=>r.message){let r={errors:[]},o=(n,i=[])=>{var a,s;for(let l of n.issues)if(l.code==="invalid_union"&&l.errors.length)l.errors.map(u=>o({issues:u},[...i,...l.path]));else if(l.code==="invalid_key")o({issues:l.issues},[...i,...l.path]);else if(l.code==="invalid_element")o({issues:l.issues},[...i,...l.path]);else{let u=[...i,...l.path];if(u.length===0){r.errors.push(t(l));continue}let d=r,p=0;for(;p<u.length;){let m=u[p],f=p===u.length-1;typeof m=="string"?(d.properties??(d.properties={}),(a=d.properties)[m]??(a[m]={errors:[]}),d=d.properties[m]):(d.items??(d.items=[]),(s=d.items)[m]??(s[m]={errors:[]}),d=d.items[m]),f&&d.errors.push(t(l)),p++}}};return o(e),r}function Ey(e){let t=[],r=e.map(o=>typeof o=="object"?o.key:o);for(let o of r)typeof o=="number"?t.push(`[${o}]`):typeof o=="symbol"?t.push(`[${JSON.stringify(String(o))}]`):/[^\w$]/.test(o)?t.push(`[${JSON.stringify(o)}]`):(t.length&&t.push("."),t.push(o));return t.join("")}function gu(e){let t=[],r=[...e.issues].sort((o,n)=>(o.path??[]).length-(n.path??[]).length);for(let o of r)t.push(`\u2716 ${o.message}`),o.path?.length&&t.push(` \u2192 at ${Ey(o.path)}`);return t.join(`
|
|
174
|
+
`)}var Br=e=>(t,r,o,n)=>{let i=o?{...o,async:!1}:{async:!1},a=t._zod.run({value:r,issues:[]},i);if(a instanceof Promise)throw new wt;if(a.issues.length){let s=new(n?.Err??e)(a.issues.map(l=>Fe(l,i,be())));throw Ma(s,n?.callee),s}return a.value},Ha=Br(Xe),Mr=e=>async(t,r,o,n)=>{let i=o?{...o,async:!0}:{async:!0},a=t._zod.run({value:r,issues:[]},i);if(a instanceof Promise&&(a=await a),a.issues.length){let s=new(n?.Err??e)(a.issues.map(l=>Fe(l,i,be())));throw Ma(s,n?.callee),s}return a.value},Za=Mr(Xe),Hr=e=>(t,r,o)=>{let n=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},n);if(i instanceof Promise)throw new wt;return i.issues.length?{success:!1,error:new(e??ci)(i.issues.map(a=>Fe(a,n,be())))}:{success:!0,data:i.value}},hu=Hr(Xe),Zr=e=>async(t,r,o)=>{let n=o?{...o,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},n);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(a=>Fe(a,n,be())))}:{success:!0,data:i.value}},vu=Zr(Xe),Ga=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Br(e)(t,r,n)},VE=Ga(Xe),Wa=e=>(t,r,o)=>Br(e)(t,r,o),JE=Wa(Xe),Va=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Mr(e)(t,r,n)},qE=Va(Xe),Ja=e=>async(t,r,o)=>Mr(e)(t,r,o),KE=Ja(Xe),qa=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Hr(e)(t,r,n)},XE=qa(Xe),Ka=e=>(t,r,o)=>Hr(e)(t,r,o),YE=Ka(Xe),Xa=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Zr(e)(t,r,n)},QE=Xa(Xe),Ya=e=>async(t,r,o)=>Zr(e)(t,r,o),eP=Ya(Xe);var rt={};Jt(rt,{base64:()=>Ou,base64url:()=>Qa,bigint:()=>Fu,boolean:()=>Mu,browserEmail:()=>cP,cidrv4:()=>Tu,cidrv6:()=>Ru,cuid:()=>yu,cuid2:()=>bu,date:()=>Lu,datetime:()=>zu,domain:()=>dP,duration:()=>_u,e164:()=>Nu,email:()=>Iu,emoji:()=>Au,extendedDuration:()=>tP,guid:()=>$u,hex:()=>pP,hostname:()=>uP,html5Email:()=>iP,httpProtocol:()=>Du,idnEmail:()=>sP,integer:()=>Bu,ipv4:()=>Eu,ipv6:()=>Pu,ksuid:()=>wu,lowercase:()=>Gu,mac:()=>Cu,md5_base64:()=>fP,md5_base64url:()=>gP,md5_hex:()=>mP,nanoid:()=>Su,null:()=>Hu,number:()=>es,rfc5322Email:()=>aP,sha1_base64:()=>vP,sha1_base64url:()=>yP,sha1_hex:()=>hP,sha256_base64:()=>xP,sha256_base64url:()=>kP,sha256_hex:()=>bP,sha384_base64:()=>SP,sha384_base64url:()=>_P,sha384_hex:()=>wP,sha512_base64:()=>IP,sha512_base64url:()=>AP,sha512_hex:()=>$P,string:()=>ju,time:()=>Uu,ulid:()=>xu,undefined:()=>Zu,unicodeEmail:()=>Py,uppercase:()=>Wu,uuid:()=>tr,uuid4:()=>nP,uuid6:()=>rP,uuid7:()=>oP,xid:()=>ku});var yu=/^[cC][0-9a-z]{6,}$/,bu=/^[0-9a-z]+$/,xu=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ku=/^[0-9a-vA-V]{20}$/,wu=/^[A-Za-z0-9]{27}$/,Su=/^[a-zA-Z0-9_-]{21}$/,_u=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,tP=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,$u=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,tr=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,nP=tr(4),rP=tr(6),oP=tr(7),Iu=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,iP=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,aP=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Py=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,sP=Py,cP=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,lP="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Au(){return new RegExp(lP,"u")}var Eu=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Pu=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Cu=e=>{let t=mt(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},Tu=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Ru=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Ou=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Qa=/^[A-Za-z0-9_-]*$/,uP=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,dP=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Du=/^https?$/,Nu=/^\+[1-9]\d{6,14}$/,Cy="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Lu=new RegExp(`^${Cy}$`);function Ty(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Uu(e){return new RegExp(`^${Ty(e)}$`)}function zu(e){let t=Ty({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${t}(?:${r.join("|")})`;return new RegExp(`^${Cy}T(?:${o})$`)}var ju=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Fu=/^-?\d+n?$/,Bu=/^-?\d+$/,es=/^-?\d+(?:\.\d+)?$/,Mu=/^(?:true|false)$/i,Hu=/^null$/i;var Zu=/^undefined$/i;var Gu=/^[^A-Z]*$/,Wu=/^[^a-z]*$/,pP=/^[0-9a-fA-F]*$/;function di(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function pi(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var mP=/^[0-9a-fA-F]{32}$/,fP=di(22,"=="),gP=pi(22),hP=/^[0-9a-fA-F]{40}$/,vP=di(27,"="),yP=pi(27),bP=/^[0-9a-fA-F]{64}$/,xP=di(43,"="),kP=pi(43),wP=/^[0-9a-fA-F]{96}$/,SP=di(64,""),_P=pi(64),$P=/^[0-9a-fA-F]{128}$/,IP=di(86,"=="),AP=pi(86);var pe=v("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Oy={number:"number",bigint:"bigint",object:"date"},ts=v("$ZodCheckLessThan",(e,t)=>{pe.init(e,t);let r=Oy[typeof t.value];e._zod.onattach.push(o=>{let n=o._zod.bag,i=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ns=v("$ZodCheckGreaterThan",(e,t)=>{pe.init(e,t);let r=Oy[typeof t.value];e._zod.onattach.push(o=>{let n=o._zod.bag,i=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Vu=v("$ZodCheckMultipleOf",(e,t)=>{pe.init(e,t),e._zod.onattach.push(r=>{var o;(o=r._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):iu(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),Ju=v("$ZodCheckNumberFormat",(e,t)=>{pe.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,i]=du[t.format];e._zod.onattach.push(a=>{let s=a._zod.bag;s.format=t.format,s.minimum=n,s.maximum=i,r&&(s.pattern=Bu)}),e._zod.check=a=>{let s=a.value;if(r){if(!Number.isInteger(s)){a.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}s<n&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),s>i&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),qu=v("$ZodCheckBigIntFormat",(e,t)=>{pe.init(e,t);let[r,o]=pu[t.format];e._zod.onattach.push(n=>{let i=n._zod.bag;i.format=t.format,i.minimum=r,i.maximum=o}),e._zod.check=n=>{let i=n.value;i<r&&n.issues.push({origin:"bigint",input:i,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),i>o&&n.issues.push({origin:"bigint",input:i,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),Ku=v("$ZodCheckMaxSize",(e,t)=>{var r;pe.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Tn(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let n=o.value;n.size<=t.maximum||o.issues.push({origin:ai(n),code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Xu=v("$ZodCheckMinSize",(e,t)=>{var r;pe.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Tn(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let n=o.value;n.size>=t.minimum||o.issues.push({origin:ai(n),code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Yu=v("$ZodCheckSizeEquals",(e,t)=>{var r;pe.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Tn(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=o=>{let n=o.value,i=n.size;if(i===t.size)return;let a=i>t.size;o.issues.push({origin:ai(n),...a?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Qu=v("$ZodCheckMaxLength",(e,t)=>{var r;pe.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Tn(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let n=o.value;if(n.length<=t.maximum)return;let a=si(n);o.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),ed=v("$ZodCheckMinLength",(e,t)=>{var r;pe.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Tn(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let n=o.value;if(n.length>=t.minimum)return;let a=si(n);o.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),td=v("$ZodCheckLengthEquals",(e,t)=>{var r;pe.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Tn(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=o=>{let n=o.value,i=n.length;if(i===t.length)return;let a=si(n),s=i>t.length;o.issues.push({origin:a,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Gr=v("$ZodCheckStringFormat",(e,t)=>{var r,o;pe.init(e,t),e._zod.onattach.push(n=>{let i=n._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),nd=v("$ZodCheckRegex",(e,t)=>{Gr.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),rd=v("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Gu),Gr.init(e,t)}),od=v("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Wu),Gr.init(e,t)}),id=v("$ZodCheckIncludes",(e,t)=>{pe.init(e,t);let r=mt(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=o,e._zod.onattach.push(n=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(o)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),ad=v("$ZodCheckStartsWith",(e,t)=>{pe.init(e,t);let r=new RegExp(`^${mt(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),sd=v("$ZodCheckEndsWith",(e,t)=>{pe.init(e,t);let r=new RegExp(`.*${mt(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});function Ry(e,t,r){e.issues.length&&t.issues.push(...Ke(r,e.issues))}var cd=v("$ZodCheckProperty",(e,t)=>{pe.init(e,t),e._zod.check=r=>{let o=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(o instanceof Promise)return o.then(n=>Ry(n,r,t.property));Ry(o,r,t.property)}}),ld=v("$ZodCheckMimeType",(e,t)=>{pe.init(e,t);let r=new Set(t.mime);e._zod.onattach.push(o=>{o._zod.bag.mime=t.mime}),e._zod.check=o=>{r.has(o.value.type)||o.issues.push({code:"invalid_value",values:t.mime,input:o.value.type,inst:e,continue:!t.abort})}}),ud=v("$ZodCheckOverwrite",(e,t)=>{pe.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var mi=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let o=t.split(`
|
|
175
175
|
`).filter(a=>a),n=Math.min(...o.map(a=>a.length-a.trimStart().length)),i=o.map(a=>a.slice(n)).map(a=>" ".repeat(this.indent*2)+a);for(let a of i)this.content.push(a)}compile(){let t=Function,r=this?.args,n=[...(this?.content??[""]).map(i=>` ${i}`)];return new t(...r,n.join(`
|
|
176
|
-
`))}};var ad={major:4,minor:4,patch:3};var F=v("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ad;let o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(let n of o)for(let i of n._zod.onattach)i(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let n=(a,s,l)=>{let u=Dn(a),d;for(let p of s){if(p._zod.def.when){if(cu(a)||!p._zod.def.when(a))continue}else if(u)continue;let m=a.issues.length,f=p._zod.check(a);if(f instanceof Promise&&l?.async===!1)throw new wt;if(d||f instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await f,a.issues.length!==m&&(u||(u=Dn(a,m)))});else{if(a.issues.length===m)continue;u||(u=Dn(a,m))}}return d?d.then(()=>a):a},i=(a,s,l)=>{if(Dn(a))return a.aborted=!0,a;let u=n(s,o,l);if(u instanceof Promise){if(l.async===!1)throw new wt;return u.then(d=>e._zod.parse(d,l))}return e._zod.parse(u,l)};e._zod.run=(a,s)=>{if(s.skipChecks)return e._zod.parse(a,s);if(s.direction==="backward"){let u=e._zod.parse({value:a.value,issues:[]},{...s,skipChecks:!0});return u instanceof Promise?u.then(d=>i(d,a,s)):i(u,a,s)}let l=e._zod.parse(a,s);if(l instanceof Promise){if(s.async===!1)throw new wt;return l.then(u=>n(u,o,s))}return n(l,o,s)}}V(e,"~standard",()=>({validate:n=>{try{let i=du(e,n);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return pu(e,n).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),er=v("$ZodString",(e,t)=>{F.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Du(e._zod.bag),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),se=v("$ZodStringFormat",(e,t)=>{Br.init(e,t),er.init(e,t)}),cd=v("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=xu),se.init(e,t)}),ld=v("$ZodUUID",(e,t)=>{if(t.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Qn(o))}else t.pattern??(t.pattern=Qn());se.init(e,t)}),ud=v("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=ku),se.init(e,t)}),dd=v("$ZodURL",(e,t)=>{se.init(e,t),e._zod.check=r=>{try{let o=r.value.trim();if(!t.normalize&&t.protocol?.source===Pu.source&&!/^https?:\/\//i.test(o)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}let n=new URL(o);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(n.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=n.href:r.value=o;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),pd=v("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=wu()),se.init(e,t)}),md=v("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=yu),se.init(e,t)}),fd=v("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=mu),se.init(e,t)}),gd=v("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=fu),se.init(e,t)}),hd=v("$ZodULID",(e,t)=>{t.pattern??(t.pattern=gu),se.init(e,t)}),vd=v("$ZodXID",(e,t)=>{t.pattern??(t.pattern=hu),se.init(e,t)}),yd=v("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=vu),se.init(e,t)}),bd=v("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Ou(t)),se.init(e,t)}),xd=v("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Tu),se.init(e,t)}),kd=v("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Ru(t)),se.init(e,t)}),wd=v("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=bu),se.init(e,t)}),Sd=v("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Su),se.init(e,t),e._zod.bag.format="ipv4"}),_d=v("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=_u),se.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),$d=v("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=$u(t.delimiter)),se.init(e,t),e._zod.bag.format="mac"}),Id=v("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Iu),se.init(e,t)}),Ad=v("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Au),se.init(e,t),e._zod.check=r=>{let o=r.value.split("/");try{if(o.length!==2)throw new Error;let[n,i]=o;if(!i)throw new Error;let a=Number(i);if(`${a}`!==i)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function Ed(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var Pd=v("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Eu),se.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{Ed(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function By(e){if(!Va.test(e))return!1;let t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Ed(r)}var Cd=v("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Va),se.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{By(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Td=v("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Cu),se.init(e,t)});function Hy(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[o]=r;if(!o)return!1;let n=JSON.parse(atob(o));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||t&&(!("alg"in n)||n.alg!==t))}catch{return!1}}var Rd=v("$ZodJWT",(e,t)=>{se.init(e,t),e._zod.check=r=>{Hy(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),Od=v("$ZodCustomStringFormat",(e,t)=>{se.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}}),ts=v("$ZodNumber",(e,t)=>{F.init(e,t),e._zod.pattern=e._zod.bag.pattern??Ja,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let n=r.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let i=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...i?{received:i}:{}}),r}}),Dd=v("$ZodNumberFormat",(e,t)=>{Hu.init(e,t),ts.init(e,t)}),ui=v("$ZodBoolean",(e,t)=>{F.init(e,t),e._zod.pattern=Uu,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=!!r.value}catch{}let n=r.value;return typeof n=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}}),ns=v("$ZodBigInt",(e,t)=>{F.init(e,t),e._zod.pattern=Nu,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),Nd=v("$ZodBigIntFormat",(e,t)=>{Zu.init(e,t),ns.init(e,t)}),Ld=v("$ZodSymbol",(e,t)=>{F.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return typeof n=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:e}),r}}),Ud=v("$ZodUndefined",(e,t)=>{F.init(e,t),e._zod.pattern=ju,e._zod.values=new Set([void 0]),e._zod.parse=(r,o)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:e}),r}}),zd=v("$ZodNull",(e,t)=>{F.init(e,t),e._zod.pattern=zu,e._zod.values=new Set([null]),e._zod.parse=(r,o)=>{let n=r.value;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),r}}),jd=v("$ZodAny",(e,t)=>{F.init(e,t),e._zod.parse=r=>r}),Fd=v("$ZodUnknown",(e,t)=>{F.init(e,t),e._zod.parse=r=>r}),Md=v("$ZodNever",(e,t)=>{F.init(e,t),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),Bd=v("$ZodVoid",(e,t)=>{F.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"void",code:"invalid_type",input:n,inst:e}),r}}),Hd=v("$ZodDate",(e,t)=>{F.init(e,t),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let n=r.value,i=n instanceof Date;return i&&!Number.isNaN(n.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:n,...i?{received:"Invalid Date"}:{},inst:e}),r}});function Ey(e,t,r){e.issues.length&&t.issues.push(...qe(r,e.issues)),t.value[r]=e.value}var Zd=v("$ZodArray",(e,t)=>{F.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),r;r.value=Array(n.length);let i=[];for(let a=0;a<n.length;a++){let s=n[a],l=t.element._zod.run({value:s,issues:[]},o);l instanceof Promise?i.push(l.then(u=>Ey(u,r,a))):Ey(l,r,a)}return i.length?Promise.all(i).then(()=>r):r}});function es(e,t,r,o,n,i){let a=r in o;if(e.issues.length){if(n&&i&&!a)return;t.issues.push(...qe(r,e.issues))}if(!a&&!n){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?a&&(t.value[r]=void 0):t.value[r]=e.value}function Zy(e){let t=Object.keys(e.shape);for(let o of t)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);let r=iu(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function Gy(e,t,r,o,n,i){let a=[],s=n.keySet,l=n.catchall._zod,u=l.def.type,d=l.optin==="optional",p=l.optout==="optional";for(let m in t){if(m==="__proto__"||s.has(m))continue;if(u==="never"){a.push(m);continue}let f=l.run({value:t[m],issues:[]},o);f instanceof Promise?e.push(f.then(g=>es(g,r,m,t,d,p))):es(f,r,m,t,d,p)}return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:i}),e.length?Promise.all(e).then(()=>r):r}var Wy=v("$ZodObject",(e,t)=>{if(F.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let s=t.shape;Object.defineProperty(t,"shape",{get:()=>{let l={...s};return Object.defineProperty(t,"shape",{value:l}),l}})}let o=Lr(()=>Zy(t));V(e._zod,"propValues",()=>{let s=t.shape,l={};for(let u in s){let d=s[u]._zod;if(d.values){l[u]??(l[u]=new Set);for(let p of d.values)l[u].add(p)}}return l});let n=Yn,i=t.catchall,a;e._zod.parse=(s,l)=>{a??(a=o.value);let u=s.value;if(!n(u))return s.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),s;s.value={};let d=[],p=a.shape;for(let m of a.keys){let f=p[m],g=f._zod.optin==="optional",y=f._zod.optout==="optional",k=f._zod.run({value:u[m],issues:[]},l);k instanceof Promise?d.push(k.then(_=>es(_,s,m,u,g,y))):es(k,s,m,u,g,y)}return i?Gy(d,u,s,l,o.value,e):d.length?Promise.all(d).then(()=>s):s}}),Gd=v("$ZodObjectJIT",(e,t)=>{Wy.init(e,t);let r=e._zod.parse,o=Lr(()=>Zy(t)),n=m=>{let f=new li(["shape","payload","ctx"]),g=o.value,y=C=>{let E=Na(C);return`shape[${E}]._zod.run({ value: input[${E}], issues: [] }, ctx)`};f.write("const input = payload.value;");let k=Object.create(null),_=0;for(let C of g.keys)k[C]=`key_${_++}`;f.write("const newResult = {};");for(let C of g.keys){let E=k[C],D=Na(C),G=m[C],ae=G?._zod?.optin==="optional",X=G?._zod?.optout==="optional";f.write(`const ${E} = ${y(C)};`),ae&&X?f.write(`
|
|
176
|
+
`))}};var dd={major:4,minor:4,patch:3};var F=v("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=dd;let o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(let n of o)for(let i of n._zod.onattach)i(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let n=(a,s,l)=>{let u=Dn(a),d;for(let p of s){if(p._zod.def.when){if(mu(a)||!p._zod.def.when(a))continue}else if(u)continue;let m=a.issues.length,f=p._zod.check(a);if(f instanceof Promise&&l?.async===!1)throw new wt;if(d||f instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await f,a.issues.length!==m&&(u||(u=Dn(a,m)))});else{if(a.issues.length===m)continue;u||(u=Dn(a,m))}}return d?d.then(()=>a):a},i=(a,s,l)=>{if(Dn(a))return a.aborted=!0,a;let u=n(s,o,l);if(u instanceof Promise){if(l.async===!1)throw new wt;return u.then(d=>e._zod.parse(d,l))}return e._zod.parse(u,l)};e._zod.run=(a,s)=>{if(s.skipChecks)return e._zod.parse(a,s);if(s.direction==="backward"){let u=e._zod.parse({value:a.value,issues:[]},{...s,skipChecks:!0});return u instanceof Promise?u.then(d=>i(d,a,s)):i(u,a,s)}let l=e._zod.parse(a,s);if(l instanceof Promise){if(s.async===!1)throw new wt;return l.then(u=>n(u,o,s))}return n(l,o,s)}}V(e,"~standard",()=>({validate:n=>{try{let i=hu(e,n);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return vu(e,n).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),nr=v("$ZodString",(e,t)=>{F.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??ju(e._zod.bag),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),le=v("$ZodStringFormat",(e,t)=>{Gr.init(e,t),nr.init(e,t)}),md=v("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=$u),le.init(e,t)}),fd=v("$ZodUUID",(e,t)=>{if(t.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=tr(o))}else t.pattern??(t.pattern=tr());le.init(e,t)}),gd=v("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Iu),le.init(e,t)}),hd=v("$ZodURL",(e,t)=>{le.init(e,t),e._zod.check=r=>{try{let o=r.value.trim();if(!t.normalize&&t.protocol?.source===Du.source&&!/^https?:\/\//i.test(o)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}let n=new URL(o);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(n.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=n.href:r.value=o;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),vd=v("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Au()),le.init(e,t)}),yd=v("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Su),le.init(e,t)}),bd=v("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=yu),le.init(e,t)}),xd=v("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=bu),le.init(e,t)}),kd=v("$ZodULID",(e,t)=>{t.pattern??(t.pattern=xu),le.init(e,t)}),wd=v("$ZodXID",(e,t)=>{t.pattern??(t.pattern=ku),le.init(e,t)}),Sd=v("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=wu),le.init(e,t)}),_d=v("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=zu(t)),le.init(e,t)}),$d=v("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Lu),le.init(e,t)}),Id=v("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Uu(t)),le.init(e,t)}),Ad=v("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=_u),le.init(e,t)}),Ed=v("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Eu),le.init(e,t),e._zod.bag.format="ipv4"}),Pd=v("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Pu),le.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),Cd=v("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=Cu(t.delimiter)),le.init(e,t),e._zod.bag.format="mac"}),Td=v("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Tu),le.init(e,t)}),Rd=v("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Ru),le.init(e,t),e._zod.check=r=>{let o=r.value.split("/");try{if(o.length!==2)throw new Error;let[n,i]=o;if(!i)throw new Error;let a=Number(i);if(`${a}`!==i)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function Od(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var Dd=v("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Ou),le.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{Od(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function qy(e){if(!Qa.test(e))return!1;let t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Od(r)}var Nd=v("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Qa),le.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{qy(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Ld=v("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Nu),le.init(e,t)});function Ky(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[o]=r;if(!o)return!1;let n=JSON.parse(atob(o));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||t&&(!("alg"in n)||n.alg!==t))}catch{return!1}}var Ud=v("$ZodJWT",(e,t)=>{le.init(e,t),e._zod.check=r=>{Ky(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),zd=v("$ZodCustomStringFormat",(e,t)=>{le.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}}),ss=v("$ZodNumber",(e,t)=>{F.init(e,t),e._zod.pattern=e._zod.bag.pattern??es,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let n=r.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let i=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...i?{received:i}:{}}),r}}),jd=v("$ZodNumberFormat",(e,t)=>{Ju.init(e,t),ss.init(e,t)}),fi=v("$ZodBoolean",(e,t)=>{F.init(e,t),e._zod.pattern=Mu,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=!!r.value}catch{}let n=r.value;return typeof n=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}}),cs=v("$ZodBigInt",(e,t)=>{F.init(e,t),e._zod.pattern=Fu,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),Fd=v("$ZodBigIntFormat",(e,t)=>{qu.init(e,t),cs.init(e,t)}),Bd=v("$ZodSymbol",(e,t)=>{F.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return typeof n=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:e}),r}}),Md=v("$ZodUndefined",(e,t)=>{F.init(e,t),e._zod.pattern=Zu,e._zod.values=new Set([void 0]),e._zod.parse=(r,o)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:e}),r}}),Hd=v("$ZodNull",(e,t)=>{F.init(e,t),e._zod.pattern=Hu,e._zod.values=new Set([null]),e._zod.parse=(r,o)=>{let n=r.value;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),r}}),Zd=v("$ZodAny",(e,t)=>{F.init(e,t),e._zod.parse=r=>r}),Gd=v("$ZodUnknown",(e,t)=>{F.init(e,t),e._zod.parse=r=>r}),Wd=v("$ZodNever",(e,t)=>{F.init(e,t),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),Vd=v("$ZodVoid",(e,t)=>{F.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"void",code:"invalid_type",input:n,inst:e}),r}}),Jd=v("$ZodDate",(e,t)=>{F.init(e,t),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let n=r.value,i=n instanceof Date;return i&&!Number.isNaN(n.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:n,...i?{received:"Invalid Date"}:{},inst:e}),r}});function Ny(e,t,r){e.issues.length&&t.issues.push(...Ke(r,e.issues)),t.value[r]=e.value}var qd=v("$ZodArray",(e,t)=>{F.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),r;r.value=Array(n.length);let i=[];for(let a=0;a<n.length;a++){let s=n[a],l=t.element._zod.run({value:s,issues:[]},o);l instanceof Promise?i.push(l.then(u=>Ny(u,r,a))):Ny(l,r,a)}return i.length?Promise.all(i).then(()=>r):r}});function as(e,t,r,o,n,i){let a=r in o;if(e.issues.length){if(n&&i&&!a)return;t.issues.push(...Ke(r,e.issues))}if(!a&&!n){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?a&&(t.value[r]=void 0):t.value[r]=e.value}function Xy(e){let t=Object.keys(e.shape);for(let o of t)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);let r=uu(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function Yy(e,t,r,o,n,i){let a=[],s=n.keySet,l=n.catchall._zod,u=l.def.type,d=l.optin==="optional",p=l.optout==="optional";for(let m in t){if(m==="__proto__"||s.has(m))continue;if(u==="never"){a.push(m);continue}let f=l.run({value:t[m],issues:[]},o);f instanceof Promise?e.push(f.then(g=>as(g,r,m,t,d,p))):as(f,r,m,t,d,p)}return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:i}),e.length?Promise.all(e).then(()=>r):r}var Qy=v("$ZodObject",(e,t)=>{if(F.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let s=t.shape;Object.defineProperty(t,"shape",{get:()=>{let l={...s};return Object.defineProperty(t,"shape",{value:l}),l}})}let o=jr(()=>Xy(t));V(e._zod,"propValues",()=>{let s=t.shape,l={};for(let u in s){let d=s[u]._zod;if(d.values){l[u]??(l[u]=new Set);for(let p of d.values)l[u].add(p)}}return l});let n=er,i=t.catchall,a;e._zod.parse=(s,l)=>{a??(a=o.value);let u=s.value;if(!n(u))return s.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),s;s.value={};let d=[],p=a.shape;for(let m of a.keys){let f=p[m],g=f._zod.optin==="optional",y=f._zod.optout==="optional",k=f._zod.run({value:u[m],issues:[]},l);k instanceof Promise?d.push(k.then(_=>as(_,s,m,u,g,y))):as(k,s,m,u,g,y)}return i?Yy(d,u,s,l,o.value,e):d.length?Promise.all(d).then(()=>s):s}}),Kd=v("$ZodObjectJIT",(e,t)=>{Qy.init(e,t);let r=e._zod.parse,o=jr(()=>Xy(t)),n=m=>{let f=new mi(["shape","payload","ctx"]),g=o.value,y=C=>{let E=Ba(C);return`shape[${E}]._zod.run({ value: input[${E}], issues: [] }, ctx)`};f.write("const input = payload.value;");let k=Object.create(null),_=0;for(let C of g.keys)k[C]=`key_${_++}`;f.write("const newResult = {};");for(let C of g.keys){let E=k[C],D=Ba(C),W=m[C],ce=W?._zod?.optin==="optional",Y=W?._zod?.optout==="optional";f.write(`const ${E} = ${y(C)};`),ce&&Y?f.write(`
|
|
177
177
|
if (${E}.issues.length) {
|
|
178
178
|
if (${D} in input) {
|
|
179
179
|
payload.issues = payload.issues.concat(${E}.issues.map(iss => ({
|
|
@@ -191,7 +191,7 @@ ${r?AA(r):""}
|
|
|
191
191
|
newResult[${D}] = ${E}.value;
|
|
192
192
|
}
|
|
193
193
|
|
|
194
|
-
`):
|
|
194
|
+
`):ce?f.write(`
|
|
195
195
|
if (${E}.issues.length) {
|
|
196
196
|
payload.issues = payload.issues.concat(${E}.issues.map(iss => ({
|
|
197
197
|
...iss,
|
|
@@ -232,15 +232,15 @@ ${r?AA(r):""}
|
|
|
232
232
|
}
|
|
233
233
|
}
|
|
234
234
|
|
|
235
|
-
`)}f.write("payload.value = newResult;"),f.write("return payload;");let P=f.compile();return(C,E)=>P(m,C,E)},i,a=Yn,s=!Xn.jitless,u=s&&nu.value,d=t.catchall,p;e._zod.parse=(m,f)=>{p??(p=o.value);let g=m.value;return a(g)?s&&u&&f?.async===!1&&f.jitless!==!0?(i||(i=n(t.shape)),m=i(m,f),d?Gy([],g,m,f,p,e):m):r(m,f):(m.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),m)}});function Py(e,t,r,o){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let n=e.filter(i=>!Dn(i));return n.length===1?(t.value=n[0].value,n[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(a=>je(a,o,ve())))}),t)}var di=v("$ZodUnion",(e,t)=>{F.init(e,t),V(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),V(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),V(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),V(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){let o=t.options.map(n=>n._zod.pattern);return new RegExp(`^(${o.map(n=>ei(n.source)).join("|")})$`)}});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,n)=>{if(r)return r(o,n);let i=!1,a=[];for(let s of t.options){let l=s._zod.run({value:o.value,issues:[]},n);if(l instanceof Promise)a.push(l),i=!0;else{if(l.issues.length===0)return l;a.push(l)}}return i?Promise.all(a).then(s=>Py(s,o,e,n)):Py(a,o,e,n)}});function Cy(e,t,r,o){let n=e.filter(i=>i.issues.length===0);return n.length===1?(t.value=n[0].value,t):(n.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(a=>je(a,o,ve())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1}),t)}var Wd=v("$ZodXor",(e,t)=>{di.init(e,t),t.inclusive=!1;let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,n)=>{if(r)return r(o,n);let i=!1,a=[];for(let s of t.options){let l=s._zod.run({value:o.value,issues:[]},n);l instanceof Promise?(a.push(l),i=!0):a.push(l)}return i?Promise.all(a).then(s=>Cy(s,o,e,n)):Cy(a,o,e,n)}}),Vd=v("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,di.init(e,t);let r=e._zod.parse;V(e._zod,"propValues",()=>{let n={};for(let i of t.options){let a=i._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let[s,l]of Object.entries(a)){n[s]||(n[s]=new Set);for(let u of l)n[s].add(u)}}return n});let o=Lr(()=>{let n=t.options,i=new Map;for(let a of n){let s=a._zod.propValues?.[t.discriminator];if(!s||s.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(let l of s){if(i.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);i.set(l,a)}}return i});e._zod.parse=(n,i)=>{let a=n.value;if(!Yn(a))return n.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),n;let s=o.value.get(a?.[t.discriminator]);return s?s._zod.run(n,i):t.unionFallback||i.direction==="backward"?r(n,i):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(o.value.keys()),input:a,path:[t.discriminator],inst:e}),n)}}),Jd=v("$ZodIntersection",(e,t)=>{F.init(e,t),e._zod.parse=(r,o)=>{let n=r.value,i=t.left._zod.run({value:n,issues:[]},o),a=t.right._zod.run({value:n,issues:[]},o);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([l,u])=>Ty(r,l,u)):Ty(r,i,a)}});function sd(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(On(e)&&On(t)){let r=Object.keys(t),o=Object.keys(e).filter(i=>r.indexOf(i)!==-1),n={...e,...t};for(let i of o){let a=sd(e[i],t[i]);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};n[i]=a.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let o=0;o<e.length;o++){let n=e[o],i=t[o],a=sd(n,i);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Ty(e,t,r){let o=new Map,n;for(let s of t.issues)if(s.code==="unrecognized_keys"){n??(n=s);for(let l of s.keys)o.has(l)||o.set(l,{}),o.get(l).l=!0}else e.issues.push(s);for(let s of r.issues)if(s.code==="unrecognized_keys")for(let l of s.keys)o.has(l)||o.set(l,{}),o.get(l).r=!0;else e.issues.push(s);let i=[...o].filter(([,s])=>s.l&&s.r).map(([s])=>s);if(i.length&&n&&e.issues.push({...n,keys:i}),Dn(e))return e;let a=sd(t.value,r.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}var rs=v("$ZodTuple",(e,t)=>{F.init(e,t);let r=t.items;e._zod.parse=(o,n)=>{let i=o.value;if(!Array.isArray(i))return o.issues.push({input:i,inst:e,expected:"tuple",code:"invalid_type"}),o;o.value=[];let a=[],s=Ry(r,"optin"),l=Ry(r,"optout");if(!t.rest){if(i.length<s)return o.issues.push({code:"too_small",minimum:s,inclusive:!0,input:i,inst:e,origin:"array"}),o;i.length>r.length&&o.issues.push({code:"too_big",maximum:r.length,inclusive:!0,input:i,inst:e,origin:"array"})}let u=new Array(r.length);for(let d=0;d<r.length;d++){let p=r[d]._zod.run({value:i[d],issues:[]},n);p instanceof Promise?a.push(p.then(m=>{u[d]=m})):u[d]=p}if(t.rest){let d=r.length-1,p=i.slice(r.length);for(let m of p){d++;let f=t.rest._zod.run({value:m,issues:[]},n);f instanceof Promise?a.push(f.then(g=>Oy(g,o,d))):Oy(f,o,d)}}return a.length?Promise.all(a).then(()=>Dy(u,o,r,i,l)):Dy(u,o,r,i,l)}});function Ry(e,t){for(let r=e.length-1;r>=0;r--)if(e[r]._zod[t]!=="optional")return r+1;return 0}function Oy(e,t,r){e.issues.length&&t.issues.push(...qe(r,e.issues)),t.value[r]=e.value}function Dy(e,t,r,o,n){for(let i=0;i<r.length;i++){let a=e[i],s=i<o.length;if(a.issues.length){if(!s&&i>=n){t.value.length=i;break}t.issues.push(...qe(i,a.issues))}t.value[i]=a.value}for(let i=t.value.length-1;i>=o.length&&(r[i]._zod.optout==="optional"&&t.value[i]===void 0);i--)t.value.length=i;return t}var qd=v("$ZodRecord",(e,t)=>{F.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!On(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:e}),r;let i=[],a=t.keyType._zod.values;if(a){r.value={};let s=new Set;for(let u of a)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){s.add(typeof u=="number"?u.toString():u);let d=t.keyType._zod.run({value:u,issues:[]},o);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(d.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(f=>je(f,o,ve())),input:u,path:[u],inst:e});continue}let p=d.value,m=t.valueType._zod.run({value:n[u],issues:[]},o);m instanceof Promise?i.push(m.then(f=>{f.issues.length&&r.issues.push(...qe(u,f.issues)),r.value[p]=f.value})):(m.issues.length&&r.issues.push(...qe(u,m.issues)),r.value[p]=m.value)}let l;for(let u in n)s.has(u)||(l=l??[],l.push(u));l&&l.length>0&&r.issues.push({code:"unrecognized_keys",input:n,inst:e,keys:l})}else{r.value={};for(let s of Reflect.ownKeys(n)){if(s==="__proto__"||!Object.prototype.propertyIsEnumerable.call(n,s))continue;let l=t.keyType._zod.run({value:s,issues:[]},o);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof s=="string"&&Ja.test(s)&&l.issues.length){let p=t.keyType._zod.run({value:Number(s),issues:[]},o);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");p.issues.length===0&&(l=p)}if(l.issues.length){t.mode==="loose"?r.value[s]=n[s]:r.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(p=>je(p,o,ve())),input:s,path:[s],inst:e});continue}let d=t.valueType._zod.run({value:n[s],issues:[]},o);d instanceof Promise?i.push(d.then(p=>{p.issues.length&&r.issues.push(...qe(s,p.issues)),r.value[l.value]=p.value})):(d.issues.length&&r.issues.push(...qe(s,d.issues)),r.value[l.value]=d.value)}}return i.length?Promise.all(i).then(()=>r):r}}),Kd=v("$ZodMap",(e,t)=>{F.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!(n instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:n,inst:e}),r;let i=[];r.value=new Map;for(let[a,s]of n){let l=t.keyType._zod.run({value:a,issues:[]},o),u=t.valueType._zod.run({value:s,issues:[]},o);l instanceof Promise||u instanceof Promise?i.push(Promise.all([l,u]).then(([d,p])=>{Ny(d,p,r,a,n,e,o)})):Ny(l,u,r,a,n,e,o)}return i.length?Promise.all(i).then(()=>r):r}});function Ny(e,t,r,o,n,i,a){e.issues.length&&(ti.has(typeof o)?r.issues.push(...qe(o,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:n,inst:i,issues:e.issues.map(s=>je(s,a,ve()))})),t.issues.length&&(ti.has(typeof o)?r.issues.push(...qe(o,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:n,inst:i,key:o,issues:t.issues.map(s=>je(s,a,ve()))})),r.value.set(e.value,t.value)}var Xd=v("$ZodSet",(e,t)=>{F.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!(n instanceof Set))return r.issues.push({input:n,inst:e,expected:"set",code:"invalid_type"}),r;let i=[];r.value=new Set;for(let a of n){let s=t.valueType._zod.run({value:a,issues:[]},o);s instanceof Promise?i.push(s.then(l=>Ly(l,r))):Ly(s,r)}return i.length?Promise.all(i).then(()=>r):r}});function Ly(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}var Yd=v("$ZodEnum",(e,t)=>{F.init(e,t);let r=Qo(t.entries),o=new Set(r);e._zod.values=o,e._zod.pattern=new RegExp(`^(${r.filter(n=>ti.has(typeof n)).map(n=>typeof n=="string"?mt(n):n.toString()).join("|")})$`),e._zod.parse=(n,i)=>{let a=n.value;return o.has(a)||n.issues.push({code:"invalid_value",values:r,input:a,inst:e}),n}}),Qd=v("$ZodLiteral",(e,t)=>{if(F.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(o=>typeof o=="string"?mt(o):o?mt(o.toString()):String(o)).join("|")})$`),e._zod.parse=(o,n)=>{let i=o.value;return r.has(i)||o.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),o}}),ep=v("$ZodFile",(e,t)=>{F.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return n instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:n,inst:e}),r}}),tp=v("$ZodTransform",(e,t)=>{F.init(e,t),e._zod.optin="optional",e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Cn(e.constructor.name);let n=t.transform(r.value,r);if(o.async)return(n instanceof Promise?n:Promise.resolve(n)).then(a=>(r.value=a,r.fallback=!0,r));if(n instanceof Promise)throw new wt;return r.value=n,r.fallback=!0,r}});function Uy(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var os=v("$ZodOptional",(e,t)=>{F.init(e,t),e._zod.optin="optional",e._zod.optout="optional",V(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),V(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${ei(r.source)})?$`):void 0}),e._zod.parse=(r,o)=>{if(t.innerType._zod.optin==="optional"){let n=r.value,i=t.innerType._zod.run(r,o);return i instanceof Promise?i.then(a=>Uy(a,n)):Uy(i,n)}return r.value===void 0?r:t.innerType._zod.run(r,o)}}),np=v("$ZodExactOptional",(e,t)=>{os.init(e,t),V(e._zod,"values",()=>t.innerType._zod.values),V(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,o)=>t.innerType._zod.run(r,o)}),rp=v("$ZodNullable",(e,t)=>{F.init(e,t),V(e._zod,"optin",()=>t.innerType._zod.optin),V(e._zod,"optout",()=>t.innerType._zod.optout),V(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${ei(r.source)}|null)$`):void 0}),V(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,o)=>r.value===null?r:t.innerType._zod.run(r,o)}),op=v("$ZodDefault",(e,t)=>{F.init(e,t),e._zod.optin="optional",V(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);if(r.value===void 0)return r.value=t.defaultValue,r;let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>zy(i,t)):zy(n,t)}});function zy(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var ip=v("$ZodPrefault",(e,t)=>{F.init(e,t),e._zod.optin="optional",V(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>(o.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,o))}),ap=v("$ZodNonOptional",(e,t)=>{F.init(e,t),V(e._zod,"values",()=>{let r=t.innerType._zod.values;return r?new Set([...r].filter(o=>o!==void 0)):void 0}),e._zod.parse=(r,o)=>{let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>jy(i,e)):jy(n,e)}});function jy(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}var sp=v("$ZodSuccess",(e,t)=>{F.init(e,t),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Cn("ZodSuccess");let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>(r.value=i.issues.length===0,r)):(r.value=n.issues.length===0,r)}}),cp=v("$ZodCatch",(e,t)=>{F.init(e,t),e._zod.optin="optional",V(e._zod,"optout",()=>t.innerType._zod.optout),V(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>(r.value=i.value,i.issues.length&&(r.value=t.catchValue({...r,error:{issues:i.issues.map(a=>je(a,o,ve()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=n.value,n.issues.length&&(r.value=t.catchValue({...r,error:{issues:n.issues.map(i=>je(i,o,ve()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),lp=v("$ZodNaN",(e,t)=>{F.init(e,t),e._zod.parse=(r,o)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r)}),is=v("$ZodPipe",(e,t)=>{F.init(e,t),V(e._zod,"values",()=>t.in._zod.values),V(e._zod,"optin",()=>t.in._zod.optin),V(e._zod,"optout",()=>t.out._zod.optout),V(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,o)=>{if(o.direction==="backward"){let i=t.out._zod.run(r,o);return i instanceof Promise?i.then(a=>Xa(a,t.in,o)):Xa(i,t.in,o)}let n=t.in._zod.run(r,o);return n instanceof Promise?n.then(i=>Xa(i,t.out,o)):Xa(n,t.out,o)}});function Xa(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}var pi=v("$ZodCodec",(e,t)=>{F.init(e,t),V(e._zod,"values",()=>t.in._zod.values),V(e._zod,"optin",()=>t.in._zod.optin),V(e._zod,"optout",()=>t.out._zod.optout),V(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,o)=>{if((o.direction||"forward")==="forward"){let i=t.in._zod.run(r,o);return i instanceof Promise?i.then(a=>Ya(a,t,o)):Ya(i,t,o)}else{let i=t.out._zod.run(r,o);return i instanceof Promise?i.then(a=>Ya(a,t,o)):Ya(i,t,o)}}});function Ya(e,t,r){if(e.issues.length)return e.aborted=!0,e;if((r.direction||"forward")==="forward"){let n=t.transform(e.value,e);return n instanceof Promise?n.then(i=>Qa(e,i,t.out,r)):Qa(e,n,t.out,r)}else{let n=t.reverseTransform(e.value,e);return n instanceof Promise?n.then(i=>Qa(e,i,t.in,r)):Qa(e,n,t.in,r)}}function Qa(e,t,r,o){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:t,issues:e.issues},o)}var up=v("$ZodPreprocess",(e,t)=>{is.init(e,t)}),dp=v("$ZodReadonly",(e,t)=>{F.init(e,t),V(e._zod,"propValues",()=>t.innerType._zod.propValues),V(e._zod,"values",()=>t.innerType._zod.values),V(e._zod,"optin",()=>t.innerType?._zod?.optin),V(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(Fy):Fy(n)}});function Fy(e){return e.value=Object.freeze(e.value),e}var pp=v("$ZodTemplateLiteral",(e,t)=>{F.init(e,t);let r=[];for(let o of t.parts)if(typeof o=="object"&&o!==null){if(!o._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...o._zod.traits].shift()}`);let n=o._zod.pattern instanceof RegExp?o._zod.pattern.source:o._zod.pattern;if(!n)throw new Error(`Invalid template literal part: ${o._zod.traits}`);let i=n.startsWith("^")?1:0,a=n.endsWith("$")?n.length-1:n.length;r.push(n.slice(i,a))}else if(o===null||ou.has(typeof o))r.push(mt(`${o}`));else throw new Error(`Invalid template literal part: ${o}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(o,n)=>typeof o.value!="string"?(o.issues.push({input:o.value,inst:e,expected:"string",code:"invalid_type"}),o):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(o.value)||o.issues.push({input:o.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),o)}),mp=v("$ZodFunction",(e,t)=>(F.init(e,t),e._def=t,e._zod.def=t,e.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...o){let n=e._def.input?Ua(e._def.input,o):o,i=Reflect.apply(r,this,n);return e._def.output?Ua(e._def.output,i):i}},e.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...o){let n=e._def.input?await za(e._def.input,o):o,i=await Reflect.apply(r,this,n);return e._def.output?await za(e._def.output,i):i}},e._zod.parse=(r,o)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:e}),r):(e._def.output&&e._def.output._zod.def.type==="promise"?r.value=e.implementAsync(r.value):r.value=e.implement(r.value),r),e.input=(...r)=>{let o=e.constructor;return Array.isArray(r[0])?new o({type:"function",input:new rs({type:"tuple",items:r[0],rest:r[1]}),output:e._def.output}):new o({type:"function",input:r[0],output:e._def.output})},e.output=r=>{let o=e.constructor;return new o({type:"function",input:e._def.input,output:r})},e)),fp=v("$ZodPromise",(e,t)=>{F.init(e,t),e._zod.parse=(r,o)=>Promise.resolve(r.value).then(n=>t.innerType._zod.run({value:n,issues:[]},o))}),gp=v("$ZodLazy",(e,t)=>{F.init(e,t),V(e._zod,"innerType",()=>{let r=t;return r._cachedInner||(r._cachedInner=t.getter()),r._cachedInner}),V(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),V(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),V(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),V(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(r,o)=>e._zod.innerType._zod.run(r,o)}),hp=v("$ZodCustom",(e,t)=>{de.init(e,t),F.init(e,t),e._zod.parse=(r,o)=>r,e._zod.check=r=>{let o=r.value,n=t.fn(o);if(n instanceof Promise)return n.then(i=>My(i,r,o,e));My(n,r,o,e)}});function My(e,t,r,o){if(!e){let n={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(n.params=o._zod.def.params),t.issues.push(Ur(n))}}var fi={};Jt(fi,{ar:()=>Vy,az:()=>Jy,be:()=>Ky,bg:()=>Xy,ca:()=>Yy,cs:()=>Qy,da:()=>eb,de:()=>tb,el:()=>nb,en:()=>as,eo:()=>rb,es:()=>ob,fa:()=>ib,fi:()=>ab,fr:()=>sb,frCA:()=>cb,he:()=>lb,hr:()=>ub,hu:()=>db,hy:()=>mb,id:()=>fb,is:()=>gb,it:()=>hb,ja:()=>vb,ka:()=>yb,kh:()=>bb,km:()=>ss,ko:()=>xb,lt:()=>wb,mk:()=>Sb,ms:()=>_b,nl:()=>$b,no:()=>Ib,ota:()=>Ab,pl:()=>Pb,ps:()=>Eb,pt:()=>Cb,ro:()=>Tb,ru:()=>Ob,sl:()=>Db,sv:()=>Nb,ta:()=>Lb,th:()=>Ub,tr:()=>zb,ua:()=>jb,uk:()=>cs,ur:()=>Fb,uz:()=>Mb,vi:()=>Bb,yo:()=>Gb,zhCN:()=>Hb,zhTW:()=>Zb});var xP=()=>{let e={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function t(n){return e[n]??null}let r={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${n.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${s}`:`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${i}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${s}`}case"invalid_value":return n.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${w(n.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${n.minimum.toString()} ${a.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${n.prefix}"`:i.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${i.suffix}"`:i.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${i.includes}"`:i.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${i.pattern}`:`${r[i.format]??n.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${n.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${n.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${n.keys.length>1?"\u0629":""}: ${x(n.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}};function Vy(){return{localeError:xP()}}var kP=()=>{let e={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function t(n){return e[n]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${n.expected}, daxil olan ${s}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${i}, daxil olan ${s}`}case"invalid_value":return n.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${w(n.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${i}${n.maximum.toString()} ${a.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${i}${n.minimum.toString()} ${a.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${i.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:i.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${i.suffix}" il\u0259 bitm\u0259lidir`:i.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${i.includes}" daxil olmal\u0131d\u0131r`:i.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${i.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${r[i.format]??n.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${n.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${n.keys.length>1?"lar":""}: ${x(n.keys,", ")}`;case"invalid_key":return`${n.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${n.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}};function Jy(){return{localeError:kP()}}function qy(e,t,r,o){let n=Math.abs(e),i=n%10,a=n%100;return a>=11&&a<=19?o:i===1?t:i>=2&&i<=4?r:o}var wP=()=>{let e={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function t(n){return e[n]??null}let r={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},o={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${n.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${s}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${i}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${s}`}case"invalid_value":return n.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${w(n.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);if(a){let s=Number(n.maximum),l=qy(s,a.unit.one,a.unit.few,a.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${i}${n.maximum.toString()} ${l}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);if(a){let s=Number(n.minimum),l=qy(s,a.unit.one,a.unit.few,a.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${i}${n.minimum.toString()} ${l}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${n.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${x(n.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${n.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}};function Ky(){return{localeError:wP()}}var SP=()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function t(n){return e[n]??null}let r={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${s}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${i}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${s}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${w(n.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${n.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${n.minimum.toString()} ${a.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${i.prefix}"`;if(i.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${i.suffix}"`;if(i.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${i.includes}"`;if(i.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${i.pattern}`;let a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return i.format==="emoji"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="datetime"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="date"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),i.format==="time"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="duration"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${a} ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${n.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u043E\u0432\u0435":""}: ${x(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${n.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}};function Xy(){return{localeError:SP()}}var _P=()=>{let e={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(n){return e[n]??null}let r={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${n.expected}, s'ha rebut ${s}`:`Tipus inv\xE0lid: s'esperava ${i}, s'ha rebut ${s}`}case"invalid_value":return n.values.length===1?`Valor inv\xE0lid: s'esperava ${w(n.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${x(n.values," o ")}`;case"too_big":{let i=n.inclusive?"com a m\xE0xim":"menys de",a=t(n.origin);return a?`Massa gran: s'esperava que ${n.origin??"el valor"} contingu\xE9s ${i} ${n.maximum.toString()} ${a.unit??"elements"}`:`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"com a m\xEDnim":"m\xE9s de",a=t(n.origin);return a?`Massa petit: s'esperava que ${n.origin} contingu\xE9s ${i} ${n.minimum.toString()} ${a.unit}`:`Massa petit: s'esperava que ${n.origin} fos ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${i.prefix}"`:i.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${i.suffix}"`:i.format==="includes"?`Format inv\xE0lid: ha d'incloure "${i.includes}"`:i.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${i.pattern}`:`Format inv\xE0lid per a ${r[i.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${n.divisor}`;case"unrecognized_keys":return`Clau${n.keys.length>1?"s":""} no reconeguda${n.keys.length>1?"s":""}: ${x(n.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${n.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${n.origin}`;default:return"Entrada inv\xE0lida"}}};function Yy(){return{localeError:_P()}}var $P=()=>{let e={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function t(n){return e[n]??null}let r={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"},o={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${n.expected}, obdr\u017Eeno ${s}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${i}, obdr\u017Eeno ${s}`}case"invalid_value":return n.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${w(n.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${i}${n.maximum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${i}${n.minimum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${i.prefix}"`:i.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${i.suffix}"`:i.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${i.includes}"`:i.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${i.pattern}`:`Neplatn\xFD form\xE1t ${r[i.format]??n.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${n.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${x(n.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${n.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${n.origin}`;default:return"Neplatn\xFD vstup"}}};function Qy(){return{localeError:$P()}}var IP=()=>{let e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function t(n){return e[n]??null}let r={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},o={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ugyldigt input: forventede instanceof ${n.expected}, fik ${s}`:`Ugyldigt input: forventede ${i}, fik ${s}`}case"invalid_value":return n.values.length===1?`Ugyldig v\xE6rdi: forventede ${w(n.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin),s=o[n.origin]??n.origin;return a?`For stor: forventede ${s??"value"} ${a.verb} ${i} ${n.maximum.toString()} ${a.unit??"elementer"}`:`For stor: forventede ${s??"value"} havde ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin),s=o[n.origin]??n.origin;return a?`For lille: forventede ${s} ${a.verb} ${i} ${n.minimum.toString()} ${a.unit}`:`For lille: forventede ${s} havde ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ugyldig streng: skal starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: skal ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: skal indeholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${r[i.format]??n.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${x(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${n.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${n.origin}`;default:return"Ugyldigt input"}}};function eb(){return{localeError:IP()}}var AP=()=>{let e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function t(n){return e[n]??null}let r={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},o={nan:"NaN",number:"Zahl",array:"Array"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${n.expected}, erhalten ${s}`:`Ung\xFCltige Eingabe: erwartet ${i}, erhalten ${s}`}case"invalid_value":return n.values.length===1?`Ung\xFCltige Eingabe: erwartet ${w(n.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${i}${n.maximum.toString()} ${a.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${i}${n.maximum.toString()} ist`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Zu klein: erwartet, dass ${n.origin} ${i}${n.minimum.toString()} ${a.unit} hat`:`Zu klein: erwartet, dass ${n.origin} ${i}${n.minimum.toString()} ist`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ung\xFCltiger String: muss mit "${i.prefix}" beginnen`:i.format==="ends_with"?`Ung\xFCltiger String: muss mit "${i.suffix}" enden`:i.format==="includes"?`Ung\xFCltiger String: muss "${i.includes}" enthalten`:i.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${i.pattern} entsprechen`:`Ung\xFCltig: ${r[i.format]??n.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${n.divisor} sein`;case"unrecognized_keys":return`${n.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${x(n.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${n.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${n.origin}`;default:return"Ung\xFCltige Eingabe"}}};function tb(){return{localeError:AP()}}var EP=()=>{let e={string:{unit:"\u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B5\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},file:{unit:"bytes",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},array:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},set:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},map:{unit:"\u03BA\u03B1\u03C4\u03B1\u03C7\u03C9\u03C1\u03AE\u03C3\u03B5\u03B9\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"}};function t(n){return e[n]??null}let r={regex:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2",email:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BA\u03B1\u03B9 \u03CE\u03C1\u03B1",date:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1",time:"ISO \u03CE\u03C1\u03B1",duration:"ISO \u03B4\u03B9\u03AC\u03C1\u03BA\u03B5\u03B9\u03B1",ipv4:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv4",ipv6:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv6",mac:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 MAC",cidrv4:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv4",cidrv6:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv6",base64:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64",base64url:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64url",json_string:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",e164:"\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",jwt:"JWT",template_literal:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return typeof n.expected=="string"&&/^[A-Z]/.test(n.expected)?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD instanceof ${n.expected}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${s}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${i}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${s}`}case"invalid_value":return n.values.length===1?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${w(n.values[0])}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD \u03AD\u03BD\u03B1 \u03B1\u03C0\u03CC ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${i}${n.maximum.toString()} ${a.unit??"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1"}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${i}${n.minimum.toString()} ${a.unit}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03BE\u03B5\u03BA\u03B9\u03BD\u03AC \u03BC\u03B5 "${i.prefix}"`:i.format==="ends_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B5\u03BB\u03B5\u03B9\u03CE\u03BD\u03B5\u03B9 \u03BC\u03B5 "${i.suffix}"`:i.format==="includes"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C0\u03B5\u03C1\u03B9\u03AD\u03C7\u03B5\u03B9 "${i.includes}"`:i.format==="regex"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B1\u03B9\u03C1\u03B9\u03AC\u03B6\u03B5\u03B9 \u03BC\u03B5 \u03C4\u03BF \u03BC\u03BF\u03C4\u03AF\u03B2\u03BF ${i.pattern}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF: ${r[i.format]??n.format}`}case"not_multiple_of":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF\u03C2 \u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03BF\u03BB\u03BB\u03B1\u03C0\u03BB\u03AC\u03C3\u03B9\u03BF \u03C4\u03BF\u03C5 ${n.divisor}`;case"unrecognized_keys":return`\u0386\u03B3\u03BD\u03C9\u03C3\u03C4${n.keys.length>1?"\u03B1":"\u03BF"} \u03BA\u03BB\u03B5\u03B9\u03B4${n.keys.length>1?"\u03B9\u03AC":"\u03AF"}: ${x(n.keys,", ")}`;case"invalid_key":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF \u03BA\u03BB\u03B5\u03B9\u03B4\u03AF \u03C3\u03C4\u03BF ${n.origin}`;case"invalid_union":return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2";case"invalid_element":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C4\u03B9\u03BC\u03AE \u03C3\u03C4\u03BF ${n.origin}`;default:return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"}}};function nb(){return{localeError:EP()}}var PP=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(n){return e[n]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return`Invalid input: expected ${i}, received ${s}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${w(n.values[0])}`:`Invalid option: expected one of ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Too big: expected ${n.origin??"value"} to have ${i}${n.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Too small: expected ${n.origin} to have ${i}${n.minimum.toString()} ${a.unit}`:`Too small: expected ${n.origin} to be ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Invalid string: must start with "${i.prefix}"`:i.format==="ends_with"?`Invalid string: must end with "${i.suffix}"`:i.format==="includes"?`Invalid string: must include "${i.includes}"`:i.format==="regex"?`Invalid string: must match pattern ${i.pattern}`:`Invalid ${r[i.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${x(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return n.options&&Array.isArray(n.options)&&n.options.length>0?`Invalid discriminator value. Expected ${n.options.map(a=>`'${a}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}};function as(){return{localeError:PP()}}var CP=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(n){return e[n]??null}let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},o={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${n.expected}, ricevi\u011Dis ${s}`:`Nevalida enigo: atendi\u011Dis ${i}, ricevi\u011Dis ${s}`}case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${w(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${i}${n.maximum.toString()} ${a.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Tro malgranda: atendi\u011Dis ke ${n.origin} havu ${i}${n.minimum.toString()} ${a.unit}`:`Tro malgranda: atendi\u011Dis ke ${n.origin} estu ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${i.prefix}"`:i.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${i.suffix}"`:i.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${i.includes}"`:i.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${i.pattern}`:`Nevalida ${r[i.format]??n.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${n.divisor}`;case"unrecognized_keys":return`Nekonata${n.keys.length>1?"j":""} \u015Dlosilo${n.keys.length>1?"j":""}: ${x(n.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${n.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${n.origin}`;default:return"Nevalida enigo"}}};function rb(){return{localeError:CP()}}var TP=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(n){return e[n]??null}let r={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${n.expected}, recibido ${s}`:`Entrada inv\xE1lida: se esperaba ${i}, recibido ${s}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: se esperaba ${w(n.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin),s=o[n.origin]??n.origin;return a?`Demasiado grande: se esperaba que ${s??"valor"} tuviera ${i}${n.maximum.toString()} ${a.unit??"elementos"}`:`Demasiado grande: se esperaba que ${s??"valor"} fuera ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin),s=o[n.origin]??n.origin;return a?`Demasiado peque\xF1o: se esperaba que ${s} tuviera ${i}${n.minimum.toString()} ${a.unit}`:`Demasiado peque\xF1o: se esperaba que ${s} fuera ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${i.prefix}"`:i.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${i.suffix}"`:i.format==="includes"?`Cadena inv\xE1lida: debe incluir "${i.includes}"`:i.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${i.pattern}`:`Inv\xE1lido ${r[i.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Llave${n.keys.length>1?"s":""} desconocida${n.keys.length>1?"s":""}: ${x(n.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${o[n.origin]??n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${o[n.origin]??n.origin}`;default:return"Entrada inv\xE1lida"}}};function ob(){return{localeError:TP()}}var RP=()=>{let e={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function t(n){return e[n]??null}let r={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},o={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${n.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${s} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${i} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${s} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return n.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${w(n.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${x(n.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} ${a.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:i.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:i.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${i.includes}" \u0628\u0627\u0634\u062F`:i.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${i.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${r[i.format]??n.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${n.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${n.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${x(n.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${n.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${n.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}};function ib(){return{localeError:RP()}}var OP=()=>{let e={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function t(n){return e[n]??null}let r={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Virheellinen tyyppi: odotettiin instanceof ${n.expected}, oli ${s}`:`Virheellinen tyyppi: odotettiin ${i}, oli ${s}`}case"invalid_value":return n.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${w(n.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Liian suuri: ${a.subject} t\xE4ytyy olla ${i}${n.maximum.toString()} ${a.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Liian pieni: ${a.subject} t\xE4ytyy olla ${i}${n.minimum.toString()} ${a.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${i.prefix}"`:i.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${i.suffix}"`:i.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${i.includes}"`:i.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${i.pattern}`:`Virheellinen ${r[i.format]??n.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${n.divisor} monikerta`;case"unrecognized_keys":return`${n.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${x(n.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}};function ab(){return{localeError:OP()}}var DP=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(n){return e[n]??null}let r={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},o={string:"cha\xEEne",number:"nombre",int:"entier",boolean:"bool\xE9en",bigint:"grand entier",symbol:"symbole",undefined:"ind\xE9fini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"enregistrement",map:"carte",set:"ensemble",file:"fichier",nonoptional:"non-optionnel",nan:"NaN",function:"fonction"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : instanceof ${n.expected} attendu, ${s} re\xE7u`:`Entr\xE9e invalide : ${i} attendu, ${s} re\xE7u`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : ${w(n.values[0])} attendu`:`Option invalide : une valeur parmi ${x(n.values,"|")} attendue`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Trop grand : ${o[n.origin]??"valeur"} doit ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${o[n.origin]??"valeur"} doit \xEAtre ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Trop petit : ${o[n.origin]??"valeur"} doit ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Trop petit : ${o[n.origin]??"valeur"} doit \xEAtre ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${i.pattern}`:`${r[i.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${x(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}};function sb(){return{localeError:DP()}}var NP=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(n){return e[n]??null}let r={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : attendu instanceof ${n.expected}, re\xE7u ${s}`:`Entr\xE9e invalide : attendu ${i}, re\xE7u ${s}`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : attendu ${w(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"\u2264":"<",a=t(n.origin);return a?`Trop grand : attendu que ${n.origin??"la valeur"} ait ${i}${n.maximum.toString()} ${a.unit}`:`Trop grand : attendu que ${n.origin??"la valeur"} soit ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"\u2265":">",a=t(n.origin);return a?`Trop petit : attendu que ${n.origin} ait ${i}${n.minimum.toString()} ${a.unit}`:`Trop petit : attendu que ${n.origin} soit ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${i.pattern}`:`${r[i.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${x(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}};function cb(){return{localeError:NP()}}var LP=()=>{let e={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},t={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},r=u=>u?e[u]:void 0,o=u=>{let d=r(u);return d?d.label:u??e.unknown.label},n=u=>`\u05D4${o(u)}`,i=u=>(r(u)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",a=u=>u?t[u]??null:null,s={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},l={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let d=u.expected,p=l[d??""]??o(d),m=S(u.input),f=l[m]??e[m]?.label??m;return/^[A-Z]/.test(u.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${u.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${f}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${p}, \u05D4\u05EA\u05E7\u05D1\u05DC ${f}`}case"invalid_value":{if(u.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${w(u.values[0])}`;let d=u.values.map(f=>w(f));if(u.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${d[0]} \u05D0\u05D5 ${d[1]}`;let p=d[d.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${d.slice(0,-1).join(", ")} \u05D0\u05D5 ${p}`}case"too_big":{let d=a(u.origin),p=n(u.origin??"value");if(u.origin==="string")return`${d?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${u.maximum.toString()} ${d?.unit??""} ${u.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(u.origin==="number"){let g=u.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${u.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${u.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${g}`}if(u.origin==="array"||u.origin==="set"){let g=u.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",y=u.inclusive?`${u.maximum} ${d?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${u.maximum} ${d?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${p} ${g} \u05DC\u05D4\u05DB\u05D9\u05DC ${y}`.trim()}let m=u.inclusive?"<=":"<",f=i(u.origin??"value");return d?.unit?`${d.longLabel} \u05DE\u05D3\u05D9: ${p} ${f} ${m}${u.maximum.toString()} ${d.unit}`:`${d?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${p} ${f} ${m}${u.maximum.toString()}`}case"too_small":{let d=a(u.origin),p=n(u.origin??"value");if(u.origin==="string")return`${d?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${u.minimum.toString()} ${d?.unit??""} ${u.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(u.origin==="number"){let g=u.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${u.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${u.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${g}`}if(u.origin==="array"||u.origin==="set"){let g=u.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(u.minimum===1&&u.inclusive){let k=(u.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} ${g} \u05DC\u05D4\u05DB\u05D9\u05DC ${k}`}let y=u.inclusive?`${u.minimum} ${d?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${u.minimum} ${d?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} ${g} \u05DC\u05D4\u05DB\u05D9\u05DC ${y}`.trim()}let m=u.inclusive?">=":">",f=i(u.origin??"value");return d?.unit?`${d.shortLabel} \u05DE\u05D3\u05D9: ${p} ${f} ${m}${u.minimum.toString()} ${d.unit}`:`${d?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${p} ${f} ${m}${u.minimum.toString()}`}case"invalid_format":{let d=u;if(d.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${d.prefix}"`;if(d.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${d.suffix}"`;if(d.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${d.includes}"`;if(d.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${d.pattern}`;let p=s[d.format],m=p?.label??d.format,g=(p?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${m} \u05DC\u05D0 ${g}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${u.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${u.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${u.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${x(u.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${n(u.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function lb(){return{localeError:LP()}}var UP=()=>{let e={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function t(n){return e[n]??null}let r={regex:"unos",email:"email adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",jwt:"JWT",template_literal:"unos"},o={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Neispravan unos: o\u010Dekuje se instanceof ${n.expected}, a primljeno je ${s}`:`Neispravan unos: o\u010Dekuje se ${i}, a primljeno je ${s}`}case"invalid_value":return n.values.length===1?`Neispravna vrijednost: o\u010Dekivano ${w(n.values[0])}`:`Neispravna opcija: o\u010Dekivano jedno od ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin),s=o[n.origin]??n.origin;return a?`Preveliko: o\u010Dekivano da ${s??"vrijednost"} ima ${i}${n.maximum.toString()} ${a.unit??"elemenata"}`:`Preveliko: o\u010Dekivano da ${s??"vrijednost"} bude ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin),s=o[n.origin]??n.origin;return a?`Premalo: o\u010Dekivano da ${s} ima ${i}${n.minimum.toString()} ${a.unit}`:`Premalo: o\u010Dekivano da ${s} bude ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neispravan tekst: mora zapo\u010Dinjati s "${i.prefix}"`:i.format==="ends_with"?`Neispravan tekst: mora zavr\u0161avati s "${i.suffix}"`:i.format==="includes"?`Neispravan tekst: mora sadr\u017Eavati "${i.includes}"`:i.format==="regex"?`Neispravan tekst: mora odgovarati uzorku ${i.pattern}`:`Neispravna ${r[i.format]??n.format}`}case"not_multiple_of":return`Neispravan broj: mora biti vi\u0161ekratnik od ${n.divisor}`;case"unrecognized_keys":return`Neprepoznat${n.keys.length>1?"i klju\u010Devi":" klju\u010D"}: ${x(n.keys,", ")}`;case"invalid_key":return`Neispravan klju\u010D u ${o[n.origin]??n.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${o[n.origin]??n.origin}`;default:return"Neispravan unos"}}};function ub(){return{localeError:UP()}}var zP=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(n){return e[n]??null}let r={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"},o={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${n.expected}, a kapott \xE9rt\xE9k ${s}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${i}, a kapott \xE9rt\xE9k ${s}`}case"invalid_value":return n.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${w(n.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`T\xFAl nagy: ${n.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${i}${n.maximum.toString()} ${a.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${n.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} m\xE9rete t\xFAl kicsi ${i}${n.minimum.toString()} ${a.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} t\xFAl kicsi ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\xC9rv\xE9nytelen string: "${i.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:i.format==="ends_with"?`\xC9rv\xE9nytelen string: "${i.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:i.format==="includes"?`\xC9rv\xE9nytelen string: "${i.includes}" \xE9rt\xE9ket kell tartalmaznia`:i.format==="regex"?`\xC9rv\xE9nytelen string: ${i.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${r[i.format]??n.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${n.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${n.keys.length>1?"s":""}: ${x(n.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${n.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${n.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}};function db(){return{localeError:zP()}}function pb(e,t,r){return Math.abs(e)===1?t:r}function Hr(e){if(!e)return"";let t=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],r=e[e.length-1];return e+(t.includes(r)?"\u0576":"\u0568")}var jP=()=>{let e={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function t(n){return e[n]??null}let r={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},o={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${n.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${s}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${i}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${s}`}case"invalid_value":return n.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${w(n.values[1])}`:`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);if(a){let s=Number(n.maximum),l=pb(s,a.unit.one,a.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Hr(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${i}${n.maximum.toString()} ${l}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Hr(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);if(a){let s=Number(n.minimum),l=pb(s,a.unit.one,a.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Hr(n.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${i}${n.minimum.toString()} ${l}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Hr(n.origin)} \u056C\u056B\u0576\u056B ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${i.prefix}"-\u0578\u057E`:i.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${i.suffix}"-\u0578\u057E`:i.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${i.includes}"`:i.format==="regex"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${i.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${r[i.format]??n.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${n.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${n.keys.length>1?"\u0576\u0565\u0580":""}. ${x(n.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${Hr(n.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${Hr(n.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}};function mb(){return{localeError:jP()}}var FP=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(n){return e[n]??null}let r={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Input tidak valid: diharapkan instanceof ${n.expected}, diterima ${s}`:`Input tidak valid: diharapkan ${i}, diterima ${s}`}case"invalid_value":return n.values.length===1?`Input tidak valid: diharapkan ${w(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${i}${n.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Terlalu kecil: diharapkan ${n.origin} memiliki ${i}${n.minimum.toString()} ${a.unit}`:`Terlalu kecil: diharapkan ${n.origin} menjadi ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`String tidak valid: harus dimulai dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak valid: harus berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak valid: harus menyertakan "${i.includes}"`:i.format==="regex"?`String tidak valid: harus sesuai pola ${i.pattern}`:`${r[i.format]??n.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${n.keys.length>1?"s":""}: ${x(n.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${n.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${n.origin}`;default:return"Input tidak valid"}}};function fb(){return{localeError:FP()}}var MP=()=>{let e={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function t(n){return e[n]??null}let r={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"},o={nan:"NaN",number:"n\xFAmer",array:"fylki"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${s} \xFEar sem \xE1 a\xF0 vera instanceof ${n.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${s} \xFEar sem \xE1 a\xF0 vera ${i}`}case"invalid_value":return n.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${w(n.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} hafi ${i}${n.maximum.toString()} ${a.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} s\xE9 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} hafi ${i}${n.minimum.toString()} ${a.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} s\xE9 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${i.prefix}"`:i.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${i.suffix}"`:i.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${i.includes}"`:i.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${i.pattern}`:`Rangt ${r[i.format]??n.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${n.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${n.keys.length>1?"ir lyklar":"ur lykill"}: ${x(n.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${n.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${n.origin}`;default:return"Rangt gildi"}}};function gb(){return{localeError:MP()}}var BP=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(n){return e[n]??null}let r={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"numero",array:"vettore"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Input non valido: atteso instanceof ${n.expected}, ricevuto ${s}`:`Input non valido: atteso ${i}, ricevuto ${s}`}case"invalid_value":return n.values.length===1?`Input non valido: atteso ${w(n.values[0])}`:`Opzione non valida: atteso uno tra ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Troppo grande: ${n.origin??"valore"} deve avere ${i}${n.maximum.toString()} ${a.unit??"elementi"}`:`Troppo grande: ${n.origin??"valore"} deve essere ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Troppo piccolo: ${n.origin} deve avere ${i}${n.minimum.toString()} ${a.unit}`:`Troppo piccolo: ${n.origin} deve essere ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Stringa non valida: deve iniziare con "${i.prefix}"`:i.format==="ends_with"?`Stringa non valida: deve terminare con "${i.suffix}"`:i.format==="includes"?`Stringa non valida: deve includere "${i.includes}"`:i.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${i.pattern}`:`Input non valido: ${r[i.format]??n.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${n.divisor}`;case"unrecognized_keys":return`Chiav${n.keys.length>1?"i":"e"} non riconosciut${n.keys.length>1?"e":"a"}: ${x(n.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${n.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${n.origin}`;default:return"Input non valido"}}};function hb(){return{localeError:BP()}}var HP=()=>{let e={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function t(n){return e[n]??null}let r={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},o={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${n.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${s}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${i}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${s}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return n.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${w(n.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${x(n.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let i=n.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",a=t(n.origin);return a?`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${a.unit??"\u8981\u7D20"}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let i=n.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",a=t(n.origin);return a?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${a.unit}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${i.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${r[i.format]??n.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${n.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${n.keys.length>1?"\u7FA4":""}: ${x(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}};function vb(){return{localeError:HP()}}var ZP=()=>{let e={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function t(n){return e[n]??null}let r={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",json_string:"JSON \u10D5\u10D4\u10DA\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},o={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10D5\u10D4\u10DA\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${n.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${s}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${s}`}case"invalid_value":return n.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${w(n.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${x(n.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} \u10D8\u10E7\u10DD\u10E1 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${i.prefix}"-\u10D8\u10D7`:i.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${i.suffix}"-\u10D8\u10D7`:i.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${i.includes}"-\u10E1`:i.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${i.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${n.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${n.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${x(n.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${n.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${n.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}};function yb(){return{localeError:ZP()}}var GP=()=>{let e={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function t(n){return e[n]??null}let r={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},o={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${n.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${s}`:`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${s}`}case"invalid_value":return n.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${w(n.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${n.maximum.toString()} ${a.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${i} ${n.minimum.toString()} ${a.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${i.prefix}"`:i.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${i.suffix}"`:i.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${i.includes}"`:i.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${i.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${n.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${x(n.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}};function ss(){return{localeError:GP()}}function bb(){return ss()}var WP=()=>{let e={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function t(n){return e[n]??null}let r={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${n.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${s}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${i}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${s}\uC785\uB2C8\uB2E4`}case"invalid_value":return n.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${w(n.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${x(n.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let i=n.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",a=i==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=t(n.origin),l=s?.unit??"\uC694\uC18C";return s?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()}${l} ${i}${a}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()} ${i}${a}`}case"too_small":{let i=n.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",a=i==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=t(n.origin),l=s?.unit??"\uC694\uC18C";return s?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()}${l} ${i}${a}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()} ${i}${a}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:i.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${i.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${r[i.format]??n.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${n.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${x(n.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${n.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${n.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}};function xb(){return{localeError:WP()}}var mi=e=>e.charAt(0).toUpperCase()+e.slice(1);function kb(e){let t=Math.abs(e),r=t%10,o=t%100;return o>=11&&o<=19||r===0?"many":r===1?"one":"few"}var VP=()=>{let e={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function t(n,i,a,s){let l=e[n]??null;return l===null?l:{unit:l.unit[i],verb:l.verb[s][a?"inclusive":"notInclusive"]}}let r={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},o={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Gautas tipas ${s}, o tik\u0117tasi - instanceof ${n.expected}`:`Gautas tipas ${s}, o tik\u0117tasi - ${i}`}case"invalid_value":return n.values.length===1?`Privalo b\u016Bti ${w(n.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${x(n.values,"|")} pasirinkim\u0173`;case"too_big":{let i=o[n.origin]??n.origin,a=t(n.origin,kb(Number(n.maximum)),n.inclusive??!1,"smaller");if(a?.verb)return`${mi(i??n.origin??"reik\u0161m\u0117")} ${a.verb} ${n.maximum.toString()} ${a.unit??"element\u0173"}`;let s=n.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${mi(i??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${n.maximum.toString()} ${a?.unit}`}case"too_small":{let i=o[n.origin]??n.origin,a=t(n.origin,kb(Number(n.minimum)),n.inclusive??!1,"bigger");if(a?.verb)return`${mi(i??n.origin??"reik\u0161m\u0117")} ${a.verb} ${n.minimum.toString()} ${a.unit??"element\u0173"}`;let s=n.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${mi(i??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${n.minimum.toString()} ${a?.unit}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${i.prefix}"`:i.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${i.suffix}"`:i.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${i.includes}"`:i.format==="regex"?`Eilut\u0117 privalo atitikti ${i.pattern}`:`Neteisingas ${r[i.format]??n.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${n.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${n.keys.length>1?"i":"as"} rakt${n.keys.length>1?"ai":"as"}: ${x(n.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let i=o[n.origin]??n.origin;return`${mi(i??n.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function wb(){return{localeError:VP()}}var JP=()=>{let e={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function t(n){return e[n]??null}let r={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},o={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${n.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${s}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${s}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${w(n.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${i}${n.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0438\u043C\u0430 ${i}${n.minimum.toString()} ${a.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${i.pattern}`:`Invalid ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${x(n.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${n.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${n.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}};function Sb(){return{localeError:JP()}}var qP=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(n){return e[n]??null}let r={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"nombor"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Input tidak sah: dijangka instanceof ${n.expected}, diterima ${s}`:`Input tidak sah: dijangka ${i}, diterima ${s}`}case"invalid_value":return n.values.length===1?`Input tidak sah: dijangka ${w(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Terlalu besar: dijangka ${n.origin??"nilai"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Terlalu kecil: dijangka ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Terlalu kecil: dijangka ${n.origin} adalah ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`String tidak sah: mesti bermula dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak sah: mesti mengandungi "${i.includes}"`:i.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${i.pattern}`:`${r[i.format]??n.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${x(n.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${n.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${n.origin}`;default:return"Input tidak sah"}}};function _b(){return{localeError:qP()}}var KP=()=>{let e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function t(n){return e[n]??null}let r={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},o={nan:"NaN",number:"getal"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ongeldige invoer: verwacht instanceof ${n.expected}, ontving ${s}`:`Ongeldige invoer: verwacht ${i}, ontving ${s}`}case"invalid_value":return n.values.length===1?`Ongeldige invoer: verwacht ${w(n.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin),s=n.origin==="date"?"laat":n.origin==="string"?"lang":"groot";return a?`Te ${s}: verwacht dat ${n.origin??"waarde"} ${i}${n.maximum.toString()} ${a.unit??"elementen"} ${a.verb}`:`Te ${s}: verwacht dat ${n.origin??"waarde"} ${i}${n.maximum.toString()} is`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin),s=n.origin==="date"?"vroeg":n.origin==="string"?"kort":"klein";return a?`Te ${s}: verwacht dat ${n.origin} ${i}${n.minimum.toString()} ${a.unit} ${a.verb}`:`Te ${s}: verwacht dat ${n.origin} ${i}${n.minimum.toString()} is`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ongeldige tekst: moet met "${i.prefix}" beginnen`:i.format==="ends_with"?`Ongeldige tekst: moet op "${i.suffix}" eindigen`:i.format==="includes"?`Ongeldige tekst: moet "${i.includes}" bevatten`:i.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${i.pattern}`:`Ongeldig: ${r[i.format]??n.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${n.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${n.keys.length>1?"s":""}: ${x(n.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${n.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${n.origin}`;default:return"Ongeldige invoer"}}};function $b(){return{localeError:KP()}}var XP=()=>{let e={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function t(n){return e[n]??null}let r={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"tall",array:"liste"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ugyldig input: forventet instanceof ${n.expected}, fikk ${s}`:`Ugyldig input: forventet ${i}, fikk ${s}`}case"invalid_value":return n.values.length===1?`Ugyldig verdi: forventet ${w(n.values[0])}`:`Ugyldig valg: forventet en av ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${i}${n.maximum.toString()} ${a.unit??"elementer"}`:`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`For lite(n): forventet ${n.origin} til \xE5 ha ${i}${n.minimum.toString()} ${a.unit}`:`For lite(n): forventet ${n.origin} til \xE5 ha ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${r[i.format]??n.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${x(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${n.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${n.origin}`;default:return"Ugyldig input"}}};function Ib(){return{localeError:XP()}}var YP=()=>{let e={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function t(n){return e[n]??null}let r={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"},o={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`F\xE2sit giren: umulan instanceof ${n.expected}, al\u0131nan ${s}`:`F\xE2sit giren: umulan ${i}, al\u0131nan ${s}`}case"invalid_value":return n.values.length===1?`F\xE2sit giren: umulan ${w(n.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${i}${n.maximum.toString()} ${a.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${i}${n.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${i}${n.minimum.toString()} ${a.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${i}${n.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let i=n;return i.format==="starts_with"?`F\xE2sit metin: "${i.prefix}" ile ba\u015Flamal\u0131.`:i.format==="ends_with"?`F\xE2sit metin: "${i.suffix}" ile bitmeli.`:i.format==="includes"?`F\xE2sit metin: "${i.includes}" ihtiv\xE2 etmeli.`:i.format==="regex"?`F\xE2sit metin: ${i.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${r[i.format]??n.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${n.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${n.keys.length>1?"s":""}: ${x(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${n.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}};function Ab(){return{localeError:YP()}}var QP=()=>{let e={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function t(n){return e[n]??null}let r={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},o={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${n.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${s} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${i} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${s} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return n.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${w(n.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${x(n.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} \u0648\u064A`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} ${a.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} \u0648\u064A`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:i.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:i.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${i.includes}" \u0648\u0644\u0631\u064A`:i.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${i.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${r[i.format]??n.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${n.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${n.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${x(n.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${n.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${n.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}};function Eb(){return{localeError:QP()}}var eC=()=>{let e={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function t(n){return e[n]??null}let r={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"},o={nan:"NaN",number:"liczba",array:"tablica"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${n.expected}, otrzymano ${s}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${i}, otrzymano ${s}`}case"invalid_value":return n.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${w(n.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${n.maximum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${n.minimum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${i.prefix}"`:i.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${i.suffix}"`:i.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${i.includes}"`:i.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${i.pattern}`:`Nieprawid\u0142ow(y/a/e) ${r[i.format]??n.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${n.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${n.keys.length>1?"s":""}: ${x(n.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${n.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${n.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}};function Pb(){return{localeError:eC()}}var tC=()=>{let e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(n){return e[n]??null}let r={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN",number:"n\xFAmero",null:"nulo"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Tipo inv\xE1lido: esperado instanceof ${n.expected}, recebido ${s}`:`Tipo inv\xE1lido: esperado ${i}, recebido ${s}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: esperado ${w(n.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Muito grande: esperado que ${n.origin??"valor"} tivesse ${i}${n.maximum.toString()} ${a.unit??"elementos"}`:`Muito grande: esperado que ${n.origin??"valor"} fosse ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Muito pequeno: esperado que ${n.origin} tivesse ${i}${n.minimum.toString()} ${a.unit}`:`Muito pequeno: esperado que ${n.origin} fosse ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${i.prefix}"`:i.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${i.suffix}"`:i.format==="includes"?`Texto inv\xE1lido: deve incluir "${i.includes}"`:i.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${i.pattern}`:`${r[i.format]??n.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Chave${n.keys.length>1?"s":""} desconhecida${n.keys.length>1?"s":""}: ${x(n.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${n.origin}`;default:return"Campo inv\xE1lido"}}};function Cb(){return{localeError:tC()}}var nC=()=>{let e={string:{unit:"caractere",verb:"s\u0103 aib\u0103"},file:{unit:"octe\u021Bi",verb:"s\u0103 aib\u0103"},array:{unit:"elemente",verb:"s\u0103 aib\u0103"},set:{unit:"elemente",verb:"s\u0103 aib\u0103"},map:{unit:"intr\u0103ri",verb:"s\u0103 aib\u0103"}};function t(n){return e[n]??null}let r={regex:"intrare",email:"adres\u0103 de email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"dat\u0103 \u0219i or\u0103 ISO",date:"dat\u0103 ISO",time:"or\u0103 ISO",duration:"durat\u0103 ISO",ipv4:"adres\u0103 IPv4",ipv6:"adres\u0103 IPv6",mac:"adres\u0103 MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"\u0219ir codat base64",base64url:"\u0219ir codat base64url",json_string:"\u0219ir JSON",e164:"num\u0103r E.164",jwt:"JWT",template_literal:"intrare"},o={nan:"NaN",string:"\u0219ir",number:"num\u0103r",boolean:"boolean",function:"func\u021Bie",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"num\u0103r mare",void:"void",never:"never",map:"hart\u0103",set:"set"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return`Intrare invalid\u0103: a\u0219teptat ${i}, primit ${s}`}case"invalid_value":return n.values.length===1?`Intrare invalid\u0103: a\u0219teptat ${w(n.values[0])}`:`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Prea mare: a\u0219teptat ca ${n.origin??"valoarea"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"elemente"}`:`Prea mare: a\u0219teptat ca ${n.origin??"valoarea"} s\u0103 fie ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Prea mic: a\u0219teptat ca ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Prea mic: a\u0219teptat ca ${n.origin} s\u0103 fie ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0218ir invalid: trebuie s\u0103 \xEEnceap\u0103 cu "${i.prefix}"`:i.format==="ends_with"?`\u0218ir invalid: trebuie s\u0103 se termine cu "${i.suffix}"`:i.format==="includes"?`\u0218ir invalid: trebuie s\u0103 includ\u0103 "${i.includes}"`:i.format==="regex"?`\u0218ir invalid: trebuie s\u0103 se potriveasc\u0103 cu modelul ${i.pattern}`:`Format invalid: ${r[i.format]??n.format}`}case"not_multiple_of":return`Num\u0103r invalid: trebuie s\u0103 fie multiplu de ${n.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${x(n.keys,", ")}`;case"invalid_key":return`Cheie invalid\u0103 \xEEn ${n.origin}`;case"invalid_union":return"Intrare invalid\u0103";case"invalid_element":return`Valoare invalid\u0103 \xEEn ${n.origin}`;default:return"Intrare invalid\u0103"}}};function Tb(){return{localeError:nC()}}function Rb(e,t,r,o){let n=Math.abs(e),i=n%10,a=n%100;return a>=11&&a<=19?o:i===1?t:i>=2&&i<=4?r:o}var rC=()=>{let e={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function t(n){return e[n]??null}let r={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${s}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${i}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${s}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${w(n.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);if(a){let s=Number(n.maximum),l=Rb(s,a.unit.one,a.unit.few,a.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${n.maximum.toString()} ${l}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);if(a){let s=Number(n.minimum),l=Rb(s,a.unit.one,a.unit.few,a.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${n.minimum.toString()} ${l}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${n.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0438":""}: ${x(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${n.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}};function Ob(){return{localeError:rC()}}var oC=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(n){return e[n]??null}let r={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"},o={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${n.expected}, prejeto ${s}`:`Neveljaven vnos: pri\u010Dakovano ${i}, prejeto ${s}`}case"invalid_value":return n.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${w(n.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} imelo ${i}${n.maximum.toString()} ${a.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Premajhno: pri\u010Dakovano, da bo ${n.origin} imelo ${i}${n.minimum.toString()} ${a.unit}`:`Premajhno: pri\u010Dakovano, da bo ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${i.prefix}"`:i.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${i.suffix}"`:i.format==="includes"?`Neveljaven niz: mora vsebovati "${i.includes}"`:i.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${i.pattern}`:`Neveljaven ${r[i.format]??n.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${n.divisor}`;case"unrecognized_keys":return`Neprepoznan${n.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${x(n.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${n.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${n.origin}`;default:return"Neveljaven vnos"}}};function Db(){return{localeError:oC()}}var iC=()=>{let e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function t(n){return e[n]??null}let r={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},o={nan:"NaN",number:"antal",array:"lista"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${n.expected}, fick ${s}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${i}, fick ${s}`}case"invalid_value":return n.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${w(n.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`F\xF6r stor(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.maximum.toString()} ${a.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${n.origin??"v\xE4rdet"} att ha ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.minimum.toString()} ${a.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${i.prefix}"`:i.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${i.suffix}"`:i.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${i.includes}"`:i.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${i.pattern}"`:`Ogiltig(t) ${r[i.format]??n.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${x(n.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${n.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${n.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}};function Nb(){return{localeError:iC()}}var aC=()=>{let e={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function t(n){return e[n]??null}let r={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${n.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${s}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${s}`}case"invalid_value":return n.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${w(n.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${x(n.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${n.maximum.toString()} ${a.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${n.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${i}${n.minimum.toString()} ${a.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${i}${n.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${i.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${n.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${n.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${x(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}};function Lb(){return{localeError:aC()}}var sC=()=>{let e={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function t(n){return e[n]??null}let r={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},o={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${n.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${s}`:`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${i} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${s}`}case"invalid_value":return n.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${w(n.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",a=t(n.origin);return a?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.maximum.toString()} ${a.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",a=t(n.origin);return a?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.minimum.toString()} ${a.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${i.prefix}"`:i.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${i.suffix}"`:i.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${i.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:i.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${i.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${n.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${x(n.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}};function Ub(){return{localeError:sC()}}var cC=()=>{let e={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function t(n){return e[n]??null}let r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${n.expected}, al\u0131nan ${s}`:`Ge\xE7ersiz de\u011Fer: beklenen ${i}, al\u0131nan ${s}`}case"invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${w(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${i}${n.maximum.toString()} ${a.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${i}${n.minimum.toString()} ${a.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ge\xE7ersiz metin: "${i.prefix}" ile ba\u015Flamal\u0131`:i.format==="ends_with"?`Ge\xE7ersiz metin: "${i.suffix}" ile bitmeli`:i.format==="includes"?`Ge\xE7ersiz metin: "${i.includes}" i\xE7ermeli`:i.format==="regex"?`Ge\xE7ersiz metin: ${i.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[i.format]??n.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${n.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${n.keys.length>1?"lar":""}: ${x(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${n.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}};function zb(){return{localeError:cC()}}var lC=()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function t(n){return e[n]??null}let r={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${n.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${s}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${i}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${s}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${w(n.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} \u0431\u0443\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0456":""}: ${x(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${n.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}};function cs(){return{localeError:lC()}}function jb(){return cs()}var uC=()=>{let e={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function t(n){return e[n]??null}let r={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},o={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${n.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${s} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${i} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${s} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return n.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${w(n.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${x(n.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${i}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${i}${n.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u06D2 ${i}${n.minimum.toString()} ${a.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u0627 ${i}${n.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${i.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${n.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${n.keys.length>1?"\u0632":""}: ${x(n.keys,"\u060C ")}`;case"invalid_key":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}};function Fb(){return{localeError:uC()}}var dC=()=>{let e={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"},map:{unit:"yozuv",verb:"bo\u2018lishi kerak"}};function t(n){return e[n]??null}let r={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},o={nan:"NaN",number:"raqam",array:"massiv"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${n.expected}, qabul qilingan ${s}`:`Noto\u2018g\u2018ri kirish: kutilgan ${i}, qabul qilingan ${s}`}case"invalid_value":return n.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${w(n.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Juda katta: kutilgan ${n.origin??"qiymat"} ${i}${n.maximum.toString()} ${a.unit} ${a.verb}`:`Juda katta: kutilgan ${n.origin??"qiymat"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Juda kichik: kutilgan ${n.origin} ${i}${n.minimum.toString()} ${a.unit} ${a.verb}`:`Juda kichik: kutilgan ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${i.prefix}" bilan boshlanishi kerak`:i.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${i.suffix}" bilan tugashi kerak`:i.format==="includes"?`Noto\u2018g\u2018ri satr: "${i.includes}" ni o\u2018z ichiga olishi kerak`:i.format==="regex"?`Noto\u2018g\u2018ri satr: ${i.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${r[i.format]??n.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${n.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${n.keys.length>1?"lar":""}: ${x(n.keys,", ")}`;case"invalid_key":return`${n.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${n.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}};function Mb(){return{localeError:dC()}}var pC=()=>{let e={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function t(n){return e[n]??null}let r={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},o={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${n.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${s}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${i}, nh\u1EADn \u0111\u01B0\u1EE3c ${s}`}case"invalid_value":return n.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${w(n.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${i.prefix}"`:i.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${i.suffix}"`:i.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${i.includes}"`:i.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${i.pattern}`:`${r[i.format]??n.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${n.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${x(n.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}};function Bb(){return{localeError:pC()}}var mC=()=>{let e={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function t(n){return e[n]??null}let r={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"},o={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${n.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${s}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${i}\uFF0C\u5B9E\u9645\u63A5\u6536 ${s}`}case"invalid_value":return n.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${w(n.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${i}${n.maximum.toString()} ${a.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${i}${n.minimum.toString()} ${a.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.prefix}" \u5F00\u5934`:i.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.suffix}" \u7ED3\u5C3E`:i.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${i.pattern}`:`\u65E0\u6548${r[i.format]??n.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${n.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${x(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${n.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}};function Hb(){return{localeError:mC()}}var fC=()=>{let e={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function t(n){return e[n]??null}let r={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${n.expected}\uFF0C\u4F46\u6536\u5230 ${s}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${i}\uFF0C\u4F46\u6536\u5230 ${s}`}case"invalid_value":return n.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${w(n.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${i}${n.maximum.toString()} ${a.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${i}${n.minimum.toString()} ${a.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.prefix}" \u958B\u982D`:i.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.suffix}" \u7D50\u5C3E`:i.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${i.pattern}`:`\u7121\u6548\u7684 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${n.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${n.keys.length>1?"\u5011":""}\uFF1A${x(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}};function Zb(){return{localeError:fC()}}var gC=()=>{let e={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function t(n){return e[n]??null}let r={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},o={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${n.expected}, \xE0m\u1ECD\u0300 a r\xED ${s}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${i}, \xE0m\u1ECD\u0300 a r\xED ${s}`}case"invalid_value":return n.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${w(n.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin??"iye"} ${a.verb} ${i}${n.maximum} ${a.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${n.maximum}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin} ${a.verb} ${i}${n.minimum} ${a.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${n.minimum}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${i.prefix}"`:i.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${i.suffix}"`:i.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${i.includes}"`:i.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${i.pattern}`:`A\u1E63\xEC\u1E63e: ${r[i.format]??n.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${n.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${x(n.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}};function Gb(){return{localeError:gC()}}var Wb,vp=Symbol("ZodOutput"),yp=Symbol("ZodInput"),ls=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let o=r[0];return this._map.set(t,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let o={...this.get(r)??{}};delete o.id;let n={...o,...this._map.get(t)};return Object.keys(n).length?n:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function us(){return new ls}(Wb=globalThis).__zod_globalRegistry??(Wb.__zod_globalRegistry=us());var Ce=globalThis.__zod_globalRegistry;function bp(e,t){return new e({type:"string",...I(t)})}function xp(e,t){return new e({type:"string",coerce:!0,...I(t)})}function ds(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...I(t)})}function gi(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...I(t)})}function ps(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...I(t)})}function ms(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...I(t)})}function fs(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...I(t)})}function gs(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...I(t)})}function hi(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...I(t)})}function hs(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...I(t)})}function vs(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...I(t)})}function ys(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...I(t)})}function bs(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...I(t)})}function xs(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...I(t)})}function ks(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...I(t)})}function ws(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...I(t)})}function Ss(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...I(t)})}function _s(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...I(t)})}function kp(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...I(t)})}function $s(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...I(t)})}function Is(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...I(t)})}function As(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...I(t)})}function Es(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...I(t)})}function Ps(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...I(t)})}function Cs(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...I(t)})}var wp={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function Sp(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...I(t)})}function _p(e,t){return new e({type:"string",format:"date",check:"string_format",...I(t)})}function $p(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...I(t)})}function Ip(e,t){return new e({type:"string",format:"duration",check:"string_format",...I(t)})}function Ap(e,t){return new e({type:"number",checks:[],...I(t)})}function Ep(e,t){return new e({type:"number",coerce:!0,checks:[],...I(t)})}function Pp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...I(t)})}function Cp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...I(t)})}function Tp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...I(t)})}function Rp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...I(t)})}function Op(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...I(t)})}function Dp(e,t){return new e({type:"boolean",...I(t)})}function Np(e,t){return new e({type:"boolean",coerce:!0,...I(t)})}function Lp(e,t){return new e({type:"bigint",...I(t)})}function Up(e,t){return new e({type:"bigint",coerce:!0,...I(t)})}function zp(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...I(t)})}function jp(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...I(t)})}function Fp(e,t){return new e({type:"symbol",...I(t)})}function Mp(e,t){return new e({type:"undefined",...I(t)})}function Bp(e,t){return new e({type:"null",...I(t)})}function Hp(e){return new e({type:"any"})}function Zp(e){return new e({type:"unknown"})}function Gp(e,t){return new e({type:"never",...I(t)})}function Wp(e,t){return new e({type:"void",...I(t)})}function Vp(e,t){return new e({type:"date",...I(t)})}function Jp(e,t){return new e({type:"date",coerce:!0,...I(t)})}function qp(e,t){return new e({type:"nan",...I(t)})}function Dt(e,t){return new qa({check:"less_than",...I(t),value:e,inclusive:!1})}function ot(e,t){return new qa({check:"less_than",...I(t),value:e,inclusive:!0})}function Nt(e,t){return new Ka({check:"greater_than",...I(t),value:e,inclusive:!1})}function Fe(e,t){return new Ka({check:"greater_than",...I(t),value:e,inclusive:!0})}function Ts(e){return Nt(0,e)}function Rs(e){return Dt(0,e)}function Os(e){return ot(0,e)}function Ds(e){return Fe(0,e)}function Nn(e,t){return new Bu({check:"multiple_of",...I(t),value:e})}function Ln(e,t){return new Gu({check:"max_size",...I(t),maximum:e})}function Lt(e,t){return new Wu({check:"min_size",...I(t),minimum:e})}function tr(e,t){return new Vu({check:"size_equals",...I(t),size:e})}function nr(e,t){return new Ju({check:"max_length",...I(t),maximum:e})}function nn(e,t){return new qu({check:"min_length",...I(t),minimum:e})}function rr(e,t){return new Ku({check:"length_equals",...I(t),length:e})}function Zr(e,t){return new Xu({check:"string_format",format:"regex",...I(t),pattern:e})}function Gr(e){return new Yu({check:"string_format",format:"lowercase",...I(e)})}function Wr(e){return new Qu({check:"string_format",format:"uppercase",...I(e)})}function Vr(e,t){return new ed({check:"string_format",format:"includes",...I(t),includes:e})}function Jr(e,t){return new td({check:"string_format",format:"starts_with",...I(t),prefix:e})}function qr(e,t){return new nd({check:"string_format",format:"ends_with",...I(t),suffix:e})}function Ns(e,t,r){return new rd({check:"property",property:e,schema:t,...I(r)})}function Kr(e,t){return new od({check:"mime_type",mime:e,...I(t)})}function St(e){return new id({check:"overwrite",tx:e})}function Xr(e){return St(t=>t.normalize(e))}function Yr(){return St(e=>e.trim())}function Qr(){return St(e=>e.toLowerCase())}function eo(){return St(e=>e.toUpperCase())}function to(){return St(e=>tu(e))}function Kp(e,t,r){return new e({type:"array",element:t,...I(r)})}function vC(e,t,r){return new e({type:"union",options:t,...I(r)})}function yC(e,t,r){return new e({type:"union",options:t,inclusive:!1,...I(r)})}function bC(e,t,r,o){return new e({type:"union",options:r,discriminator:t,...I(o)})}function xC(e,t,r){return new e({type:"intersection",left:t,right:r})}function kC(e,t,r,o){let n=r instanceof F,i=n?o:r,a=n?r:null;return new e({type:"tuple",items:t,rest:a,...I(i)})}function wC(e,t,r,o){return new e({type:"record",keyType:t,valueType:r,...I(o)})}function SC(e,t,r,o){return new e({type:"map",keyType:t,valueType:r,...I(o)})}function _C(e,t,r){return new e({type:"set",valueType:t,...I(r)})}function $C(e,t,r){let o=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new e({type:"enum",entries:o,...I(r)})}function IC(e,t,r){return new e({type:"enum",entries:t,...I(r)})}function AC(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...I(r)})}function Xp(e,t){return new e({type:"file",...I(t)})}function EC(e,t){return new e({type:"transform",transform:t})}function PC(e,t){return new e({type:"optional",innerType:t})}function CC(e,t){return new e({type:"nullable",innerType:t})}function TC(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r=="function"?r():ru(r)}})}function RC(e,t,r){return new e({type:"nonoptional",innerType:t,...I(r)})}function OC(e,t){return new e({type:"success",innerType:t})}function DC(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r=="function"?r:()=>r})}function NC(e,t,r){return new e({type:"pipe",in:t,out:r})}function LC(e,t){return new e({type:"readonly",innerType:t})}function UC(e,t,r){return new e({type:"template_literal",parts:t,...I(r)})}function zC(e,t){return new e({type:"lazy",getter:t})}function jC(e,t){return new e({type:"promise",innerType:t})}function Yp(e,t,r){let o=I(r);return o.abort??(o.abort=!0),new e({type:"custom",check:"custom",fn:t,...o})}function Qp(e,t,r){return new e({type:"custom",check:"custom",fn:t,...I(r)})}function em(e,t){let r=Vb(o=>(o.addIssue=n=>{if(typeof n=="string")o.issues.push(Ur(n,o.value,r._zod.def));else{let i=n;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=o.value),i.inst??(i.inst=r),i.continue??(i.continue=!r._zod.def.abort),o.issues.push(Ur(i))}},e(o.value,o)),t);return r}function Vb(e,t){let r=new de({check:"custom",...I(t)});return r._zod.check=e,r}function tm(e){let t=new de({check:"describe"});return t._zod.onattach=[r=>{let o=Ce.get(r)??{};Ce.add(r,{...o,description:e})}],t._zod.check=()=>{},t}function nm(e){let t=new de({check:"meta"});return t._zod.onattach=[r=>{let o=Ce.get(r)??{};Ce.add(r,{...o,...e})}],t._zod.check=()=>{},t}function rm(e,t){let r=I(t),o=r.truthy??["true","1","yes","on","y","enabled"],n=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(o=o.map(f=>typeof f=="string"?f.toLowerCase():f),n=n.map(f=>typeof f=="string"?f.toLowerCase():f));let i=new Set(o),a=new Set(n),s=e.Codec??pi,l=e.Boolean??ui,u=e.String??er,d=new u({type:"string",error:r.error}),p=new l({type:"boolean",error:r.error}),m=new s({type:"pipe",in:d,out:p,transform:((f,g)=>{let y=f;return r.case!=="sensitive"&&(y=y.toLowerCase()),i.has(y)?!0:a.has(y)?!1:(g.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...a],input:g.value,inst:m,continue:!1}),{})}),reverseTransform:((f,g)=>f===!0?o[0]||"true":n[0]||"false"),error:r.error});return m}function no(e,t,r,o={}){let n=I(o),i={...I(o),check:"string_format",type:"string",format:t,fn:typeof r=="function"?r:s=>r.test(s),...n};return r instanceof RegExp&&(i.pattern=r),new e(i)}function Un(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Ce,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function oe(e,t,r={path:[],schemaPath:[]}){var o;let n=e._zod.def,i=t.seen.get(e);if(i)return i.count++,r.schemaPath.includes(e)&&(i.cycle=r.path),i.schema;let a={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,a);let s=e._zod.toJSONSchema?.();if(s)a.schema=s;else{let d={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,d);else{let m=a.schema,f=t.processors[n.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);f(e,t,m,d)}let p=e._zod.parent;p&&(a.ref||(a.ref=p),oe(p,t,d),t.seen.get(p).isParent=!0)}let l=t.metadataRegistry.get(e);return l&&Object.assign(a.schema,l),t.io==="input"&&Me(e)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&"_prefault"in a.schema&&((o=a.schema).default??(o.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function zn(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=new Map;for(let a of e.seen.entries()){let s=e.metadataRegistry.get(a[0])?.id;if(s){let l=o.get(s);if(l&&l!==a[0])throw new Error(`Duplicate schema id "${s}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(s,a[0])}}let n=a=>{let s=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let p=e.external.registry.get(a[0])?.id,m=e.external.uri??(g=>g);if(p)return{ref:m(p)};let f=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=f,{defId:f,ref:`${m("__shared")}#/${s}/${f}`}}if(a[1]===r)return{ref:"#"};let u=`#/${s}/`,d=a[1].schema.id??`__schema${e.counter++}`;return{defId:d,ref:u+d}},i=a=>{if(a[1].schema.$ref)return;let s=a[1],{ref:l,defId:u}=n(a);s.def={...s.schema},u&&(s.defId=u);let d=s.schema;for(let p in d)delete d[p];d.$ref=l};if(e.cycles==="throw")for(let a of e.seen.entries()){let s=a[1];if(s.cycle)throw new Error(`Cycle detected: #/${s.cycle?.join("/")}/<root>
|
|
235
|
+
`)}f.write("payload.value = newResult;"),f.write("return payload;");let P=f.compile();return(C,E)=>P(m,C,E)},i,a=er,s=!Qn.jitless,u=s&&su.value,d=t.catchall,p;e._zod.parse=(m,f)=>{p??(p=o.value);let g=m.value;return a(g)?s&&u&&f?.async===!1&&f.jitless!==!0?(i||(i=n(t.shape)),m=i(m,f),d?Yy([],g,m,f,p,e):m):r(m,f):(m.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),m)}});function Ly(e,t,r,o){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let n=e.filter(i=>!Dn(i));return n.length===1?(t.value=n[0].value,n[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(a=>Fe(a,o,be())))}),t)}var gi=v("$ZodUnion",(e,t)=>{F.init(e,t),V(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),V(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),V(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),V(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){let o=t.options.map(n=>n._zod.pattern);return new RegExp(`^(${o.map(n=>oi(n.source)).join("|")})$`)}});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,n)=>{if(r)return r(o,n);let i=!1,a=[];for(let s of t.options){let l=s._zod.run({value:o.value,issues:[]},n);if(l instanceof Promise)a.push(l),i=!0;else{if(l.issues.length===0)return l;a.push(l)}}return i?Promise.all(a).then(s=>Ly(s,o,e,n)):Ly(a,o,e,n)}});function Uy(e,t,r,o){let n=e.filter(i=>i.issues.length===0);return n.length===1?(t.value=n[0].value,t):(n.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(a=>Fe(a,o,be())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1}),t)}var Xd=v("$ZodXor",(e,t)=>{gi.init(e,t),t.inclusive=!1;let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,n)=>{if(r)return r(o,n);let i=!1,a=[];for(let s of t.options){let l=s._zod.run({value:o.value,issues:[]},n);l instanceof Promise?(a.push(l),i=!0):a.push(l)}return i?Promise.all(a).then(s=>Uy(s,o,e,n)):Uy(a,o,e,n)}}),Yd=v("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,gi.init(e,t);let r=e._zod.parse;V(e._zod,"propValues",()=>{let n={};for(let i of t.options){let a=i._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let[s,l]of Object.entries(a)){n[s]||(n[s]=new Set);for(let u of l)n[s].add(u)}}return n});let o=jr(()=>{let n=t.options,i=new Map;for(let a of n){let s=a._zod.propValues?.[t.discriminator];if(!s||s.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(let l of s){if(i.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);i.set(l,a)}}return i});e._zod.parse=(n,i)=>{let a=n.value;if(!er(a))return n.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),n;let s=o.value.get(a?.[t.discriminator]);return s?s._zod.run(n,i):t.unionFallback||i.direction==="backward"?r(n,i):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(o.value.keys()),input:a,path:[t.discriminator],inst:e}),n)}}),Qd=v("$ZodIntersection",(e,t)=>{F.init(e,t),e._zod.parse=(r,o)=>{let n=r.value,i=t.left._zod.run({value:n,issues:[]},o),a=t.right._zod.run({value:n,issues:[]},o);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([l,u])=>zy(r,l,u)):zy(r,i,a)}});function pd(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(On(e)&&On(t)){let r=Object.keys(t),o=Object.keys(e).filter(i=>r.indexOf(i)!==-1),n={...e,...t};for(let i of o){let a=pd(e[i],t[i]);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};n[i]=a.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let o=0;o<e.length;o++){let n=e[o],i=t[o],a=pd(n,i);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function zy(e,t,r){let o=new Map,n;for(let s of t.issues)if(s.code==="unrecognized_keys"){n??(n=s);for(let l of s.keys)o.has(l)||o.set(l,{}),o.get(l).l=!0}else e.issues.push(s);for(let s of r.issues)if(s.code==="unrecognized_keys")for(let l of s.keys)o.has(l)||o.set(l,{}),o.get(l).r=!0;else e.issues.push(s);let i=[...o].filter(([,s])=>s.l&&s.r).map(([s])=>s);if(i.length&&n&&e.issues.push({...n,keys:i}),Dn(e))return e;let a=pd(t.value,r.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}var ls=v("$ZodTuple",(e,t)=>{F.init(e,t);let r=t.items;e._zod.parse=(o,n)=>{let i=o.value;if(!Array.isArray(i))return o.issues.push({input:i,inst:e,expected:"tuple",code:"invalid_type"}),o;o.value=[];let a=[],s=jy(r,"optin"),l=jy(r,"optout");if(!t.rest){if(i.length<s)return o.issues.push({code:"too_small",minimum:s,inclusive:!0,input:i,inst:e,origin:"array"}),o;i.length>r.length&&o.issues.push({code:"too_big",maximum:r.length,inclusive:!0,input:i,inst:e,origin:"array"})}let u=new Array(r.length);for(let d=0;d<r.length;d++){let p=r[d]._zod.run({value:i[d],issues:[]},n);p instanceof Promise?a.push(p.then(m=>{u[d]=m})):u[d]=p}if(t.rest){let d=r.length-1,p=i.slice(r.length);for(let m of p){d++;let f=t.rest._zod.run({value:m,issues:[]},n);f instanceof Promise?a.push(f.then(g=>Fy(g,o,d))):Fy(f,o,d)}}return a.length?Promise.all(a).then(()=>By(u,o,r,i,l)):By(u,o,r,i,l)}});function jy(e,t){for(let r=e.length-1;r>=0;r--)if(e[r]._zod[t]!=="optional")return r+1;return 0}function Fy(e,t,r){e.issues.length&&t.issues.push(...Ke(r,e.issues)),t.value[r]=e.value}function By(e,t,r,o,n){for(let i=0;i<r.length;i++){let a=e[i],s=i<o.length;if(a.issues.length){if(!s&&i>=n){t.value.length=i;break}t.issues.push(...Ke(i,a.issues))}t.value[i]=a.value}for(let i=t.value.length-1;i>=o.length&&(r[i]._zod.optout==="optional"&&t.value[i]===void 0);i--)t.value.length=i;return t}var ep=v("$ZodRecord",(e,t)=>{F.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!On(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:e}),r;let i=[],a=t.keyType._zod.values;if(a){r.value={};let s=new Set;for(let u of a)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){s.add(typeof u=="number"?u.toString():u);let d=t.keyType._zod.run({value:u,issues:[]},o);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(d.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(f=>Fe(f,o,be())),input:u,path:[u],inst:e});continue}let p=d.value,m=t.valueType._zod.run({value:n[u],issues:[]},o);m instanceof Promise?i.push(m.then(f=>{f.issues.length&&r.issues.push(...Ke(u,f.issues)),r.value[p]=f.value})):(m.issues.length&&r.issues.push(...Ke(u,m.issues)),r.value[p]=m.value)}let l;for(let u in n)s.has(u)||(l=l??[],l.push(u));l&&l.length>0&&r.issues.push({code:"unrecognized_keys",input:n,inst:e,keys:l})}else{r.value={};for(let s of Reflect.ownKeys(n)){if(s==="__proto__"||!Object.prototype.propertyIsEnumerable.call(n,s))continue;let l=t.keyType._zod.run({value:s,issues:[]},o);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof s=="string"&&es.test(s)&&l.issues.length){let p=t.keyType._zod.run({value:Number(s),issues:[]},o);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");p.issues.length===0&&(l=p)}if(l.issues.length){t.mode==="loose"?r.value[s]=n[s]:r.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(p=>Fe(p,o,be())),input:s,path:[s],inst:e});continue}let d=t.valueType._zod.run({value:n[s],issues:[]},o);d instanceof Promise?i.push(d.then(p=>{p.issues.length&&r.issues.push(...Ke(s,p.issues)),r.value[l.value]=p.value})):(d.issues.length&&r.issues.push(...Ke(s,d.issues)),r.value[l.value]=d.value)}}return i.length?Promise.all(i).then(()=>r):r}}),tp=v("$ZodMap",(e,t)=>{F.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!(n instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:n,inst:e}),r;let i=[];r.value=new Map;for(let[a,s]of n){let l=t.keyType._zod.run({value:a,issues:[]},o),u=t.valueType._zod.run({value:s,issues:[]},o);l instanceof Promise||u instanceof Promise?i.push(Promise.all([l,u]).then(([d,p])=>{My(d,p,r,a,n,e,o)})):My(l,u,r,a,n,e,o)}return i.length?Promise.all(i).then(()=>r):r}});function My(e,t,r,o,n,i,a){e.issues.length&&(ii.has(typeof o)?r.issues.push(...Ke(o,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:n,inst:i,issues:e.issues.map(s=>Fe(s,a,be()))})),t.issues.length&&(ii.has(typeof o)?r.issues.push(...Ke(o,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:n,inst:i,key:o,issues:t.issues.map(s=>Fe(s,a,be()))})),r.value.set(e.value,t.value)}var np=v("$ZodSet",(e,t)=>{F.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!(n instanceof Set))return r.issues.push({input:n,inst:e,expected:"set",code:"invalid_type"}),r;let i=[];r.value=new Set;for(let a of n){let s=t.valueType._zod.run({value:a,issues:[]},o);s instanceof Promise?i.push(s.then(l=>Hy(l,r))):Hy(s,r)}return i.length?Promise.all(i).then(()=>r):r}});function Hy(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}var rp=v("$ZodEnum",(e,t)=>{F.init(e,t);let r=ri(t.entries),o=new Set(r);e._zod.values=o,e._zod.pattern=new RegExp(`^(${r.filter(n=>ii.has(typeof n)).map(n=>typeof n=="string"?mt(n):n.toString()).join("|")})$`),e._zod.parse=(n,i)=>{let a=n.value;return o.has(a)||n.issues.push({code:"invalid_value",values:r,input:a,inst:e}),n}}),op=v("$ZodLiteral",(e,t)=>{if(F.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(o=>typeof o=="string"?mt(o):o?mt(o.toString()):String(o)).join("|")})$`),e._zod.parse=(o,n)=>{let i=o.value;return r.has(i)||o.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),o}}),ip=v("$ZodFile",(e,t)=>{F.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return n instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:n,inst:e}),r}}),ap=v("$ZodTransform",(e,t)=>{F.init(e,t),e._zod.optin="optional",e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Cn(e.constructor.name);let n=t.transform(r.value,r);if(o.async)return(n instanceof Promise?n:Promise.resolve(n)).then(a=>(r.value=a,r.fallback=!0,r));if(n instanceof Promise)throw new wt;return r.value=n,r.fallback=!0,r}});function Zy(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var us=v("$ZodOptional",(e,t)=>{F.init(e,t),e._zod.optin="optional",e._zod.optout="optional",V(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),V(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${oi(r.source)})?$`):void 0}),e._zod.parse=(r,o)=>{if(t.innerType._zod.optin==="optional"){let n=r.value,i=t.innerType._zod.run(r,o);return i instanceof Promise?i.then(a=>Zy(a,n)):Zy(i,n)}return r.value===void 0?r:t.innerType._zod.run(r,o)}}),sp=v("$ZodExactOptional",(e,t)=>{us.init(e,t),V(e._zod,"values",()=>t.innerType._zod.values),V(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,o)=>t.innerType._zod.run(r,o)}),cp=v("$ZodNullable",(e,t)=>{F.init(e,t),V(e._zod,"optin",()=>t.innerType._zod.optin),V(e._zod,"optout",()=>t.innerType._zod.optout),V(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${oi(r.source)}|null)$`):void 0}),V(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,o)=>r.value===null?r:t.innerType._zod.run(r,o)}),lp=v("$ZodDefault",(e,t)=>{F.init(e,t),e._zod.optin="optional",V(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);if(r.value===void 0)return r.value=t.defaultValue,r;let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>Gy(i,t)):Gy(n,t)}});function Gy(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var up=v("$ZodPrefault",(e,t)=>{F.init(e,t),e._zod.optin="optional",V(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>(o.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,o))}),dp=v("$ZodNonOptional",(e,t)=>{F.init(e,t),V(e._zod,"values",()=>{let r=t.innerType._zod.values;return r?new Set([...r].filter(o=>o!==void 0)):void 0}),e._zod.parse=(r,o)=>{let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>Wy(i,e)):Wy(n,e)}});function Wy(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}var pp=v("$ZodSuccess",(e,t)=>{F.init(e,t),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Cn("ZodSuccess");let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>(r.value=i.issues.length===0,r)):(r.value=n.issues.length===0,r)}}),mp=v("$ZodCatch",(e,t)=>{F.init(e,t),e._zod.optin="optional",V(e._zod,"optout",()=>t.innerType._zod.optout),V(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>(r.value=i.value,i.issues.length&&(r.value=t.catchValue({...r,error:{issues:i.issues.map(a=>Fe(a,o,be()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=n.value,n.issues.length&&(r.value=t.catchValue({...r,error:{issues:n.issues.map(i=>Fe(i,o,be()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),fp=v("$ZodNaN",(e,t)=>{F.init(e,t),e._zod.parse=(r,o)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r)}),ds=v("$ZodPipe",(e,t)=>{F.init(e,t),V(e._zod,"values",()=>t.in._zod.values),V(e._zod,"optin",()=>t.in._zod.optin),V(e._zod,"optout",()=>t.out._zod.optout),V(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,o)=>{if(o.direction==="backward"){let i=t.out._zod.run(r,o);return i instanceof Promise?i.then(a=>rs(a,t.in,o)):rs(i,t.in,o)}let n=t.in._zod.run(r,o);return n instanceof Promise?n.then(i=>rs(i,t.out,o)):rs(n,t.out,o)}});function rs(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}var hi=v("$ZodCodec",(e,t)=>{F.init(e,t),V(e._zod,"values",()=>t.in._zod.values),V(e._zod,"optin",()=>t.in._zod.optin),V(e._zod,"optout",()=>t.out._zod.optout),V(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,o)=>{if((o.direction||"forward")==="forward"){let i=t.in._zod.run(r,o);return i instanceof Promise?i.then(a=>os(a,t,o)):os(i,t,o)}else{let i=t.out._zod.run(r,o);return i instanceof Promise?i.then(a=>os(a,t,o)):os(i,t,o)}}});function os(e,t,r){if(e.issues.length)return e.aborted=!0,e;if((r.direction||"forward")==="forward"){let n=t.transform(e.value,e);return n instanceof Promise?n.then(i=>is(e,i,t.out,r)):is(e,n,t.out,r)}else{let n=t.reverseTransform(e.value,e);return n instanceof Promise?n.then(i=>is(e,i,t.in,r)):is(e,n,t.in,r)}}function is(e,t,r,o){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:t,issues:e.issues},o)}var gp=v("$ZodPreprocess",(e,t)=>{ds.init(e,t)}),hp=v("$ZodReadonly",(e,t)=>{F.init(e,t),V(e._zod,"propValues",()=>t.innerType._zod.propValues),V(e._zod,"values",()=>t.innerType._zod.values),V(e._zod,"optin",()=>t.innerType?._zod?.optin),V(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(Vy):Vy(n)}});function Vy(e){return e.value=Object.freeze(e.value),e}var vp=v("$ZodTemplateLiteral",(e,t)=>{F.init(e,t);let r=[];for(let o of t.parts)if(typeof o=="object"&&o!==null){if(!o._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...o._zod.traits].shift()}`);let n=o._zod.pattern instanceof RegExp?o._zod.pattern.source:o._zod.pattern;if(!n)throw new Error(`Invalid template literal part: ${o._zod.traits}`);let i=n.startsWith("^")?1:0,a=n.endsWith("$")?n.length-1:n.length;r.push(n.slice(i,a))}else if(o===null||lu.has(typeof o))r.push(mt(`${o}`));else throw new Error(`Invalid template literal part: ${o}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(o,n)=>typeof o.value!="string"?(o.issues.push({input:o.value,inst:e,expected:"string",code:"invalid_type"}),o):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(o.value)||o.issues.push({input:o.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),o)}),yp=v("$ZodFunction",(e,t)=>(F.init(e,t),e._def=t,e._zod.def=t,e.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...o){let n=e._def.input?Ha(e._def.input,o):o,i=Reflect.apply(r,this,n);return e._def.output?Ha(e._def.output,i):i}},e.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...o){let n=e._def.input?await Za(e._def.input,o):o,i=await Reflect.apply(r,this,n);return e._def.output?await Za(e._def.output,i):i}},e._zod.parse=(r,o)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:e}),r):(e._def.output&&e._def.output._zod.def.type==="promise"?r.value=e.implementAsync(r.value):r.value=e.implement(r.value),r),e.input=(...r)=>{let o=e.constructor;return Array.isArray(r[0])?new o({type:"function",input:new ls({type:"tuple",items:r[0],rest:r[1]}),output:e._def.output}):new o({type:"function",input:r[0],output:e._def.output})},e.output=r=>{let o=e.constructor;return new o({type:"function",input:e._def.input,output:r})},e)),bp=v("$ZodPromise",(e,t)=>{F.init(e,t),e._zod.parse=(r,o)=>Promise.resolve(r.value).then(n=>t.innerType._zod.run({value:n,issues:[]},o))}),xp=v("$ZodLazy",(e,t)=>{F.init(e,t),V(e._zod,"innerType",()=>{let r=t;return r._cachedInner||(r._cachedInner=t.getter()),r._cachedInner}),V(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),V(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),V(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),V(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(r,o)=>e._zod.innerType._zod.run(r,o)}),kp=v("$ZodCustom",(e,t)=>{pe.init(e,t),F.init(e,t),e._zod.parse=(r,o)=>r,e._zod.check=r=>{let o=r.value,n=t.fn(o);if(n instanceof Promise)return n.then(i=>Jy(i,r,o,e));Jy(n,r,o,e)}});function Jy(e,t,r,o){if(!e){let n={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(n.params=o._zod.def.params),t.issues.push(Fr(n))}}var yi={};Jt(yi,{ar:()=>eb,az:()=>tb,be:()=>rb,bg:()=>ob,ca:()=>ib,cs:()=>ab,da:()=>sb,de:()=>cb,el:()=>lb,en:()=>ps,eo:()=>ub,es:()=>db,fa:()=>pb,fi:()=>mb,fr:()=>fb,frCA:()=>gb,he:()=>hb,hr:()=>vb,hu:()=>yb,hy:()=>xb,id:()=>kb,is:()=>wb,it:()=>Sb,ja:()=>_b,ka:()=>$b,kh:()=>Ib,km:()=>ms,ko:()=>Ab,lt:()=>Pb,mk:()=>Cb,ms:()=>Tb,nl:()=>Rb,no:()=>Ob,ota:()=>Db,pl:()=>Lb,ps:()=>Nb,pt:()=>Ub,ro:()=>zb,ru:()=>Fb,sl:()=>Bb,sv:()=>Mb,ta:()=>Hb,th:()=>Zb,tr:()=>Gb,ua:()=>Wb,uk:()=>fs,ur:()=>Vb,uz:()=>Jb,vi:()=>qb,yo:()=>Yb,zhCN:()=>Kb,zhTW:()=>Xb});var PP=()=>{let e={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function t(n){return e[n]??null}let r={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${n.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${s}`:`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${i}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${s}`}case"invalid_value":return n.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${w(n.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${n.minimum.toString()} ${a.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${n.prefix}"`:i.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${i.suffix}"`:i.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${i.includes}"`:i.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${i.pattern}`:`${r[i.format]??n.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${n.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${n.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${n.keys.length>1?"\u0629":""}: ${x(n.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}};function eb(){return{localeError:PP()}}var CP=()=>{let e={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function t(n){return e[n]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${n.expected}, daxil olan ${s}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${i}, daxil olan ${s}`}case"invalid_value":return n.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${w(n.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${i}${n.maximum.toString()} ${a.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${i}${n.minimum.toString()} ${a.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${i.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:i.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${i.suffix}" il\u0259 bitm\u0259lidir`:i.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${i.includes}" daxil olmal\u0131d\u0131r`:i.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${i.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${r[i.format]??n.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${n.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${n.keys.length>1?"lar":""}: ${x(n.keys,", ")}`;case"invalid_key":return`${n.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${n.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}};function tb(){return{localeError:CP()}}function nb(e,t,r,o){let n=Math.abs(e),i=n%10,a=n%100;return a>=11&&a<=19?o:i===1?t:i>=2&&i<=4?r:o}var TP=()=>{let e={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function t(n){return e[n]??null}let r={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},o={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${n.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${s}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${i}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${s}`}case"invalid_value":return n.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${w(n.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);if(a){let s=Number(n.maximum),l=nb(s,a.unit.one,a.unit.few,a.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${i}${n.maximum.toString()} ${l}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);if(a){let s=Number(n.minimum),l=nb(s,a.unit.one,a.unit.few,a.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${i}${n.minimum.toString()} ${l}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${n.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${x(n.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${n.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}};function rb(){return{localeError:TP()}}var RP=()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function t(n){return e[n]??null}let r={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${s}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${i}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${s}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${w(n.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${n.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${n.minimum.toString()} ${a.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${i.prefix}"`;if(i.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${i.suffix}"`;if(i.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${i.includes}"`;if(i.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${i.pattern}`;let a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return i.format==="emoji"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="datetime"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="date"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),i.format==="time"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="duration"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${a} ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${n.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u043E\u0432\u0435":""}: ${x(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${n.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}};function ob(){return{localeError:RP()}}var OP=()=>{let e={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(n){return e[n]??null}let r={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${n.expected}, s'ha rebut ${s}`:`Tipus inv\xE0lid: s'esperava ${i}, s'ha rebut ${s}`}case"invalid_value":return n.values.length===1?`Valor inv\xE0lid: s'esperava ${w(n.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${x(n.values," o ")}`;case"too_big":{let i=n.inclusive?"com a m\xE0xim":"menys de",a=t(n.origin);return a?`Massa gran: s'esperava que ${n.origin??"el valor"} contingu\xE9s ${i} ${n.maximum.toString()} ${a.unit??"elements"}`:`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"com a m\xEDnim":"m\xE9s de",a=t(n.origin);return a?`Massa petit: s'esperava que ${n.origin} contingu\xE9s ${i} ${n.minimum.toString()} ${a.unit}`:`Massa petit: s'esperava que ${n.origin} fos ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${i.prefix}"`:i.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${i.suffix}"`:i.format==="includes"?`Format inv\xE0lid: ha d'incloure "${i.includes}"`:i.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${i.pattern}`:`Format inv\xE0lid per a ${r[i.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${n.divisor}`;case"unrecognized_keys":return`Clau${n.keys.length>1?"s":""} no reconeguda${n.keys.length>1?"s":""}: ${x(n.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${n.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${n.origin}`;default:return"Entrada inv\xE0lida"}}};function ib(){return{localeError:OP()}}var DP=()=>{let e={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function t(n){return e[n]??null}let r={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"},o={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${n.expected}, obdr\u017Eeno ${s}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${i}, obdr\u017Eeno ${s}`}case"invalid_value":return n.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${w(n.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${i}${n.maximum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${i}${n.minimum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${i.prefix}"`:i.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${i.suffix}"`:i.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${i.includes}"`:i.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${i.pattern}`:`Neplatn\xFD form\xE1t ${r[i.format]??n.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${n.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${x(n.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${n.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${n.origin}`;default:return"Neplatn\xFD vstup"}}};function ab(){return{localeError:DP()}}var NP=()=>{let e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function t(n){return e[n]??null}let r={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},o={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ugyldigt input: forventede instanceof ${n.expected}, fik ${s}`:`Ugyldigt input: forventede ${i}, fik ${s}`}case"invalid_value":return n.values.length===1?`Ugyldig v\xE6rdi: forventede ${w(n.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin),s=o[n.origin]??n.origin;return a?`For stor: forventede ${s??"value"} ${a.verb} ${i} ${n.maximum.toString()} ${a.unit??"elementer"}`:`For stor: forventede ${s??"value"} havde ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin),s=o[n.origin]??n.origin;return a?`For lille: forventede ${s} ${a.verb} ${i} ${n.minimum.toString()} ${a.unit}`:`For lille: forventede ${s} havde ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ugyldig streng: skal starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: skal ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: skal indeholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${r[i.format]??n.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${x(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${n.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${n.origin}`;default:return"Ugyldigt input"}}};function sb(){return{localeError:NP()}}var LP=()=>{let e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function t(n){return e[n]??null}let r={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},o={nan:"NaN",number:"Zahl",array:"Array"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${n.expected}, erhalten ${s}`:`Ung\xFCltige Eingabe: erwartet ${i}, erhalten ${s}`}case"invalid_value":return n.values.length===1?`Ung\xFCltige Eingabe: erwartet ${w(n.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${i}${n.maximum.toString()} ${a.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${i}${n.maximum.toString()} ist`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Zu klein: erwartet, dass ${n.origin} ${i}${n.minimum.toString()} ${a.unit} hat`:`Zu klein: erwartet, dass ${n.origin} ${i}${n.minimum.toString()} ist`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ung\xFCltiger String: muss mit "${i.prefix}" beginnen`:i.format==="ends_with"?`Ung\xFCltiger String: muss mit "${i.suffix}" enden`:i.format==="includes"?`Ung\xFCltiger String: muss "${i.includes}" enthalten`:i.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${i.pattern} entsprechen`:`Ung\xFCltig: ${r[i.format]??n.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${n.divisor} sein`;case"unrecognized_keys":return`${n.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${x(n.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${n.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${n.origin}`;default:return"Ung\xFCltige Eingabe"}}};function cb(){return{localeError:LP()}}var UP=()=>{let e={string:{unit:"\u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B5\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},file:{unit:"bytes",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},array:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},set:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},map:{unit:"\u03BA\u03B1\u03C4\u03B1\u03C7\u03C9\u03C1\u03AE\u03C3\u03B5\u03B9\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"}};function t(n){return e[n]??null}let r={regex:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2",email:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BA\u03B1\u03B9 \u03CE\u03C1\u03B1",date:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1",time:"ISO \u03CE\u03C1\u03B1",duration:"ISO \u03B4\u03B9\u03AC\u03C1\u03BA\u03B5\u03B9\u03B1",ipv4:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv4",ipv6:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv6",mac:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 MAC",cidrv4:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv4",cidrv6:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv6",base64:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64",base64url:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64url",json_string:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",e164:"\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",jwt:"JWT",template_literal:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return typeof n.expected=="string"&&/^[A-Z]/.test(n.expected)?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD instanceof ${n.expected}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${s}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${i}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${s}`}case"invalid_value":return n.values.length===1?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${w(n.values[0])}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD \u03AD\u03BD\u03B1 \u03B1\u03C0\u03CC ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${i}${n.maximum.toString()} ${a.unit??"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1"}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${i}${n.minimum.toString()} ${a.unit}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03BE\u03B5\u03BA\u03B9\u03BD\u03AC \u03BC\u03B5 "${i.prefix}"`:i.format==="ends_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B5\u03BB\u03B5\u03B9\u03CE\u03BD\u03B5\u03B9 \u03BC\u03B5 "${i.suffix}"`:i.format==="includes"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C0\u03B5\u03C1\u03B9\u03AD\u03C7\u03B5\u03B9 "${i.includes}"`:i.format==="regex"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B1\u03B9\u03C1\u03B9\u03AC\u03B6\u03B5\u03B9 \u03BC\u03B5 \u03C4\u03BF \u03BC\u03BF\u03C4\u03AF\u03B2\u03BF ${i.pattern}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF: ${r[i.format]??n.format}`}case"not_multiple_of":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF\u03C2 \u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03BF\u03BB\u03BB\u03B1\u03C0\u03BB\u03AC\u03C3\u03B9\u03BF \u03C4\u03BF\u03C5 ${n.divisor}`;case"unrecognized_keys":return`\u0386\u03B3\u03BD\u03C9\u03C3\u03C4${n.keys.length>1?"\u03B1":"\u03BF"} \u03BA\u03BB\u03B5\u03B9\u03B4${n.keys.length>1?"\u03B9\u03AC":"\u03AF"}: ${x(n.keys,", ")}`;case"invalid_key":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF \u03BA\u03BB\u03B5\u03B9\u03B4\u03AF \u03C3\u03C4\u03BF ${n.origin}`;case"invalid_union":return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2";case"invalid_element":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C4\u03B9\u03BC\u03AE \u03C3\u03C4\u03BF ${n.origin}`;default:return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"}}};function lb(){return{localeError:UP()}}var zP=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(n){return e[n]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return`Invalid input: expected ${i}, received ${s}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${w(n.values[0])}`:`Invalid option: expected one of ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Too big: expected ${n.origin??"value"} to have ${i}${n.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Too small: expected ${n.origin} to have ${i}${n.minimum.toString()} ${a.unit}`:`Too small: expected ${n.origin} to be ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Invalid string: must start with "${i.prefix}"`:i.format==="ends_with"?`Invalid string: must end with "${i.suffix}"`:i.format==="includes"?`Invalid string: must include "${i.includes}"`:i.format==="regex"?`Invalid string: must match pattern ${i.pattern}`:`Invalid ${r[i.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${x(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return n.options&&Array.isArray(n.options)&&n.options.length>0?`Invalid discriminator value. Expected ${n.options.map(a=>`'${a}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}};function ps(){return{localeError:zP()}}var jP=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(n){return e[n]??null}let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},o={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${n.expected}, ricevi\u011Dis ${s}`:`Nevalida enigo: atendi\u011Dis ${i}, ricevi\u011Dis ${s}`}case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${w(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${i}${n.maximum.toString()} ${a.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Tro malgranda: atendi\u011Dis ke ${n.origin} havu ${i}${n.minimum.toString()} ${a.unit}`:`Tro malgranda: atendi\u011Dis ke ${n.origin} estu ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${i.prefix}"`:i.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${i.suffix}"`:i.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${i.includes}"`:i.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${i.pattern}`:`Nevalida ${r[i.format]??n.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${n.divisor}`;case"unrecognized_keys":return`Nekonata${n.keys.length>1?"j":""} \u015Dlosilo${n.keys.length>1?"j":""}: ${x(n.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${n.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${n.origin}`;default:return"Nevalida enigo"}}};function ub(){return{localeError:jP()}}var FP=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(n){return e[n]??null}let r={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${n.expected}, recibido ${s}`:`Entrada inv\xE1lida: se esperaba ${i}, recibido ${s}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: se esperaba ${w(n.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin),s=o[n.origin]??n.origin;return a?`Demasiado grande: se esperaba que ${s??"valor"} tuviera ${i}${n.maximum.toString()} ${a.unit??"elementos"}`:`Demasiado grande: se esperaba que ${s??"valor"} fuera ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin),s=o[n.origin]??n.origin;return a?`Demasiado peque\xF1o: se esperaba que ${s} tuviera ${i}${n.minimum.toString()} ${a.unit}`:`Demasiado peque\xF1o: se esperaba que ${s} fuera ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${i.prefix}"`:i.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${i.suffix}"`:i.format==="includes"?`Cadena inv\xE1lida: debe incluir "${i.includes}"`:i.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${i.pattern}`:`Inv\xE1lido ${r[i.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Llave${n.keys.length>1?"s":""} desconocida${n.keys.length>1?"s":""}: ${x(n.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${o[n.origin]??n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${o[n.origin]??n.origin}`;default:return"Entrada inv\xE1lida"}}};function db(){return{localeError:FP()}}var BP=()=>{let e={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function t(n){return e[n]??null}let r={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},o={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${n.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${s} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${i} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${s} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return n.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${w(n.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${x(n.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} ${a.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:i.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:i.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${i.includes}" \u0628\u0627\u0634\u062F`:i.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${i.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${r[i.format]??n.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${n.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${n.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${x(n.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${n.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${n.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}};function pb(){return{localeError:BP()}}var MP=()=>{let e={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function t(n){return e[n]??null}let r={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Virheellinen tyyppi: odotettiin instanceof ${n.expected}, oli ${s}`:`Virheellinen tyyppi: odotettiin ${i}, oli ${s}`}case"invalid_value":return n.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${w(n.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Liian suuri: ${a.subject} t\xE4ytyy olla ${i}${n.maximum.toString()} ${a.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Liian pieni: ${a.subject} t\xE4ytyy olla ${i}${n.minimum.toString()} ${a.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${i.prefix}"`:i.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${i.suffix}"`:i.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${i.includes}"`:i.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${i.pattern}`:`Virheellinen ${r[i.format]??n.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${n.divisor} monikerta`;case"unrecognized_keys":return`${n.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${x(n.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}};function mb(){return{localeError:MP()}}var HP=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(n){return e[n]??null}let r={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},o={string:"cha\xEEne",number:"nombre",int:"entier",boolean:"bool\xE9en",bigint:"grand entier",symbol:"symbole",undefined:"ind\xE9fini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"enregistrement",map:"carte",set:"ensemble",file:"fichier",nonoptional:"non-optionnel",nan:"NaN",function:"fonction"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : instanceof ${n.expected} attendu, ${s} re\xE7u`:`Entr\xE9e invalide : ${i} attendu, ${s} re\xE7u`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : ${w(n.values[0])} attendu`:`Option invalide : une valeur parmi ${x(n.values,"|")} attendue`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Trop grand : ${o[n.origin]??"valeur"} doit ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${o[n.origin]??"valeur"} doit \xEAtre ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Trop petit : ${o[n.origin]??"valeur"} doit ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Trop petit : ${o[n.origin]??"valeur"} doit \xEAtre ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${i.pattern}`:`${r[i.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${x(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}};function fb(){return{localeError:HP()}}var ZP=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(n){return e[n]??null}let r={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : attendu instanceof ${n.expected}, re\xE7u ${s}`:`Entr\xE9e invalide : attendu ${i}, re\xE7u ${s}`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : attendu ${w(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"\u2264":"<",a=t(n.origin);return a?`Trop grand : attendu que ${n.origin??"la valeur"} ait ${i}${n.maximum.toString()} ${a.unit}`:`Trop grand : attendu que ${n.origin??"la valeur"} soit ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"\u2265":">",a=t(n.origin);return a?`Trop petit : attendu que ${n.origin} ait ${i}${n.minimum.toString()} ${a.unit}`:`Trop petit : attendu que ${n.origin} soit ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${i.pattern}`:`${r[i.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${x(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}};function gb(){return{localeError:ZP()}}var GP=()=>{let e={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},t={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},r=u=>u?e[u]:void 0,o=u=>{let d=r(u);return d?d.label:u??e.unknown.label},n=u=>`\u05D4${o(u)}`,i=u=>(r(u)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",a=u=>u?t[u]??null:null,s={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},l={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let d=u.expected,p=l[d??""]??o(d),m=S(u.input),f=l[m]??e[m]?.label??m;return/^[A-Z]/.test(u.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${u.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${f}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${p}, \u05D4\u05EA\u05E7\u05D1\u05DC ${f}`}case"invalid_value":{if(u.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${w(u.values[0])}`;let d=u.values.map(f=>w(f));if(u.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${d[0]} \u05D0\u05D5 ${d[1]}`;let p=d[d.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${d.slice(0,-1).join(", ")} \u05D0\u05D5 ${p}`}case"too_big":{let d=a(u.origin),p=n(u.origin??"value");if(u.origin==="string")return`${d?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${u.maximum.toString()} ${d?.unit??""} ${u.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(u.origin==="number"){let g=u.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${u.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${u.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${g}`}if(u.origin==="array"||u.origin==="set"){let g=u.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",y=u.inclusive?`${u.maximum} ${d?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${u.maximum} ${d?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${p} ${g} \u05DC\u05D4\u05DB\u05D9\u05DC ${y}`.trim()}let m=u.inclusive?"<=":"<",f=i(u.origin??"value");return d?.unit?`${d.longLabel} \u05DE\u05D3\u05D9: ${p} ${f} ${m}${u.maximum.toString()} ${d.unit}`:`${d?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${p} ${f} ${m}${u.maximum.toString()}`}case"too_small":{let d=a(u.origin),p=n(u.origin??"value");if(u.origin==="string")return`${d?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${u.minimum.toString()} ${d?.unit??""} ${u.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(u.origin==="number"){let g=u.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${u.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${u.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${g}`}if(u.origin==="array"||u.origin==="set"){let g=u.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(u.minimum===1&&u.inclusive){let k=(u.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} ${g} \u05DC\u05D4\u05DB\u05D9\u05DC ${k}`}let y=u.inclusive?`${u.minimum} ${d?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${u.minimum} ${d?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} ${g} \u05DC\u05D4\u05DB\u05D9\u05DC ${y}`.trim()}let m=u.inclusive?">=":">",f=i(u.origin??"value");return d?.unit?`${d.shortLabel} \u05DE\u05D3\u05D9: ${p} ${f} ${m}${u.minimum.toString()} ${d.unit}`:`${d?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${p} ${f} ${m}${u.minimum.toString()}`}case"invalid_format":{let d=u;if(d.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${d.prefix}"`;if(d.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${d.suffix}"`;if(d.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${d.includes}"`;if(d.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${d.pattern}`;let p=s[d.format],m=p?.label??d.format,g=(p?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${m} \u05DC\u05D0 ${g}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${u.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${u.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${u.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${x(u.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${n(u.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function hb(){return{localeError:GP()}}var WP=()=>{let e={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function t(n){return e[n]??null}let r={regex:"unos",email:"email adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",jwt:"JWT",template_literal:"unos"},o={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Neispravan unos: o\u010Dekuje se instanceof ${n.expected}, a primljeno je ${s}`:`Neispravan unos: o\u010Dekuje se ${i}, a primljeno je ${s}`}case"invalid_value":return n.values.length===1?`Neispravna vrijednost: o\u010Dekivano ${w(n.values[0])}`:`Neispravna opcija: o\u010Dekivano jedno od ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin),s=o[n.origin]??n.origin;return a?`Preveliko: o\u010Dekivano da ${s??"vrijednost"} ima ${i}${n.maximum.toString()} ${a.unit??"elemenata"}`:`Preveliko: o\u010Dekivano da ${s??"vrijednost"} bude ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin),s=o[n.origin]??n.origin;return a?`Premalo: o\u010Dekivano da ${s} ima ${i}${n.minimum.toString()} ${a.unit}`:`Premalo: o\u010Dekivano da ${s} bude ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neispravan tekst: mora zapo\u010Dinjati s "${i.prefix}"`:i.format==="ends_with"?`Neispravan tekst: mora zavr\u0161avati s "${i.suffix}"`:i.format==="includes"?`Neispravan tekst: mora sadr\u017Eavati "${i.includes}"`:i.format==="regex"?`Neispravan tekst: mora odgovarati uzorku ${i.pattern}`:`Neispravna ${r[i.format]??n.format}`}case"not_multiple_of":return`Neispravan broj: mora biti vi\u0161ekratnik od ${n.divisor}`;case"unrecognized_keys":return`Neprepoznat${n.keys.length>1?"i klju\u010Devi":" klju\u010D"}: ${x(n.keys,", ")}`;case"invalid_key":return`Neispravan klju\u010D u ${o[n.origin]??n.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${o[n.origin]??n.origin}`;default:return"Neispravan unos"}}};function vb(){return{localeError:WP()}}var VP=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(n){return e[n]??null}let r={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"},o={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${n.expected}, a kapott \xE9rt\xE9k ${s}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${i}, a kapott \xE9rt\xE9k ${s}`}case"invalid_value":return n.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${w(n.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`T\xFAl nagy: ${n.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${i}${n.maximum.toString()} ${a.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${n.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} m\xE9rete t\xFAl kicsi ${i}${n.minimum.toString()} ${a.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} t\xFAl kicsi ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\xC9rv\xE9nytelen string: "${i.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:i.format==="ends_with"?`\xC9rv\xE9nytelen string: "${i.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:i.format==="includes"?`\xC9rv\xE9nytelen string: "${i.includes}" \xE9rt\xE9ket kell tartalmaznia`:i.format==="regex"?`\xC9rv\xE9nytelen string: ${i.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${r[i.format]??n.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${n.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${n.keys.length>1?"s":""}: ${x(n.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${n.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${n.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}};function yb(){return{localeError:VP()}}function bb(e,t,r){return Math.abs(e)===1?t:r}function Wr(e){if(!e)return"";let t=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],r=e[e.length-1];return e+(t.includes(r)?"\u0576":"\u0568")}var JP=()=>{let e={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function t(n){return e[n]??null}let r={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},o={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${n.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${s}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${i}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${s}`}case"invalid_value":return n.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${w(n.values[1])}`:`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);if(a){let s=Number(n.maximum),l=bb(s,a.unit.one,a.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Wr(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${i}${n.maximum.toString()} ${l}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Wr(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);if(a){let s=Number(n.minimum),l=bb(s,a.unit.one,a.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Wr(n.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${i}${n.minimum.toString()} ${l}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Wr(n.origin)} \u056C\u056B\u0576\u056B ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${i.prefix}"-\u0578\u057E`:i.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${i.suffix}"-\u0578\u057E`:i.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${i.includes}"`:i.format==="regex"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${i.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${r[i.format]??n.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${n.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${n.keys.length>1?"\u0576\u0565\u0580":""}. ${x(n.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${Wr(n.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${Wr(n.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}};function xb(){return{localeError:JP()}}var qP=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(n){return e[n]??null}let r={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Input tidak valid: diharapkan instanceof ${n.expected}, diterima ${s}`:`Input tidak valid: diharapkan ${i}, diterima ${s}`}case"invalid_value":return n.values.length===1?`Input tidak valid: diharapkan ${w(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${i}${n.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Terlalu kecil: diharapkan ${n.origin} memiliki ${i}${n.minimum.toString()} ${a.unit}`:`Terlalu kecil: diharapkan ${n.origin} menjadi ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`String tidak valid: harus dimulai dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak valid: harus berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak valid: harus menyertakan "${i.includes}"`:i.format==="regex"?`String tidak valid: harus sesuai pola ${i.pattern}`:`${r[i.format]??n.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${n.keys.length>1?"s":""}: ${x(n.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${n.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${n.origin}`;default:return"Input tidak valid"}}};function kb(){return{localeError:qP()}}var KP=()=>{let e={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function t(n){return e[n]??null}let r={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"},o={nan:"NaN",number:"n\xFAmer",array:"fylki"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${s} \xFEar sem \xE1 a\xF0 vera instanceof ${n.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${s} \xFEar sem \xE1 a\xF0 vera ${i}`}case"invalid_value":return n.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${w(n.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} hafi ${i}${n.maximum.toString()} ${a.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} s\xE9 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} hafi ${i}${n.minimum.toString()} ${a.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} s\xE9 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${i.prefix}"`:i.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${i.suffix}"`:i.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${i.includes}"`:i.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${i.pattern}`:`Rangt ${r[i.format]??n.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${n.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${n.keys.length>1?"ir lyklar":"ur lykill"}: ${x(n.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${n.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${n.origin}`;default:return"Rangt gildi"}}};function wb(){return{localeError:KP()}}var XP=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(n){return e[n]??null}let r={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"numero",array:"vettore"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Input non valido: atteso instanceof ${n.expected}, ricevuto ${s}`:`Input non valido: atteso ${i}, ricevuto ${s}`}case"invalid_value":return n.values.length===1?`Input non valido: atteso ${w(n.values[0])}`:`Opzione non valida: atteso uno tra ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Troppo grande: ${n.origin??"valore"} deve avere ${i}${n.maximum.toString()} ${a.unit??"elementi"}`:`Troppo grande: ${n.origin??"valore"} deve essere ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Troppo piccolo: ${n.origin} deve avere ${i}${n.minimum.toString()} ${a.unit}`:`Troppo piccolo: ${n.origin} deve essere ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Stringa non valida: deve iniziare con "${i.prefix}"`:i.format==="ends_with"?`Stringa non valida: deve terminare con "${i.suffix}"`:i.format==="includes"?`Stringa non valida: deve includere "${i.includes}"`:i.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${i.pattern}`:`Input non valido: ${r[i.format]??n.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${n.divisor}`;case"unrecognized_keys":return`Chiav${n.keys.length>1?"i":"e"} non riconosciut${n.keys.length>1?"e":"a"}: ${x(n.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${n.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${n.origin}`;default:return"Input non valido"}}};function Sb(){return{localeError:XP()}}var YP=()=>{let e={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function t(n){return e[n]??null}let r={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},o={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${n.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${s}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${i}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${s}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return n.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${w(n.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${x(n.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let i=n.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",a=t(n.origin);return a?`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${a.unit??"\u8981\u7D20"}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let i=n.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",a=t(n.origin);return a?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${a.unit}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${i.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${r[i.format]??n.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${n.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${n.keys.length>1?"\u7FA4":""}: ${x(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}};function _b(){return{localeError:YP()}}var QP=()=>{let e={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function t(n){return e[n]??null}let r={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",json_string:"JSON \u10D5\u10D4\u10DA\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},o={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10D5\u10D4\u10DA\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${n.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${s}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${s}`}case"invalid_value":return n.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${w(n.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${x(n.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} \u10D8\u10E7\u10DD\u10E1 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${i.prefix}"-\u10D8\u10D7`:i.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${i.suffix}"-\u10D8\u10D7`:i.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${i.includes}"-\u10E1`:i.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${i.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${n.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${n.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${x(n.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${n.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${n.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}};function $b(){return{localeError:QP()}}var eC=()=>{let e={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function t(n){return e[n]??null}let r={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},o={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${n.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${s}`:`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${s}`}case"invalid_value":return n.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${w(n.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${n.maximum.toString()} ${a.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${i} ${n.minimum.toString()} ${a.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${i.prefix}"`:i.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${i.suffix}"`:i.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${i.includes}"`:i.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${i.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${n.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${x(n.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}};function ms(){return{localeError:eC()}}function Ib(){return ms()}var tC=()=>{let e={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function t(n){return e[n]??null}let r={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${n.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${s}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${i}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${s}\uC785\uB2C8\uB2E4`}case"invalid_value":return n.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${w(n.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${x(n.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let i=n.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",a=i==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=t(n.origin),l=s?.unit??"\uC694\uC18C";return s?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()}${l} ${i}${a}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()} ${i}${a}`}case"too_small":{let i=n.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",a=i==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=t(n.origin),l=s?.unit??"\uC694\uC18C";return s?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()}${l} ${i}${a}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()} ${i}${a}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:i.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${i.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${r[i.format]??n.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${n.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${x(n.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${n.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${n.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}};function Ab(){return{localeError:tC()}}var vi=e=>e.charAt(0).toUpperCase()+e.slice(1);function Eb(e){let t=Math.abs(e),r=t%10,o=t%100;return o>=11&&o<=19||r===0?"many":r===1?"one":"few"}var nC=()=>{let e={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function t(n,i,a,s){let l=e[n]??null;return l===null?l:{unit:l.unit[i],verb:l.verb[s][a?"inclusive":"notInclusive"]}}let r={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},o={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Gautas tipas ${s}, o tik\u0117tasi - instanceof ${n.expected}`:`Gautas tipas ${s}, o tik\u0117tasi - ${i}`}case"invalid_value":return n.values.length===1?`Privalo b\u016Bti ${w(n.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${x(n.values,"|")} pasirinkim\u0173`;case"too_big":{let i=o[n.origin]??n.origin,a=t(n.origin,Eb(Number(n.maximum)),n.inclusive??!1,"smaller");if(a?.verb)return`${vi(i??n.origin??"reik\u0161m\u0117")} ${a.verb} ${n.maximum.toString()} ${a.unit??"element\u0173"}`;let s=n.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${vi(i??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${n.maximum.toString()} ${a?.unit}`}case"too_small":{let i=o[n.origin]??n.origin,a=t(n.origin,Eb(Number(n.minimum)),n.inclusive??!1,"bigger");if(a?.verb)return`${vi(i??n.origin??"reik\u0161m\u0117")} ${a.verb} ${n.minimum.toString()} ${a.unit??"element\u0173"}`;let s=n.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${vi(i??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${n.minimum.toString()} ${a?.unit}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${i.prefix}"`:i.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${i.suffix}"`:i.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${i.includes}"`:i.format==="regex"?`Eilut\u0117 privalo atitikti ${i.pattern}`:`Neteisingas ${r[i.format]??n.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${n.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${n.keys.length>1?"i":"as"} rakt${n.keys.length>1?"ai":"as"}: ${x(n.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let i=o[n.origin]??n.origin;return`${vi(i??n.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function Pb(){return{localeError:nC()}}var rC=()=>{let e={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function t(n){return e[n]??null}let r={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},o={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${n.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${s}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${s}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${w(n.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${i}${n.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0438\u043C\u0430 ${i}${n.minimum.toString()} ${a.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${i.pattern}`:`Invalid ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${x(n.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${n.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${n.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}};function Cb(){return{localeError:rC()}}var oC=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(n){return e[n]??null}let r={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"nombor"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Input tidak sah: dijangka instanceof ${n.expected}, diterima ${s}`:`Input tidak sah: dijangka ${i}, diterima ${s}`}case"invalid_value":return n.values.length===1?`Input tidak sah: dijangka ${w(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Terlalu besar: dijangka ${n.origin??"nilai"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Terlalu kecil: dijangka ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Terlalu kecil: dijangka ${n.origin} adalah ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`String tidak sah: mesti bermula dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak sah: mesti mengandungi "${i.includes}"`:i.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${i.pattern}`:`${r[i.format]??n.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${x(n.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${n.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${n.origin}`;default:return"Input tidak sah"}}};function Tb(){return{localeError:oC()}}var iC=()=>{let e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function t(n){return e[n]??null}let r={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},o={nan:"NaN",number:"getal"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ongeldige invoer: verwacht instanceof ${n.expected}, ontving ${s}`:`Ongeldige invoer: verwacht ${i}, ontving ${s}`}case"invalid_value":return n.values.length===1?`Ongeldige invoer: verwacht ${w(n.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin),s=n.origin==="date"?"laat":n.origin==="string"?"lang":"groot";return a?`Te ${s}: verwacht dat ${n.origin??"waarde"} ${i}${n.maximum.toString()} ${a.unit??"elementen"} ${a.verb}`:`Te ${s}: verwacht dat ${n.origin??"waarde"} ${i}${n.maximum.toString()} is`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin),s=n.origin==="date"?"vroeg":n.origin==="string"?"kort":"klein";return a?`Te ${s}: verwacht dat ${n.origin} ${i}${n.minimum.toString()} ${a.unit} ${a.verb}`:`Te ${s}: verwacht dat ${n.origin} ${i}${n.minimum.toString()} is`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ongeldige tekst: moet met "${i.prefix}" beginnen`:i.format==="ends_with"?`Ongeldige tekst: moet op "${i.suffix}" eindigen`:i.format==="includes"?`Ongeldige tekst: moet "${i.includes}" bevatten`:i.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${i.pattern}`:`Ongeldig: ${r[i.format]??n.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${n.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${n.keys.length>1?"s":""}: ${x(n.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${n.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${n.origin}`;default:return"Ongeldige invoer"}}};function Rb(){return{localeError:iC()}}var aC=()=>{let e={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function t(n){return e[n]??null}let r={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"tall",array:"liste"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ugyldig input: forventet instanceof ${n.expected}, fikk ${s}`:`Ugyldig input: forventet ${i}, fikk ${s}`}case"invalid_value":return n.values.length===1?`Ugyldig verdi: forventet ${w(n.values[0])}`:`Ugyldig valg: forventet en av ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${i}${n.maximum.toString()} ${a.unit??"elementer"}`:`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`For lite(n): forventet ${n.origin} til \xE5 ha ${i}${n.minimum.toString()} ${a.unit}`:`For lite(n): forventet ${n.origin} til \xE5 ha ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${r[i.format]??n.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${x(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${n.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${n.origin}`;default:return"Ugyldig input"}}};function Ob(){return{localeError:aC()}}var sC=()=>{let e={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function t(n){return e[n]??null}let r={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"},o={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`F\xE2sit giren: umulan instanceof ${n.expected}, al\u0131nan ${s}`:`F\xE2sit giren: umulan ${i}, al\u0131nan ${s}`}case"invalid_value":return n.values.length===1?`F\xE2sit giren: umulan ${w(n.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${i}${n.maximum.toString()} ${a.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${i}${n.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${i}${n.minimum.toString()} ${a.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${i}${n.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let i=n;return i.format==="starts_with"?`F\xE2sit metin: "${i.prefix}" ile ba\u015Flamal\u0131.`:i.format==="ends_with"?`F\xE2sit metin: "${i.suffix}" ile bitmeli.`:i.format==="includes"?`F\xE2sit metin: "${i.includes}" ihtiv\xE2 etmeli.`:i.format==="regex"?`F\xE2sit metin: ${i.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${r[i.format]??n.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${n.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${n.keys.length>1?"s":""}: ${x(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${n.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}};function Db(){return{localeError:sC()}}var cC=()=>{let e={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function t(n){return e[n]??null}let r={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},o={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${n.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${s} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${i} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${s} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return n.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${w(n.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${x(n.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} \u0648\u064A`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} ${a.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} \u0648\u064A`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:i.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:i.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${i.includes}" \u0648\u0644\u0631\u064A`:i.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${i.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${r[i.format]??n.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${n.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${n.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${x(n.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${n.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${n.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}};function Nb(){return{localeError:cC()}}var lC=()=>{let e={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function t(n){return e[n]??null}let r={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"},o={nan:"NaN",number:"liczba",array:"tablica"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${n.expected}, otrzymano ${s}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${i}, otrzymano ${s}`}case"invalid_value":return n.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${w(n.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${n.maximum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${n.minimum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${i.prefix}"`:i.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${i.suffix}"`:i.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${i.includes}"`:i.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${i.pattern}`:`Nieprawid\u0142ow(y/a/e) ${r[i.format]??n.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${n.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${n.keys.length>1?"s":""}: ${x(n.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${n.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${n.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}};function Lb(){return{localeError:lC()}}var uC=()=>{let e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(n){return e[n]??null}let r={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN",number:"n\xFAmero",null:"nulo"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Tipo inv\xE1lido: esperado instanceof ${n.expected}, recebido ${s}`:`Tipo inv\xE1lido: esperado ${i}, recebido ${s}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: esperado ${w(n.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Muito grande: esperado que ${n.origin??"valor"} tivesse ${i}${n.maximum.toString()} ${a.unit??"elementos"}`:`Muito grande: esperado que ${n.origin??"valor"} fosse ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Muito pequeno: esperado que ${n.origin} tivesse ${i}${n.minimum.toString()} ${a.unit}`:`Muito pequeno: esperado que ${n.origin} fosse ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${i.prefix}"`:i.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${i.suffix}"`:i.format==="includes"?`Texto inv\xE1lido: deve incluir "${i.includes}"`:i.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${i.pattern}`:`${r[i.format]??n.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Chave${n.keys.length>1?"s":""} desconhecida${n.keys.length>1?"s":""}: ${x(n.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${n.origin}`;default:return"Campo inv\xE1lido"}}};function Ub(){return{localeError:uC()}}var dC=()=>{let e={string:{unit:"caractere",verb:"s\u0103 aib\u0103"},file:{unit:"octe\u021Bi",verb:"s\u0103 aib\u0103"},array:{unit:"elemente",verb:"s\u0103 aib\u0103"},set:{unit:"elemente",verb:"s\u0103 aib\u0103"},map:{unit:"intr\u0103ri",verb:"s\u0103 aib\u0103"}};function t(n){return e[n]??null}let r={regex:"intrare",email:"adres\u0103 de email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"dat\u0103 \u0219i or\u0103 ISO",date:"dat\u0103 ISO",time:"or\u0103 ISO",duration:"durat\u0103 ISO",ipv4:"adres\u0103 IPv4",ipv6:"adres\u0103 IPv6",mac:"adres\u0103 MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"\u0219ir codat base64",base64url:"\u0219ir codat base64url",json_string:"\u0219ir JSON",e164:"num\u0103r E.164",jwt:"JWT",template_literal:"intrare"},o={nan:"NaN",string:"\u0219ir",number:"num\u0103r",boolean:"boolean",function:"func\u021Bie",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"num\u0103r mare",void:"void",never:"never",map:"hart\u0103",set:"set"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return`Intrare invalid\u0103: a\u0219teptat ${i}, primit ${s}`}case"invalid_value":return n.values.length===1?`Intrare invalid\u0103: a\u0219teptat ${w(n.values[0])}`:`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Prea mare: a\u0219teptat ca ${n.origin??"valoarea"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"elemente"}`:`Prea mare: a\u0219teptat ca ${n.origin??"valoarea"} s\u0103 fie ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Prea mic: a\u0219teptat ca ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Prea mic: a\u0219teptat ca ${n.origin} s\u0103 fie ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0218ir invalid: trebuie s\u0103 \xEEnceap\u0103 cu "${i.prefix}"`:i.format==="ends_with"?`\u0218ir invalid: trebuie s\u0103 se termine cu "${i.suffix}"`:i.format==="includes"?`\u0218ir invalid: trebuie s\u0103 includ\u0103 "${i.includes}"`:i.format==="regex"?`\u0218ir invalid: trebuie s\u0103 se potriveasc\u0103 cu modelul ${i.pattern}`:`Format invalid: ${r[i.format]??n.format}`}case"not_multiple_of":return`Num\u0103r invalid: trebuie s\u0103 fie multiplu de ${n.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${x(n.keys,", ")}`;case"invalid_key":return`Cheie invalid\u0103 \xEEn ${n.origin}`;case"invalid_union":return"Intrare invalid\u0103";case"invalid_element":return`Valoare invalid\u0103 \xEEn ${n.origin}`;default:return"Intrare invalid\u0103"}}};function zb(){return{localeError:dC()}}function jb(e,t,r,o){let n=Math.abs(e),i=n%10,a=n%100;return a>=11&&a<=19?o:i===1?t:i>=2&&i<=4?r:o}var pC=()=>{let e={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function t(n){return e[n]??null}let r={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${s}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${i}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${s}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${w(n.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);if(a){let s=Number(n.maximum),l=jb(s,a.unit.one,a.unit.few,a.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${n.maximum.toString()} ${l}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);if(a){let s=Number(n.minimum),l=jb(s,a.unit.one,a.unit.few,a.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${n.minimum.toString()} ${l}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${n.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0438":""}: ${x(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${n.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}};function Fb(){return{localeError:pC()}}var mC=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(n){return e[n]??null}let r={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"},o={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${n.expected}, prejeto ${s}`:`Neveljaven vnos: pri\u010Dakovano ${i}, prejeto ${s}`}case"invalid_value":return n.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${w(n.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} imelo ${i}${n.maximum.toString()} ${a.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Premajhno: pri\u010Dakovano, da bo ${n.origin} imelo ${i}${n.minimum.toString()} ${a.unit}`:`Premajhno: pri\u010Dakovano, da bo ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${i.prefix}"`:i.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${i.suffix}"`:i.format==="includes"?`Neveljaven niz: mora vsebovati "${i.includes}"`:i.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${i.pattern}`:`Neveljaven ${r[i.format]??n.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${n.divisor}`;case"unrecognized_keys":return`Neprepoznan${n.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${x(n.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${n.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${n.origin}`;default:return"Neveljaven vnos"}}};function Bb(){return{localeError:mC()}}var fC=()=>{let e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function t(n){return e[n]??null}let r={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},o={nan:"NaN",number:"antal",array:"lista"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${n.expected}, fick ${s}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${i}, fick ${s}`}case"invalid_value":return n.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${w(n.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`F\xF6r stor(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.maximum.toString()} ${a.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${n.origin??"v\xE4rdet"} att ha ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.minimum.toString()} ${a.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${i.prefix}"`:i.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${i.suffix}"`:i.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${i.includes}"`:i.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${i.pattern}"`:`Ogiltig(t) ${r[i.format]??n.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${x(n.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${n.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${n.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}};function Mb(){return{localeError:fC()}}var gC=()=>{let e={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function t(n){return e[n]??null}let r={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${n.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${s}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${s}`}case"invalid_value":return n.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${w(n.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${x(n.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${n.maximum.toString()} ${a.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${n.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${i}${n.minimum.toString()} ${a.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${i}${n.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${i.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${n.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${n.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${x(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}};function Hb(){return{localeError:gC()}}var hC=()=>{let e={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function t(n){return e[n]??null}let r={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},o={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${n.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${s}`:`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${i} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${s}`}case"invalid_value":return n.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${w(n.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",a=t(n.origin);return a?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.maximum.toString()} ${a.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",a=t(n.origin);return a?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.minimum.toString()} ${a.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${i.prefix}"`:i.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${i.suffix}"`:i.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${i.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:i.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${i.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${n.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${x(n.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}};function Zb(){return{localeError:hC()}}var vC=()=>{let e={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function t(n){return e[n]??null}let r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${n.expected}, al\u0131nan ${s}`:`Ge\xE7ersiz de\u011Fer: beklenen ${i}, al\u0131nan ${s}`}case"invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${w(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${i}${n.maximum.toString()} ${a.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${i}${n.minimum.toString()} ${a.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ge\xE7ersiz metin: "${i.prefix}" ile ba\u015Flamal\u0131`:i.format==="ends_with"?`Ge\xE7ersiz metin: "${i.suffix}" ile bitmeli`:i.format==="includes"?`Ge\xE7ersiz metin: "${i.includes}" i\xE7ermeli`:i.format==="regex"?`Ge\xE7ersiz metin: ${i.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[i.format]??n.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${n.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${n.keys.length>1?"lar":""}: ${x(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${n.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}};function Gb(){return{localeError:vC()}}var yC=()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function t(n){return e[n]??null}let r={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${n.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${s}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${i}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${s}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${w(n.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} \u0431\u0443\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0456":""}: ${x(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${n.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}};function fs(){return{localeError:yC()}}function Wb(){return fs()}var bC=()=>{let e={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function t(n){return e[n]??null}let r={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},o={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${n.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${s} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${i} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${s} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return n.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${w(n.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${x(n.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${i}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${i}${n.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u06D2 ${i}${n.minimum.toString()} ${a.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u0627 ${i}${n.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${i.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${n.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${n.keys.length>1?"\u0632":""}: ${x(n.keys,"\u060C ")}`;case"invalid_key":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}};function Vb(){return{localeError:bC()}}var xC=()=>{let e={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"},map:{unit:"yozuv",verb:"bo\u2018lishi kerak"}};function t(n){return e[n]??null}let r={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},o={nan:"NaN",number:"raqam",array:"massiv"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${n.expected}, qabul qilingan ${s}`:`Noto\u2018g\u2018ri kirish: kutilgan ${i}, qabul qilingan ${s}`}case"invalid_value":return n.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${w(n.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Juda katta: kutilgan ${n.origin??"qiymat"} ${i}${n.maximum.toString()} ${a.unit} ${a.verb}`:`Juda katta: kutilgan ${n.origin??"qiymat"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Juda kichik: kutilgan ${n.origin} ${i}${n.minimum.toString()} ${a.unit} ${a.verb}`:`Juda kichik: kutilgan ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${i.prefix}" bilan boshlanishi kerak`:i.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${i.suffix}" bilan tugashi kerak`:i.format==="includes"?`Noto\u2018g\u2018ri satr: "${i.includes}" ni o\u2018z ichiga olishi kerak`:i.format==="regex"?`Noto\u2018g\u2018ri satr: ${i.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${r[i.format]??n.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${n.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${n.keys.length>1?"lar":""}: ${x(n.keys,", ")}`;case"invalid_key":return`${n.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${n.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}};function Jb(){return{localeError:xC()}}var kC=()=>{let e={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function t(n){return e[n]??null}let r={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},o={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${n.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${s}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${i}, nh\u1EADn \u0111\u01B0\u1EE3c ${s}`}case"invalid_value":return n.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${w(n.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${i.prefix}"`:i.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${i.suffix}"`:i.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${i.includes}"`:i.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${i.pattern}`:`${r[i.format]??n.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${n.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${x(n.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}};function qb(){return{localeError:kC()}}var wC=()=>{let e={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function t(n){return e[n]??null}let r={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"},o={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${n.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${s}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${i}\uFF0C\u5B9E\u9645\u63A5\u6536 ${s}`}case"invalid_value":return n.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${w(n.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${i}${n.maximum.toString()} ${a.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${i}${n.minimum.toString()} ${a.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.prefix}" \u5F00\u5934`:i.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.suffix}" \u7ED3\u5C3E`:i.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${i.pattern}`:`\u65E0\u6548${r[i.format]??n.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${n.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${x(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${n.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}};function Kb(){return{localeError:wC()}}var SC=()=>{let e={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function t(n){return e[n]??null}let r={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${n.expected}\uFF0C\u4F46\u6536\u5230 ${s}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${i}\uFF0C\u4F46\u6536\u5230 ${s}`}case"invalid_value":return n.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${w(n.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${i}${n.maximum.toString()} ${a.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${i}${n.minimum.toString()} ${a.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.prefix}" \u958B\u982D`:i.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.suffix}" \u7D50\u5C3E`:i.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${i.pattern}`:`\u7121\u6548\u7684 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${n.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${n.keys.length>1?"\u5011":""}\uFF1A${x(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}};function Xb(){return{localeError:SC()}}var _C=()=>{let e={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function t(n){return e[n]??null}let r={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},o={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${n.expected}, \xE0m\u1ECD\u0300 a r\xED ${s}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${i}, \xE0m\u1ECD\u0300 a r\xED ${s}`}case"invalid_value":return n.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${w(n.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin??"iye"} ${a.verb} ${i}${n.maximum} ${a.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${n.maximum}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin} ${a.verb} ${i}${n.minimum} ${a.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${n.minimum}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${i.prefix}"`:i.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${i.suffix}"`:i.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${i.includes}"`:i.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${i.pattern}`:`A\u1E63\xEC\u1E63e: ${r[i.format]??n.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${n.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${x(n.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}};function Yb(){return{localeError:_C()}}var Qb,wp=Symbol("ZodOutput"),Sp=Symbol("ZodInput"),gs=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let o=r[0];return this._map.set(t,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let o={...this.get(r)??{}};delete o.id;let n={...o,...this._map.get(t)};return Object.keys(n).length?n:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function hs(){return new gs}(Qb=globalThis).__zod_globalRegistry??(Qb.__zod_globalRegistry=hs());var Ce=globalThis.__zod_globalRegistry;function _p(e,t){return new e({type:"string",...I(t)})}function $p(e,t){return new e({type:"string",coerce:!0,...I(t)})}function vs(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...I(t)})}function bi(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...I(t)})}function ys(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...I(t)})}function bs(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...I(t)})}function xs(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...I(t)})}function ks(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...I(t)})}function xi(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...I(t)})}function ws(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...I(t)})}function Ss(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...I(t)})}function _s(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...I(t)})}function $s(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...I(t)})}function Is(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...I(t)})}function As(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...I(t)})}function Es(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...I(t)})}function Ps(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...I(t)})}function Cs(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...I(t)})}function Ip(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...I(t)})}function Ts(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...I(t)})}function Rs(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...I(t)})}function Os(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...I(t)})}function Ds(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...I(t)})}function Ns(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...I(t)})}function Ls(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...I(t)})}var Ap={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function Ep(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...I(t)})}function Pp(e,t){return new e({type:"string",format:"date",check:"string_format",...I(t)})}function Cp(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...I(t)})}function Tp(e,t){return new e({type:"string",format:"duration",check:"string_format",...I(t)})}function Rp(e,t){return new e({type:"number",checks:[],...I(t)})}function Op(e,t){return new e({type:"number",coerce:!0,checks:[],...I(t)})}function Dp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...I(t)})}function Np(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...I(t)})}function Lp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...I(t)})}function Up(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...I(t)})}function zp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...I(t)})}function jp(e,t){return new e({type:"boolean",...I(t)})}function Fp(e,t){return new e({type:"boolean",coerce:!0,...I(t)})}function Bp(e,t){return new e({type:"bigint",...I(t)})}function Mp(e,t){return new e({type:"bigint",coerce:!0,...I(t)})}function Hp(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...I(t)})}function Zp(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...I(t)})}function Gp(e,t){return new e({type:"symbol",...I(t)})}function Wp(e,t){return new e({type:"undefined",...I(t)})}function Vp(e,t){return new e({type:"null",...I(t)})}function Jp(e){return new e({type:"any"})}function qp(e){return new e({type:"unknown"})}function Kp(e,t){return new e({type:"never",...I(t)})}function Xp(e,t){return new e({type:"void",...I(t)})}function Yp(e,t){return new e({type:"date",...I(t)})}function Qp(e,t){return new e({type:"date",coerce:!0,...I(t)})}function em(e,t){return new e({type:"nan",...I(t)})}function Dt(e,t){return new ts({check:"less_than",...I(t),value:e,inclusive:!1})}function ot(e,t){return new ts({check:"less_than",...I(t),value:e,inclusive:!0})}function Nt(e,t){return new ns({check:"greater_than",...I(t),value:e,inclusive:!1})}function Be(e,t){return new ns({check:"greater_than",...I(t),value:e,inclusive:!0})}function Us(e){return Nt(0,e)}function zs(e){return Dt(0,e)}function js(e){return ot(0,e)}function Fs(e){return Be(0,e)}function Nn(e,t){return new Vu({check:"multiple_of",...I(t),value:e})}function Ln(e,t){return new Ku({check:"max_size",...I(t),maximum:e})}function Lt(e,t){return new Xu({check:"min_size",...I(t),minimum:e})}function rr(e,t){return new Yu({check:"size_equals",...I(t),size:e})}function or(e,t){return new Qu({check:"max_length",...I(t),maximum:e})}function rn(e,t){return new ed({check:"min_length",...I(t),minimum:e})}function ir(e,t){return new td({check:"length_equals",...I(t),length:e})}function Vr(e,t){return new nd({check:"string_format",format:"regex",...I(t),pattern:e})}function Jr(e){return new rd({check:"string_format",format:"lowercase",...I(e)})}function qr(e){return new od({check:"string_format",format:"uppercase",...I(e)})}function Kr(e,t){return new id({check:"string_format",format:"includes",...I(t),includes:e})}function Xr(e,t){return new ad({check:"string_format",format:"starts_with",...I(t),prefix:e})}function Yr(e,t){return new sd({check:"string_format",format:"ends_with",...I(t),suffix:e})}function Bs(e,t,r){return new cd({check:"property",property:e,schema:t,...I(r)})}function Qr(e,t){return new ld({check:"mime_type",mime:e,...I(t)})}function St(e){return new ud({check:"overwrite",tx:e})}function eo(e){return St(t=>t.normalize(e))}function to(){return St(e=>e.trim())}function no(){return St(e=>e.toLowerCase())}function ro(){return St(e=>e.toUpperCase())}function oo(){return St(e=>au(e))}function tm(e,t,r){return new e({type:"array",element:t,...I(r)})}function IC(e,t,r){return new e({type:"union",options:t,...I(r)})}function AC(e,t,r){return new e({type:"union",options:t,inclusive:!1,...I(r)})}function EC(e,t,r,o){return new e({type:"union",options:r,discriminator:t,...I(o)})}function PC(e,t,r){return new e({type:"intersection",left:t,right:r})}function CC(e,t,r,o){let n=r instanceof F,i=n?o:r,a=n?r:null;return new e({type:"tuple",items:t,rest:a,...I(i)})}function TC(e,t,r,o){return new e({type:"record",keyType:t,valueType:r,...I(o)})}function RC(e,t,r,o){return new e({type:"map",keyType:t,valueType:r,...I(o)})}function OC(e,t,r){return new e({type:"set",valueType:t,...I(r)})}function DC(e,t,r){let o=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new e({type:"enum",entries:o,...I(r)})}function NC(e,t,r){return new e({type:"enum",entries:t,...I(r)})}function LC(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...I(r)})}function nm(e,t){return new e({type:"file",...I(t)})}function UC(e,t){return new e({type:"transform",transform:t})}function zC(e,t){return new e({type:"optional",innerType:t})}function jC(e,t){return new e({type:"nullable",innerType:t})}function FC(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r=="function"?r():cu(r)}})}function BC(e,t,r){return new e({type:"nonoptional",innerType:t,...I(r)})}function MC(e,t){return new e({type:"success",innerType:t})}function HC(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r=="function"?r:()=>r})}function ZC(e,t,r){return new e({type:"pipe",in:t,out:r})}function GC(e,t){return new e({type:"readonly",innerType:t})}function WC(e,t,r){return new e({type:"template_literal",parts:t,...I(r)})}function VC(e,t){return new e({type:"lazy",getter:t})}function JC(e,t){return new e({type:"promise",innerType:t})}function rm(e,t,r){let o=I(r);return o.abort??(o.abort=!0),new e({type:"custom",check:"custom",fn:t,...o})}function om(e,t,r){return new e({type:"custom",check:"custom",fn:t,...I(r)})}function im(e,t){let r=ex(o=>(o.addIssue=n=>{if(typeof n=="string")o.issues.push(Fr(n,o.value,r._zod.def));else{let i=n;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=o.value),i.inst??(i.inst=r),i.continue??(i.continue=!r._zod.def.abort),o.issues.push(Fr(i))}},e(o.value,o)),t);return r}function ex(e,t){let r=new pe({check:"custom",...I(t)});return r._zod.check=e,r}function am(e){let t=new pe({check:"describe"});return t._zod.onattach=[r=>{let o=Ce.get(r)??{};Ce.add(r,{...o,description:e})}],t._zod.check=()=>{},t}function sm(e){let t=new pe({check:"meta"});return t._zod.onattach=[r=>{let o=Ce.get(r)??{};Ce.add(r,{...o,...e})}],t._zod.check=()=>{},t}function cm(e,t){let r=I(t),o=r.truthy??["true","1","yes","on","y","enabled"],n=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(o=o.map(f=>typeof f=="string"?f.toLowerCase():f),n=n.map(f=>typeof f=="string"?f.toLowerCase():f));let i=new Set(o),a=new Set(n),s=e.Codec??hi,l=e.Boolean??fi,u=e.String??nr,d=new u({type:"string",error:r.error}),p=new l({type:"boolean",error:r.error}),m=new s({type:"pipe",in:d,out:p,transform:((f,g)=>{let y=f;return r.case!=="sensitive"&&(y=y.toLowerCase()),i.has(y)?!0:a.has(y)?!1:(g.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...a],input:g.value,inst:m,continue:!1}),{})}),reverseTransform:((f,g)=>f===!0?o[0]||"true":n[0]||"false"),error:r.error});return m}function io(e,t,r,o={}){let n=I(o),i={...I(o),check:"string_format",type:"string",format:t,fn:typeof r=="function"?r:s=>r.test(s),...n};return r instanceof RegExp&&(i.pattern=r),new e(i)}function Un(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Ce,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function oe(e,t,r={path:[],schemaPath:[]}){var o;let n=e._zod.def,i=t.seen.get(e);if(i)return i.count++,r.schemaPath.includes(e)&&(i.cycle=r.path),i.schema;let a={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,a);let s=e._zod.toJSONSchema?.();if(s)a.schema=s;else{let d={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,d);else{let m=a.schema,f=t.processors[n.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);f(e,t,m,d)}let p=e._zod.parent;p&&(a.ref||(a.ref=p),oe(p,t,d),t.seen.get(p).isParent=!0)}let l=t.metadataRegistry.get(e);return l&&Object.assign(a.schema,l),t.io==="input"&&Me(e)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&"_prefault"in a.schema&&((o=a.schema).default??(o.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function zn(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=new Map;for(let a of e.seen.entries()){let s=e.metadataRegistry.get(a[0])?.id;if(s){let l=o.get(s);if(l&&l!==a[0])throw new Error(`Duplicate schema id "${s}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(s,a[0])}}let n=a=>{let s=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let p=e.external.registry.get(a[0])?.id,m=e.external.uri??(g=>g);if(p)return{ref:m(p)};let f=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=f,{defId:f,ref:`${m("__shared")}#/${s}/${f}`}}if(a[1]===r)return{ref:"#"};let u=`#/${s}/`,d=a[1].schema.id??`__schema${e.counter++}`;return{defId:d,ref:u+d}},i=a=>{if(a[1].schema.$ref)return;let s=a[1],{ref:l,defId:u}=n(a);s.def={...s.schema},u&&(s.defId=u);let d=s.schema;for(let p in d)delete d[p];d.$ref=l};if(e.cycles==="throw")for(let a of e.seen.entries()){let s=a[1];if(s.cycle)throw new Error(`Cycle detected: #/${s.cycle?.join("/")}/<root>
|
|
236
236
|
|
|
237
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let a of e.seen.entries()){let s=a[1];if(t===a[0]){i(a);continue}if(e.external){let u=e.external.registry.get(a[0])?.id;if(t!==a[0]&&u){i(a);continue}}if(e.metadataRegistry.get(a[0])?.id){i(a);continue}if(s.cycle){i(a);continue}if(s.count>1&&e.reused==="ref"){i(a);continue}}}function jn(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=s=>{let l=e.seen.get(s);if(l.ref===null)return;let u=l.def??l.schema,d={...u},p=l.ref;if(l.ref=null,p){o(p);let f=e.seen.get(p),g=f.schema;if(g.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(g)):Object.assign(u,g),Object.assign(u,d),s._zod.parent===p)for(let k in u)k==="$ref"||k==="allOf"||k in d||delete u[k];if(g.$ref&&f.def)for(let k in u)k==="$ref"||k==="allOf"||k in f.def&&JSON.stringify(u[k])===JSON.stringify(f.def[k])&&delete u[k]}let m=s._zod.parent;if(m&&m!==p){o(m);let f=e.seen.get(m);if(f?.schema.$ref&&(u.$ref=f.schema.$ref,f.def))for(let g in u)g==="$ref"||g==="allOf"||g in f.def&&JSON.stringify(u[g])===JSON.stringify(f.def[g])&&delete u[g]}e.override({zodSchema:s,jsonSchema:u,path:l.path??[]})};for(let s of[...e.seen.entries()].reverse())o(s[0]);let n={};if(e.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let s=e.external.registry.get(t)?.id;if(!s)throw new Error("Schema is missing an `id` property");n.$id=e.external.uri(s)}Object.assign(n,r.def??r.schema);let i=e.metadataRegistry.get(t)?.id;i!==void 0&&n.id===i&&delete n.id;let a=e.external?.defs??{};for(let s of e.seen.entries()){let l=s[1];l.def&&l.defId&&(l.def.id===l.defId&&delete l.def.id,a[l.defId]=l.def)}e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?n.$defs=a:n.definitions=a);try{let s=JSON.parse(JSON.stringify(n));return Object.defineProperty(s,"~standard",{value:{...t["~standard"],jsonSchema:{input:ro(t,"input",e.processors),output:ro(t,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function Me(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return Me(o.element,r);if(o.type==="set")return Me(o.valueType,r);if(o.type==="lazy")return Me(o.getter(),r);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return Me(o.innerType,r);if(o.type==="intersection")return Me(o.left,r)||Me(o.right,r);if(o.type==="record"||o.type==="map")return Me(o.keyType,r)||Me(o.valueType,r);if(o.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Me(o.in,r)||Me(o.out,r);if(o.type==="object"){for(let n in o.shape)if(Me(o.shape[n],r))return!0;return!1}if(o.type==="union"){for(let n of o.options)if(Me(n,r))return!0;return!1}if(o.type==="tuple"){for(let n of o.items)if(Me(n,r))return!0;return!!(o.rest&&Me(o.rest,r))}return!1}var om=(e,t={})=>r=>{let o=Un({...r,processors:t});return oe(e,o),zn(o,e),jn(o,e)},ro=(e,t,r={})=>o=>{let{libraryOptions:n,target:i}=o??{},a=Un({...n??{},target:i,io:t,processors:r});return oe(e,a),zn(a,e),jn(a,e)};var FC={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},im=(e,t,r,o)=>{let n=r;n.type="string";let{minimum:i,maximum:a,format:s,patterns:l,contentEncoding:u}=e._zod.bag;if(typeof i=="number"&&(n.minLength=i),typeof a=="number"&&(n.maxLength=a),s&&(n.format=FC[s]??s,n.format===""&&delete n.format,s==="time"&&delete n.format),u&&(n.contentEncoding=u),l&&l.size>0){let d=[...l];d.length===1?n.pattern=d[0].source:d.length>1&&(n.allOf=[...d.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},am=(e,t,r,o)=>{let n=r,{minimum:i,maximum:a,format:s,multipleOf:l,exclusiveMaximum:u,exclusiveMinimum:d}=e._zod.bag;typeof s=="string"&&s.includes("int")?n.type="integer":n.type="number";let p=typeof d=="number"&&d>=(i??Number.NEGATIVE_INFINITY),m=typeof u=="number"&&u<=(a??Number.POSITIVE_INFINITY),f=t.target==="draft-04"||t.target==="openapi-3.0";p?f?(n.minimum=d,n.exclusiveMinimum=!0):n.exclusiveMinimum=d:typeof i=="number"&&(n.minimum=i),m?f?(n.maximum=u,n.exclusiveMaximum=!0):n.exclusiveMaximum=u:typeof a=="number"&&(n.maximum=a),typeof l=="number"&&(n.multipleOf=l)},sm=(e,t,r,o)=>{r.type="boolean"},cm=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},lm=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},um=(e,t,r,o)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},dm=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},pm=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},mm=(e,t,r,o)=>{r.not={}},fm=(e,t,r,o)=>{},gm=(e,t,r,o)=>{},hm=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},vm=(e,t,r,o)=>{let n=e._zod.def,i=Qo(n.entries);i.every(a=>typeof a=="number")&&(r.type="number"),i.every(a=>typeof a=="string")&&(r.type="string"),r.enum=i},ym=(e,t,r,o)=>{let n=e._zod.def,i=[];for(let a of n.values)if(a===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(a))}else i.push(a);if(i.length!==0)if(i.length===1){let a=i[0];r.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[a]:r.const=a}else i.every(a=>typeof a=="number")&&(r.type="number"),i.every(a=>typeof a=="string")&&(r.type="string"),i.every(a=>typeof a=="boolean")&&(r.type="boolean"),i.every(a=>a===null)&&(r.type="null"),r.enum=i},bm=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},xm=(e,t,r,o)=>{let n=r,i=e._zod.pattern;if(!i)throw new Error("Pattern not found in template literal");n.type="string",n.pattern=i.source},km=(e,t,r,o)=>{let n=r,i={type:"string",format:"binary",contentEncoding:"binary"},{minimum:a,maximum:s,mime:l}=e._zod.bag;a!==void 0&&(i.minLength=a),s!==void 0&&(i.maxLength=s),l?l.length===1?(i.contentMediaType=l[0],Object.assign(n,i)):(Object.assign(n,i),n.anyOf=l.map(u=>({contentMediaType:u}))):Object.assign(n,i)},wm=(e,t,r,o)=>{r.type="boolean"},Sm=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},_m=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},$m=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Im=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},Am=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},Em=(e,t,r,o)=>{let n=r,i=e._zod.def,{minimum:a,maximum:s}=e._zod.bag;typeof a=="number"&&(n.minItems=a),typeof s=="number"&&(n.maxItems=s),n.type="array",n.items=oe(i.element,t,{...o,path:[...o.path,"items"]})},Pm=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="object",n.properties={};let a=i.shape;for(let u in a)n.properties[u]=oe(a[u],t,{...o,path:[...o.path,"properties",u]});let s=new Set(Object.keys(a)),l=new Set([...s].filter(u=>{let d=i.shape[u]._zod;return t.io==="input"?d.optin===void 0:d.optout===void 0}));l.size>0&&(n.required=Array.from(l)),i.catchall?._zod.def.type==="never"?n.additionalProperties=!1:i.catchall?i.catchall&&(n.additionalProperties=oe(i.catchall,t,{...o,path:[...o.path,"additionalProperties"]})):t.io==="output"&&(n.additionalProperties=!1)},Us=(e,t,r,o)=>{let n=e._zod.def,i=n.inclusive===!1,a=n.options.map((s,l)=>oe(s,t,{...o,path:[...o.path,i?"oneOf":"anyOf",l]}));i?r.oneOf=a:r.anyOf=a},Cm=(e,t,r,o)=>{let n=e._zod.def,i=oe(n.left,t,{...o,path:[...o.path,"allOf",0]}),a=oe(n.right,t,{...o,path:[...o.path,"allOf",1]}),s=u=>"allOf"in u&&Object.keys(u).length===1,l=[...s(i)?i.allOf:[i],...s(a)?a.allOf:[a]];r.allOf=l},Tm=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="array";let a=t.target==="draft-2020-12"?"prefixItems":"items",s=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",l=i.items.map((m,f)=>oe(m,t,{...o,path:[...o.path,a,f]})),u=i.rest?oe(i.rest,t,{...o,path:[...o.path,s,...t.target==="openapi-3.0"?[i.items.length]:[]]}):null;t.target==="draft-2020-12"?(n.prefixItems=l,u&&(n.items=u)):t.target==="openapi-3.0"?(n.items={anyOf:l},u&&n.items.anyOf.push(u),n.minItems=l.length,u||(n.maxItems=l.length)):(n.items=l,u&&(n.additionalItems=u));let{minimum:d,maximum:p}=e._zod.bag;typeof d=="number"&&(n.minItems=d),typeof p=="number"&&(n.maxItems=p)},Rm=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="object";let a=i.keyType,l=a._zod.bag?.patterns;if(i.mode==="loose"&&l&&l.size>0){let d=oe(i.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});n.patternProperties={};for(let p of l)n.patternProperties[p.source]=d}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(n.propertyNames=oe(i.keyType,t,{...o,path:[...o.path,"propertyNames"]})),n.additionalProperties=oe(i.valueType,t,{...o,path:[...o.path,"additionalProperties"]});let u=a._zod.values;if(u){let d=[...u].filter(p=>typeof p=="string"||typeof p=="number");d.length>0&&(n.required=d)}},Om=(e,t,r,o)=>{let n=e._zod.def,i=oe(n.innerType,t,o),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=n.innerType,r.nullable=!0):r.anyOf=[i,{type:"null"}]},Dm=(e,t,r,o)=>{let n=e._zod.def;oe(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},Nm=(e,t,r,o)=>{let n=e._zod.def;oe(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue))},Lm=(e,t,r,o)=>{let n=e._zod.def;oe(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(n.defaultValue)))},Um=(e,t,r,o)=>{let n=e._zod.def;oe(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType;let a;try{a=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=a},zm=(e,t,r,o)=>{let n=e._zod.def,i=n.in._zod.traits.has("$ZodTransform"),a=t.io==="input"?i?n.out:n.in:n.out;oe(a,t,o);let s=t.seen.get(e);s.ref=a},jm=(e,t,r,o)=>{let n=e._zod.def;oe(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,r.readOnly=!0},Fm=(e,t,r,o)=>{let n=e._zod.def;oe(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},zs=(e,t,r,o)=>{let n=e._zod.def;oe(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},Mm=(e,t,r,o)=>{let n=e._zod.innerType;oe(n,t,o);let i=t.seen.get(e);i.ref=n},Ls={string:im,number:am,boolean:sm,bigint:cm,symbol:lm,null:um,undefined:dm,void:pm,never:mm,any:fm,unknown:gm,date:hm,enum:vm,literal:ym,nan:bm,template_literal:xm,file:km,success:wm,custom:Sm,function:_m,transform:$m,map:Im,set:Am,array:Em,object:Pm,union:Us,intersection:Cm,tuple:Tm,record:Rm,nullable:Om,nonoptional:Dm,default:Nm,prefault:Lm,catch:Um,pipe:zm,readonly:jm,promise:Fm,optional:zs,lazy:Mm};function js(e,t){if("_idmap"in e){let o=e,n=Un({...t,processors:Ls}),i={};for(let l of o._idmap.entries()){let[u,d]=l;oe(d,n)}let a={},s={registry:o,uri:t?.uri,defs:i};n.external=s;for(let l of o._idmap.entries()){let[u,d]=l;zn(n,d),a[u]=jn(n,d)}if(Object.keys(i).length>0){let l=n.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[l]:i}}return{schemas:a}}let r=Un({...t,processors:Ls});return oe(e,r),zn(r,e),jn(r,e)}var Fs=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let r=t?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=Un({processors:Ls,target:r,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,r={path:[],schemaPath:[]}){return oe(t,this.ctx,r)}emit(t,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),zn(this.ctx,t);let o=jn(this.ctx,t),{"~standard":n,...i}=o;return i}};var Jb={};var vi={};Jt(vi,{ZodAny:()=>pf,ZodArray:()=>hf,ZodBase64:()=>sc,ZodBase64URL:()=>cc,ZodBigInt:()=>po,ZodBigIntFormat:()=>dc,ZodBoolean:()=>uo,ZodCIDRv4:()=>ic,ZodCIDRv6:()=>ac,ZodCUID:()=>Ys,ZodCUID2:()=>Qs,ZodCatch:()=>zf,ZodCodec:()=>Pi,ZodCustom:()=>Ci,ZodCustomStringFormat:()=>co,ZodDate:()=>_i,ZodDefault:()=>Rf,ZodDiscriminatedUnion:()=>yf,ZodE164:()=>lc,ZodEmail:()=>qs,ZodEmoji:()=>Ks,ZodEnum:()=>ao,ZodExactOptional:()=>Pf,ZodFile:()=>Af,ZodFunction:()=>Jf,ZodGUID:()=>bi,ZodIPv4:()=>rc,ZodIPv6:()=>oc,ZodIntersection:()=>bf,ZodJWT:()=>uc,ZodKSUID:()=>nc,ZodLazy:()=>Gf,ZodLiteral:()=>If,ZodMAC:()=>of,ZodMap:()=>_f,ZodNaN:()=>Ff,ZodNanoID:()=>Xs,ZodNever:()=>ff,ZodNonOptional:()=>vc,ZodNull:()=>uf,ZodNullable:()=>Tf,ZodNumber:()=>lo,ZodNumberFormat:()=>ir,ZodObject:()=>Ii,ZodOptional:()=>hc,ZodPipe:()=>Ei,ZodPrefault:()=>Df,ZodPreprocess:()=>Mf,ZodPromise:()=>Vf,ZodReadonly:()=>Bf,ZodRecord:()=>io,ZodSet:()=>$f,ZodString:()=>so,ZodStringFormat:()=>ce,ZodSuccess:()=>Uf,ZodSymbol:()=>cf,ZodTemplateLiteral:()=>Zf,ZodTransform:()=>Ef,ZodTuple:()=>kf,ZodType:()=>B,ZodULID:()=>ec,ZodURL:()=>Si,ZodUUID:()=>Ut,ZodUndefined:()=>lf,ZodUnion:()=>Ai,ZodUnknown:()=>mf,ZodVoid:()=>gf,ZodXID:()=>tc,ZodXor:()=>vf,_ZodString:()=>Js,_default:()=>Of,_function:()=>rk,any:()=>Dx,array:()=>$i,base64:()=>vx,base64url:()=>yx,bigint:()=>Px,boolean:()=>sf,catch:()=>jf,check:()=>ok,cidrv4:()=>gx,cidrv6:()=>hx,codec:()=>Qx,cuid:()=>sx,cuid2:()=>cx,custom:()=>ik,date:()=>Lx,describe:()=>ak,discriminatedUnion:()=>Bx,e164:()=>bx,email:()=>Xb,emoji:()=>ix,enum:()=>fc,exactOptional:()=>Cf,file:()=>qx,float32:()=>$x,float64:()=>Ix,function:()=>rk,guid:()=>Yb,hash:()=>_x,hex:()=>Sx,hostname:()=>wx,httpUrl:()=>ox,instanceof:()=>ck,int:()=>Ws,int32:()=>Ax,int64:()=>Cx,intersection:()=>xf,invertCodec:()=>ek,ipv4:()=>px,ipv6:()=>fx,json:()=>uk,jwt:()=>xx,keyof:()=>Ux,ksuid:()=>dx,lazy:()=>Wf,literal:()=>Jx,looseObject:()=>Fx,looseRecord:()=>Zx,mac:()=>mx,map:()=>Gx,meta:()=>sk,nan:()=>Yx,nanoid:()=>ax,nativeEnum:()=>Vx,never:()=>pc,nonoptional:()=>Lf,null:()=>df,nullable:()=>ki,nullish:()=>Kx,number:()=>af,object:()=>zx,optional:()=>xi,partialRecord:()=>Hx,pipe:()=>Vs,prefault:()=>Nf,preprocess:()=>dk,promise:()=>nk,readonly:()=>Hf,record:()=>Sf,refine:()=>qf,set:()=>Wx,strictObject:()=>jx,string:()=>yi,stringFormat:()=>kx,stringbool:()=>lk,success:()=>Xx,superRefine:()=>Kf,symbol:()=>Rx,templateLiteral:()=>tk,transform:()=>gc,tuple:()=>wf,uint32:()=>Ex,uint64:()=>Tx,ulid:()=>lx,undefined:()=>Ox,union:()=>mc,unknown:()=>or,url:()=>rx,uuid:()=>Qb,uuidv4:()=>ex,uuidv6:()=>tx,uuidv7:()=>nx,void:()=>Nx,xid:()=>ux,xor:()=>Mx});var Ms={};Jt(Ms,{endsWith:()=>qr,gt:()=>Nt,gte:()=>Fe,includes:()=>Vr,length:()=>rr,lowercase:()=>Gr,lt:()=>Dt,lte:()=>ot,maxLength:()=>nr,maxSize:()=>Ln,mime:()=>Kr,minLength:()=>nn,minSize:()=>Lt,multipleOf:()=>Nn,negative:()=>Rs,nonnegative:()=>Ds,nonpositive:()=>Os,normalize:()=>Xr,overwrite:()=>St,positive:()=>Ts,property:()=>Ns,regex:()=>Zr,size:()=>tr,slugify:()=>to,startsWith:()=>Jr,toLowerCase:()=>Qr,toUpperCase:()=>eo,trim:()=>Yr,uppercase:()=>Wr});var oo={};Jt(oo,{ZodISODate:()=>Hs,ZodISODateTime:()=>Bs,ZodISODuration:()=>Gs,ZodISOTime:()=>Zs,date:()=>Hm,datetime:()=>Bm,duration:()=>Gm,time:()=>Zm});var Bs=v("ZodISODateTime",(e,t)=>{bd.init(e,t),ce.init(e,t)});function Bm(e){return Sp(Bs,e)}var Hs=v("ZodISODate",(e,t)=>{xd.init(e,t),ce.init(e,t)});function Hm(e){return _p(Hs,e)}var Zs=v("ZodISOTime",(e,t)=>{kd.init(e,t),ce.init(e,t)});function Zm(e){return $p(Zs,e)}var Gs=v("ZodISODuration",(e,t)=>{wd.init(e,t),ce.init(e,t)});function Gm(e){return Ip(Gs,e)}var qb=(e,t)=>{oi.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>ai(e,r)},flatten:{value:r=>ii(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,Nr,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,Nr,2)}},isEmpty:{get(){return e.issues.length===0}}})},BC=v("ZodError",qb),Xe=v("ZodError",qb,{Parent:Error});var Wm=zr(Xe),Vm=jr(Xe),Jm=Fr(Xe),qm=Mr(Xe),Km=ja(Xe),Xm=Fa(Xe),Ym=Ma(Xe),Qm=Ba(Xe),ef=Ha(Xe),tf=Za(Xe),nf=Ga(Xe),rf=Wa(Xe);var Kb=new WeakMap;function wi(e,t,r){let o=Object.getPrototypeOf(e),n=Kb.get(o);if(n||(n=new Set,Kb.set(o,n)),!n.has(t)){n.add(t);for(let i in r){let a=r[i];Object.defineProperty(o,i,{configurable:!0,enumerable:!1,get(){let s=a.bind(this);return Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:s}),s},set(s){Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:s})}})}}}var B=v("ZodType",(e,t)=>(F.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:ro(e,"input"),output:ro(e,"output")}}),e.toJSONSchema=om(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(r,o)=>Wm(e,r,o,{callee:e.parse}),e.safeParse=(r,o)=>Jm(e,r,o),e.parseAsync=async(r,o)=>Vm(e,r,o,{callee:e.parseAsync}),e.safeParseAsync=async(r,o)=>qm(e,r,o),e.spa=e.safeParseAsync,e.encode=(r,o)=>Km(e,r,o),e.decode=(r,o)=>Xm(e,r,o),e.encodeAsync=async(r,o)=>Ym(e,r,o),e.decodeAsync=async(r,o)=>Qm(e,r,o),e.safeEncode=(r,o)=>ef(e,r,o),e.safeDecode=(r,o)=>tf(e,r,o),e.safeEncodeAsync=async(r,o)=>nf(e,r,o),e.safeDecodeAsync=async(r,o)=>rf(e,r,o),wi(e,"ZodType",{check(...r){let o=this.def;return this.clone($.mergeDefs(o,{checks:[...o.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,o){return ze(this,r,o)},brand(){return this},register(r,o){return r.add(this,o),this},refine(r,o){return this.check(qf(r,o))},superRefine(r,o){return this.check(Kf(r,o))},overwrite(r){return this.check(St(r))},optional(){return xi(this)},exactOptional(){return Cf(this)},nullable(){return ki(this)},nullish(){return xi(ki(this))},nonoptional(r){return Lf(this,r)},array(){return $i(this)},or(r){return mc([this,r])},and(r){return xf(this,r)},transform(r){return Vs(this,gc(r))},default(r){return Of(this,r)},prefault(r){return Nf(this,r)},catch(r){return jf(this,r)},pipe(r){return Vs(this,r)},readonly(){return Hf(this)},describe(r){let o=this.clone();return Ce.add(o,{description:r}),o},meta(...r){if(r.length===0)return Ce.get(this);let o=this.clone();return Ce.add(o,r[0]),o},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(e,"description",{get(){return Ce.get(e)?.description},configurable:!0}),e)),Js=v("_ZodString",(e,t)=>{er.init(e,t),B.init(e,t),e._zod.processJSONSchema=(o,n,i)=>im(e,o,n,i);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,wi(e,"_ZodString",{regex(...o){return this.check(Zr(...o))},includes(...o){return this.check(Vr(...o))},startsWith(...o){return this.check(Jr(...o))},endsWith(...o){return this.check(qr(...o))},min(...o){return this.check(nn(...o))},max(...o){return this.check(nr(...o))},length(...o){return this.check(rr(...o))},nonempty(...o){return this.check(nn(1,...o))},lowercase(o){return this.check(Gr(o))},uppercase(o){return this.check(Wr(o))},trim(){return this.check(Yr())},normalize(...o){return this.check(Xr(...o))},toLowerCase(){return this.check(Qr())},toUpperCase(){return this.check(eo())},slugify(){return this.check(to())}})}),so=v("ZodString",(e,t)=>{er.init(e,t),Js.init(e,t),e.email=r=>e.check(ds(qs,r)),e.url=r=>e.check(hi(Si,r)),e.jwt=r=>e.check(Cs(uc,r)),e.emoji=r=>e.check(hs(Ks,r)),e.guid=r=>e.check(gi(bi,r)),e.uuid=r=>e.check(ps(Ut,r)),e.uuidv4=r=>e.check(ms(Ut,r)),e.uuidv6=r=>e.check(fs(Ut,r)),e.uuidv7=r=>e.check(gs(Ut,r)),e.nanoid=r=>e.check(vs(Xs,r)),e.guid=r=>e.check(gi(bi,r)),e.cuid=r=>e.check(ys(Ys,r)),e.cuid2=r=>e.check(bs(Qs,r)),e.ulid=r=>e.check(xs(ec,r)),e.base64=r=>e.check(As(sc,r)),e.base64url=r=>e.check(Es(cc,r)),e.xid=r=>e.check(ks(tc,r)),e.ksuid=r=>e.check(ws(nc,r)),e.ipv4=r=>e.check(Ss(rc,r)),e.ipv6=r=>e.check(_s(oc,r)),e.cidrv4=r=>e.check($s(ic,r)),e.cidrv6=r=>e.check(Is(ac,r)),e.e164=r=>e.check(Ps(lc,r)),e.datetime=r=>e.check(Bm(r)),e.date=r=>e.check(Hm(r)),e.time=r=>e.check(Zm(r)),e.duration=r=>e.check(Gm(r))});function yi(e){return bp(so,e)}var ce=v("ZodStringFormat",(e,t)=>{se.init(e,t),Js.init(e,t)}),qs=v("ZodEmail",(e,t)=>{ud.init(e,t),ce.init(e,t)});function Xb(e){return ds(qs,e)}var bi=v("ZodGUID",(e,t)=>{cd.init(e,t),ce.init(e,t)});function Yb(e){return gi(bi,e)}var Ut=v("ZodUUID",(e,t)=>{ld.init(e,t),ce.init(e,t)});function Qb(e){return ps(Ut,e)}function ex(e){return ms(Ut,e)}function tx(e){return fs(Ut,e)}function nx(e){return gs(Ut,e)}var Si=v("ZodURL",(e,t)=>{dd.init(e,t),ce.init(e,t)});function rx(e){return hi(Si,e)}function ox(e){return hi(Si,{protocol:rt.httpProtocol,hostname:rt.domain,...$.normalizeParams(e)})}var Ks=v("ZodEmoji",(e,t)=>{pd.init(e,t),ce.init(e,t)});function ix(e){return hs(Ks,e)}var Xs=v("ZodNanoID",(e,t)=>{md.init(e,t),ce.init(e,t)});function ax(e){return vs(Xs,e)}var Ys=v("ZodCUID",(e,t)=>{fd.init(e,t),ce.init(e,t)});function sx(e){return ys(Ys,e)}var Qs=v("ZodCUID2",(e,t)=>{gd.init(e,t),ce.init(e,t)});function cx(e){return bs(Qs,e)}var ec=v("ZodULID",(e,t)=>{hd.init(e,t),ce.init(e,t)});function lx(e){return xs(ec,e)}var tc=v("ZodXID",(e,t)=>{vd.init(e,t),ce.init(e,t)});function ux(e){return ks(tc,e)}var nc=v("ZodKSUID",(e,t)=>{yd.init(e,t),ce.init(e,t)});function dx(e){return ws(nc,e)}var rc=v("ZodIPv4",(e,t)=>{Sd.init(e,t),ce.init(e,t)});function px(e){return Ss(rc,e)}var of=v("ZodMAC",(e,t)=>{$d.init(e,t),ce.init(e,t)});function mx(e){return kp(of,e)}var oc=v("ZodIPv6",(e,t)=>{_d.init(e,t),ce.init(e,t)});function fx(e){return _s(oc,e)}var ic=v("ZodCIDRv4",(e,t)=>{Id.init(e,t),ce.init(e,t)});function gx(e){return $s(ic,e)}var ac=v("ZodCIDRv6",(e,t)=>{Ad.init(e,t),ce.init(e,t)});function hx(e){return Is(ac,e)}var sc=v("ZodBase64",(e,t)=>{Pd.init(e,t),ce.init(e,t)});function vx(e){return As(sc,e)}var cc=v("ZodBase64URL",(e,t)=>{Cd.init(e,t),ce.init(e,t)});function yx(e){return Es(cc,e)}var lc=v("ZodE164",(e,t)=>{Td.init(e,t),ce.init(e,t)});function bx(e){return Ps(lc,e)}var uc=v("ZodJWT",(e,t)=>{Rd.init(e,t),ce.init(e,t)});function xx(e){return Cs(uc,e)}var co=v("ZodCustomStringFormat",(e,t)=>{Od.init(e,t),ce.init(e,t)});function kx(e,t,r={}){return no(co,e,t,r)}function wx(e){return no(co,"hostname",rt.hostname,e)}function Sx(e){return no(co,"hex",rt.hex,e)}function _x(e,t){let r=t?.enc??"hex",o=`${e}_${r}`,n=rt[o];if(!n)throw new Error(`Unrecognized hash format: ${o}`);return no(co,o,n,t)}var lo=v("ZodNumber",(e,t)=>{ts.init(e,t),B.init(e,t),e._zod.processJSONSchema=(o,n,i)=>am(e,o,n,i),wi(e,"ZodNumber",{gt(o,n){return this.check(Nt(o,n))},gte(o,n){return this.check(Fe(o,n))},min(o,n){return this.check(Fe(o,n))},lt(o,n){return this.check(Dt(o,n))},lte(o,n){return this.check(ot(o,n))},max(o,n){return this.check(ot(o,n))},int(o){return this.check(Ws(o))},safe(o){return this.check(Ws(o))},positive(o){return this.check(Nt(0,o))},nonnegative(o){return this.check(Fe(0,o))},negative(o){return this.check(Dt(0,o))},nonpositive(o){return this.check(ot(0,o))},multipleOf(o,n){return this.check(Nn(o,n))},step(o,n){return this.check(Nn(o,n))},finite(){return this}});let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function af(e){return Ap(lo,e)}var ir=v("ZodNumberFormat",(e,t)=>{Dd.init(e,t),lo.init(e,t)});function Ws(e){return Pp(ir,e)}function $x(e){return Cp(ir,e)}function Ix(e){return Tp(ir,e)}function Ax(e){return Rp(ir,e)}function Ex(e){return Op(ir,e)}var uo=v("ZodBoolean",(e,t)=>{ui.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>sm(e,r,o,n)});function sf(e){return Dp(uo,e)}var po=v("ZodBigInt",(e,t)=>{ns.init(e,t),B.init(e,t),e._zod.processJSONSchema=(o,n,i)=>cm(e,o,n,i),e.gte=(o,n)=>e.check(Fe(o,n)),e.min=(o,n)=>e.check(Fe(o,n)),e.gt=(o,n)=>e.check(Nt(o,n)),e.gte=(o,n)=>e.check(Fe(o,n)),e.min=(o,n)=>e.check(Fe(o,n)),e.lt=(o,n)=>e.check(Dt(o,n)),e.lte=(o,n)=>e.check(ot(o,n)),e.max=(o,n)=>e.check(ot(o,n)),e.positive=o=>e.check(Nt(BigInt(0),o)),e.negative=o=>e.check(Dt(BigInt(0),o)),e.nonpositive=o=>e.check(ot(BigInt(0),o)),e.nonnegative=o=>e.check(Fe(BigInt(0),o)),e.multipleOf=(o,n)=>e.check(Nn(o,n));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});function Px(e){return Lp(po,e)}var dc=v("ZodBigIntFormat",(e,t)=>{Nd.init(e,t),po.init(e,t)});function Cx(e){return zp(dc,e)}function Tx(e){return jp(dc,e)}var cf=v("ZodSymbol",(e,t)=>{Ld.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>lm(e,r,o,n)});function Rx(e){return Fp(cf,e)}var lf=v("ZodUndefined",(e,t)=>{Ud.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>dm(e,r,o,n)});function Ox(e){return Mp(lf,e)}var uf=v("ZodNull",(e,t)=>{zd.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>um(e,r,o,n)});function df(e){return Bp(uf,e)}var pf=v("ZodAny",(e,t)=>{jd.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>fm(e,r,o,n)});function Dx(){return Hp(pf)}var mf=v("ZodUnknown",(e,t)=>{Fd.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>gm(e,r,o,n)});function or(){return Zp(mf)}var ff=v("ZodNever",(e,t)=>{Md.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>mm(e,r,o,n)});function pc(e){return Gp(ff,e)}var gf=v("ZodVoid",(e,t)=>{Bd.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>pm(e,r,o,n)});function Nx(e){return Wp(gf,e)}var _i=v("ZodDate",(e,t)=>{Hd.init(e,t),B.init(e,t),e._zod.processJSONSchema=(o,n,i)=>hm(e,o,n,i),e.min=(o,n)=>e.check(Fe(o,n)),e.max=(o,n)=>e.check(ot(o,n));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});function Lx(e){return Vp(_i,e)}var hf=v("ZodArray",(e,t)=>{Zd.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Em(e,r,o,n),e.element=t.element,wi(e,"ZodArray",{min(r,o){return this.check(nn(r,o))},nonempty(r){return this.check(nn(1,r))},max(r,o){return this.check(nr(r,o))},length(r,o){return this.check(rr(r,o))},unwrap(){return this.element}})});function $i(e,t){return Kp(hf,e,t)}function Ux(e){let t=e._zod.def.shape;return fc(Object.keys(t))}var Ii=v("ZodObject",(e,t)=>{Gd.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Pm(e,r,o,n),$.defineLazy(e,"shape",()=>t.shape),wi(e,"ZodObject",{keyof(){return fc(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:or()})},loose(){return this.clone({...this._zod.def,catchall:or()})},strict(){return this.clone({...this._zod.def,catchall:pc()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return $.extend(this,r)},safeExtend(r){return $.safeExtend(this,r)},merge(r){return $.merge(this,r)},pick(r){return $.pick(this,r)},omit(r){return $.omit(this,r)},partial(...r){return $.partial(hc,this,r[0])},required(...r){return $.required(vc,this,r[0])}})});function zx(e,t){let r={type:"object",shape:e??{},...$.normalizeParams(t)};return new Ii(r)}function jx(e,t){return new Ii({type:"object",shape:e,catchall:pc(),...$.normalizeParams(t)})}function Fx(e,t){return new Ii({type:"object",shape:e,catchall:or(),...$.normalizeParams(t)})}var Ai=v("ZodUnion",(e,t)=>{di.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Us(e,r,o,n),e.options=t.options});function mc(e,t){return new Ai({type:"union",options:e,...$.normalizeParams(t)})}var vf=v("ZodXor",(e,t)=>{Ai.init(e,t),Wd.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Us(e,r,o,n),e.options=t.options});function Mx(e,t){return new vf({type:"union",options:e,inclusive:!1,...$.normalizeParams(t)})}var yf=v("ZodDiscriminatedUnion",(e,t)=>{Ai.init(e,t),Vd.init(e,t)});function Bx(e,t,r){return new yf({type:"union",options:t,discriminator:e,...$.normalizeParams(r)})}var bf=v("ZodIntersection",(e,t)=>{Jd.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Cm(e,r,o,n)});function xf(e,t){return new bf({type:"intersection",left:e,right:t})}var kf=v("ZodTuple",(e,t)=>{rs.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Tm(e,r,o,n),e.rest=r=>e.clone({...e._zod.def,rest:r})});function wf(e,t,r){let o=t instanceof F,n=o?r:t,i=o?t:null;return new kf({type:"tuple",items:e,rest:i,...$.normalizeParams(n)})}var io=v("ZodRecord",(e,t)=>{qd.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Rm(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType});function Sf(e,t,r){return!t||!t._zod?new io({type:"record",keyType:yi(),valueType:e,...$.normalizeParams(t)}):new io({type:"record",keyType:e,valueType:t,...$.normalizeParams(r)})}function Hx(e,t,r){let o=ze(e);return o._zod.values=void 0,new io({type:"record",keyType:o,valueType:t,...$.normalizeParams(r)})}function Zx(e,t,r){return new io({type:"record",keyType:e,valueType:t,mode:"loose",...$.normalizeParams(r)})}var _f=v("ZodMap",(e,t)=>{Kd.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Im(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...r)=>e.check(Lt(...r)),e.nonempty=r=>e.check(Lt(1,r)),e.max=(...r)=>e.check(Ln(...r)),e.size=(...r)=>e.check(tr(...r))});function Gx(e,t,r){return new _f({type:"map",keyType:e,valueType:t,...$.normalizeParams(r)})}var $f=v("ZodSet",(e,t)=>{Xd.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Am(e,r,o,n),e.min=(...r)=>e.check(Lt(...r)),e.nonempty=r=>e.check(Lt(1,r)),e.max=(...r)=>e.check(Ln(...r)),e.size=(...r)=>e.check(tr(...r))});function Wx(e,t){return new $f({type:"set",valueType:e,...$.normalizeParams(t)})}var ao=v("ZodEnum",(e,t)=>{Yd.init(e,t),B.init(e,t),e._zod.processJSONSchema=(o,n,i)=>vm(e,o,n,i),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(o,n)=>{let i={};for(let a of o)if(r.has(a))i[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new ao({...t,checks:[],...$.normalizeParams(n),entries:i})},e.exclude=(o,n)=>{let i={...t.entries};for(let a of o)if(r.has(a))delete i[a];else throw new Error(`Key ${a} not found in enum`);return new ao({...t,checks:[],...$.normalizeParams(n),entries:i})}});function fc(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new ao({type:"enum",entries:r,...$.normalizeParams(t)})}function Vx(e,t){return new ao({type:"enum",entries:e,...$.normalizeParams(t)})}var If=v("ZodLiteral",(e,t)=>{Qd.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ym(e,r,o,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Jx(e,t){return new If({type:"literal",values:Array.isArray(e)?e:[e],...$.normalizeParams(t)})}var Af=v("ZodFile",(e,t)=>{ep.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>km(e,r,o,n),e.min=(r,o)=>e.check(Lt(r,o)),e.max=(r,o)=>e.check(Ln(r,o)),e.mime=(r,o)=>e.check(Kr(Array.isArray(r)?r:[r],o))});function qx(e){return Xp(Af,e)}var Ef=v("ZodTransform",(e,t)=>{tp.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>$m(e,r,o,n),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Cn(e.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push($.issue(i,r.value,t));else{let a=i;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=e),r.issues.push($.issue(a))}};let n=t.transform(r.value,r);return n instanceof Promise?n.then(i=>(r.value=i,r.fallback=!0,r)):(r.value=n,r.fallback=!0,r)}});function gc(e){return new Ef({type:"transform",transform:e})}var hc=v("ZodOptional",(e,t)=>{os.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>zs(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function xi(e){return new hc({type:"optional",innerType:e})}var Pf=v("ZodExactOptional",(e,t)=>{np.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>zs(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Cf(e){return new Pf({type:"optional",innerType:e})}var Tf=v("ZodNullable",(e,t)=>{rp.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Om(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function ki(e){return new Tf({type:"nullable",innerType:e})}function Kx(e){return xi(ki(e))}var Rf=v("ZodDefault",(e,t)=>{op.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Nm(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Of(e,t){return new Rf({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():$.shallowClone(t)}})}var Df=v("ZodPrefault",(e,t)=>{ip.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Lm(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Nf(e,t){return new Df({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():$.shallowClone(t)}})}var vc=v("ZodNonOptional",(e,t)=>{ap.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Dm(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Lf(e,t){return new vc({type:"nonoptional",innerType:e,...$.normalizeParams(t)})}var Uf=v("ZodSuccess",(e,t)=>{sp.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>wm(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Xx(e){return new Uf({type:"success",innerType:e})}var zf=v("ZodCatch",(e,t)=>{cp.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Um(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function jf(e,t){return new zf({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}var Ff=v("ZodNaN",(e,t)=>{lp.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>bm(e,r,o,n)});function Yx(e){return qp(Ff,e)}var Ei=v("ZodPipe",(e,t)=>{is.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>zm(e,r,o,n),e.in=t.in,e.out=t.out});function Vs(e,t){return new Ei({type:"pipe",in:e,out:t})}var Pi=v("ZodCodec",(e,t)=>{Ei.init(e,t),pi.init(e,t)});function Qx(e,t,r){return new Pi({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}function ek(e){let t=e._zod.def;return new Pi({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}var Mf=v("ZodPreprocess",(e,t)=>{Ei.init(e,t),up.init(e,t)}),Bf=v("ZodReadonly",(e,t)=>{dp.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>jm(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Hf(e){return new Bf({type:"readonly",innerType:e})}var Zf=v("ZodTemplateLiteral",(e,t)=>{pp.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>xm(e,r,o,n)});function tk(e,t){return new Zf({type:"template_literal",parts:e,...$.normalizeParams(t)})}var Gf=v("ZodLazy",(e,t)=>{gp.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Mm(e,r,o,n),e.unwrap=()=>e._zod.def.getter()});function Wf(e){return new Gf({type:"lazy",getter:e})}var Vf=v("ZodPromise",(e,t)=>{fp.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Fm(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function nk(e){return new Vf({type:"promise",innerType:e})}var Jf=v("ZodFunction",(e,t)=>{mp.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>_m(e,r,o,n)});function rk(e){return new Jf({type:"function",input:Array.isArray(e?.input)?wf(e?.input):e?.input??$i(or()),output:e?.output??or()})}var Ci=v("ZodCustom",(e,t)=>{hp.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Sm(e,r,o,n)});function ok(e){let t=new de({check:"custom"});return t._zod.check=e,t}function ik(e,t){return Yp(Ci,e??(()=>!0),t)}function qf(e,t={}){return Qp(Ci,e,t)}function Kf(e,t){return em(e,t)}var ak=tm,sk=nm;function ck(e,t={}){let r=new Ci({type:"custom",check:"custom",fn:o=>o instanceof e,abort:!0,...$.normalizeParams(t)});return r._zod.bag.Class=e,r._zod.check=o=>{o.value instanceof e||o.issues.push({code:"invalid_type",expected:e.name,input:o.value,inst:r,path:[...r._zod.def.path??[]]})},r}var lk=(...e)=>rm({Codec:Pi,Boolean:uo,String:so},...e);function uk(e){let t=Wf(()=>mc([yi(e),af(),sf(),df(),$i(t),Sf(yi(),t)]));return t}function dk(e,t){return new Mf({type:"pipe",in:gc(e),out:t})}var ZC={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function GC(e){ve({customError:e})}function WC(){return ve().customError}var Xf;Xf||(Xf={});var T={...vi,...Ms,iso:oo},VC=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function JC(e,t){let r=e.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function qC(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=e.slice(1).split("/").filter(Boolean);if(r.length===0)return t.rootSchema;let o=t.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===o){let n=r[1];if(!n||!t.defs[n])throw new Error(`Reference not found: ${e}`);return t.defs[n]}throw new Error(`Reference not found: ${e}`)}function pk(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return T.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let n=e.$ref;if(t.refs.has(n))return t.refs.get(n);if(t.processing.has(n))return T.lazy(()=>{if(!t.refs.has(n))throw new Error(`Circular reference not resolved: ${n}`);return t.refs.get(n)});t.processing.add(n);let i=qC(n,t),a=Oe(i,t);return t.refs.set(n,a),t.processing.delete(n),a}if(e.enum!==void 0){let n=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&n.length===1&&n[0]===null)return T.null();if(n.length===0)return T.never();if(n.length===1)return T.literal(n[0]);if(n.every(a=>typeof a=="string"))return T.enum(n);let i=n.map(a=>T.literal(a));return i.length<2?i[0]:T.union([i[0],i[1],...i.slice(2)])}if(e.const!==void 0)return T.literal(e.const);let r=e.type;if(Array.isArray(r)){let n=r.map(i=>{let a={...e,type:i};return pk(a,t)});return n.length===0?T.never():n.length===1?n[0]:T.union(n)}if(!r)return T.any();let o;switch(r){case"string":{let n=T.string();if(e.format){let i=e.format;i==="email"?n=n.check(T.email()):i==="uri"||i==="uri-reference"?n=n.check(T.url()):i==="uuid"||i==="guid"?n=n.check(T.uuid()):i==="date-time"?n=n.check(T.iso.datetime()):i==="date"?n=n.check(T.iso.date()):i==="time"?n=n.check(T.iso.time()):i==="duration"?n=n.check(T.iso.duration()):i==="ipv4"?n=n.check(T.ipv4()):i==="ipv6"?n=n.check(T.ipv6()):i==="mac"?n=n.check(T.mac()):i==="cidr"?n=n.check(T.cidrv4()):i==="cidr-v6"?n=n.check(T.cidrv6()):i==="base64"?n=n.check(T.base64()):i==="base64url"?n=n.check(T.base64url()):i==="e164"?n=n.check(T.e164()):i==="jwt"?n=n.check(T.jwt()):i==="emoji"?n=n.check(T.emoji()):i==="nanoid"?n=n.check(T.nanoid()):i==="cuid"?n=n.check(T.cuid()):i==="cuid2"?n=n.check(T.cuid2()):i==="ulid"?n=n.check(T.ulid()):i==="xid"?n=n.check(T.xid()):i==="ksuid"&&(n=n.check(T.ksuid()))}typeof e.minLength=="number"&&(n=n.min(e.minLength)),typeof e.maxLength=="number"&&(n=n.max(e.maxLength)),e.pattern&&(n=n.regex(new RegExp(e.pattern))),o=n;break}case"number":case"integer":{let n=r==="integer"?T.number().int():T.number();typeof e.minimum=="number"&&(n=n.min(e.minimum)),typeof e.maximum=="number"&&(n=n.max(e.maximum)),typeof e.exclusiveMinimum=="number"?n=n.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(n=n.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?n=n.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(n=n.lt(e.maximum)),typeof e.multipleOf=="number"&&(n=n.multipleOf(e.multipleOf)),o=n;break}case"boolean":{o=T.boolean();break}case"null":{o=T.null();break}case"object":{let n={},i=e.properties||{},a=new Set(e.required||[]);for(let[l,u]of Object.entries(i)){let d=Oe(u,t);n[l]=a.has(l)?d:d.optional()}if(e.propertyNames){let l=Oe(e.propertyNames,t),u=e.additionalProperties&&typeof e.additionalProperties=="object"?Oe(e.additionalProperties,t):T.any();if(Object.keys(n).length===0){o=T.record(l,u);break}let d=T.object(n).passthrough(),p=T.looseRecord(l,u);o=T.intersection(d,p);break}if(e.patternProperties){let l=e.patternProperties,u=Object.keys(l),d=[];for(let m of u){let f=Oe(l[m],t),g=T.string().regex(new RegExp(m));d.push(T.looseRecord(g,f))}let p=[];if(Object.keys(n).length>0&&p.push(T.object(n).passthrough()),p.push(...d),p.length===0)o=T.object({}).passthrough();else if(p.length===1)o=p[0];else{let m=T.intersection(p[0],p[1]);for(let f=2;f<p.length;f++)m=T.intersection(m,p[f]);o=m}break}let s=T.object(n);e.additionalProperties===!1?o=s.strict():typeof e.additionalProperties=="object"?o=s.catchall(Oe(e.additionalProperties,t)):o=s.passthrough();break}case"array":{let n=e.prefixItems,i=e.items;if(n&&Array.isArray(n)){let a=n.map(l=>Oe(l,t)),s=i&&typeof i=="object"&&!Array.isArray(i)?Oe(i,t):void 0;s?o=T.tuple(a).rest(s):o=T.tuple(a),typeof e.minItems=="number"&&(o=o.check(T.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(T.maxLength(e.maxItems)))}else if(Array.isArray(i)){let a=i.map(l=>Oe(l,t)),s=e.additionalItems&&typeof e.additionalItems=="object"?Oe(e.additionalItems,t):void 0;s?o=T.tuple(a).rest(s):o=T.tuple(a),typeof e.minItems=="number"&&(o=o.check(T.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(T.maxLength(e.maxItems)))}else if(i!==void 0){let a=Oe(i,t),s=T.array(a);typeof e.minItems=="number"&&(s=s.min(e.minItems)),typeof e.maxItems=="number"&&(s=s.max(e.maxItems)),o=s}else o=T.array(T.any());break}default:throw new Error(`Unsupported type: ${r}`)}return o}function Oe(e,t){if(typeof e=="boolean")return e?T.any():T.never();let r=pk(e,t),o=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let s=e.anyOf.map(u=>Oe(u,t)),l=T.union(s);r=o?T.intersection(r,l):l}if(e.oneOf&&Array.isArray(e.oneOf)){let s=e.oneOf.map(u=>Oe(u,t)),l=T.xor(s);r=o?T.intersection(r,l):l}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=o?r:T.any();else{let s=o?r:Oe(e.allOf[0],t),l=o?0:1;for(let u=l;u<e.allOf.length;u++)s=T.intersection(s,Oe(e.allOf[u],t));r=s}e.nullable===!0&&t.version==="openapi-3.0"&&(r=T.nullable(r)),e.readOnly===!0&&(r=T.readonly(r)),e.default!==void 0&&(r=r.default(e.default));let n={},i=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let s of i)s in e&&(n[s]=e[s]);let a=["contentEncoding","contentMediaType","contentSchema"];for(let s of a)s in e&&(n[s]=e[s]);for(let s of Object.keys(e))VC.has(s)||(n[s]=e[s]);return Object.keys(n).length>0&&t.registry.add(r,n),e.description&&(r=r.describe(e.description)),r}function mk(e,t){if(typeof e=="boolean")return e?T.any():T.never();let r;try{r=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let o=JC(r,t?.defaultTarget),n=r.$defs||r.definitions||{},i={version:o,defs:n,refs:new Map,processing:new Set,rootSchema:r,registry:t?.registry??Ce};return Oe(r,i)}var Yf={};Jt(Yf,{bigint:()=>QC,boolean:()=>YC,date:()=>eT,number:()=>XC,string:()=>KC});function KC(e){return xp(so,e)}function XC(e){return Ep(lo,e)}function YC(e){return Np(uo,e)}function QC(e){return Up(po,e)}function eT(e){return Jp(_i,e)}ve(as());var ie=c.number().min(0).max(100),ar=c.number().int().min(1e3).max(12e3),sn=c.number(),H=c.number().int().nonnegative(),_t=c.enum(["hue","matter","smartthings","homeassistant","nest","alexa","google","kasa","wiz","lifx","shelly","govee","tapo","tuya","yeelight","nanoleaf","meross","ewelink","wled","elgato","roku","mqtt","esphome","mock","other"]),tT=c.enum(["local","cloud","offline","unknown"]),Ti=c.enum(["light","plug","switch","dimmer","thermostat","lock","cover","garageDoor","valve","fan","sensor","binarySensor","camera","doorbell","speaker","tv","mediaPlayer","vacuum","appliance","airPurifier","humidifier","waterHeater","evCharger","sceneController","remote","scene","group","bridge","other"]),nT=c.enum(["temperature","humidity","illuminance","pressure","co2","pm25","pm10","voc","airQuality","noise","uvIndex","windSpeed","distance","generic"]),rT=c.enum(["motion","occupancy","presence","contact","leak","smoke","co","gas","tamper","vibration","glassBreak","button","person","sound","moisture","generic"]);var me=(e,t)=>c.object({type:c.literal(e),instance:c.string().optional(),...t}),oT=me("power",{state:c.object({on:c.boolean().nullable()})}),iT=me("brightness",{state:c.object({level:ie.nullable()})}),aT=me("colorTemperature",{config:c.object({minKelvin:ar,maxKelvin:ar}),state:c.object({kelvin:ar.nullable()})}),sT=me("color",{config:c.object({modes:c.array(c.enum(["hs","rgb","xy"])).default(["hs"])}),state:c.object({hue:c.number().min(0).max(360).nullable(),saturation:ie.nullable()})}),cT=me("segmentColor",{config:c.object({segments:c.number().int().min(1)}),state:c.object({colors:c.array(c.object({hue:c.number().min(0).max(360).nullable(),saturation:ie.nullable()})).nullable()})}),tg=c.enum(["off","heat","cool","auto","eco","fanOnly","dry"]),lT=me("thermostat",{config:c.object({modes:c.array(tg),minC:sn,maxC:sn,supportsRange:c.boolean().default(!1)}),state:c.object({mode:tg.nullable(),currentC:sn.nullable(),setpointC:sn.nullable().optional(),heatC:sn.nullable().optional(),coolC:sn.nullable().optional(),action:c.enum(["idle","heating","cooling","fan"]).nullable().optional()})}),uT=me("humidity",{config:c.object({settable:c.boolean().default(!1),minPct:ie.default(0),maxPct:ie.default(100)}),state:c.object({currentPct:ie.nullable().optional(),targetPct:ie.nullable().optional()})}),dT=me("lock",{state:c.object({state:c.enum(["locked","unlocked","jammed","unknown"])})}),pT=me("cover",{config:c.object({kind:c.enum(["blind","shade","curtain","awning","garage","door","window","valve","generic"]),supportsPosition:c.boolean().default(!1),supportsTilt:c.boolean().default(!1)}),state:c.object({position:ie.nullable().optional(),tilt:ie.nullable().optional(),state:c.enum(["open","closed","opening","closing","stopped","partial","unknown"])})}),mT=me("fan",{config:c.object({presets:c.array(c.string()).default([]),supportsOscillate:c.boolean().default(!1)}),state:c.object({on:c.boolean().nullable(),level:ie.nullable().optional(),preset:c.string().nullable().optional(),oscillating:c.boolean().nullable().optional()})}),fT=me("mode",{config:c.object({options:c.array(c.string())}),state:c.object({value:c.string().nullable()})}),gT=me("toggle",{state:c.object({on:c.boolean().nullable()})}),hT=me("range",{config:c.object({min:c.number(),max:c.number(),step:c.number().optional(),unit:c.string().optional()}),state:c.object({value:c.number().nullable()})}),vT=me("mediaTransport",{state:c.object({state:c.enum(["playing","paused","stopped","buffering","idle"]).nullable(),metadata:c.object({title:c.string().optional(),artist:c.string().optional(),album:c.string().optional(),artworkUrl:c.string().optional()}).nullable().optional(),positionSec:c.number().nonnegative().nullable().optional(),durationSec:c.number().nonnegative().nullable().optional(),shuffle:c.boolean().nullable().optional(),repeat:c.enum(["off","one","all"]).nullable().optional()})}),yT=me("volume",{state:c.object({level:ie.nullable(),muted:c.boolean().nullable()})}),bT=me("inputSource",{config:c.object({sources:c.array(c.string())}),state:c.object({source:c.string().nullable()})}),xT=me("startStop",{config:c.object({supportsPause:c.boolean().default(!1)}),state:c.object({state:c.enum(["running","paused","stopped","unknown"])})}),kT=me("scene",{state:c.object({lastActivated:H.nullable().optional()})}),wT=me("camera",{config:c.object({protocols:c.array(c.enum(["rtsp","webrtc","hls","snapshot"]))}),state:c.object({streaming:c.boolean().nullable().optional()})}),ST=me("sensor",{config:c.object({measurement:nT,unit:c.string()}),state:c.object({value:c.number().nullable(),ts:H.nullable().optional()})}),_T=me("binarySensor",{config:c.object({sensorType:rT}),state:c.object({active:c.boolean().nullable(),lastChanged:H.nullable().optional()})}),$T=me("battery",{state:c.object({level:ie.nullable(),charging:c.boolean().nullable().optional(),low:c.boolean().nullable().optional()})}),IT=me("energyMeter",{state:c.object({power:c.number().nullable().optional(),energy:c.number().nullable().optional(),voltage:c.number().nullable().optional(),current:c.number().nullable().optional()})}),AT=me("doorbell",{state:c.object({lastPress:H.nullable().optional()})}),ET=me("connectivity",{config:c.object({transport:c.enum(["wifi","thread","zigbee","zwave","ethernet","ble","cloud","matter","unknown"])}),state:c.object({online:c.boolean().nullable(),signal:c.number().nullable().optional()})}),fk=c.enum(["flash","strobe","pulse","colorFade","colorLoop","candle","rainbow","siren","meter"]),on=c.object({hue:c.number().min(0).max(360),saturation:ie}),an=c.number().int().min(20).max(6e5),Qf=c.number().int().min(1).max(1e3).nullable().default(null),ng=c.discriminatedUnion("kind",[c.object({kind:c.literal("flash"),count:c.number().int().min(1).max(100).default(3),onMs:an.default(300),offMs:an.default(300),color:on.nullable().default(null),brightness:ie.nullable().default(null)}),c.object({kind:c.literal("strobe"),hz:c.number().min(.5).max(25).default(8),durationMs:an.default(3e3),color:on.nullable().default(null)}),c.object({kind:c.literal("pulse"),periodMs:an.default(2e3),minPct:ie.default(5),maxPct:ie.default(100),color:on.nullable().default(null),cycles:Qf}),c.object({kind:c.literal("colorFade"),from:on.nullable().default(null),to:on,durationMs:an.default(2e3),easing:c.enum(["linear","ease"]).default("ease")}),c.object({kind:c.literal("colorLoop"),colors:c.array(on).min(2).max(16),holdMs:an.default(1e3),fadeMs:c.number().int().min(0).max(6e5).default(800),loops:Qf,direction:c.enum(["forward","pingpong"]).default("forward")}),c.object({kind:c.literal("candle"),intensity:ie.default(50),warmthKelvin:ar.nullable().default(null),durationMs:an.nullable().default(null)}),c.object({kind:c.literal("rainbow"),cycleMs:an.default(4e3),saturation:ie.default(100),brightness:ie.default(100),loops:Qf}),c.object({kind:c.literal("siren"),colorA:on.default({hue:0,saturation:100}),colorB:on.default({hue:240,saturation:100}),hz:c.number().min(.5).max(10).default(4),durationMs:an.nullable().default(null)}),c.object({kind:c.literal("meter"),source:c.enum(["context","usage","cost"]),stops:c.array(c.object({at:c.number().min(0),color:on})).min(2).max(6).default([{at:0,color:{hue:120,saturation:90}},{at:75,color:{hue:40,saturation:95}},{at:95,color:{hue:0,saturation:95}}])})]),PT=me("effect",{config:c.object({kinds:c.array(fk).default(["flash"]),supportsColor:c.boolean().default(!1)}),state:c.object({active:fk.nullable()})}),CT=c.discriminatedUnion("type",[oT,iT,aT,sT,cT,lT,uT,dT,pT,mT,fT,gT,hT,vT,yT,bT,xT,kT,wT,ST,_T,$T,IT,AT,ET,PT]),cn=c.enum(["power","brightness","colorTemperature","color","segmentColor","thermostat","humidity","lock","cover","fan","mode","toggle","range","mediaTransport","volume","inputSource","startStop","scene","camera","sensor","binarySensor","battery","energyMeter","doorbell","connectivity","effect"]),vk=c.enum(["needs-password"]),TT=c.object({sourceId:c.string(),provider:_t,providerAccountId:c.string(),nativeId:c.string(),nativeType:c.string().optional(),reachability:c.enum(["local","cloud"]),online:c.boolean(),attention:vk.nullable().optional(),credentialRef:c.string().nullable().optional(),lastSeen:H.nullable().optional()}),RT=c.object({id:c.string(),name:c.string(),providerRefs:c.array(c.object({provider:_t,nativeId:c.string()})).default([])}),OT=c.object({accountId:c.string(),provider:_t,displayName:c.string(),reachability:c.enum(["local","cloud"]),status:c.enum(["linked","needs_reauth","revoked"]),expiresAt:H.nullable().optional()}),DT=c.object({id:c.string(),type:Ti,name:c.string(),areaId:c.string().nullable(),manufacturer:c.string().nullable().optional(),model:c.string().nullable().optional(),firmwareVersion:c.string().nullable().optional(),online:c.boolean(),reachability:tT,attention:vk.nullable().optional(),parentId:c.string().nullable().optional(),members:c.array(c.string()).optional(),sources:c.array(TT).min(1),preferredSourceId:c.string(),capabilities:c.array(CT),updatedAt:H,raw:c.unknown().optional()}),yk=c.object({version:c.literal(1),nodeId:c.string(),updatedAt:H,areas:c.array(RT),accounts:c.array(OT),devices:c.array(DT)}),NT=c.enum(["relay-do-sealed","hub-local"]),WM=c.object({accountId:c.string(),provider:_t,providerAccountId:c.string(),nodeId:c.string(),credentialLocation:NT,scopes:c.array(c.string()).default([]),status:c.enum(["linked","needs_reauth","revoked"]),displayName:c.string(),expiresAt:H.nullable().optional(),linkedAt:H}),gk=c.enum(["open","guarded","locked"]),eg=c.enum(["allow","confirm","deny"]),LT=c.enum(["voice","claude","app","rules"]),VM=c.object({tier:gk.default("open"),perConsumer:c.partialRecord(LT,gk).default({}),perClass:c.partialRecord(cn,eg).default({}),perDeviceType:c.partialRecord(Ti,eg).default({}),perDevice:c.record(c.string(),eg).default({}),confirmWindowSec:c.number().default(60)}),ye=c.object({}),hk=e=>e.type==="cover"&&(e.config.kind==="garage"||e.config.kind==="door"),rg={power:[{command:"turnOn",params:ye},{command:"turnOff",params:ye},{command:"toggle",params:ye}],brightness:[{command:"setBrightness",params:c.object({level:ie})},{command:"adjustBrightness",params:c.object({delta:c.number().min(-100).max(100)})}],colorTemperature:[{command:"setColorTemperature",params:c.object({kelvin:ar})}],color:[{command:"setColor",params:c.object({hue:c.number().min(0).max(360),saturation:ie})}],segmentColor:[{command:"setSegmentColors",voice:!1,params:c.object({segments:c.array(c.object({index:c.number().int().nonnegative(),hue:c.number().min(0).max(360),saturation:ie})).min(1).max(512)})}],thermostat:[{command:"setThermostatMode",params:c.object({mode:tg})},{command:"setSetpoint",params:c.object({celsius:sn})},{command:"setRange",params:c.object({heatCelsius:sn,coolCelsius:sn}),gate:e=>e.type==="thermostat"&&e.config.supportsRange}],humidity:[{command:"setHumidity",params:c.object({percent:ie}),gate:e=>e.type==="humidity"&&e.config.settable}],lock:[{command:"lock",params:ye},{command:"unlock",params:ye,confirm:!0}],cover:[{command:"open",params:ye,confirm:hk},{command:"close",params:ye},{command:"stop",params:ye},{command:"setPosition",params:c.object({position:ie}),confirm:hk,gate:e=>e.type==="cover"&&e.config.supportsPosition},{command:"setTilt",params:c.object({tilt:ie}),gate:e=>e.type==="cover"&&e.config.supportsTilt}],fan:[{command:"turnOn",params:ye},{command:"turnOff",params:ye},{command:"setFanSpeed",params:c.object({level:ie})},{command:"setFanPreset",params:c.object({preset:c.string()}),gate:e=>e.type==="fan"&&e.config.presets.length>0},{command:"setOscillate",params:c.object({oscillating:c.boolean()}),gate:e=>e.type==="fan"&&e.config.supportsOscillate}],mode:[{command:"setMode",params:c.object({value:c.string()})}],toggle:[{command:"setToggle",params:c.object({on:c.boolean()})}],range:[{command:"setRange",params:c.object({value:c.number()})},{command:"adjustRange",params:c.object({delta:c.number()})}],mediaTransport:[{command:"play",params:ye},{command:"pause",params:ye},{command:"stop",params:ye},{command:"next",params:ye},{command:"previous",params:ye},{command:"seek",params:c.object({positionSec:c.number().nonnegative()})},{command:"setShuffle",params:c.object({on:c.boolean()})},{command:"setRepeat",params:c.object({mode:c.enum(["off","one","all"])})}],volume:[{command:"setVolume",params:c.object({level:ie})},{command:"adjustVolume",params:c.object({delta:c.number().min(-100).max(100)})},{command:"setMute",params:c.object({muted:c.boolean()})}],inputSource:[{command:"selectInput",params:c.object({source:c.string()})}],startStop:[{command:"start",params:ye},{command:"stop",params:ye},{command:"pause",params:ye,gate:e=>e.type==="startStop"&&e.config.supportsPause},{command:"resume",params:ye,gate:e=>e.type==="startStop"&&e.config.supportsPause}],scene:[{command:"activate",params:ye}],effect:[{command:"startEffect",params:c.object({spec:ng})},{command:"stopEffect",params:ye}],camera:[{command:"getStream",params:c.object({protocol:c.enum(["rtsp","webrtc","hls"])}),voice:!1,returns:c.object({url:c.string(),token:c.string().optional(),expiresAt:H.optional()})},{command:"getSnapshot",params:ye,voice:!1,returns:c.object({url:c.string(),expiresAt:H.optional()})}],sensor:[],binarySensor:[],battery:[],energyMeter:[],doorbell:[],connectivity:[]};var UT=c.discriminatedUnion("kind",[c.object({kind:c.literal("literal"),hue:c.number().min(0).max(360),saturation:ie}),c.object({kind:c.literal("token"),token:c.enum(["main","session"])})]),bk=c.enum(["main","session","hold","off"]),xk=c.object({color:UT.optional(),brightnessPct:ie.nullable().optional(),brightnessScale:c.number().min(0).max(2).optional(),kelvin:ar.nullable().optional(),power:c.boolean().optional()});var zT=c.enum(["added","removed","permission_request","started","ended","working","finished","error","idle","needs_permission","promptSubmitted","toolStart","toolEnd","subagentStart","subagentFinished","compacting","resumed","aborted","contextLow","contextCritical","needsInput","planReady","rateLimited","compactDone","permissionDenied","taskCompleted","usageHigh","modePlan","modeAuto","modeBypass","modeNormal","modelChanged","workflowStarted","sandboxEscalation","reviewChanged","costHigh","longRunning"]),sr=c.enum(["claude","codex"]);var jT=c.discriminatedUnion("kind",[c.object({kind:c.literal("deviceState"),deviceId:c.string(),capability:c.string(),instance:c.string().optional(),op:c.enum(["eq","neq","gt","lt","gte","lte","changed"]).default("changed"),path:c.string().optional(),value:c.unknown().optional()}),c.object({kind:c.literal("edge"),deviceId:c.string(),event:c.string()}),c.object({kind:c.literal("session"),event:zT,repo:c.string().optional(),sessionId:c.string().optional(),agent:sr.optional()}),c.object({kind:c.literal("schedule"),cron:c.string()})]),FT=c.object({deviceId:c.string(),capability:c.string(),instance:c.string().optional(),op:c.enum(["eq","neq","gt","lt","gte","lte"]),path:c.string().optional(),value:c.unknown()}),MT=c.discriminatedUnion("kind",[c.object({kind:c.literal("device"),deviceId:c.string(),capability:c.string(),instance:c.string().optional(),command:c.string(),params:c.unknown().optional()}),c.object({kind:c.literal("session"),sessionId:c.string(),text:c.string()}),c.object({kind:c.literal("notify"),title:c.string(),body:c.string()}),c.object({kind:c.literal("intent"),deviceId:c.string(),instance:c.string().optional(),look:xk.optional(),effect:ng.optional(),returnTo:bk.optional(),hold:c.boolean().default(!1)})]),tB=c.object({id:c.string(),name:c.string().default(""),enabled:c.boolean().default(!0),trigger:jT,conditions:c.array(FT).default([]),actions:c.array(MT).min(1),allowSecurity:c.boolean().default(!1)});var mo=c.enum(["started","ended","working","finished","error","idle","needs_permission","subagentFinished","compacting","resumed","contextLow","contextCritical","needsInput","planReady","rateLimited","subagentStart","compactDone","permissionDenied","taskCompleted","usageHigh","modePlan","modeAuto","modeBypass","modeNormal","modelChanged","workflowStarted","sandboxEscalation","reviewChanged","costHigh","longRunning"]),kk=c.object({id:c.string(),name:c.string(),cwd:c.string(),online:c.boolean().default(!0),state:mo.optional(),bridgeId:c.string().optional(),bridgeName:c.string().optional(),agent:sr.optional()}),wk=c.enum(["allow","deny"]),aB=c.object({sessionId:c.string().nullable(),text:c.string(),ts:H.optional()}),yc=c.object({latestReply:c.string().nullable(),ts:c.number().nullable(),cursor:c.number().int().nonnegative(),hasMore:c.boolean()}),sB=c.object({requestId:c.string(),behavior:wk,ts:H.optional()}),cB=c.object({id:c.string(),sessionId:c.string().nullable(),args:c.unknown(),ts:H.optional()}),BT=c.object({type:c.literal("register"),userToken:c.string().optional(),sessions:c.array(kk),claudeSessionId:c.string().optional()}),HT=c.object({type:c.literal("sessions.update"),sessions:c.array(kk)}),ZT=c.object({type:c.literal("prompt"),sessionId:c.string(),requestId:c.string(),text:c.string(),ts:H.optional()});var GT=c.object({type:c.literal("reply"),sessionId:c.string(),requestId:c.string(),text:c.string(),seq:c.number().int().nonnegative().optional(),final:c.boolean().optional(),ts:H.optional()}),WT=c.object({type:c.literal("permission_request"),sessionId:c.string(),requestId:c.string(),tool:c.string(),description:c.string(),preview:c.string(),ts:H.optional()}),VT=c.object({type:c.literal("permission_verdict"),sessionId:c.string(),requestId:c.string(),behavior:wk,ts:H.optional()}),JT=c.object({type:c.literal("command"),id:c.string(),requestId:c.string(),sessionId:c.string().nullable(),args:c.unknown(),ts:H.optional()}),qT=c.object({type:c.literal("command_result"),requestId:c.string(),id:c.string(),sessionId:c.string().nullable().optional(),result:c.unknown().optional(),error:c.string().optional(),ts:H.optional()}),KT=c.object({type:c.literal("devices.update"),doc:yk}),XT=c.object({type:c.literal("device_command"),requestId:c.string(),deviceId:c.string(),sourceId:c.string().nullable().optional(),ruleId:c.string().optional(),capability:cn,instance:c.string().optional(),command:c.string(),params:c.unknown(),consumer:c.enum(["voice","claude","app","rules"]),sessionId:c.string().optional(),confirm:c.boolean().optional()}),YT=c.object({type:c.literal("device_query"),requestId:c.string(),kind:c.enum(["list","get"]),deviceId:c.string().optional()}),QT=c.object({type:c.literal("device_result"),requestId:c.string(),deviceId:c.string().optional(),ok:c.boolean(),verified:c.boolean().optional(),state:c.unknown().optional(),result:c.unknown().optional(),error:c.string().optional()}),e1=c.object({type:c.literal("device_event"),deviceId:c.string(),capability:cn,instance:c.string().optional(),event:c.string(),payload:c.unknown().optional(),ts:H}),t1=c.object({type:c.literal("device_source_event"),provider:_t,providerAccountId:c.string(),nativeId:c.string(),patch:c.array(c.object({type:cn,instance:c.string().optional(),state:c.unknown()})).optional(),edge:c.object({capability:cn,instance:c.string().optional(),event:c.string(),payload:c.unknown().optional()}).optional(),online:c.boolean().optional(),ts:H}),n1=c.object({type:c.literal("entitlement"),plan:c.enum(["free","paid"]),planStatus:c.enum(["active","past_due","canceled"]).optional(),serviceOk:c.boolean().optional(),capture:c.object({telemetry:c.boolean(),transcripts:c.boolean()}),policyVersion:c.string(),ts:H}),r1=c.object({type:c.literal("device_config"),version:c.number().int().nonnegative(),config:c.record(c.string(),c.unknown()),ts:H}),o1=c.object({type:c.literal("disconnect"),code:c.union([c.literal(1012),c.literal(4402),c.literal(4426),c.number().int().min(1e3).max(4999)]),reason:c.string().max(120),ts:H}),i1=c.object({type:c.literal("device_audit"),requestId:c.string(),consumer:c.enum(["voice","claude","app","rules"]),deviceId:c.string(),ruleId:c.string().optional(),capability:cn,command:c.string(),params:c.unknown(),ok:c.boolean(),confirmRequired:c.boolean(),confirmedBy:c.string().optional(),error:c.string().optional(),ts:H}),a1=64,s1=c.object({type:c.literal("session_state"),sessionId:c.string(),state:mo,event:c.string(),ts:H,transitions:c.array(c.object({state:mo,event:c.string(),ts:H})).max(a1).optional()}),c1=c.object({type:c.literal("notification"),sessionId:c.string(),event:mo,repo:c.string().optional(),title:c.string().optional(),body:c.string().optional()}),l1=c.discriminatedUnion("type",[BT,HT,ZT,GT,WT,VT,JT,qT,KT,XT,YT,QT,e1,t1,i1,n1,o1,r1,s1,c1]),Sk=e=>l1.parse(typeof e=="string"?JSON.parse(e):e);var u1=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),zt=(e,t)=>e>>>t|e<<32-t;function d1(e){let t=[];for(let r of e){let o=r.codePointAt(0);o<128?t.push(o):o<2048?t.push(192|o>>6,128|o&63):o<65536?t.push(224|o>>12,128|o>>6&63,128|o&63):t.push(240|o>>18,128|o>>12&63,128|o>>6&63,128|o&63)}return Uint8Array.from(t)}function p1(e){let t=d1(e),r=new Uint8Array((t.length+8>>6)+1<<6);r.set(t),r[t.length]=128;let o=new DataView(r.buffer),n=t.length*8;o.setUint32(r.length-8,Math.floor(n/4294967296)),o.setUint32(r.length-4,n>>>0);let i=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),a=new Uint32Array(64);for(let u=0;u<r.length;u+=64){for(let P=0;P<16;P++)a[P]=o.getUint32(u+P*4);for(let P=16;P<64;P++){let C=a[P-15],E=a[P-2],D=zt(C,7)^zt(C,18)^C>>>3,G=zt(E,17)^zt(E,19)^E>>>10;a[P]=a[P-16]+D+a[P-7]+G>>>0}let d=i[0],p=i[1],m=i[2],f=i[3],g=i[4],y=i[5],k=i[6],_=i[7];for(let P=0;P<64;P++){let C=zt(g,6)^zt(g,11)^zt(g,25),E=g&y^~g&k,D=_+C+E+u1[P]+a[P],G=zt(d,2)^zt(d,13)^zt(d,22),ae=d&p^d&m^p&m,X=G+ae;_=k,k=y,y=g,g=f+D>>>0,f=m,m=p,p=d,d=D+X>>>0}i[0]=i[0]+d>>>0,i[1]=i[1]+p>>>0,i[2]=i[2]+m>>>0,i[3]=i[3]+f>>>0,i[4]=i[4]+g>>>0,i[5]=i[5]+y>>>0,i[6]=i[6]+k>>>0,i[7]=i[7]+_>>>0}let s=new Uint8Array(32),l=new DataView(s.buffer);for(let u=0;u<8;u++)l.setUint32(u*4,i[u]);return s}var _k="abcdefghijklmnopqrstuvwxyz234567";function m1(e){let t=0,r=0,o="";for(let n of e)for(r=r<<8|n,t+=8;t>=5;)o+=_k[r>>>t-5&31],t-=5;return t>0&&(o+=_k[r<<5-t&31]),o}function Ik(e){return m1(p1(e))}var f1=c.enum(["mdns","ssdp","kasa-udp","wiz-udp","lifx-lan","yeelight","govee-udp","tuya-beacon","arp","http","meethue"]),g1=c.object({protocol:f1,detail:c.string(),at:H}),h1=c.enum(["connect-now","link-ecosystem","identified-only"]),bc=c.enum(["kasa","kasa-klap","wiz","lifx","shelly","govee","tapo","tuya","yeelight","nanoleaf","meross","ewelink","wled","elgato","roku","esphome"]),v1=c.enum(["high","medium","low"]),y1=c.object({ip:c.string(),mac:c.string().optional(),hostname:c.string().optional(),port:c.number().int().positive().optional()}),Ak=c.object({discoveredId:c.string(),addresses:y1,evidence:c.array(g1).min(1),identity:c.object({name:c.string().optional(),manufacturer:c.string().optional(),model:c.string().optional(),hint:c.string().optional(),vendorId:c.string().optional()}).default({}),bucket:h1,kind:c.string().optional(),suggestedProvider:_t.optional(),localProtocol:bc.optional(),expectedType:Ti.optional(),expectedCapabilities:c.array(cn).default([]),alreadyLinked:c.object({provider:_t,deviceId:c.string().optional(),accountId:c.string().optional()}).nullable().optional(),confidence:v1,firstSeen:H,lastSeen:H});function $t(e){return e.trim().toLowerCase().replace(/[^0-9a-f]/g,"").replace(/(..)(?=.)/g,"$1:")}var Ek=c.object({key:c.string(),provider:_t,accountId:c.string().optional(),name:c.string(),mac:c.string().optional(),nativeType:c.string().optional(),expectedType:Ti.optional(),state:c.enum(["cloud","not-seen"]),deviceId:c.string().optional()}),Pk=c.object({wsl:c.boolean(),multicastOk:c.boolean().nullable(),broadcastOk:c.boolean().nullable(),interop:c.enum(["windows-arp"]).optional(),interfaces:c.array(c.string()).optional(),primaryInterface:c.string().optional()});function Ck(e){return e!==void 0&&(e.wsl||e.multicastOk===!1)}function Tk(e,t){return t>0||e===void 0||e.wsl?!1:e.multicastOk===!0}var Rk="Your computer's network stack is fine, so if you expected devices here the likely cause is the network itself: guest WiFi, VLANs, or an access point with client isolation all block the discovery messages between devices. Try the same scan on your main WiFi, or add a device by IP.",b1=c.enum(["running","done","failed"]),fB=c.object({id:c.string(),status:b1,startedAt:H,finishedAt:H.optional(),error:c.string().optional(),devices:c.array(Ak),accountDevices:c.array(Ek).optional(),env:Pk,probeStatus:c.record(c.string(),c.string()).optional()}),x1=c.enum(["mdns","ssdp","kasa","wiz","lifx","yeelight","govee","tuya","arp","sweep"]),gB=c.object({autoConnect:c.enum(["unset","off","open-protocols"]).default("unset"),passive:c.boolean().default(!0),protocols:c.partialRecord(x1,c.boolean()).default({}),unidentified:c.boolean().default(!0)}),hB=c.object({scanId:c.string()}),vB=c.object({devices:c.array(Ak),accountDevices:c.array(Ek).optional(),env:Pk,updatedAt:H}),yB=c.object({discoveredId:c.string().optional(),ip:c.string().optional(),protocol:bc,name:c.string().optional(),credentials:c.record(c.string(),c.string()).optional()}).refine(e=>e.discoveredId!==void 0||e.ip!==void 0,{message:"either discoveredId or ip is required"}),og={tapo:[{key:"username",label:"TP-Link email",secret:!1,helpText:"the TP-Link ID the device was set up with"},{key:"password",label:"Password",secret:!0}],"kasa-klap":[{key:"username",label:"TP-Link email",secret:!1,helpText:"the TP-Link/Kasa ID the device was set up with (leave blank if never linked to the cloud)"},{key:"password",label:"Password",secret:!0}],shelly:[{key:"password",label:"Device password",secret:!0,helpText:'the password set on this Shelly (its username is always "admin")'}],esphome:[{key:"encryptionKey",label:"Encryption key",secret:!0,helpText:"the `api: encryption: key` from this device's ESPHome config (base64) \u2014 leave blank if it has no encryption"}]},k1=new Set(["shelly","esphome"]);function w1(e){return k1.has(e)}var bB=c.object({ok:c.boolean(),deviceId:c.string().optional(),accountId:c.string().optional(),error:c.string().optional(),note:c.string().optional(),linkVia:_t.optional()}),xB=c.object({deviceId:c.string(),purge:c.boolean().default(!1),discoveredId:c.string().optional()}),kB=c.object({deviceId:c.string(),name:c.string()}),wB=c.object({clientId:c.string().min(1),clientSecret:c.string().min(1),region:c.string().min(1)}),SB=c.object({ok:c.boolean(),deviceCount:c.number().int().nonnegative().optional(),sleepyCount:c.number().int().nonnegative().optional(),error:c.string().optional()}),_B=c.object({email:c.string().min(1),password:c.string().min(1),region:c.string().min(1),mfaCode:c.string().optional()}),$B=c.object({ok:c.boolean(),deviceCount:c.number().int().nonnegative().optional(),error:c.string().optional()}),IB=c.object({email:c.string().min(1),password:c.string().min(1),region:c.string().min(1)}),AB=c.object({ok:c.boolean(),deviceCount:c.number().int().nonnegative().optional(),error:c.string().optional()}),EB=c.object({apiKey:c.string().min(1)}),PB=c.object({ok:c.boolean(),deviceCount:c.number().int().nonnegative().optional(),error:c.string().optional()}),CB=c.object({ok:c.boolean(),note:c.string().optional(),error:c.string().optional()}),TB=c.object({sessionId:c.string().optional(),revertOnStop:c.boolean().default(!0)}),RB=c.object({sessionId:c.string().optional()}),Ok=c.object({pct:c.number().min(0).max(100),usedTokens:c.number().int().nonnegative().optional(),windowTokens:c.number().int().positive().optional()}),$k=c.object({usedPct:c.number().min(0).max(100),resetsAt:H.optional()}),OB=c.object({sessionId:c.string().optional(),claudeSessionId:c.string().optional(),state:mo,event:c.string(),ts:H.optional(),cwd:c.string().optional(),extra:c.record(c.string(),c.unknown()).optional(),context:Ok.optional(),mode:c.string().optional(),model:c.string().optional(),agent:sr.optional()}),DB=c.object({sessionId:c.string().optional(),claudeSessionId:c.string().optional(),cwd:c.string().optional(),ts:H.optional(),context:Ok.optional(),rateLimits:c.object({fiveHour:$k.optional(),sevenDay:$k.optional()}).optional(),mode:c.string().optional(),model:c.string().optional(),modelName:c.string().optional(),review:c.string().optional(),cost:c.number().nonnegative().optional(),agent:sr.optional()}),NB=c.object({sessionId:c.string().optional(),claudeSessionId:c.string().optional(),codexThreadId:c.string().min(1),cwd:c.string().optional(),gitBranch:c.string().optional(),ts:H.optional(),inputTokens:c.number().int().nonnegative(),cachedInputTokens:c.number().int().nonnegative().default(0),outputTokens:c.number().int().nonnegative(),agent:sr.optional()}),S1=c.object({reverted:c.number().int().nonnegative(),failed:c.number().int().nonnegative(),skipped:c.number().int().nonnegative()}),LB=c.object({active:c.boolean(),sessionId:c.string().optional(),generation:c.number().int().nonnegative().optional(),touched:c.number().int().nonnegative().default(0),revertOnStop:c.boolean().default(!0),owner:c.enum(["app","hook"]).optional(),summary:S1.optional()});function fo(e){return e.kind==="gateway"?"infrastructure":e.bucket==="connect-now"?"ready":e.bucket==="link-ecosystem"?"ecosystems":e.kind==="unidentified"||e.kind==="mdns-service"?"unidentified":e.bucket==="identified-only"?"needs-setup":"unidentified"}var xc=["govee","wiz","yeelight","kasa","esphome"],_1=new Set(["lock","cover","garageDoor","valve","camera","doorbell"]),$1=new Set(["lock","cover","camera","doorbell"]),I1=new Set(["tuya","meross","ewelink","nanoleaf","esphome"]);function Dk(e,t=og){return e.bucket==="connect-now"&&e.localProtocol!==void 0&&((t[e.localProtocol]?.length??0)===0||w1(e.localProtocol))&&!I1.has(e.localProtocol)&&e.confidence==="high"&&e.addresses.mac!==void 0&&!e.alreadyLinked&&!(e.expectedType!==void 0&&_1.has(e.expectedType))&&!e.expectedCapabilities.some(r=>$1.has(r))}function Nk(e){let t=e.trim(),r,o=/^(mqtts?|tcp|ssl|tls|wss?):\/\//i.exec(t);if(o){let s=o[1].toLowerCase();(s==="mqtts"||s==="ssl"||s==="tls"||s==="wss")&&(r=!0),t=t.slice(o[0].length)}t=t.replace(/\/.*$/,"");let n=/^(.+):(\d{1,5})$/.exec(t),i=(n?n[1]:t).trim(),a=n?Number(n[2]):void 0;return{host:i,...a!==void 0&&a>=1&&a<=65535?{port:a}:{},...r!==void 0?{tls:r}:{}}}import{spawn as P1}from"node:child_process";import{chmodSync as C1,existsSync as ag,openSync as T1,readFileSync as R1,realpathSync as O1,writeFileSync as Mk}from"node:fs";import{request as D1}from"node:http";import N1 from"node:net";import L1 from"node:path";function Ri(){return!0}function Lk(){return"1.0.0"}var Uk=3e3,A1=15e3;function E1(e){if(!e)return null;try{let t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return null;let{pid:r,startedAt:o,lastBeat:n}=t;return!Number.isInteger(r)||r<=0||typeof o!="number"||typeof n!="number"?null:{pid:r,startedAt:o,lastBeat:n}}catch{return null}}function zk(e){let t=e?.read??O;return E1(t(e?.file??Ia))}function ig(e,t){let r=t?.write??((n,i)=>ge(n,i,384)),o=t?.now??Date.now;try{r(t?.file??Ia,JSON.stringify({pid:t?.pid??process.pid,startedAt:e,lastBeat:o()}))}catch{}}function jk(e){try{(e?.remove??ue)(e?.file??Ia)}catch{}}function Fk(e){let{beacon:t,pid:r}=e;return!Number.isInteger(r)||r<=0||!t||t.pid!==r||!(e.isAlive??Ea)(r)?!1:(e.now??Date.now())-t.lastBeat<=(e.staleAfterMs??A1)}function U1(e){return new Promise(t=>{let r=N1.connect({host:"127.0.0.1",port:e},()=>{r.destroy(),t(!0)});r.on("error",()=>t(!1)),r.setTimeout(500,()=>{r.destroy(),t(!1)})})}function wc(e={}){let t=Sr(e);return{dir:t.dir,source:t.source,port:t.beacon?.port??ne().hubPort,tokenFile:Hl(t.dir),advertised:t.beacon!==null}}async function Te(){return U1(wc().port)}function z1(e=process.env,t=r=>Ct(r)){if(e.BRIDGE_CLIENT_VERSION!==void 0)return{};let r=t(e);return r===null?{}:{BRIDGE_CLIENT_VERSION:r}}function j1(e=process.env,t={}){let r=t.bundled??Ri(),o={...e};return r&&delete o.BRIDGE_VOICE,o}async function it(e={kind:"run"}){if(await Te())return Y("hub already running \u2014 reusing it"),{spawned:!1,holderId:await Bk(e.kind)??await Sc(e.kind)};let t=ne(),r=ag(Xo)?{file:process.execPath,args:[Xo]}:{file:ag(Ca)?Ca:"tsx",args:[oy]};Mk(xt,"",{mode:384}),C1(xt,384);let o=T1(xt,"a"),n=P1(r.file,r.args,{cwd:en,detached:!0,stdio:["ignore",o,o],env:{...j1(),BRIDGE_RELAY_URL:t.relayUrl,BRIDGE_HUB_PORT:String(t.hubPort),BRIDGE_HUB_HOLDER:e.kind,BRIDGE_HUB_HOLDER_PID:String(process.pid),...z1()}});n.unref(),n.pid&&Mk(Mo,String(n.pid));for(let i=0;i<30;i++){let a=_c(xt);if(/relay connected/i.test(a))return A("hub connected to relay"),{spawned:!0,holderId:await Bk(e.kind)??await Sc(e.kind)};if(/relay ws error|FATAL/i.test(a))throw new Error(`hub failed to connect:
|
|
238
|
-
${Se(
|
|
239
|
-
${Se(
|
|
240
|
-
`)[0]??"").holderId??null)}catch{a(null)}}),l.once("close",()=>a(null))});s.on("error",()=>a(null)),s.setTimeout(5e3,()=>a(null)),s.end(o)}catch{a(null)}})}async function
|
|
237
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let a of e.seen.entries()){let s=a[1];if(t===a[0]){i(a);continue}if(e.external){let u=e.external.registry.get(a[0])?.id;if(t!==a[0]&&u){i(a);continue}}if(e.metadataRegistry.get(a[0])?.id){i(a);continue}if(s.cycle){i(a);continue}if(s.count>1&&e.reused==="ref"){i(a);continue}}}function jn(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=s=>{let l=e.seen.get(s);if(l.ref===null)return;let u=l.def??l.schema,d={...u},p=l.ref;if(l.ref=null,p){o(p);let f=e.seen.get(p),g=f.schema;if(g.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(g)):Object.assign(u,g),Object.assign(u,d),s._zod.parent===p)for(let k in u)k==="$ref"||k==="allOf"||k in d||delete u[k];if(g.$ref&&f.def)for(let k in u)k==="$ref"||k==="allOf"||k in f.def&&JSON.stringify(u[k])===JSON.stringify(f.def[k])&&delete u[k]}let m=s._zod.parent;if(m&&m!==p){o(m);let f=e.seen.get(m);if(f?.schema.$ref&&(u.$ref=f.schema.$ref,f.def))for(let g in u)g==="$ref"||g==="allOf"||g in f.def&&JSON.stringify(u[g])===JSON.stringify(f.def[g])&&delete u[g]}e.override({zodSchema:s,jsonSchema:u,path:l.path??[]})};for(let s of[...e.seen.entries()].reverse())o(s[0]);let n={};if(e.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let s=e.external.registry.get(t)?.id;if(!s)throw new Error("Schema is missing an `id` property");n.$id=e.external.uri(s)}Object.assign(n,r.def??r.schema);let i=e.metadataRegistry.get(t)?.id;i!==void 0&&n.id===i&&delete n.id;let a=e.external?.defs??{};for(let s of e.seen.entries()){let l=s[1];l.def&&l.defId&&(l.def.id===l.defId&&delete l.def.id,a[l.defId]=l.def)}e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?n.$defs=a:n.definitions=a);try{let s=JSON.parse(JSON.stringify(n));return Object.defineProperty(s,"~standard",{value:{...t["~standard"],jsonSchema:{input:ao(t,"input",e.processors),output:ao(t,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function Me(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return Me(o.element,r);if(o.type==="set")return Me(o.valueType,r);if(o.type==="lazy")return Me(o.getter(),r);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return Me(o.innerType,r);if(o.type==="intersection")return Me(o.left,r)||Me(o.right,r);if(o.type==="record"||o.type==="map")return Me(o.keyType,r)||Me(o.valueType,r);if(o.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Me(o.in,r)||Me(o.out,r);if(o.type==="object"){for(let n in o.shape)if(Me(o.shape[n],r))return!0;return!1}if(o.type==="union"){for(let n of o.options)if(Me(n,r))return!0;return!1}if(o.type==="tuple"){for(let n of o.items)if(Me(n,r))return!0;return!!(o.rest&&Me(o.rest,r))}return!1}var lm=(e,t={})=>r=>{let o=Un({...r,processors:t});return oe(e,o),zn(o,e),jn(o,e)},ao=(e,t,r={})=>o=>{let{libraryOptions:n,target:i}=o??{},a=Un({...n??{},target:i,io:t,processors:r});return oe(e,a),zn(a,e),jn(a,e)};var qC={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},um=(e,t,r,o)=>{let n=r;n.type="string";let{minimum:i,maximum:a,format:s,patterns:l,contentEncoding:u}=e._zod.bag;if(typeof i=="number"&&(n.minLength=i),typeof a=="number"&&(n.maxLength=a),s&&(n.format=qC[s]??s,n.format===""&&delete n.format,s==="time"&&delete n.format),u&&(n.contentEncoding=u),l&&l.size>0){let d=[...l];d.length===1?n.pattern=d[0].source:d.length>1&&(n.allOf=[...d.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},dm=(e,t,r,o)=>{let n=r,{minimum:i,maximum:a,format:s,multipleOf:l,exclusiveMaximum:u,exclusiveMinimum:d}=e._zod.bag;typeof s=="string"&&s.includes("int")?n.type="integer":n.type="number";let p=typeof d=="number"&&d>=(i??Number.NEGATIVE_INFINITY),m=typeof u=="number"&&u<=(a??Number.POSITIVE_INFINITY),f=t.target==="draft-04"||t.target==="openapi-3.0";p?f?(n.minimum=d,n.exclusiveMinimum=!0):n.exclusiveMinimum=d:typeof i=="number"&&(n.minimum=i),m?f?(n.maximum=u,n.exclusiveMaximum=!0):n.exclusiveMaximum=u:typeof a=="number"&&(n.maximum=a),typeof l=="number"&&(n.multipleOf=l)},pm=(e,t,r,o)=>{r.type="boolean"},mm=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},fm=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},gm=(e,t,r,o)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},hm=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},vm=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},ym=(e,t,r,o)=>{r.not={}},bm=(e,t,r,o)=>{},xm=(e,t,r,o)=>{},km=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},wm=(e,t,r,o)=>{let n=e._zod.def,i=ri(n.entries);i.every(a=>typeof a=="number")&&(r.type="number"),i.every(a=>typeof a=="string")&&(r.type="string"),r.enum=i},Sm=(e,t,r,o)=>{let n=e._zod.def,i=[];for(let a of n.values)if(a===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(a))}else i.push(a);if(i.length!==0)if(i.length===1){let a=i[0];r.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[a]:r.const=a}else i.every(a=>typeof a=="number")&&(r.type="number"),i.every(a=>typeof a=="string")&&(r.type="string"),i.every(a=>typeof a=="boolean")&&(r.type="boolean"),i.every(a=>a===null)&&(r.type="null"),r.enum=i},_m=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},$m=(e,t,r,o)=>{let n=r,i=e._zod.pattern;if(!i)throw new Error("Pattern not found in template literal");n.type="string",n.pattern=i.source},Im=(e,t,r,o)=>{let n=r,i={type:"string",format:"binary",contentEncoding:"binary"},{minimum:a,maximum:s,mime:l}=e._zod.bag;a!==void 0&&(i.minLength=a),s!==void 0&&(i.maxLength=s),l?l.length===1?(i.contentMediaType=l[0],Object.assign(n,i)):(Object.assign(n,i),n.anyOf=l.map(u=>({contentMediaType:u}))):Object.assign(n,i)},Am=(e,t,r,o)=>{r.type="boolean"},Em=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Pm=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},Cm=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Tm=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},Rm=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},Om=(e,t,r,o)=>{let n=r,i=e._zod.def,{minimum:a,maximum:s}=e._zod.bag;typeof a=="number"&&(n.minItems=a),typeof s=="number"&&(n.maxItems=s),n.type="array",n.items=oe(i.element,t,{...o,path:[...o.path,"items"]})},Dm=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="object",n.properties={};let a=i.shape;for(let u in a)n.properties[u]=oe(a[u],t,{...o,path:[...o.path,"properties",u]});let s=new Set(Object.keys(a)),l=new Set([...s].filter(u=>{let d=i.shape[u]._zod;return t.io==="input"?d.optin===void 0:d.optout===void 0}));l.size>0&&(n.required=Array.from(l)),i.catchall?._zod.def.type==="never"?n.additionalProperties=!1:i.catchall?i.catchall&&(n.additionalProperties=oe(i.catchall,t,{...o,path:[...o.path,"additionalProperties"]})):t.io==="output"&&(n.additionalProperties=!1)},Hs=(e,t,r,o)=>{let n=e._zod.def,i=n.inclusive===!1,a=n.options.map((s,l)=>oe(s,t,{...o,path:[...o.path,i?"oneOf":"anyOf",l]}));i?r.oneOf=a:r.anyOf=a},Nm=(e,t,r,o)=>{let n=e._zod.def,i=oe(n.left,t,{...o,path:[...o.path,"allOf",0]}),a=oe(n.right,t,{...o,path:[...o.path,"allOf",1]}),s=u=>"allOf"in u&&Object.keys(u).length===1,l=[...s(i)?i.allOf:[i],...s(a)?a.allOf:[a]];r.allOf=l},Lm=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="array";let a=t.target==="draft-2020-12"?"prefixItems":"items",s=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",l=i.items.map((m,f)=>oe(m,t,{...o,path:[...o.path,a,f]})),u=i.rest?oe(i.rest,t,{...o,path:[...o.path,s,...t.target==="openapi-3.0"?[i.items.length]:[]]}):null;t.target==="draft-2020-12"?(n.prefixItems=l,u&&(n.items=u)):t.target==="openapi-3.0"?(n.items={anyOf:l},u&&n.items.anyOf.push(u),n.minItems=l.length,u||(n.maxItems=l.length)):(n.items=l,u&&(n.additionalItems=u));let{minimum:d,maximum:p}=e._zod.bag;typeof d=="number"&&(n.minItems=d),typeof p=="number"&&(n.maxItems=p)},Um=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="object";let a=i.keyType,l=a._zod.bag?.patterns;if(i.mode==="loose"&&l&&l.size>0){let d=oe(i.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});n.patternProperties={};for(let p of l)n.patternProperties[p.source]=d}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(n.propertyNames=oe(i.keyType,t,{...o,path:[...o.path,"propertyNames"]})),n.additionalProperties=oe(i.valueType,t,{...o,path:[...o.path,"additionalProperties"]});let u=a._zod.values;if(u){let d=[...u].filter(p=>typeof p=="string"||typeof p=="number");d.length>0&&(n.required=d)}},zm=(e,t,r,o)=>{let n=e._zod.def,i=oe(n.innerType,t,o),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=n.innerType,r.nullable=!0):r.anyOf=[i,{type:"null"}]},jm=(e,t,r,o)=>{let n=e._zod.def;oe(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},Fm=(e,t,r,o)=>{let n=e._zod.def;oe(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue))},Bm=(e,t,r,o)=>{let n=e._zod.def;oe(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(n.defaultValue)))},Mm=(e,t,r,o)=>{let n=e._zod.def;oe(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType;let a;try{a=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=a},Hm=(e,t,r,o)=>{let n=e._zod.def,i=n.in._zod.traits.has("$ZodTransform"),a=t.io==="input"?i?n.out:n.in:n.out;oe(a,t,o);let s=t.seen.get(e);s.ref=a},Zm=(e,t,r,o)=>{let n=e._zod.def;oe(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,r.readOnly=!0},Gm=(e,t,r,o)=>{let n=e._zod.def;oe(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},Zs=(e,t,r,o)=>{let n=e._zod.def;oe(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},Wm=(e,t,r,o)=>{let n=e._zod.innerType;oe(n,t,o);let i=t.seen.get(e);i.ref=n},Ms={string:um,number:dm,boolean:pm,bigint:mm,symbol:fm,null:gm,undefined:hm,void:vm,never:ym,any:bm,unknown:xm,date:km,enum:wm,literal:Sm,nan:_m,template_literal:$m,file:Im,success:Am,custom:Em,function:Pm,transform:Cm,map:Tm,set:Rm,array:Om,object:Dm,union:Hs,intersection:Nm,tuple:Lm,record:Um,nullable:zm,nonoptional:jm,default:Fm,prefault:Bm,catch:Mm,pipe:Hm,readonly:Zm,promise:Gm,optional:Zs,lazy:Wm};function Gs(e,t){if("_idmap"in e){let o=e,n=Un({...t,processors:Ms}),i={};for(let l of o._idmap.entries()){let[u,d]=l;oe(d,n)}let a={},s={registry:o,uri:t?.uri,defs:i};n.external=s;for(let l of o._idmap.entries()){let[u,d]=l;zn(n,d),a[u]=jn(n,d)}if(Object.keys(i).length>0){let l=n.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[l]:i}}return{schemas:a}}let r=Un({...t,processors:Ms});return oe(e,r),zn(r,e),jn(r,e)}var Ws=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let r=t?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=Un({processors:Ms,target:r,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,r={path:[],schemaPath:[]}){return oe(t,this.ctx,r)}emit(t,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),zn(this.ctx,t);let o=jn(this.ctx,t),{"~standard":n,...i}=o;return i}};var tx={};var ki={};Jt(ki,{ZodAny:()=>vf,ZodArray:()=>kf,ZodBase64:()=>mc,ZodBase64URL:()=>fc,ZodBigInt:()=>go,ZodBigIntFormat:()=>vc,ZodBoolean:()=>fo,ZodCIDRv4:()=>dc,ZodCIDRv6:()=>pc,ZodCUID:()=>oc,ZodCUID2:()=>ic,ZodCatch:()=>Hf,ZodCodec:()=>Oi,ZodCustom:()=>Di,ZodCustomStringFormat:()=>po,ZodDate:()=>Ei,ZodDefault:()=>Uf,ZodDiscriminatedUnion:()=>Sf,ZodE164:()=>gc,ZodEmail:()=>tc,ZodEmoji:()=>nc,ZodEnum:()=>lo,ZodExactOptional:()=>Df,ZodFile:()=>Rf,ZodFunction:()=>Qf,ZodGUID:()=>Si,ZodIPv4:()=>lc,ZodIPv6:()=>uc,ZodIntersection:()=>_f,ZodJWT:()=>hc,ZodKSUID:()=>cc,ZodLazy:()=>Kf,ZodLiteral:()=>Tf,ZodMAC:()=>uf,ZodMap:()=>Pf,ZodNaN:()=>Gf,ZodNanoID:()=>rc,ZodNever:()=>bf,ZodNonOptional:()=>Sc,ZodNull:()=>gf,ZodNullable:()=>Lf,ZodNumber:()=>mo,ZodNumberFormat:()=>sr,ZodObject:()=>Ci,ZodOptional:()=>wc,ZodPipe:()=>Ri,ZodPrefault:()=>jf,ZodPreprocess:()=>Wf,ZodPromise:()=>Yf,ZodReadonly:()=>Vf,ZodRecord:()=>co,ZodSet:()=>Cf,ZodString:()=>uo,ZodStringFormat:()=>ue,ZodSuccess:()=>Mf,ZodSymbol:()=>mf,ZodTemplateLiteral:()=>qf,ZodTransform:()=>Of,ZodTuple:()=>If,ZodType:()=>H,ZodULID:()=>ac,ZodURL:()=>Ai,ZodUUID:()=>Ut,ZodUndefined:()=>ff,ZodUnion:()=>Ti,ZodUnknown:()=>yf,ZodVoid:()=>xf,ZodXID:()=>sc,ZodXor:()=>wf,_ZodString:()=>ec,_default:()=>zf,_function:()=>uk,any:()=>Bx,array:()=>Pi,base64:()=>_x,base64url:()=>$x,bigint:()=>Lx,boolean:()=>pf,catch:()=>Zf,check:()=>dk,cidrv4:()=>wx,cidrv6:()=>Sx,codec:()=>ak,cuid:()=>fx,cuid2:()=>gx,custom:()=>pk,date:()=>Hx,describe:()=>mk,discriminatedUnion:()=>qx,e164:()=>Ix,email:()=>ox,emoji:()=>px,enum:()=>xc,exactOptional:()=>Nf,file:()=>nk,float32:()=>Rx,float64:()=>Ox,function:()=>uk,guid:()=>ix,hash:()=>Tx,hex:()=>Cx,hostname:()=>Px,httpUrl:()=>dx,instanceof:()=>gk,int:()=>Ys,int32:()=>Dx,int64:()=>Ux,intersection:()=>$f,invertCodec:()=>sk,ipv4:()=>bx,ipv6:()=>kx,json:()=>vk,jwt:()=>Ax,keyof:()=>Zx,ksuid:()=>yx,lazy:()=>Xf,literal:()=>tk,looseObject:()=>Vx,looseRecord:()=>Xx,mac:()=>xx,map:()=>Yx,meta:()=>fk,nan:()=>ik,nanoid:()=>mx,nativeEnum:()=>ek,never:()=>yc,nonoptional:()=>Bf,null:()=>hf,nullable:()=>$i,nullish:()=>rk,number:()=>df,object:()=>Gx,optional:()=>_i,partialRecord:()=>Kx,pipe:()=>Qs,prefault:()=>Ff,preprocess:()=>yk,promise:()=>lk,readonly:()=>Jf,record:()=>Ef,refine:()=>eg,set:()=>Qx,strictObject:()=>Wx,string:()=>wi,stringFormat:()=>Ex,stringbool:()=>hk,success:()=>ok,superRefine:()=>tg,symbol:()=>jx,templateLiteral:()=>ck,transform:()=>kc,tuple:()=>Af,uint32:()=>Nx,uint64:()=>zx,ulid:()=>hx,undefined:()=>Fx,union:()=>bc,unknown:()=>ar,url:()=>ux,uuid:()=>ax,uuidv4:()=>sx,uuidv6:()=>cx,uuidv7:()=>lx,void:()=>Mx,xid:()=>vx,xor:()=>Jx});var Vs={};Jt(Vs,{endsWith:()=>Yr,gt:()=>Nt,gte:()=>Be,includes:()=>Kr,length:()=>ir,lowercase:()=>Jr,lt:()=>Dt,lte:()=>ot,maxLength:()=>or,maxSize:()=>Ln,mime:()=>Qr,minLength:()=>rn,minSize:()=>Lt,multipleOf:()=>Nn,negative:()=>zs,nonnegative:()=>Fs,nonpositive:()=>js,normalize:()=>eo,overwrite:()=>St,positive:()=>Us,property:()=>Bs,regex:()=>Vr,size:()=>rr,slugify:()=>oo,startsWith:()=>Xr,toLowerCase:()=>no,toUpperCase:()=>ro,trim:()=>to,uppercase:()=>qr});var so={};Jt(so,{ZodISODate:()=>qs,ZodISODateTime:()=>Js,ZodISODuration:()=>Xs,ZodISOTime:()=>Ks,date:()=>Jm,datetime:()=>Vm,duration:()=>Km,time:()=>qm});var Js=v("ZodISODateTime",(e,t)=>{_d.init(e,t),ue.init(e,t)});function Vm(e){return Ep(Js,e)}var qs=v("ZodISODate",(e,t)=>{$d.init(e,t),ue.init(e,t)});function Jm(e){return Pp(qs,e)}var Ks=v("ZodISOTime",(e,t)=>{Id.init(e,t),ue.init(e,t)});function qm(e){return Cp(Ks,e)}var Xs=v("ZodISODuration",(e,t)=>{Ad.init(e,t),ue.init(e,t)});function Km(e){return Tp(Xs,e)}var nx=(e,t)=>{ci.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>ui(e,r)},flatten:{value:r=>li(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,zr,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,zr,2)}},isEmpty:{get(){return e.issues.length===0}}})},XC=v("ZodError",nx),Ye=v("ZodError",nx,{Parent:Error});var Xm=Br(Ye),Ym=Mr(Ye),Qm=Hr(Ye),ef=Zr(Ye),tf=Ga(Ye),nf=Wa(Ye),rf=Va(Ye),of=Ja(Ye),af=qa(Ye),sf=Ka(Ye),cf=Xa(Ye),lf=Ya(Ye);var rx=new WeakMap;function Ii(e,t,r){let o=Object.getPrototypeOf(e),n=rx.get(o);if(n||(n=new Set,rx.set(o,n)),!n.has(t)){n.add(t);for(let i in r){let a=r[i];Object.defineProperty(o,i,{configurable:!0,enumerable:!1,get(){let s=a.bind(this);return Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:s}),s},set(s){Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:s})}})}}}var H=v("ZodType",(e,t)=>(F.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:ao(e,"input"),output:ao(e,"output")}}),e.toJSONSchema=lm(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(r,o)=>Xm(e,r,o,{callee:e.parse}),e.safeParse=(r,o)=>Qm(e,r,o),e.parseAsync=async(r,o)=>Ym(e,r,o,{callee:e.parseAsync}),e.safeParseAsync=async(r,o)=>ef(e,r,o),e.spa=e.safeParseAsync,e.encode=(r,o)=>tf(e,r,o),e.decode=(r,o)=>nf(e,r,o),e.encodeAsync=async(r,o)=>rf(e,r,o),e.decodeAsync=async(r,o)=>of(e,r,o),e.safeEncode=(r,o)=>af(e,r,o),e.safeDecode=(r,o)=>sf(e,r,o),e.safeEncodeAsync=async(r,o)=>cf(e,r,o),e.safeDecodeAsync=async(r,o)=>lf(e,r,o),Ii(e,"ZodType",{check(...r){let o=this.def;return this.clone($.mergeDefs(o,{checks:[...o.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,o){return je(this,r,o)},brand(){return this},register(r,o){return r.add(this,o),this},refine(r,o){return this.check(eg(r,o))},superRefine(r,o){return this.check(tg(r,o))},overwrite(r){return this.check(St(r))},optional(){return _i(this)},exactOptional(){return Nf(this)},nullable(){return $i(this)},nullish(){return _i($i(this))},nonoptional(r){return Bf(this,r)},array(){return Pi(this)},or(r){return bc([this,r])},and(r){return $f(this,r)},transform(r){return Qs(this,kc(r))},default(r){return zf(this,r)},prefault(r){return Ff(this,r)},catch(r){return Zf(this,r)},pipe(r){return Qs(this,r)},readonly(){return Jf(this)},describe(r){let o=this.clone();return Ce.add(o,{description:r}),o},meta(...r){if(r.length===0)return Ce.get(this);let o=this.clone();return Ce.add(o,r[0]),o},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(e,"description",{get(){return Ce.get(e)?.description},configurable:!0}),e)),ec=v("_ZodString",(e,t)=>{nr.init(e,t),H.init(e,t),e._zod.processJSONSchema=(o,n,i)=>um(e,o,n,i);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,Ii(e,"_ZodString",{regex(...o){return this.check(Vr(...o))},includes(...o){return this.check(Kr(...o))},startsWith(...o){return this.check(Xr(...o))},endsWith(...o){return this.check(Yr(...o))},min(...o){return this.check(rn(...o))},max(...o){return this.check(or(...o))},length(...o){return this.check(ir(...o))},nonempty(...o){return this.check(rn(1,...o))},lowercase(o){return this.check(Jr(o))},uppercase(o){return this.check(qr(o))},trim(){return this.check(to())},normalize(...o){return this.check(eo(...o))},toLowerCase(){return this.check(no())},toUpperCase(){return this.check(ro())},slugify(){return this.check(oo())}})}),uo=v("ZodString",(e,t)=>{nr.init(e,t),ec.init(e,t),e.email=r=>e.check(vs(tc,r)),e.url=r=>e.check(xi(Ai,r)),e.jwt=r=>e.check(Ls(hc,r)),e.emoji=r=>e.check(ws(nc,r)),e.guid=r=>e.check(bi(Si,r)),e.uuid=r=>e.check(ys(Ut,r)),e.uuidv4=r=>e.check(bs(Ut,r)),e.uuidv6=r=>e.check(xs(Ut,r)),e.uuidv7=r=>e.check(ks(Ut,r)),e.nanoid=r=>e.check(Ss(rc,r)),e.guid=r=>e.check(bi(Si,r)),e.cuid=r=>e.check(_s(oc,r)),e.cuid2=r=>e.check($s(ic,r)),e.ulid=r=>e.check(Is(ac,r)),e.base64=r=>e.check(Os(mc,r)),e.base64url=r=>e.check(Ds(fc,r)),e.xid=r=>e.check(As(sc,r)),e.ksuid=r=>e.check(Es(cc,r)),e.ipv4=r=>e.check(Ps(lc,r)),e.ipv6=r=>e.check(Cs(uc,r)),e.cidrv4=r=>e.check(Ts(dc,r)),e.cidrv6=r=>e.check(Rs(pc,r)),e.e164=r=>e.check(Ns(gc,r)),e.datetime=r=>e.check(Vm(r)),e.date=r=>e.check(Jm(r)),e.time=r=>e.check(qm(r)),e.duration=r=>e.check(Km(r))});function wi(e){return _p(uo,e)}var ue=v("ZodStringFormat",(e,t)=>{le.init(e,t),ec.init(e,t)}),tc=v("ZodEmail",(e,t)=>{gd.init(e,t),ue.init(e,t)});function ox(e){return vs(tc,e)}var Si=v("ZodGUID",(e,t)=>{md.init(e,t),ue.init(e,t)});function ix(e){return bi(Si,e)}var Ut=v("ZodUUID",(e,t)=>{fd.init(e,t),ue.init(e,t)});function ax(e){return ys(Ut,e)}function sx(e){return bs(Ut,e)}function cx(e){return xs(Ut,e)}function lx(e){return ks(Ut,e)}var Ai=v("ZodURL",(e,t)=>{hd.init(e,t),ue.init(e,t)});function ux(e){return xi(Ai,e)}function dx(e){return xi(Ai,{protocol:rt.httpProtocol,hostname:rt.domain,...$.normalizeParams(e)})}var nc=v("ZodEmoji",(e,t)=>{vd.init(e,t),ue.init(e,t)});function px(e){return ws(nc,e)}var rc=v("ZodNanoID",(e,t)=>{yd.init(e,t),ue.init(e,t)});function mx(e){return Ss(rc,e)}var oc=v("ZodCUID",(e,t)=>{bd.init(e,t),ue.init(e,t)});function fx(e){return _s(oc,e)}var ic=v("ZodCUID2",(e,t)=>{xd.init(e,t),ue.init(e,t)});function gx(e){return $s(ic,e)}var ac=v("ZodULID",(e,t)=>{kd.init(e,t),ue.init(e,t)});function hx(e){return Is(ac,e)}var sc=v("ZodXID",(e,t)=>{wd.init(e,t),ue.init(e,t)});function vx(e){return As(sc,e)}var cc=v("ZodKSUID",(e,t)=>{Sd.init(e,t),ue.init(e,t)});function yx(e){return Es(cc,e)}var lc=v("ZodIPv4",(e,t)=>{Ed.init(e,t),ue.init(e,t)});function bx(e){return Ps(lc,e)}var uf=v("ZodMAC",(e,t)=>{Cd.init(e,t),ue.init(e,t)});function xx(e){return Ip(uf,e)}var uc=v("ZodIPv6",(e,t)=>{Pd.init(e,t),ue.init(e,t)});function kx(e){return Cs(uc,e)}var dc=v("ZodCIDRv4",(e,t)=>{Td.init(e,t),ue.init(e,t)});function wx(e){return Ts(dc,e)}var pc=v("ZodCIDRv6",(e,t)=>{Rd.init(e,t),ue.init(e,t)});function Sx(e){return Rs(pc,e)}var mc=v("ZodBase64",(e,t)=>{Dd.init(e,t),ue.init(e,t)});function _x(e){return Os(mc,e)}var fc=v("ZodBase64URL",(e,t)=>{Nd.init(e,t),ue.init(e,t)});function $x(e){return Ds(fc,e)}var gc=v("ZodE164",(e,t)=>{Ld.init(e,t),ue.init(e,t)});function Ix(e){return Ns(gc,e)}var hc=v("ZodJWT",(e,t)=>{Ud.init(e,t),ue.init(e,t)});function Ax(e){return Ls(hc,e)}var po=v("ZodCustomStringFormat",(e,t)=>{zd.init(e,t),ue.init(e,t)});function Ex(e,t,r={}){return io(po,e,t,r)}function Px(e){return io(po,"hostname",rt.hostname,e)}function Cx(e){return io(po,"hex",rt.hex,e)}function Tx(e,t){let r=t?.enc??"hex",o=`${e}_${r}`,n=rt[o];if(!n)throw new Error(`Unrecognized hash format: ${o}`);return io(po,o,n,t)}var mo=v("ZodNumber",(e,t)=>{ss.init(e,t),H.init(e,t),e._zod.processJSONSchema=(o,n,i)=>dm(e,o,n,i),Ii(e,"ZodNumber",{gt(o,n){return this.check(Nt(o,n))},gte(o,n){return this.check(Be(o,n))},min(o,n){return this.check(Be(o,n))},lt(o,n){return this.check(Dt(o,n))},lte(o,n){return this.check(ot(o,n))},max(o,n){return this.check(ot(o,n))},int(o){return this.check(Ys(o))},safe(o){return this.check(Ys(o))},positive(o){return this.check(Nt(0,o))},nonnegative(o){return this.check(Be(0,o))},negative(o){return this.check(Dt(0,o))},nonpositive(o){return this.check(ot(0,o))},multipleOf(o,n){return this.check(Nn(o,n))},step(o,n){return this.check(Nn(o,n))},finite(){return this}});let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function df(e){return Rp(mo,e)}var sr=v("ZodNumberFormat",(e,t)=>{jd.init(e,t),mo.init(e,t)});function Ys(e){return Dp(sr,e)}function Rx(e){return Np(sr,e)}function Ox(e){return Lp(sr,e)}function Dx(e){return Up(sr,e)}function Nx(e){return zp(sr,e)}var fo=v("ZodBoolean",(e,t)=>{fi.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,o,n)=>pm(e,r,o,n)});function pf(e){return jp(fo,e)}var go=v("ZodBigInt",(e,t)=>{cs.init(e,t),H.init(e,t),e._zod.processJSONSchema=(o,n,i)=>mm(e,o,n,i),e.gte=(o,n)=>e.check(Be(o,n)),e.min=(o,n)=>e.check(Be(o,n)),e.gt=(o,n)=>e.check(Nt(o,n)),e.gte=(o,n)=>e.check(Be(o,n)),e.min=(o,n)=>e.check(Be(o,n)),e.lt=(o,n)=>e.check(Dt(o,n)),e.lte=(o,n)=>e.check(ot(o,n)),e.max=(o,n)=>e.check(ot(o,n)),e.positive=o=>e.check(Nt(BigInt(0),o)),e.negative=o=>e.check(Dt(BigInt(0),o)),e.nonpositive=o=>e.check(ot(BigInt(0),o)),e.nonnegative=o=>e.check(Be(BigInt(0),o)),e.multipleOf=(o,n)=>e.check(Nn(o,n));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});function Lx(e){return Bp(go,e)}var vc=v("ZodBigIntFormat",(e,t)=>{Fd.init(e,t),go.init(e,t)});function Ux(e){return Hp(vc,e)}function zx(e){return Zp(vc,e)}var mf=v("ZodSymbol",(e,t)=>{Bd.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,o,n)=>fm(e,r,o,n)});function jx(e){return Gp(mf,e)}var ff=v("ZodUndefined",(e,t)=>{Md.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,o,n)=>hm(e,r,o,n)});function Fx(e){return Wp(ff,e)}var gf=v("ZodNull",(e,t)=>{Hd.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,o,n)=>gm(e,r,o,n)});function hf(e){return Vp(gf,e)}var vf=v("ZodAny",(e,t)=>{Zd.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,o,n)=>bm(e,r,o,n)});function Bx(){return Jp(vf)}var yf=v("ZodUnknown",(e,t)=>{Gd.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,o,n)=>xm(e,r,o,n)});function ar(){return qp(yf)}var bf=v("ZodNever",(e,t)=>{Wd.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ym(e,r,o,n)});function yc(e){return Kp(bf,e)}var xf=v("ZodVoid",(e,t)=>{Vd.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,o,n)=>vm(e,r,o,n)});function Mx(e){return Xp(xf,e)}var Ei=v("ZodDate",(e,t)=>{Jd.init(e,t),H.init(e,t),e._zod.processJSONSchema=(o,n,i)=>km(e,o,n,i),e.min=(o,n)=>e.check(Be(o,n)),e.max=(o,n)=>e.check(ot(o,n));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});function Hx(e){return Yp(Ei,e)}var kf=v("ZodArray",(e,t)=>{qd.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Om(e,r,o,n),e.element=t.element,Ii(e,"ZodArray",{min(r,o){return this.check(rn(r,o))},nonempty(r){return this.check(rn(1,r))},max(r,o){return this.check(or(r,o))},length(r,o){return this.check(ir(r,o))},unwrap(){return this.element}})});function Pi(e,t){return tm(kf,e,t)}function Zx(e){let t=e._zod.def.shape;return xc(Object.keys(t))}var Ci=v("ZodObject",(e,t)=>{Kd.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Dm(e,r,o,n),$.defineLazy(e,"shape",()=>t.shape),Ii(e,"ZodObject",{keyof(){return xc(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:ar()})},loose(){return this.clone({...this._zod.def,catchall:ar()})},strict(){return this.clone({...this._zod.def,catchall:yc()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return $.extend(this,r)},safeExtend(r){return $.safeExtend(this,r)},merge(r){return $.merge(this,r)},pick(r){return $.pick(this,r)},omit(r){return $.omit(this,r)},partial(...r){return $.partial(wc,this,r[0])},required(...r){return $.required(Sc,this,r[0])}})});function Gx(e,t){let r={type:"object",shape:e??{},...$.normalizeParams(t)};return new Ci(r)}function Wx(e,t){return new Ci({type:"object",shape:e,catchall:yc(),...$.normalizeParams(t)})}function Vx(e,t){return new Ci({type:"object",shape:e,catchall:ar(),...$.normalizeParams(t)})}var Ti=v("ZodUnion",(e,t)=>{gi.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Hs(e,r,o,n),e.options=t.options});function bc(e,t){return new Ti({type:"union",options:e,...$.normalizeParams(t)})}var wf=v("ZodXor",(e,t)=>{Ti.init(e,t),Xd.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Hs(e,r,o,n),e.options=t.options});function Jx(e,t){return new wf({type:"union",options:e,inclusive:!1,...$.normalizeParams(t)})}var Sf=v("ZodDiscriminatedUnion",(e,t)=>{Ti.init(e,t),Yd.init(e,t)});function qx(e,t,r){return new Sf({type:"union",options:t,discriminator:e,...$.normalizeParams(r)})}var _f=v("ZodIntersection",(e,t)=>{Qd.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Nm(e,r,o,n)});function $f(e,t){return new _f({type:"intersection",left:e,right:t})}var If=v("ZodTuple",(e,t)=>{ls.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Lm(e,r,o,n),e.rest=r=>e.clone({...e._zod.def,rest:r})});function Af(e,t,r){let o=t instanceof F,n=o?r:t,i=o?t:null;return new If({type:"tuple",items:e,rest:i,...$.normalizeParams(n)})}var co=v("ZodRecord",(e,t)=>{ep.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Um(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType});function Ef(e,t,r){return!t||!t._zod?new co({type:"record",keyType:wi(),valueType:e,...$.normalizeParams(t)}):new co({type:"record",keyType:e,valueType:t,...$.normalizeParams(r)})}function Kx(e,t,r){let o=je(e);return o._zod.values=void 0,new co({type:"record",keyType:o,valueType:t,...$.normalizeParams(r)})}function Xx(e,t,r){return new co({type:"record",keyType:e,valueType:t,mode:"loose",...$.normalizeParams(r)})}var Pf=v("ZodMap",(e,t)=>{tp.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Tm(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...r)=>e.check(Lt(...r)),e.nonempty=r=>e.check(Lt(1,r)),e.max=(...r)=>e.check(Ln(...r)),e.size=(...r)=>e.check(rr(...r))});function Yx(e,t,r){return new Pf({type:"map",keyType:e,valueType:t,...$.normalizeParams(r)})}var Cf=v("ZodSet",(e,t)=>{np.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Rm(e,r,o,n),e.min=(...r)=>e.check(Lt(...r)),e.nonempty=r=>e.check(Lt(1,r)),e.max=(...r)=>e.check(Ln(...r)),e.size=(...r)=>e.check(rr(...r))});function Qx(e,t){return new Cf({type:"set",valueType:e,...$.normalizeParams(t)})}var lo=v("ZodEnum",(e,t)=>{rp.init(e,t),H.init(e,t),e._zod.processJSONSchema=(o,n,i)=>wm(e,o,n,i),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(o,n)=>{let i={};for(let a of o)if(r.has(a))i[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new lo({...t,checks:[],...$.normalizeParams(n),entries:i})},e.exclude=(o,n)=>{let i={...t.entries};for(let a of o)if(r.has(a))delete i[a];else throw new Error(`Key ${a} not found in enum`);return new lo({...t,checks:[],...$.normalizeParams(n),entries:i})}});function xc(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new lo({type:"enum",entries:r,...$.normalizeParams(t)})}function ek(e,t){return new lo({type:"enum",entries:e,...$.normalizeParams(t)})}var Tf=v("ZodLiteral",(e,t)=>{op.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Sm(e,r,o,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function tk(e,t){return new Tf({type:"literal",values:Array.isArray(e)?e:[e],...$.normalizeParams(t)})}var Rf=v("ZodFile",(e,t)=>{ip.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Im(e,r,o,n),e.min=(r,o)=>e.check(Lt(r,o)),e.max=(r,o)=>e.check(Ln(r,o)),e.mime=(r,o)=>e.check(Qr(Array.isArray(r)?r:[r],o))});function nk(e){return nm(Rf,e)}var Of=v("ZodTransform",(e,t)=>{ap.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Cm(e,r,o,n),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Cn(e.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push($.issue(i,r.value,t));else{let a=i;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=e),r.issues.push($.issue(a))}};let n=t.transform(r.value,r);return n instanceof Promise?n.then(i=>(r.value=i,r.fallback=!0,r)):(r.value=n,r.fallback=!0,r)}});function kc(e){return new Of({type:"transform",transform:e})}var wc=v("ZodOptional",(e,t)=>{us.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Zs(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function _i(e){return new wc({type:"optional",innerType:e})}var Df=v("ZodExactOptional",(e,t)=>{sp.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Zs(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Nf(e){return new Df({type:"optional",innerType:e})}var Lf=v("ZodNullable",(e,t)=>{cp.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,o,n)=>zm(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function $i(e){return new Lf({type:"nullable",innerType:e})}function rk(e){return _i($i(e))}var Uf=v("ZodDefault",(e,t)=>{lp.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Fm(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function zf(e,t){return new Uf({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():$.shallowClone(t)}})}var jf=v("ZodPrefault",(e,t)=>{up.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Bm(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Ff(e,t){return new jf({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():$.shallowClone(t)}})}var Sc=v("ZodNonOptional",(e,t)=>{dp.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,o,n)=>jm(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Bf(e,t){return new Sc({type:"nonoptional",innerType:e,...$.normalizeParams(t)})}var Mf=v("ZodSuccess",(e,t)=>{pp.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Am(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function ok(e){return new Mf({type:"success",innerType:e})}var Hf=v("ZodCatch",(e,t)=>{mp.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Mm(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Zf(e,t){return new Hf({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}var Gf=v("ZodNaN",(e,t)=>{fp.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,o,n)=>_m(e,r,o,n)});function ik(e){return em(Gf,e)}var Ri=v("ZodPipe",(e,t)=>{ds.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Hm(e,r,o,n),e.in=t.in,e.out=t.out});function Qs(e,t){return new Ri({type:"pipe",in:e,out:t})}var Oi=v("ZodCodec",(e,t)=>{Ri.init(e,t),hi.init(e,t)});function ak(e,t,r){return new Oi({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}function sk(e){let t=e._zod.def;return new Oi({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}var Wf=v("ZodPreprocess",(e,t)=>{Ri.init(e,t),gp.init(e,t)}),Vf=v("ZodReadonly",(e,t)=>{hp.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Zm(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Jf(e){return new Vf({type:"readonly",innerType:e})}var qf=v("ZodTemplateLiteral",(e,t)=>{vp.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,o,n)=>$m(e,r,o,n)});function ck(e,t){return new qf({type:"template_literal",parts:e,...$.normalizeParams(t)})}var Kf=v("ZodLazy",(e,t)=>{xp.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Wm(e,r,o,n),e.unwrap=()=>e._zod.def.getter()});function Xf(e){return new Kf({type:"lazy",getter:e})}var Yf=v("ZodPromise",(e,t)=>{bp.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Gm(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function lk(e){return new Yf({type:"promise",innerType:e})}var Qf=v("ZodFunction",(e,t)=>{yp.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Pm(e,r,o,n)});function uk(e){return new Qf({type:"function",input:Array.isArray(e?.input)?Af(e?.input):e?.input??Pi(ar()),output:e?.output??ar()})}var Di=v("ZodCustom",(e,t)=>{kp.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Em(e,r,o,n)});function dk(e){let t=new pe({check:"custom"});return t._zod.check=e,t}function pk(e,t){return rm(Di,e??(()=>!0),t)}function eg(e,t={}){return om(Di,e,t)}function tg(e,t){return im(e,t)}var mk=am,fk=sm;function gk(e,t={}){let r=new Di({type:"custom",check:"custom",fn:o=>o instanceof e,abort:!0,...$.normalizeParams(t)});return r._zod.bag.Class=e,r._zod.check=o=>{o.value instanceof e||o.issues.push({code:"invalid_type",expected:e.name,input:o.value,inst:r,path:[...r._zod.def.path??[]]})},r}var hk=(...e)=>cm({Codec:Oi,Boolean:fo,String:uo},...e);function vk(e){let t=Xf(()=>bc([wi(e),df(),pf(),hf(),Pi(t),Ef(wi(),t)]));return t}function yk(e,t){return new Wf({type:"pipe",in:kc(e),out:t})}var QC={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function eT(e){be({customError:e})}function tT(){return be().customError}var ng;ng||(ng={});var T={...ki,...Vs,iso:so},nT=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function rT(e,t){let r=e.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function oT(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=e.slice(1).split("/").filter(Boolean);if(r.length===0)return t.rootSchema;let o=t.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===o){let n=r[1];if(!n||!t.defs[n])throw new Error(`Reference not found: ${e}`);return t.defs[n]}throw new Error(`Reference not found: ${e}`)}function bk(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return T.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let n=e.$ref;if(t.refs.has(n))return t.refs.get(n);if(t.processing.has(n))return T.lazy(()=>{if(!t.refs.has(n))throw new Error(`Circular reference not resolved: ${n}`);return t.refs.get(n)});t.processing.add(n);let i=oT(n,t),a=De(i,t);return t.refs.set(n,a),t.processing.delete(n),a}if(e.enum!==void 0){let n=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&n.length===1&&n[0]===null)return T.null();if(n.length===0)return T.never();if(n.length===1)return T.literal(n[0]);if(n.every(a=>typeof a=="string"))return T.enum(n);let i=n.map(a=>T.literal(a));return i.length<2?i[0]:T.union([i[0],i[1],...i.slice(2)])}if(e.const!==void 0)return T.literal(e.const);let r=e.type;if(Array.isArray(r)){let n=r.map(i=>{let a={...e,type:i};return bk(a,t)});return n.length===0?T.never():n.length===1?n[0]:T.union(n)}if(!r)return T.any();let o;switch(r){case"string":{let n=T.string();if(e.format){let i=e.format;i==="email"?n=n.check(T.email()):i==="uri"||i==="uri-reference"?n=n.check(T.url()):i==="uuid"||i==="guid"?n=n.check(T.uuid()):i==="date-time"?n=n.check(T.iso.datetime()):i==="date"?n=n.check(T.iso.date()):i==="time"?n=n.check(T.iso.time()):i==="duration"?n=n.check(T.iso.duration()):i==="ipv4"?n=n.check(T.ipv4()):i==="ipv6"?n=n.check(T.ipv6()):i==="mac"?n=n.check(T.mac()):i==="cidr"?n=n.check(T.cidrv4()):i==="cidr-v6"?n=n.check(T.cidrv6()):i==="base64"?n=n.check(T.base64()):i==="base64url"?n=n.check(T.base64url()):i==="e164"?n=n.check(T.e164()):i==="jwt"?n=n.check(T.jwt()):i==="emoji"?n=n.check(T.emoji()):i==="nanoid"?n=n.check(T.nanoid()):i==="cuid"?n=n.check(T.cuid()):i==="cuid2"?n=n.check(T.cuid2()):i==="ulid"?n=n.check(T.ulid()):i==="xid"?n=n.check(T.xid()):i==="ksuid"&&(n=n.check(T.ksuid()))}typeof e.minLength=="number"&&(n=n.min(e.minLength)),typeof e.maxLength=="number"&&(n=n.max(e.maxLength)),e.pattern&&(n=n.regex(new RegExp(e.pattern))),o=n;break}case"number":case"integer":{let n=r==="integer"?T.number().int():T.number();typeof e.minimum=="number"&&(n=n.min(e.minimum)),typeof e.maximum=="number"&&(n=n.max(e.maximum)),typeof e.exclusiveMinimum=="number"?n=n.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(n=n.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?n=n.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(n=n.lt(e.maximum)),typeof e.multipleOf=="number"&&(n=n.multipleOf(e.multipleOf)),o=n;break}case"boolean":{o=T.boolean();break}case"null":{o=T.null();break}case"object":{let n={},i=e.properties||{},a=new Set(e.required||[]);for(let[l,u]of Object.entries(i)){let d=De(u,t);n[l]=a.has(l)?d:d.optional()}if(e.propertyNames){let l=De(e.propertyNames,t),u=e.additionalProperties&&typeof e.additionalProperties=="object"?De(e.additionalProperties,t):T.any();if(Object.keys(n).length===0){o=T.record(l,u);break}let d=T.object(n).passthrough(),p=T.looseRecord(l,u);o=T.intersection(d,p);break}if(e.patternProperties){let l=e.patternProperties,u=Object.keys(l),d=[];for(let m of u){let f=De(l[m],t),g=T.string().regex(new RegExp(m));d.push(T.looseRecord(g,f))}let p=[];if(Object.keys(n).length>0&&p.push(T.object(n).passthrough()),p.push(...d),p.length===0)o=T.object({}).passthrough();else if(p.length===1)o=p[0];else{let m=T.intersection(p[0],p[1]);for(let f=2;f<p.length;f++)m=T.intersection(m,p[f]);o=m}break}let s=T.object(n);e.additionalProperties===!1?o=s.strict():typeof e.additionalProperties=="object"?o=s.catchall(De(e.additionalProperties,t)):o=s.passthrough();break}case"array":{let n=e.prefixItems,i=e.items;if(n&&Array.isArray(n)){let a=n.map(l=>De(l,t)),s=i&&typeof i=="object"&&!Array.isArray(i)?De(i,t):void 0;s?o=T.tuple(a).rest(s):o=T.tuple(a),typeof e.minItems=="number"&&(o=o.check(T.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(T.maxLength(e.maxItems)))}else if(Array.isArray(i)){let a=i.map(l=>De(l,t)),s=e.additionalItems&&typeof e.additionalItems=="object"?De(e.additionalItems,t):void 0;s?o=T.tuple(a).rest(s):o=T.tuple(a),typeof e.minItems=="number"&&(o=o.check(T.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(T.maxLength(e.maxItems)))}else if(i!==void 0){let a=De(i,t),s=T.array(a);typeof e.minItems=="number"&&(s=s.min(e.minItems)),typeof e.maxItems=="number"&&(s=s.max(e.maxItems)),o=s}else o=T.array(T.any());break}default:throw new Error(`Unsupported type: ${r}`)}return o}function De(e,t){if(typeof e=="boolean")return e?T.any():T.never();let r=bk(e,t),o=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let s=e.anyOf.map(u=>De(u,t)),l=T.union(s);r=o?T.intersection(r,l):l}if(e.oneOf&&Array.isArray(e.oneOf)){let s=e.oneOf.map(u=>De(u,t)),l=T.xor(s);r=o?T.intersection(r,l):l}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=o?r:T.any();else{let s=o?r:De(e.allOf[0],t),l=o?0:1;for(let u=l;u<e.allOf.length;u++)s=T.intersection(s,De(e.allOf[u],t));r=s}e.nullable===!0&&t.version==="openapi-3.0"&&(r=T.nullable(r)),e.readOnly===!0&&(r=T.readonly(r)),e.default!==void 0&&(r=r.default(e.default));let n={},i=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let s of i)s in e&&(n[s]=e[s]);let a=["contentEncoding","contentMediaType","contentSchema"];for(let s of a)s in e&&(n[s]=e[s]);for(let s of Object.keys(e))nT.has(s)||(n[s]=e[s]);return Object.keys(n).length>0&&t.registry.add(r,n),e.description&&(r=r.describe(e.description)),r}function xk(e,t){if(typeof e=="boolean")return e?T.any():T.never();let r;try{r=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let o=rT(r,t?.defaultTarget),n=r.$defs||r.definitions||{},i={version:o,defs:n,refs:new Map,processing:new Set,rootSchema:r,registry:t?.registry??Ce};return De(r,i)}var rg={};Jt(rg,{bigint:()=>cT,boolean:()=>sT,date:()=>lT,number:()=>aT,string:()=>iT});function iT(e){return $p(uo,e)}function aT(e){return Op(mo,e)}function sT(e){return Fp(fo,e)}function cT(e){return Mp(go,e)}function lT(e){return Qp(Ei,e)}be(ps());var ie=c.number().min(0).max(100),cr=c.number().int().min(1e3).max(12e3),cn=c.number(),Z=c.number().int().nonnegative(),_t=c.enum(["hue","matter","smartthings","homeassistant","nest","alexa","google","kasa","wiz","lifx","shelly","govee","tapo","tuya","yeelight","nanoleaf","meross","ewelink","wled","elgato","roku","mqtt","esphome","mock","other"]),uT=c.enum(["local","cloud","offline","unknown"]),Ni=c.enum(["light","plug","switch","dimmer","thermostat","lock","cover","garageDoor","valve","fan","sensor","binarySensor","camera","doorbell","speaker","tv","mediaPlayer","vacuum","appliance","airPurifier","humidifier","waterHeater","evCharger","sceneController","remote","scene","group","bridge","other"]),dT=c.enum(["temperature","humidity","illuminance","pressure","co2","pm25","pm10","voc","airQuality","noise","uvIndex","windSpeed","distance","generic"]),pT=c.enum(["motion","occupancy","presence","contact","leak","smoke","co","gas","tamper","vibration","glassBreak","button","person","sound","moisture","generic"]);var me=(e,t)=>c.object({type:c.literal(e),instance:c.string().optional(),...t}),mT=me("power",{state:c.object({on:c.boolean().nullable()})}),fT=me("brightness",{state:c.object({level:ie.nullable()})}),gT=me("colorTemperature",{config:c.object({minKelvin:cr,maxKelvin:cr}),state:c.object({kelvin:cr.nullable()})}),hT=me("color",{config:c.object({modes:c.array(c.enum(["hs","rgb","xy"])).default(["hs"])}),state:c.object({hue:c.number().min(0).max(360).nullable(),saturation:ie.nullable()})}),vT=me("segmentColor",{config:c.object({segments:c.number().int().min(1)}),state:c.object({colors:c.array(c.object({hue:c.number().min(0).max(360).nullable(),saturation:ie.nullable()})).nullable()})}),ag=c.enum(["off","heat","cool","auto","eco","fanOnly","dry"]),yT=me("thermostat",{config:c.object({modes:c.array(ag),minC:cn,maxC:cn,supportsRange:c.boolean().default(!1)}),state:c.object({mode:ag.nullable(),currentC:cn.nullable(),setpointC:cn.nullable().optional(),heatC:cn.nullable().optional(),coolC:cn.nullable().optional(),action:c.enum(["idle","heating","cooling","fan"]).nullable().optional()})}),bT=me("humidity",{config:c.object({settable:c.boolean().default(!1),minPct:ie.default(0),maxPct:ie.default(100)}),state:c.object({currentPct:ie.nullable().optional(),targetPct:ie.nullable().optional()})}),xT=me("lock",{state:c.object({state:c.enum(["locked","unlocked","jammed","unknown"])})}),kT=me("cover",{config:c.object({kind:c.enum(["blind","shade","curtain","awning","garage","door","window","valve","generic"]),supportsPosition:c.boolean().default(!1),supportsTilt:c.boolean().default(!1)}),state:c.object({position:ie.nullable().optional(),tilt:ie.nullable().optional(),state:c.enum(["open","closed","opening","closing","stopped","partial","unknown"])})}),wT=me("fan",{config:c.object({presets:c.array(c.string()).default([]),supportsOscillate:c.boolean().default(!1)}),state:c.object({on:c.boolean().nullable(),level:ie.nullable().optional(),preset:c.string().nullable().optional(),oscillating:c.boolean().nullable().optional()})}),ST=me("mode",{config:c.object({options:c.array(c.string())}),state:c.object({value:c.string().nullable()})}),_T=me("toggle",{state:c.object({on:c.boolean().nullable()})}),$T=me("range",{config:c.object({min:c.number(),max:c.number(),step:c.number().optional(),unit:c.string().optional()}),state:c.object({value:c.number().nullable()})}),IT=me("mediaTransport",{state:c.object({state:c.enum(["playing","paused","stopped","buffering","idle"]).nullable(),metadata:c.object({title:c.string().optional(),artist:c.string().optional(),album:c.string().optional(),artworkUrl:c.string().optional()}).nullable().optional(),positionSec:c.number().nonnegative().nullable().optional(),durationSec:c.number().nonnegative().nullable().optional(),shuffle:c.boolean().nullable().optional(),repeat:c.enum(["off","one","all"]).nullable().optional()})}),AT=me("volume",{state:c.object({level:ie.nullable(),muted:c.boolean().nullable()})}),ET=me("inputSource",{config:c.object({sources:c.array(c.string())}),state:c.object({source:c.string().nullable()})}),PT=me("startStop",{config:c.object({supportsPause:c.boolean().default(!1)}),state:c.object({state:c.enum(["running","paused","stopped","unknown"])})}),CT=me("scene",{state:c.object({lastActivated:Z.nullable().optional()})}),TT=me("camera",{config:c.object({protocols:c.array(c.enum(["rtsp","webrtc","hls","snapshot"]))}),state:c.object({streaming:c.boolean().nullable().optional()})}),RT=me("sensor",{config:c.object({measurement:dT,unit:c.string()}),state:c.object({value:c.number().nullable(),ts:Z.nullable().optional()})}),OT=me("binarySensor",{config:c.object({sensorType:pT}),state:c.object({active:c.boolean().nullable(),lastChanged:Z.nullable().optional()})}),DT=me("battery",{state:c.object({level:ie.nullable(),charging:c.boolean().nullable().optional(),low:c.boolean().nullable().optional()})}),NT=me("energyMeter",{state:c.object({power:c.number().nullable().optional(),energy:c.number().nullable().optional(),voltage:c.number().nullable().optional(),current:c.number().nullable().optional()})}),LT=me("doorbell",{state:c.object({lastPress:Z.nullable().optional()})}),UT=me("connectivity",{config:c.object({transport:c.enum(["wifi","thread","zigbee","zwave","ethernet","ble","cloud","matter","unknown"])}),state:c.object({online:c.boolean().nullable(),signal:c.number().nullable().optional()})}),kk=c.enum(["flash","strobe","pulse","colorFade","colorLoop","candle","rainbow","siren","meter"]),an=c.object({hue:c.number().min(0).max(360),saturation:ie}),sn=c.number().int().min(20).max(6e5),og=c.number().int().min(1).max(1e3).nullable().default(null),sg=c.discriminatedUnion("kind",[c.object({kind:c.literal("flash"),count:c.number().int().min(1).max(100).default(3),onMs:sn.default(300),offMs:sn.default(300),color:an.nullable().default(null),brightness:ie.nullable().default(null)}),c.object({kind:c.literal("strobe"),hz:c.number().min(.5).max(25).default(8),durationMs:sn.default(3e3),color:an.nullable().default(null)}),c.object({kind:c.literal("pulse"),periodMs:sn.default(2e3),minPct:ie.default(5),maxPct:ie.default(100),color:an.nullable().default(null),cycles:og}),c.object({kind:c.literal("colorFade"),from:an.nullable().default(null),to:an,durationMs:sn.default(2e3),easing:c.enum(["linear","ease"]).default("ease")}),c.object({kind:c.literal("colorLoop"),colors:c.array(an).min(2).max(16),holdMs:sn.default(1e3),fadeMs:c.number().int().min(0).max(6e5).default(800),loops:og,direction:c.enum(["forward","pingpong"]).default("forward")}),c.object({kind:c.literal("candle"),intensity:ie.default(50),warmthKelvin:cr.nullable().default(null),durationMs:sn.nullable().default(null)}),c.object({kind:c.literal("rainbow"),cycleMs:sn.default(4e3),saturation:ie.default(100),brightness:ie.default(100),loops:og}),c.object({kind:c.literal("siren"),colorA:an.default({hue:0,saturation:100}),colorB:an.default({hue:240,saturation:100}),hz:c.number().min(.5).max(10).default(4),durationMs:sn.nullable().default(null)}),c.object({kind:c.literal("meter"),source:c.enum(["context","usage","cost"]),stops:c.array(c.object({at:c.number().min(0),color:an})).min(2).max(6).default([{at:0,color:{hue:120,saturation:90}},{at:75,color:{hue:40,saturation:95}},{at:95,color:{hue:0,saturation:95}}])})]),zT=me("effect",{config:c.object({kinds:c.array(kk).default(["flash"]),supportsColor:c.boolean().default(!1)}),state:c.object({active:kk.nullable()})}),jT=c.discriminatedUnion("type",[mT,fT,gT,hT,vT,yT,bT,xT,kT,wT,ST,_T,$T,IT,AT,ET,PT,CT,TT,RT,OT,DT,NT,LT,UT,zT]),ln=c.enum(["power","brightness","colorTemperature","color","segmentColor","thermostat","humidity","lock","cover","fan","mode","toggle","range","mediaTransport","volume","inputSource","startStop","scene","camera","sensor","binarySensor","battery","energyMeter","doorbell","connectivity","effect"]),_k=c.enum(["needs-password"]),FT=c.object({sourceId:c.string(),provider:_t,providerAccountId:c.string(),nativeId:c.string(),nativeType:c.string().optional(),reachability:c.enum(["local","cloud"]),online:c.boolean(),attention:_k.nullable().optional(),credentialRef:c.string().nullable().optional(),lastSeen:Z.nullable().optional()}),BT=c.object({id:c.string(),name:c.string(),providerRefs:c.array(c.object({provider:_t,nativeId:c.string()})).default([])}),MT=c.object({accountId:c.string(),provider:_t,displayName:c.string(),reachability:c.enum(["local","cloud"]),status:c.enum(["linked","needs_reauth","revoked"]),expiresAt:Z.nullable().optional()}),HT=c.object({id:c.string(),type:Ni,name:c.string(),areaId:c.string().nullable(),manufacturer:c.string().nullable().optional(),model:c.string().nullable().optional(),firmwareVersion:c.string().nullable().optional(),online:c.boolean(),reachability:uT,attention:_k.nullable().optional(),parentId:c.string().nullable().optional(),members:c.array(c.string()).optional(),sources:c.array(FT).min(1),preferredSourceId:c.string(),capabilities:c.array(jT),updatedAt:Z,raw:c.unknown().optional()}),$k=c.object({version:c.literal(1),nodeId:c.string(),updatedAt:Z,areas:c.array(BT),accounts:c.array(MT),devices:c.array(HT)}),ZT=c.enum(["relay-do-sealed","hub-local"]),rM=c.object({accountId:c.string(),provider:_t,providerAccountId:c.string(),nodeId:c.string(),credentialLocation:ZT,scopes:c.array(c.string()).default([]),status:c.enum(["linked","needs_reauth","revoked"]),displayName:c.string(),expiresAt:Z.nullable().optional(),linkedAt:Z}),wk=c.enum(["open","guarded","locked"]),ig=c.enum(["allow","confirm","deny"]),GT=c.enum(["voice","claude","app","rules"]),oM=c.object({tier:wk.default("open"),perConsumer:c.partialRecord(GT,wk).default({}),perClass:c.partialRecord(ln,ig).default({}),perDeviceType:c.partialRecord(Ni,ig).default({}),perDevice:c.record(c.string(),ig).default({}),confirmWindowSec:c.number().default(60)}),xe=c.object({}),Sk=e=>e.type==="cover"&&(e.config.kind==="garage"||e.config.kind==="door"),cg={power:[{command:"turnOn",params:xe},{command:"turnOff",params:xe},{command:"toggle",params:xe}],brightness:[{command:"setBrightness",params:c.object({level:ie})},{command:"adjustBrightness",params:c.object({delta:c.number().min(-100).max(100)})}],colorTemperature:[{command:"setColorTemperature",params:c.object({kelvin:cr})}],color:[{command:"setColor",params:c.object({hue:c.number().min(0).max(360),saturation:ie})}],segmentColor:[{command:"setSegmentColors",voice:!1,params:c.object({segments:c.array(c.object({index:c.number().int().nonnegative(),hue:c.number().min(0).max(360),saturation:ie})).min(1).max(512)})}],thermostat:[{command:"setThermostatMode",params:c.object({mode:ag})},{command:"setSetpoint",params:c.object({celsius:cn})},{command:"setRange",params:c.object({heatCelsius:cn,coolCelsius:cn}),gate:e=>e.type==="thermostat"&&e.config.supportsRange}],humidity:[{command:"setHumidity",params:c.object({percent:ie}),gate:e=>e.type==="humidity"&&e.config.settable}],lock:[{command:"lock",params:xe},{command:"unlock",params:xe,confirm:!0}],cover:[{command:"open",params:xe,confirm:Sk},{command:"close",params:xe},{command:"stop",params:xe},{command:"setPosition",params:c.object({position:ie}),confirm:Sk,gate:e=>e.type==="cover"&&e.config.supportsPosition},{command:"setTilt",params:c.object({tilt:ie}),gate:e=>e.type==="cover"&&e.config.supportsTilt}],fan:[{command:"turnOn",params:xe},{command:"turnOff",params:xe},{command:"setFanSpeed",params:c.object({level:ie})},{command:"setFanPreset",params:c.object({preset:c.string()}),gate:e=>e.type==="fan"&&e.config.presets.length>0},{command:"setOscillate",params:c.object({oscillating:c.boolean()}),gate:e=>e.type==="fan"&&e.config.supportsOscillate}],mode:[{command:"setMode",params:c.object({value:c.string()})}],toggle:[{command:"setToggle",params:c.object({on:c.boolean()})}],range:[{command:"setRange",params:c.object({value:c.number()})},{command:"adjustRange",params:c.object({delta:c.number()})}],mediaTransport:[{command:"play",params:xe},{command:"pause",params:xe},{command:"stop",params:xe},{command:"next",params:xe},{command:"previous",params:xe},{command:"seek",params:c.object({positionSec:c.number().nonnegative()})},{command:"setShuffle",params:c.object({on:c.boolean()})},{command:"setRepeat",params:c.object({mode:c.enum(["off","one","all"])})}],volume:[{command:"setVolume",params:c.object({level:ie})},{command:"adjustVolume",params:c.object({delta:c.number().min(-100).max(100)})},{command:"setMute",params:c.object({muted:c.boolean()})}],inputSource:[{command:"selectInput",params:c.object({source:c.string()})}],startStop:[{command:"start",params:xe},{command:"stop",params:xe},{command:"pause",params:xe,gate:e=>e.type==="startStop"&&e.config.supportsPause},{command:"resume",params:xe,gate:e=>e.type==="startStop"&&e.config.supportsPause}],scene:[{command:"activate",params:xe}],effect:[{command:"startEffect",params:c.object({spec:sg})},{command:"stopEffect",params:xe}],camera:[{command:"getStream",params:c.object({protocol:c.enum(["rtsp","webrtc","hls"])}),voice:!1,returns:c.object({url:c.string(),token:c.string().optional(),expiresAt:Z.optional()})},{command:"getSnapshot",params:xe,voice:!1,returns:c.object({url:c.string(),expiresAt:Z.optional()})}],sensor:[],binarySensor:[],battery:[],energyMeter:[],doorbell:[],connectivity:[]};var WT=c.discriminatedUnion("kind",[c.object({kind:c.literal("literal"),hue:c.number().min(0).max(360),saturation:ie}),c.object({kind:c.literal("token"),token:c.enum(["main","session"])})]),Ik=c.enum(["main","session","hold","off"]),Ak=c.object({color:WT.optional(),brightnessPct:ie.nullable().optional(),brightnessScale:c.number().min(0).max(2).optional(),kelvin:cr.nullable().optional(),power:c.boolean().optional()});var VT=c.enum(["added","removed","permission_request","started","ended","working","finished","error","idle","needs_permission","promptSubmitted","toolStart","toolEnd","subagentStart","subagentFinished","compacting","resumed","aborted","contextLow","contextCritical","needsInput","planReady","rateLimited","compactDone","permissionDenied","taskCompleted","usageHigh","modePlan","modeAuto","modeBypass","modeNormal","modelChanged","workflowStarted","sandboxEscalation","reviewChanged","costHigh","longRunning"]),lr=c.enum(["claude","codex"]);var JT=c.discriminatedUnion("kind",[c.object({kind:c.literal("deviceState"),deviceId:c.string(),capability:c.string(),instance:c.string().optional(),op:c.enum(["eq","neq","gt","lt","gte","lte","changed"]).default("changed"),path:c.string().optional(),value:c.unknown().optional()}),c.object({kind:c.literal("edge"),deviceId:c.string(),event:c.string()}),c.object({kind:c.literal("session"),event:VT,repo:c.string().optional(),sessionId:c.string().optional(),agent:lr.optional()}),c.object({kind:c.literal("schedule"),cron:c.string()})]),qT=c.object({deviceId:c.string(),capability:c.string(),instance:c.string().optional(),op:c.enum(["eq","neq","gt","lt","gte","lte"]),path:c.string().optional(),value:c.unknown()}),KT=c.discriminatedUnion("kind",[c.object({kind:c.literal("device"),deviceId:c.string(),capability:c.string(),instance:c.string().optional(),command:c.string(),params:c.unknown().optional()}),c.object({kind:c.literal("session"),sessionId:c.string(),text:c.string()}),c.object({kind:c.literal("notify"),title:c.string(),body:c.string()}),c.object({kind:c.literal("intent"),deviceId:c.string(),instance:c.string().optional(),look:Ak.optional(),effect:sg.optional(),returnTo:Ik.optional(),hold:c.boolean().default(!1)})]),pM=c.object({id:c.string(),name:c.string().default(""),enabled:c.boolean().default(!0),trigger:JT,conditions:c.array(qT).default([]),actions:c.array(KT).min(1),allowSecurity:c.boolean().default(!1)});var ho=c.enum(["started","ended","working","finished","error","idle","needs_permission","subagentFinished","compacting","resumed","contextLow","contextCritical","needsInput","planReady","rateLimited","subagentStart","compactDone","permissionDenied","taskCompleted","usageHigh","modePlan","modeAuto","modeBypass","modeNormal","modelChanged","workflowStarted","sandboxEscalation","reviewChanged","costHigh","longRunning"]),Ek=c.object({id:c.string(),name:c.string(),cwd:c.string(),online:c.boolean().default(!0),state:ho.optional(),bridgeId:c.string().optional(),bridgeName:c.string().optional(),agent:lr.optional()}),Pk=c.enum(["allow","deny"]),vM=c.object({sessionId:c.string().nullable(),text:c.string(),ts:Z.optional()}),_c=c.object({latestReply:c.string().nullable(),ts:c.number().nullable(),cursor:c.number().int().nonnegative(),hasMore:c.boolean()}),yM=c.object({requestId:c.string(),behavior:Pk,ts:Z.optional()}),bM=c.object({id:c.string(),sessionId:c.string().nullable(),args:c.unknown(),ts:Z.optional()}),XT=c.object({type:c.literal("register"),userToken:c.string().optional(),sessions:c.array(Ek),claudeSessionId:c.string().optional()}),YT=c.object({type:c.literal("sessions.update"),sessions:c.array(Ek)}),QT=c.object({type:c.literal("prompt"),sessionId:c.string(),requestId:c.string(),text:c.string(),ts:Z.optional()});var e1=c.object({type:c.literal("reply"),sessionId:c.string(),requestId:c.string(),text:c.string(),seq:c.number().int().nonnegative().optional(),final:c.boolean().optional(),ts:Z.optional()}),t1=c.object({type:c.literal("permission_request"),sessionId:c.string(),requestId:c.string(),tool:c.string(),description:c.string(),preview:c.string(),ts:Z.optional()}),n1=c.object({type:c.literal("permission_verdict"),sessionId:c.string(),requestId:c.string(),behavior:Pk,ts:Z.optional()}),r1=c.object({type:c.literal("command"),id:c.string(),requestId:c.string(),sessionId:c.string().nullable(),args:c.unknown(),ts:Z.optional()}),o1=c.object({type:c.literal("command_result"),requestId:c.string(),id:c.string(),sessionId:c.string().nullable().optional(),result:c.unknown().optional(),error:c.string().optional(),ts:Z.optional()}),i1=c.object({type:c.literal("devices.update"),doc:$k}),a1=c.object({type:c.literal("device_command"),requestId:c.string(),deviceId:c.string(),sourceId:c.string().nullable().optional(),ruleId:c.string().optional(),capability:ln,instance:c.string().optional(),command:c.string(),params:c.unknown(),consumer:c.enum(["voice","claude","app","rules"]),sessionId:c.string().optional(),confirm:c.boolean().optional()}),s1=c.object({type:c.literal("device_query"),requestId:c.string(),kind:c.enum(["list","get"]),deviceId:c.string().optional()}),c1=c.object({type:c.literal("device_result"),requestId:c.string(),deviceId:c.string().optional(),ok:c.boolean(),verified:c.boolean().optional(),state:c.unknown().optional(),result:c.unknown().optional(),error:c.string().optional()}),l1=c.object({type:c.literal("device_event"),deviceId:c.string(),capability:ln,instance:c.string().optional(),event:c.string(),payload:c.unknown().optional(),ts:Z}),u1=c.object({type:c.literal("device_source_event"),provider:_t,providerAccountId:c.string(),nativeId:c.string(),patch:c.array(c.object({type:ln,instance:c.string().optional(),state:c.unknown()})).optional(),edge:c.object({capability:ln,instance:c.string().optional(),event:c.string(),payload:c.unknown().optional()}).optional(),online:c.boolean().optional(),ts:Z}),d1=c.object({type:c.literal("entitlement"),plan:c.enum(["free","paid"]),planStatus:c.enum(["active","past_due","canceled"]).optional(),serviceOk:c.boolean().optional(),capture:c.object({telemetry:c.boolean(),transcripts:c.boolean()}),policyVersion:c.string(),ts:Z}),p1=c.object({type:c.literal("device_config"),version:c.number().int().nonnegative(),config:c.record(c.string(),c.unknown()),ts:Z}),m1=c.object({type:c.literal("disconnect"),code:c.union([c.literal(1012),c.literal(4402),c.literal(4426),c.number().int().min(1e3).max(4999)]),reason:c.string().max(120),ts:Z}),f1=c.object({type:c.literal("device_audit"),requestId:c.string(),consumer:c.enum(["voice","claude","app","rules"]),deviceId:c.string(),ruleId:c.string().optional(),capability:ln,command:c.string(),params:c.unknown(),ok:c.boolean(),confirmRequired:c.boolean(),confirmedBy:c.string().optional(),error:c.string().optional(),ts:Z}),g1=64,h1=c.object({type:c.literal("session_state"),sessionId:c.string(),state:ho,event:c.string(),ts:Z,transitions:c.array(c.object({state:ho,event:c.string(),ts:Z})).max(g1).optional()}),v1=c.object({type:c.literal("notification"),sessionId:c.string(),event:ho,repo:c.string().optional(),title:c.string().optional(),body:c.string().optional()}),y1=c.discriminatedUnion("type",[XT,YT,QT,e1,t1,n1,r1,o1,i1,a1,s1,c1,l1,u1,f1,d1,m1,p1,h1,v1]),Ck=e=>y1.parse(typeof e=="string"?JSON.parse(e):e);var b1=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),zt=(e,t)=>e>>>t|e<<32-t;function x1(e){let t=[];for(let r of e){let o=r.codePointAt(0);o<128?t.push(o):o<2048?t.push(192|o>>6,128|o&63):o<65536?t.push(224|o>>12,128|o>>6&63,128|o&63):t.push(240|o>>18,128|o>>12&63,128|o>>6&63,128|o&63)}return Uint8Array.from(t)}function k1(e){let t=x1(e),r=new Uint8Array((t.length+8>>6)+1<<6);r.set(t),r[t.length]=128;let o=new DataView(r.buffer),n=t.length*8;o.setUint32(r.length-8,Math.floor(n/4294967296)),o.setUint32(r.length-4,n>>>0);let i=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),a=new Uint32Array(64);for(let u=0;u<r.length;u+=64){for(let P=0;P<16;P++)a[P]=o.getUint32(u+P*4);for(let P=16;P<64;P++){let C=a[P-15],E=a[P-2],D=zt(C,7)^zt(C,18)^C>>>3,W=zt(E,17)^zt(E,19)^E>>>10;a[P]=a[P-16]+D+a[P-7]+W>>>0}let d=i[0],p=i[1],m=i[2],f=i[3],g=i[4],y=i[5],k=i[6],_=i[7];for(let P=0;P<64;P++){let C=zt(g,6)^zt(g,11)^zt(g,25),E=g&y^~g&k,D=_+C+E+b1[P]+a[P],W=zt(d,2)^zt(d,13)^zt(d,22),ce=d&p^d&m^p&m,Y=W+ce;_=k,k=y,y=g,g=f+D>>>0,f=m,m=p,p=d,d=D+Y>>>0}i[0]=i[0]+d>>>0,i[1]=i[1]+p>>>0,i[2]=i[2]+m>>>0,i[3]=i[3]+f>>>0,i[4]=i[4]+g>>>0,i[5]=i[5]+y>>>0,i[6]=i[6]+k>>>0,i[7]=i[7]+_>>>0}let s=new Uint8Array(32),l=new DataView(s.buffer);for(let u=0;u<8;u++)l.setUint32(u*4,i[u]);return s}var Tk="abcdefghijklmnopqrstuvwxyz234567";function w1(e){let t=0,r=0,o="";for(let n of e)for(r=r<<8|n,t+=8;t>=5;)o+=Tk[r>>>t-5&31],t-=5;return t>0&&(o+=Tk[r<<5-t&31]),o}function Ok(e){return w1(k1(e))}var S1=c.enum(["mdns","ssdp","kasa-udp","wiz-udp","lifx-lan","yeelight","govee-udp","tuya-beacon","arp","http","meethue"]),_1=c.object({protocol:S1,detail:c.string(),at:Z}),$1=c.enum(["connect-now","link-ecosystem","identified-only"]),$c=c.enum(["kasa","kasa-klap","wiz","lifx","shelly","govee","tapo","tuya","yeelight","nanoleaf","meross","ewelink","wled","elgato","roku","esphome"]),I1=c.enum(["high","medium","low"]),A1=c.object({ip:c.string(),mac:c.string().optional(),hostname:c.string().optional(),port:c.number().int().positive().optional()}),Dk=c.object({discoveredId:c.string(),addresses:A1,evidence:c.array(_1).min(1),identity:c.object({name:c.string().optional(),manufacturer:c.string().optional(),model:c.string().optional(),hint:c.string().optional(),vendorId:c.string().optional()}).default({}),bucket:$1,kind:c.string().optional(),suggestedProvider:_t.optional(),localProtocol:$c.optional(),expectedType:Ni.optional(),expectedCapabilities:c.array(ln).default([]),alreadyLinked:c.object({provider:_t,deviceId:c.string().optional(),accountId:c.string().optional()}).nullable().optional(),confidence:I1,firstSeen:Z,lastSeen:Z});function $t(e){return e.trim().toLowerCase().replace(/[^0-9a-f]/g,"").replace(/(..)(?=.)/g,"$1:")}var Nk=c.object({key:c.string(),provider:_t,accountId:c.string().optional(),name:c.string(),mac:c.string().optional(),nativeType:c.string().optional(),expectedType:Ni.optional(),state:c.enum(["cloud","not-seen"]),deviceId:c.string().optional()}),Lk=c.object({wsl:c.boolean(),multicastOk:c.boolean().nullable(),broadcastOk:c.boolean().nullable(),interop:c.enum(["windows-arp"]).optional(),interfaces:c.array(c.string()).optional(),primaryInterface:c.string().optional()});function Uk(e){return e!==void 0&&(e.wsl||e.multicastOk===!1)}function zk(e,t){return t>0||e===void 0||e.wsl?!1:e.multicastOk===!0}var jk="Your computer's network stack is fine, so if you expected devices here the likely cause is the network itself: guest WiFi, VLANs, or an access point with client isolation all block the discovery messages between devices. Try the same scan on your main WiFi, or add a device by IP.",E1=c.enum(["running","done","failed"]),$M=c.object({id:c.string(),status:E1,startedAt:Z,finishedAt:Z.optional(),error:c.string().optional(),devices:c.array(Dk),accountDevices:c.array(Nk).optional(),env:Lk,probeStatus:c.record(c.string(),c.string()).optional()}),P1=c.enum(["mdns","ssdp","kasa","wiz","lifx","yeelight","govee","tuya","arp","sweep"]),IM=c.object({autoConnect:c.enum(["unset","off","open-protocols"]).default("unset"),passive:c.boolean().default(!0),protocols:c.partialRecord(P1,c.boolean()).default({}),unidentified:c.boolean().default(!0)}),AM=c.object({scanId:c.string()}),EM=c.object({devices:c.array(Dk),accountDevices:c.array(Nk).optional(),env:Lk,updatedAt:Z}),PM=c.object({discoveredId:c.string().optional(),ip:c.string().optional(),protocol:$c,name:c.string().optional(),credentials:c.record(c.string(),c.string()).optional()}).refine(e=>e.discoveredId!==void 0||e.ip!==void 0,{message:"either discoveredId or ip is required"}),lg={tapo:[{key:"username",label:"TP-Link email",secret:!1,helpText:"the TP-Link ID the device was set up with"},{key:"password",label:"Password",secret:!0}],"kasa-klap":[{key:"username",label:"TP-Link email",secret:!1,helpText:"the TP-Link/Kasa ID the device was set up with (leave blank if never linked to the cloud)"},{key:"password",label:"Password",secret:!0}],shelly:[{key:"password",label:"Device password",secret:!0,helpText:'the password set on this Shelly (its username is always "admin")'}],esphome:[{key:"encryptionKey",label:"Encryption key",secret:!0,helpText:"the `api: encryption: key` from this device's ESPHome config (base64) \u2014 leave blank if it has no encryption"}]},C1=new Set(["shelly","esphome"]);function T1(e){return C1.has(e)}var CM=c.object({ok:c.boolean(),deviceId:c.string().optional(),accountId:c.string().optional(),error:c.string().optional(),note:c.string().optional(),linkVia:_t.optional()}),TM=c.object({deviceId:c.string(),purge:c.boolean().default(!1),discoveredId:c.string().optional()}),RM=c.object({deviceId:c.string(),name:c.string()}),OM=c.object({clientId:c.string().min(1),clientSecret:c.string().min(1),region:c.string().min(1)}),DM=c.object({ok:c.boolean(),deviceCount:c.number().int().nonnegative().optional(),sleepyCount:c.number().int().nonnegative().optional(),error:c.string().optional()}),NM=c.object({email:c.string().min(1),password:c.string().min(1),region:c.string().min(1),mfaCode:c.string().optional()}),LM=c.object({ok:c.boolean(),deviceCount:c.number().int().nonnegative().optional(),error:c.string().optional()}),UM=c.object({email:c.string().min(1),password:c.string().min(1),region:c.string().min(1)}),zM=c.object({ok:c.boolean(),deviceCount:c.number().int().nonnegative().optional(),error:c.string().optional()}),jM=c.object({apiKey:c.string().min(1)}),FM=c.object({ok:c.boolean(),deviceCount:c.number().int().nonnegative().optional(),error:c.string().optional()}),BM=c.object({ok:c.boolean(),note:c.string().optional(),error:c.string().optional()}),MM=c.object({sessionId:c.string().optional(),revertOnStop:c.boolean().default(!0)}),HM=c.object({sessionId:c.string().optional()}),Fk=c.object({pct:c.number().min(0).max(100),usedTokens:c.number().int().nonnegative().optional(),windowTokens:c.number().int().positive().optional()}),Rk=c.object({usedPct:c.number().min(0).max(100),resetsAt:Z.optional()}),ZM=c.object({sessionId:c.string().optional(),claudeSessionId:c.string().optional(),state:ho,event:c.string(),ts:Z.optional(),cwd:c.string().optional(),extra:c.record(c.string(),c.unknown()).optional(),context:Fk.optional(),mode:c.string().optional(),model:c.string().optional(),agent:lr.optional()}),GM=c.object({sessionId:c.string().optional(),claudeSessionId:c.string().optional(),cwd:c.string().optional(),ts:Z.optional(),context:Fk.optional(),rateLimits:c.object({fiveHour:Rk.optional(),sevenDay:Rk.optional()}).optional(),mode:c.string().optional(),model:c.string().optional(),modelName:c.string().optional(),review:c.string().optional(),cost:c.number().nonnegative().optional(),agent:lr.optional()}),WM=c.object({sessionId:c.string().optional(),claudeSessionId:c.string().optional(),codexThreadId:c.string().min(1),cwd:c.string().optional(),gitBranch:c.string().optional(),ts:Z.optional(),inputTokens:c.number().int().nonnegative(),cachedInputTokens:c.number().int().nonnegative().default(0),outputTokens:c.number().int().nonnegative(),agent:lr.optional()}),R1=c.object({reverted:c.number().int().nonnegative(),failed:c.number().int().nonnegative(),skipped:c.number().int().nonnegative()}),VM=c.object({active:c.boolean(),sessionId:c.string().optional(),generation:c.number().int().nonnegative().optional(),touched:c.number().int().nonnegative().default(0),revertOnStop:c.boolean().default(!0),owner:c.enum(["app","hook"]).optional(),summary:R1.optional()});function vo(e){return e.kind==="gateway"?"infrastructure":e.bucket==="connect-now"?"ready":e.bucket==="link-ecosystem"?"ecosystems":e.kind==="unidentified"||e.kind==="mdns-service"?"unidentified":e.bucket==="identified-only"?"needs-setup":"unidentified"}var Ic=["govee","wiz","yeelight","kasa","esphome"],O1=new Set(["lock","cover","garageDoor","valve","camera","doorbell"]),D1=new Set(["lock","cover","camera","doorbell"]),N1=new Set(["tuya","meross","ewelink","nanoleaf","esphome"]);function Bk(e,t=lg){return e.bucket==="connect-now"&&e.localProtocol!==void 0&&((t[e.localProtocol]?.length??0)===0||T1(e.localProtocol))&&!N1.has(e.localProtocol)&&e.confidence==="high"&&e.addresses.mac!==void 0&&!e.alreadyLinked&&!(e.expectedType!==void 0&&O1.has(e.expectedType))&&!e.expectedCapabilities.some(r=>D1.has(r))}function Mk(e){let t=e.trim(),r,o=/^(mqtts?|tcp|ssl|tls|wss?):\/\//i.exec(t);if(o){let s=o[1].toLowerCase();(s==="mqtts"||s==="ssl"||s==="tls"||s==="wss")&&(r=!0),t=t.slice(o[0].length)}t=t.replace(/\/.*$/,"");let n=/^(.+):(\d{1,5})$/.exec(t),i=(n?n[1]:t).trim(),a=n?Number(n[2]):void 0;return{host:i,...a!==void 0&&a>=1&&a<=65535?{port:a}:{},...r!==void 0?{tls:r}:{}}}import{spawn as z1}from"node:child_process";import{chmodSync as j1,existsSync as dg,openSync as F1,readFileSync as B1,realpathSync as M1,writeFileSync as Jk}from"node:fs";import{request as H1}from"node:http";import Z1 from"node:net";import G1 from"node:path";function Li(){return!0}function Hk(){return"1.0.1"}var Zk=3e3,L1=15e3;function U1(e){if(!e)return null;try{let t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return null;let{pid:r,startedAt:o,lastBeat:n}=t;return!Number.isInteger(r)||r<=0||typeof o!="number"||typeof n!="number"?null:{pid:r,startedAt:o,lastBeat:n}}catch{return null}}function Gk(e){let t=e?.read??O;return U1(t(e?.file??Ra))}function ug(e,t){let r=t?.write??((n,i)=>ge(n,i,384)),o=t?.now??Date.now;try{r(t?.file??Ra,JSON.stringify({pid:t?.pid??process.pid,startedAt:e,lastBeat:o()}))}catch{}}function Wk(e){try{(e?.remove??de)(e?.file??Ra)}catch{}}function Vk(e){let{beacon:t,pid:r}=e;return!Number.isInteger(r)||r<=0||!t||t.pid!==r||!(e.isAlive??Da)(r)?!1:(e.now??Date.now())-t.lastBeat<=(e.staleAfterMs??L1)}function W1(e){return new Promise(t=>{let r=Z1.connect({host:"127.0.0.1",port:e},()=>{r.destroy(),t(!0)});r.on("error",()=>t(!1)),r.setTimeout(500,()=>{r.destroy(),t(!1)})})}function Ec(e={}){let t=$r(e);return{dir:t.dir,source:t.source,port:t.beacon?.port??ne().hubPort,tokenFile:Jl(t.dir),advertised:t.beacon!==null}}async function Te(){return W1(Ec().port)}function V1(e=process.env,t=r=>Ct(r)){if(e.BRIDGE_CLIENT_VERSION!==void 0)return{};let r=t(e);return r===null?{}:{BRIDGE_CLIENT_VERSION:r}}function J1(e=process.env,t={}){let r=t.bundled??Li(),o={...e};return r&&delete o.BRIDGE_VOICE,o}async function it(e={kind:"run"}){if(await Te())return X("hub already running \u2014 reusing it"),{spawned:!1,holderId:await qk(e.kind)??await Pc(e.kind)};let t=ne(),r=dg(ti)?{file:process.execPath,args:[ti]}:{file:dg(La)?La:"tsx",args:[dy]};Jk(xt,"",{mode:384}),j1(xt,384);let o=F1(xt,"a"),n=z1(r.file,r.args,{cwd:tn,detached:!0,stdio:["ignore",o,o],env:{...J1(),BRIDGE_RELAY_URL:t.relayUrl,BRIDGE_HUB_PORT:String(t.hubPort),BRIDGE_HUB_HOLDER:e.kind,BRIDGE_HUB_HOLDER_PID:String(process.pid),...V1()}});n.unref(),n.pid&&Jk(Zo,String(n.pid));for(let i=0;i<30;i++){let a=Cc(xt);if(/relay connected/i.test(a))return A("hub connected to relay"),{spawned:!0,holderId:await qk(e.kind)??await Pc(e.kind)};if(/relay ws error|FATAL/i.test(a))throw new Error(`hub failed to connect:
|
|
238
|
+
${Se(Xk(a,6))}`);await q1(1e3)}throw new Error(`hub timed out connecting to the relay. Last log:
|
|
239
|
+
${Se(Xk(Cc(xt),8))}`)}function Yk(){Jh()}function Qk(e,t){let r=t?.argv1??process.argv[1]??"",o=t?.exists??dg,n=t?.tsxBin??La;if(t?.bundled??Li()){let s=r;try{s=(t?.realpath??M1)(r)}catch{}return{file:process.execPath,args:[s,"daemon",...e]}}if(/\.(mjs|cjs|js)$/.test(r))return{file:process.execPath,args:[r,"daemon",...e]};let a=r||G1.join(tn,"cli","src","index.ts");return{file:o(n)?n:"tsx",args:[a,"daemon",...e]}}async function Pc(e){return(await G("/local/hub/hold",{method:"POST",body:{kind:e,pid:process.pid}})).body?.holderId??null}function qk(e){let t=Ec(),r=Cc(t.tokenFile).trim();if(!r)return Promise.resolve(null);let o=JSON.stringify({kind:e,pid:process.pid,stream:!0});return new Promise(n=>{let i=!1,a=s=>{i||(i=!0,n(s))};try{let s=H1({host:"127.0.0.1",port:t.port,path:"/local/hub/hold",method:"POST",headers:{"x-bridge-hub-token":r,"content-type":"application/json","content-length":Buffer.byteLength(o)}},l=>{if(l.statusCode!==200)return l.resume(),a(null);l.socket?.unref(),l.once("data",u=>{try{a(JSON.parse(u.toString("utf8").split(`
|
|
240
|
+
`)[0]??"").holderId??null)}catch{a(null)}}),l.once("close",()=>a(null))});s.on("error",()=>a(null)),s.setTimeout(5e3,()=>a(null)),s.end(o)}catch{a(null)}})}async function e0(e){let t=await G("/local/hub/beat",{method:"POST",body:{holderId:e},timeoutMs:4e3});return t.hubOffline?"offline":t.status===200?"ok":"unknown"}async function Tc(e){await G("/local/hub/release",{method:"POST",body:{holderId:e},timeoutMs:4e3})}async function t0(){let e=await G("/local/hub/shutdown",{method:"POST",body:{},timeoutMs:8e3});return!e.hubOffline&&e.status===200}async function n0(){await G("/local/reload",{method:"POST",body:{},timeoutMs:8e3})}function yo(e){return Vk({beacon:(e.readBeacon??Gk)(),pid:e.pid,...e.now!==void 0?{now:e.now}:{},...e.isAlive?{isAlive:e.isAlive}:{}})}var Ac=null;function Ne(){let e=Ac;if(!e||e.reason==="offline")return"hub offline \u2014 run `acbridge daemon` or start the app";let r=e.target.source==="peer-wsl"||e.target.source==="peer-windows"?` (it runs ${e.target.source==="peer-wsl"?"on Windows":"inside WSL"}, state in ${e.target.dir})`:"";return e.reason==="absent"?`a hub is running on port ${e.target.port}${r}, but this account has no hub-token to present. Sign in with \`acbridge login\`, or restart the bridge from the side that owns it.`:`the hub on port ${e.target.port}${r} REJECTED this credential (401) \u2014 it belongs to another account or another run. Restart the bridge (\`acbridge stop\` then \`acbridge start\`) to re-mint it.`}function pg(e){return Jl(M,e)}async function Kk(e,t,r){let o=Cc(e.tokenFile).trim();if(!o)return Ac={reason:e.advertised?"absent":"offline",target:e},e.advertised?{hubOffline:!0,hubUnauthorized:"absent"}:{hubOffline:!0};let n=r?.body!==void 0;try{let i=await fetch(`http://127.0.0.1:${e.port}${t}`,{method:r?.method??"GET",headers:{"x-bridge-hub-token":o,...n?{"content-type":"application/json"}:{}},...n?{body:JSON.stringify(r?.body)}:{},signal:AbortSignal.timeout(r?.timeoutMs??1e4)}),a;try{a=await i.json()}catch{a=void 0}return i.status===401&&(Ac={reason:"rejected",target:e}),{status:i.status,body:a,...i.status===401?{hubUnauthorized:"rejected"}:{}}}catch{return Ac={reason:"offline",target:e},{hubOffline:!0}}}async function G(e,t){let r=Ec(),o=await Kk(r,e,t);if(!o.hubOffline&&!o.hubUnauthorized)return o;let n=Ec({fresh:!0});return n.port===r.port&&n.tokenFile===r.tokenFile?o:Kk(n,e,t)}function Cc(e){try{return B1(e,"utf8")}catch{return""}}function Xk(e,t){return e.trimEnd().split(`
|
|
241
241
|
`).slice(-t).join(`
|
|
242
|
-
`)}function
|
|
243
|
-
acbridge connect <ip> --as ${
|
|
242
|
+
`)}function q1(e){return new Promise(t=>setTimeout(t,e))}var Fn=`Usage: acbridge connect <mac|ip|discoveredId> [--name <display-name>] [--credentials-file <json>]
|
|
243
|
+
acbridge connect <ip> --as ${Ic.join("|")} [--name <display-name>]
|
|
244
244
|
acbridge connect --forget <deviceId|mac|ip|discoveredId> [--purge]
|
|
245
245
|
acbridge connect --auto on|off
|
|
246
246
|
|
|
@@ -249,30 +249,31 @@ Targets come from \`acbridge scan\` (the ldev_\u2026 id, or the device's MAC/IP)
|
|
|
249
249
|
LAN-Control toggle flipped after the scan, or multicast is filtered) \u2014 it persists ONLY after the
|
|
250
250
|
protocol's live probe replies at that IP; a dead IP or wrong protocol simply gets no reply.
|
|
251
251
|
A protocol that needs an account credential (e.g. Tapo) prompts on a TTY, or reads
|
|
252
|
-
--credentials-file <json> / $ACBRIDGE_CREDENTIALS_FILE (a {"field":"value"} object) when headless.`;function
|
|
252
|
+
--credentials-file <json> / $ACBRIDGE_CREDENTIALS_FILE (a {"field":"value"} object) when headless.`;function Y1(e){let t={purge:!1},r=(o,n,i,a)=>o===`--${n}`?(t[n]=a[++i],i):o.startsWith(`--${n}=`)?(t[n]=o.slice(`--${n}=`.length),i):null;for(let o=0;o<e.length;o++){let n=e[o];if(!n)continue;if(n==="--purge"){t.purge=!0;continue}if(n==="--credentials-file"){t.credentialsFile=e[++o];continue}if(n.startsWith("--credentials-file=")){t.credentialsFile=n.slice(19);continue}let i=!1;for(let a of["forget","auto","name","as"]){let s=r(n,a,o,e);if(s!==null){o=s,i=!0;break}}i||(n.startsWith("--")?t.bad=`unknown option: ${n}`:t.target?t.bad=`unexpected argument: ${n}`:t.target=n)}return t}var i0=e=>/^([0-9a-f]{2}:){5}[0-9a-f]{2}$/.test($t(e)),mg=e=>/^(\d{1,3}\.){3}\d{1,3}$/.test(e),r0=e=>`dev_${Ok(`mac:${$t(e)}`).slice(0,8)}`,o0=e=>e==="homeassistant"?"home-assistant":e;async function a0(e){let t=Y1(e);if(t.bad)return b(t.bad),h(Fn),2;if(t.as!==void 0)return t.forget!==void 0||t.auto!==void 0?(b("--as can't combine with --forget or --auto"),h(Fn),2):t.target?Q1(t.target,t.as,t.name):(b("connect --as <protocol> needs an IP address as the target"),h(Fn),2);let r=[t.target,t.forget,t.auto].filter(o=>o!==void 0).length;return r!==1?(r>1&&b("pick one of: a connect target, --forget, --auto"),h(Fn),2):t.auto!==void 0?aR(t.auto):t.forget!==void 0?iR(t.forget,t.purge):eR(t.target,t.name,t.credentialsFile)}async function Q1(e,t,r){if(!Ic.includes(t))return b(`--as takes one of: ${Ic.join(", ")} (got ${t||"(none)"})`),2;if(!mg(e))return b(`connect --as needs an IP address as the target, got: ${e}`),h(Fn),2;h(Se(`probing ${e} as ${t}\u2026`));let o={ip:e,protocol:t,...r?{name:r}:{}},n=await G("/local/connect",{method:"POST",body:o,timeoutMs:15e3});if(n.hubOffline)return b(Ne()),1;let i=n.body;return n.status===200&&i?.ok?(A(`connected \u2014 ${i.deviceId??e}${i.accountId?` (account ${i.accountId})`:""}`),i.note&&h(i.note),h("It now appears in `acbridge status`, the app dashboard, and to Claude."),0):(b(i?.error??`hub answered HTTP ${n.status}`),i?.note&&h(i.note),(n.status===502||n.status===422)&&h(`\u2192 no ${t} answered at ${e} \u2014 check the IP, that LAN Control is enabled, and that this machine shares the device's network/VLAN`),1)}async function eR(e,t,r){let o=await s0(e);if(typeof o=="number")return o;let n=o;if(n.bucket==="link-ecosystem"){let l=n.suggestedProvider;return b("this device is managed by an ecosystem"),h(`\u2192 link the ecosystem instead: ${l?`\`acbridge link ${o0(l)}\``:"use the app"}`),1}if(n.bucket==="identified-only")return b("no direct local adapter for this device"),h(n.identity.hint?`\u2192 ${n.identity.hint}`:"\u2192 control it via a linked Home Assistant (`acbridge link home-assistant`), or wait for a future adapter"),1;if(!n.localProtocol)return b(`no local protocol resolved for ${n.discoveredId} \u2014 rescan and try again`),1;h(Se(`connecting ${fg(n)} via ${n.localProtocol}\u2026`));let i={discoveredId:n.discoveredId,protocol:n.localProtocol,...t?{name:t}:{}},a=await G("/local/connect",{method:"POST",body:i,timeoutMs:15e3});if(a.hubOffline)return b(Ne()),1;let s=a.body;return a.status===200&&s?.ok?(A(`connected \u2014 ${s.deviceId??n.discoveredId}${s.accountId?` (account ${s.accountId})`:""}`),s.note&&h(s.note),h("It now appears in `acbridge status`, the app dashboard, and to Claude."),0):a.status===428&&s?.error==="pairing-required"?(b(s.note??"put the device in pairing mode (hold its button until it flashes), then connect again"),h(`\u2192 hold the button, then rerun: \`acbridge connect ${n.discoveredId}\``),1):a.status===428?tR(n,n.localProtocol,t,s?.note??null,r):(b(s?.error??`hub answered HTTP ${a.status}`),s?.note&&h(s.note),a.status===404&&h("\u2192 run `acbridge scan`, then retry with a fresh id"),s?.linkVia&&h(`\u2192 \`acbridge link ${o0(s.linkVia)}\``),1)}async function tR(e,t,r,o,n){let i=lg[t]??[],a=n??process.env.ACBRIDGE_CREDENTIALS_FILE,s;if(a){if(s=nR(a),!s)return 1}else if(process.stdin.isTTY&&process.stdout.isTTY&&i.length>0)s=await rR(i,o);else{b(o??"this protocol needs an account credential \u2014 supply it and retry");let p=i.length>0?` with fields: ${i.map(m=>m.key).join(", ")}`:"";return h(`\u2192 pass --credentials-file <json> (or set ACBRIDGE_CREDENTIALS_FILE)${p}`),1}h(Se(`connecting ${fg(e)} via ${t} with credentials\u2026`));let l={discoveredId:e.discoveredId,protocol:t,...r?{name:r}:{},credentials:s},u=await G("/local/connect",{method:"POST",body:l,timeoutMs:15e3});if(u.hubOffline)return b(Ne()),1;let d=u.body;return u.status===200&&d?.ok?(A(`connected \u2014 ${d.deviceId??e.discoveredId}${d.accountId?` (account ${d.accountId})`:""}`),d.note&&h(d.note),h("It now appears in `acbridge status`, the app dashboard, and to Claude."),0):(b(d?.error??`hub answered HTTP ${u.status}`),d?.note&&h(d.note),1)}function nR(e){let t;try{t=K1(e,"utf8")}catch{b(`cannot read credentials file: ${e}`);return}let r;try{r=JSON.parse(t)}catch{b(`credentials file is not valid JSON: ${e}`);return}if(!r||typeof r!="object"||Array.isArray(r)){b("credentials file must be a JSON object of field \u2192 value");return}let o={};for(let[n,i]of Object.entries(r))i!=null&&(o[n]=String(i));return o}async function rR(e,t){t&&h(t);let r={};for(let o of e)o.helpText&&h(Se(o.helpText)),r[o.key]=await oR(`${o.label}: `,o.secret);return r}function oR(e,t){return new Promise(r=>{let o=X1({input:process.stdin,output:process.stdout,terminal:!0});if(t){let n=!1,i=o;i._writeToOutput=a=>{n?(a.includes(`
|
|
253
253
|
`)||a.includes("\r"))&&process.stdout.write(`
|
|
254
|
-
`):(process.stdout.write(e),n=!0)}}o.question(e,n=>{o.close(),r(n.trim())})})}async function
|
|
255
|
-
`)}catch{}}function
|
|
256
|
-
`),h(`Synced cloud settings into config.json (${Object.keys(i).join(", ")}).`)}catch(n){h(`Cloud settings sync skipped (${n instanceof Error?n.message:String(n)}).`)}return o}var
|
|
257
|
-
`);function
|
|
258
|
-
`);var
|
|
259
|
-
`),g3=new TextDecoder;var S3=new Uint8Array([0]);import{spawnSync as dw}from"node:child_process";var Mg=Kh("cli");function mD(e){try{let t=dw(e,{shell:!0,encoding:"utf8",timeout:5e3});return`${t.stdout??""}${t.stderr??""}`}catch{return""}}function pw(e=process.platform){return nv({platform:e,programs:[process.execPath],ruleName:Mg,runCheck:mD,runElevated:t=>{e!=="win32"&&dw("sudo",["sh","-c",t],{stdio:"inherit"})}})}function mw(e){let t=[],{home:r,credential:o}=e,n=r.source==="peer-wsl"||r.source==="peer-windows";if(r.source==="env")t.push({grade:"info",line:`hub state home: ${r.dir} (BRIDGE_SECRET_DIR override)`});else if(n){let a=r.source==="peer-wsl"?"on Windows":"inside WSL";t.push({grade:"ok",line:`hub state home: ${r.dir} \u2014 the hub runs ${a}, this environment reads its home across the boundary`})}else r.beacon?t.push({grade:"ok",line:`hub state home: ${r.dir} (hub live on port ${r.beacon.port})`}):t.push({grade:"info",line:`hub state home: ${r.dir} \u2014 no hub advertising itself here yet`});o==="rejected"?t.push({grade:"bad",line:"the hub REJECTED this machine's hub-token (401) \u2014 it is stale or belongs to another home. Profiles signals from every session here are being dropped. Restart the bridge (`acbridge stop` then `acbridge start`, or Stop \u2192 Start in the app) to re-mint it."}):o==="absent"&&r.beacon?t.push({grade:"warn",line:`a hub is running (port ${r.beacon.port}) but no readable hub-token was found in ${r.dir} \u2014 sessions here cannot authenticate to it`}):o==="ok"&&t.push({grade:"ok",line:"hub credential accepted (Profiles signals from this environment are authorized)"});let i=e.lastHookError;if(i&&e.nowMs-i.ts<=864e5&&o!=="ok"){let a=Math.max(0,Math.round((e.nowMs-i.ts)/6e4));t.push({grade:"warn",line:`a Profiles signal from this machine was refused ${a}m ago (HTTP ${i.status})${i.hint?` \u2014 ${i.hint}`:""}`})}return t}import{spawnSync as fD}from"node:child_process";function Qe(e={}){let t=e.env??process.env,r=e.clientVersion!==void 0?e.clientVersion:Ct(t),o=e.bundled??Ri();return ra({isDevBuild:r===null&&!o,env:t})}function fw(){return qh({voice:Qe(),runElevated:e=>{e.method==="sudo"&&fD(e.file,e.args,{stdio:"inherit"})}})}function hD(e,t){let r=`codex: ${e??"not found"} \xB7 ${t?"logged in":"not logged in"}`;return{grade:e!==null&&t?"ok":"warn",line:r}}async function vD(){let e=await Dc();e.wsl?U("WSL detected \u2014 LAN scan degraded (mDNS/broadcast limited)"):A("host is not WSL \u2014 LAN discovery unrestricted"),e.multicastOk===!0?e.wsl?U("multicast self-test passed locally, but under WSL that only exercises the loopback stack \u2014 LAN mDNS delivery is still limited (rely on the Windows neighbor table below)"):A("multicast self-test passed (this computer's stack \u2014 it does not prove your NETWORK forwards multicast)"):e.multicastOk===!1?U("multicast self-test failed \u2014 mDNS discovery unavailable"):U("multicast self-test could not run (inconclusive)"),e.wsl&&(e.interop==="windows-arp"?A("WSL interop scanning available (powershell.exe \u2014 Windows neighbor table)"):U("WSL interop unavailable (powershell.exe not on PATH) \u2014 ARP discovery sees only the WSL subnet"));let t=await Z("/local/discovered");t.hubOffline?U("hub control API unreachable \u2014 scan/connect unavailable (start it: `acbridge daemon` or the app)"):t.status===200?A(`hub control API reachable (127.0.0.1:${ne().hubPort})`):U(`hub control API answered HTTP ${t.status} \u2014 token mismatch? restart the hub`);try{let r=a=>{let s=Zc(a,{shell:!0,encoding:"utf8",timeout:4e3});return`${s.stdout??""}${s.stderr??""}`};if(Bo(process.platform,{})==="wsl-host"){h(`firewall: ${Dl}`);return}let o=Rl(process.platform,r),n=Bo(process.platform,o),i=`${o.ufwStatusOut??""}${o.firewallCmdStateOut??""}${o.alfGlobalStateOut??""}`;if(n==="none")/permission denied|must be root|need to be root/i.test(i)?h("firewall state undetectable without sudo"):A("firewall: no active firewall detected \u2014 scanning unrestricted");else{let a=Ol(n,{programs:[process.execPath],ruleName:Mg});if("state"in a?A("firewall: no active firewall detected \u2014 scanning unrestricted"):a.evalCheck(a.checkCommands.map(r))?A(`firewall: rule present (${n})`):U(`firewall rule missing \u2014 allow it with: ${a.manualCommand} (or use the app's Scan panel to cover the desktop app)`),n==="windows"){let s=ev(r("netsh advfirewall firewall show rule name=all dir=in verbose"),process.execPath),l=tv(Qh(r("netsh advfirewall show currentprofile")),s);l&&U(l)}}$l(Fo())==="keyring"?A("integration secrets: OS keyring (encrypted at rest, as this CLI resolves it)"):h("integration secrets: 0600 FILES, not the OS keyring (as this CLI resolves it) \u2014 no session keyring here, which is normal on WSL/headless Linux. The app or hub can resolve differently if it runs in a different session.")}catch{h("firewall state undetectable without sudo")}}async function yD(){let e=Sr({fresh:!0}),t=W,r="unknown",o=e.beacon?.port??ry(),n=O(Ah(e.dir));if(!n)r="absent";else try{r=(await fetch(`http://127.0.0.1:${o}/local/devices`,{headers:{"x-bridge-hub-token":n},signal:AbortSignal.timeout(3e3)})).status===401?"rejected":"ok"}catch{r="unknown"}let i=null;try{let a=O(gw.join(t,"launch-last.json"));if(a)try{let l=JSON.parse(a);l.error?h(`last launch: REFUSED (${l.terminalId}, ${l.cwd}) \u2014 ${l.error}`):h(`last launch: ${l.terminalId} \u2192 ${l.file} ${JSON.stringify(l.args??[])}`)}catch{}let s=O(gw.join(t,"hooks-last-error.json"));if(s){let l=JSON.parse(s);typeof l.ts=="number"&&typeof l.status=="number"&&(i={ts:l.ts,status:l.status,...typeof l.hint=="string"?{hint:l.hint}:{}})}}catch{}return{home:e,localDir:t,credential:r,lastHookError:i,nowMs:Date.now()}}async function hw(e={}){let t=0,r=z=>{t++,b(z)},o=null,n=()=>o??=An(),i=(e.build??Mn)(),a=e.clientVersion?e.clientVersion():i.version,s=e.fetchManifest??Cc,l=l0(a,a===null?null:await s(),process.platform,i.channel??"app");l.grade==="ok"?A(l.line):l.grade==="warn"?U(l.line):l.grade==="bad"?r(l.line):h(l.line);let u=e.voice??Qe({clientVersion:a}),d=(e.claudeVersion??(()=>bD(n())))(),p=ia(process.platform).manualCommand;if(d===null)r(`claude CLI not found on PATH \u2014 install it: ${p}`);else{let z=wv(d);z.ok?A(`claude ${z.version}`):r(`claude ${z.version??"?"} \u2014 channels need \u2265 2.1.80 \u2014 reinstall: ${p}`)}let m=(e.codexVersion??xD)(),f=e.codexLoggedIn??la,g=hD(m,f());g.grade==="ok"?A(g.line):U(g.line);let y=(e.nodeRuntime??(()=>Er(Pr(W))))();y.kind==="shim"?A(`node runtime: bundled shim (${y.command})`):y.kind==="system"?A(`node v${y.version}`):r("node not found \u2014 install Node \u2265 20 or the AC Bridge app"),(e.pluginInstalled??(()=>kD(n())))()?A(u?"alexa@bridge plugin installed":"alexa@bridge plugin installed (agent state \u2192 device profiles)"):r("alexa@bridge plugin not installed \u2014 run `acbridge setup`");let _=Kn(),P=(e.managedSettingsRaw??(()=>O(_)))(),C=_v(P);u?C.allowed?A("channel allowlisted in managed settings"):C.present?r(`channel not allowlisted in ${_} \u2014 run \`acbridge setup\``):r(`managed settings missing at ${_} \u2014 run \`acbridge setup\``):A("managed settings not used (voice off \u2014 no channel allowlist needed)"),(e.hubBundlePresent??(()=>gD(Xo)))()?A("hub bundle present"):U("hub bundle not built \u2014 run `npm run build` (dev uses tsx)");let D=(e.signedIn??Pn)(),G=D.state==="ok"?D.token:"";D.state==="ok"?A("signed in (relay token present)"):D.state==="mismatch"?r(Je.pointerMismatch):U("not signed in \u2014 run `acbridge login`, sign in via the app, or `acbridge pair <code>`");let ae=(e.onboardingVerified??wD)();ae!==null?A(`account setup verified (${new Date(ae).toISOString().slice(0,10)})`):h("account setup not yet verified here \u2014 start/run check the relay on first use");let X=(e.appInstalled??Tr)();if(X?A(`desktop app found (${X.path})`):h("desktop app not found on this machine \u2014 sign-in handoff unavailable (browser `acbridge login` works)"),G){let vt=await(e.fetchEntitlement??Ot)(G);vt?h(`plan ${vt.plan}; capture telemetry=${vt.capture.telemetry} transcripts=${vt.capture.transcripts}`):h("entitlement: couldn't read from the relay (offline?)");let et=(e.entitlementFileAgeH??SD)();et==="absent"?h("entitlement file absent \u2014 capture off until the hub next syncs"):et==="unreadable"?U("entitlement file unreadable \u2014 capture off, fail-closed"):et<=24?A(`entitlement file fresh (${et.toFixed(1)}h)`):U(`entitlement file STALE (${et.toFixed(1)}h) \u2014 capture off, fail-closed`)}await(e.hubRunning??Te)()?A("hub running"):h(u?"hub not running (starts automatically on `acbridge run`)":"hub not running (start it: `acbridge start`)");for(let z of mw(await(e.homeFacts??yD)()))z.grade==="ok"?A(z.line):z.grade==="warn"?U(z.line):z.grade==="bad"?r(z.line):h(z.line);let Ee=(e.claudeEnvironments??Iv)();for(let z of Ee)z.claudePresent&&(z.pluginInstalled?A(`Claude Code wired for Profiles \u2014 ${z.label}`):U(`Claude Code is installed in ${z.label} WITHOUT the bridge plugin \u2014 sessions there drive no devices. Fix: ${z.setupHint}`));return await(e.discoveryPreflight??vD)(),h(""),t?b(`${t} problem(s) found`):A("all checks passed"),t?1:0}function bD(e){let t=e??An(),r=Zc(t.file,[...t.argsPrefix,"--version"],{encoding:"utf8"});return r.status===0?r.stdout??"":null}function xD(){let e=$r(),t=Zc(e.file,[...e.argsPrefix,"--version"],{encoding:"utf8",timeout:5e3});return t.status===0?(t.stdout||t.stderr||"").trim()||"unknown":null}function kD(e){let t=e??An(),r=Zc(t.file,[...t.argsPrefix,"plugin","list"],{encoding:"utf8"});return Sv(`${r.stdout??""}${r.stderr??""}`).ok}function wD(){let e=kt();return e?ha({configFile:e.userConfigFile}).onboardedAt:null}function SD(){let e=kt(),t=e?O(e.entitlementFile):null;if(!t)return"absent";try{let r=JSON.parse(t);return(Date.now()-(r.fetchedAt??0))/36e5}catch{return"unreadable"}}var _D=["tuya","meross","ewelink","govee"];function $D(e){let t=[],r=e.accounts("homeassistant");t.push({provider:"home-assistant",kind:"local",status:r.length>0?"linked":"not linked",...r.length>0?{detail:r.map(a=>String(a.baseUrl??a.accountId??"")).join(", ")}:{hint:"acbridge link home-assistant"}});let o=e.accounts("mqtt");t.push({provider:"mqtt",kind:"local",status:o.length>0?"linked":"not linked",...o.length>0?{detail:o.map(a=>`${String(a.host??a.accountId??"")}${a.port?`:${String(a.port)}`:""}`).join(", ")}:{hint:"acbridge link mqtt --host <broker>"}});let n=e.accounts("hue");t.push({provider:"hue",kind:"local",status:n.length>0?"linked":"not linked",...n.length>0?{detail:n.map(a=>String(a.host??a.bridgeId??"")).join(", ")}:{hint:"acbridge link hue"}});for(let a of _D){let s=e.hasKeystore(a);t.push({provider:a,kind:"keyed",status:s?"linked":"not linked",...s?{}:{hint:`acbridge link ${a}`}})}t.push({provider:"nanoleaf",kind:"device-paired",status:"pairs per device",hint:"acbridge connect <device> (hold the power button)"});let i=e.cloudAccounts===null?null:e.cloudAccounts.find(a=>a.provider==="smartthings");return t.push({provider:"smartthings",kind:"cloud",status:e.cloudAccounts===null?"unknown (sign in)":i?i.status??"linked":"not linked",...e.cloudAccounts!==null&&!i?{hint:"acbridge link smartthings"}:{}}),t}function ID(e){return e.map(t=>`${t.provider.padEnd(16)} ${t.status.padEnd(18)} ${t.detail??t.hint??""}`.trimEnd())}async function vw(e=[]){let t=e.includes("--json");t&&we(!0);let r=Pn(),o=r.state==="ok"?await uy(r.token):null,n=kt(),i=$D({accounts:a=>n?Dr(n,a):[],hasKeystore:a=>n?_r(n,a,"keystore").read()!==null:!1,cloudAccounts:o});if(t)xe(i);else for(let a of ID(i))h(a);return 0}import*as yw from"node:https";import{createInterface as bw}from"node:readline/promises";function Hg(){let e=Sr({fresh:!0});if(e.source==="peer-wsl"||e.source==="peer-windows"){let o=e.source==="peer-wsl"?"on Windows":"inside WSL";return b(`the bridge is running ${o} (state in ${e.dir}), so an account linked here would be saved where that hub cannot read it. Run \`acbridge link\` from ${o}, or stop that bridge and start one on this side first.`),null}let t=kt();if(t)return t;let r=Bn();return r.ok?(b($e()?"This machine's signed-in account doesn't match its stored account pointer \u2014 run `acbridge logout` then `acbridge login` to reset it.":"Couldn't resolve this machine's signed-in account \u2014 run `acbridge login` again."),null):(b(r.message),null)}var AD=e=>`${e} on the command line is world-readable via \`ps\` and saved in shell history \u2014 prefer \`${e}-file <path>\`, the interactive prompt, or its env var.`;function gr(e){if(e.file!==void 0){let t=(e.read??O)(e.file);if(t===null)return{ok:!1,message:`Couldn't read ${e.flag}-file ${e.file} \u2014 check the path and its permissions.`};let r=t.trim();return r?{ok:!0,value:r}:{ok:!1,message:`${e.flag}-file ${e.file} is empty \u2014 write the secret into it first.`}}return e.argv!==void 0?((e.warn??U)(AD(e.flag)),{ok:!0,value:e.argv.trim()}):{ok:!0,value:(e.env??"").trim()}}function ED(e){let t={},r=(o,n,i,a)=>o===`--${Bg(n)}`?(t[n]=a[++i],i):(o.startsWith(`--${Bg(n)}=`)&&(t[n]=o.slice(`--${Bg(n)}=`.length)),i);for(let o=0;o<e.length;o++){let n=e[o];if(n)for(let i of["tokenFile","keyFile","secretFile","passwordFile","url","token","units","host","bridgeId","key","clientId","secret","region","email","password","mfa","username","prefix"])o=r(n,i,o,e)}return t}var Bg=e=>e==="bridgeId"?"bridge-id":e==="clientId"?"client-id":e.endsWith("File")?`${e.slice(0,-4)}-file`:e,PD=e=>/^(https?|wss?):\/\/[^\s]+$/i.test(e),xw="Usage: acbridge link home-assistant --url http://homeassistant.local:8123 --token <long-lived-access-token> | --token-file <path> [--units metric|imperial]",kw="Usage: acbridge link hue --host <bridge-ip> [--bridge-id <id>] [--key <existing-app-key> | --key-file <path>]",ww="Usage: acbridge link smartthings (opens a browser sign-in via the relay; tokens seal at the relay)",Sw="Usage: acbridge link tuya [--client-id <id>] [--secret <access-secret> | --secret-file <path>] [--region eu|eu-w|us|us-e|cn|in] (eu-w/us-e = the Azure DCs)",_w="Usage: acbridge link meross [--email <you@example.com>] [--password <pw> | --password-file <path>] [--region eu|us|ap] [--mfa <6-digit-2fa-code>]",$w="Usage: acbridge link ewelink [--email <you@example.com>] [--password <pw> | --password-file <path>] [--region eu|us|as|cn]",Iw="Usage: acbridge link govee [--key <govee-api-key> | --key-file <path>] (Govee Home app \u2192 profile \u2192 Settings \u2192 Apply for API Key)",Aw="Usage: acbridge link mqtt --host <broker-host[:port]> [--username <u>] [--password <p> | --password-file <path>] [--prefix homeassistant]",CD="nanoleaf pairs per-device, not per-account: run `acbridge scan`, then `acbridge connect <device>` and hold the panel's power button.";async function Ew(e){let t=e[0],r=ED(e.slice(1));if(t==="smartthings")return DD();if(t==="tuya")return ND(r);if(t==="meross")return LD(r);if(t==="ewelink")return UD(r);if(t==="govee")return zD(r);let o;if(t==="home-assistant"||t==="homeassistant")o=TD(r);else if(t==="hue")o=await OD(r);else if(t==="mqtt")o=RD(r);else return b(`unsupported provider: ${t??"(none)"}. Supported: home-assistant, hue, smartthings, tuya, meross, ewelink, govee, mqtt`),h(xw),h(kw),h(ww),h(Sw),h(_w),h($w),h(Iw),h(Aw),h(CD),2;if(!o)return 1;Y("Bringing up the integration\u2026");try{let{spawned:n}=await it({kind:"cli"});n||await qk(),A(`Linked \u2014 your ${o.label} devices should now appear in the app and to Claude.`)}catch(n){h(`Recorded. Start the node when ready (\`acbridge daemon\`) to bring it up. (${n.message})`)}return 0}function TD(e){let t=Hg();if(!t)return null;let r=(e.url??"").trim().replace(/\/+$/,""),o=gr({flag:"--token",argv:e.token,file:e.tokenFile,env:process.env.BRIDGE_HA_TOKEN});if(!o.ok)return b(o.message),null;let n=o.value;if(!PD(r))return b("Missing/invalid --url. Give your Home Assistant base URL, e.g. http://homeassistant.local:8123"),h(xw),null;if(!n)return b("Missing --token (or BRIDGE_HA_TOKEN). Create a Long-Lived Access Token in HA \u2192 your profile \u2192 Security."),null;let i=e.units==="imperial"||e.units==="metric"?e.units:void 0,a=Pa("homeassistant",r);_r(t,"homeassistant",a).write(n);let s=Dr(t,"homeassistant").filter(l=>l.accountId!==a);return Da(t,"homeassistant",[...s,{accountId:a,baseUrl:r,...i?{unitSystem:i}:{}}]),A(`Linked Home Assistant (${r}). Token stored locally; account ${a}.`),{label:"Home Assistant"}}function RD(e){let t=Hg();if(!t)return null;let r=(e.host??e.url??"").trim(),{host:o,port:n,tls:i}=Nk(r);if(!o)return b("Missing --host. Give your broker's address, e.g. --host 192.168.1.5 (or mqtts://broker.lan:8883)."),h(Aw),null;let a=(e.username??"").trim(),s=gr({flag:"--password",argv:e.password,file:e.passwordFile,env:process.env.BRIDGE_MQTT_PASSWORD});if(!s.ok)return b(s.message),null;let l=s.value;if(l&&!a)return b("A password needs a --username too \u2014 MQTT forbids a password with no user, and brokers refuse the connection."),null;let u=(e.prefix??"").trim(),d=`${o}:${n??(i?8883:1883)}`,p=Pa("mqtt",d);_r(t,"mqtt",p).write(l);let m=Dr(t,"mqtt").filter(f=>f.accountId!==p);return Da(t,"mqtt",[...m,{accountId:p,host:o,...n!==void 0?{port:n}:{},...i?{tls:i}:{},...a?{username:a}:{},...u?{discoveryPrefix:u}:{}}]),A(`Linked MQTT broker ${d}${a?` as ${a}`:" (anonymous)"}. Account ${p}.`),h(`Watching \`${u||"homeassistant"}/#\` for Home Assistant Discovery configs \u2014 Zigbee2MQTT, Tasmota and anything else that publishes them.`),{label:"MQTT"}}async function OD(e){let t=Hg();if(!t)return null;let r=(e.host??"").trim();if(!r)return b("Missing --host. Give your Hue Bridge IP, e.g. --host 192.168.1.42"),h(kw),null;let o=(e.bridgeId??"").trim().toLowerCase(),n;if(!o){let d=await jD(r);o=d.bridgeId??r.toLowerCase(),n=d.name}let i=gr({flag:"--key",argv:e.key,file:e.keyFile,env:process.env.BRIDGE_HUE_KEY});if(!i.ok)return b(i.message),null;let a=i.value||void 0,s;if(a)s=JSON.stringify({appkey:a.trim()}),h("Using the provided app key (skipping link-button pairing).");else{Y("Press the link button on top of your Hue Bridge now \u2014 pairing completes within 30s\u2026");try{let d=await FD(r);s=JSON.stringify({appkey:d.appkey,...d.clientkey?{clientkey:d.clientkey}:{}})}catch(d){return b(`Hue pairing failed: ${d.message}`),null}}let l=Pa("hue",o);_r(t,"hue",l).write(s);let u=Dr(t,"hue").filter(d=>d.accountId!==l);return Da(t,"hue",[...u,{accountId:l,host:r,bridgeId:o,...n?{name:n}:{}}]),A(`Linked Philips Hue (${r}, bridge ${o}). Keys stored locally; account ${l}.`),{label:"Philips Hue"}}async function DD(){let e=Bn();if(!e.ok)return b(e.message),3;Y("Starting SmartThings sign-in\u2026");let t=await py("smartthings");return!t.ok||!t.authorizeUrl?(b(t.error??"Couldn't start SmartThings linking."),h(ww),1):(A("Open this URL in a browser, sign in to Samsung, and approve access:"),h(t.authorizeUrl),h("The account links at the relay; the hub picks it up automatically on its next connect (or restart the hub)."),0)}async function ND(e){let t=await cr();if(!t.ok)return b(t.message),3;h("Tuya key wizard \u2014 one-time setup to control Smart Life / Tuya devices locally:"),h(" 1. Create a free account + Cloud Project at iot.tuya.com (data-center region MUST match your Smart Life app \u2014 UK/EU \u2192 Central Europe)."),h(" 2. Subscribe IoT Core (+ Authorization) to the project, then 'Link Tuya App Account' by scanning the QR from the Smart Life app."),h(" 3. Copy the project's Access ID (client id) + Access Secret below."),h(" Note: the IoT Core trial runs ~1 month (console \u2192 Cloud \u2192 My Services \u2192 'Extend Trial Period'). After it expires your"),h(" already-connected lamps keep working locally \u2014 only fetching NEW keys stops. Re-pairing a device rotates its key \u2192 re-run this.");let r=(e.clientId??process.env.BRIDGE_TUYA_CLIENT_ID??await ko("Access ID (client id): ")).trim(),o=gr({flag:"--secret",argv:e.secret,file:e.secretFile,env:process.env.BRIDGE_TUYA_SECRET});if(!o.ok)return b(o.message),2;let n=(o.value||await Gc("Access Secret: ")).trim(),i=((e.region??process.env.BRIDGE_TUYA_REGION??await ko("Region [eu]: "))||"eu").trim().toLowerCase();if(!r||!n)return b("Both the Access ID and Access Secret are required."),h(Sw),1;if(!["eu","eu-w","us","us-e","cn","in"].includes(i))return b(`Unknown region "${i}" \u2014 use eu, eu-w, us, us-e, cn, or in.`),1;Y("Making sure the hub is running\u2026");try{await it({kind:"cli"})}catch(s){return b(`The hub isn't running and couldn't be started: ${s.message}. Start it with \`acbridge daemon\` and retry.`),1}Y("Fetching your device keys from Tuya (this can take a few seconds)\u2026");let a=await Z("/local/tuya/link",{method:"POST",body:{clientId:r,clientSecret:n,region:i},timeoutMs:9e4});if(a.hubOffline)return b("The hub went offline. Start it with `acbridge daemon` and retry."),1;if(a.status===200&&a.body?.ok){let s=a.body.deviceCount??0,l=a.body.sleepyCount??0;return A(`Imported keys for ${s} Tuya device${s===1?"":"s"}. Keys are stored only on this PC (never on your network or the cloud).`),l>0&&h(`${l} battery/sensor device${l===1?"":"s"} (e.g. a PIR) won't control locally yet \u2014 those come in a later update.`),h('Now run `acbridge scan` \u2014 your lamps should appear under "Ready to connect". Connect each, then control by voice or in the app.'),0}return b(a.body?.error??`The hub couldn't complete the wizard (HTTP ${a.status??"?"}).`),1}async function LD(e){let t=await cr();if(!t.ok)return b(t.message),3;h("Meross account wizard \u2014 a one-time sign-in so the hub can control your Meross devices locally:"),h(" Your Meross email + password are sent ONCE to Meross to fetch the account key that signs local"),h(" requests. The key is stored only on this PC \u2014 never on your network, the cloud, or our relay.");let r=gr({flag:"--password",argv:e.password,file:e.passwordFile,env:process.env.BRIDGE_MEROSS_PASSWORD});if(!r.ok)return b(r.message),2;let o=(e.email??process.env.BRIDGE_MEROSS_EMAIL??await ko("Meross email: ")).trim(),n=r.value||await Gc("Password: "),i=((e.region??process.env.BRIDGE_MEROSS_REGION??await ko("Region [eu]: "))||"eu").trim().toLowerCase();if(!o||!n)return b("Both the email and password are required."),h(_w),1;if(!["eu","us","ap"].includes(i))return b(`Unknown region "${i}" \u2014 use eu, us, or ap.`),1;let a=(e.mfa??process.env.BRIDGE_MEROSS_MFA)?.trim()||void 0;Y("Making sure the hub is running\u2026");try{await it({kind:"cli"})}catch(l){return b(`The hub isn't running and couldn't be started: ${l.message}. Start it with \`acbridge daemon\` and retry.`),1}Y("Signing in to Meross\u2026");let s=await Z("/local/meross/link",{method:"POST",body:{email:o,password:n,region:i,...a?{mfaCode:a}:{}},timeoutMs:6e4});if(s.hubOffline)return b("The hub went offline. Start it with `acbridge daemon` and retry."),1;if(s.status===200&&s.body?.ok){let l=s.body.deviceCount??0;return A(`Signed in. The account key is stored only on this PC.${l?` (${l} device${l===1?"":"s"} on the account.)`:""}`),h('Now run `acbridge scan` \u2014 your Meross plugs/bulbs should appear under "Ready to connect". Connect each, then control by voice or in the app.'),0}return b(s.body?.error??`The hub couldn't complete the sign-in (HTTP ${s.status??"?"}).`),1}async function UD(e){let t=await cr();if(!t.ok)return b(t.message),3;h("SONOFF / eWeLink account wizard \u2014 a one-time sign-in so the hub can control your SONOFF devices locally:"),h(" Your eWeLink email + password are sent ONCE to eWeLink to fetch each device's LAN key. The keys"),h(" are stored only on this PC \u2014 never on your network, the cloud, or our relay.");let r=gr({flag:"--password",argv:e.password,file:e.passwordFile,env:process.env.BRIDGE_EWELINK_PASSWORD});if(!r.ok)return b(r.message),2;let o=(e.email??process.env.BRIDGE_EWELINK_EMAIL??await ko("eWeLink email: ")).trim(),n=r.value||await Gc("Password: "),i=((e.region??process.env.BRIDGE_EWELINK_REGION??await ko("Region [eu]: "))||"eu").trim().toLowerCase();if(!o||!n)return b("Both the email and password are required."),h($w),1;if(!["eu","us","as","cn"].includes(i))return b(`Unknown region "${i}" \u2014 use eu, us, as, or cn.`),1;Y("Making sure the hub is running\u2026");try{await it({kind:"cli"})}catch(s){return b(`The hub isn't running and couldn't be started: ${s.message}. Start it with \`acbridge daemon\` and retry.`),1}Y("Signing in to eWeLink\u2026");let a=await Z("/local/ewelink/link",{method:"POST",body:{email:o,password:n,region:i},timeoutMs:6e4});if(a.hubOffline)return b("The hub went offline. Start it with `acbridge daemon` and retry."),1;if(a.status===200&&a.body?.ok){let s=a.body.deviceCount??0;return A(`Signed in. ${s} device key${s===1?"":"s"} stored \u2014 only on this PC.`),h('Now run `acbridge scan` \u2014 your SONOFF switches/plugs should appear under "Ready to connect". Connect each, then control by voice or in the app.'),0}return b(a.body?.error??`The hub couldn't complete the sign-in (HTTP ${a.status??"?"}).`),1}async function zD(e){let t=await cr();if(!t.ok)return b(t.message),3;h("Govee key wizard \u2014 one self-service API key imports your Govee devices:"),h(" Govee Home app \u2192 profile \u2192 Settings \u2192 Apply for API Key (it arrives by email within minutes).");let r=gr({flag:"--key",argv:e.key,file:e.keyFile,env:process.env.BRIDGE_GOVEE_KEY});if(!r.ok)return b(r.message),2;let o=(r.value||await Gc("Govee API key: ")).trim();if(!o)return b("An API key is required."),h(Iw),2;Y("Making sure the hub is running\u2026");try{await it({kind:"cli"})}catch(i){return b(`The hub isn't running and couldn't be started: ${i.message}. Start it with \`acbridge daemon\` and retry.`),1}Y("Importing your Govee devices\u2026");let n=await Z("/local/govee/link",{method:"POST",body:{apiKey:o},timeoutMs:6e4});if(n.hubOffline)return b("The hub went offline. Start it with `acbridge daemon` and retry."),1;if(n.status===200&&n.body?.ok){let i=n.body.deviceCount??0;return A(`Imported ${i} Govee device${i===1?"":"s"}. The key is stored only on this PC.`),h('Now run `acbridge scan` \u2014 your Govee lights should appear under "Ready to connect". Connect each, then control by voice or in the app.'),0}return b(n.body?.error??`The hub couldn't complete the wizard (HTTP ${n.status??"?"}).`),1}async function ko(e){let t=bw({input:process.stdin,output:process.stdout});try{return await t.question(e)}finally{t.close()}}async function Gc(e){let t=process.stdout,r=bw({input:process.stdin,output:t}),o=r,n=o._writeToOutput?.bind(r);o._writeToOutput=i=>{(i.includes(e)||i===`\r
|
|
254
|
+
`):(process.stdout.write(e),n=!0)}}o.question(e,n=>{o.close(),r(n.trim())})})}async function s0(e){let t=await G("/local/discovered");if(t.hubOffline)return b(Ne()),1;if(t.status!==200||!t.body)return b(`hub answered HTTP ${t.status} reading /local/discovered`),1;let r=t.body.devices;if(e.startsWith("ldev_")){let o=r.find(n=>n.discoveredId===e);return o||(b(`unknown discoveredId ${e} \u2014 run \`acbridge scan\` and use an id from its results`),1)}if(i0(e)){let o=$t(e),n=r.find(i=>i.addresses.mac===o);return n||(b(`no discovered device with MAC ${o} \u2014 run \`acbridge scan\` first`),1)}if(mg(e)){let o=r.filter(n=>n.addresses.ip===e);if(o.length===1)return o[0];if(o.length===0)return b(`no discovered device at ${e} \u2014 run \`acbridge scan\` first`),1;b(`${o.length} devices share ${e} \u2014 pick one by id:`);for(let n of o)h(` ${n.discoveredId} ${fg(n)}`);return 1}return b(`not a MAC, IP, or ldev_\u2026 id: ${e}`),h(Fn),2}var fg=e=>{let t=[e.identity.manufacturer,e.identity.model].filter(Boolean).join(" ");return`${e.identity.name??(t||(e.identity.hint??"unknown device"))} (${e.addresses.ip}${e.addresses.mac?`, ${e.addresses.mac}`:""})`};async function iR(e,t){let r;if(e.startsWith("dev_"))r=e;else if(i0(e))r=r0(e);else if(e.startsWith("ldev_")||mg(e)){let n=await s0(e);if(typeof n=="number")return n;if(!n.addresses.mac)return b(`${e} has no stable identity (no MAC) \u2014 it was never connected, so there is nothing to forget`),1;r=r0(n.addresses.mac)}else return b(`not a deviceId, MAC, IP, or ldev_\u2026 id: ${e}`),h(Fn),2;let o=await G("/local/forget",{method:"POST",body:{deviceId:r,purge:t}});return o.hubOffline?(b(Ne()),1):o.status===200&&o.body?.ok?(A(`forgot ${r}${t?" (purged)":""} \u2014 it will not be auto-reconnected`),o.body.note&&h(o.body.note),0):(b(o.body?.error??`hub answered HTTP ${o.status}`),1)}async function aR(e){if(e!=="on"&&e!=="off")return b(`--auto takes on|off, got: ${e||"(none)"}`),h(Fn),2;let t=await G("/local/config");if(t.hubOffline)return b(Ne()),1;if(t.status!==200||!t.body)return b(`hub answered HTTP ${t.status} reading /local/config`),1;let r={...t.body,autoConnect:e==="on"?"open-protocols":"off"},o=await G("/local/config",{method:"POST",body:r});return o.hubOffline?(b(Ne()),1):o.status!==200||!o.body?(b(`hub answered HTTP ${o.status} writing /local/config`),1):(o.body.autoConnect==="open-protocols"?(A("auto-connect ON (open protocols)"),h("New lights/plugs on open local protocols connect automatically. Never locks, covers, garage doors, valves, cameras, or doorbells.")):A("auto-connect OFF"),0)}import{writeFileSync as IR}from"node:fs";function Rc(){return mv({marketplaceDir:Nr,claudeCmd:Yt()})}function c0(){return pv({claudeCmd:Yt()})}function sR(e=M){return ka(Tr(Rr(e)))}function bo(e){return kv(Nr,{settingsFile:e?.settingsFile,configFile:e?.configFile,env:e?.env,nodeCommand:e?.nodeCommand??sR(e?.bridgeDir)})}function Oc(e={}){let t=[],r=e.ensurePluginInstalled??Rc;try{let n=r();n.marketplaceRepointed?t.push({level:"info",message:"Re-pointed the alexa plugin marketplace to this install."}):n.pluginReinstalled&&t.push({level:"info",message:"Refreshed the alexa plugin from this install."})}catch(n){t.push({level:"warn",message:`plugin refresh skipped: ${n.message}`})}let o=e.ensureStatusline??bo;try{let n=o();n.changed&&t.push({level:"info",message:n.enabled?"Installed the AC Bridge statusline tee (chains any existing statusline).":"Removed the AC Bridge statusline tee (original restored)."})}catch(n){t.push({level:"warn",message:`statusline tee skipped: ${n.message}`})}return t}function l0(e){if(!e)return null;try{let t=JSON.parse(e);return typeof t.signal!="string"||typeof t.ts!="number"?null:{signal:t.signal,ts:t.ts}}catch{return null}}function u0(e){if(e.reason!==null&&e.now-e.reason.ts<(e.reasonFreshMs??6e4)&&e.reason.signal!=="account-switched")return{action:"exit-clean"};let r=e.windowMs??3e5;return e.respawnTimes.filter(n=>e.now-n<r).length>=(e.maxRespawns??3)?{action:"exit-fail",why:"the hub keeps dying \u2014 respawn cap reached (see ~/.claude-bridge/hub.log)"}:{action:"respawn"}}function d0(e,t,r){return t==="offline"?"handle-offline":t==="unknown"||e.holderId===null?"rehold":e.wantRevert&&r&&r.active===!1?"rearm":"none"}import{createInterface as hR}from"node:readline/promises";function Bn(e={}){let t=(e.payloadVersion??(()=>Ct()))();if(t!==null)return{version:t,channel:"app"};let r=(e.bundledVersion??Hk)(),o=Oh(r);return o!==null?{version:o,channel:"npm"}:{version:null,channel:null}}function Dc(e=O){let t=ve(),r=e(t.refreshFile)?.trim(),o=r?Ge(r):null;if(o)return o;let n=e(t.accessFile)?.trim();return n?Ge(n):null}var p0="https://www.ac-bridge.com/home";function m0(e,t){return!t||typeof t.plan!="string"?{allowed:!0}:t.plan==="paid"&&t.serviceOk===!1?{allowed:!1,message:`Your subscription has ended \u2014 manage your plan at ${p0}, then retry.`}:t.plan==="free"?{allowed:!1,message:`No active subscription \u2014 start the 3-day free trial at ${p0}, then retry.`}:{allowed:!0}}var cR=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?$/;function f0(e){let t=cR.exec(e);if(!t)return null;let r=t[4]?t[4].split(".").map(o=>/^\d+$/.test(o)?Number(o):o):[];return{major:Number(t[1]),minor:Number(t[2]),patch:Number(t[3]),prerelease:r}}function lR(e,t){let r=typeof e=="number",o=typeof t=="number";return r&&!o?-1:!r&&o?1:e<t?-1:e>t?1:0}function Ui(e,t){let r=f0(e),o=f0(t);if(!r||!o)return null;for(let i of["major","minor","patch"])if(r[i]!==o[i])return r[i]<o[i]?-1:1;if(r.prerelease.length===0&&o.prerelease.length===0)return 0;if(r.prerelease.length===0)return 1;if(o.prerelease.length===0)return-1;let n=Math.min(r.prerelease.length,o.prerelease.length);for(let i=0;i<n;i++){let a=lR(r.prerelease[i],o.prerelease[i]);if(a!==0)return a}return r.prerelease.length!==o.prerelease.length?r.prerelease.length<o.prerelease.length?-1:1:0}var g0="npm i -g acbridge@latest",uR="https://www.ac-bridge.com/api/releases/manifest",gg=6*36e5,dR="https://www.ac-bridge.com";function pR(e=process.platform){return e==="win32"?"windows":e==="darwin"?"macos":e==="linux"?"linux":null}function h0(e){if(typeof e!="object"||e===null)return null;let t=e;if(t.schemaVersion!==1)return null;let r={},o=typeof t.platforms=="object"&&t.platforms!==null?t.platforms:{};for(let i of["windows","macos","linux"]){let a=o[i];typeof a=="object"&&a!==null&&typeof a.version=="string"&&(r[i]={version:a.version})}let n=typeof t.cli=="object"&&t.cli!==null?t.cli:null;return{schemaVersion:1,minimumVersion:typeof t.minimumVersion=="string"?t.minimumVersion:null,downloadPage:typeof t.downloadPage=="string"&&t.downloadPage?t.downloadPage:dR,platforms:r,cli:n?{version:typeof n.version=="string"?n.version:null,minimumVersion:typeof n.minimumVersion=="string"?n.minimumVersion:null}:null}}async function Nc(e={}){let t=process.env.BRIDGE_UPDATE_MANIFEST_URL||uR;try{let r=await(e.fetchImpl??fetch)(t,{signal:AbortSignal.timeout(e.timeoutMs??6e3)});if(!r.ok)return null;let o=h0(await r.json());return o&&mR(o,e.now),o}catch{return null}}function mR(e,t=Date.now()){try{let r={};try{let o=JSON.parse(O(we)??"{}");typeof o=="object"&&o!==null&&!Array.isArray(o)&&(r=o)}catch{r={}}r.updateCheck={manifest:e,fetchedAt:t},ge(we,`${JSON.stringify(r,null,2)}
|
|
255
|
+
`)}catch{}}function Lc(e=gg,t=Date.now()){try{let r=O(we);if(!r)return null;let n=JSON.parse(r).updateCheck;return!n||typeof n!="object"||typeof n.fetchedAt!="number"||t-n.fetchedAt>e?null:h0(n.manifest)}catch{return null}}function zi(e,t,r=process.platform,o="app"){if(e===null)return{state:"dev"};if(!t)return{state:"unknown"};if(o==="npm"){let a=t.cli;return a?a.minimumVersion&&Ui(e,a.minimumVersion)===-1?{state:"blocked",current:e,minimum:a.minimumVersion,upgrade:g0}:a.version&&Ui(e,a.version)===-1?{state:"update",current:e,latest:a.version,upgrade:g0}:{state:"current",current:e}:{state:"unpublished",current:e}}if(t.minimumVersion&&Ui(e,t.minimumVersion)===-1)return{state:"blocked",current:e,minimum:t.minimumVersion,upgrade:t.downloadPage};let n=pR(r),i=n?t.platforms[n]?.version:void 0;return i&&Ui(e,i)===-1?{state:"update",current:e,latest:i,upgrade:t.downloadPage}:{state:"current",current:e}}function v0(e,t,r=process.platform,o="app"){let n=zi(e,t,r,o),i=o==="npm"?"acbridge":"app";switch(n.state){case"dev":return{grade:"info",line:"dev build \u2014 update checks skipped"};case"unknown":return{grade:"warn",line:"update check unreachable"};case"unpublished":return{grade:"info",line:`${i} ${n.current} \u2014 no update channel published yet`};case"blocked":return{grade:"bad",line:`${i} ${n.current} is below the minimum supported version ${n.minimum} \u2014 update required: ${n.upgrade}`};case"update":return{grade:"warn",line:`update available: ${n.latest} (you have ${n.current})`};case"current":return{grade:"ok",line:`${i} ${n.current} is current`}}}var vR="Not signed in on this machine. Run `acbridge login`, sign in via the AC Bridge app, or `acbridge pair <code>` (get a code from the app: System \u2192 Add another machine).";function Mn(e=O,t={}){let r=t.paths??ve(),o=e(r.accessFile)?.trim(),n=e(r.refreshFile)?.trim();if(o||n)return(t.resolveScope??(()=>pt()))()?{ok:!0,paired:!!n}:(t.readPointer??(()=>$e()))()?{ok:!1,message:qe.pointerMismatch}:{ok:!0,paired:!!n};let i=(t.scan??dt)();return i.length===0?{ok:!1,message:vR}:(nt(i),{ok:!1,message:qe.pointerMismatch})}async function ur(e){if(await(e?.hubHealthy??Te)())return{ok:!0};let r=Mn(e?.read??O);return r.ok?{ok:!0}:{ok:!1,message:r.message}}function y0(e={}){let t=e.resolveScope??(()=>pt()),o=(e.layout??Kt())>=Xt,n=o?(e.scan??dt)():[];(e.warnAmbiguous??(u=>nt(u)))(n);let i=t();if(i)return i;if((e.readPointer??(()=>$e()))())return null;let s=u=>((e.writePointer??(d=>Qt({sub:d})))(u),t());if(o){if(n.length!==1)return null;let u=n[0];return ja(u,e.segmentOf)?s(u.sub):null}let l=(e.readCredentialSub??Dc)();return l?s(l):null}function yR(){let e=y0();return e?wa({configFile:Qo(e).userConfigFile}).onboardedAt:null}function bR(e){let t=y0();t&&Sa({onboardedAt:e},{configFile:Qo(t).userConfigFile})}async function xR(e={}){let t=(e.build??Bn)(),r=e.clientVersion?e.clientVersion():t.version;if(r===null)return{ok:!0};let o=await(e.fetchManifest??Nc)()??(e.cachedManifest??Lc)(gg);if(!o)return(e.warnLine??U)("update check unreachable \u2014 continuing (it will retry next run)"),{ok:!0};let n=zi(r,o,e.platform??process.platform,t.channel??"app");return n.state==="blocked"?{ok:!1,exitCode:4,message:`This AC Bridge build (${n.current}) is below the minimum supported version (${n.minimum}). Update it: ${n.upgrade}`}:(n.state==="update"&&(e.infoLine??h)(`update available: ${n.latest} (you have ${n.current}) \u2014 ${n.upgrade}`),{ok:!0})}var kR="This machine's sign-in is no longer valid (the relay rejected its stored credential). Run `acbridge login` to sign in again.";function wR(){return!!O(ve().refreshFile)?.trim()}var SR="This account hasn't completed setup yet. Run `acbridge login --if-needed` on this machine to complete it from the terminal, or finish first-run setup in the AC Bridge app.";async function xo(e={}){let t=e.read??O,r=Mn(t);if(!r.ok){let m=e.isTTY??!!(process.stdin.isTTY&&process.stdout.isTTY)?(e.findApp??(()=>Dr()))():null;if(m&&await(e.offerAndLaunch??_R)(m)&&(r=Mn(t)),!r.ok)return{ok:!1,exitCode:3,message:r.message}}let o=e.relayUrl??ne().relayUrl,n=e.fetchImpl??fetch;if(!await(e.refreshToken??(p=>Tt(p)))(o)&&!(e.hasRefreshCredential??wR)())return{ok:!1,exitCode:3,message:kR};let a=t(ve().accessFile)?.trim()??"",s={reachable:!1,completedAt:null};try{let p=await n(`${o.replace(/\/+$/,"")}/settings`,{headers:{authorization:`Bearer ${a}`},signal:AbortSignal.timeout(6e3)});if(p.ok){let f=(await p.json()).config?.onboarding?.completedAt;s={reachable:!0,completedAt:typeof f=="number"?f:null}}}catch{}if(s.reachable){if(s.completedAt===null)return{ok:!1,exitCode:3,message:SR};(e.cacheOnboardedAt??bR)(s.completedAt)}else if((e.cachedOnboardedAt??yR)()===null)return{ok:!1,exitCode:1,message:"Couldn't verify this account's setup with the relay \u2014 check your connection and retry."};let l=await xR(e.updateGate);if(!l.ok)return l;let u=await(e.fetchEntitlement??Ot)(a),d=m0("preflight",u);return d.allowed?{ok:!0}:{ok:!1,exitCode:5,message:d.message}}async function _R(e){let t=hR({input:process.stdin,output:process.stdout}),r=!1;try{let n=(await t.question("Not signed in \u2014 open the AC Bridge app to sign in? [Y/n] ")).trim().toLowerCase();r=n===""||n==="y"||n==="yes"}finally{t.close()}if(!r||!await Pa(e))return!1;X("waiting for you to finish signing in in the app\u2026");let o=await Ca({timeoutMs:18e4});return o&&h("signed in \u2014 continuing."),o}var $R=["relayUrl","hubPort","machine"];async function Uc(e,t,r=fetch){let o=await r(`${e.replace(/\/+$/,"")}/settings`,{headers:{authorization:`Bearer ${t}`}});if(!o.ok)throw new Error(`relay ${o.status}`);let n=await o.json().catch(()=>null);return{version:typeof n?.version=="number"?n.version:null,config:typeof n?.config=="object"&&n?.config!==null?n.config:{}}}async function ko(e,t,r=fetch){if(!t)return null;let o;try{o=await Uc(e,t,r)}catch(n){return h(`Cloud settings sync skipped (${n instanceof Error?n.message:String(n)}).`),null}try{let n=typeof o.config.cli=="object"&&o.config.cli!==null?o.config.cli:null;if(!n)return o;let i={};for(let l of $R){let u=n[l];(l==="hubPort"?typeof u=="number"&&Number.isFinite(u):typeof u=="string"&&u)&&(i[l]=u)}if(Object.keys(i).length===0)return o;let a={};try{a=JSON.parse(O(we)??"{}"),(typeof a!="object"||a===null||Array.isArray(a))&&(a={})}catch{a={}}let s={...a,...i};if(JSON.stringify(s)===JSON.stringify(a))return o;ge(we,`${JSON.stringify(s,null,2)}
|
|
256
|
+
`),h(`Synced cloud settings into config.json (${Object.keys(i).join(", ")}).`)}catch(n){h(`Cloud settings sync skipped (${n instanceof Error?n.message:String(n)}).`)}return o}var AR=3e3;async function zc(e=[]){let t=!e.includes("--no-revert"),{relayUrl:r}=ne(),o=await xo();if(!o.ok)return b(o.message),o.exitCode;if(!await Tt(r))return b("No valid credential. Run `acbridge login`, or sign in via the app."),3;await ko(r,O(ve().accessFile)??"");for(let y of Oc())(y.level==="info"?h:U)(y.message);let n=(await it({kind:"daemon"})).holderId;try{IR(Je,String(process.pid))}catch{}let i=Date.now();ug(i),setInterval(()=>ug(i),Zk).unref();let a,s=!1,l=async()=>{let y=await G("/local/session/activate",{method:"POST",body:{revertOnStop:t},timeoutMs:8e3});s=!y.hubOffline&&y.status===200&&y.body?.active===!0,a=y.body?.active?y.body.sessionId:void 0};await l();let u=!1,d=async(y=0)=>{u||(u=!0,n&&await Tc(n).catch(()=>{}),de(Je),Wk(),process.exit(y))};process.once("SIGINT",()=>{d()}),process.once("SIGTERM",()=>{d()}),A(`Bridge running \u2014 hub connected, revert-on-stop ${t?"armed":"off"}. Ctrl-C to stop.`);let p=[],m=async()=>{let y=u0({reason:l0(O(ei)),now:Date.now(),respawnTimes:p});if(y.action==="exit-clean"){A("hub stopped \u2014 daemon exiting."),await d();return}if(y.action==="exit-fail"){b(y.why),await d(1);return}p.push(Date.now()),U("hub went down without a stop \u2014 respawning it\u2026");try{n=(await it({kind:"daemon"})).holderId,await l(),A("hub respawned")}catch(k){U(`respawn failed: ${k.message} \u2014 retrying on the next beat`),n=null}},f=!1,g=async()=>{if(!(f||u)){f=!0;try{let y=n?await e0(n):await Te()?"unknown":"offline",k=null;if(y==="ok"&&t){let P=await G("/local/session/heartbeat",{method:"POST",body:{...a?{sessionId:a}:{}},timeoutMs:4e3});!P.hubOffline&&P.status===200&&P.body&&(k={active:P.body.active})}let _=d0({holderId:n,wantRevert:t,sessionArmed:s},y,k);_==="handle-offline"?await m():_==="rehold"?(n=await Pc("daemon"),t&&await l()):_==="rearm"&&await l()}finally{f=!1}}};return setInterval(()=>{g()},AR),await new Promise(()=>{}),0}var hg=["Usage: acbridge devices [list] [--json]"," acbridge devices on|off <device>"," acbridge devices set <device> <capability.command|command> [--param k=v ...]"].join(`
|
|
257
|
+
`);function vg(e,t){let r=e.find(a=>a.id===t);if(r)return{ok:!0,device:r};let o=t.toLowerCase(),n=e.filter(a=>a.name.toLowerCase()===o);if(n.length===1)return{ok:!0,device:n[0]};let i=n.length>1?n:e.filter(a=>a.name.toLowerCase().includes(o));return i.length===1?{ok:!0,device:i[0]}:i.length>1?{ok:!1,kind:"ambiguous",candidates:i.map(a=>({id:a.id,name:a.name}))}:{ok:!1,kind:"not-found",candidates:[]}}function ER(e){let t={};for(let r of e){let o=r.indexOf("=");if(o<=0)return{ok:!1,message:`--param needs k=v, got: ${r}`};let n=r.slice(0,o),i=r.slice(o+1);if(i==="true"||i==="false")t[n]=i==="true";else if(i!==""&&Number.isFinite(Number(i)))t[n]=Number(i);else if(i.startsWith("[")||i.startsWith("{"))try{t[n]=JSON.parse(i)}catch{return{ok:!1,message:`--param ${n} isn't valid JSON`}}else t[n]=i}return{ok:!0,params:t}}function b0(e,t,r){let o=t.indexOf("."),n=o>0?t.slice(0,o):null,i=o>0?t.slice(o+1):t,a=[];for(let d of e.capabilities)if(!(n&&d.type!==n))for(let p of cg[d.type]??[])p.command===i&&(p.gate&&!p.gate(d)||a.push({cap:d,entry:p}));if(a.length===0)return n&&!e.capabilities.some(d=>d.type===n)?{ok:!1,message:`${e.name} doesn't have the "${n}" capability`}:{ok:!1,message:`no command "${i}" on ${e.name}${n?` (${n})`:""}`};if(a.length>1)return{ok:!1,message:`"${i}" is ambiguous on ${e.name} \u2014 qualify it: ${a.map(d=>`${d.cap.type}.${i}`).join(" | ")}`};let{cap:s,entry:l}=a[0],u=l.params.safeParse(r);if(!u.success){let d=u.error.issues[0];return{ok:!1,message:`bad params for ${s.type}.${i}: ${d?`${d.path.join(".")} ${d.message}`:"invalid"}`}}return{ok:!0,capability:s.type,command:i,params:u.data}}function PR(e,t){return{deviceId:e,capability:t.capability,command:t.command,params:t.params,consumer:"app"}}function CR(e,t){let r=new Map(e.areas.map(n=>[n.id,n.name])),o=[];if(t?.note&&o.push(`(${t.note})`),e.devices.length===0)return o.push("no devices connected \u2014 run `acbridge scan` to find some, or add them in the app"),o;for(let n of[...e.devices].sort((i,a)=>i.name.localeCompare(a.name))){let i=n.areaId&&r.get(n.areaId)||"\u2014";o.push(`${n.name.padEnd(26)} ${n.type.padEnd(12)} ${i.padEnd(14)} ${n.reachability.padEnd(9)} ${n.id}`)}return o}async function x0(){let e=await G("/local/devices",{method:"GET",timeoutMs:5e3});if(!e.hubOffline&&e.status===200&&e.body)return{doc:e.body};let t=Pn();if(t.state==="mismatch")return{refusal:{message:t.message,exitCode:3}};if(t.state!=="ok")return null;let r=await fy(t.token);return r?{doc:r,note:"relay cache \u2014 bridge not running; state may be stale"}:null}async function k0(e=[]){let t=e.includes("--json");t&&ye(!0);let r=e.filter(d=>!d.startsWith("--")),o=r[0]??"list";if(o==="list"){let d=await x0();if(d&&"refusal"in d)return Pe(d.refusal.message,d.refusal.exitCode);if(!d)return Pe("no device graph available \u2014 start the bridge (`acbridge start`) or sign in",1);if(t)he(d.doc);else for(let p of CR(d.doc,d.note?{note:d.note}:void 0))h(p);return 0}if(o!=="on"&&o!=="off"&&o!=="set")return h(hg),Pe(`unknown devices subcommand: ${o}`,2);let n=r[1];if(!n)return h(hg),Pe("which device? give an id (dev_\u2026) or a name",2);let i=await x0();if(i&&"refusal"in i)return Pe(i.refusal.message,i.refusal.exitCode);if(!i)return Pe("no device graph available \u2014 start the bridge (`acbridge start`) or sign in",1);let a=vg(i.doc.devices,n);if(!a.ok){if(a.kind==="ambiguous"){for(let d of a.candidates)h(` ${d.name} (${d.id})`);return Pe(`"${n}" matches several devices \u2014 name one of the ids above`,2)}return Pe(`no device matches "${n}" \u2014 try \`acbridge devices\``,2)}let s;if(o==="on"||o==="off")s=b0(a.device,o==="on"?"power.turnOn":"power.turnOff",{});else{let d=r[2];if(!d)return h(hg),Pe("set needs a command \u2014 e.g. `acbridge devices set lamp brightness.setBrightness --param level=40`",2);let p=[];for(let f=0;f<e.length;f++)e[f]==="--param"&&e[f+1]&&p.push(e[++f]);let m=ER(p);if(!m.ok)return Pe(m.message,2);s=b0(a.device,d,m.params)}if(!s.ok)return Pe(s.message,2);let l=Lr({notSignedIn:{message:"Not signed in. Run `acbridge login`, or sign in via the AC Bridge app.",exitCode:3}});if(!l.ok)return Pe(l.message,l.exitCode);let u=await gy(l.token,PR(a.device.id,s));return u.ok?(A(`${a.device.name}: ${s.capability}.${s.command}${u.verified===!0?" (verified)":""}`),u.note&&h(Se(u.note)),t&&he({ok:!0,deviceId:a.device.id,capability:s.capability,command:s.command}),0):u.status===503?Pe("bridge not running \u2014 run `acbridge start` (device control routes through your PC)",1):(b(u.error??`command failed (${u.status||"network"})`),t&&he({ok:!1,error:u.error??null,status:u.status,exit:1}),1)}import{spawnSync as Kc}from"node:child_process";import{existsSync as SD}from"node:fs";import _w from"node:path";import{createSocket as LR}from"node:dgram";import{readFile as UR}from"node:fs/promises";import{networkInterfaces as S0}from"node:os";import{execFile as RR}from"node:child_process";import{existsSync as OR}from"node:fs";import{join as DR}from"node:path";import{promisify as NR}from"node:util";var EH=new TextEncoder;var NH=NR(RR);function yg(e={}){let t=e.env??process.env,r=e.exists??(o=>OR(o));for(let o of(t.PATH??"").split(":"))if(o!=="")try{if(r(DR(o,"powershell.exe")))return!0}catch{}return!1}var bg="239.255.90.90",xg=35090,_0=35091;function $0(e){return!e.internal&&(e.family==="IPv4"||e.family===4)}var ft={createSocket:(e,t)=>LR({type:e,reuseAddr:t?.reuseAddr??!0}),interfaceAddresses:()=>Object.values(S0()).flatMap(e=>e??[]).filter($0).map(e=>e.address)};async function jc(e={}){let t=e.timeoutMs??2e3,r=e.sockets??ft,o=await zR(e.readProcVersion??(()=>UR("/proc/version","utf8")),e.env??process.env),[n,i]=await Promise.all([jR(r,t).catch(()=>null),FR(r,t).catch(()=>null)]),a;try{a=(e.interfaces??BR)()}catch{a=void 0}let s={wsl:o,multicastOk:n,broadcastOk:i};a!==void 0&&(s.interfaces=a);try{let l=e.windowsInterop??(()=>yg({env:e.env??process.env}));o&&l()&&(s.interop="windows-arp")}catch{}return s}async function zR(e,t){if(t.WSL_DISTRO_NAME||t.WSL_INTEROP)return!0;try{return/microsoft/i.test(await e())}catch{return!1}}function jR(e,t){return new Promise(r=>{let o=[],n=[],i=!1,a=s=>{if(!i){i=!0;for(let l of n)clearTimeout(l);for(let l of o)try{l.close()}catch{}r(s)}};try{let s=`acbridge-mc-${Math.random().toString(36).slice(2)}`,l=new TextEncoder().encode(s),u=e.createSocket("udp4",{reuseAddr:!0});o.push(u),u.on("error",()=>a(null)),u.on("message",d=>{new TextDecoder().decode(d)===s&&a(!0)}),u.bind(xg,()=>{try{u.addMembership(bg)}catch{a(null);return}let d=e.createSocket("udp4",{reuseAddr:!0});o.push(d),d.on("error",()=>a(null)),d.bind(0,()=>{let p=()=>{try{d.setMulticastLoopback(!0),d.send(l,xg,bg,m=>{m&&a(null)})}catch{a(null)}};p(),n.push(setTimeout(p,Math.max(1,Math.floor(t/2))))}),n.push(setTimeout(()=>a(!1),t))})}catch{a(null)}})}function FR(e,t){return new Promise(r=>{let o,n,i=!1,a=s=>{if(!i){i=!0,n&&clearTimeout(n);try{o?.close()}catch{}r(s)}};try{o=e.createSocket("udp4",{reuseAddr:!0});let s=o;s.on("error",()=>a(null)),s.bind(0,()=>{try{s.setBroadcast(!0),s.send(new TextEncoder().encode("acbridge-env-probe"),_0,"255.255.255.255",l=>{if(!l)return a(!0);let u=l.code;a(u==="EACCES"||u==="ENETUNREACH"||u==="EHOSTUNREACH"?!1:null)})}catch{a(null)}}),n=setTimeout(()=>a(null),t)}catch{a(null)}})}function BR(){return Object.entries(S0()).filter(([,e])=>e?.some($0)).map(([e])=>e)}var LO=qt(sw(),1);var gZ=new TextDecoder;import{createDecipheriv as yZ,createHash as UO}from"node:crypto";var kZ=UO("md5").update("yGAdlopoPVldABfn").digest(),wZ=new TextDecoder;var EZ=30*6e4;var jO=new Set(["00:33:7a","10:5a:17","10:d5:61","18:69:d8","18:de:50","1c:90:ff","20:f1:b2","2c:b4:71","30:48:7d","38:1f:8d","38:2c:e5","38:a5:c9","3c:0b:59","4c:a9:19","50:8a:06","50:8b:b9","68:57:2d","70:89:76","7c:f6:66","80:64:7c","84:e3:42","a0:92:08","a8:80:55","b8:06:0d","bc:35:1e","c0:f8:53","c4:82:e1","cc:8c:bf","d0:32:e7","d0:82:e8","d0:82:eb","d4:a6:51","d8:1f:12","d8:c8:0c","d8:d6:68","d8:fc:92","e4:ae:e4","f8:17:2d","fc:3c:d7","fc:67:1f"]),FO={"00:17:88":"Signify (Philips Hue)","c4:29:96":"Signify","fc:26:8c":"Signify","d0:73:d5":"LIFX","50:c7:bf":"TP-Link","1c:3b:f3":"TP-Link","d8:0d:17":"TP-Link","5c:e9:31":"TP-Link","3c:52:a1":"TP-Link","24:0a:c4":"Espressif","24:6f:28":"Espressif","30:ae:a4":"Espressif","5c:cf:7f":"Espressif","ec:fa:bc":"Espressif","a4:cf:12":"Espressif","48:3f:da":"Espressif","70:87:9e":"Beken","80:6d:de":"Beken","c8:47:8c":"Beken",...Object.fromEntries([...jO].map(e=>[e,"Tuya"])),"a8:bb:50":"WiZ","d8:a0:11":"WiZ","44:4f:8e":"WiZ","6c:29:90":"WiZ","94:9f:3e":"Sonos","5c:aa:fd":"Sonos","00:0e:58":"Sonos","fc:65:de":"Amazon","74:c2:46":"Amazon","44:65:0d":"Amazon","0c:47:c9":"Amazon","b8:5f:98":"Amazon","f4:f5:d8":"Google","54:60:09":"Google","1c:f2:9a":"Google","d8:eb:46":"Google","18:b4:30":"Nest Labs","64:16:66":"Nest Labs","d0:52:a8":"SmartThings","24:fd:5b":"SmartThings","28:6d:97":"SAMJIN (SmartThings)","50:14:79":"iRobot","24:9e:7d":"Roborock","b0:4a:39":"Roborock","78:0f:77":"Broadlink","34:ea:34":"Broadlink","2c:aa:8e":"Wyze","44:61:32":"Ecobee","94:10:3e":"Belkin (Wemo)","5c:e7:53":"Govee","d4:13:68":"Govee","e0:2a:25":"Govee","80:8a:f7":"Nanoleaf","f8:24:41":"Yeelight","54:ef:44":"Aqara (Lumi)","18:c2:3c":"Aqara (Lumi)","b0:e9:fe":"SwitchBot","00:1c:2b":"Hive (Centrica)","ec:e5:12":"tado\xB0"};var zZ=new TextDecoder;var pw=Buffer.from("020000010000000000000000463cb5d3","hex"),MZ=new TextEncoder,HZ=new TextDecoder;var n3=new TextDecoder;var gw="239.255.255.250",Gg=1982,hw=["M-SEARCH * HTTP/1.1",`HOST: ${gw}:${Gg}`,'MAN: "ssdp:discover"',"ST: wifi_bulb","",""].join(`\r
|
|
258
|
+
`);var s3=new TextDecoder;var x3=new TextDecoder;var vw="239.255.255.250",yw=1900,uD=["M-SEARCH * HTTP/1.1",`HOST: ${vw}:${yw}`,'MAN: "ssdp:discover"',"MX: 3","ST: ssdp:all","",""].join(`\r
|
|
259
|
+
`),I3=new TextDecoder;var D3=new Uint8Array([0]);import{spawnSync as Wg}from"node:child_process";var qc=ev("cli");function bw(e){try{let t=Wg(e,{shell:!0,encoding:"utf8",timeout:5e3});return`${t.stdout??""}${t.stderr??""}`}catch{return""}}function xw(e=process.platform){return av({platform:e,programs:[process.execPath],ruleName:qc,runCheck:bw,runElevated:t=>{e!=="win32"&&Wg("sudo",["sh","-c",t],{stdio:"inherit"})}})}function kw(e=process.platform){return sv({platform:e,programs:[process.execPath],ruleName:qc,runCheck:bw,runElevated:t=>{e!=="win32"&&Wg("sudo",["sh","-c",t],{stdio:"inherit"})}})}function ww(e){let t=[],{home:r,credential:o}=e,n=r.source==="peer-wsl"||r.source==="peer-windows";if(r.source==="env")t.push({grade:"info",line:`hub state home: ${r.dir} (BRIDGE_SECRET_DIR override)`});else if(n){let a=r.source==="peer-wsl"?"on Windows":"inside WSL";t.push({grade:"ok",line:`hub state home: ${r.dir} \u2014 the hub runs ${a}, this environment reads its home across the boundary`})}else r.beacon?t.push({grade:"ok",line:`hub state home: ${r.dir} (hub live on port ${r.beacon.port})`}):t.push({grade:"info",line:`hub state home: ${r.dir} \u2014 no hub advertising itself here yet`});o==="rejected"?t.push({grade:"bad",line:"the hub REJECTED this machine's hub-token (401) \u2014 it is stale or belongs to another home. Profiles signals from every session here are being dropped. Restart the bridge (`acbridge stop` then `acbridge start`, or Stop \u2192 Start in the app) to re-mint it."}):o==="absent"&&r.beacon?t.push({grade:"warn",line:`a hub is running (port ${r.beacon.port}) but no readable hub-token was found in ${r.dir} \u2014 sessions here cannot authenticate to it`}):o==="ok"&&t.push({grade:"ok",line:"hub credential accepted (Profiles signals from this environment are authorized)"});let i=e.lastHookError;if(i&&e.nowMs-i.ts<=864e5&&o!=="ok"){let a=Math.max(0,Math.round((e.nowMs-i.ts)/6e4));t.push({grade:"warn",line:`a Profiles signal from this machine was refused ${a}m ago (HTTP ${i.status})${i.hint?` \u2014 ${i.hint}`:""}`})}return t}import{spawnSync as wD}from"node:child_process";function et(e={}){let t=e.env??process.env,r=e.clientVersion!==void 0?e.clientVersion:Ct(t),o=e.bundled??Li();return sa({isDevBuild:r===null&&!o,env:t})}function Sw(){return Qh({voice:et(),runElevated:e=>{e.method==="sudo"&&wD(e.file,e.args,{stdio:"inherit"})}})}function _D(e,t){let r=`codex: ${e??"not found"} \xB7 ${t?"logged in":"not logged in"}`;return{grade:e!==null&&t?"ok":"warn",line:r}}async function $D(){let e=await jc();e.wsl?U("WSL detected \u2014 LAN scan degraded (mDNS/broadcast limited)"):A("host is not WSL \u2014 LAN discovery unrestricted"),e.multicastOk===!0?e.wsl?U("multicast self-test passed locally, but under WSL that only exercises the loopback stack \u2014 LAN mDNS delivery is still limited (rely on the Windows neighbor table below)"):A("multicast self-test passed (this computer's stack \u2014 it does not prove your NETWORK forwards multicast)"):e.multicastOk===!1?U("multicast self-test failed \u2014 mDNS discovery unavailable"):U("multicast self-test could not run (inconclusive)"),e.wsl&&(e.interop==="windows-arp"?A("WSL interop scanning available (powershell.exe \u2014 Windows neighbor table)"):U("WSL interop unavailable (powershell.exe not on PATH) \u2014 ARP discovery sees only the WSL subnet"));let t=await G("/local/discovered");t.hubOffline?U("hub control API unreachable \u2014 scan/connect unavailable (start it: `acbridge daemon` or the app)"):t.status===200?A(`hub control API reachable (127.0.0.1:${ne().hubPort})`):U(`hub control API answered HTTP ${t.status} \u2014 token mismatch? restart the hub`);try{let r=a=>{let s=Kc(a,{shell:!0,encoding:"utf8",timeout:4e3});return`${s.stdout??""}${s.stderr??""}`};if(Yn(process.platform,{})==="wsl-host"){h(`firewall: ${zl}`);return}let o=ha(process.platform,r),n=Yn(process.platform,o),i=`${o.ufwStatusOut??""}${o.firewallCmdStateOut??""}${o.alfGlobalStateOut??""}`;if(n==="none")/permission denied|must be root|need to be root/i.test(i)?h("firewall state undetectable without sudo"):A("firewall: no active firewall detected \u2014 scanning unrestricted");else{let a=va(n,{programs:[process.execPath],ruleName:qc});if("state"in a?A("firewall: no active firewall detected \u2014 scanning unrestricted"):a.evalCheck(a.checkCommands.map(r))?A(`firewall: rule present (${n})`):U(`firewall rule missing \u2014 allow it with: ${a.manualCommand} (or use the app's Scan panel to cover the desktop app)`),n==="windows"){let s=ov(r("netsh advfirewall firewall show rule name=all dir=in verbose"),process.execPath),l=iv(rv(r("netsh advfirewall show currentprofile")),s);l&&U(l)}}Ol(Ho())==="keyring"?A("integration secrets: OS keyring (encrypted at rest, as this CLI resolves it)"):h("integration secrets: 0600 FILES, not the OS keyring (as this CLI resolves it) \u2014 no session keyring here, which is normal on WSL/headless Linux. The app or hub can resolve differently if it runs in a different session.")}catch{h("firewall state undetectable without sudo")}}async function ID(){let e=$r({fresh:!0}),t=M,r="unknown",o=e.beacon?.port??uy(),n=O(Rh(e.dir));if(!n)r="absent";else try{r=(await fetch(`http://127.0.0.1:${o}/local/devices`,{headers:{"x-bridge-hub-token":n},signal:AbortSignal.timeout(3e3)})).status===401?"rejected":"ok"}catch{r="unknown"}let i=null;try{let a=O(_w.join(t,"launch-last.json"));if(a)try{let l=JSON.parse(a);l.error?h(`last launch: REFUSED (${l.terminalId}, ${l.cwd}) \u2014 ${l.error}`):h(`last launch: ${l.terminalId} \u2192 ${l.file} ${JSON.stringify(l.args??[])}`)}catch{}let s=O(_w.join(t,"hooks-last-error.json"));if(s){let l=JSON.parse(s);typeof l.ts=="number"&&typeof l.status=="number"&&(i={ts:l.ts,status:l.status,...typeof l.hint=="string"?{hint:l.hint}:{}})}}catch{}return{home:e,localDir:t,credential:r,lastHookError:i,nowMs:Date.now()}}async function $w(e={}){let t=0,r=z=>{t++,b(z)},o=null,n=()=>o??=Yt(),i=(e.build??Bn)(),a=e.clientVersion?e.clientVersion():i.version,s=e.fetchManifest??Nc,l=v0(a,a===null?null:await s(),process.platform,i.channel??"app");l.grade==="ok"?A(l.line):l.grade==="warn"?U(l.line):l.grade==="bad"?r(l.line):h(l.line);let u=e.voice??et({clientVersion:a}),d=(e.claudeVersion??(()=>AD(n())))(),p=la(process.platform).manualCommand;if(d===null)r(`claude CLI not found on PATH \u2014 install it: ${p}`);else{let z=Pv(d);z.ok?A(`claude ${z.version}`):r(`claude ${z.version??"?"} \u2014 channels need \u2265 2.1.80 \u2014 reinstall: ${p}`)}let m=(e.codexVersion??ED)(),f=e.codexLoggedIn??fa,g=_D(m,f());g.grade==="ok"?A(g.line):U(g.line);let y=(e.nodeRuntime??(()=>Tr(Rr(M))))();y.kind==="shim"?A(`node runtime: bundled shim (${y.command})`):y.kind==="system"?A(`node v${y.version}`):r("node not found \u2014 install Node \u2265 20 or the AC Bridge app"),(e.pluginInstalled??(()=>PD(n())))()?A(u?"alexa@bridge plugin installed":"alexa@bridge plugin installed (agent state \u2192 device profiles)"):r("alexa@bridge plugin not installed \u2014 run `acbridge setup`");let _=Xn(),P=(e.managedSettingsRaw??(()=>O(_)))(),C=Tv(P);u?C.allowed?A("channel allowlisted in managed settings"):C.present?r(`channel not allowlisted in ${_} \u2014 run \`acbridge setup\``):r(`managed settings missing at ${_} \u2014 run \`acbridge setup\``):A("managed settings not used (voice off \u2014 no channel allowlist needed)"),(e.hubBundlePresent??(()=>SD(ti)))()?A("hub bundle present"):U("hub bundle not built \u2014 run `npm run build` (dev uses tsx)");let D=(e.signedIn??Pn)(),W=D.state==="ok"?D.token:"";D.state==="ok"?A("signed in (relay token present)"):D.state==="mismatch"?r(qe.pointerMismatch):U("not signed in \u2014 run `acbridge login`, sign in via the app, or `acbridge pair <code>`");let ce=(e.onboardingVerified??CD)();ce!==null?A(`account setup verified (${new Date(ce).toISOString().slice(0,10)})`):h("account setup not yet verified here \u2014 start/run check the relay on first use");let Y=(e.appInstalled??Dr)();if(Y?A(`desktop app found (${Y.path})`):h("desktop app not found on this machine \u2014 sign-in handoff unavailable (browser `acbridge login` works)"),W){let vt=await(e.fetchEntitlement??Ot)(W);vt?h(`plan ${vt.plan}; capture telemetry=${vt.capture.telemetry} transcripts=${vt.capture.transcripts}`):h("entitlement: couldn't read from the relay (offline?)");let tt=(e.entitlementFileAgeH??TD)();tt==="absent"?h("entitlement file absent \u2014 capture off until the hub next syncs"):tt==="unreadable"?U("entitlement file unreadable \u2014 capture off, fail-closed"):tt<=24?A(`entitlement file fresh (${tt.toFixed(1)}h)`):U(`entitlement file STALE (${tt.toFixed(1)}h) \u2014 capture off, fail-closed`)}await(e.hubRunning??Te)()?A("hub running"):h(u?"hub not running (starts automatically on `acbridge run`)":"hub not running (start it: `acbridge start`)");for(let z of ww(await(e.homeFacts??ID)()))z.grade==="ok"?A(z.line):z.grade==="warn"?U(z.line):z.grade==="bad"?r(z.line):h(z.line);let Ee=(e.claudeEnvironments??Ov)();for(let z of Ee)z.claudePresent&&(z.pluginInstalled?A(`Claude Code wired for Profiles \u2014 ${z.label}`):U(`Claude Code is installed in ${z.label} WITHOUT the bridge plugin \u2014 sessions there drive no devices. Fix: ${z.setupHint}`));return await(e.discoveryPreflight??$D)(),h(""),t?b(`${t} problem(s) found`):A("all checks passed"),t?1:0}function AD(e){let t=e??Yt(),r=Kc(t.file,[...t.argsPrefix,"--version"],{encoding:"utf8"});return r.status===0?r.stdout??"":null}function ED(){let e=Ar(),t=Kc(e.file,[...e.argsPrefix,"--version"],{encoding:"utf8",timeout:5e3});return t.status===0?(t.stdout||t.stderr||"").trim()||"unknown":null}function PD(e){let t=e??Yt(),r=Kc(t.file,[...t.argsPrefix,"plugin","list"],{encoding:"utf8"});return Cv(`${r.stdout??""}${r.stderr??""}`).ok}function CD(){let e=kt();return e?wa({configFile:e.userConfigFile}).onboardedAt:null}function TD(){let e=kt(),t=e?O(e.entitlementFile):null;if(!t)return"absent";try{let r=JSON.parse(t);return(Date.now()-(r.fetchedAt??0))/36e5}catch{return"unreadable"}}var RD=["tuya","meross","ewelink","govee"];function OD(e){let t=[],r=e.accounts("homeassistant");t.push({provider:"home-assistant",kind:"local",status:r.length>0?"linked":"not linked",...r.length>0?{detail:r.map(a=>String(a.baseUrl??a.accountId??"")).join(", ")}:{hint:"acbridge link home-assistant"}});let o=e.accounts("mqtt");t.push({provider:"mqtt",kind:"local",status:o.length>0?"linked":"not linked",...o.length>0?{detail:o.map(a=>`${String(a.host??a.accountId??"")}${a.port?`:${String(a.port)}`:""}`).join(", ")}:{hint:"acbridge link mqtt --host <broker>"}});let n=e.accounts("hue");t.push({provider:"hue",kind:"local",status:n.length>0?"linked":"not linked",...n.length>0?{detail:n.map(a=>String(a.host??a.bridgeId??"")).join(", ")}:{hint:"acbridge link hue"}});for(let a of RD){let s=e.hasKeystore(a);t.push({provider:a,kind:"keyed",status:s?"linked":"not linked",...s?{}:{hint:`acbridge link ${a}`}})}t.push({provider:"nanoleaf",kind:"device-paired",status:"pairs per device",hint:"acbridge connect <device> (hold the power button)"});let i=e.cloudAccounts===null?null:e.cloudAccounts.find(a=>a.provider==="smartthings");return t.push({provider:"smartthings",kind:"cloud",status:e.cloudAccounts===null?"unknown (sign in)":i?i.status??"linked":"not linked",...e.cloudAccounts!==null&&!i?{hint:"acbridge link smartthings"}:{}}),t}function DD(e){return e.map(t=>`${t.provider.padEnd(16)} ${t.status.padEnd(18)} ${t.detail??t.hint??""}`.trimEnd())}async function Iw(e=[]){let t=e.includes("--json");t&&ye(!0);let r=Pn(),o=r.state==="ok"?await vy(r.token):null,n=kt(),i=OD({accounts:a=>n?Ur(n,a):[],hasKeystore:a=>n?Ir(n,a,"keystore").read()!==null:!1,cloudAccounts:o});if(t)he(i);else for(let a of DD(i))h(a);return 0}import*as Aw from"node:https";import{createInterface as Ew}from"node:readline/promises";function Jg(){let e=$r({fresh:!0});if(e.source==="peer-wsl"||e.source==="peer-windows"){let o=e.source==="peer-wsl"?"on Windows":"inside WSL";return b(`the bridge is running ${o} (state in ${e.dir}), so an account linked here would be saved where that hub cannot read it. Run \`acbridge link\` from ${o}, or stop that bridge and start one on this side first.`),null}let t=kt();if(t)return t;let r=Mn();return r.ok?(b($e()?"This machine's signed-in account doesn't match its stored account pointer \u2014 run `acbridge logout` then `acbridge login` to reset it.":"Couldn't resolve this machine's signed-in account \u2014 run `acbridge login` again."),null):(b(r.message),null)}var ND=e=>`${e} on the command line is world-readable via \`ps\` and saved in shell history \u2014 prefer \`${e}-file <path>\`, the interactive prompt, or its env var.`;function vr(e){if(e.file!==void 0){let t=(e.read??O)(e.file);if(t===null)return{ok:!1,message:`Couldn't read ${e.flag}-file ${e.file} \u2014 check the path and its permissions.`};let r=t.trim();return r?{ok:!0,value:r}:{ok:!1,message:`${e.flag}-file ${e.file} is empty \u2014 write the secret into it first.`}}return e.argv!==void 0?((e.warn??U)(ND(e.flag)),{ok:!0,value:e.argv.trim()}):{ok:!0,value:(e.env??"").trim()}}function LD(e){let t={},r=(o,n,i,a)=>o===`--${Vg(n)}`?(t[n]=a[++i],i):(o.startsWith(`--${Vg(n)}=`)&&(t[n]=o.slice(`--${Vg(n)}=`.length)),i);for(let o=0;o<e.length;o++){let n=e[o];if(n)for(let i of["tokenFile","keyFile","secretFile","passwordFile","url","token","units","host","bridgeId","key","clientId","secret","region","email","password","mfa","username","prefix"])o=r(n,i,o,e)}return t}var Vg=e=>e==="bridgeId"?"bridge-id":e==="clientId"?"client-id":e.endsWith("File")?`${e.slice(0,-4)}-file`:e,UD=e=>/^(https?|wss?):\/\/[^\s]+$/i.test(e),Pw="Usage: acbridge link home-assistant --url http://homeassistant.local:8123 --token <long-lived-access-token> | --token-file <path> [--units metric|imperial]",Cw="Usage: acbridge link hue --host <bridge-ip> [--bridge-id <id>] [--key <existing-app-key> | --key-file <path>]",Tw="Usage: acbridge link smartthings (opens a browser sign-in via the relay; tokens seal at the relay)",Rw="Usage: acbridge link tuya [--client-id <id>] [--secret <access-secret> | --secret-file <path>] [--region eu|eu-w|us|us-e|cn|in] (eu-w/us-e = the Azure DCs)",Ow="Usage: acbridge link meross [--email <you@example.com>] [--password <pw> | --password-file <path>] [--region eu|us|ap] [--mfa <6-digit-2fa-code>]",Dw="Usage: acbridge link ewelink [--email <you@example.com>] [--password <pw> | --password-file <path>] [--region eu|us|as|cn]",Nw="Usage: acbridge link govee [--key <govee-api-key> | --key-file <path>] (Govee Home app \u2192 profile \u2192 Settings \u2192 Apply for API Key)",Lw="Usage: acbridge link mqtt --host <broker-host[:port]> [--username <u>] [--password <p> | --password-file <path>] [--prefix homeassistant]",zD="nanoleaf pairs per-device, not per-account: run `acbridge scan`, then `acbridge connect <device>` and hold the panel's power button.";async function Uw(e){let t=e[0],r=LD(e.slice(1));if(t==="smartthings")return MD();if(t==="tuya")return HD(r);if(t==="meross")return ZD(r);if(t==="ewelink")return GD(r);if(t==="govee")return WD(r);let o;if(t==="home-assistant"||t==="homeassistant")o=jD(r);else if(t==="hue")o=await BD(r);else if(t==="mqtt")o=FD(r);else return b(`unsupported provider: ${t??"(none)"}. Supported: home-assistant, hue, smartthings, tuya, meross, ewelink, govee, mqtt`),h(Pw),h(Cw),h(Tw),h(Rw),h(Ow),h(Dw),h(Nw),h(Lw),h(zD),2;if(!o)return 1;X("Bringing up the integration\u2026");try{let{spawned:n}=await it({kind:"cli"});n||await n0(),A(`Linked \u2014 your ${o.label} devices should now appear in the app and to Claude.`)}catch(n){h(`Recorded. Start the node when ready (\`acbridge daemon\`) to bring it up. (${n.message})`)}return 0}function jD(e){let t=Jg();if(!t)return null;let r=(e.url??"").trim().replace(/\/+$/,""),o=vr({flag:"--token",argv:e.token,file:e.tokenFile,env:process.env.BRIDGE_HA_TOKEN});if(!o.ok)return b(o.message),null;let n=o.value;if(!UD(r))return b("Missing/invalid --url. Give your Home Assistant base URL, e.g. http://homeassistant.local:8123"),h(Pw),null;if(!n)return b("Missing --token (or BRIDGE_HA_TOKEN). Create a Long-Lived Access Token in HA \u2192 your profile \u2192 Security."),null;let i=e.units==="imperial"||e.units==="metric"?e.units:void 0,a=Na("homeassistant",r);Ir(t,"homeassistant",a).write(n);let s=Ur(t,"homeassistant").filter(l=>l.accountId!==a);return Fa(t,"homeassistant",[...s,{accountId:a,baseUrl:r,...i?{unitSystem:i}:{}}]),A(`Linked Home Assistant (${r}). Token stored locally; account ${a}.`),{label:"Home Assistant"}}function FD(e){let t=Jg();if(!t)return null;let r=(e.host??e.url??"").trim(),{host:o,port:n,tls:i}=Mk(r);if(!o)return b("Missing --host. Give your broker's address, e.g. --host 192.168.1.5 (or mqtts://broker.lan:8883)."),h(Lw),null;let a=(e.username??"").trim(),s=vr({flag:"--password",argv:e.password,file:e.passwordFile,env:process.env.BRIDGE_MQTT_PASSWORD});if(!s.ok)return b(s.message),null;let l=s.value;if(l&&!a)return b("A password needs a --username too \u2014 MQTT forbids a password with no user, and brokers refuse the connection."),null;let u=(e.prefix??"").trim(),d=`${o}:${n??(i?8883:1883)}`,p=Na("mqtt",d);Ir(t,"mqtt",p).write(l);let m=Ur(t,"mqtt").filter(f=>f.accountId!==p);return Fa(t,"mqtt",[...m,{accountId:p,host:o,...n!==void 0?{port:n}:{},...i?{tls:i}:{},...a?{username:a}:{},...u?{discoveryPrefix:u}:{}}]),A(`Linked MQTT broker ${d}${a?` as ${a}`:" (anonymous)"}. Account ${p}.`),h(`Watching \`${u||"homeassistant"}/#\` for Home Assistant Discovery configs \u2014 Zigbee2MQTT, Tasmota and anything else that publishes them.`),{label:"MQTT"}}async function BD(e){let t=Jg();if(!t)return null;let r=(e.host??"").trim();if(!r)return b("Missing --host. Give your Hue Bridge IP, e.g. --host 192.168.1.42"),h(Cw),null;let o=(e.bridgeId??"").trim().toLowerCase(),n;if(!o){let d=await VD(r);o=d.bridgeId??r.toLowerCase(),n=d.name}let i=vr({flag:"--key",argv:e.key,file:e.keyFile,env:process.env.BRIDGE_HUE_KEY});if(!i.ok)return b(i.message),null;let a=i.value||void 0,s;if(a)s=JSON.stringify({appkey:a.trim()}),h("Using the provided app key (skipping link-button pairing).");else{X("Press the link button on top of your Hue Bridge now \u2014 pairing completes within 30s\u2026");try{let d=await JD(r);s=JSON.stringify({appkey:d.appkey,...d.clientkey?{clientkey:d.clientkey}:{}})}catch(d){return b(`Hue pairing failed: ${d.message}`),null}}let l=Na("hue",o);Ir(t,"hue",l).write(s);let u=Ur(t,"hue").filter(d=>d.accountId!==l);return Fa(t,"hue",[...u,{accountId:l,host:r,bridgeId:o,...n?{name:n}:{}}]),A(`Linked Philips Hue (${r}, bridge ${o}). Keys stored locally; account ${l}.`),{label:"Philips Hue"}}async function MD(){let e=Mn();if(!e.ok)return b(e.message),3;X("Starting SmartThings sign-in\u2026");let t=await by("smartthings");return!t.ok||!t.authorizeUrl?(b(t.error??"Couldn't start SmartThings linking."),h(Tw),1):(A("Open this URL in a browser, sign in to Samsung, and approve access:"),h(t.authorizeUrl),h("The account links at the relay; the hub picks it up automatically on its next connect (or restart the hub)."),0)}async function HD(e){let t=await ur();if(!t.ok)return b(t.message),3;h("Tuya key wizard \u2014 one-time setup to control Smart Life / Tuya devices locally:"),h(" 1. Create a free account + Cloud Project at iot.tuya.com (data-center region MUST match your Smart Life app \u2014 UK/EU \u2192 Central Europe)."),h(" 2. Subscribe IoT Core (+ Authorization) to the project, then 'Link Tuya App Account' by scanning the QR from the Smart Life app."),h(" 3. Copy the project's Access ID (client id) + Access Secret below."),h(" Note: the IoT Core trial runs ~1 month (console \u2192 Cloud \u2192 My Services \u2192 'Extend Trial Period'). After it expires your"),h(" already-connected lamps keep working locally \u2014 only fetching NEW keys stops. Re-pairing a device rotates its key \u2192 re-run this.");let r=(e.clientId??process.env.BRIDGE_TUYA_CLIENT_ID??await $o("Access ID (client id): ")).trim(),o=vr({flag:"--secret",argv:e.secret,file:e.secretFile,env:process.env.BRIDGE_TUYA_SECRET});if(!o.ok)return b(o.message),2;let n=(o.value||await Xc("Access Secret: ")).trim(),i=((e.region??process.env.BRIDGE_TUYA_REGION??await $o("Region [eu]: "))||"eu").trim().toLowerCase();if(!r||!n)return b("Both the Access ID and Access Secret are required."),h(Rw),1;if(!["eu","eu-w","us","us-e","cn","in"].includes(i))return b(`Unknown region "${i}" \u2014 use eu, eu-w, us, us-e, cn, or in.`),1;X("Making sure the hub is running\u2026");try{await it({kind:"cli"})}catch(s){return b(`The hub isn't running and couldn't be started: ${s.message}. Start it with \`acbridge daemon\` and retry.`),1}X("Fetching your device keys from Tuya (this can take a few seconds)\u2026");let a=await G("/local/tuya/link",{method:"POST",body:{clientId:r,clientSecret:n,region:i},timeoutMs:9e4});if(a.hubOffline)return b("The hub went offline. Start it with `acbridge daemon` and retry."),1;if(a.status===200&&a.body?.ok){let s=a.body.deviceCount??0,l=a.body.sleepyCount??0;return A(`Imported keys for ${s} Tuya device${s===1?"":"s"}. Keys are stored only on this PC (never on your network or the cloud).`),l>0&&h(`${l} battery/sensor device${l===1?"":"s"} (e.g. a PIR) won't control locally yet \u2014 those come in a later update.`),h('Now run `acbridge scan` \u2014 your lamps should appear under "Ready to connect". Connect each, then control by voice or in the app.'),0}return b(a.body?.error??`The hub couldn't complete the wizard (HTTP ${a.status??"?"}).`),1}async function ZD(e){let t=await ur();if(!t.ok)return b(t.message),3;h("Meross account wizard \u2014 a one-time sign-in so the hub can control your Meross devices locally:"),h(" Your Meross email + password are sent ONCE to Meross to fetch the account key that signs local"),h(" requests. The key is stored only on this PC \u2014 never on your network, the cloud, or our relay.");let r=vr({flag:"--password",argv:e.password,file:e.passwordFile,env:process.env.BRIDGE_MEROSS_PASSWORD});if(!r.ok)return b(r.message),2;let o=(e.email??process.env.BRIDGE_MEROSS_EMAIL??await $o("Meross email: ")).trim(),n=r.value||await Xc("Password: "),i=((e.region??process.env.BRIDGE_MEROSS_REGION??await $o("Region [eu]: "))||"eu").trim().toLowerCase();if(!o||!n)return b("Both the email and password are required."),h(Ow),1;if(!["eu","us","ap"].includes(i))return b(`Unknown region "${i}" \u2014 use eu, us, or ap.`),1;let a=(e.mfa??process.env.BRIDGE_MEROSS_MFA)?.trim()||void 0;X("Making sure the hub is running\u2026");try{await it({kind:"cli"})}catch(l){return b(`The hub isn't running and couldn't be started: ${l.message}. Start it with \`acbridge daemon\` and retry.`),1}X("Signing in to Meross\u2026");let s=await G("/local/meross/link",{method:"POST",body:{email:o,password:n,region:i,...a?{mfaCode:a}:{}},timeoutMs:6e4});if(s.hubOffline)return b("The hub went offline. Start it with `acbridge daemon` and retry."),1;if(s.status===200&&s.body?.ok){let l=s.body.deviceCount??0;return A(`Signed in. The account key is stored only on this PC.${l?` (${l} device${l===1?"":"s"} on the account.)`:""}`),h('Now run `acbridge scan` \u2014 your Meross plugs/bulbs should appear under "Ready to connect". Connect each, then control by voice or in the app.'),0}return b(s.body?.error??`The hub couldn't complete the sign-in (HTTP ${s.status??"?"}).`),1}async function GD(e){let t=await ur();if(!t.ok)return b(t.message),3;h("SONOFF / eWeLink account wizard \u2014 a one-time sign-in so the hub can control your SONOFF devices locally:"),h(" Your eWeLink email + password are sent ONCE to eWeLink to fetch each device's LAN key. The keys"),h(" are stored only on this PC \u2014 never on your network, the cloud, or our relay.");let r=vr({flag:"--password",argv:e.password,file:e.passwordFile,env:process.env.BRIDGE_EWELINK_PASSWORD});if(!r.ok)return b(r.message),2;let o=(e.email??process.env.BRIDGE_EWELINK_EMAIL??await $o("eWeLink email: ")).trim(),n=r.value||await Xc("Password: "),i=((e.region??process.env.BRIDGE_EWELINK_REGION??await $o("Region [eu]: "))||"eu").trim().toLowerCase();if(!o||!n)return b("Both the email and password are required."),h(Dw),1;if(!["eu","us","as","cn"].includes(i))return b(`Unknown region "${i}" \u2014 use eu, us, as, or cn.`),1;X("Making sure the hub is running\u2026");try{await it({kind:"cli"})}catch(s){return b(`The hub isn't running and couldn't be started: ${s.message}. Start it with \`acbridge daemon\` and retry.`),1}X("Signing in to eWeLink\u2026");let a=await G("/local/ewelink/link",{method:"POST",body:{email:o,password:n,region:i},timeoutMs:6e4});if(a.hubOffline)return b("The hub went offline. Start it with `acbridge daemon` and retry."),1;if(a.status===200&&a.body?.ok){let s=a.body.deviceCount??0;return A(`Signed in. ${s} device key${s===1?"":"s"} stored \u2014 only on this PC.`),h('Now run `acbridge scan` \u2014 your SONOFF switches/plugs should appear under "Ready to connect". Connect each, then control by voice or in the app.'),0}return b(a.body?.error??`The hub couldn't complete the sign-in (HTTP ${a.status??"?"}).`),1}async function WD(e){let t=await ur();if(!t.ok)return b(t.message),3;h("Govee key wizard \u2014 one self-service API key imports your Govee devices:"),h(" Govee Home app \u2192 profile \u2192 Settings \u2192 Apply for API Key (it arrives by email within minutes).");let r=vr({flag:"--key",argv:e.key,file:e.keyFile,env:process.env.BRIDGE_GOVEE_KEY});if(!r.ok)return b(r.message),2;let o=(r.value||await Xc("Govee API key: ")).trim();if(!o)return b("An API key is required."),h(Nw),2;X("Making sure the hub is running\u2026");try{await it({kind:"cli"})}catch(i){return b(`The hub isn't running and couldn't be started: ${i.message}. Start it with \`acbridge daemon\` and retry.`),1}X("Importing your Govee devices\u2026");let n=await G("/local/govee/link",{method:"POST",body:{apiKey:o},timeoutMs:6e4});if(n.hubOffline)return b("The hub went offline. Start it with `acbridge daemon` and retry."),1;if(n.status===200&&n.body?.ok){let i=n.body.deviceCount??0;return A(`Imported ${i} Govee device${i===1?"":"s"}. The key is stored only on this PC.`),h('Now run `acbridge scan` \u2014 your Govee lights should appear under "Ready to connect". Connect each, then control by voice or in the app.'),0}return b(n.body?.error??`The hub couldn't complete the wizard (HTTP ${n.status??"?"}).`),1}async function $o(e){let t=Ew({input:process.stdin,output:process.stdout});try{return await t.question(e)}finally{t.close()}}async function Xc(e){let t=process.stdout,r=Ew({input:process.stdin,output:t}),o=r,n=o._writeToOutput?.bind(r);o._writeToOutput=i=>{(i.includes(e)||i===`\r
|
|
260
260
|
`||i===`
|
|
261
261
|
`)&&n?.(i)};try{let i=await r.question(e);return t.write(`
|
|
262
|
-
`),i}finally{r.close()}}function
|
|
263
|
-
--if-needed skip the sign-in when this machine already holds a usable credential (default: always sign in)`,Tw=["google","github","microsoft","email","sso"];function WD(e){let t={provider:"email",app:!1,noBrowser:!1,timeoutMs:18e4,json:!1,ifNeeded:!1,chooser:!0};for(let r=0;r<e.length;r++){let o=e[r];if(o==="--app")t.app=!0;else if(o==="--if-needed")t.ifNeeded=!0;else if(o==="--no-browser")t.noBrowser=!0;else if(o==="--json")t.json=!0;else if(o==="--provider"){let n=e[++r];Tw.includes(n)?(t.provider=n,t.chooser=!1):t.bad=`invalid --provider: ${n??"(none)"} (use ${Tw.join(" | ")})`}else if(o==="--email")t.email=e[++r],t.chooser=!1;else if(o==="--timeout"){let n=Number(e[++r]);Number.isFinite(n)?t.timeoutMs=Math.min(600,Math.max(30,Math.round(n)))*1e3:t.bad=`invalid --timeout: ${e[r]??"(none)"}`}else t.bad=`unknown option: ${o??""}`}return t}function Vc(e={}){let t=e.readCredentialSub??Pc,r=e.writePointer??(n=>Yt({sub:n})),o=e.log??U;try{let n=t();n&&r(n)}catch(n){o(`couldn't update the active-user pointer (non-fatal): ${n instanceof Error?n.message:String(n)}`)}}function VD(e={}){(e.readActiveUser??(()=>$e()))()||(e.heal??Vc)()}function JD(e={}){let t=(e.scan??dt)();return(e.warnAmbiguous??(o=>nt(o)))(t),(e.resolveScope??(()=>pt()))()?{kind:"signed-in"}:(e.readPointer??(()=>$e()))()?{kind:"refuse",message:Je.pointerMismatch}:t.length===1&&Oa(t[0],e.segmentOf)?{kind:"heal",sub:t[0].sub}:{kind:"refuse",message:Je.logoutFirst("log in")}}function qD(e){return e.hasCredential?e.refreshed?{kind:"already"}:{kind:"stale-sign-in"}:{kind:"sign-in"}}async function Rw(e,t,r={}){let o=(r.readToken??(()=>O(he().accessFile)?.trim()??""))();if(o){let n=await(r.sync??vo)(e,o);await(r.claim??Cw)(e,o,{current:n})==="claimed"&&h("Account setup completed from this machine \u2014 `acbridge start` will run here now.")}return A(t.successLine),(r.report??(n=>Wc(n?["--json"]:[])))(t.json)}async function Ow(e=[]){let t=WD(e);if(t.bad)return b(t.bad),h(GD),2;t.json&&we(!0);let r=ne().relayUrl;if(t.ifNeeded&&Vo()){if(Kt()>=Xt){let n=JD();if(n.kind==="refuse")return b(n.message),3;n.kind==="heal"&&Yt({sub:n.sub})}else VD();if(qD({hasCredential:!0,refreshed:await Tt(r)}).kind==="already")return Rw(r,{json:t.json,successLine:"already signed in on this machine"});U("this machine's stored sign-in is no longer valid \u2014 signing in again")}if(t.app){let o=Tr();if(!o)return b("Couldn't find the AC Bridge app on this machine \u2014 run `acbridge login` (browser sign-in) or install the app."),1;if(Y(`opening the AC Bridge app (${o.path})\u2026`),!await Sa(o))return b("Couldn't launch the app."),1;if(h("Complete the sign-in in the AC Bridge app \u2014 I'll pick the credential up here."),!await _a({timeoutMs:t.timeoutMs}))return b("Timed out waiting for the app sign-in."),3}else{let o=Rv(),n=na();try{t.noBrowser||Y("opening your browser to sign in\u2026");let i=await Hv({cfg:o,opts:{provider:t.provider,...t.email?{email:t.email}:{}},chooser:t.chooser,timeoutMs:t.timeoutMs,openUrl:t.noBrowser?async()=>!1:s=>ka(s,{isWsl:n}),onBrowserFail:s=>{h(t.noBrowser?"Open this URL to sign in:":"Couldn't open a browser \u2014 open this URL to sign in:"),h(s)}});if(Y("pairing this machine\u2026"),!await Bv(r,()=>i.accessToken))return b("Signed in, but couldn't pair this machine with the relay \u2014 check your connection and retry."),1}catch(i){return b(Lv(i)),3}}return Vc(),Rw(r,{json:t.json,successLine:"Signed in. This machine now holds its own relay credential and refreshes itself."})}function KD(e){let t=e.reverted+e.failed+e.skipped;if(t===0)return"no devices needed reverting";let r=[`reverted ${e.reverted} of ${t} device${t===1?"":"s"}`];return e.failed&&r.push(`${e.failed} failed`),e.skipped&&r.push(`${e.skipped} skipped`),r.join(", ")}async function wo(e=[]){let t=e.includes("--json");t&&we(!0);let r,o=d=>{t&&xe({stopped:d,...r?{revert:r}:{}})},n=await Z("/local/session/stop",{method:"POST",body:{},timeoutMs:2e4});!n.hubOffline&&n.status===200&&n.body?.summary&&(r=n.body.summary,A(`lights: ${KD(r)}`));let i=await Jk(),a=O(Ve);if(i)return a&&ue(Ve),A("hub stopping \u2014 devices reverting, holders releasing"),o(!0),0;ny("stop-requested");let s=a?Number(a):0,l=s>0&&go({pid:s}),u=await Te();if(!l&&!u)return a&&ue(Ve),A("bridge already stopped"),o(!1),0;if(l)try{process.kill(s)}catch{}return a&&ue(Ve),Gk(),await Te()?(b("the hub is still running and didn't answer the shutdown \u2014 check ~/.claude-bridge/hub.log"),1):(A("hub stopped"),o(!0),0)}var XD="Usage: acbridge logout [--json]",YD=new Set(["--json"]);async function Dw(e=[],t={}){let r=e.filter(y=>!YD.has(y));if(r.length>0)return b(`unknown option: ${r[0]}`),h(XD),2;let o=e.includes("--json");o&&we(!0);let n=t.read??O,i=t.stopBridge??wo,a=t.revoke??((y,k,_)=>Mv(y,k,{clear:_})),s=t.clearTokens??jo,l=t.keyring??Fo(),u=y=>(t.clearDeviceCredentials??hl)(y,l),d=t.clearLogs??(()=>{Wl(xt),Wl(En)}),p=t.clearPointer??Wv,m=t.relayUrl??ne().relayUrl,f=[],g=(t.scan??dt)();g.length>=2&&(t.warnAmbiguous??(y=>nt(y)))(g);for(let{segment:y}of g){let k=yt(y),_=n(k.accessFile)?.trim()??n(k.refreshFile)?.trim()??null;f.push({segment:y,paths:k,bearer:_})}if(f.length===0)return A("already signed out"),o&&xe({signedOut:!0,alreadySignedOut:!0}),0;Y("stopping the bridge\u2026"),await i([]);for(let{segment:y,paths:k,bearer:_}of f)Y("revoking this machine's credential\u2026"),await a(m,_,()=>s(k)),u(y);return d(),p(),A("signed out \u2014 this machine no longer holds a credential."),o&&xe({signedOut:!0,alreadySignedOut:!1}),0}async function Nw(e,t={}){let r=e[0];if(!r)return b('Usage: acbridge pair <claim-code> (get a code from the app: "Add another machine")'),2;let n=(t.scan??oa)(),i=my(n,"pair");if(!i.ok)return i.ambiguous&&(t.warnAmbiguous??(a=>nt(a)))(n),b(i.message),3;try{h("Pairing this machine with your account\u2026");let a=await(t.claim??iy)(r),s=(t.store??zo)(a);return s?(t.writePointer??(l=>Yt({sub:l})))(s.sub):(t.healPointer??Vc)(),await(t.syncConfig??vo)(t.relayUrl??ne().relayUrl,a.access_token),A("Paired. This machine now holds its own relay credential and refreshes itself \u2014 no app needed."),h("Start the background node with: acbridge daemon"),0}catch(a){return b(a.message),1}}function Lw(e,t,r){let o=e!==null&&typeof e=="object"&&!Array.isArray(e)?e:{};return Object.entries(o).filter(n=>typeof n[1]=="string").map(([n,i])=>({repo:n,profile:r.get(i)??`${i} (missing)`,lane:t}))}function QD(e){let t=e??{},o=(Array.isArray(t.profiles)?t.profiles:[]).filter(a=>a!==null&&typeof a=="object").map(a=>({id:typeof a.id=="string"?a.id:"(unknown)",name:typeof a.name=="string"&&a.name.trim()?a.name:"(unnamed)",states:a.states!==null&&typeof a.states=="object"?Object.keys(a.states).length:0})),n=new Map(o.map(a=>[a.id,a.name])),i=[...Lw(t.bindings,"claude",n),...Lw(t.codexBindings,"codex",n)];return{profiles:o,bindings:i}}function eN(e){if(e.profiles.length===0)return["no profiles yet \u2014 create them in the AC Bridge app (Profiles page)"];let t=e.profiles.map(r=>`${r.name.padEnd(24)} ${r.states} state${r.states===1?"":"s"} (${r.id})`);if(e.bindings.length>0){t.push("","bindings (repo \u2192 profile):");for(let r of e.bindings)t.push(` ${r.repo} \u2192 ${r.profile} [${r.lane}]`)}return t}async function Uw(e=[]){let t=e.includes("--json");t&&we(!0);let r=Or({notSignedIn:{message:"Not signed in. Run `acbridge login`, or sign in via the AC Bridge app.",exitCode:3}});if(!r.ok)return b(r.message),r.exitCode;let o=await ly(r.token);if(o===null)return b("couldn't read the profiles document from the relay \u2014 check your connection"),1;let n=QD(o);if(t)xe(n);else for(let i of eN(n))h(i);return 0}async function zw(e=[]){let t=e[0],r=e.slice(1).join(" ").trim();if(!t||!r)return b("Usage: acbridge rename <device> <new name>"),2;let o=await cr();if(!o.ok)return b(o.message),3;let n=await Z("/local/devices",{method:"GET",timeoutMs:5e3});if(n.hubOffline||n.status!==200||!n.body)return b(De()),1;let i=pg(n.body.devices,t);if(!i.ok){if(i.kind==="ambiguous"){b(`"${t}" matches several devices:`);for(let l of i.candidates)h(` ${l.name} (${l.id})`)}else b(`no device matches "${t}" \u2014 try \`acbridge devices\``);return 2}let a={deviceId:i.device.id,name:r},s=await Z("/local/rename",{method:"POST",body:a,timeoutMs:8e3});return!s.hubOffline&&s.status===200&&s.body?.ok?(A(`renamed ${i.device.name} \u2192 ${r}`),0):(b(s.body?.error??`rename failed (HTTP ${s.status??"offline"})`),1)}import{spawn as tN}from"node:child_process";import{chmodSync as nN,openSync as rN,writeFileSync as oN}from"node:fs";var iN="Usage: acbridge start [--no-revert] [--attach] [--json]",jw=35;function aN(e){let t=e.daemonPidRaw?Number(e.daemonPidRaw):0;return t>0&&(e.identifiable||e.hubUp)?"already-running":t>0?"stale-pid":"proceed"}function sN(e,t){return e.daemonAlive?e.hubUp&&(t||e.session==="active"||e.session==="unavailable")?"ready":"waiting":"died"}async function Jc(e=[]){let t=e.includes("--json");t&&we(!0);let r=e.includes("--no-revert"),o=e.includes("--attach"),n=e.find(f=>!["--json","--no-revert","--attach"].includes(f));if(n!==void 0)return b(`unknown option: ${n}`),h(iN),2;let i=await ho();if(!i.ok)return b(i.message),i.exitCode;await Tt(ne().relayUrl);let a=O(Ve),s=a?Number(a):0,l=aN({daemonPidRaw:a,identifiable:s>0&&go({pid:s}),hubUp:await Te()});if(l==="already-running")return A(`bridge already running (daemon pid ${s})`),t&&xe({started:!1,alreadyRunning:!0}),0;l==="stale-pid"&&(ue(Ve),Y("removed a stale daemon.pid")),ue(Ko);let u=r?["--no-revert"]:[];if(o)return h("running the bridge keeper in the foreground (Ctrl-C to stop)\u2026"),Oc(u);let d=Wk(u);oN(En,"",{mode:384}),nN(En,384);let p=rN(En,"a"),m=tN(d.file,d.args,{cwd:en,detached:!0,stdio:["ignore",p,p],env:process.env});m.unref(),Y(`bridge keeper starting (pid ${m.pid??"?"})`);for(let f=0;f<jw;f++){await lN(1e3);let g={daemonAlive:m.pid?Ea(m.pid):!1,hubUp:await Te(),session:await cN()},y=sN(g,r);if(y==="ready"){let k=r?"revert-on-stop off":g.session==="active"?"revert-on-stop armed":"session probe unavailable (older hub)";return A(`bridge running \u2014 hub up, ${k}`),h("stop it with: acbridge stop"),t&&xe({started:!0,revertOnStop:!r,session:g.session}),0}if(y==="died"){b("the bridge keeper exited during startup");let k=O(En);return k&&h(Se(Fw(k,8))),1}}b(`timed out waiting for the bridge to come up (${jw}s)`);for(let f of[En,xt]){let g=O(f);g?.trim()&&h(Se(Fw(g,6)))}return 1}async function cN(){let e=await Z("/local/session",{method:"GET",timeoutMs:3e3});return e.hubOffline||e.status!==200||!e.body?"unavailable":e.body.active?"active":"inactive"}function Fw(e,t){return e.trimEnd().split(`
|
|
262
|
+
`),i}finally{r.close()}}function zw(e,t,r,o){return new Promise((n,i)=>{let a=o===void 0?void 0:JSON.stringify(o),s=Aw.request({host:e,port:443,method:t,path:r,rejectUnauthorized:!1,headers:{"content-type":"application/json"}},l=>{let u="";l.setEncoding("utf8"),l.on("data",d=>u+=d),l.on("end",()=>{try{n(u?JSON.parse(u):{})}catch(d){i(d instanceof Error?d:new Error(String(d)))}})});s.on("error",i),a&&s.write(a),s.end()})}async function VD(e){try{let t=await zw(e,"GET","/api/0/config");return{bridgeId:t.bridgeid?.toLowerCase(),name:t.name}}catch{return{}}}async function JD(e){let t=Date.now()+3e4;for(;;){let r=await zw(e,"POST","/api",{devicetype:"acbridge#cli",generateclientkey:!0}),o=Array.isArray(r)?r.find(i=>i.success)?.success:void 0;if(o)return{appkey:o.username,clientkey:o.clientkey};let n=Array.isArray(r)?r.find(i=>i.error)?.error:void 0;if(n&&n.type!==101)throw new Error(n.description??`Hue error ${n.type}`);if(Date.now()>t)throw new Error("timed out waiting for the link button (30s)");await new Promise(i=>setTimeout(i,1500))}}function qD(e){let t=e?.onboarding;return typeof t=="object"&&t!==null&&typeof t.completedAt=="number"}function KD(e){return{onboarding:{completedAt:e,completedBy:"cli"}}}async function jw(e,t,r={}){if(!t)return"skipped";let o=r.http??fetch,n=r.now??Date.now,i=e.replace(/\/+$/,""),a=2;try{let s=r.current??await Uc(e,t,o);for(let l=0;l<a;l+=1){if(qD(s.config))return"already";if(s.version===null)return"skipped";let u=await o(`${i}/settings`,{method:"PUT",headers:{authorization:`Bearer ${t}`,"content-type":"application/json"},body:JSON.stringify({version:s.version,config:{...s.config,...KD(n())}}),signal:AbortSignal.timeout(6e3)});if(u.ok)return"claimed";if(u.status!==409)return"skipped";l+1<a&&(s=await Uc(e,t,o))}return"skipped"}catch{return"skipped"}}function XD(e){try{let t=JSON.parse(Buffer.from(e.split(".")[1]??"","base64url").toString("utf8"));return{...typeof t.sub=="string"?{sub:t.sub}:{},...typeof t.nid=="string"?{nid:t.nid}:{},...typeof t.exp=="number"?{exp:t.exp}:{}}}catch{return null}}function YD(e){let t=[`account: ${e.claims.sub??"(unknown)"}`,...e.claims.nid?[`node: ${e.claims.nid}`]:[],`machine: ${e.machine}`,`relay: ${e.relayUrl}`,...e.plan?[`plan: ${e.plan}`]:[]],r={account:e.claims.sub??null,...e.claims.nid?{node:e.claims.nid}:{},machine:e.machine,relayUrl:e.relayUrl,...e.plan?{plan:e.plan}:{}};if(e.scope){let{pointerSub:o,resolvedSub:n}=e.scope,i=!!n&&o===n;t.push(`pointer: ${o??"(none)"}`),t.push(n?`resolved: ${n}${i?" (pointer and credential agree)":""}`:o?`resolved: MISMATCH \u2014 pointer and credential name different accounts (${qe.pointerMismatch})`:"resolved: not signed in"),r.pointer=o,r.resolved=n,r.agree=i}return{lines:t,json:r}}async function Yc(e=[]){let t=e.includes("--json");t&&ye(!0);let r=O(ve().accessFile)?.trim(),o=$e()?.sub??null,n=pt()?.sub??null;if(!r){let l=dt();return l.length>0&&o&&!n?(nt(l),Pe(qe.pointerMismatch,3)):Pe("Not signed in. Run `acbridge login`, or sign in via the AC Bridge app.",3)}let i=XD(r)??{},a=await Ot(r),s=YD({claims:i,machine:Oa(),relayUrl:ne().relayUrl,plan:a?.plan??null,scope:{pointerSub:o,resolvedSub:n}});if(t)he(s.json);else for(let l of s.lines)h(l);return 0}var QD=`Usage: acbridge login [--if-needed] [--provider google|github|microsoft|sso] [--email <you@example.com>] [--app] [--no-browser] [--timeout <s>] [--json]
|
|
263
|
+
--if-needed skip the sign-in when this machine already holds a usable credential (default: always sign in)`,Fw=["google","github","microsoft","email","sso"];function eN(e){let t={provider:"email",app:!1,noBrowser:!1,timeoutMs:18e4,json:!1,ifNeeded:!1,chooser:!0};for(let r=0;r<e.length;r++){let o=e[r];if(o==="--app")t.app=!0;else if(o==="--if-needed")t.ifNeeded=!0;else if(o==="--no-browser")t.noBrowser=!0;else if(o==="--json")t.json=!0;else if(o==="--provider"){let n=e[++r];Fw.includes(n)?(t.provider=n,t.chooser=!1):t.bad=`invalid --provider: ${n??"(none)"} (use ${Fw.join(" | ")})`}else if(o==="--email")t.email=e[++r],t.chooser=!1;else if(o==="--timeout"){let n=Number(e[++r]);Number.isFinite(n)?t.timeoutMs=Math.min(600,Math.max(30,Math.round(n)))*1e3:t.bad=`invalid --timeout: ${e[r]??"(none)"}`}else t.bad=`unknown option: ${o??""}`}return t}function Qc(e={}){let t=e.readCredentialSub??Dc,r=e.writePointer??(n=>Qt({sub:n})),o=e.log??U;try{let n=t();n&&r(n)}catch(n){o(`couldn't update the active-user pointer (non-fatal): ${n instanceof Error?n.message:String(n)}`)}}function tN(e={}){(e.readActiveUser??(()=>$e()))()||(e.heal??Qc)()}function nN(e={}){let t=(e.scan??dt)();return(e.warnAmbiguous??(o=>nt(o)))(t),(e.resolveScope??(()=>pt()))()?{kind:"signed-in"}:(e.readPointer??(()=>$e()))()?{kind:"refuse",message:qe.pointerMismatch}:t.length===1&&ja(t[0],e.segmentOf)?{kind:"heal",sub:t[0].sub}:{kind:"refuse",message:qe.logoutFirst("log in")}}function rN(e){return e.hasCredential?e.refreshed?{kind:"already"}:{kind:"stale-sign-in"}:{kind:"sign-in"}}async function Bw(e,t,r={}){let o=(r.readToken??(()=>O(ve().accessFile)?.trim()??""))();if(o){let n=await(r.sync??ko)(e,o);await(r.claim??jw)(e,o,{current:n})==="claimed"&&h("Account setup completed from this machine \u2014 `acbridge start` will run here now.")}return A(t.successLine),(r.report??(n=>Yc(n?["--json"]:[])))(t.json)}async function Mw(e=[]){let t=eN(e);if(t.bad)return b(t.bad),h(QD),2;t.json&&ye(!0);let r=ne().relayUrl;if(t.ifNeeded&&Xo()){if(Kt()>=Xt){let n=nN();if(n.kind==="refuse")return b(n.message),3;n.kind==="heal"&&Qt({sub:n.sub})}else tN();if(rN({hasCredential:!0,refreshed:await Tt(r)}).kind==="already")return Bw(r,{json:t.json,successLine:"already signed in on this machine"});U("this machine's stored sign-in is no longer valid \u2014 signing in again")}if(t.app){let o=Dr();if(!o)return b("Couldn't find the AC Bridge app on this machine \u2014 run `acbridge login` (browser sign-in) or install the app."),1;if(X(`opening the AC Bridge app (${o.path})\u2026`),!await Pa(o))return b("Couldn't launch the app."),1;if(h("Complete the sign-in in the AC Bridge app \u2014 I'll pick the credential up here."),!await Ca({timeoutMs:t.timeoutMs}))return b("Timed out waiting for the app sign-in."),3}else{let o=jv(),n=aa();try{t.noBrowser||X("opening your browser to sign in\u2026");let i=await Kv({cfg:o,opts:{provider:t.provider,...t.email?{email:t.email}:{}},chooser:t.chooser,timeoutMs:t.timeoutMs,openUrl:t.noBrowser?async()=>!1:s=>Aa(s,{isWsl:n}),onBrowserFail:s=>{h(t.noBrowser?"Open this URL to sign in:":"Couldn't open a browser \u2014 open this URL to sign in:"),h(s)}});if(X("pairing this machine\u2026"),!await qv(r,()=>i.accessToken))return b("Signed in, but couldn't pair this machine with the relay \u2014 check your connection and retry."),1}catch(i){return b(Hv(i)),3}}return Qc(),Bw(r,{json:t.json,successLine:"Signed in. This machine now holds its own relay credential and refreshes itself."})}function oN(e){let t=e.reverted+e.failed+e.skipped;if(t===0)return"no devices needed reverting";let r=[`reverted ${e.reverted} of ${t} device${t===1?"":"s"}`];return e.failed&&r.push(`${e.failed} failed`),e.skipped&&r.push(`${e.skipped} skipped`),r.join(", ")}async function Gn(e=[]){let t=e.includes("--json");t&&ye(!0);let r,o=d=>{t&&he({stopped:d,...r?{revert:r}:{}})},n=await G("/local/session/stop",{method:"POST",body:{},timeoutMs:2e4});!n.hubOffline&&n.status===200&&n.body?.summary&&(r=n.body.summary,A(`lights: ${oN(r)}`));let i=await t0(),a=O(Je);if(i)return a&&de(Je),A("hub stopping \u2014 devices reverting, holders releasing"),o(!0),0;ly("stop-requested");let s=a?Number(a):0,l=s>0&&yo({pid:s}),u=await Te();if(!l&&!u)return a&&de(Je),A("bridge already stopped"),o(!1),0;if(l)try{process.kill(s)}catch{}return a&&de(Je),Yk(),await Te()?(b("the hub is still running and didn't answer the shutdown \u2014 check ~/.claude-bridge/hub.log"),1):(A("hub stopped"),o(!0),0)}var iN="Usage: acbridge logout [--json]",aN=new Set(["--json"]);async function el(e=[],t={}){let r=e.filter(y=>!aN.has(y));if(r.length>0)return b(`unknown option: ${r[0]}`),h(iN),2;let o=e.includes("--json");o&&ye(!0);let n=t.read??O,i=t.stopBridge??Gn,a=t.revoke??((y,k,_)=>Jv(y,k,{clear:_})),s=t.clearTokens??Mo,l=t.keyring??Ho(),u=y=>(t.clearDeviceCredentials??_l)(y,l),d=t.clearLogs??(()=>{Xl(xt),Xl(En)}),p=t.clearPointer??Qv,m=t.relayUrl??ne().relayUrl,f=[],g=(t.scan??dt)();g.length>=2&&(t.warnAmbiguous??(y=>nt(y)))(g);for(let{segment:y}of g){let k=yt(y),_=n(k.accessFile)?.trim()??n(k.refreshFile)?.trim()??null;f.push({segment:y,paths:k,bearer:_})}if(f.length===0)return A("already signed out"),o&&he({signedOut:!0,alreadySignedOut:!0}),0;X("stopping the bridge\u2026"),await i([]);for(let{segment:y,paths:k,bearer:_}of f)X("revoking this machine's credential\u2026"),await a(m,_,()=>s(k)),u(y);return d(),p(),A("signed out \u2014 this machine no longer holds a credential."),o&&he({signedOut:!0,alreadySignedOut:!1}),0}async function Hw(e,t={}){let r=e[0];if(!r)return b('Usage: acbridge pair <claim-code> (get a code from the app: "Add another machine")'),2;let n=(t.scan??ca)(),i=xy(n,"pair");if(!i.ok)return i.ambiguous&&(t.warnAmbiguous??(a=>nt(a)))(n),b(i.message),3;try{h("Pairing this machine with your account\u2026");let a=await(t.claim??py)(r),s=(t.store??Bo)(a);return s?(t.writePointer??(l=>Qt({sub:l})))(s.sub):(t.healPointer??Qc)(),await(t.syncConfig??ko)(t.relayUrl??ne().relayUrl,a.access_token),A("Paired. This machine now holds its own relay credential and refreshes itself \u2014 no app needed."),h("Start the background node with: acbridge daemon"),0}catch(a){return b(a.message),1}}function Zw(e,t,r){let o=e!==null&&typeof e=="object"&&!Array.isArray(e)?e:{};return Object.entries(o).filter(n=>typeof n[1]=="string").map(([n,i])=>({repo:n,profile:r.get(i)??`${i} (missing)`,lane:t}))}function sN(e){let t=e??{},o=(Array.isArray(t.profiles)?t.profiles:[]).filter(a=>a!==null&&typeof a=="object").map(a=>({id:typeof a.id=="string"?a.id:"(unknown)",name:typeof a.name=="string"&&a.name.trim()?a.name:"(unnamed)",states:a.states!==null&&typeof a.states=="object"?Object.keys(a.states).length:0})),n=new Map(o.map(a=>[a.id,a.name])),i=[...Zw(t.bindings,"claude",n),...Zw(t.codexBindings,"codex",n)];return{profiles:o,bindings:i}}function cN(e){if(e.profiles.length===0)return["no profiles yet \u2014 create them in the AC Bridge app (Profiles page)"];let t=e.profiles.map(r=>`${r.name.padEnd(24)} ${r.states} state${r.states===1?"":"s"} (${r.id})`);if(e.bindings.length>0){t.push("","bindings (repo \u2192 profile):");for(let r of e.bindings)t.push(` ${r.repo} \u2192 ${r.profile} [${r.lane}]`)}return t}async function Gw(e=[]){let t=e.includes("--json");t&&ye(!0);let r=Lr({notSignedIn:{message:"Not signed in. Run `acbridge login`, or sign in via the AC Bridge app.",exitCode:3}});if(!r.ok)return b(r.message),r.exitCode;let o=await hy(r.token);if(o===null)return b("couldn't read the profiles document from the relay \u2014 check your connection"),1;let n=sN(o);if(t)he(n);else for(let i of cN(n))h(i);return 0}async function Ww(e=[]){let t=e[0],r=e.slice(1).join(" ").trim();if(!t||!r)return b("Usage: acbridge rename <device> <new name>"),2;let o=await ur();if(!o.ok)return b(o.message),3;let n=await G("/local/devices",{method:"GET",timeoutMs:5e3});if(n.hubOffline||n.status!==200||!n.body)return b(Ne()),1;let i=vg(n.body.devices,t);if(!i.ok){if(i.kind==="ambiguous"){b(`"${t}" matches several devices:`);for(let l of i.candidates)h(` ${l.name} (${l.id})`)}else b(`no device matches "${t}" \u2014 try \`acbridge devices\``);return 2}let a={deviceId:i.device.id,name:r},s=await G("/local/rename",{method:"POST",body:a,timeoutMs:8e3});return!s.hubOffline&&s.status===200&&s.body?.ok?(A(`renamed ${i.device.name} \u2192 ${r}`),0):(b(s.body?.error??`rename failed (HTTP ${s.status??"offline"})`),1)}import{spawn as lN}from"node:child_process";import{chmodSync as uN,openSync as dN,writeFileSync as pN}from"node:fs";var mN="Usage: acbridge start [--no-revert] [--attach] [--json]",Vw=35;function fN(e){let t=e.daemonPidRaw?Number(e.daemonPidRaw):0;return t>0&&(e.identifiable||e.hubUp)?"already-running":t>0?"stale-pid":"proceed"}function gN(e,t){return e.daemonAlive?e.hubUp&&(t||e.session==="active"||e.session==="unavailable")?"ready":"waiting":"died"}async function tl(e=[]){let t=e.includes("--json");t&&ye(!0);let r=e.includes("--no-revert"),o=e.includes("--attach"),n=e.find(f=>!["--json","--no-revert","--attach"].includes(f));if(n!==void 0)return b(`unknown option: ${n}`),h(mN),2;let i=await xo();if(!i.ok)return b(i.message),i.exitCode;await Tt(ne().relayUrl);let a=O(Je),s=a?Number(a):0,l=fN({daemonPidRaw:a,identifiable:s>0&&yo({pid:s}),hubUp:await Te()});if(l==="already-running")return A(`bridge already running (daemon pid ${s})`),t&&he({started:!1,alreadyRunning:!0}),0;l==="stale-pid"&&(de(Je),X("removed a stale daemon.pid")),de(ei);let u=r?["--no-revert"]:[];if(o)return h("running the bridge keeper in the foreground (Ctrl-C to stop)\u2026"),zc(u);let d=Qk(u);pN(En,"",{mode:384}),uN(En,384);let p=dN(En,"a"),m=lN(d.file,d.args,{cwd:tn,detached:!0,stdio:["ignore",p,p],env:process.env});m.unref(),X(`bridge keeper starting (pid ${m.pid??"?"})`);for(let f=0;f<Vw;f++){await vN(1e3);let g={daemonAlive:m.pid?Da(m.pid):!1,hubUp:await Te(),session:await hN()},y=gN(g,r);if(y==="ready"){let k=r?"revert-on-stop off":g.session==="active"?"revert-on-stop armed":"session probe unavailable (older hub)";return A(`bridge running \u2014 hub up, ${k}`),h("stop it with: acbridge stop"),t&&he({started:!0,revertOnStop:!r,session:g.session}),0}if(y==="died"){b("the bridge keeper exited during startup");let k=O(En);return k&&h(Se(Jw(k,8))),1}}b(`timed out waiting for the bridge to come up (${Vw}s)`);for(let f of[En,xt]){let g=O(f);g?.trim()&&h(Se(Jw(g,6)))}return 1}async function hN(){let e=await G("/local/session",{method:"GET",timeoutMs:3e3});return e.hubOffline||e.status!==200||!e.body?"unavailable":e.body.active?"active":"inactive"}function Jw(e,t){return e.trimEnd().split(`
|
|
264
264
|
`).slice(-t).join(`
|
|
265
|
-
`)}function lN(e){return new Promise(t=>setTimeout(t,e))}async function Mw(e=[],t={}){let r=await(t.stop??wo)([]);return r!==0?r:(t.start??Jc)(e)}import{spawnSync as __}from"node:child_process";import{randomUUID as yU}from"node:crypto";import{mkdirSync as bU,writeFileSync as xU}from"node:fs";import kU from"node:os";import ul from"node:path";import{createInterface as wU}from"node:readline";import{spawn as QL,spawnSync as eU}from"node:child_process";import{randomUUID as tU}from"node:crypto";import{readFileSync as nU}from"node:fs";import{request as rU}from"node:http";import{createInterface as oU}from"node:readline";import{readFileSync as UL}from"node:fs";var CL=qt(LS(),1),TL=qt(rl(),1),RL=qt($o(),1),OL=qt(eh(),1),DL=qt(rh(),1),NL=qt(lh(),1),Vi=qt(sl(),1),LL=qt(ZS(),1);var GS=100;function WS(e){let t=null,r=!1,o=1e3,n=null,i=[],a=()=>"endpoint"in e?e.endpoint():{port:e.port,tokenFile:e.tokenFile},s=p=>{try{return UL(p,"utf8").trim()}catch(m){return console.error(`[channel] cannot read hub token file ${p}:`,m),""}},l=p=>(i.push(p),i.length>GS&&(i.shift(),console.error(`[channel] outbound buffer at cap (${GS}); dropped oldest frame`)),!0),u=p=>{for(;i.length>0&&p.readyState===Vi.default.OPEN;){let m=i.shift();m&&p.send(JSON.stringify(m))}},d=()=>{if(r)return;let{port:p,tokenFile:m}=a(),f=s(m),g=new Vi.default(`ws://${e.host??"127.0.0.1"}:${p}`,{headers:{"x-bridge-hub-token":f}});t=g;let y=!0,k=null;g.on("open",()=>{o=1e3;let _=e.hello?.();_&&g.send(JSON.stringify(_)),u(g),y=!0,k=setInterval(()=>{if(!y){g.terminate();return}y=!1;try{g.ping()}catch{}},3e4)}),g.on("pong",()=>{y=!0}),g.on("message",_=>{try{e.onMessage(Sk(_.toString()))}catch(P){console.error("[channel] bad hub frame:",P)}}),g.on("error",_=>console.error("[channel] hub ws error:",_)),g.on("close",()=>{if(k&&(clearInterval(k),k=null),t===g&&(t=null),r)return;let _=o;o=Math.min(o*2,5e3),n=setTimeout(d,_)})};return d(),{send:p=>{if(r)return!1;let m=t;return m&&m.readyState===Vi.default.OPEN&&i.length===0?(m.send(JSON.stringify(p)),!0):l(p)},close:()=>{r=!0,n&&clearTimeout(n),t?.close()}}}var Q=e=>e;var VS=Q({id:"ActivateScene",target:"hub",customHandler:!0,scaffold:!0,carrier:"scene",utterances:["activate {scene} scene","activate scene {scene}","run scene {scene}","start {scene} scene"],slots:[{name:"scene",type:"SceneName",dynamic:!0,elicitationPrompts:["Which scene?"]}],customTypes:[{name:"SceneName",values:["movie night","good morning","bedtime","focus"]}],deviceCommands:[{capability:"scene",command:"activate"}],args:c.object({scene:c.string()}),result:c.object({ok:c.boolean()}),fromSlots:e=>({scene:e.scene??""}),ackSpeech:()=>"",speak:()=>""});var JS=Q({id:"Attach",target:"hub",skillLocal:!0,carrier:"attach",utterances:["attach to {target}","attach","switch to {target}","use {target}"],slots:[{name:"target",type:"SessionName",required:!0,dynamic:!0,elicitationPrompts:["Which session?","Which one would you like to attach to?"]}],customTypes:[{name:"SessionName",values:["one","two","three","four","five","six","seven","eight","nine","ten"]}],args:c.object({target:c.string()}),result:c.object({name:c.string()}),precheck:(e,t)=>t.sessionCount===0?"No sessions are running yet.":null,fromSlots:e=>({target:e.target??""}),ackSpeech:()=>"",speak:e=>`Entered ${e.name}.`});var qS=Q({id:"AttachBridge",target:"hub",skillLocal:!0,attachLevel:"bridge",carrier:"bridge",utterances:["attach to bridge {bridge}","switch to bridge {bridge}","open bridge {bridge}","go to bridge {bridge}"],slots:[{name:"bridge",type:"BridgeName",required:!0,dynamic:!0,elicitationPrompts:["Which bridge?","Which bridge would you like to attach to?"]}],customTypes:[{name:"BridgeName",values:["one","two","three","four","five","six","seven","eight","nine","ten"]}],args:c.object({target:c.string()}),result:c.object({name:c.string()}),precheck:(e,t)=>(t.bridgeCount??0)===0?"No bridges have a running session yet.":null,fromSlots:e=>({target:e.bridge??""}),ackSpeech:()=>"",speak:e=>`Entered ${e.name}.`});var KS=Q({id:"ControlDevice",target:"hub",customHandler:!0,scaffold:!0,carrier:"turn",utterances:["turn on {device}","turn off {device}","turn on the {device}","turn off the {device}","toggle {device}"],slots:[{name:"device",type:"DeviceName",dynamic:!0,elicitationPrompts:["Which device?"]}],customTypes:[{name:"DeviceName",values:["light","lamp","fan","plug","heater"]}],deviceCommands:[{capability:"power",command:"turnOn"},{capability:"power",command:"turnOff"},{capability:"power",command:"toggle"}],args:c.object({device:c.string()}),result:c.object({ok:c.boolean()}),fromSlots:e=>({device:e.device??""}),ackSpeech:()=>"",speak:()=>""});var XS=Q({id:"ControlGroup",target:"hub",customHandler:!0,scaffold:!0,carrier:"group",utterances:["turn on the {group} group","turn off the {group} group","turn off {group} group"],slots:[{name:"group",type:"GroupName",dynamic:!0,elicitationPrompts:["Which group or room?"]}],customTypes:[{name:"GroupName",values:["living room","bedroom","kitchen","office","studio"]}],deviceCommands:[{capability:"power",command:"turnOn"},{capability:"power",command:"turnOff"}],args:c.object({group:c.string()}),result:c.object({ok:c.boolean()}),fromSlots:e=>({group:e.group??""}),ackSpeech:()=>"",speak:()=>""});var YS=e=>`In the current working directory, ${e}. Keep the answer brief enough to be read aloud.`;var QS=Q({id:"GitStatus",target:"session",carrier:"git",utterances:["git status","what's the git status","any uncommitted changes in git"],slots:[],args:c.object({}),result:c.object({}),fromSlots:()=>({}),ackSpeech:()=>"Asking git status.",speak:()=>"",render:()=>YS("run git status and report the current branch and any uncommitted changes")});var zL=c.object({index:c.number().int().positive(),name:c.string(),id:c.string(),sessionCount:c.number().int().nonnegative()}),e_=Q({id:"ListBridges",target:"hub",carrier:"bridge",utterances:["list bridges","list my bridges","what bridges do I have","what bridges are running","which bridges are running"],slots:[],args:c.object({}),result:c.object({bridges:c.array(zL)}),speaksResult:!0,cacheSource:"bridges",providesBridgeCatalog:!0,fromSlots:()=>({}),ackSpeech:()=>"",speak:e=>{let t=e.bridges.length;if(t===0)return"No bridges have a running session.";let r=e.bridges.map(o=>`${o.index}, ${o.name}`).join("; ");return`${t} bridge${t===1?"":"s"}: ${r}.`}});var jL=c.object({name:c.string(),type:c.string(),room:c.string().nullable(),online:c.boolean()}),FL=c.object({provider:c.string(),status:c.string()}),t_=Q({id:"ListDevices",target:"hub",carrier:"device",utterances:["list devices","list my devices","what devices do I have","what devices are online"],slots:[],args:c.object({}),result:c.object({devices:c.array(jL),accounts:c.array(FL)}),speaksResult:!0,cacheSource:"devices",fromSlots:()=>({}),ackSpeech:()=>"",speak:e=>{let t=e.accounts.filter(i=>i.status!=="linked"),r=t.length?` ${t.map(i=>`${i.provider} needs re-linking`).join("; ")}.`:"",o=e.devices.length;if(o===0)return`No devices are connected.${r}`;let n=e.devices.filter(i=>i.online).length;return`${o} device${o===1?"":"s"}, ${n} online.${r}`}});var ML=c.object({index:c.number().int().positive(),name:c.string(),id:c.string()}),n_=Q({id:"ListSessions",target:"hub",carrier:"session",utterances:["list sessions","list my sessions","what sessions do I have","what sessions are running"],slots:[],args:c.object({}),result:c.object({sessions:c.array(ML)}),speaksResult:!0,cacheSource:"sessions",providesSessionCatalog:!0,fromSlots:()=>({}),ackSpeech:()=>"",speak:e=>{let t=e.sessions.length;if(t===0)return"No sessions are running.";let r=e.sessions.map(o=>`${o.index}, ${o.name}`).join("; ");return`${t} session${t===1?"":"s"}: ${r}.`}});var r_=Q({id:"ReadMore",target:"hub",carrier:"more",utterances:["read more","continue reading","keep reading"],slots:[],args:c.object({}),result:yc,speaksResult:!0,cacheSource:"output",fromSlots:()=>({}),ackSpeech:()=>"",speak:e=>e.latestReply?e.hasMore?`${e.latestReply} Say read more to continue.`:e.latestReply:"That's the end of the output."});var o_=Q({id:"ReadOutput",target:"hub",carrier:"output",utterances:["read output","read the output","what's the output","read reply","read the reply","what's the reply","read the last reply","read it","replies","read replies","dev replies","any replies","latest reply"],slots:[],args:c.object({}),result:yc,speaksResult:!0,cacheSource:"output",fromSlots:()=>({}),ackSpeech:()=>"",speak:e=>e.latestReply?e.hasMore?`${e.latestReply} Say read more to continue.`:e.latestReply:"No output yet."});var BL=c.object({index:c.number().int().positive(),name:c.string(),id:c.string(),sessionCount:c.number().int().nonnegative()}),i_=Q({id:"RenameBridge",target:"hub",relayMutation:!0,customHandler:!0,carrier:"bridge",utterances:["rename bridge {bridge}","rename a bridge","rename this bridge","rename the bridge","rename this bridge to {name}","rename the bridge to {name}","call the bridge {name}"],slots:[{name:"bridge",type:"BridgeName",dynamic:!0},{name:"name",type:"AMAZON.SearchQuery",allowFreeText:!0}],args:c.object({name:c.string(),bridgeId:c.string().optional()}),result:c.object({bridges:c.array(BL)}),providesBridgeCatalog:!0,precheck:e=>e.name.trim()?null:"What would you like to call it?",fromSlots:e=>({name:(e.name??"").trim()}),ackSpeech:e=>`Okay, I'll call it ${e.name}.`,speak:()=>""});var HL=c.object({index:c.number().int().positive(),name:c.string(),id:c.string()}),a_=Q({id:"RenameSession",target:"hub",relayMutation:!0,customHandler:!0,carrier:"rename",utterances:["rename","rename a session","rename this session","rename the session","rename it","rename {target}","rename session {target}","rename to {name}","rename this session to {name}","call it {name}"],slots:[{name:"target",type:"SessionName",dynamic:!0},{name:"name",type:"AMAZON.SearchQuery",allowFreeText:!0}],args:c.object({name:c.string()}),result:c.object({sessions:c.array(HL)}),providesSessionCatalog:!0,precheck:e=>e.name.trim()?null:"What would you like to call it?",fromSlots:e=>({name:(e.name??"").trim()}),ackSpeech:e=>`Okay, I'll call it ${e.name}.`,speak:()=>""});var s_=Q({id:"Return",target:"hub",skillLocal:!0,clearsAttach:!0,carrier:"return",utterances:["return","go back","back to the main menu","main menu","leave the session","leave this session"],slots:[],args:c.object({}),result:c.object({}),fromSlots:()=>({}),ackSpeech:()=>"",speak:()=>"Back at the main menu."});var c_=Q({id:"SetBrightness",target:"hub",customHandler:!0,scaffold:!0,carrier:"brightness",utterances:["set brightness of {device} to {level}","set {device} brightness to {level}","dim {device} to {level}"],slots:[{name:"device",type:"DeviceName",dynamic:!0,elicitationPrompts:["Which device?"]},{name:"level",type:"AMAZON.NUMBER",elicitationPrompts:["What level, 0 to 100?"]}],customTypes:[{name:"DeviceName",values:["light","lamp","fan","plug","heater"]}],deviceCommands:[{capability:"brightness",command:"setBrightness"}],args:c.object({device:c.string(),level:c.number()}),result:c.object({ok:c.boolean()}),fromSlots:e=>({device:e.device??"",level:Number(e.level??0)}),ackSpeech:()=>"",speak:()=>""});var l_=Q({id:"SetTemperature",target:"hub",customHandler:!0,scaffold:!0,carrier:"temperature",utterances:["set temperature of {device} to {temperature}","set {device} temperature to {temperature}","set {device} to {temperature} degrees"],slots:[{name:"device",type:"DeviceName",dynamic:!0,elicitationPrompts:["Which thermostat?"]},{name:"temperature",type:"AMAZON.NUMBER",elicitationPrompts:["What temperature?"]}],customTypes:[{name:"DeviceName",values:["light","lamp","fan","plug","heater"]}],deviceCommands:[{capability:"thermostat",command:"setSetpoint"}],args:c.object({device:c.string(),temperature:c.number()}),result:c.object({ok:c.boolean()}),fromSlots:e=>({device:e.device??"",temperature:Number(e.temperature??0)}),ackSpeech:()=>"",speak:()=>""});var u_=[VS,JS,qS,KS,XS,QS,e_,t_,n_,r_,o_,i_,a_,s_,c_,l_],d_=new Map(u_.map(e=>[e.id,e])),FV=new Map(u_.map(e=>[`${e.id}Intent`,e]));function p_(e){if(e.type==="prompt")return e.text;let t=d_.get(e.id);if(!t?.render)throw new Error(`channel got command "${e.id}" with no render() \u2014 not a session-target command`);return t.render(t.args.parse(e.args))}var ZL=new Set(["item/commandExecution/requestApproval","item/fileChange/requestApproval","item/permissions/requestApproval"]);function m_(e){return{decision:e}}var GL="Added to the current turn.",f_="late verdict dropped",WL="approve? [y/n/a]",dh="Codex restarted before this prompt ran \u2014 please resend.",VL=16e3;function _e(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:{}}function g_(e){let t=e.replace(/\\/g,"/").replace(/\/+$/,""),r=t.lastIndexOf("/");return(r>=0?t.slice(r+1):t)||e}function h_(e){return(Array.isArray(e)?e.map(String).join(" "):typeof e=="string"?e:"").replace(/\s+/g," ").trim()}function JL(e){return e.replace(/^```.*\n?/gm,"").replace(/\[([^\]]*)\]\([^)]*\)/g,"$1")}function qL(e,t){return e.length>t?e.slice(0,t):e}function KL(e){let t=_e(e),r=t.codexErrorInfo,o=typeof r=="string"?r:r&&typeof r=="object"?String(_e(r).kind??_e(r).code??""):"",n=typeof t.message=="string"?t.message:"",i=`${o} ${n}`;return/usagelimitexceeded/i.test(i)?"rateLimited":/contextwindowexceeded/i.test(i)?"contextCritical":"error"}function XL(e,t,r,o,n){let i=_e(t);switch(e){case"item/commandExecution/requestApproval":{let a=h_(i.command),s=typeof i.cwd=="string"&&i.cwd?i.cwd:n,{command:l,cwd:u,...d}=i;return{type:"permission_request",sessionId:r,requestId:o,tool:"Shell",description:`\`${a}\` in ${g_(s)}`,preview:JSON.stringify({command:a,cwd:s,...d})}}case"item/fileChange/requestApproval":{let s=(Array.isArray(i.files)?i.files:[]).map(d=>typeof d=="string"?d:_e(d).path).filter(d=>typeof d=="string"&&d.length>0),l=s.slice(0,3).map(g_).join(", "),u=s.length>3?", \u2026":"";return{type:"permission_request",sessionId:r,requestId:o,tool:"File change",description:`edit ${s.length} file(s): ${l}${u}`,preview:JSON.stringify(i)}}case"item/permissions/requestApproval":{let a=typeof i.mode=="string"?i.mode:typeof i.requestedMode=="string"?i.requestedMode:"unknown";return{type:"permission_request",sessionId:r,requestId:o,tool:"Permissions",description:`escalate sandbox to ${a}`,preview:JSON.stringify(i)}}default:return{type:"permission_request",sessionId:r,requestId:o,tool:"Approval",description:"approve this action?",preview:JSON.stringify(i)}}}var ll=class{sessionId;cwd;steerSupported;newSeq;turnInFlight=!1;owner=null;queue=[];pendingApprovals=new Map;lastApprovalRequestId=null;planReadyFired=!1;pendingSteerAcks=new Set;constructor(t){this.sessionId=t.sessionId,this.cwd=t.cwd,this.steerSupported=t.steerSupported,this.newSeq=t.newSeq}setSteerSupported(t){this.steerSupported=t}handle(t){switch(t.kind){case"hub":return this.onHub(t.msg);case"notification":return this.onNotification(t.method,t.params);case"server-request":return this.onServerRequest(t.id,t.method,t.params);case"local-line":return this.onLocalInput(t.text);case"local-approval":return this.onLocalApproval(t.behavior);case"steer-ok":return this.onSteerOk(t.requestId);case"sigint":return this.turnInFlight?[{kind:"rpc",method:"turn/interrupt"}]:this.endSession();case"teardown":return this.endSession();case"server-exit":return this.onServerExit();default:return[]}}onHub(t){switch(t.type){case"prompt":return this.onHubInput(t.requestId,t.text);case"command":return this.onHubInput(t.requestId,p_(t));case"permission_verdict":return this.onHubVerdict(t.requestId,t.behavior);default:return[]}}onHubInput(t,r){return this.turnInFlight?this.steerSupported?(this.pendingSteerAcks.add(t),[{kind:"rpc",method:"turn/steer",params:{text:r}}]):(this.queue.push({source:"hub",requestId:t,text:r}),[]):this.startTurn({kind:"hub",requestId:t},r)}onLocalInput(t){return this.turnInFlight?this.steerSupported?[{kind:"rpc",method:"turn/steer",params:{text:t}}]:(this.queue.push({source:"local",text:t}),[]):this.startTurn({kind:"local"},t)}startTurn(t,r){this.turnInFlight=!0,this.owner=t;let o=[{kind:"rpc",method:"turn/start",params:{text:r}}];return t.kind==="hub"&&o.push({kind:"render",channel:"voice",text:`[alexa] ${r}`}),o}onSteerOk(t){return this.pendingSteerAcks.has(t)?(this.pendingSteerAcks.delete(t),[this.replyAction(t,GL)]):[]}replyAction(t,r){return{kind:"hub-send",msg:{type:"reply",sessionId:this.sessionId,requestId:t,seq:this.newSeq(),text:r,final:!0}}}statePost(t,r){return{kind:"state-post",state:t,event:`codex-adapter:${r}`}}onNotification(t,r){switch(t){case"turn/started":return this.planReadyFired=!1,[this.statePost("working","turn-started")];case"turn/completed":return this.onTurnCompleted(r);case"item/agentMessage/delta":return this.onAgentDelta(r);case"item/started":return this.onItemStarted(r);case"item/completed":return this.onItemCompleted(r);case"item/commandExecution/outputDelta":return this.onOutputDelta(r);case"turn/plan/updated":return this.onPlanUpdated(r);case"thread/tokenUsage/updated":return this.onTokenUsage(r);default:return[]}}onTurnCompleted(t){let r=_e(t),o=_e(r.turn),n=typeof o.status=="string"?o.status:typeof r.status=="string"?r.status:"",i=o.error??r.error,a=[];if(n==="completed")a.push(this.statePost("finished","turn-completed"));else if(n==="failed"){if(this.owner?.kind==="hub"){let s=_e(i),l=typeof s.message=="string"?s.message:"unknown error";a.push(this.replyAction(this.owner.requestId,`Codex hit an error: ${l}`))}a.push(this.statePost(KL(i),"turn-failed"))}else n==="interrupted"&&a.push(this.statePost("idle","turn-interrupted"));return a.push(...this.finishTurnAndDrain()),a}finishTurnAndDrain(){this.turnInFlight=!1,this.owner=null;let t=this.queue.shift();return t?t.source==="hub"?this.startTurn({kind:"hub",requestId:t.requestId},t.text):this.startTurn({kind:"local"},t.text):[]}onAgentDelta(t){let r=_e(t).delta;return typeof r=="string"&&r?[{kind:"render",channel:"agent",text:r}]:[]}onItemStarted(t){let r=_e(_e(t).item);return r.type==="commandExecution"?[{kind:"render",channel:"tool",text:`$ ${h_(r.command)}`}]:[]}onItemCompleted(t){let r=_e(_e(t).item);if(r.type==="agentMessage"){if(this.owner?.kind!=="hub")return[];let o=qL(JL(typeof r.text=="string"?r.text:""),VL);return[this.replyAction(this.owner.requestId,o)]}if(r.type==="commandExecution"){let o=r.exitCode;return[{kind:"render",channel:"tool",text:typeof o=="number"?`(exit ${o})`:"(done)"}]}return[]}onOutputDelta(t){let r=_e(t).delta;return typeof r=="string"&&r?[{kind:"render",channel:"tool",text:r}]:[]}onPlanUpdated(t){let r=_e(t).plan;if(!Array.isArray(r))return[];let o=r.map(n=>({kind:"render",channel:"meta",text:`- ${String(n)}`}));return this.planReadyFired||(this.planReadyFired=!0,o.push(this.statePost("planReady","plan-updated"))),o}onTokenUsage(t){let r=_e(t),o=_e(r.tokenUsage),n=_e(o.total),i=_e(o.last),a=m=>typeof m=="number"&&Number.isFinite(m)?m:void 0,s=[],l=a(n.inputTokens),u=a(n.outputTokens);l!==void 0&&u!==void 0&&s.push({kind:"usage-post",inputTokens:l,cachedInputTokens:a(n.cachedInputTokens)??0,outputTokens:u});let d=a(i.totalTokens),p=a(o.modelContextWindow);if(d!==void 0&&p!==void 0&&p>0){let m=Math.round(d/p*1e3)/10;s.push({kind:"context-post",pct:m,usedTokens:d,windowTokens:p})}return s}onServerRequest(t,r,o){if(!ZL.has(r))return[];let n=`codex-approval-${this.newSeq()}`,i=XL(r,o,this.sessionId,n,this.cwd);this.pendingApprovals.set(n,{serverRequestId:t}),this.lastApprovalRequestId=n;let a=r==="item/permissions/requestApproval"?"sandboxEscalation":"needs_permission";return[{kind:"hub-send",msg:i},this.statePost(a,"approval-requested"),{kind:"render",channel:"meta",text:WL}]}onHubVerdict(t,r){let o=r==="allow"?"accept":"decline",n={kind:"render",channel:"voice",text:r==="allow"?"[alexa] approved":"[alexa] denied"};return this.resolveApproval(t,o,n)}onLocalApproval(t){let r=this.lastApprovalRequestId;if(!r)return[{kind:"render",channel:"meta",text:f_}];let o=t==="allow"?"accept":t==="allow-session"?"acceptForSession":"decline",n=t==="allow"?"approved":t==="allow-session"?"approved for session":"denied";return this.resolveApproval(r,o,{kind:"render",channel:"meta",text:n})}resolveApproval(t,r,o){let n=this.pendingApprovals.get(t);if(!n)return[{kind:"render",channel:"meta",text:f_}];this.pendingApprovals.delete(t),this.lastApprovalRequestId===t&&(this.lastApprovalRequestId=null);let i=r==="decline";return[{kind:"rpc-respond",id:n.serverRequestId,result:m_(r)},this.statePost(i?"permissionDenied":"working",i?"approval-denied":"approval-allowed"),o]}endSession(){let t=[...this.pendingApprovals.values()].map(r=>({kind:"rpc-respond",id:r.serverRequestId,result:m_("decline")}));return this.pendingApprovals.clear(),this.lastApprovalRequestId=null,this.pendingSteerAcks.clear(),[this.statePost("ended","teardown"),...t,{kind:"exit"}]}onServerExit(){let t=[];this.turnInFlight&&t.push(this.statePost("error","server-exit"));for(let r of this.queue)r.source==="hub"&&t.push(this.replyAction(r.requestId,dh));return this.queue=[],this.turnInFlight=!1,this.owner=null,this.pendingApprovals.clear(),this.lastApprovalRequestId=null,this.pendingSteerAcks.clear(),t}};import YL from"node:path";function v_(e,t){let r=YL.basename(e)||"session";return{id:`${r}@${t}+codex`,name:`${r} codex (${t})`}}function y_(e){let{sub:t,...r}=e;return{...r,voice:!0,agent:"codex",...t?{sub:t}:{}}}var Ji=class extends Error{code;constructor(t,r){super(`codex app-server error ${t}: ${r}`),this.name="AppServerError",this.code=t}};function ph(e,t){let r=1,o=!1,n="",i=new Map,a=[],s=[],l=[];function u(_){o||e.write(`${JSON.stringify(_)}
|
|
266
|
-
`)}function d(_){let P=_.trim();if(!P)return;let C;try{C=JSON.parse(P)}catch{return}if(!C||typeof C!="object"||Array.isArray(C))return;let E=C,D=E.id,
|
|
267
|
-
`))>=0;){let C=n.slice(0,P);n=n.slice(P+1),d(C)}}function m(){t.removeListener("data",p),t.removeListener("end",y),t.removeListener("error",k),e.removeListener("error",k)}function f(_){m();let P=_??new Error("codex app-server stream closed");for(let C of i.values())C.reject(P);i.clear()}function g(_){if(!o){o=!0,f(_);for(let P of l)P(_)}}function y(){g()}function k(_){g(_)}return t.setEncoding("utf8"),t.on("data",p),t.on("end",y),t.on("error",k),e.on("error",k),{request(_,P){if(o)return Promise.reject(new Error("codex app-server client is closed"));let C=r++;return new Promise((E,D)=>{i.set(C,{resolve:E,reject:D}),u({id:C,method:_,params:P})})},notify(_,P){u({method:_,params:P})},respond(_,P){u({id:_,result:P})},onNotification(_){a.push(_)},onServerRequest(_){s.push(_)},onClose(_){l.push(_)},close(){o||(o=!0,f())}}}function
|
|
268
|
-
`);return}if(t==="tool"){this.out.write(
|
|
265
|
+
`)}function vN(e){return new Promise(t=>setTimeout(t,e))}async function qw(e=[],t={}){let r=await(t.stop??Gn)([]);return r!==0?r:(t.start??tl)(e)}import{spawnSync as R_}from"node:child_process";import{randomUUID as IU}from"node:crypto";import{mkdirSync as AU,writeFileSync as EU}from"node:fs";import PU from"node:os";import vl from"node:path";import{createInterface as CU}from"node:readline";import{spawn as sU,spawnSync as cU}from"node:child_process";import{randomUUID as lU}from"node:crypto";import{readFileSync as uU}from"node:fs";import{request as dU}from"node:http";import{createInterface as pU}from"node:readline";import{readFileSync as GL}from"node:fs";var zL=qt(ZS(),1),jL=qt(ul(),1),FL=qt(Eo(),1),BL=qt(ih(),1),ML=qt(ch(),1),HL=qt(fh(),1),Xi=qt(fl(),1),ZL=qt(YS(),1);var QS=100;function e_(e){let t=null,r=!1,o=1e3,n=null,i=[],a=()=>"endpoint"in e?e.endpoint():{port:e.port,tokenFile:e.tokenFile},s=p=>{try{return GL(p,"utf8").trim()}catch(m){return console.error(`[channel] cannot read hub token file ${p}:`,m),""}},l=p=>(i.push(p),i.length>QS&&(i.shift(),console.error(`[channel] outbound buffer at cap (${QS}); dropped oldest frame`)),!0),u=p=>{for(;i.length>0&&p.readyState===Xi.default.OPEN;){let m=i.shift();m&&p.send(JSON.stringify(m))}},d=()=>{if(r)return;let{port:p,tokenFile:m}=a(),f=s(m),g=new Xi.default(`ws://${e.host??"127.0.0.1"}:${p}`,{headers:{"x-bridge-hub-token":f}});t=g;let y=!0,k=null;g.on("open",()=>{o=1e3;let _=e.hello?.();_&&g.send(JSON.stringify(_)),u(g),y=!0,k=setInterval(()=>{if(!y){g.terminate();return}y=!1;try{g.ping()}catch{}},3e4)}),g.on("pong",()=>{y=!0}),g.on("message",_=>{try{e.onMessage(Ck(_.toString()))}catch(P){console.error("[channel] bad hub frame:",P)}}),g.on("error",_=>console.error("[channel] hub ws error:",_)),g.on("close",()=>{if(k&&(clearInterval(k),k=null),t===g&&(t=null),r)return;let _=o;o=Math.min(o*2,5e3),n=setTimeout(d,_)})};return d(),{send:p=>{if(r)return!1;let m=t;return m&&m.readyState===Xi.default.OPEN&&i.length===0?(m.send(JSON.stringify(p)),!0):l(p)},close:()=>{r=!0,n&&clearTimeout(n),t?.close()}}}var Q=e=>e;var t_=Q({id:"ActivateScene",target:"hub",customHandler:!0,scaffold:!0,carrier:"scene",utterances:["activate {scene} scene","activate scene {scene}","run scene {scene}","start {scene} scene"],slots:[{name:"scene",type:"SceneName",dynamic:!0,elicitationPrompts:["Which scene?"]}],customTypes:[{name:"SceneName",values:["movie night","good morning","bedtime","focus"]}],deviceCommands:[{capability:"scene",command:"activate"}],args:c.object({scene:c.string()}),result:c.object({ok:c.boolean()}),fromSlots:e=>({scene:e.scene??""}),ackSpeech:()=>"",speak:()=>""});var n_=Q({id:"Attach",target:"hub",skillLocal:!0,carrier:"attach",utterances:["attach to {target}","attach","switch to {target}","use {target}"],slots:[{name:"target",type:"SessionName",required:!0,dynamic:!0,elicitationPrompts:["Which session?","Which one would you like to attach to?"]}],customTypes:[{name:"SessionName",values:["one","two","three","four","five","six","seven","eight","nine","ten"]}],args:c.object({target:c.string()}),result:c.object({name:c.string()}),precheck:(e,t)=>t.sessionCount===0?"No sessions are running yet.":null,fromSlots:e=>({target:e.target??""}),ackSpeech:()=>"",speak:e=>`Entered ${e.name}.`});var r_=Q({id:"AttachBridge",target:"hub",skillLocal:!0,attachLevel:"bridge",carrier:"bridge",utterances:["attach to bridge {bridge}","switch to bridge {bridge}","open bridge {bridge}","go to bridge {bridge}"],slots:[{name:"bridge",type:"BridgeName",required:!0,dynamic:!0,elicitationPrompts:["Which bridge?","Which bridge would you like to attach to?"]}],customTypes:[{name:"BridgeName",values:["one","two","three","four","five","six","seven","eight","nine","ten"]}],args:c.object({target:c.string()}),result:c.object({name:c.string()}),precheck:(e,t)=>(t.bridgeCount??0)===0?"No bridges have a running session yet.":null,fromSlots:e=>({target:e.bridge??""}),ackSpeech:()=>"",speak:e=>`Entered ${e.name}.`});var o_=Q({id:"ControlDevice",target:"hub",customHandler:!0,scaffold:!0,carrier:"turn",utterances:["turn on {device}","turn off {device}","turn on the {device}","turn off the {device}","toggle {device}"],slots:[{name:"device",type:"DeviceName",dynamic:!0,elicitationPrompts:["Which device?"]}],customTypes:[{name:"DeviceName",values:["light","lamp","fan","plug","heater"]}],deviceCommands:[{capability:"power",command:"turnOn"},{capability:"power",command:"turnOff"},{capability:"power",command:"toggle"}],args:c.object({device:c.string()}),result:c.object({ok:c.boolean()}),fromSlots:e=>({device:e.device??""}),ackSpeech:()=>"",speak:()=>""});var i_=Q({id:"ControlGroup",target:"hub",customHandler:!0,scaffold:!0,carrier:"group",utterances:["turn on the {group} group","turn off the {group} group","turn off {group} group"],slots:[{name:"group",type:"GroupName",dynamic:!0,elicitationPrompts:["Which group or room?"]}],customTypes:[{name:"GroupName",values:["living room","bedroom","kitchen","office","studio"]}],deviceCommands:[{capability:"power",command:"turnOn"},{capability:"power",command:"turnOff"}],args:c.object({group:c.string()}),result:c.object({ok:c.boolean()}),fromSlots:e=>({group:e.group??""}),ackSpeech:()=>"",speak:()=>""});var a_=e=>`In the current working directory, ${e}. Keep the answer brief enough to be read aloud.`;var s_=Q({id:"GitStatus",target:"session",carrier:"git",utterances:["git status","what's the git status","any uncommitted changes in git"],slots:[],args:c.object({}),result:c.object({}),fromSlots:()=>({}),ackSpeech:()=>"Asking git status.",speak:()=>"",render:()=>a_("run git status and report the current branch and any uncommitted changes")});var WL=c.object({index:c.number().int().positive(),name:c.string(),id:c.string(),sessionCount:c.number().int().nonnegative()}),c_=Q({id:"ListBridges",target:"hub",carrier:"bridge",utterances:["list bridges","list my bridges","what bridges do I have","what bridges are running","which bridges are running"],slots:[],args:c.object({}),result:c.object({bridges:c.array(WL)}),speaksResult:!0,cacheSource:"bridges",providesBridgeCatalog:!0,fromSlots:()=>({}),ackSpeech:()=>"",speak:e=>{let t=e.bridges.length;if(t===0)return"No bridges have a running session.";let r=e.bridges.map(o=>`${o.index}, ${o.name}`).join("; ");return`${t} bridge${t===1?"":"s"}: ${r}.`}});var VL=c.object({name:c.string(),type:c.string(),room:c.string().nullable(),online:c.boolean()}),JL=c.object({provider:c.string(),status:c.string()}),l_=Q({id:"ListDevices",target:"hub",carrier:"device",utterances:["list devices","list my devices","what devices do I have","what devices are online"],slots:[],args:c.object({}),result:c.object({devices:c.array(VL),accounts:c.array(JL)}),speaksResult:!0,cacheSource:"devices",fromSlots:()=>({}),ackSpeech:()=>"",speak:e=>{let t=e.accounts.filter(i=>i.status!=="linked"),r=t.length?` ${t.map(i=>`${i.provider} needs re-linking`).join("; ")}.`:"",o=e.devices.length;if(o===0)return`No devices are connected.${r}`;let n=e.devices.filter(i=>i.online).length;return`${o} device${o===1?"":"s"}, ${n} online.${r}`}});var qL=c.object({index:c.number().int().positive(),name:c.string(),id:c.string()}),u_=Q({id:"ListSessions",target:"hub",carrier:"session",utterances:["list sessions","list my sessions","what sessions do I have","what sessions are running"],slots:[],args:c.object({}),result:c.object({sessions:c.array(qL)}),speaksResult:!0,cacheSource:"sessions",providesSessionCatalog:!0,fromSlots:()=>({}),ackSpeech:()=>"",speak:e=>{let t=e.sessions.length;if(t===0)return"No sessions are running.";let r=e.sessions.map(o=>`${o.index}, ${o.name}`).join("; ");return`${t} session${t===1?"":"s"}: ${r}.`}});var d_=Q({id:"ReadMore",target:"hub",carrier:"more",utterances:["read more","continue reading","keep reading"],slots:[],args:c.object({}),result:_c,speaksResult:!0,cacheSource:"output",fromSlots:()=>({}),ackSpeech:()=>"",speak:e=>e.latestReply?e.hasMore?`${e.latestReply} Say read more to continue.`:e.latestReply:"That's the end of the output."});var p_=Q({id:"ReadOutput",target:"hub",carrier:"output",utterances:["read output","read the output","what's the output","read reply","read the reply","what's the reply","read the last reply","read it","replies","read replies","dev replies","any replies","latest reply"],slots:[],args:c.object({}),result:_c,speaksResult:!0,cacheSource:"output",fromSlots:()=>({}),ackSpeech:()=>"",speak:e=>e.latestReply?e.hasMore?`${e.latestReply} Say read more to continue.`:e.latestReply:"No output yet."});var KL=c.object({index:c.number().int().positive(),name:c.string(),id:c.string(),sessionCount:c.number().int().nonnegative()}),m_=Q({id:"RenameBridge",target:"hub",relayMutation:!0,customHandler:!0,carrier:"bridge",utterances:["rename bridge {bridge}","rename a bridge","rename this bridge","rename the bridge","rename this bridge to {name}","rename the bridge to {name}","call the bridge {name}"],slots:[{name:"bridge",type:"BridgeName",dynamic:!0},{name:"name",type:"AMAZON.SearchQuery",allowFreeText:!0}],args:c.object({name:c.string(),bridgeId:c.string().optional()}),result:c.object({bridges:c.array(KL)}),providesBridgeCatalog:!0,precheck:e=>e.name.trim()?null:"What would you like to call it?",fromSlots:e=>({name:(e.name??"").trim()}),ackSpeech:e=>`Okay, I'll call it ${e.name}.`,speak:()=>""});var XL=c.object({index:c.number().int().positive(),name:c.string(),id:c.string()}),f_=Q({id:"RenameSession",target:"hub",relayMutation:!0,customHandler:!0,carrier:"rename",utterances:["rename","rename a session","rename this session","rename the session","rename it","rename {target}","rename session {target}","rename to {name}","rename this session to {name}","call it {name}"],slots:[{name:"target",type:"SessionName",dynamic:!0},{name:"name",type:"AMAZON.SearchQuery",allowFreeText:!0}],args:c.object({name:c.string()}),result:c.object({sessions:c.array(XL)}),providesSessionCatalog:!0,precheck:e=>e.name.trim()?null:"What would you like to call it?",fromSlots:e=>({name:(e.name??"").trim()}),ackSpeech:e=>`Okay, I'll call it ${e.name}.`,speak:()=>""});var g_=Q({id:"Return",target:"hub",skillLocal:!0,clearsAttach:!0,carrier:"return",utterances:["return","go back","back to the main menu","main menu","leave the session","leave this session"],slots:[],args:c.object({}),result:c.object({}),fromSlots:()=>({}),ackSpeech:()=>"",speak:()=>"Back at the main menu."});var h_=Q({id:"SetBrightness",target:"hub",customHandler:!0,scaffold:!0,carrier:"brightness",utterances:["set brightness of {device} to {level}","set {device} brightness to {level}","dim {device} to {level}"],slots:[{name:"device",type:"DeviceName",dynamic:!0,elicitationPrompts:["Which device?"]},{name:"level",type:"AMAZON.NUMBER",elicitationPrompts:["What level, 0 to 100?"]}],customTypes:[{name:"DeviceName",values:["light","lamp","fan","plug","heater"]}],deviceCommands:[{capability:"brightness",command:"setBrightness"}],args:c.object({device:c.string(),level:c.number()}),result:c.object({ok:c.boolean()}),fromSlots:e=>({device:e.device??"",level:Number(e.level??0)}),ackSpeech:()=>"",speak:()=>""});var v_=Q({id:"SetTemperature",target:"hub",customHandler:!0,scaffold:!0,carrier:"temperature",utterances:["set temperature of {device} to {temperature}","set {device} temperature to {temperature}","set {device} to {temperature} degrees"],slots:[{name:"device",type:"DeviceName",dynamic:!0,elicitationPrompts:["Which thermostat?"]},{name:"temperature",type:"AMAZON.NUMBER",elicitationPrompts:["What temperature?"]}],customTypes:[{name:"DeviceName",values:["light","lamp","fan","plug","heater"]}],deviceCommands:[{capability:"thermostat",command:"setSetpoint"}],args:c.object({device:c.string(),temperature:c.number()}),result:c.object({ok:c.boolean()}),fromSlots:e=>({device:e.device??"",temperature:Number(e.temperature??0)}),ackSpeech:()=>"",speak:()=>""});var y_=[t_,n_,r_,o_,i_,s_,c_,l_,u_,d_,p_,m_,f_,g_,h_,v_],b_=new Map(y_.map(e=>[e.id,e])),XV=new Map(y_.map(e=>[`${e.id}Intent`,e]));function x_(e){if(e.type==="prompt")return e.text;let t=b_.get(e.id);if(!t?.render)throw new Error(`channel got command "${e.id}" with no render() \u2014 not a session-target command`);return t.render(t.args.parse(e.args))}var YL=new Set(["item/commandExecution/requestApproval","item/fileChange/requestApproval","item/permissions/requestApproval"]);function k_(e){return{decision:e}}var QL="Added to the current turn.",w_="late verdict dropped",eU="approve? [y/n/a]",hh="Codex restarted before this prompt ran \u2014 please resend.",tU=16e3;function _e(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:{}}function S_(e){let t=e.replace(/\\/g,"/").replace(/\/+$/,""),r=t.lastIndexOf("/");return(r>=0?t.slice(r+1):t)||e}function __(e){return(Array.isArray(e)?e.map(String).join(" "):typeof e=="string"?e:"").replace(/\s+/g," ").trim()}function nU(e){return e.replace(/^```.*\n?/gm,"").replace(/\[([^\]]*)\]\([^)]*\)/g,"$1")}function rU(e,t){return e.length>t?e.slice(0,t):e}function oU(e){let t=_e(e),r=t.codexErrorInfo,o=typeof r=="string"?r:r&&typeof r=="object"?String(_e(r).kind??_e(r).code??""):"",n=typeof t.message=="string"?t.message:"",i=`${o} ${n}`;return/usagelimitexceeded/i.test(i)?"rateLimited":/contextwindowexceeded/i.test(i)?"contextCritical":"error"}function iU(e,t,r,o,n){let i=_e(t);switch(e){case"item/commandExecution/requestApproval":{let a=__(i.command),s=typeof i.cwd=="string"&&i.cwd?i.cwd:n,{command:l,cwd:u,...d}=i;return{type:"permission_request",sessionId:r,requestId:o,tool:"Shell",description:`\`${a}\` in ${S_(s)}`,preview:JSON.stringify({command:a,cwd:s,...d})}}case"item/fileChange/requestApproval":{let s=(Array.isArray(i.files)?i.files:[]).map(d=>typeof d=="string"?d:_e(d).path).filter(d=>typeof d=="string"&&d.length>0),l=s.slice(0,3).map(S_).join(", "),u=s.length>3?", \u2026":"";return{type:"permission_request",sessionId:r,requestId:o,tool:"File change",description:`edit ${s.length} file(s): ${l}${u}`,preview:JSON.stringify(i)}}case"item/permissions/requestApproval":{let a=typeof i.mode=="string"?i.mode:typeof i.requestedMode=="string"?i.requestedMode:"unknown";return{type:"permission_request",sessionId:r,requestId:o,tool:"Permissions",description:`escalate sandbox to ${a}`,preview:JSON.stringify(i)}}default:return{type:"permission_request",sessionId:r,requestId:o,tool:"Approval",description:"approve this action?",preview:JSON.stringify(i)}}}var hl=class{sessionId;cwd;steerSupported;newSeq;turnInFlight=!1;owner=null;queue=[];pendingApprovals=new Map;lastApprovalRequestId=null;planReadyFired=!1;pendingSteerAcks=new Set;constructor(t){this.sessionId=t.sessionId,this.cwd=t.cwd,this.steerSupported=t.steerSupported,this.newSeq=t.newSeq}setSteerSupported(t){this.steerSupported=t}handle(t){switch(t.kind){case"hub":return this.onHub(t.msg);case"notification":return this.onNotification(t.method,t.params);case"server-request":return this.onServerRequest(t.id,t.method,t.params);case"local-line":return this.onLocalInput(t.text);case"local-approval":return this.onLocalApproval(t.behavior);case"steer-ok":return this.onSteerOk(t.requestId);case"sigint":return this.turnInFlight?[{kind:"rpc",method:"turn/interrupt"}]:this.endSession();case"teardown":return this.endSession();case"server-exit":return this.onServerExit();default:return[]}}onHub(t){switch(t.type){case"prompt":return this.onHubInput(t.requestId,t.text);case"command":return this.onHubInput(t.requestId,x_(t));case"permission_verdict":return this.onHubVerdict(t.requestId,t.behavior);default:return[]}}onHubInput(t,r){return this.turnInFlight?this.steerSupported?(this.pendingSteerAcks.add(t),[{kind:"rpc",method:"turn/steer",params:{text:r}}]):(this.queue.push({source:"hub",requestId:t,text:r}),[]):this.startTurn({kind:"hub",requestId:t},r)}onLocalInput(t){return this.turnInFlight?this.steerSupported?[{kind:"rpc",method:"turn/steer",params:{text:t}}]:(this.queue.push({source:"local",text:t}),[]):this.startTurn({kind:"local"},t)}startTurn(t,r){this.turnInFlight=!0,this.owner=t;let o=[{kind:"rpc",method:"turn/start",params:{text:r}}];return t.kind==="hub"&&o.push({kind:"render",channel:"voice",text:`[alexa] ${r}`}),o}onSteerOk(t){return this.pendingSteerAcks.has(t)?(this.pendingSteerAcks.delete(t),[this.replyAction(t,QL)]):[]}replyAction(t,r){return{kind:"hub-send",msg:{type:"reply",sessionId:this.sessionId,requestId:t,seq:this.newSeq(),text:r,final:!0}}}statePost(t,r){return{kind:"state-post",state:t,event:`codex-adapter:${r}`}}onNotification(t,r){switch(t){case"turn/started":return this.planReadyFired=!1,[this.statePost("working","turn-started")];case"turn/completed":return this.onTurnCompleted(r);case"item/agentMessage/delta":return this.onAgentDelta(r);case"item/started":return this.onItemStarted(r);case"item/completed":return this.onItemCompleted(r);case"item/commandExecution/outputDelta":return this.onOutputDelta(r);case"turn/plan/updated":return this.onPlanUpdated(r);case"thread/tokenUsage/updated":return this.onTokenUsage(r);default:return[]}}onTurnCompleted(t){let r=_e(t),o=_e(r.turn),n=typeof o.status=="string"?o.status:typeof r.status=="string"?r.status:"",i=o.error??r.error,a=[];if(n==="completed")a.push(this.statePost("finished","turn-completed"));else if(n==="failed"){if(this.owner?.kind==="hub"){let s=_e(i),l=typeof s.message=="string"?s.message:"unknown error";a.push(this.replyAction(this.owner.requestId,`Codex hit an error: ${l}`))}a.push(this.statePost(oU(i),"turn-failed"))}else n==="interrupted"&&a.push(this.statePost("idle","turn-interrupted"));return a.push(...this.finishTurnAndDrain()),a}finishTurnAndDrain(){this.turnInFlight=!1,this.owner=null;let t=this.queue.shift();return t?t.source==="hub"?this.startTurn({kind:"hub",requestId:t.requestId},t.text):this.startTurn({kind:"local"},t.text):[]}onAgentDelta(t){let r=_e(t).delta;return typeof r=="string"&&r?[{kind:"render",channel:"agent",text:r}]:[]}onItemStarted(t){let r=_e(_e(t).item);return r.type==="commandExecution"?[{kind:"render",channel:"tool",text:`$ ${__(r.command)}`}]:[]}onItemCompleted(t){let r=_e(_e(t).item);if(r.type==="agentMessage"){if(this.owner?.kind!=="hub")return[];let o=rU(nU(typeof r.text=="string"?r.text:""),tU);return[this.replyAction(this.owner.requestId,o)]}if(r.type==="commandExecution"){let o=r.exitCode;return[{kind:"render",channel:"tool",text:typeof o=="number"?`(exit ${o})`:"(done)"}]}return[]}onOutputDelta(t){let r=_e(t).delta;return typeof r=="string"&&r?[{kind:"render",channel:"tool",text:r}]:[]}onPlanUpdated(t){let r=_e(t).plan;if(!Array.isArray(r))return[];let o=r.map(n=>({kind:"render",channel:"meta",text:`- ${String(n)}`}));return this.planReadyFired||(this.planReadyFired=!0,o.push(this.statePost("planReady","plan-updated"))),o}onTokenUsage(t){let r=_e(t),o=_e(r.tokenUsage),n=_e(o.total),i=_e(o.last),a=m=>typeof m=="number"&&Number.isFinite(m)?m:void 0,s=[],l=a(n.inputTokens),u=a(n.outputTokens);l!==void 0&&u!==void 0&&s.push({kind:"usage-post",inputTokens:l,cachedInputTokens:a(n.cachedInputTokens)??0,outputTokens:u});let d=a(i.totalTokens),p=a(o.modelContextWindow);if(d!==void 0&&p!==void 0&&p>0){let m=Math.round(d/p*1e3)/10;s.push({kind:"context-post",pct:m,usedTokens:d,windowTokens:p})}return s}onServerRequest(t,r,o){if(!YL.has(r))return[];let n=`codex-approval-${this.newSeq()}`,i=iU(r,o,this.sessionId,n,this.cwd);this.pendingApprovals.set(n,{serverRequestId:t}),this.lastApprovalRequestId=n;let a=r==="item/permissions/requestApproval"?"sandboxEscalation":"needs_permission";return[{kind:"hub-send",msg:i},this.statePost(a,"approval-requested"),{kind:"render",channel:"meta",text:eU}]}onHubVerdict(t,r){let o=r==="allow"?"accept":"decline",n={kind:"render",channel:"voice",text:r==="allow"?"[alexa] approved":"[alexa] denied"};return this.resolveApproval(t,o,n)}onLocalApproval(t){let r=this.lastApprovalRequestId;if(!r)return[{kind:"render",channel:"meta",text:w_}];let o=t==="allow"?"accept":t==="allow-session"?"acceptForSession":"decline",n=t==="allow"?"approved":t==="allow-session"?"approved for session":"denied";return this.resolveApproval(r,o,{kind:"render",channel:"meta",text:n})}resolveApproval(t,r,o){let n=this.pendingApprovals.get(t);if(!n)return[{kind:"render",channel:"meta",text:w_}];this.pendingApprovals.delete(t),this.lastApprovalRequestId===t&&(this.lastApprovalRequestId=null);let i=r==="decline";return[{kind:"rpc-respond",id:n.serverRequestId,result:k_(r)},this.statePost(i?"permissionDenied":"working",i?"approval-denied":"approval-allowed"),o]}endSession(){let t=[...this.pendingApprovals.values()].map(r=>({kind:"rpc-respond",id:r.serverRequestId,result:k_("decline")}));return this.pendingApprovals.clear(),this.lastApprovalRequestId=null,this.pendingSteerAcks.clear(),[this.statePost("ended","teardown"),...t,{kind:"exit"}]}onServerExit(){let t=[];this.turnInFlight&&t.push(this.statePost("error","server-exit"));for(let r of this.queue)r.source==="hub"&&t.push(this.replyAction(r.requestId,hh));return this.queue=[],this.turnInFlight=!1,this.owner=null,this.pendingApprovals.clear(),this.lastApprovalRequestId=null,this.pendingSteerAcks.clear(),t}};import aU from"node:path";function $_(e,t){let r=aU.basename(e)||"session";return{id:`${r}@${t}+codex`,name:`${r} codex (${t})`}}function I_(e){let{sub:t,...r}=e;return{...r,voice:!0,agent:"codex",...t?{sub:t}:{}}}var Yi=class extends Error{code;constructor(t,r){super(`codex app-server error ${t}: ${r}`),this.name="AppServerError",this.code=t}};function vh(e,t){let r=1,o=!1,n="",i=new Map,a=[],s=[],l=[];function u(_){o||e.write(`${JSON.stringify(_)}
|
|
266
|
+
`)}function d(_){let P=_.trim();if(!P)return;let C;try{C=JSON.parse(P)}catch{return}if(!C||typeof C!="object"||Array.isArray(C))return;let E=C,D=E.id,W=typeof D=="number"||typeof D=="string",ce=E.method;if(typeof ce=="string"){if(W)for(let Y of s)Y(D,ce,E.params);else for(let Y of a)Y(ce,E.params);return}if(W&&("result"in E||"error"in E)){if(typeof D!="number")return;let Y=i.get(D);if(!Y)return;if(i.delete(D),"error"in E&&E.error){let ke=E.error,Ee=typeof ke.code=="number"?ke.code:-32603,z=typeof ke.message=="string"?ke.message:"unknown app-server error";Y.reject(new Yi(Ee,z))}else Y.resolve(E.result);return}}function p(_){n+=_;let P;for(;(P=n.indexOf(`
|
|
267
|
+
`))>=0;){let C=n.slice(0,P);n=n.slice(P+1),d(C)}}function m(){t.removeListener("data",p),t.removeListener("end",y),t.removeListener("error",k),e.removeListener("error",k)}function f(_){m();let P=_??new Error("codex app-server stream closed");for(let C of i.values())C.reject(P);i.clear()}function g(_){if(!o){o=!0,f(_);for(let P of l)P(_)}}function y(){g()}function k(_){g(_)}return t.setEncoding("utf8"),t.on("data",p),t.on("end",y),t.on("error",k),e.on("error",k),{request(_,P){if(o)return Promise.reject(new Error("codex app-server client is closed"));let C=r++;return new Promise((E,D)=>{i.set(C,{resolve:E,reject:D}),u({id:C,method:_,params:P})})},notify(_,P){u({method:_,params:P})},respond(_,P){u({id:_,result:P})},onNotification(_){a.push(_)},onServerRequest(_){s.push(_)},onClose(_){l.push(_)},close(){o||(o=!0,f())}}}function mU(e,t){return sU(e.file,[...e.argsPrefix,"app-server"],{env:t,stdio:["pipe","pipe","inherit"]})}function Qi(e){if(process.platform==="win32"&&e.pid){cU("taskkill",["/pid",String(e.pid),"/T","/F"]);return}try{e.kill?.("SIGTERM")}catch{}}function fU(e){return new Promise(t=>setTimeout(t,e))}function gU(e,t){return{...t?{threadId:t}:{},input:[{type:"text",text:e}]}}function hU(e,t,r){if(e==="turn/start"||e==="turn/steer"){let o=t,n=typeof o?.text=="string"?o.text:"";return gU(n,r)}return e==="turn/interrupt"?r?{threadId:r}:void 0:t}function kh(e){if(!e||typeof e!="object")return;let t=e;if(typeof t.threadId=="string"&&t.threadId)return t.threadId;if(typeof t.thread_id=="string"&&t.thread_id)return t.thread_id;let r=t.thread;if(r&&typeof r=="object"){let o=r.id;if(typeof o=="string"&&o)return o}}function vU(e){return kh(e)!==void 0?!1:!!e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length>0}function E_(e){if(Array.isArray(e))return e;if(e&&typeof e=="object"&&Array.isArray(e.threads))return e.threads}function yU(e){let t=E_(e);if(!t)return[];let r=[];for(let o of t){if(!o||typeof o!="object")continue;let n=o,i=typeof n.threadId=="string"?n.threadId:typeof n.thread_id=="string"?n.thread_id:typeof n.id=="string"?n.id:void 0;if(!i)continue;let a=typeof n.cwd=="string"?n.cwd:typeof n.workingDirectory=="string"?n.workingDirectory:typeof n.path=="string"?n.path:void 0,s=n.updatedAt??n.lastActiveAt??n.createdAt,l=typeof s=="number"?s:typeof s=="string"?Date.parse(s):void 0;r.push({id:i,cwd:a,updatedAt:l!==void 0&&Number.isFinite(l)?l:void 0})}return r}function bU(e){return E_(e)!==void 0?!1:!!e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length>0}function xU(e,t){let r=yU(e).filter(o=>o.cwd===t);if(r.length!==0)return r.sort((o,n)=>(n.updatedAt??0)-(o.updatedAt??0)),r[0]?.id}function kU(e){switch(e.trim().toLowerCase()){case"y":case"yes":return"allow";case"a":case"always":return"allow-session";case"n":case"no":return"deny";default:return null}}var ea={dim:"\x1B[2m",italic:"\x1B[3m",reset:"\x1B[0m",cyan:"\x1B[36m"};function yh(e,t,r){return r?`${e}${t}${ea.reset}`:t}var xh=class{constructor(t){this.out=t;this.colorEnabled=!!t.isTTY&&!process.env.NO_COLOR}out;atLineStart=!0;colorEnabled;render(t,r){if(t==="agent"){this.out.write(r),this.atLineStart=r.endsWith(`
|
|
268
|
+
`);return}if(t==="tool"){this.out.write(yh(ea.dim,r,this.colorEnabled)),this.atLineStart=r.endsWith(`
|
|
269
269
|
`);return}if(this.atLineStart||this.out.write(`
|
|
270
|
-
`),t==="meta")this.out.write(`${
|
|
271
|
-
`);else{let o=/^(\[[^\]]+\]\s?)/.exec(r),n=o?`${
|
|
272
|
-
`)}this.atLineStart=!0}};function fh(e){return new Promise(t=>{let r="";try{r=nU(e.tokenFile,"utf8").trim()}catch{}let o=JSON.stringify(e.body),n=rU({host:"127.0.0.1",port:e.hubPort,path:e.path,method:"POST",headers:{"content-type":"application/json","content-length":Buffer.byteLength(o),"x-bridge-hub-token":r},timeout:2e3},i=>{i.on("data",()=>{}),i.on("end",()=>t())});n.on("timeout",()=>{n.destroy(),t()}),n.on("error",()=>t()),n.end(o)})}function To(e){return e instanceof Error?e.message:String(e)}function fU(e){if(e.kind!=="hub")return;let t=e.msg;return t.type==="prompt"||t.type==="command"?t.requestId:void 0}async function Xi(e,t,r){let o=await e.request("thread/start",{cwd:t});return lU(o)&&r("thread/start returned a result but no recognizable thread id (threadId/thread_id/thread.id) \u2014 codex resume may not work"),hh(o)}async function k_(e,t,r,o){try{let n=await e.request("thread/resume",{threadId:r});return hh(n)??r}catch{return o("codex thread/resume was rejected \u2014 starting a fresh thread instead"),Xi(e,t,o)}}async function gU(e,t,r){let o=await e.request("thread/list",{cwd:t});if(dU(o))return r("thread/list returned a result but no recognizable thread list \u2014 starting a fresh thread"),Xi(e,t,r);let n=pU(o,t);return n?(r(`resuming the most recent codex thread for this cwd (${n})`),k_(e,t,n,r)):(r("no existing codex thread found for this cwd \u2014 starting a fresh thread"),Xi(e,t,r))}var b_=5,hU=1e3,vU=3e4;async function w_(e){let t=e.codexCmd??$r(),r=e.clientVersion??"0.0.0",o=e.voice??ra({isDevBuild:Ct()===null}),n=e.spawn??iU,i=e.delay??aU,a=e.stdin??process.stdin,s=e.stdout??process.stdout,l=new gh(s),u=0;function d(){return u+=1,{...process.env,ACB_CODEX_ADAPTER:"1",ACB_CODEX_GENERATION:String(u)}}let p;try{p=n(t,d())}catch(C){return l.render("meta",`failed to launch codex: ${To(C)}`),1}p.on("error",C=>l.render("meta",`codex process error: ${To(C)}`));let m=ph(p.stdin,p.stdout),f=null,g=C=>(l.render("meta",C),m.close(),qi(p),f&&ue(f),1),y,k,_,P={};try{await m.request("initialize",{clientInfo:{name:"acbridge",title:"AC Bridge",version:r}}),m.notify("initialized",{});let C=E=>l.render("meta",E);y=e.resume?await gU(m,e.cwd,C):await Xi(m,e.cwd,C),_=tU(),k=v_(e.cwd,e.machine),f=Gl(_),P=y_({id:k.id,name:k.name,hubPort:e.hubPort,hubTokenFile:e.hubTokenFile,claudeSessionId:_,cwd:e.cwd,sub:e.sub}),ge(f,JSON.stringify({...P,...y?{codexThreadId:y}:{}}))}catch(C){return g(`codex bring-up failed: ${To(C)}`)}return new Promise(C=>{let E=!1,D=0,G=()=>D+=1,ae=new ll({sessionId:k.id,cwd:e.cwd,steerSupported:!0,newSeq:G}),X=!1,be=!1,Ee=[];function z(M){if(be){Ee.push(M);return}Vt(M)}function vt(){let M=Ee.splice(0,Ee.length);for(let ee of M){if(ee.kind!=="hub")continue;let j=ee.msg;j.type!=="prompt"&&j.type!=="command"||et.send({type:"reply",sessionId:k.id,requestId:j.requestId,seq:G(),text:dh,final:!0})}}let et=WS({port:e.hubPort,tokenFile:e.hubTokenFile,hello:()=>o?{type:"register",sessions:[{id:k.id,name:k.name,cwd:e.cwd,online:!0,agent:"codex"}],claudeSessionId:_}:null,onMessage:M=>z({kind:"hub",msg:M})}),Oo=oU({input:a,output:s,terminal:!!a.isTTY}),$n=null;function vh(M){E||(E=!0,$n&&(qi($n),$n=null),m.close(),et.close(),qi(p),f&&ue(f),Oo.close(),C(M))}function Yi(M,ee){fh({hubPort:e.hubPort,tokenFile:e.hubTokenFile,path:"/local/session/state",body:{sessionId:k.id,claudeSessionId:_,cwd:e.cwd,ts:Date.now(),state:M,event:ee,agent:"codex"}})}function U_(M,ee,j){if(M===void 0)return;let Ne={pct:M};ee!==void 0&&(Ne.usedTokens=ee),j!==void 0&&(Ne.windowTokens=j),fh({hubPort:e.hubPort,tokenFile:e.hubTokenFile,path:"/local/session/context",body:{sessionId:k.id,claudeSessionId:_,cwd:e.cwd,ts:Date.now(),agent:"codex",context:Ne}})}function z_(M){y&&fh({hubPort:e.hubPort,tokenFile:e.hubTokenFile,path:"/local/session/usage",body:{sessionId:k.id,claudeSessionId:_,codexThreadId:y,cwd:e.cwd,ts:Date.now(),agent:"codex",inputTokens:M.inputTokens,cachedInputTokens:M.cachedInputTokens,outputTokens:M.outputTokens}})}function j_(){f&&ge(f,JSON.stringify({...P,...y?{codexThreadId:y}:{}}))}function yh(M,ee){for(let j of M)switch(j.kind){case"rpc":{let Ne=j.method,No=cU(Ne,j.params,y);m.request(Ne,No).then(()=>{if(Ne!=="turn/steer")return;let kr=fU(ee);kr&&Vt({kind:"steer-ok",requestId:kr})},kr=>{if(Ne==="turn/steer"&&kr instanceof Ji&&kr.code===-32601){ae.setSteerSupported(!1),yh(ae.handle(ee),ee);return}l.render("meta",`codex error (${Ne}): ${To(kr)}`)});break}case"rpc-respond":X=!1,m.respond(j.id,j.result);break;case"hub-send":j.msg.type==="permission_request"&&(X=!0),et.send(j.msg);break;case"state-post":Yi(j.state,j.event);break;case"context-post":U_(j.pct,j.usedTokens,j.windowTokens);break;case"usage-post":z_(j);break;case"render":l.render(j.channel,j.text);break;case"exit":vh(0);break;default:break}}function Vt(M){yh(ae.handle(M),M)}let pl=!1,Qi,Do=0;function bh(){Do+=1;let M=Do;p.on("exit",ee=>{M===Do&&(Qi=ee,ml())}),m.onClose(()=>{M===Do&&(Qi!==void 0?ml():setTimeout(()=>{M===Do&&ml()},25))}),m.onNotification((ee,j)=>Vt({kind:"notification",method:ee,params:j})),m.onServerRequest((ee,j,Ne)=>Vt({kind:"server-request",id:ee,method:j,params:Ne}))}async function F_(){let M=n(t,d());$n=M,M.on("error",j=>l.render("meta",`codex process error: ${To(j)}`));let ee=ph(M.stdin,M.stdout);try{await ee.request("initialize",{clientInfo:{name:"acbridge",title:"AC Bridge",version:r}}),ee.notify("initialized",{});let j=No=>l.render("meta",No),Ne=y?await k_(ee,e.cwd,y,j):await Xi(ee,e.cwd,j);return $n=null,{child:M,client:ee,threadId:Ne}}catch(j){throw $n=null,ee.close(),qi(M),j}}async function M_(){let M=hU,ee=0;for(;;){if(await i(M),E)return;try{let j=await F_();if(E){j.client.close(),qi(j.child);return}p=j.child,m=j.client,pl=!1,Qi=void 0,X=!1,bh(),j.threadId!==void 0&&j.threadId!==y&&(y=j.threadId,j_()),l.render("meta","codex reconnected \u2014 session resumed"),Yi("resumed","codex-adapter:respawned"),be=!1;let Ne=Ee.splice(0,Ee.length);for(let No of Ne)Vt(No);return}catch(j){if(ee+=1,l.render("meta",`codex respawn attempt ${ee} failed: ${To(j)}`),E)return;if(ee>=b_){Yi("error","codex-adapter:respawn-gave-up"),l.render("meta",`codex gave up respawning after ${b_} consecutive failed attempts \u2014 ending session`),vt(),vh(1);return}M=Math.min(M*2,vU)}}}function ml(){if(pl||E)return;pl=!0;let M=Qi??null;Vt({kind:"server-exit",code:M}),l.render("meta",`codex exited unexpectedly (code ${M??"unknown"}) \u2014 attempting to respawn`),X=!1,be=!0,M_()}bh(),Oo.on("line",M=>{let ee=M.trim();if(X){let j=mU(ee);if(j){Vt({kind:"local-approval",behavior:j});return}}z({kind:"local-line",text:ee})}),Oo.on("SIGINT",()=>Vt({kind:"sigint"})),Oo.on("close",()=>{E||Vt({kind:"teardown"})}),Yi("started","codex-adapter:started")})}function SU(e){let t={hold:e.includes("--hold"),agent:"claude",resume:e.includes("--resume")},r=e.indexOf("--agent");if(r>=0){let o=e[r+1];o==="claude"||o==="codex"?t.agent=o:t.bad=`invalid --agent: ${o??"(none)"} (use claude | codex)`}return!t.bad&&t.resume&&t.agent!=="codex"&&(t.bad="--resume requires --agent codex"),t}function _U(e,t,r){let o={...r,BRIDGE_SESSION_ID:t.sessionId,BRIDGE_SESSION_NAME:t.sessionName,BRIDGE_HUB_PORT:String(t.hubPort)};return delete o.ELECTRON_RUN_AS_NODE,{file:e.file,args:[...e.argsPrefix,"--session-id",t.claudeSessionId,"--channels","plugin:alexa@bridge"],env:o}}function $U(e){let{sub:t,...r}=e;return{...r,voice:!0,...t?{sub:t}:{}}}async function IU(){h("[bridge] session closed \u2014 press Enter to exit\u2026"),await new Promise(e=>{let t=wU({input:process.stdin,output:process.stdout});t.question("",()=>{t.close(),e()})})}var S_="https://github.com/openai/codex#install";function AU(e){return __(e.file,[...e.argsPrefix,"--version"],{encoding:"utf8",timeout:5e3}).status===0}function EU(e={}){let t;try{t=(e.resolveCodex??$r)()}catch{return{ok:!1,message:`codex CLI not found \u2014 install it: ${S_}`}}return(e.probeCodex??AU)(t)?(e.codexLoggedIn??la)()?{ok:!0,codexCmd:t}:{ok:!1,message:"Run `codex login` first."}:{ok:!1,message:`codex CLI not found \u2014 install it: ${S_}`}}async function $_(e=[],t={}){let r=SU(e);if(r.bad)return b(r.bad),2;if(!(t.voice??Qe()))return b("voice sessions are turned off in this build."),h("Your devices and Profiles are unaffected \u2014 `acbridge start` keeps the bridge running."),h(`Launch the agent yourself in this folder: \`${r.agent}\` \u2014 its hooks still drive your Profiles.`),1;let{hold:o,agent:n}=r,i=ne(),a=t.preflightAccount??ho,s=t.ensureFreshToken??Tt,l=t.ensureHub??it,u=t.hubRelease??$c,d=t.readActiveUser??$e,p=t.holdForEnter??IU,m=await a();if(!m.ok)return b(m.message),m.exitCode;await s(i.relayUrl);let{holderId:f}=await l({kind:"run"});if(n==="codex"){let z=!1,vt=async()=>{if(!z&&(z=!0,f))try{await u(f)}catch{}};process.once("SIGINT",()=>{vt()}),process.once("SIGTERM",()=>{vt()});let et=(t.codexPreflight??EU)();if(!et.ok)return b(et.message),await vt(),1;h(`Launching Codex with the Alexa channel \u2014 cwd: ${process.cwd()}`);let $n=await(t.runCodexAdapter??w_)({cwd:process.cwd(),machine:i.machine,hubPort:i.hubPort,hubTokenFile:sg(),sub:d()?.sub,codexCmd:et.codexCmd,clientVersion:Ct()??void 0,voice:!0,resume:r.resume});return await vt(),o&&await p(),$n}for(let z of Ec({...t.ensurePluginInstalled?{ensurePluginInstalled:t.ensurePluginInstalled}:{},...t.ensureStatusline?{ensureStatusline:t.ensureStatusline}:{}}))(z.level==="info"?h:U)(z.message);let g=ul.basename(process.cwd())||"session",y=`${g}@${i.machine}`,k=`${g} (${i.machine})`,_=yU(),P=ul.join(W,"sessions");bU(P,{recursive:!0});let C=ul.join(P,`${_}.json`),E=process.cwd(),D=ul.join(kU.homedir(),".claude","projects",E.replace(/[^A-Za-z0-9]/g,"-"),`${_}.jsonl`),G=sg();xU(C,JSON.stringify($U({id:y,name:k,hubPort:i.hubPort,hubTokenFile:G,claudeSessionId:_,transcriptPath:D,cwd:E,sub:d()?.sub})),{mode:384});let ae=!1,X=async()=>{if(!ae&&(ae=!0,ue(C),f))try{await u(f)}catch{}};process.once("SIGINT",()=>{X()}),process.once("SIGTERM",()=>{X()}),h(`Launching Claude with the Alexa channel \u2014 session: ${y}`);let be=_U((t.resolveClaude??An)(),{sessionId:y,claudeSessionId:_,sessionName:k,hubPort:i.hubPort},process.env),Ee=__(be.file,be.args,{stdio:"inherit",env:be.env});return await X(),o&&await p(),Ee.status??0}var PU="Usage: acbridge scan [--json] [--timeout <seconds>]",CU=1e3,TU=e=>Dk(e);function RU(e){let t={json:!1,timeoutMs:3e4};for(let r=0;r<e.length;r++){let o=e[r];if(o==="--json")t.json=!0;else if(o==="--timeout"||o?.startsWith("--timeout=")){let n=o==="--timeout"?e[++r]:o.slice(10),i=Number(n);!Number.isFinite(i)||i<=0?t.bad=`invalid --timeout: ${n??"(none)"}`:t.timeoutMs=Math.min(120,Math.max(5,Math.round(i)))*1e3}else t.bad=`unknown option: ${o??""}`}return t}async function P_(e){let t=RU(e);if(t.bad)return b(t.bad),h(PU),2;if(t.json&&we(!0),!await Te()){let i=Bn();if(!i.ok)return b(i.message),3;if(t.json)return b(De()),1;try{await it({kind:"cli"})}catch(a){return b(`couldn't start the hub: ${a.message}`),h("check ~/.claude-bridge/hub.log, or start it yourself with `acbridge daemon` and re-run"),1}}let r=await Z("/local/scan",{method:"POST"});if(r.hubOffline)return b(De()),1;if(r.status!==200||!r.body?.scanId)return b(`hub answered HTTP ${r.status} starting the scan \u2014 token mismatch? restart the hub`),1;let{session:o,expired:n}=await OU(r.body.scanId,t);return o?t.json?(console.log(JSON.stringify(o)),o.status==="failed"?1:0):(n&&h(Se("(scan session expired mid-poll \u2014 showing the hub's last-known devices)")),o.status==="failed"?(b(`scan failed: ${o.error??"unknown error"}`),1):(o.status==="running"&&U("scan still running at --timeout \u2014 showing partial results (re-run `acbridge scan` for the final list)"),zU(o.devices,o.env,o.accountDevices),await MU(o.devices),0)):(b(De()),1)}async function OU(e,t){let r=Date.now()+t.timeoutMs,o=!t.json&&process.stdout.isTTY,n=null;!t.json&&!o&&h("scanning\u2026");try{for(;;){let i=await Z(`/local/scan/${e}`);if(i.hubOffline)return{session:n,expired:!1};if(i.status===404){let a=await Z("/local/discovered");return a.status===200&&a.body?{session:DU(e,a.body),expired:!0}:{session:n,expired:!0}}if(i.status===200&&i.body&&(n=i.body,o&&process.stdout.write(`\r\u2022 scanning\u2026 ${n.devices.length} device(s) found`),n.status!=="running"))return{session:n,expired:!1};if(Date.now()>=r)return{session:n,expired:!1};await new Promise(a=>setTimeout(a,CU))}}finally{o&&process.stdout.write("\r\x1B[2K")}}var DU=(e,t)=>({id:e,status:"done",startedAt:t.updatedAt,finishedAt:t.updatedAt,devices:t.devices,...t.accountDevices?{accountDevices:t.accountDevices}:{},env:t.env}),NU={ready:0,ecosystems:1,"needs-setup":2,unidentified:3,infrastructure:4},LU={ready:"Ready",ecosystems:"Link account","needs-setup":"Needs setup",unidentified:"Unknown",infrastructure:"Infrastructure"};function I_(e){return NU[fo(e)]}function UU(e){return LU[fo(e)]}function dl(e){let t=[e.identity.manufacturer,e.identity.model].filter(Boolean).join(" ");return e.identity.name??(t||e.identity.hint||e.addresses.hostname||e.addresses.ip)}function A_(e){if(e.alreadyLinked)return`connected \u2713 (via ${e.alreadyLinked.provider})`;if(e.bucket==="connect-now"&&e.localProtocol)return`acbridge connect ${e.discoveredId}`;if(e.bucket==="link-ecosystem"){let t=e.suggestedProvider;return t==="homeassistant"?"acbridge link home-assistant":t==="mqtt"?`acbridge link mqtt --host ${e.addresses.ip}`:t==="hue"||t==="smartthings"?`acbridge link ${t}`:"link via the app"}return"\u2014"}function E_(e){let t=jU(e);if(t.length!==0){h(""),h(Se(t[0]));for(let r of t.slice(1))h(r)}}function zU(e,t,r){let o=Ck(t);if(o&&t.interop==="windows-arp"?U("WSL detected \u2014 mDNS/broadcast limited; using the Windows neighbor table for ARP discovery"):o&&t.wsl?U("WSL detected \u2014 LAN scan degraded (mDNS/broadcast limited); results may be incomplete"):o&&U("multicast self-test failed \u2014 mDNS results may be missing"),e.length===0){o&&t.wsl?h("0 devices found \u2014 expected to be incomplete under WSL (see `acbridge doctor`)."):o?h("0 devices found \u2014 the multicast self-test failed, so this scan is expected to be incomplete (see `acbridge doctor`)."):Tk(t,e.length)?h(`No devices found. ${Rk}`):h("No devices found. Devices must be on the same network/VLAN; Wi-Fi isolation limits discovery."),E_(r);return}let n=[...e].sort((m,f)=>I_(m)-I_(f)||dl(m).localeCompare(dl(f))),i=n.map(m=>[C_(dl(m),28),m.expectedType??"\u2014",m.addresses.ip,m.addresses.mac??"\u2014",UU(m),A_(m)]),a=["NAME","TYPE","IP","MAC","STATUS","ACTION"],s=a.map((m,f)=>Math.max(m.length,...i.map(g=>g[f].length))),l=m=>m.map((f,g)=>f.padEnd(s[g])).join(" ").trimEnd();h(Se(l(a)));for(let m of i)h(l(m));h("");let u=new Map;for(let m of n)u.set(fo(m),(u.get(fo(m))??0)+1);let d=[["ready","ready"],["ecosystems","ecosystem"],["needs-setup","need setup"],["unidentified","unidentified"],["infrastructure","infrastructure"]].map(([m,f])=>u.get(m)?`${u.get(m)} ${f}`:null).filter(m=>m!==null);h(`${e.length} device(s)${d.length>0?` \u2014 ${d.join(" \xB7 ")}`:""}`);let p=n.filter(m=>m.identity.hint!==void 0&&A_(m)==="\u2014"&&fo(m)!=="unidentified");if(p.length>0){h(""),h(Se("Notes:"));for(let m of p)h(` \u2022 ${dl(m)} (${m.addresses.ip}): ${m.identity.hint}`)}E_(r)}var C_=(e,t)=>e.length>t?`${e.slice(0,t-1)}\u2026`:e;function jU(e){let t=e??[];if(t.length===0)return[];let r=[`Known from your accounts (${t.length}):`];for(let o of t){let n=o.state==="cloud"?`added \u2014 reads over the ${o.provider} cloud, so it never appears in a scan`:`in your ${o.provider} account \u2014 not seen on this network`;r.push(` \u2022 ${FU(o)}: ${n}`)}return r}var FU=e=>C_(e.name,40);async function MU(e){if(!e.some(TU))return;let t=await Z("/local/config");t.status!==200||t.body?.autoConnect!=="unset"||(h(""),A("Tip: `acbridge connect --auto on` auto-connects open-protocol lights/plugs (never locks, cameras, or doors)."))}import{existsSync as HU}from"node:fs";import{dirname as ZU}from"node:path";function BU(e=W){return ga(Er(Pr(e)))}function T_(e){return kv(Rr,{home:e?.home,configFile:e?.configFile,env:e?.env,nodeCommand:e?.nodeCommand??BU(e?.bridgeDir)})}function GU(e){return e?"Setup complete. Run `acbridge run` in any project to start a voice-driven session.":"Setup complete. `acbridge start` runs the bridge; launch `claude` in any project \u2014 its hooks drive your Profiles."}async function R_(e={}){let t=e.installPlugin??Ic,r=e.applyManaged??fw,o=e.applyFirewall??(()=>pw()),n=e.ensureStatusline??Ac,i=e.ensureCodexHooks??T_,a=e.voice??Qe(),s=(e.codexInstalled??(()=>HU(ZU(fa()))))(),l=(e.claudeInstalled??zh)();if(h(a?`Setting up the Alexa bridge on this machine\u2026
|
|
270
|
+
`),t==="meta")this.out.write(`${yh(`${ea.dim}${ea.italic}`,`\u2022 ${r}`,this.colorEnabled)}
|
|
271
|
+
`);else{let o=/^(\[[^\]]+\]\s?)/.exec(r),n=o?`${yh(ea.cyan,o[1],this.colorEnabled)}${r.slice(o[1].length)}`:r;this.out.write(`${n}
|
|
272
|
+
`)}this.atLineStart=!0}};function bh(e){return new Promise(t=>{let r="";try{r=uU(e.tokenFile,"utf8").trim()}catch{}let o=JSON.stringify(e.body),n=dU({host:"127.0.0.1",port:e.hubPort,path:e.path,method:"POST",headers:{"content-type":"application/json","content-length":Buffer.byteLength(o),"x-bridge-hub-token":r},timeout:2e3},i=>{i.on("data",()=>{}),i.on("end",()=>t())});n.on("timeout",()=>{n.destroy(),t()}),n.on("error",()=>t()),n.end(o)})}function Do(e){return e instanceof Error?e.message:String(e)}function wU(e){if(e.kind!=="hub")return;let t=e.msg;return t.type==="prompt"||t.type==="command"?t.requestId:void 0}async function ta(e,t,r){let o=await e.request("thread/start",{cwd:t});return vU(o)&&r("thread/start returned a result but no recognizable thread id (threadId/thread_id/thread.id) \u2014 codex resume may not work"),kh(o)}async function P_(e,t,r,o){try{let n=await e.request("thread/resume",{threadId:r});return kh(n)??r}catch{return o("codex thread/resume was rejected \u2014 starting a fresh thread instead"),ta(e,t,o)}}async function SU(e,t,r){let o=await e.request("thread/list",{cwd:t});if(bU(o))return r("thread/list returned a result but no recognizable thread list \u2014 starting a fresh thread"),ta(e,t,r);let n=xU(o,t);return n?(r(`resuming the most recent codex thread for this cwd (${n})`),P_(e,t,n,r)):(r("no existing codex thread found for this cwd \u2014 starting a fresh thread"),ta(e,t,r))}var A_=5,_U=1e3,$U=3e4;async function C_(e){let t=e.codexCmd??Ar(),r=e.clientVersion??"0.0.0",o=e.voice??sa({isDevBuild:Ct()===null}),n=e.spawn??mU,i=e.delay??fU,a=e.stdin??process.stdin,s=e.stdout??process.stdout,l=new xh(s),u=0;function d(){return u+=1,{...process.env,ACB_CODEX_ADAPTER:"1",ACB_CODEX_GENERATION:String(u)}}let p;try{p=n(t,d())}catch(C){return l.render("meta",`failed to launch codex: ${Do(C)}`),1}p.on("error",C=>l.render("meta",`codex process error: ${Do(C)}`));let m=vh(p.stdin,p.stdout),f=null,g=C=>(l.render("meta",C),m.close(),Qi(p),f&&de(f),1),y,k,_,P={};try{await m.request("initialize",{clientInfo:{name:"acbridge",title:"AC Bridge",version:r}}),m.notify("initialized",{});let C=E=>l.render("meta",E);y=e.resume?await SU(m,e.cwd,C):await ta(m,e.cwd,C),_=lU(),k=$_(e.cwd,e.machine),f=Kl(_),P=I_({id:k.id,name:k.name,hubPort:e.hubPort,hubTokenFile:e.hubTokenFile,claudeSessionId:_,cwd:e.cwd,sub:e.sub}),ge(f,JSON.stringify({...P,...y?{codexThreadId:y}:{}}))}catch(C){return g(`codex bring-up failed: ${Do(C)}`)}return new Promise(C=>{let E=!1,D=0,W=()=>D+=1,ce=new hl({sessionId:k.id,cwd:e.cwd,steerSupported:!0,newSeq:W}),Y=!1,ke=!1,Ee=[];function z(B){if(ke){Ee.push(B);return}Vt(B)}function vt(){let B=Ee.splice(0,Ee.length);for(let ee of B){if(ee.kind!=="hub")continue;let j=ee.msg;j.type!=="prompt"&&j.type!=="command"||tt.send({type:"reply",sessionId:k.id,requestId:j.requestId,seq:W(),text:hh,final:!0})}}let tt=e_({port:e.hubPort,tokenFile:e.hubTokenFile,hello:()=>o?{type:"register",sessions:[{id:k.id,name:k.name,cwd:e.cwd,online:!0,agent:"codex"}],claudeSessionId:_}:null,onMessage:B=>z({kind:"hub",msg:B})}),Lo=pU({input:a,output:s,terminal:!!a.isTTY}),In=null;function wh(B){E||(E=!0,In&&(Qi(In),In=null),m.close(),tt.close(),Qi(p),f&&de(f),Lo.close(),C(B))}function na(B,ee){bh({hubPort:e.hubPort,tokenFile:e.hubTokenFile,path:"/local/session/state",body:{sessionId:k.id,claudeSessionId:_,cwd:e.cwd,ts:Date.now(),state:B,event:ee,agent:"codex"}})}function W_(B,ee,j){if(B===void 0)return;let Le={pct:B};ee!==void 0&&(Le.usedTokens=ee),j!==void 0&&(Le.windowTokens=j),bh({hubPort:e.hubPort,tokenFile:e.hubTokenFile,path:"/local/session/context",body:{sessionId:k.id,claudeSessionId:_,cwd:e.cwd,ts:Date.now(),agent:"codex",context:Le}})}function V_(B){y&&bh({hubPort:e.hubPort,tokenFile:e.hubTokenFile,path:"/local/session/usage",body:{sessionId:k.id,claudeSessionId:_,codexThreadId:y,cwd:e.cwd,ts:Date.now(),agent:"codex",inputTokens:B.inputTokens,cachedInputTokens:B.cachedInputTokens,outputTokens:B.outputTokens}})}function J_(){f&&ge(f,JSON.stringify({...P,...y?{codexThreadId:y}:{}}))}function Sh(B,ee){for(let j of B)switch(j.kind){case"rpc":{let Le=j.method,zo=hU(Le,j.params,y);m.request(Le,zo).then(()=>{if(Le!=="turn/steer")return;let Sr=wU(ee);Sr&&Vt({kind:"steer-ok",requestId:Sr})},Sr=>{if(Le==="turn/steer"&&Sr instanceof Yi&&Sr.code===-32601){ce.setSteerSupported(!1),Sh(ce.handle(ee),ee);return}l.render("meta",`codex error (${Le}): ${Do(Sr)}`)});break}case"rpc-respond":Y=!1,m.respond(j.id,j.result);break;case"hub-send":j.msg.type==="permission_request"&&(Y=!0),tt.send(j.msg);break;case"state-post":na(j.state,j.event);break;case"context-post":W_(j.pct,j.usedTokens,j.windowTokens);break;case"usage-post":V_(j);break;case"render":l.render(j.channel,j.text);break;case"exit":wh(0);break;default:break}}function Vt(B){Sh(ce.handle(B),B)}let xl=!1,ra,Uo=0;function _h(){Uo+=1;let B=Uo;p.on("exit",ee=>{B===Uo&&(ra=ee,kl())}),m.onClose(()=>{B===Uo&&(ra!==void 0?kl():setTimeout(()=>{B===Uo&&kl()},25))}),m.onNotification((ee,j)=>Vt({kind:"notification",method:ee,params:j})),m.onServerRequest((ee,j,Le)=>Vt({kind:"server-request",id:ee,method:j,params:Le}))}async function q_(){let B=n(t,d());In=B,B.on("error",j=>l.render("meta",`codex process error: ${Do(j)}`));let ee=vh(B.stdin,B.stdout);try{await ee.request("initialize",{clientInfo:{name:"acbridge",title:"AC Bridge",version:r}}),ee.notify("initialized",{});let j=zo=>l.render("meta",zo),Le=y?await P_(ee,e.cwd,y,j):await ta(ee,e.cwd,j);return In=null,{child:B,client:ee,threadId:Le}}catch(j){throw In=null,ee.close(),Qi(B),j}}async function K_(){let B=_U,ee=0;for(;;){if(await i(B),E)return;try{let j=await q_();if(E){j.client.close(),Qi(j.child);return}p=j.child,m=j.client,xl=!1,ra=void 0,Y=!1,_h(),j.threadId!==void 0&&j.threadId!==y&&(y=j.threadId,J_()),l.render("meta","codex reconnected \u2014 session resumed"),na("resumed","codex-adapter:respawned"),ke=!1;let Le=Ee.splice(0,Ee.length);for(let zo of Le)Vt(zo);return}catch(j){if(ee+=1,l.render("meta",`codex respawn attempt ${ee} failed: ${Do(j)}`),E)return;if(ee>=A_){na("error","codex-adapter:respawn-gave-up"),l.render("meta",`codex gave up respawning after ${A_} consecutive failed attempts \u2014 ending session`),vt(),wh(1);return}B=Math.min(B*2,$U)}}}function kl(){if(xl||E)return;xl=!0;let B=ra??null;Vt({kind:"server-exit",code:B}),l.render("meta",`codex exited unexpectedly (code ${B??"unknown"}) \u2014 attempting to respawn`),Y=!1,ke=!0,K_()}_h(),Lo.on("line",B=>{let ee=B.trim();if(Y){let j=kU(ee);if(j){Vt({kind:"local-approval",behavior:j});return}}z({kind:"local-line",text:ee})}),Lo.on("SIGINT",()=>Vt({kind:"sigint"})),Lo.on("close",()=>{E||Vt({kind:"teardown"})}),na("started","codex-adapter:started")})}function TU(e){let t={hold:e.includes("--hold"),agent:"claude",resume:e.includes("--resume")},r=e.indexOf("--agent");if(r>=0){let o=e[r+1];o==="claude"||o==="codex"?t.agent=o:t.bad=`invalid --agent: ${o??"(none)"} (use claude | codex)`}return!t.bad&&t.resume&&t.agent!=="codex"&&(t.bad="--resume requires --agent codex"),t}function RU(e,t,r){let o={...r,BRIDGE_SESSION_ID:t.sessionId,BRIDGE_SESSION_NAME:t.sessionName,BRIDGE_HUB_PORT:String(t.hubPort)};return delete o.ELECTRON_RUN_AS_NODE,{file:e.file,args:[...e.argsPrefix,"--session-id",t.claudeSessionId,"--channels","plugin:alexa@bridge"],env:o}}function OU(e){let{sub:t,...r}=e;return{...r,voice:!0,...t?{sub:t}:{}}}async function DU(){h("[bridge] session closed \u2014 press Enter to exit\u2026"),await new Promise(e=>{let t=CU({input:process.stdin,output:process.stdout});t.question("",()=>{t.close(),e()})})}var T_="https://github.com/openai/codex#install";function NU(e){return R_(e.file,[...e.argsPrefix,"--version"],{encoding:"utf8",timeout:5e3}).status===0}function LU(e={}){let t;try{t=(e.resolveCodex??Ar)()}catch{return{ok:!1,message:`codex CLI not found \u2014 install it: ${T_}`}}return(e.probeCodex??NU)(t)?(e.codexLoggedIn??fa)()?{ok:!0,codexCmd:t}:{ok:!1,message:"Run `codex login` first."}:{ok:!1,message:`codex CLI not found \u2014 install it: ${T_}`}}async function O_(e=[],t={}){let r=TU(e);if(r.bad)return b(r.bad),2;if(!(t.voice??et()))return b("voice sessions are turned off in this build."),h("Your devices and Profiles are unaffected \u2014 `acbridge start` keeps the bridge running."),h(`Launch the agent yourself in this folder: \`${r.agent}\` \u2014 its hooks still drive your Profiles.`),1;let{hold:o,agent:n}=r,i=ne(),a=t.preflightAccount??xo,s=t.ensureFreshToken??Tt,l=t.ensureHub??it,u=t.hubRelease??Tc,d=t.readActiveUser??$e,p=t.holdForEnter??DU,m=await a();if(!m.ok)return b(m.message),m.exitCode;await s(i.relayUrl);let{holderId:f}=await l({kind:"run"});if(n==="codex"){let z=!1,vt=async()=>{if(!z&&(z=!0,f))try{await u(f)}catch{}};process.once("SIGINT",()=>{vt()}),process.once("SIGTERM",()=>{vt()});let tt=(t.codexPreflight??LU)();if(!tt.ok)return b(tt.message),await vt(),1;h(`Launching Codex with the Alexa channel \u2014 cwd: ${process.cwd()}`);let In=await(t.runCodexAdapter??C_)({cwd:process.cwd(),machine:i.machine,hubPort:i.hubPort,hubTokenFile:pg(),sub:d()?.sub,codexCmd:tt.codexCmd,clientVersion:Ct()??void 0,voice:!0,resume:r.resume});return await vt(),o&&await p(),In}for(let z of Oc({...t.ensurePluginInstalled?{ensurePluginInstalled:t.ensurePluginInstalled}:{},...t.ensureStatusline?{ensureStatusline:t.ensureStatusline}:{}}))(z.level==="info"?h:U)(z.message);let g=vl.basename(process.cwd())||"session",y=`${g}@${i.machine}`,k=`${g} (${i.machine})`,_=IU(),P=vl.join(M,"sessions");AU(P,{recursive:!0});let C=vl.join(P,`${_}.json`),E=process.cwd(),D=vl.join(PU.homedir(),".claude","projects",E.replace(/[^A-Za-z0-9]/g,"-"),`${_}.jsonl`),W=pg();EU(C,JSON.stringify(OU({id:y,name:k,hubPort:i.hubPort,hubTokenFile:W,claudeSessionId:_,transcriptPath:D,cwd:E,sub:d()?.sub})),{mode:384});let ce=!1,Y=async()=>{if(!ce&&(ce=!0,de(C),f))try{await u(f)}catch{}};process.once("SIGINT",()=>{Y()}),process.once("SIGTERM",()=>{Y()}),h(`Launching Claude with the Alexa channel \u2014 session: ${y}`);let ke=RU((t.resolveClaude??Yt)(),{sessionId:y,claudeSessionId:_,sessionName:k,hubPort:i.hubPort},process.env),Ee=R_(ke.file,ke.args,{stdio:"inherit",env:ke.env});return await Y(),o&&await p(),Ee.status??0}var UU="Usage: acbridge scan [--json] [--timeout <seconds>]",zU=1e3,jU=e=>Bk(e);function FU(e){let t={json:!1,timeoutMs:3e4};for(let r=0;r<e.length;r++){let o=e[r];if(o==="--json")t.json=!0;else if(o==="--timeout"||o?.startsWith("--timeout=")){let n=o==="--timeout"?e[++r]:o.slice(10),i=Number(n);!Number.isFinite(i)||i<=0?t.bad=`invalid --timeout: ${n??"(none)"}`:t.timeoutMs=Math.min(120,Math.max(5,Math.round(i)))*1e3}else t.bad=`unknown option: ${o??""}`}return t}async function U_(e){let t=FU(e);if(t.bad)return b(t.bad),h(UU),2;if(t.json&&ye(!0),!await Te()){let i=Mn();if(!i.ok)return b(i.message),3;if(t.json)return b(Ne()),1;try{await it({kind:"cli"})}catch(a){return b(`couldn't start the hub: ${a.message}`),h("check ~/.claude-bridge/hub.log, or start it yourself with `acbridge daemon` and re-run"),1}}let r=await G("/local/scan",{method:"POST"});if(r.hubOffline)return b(Ne()),1;if(r.status!==200||!r.body?.scanId)return b(`hub answered HTTP ${r.status} starting the scan \u2014 token mismatch? restart the hub`),1;let{session:o,expired:n}=await BU(r.body.scanId,t);return o?t.json?(console.log(JSON.stringify(o)),o.status==="failed"?1:0):(n&&h(Se("(scan session expired mid-poll \u2014 showing the hub's last-known devices)")),o.status==="failed"?(b(`scan failed: ${o.error??"unknown error"}`),1):(o.status==="running"&&U("scan still running at --timeout \u2014 showing partial results (re-run `acbridge scan` for the final list)"),WU(o.devices,o.env,o.accountDevices),await qU(o.devices),0)):(b(Ne()),1)}async function BU(e,t){let r=Date.now()+t.timeoutMs,o=!t.json&&process.stdout.isTTY,n=null;!t.json&&!o&&h("scanning\u2026");try{for(;;){let i=await G(`/local/scan/${e}`);if(i.hubOffline)return{session:n,expired:!1};if(i.status===404){let a=await G("/local/discovered");return a.status===200&&a.body?{session:MU(e,a.body),expired:!0}:{session:n,expired:!0}}if(i.status===200&&i.body&&(n=i.body,o&&process.stdout.write(`\r\u2022 scanning\u2026 ${n.devices.length} device(s) found`),n.status!=="running"))return{session:n,expired:!1};if(Date.now()>=r)return{session:n,expired:!1};await new Promise(a=>setTimeout(a,zU))}}finally{o&&process.stdout.write("\r\x1B[2K")}}var MU=(e,t)=>({id:e,status:"done",startedAt:t.updatedAt,finishedAt:t.updatedAt,devices:t.devices,...t.accountDevices?{accountDevices:t.accountDevices}:{},env:t.env}),HU={ready:0,ecosystems:1,"needs-setup":2,unidentified:3,infrastructure:4},ZU={ready:"Ready",ecosystems:"Link account","needs-setup":"Needs setup",unidentified:"Unknown",infrastructure:"Infrastructure"};function D_(e){return HU[vo(e)]}function GU(e){return ZU[vo(e)]}function yl(e){let t=[e.identity.manufacturer,e.identity.model].filter(Boolean).join(" ");return e.identity.name??(t||e.identity.hint||e.addresses.hostname||e.addresses.ip)}function N_(e){if(e.alreadyLinked)return`connected \u2713 (via ${e.alreadyLinked.provider})`;if(e.bucket==="connect-now"&&e.localProtocol)return`acbridge connect ${e.discoveredId}`;if(e.bucket==="link-ecosystem"){let t=e.suggestedProvider;return t==="homeassistant"?"acbridge link home-assistant":t==="mqtt"?`acbridge link mqtt --host ${e.addresses.ip}`:t==="hue"||t==="smartthings"?`acbridge link ${t}`:"link via the app"}return"\u2014"}function L_(e){let t=VU(e);if(t.length!==0){h(""),h(Se(t[0]));for(let r of t.slice(1))h(r)}}function WU(e,t,r){let o=Uk(t);if(o&&t.interop==="windows-arp"?U("WSL detected \u2014 mDNS/broadcast limited; using the Windows neighbor table for ARP discovery"):o&&t.wsl?U("WSL detected \u2014 LAN scan degraded (mDNS/broadcast limited); results may be incomplete"):o&&U("multicast self-test failed \u2014 mDNS results may be missing"),e.length===0){o&&t.wsl?h("0 devices found \u2014 expected to be incomplete under WSL (see `acbridge doctor`)."):o?h("0 devices found \u2014 the multicast self-test failed, so this scan is expected to be incomplete (see `acbridge doctor`)."):zk(t,e.length)?h(`No devices found. ${jk}`):h("No devices found. Devices must be on the same network/VLAN; Wi-Fi isolation limits discovery."),L_(r);return}let n=[...e].sort((m,f)=>D_(m)-D_(f)||yl(m).localeCompare(yl(f))),i=n.map(m=>[z_(yl(m),28),m.expectedType??"\u2014",m.addresses.ip,m.addresses.mac??"\u2014",GU(m),N_(m)]),a=["NAME","TYPE","IP","MAC","STATUS","ACTION"],s=a.map((m,f)=>Math.max(m.length,...i.map(g=>g[f].length))),l=m=>m.map((f,g)=>f.padEnd(s[g])).join(" ").trimEnd();h(Se(l(a)));for(let m of i)h(l(m));h("");let u=new Map;for(let m of n)u.set(vo(m),(u.get(vo(m))??0)+1);let d=[["ready","ready"],["ecosystems","ecosystem"],["needs-setup","need setup"],["unidentified","unidentified"],["infrastructure","infrastructure"]].map(([m,f])=>u.get(m)?`${u.get(m)} ${f}`:null).filter(m=>m!==null);h(`${e.length} device(s)${d.length>0?` \u2014 ${d.join(" \xB7 ")}`:""}`);let p=n.filter(m=>m.identity.hint!==void 0&&N_(m)==="\u2014"&&vo(m)!=="unidentified");if(p.length>0){h(""),h(Se("Notes:"));for(let m of p)h(` \u2022 ${yl(m)} (${m.addresses.ip}): ${m.identity.hint}`)}L_(r)}var z_=(e,t)=>e.length>t?`${e.slice(0,t-1)}\u2026`:e;function VU(e){let t=e??[];if(t.length===0)return[];let r=[`Known from your accounts (${t.length}):`];for(let o of t){let n=o.state==="cloud"?`added \u2014 reads over the ${o.provider} cloud, so it never appears in a scan`:`in your ${o.provider} account \u2014 not seen on this network`;r.push(` \u2022 ${JU(o)}: ${n}`)}return r}var JU=e=>z_(e.name,40);async function qU(e){if(!e.some(jU))return;let t=await G("/local/config");t.status!==200||t.body?.autoConnect!=="unset"||(h(""),A("Tip: `acbridge connect --auto on` auto-connects open-protocol lights/plugs (never locks, cameras, or doors)."))}import{existsSync as XU}from"node:fs";import{dirname as YU}from"node:path";function KU(e=M){return ka(Tr(Rr(e)))}function bl(e){return Ev(Nr,{home:e?.home,configFile:e?.configFile,env:e?.env,nodeCommand:e?.nodeCommand??KU(e?.bridgeDir)})}function QU(e){return e?"Setup complete. Run `acbridge run` in any project to start a voice-driven session.":"Setup complete. `acbridge start` runs the bridge; launch `claude` in any project \u2014 its hooks drive your Profiles."}async function j_(e={}){let t=e.installPlugin??Rc,r=e.applyManaged??Sw,o=e.applyFirewall??(()=>xw()),n=e.ensureStatusline??bo,i=e.ensureCodexHooks??bl,a=e.voice??et(),s=(e.codexInstalled??(()=>XU(YU(xa()))))(),l=(e.claudeInstalled??da)();if(h(a?`Setting up the Alexa bridge on this machine\u2026
|
|
273
273
|
`:`Setting up AC Bridge on this machine\u2026
|
|
274
|
-
`),l)try{
|
|
275
|
-
${u.manualCommand}`)):(A(u.changed?"firewall rule added":"firewall rule already present"),u.userNote&&h(u.userNote))}catch(u){U(`firewall rule skipped: ${u.message}`)}try{
|
|
274
|
+
`),l)try{X("installing the alexa@bridge plugin (bound to this install)");let u=t();A(u.marketplaceRepointed?"plugin marketplace re-pointed to this install + installed":u.pluginReinstalled?"plugin refreshed from this install":"plugin already current")}catch(u){if(!s)return b(`plugin install failed: ${u.message}`),1;U(`plugin install skipped (${u.message}) \u2014 no Claude Code here; continuing for Codex.`)}else{let u=la(process.platform).manualCommand;if(!s)return b(`no coding agent found \u2014 setup wires the Claude Code plugin and Codex hooks. Install Claude Code (\`${u}\`) or Codex, then re-run \`acbridge setup\`. Device control works without either.`),1;U(`plugin install skipped (claude CLI not found \u2014 install it: ${u}) \u2014 no Claude Code here; continuing for Codex.`)}try{X(a?`allowlisting the channel in ${Xn()}`:`checking managed settings in ${Xn()}`);let u=r();u.replacedDefaultAllowlist&&U("allowedChannelPlugins was unset \u2014 setting it REPLACES Anthropic's default channel list. If you also use Telegram/Discord channels, add them to the managed-settings file too."),A(u.changed?`managed settings written${u.usedSudo?" (via sudo)":""}`:"managed settings already current")}catch(u){if(!s)return b(`managed settings: ${u.message}`),h("Write it manually if needed \u2014 `acbridge doctor` prints the exact path + expected JSON."),1;U(`managed settings skipped (${u.message}) \u2014 not needed for Codex-only.`)}try{X("adding the LAN device-scan firewall rule");let u=o();u.status==="nothing-to-do"?A("no active firewall detected \u2014 nothing to add"):u.status==="needs-elevation"?(U("firewall rule not applied (declined or unavailable)."),u.manualCommand&&h(`Run it manually if device scanning misses devices:
|
|
275
|
+
${u.manualCommand}`)):(A(u.changed?"firewall rule added":"firewall rule already present"),u.userNote&&h(u.userNote))}catch(u){U(`firewall rule skipped: ${u.message}`)}try{X("installing the statusline tee (context + usage readings)");let u=n();A(u.enabled?u.changed?"statusline tee installed (any existing statusline is chained)":"statusline tee already current":"statusline tee disabled by config \u2014 skipped")}catch(u){U(`statusline tee skipped: ${u.message}`)}try{X("installing Codex hooks (session-state signals for OpenAI Codex CLI)");let u=i();u.skipped?A("Codex not detected (no ~/.codex) \u2014 hooks skipped"):u.corrupt?U("~/.codex/hooks.json is unparseable \u2014 fix or delete it, then re-run setup."):u.enabled?u.changed?(A("Codex hooks installed (any existing hooks are preserved)"),h("Codex hooks installed \u2014 run /hooks once inside Codex to review and trust the AC Bridge hook.")):A("Codex hooks already current"):A("Codex hooks disabled by config \u2014 skipped")}catch(u){U(`Codex hooks skipped: ${u.message}`)}return h(""),A(QU(a)),0}function ez(e){return e.voice&&e.hubUp&&e.signedIn}function tz(e){let t=[`relay: ${e.relayUrl}`,`machine: ${e.machine}`,`version: ${e.version??"dev"}`,`signed in: ${e.signedIn?e.paired?"yes (paired)":"yes":"no"}`,`hub: ${e.hubUp?"running":"stopped"}`];if(e.update&&t.push(`update: ${e.update.latest} available (you have ${e.version??"dev"})`),e.accountMismatch&&t.push("account: signed-in account does not match this machine's credential \u2014 run `acbridge logout` then `acbridge login`"),e.daemonPid!==void 0&&t.push(`daemon: running (pid ${e.daemonPid})`),e.relayLink&&t.push(`relay link: ${e.relayLink.connected?"connected":e.relayLink.code===4426?"refused \u2014 app update required":"down"}`),e.session&&t.push(e.session.active?`session: active \u2014 ${[e.session.owner?`owner ${e.session.owner}`:null,`${e.session.touched} touched`,e.session.revertOnStop?"revert on stop":"no revert"].filter(Boolean).join(", ")}`:"session: none"),e.sessions!==null&&t.push(`sessions: ${e.sessions}`),e.entitlement&&(t.push(`plan: ${e.entitlement.plan}`),t.push(`capture: telemetry=${e.entitlement.capture.telemetry} transcripts=${e.entitlement.capture.transcripts}`)),e.signedIn)if(e.entitlementFile==="absent")t.push("entitlement file: absent (capture off, fail-closed)");else if(e.entitlementFile==="unreadable")t.push("entitlement file: unreadable (capture off, fail-closed)");else{let n=e.entitlementFile.ageHours;t.push(`entitlement file: ${n.toFixed(1)}h old (${n<=24?"fresh":"STALE \u2014 capture off, fail-closed"})`)}let r;if(e.sessions!==null)try{r=JSON.parse(e.sessions)}catch{r=e.sessions}let o={relayUrl:e.relayUrl,machine:e.machine,version:e.version??"dev",...e.update?{updateAvailable:!0,latestVersion:e.update.latest}:{},signedIn:e.signedIn,paired:e.paired,hub:e.hubUp?"running":"stopped",...e.accountMismatch?{accountMismatch:!0}:{},...e.daemonPid!==void 0?{daemonPid:e.daemonPid}:{},...e.relayLink?{relayLink:e.relayLink}:{},...e.session?{session:e.session}:{},...e.sessions!==null?{sessions:r}:{},...e.entitlement?{plan:e.entitlement.plan,capture:e.entitlement.capture}:{},...typeof e.entitlementFile=="object"?{entitlementFile:{ageHours:e.entitlementFile.ageHours,fresh:e.entitlementFile.ageHours<=24}}:{}};return{lines:t,exitCode:e.hubUp?0:1,json:o}}async function F_(e=[]){let t=e.includes("--json");t&&ye(!0);let r=ne(),o=Pn(),n=o.state==="ok"?o.token:"",i=!!n,a=o.state==="mismatch",s=!!O(ve().refreshFile)?.trim(),l=await Te(),u=ez({voice:et(),hubUp:l,signedIn:i}),d=u?await my(n):null;u&&d===null&&U("could not reach the relay /sessions endpoint");let p=i?await Ot(n):null,m=p?{plan:p.plan,capture:{telemetry:p.capture.telemetry,transcripts:p.capture.transcripts}}:null,f="absent",g=i?kt():null,y=g?O(g.entitlementFile):null;if(y)try{let z=JSON.parse(y);f={ageHours:(Date.now()-(z.fetchedAt??0))/36e5}}catch{f="unreadable"}let k=O(Je),_=k?Number(k):0,P=_>0&&yo({pid:_})?_:void 0,C,E=O(sy);if(l&&E)try{let z=JSON.parse(E);typeof z.connected=="boolean"&&(C={connected:z.connected,...typeof z.code=="number"?{code:z.code}:{}})}catch{}let D=Bn(),W=D.version,ce=zi(W,Lc(),process.platform,D.channel??"app"),Y=ce.state==="update"?{latest:ce.latest}:void 0,ke;if(l){let z=await G("/local/session",{method:"GET",timeoutMs:3e3});!z.hubOffline&&z.status===200&&z.body&&(ke={active:z.body.active,...z.body.owner?{owner:z.body.owner}:{},touched:z.body.touched,revertOnStop:z.body.revertOnStop})}let Ee=tz({relayUrl:r.relayUrl,machine:r.machine,version:W,...Y?{update:Y}:{},signedIn:i,paired:s,hubUp:l,sessions:d,entitlement:m,entitlementFile:f,...a?{accountMismatch:!0}:{},...P!==void 0?{daemonPid:P}:{},...C?{relayLink:C}:{},...ke?{session:ke}:{}});if(t)he(Ee.json);else for(let z of Ee.lines)h(z);return Ee.exitCode}import{rmSync as nz}from"node:fs";import{createInterface as rz}from"node:readline/promises";var B_="Usage: acbridge uninstall [--purge | --keep-account] [--json]",oz=new Set(["--purge","--keep-account","--json"]);async function M_(e=[],t={}){let r=e.filter(p=>!oz.has(p));if(r.length>0)return b(`unknown option: ${r[0]}`),h(B_),2;let o=e.includes("--purge"),n=e.includes("--keep-account");if(o&&n)return b("--purge and --keep-account are opposites \u2014 pick one"),h(B_),2;let i=e.includes("--json");i&&ye(!0);let a={},s=async(p,m,f)=>{X(m);try{await f(),a[p]="ok"}catch(g){a[p]="failed",U(`${m} failed (${g.message}) \u2014 continuing`)}};await s("stop","stopping the bridge (devices revert)\u2026",()=>(t.stopBridge??Gn)([])),await s("statusline","restoring your Claude Code statusline\u2026",()=>(t.restoreStatusline??(()=>bo({env:{...process.env,BRIDGE_STATUSLINE:"0"}})))()),await s("codex","removing the Codex hooks\u2026",()=>(t.removeCodexHooks??(()=>bl({env:{...process.env,BRIDGE_CODEX_HOOKS:"0"}})))()),(t.claudeInstalled??da)()?await s("plugin","removing the Claude Code plugin + marketplace\u2026",()=>(t.removePlugin??c0)()):(a.plugin="skipped",h("no Claude Code here \u2014 plugin removal skipped")),await s("firewall","removing the LAN-discovery firewall rule\u2026",()=>{let p=(t.removeFirewall??kw)();p.status==="needs-elevation"&&p.manualCommand&&U(`couldn't remove the firewall rule without elevation \u2014 run it yourself:
|
|
276
|
+
${p.manualCommand}`)});let l=!1,u=!1;if(!n){let p=o;if(!p)if(t.isTTY??!!(process.stdin.isTTY&&process.stdout.isTTY)){let g=(await(t.ask??(async y=>{let k=rz({input:process.stdin,output:process.stdout});try{return await k.question(y)}finally{k.close()}}))("Sign out and delete this machine's account data (credentials, provider keys, device configs, logs)? [y/N] ")).trim().toLowerCase();p=g==="y"||g==="yes"}else h("keeping account data (non-interactive) \u2014 pass --purge to remove everything, --keep-account to silence this");p&&(await s("signOut","signing out (revokes this machine at the relay)\u2026",()=>(t.signOut??el)([])),l=a.signOut==="ok",o&&(await s("purgeHome","deleting the AC Bridge home (100% fresh next install)\u2026",()=>(t.purgeHome??(()=>nz(M,{recursive:!0,force:!0})))()),u=a.purgeHome==="ok"))}let d=Object.entries(a).filter(([,p])=>p==="failed").map(([p])=>p);return d.length===0?A("AC Bridge is unwired from this machine."):U(`unwired with issues (${d.join(", ")}) \u2014 see above`),h("finish with: npm uninstall -g acbridge"),i&&he({steps:a,signedOut:l,purged:u}),0}var iz=["tuya","meross","ewelink","nanoleaf","govee","esphome"];async function H_(e){let t=e[0];if(t===void 0||!$c.safeParse(t).success)return b(`usage: acbridge unlink <${iz.join(" | ")}>`),2;let r=await G(`/local/${t}/unlink`,{method:"POST"});return r.hubOffline?(b(Ne()),1):r.status===200&&r.body?.ok?(A(`removed the ${t} account \u2014 its keys and devices are gone from this machine`),r.body.note&&h(r.body.note),0):(b(r.body?.error??`hub answered HTTP ${r.status}`),1)}function No(e){return`${e?"acbridge \u2014 voice-driven Claude Code, on any machine":"acbridge \u2014 the AC Bridge companion CLI: bridge, devices, and profiles from any terminal"}
|
|
276
277
|
|
|
277
278
|
Usage: acbridge <command>
|
|
278
279
|
|
|
@@ -282,6 +283,9 @@ Commands:
|
|
|
282
283
|
--no-browser prints the URL to open on THIS machine; --if-needed exits 0 when
|
|
283
284
|
already signed in)
|
|
284
285
|
logout [--json] Sign out: stop the bridge + revoke this machine's credential
|
|
286
|
+
uninstall [--purge | --keep-account] [--json]
|
|
287
|
+
Unwire this machine (agent hooks, plugin, firewall) before \`npm uninstall -g acbridge\`;
|
|
288
|
+
--purge deletes ALL AC Bridge data so the next install starts 100% fresh
|
|
285
289
|
whoami [--json] Show the signed-in account, machine, relay, and plan
|
|
286
290
|
start [--no-revert] [--attach] [--json]
|
|
287
291
|
Start the bridge like the app's Start button (detached; lights revert on stop)
|
|
@@ -312,6 +316,6 @@ ${e?" setup One-time: install the channel plugin + allowlist it (manag
|
|
|
312
316
|
|
|
313
317
|
Exit codes: 0 ok \xB7 1 failure \xB7 2 usage error \xB7 3 not signed in (run \`acbridge pair\` or use the app)
|
|
314
318
|
\xB7 4 update required (below the minimum supported version) \xB7 5 no active subscription (ac-bridge.com/home)
|
|
315
|
-
`}function
|
|
319
|
+
`}function Z_(e){return e.some(t=>t==="-h"||t==="--help")}function G_(e,t){let r=No(t).split(`
|
|
316
320
|
`),o=new RegExp(`^ {2}${e.replace(/[.*+?^${}()|[\]\\-]/g,"\\$&")}(?=\\s|$)`),n=r.findIndex(a=>o.test(a));if(n===-1)return null;let i=[r[n]];for(let a of r.slice(n+1)){if(a.trim()===""||/^ {2}\S/.test(a))break;i.push(a)}return i.join(`
|
|
317
|
-
`).trimEnd()}async function
|
|
321
|
+
`).trimEnd()}async function az(){try{ry()}catch(r){b(`archiveLegacyUserState() failed (non-fatal): ${r instanceof Error?r.message:String(r)}`)}let[,,e,...t]=process.argv;if(e&&Z_(t)){let r=et();return h(G_(e,r)??No(r)),0}switch(e){case"login":return Mw(t);case"logout":return el(t);case"whoami":return Yc(t);case"start":return tl(t);case"restart":return qw(t);case"run":return O_(t);case"setup":return j_();case"uninstall":return M_(t);case"pair":return Hw(t);case"link":return Uw(t);case"unlink":return H_(t);case"devices":return k0(t);case"profiles":return Gw(t);case"integrations":return Iw(t);case"rename":return Ww(t);case"scan":return U_(t);case"connect":return a0(t);case"daemon":return zc(t);case"stop":return Gn(t);case"status":return F_(t);case"capture":return wy(t);case"doctor":return $w();case"--version":case"-V":return h(Bn().version??"dev (unversioned)"),0;case void 0:case"-h":case"--help":case"help":return h(No(et())),0;default:return b(`unknown command: ${e}`),h(No(et())),2}}az().then(e=>process.exit(e),e=>{b(e instanceof Error?e.message:String(e)),process.exit(1)});
|