diff --git a/ui/dist/assets/index-CSdX68Da.js b/ui/dist/assets/index-BRoqOo1T.js similarity index 99% rename from ui/dist/assets/index-CSdX68Da.js rename to ui/dist/assets/index-BRoqOo1T.js index 354c9bc7..877b167e 100644 --- a/ui/dist/assets/index-CSdX68Da.js +++ b/ui/dist/assets/index-BRoqOo1T.js @@ -281,4 +281,4 @@ Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/js JSZip uses the library pako released under the MIT license : https://github.com/nodeca/pako/blob/main/LICENSE */(function(e,t){(function(r){e.exports=r()})(function(){return function r(n,s,i){function o(u,d){if(!s[u]){if(!n[u]){var f=typeof uu=="function"&&uu;if(!d&&f)return f(u,!0);if(a)return a(u,!0);var g=new Error("Cannot find module '"+u+"'");throw g.code="MODULE_NOT_FOUND",g}var h=s[u]={exports:{}};n[u][0].call(h.exports,function(y){var m=n[u][1][y];return o(m||y)},h,h.exports,r,n,s,i)}return s[u].exports}for(var a=typeof uu=="function"&&uu,l=0;l>2,h=(3&u)<<4|d>>4,y=1<_?(15&d)<<2|f>>6:64,m=2<_?63&f:64,w.push(a.charAt(g)+a.charAt(h)+a.charAt(y)+a.charAt(m));return w.join("")},s.decode=function(l){var u,d,f,g,h,y,m=0,w=0,v="data:";if(l.substr(0,v.length)===v)throw new Error("Invalid base64 input, it looks like a data url.");var p,_=3*(l=l.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(l.charAt(l.length-1)===a.charAt(64)&&_--,l.charAt(l.length-2)===a.charAt(64)&&_--,_%1!=0)throw new Error("Invalid base64 input, bad content length.");for(p=o.uint8array?new Uint8Array(0|_):new Array(0|_);m>4,d=(15&g)<<4|(h=a.indexOf(l.charAt(m++)))>>2,f=(3&h)<<6|(y=a.indexOf(l.charAt(m++))),p[w++]=u,h!==64&&(p[w++]=d),y!==64&&(p[w++]=f);return p}},{"./support":30,"./utils":32}],2:[function(r,n,s){var i=r("./external"),o=r("./stream/DataWorker"),a=r("./stream/Crc32Probe"),l=r("./stream/DataLengthProbe");function u(d,f,g,h,y){this.compressedSize=d,this.uncompressedSize=f,this.crc32=g,this.compression=h,this.compressedContent=y}u.prototype={getContentWorker:function(){var d=new o(i.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),f=this;return d.on("end",function(){if(this.streamInfo.data_length!==f.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),d},getCompressedWorker:function(){return new o(i.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},u.createWorkerFrom=function(d,f,g){return d.pipe(new a).pipe(new l("uncompressedSize")).pipe(f.compressWorker(g)).pipe(new l("compressedSize")).withStreamInfo("compression",f)},n.exports=u},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(r,n,s){var i=r("./stream/GenericWorker");s.STORE={magic:"\0\0",compressWorker:function(){return new i("STORE compression")},uncompressWorker:function(){return new i("STORE decompression")}},s.DEFLATE=r("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(r,n,s){var i=r("./utils"),o=function(){for(var a,l=[],u=0;u<256;u++){a=u;for(var d=0;d<8;d++)a=1&a?3988292384^a>>>1:a>>>1;l[u]=a}return l}();n.exports=function(a,l){return a!==void 0&&a.length?i.getTypeOf(a)!=="string"?function(u,d,f,g){var h=o,y=g+f;u^=-1;for(var m=g;m>>8^h[255&(u^d[m])];return-1^u}(0|l,a,a.length,0):function(u,d,f,g){var h=o,y=g+f;u^=-1;for(var m=g;m>>8^h[255&(u^d.charCodeAt(m))];return-1^u}(0|l,a,a.length,0):0}},{"./utils":32}],5:[function(r,n,s){s.base64=!1,s.binary=!1,s.dir=!1,s.createFolders=!0,s.date=null,s.compression=null,s.compressionOptions=null,s.comment=null,s.unixPermissions=null,s.dosPermissions=null},{}],6:[function(r,n,s){var i=null;i=typeof Promise<"u"?Promise:r("lie"),n.exports={Promise:i}},{lie:37}],7:[function(r,n,s){var i=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",o=r("pako"),a=r("./utils"),l=r("./stream/GenericWorker"),u=i?"uint8array":"array";function d(f,g){l.call(this,"FlateWorker/"+f),this._pako=null,this._pakoAction=f,this._pakoOptions=g,this.meta={}}s.magic="\b\0",a.inherits(d,l),d.prototype.processChunk=function(f){this.meta=f.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(u,f.data),!1)},d.prototype.flush=function(){l.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},d.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this._pako=null},d.prototype._createPako=function(){this._pako=new o[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var f=this;this._pako.onData=function(g){f.push({data:g,meta:f.meta})}},s.compressWorker=function(f){return new d("Deflate",f)},s.uncompressWorker=function(){return new d("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(r,n,s){function i(h,y){var m,w="";for(m=0;m>>=8;return w}function o(h,y,m,w,v,p){var _,C,E=h.file,j=h.compression,R=p!==u.utf8encode,D=a.transformTo("string",p(E.name)),P=a.transformTo("string",u.utf8encode(E.name)),L=E.comment,q=a.transformTo("string",p(L)),T=a.transformTo("string",u.utf8encode(L)),F=P.length!==E.name.length,b=T.length!==L.length,W="",te="",$="",Z=E.dir,I=E.date,Q={crc32:0,compressedSize:0,uncompressedSize:0};y&&!m||(Q.crc32=h.crc32,Q.compressedSize=h.compressedSize,Q.uncompressedSize=h.uncompressedSize);var z=0;y&&(z|=8),R||!F&&!b||(z|=2048);var V=0,de=0;Z&&(V|=16),v==="UNIX"?(de=798,V|=function(se,Pe){var fe=se;return se||(fe=Pe?16893:33204),(65535&fe)<<16}(E.unixPermissions,Z)):(de=20,V|=function(se){return 63&(se||0)}(E.dosPermissions)),_=I.getUTCHours(),_<<=6,_|=I.getUTCMinutes(),_<<=5,_|=I.getUTCSeconds()/2,C=I.getUTCFullYear()-1980,C<<=4,C|=I.getUTCMonth()+1,C<<=5,C|=I.getUTCDate(),F&&(te=i(1,1)+i(d(D),4)+P,W+="up"+i(te.length,2)+te),b&&($=i(1,1)+i(d(q),4)+T,W+="uc"+i($.length,2)+$);var ne="";return ne+=` -\0`,ne+=i(z,2),ne+=j.magic,ne+=i(_,2),ne+=i(C,2),ne+=i(Q.crc32,4),ne+=i(Q.compressedSize,4),ne+=i(Q.uncompressedSize,4),ne+=i(D.length,2),ne+=i(W.length,2),{fileRecord:f.LOCAL_FILE_HEADER+ne+D+W,dirRecord:f.CENTRAL_FILE_HEADER+i(de,2)+ne+i(q.length,2)+"\0\0\0\0"+i(V,4)+i(w,4)+D+W+q}}var a=r("../utils"),l=r("../stream/GenericWorker"),u=r("../utf8"),d=r("../crc32"),f=r("../signature");function g(h,y,m,w){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=y,this.zipPlatform=m,this.encodeFileName=w,this.streamFiles=h,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(g,l),g.prototype.push=function(h){var y=h.meta.percent||0,m=this.entriesCount,w=this._sources.length;this.accumulate?this.contentBuffer.push(h):(this.bytesWritten+=h.data.length,l.prototype.push.call(this,{data:h.data,meta:{currentFile:this.currentFile,percent:m?(y+100*(m-w-1))/m:100}}))},g.prototype.openedSource=function(h){this.currentSourceOffset=this.bytesWritten,this.currentFile=h.file.name;var y=this.streamFiles&&!h.file.dir;if(y){var m=o(h,y,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:m.fileRecord,meta:{percent:0}})}else this.accumulate=!0},g.prototype.closedSource=function(h){this.accumulate=!1;var y=this.streamFiles&&!h.file.dir,m=o(h,y,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(m.dirRecord),y)this.push({data:function(w){return f.DATA_DESCRIPTOR+i(w.crc32,4)+i(w.compressedSize,4)+i(w.uncompressedSize,4)}(h),meta:{percent:100}});else for(this.push({data:m.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},g.prototype.flush=function(){for(var h=this.bytesWritten,y=0;y=this.index;l--)u=(u<<8)+this.byteAt(l);return this.index+=a,u},readString:function(a){return i.transformTo("string",this.readData(a))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var a=this.readInt(4);return new Date(Date.UTC(1980+(a>>25&127),(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1))}},n.exports=o},{"../utils":32}],19:[function(r,n,s){var i=r("./Uint8ArrayReader");function o(a){i.call(this,a)}r("../utils").inherits(o,i),o.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=o},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(r,n,s){var i=r("./DataReader");function o(a){i.call(this,a)}r("../utils").inherits(o,i),o.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+a)},o.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero},o.prototype.readAndCheckSignature=function(a){return a===this.readData(4)},o.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=o},{"../utils":32,"./DataReader":18}],21:[function(r,n,s){var i=r("./ArrayReader");function o(a){i.call(this,a)}r("../utils").inherits(o,i),o.prototype.readData=function(a){if(this.checkOffset(a),a===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=o},{"../utils":32,"./ArrayReader":17}],22:[function(r,n,s){var i=r("../utils"),o=r("../support"),a=r("./ArrayReader"),l=r("./StringReader"),u=r("./NodeBufferReader"),d=r("./Uint8ArrayReader");n.exports=function(f){var g=i.getTypeOf(f);return i.checkSupport(g),g!=="string"||o.uint8array?g==="nodebuffer"?new u(f):o.uint8array?new d(i.transformTo("uint8array",f)):new a(i.transformTo("array",f)):new l(f)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(r,n,s){s.LOCAL_FILE_HEADER="PK",s.CENTRAL_FILE_HEADER="PK",s.CENTRAL_DIRECTORY_END="PK",s.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",s.ZIP64_CENTRAL_DIRECTORY_END="PK",s.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(r,n,s){var i=r("./GenericWorker"),o=r("../utils");function a(l){i.call(this,"ConvertWorker to "+l),this.destType=l}o.inherits(a,i),a.prototype.processChunk=function(l){this.push({data:o.transformTo(this.destType,l.data),meta:l.meta})},n.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(r,n,s){var i=r("./GenericWorker"),o=r("../crc32");function a(){i.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}r("../utils").inherits(a,i),a.prototype.processChunk=function(l){this.streamInfo.crc32=o(l.data,this.streamInfo.crc32||0),this.push(l)},n.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(r,n,s){var i=r("../utils"),o=r("./GenericWorker");function a(l){o.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}i.inherits(a,o),a.prototype.processChunk=function(l){if(l){var u=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=u+l.data.length}o.prototype.processChunk.call(this,l)},n.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(r,n,s){var i=r("../utils"),o=r("./GenericWorker");function a(l){o.call(this,"DataWorker");var u=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(d){u.dataIsReady=!0,u.data=d,u.max=d&&d.length||0,u.type=i.getTypeOf(d),u.isPaused||u._tickAndRepeat()},function(d){u.error(d)})}i.inherits(a,o),a.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,i.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(i.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=null,u=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":l=this.data.substring(this.index,u);break;case"uint8array":l=this.data.subarray(this.index,u);break;case"array":case"nodebuffer":l=this.data.slice(this.index,u)}return this.index=u,this.push({data:l,meta:{percent:this.max?this.index/this.max*100:0}})},n.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(r,n,s){function i(o){this.name=o||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}i.prototype={push:function(o){this.emit("data",o)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(o){this.emit("error",o)}return!0},error:function(o){return!this.isFinished&&(this.isPaused?this.generatedError=o:(this.isFinished=!0,this.emit("error",o),this.previous&&this.previous.error(o),this.cleanUp()),!0)},on:function(o,a){return this._listeners[o].push(a),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(o,a){if(this._listeners[o])for(var l=0;l "+o:o}},n.exports=i},{}],29:[function(r,n,s){var i=r("../utils"),o=r("./ConvertWorker"),a=r("./GenericWorker"),l=r("../base64"),u=r("../support"),d=r("../external"),f=null;if(u.nodestream)try{f=r("../nodejs/NodejsStreamOutputAdapter")}catch{}function g(y,m){return new d.Promise(function(w,v){var p=[],_=y._internalType,C=y._outputType,E=y._mimeType;y.on("data",function(j,R){p.push(j),m&&m(R)}).on("error",function(j){p=[],v(j)}).on("end",function(){try{var j=function(R,D,P){switch(R){case"blob":return i.newBlob(i.transformTo("arraybuffer",D),P);case"base64":return l.encode(D);default:return i.transformTo(R,D)}}(C,function(R,D){var P,L=0,q=null,T=0;for(P=0;P"u")s.blob=!1;else{var i=new ArrayBuffer(0);try{s.blob=new Blob([i],{type:"application/zip"}).size===0}catch{try{var o=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);o.append(i),s.blob=o.getBlob("application/zip").size===0}catch{s.blob=!1}}}try{s.nodestream=!!r("readable-stream").Readable}catch{s.nodestream=!1}},{"readable-stream":16}],31:[function(r,n,s){for(var i=r("./utils"),o=r("./support"),a=r("./nodejsUtils"),l=r("./stream/GenericWorker"),u=new Array(256),d=0;d<256;d++)u[d]=252<=d?6:248<=d?5:240<=d?4:224<=d?3:192<=d?2:1;u[254]=u[254]=1;function f(){l.call(this,"utf-8 decode"),this.leftOver=null}function g(){l.call(this,"utf-8 encode")}s.utf8encode=function(h){return o.nodebuffer?a.newBufferFrom(h,"utf-8"):function(y){var m,w,v,p,_,C=y.length,E=0;for(p=0;p>>6:(w<65536?m[_++]=224|w>>>12:(m[_++]=240|w>>>18,m[_++]=128|w>>>12&63),m[_++]=128|w>>>6&63),m[_++]=128|63&w);return m}(h)},s.utf8decode=function(h){return o.nodebuffer?i.transformTo("nodebuffer",h).toString("utf-8"):function(y){var m,w,v,p,_=y.length,C=new Array(2*_);for(m=w=0;m<_;)if((v=y[m++])<128)C[w++]=v;else if(4<(p=u[v]))C[w++]=65533,m+=p-1;else{for(v&=p===2?31:p===3?15:7;1>10&1023,C[w++]=56320|1023&v)}return C.length!==w&&(C.subarray?C=C.subarray(0,w):C.length=w),i.applyFromCharCode(C)}(h=i.transformTo(o.uint8array?"uint8array":"array",h))},i.inherits(f,l),f.prototype.processChunk=function(h){var y=i.transformTo(o.uint8array?"uint8array":"array",h.data);if(this.leftOver&&this.leftOver.length){if(o.uint8array){var m=y;(y=new Uint8Array(m.length+this.leftOver.length)).set(this.leftOver,0),y.set(m,this.leftOver.length)}else y=this.leftOver.concat(y);this.leftOver=null}var w=function(p,_){var C;for((_=_||p.length)>p.length&&(_=p.length),C=_-1;0<=C&&(192&p[C])==128;)C--;return C<0||C===0?_:C+u[p[C]]>_?C:_}(y),v=y;w!==y.length&&(o.uint8array?(v=y.subarray(0,w),this.leftOver=y.subarray(w,y.length)):(v=y.slice(0,w),this.leftOver=y.slice(w,y.length))),this.push({data:s.utf8decode(v),meta:h.meta})},f.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:s.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},s.Utf8DecodeWorker=f,i.inherits(g,l),g.prototype.processChunk=function(h){this.push({data:s.utf8encode(h.data),meta:h.meta})},s.Utf8EncodeWorker=g},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(r,n,s){var i=r("./support"),o=r("./base64"),a=r("./nodejsUtils"),l=r("./external");function u(m){return m}function d(m,w){for(var v=0;v>8;this.dir=!!(16&this.externalFileAttributes),h==0&&(this.dosPermissions=63&this.externalFileAttributes),h==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var h=i(this.extraFields[1].value);this.uncompressedSize===o.MAX_VALUE_32BITS&&(this.uncompressedSize=h.readInt(8)),this.compressedSize===o.MAX_VALUE_32BITS&&(this.compressedSize=h.readInt(8)),this.localHeaderOffset===o.MAX_VALUE_32BITS&&(this.localHeaderOffset=h.readInt(8)),this.diskNumberStart===o.MAX_VALUE_32BITS&&(this.diskNumberStart=h.readInt(4))}},readExtraFields:function(h){var y,m,w,v=h.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});h.index+4>>6:(h<65536?g[w++]=224|h>>>12:(g[w++]=240|h>>>18,g[w++]=128|h>>>12&63),g[w++]=128|h>>>6&63),g[w++]=128|63&h);return g},s.buf2binstring=function(f){return d(f,f.length)},s.binstring2buf=function(f){for(var g=new i.Buf8(f.length),h=0,y=g.length;h>10&1023,p[y++]=56320|1023&m)}return d(p,y)},s.utf8border=function(f,g){var h;for((g=g||f.length)>f.length&&(g=f.length),h=g-1;0<=h&&(192&f[h])==128;)h--;return h<0||h===0?g:h+l[f[h]]>g?h:g}},{"./common":41}],43:[function(r,n,s){n.exports=function(i,o,a,l){for(var u=65535&i|0,d=i>>>16&65535|0,f=0;a!==0;){for(a-=f=2e3>>1:o>>>1;a[l]=o}return a}();n.exports=function(o,a,l,u){var d=i,f=u+l;o^=-1;for(var g=u;g>>8^d[255&(o^a[g])];return-1^o}},{}],46:[function(r,n,s){var i,o=r("../utils/common"),a=r("./trees"),l=r("./adler32"),u=r("./crc32"),d=r("./messages"),f=0,g=4,h=0,y=-2,m=-1,w=4,v=2,p=8,_=9,C=286,E=30,j=19,R=2*C+1,D=15,P=3,L=258,q=L+P+1,T=42,F=113,b=1,W=2,te=3,$=4;function Z(k,J){return k.msg=d[J],J}function I(k){return(k<<1)-(4k.avail_out&&(K=k.avail_out),K!==0&&(o.arraySet(k.output,J.pending_buf,J.pending_out,K,k.next_out),k.next_out+=K,J.pending_out+=K,k.total_out+=K,k.avail_out-=K,J.pending-=K,J.pending===0&&(J.pending_out=0))}function V(k,J){a._tr_flush_block(k,0<=k.block_start?k.block_start:-1,k.strstart-k.block_start,J),k.block_start=k.strstart,z(k.strm)}function de(k,J){k.pending_buf[k.pending++]=J}function ne(k,J){k.pending_buf[k.pending++]=J>>>8&255,k.pending_buf[k.pending++]=255&J}function se(k,J){var K,A,S=k.max_chain_length,N=k.strstart,O=k.prev_length,Y=k.nice_match,M=k.strstart>k.w_size-q?k.strstart-(k.w_size-q):0,H=k.window,X=k.w_mask,ee=k.prev,he=k.strstart+L,Be=H[N+O-1],ze=H[N+O];k.prev_length>=k.good_match&&(S>>=2),Y>k.lookahead&&(Y=k.lookahead);do if(H[(K=J)+O]===ze&&H[K+O-1]===Be&&H[K]===H[N]&&H[++K]===H[N+1]){N+=2,K++;do;while(H[++N]===H[++K]&&H[++N]===H[++K]&&H[++N]===H[++K]&&H[++N]===H[++K]&&H[++N]===H[++K]&&H[++N]===H[++K]&&H[++N]===H[++K]&&H[++N]===H[++K]&&NM&&--S!=0);return O<=k.lookahead?O:k.lookahead}function Pe(k){var J,K,A,S,N,O,Y,M,H,X,ee=k.w_size;do{if(S=k.window_size-k.lookahead-k.strstart,k.strstart>=ee+(ee-q)){for(o.arraySet(k.window,k.window,ee,ee,0),k.match_start-=ee,k.strstart-=ee,k.block_start-=ee,J=K=k.hash_size;A=k.head[--J],k.head[J]=ee<=A?A-ee:0,--K;);for(J=K=ee;A=k.prev[--J],k.prev[J]=ee<=A?A-ee:0,--K;);S+=ee}if(k.strm.avail_in===0)break;if(O=k.strm,Y=k.window,M=k.strstart+k.lookahead,H=S,X=void 0,X=O.avail_in,H=P)for(N=k.strstart-k.insert,k.ins_h=k.window[N],k.ins_h=(k.ins_h<=P&&(k.ins_h=(k.ins_h<=P)if(A=a._tr_tally(k,k.strstart-k.match_start,k.match_length-P),k.lookahead-=k.match_length,k.match_length<=k.max_lazy_match&&k.lookahead>=P){for(k.match_length--;k.strstart++,k.ins_h=(k.ins_h<=P&&(k.ins_h=(k.ins_h<=P&&k.match_length<=k.prev_length){for(S=k.strstart+k.lookahead-P,A=a._tr_tally(k,k.strstart-1-k.prev_match,k.prev_length-P),k.lookahead-=k.prev_length-1,k.prev_length-=2;++k.strstart<=S&&(k.ins_h=(k.ins_h<k.pending_buf_size-5&&(K=k.pending_buf_size-5);;){if(k.lookahead<=1){if(Pe(k),k.lookahead===0&&J===f)return b;if(k.lookahead===0)break}k.strstart+=k.lookahead,k.lookahead=0;var A=k.block_start+K;if((k.strstart===0||k.strstart>=A)&&(k.lookahead=k.strstart-A,k.strstart=A,V(k,!1),k.strm.avail_out===0)||k.strstart-k.block_start>=k.w_size-q&&(V(k,!1),k.strm.avail_out===0))return b}return k.insert=0,J===g?(V(k,!0),k.strm.avail_out===0?te:$):(k.strstart>k.block_start&&(V(k,!1),k.strm.avail_out),b)}),new Se(4,4,8,4,fe),new Se(4,5,16,8,fe),new Se(4,6,32,32,fe),new Se(4,4,16,16,ve),new Se(8,16,32,32,ve),new Se(8,16,128,128,ve),new Se(8,32,128,256,ve),new Se(32,128,258,1024,ve),new Se(32,258,258,4096,ve)],s.deflateInit=function(k,J){return rt(k,J,p,15,8,0)},s.deflateInit2=rt,s.deflateReset=Ce,s.deflateResetKeep=De,s.deflateSetHeader=function(k,J){return k&&k.state?k.state.wrap!==2?y:(k.state.gzhead=J,h):y},s.deflate=function(k,J){var K,A,S,N;if(!k||!k.state||5>8&255),de(A,A.gzhead.time>>16&255),de(A,A.gzhead.time>>24&255),de(A,A.level===9?2:2<=A.strategy||A.level<2?4:0),de(A,255&A.gzhead.os),A.gzhead.extra&&A.gzhead.extra.length&&(de(A,255&A.gzhead.extra.length),de(A,A.gzhead.extra.length>>8&255)),A.gzhead.hcrc&&(k.adler=u(k.adler,A.pending_buf,A.pending,0)),A.gzindex=0,A.status=69):(de(A,0),de(A,0),de(A,0),de(A,0),de(A,0),de(A,A.level===9?2:2<=A.strategy||A.level<2?4:0),de(A,3),A.status=F);else{var O=p+(A.w_bits-8<<4)<<8;O|=(2<=A.strategy||A.level<2?0:A.level<6?1:A.level===6?2:3)<<6,A.strstart!==0&&(O|=32),O+=31-O%31,A.status=F,ne(A,O),A.strstart!==0&&(ne(A,k.adler>>>16),ne(A,65535&k.adler)),k.adler=1}if(A.status===69)if(A.gzhead.extra){for(S=A.pending;A.gzindex<(65535&A.gzhead.extra.length)&&(A.pending!==A.pending_buf_size||(A.gzhead.hcrc&&A.pending>S&&(k.adler=u(k.adler,A.pending_buf,A.pending-S,S)),z(k),S=A.pending,A.pending!==A.pending_buf_size));)de(A,255&A.gzhead.extra[A.gzindex]),A.gzindex++;A.gzhead.hcrc&&A.pending>S&&(k.adler=u(k.adler,A.pending_buf,A.pending-S,S)),A.gzindex===A.gzhead.extra.length&&(A.gzindex=0,A.status=73)}else A.status=73;if(A.status===73)if(A.gzhead.name){S=A.pending;do{if(A.pending===A.pending_buf_size&&(A.gzhead.hcrc&&A.pending>S&&(k.adler=u(k.adler,A.pending_buf,A.pending-S,S)),z(k),S=A.pending,A.pending===A.pending_buf_size)){N=1;break}N=A.gzindexS&&(k.adler=u(k.adler,A.pending_buf,A.pending-S,S)),N===0&&(A.gzindex=0,A.status=91)}else A.status=91;if(A.status===91)if(A.gzhead.comment){S=A.pending;do{if(A.pending===A.pending_buf_size&&(A.gzhead.hcrc&&A.pending>S&&(k.adler=u(k.adler,A.pending_buf,A.pending-S,S)),z(k),S=A.pending,A.pending===A.pending_buf_size)){N=1;break}N=A.gzindexS&&(k.adler=u(k.adler,A.pending_buf,A.pending-S,S)),N===0&&(A.status=103)}else A.status=103;if(A.status===103&&(A.gzhead.hcrc?(A.pending+2>A.pending_buf_size&&z(k),A.pending+2<=A.pending_buf_size&&(de(A,255&k.adler),de(A,k.adler>>8&255),k.adler=0,A.status=F)):A.status=F),A.pending!==0){if(z(k),k.avail_out===0)return A.last_flush=-1,h}else if(k.avail_in===0&&I(J)<=I(K)&&J!==g)return Z(k,-5);if(A.status===666&&k.avail_in!==0)return Z(k,-5);if(k.avail_in!==0||A.lookahead!==0||J!==f&&A.status!==666){var Y=A.strategy===2?function(M,H){for(var X;;){if(M.lookahead===0&&(Pe(M),M.lookahead===0)){if(H===f)return b;break}if(M.match_length=0,X=a._tr_tally(M,0,M.window[M.strstart]),M.lookahead--,M.strstart++,X&&(V(M,!1),M.strm.avail_out===0))return b}return M.insert=0,H===g?(V(M,!0),M.strm.avail_out===0?te:$):M.last_lit&&(V(M,!1),M.strm.avail_out===0)?b:W}(A,J):A.strategy===3?function(M,H){for(var X,ee,he,Be,ze=M.window;;){if(M.lookahead<=L){if(Pe(M),M.lookahead<=L&&H===f)return b;if(M.lookahead===0)break}if(M.match_length=0,M.lookahead>=P&&0M.lookahead&&(M.match_length=M.lookahead)}if(M.match_length>=P?(X=a._tr_tally(M,1,M.match_length-P),M.lookahead-=M.match_length,M.strstart+=M.match_length,M.match_length=0):(X=a._tr_tally(M,0,M.window[M.strstart]),M.lookahead--,M.strstart++),X&&(V(M,!1),M.strm.avail_out===0))return b}return M.insert=0,H===g?(V(M,!0),M.strm.avail_out===0?te:$):M.last_lit&&(V(M,!1),M.strm.avail_out===0)?b:W}(A,J):i[A.level].func(A,J);if(Y!==te&&Y!==$||(A.status=666),Y===b||Y===te)return k.avail_out===0&&(A.last_flush=-1),h;if(Y===W&&(J===1?a._tr_align(A):J!==5&&(a._tr_stored_block(A,0,0,!1),J===3&&(Q(A.head),A.lookahead===0&&(A.strstart=0,A.block_start=0,A.insert=0))),z(k),k.avail_out===0))return A.last_flush=-1,h}return J!==g?h:A.wrap<=0?1:(A.wrap===2?(de(A,255&k.adler),de(A,k.adler>>8&255),de(A,k.adler>>16&255),de(A,k.adler>>24&255),de(A,255&k.total_in),de(A,k.total_in>>8&255),de(A,k.total_in>>16&255),de(A,k.total_in>>24&255)):(ne(A,k.adler>>>16),ne(A,65535&k.adler)),z(k),0=K.w_size&&(N===0&&(Q(K.head),K.strstart=0,K.block_start=0,K.insert=0),H=new o.Buf8(K.w_size),o.arraySet(H,J,X-K.w_size,K.w_size,0),J=H,X=K.w_size),O=k.avail_in,Y=k.next_in,M=k.input,k.avail_in=X,k.next_in=0,k.input=J,Pe(K);K.lookahead>=P;){for(A=K.strstart,S=K.lookahead-(P-1);K.ins_h=(K.ins_h<>>=P=D>>>24,_-=P,(P=D>>>16&255)===0)W[d++]=65535&D;else{if(!(16&P)){if(!(64&P)){D=C[(65535&D)+(p&(1<>>=P,_-=P),_<15&&(p+=b[l++]<<_,_+=8,p+=b[l++]<<_,_+=8),D=E[p&R];r:for(;;){if(p>>>=P=D>>>24,_-=P,!(16&(P=D>>>16&255))){if(!(64&P)){D=E[(65535&D)+(p&(1<>>=P,_-=P,(P=d-f)>3,p&=(1<<(_-=L<<3))-1,i.next_in=l,i.next_out=d,i.avail_in=l>>24&255)+(T>>>8&65280)+((65280&T)<<8)+((255&T)<<24)}function p(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new i.Buf16(320),this.work=new i.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function _(T){var F;return T&&T.state?(F=T.state,T.total_in=T.total_out=F.total=0,T.msg="",F.wrap&&(T.adler=1&F.wrap),F.mode=y,F.last=0,F.havedict=0,F.dmax=32768,F.head=null,F.hold=0,F.bits=0,F.lencode=F.lendyn=new i.Buf32(m),F.distcode=F.distdyn=new i.Buf32(w),F.sane=1,F.back=-1,g):h}function C(T){var F;return T&&T.state?((F=T.state).wsize=0,F.whave=0,F.wnext=0,_(T)):h}function E(T,F){var b,W;return T&&T.state?(W=T.state,F<0?(b=0,F=-F):(b=1+(F>>4),F<48&&(F&=15)),F&&(F<8||15=$.wsize?(i.arraySet($.window,F,b-$.wsize,$.wsize,0),$.wnext=0,$.whave=$.wsize):(W<(te=$.wsize-$.wnext)&&(te=W),i.arraySet($.window,F,b-W,te,$.wnext),(W-=te)?(i.arraySet($.window,F,b-W,W,0),$.wnext=W,$.whave=$.wsize):($.wnext+=te,$.wnext===$.wsize&&($.wnext=0),$.whave<$.wsize&&($.whave+=te))),0}s.inflateReset=C,s.inflateReset2=E,s.inflateResetKeep=_,s.inflateInit=function(T){return j(T,15)},s.inflateInit2=j,s.inflate=function(T,F){var b,W,te,$,Z,I,Q,z,V,de,ne,se,Pe,fe,ve,Se,Ie,De,Ce,rt,k,J,K,A,S=0,N=new i.Buf8(4),O=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!T||!T.state||!T.output||!T.input&&T.avail_in!==0)return h;(b=T.state).mode===12&&(b.mode=13),Z=T.next_out,te=T.output,Q=T.avail_out,$=T.next_in,W=T.input,I=T.avail_in,z=b.hold,V=b.bits,de=I,ne=Q,J=g;e:for(;;)switch(b.mode){case y:if(b.wrap===0){b.mode=13;break}for(;V<16;){if(I===0)break e;I--,z+=W[$++]<>>8&255,b.check=a(b.check,N,2,0),V=z=0,b.mode=2;break}if(b.flags=0,b.head&&(b.head.done=!1),!(1&b.wrap)||(((255&z)<<8)+(z>>8))%31){T.msg="incorrect header check",b.mode=30;break}if((15&z)!=8){T.msg="unknown compression method",b.mode=30;break}if(V-=4,k=8+(15&(z>>>=4)),b.wbits===0)b.wbits=k;else if(k>b.wbits){T.msg="invalid window size",b.mode=30;break}b.dmax=1<>8&1),512&b.flags&&(N[0]=255&z,N[1]=z>>>8&255,b.check=a(b.check,N,2,0)),V=z=0,b.mode=3;case 3:for(;V<32;){if(I===0)break e;I--,z+=W[$++]<>>8&255,N[2]=z>>>16&255,N[3]=z>>>24&255,b.check=a(b.check,N,4,0)),V=z=0,b.mode=4;case 4:for(;V<16;){if(I===0)break e;I--,z+=W[$++]<>8),512&b.flags&&(N[0]=255&z,N[1]=z>>>8&255,b.check=a(b.check,N,2,0)),V=z=0,b.mode=5;case 5:if(1024&b.flags){for(;V<16;){if(I===0)break e;I--,z+=W[$++]<>>8&255,b.check=a(b.check,N,2,0)),V=z=0}else b.head&&(b.head.extra=null);b.mode=6;case 6:if(1024&b.flags&&(I<(se=b.length)&&(se=I),se&&(b.head&&(k=b.head.extra_len-b.length,b.head.extra||(b.head.extra=new Array(b.head.extra_len)),i.arraySet(b.head.extra,W,$,se,k)),512&b.flags&&(b.check=a(b.check,W,se,$)),I-=se,$+=se,b.length-=se),b.length))break e;b.length=0,b.mode=7;case 7:if(2048&b.flags){if(I===0)break e;for(se=0;k=W[$+se++],b.head&&k&&b.length<65536&&(b.head.name+=String.fromCharCode(k)),k&&se>9&1,b.head.done=!0),T.adler=b.check=0,b.mode=12;break;case 10:for(;V<32;){if(I===0)break e;I--,z+=W[$++]<>>=7&V,V-=7&V,b.mode=27;break}for(;V<3;){if(I===0)break e;I--,z+=W[$++]<>>=1)){case 0:b.mode=14;break;case 1:if(L(b),b.mode=20,F!==6)break;z>>>=2,V-=2;break e;case 2:b.mode=17;break;case 3:T.msg="invalid block type",b.mode=30}z>>>=2,V-=2;break;case 14:for(z>>>=7&V,V-=7&V;V<32;){if(I===0)break e;I--,z+=W[$++]<>>16^65535)){T.msg="invalid stored block lengths",b.mode=30;break}if(b.length=65535&z,V=z=0,b.mode=15,F===6)break e;case 15:b.mode=16;case 16:if(se=b.length){if(I>>=5,V-=5,b.ndist=1+(31&z),z>>>=5,V-=5,b.ncode=4+(15&z),z>>>=4,V-=4,286>>=3,V-=3}for(;b.have<19;)b.lens[O[b.have++]]=0;if(b.lencode=b.lendyn,b.lenbits=7,K={bits:b.lenbits},J=u(0,b.lens,0,19,b.lencode,0,b.work,K),b.lenbits=K.bits,J){T.msg="invalid code lengths set",b.mode=30;break}b.have=0,b.mode=19;case 19:for(;b.have>>16&255,Ie=65535&S,!((ve=S>>>24)<=V);){if(I===0)break e;I--,z+=W[$++]<>>=ve,V-=ve,b.lens[b.have++]=Ie;else{if(Ie===16){for(A=ve+2;V>>=ve,V-=ve,b.have===0){T.msg="invalid bit length repeat",b.mode=30;break}k=b.lens[b.have-1],se=3+(3&z),z>>>=2,V-=2}else if(Ie===17){for(A=ve+3;V>>=ve)),z>>>=3,V-=3}else{for(A=ve+7;V>>=ve)),z>>>=7,V-=7}if(b.have+se>b.nlen+b.ndist){T.msg="invalid bit length repeat",b.mode=30;break}for(;se--;)b.lens[b.have++]=k}}if(b.mode===30)break;if(b.lens[256]===0){T.msg="invalid code -- missing end-of-block",b.mode=30;break}if(b.lenbits=9,K={bits:b.lenbits},J=u(d,b.lens,0,b.nlen,b.lencode,0,b.work,K),b.lenbits=K.bits,J){T.msg="invalid literal/lengths set",b.mode=30;break}if(b.distbits=6,b.distcode=b.distdyn,K={bits:b.distbits},J=u(f,b.lens,b.nlen,b.ndist,b.distcode,0,b.work,K),b.distbits=K.bits,J){T.msg="invalid distances set",b.mode=30;break}if(b.mode=20,F===6)break e;case 20:b.mode=21;case 21:if(6<=I&&258<=Q){T.next_out=Z,T.avail_out=Q,T.next_in=$,T.avail_in=I,b.hold=z,b.bits=V,l(T,ne),Z=T.next_out,te=T.output,Q=T.avail_out,$=T.next_in,W=T.input,I=T.avail_in,z=b.hold,V=b.bits,b.mode===12&&(b.back=-1);break}for(b.back=0;Se=(S=b.lencode[z&(1<>>16&255,Ie=65535&S,!((ve=S>>>24)<=V);){if(I===0)break e;I--,z+=W[$++]<>De)])>>>16&255,Ie=65535&S,!(De+(ve=S>>>24)<=V);){if(I===0)break e;I--,z+=W[$++]<>>=De,V-=De,b.back+=De}if(z>>>=ve,V-=ve,b.back+=ve,b.length=Ie,Se===0){b.mode=26;break}if(32&Se){b.back=-1,b.mode=12;break}if(64&Se){T.msg="invalid literal/length code",b.mode=30;break}b.extra=15&Se,b.mode=22;case 22:if(b.extra){for(A=b.extra;V>>=b.extra,V-=b.extra,b.back+=b.extra}b.was=b.length,b.mode=23;case 23:for(;Se=(S=b.distcode[z&(1<>>16&255,Ie=65535&S,!((ve=S>>>24)<=V);){if(I===0)break e;I--,z+=W[$++]<>De)])>>>16&255,Ie=65535&S,!(De+(ve=S>>>24)<=V);){if(I===0)break e;I--,z+=W[$++]<>>=De,V-=De,b.back+=De}if(z>>>=ve,V-=ve,b.back+=ve,64&Se){T.msg="invalid distance code",b.mode=30;break}b.offset=Ie,b.extra=15&Se,b.mode=24;case 24:if(b.extra){for(A=b.extra;V>>=b.extra,V-=b.extra,b.back+=b.extra}if(b.offset>b.dmax){T.msg="invalid distance too far back",b.mode=30;break}b.mode=25;case 25:if(Q===0)break e;if(se=ne-Q,b.offset>se){if((se=b.offset-se)>b.whave&&b.sane){T.msg="invalid distance too far back",b.mode=30;break}Pe=se>b.wnext?(se-=b.wnext,b.wsize-se):b.wnext-se,se>b.length&&(se=b.length),fe=b.window}else fe=te,Pe=Z-b.offset,se=b.length;for(QR?(P=Pe[fe+w[F]],V[de+w[F]]):(P=96,0),p=1<>Z)+(_-=p)]=D<<24|P<<16|L|0,_!==0;);for(p=1<>=1;if(p!==0?(z&=p-1,z+=p):z=0,F++,--ne[T]==0){if(T===W)break;T=f[g+w[F]]}if(te>>7)]}function de(S,N){S.pending_buf[S.pending++]=255&N,S.pending_buf[S.pending++]=N>>>8&255}function ne(S,N,O){S.bi_valid>v-O?(S.bi_buf|=N<>v-S.bi_valid,S.bi_valid+=O-v):(S.bi_buf|=N<>>=1,O<<=1,0<--N;);return O>>>1}function fe(S,N,O){var Y,M,H=new Array(w+1),X=0;for(Y=1;Y<=w;Y++)H[Y]=X=X+O[Y-1]<<1;for(M=0;M<=N;M++){var ee=S[2*M+1];ee!==0&&(S[2*M]=Pe(H[ee]++,ee))}}function ve(S){var N;for(N=0;N>1;1<=O;O--)De(S,H,O);for(M=he;O=S.heap[1],S.heap[1]=S.heap[S.heap_len--],De(S,H,1),Y=S.heap[1],S.heap[--S.heap_max]=O,S.heap[--S.heap_max]=Y,H[2*M]=H[2*O]+H[2*Y],S.depth[M]=(S.depth[O]>=S.depth[Y]?S.depth[O]:S.depth[Y])+1,H[2*O+1]=H[2*Y+1]=M,S.heap[1]=M++,De(S,H,1),2<=S.heap_len;);S.heap[--S.heap_max]=S.heap[1],function(ze,Et){var Wr,Bt,Gn,it,qn,Xn,$r=Et.dyn_tree,jc=Et.max_code,Tc=Et.stat_desc.static_tree,so=Et.stat_desc.has_stree,Nc=Et.stat_desc.extra_bits,io=Et.stat_desc.extra_base,jn=Et.stat_desc.max_length,Ds=0;for(it=0;it<=w;it++)ze.bl_count[it]=0;for($r[2*ze.heap[ze.heap_max]+1]=0,Wr=ze.heap_max+1;Wr>=7;M>>=1)if(1&Be&&ee.dyn_ltree[2*he]!==0)return o;if(ee.dyn_ltree[18]!==0||ee.dyn_ltree[20]!==0||ee.dyn_ltree[26]!==0)return a;for(he=32;he>>3,(H=S.static_len+3+7>>>3)<=M&&(M=H)):M=H=O+5,O+4<=M&&N!==-1?A(S,N,O,Y):S.strategy===4||H===M?(ne(S,2+(Y?1:0),3),Ce(S,q,T)):(ne(S,4+(Y?1:0),3),function(ee,he,Be,ze){var Et;for(ne(ee,he-257,5),ne(ee,Be-1,5),ne(ee,ze-4,4),Et=0;Et>>8&255,S.pending_buf[S.d_buf+2*S.last_lit+1]=255&N,S.pending_buf[S.l_buf+S.last_lit]=255&O,S.last_lit++,N===0?S.dyn_ltree[2*O]++:(S.matches++,N--,S.dyn_ltree[2*(b[O]+f+1)]++,S.dyn_dtree[2*V(N)]++),S.last_lit===S.lit_bufsize-1},s._tr_align=function(S){ne(S,2,3),se(S,_,q),function(N){N.bi_valid===16?(de(N,N.bi_buf),N.bi_buf=0,N.bi_valid=0):8<=N.bi_valid&&(N.pending_buf[N.pending++]=255&N.bi_buf,N.bi_buf>>=8,N.bi_valid-=8)}(S)}},{"../utils/common":41}],53:[function(r,n,s){n.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(r,n,s){(function(i){(function(o,a){if(!o.setImmediate){var l,u,d,f,g=1,h={},y=!1,m=o.document,w=Object.getPrototypeOf&&Object.getPrototypeOf(o);w=w&&w.setTimeout?w:o,l={}.toString.call(o.process)==="[object process]"?function(C){process.nextTick(function(){p(C)})}:function(){if(o.postMessage&&!o.importScripts){var C=!0,E=o.onmessage;return o.onmessage=function(){C=!1},o.postMessage("","*"),o.onmessage=E,C}}()?(f="setImmediate$"+Math.random()+"$",o.addEventListener?o.addEventListener("message",_,!1):o.attachEvent("onmessage",_),function(C){o.postMessage(f+C,"*")}):o.MessageChannel?((d=new MessageChannel).port1.onmessage=function(C){p(C.data)},function(C){d.port2.postMessage(C)}):m&&"onreadystatechange"in m.createElement("script")?(u=m.documentElement,function(C){var E=m.createElement("script");E.onreadystatechange=function(){p(C),E.onreadystatechange=null,u.removeChild(E),E=null},u.appendChild(E)}):function(C){setTimeout(p,0,C)},w.setImmediate=function(C){typeof C!="function"&&(C=new Function(""+C));for(var E=new Array(arguments.length-1),j=0;j"u"?i===void 0?this:i:self)}).call(this,typeof Oc<"u"?Oc:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(IC);var S5=IC.exports;const k5=vm(S5);function C5(e){return new Promise((t,r)=>{const n=new FileReader;n.onload=()=>{n.result?t(n.result.toString()):r("No content found")},n.onerror=()=>r(n.error),n.readAsText(e)})}const E5=async(e,t)=>{const r=new k5;t.forEach(i=>{r.file(i.name,i.content)});const n=await r.generateAsync({type:"blob"}),s=document.createElement("a");s.href=URL.createObjectURL(n),s.download=e,s.click()},ca=e=>{const t=new Date(e);return new Intl.DateTimeFormat("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1,timeZone:"Asia/Shanghai"}).format(t)},j5=e=>ca(e).split(" ")[0];function LC(e){const t=new Date;t.setUTCDate(t.getUTCDate()+e);const r=t.getUTCFullYear(),n=String(t.getUTCMonth()+1).padStart(2,"0"),s=String(t.getUTCDate()).padStart(2,"0"),i=String(t.getUTCHours()).padStart(2,"0"),o=String(t.getUTCMinutes()).padStart(2,"0"),a=String(t.getUTCSeconds()).padStart(2,"0");return`${r}-${n}-${s} ${i}:${o}:${a}`}const T5=async e=>{let t=1;e.page&&(t=e.page);let r=2;e.perPage&&(r=e.perPage);const n=xt();let s="";return e.state==="enabled"?s="enabled=true":e.state==="disabled"?s="enabled=false":e.state==="expired"&&(s=n.filter("expiredAt<{:expiredAt}",{expiredAt:LC(15)})),n.collection("domains").getList(t,r,{sort:"-created",expand:"lastDeployment",filter:s})},N5=async()=>{const e=xt(),t=await e.collection("domains").getList(1,1,{}),r=await e.collection("domains").getList(1,1,{filter:e.filter("expiredAt<{:expiredAt}",{expiredAt:LC(15)})}),n=await e.collection("domains").getList(1,1,{filter:"enabled=true"}),s=await e.collection("domains").getList(1,1,{filter:"enabled=false"});return{total:t.totalItems,expired:r.totalItems,enabled:n.totalItems,disabled:s.totalItems}},R5=async e=>await xt().collection("domains").getOne(e),sm=async e=>e.id?await xt().collection("domains").update(e.id,e):await xt().collection("domains").create(e),P5=async e=>await xt().collection("domains").delete(e),D5=(e,t)=>xt().collection("domains").subscribe(e,r=>{r.action==="update"&&t(r.record)},{expand:"lastDeployment"}),A5=e=>{xt().collection("domains").unsubscribe(e)},O5=()=>{const e=Tf(),t=Sn(),r=Hn(),n=new URLSearchParams(r.search),s=n.get("page"),i=n.get("state"),[o,a]=x.useState(0),l=()=>{t("/edit")},u=p=>{n.set("page",p.toString()),t(`?${n.toString()}`)},d=p=>{t(`/edit?id=${p}`)},f=p=>{t(`/history?domain=${p}`)},g=async p=>{try{await P5(p),y(h.filter(_=>_.id!==p))}catch(_){console.error("Error deleting domain:",_)}},[h,y]=x.useState([]);x.useEffect(()=>{(async()=>{const _=await T5({page:s?Number(s):1,perPage:10,state:i||""});y(_.items),a(_.totalPages)})()},[s,i]);const m=async p=>{const _=h.filter(R=>R.id===p),C=_[0].enabled,E=_[0];E.enabled=!C,await sm(E);const j=h.map(R=>R.id===p?{...R,checked:!C}:R);y(j)},w=async p=>{try{A5(p.id),D5(p.id,_=>{console.log(_);const C=h.map(E=>E.id===_.id?{..._}:E);y(C)}),p.rightnow=!0,await sm(p),e.toast({title:"操作成功",description:"已发起部署,请稍后查看部署日志。"})}catch{e.toast({title:"执行失败",description:c.jsxs(c.Fragment,{children:["执行失败,请查看",c.jsx(dr,{to:`/history?domain=${p.id}`,className:"underline text-blue-500",children:"部署日志"}),"查看详情。"]}),variant:"destructive"})}},v=async p=>{const _=`${p.id}-${p.domain}.zip`,C=[{name:`${p.domain}.pem`,content:p.certificate?p.certificate:""},{name:`${p.domain}.key`,content:p.privateKey?p.privateKey:""}];await E5(_,C)};return c.jsx(c.Fragment,{children:c.jsxs("div",{className:"",children:[c.jsx(Pv,{}),c.jsxs("div",{className:"flex justify-between items-center",children:[c.jsx("div",{className:"text-muted-foreground",children:"域名列表"}),c.jsx(at,{onClick:l,children:"新增域名"})]}),h.length?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"hidden sm:flex sm:flex-row text-muted-foreground text-sm border-b dark:border-stone-500 sm:p-2 mt-5",children:[c.jsx("div",{className:"w-40",children:"域名"}),c.jsx("div",{className:"w-48",children:"有效期限"}),c.jsx("div",{className:"w-32",children:"最近执行状态"}),c.jsx("div",{className:"w-64",children:"最近执行阶段"}),c.jsx("div",{className:"w-40 sm:ml-2",children:"最近执行时间"}),c.jsx("div",{className:"w-32",children:"是否启用"}),c.jsx("div",{className:"grow",children:"操作"})]}),c.jsx("div",{className:"sm:hidden flex text-sm text-muted-foreground",children:"域名"}),h.map(p=>{var _,C,E,j,R,D;return c.jsxs("div",{className:"flex flex-col sm:flex-row text-secondary-foreground border-b dark:border-stone-500 sm:p-2 hover:bg-muted/50 text-sm",children:[c.jsx("div",{className:"sm:w-40 w-full pt-1 sm:pt-0 flex items-center",children:p.domain}),c.jsx("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center",children:c.jsx("div",{children:p.expiredAt?c.jsxs(c.Fragment,{children:[c.jsx("div",{children:"有效期90天"}),c.jsxs("div",{children:[j5(p.expiredAt),"到期"]})]}):"---"})}),c.jsx("div",{className:"sm:w-32 w-full pt-1 sm:pt-0 flex items-center",children:p.lastDeployedAt&&((_=p.expand)!=null&&_.lastDeployment)?c.jsx(c.Fragment,{children:((C=p.expand.lastDeployment)==null?void 0:C.phase)==="deploy"&&((E=p.expand.lastDeployment)!=null&&E.phaseSuccess)?c.jsx(vg,{size:16,className:"text-green-700"}):c.jsx(yg,{size:16,className:"text-red-700"})}):"---"}),c.jsx("div",{className:"sm:w-64 w-full pt-1 sm:pt-0 flex items-center",children:p.lastDeployedAt&&((j=p.expand)!=null&&j.lastDeployment)?c.jsx(Ev,{phase:(R=p.expand.lastDeployment)==null?void 0:R.phase,phaseSuccess:(D=p.expand.lastDeployment)==null?void 0:D.phaseSuccess}):"---"}),c.jsx("div",{className:"sm:w-40 pt-1 sm:pt-0 sm:ml-2 flex items-center",children:p.lastDeployedAt?ca(p.lastDeployedAt):"---"}),c.jsx("div",{className:"sm:w-32 flex items-center",children:c.jsx(RC,{children:c.jsxs(w5,{children:[c.jsx(_5,{children:c.jsx(sC,{checked:p.enabled,onCheckedChange:()=>{m(p.id)}})}),c.jsx(Av,{children:c.jsx("div",{className:"border rounded-sm px-3 bg-background text-muted-foreground text-xs",children:p.enabled?"禁用":"启用"})})]})})}),c.jsxs("div",{className:"flex items-center grow justify-start pt-1 sm:pt-0",children:[c.jsx(at,{variant:"link",className:"p-0",onClick:()=>f(p.id),children:"部署历史"}),c.jsxs(y0,{when:!!p.enabled,children:[c.jsx(Yt,{orientation:"vertical",className:"h-4 mx-2"}),c.jsx(at,{variant:"link",className:"p-0",onClick:()=>w(p),children:"立即部署"})]}),c.jsxs(y0,{when:!!p.expiredAt,children:[c.jsx(Yt,{orientation:"vertical",className:"h-4 mx-2"}),c.jsx(at,{variant:"link",className:"p-0",onClick:()=>v(p),children:"下载"})]}),!p.enabled&&c.jsxs(c.Fragment,{children:[c.jsx(Yt,{orientation:"vertical",className:"h-4 mx-2"}),c.jsxs(_3,{children:[c.jsx(b3,{asChild:!0,children:c.jsx(at,{variant:"link",className:"p-0",children:"删除"})}),c.jsxs(Hk,{children:[c.jsxs(Yk,{children:[c.jsx(Kk,{children:"删除域名"}),c.jsx(Gk,{children:"确定要删除域名吗?"})]}),c.jsxs(Zk,{children:[c.jsx(Xk,{children:"取消"}),c.jsx(qk,{onClick:()=>{g(p.id)},children:"确认"})]})]})]}),c.jsx(Yt,{orientation:"vertical",className:"h-4 mx-2"}),c.jsx(at,{variant:"link",className:"p-0",onClick:()=>d(p.id),children:"编辑"})]})]})]},p.id)}),c.jsx(kk,{totalPages:o,currentPage:s?Number(s):1,onPageChange:p=>{u(p)}})]}):c.jsx(c.Fragment,{children:c.jsxs("div",{className:"flex flex-col items-center mt-10",children:[c.jsx("span",{className:"bg-orange-100 p-5 rounded-full",children:c.jsx(Ip,{size:40,className:"text-primary"})}),c.jsx("div",{className:"text-center text-sm text-muted-foreground mt-3",children:"请添加域名开始部署证书吧。"}),c.jsx(at,{onClick:l,className:"mt-3",children:"添加域名"})]})})]})})},Fe=x.forwardRef(({className:e,type:t,...r},n)=>c.jsx("input",{type:t,className:pe("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...r}));Fe.displayName="Input";var kc=e=>e.type==="checkbox",Ao=e=>e instanceof Date,hr=e=>e==null;const FC=e=>typeof e=="object";var qt=e=>!hr(e)&&!Array.isArray(e)&&FC(e)&&!Ao(e),zC=e=>qt(e)&&e.target?kc(e.target)?e.target.checked:e.target.value:e,M5=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,UC=(e,t)=>e.has(M5(t)),I5=e=>{const t=e.constructor&&e.constructor.prototype;return qt(t)&&t.hasOwnProperty("isPrototypeOf")},Ov=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function wr(e){let t;const r=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(Ov&&(e instanceof Blob||e instanceof FileList))&&(r||qt(e)))if(t=r?[]:{},!r&&!I5(e))t=e;else for(const n in e)e.hasOwnProperty(n)&&(t[n]=wr(e[n]));else return e;return t}var Af=e=>Array.isArray(e)?e.filter(Boolean):[],Ft=e=>e===void 0,le=(e,t,r)=>{if(!t||!qt(e))return r;const n=Af(t.split(/[,[\].]+?/)).reduce((s,i)=>hr(s)?s:s[i],e);return Ft(n)||n===e?Ft(e[t])?r:e[t]:n},On=e=>typeof e=="boolean",Mv=e=>/^\w*$/.test(e),VC=e=>Af(e.replace(/["|']|\]/g,"").split(/\.|\[/)),dt=(e,t,r)=>{let n=-1;const s=Mv(t)?[t]:VC(t),i=s.length,o=i-1;for(;++net.useContext(WC),L5=e=>{const{children:t,...r}=e;return et.createElement(WC.Provider,{value:r},t)};var $C=(e,t,r,n=!0)=>{const s={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(s,i,{get:()=>{const o=i;return t._proxyFormState[o]!==dn.all&&(t._proxyFormState[o]=!n||dn.all),r&&(r[o]=!0),e[o]}});return s},Nr=e=>qt(e)&&!Object.keys(e).length,BC=(e,t,r,n)=>{r(e);const{name:s,...i}=e;return Nr(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(o=>t[o]===(!n||dn.all))},pl=e=>Array.isArray(e)?e:[e],HC=(e,t,r)=>!e||!t||e===t||pl(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n)));function Iv(e){const t=et.useRef(e);t.current=e,et.useEffect(()=>{const r=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{r&&r.unsubscribe()}},[e.disabled])}function F5(e){const t=Of(),{control:r=t.control,disabled:n,name:s,exact:i}=e||{},[o,a]=et.useState(r._formState),l=et.useRef(!0),u=et.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),d=et.useRef(s);return d.current=s,Iv({disabled:n,next:f=>l.current&&HC(d.current,f.name,i)&&BC(f,u.current,r._updateFormState)&&a({...r._formState,...f}),subject:r._subjects.state}),et.useEffect(()=>(l.current=!0,u.current.isValid&&r._updateValid(!0),()=>{l.current=!1}),[r]),$C(o,r,u.current,!1)}var In=e=>typeof e=="string",YC=(e,t,r,n,s)=>In(e)?(n&&t.watch.add(e),le(r,e,s)):Array.isArray(e)?e.map(i=>(n&&t.watch.add(i),le(r,i))):(n&&(t.watchAll=!0),r);function z5(e){const t=Of(),{control:r=t.control,name:n,defaultValue:s,disabled:i,exact:o}=e||{},a=et.useRef(n);a.current=n,Iv({disabled:i,subject:r._subjects.values,next:d=>{HC(a.current,d.name,o)&&u(wr(YC(a.current,r._names,d.values||r._formValues,!1,s)))}});const[l,u]=et.useState(r._getWatch(n,s));return et.useEffect(()=>r._removeUnmounted()),l}function U5(e){const t=Of(),{name:r,disabled:n,control:s=t.control,shouldUnregister:i}=e,o=UC(s._names.array,r),a=z5({control:s,name:r,defaultValue:le(s._formValues,r,le(s._defaultValues,r,e.defaultValue)),exact:!0}),l=F5({control:s,name:r}),u=et.useRef(s.register(r,{...e.rules,value:a,...On(e.disabled)?{disabled:e.disabled}:{}}));return et.useEffect(()=>{const d=s._options.shouldUnregister||i,f=(g,h)=>{const y=le(s._fields,g);y&&y._f&&(y._f.mount=h)};if(f(r,!0),d){const g=wr(le(s._options.defaultValues,r));dt(s._defaultValues,r,g),Ft(le(s._formValues,r))&&dt(s._formValues,r,g)}return()=>{(o?d&&!s._state.action:d)?s.unregister(r):f(r,!1)}},[r,s,o,i]),et.useEffect(()=>{le(s._fields,r)&&s._updateDisabledField({disabled:n,fields:s._fields,name:r,value:le(s._fields,r)._f.value})},[n,r,s]),{field:{name:r,value:a,...On(n)||l.disabled?{disabled:l.disabled||n}:{},onChange:et.useCallback(d=>u.current.onChange({target:{value:zC(d),name:r},type:xd.CHANGE}),[r]),onBlur:et.useCallback(()=>u.current.onBlur({target:{value:le(s._formValues,r),name:r},type:xd.BLUR}),[r,s]),ref:d=>{const f=le(s._fields,r);f&&d&&(f._f.ref={focus:()=>d.focus(),select:()=>d.select(),setCustomValidity:g=>d.setCustomValidity(g),reportValidity:()=>d.reportValidity()})}},formState:l,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!le(l.errors,r)},isDirty:{enumerable:!0,get:()=>!!le(l.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!le(l.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!le(l.validatingFields,r)},error:{enumerable:!0,get:()=>le(l.errors,r)}})}}const V5=e=>e.render(U5(e));var ZC=(e,t,r,n,s)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:s||!0}}:{},_0=e=>({isOnSubmit:!e||e===dn.onSubmit,isOnBlur:e===dn.onBlur,isOnChange:e===dn.onChange,isOnAll:e===dn.all,isOnTouch:e===dn.onTouched}),b0=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const ml=(e,t,r,n)=>{for(const s of r||Object.keys(e)){const i=le(e,s);if(i){const{_f:o,...a}=i;if(o){if(o.refs&&o.refs[0]&&t(o.refs[0],s)&&!n)break;if(o.ref&&t(o.ref,o.name)&&!n)break;ml(a,t)}else qt(a)&&ml(a,t)}}};var W5=(e,t,r)=>{const n=pl(le(e,r));return dt(n,"root",t[r]),dt(e,r,n),e},Lv=e=>e.type==="file",Ks=e=>typeof e=="function",wd=e=>{if(!Ov)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Au=e=>In(e),Fv=e=>e.type==="radio",_d=e=>e instanceof RegExp;const S0={value:!1,isValid:!1},k0={value:!0,isValid:!0};var KC=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Ft(e[0].attributes.value)?Ft(e[0].value)||e[0].value===""?k0:{value:e[0].value,isValid:!0}:k0:S0}return S0};const C0={isValid:!1,value:null};var GC=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,C0):C0;function E0(e,t,r="validate"){if(Au(e)||Array.isArray(e)&&e.every(Au)||On(e)&&!e)return{type:r,message:Au(e)?e:"",ref:t}}var go=e=>qt(e)&&!_d(e)?e:{value:e,message:""},j0=async(e,t,r,n,s)=>{const{ref:i,refs:o,required:a,maxLength:l,minLength:u,min:d,max:f,pattern:g,validate:h,name:y,valueAsNumber:m,mount:w,disabled:v}=e._f,p=le(t,y);if(!w||v)return{};const _=o?o[0]:i,C=T=>{n&&_.reportValidity&&(_.setCustomValidity(On(T)?"":T||""),_.reportValidity())},E={},j=Fv(i),R=kc(i),D=j||R,P=(m||Lv(i))&&Ft(i.value)&&Ft(p)||wd(i)&&i.value===""||p===""||Array.isArray(p)&&!p.length,L=ZC.bind(null,y,r,E),q=(T,F,b,W=ts.maxLength,te=ts.minLength)=>{const $=T?F:b;E[y]={type:T?W:te,message:$,ref:i,...L(T?W:te,$)}};if(s?!Array.isArray(p)||!p.length:a&&(!D&&(P||hr(p))||On(p)&&!p||R&&!KC(o).isValid||j&&!GC(o).isValid)){const{value:T,message:F}=Au(a)?{value:!!a,message:a}:go(a);if(T&&(E[y]={type:ts.required,message:F,ref:_,...L(ts.required,F)},!r))return C(F),E}if(!P&&(!hr(d)||!hr(f))){let T,F;const b=go(f),W=go(d);if(!hr(p)&&!isNaN(p)){const te=i.valueAsNumber||p&&+p;hr(b.value)||(T=te>b.value),hr(W.value)||(F=tenew Date(new Date().toDateString()+" "+Q),Z=i.type=="time",I=i.type=="week";In(b.value)&&p&&(T=Z?$(p)>$(b.value):I?p>b.value:te>new Date(b.value)),In(W.value)&&p&&(F=Z?$(p)<$(W.value):I?p+T.value,W=!hr(F.value)&&p.length<+F.value;if((b||W)&&(q(b,T.message,F.message),!r))return C(E[y].message),E}if(g&&!P&&In(p)){const{value:T,message:F}=go(g);if(_d(T)&&!p.match(T)&&(E[y]={type:ts.pattern,message:F,ref:i,...L(ts.pattern,F)},!r))return C(F),E}if(h){if(Ks(h)){const T=await h(p,t),F=E0(T,_);if(F&&(E[y]={...F,...L(ts.validate,F.message)},!r))return C(F.message),E}else if(qt(h)){let T={};for(const F in h){if(!Nr(T)&&!r)break;const b=E0(await h[F](p,t),_,F);b&&(T={...b,...L(F,b.message)},C(b.message),r&&(E[y]=T))}if(!Nr(T)&&(E[y]={ref:_,...T},!r))return E}}return C(!0),E};function $5(e,t){const r=t.slice(0,-1).length;let n=0;for(;n{let e=[];return{get observers(){return e},next:s=>{for(const i of e)i.next&&i.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(i=>i!==s)}}),unsubscribe:()=>{e=[]}}},bd=e=>hr(e)||!FC(e);function Oi(e,t){if(bd(e)||bd(t))return e===t;if(Ao(e)&&Ao(t))return e.getTime()===t.getTime();const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(const s of r){const i=e[s];if(!n.includes(s))return!1;if(s!=="ref"){const o=t[s];if(Ao(i)&&Ao(o)||qt(i)&&qt(o)||Array.isArray(i)&&Array.isArray(o)?!Oi(i,o):i!==o)return!1}}return!0}var qC=e=>e.type==="select-multiple",H5=e=>Fv(e)||kc(e),Lh=e=>wd(e)&&e.isConnected,XC=e=>{for(const t in e)if(Ks(e[t]))return!0;return!1};function Sd(e,t={}){const r=Array.isArray(e);if(qt(e)||r)for(const n in e)Array.isArray(e[n])||qt(e[n])&&!XC(e[n])?(t[n]=Array.isArray(e[n])?[]:{},Sd(e[n],t[n])):hr(e[n])||(t[n]=!0);return t}function QC(e,t,r){const n=Array.isArray(e);if(qt(e)||n)for(const s in e)Array.isArray(e[s])||qt(e[s])&&!XC(e[s])?Ft(t)||bd(r[s])?r[s]=Array.isArray(e[s])?Sd(e[s],[]):{...Sd(e[s])}:QC(e[s],hr(t)?{}:t[s],r[s]):r[s]=!Oi(e[s],t[s]);return r}var du=(e,t)=>QC(e,t,Sd(t)),JC=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Ft(e)?e:t?e===""?NaN:e&&+e:r&&In(e)?new Date(e):n?n(e):e;function Fh(e){const t=e.ref;if(!(e.refs?e.refs.every(r=>r.disabled):t.disabled))return Lv(t)?t.files:Fv(t)?GC(e.refs).value:qC(t)?[...t.selectedOptions].map(({value:r})=>r):kc(t)?KC(e.refs).value:JC(Ft(t.value)?e.ref.value:t.value,e)}var Y5=(e,t,r,n)=>{const s={};for(const i of e){const o=le(t,i);o&&dt(s,i,o._f)}return{criteriaMode:r,names:[...e],fields:s,shouldUseNativeValidation:n}},Ba=e=>Ft(e)?e:_d(e)?e.source:qt(e)?_d(e.value)?e.value.source:e.value:e,Z5=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function T0(e,t,r){const n=le(e,r);if(n||Mv(r))return{error:n,name:r};const s=r.split(".");for(;s.length;){const i=s.join("."),o=le(t,i),a=le(e,i);if(o&&!Array.isArray(o)&&r!==i)return{name:r};if(a&&a.type)return{name:i,error:a};s.pop()}return{name:r}}var K5=(e,t,r,n,s)=>s.isOnAll?!1:!r&&s.isOnTouch?!(t||e):(r?n.isOnBlur:s.isOnBlur)?!e:(r?n.isOnChange:s.isOnChange)?e:!0,G5=(e,t)=>!Af(le(e,t)).length&&Ht(e,t);const q5={mode:dn.onSubmit,reValidateMode:dn.onChange,shouldFocusError:!0};function X5(e={}){let t={...q5,...e},r={submitCount:0,isDirty:!1,isLoading:Ks(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},n={},s=qt(t.defaultValues)||qt(t.values)?wr(t.defaultValues||t.values)||{}:{},i=t.shouldUnregister?{}:wr(s),o={action:!1,mount:!1,watch:!1},a={mount:new Set,unMount:new Set,array:new Set,watch:new Set},l,u=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},f={values:Ih(),array:Ih(),state:Ih()},g=_0(t.mode),h=_0(t.reValidateMode),y=t.criteriaMode===dn.all,m=S=>N=>{clearTimeout(u),u=setTimeout(S,N)},w=async S=>{if(d.isValid||S){const N=t.resolver?Nr((await D()).errors):await L(n,!0);N!==r.isValid&&f.state.next({isValid:N})}},v=(S,N)=>{(d.isValidating||d.validatingFields)&&((S||Array.from(a.mount)).forEach(O=>{O&&(N?dt(r.validatingFields,O,N):Ht(r.validatingFields,O))}),f.state.next({validatingFields:r.validatingFields,isValidating:!Nr(r.validatingFields)}))},p=(S,N=[],O,Y,M=!0,H=!0)=>{if(Y&&O){if(o.action=!0,H&&Array.isArray(le(n,S))){const X=O(le(n,S),Y.argA,Y.argB);M&&dt(n,S,X)}if(H&&Array.isArray(le(r.errors,S))){const X=O(le(r.errors,S),Y.argA,Y.argB);M&&dt(r.errors,S,X),G5(r.errors,S)}if(d.touchedFields&&H&&Array.isArray(le(r.touchedFields,S))){const X=O(le(r.touchedFields,S),Y.argA,Y.argB);M&&dt(r.touchedFields,S,X)}d.dirtyFields&&(r.dirtyFields=du(s,i)),f.state.next({name:S,isDirty:T(S,N),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else dt(i,S,N)},_=(S,N)=>{dt(r.errors,S,N),f.state.next({errors:r.errors})},C=S=>{r.errors=S,f.state.next({errors:r.errors,isValid:!1})},E=(S,N,O,Y)=>{const M=le(n,S);if(M){const H=le(i,S,Ft(O)?le(s,S):O);Ft(H)||Y&&Y.defaultChecked||N?dt(i,S,N?H:Fh(M._f)):W(S,H),o.mount&&w()}},j=(S,N,O,Y,M)=>{let H=!1,X=!1;const ee={name:S},he=!!(le(n,S)&&le(n,S)._f&&le(n,S)._f.disabled);if(!O||Y){d.isDirty&&(X=r.isDirty,r.isDirty=ee.isDirty=T(),H=X!==ee.isDirty);const Be=he||Oi(le(s,S),N);X=!!(!he&&le(r.dirtyFields,S)),Be||he?Ht(r.dirtyFields,S):dt(r.dirtyFields,S,!0),ee.dirtyFields=r.dirtyFields,H=H||d.dirtyFields&&X!==!Be}if(O){const Be=le(r.touchedFields,S);Be||(dt(r.touchedFields,S,O),ee.touchedFields=r.touchedFields,H=H||d.touchedFields&&Be!==O)}return H&&M&&f.state.next(ee),H?ee:{}},R=(S,N,O,Y)=>{const M=le(r.errors,S),H=d.isValid&&On(N)&&r.isValid!==N;if(e.delayError&&O?(l=m(()=>_(S,O)),l(e.delayError)):(clearTimeout(u),l=null,O?dt(r.errors,S,O):Ht(r.errors,S)),(O?!Oi(M,O):M)||!Nr(Y)||H){const X={...Y,...H&&On(N)?{isValid:N}:{},errors:r.errors,name:S};r={...r,...X},f.state.next(X)}},D=async S=>{v(S,!0);const N=await t.resolver(i,t.context,Y5(S||a.mount,n,t.criteriaMode,t.shouldUseNativeValidation));return v(S),N},P=async S=>{const{errors:N}=await D(S);if(S)for(const O of S){const Y=le(N,O);Y?dt(r.errors,O,Y):Ht(r.errors,O)}else r.errors=N;return N},L=async(S,N,O={valid:!0})=>{for(const Y in S){const M=S[Y];if(M){const{_f:H,...X}=M;if(H){const ee=a.array.has(H.name);v([Y],!0);const he=await j0(M,i,y,t.shouldUseNativeValidation&&!N,ee);if(v([Y]),he[H.name]&&(O.valid=!1,N))break;!N&&(le(he,H.name)?ee?W5(r.errors,he,H.name):dt(r.errors,H.name,he[H.name]):Ht(r.errors,H.name))}X&&await L(X,N,O)}}return O.valid},q=()=>{for(const S of a.unMount){const N=le(n,S);N&&(N._f.refs?N._f.refs.every(O=>!Lh(O)):!Lh(N._f.ref))&&Pe(S)}a.unMount=new Set},T=(S,N)=>(S&&N&&dt(i,S,N),!Oi(z(),s)),F=(S,N,O)=>YC(S,a,{...o.mount?i:Ft(N)?s:In(S)?{[S]:N}:N},O,N),b=S=>Af(le(o.mount?i:s,S,e.shouldUnregister?le(s,S,[]):[])),W=(S,N,O={})=>{const Y=le(n,S);let M=N;if(Y){const H=Y._f;H&&(!H.disabled&&dt(i,S,JC(N,H)),M=wd(H.ref)&&hr(N)?"":N,qC(H.ref)?[...H.ref.options].forEach(X=>X.selected=M.includes(X.value)):H.refs?kc(H.ref)?H.refs.length>1?H.refs.forEach(X=>(!X.defaultChecked||!X.disabled)&&(X.checked=Array.isArray(M)?!!M.find(ee=>ee===X.value):M===X.value)):H.refs[0]&&(H.refs[0].checked=!!M):H.refs.forEach(X=>X.checked=X.value===M):Lv(H.ref)?H.ref.value="":(H.ref.value=M,H.ref.type||f.values.next({name:S,values:{...i}})))}(O.shouldDirty||O.shouldTouch)&&j(S,M,O.shouldTouch,O.shouldDirty,!0),O.shouldValidate&&Q(S)},te=(S,N,O)=>{for(const Y in N){const M=N[Y],H=`${S}.${Y}`,X=le(n,H);(a.array.has(S)||!bd(M)||X&&!X._f)&&!Ao(M)?te(H,M,O):W(H,M,O)}},$=(S,N,O={})=>{const Y=le(n,S),M=a.array.has(S),H=wr(N);dt(i,S,H),M?(f.array.next({name:S,values:{...i}}),(d.isDirty||d.dirtyFields)&&O.shouldDirty&&f.state.next({name:S,dirtyFields:du(s,i),isDirty:T(S,H)})):Y&&!Y._f&&!hr(H)?te(S,H,O):W(S,H,O),b0(S,a)&&f.state.next({...r}),f.values.next({name:o.mount?S:void 0,values:{...i}})},Z=async S=>{o.mount=!0;const N=S.target;let O=N.name,Y=!0;const M=le(n,O),H=()=>N.type?Fh(M._f):zC(S),X=ee=>{Y=Number.isNaN(ee)||ee===le(i,O,ee)};if(M){let ee,he;const Be=H(),ze=S.type===xd.BLUR||S.type===xd.FOCUS_OUT,Et=!Z5(M._f)&&!t.resolver&&!le(r.errors,O)&&!M._f.deps||K5(ze,le(r.touchedFields,O),r.isSubmitted,h,g),Wr=b0(O,a,ze);dt(i,O,Be),ze?(M._f.onBlur&&M._f.onBlur(S),l&&l(0)):M._f.onChange&&M._f.onChange(S);const Bt=j(O,Be,ze,!1),Gn=!Nr(Bt)||Wr;if(!ze&&f.values.next({name:O,type:S.type,values:{...i}}),Et)return d.isValid&&w(),Gn&&f.state.next({name:O,...Wr?{}:Bt});if(!ze&&Wr&&f.state.next({...r}),t.resolver){const{errors:it}=await D([O]);if(X(Be),Y){const qn=T0(r.errors,n,O),Xn=T0(it,n,qn.name||O);ee=Xn.error,O=Xn.name,he=Nr(it)}}else v([O],!0),ee=(await j0(M,i,y,t.shouldUseNativeValidation))[O],v([O]),X(Be),Y&&(ee?he=!1:d.isValid&&(he=await L(n,!0)));Y&&(M._f.deps&&Q(M._f.deps),R(O,he,ee,Bt))}},I=(S,N)=>{if(le(r.errors,N)&&S.focus)return S.focus(),1},Q=async(S,N={})=>{let O,Y;const M=pl(S);if(t.resolver){const H=await P(Ft(S)?S:M);O=Nr(H),Y=S?!M.some(X=>le(H,X)):O}else S?(Y=(await Promise.all(M.map(async H=>{const X=le(n,H);return await L(X&&X._f?{[H]:X}:X)}))).every(Boolean),!(!Y&&!r.isValid)&&w()):Y=O=await L(n);return f.state.next({...!In(S)||d.isValid&&O!==r.isValid?{}:{name:S},...t.resolver||!S?{isValid:O}:{},errors:r.errors}),N.shouldFocus&&!Y&&ml(n,I,S?M:a.mount),Y},z=S=>{const N={...o.mount?i:s};return Ft(S)?N:In(S)?le(N,S):S.map(O=>le(N,O))},V=(S,N)=>({invalid:!!le((N||r).errors,S),isDirty:!!le((N||r).dirtyFields,S),error:le((N||r).errors,S),isValidating:!!le(r.validatingFields,S),isTouched:!!le((N||r).touchedFields,S)}),de=S=>{S&&pl(S).forEach(N=>Ht(r.errors,N)),f.state.next({errors:S?r.errors:{}})},ne=(S,N,O)=>{const Y=(le(n,S,{_f:{}})._f||{}).ref,M=le(r.errors,S)||{},{ref:H,message:X,type:ee,...he}=M;dt(r.errors,S,{...he,...N,ref:Y}),f.state.next({name:S,errors:r.errors,isValid:!1}),O&&O.shouldFocus&&Y&&Y.focus&&Y.focus()},se=(S,N)=>Ks(S)?f.values.subscribe({next:O=>S(F(void 0,N),O)}):F(S,N,!0),Pe=(S,N={})=>{for(const O of S?pl(S):a.mount)a.mount.delete(O),a.array.delete(O),N.keepValue||(Ht(n,O),Ht(i,O)),!N.keepError&&Ht(r.errors,O),!N.keepDirty&&Ht(r.dirtyFields,O),!N.keepTouched&&Ht(r.touchedFields,O),!N.keepIsValidating&&Ht(r.validatingFields,O),!t.shouldUnregister&&!N.keepDefaultValue&&Ht(s,O);f.values.next({values:{...i}}),f.state.next({...r,...N.keepDirty?{isDirty:T()}:{}}),!N.keepIsValid&&w()},fe=({disabled:S,name:N,field:O,fields:Y,value:M})=>{if(On(S)&&o.mount||S){const H=S?void 0:Ft(M)?Fh(O?O._f:le(Y,N)._f):M;dt(i,N,H),j(N,H,!1,!1,!0)}},ve=(S,N={})=>{let O=le(n,S);const Y=On(N.disabled);return dt(n,S,{...O||{},_f:{...O&&O._f?O._f:{ref:{name:S}},name:S,mount:!0,...N}}),a.mount.add(S),O?fe({field:O,disabled:N.disabled,name:S,value:N.value}):E(S,!0,N.value),{...Y?{disabled:N.disabled}:{},...t.progressive?{required:!!N.required,min:Ba(N.min),max:Ba(N.max),minLength:Ba(N.minLength),maxLength:Ba(N.maxLength),pattern:Ba(N.pattern)}:{},name:S,onChange:Z,onBlur:Z,ref:M=>{if(M){ve(S,N),O=le(n,S);const H=Ft(M.value)&&M.querySelectorAll&&M.querySelectorAll("input,select,textarea")[0]||M,X=H5(H),ee=O._f.refs||[];if(X?ee.find(he=>he===H):H===O._f.ref)return;dt(n,S,{_f:{...O._f,...X?{refs:[...ee.filter(Lh),H,...Array.isArray(le(s,S))?[{}]:[]],ref:{type:H.type,name:S}}:{ref:H}}}),E(S,!1,void 0,H)}else O=le(n,S,{}),O._f&&(O._f.mount=!1),(t.shouldUnregister||N.shouldUnregister)&&!(UC(a.array,S)&&o.action)&&a.unMount.add(S)}}},Se=()=>t.shouldFocusError&&ml(n,I,a.mount),Ie=S=>{On(S)&&(f.state.next({disabled:S}),ml(n,(N,O)=>{const Y=le(n,O);Y&&(N.disabled=Y._f.disabled||S,Array.isArray(Y._f.refs)&&Y._f.refs.forEach(M=>{M.disabled=Y._f.disabled||S}))},0,!1))},De=(S,N)=>async O=>{let Y;O&&(O.preventDefault&&O.preventDefault(),O.persist&&O.persist());let M=wr(i);if(f.state.next({isSubmitting:!0}),t.resolver){const{errors:H,values:X}=await D();r.errors=H,M=X}else await L(n);if(Ht(r.errors,"root"),Nr(r.errors)){f.state.next({errors:{}});try{await S(M,O)}catch(H){Y=H}}else N&&await N({...r.errors},O),Se(),setTimeout(Se);if(f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Nr(r.errors)&&!Y,submitCount:r.submitCount+1,errors:r.errors}),Y)throw Y},Ce=(S,N={})=>{le(n,S)&&(Ft(N.defaultValue)?$(S,wr(le(s,S))):($(S,N.defaultValue),dt(s,S,wr(N.defaultValue))),N.keepTouched||Ht(r.touchedFields,S),N.keepDirty||(Ht(r.dirtyFields,S),r.isDirty=N.defaultValue?T(S,wr(le(s,S))):T()),N.keepError||(Ht(r.errors,S),d.isValid&&w()),f.state.next({...r}))},rt=(S,N={})=>{const O=S?wr(S):s,Y=wr(O),M=Nr(S),H=M?s:Y;if(N.keepDefaultValues||(s=O),!N.keepValues){if(N.keepDirtyValues)for(const X of a.mount)le(r.dirtyFields,X)?dt(H,X,le(i,X)):$(X,le(H,X));else{if(Ov&&Ft(S))for(const X of a.mount){const ee=le(n,X);if(ee&&ee._f){const he=Array.isArray(ee._f.refs)?ee._f.refs[0]:ee._f.ref;if(wd(he)){const Be=he.closest("form");if(Be){Be.reset();break}}}}n={}}i=e.shouldUnregister?N.keepDefaultValues?wr(s):{}:wr(H),f.array.next({values:{...H}}),f.values.next({values:{...H}})}a={mount:N.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!d.isValid||!!N.keepIsValid||!!N.keepDirtyValues,o.watch=!!e.shouldUnregister,f.state.next({submitCount:N.keepSubmitCount?r.submitCount:0,isDirty:M?!1:N.keepDirty?r.isDirty:!!(N.keepDefaultValues&&!Oi(S,s)),isSubmitted:N.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:M?{}:N.keepDirtyValues?N.keepDefaultValues&&i?du(s,i):r.dirtyFields:N.keepDefaultValues&&S?du(s,S):N.keepDirty?r.dirtyFields:{},touchedFields:N.keepTouched?r.touchedFields:{},errors:N.keepErrors?r.errors:{},isSubmitSuccessful:N.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},k=(S,N)=>rt(Ks(S)?S(i):S,N);return{control:{register:ve,unregister:Pe,getFieldState:V,handleSubmit:De,setError:ne,_executeSchema:D,_getWatch:F,_getDirty:T,_updateValid:w,_removeUnmounted:q,_updateFieldArray:p,_updateDisabledField:fe,_getFieldArray:b,_reset:rt,_resetDefaultValues:()=>Ks(t.defaultValues)&&t.defaultValues().then(S=>{k(S,t.resetOptions),f.state.next({isLoading:!1})}),_updateFormState:S=>{r={...r,...S}},_disableForm:Ie,_subjects:f,_proxyFormState:d,_setErrors:C,get _fields(){return n},get _formValues(){return i},get _state(){return o},set _state(S){o=S},get _defaultValues(){return s},get _names(){return a},set _names(S){a=S},get _formState(){return r},set _formState(S){r=S},get _options(){return t},set _options(S){t={...t,...S}}},trigger:Q,register:ve,handleSubmit:De,watch:se,setValue:$,getValues:z,reset:k,resetField:Ce,clearErrors:de,unregister:Pe,setError:ne,setFocus:(S,N={})=>{const O=le(n,S),Y=O&&O._f;if(Y){const M=Y.refs?Y.refs[0]:Y.ref;M.focus&&(M.focus(),N.shouldSelect&&M.select())}},getFieldState:V}}function tn(e={}){const t=et.useRef(),r=et.useRef(),[n,s]=et.useState({isDirty:!1,isValidating:!1,isLoading:Ks(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:Ks(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...X5(e),formState:n});const i=t.current.control;return i._options=e,Iv({subject:i._subjects.state,next:o=>{BC(o,i._proxyFormState,i._updateFormState,!0)&&s({...i._formState})}}),et.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),et.useEffect(()=>{if(i._proxyFormState.isDirty){const o=i._getDirty();o!==n.isDirty&&i._subjects.state.next({isDirty:o})}},[i,n.isDirty]),et.useEffect(()=>{e.values&&!Oi(e.values,r.current)?(i._reset(e.values,i._options.resetOptions),r.current=e.values,s(o=>({...o}))):i._resetDefaultValues()},[e.values,i]),et.useEffect(()=>{e.errors&&i._setErrors(e.errors)},[e.errors,i]),et.useEffect(()=>{i._state.mount||(i._updateValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),et.useEffect(()=>{e.shouldUnregister&&i._subjects.values.next({values:i._getWatch()})},[e.shouldUnregister,i]),t.current.formState=$C(n,i),t.current}const N0=(e,t,r)=>{if(e&&"reportValidity"in e){const n=le(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},eE=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?N0(n.ref,r,e):n.refs&&n.refs.forEach(s=>N0(s,r,e))}},Q5=(e,t)=>{t.shouldUseNativeValidation&&eE(e,t);const r={};for(const n in e){const s=le(t.fields,n),i=Object.assign(e[n]||{},{ref:s&&s.ref});if(J5(t.names||Object.keys(e),n)){const o=Object.assign({},le(r,n));dt(o,"root",i),dt(r,n,o)}else dt(r,n,i)}return r},J5=(e,t)=>e.some(r=>r.startsWith(t+"."));var e6=function(e,t){for(var r={};e.length;){var n=e[0],s=n.code,i=n.message,o=n.path.join(".");if(!r[o])if("unionErrors"in n){var a=n.unionErrors[0].errors[0];r[o]={message:a.message,type:a.code}}else r[o]={message:i,type:s};if("unionErrors"in n&&n.unionErrors.forEach(function(d){return d.errors.forEach(function(f){return e.push(f)})}),t){var l=r[o].types,u=l&&l[n.code];r[o]=ZC(o,t,r,s,u?[].concat(u,n.message):n.message)}e.shift()}return r},rn=function(e,t,r){return r===void 0&&(r={}),function(n,s,i){try{return Promise.resolve(function(o,a){try{var l=Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](n,t)).then(function(u){return i.shouldUseNativeValidation&&eE({},i),{errors:{},values:r.raw?n:u}})}catch(u){return a(u)}return l&&l.then?l.then(void 0,a):l}(0,function(o){if(function(a){return Array.isArray(a==null?void 0:a.errors)}(o))return{values:{},errors:Q5(e6(o.errors,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw o}))}catch(o){return Promise.reject(o)}}},nt;(function(e){e.assertEqual=s=>s;function t(s){}e.assertIs=t;function r(s){throw new Error}e.assertNever=r,e.arrayToEnum=s=>{const i={};for(const o of s)i[o]=o;return i},e.getValidEnumValues=s=>{const i=e.objectKeys(s).filter(a=>typeof s[s[a]]!="number"),o={};for(const a of i)o[a]=s[a];return e.objectValues(o)},e.objectValues=s=>e.objectKeys(s).map(function(i){return s[i]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const i=[];for(const o in s)Object.prototype.hasOwnProperty.call(s,o)&&i.push(o);return i},e.find=(s,i)=>{for(const o of s)if(i(o))return o},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function n(s,i=" | "){return s.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}e.joinValues=n,e.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})(nt||(nt={}));var im;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(im||(im={}));const xe=nt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),$s=e=>{switch(typeof e){case"undefined":return xe.undefined;case"string":return xe.string;case"number":return isNaN(e)?xe.nan:xe.number;case"boolean":return xe.boolean;case"function":return xe.function;case"bigint":return xe.bigint;case"symbol":return xe.symbol;case"object":return Array.isArray(e)?xe.array:e===null?xe.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?xe.promise:typeof Map<"u"&&e instanceof Map?xe.map:typeof Set<"u"&&e instanceof Set?xe.set:typeof Date<"u"&&e instanceof Date?xe.date:xe.object;default:return xe.unknown}},oe=nt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),t6=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Lr extends Error{constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const r=t||function(i){return i.message},n={_errors:[]},s=i=>{for(const o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(s);else if(o.code==="invalid_return_type")s(o.returnTypeError);else if(o.code==="invalid_arguments")s(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let a=n,l=0;for(;lr.message){const r={},n=[];for(const s of this.issues)s.path.length>0?(r[s.path[0]]=r[s.path[0]]||[],r[s.path[0]].push(t(s))):n.push(t(s));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}Lr.create=e=>new Lr(e);const ua=(e,t)=>{let r;switch(e.code){case oe.invalid_type:e.received===xe.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case oe.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,nt.jsonStringifyReplacer)}`;break;case oe.unrecognized_keys:r=`Unrecognized key(s) in object: ${nt.joinValues(e.keys,", ")}`;break;case oe.invalid_union:r="Invalid input";break;case oe.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${nt.joinValues(e.options)}`;break;case oe.invalid_enum_value:r=`Invalid enum value. Expected ${nt.joinValues(e.options)}, received '${e.received}'`;break;case oe.invalid_arguments:r="Invalid function arguments";break;case oe.invalid_return_type:r="Invalid function return type";break;case oe.invalid_date:r="Invalid date";break;case oe.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:nt.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case oe.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case oe.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case oe.custom:r="Invalid input";break;case oe.invalid_intersection_types:r="Intersection results could not be merged";break;case oe.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case oe.not_finite:r="Number must be finite";break;default:r=t.defaultError,nt.assertNever(e)}return{message:r}};let tE=ua;function r6(e){tE=e}function kd(){return tE}const Cd=e=>{const{data:t,path:r,errorMaps:n,issueData:s}=e,i=[...r,...s.path||[]],o={...s,path:i};if(s.message!==void 0)return{...s,path:i,message:s.message};let a="";const l=n.filter(u=>!!u).slice().reverse();for(const u of l)a=u(o,{data:t,defaultError:a}).message;return{...s,path:i,message:a}},n6=[];function me(e,t){const r=kd(),n=Cd({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===ua?void 0:ua].filter(s=>!!s)});e.common.issues.push(n)}class cr{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){const n=[];for(const s of r){if(s.status==="aborted")return $e;s.status==="dirty"&&t.dirty(),n.push(s.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){const n=[];for(const s of r){const i=await s.key,o=await s.value;n.push({key:i,value:o})}return cr.mergeObjectSync(t,n)}static mergeObjectSync(t,r){const n={};for(const s of r){const{key:i,value:o}=s;if(i.status==="aborted"||o.status==="aborted")return $e;i.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||s.alwaysSet)&&(n[i.value]=o.value)}return{status:t.value,value:n}}}const $e=Object.freeze({status:"aborted"}),Oo=e=>({status:"dirty",value:e}),mr=e=>({status:"valid",value:e}),om=e=>e.status==="aborted",am=e=>e.status==="dirty",Hl=e=>e.status==="valid",Yl=e=>typeof Promise<"u"&&e instanceof Promise;function Ed(e,t,r,n){if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function rE(e,t,r,n,s){if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,r),r}var je;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(je||(je={}));var Xa,Qa;class $n{constructor(t,r,n,s){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const R0=(e,t)=>{if(Hl(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new Lr(e.common.issues);return this._error=r,this._error}}};function He(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:s}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:(o,a)=>{var l,u;const{message:d}=e;return o.code==="invalid_enum_value"?{message:d??a.defaultError}:typeof a.data>"u"?{message:(l=d??n)!==null&&l!==void 0?l:a.defaultError}:o.code!=="invalid_type"?{message:a.defaultError}:{message:(u=d??r)!==null&&u!==void 0?u:a.defaultError}},description:s}}class qe{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return $s(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:$s(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new cr,ctx:{common:t.parent.common,data:t.data,parsedType:$s(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(Yl(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){const r=this._parse(t);return Promise.resolve(r)}parse(t,r){const n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){var n;const s={common:{issues:[],async:(n=r==null?void 0:r.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:$s(t)},i=this._parseSync({data:t,path:s.path,parent:s});return R0(s,i)}async parseAsync(t,r){const n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){const n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:$s(t)},s=this._parse({data:t,path:n.path,parent:n}),i=await(Yl(s)?s:Promise.resolve(s));return R0(n,i)}refine(t,r){const n=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,i)=>{const o=t(s),a=()=>i.addIssue({code:oe.custom,...n(s)});return typeof Promise<"u"&&o instanceof Promise?o.then(l=>l?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(t,r){return this._refinement((n,s)=>t(n)?!0:(s.addIssue(typeof r=="function"?r(n,s):r),!1))}_refinement(t){return new bn({schema:this,typeName:Ue.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Un.create(this,this._def)}nullable(){return hi.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return gn.create(this,this._def)}promise(){return fa.create(this,this._def)}or(t){return ql.create([this,t],this._def)}and(t){return Xl.create(this,t,this._def)}transform(t){return new bn({...He(this._def),schema:this,typeName:Ue.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r=typeof t=="function"?t:()=>t;return new rc({...He(this._def),innerType:this,defaultValue:r,typeName:Ue.ZodDefault})}brand(){return new zv({typeName:Ue.ZodBranded,type:this,...He(this._def)})}catch(t){const r=typeof t=="function"?t:()=>t;return new nc({...He(this._def),innerType:this,catchValue:r,typeName:Ue.ZodCatch})}describe(t){const r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Cc.create(this,t)}readonly(){return sc.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const s6=/^c[^\s-]{8,}$/i,i6=/^[0-9a-z]+$/,o6=/^[0-9A-HJKMNP-TV-Z]{26}$/,a6=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,l6=/^[a-z0-9_-]{21}$/i,c6=/^[-+]?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)?)??$/,u6=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,d6="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let zh;const f6=/^(?:(?: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])$/,h6=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,p6=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,nE="((\\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])))",m6=new RegExp(`^${nE}$`);function sE(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function g6(e){return new RegExp(`^${sE(e)}$`)}function iE(e){let t=`${nE}T${sE(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function v6(e,t){return!!((t==="v4"||!t)&&f6.test(e)||(t==="v6"||!t)&&h6.test(e))}class hn extends qe{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==xe.string){const i=this._getOrReturnCtx(t);return me(i,{code:oe.invalid_type,expected:xe.string,received:i.parsedType}),$e}const n=new cr;let s;for(const i of this._def.checks)if(i.kind==="min")t.data.lengthi.value&&(s=this._getOrReturnCtx(t,s),me(s,{code:oe.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){const o=t.data.length>i.value,a=t.data.lengtht.test(s),{validation:r,code:oe.invalid_string,...je.errToObj(n)})}_addCheck(t){return new hn({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...je.errToObj(t)})}url(t){return this._addCheck({kind:"url",...je.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...je.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...je.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...je.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...je.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...je.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...je.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...je.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...je.errToObj(t)})}datetime(t){var r,n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(r=t==null?void 0:t.offset)!==null&&r!==void 0?r:!1,local:(n=t==null?void 0:t.local)!==null&&n!==void 0?n:!1,...je.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...je.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...je.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...je.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...je.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...je.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...je.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...je.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...je.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...je.errToObj(r)})}nonempty(t){return this.min(1,je.errToObj(t))}trim(){return new hn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new hn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new hn({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value{var t;return new hn({checks:[],typeName:Ue.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...He(e)})};function y6(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,s=r>n?r:n,i=parseInt(e.toFixed(s).replace(".","")),o=parseInt(t.toFixed(s).replace(".",""));return i%o/Math.pow(10,s)}class ui extends qe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==xe.number){const i=this._getOrReturnCtx(t);return me(i,{code:oe.invalid_type,expected:xe.number,received:i.parsedType}),$e}let n;const s=new cr;for(const i of this._def.checks)i.kind==="int"?nt.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),me(n,{code:oe.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):i.kind==="min"?(i.inclusive?t.datai.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),me(n,{code:oe.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?y6(t.data,i.value)!==0&&(n=this._getOrReturnCtx(t,n),me(n,{code:oe.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),me(n,{code:oe.not_finite,message:i.message}),s.dirty()):nt.assertNever(i);return{status:s.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,je.toString(r))}gt(t,r){return this.setLimit("min",t,!1,je.toString(r))}lte(t,r){return this.setLimit("max",t,!0,je.toString(r))}lt(t,r){return this.setLimit("max",t,!1,je.toString(r))}setLimit(t,r,n,s){return new ui({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:je.toString(s)}]})}_addCheck(t){return new ui({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:je.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:je.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:je.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:je.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:je.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:je.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:je.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:je.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:je.toString(t)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuet.kind==="int"||t.kind==="multipleOf"&&nt.isInteger(t.value))}get isFinite(){let t=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.valuenew ui({checks:[],typeName:Ue.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...He(e)});class di extends qe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==xe.bigint){const i=this._getOrReturnCtx(t);return me(i,{code:oe.invalid_type,expected:xe.bigint,received:i.parsedType}),$e}let n;const s=new cr;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?t.datai.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),me(n,{code:oe.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),me(n,{code:oe.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):nt.assertNever(i);return{status:s.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,je.toString(r))}gt(t,r){return this.setLimit("min",t,!1,je.toString(r))}lte(t,r){return this.setLimit("max",t,!0,je.toString(r))}lt(t,r){return this.setLimit("max",t,!1,je.toString(r))}setLimit(t,r,n,s){return new di({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:je.toString(s)}]})}_addCheck(t){return new di({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:je.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:je.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:je.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:je.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:je.toString(r)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value{var t;return new di({checks:[],typeName:Ue.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...He(e)})};class Zl extends qe{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==xe.boolean){const n=this._getOrReturnCtx(t);return me(n,{code:oe.invalid_type,expected:xe.boolean,received:n.parsedType}),$e}return mr(t.data)}}Zl.create=e=>new Zl({typeName:Ue.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...He(e)});class Gi extends qe{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==xe.date){const i=this._getOrReturnCtx(t);return me(i,{code:oe.invalid_type,expected:xe.date,received:i.parsedType}),$e}if(isNaN(t.data.getTime())){const i=this._getOrReturnCtx(t);return me(i,{code:oe.invalid_date}),$e}const n=new cr;let s;for(const i of this._def.checks)i.kind==="min"?t.data.getTime()i.value&&(s=this._getOrReturnCtx(t,s),me(s,{code:oe.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):nt.assertNever(i);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Gi({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:je.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:je.toString(r)})}get minDate(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuenew Gi({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Ue.ZodDate,...He(e)});class jd extends qe{_parse(t){if(this._getType(t)!==xe.symbol){const n=this._getOrReturnCtx(t);return me(n,{code:oe.invalid_type,expected:xe.symbol,received:n.parsedType}),$e}return mr(t.data)}}jd.create=e=>new jd({typeName:Ue.ZodSymbol,...He(e)});class Kl extends qe{_parse(t){if(this._getType(t)!==xe.undefined){const n=this._getOrReturnCtx(t);return me(n,{code:oe.invalid_type,expected:xe.undefined,received:n.parsedType}),$e}return mr(t.data)}}Kl.create=e=>new Kl({typeName:Ue.ZodUndefined,...He(e)});class Gl extends qe{_parse(t){if(this._getType(t)!==xe.null){const n=this._getOrReturnCtx(t);return me(n,{code:oe.invalid_type,expected:xe.null,received:n.parsedType}),$e}return mr(t.data)}}Gl.create=e=>new Gl({typeName:Ue.ZodNull,...He(e)});class da extends qe{constructor(){super(...arguments),this._any=!0}_parse(t){return mr(t.data)}}da.create=e=>new da({typeName:Ue.ZodAny,...He(e)});class Fi extends qe{constructor(){super(...arguments),this._unknown=!0}_parse(t){return mr(t.data)}}Fi.create=e=>new Fi({typeName:Ue.ZodUnknown,...He(e)});class Ss extends qe{_parse(t){const r=this._getOrReturnCtx(t);return me(r,{code:oe.invalid_type,expected:xe.never,received:r.parsedType}),$e}}Ss.create=e=>new Ss({typeName:Ue.ZodNever,...He(e)});class Td extends qe{_parse(t){if(this._getType(t)!==xe.undefined){const n=this._getOrReturnCtx(t);return me(n,{code:oe.invalid_type,expected:xe.void,received:n.parsedType}),$e}return mr(t.data)}}Td.create=e=>new Td({typeName:Ue.ZodVoid,...He(e)});class gn extends qe{_parse(t){const{ctx:r,status:n}=this._processInputParams(t),s=this._def;if(r.parsedType!==xe.array)return me(r,{code:oe.invalid_type,expected:xe.array,received:r.parsedType}),$e;if(s.exactLength!==null){const o=r.data.length>s.exactLength.value,a=r.data.lengths.maxLength.value&&(me(r,{code:oe.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,a)=>s.type._parseAsync(new $n(r,o,r.path,a)))).then(o=>cr.mergeArray(n,o));const i=[...r.data].map((o,a)=>s.type._parseSync(new $n(r,o,r.path,a)));return cr.mergeArray(n,i)}get element(){return this._def.type}min(t,r){return new gn({...this._def,minLength:{value:t,message:je.toString(r)}})}max(t,r){return new gn({...this._def,maxLength:{value:t,message:je.toString(r)}})}length(t,r){return new gn({...this._def,exactLength:{value:t,message:je.toString(r)}})}nonempty(t){return this.min(1,t)}}gn.create=(e,t)=>new gn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ue.ZodArray,...He(t)});function yo(e){if(e instanceof Rt){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=Un.create(yo(n))}return new Rt({...e._def,shape:()=>t})}else return e instanceof gn?new gn({...e._def,type:yo(e.element)}):e instanceof Un?Un.create(yo(e.unwrap())):e instanceof hi?hi.create(yo(e.unwrap())):e instanceof Bn?Bn.create(e.items.map(t=>yo(t))):e}class Rt extends qe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),r=nt.objectKeys(t);return this._cached={shape:t,keys:r}}_parse(t){if(this._getType(t)!==xe.object){const u=this._getOrReturnCtx(t);return me(u,{code:oe.invalid_type,expected:xe.object,received:u.parsedType}),$e}const{status:n,ctx:s}=this._processInputParams(t),{shape:i,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof Ss&&this._def.unknownKeys==="strip"))for(const u in s.data)o.includes(u)||a.push(u);const l=[];for(const u of o){const d=i[u],f=s.data[u];l.push({key:{status:"valid",value:u},value:d._parse(new $n(s,f,s.path,u)),alwaysSet:u in s.data})}if(this._def.catchall instanceof Ss){const u=this._def.unknownKeys;if(u==="passthrough")for(const d of a)l.push({key:{status:"valid",value:d},value:{status:"valid",value:s.data[d]}});else if(u==="strict")a.length>0&&(me(s,{code:oe.unrecognized_keys,keys:a}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const d of a){const f=s.data[d];l.push({key:{status:"valid",value:d},value:u._parse(new $n(s,f,s.path,d)),alwaysSet:d in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const u=[];for(const d of l){const f=await d.key,g=await d.value;u.push({key:f,value:g,alwaysSet:d.alwaysSet})}return u}).then(u=>cr.mergeObjectSync(n,u)):cr.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(t){return je.errToObj,new Rt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var s,i,o,a;const l=(o=(i=(s=this._def).errorMap)===null||i===void 0?void 0:i.call(s,r,n).message)!==null&&o!==void 0?o:n.defaultError;return r.code==="unrecognized_keys"?{message:(a=je.errToObj(t).message)!==null&&a!==void 0?a:l}:{message:l}}}:{}})}strip(){return new Rt({...this._def,unknownKeys:"strip"})}passthrough(){return new Rt({...this._def,unknownKeys:"passthrough"})}extend(t){return new Rt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Rt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Ue.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new Rt({...this._def,catchall:t})}pick(t){const r={};return nt.objectKeys(t).forEach(n=>{t[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new Rt({...this._def,shape:()=>r})}omit(t){const r={};return nt.objectKeys(this.shape).forEach(n=>{t[n]||(r[n]=this.shape[n])}),new Rt({...this._def,shape:()=>r})}deepPartial(){return yo(this)}partial(t){const r={};return nt.objectKeys(this.shape).forEach(n=>{const s=this.shape[n];t&&!t[n]?r[n]=s:r[n]=s.optional()}),new Rt({...this._def,shape:()=>r})}required(t){const r={};return nt.objectKeys(this.shape).forEach(n=>{if(t&&!t[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof Un;)i=i._def.innerType;r[n]=i}}),new Rt({...this._def,shape:()=>r})}keyof(){return oE(nt.objectKeys(this.shape))}}Rt.create=(e,t)=>new Rt({shape:()=>e,unknownKeys:"strip",catchall:Ss.create(),typeName:Ue.ZodObject,...He(t)});Rt.strictCreate=(e,t)=>new Rt({shape:()=>e,unknownKeys:"strict",catchall:Ss.create(),typeName:Ue.ZodObject,...He(t)});Rt.lazycreate=(e,t)=>new Rt({shape:e,unknownKeys:"strip",catchall:Ss.create(),typeName:Ue.ZodObject,...He(t)});class ql extends qe{_parse(t){const{ctx:r}=this._processInputParams(t),n=this._def.options;function s(i){for(const a of i)if(a.result.status==="valid")return a.result;for(const a of i)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;const o=i.map(a=>new Lr(a.ctx.common.issues));return me(r,{code:oe.invalid_union,unionErrors:o}),$e}if(r.common.async)return Promise.all(n.map(async i=>{const o={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(s);{let i;const o=[];for(const l of n){const u={...r,common:{...r.common,issues:[]},parent:null},d=l._parseSync({data:r.data,path:r.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!i&&(i={result:d,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;const a=o.map(l=>new Lr(l));return me(r,{code:oe.invalid_union,unionErrors:a}),$e}}get options(){return this._def.options}}ql.create=(e,t)=>new ql({options:e,typeName:Ue.ZodUnion,...He(t)});const rs=e=>e instanceof Jl?rs(e.schema):e instanceof bn?rs(e.innerType()):e instanceof ec?[e.value]:e instanceof fi?e.options:e instanceof tc?nt.objectValues(e.enum):e instanceof rc?rs(e._def.innerType):e instanceof Kl?[void 0]:e instanceof Gl?[null]:e instanceof Un?[void 0,...rs(e.unwrap())]:e instanceof hi?[null,...rs(e.unwrap())]:e instanceof zv||e instanceof sc?rs(e.unwrap()):e instanceof nc?rs(e._def.innerType):[];class Mf extends qe{_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==xe.object)return me(r,{code:oe.invalid_type,expected:xe.object,received:r.parsedType}),$e;const n=this.discriminator,s=r.data[n],i=this.optionsMap.get(s);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(me(r,{code:oe.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),$e)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){const s=new Map;for(const i of r){const o=rs(i.shape[t]);if(!o.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of o){if(s.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);s.set(a,i)}}return new Mf({typeName:Ue.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:s,...He(n)})}}function lm(e,t){const r=$s(e),n=$s(t);if(e===t)return{valid:!0,data:e};if(r===xe.object&&n===xe.object){const s=nt.objectKeys(t),i=nt.objectKeys(e).filter(a=>s.indexOf(a)!==-1),o={...e,...t};for(const a of i){const l=lm(e[a],t[a]);if(!l.valid)return{valid:!1};o[a]=l.data}return{valid:!0,data:o}}else if(r===xe.array&&n===xe.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let i=0;i{if(om(i)||om(o))return $e;const a=lm(i.value,o.value);return a.valid?((am(i)||am(o))&&r.dirty(),{status:r.value,value:a.data}):(me(n,{code:oe.invalid_intersection_types}),$e)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,o])=>s(i,o)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Xl.create=(e,t,r)=>new Xl({left:e,right:t,typeName:Ue.ZodIntersection,...He(r)});class Bn extends qe{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==xe.array)return me(n,{code:oe.invalid_type,expected:xe.array,received:n.parsedType}),$e;if(n.data.lengththis._def.items.length&&(me(n,{code:oe.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const i=[...n.data].map((o,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new $n(n,o,n.path,a)):null}).filter(o=>!!o);return n.common.async?Promise.all(i).then(o=>cr.mergeArray(r,o)):cr.mergeArray(r,i)}get items(){return this._def.items}rest(t){return new Bn({...this._def,rest:t})}}Bn.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Bn({items:e,typeName:Ue.ZodTuple,rest:null,...He(t)})};class Ql extends qe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==xe.object)return me(n,{code:oe.invalid_type,expected:xe.object,received:n.parsedType}),$e;const s=[],i=this._def.keyType,o=this._def.valueType;for(const a in n.data)s.push({key:i._parse(new $n(n,a,n.path,a)),value:o._parse(new $n(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?cr.mergeObjectAsync(r,s):cr.mergeObjectSync(r,s)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof qe?new Ql({keyType:t,valueType:r,typeName:Ue.ZodRecord,...He(n)}):new Ql({keyType:hn.create(),valueType:t,typeName:Ue.ZodRecord,...He(r)})}}class Nd extends qe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==xe.map)return me(n,{code:oe.invalid_type,expected:xe.map,received:n.parsedType}),$e;const s=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map(([a,l],u)=>({key:s._parse(new $n(n,a,n.path,[u,"key"])),value:i._parse(new $n(n,l,n.path,[u,"value"]))}));if(n.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of o){const u=await l.key,d=await l.value;if(u.status==="aborted"||d.status==="aborted")return $e;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),a.set(u.value,d.value)}return{status:r.value,value:a}})}else{const a=new Map;for(const l of o){const u=l.key,d=l.value;if(u.status==="aborted"||d.status==="aborted")return $e;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),a.set(u.value,d.value)}return{status:r.value,value:a}}}}Nd.create=(e,t,r)=>new Nd({valueType:t,keyType:e,typeName:Ue.ZodMap,...He(r)});class qi extends qe{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==xe.set)return me(n,{code:oe.invalid_type,expected:xe.set,received:n.parsedType}),$e;const s=this._def;s.minSize!==null&&n.data.sizes.maxSize.value&&(me(n,{code:oe.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());const i=this._def.valueType;function o(l){const u=new Set;for(const d of l){if(d.status==="aborted")return $e;d.status==="dirty"&&r.dirty(),u.add(d.value)}return{status:r.value,value:u}}const a=[...n.data.values()].map((l,u)=>i._parse(new $n(n,l,n.path,u)));return n.common.async?Promise.all(a).then(l=>o(l)):o(a)}min(t,r){return new qi({...this._def,minSize:{value:t,message:je.toString(r)}})}max(t,r){return new qi({...this._def,maxSize:{value:t,message:je.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}}qi.create=(e,t)=>new qi({valueType:e,minSize:null,maxSize:null,typeName:Ue.ZodSet,...He(t)});class Jo extends qe{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==xe.function)return me(r,{code:oe.invalid_type,expected:xe.function,received:r.parsedType}),$e;function n(a,l){return Cd({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,kd(),ua].filter(u=>!!u),issueData:{code:oe.invalid_arguments,argumentsError:l}})}function s(a,l){return Cd({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,kd(),ua].filter(u=>!!u),issueData:{code:oe.invalid_return_type,returnTypeError:l}})}const i={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof fa){const a=this;return mr(async function(...l){const u=new Lr([]),d=await a._def.args.parseAsync(l,i).catch(h=>{throw u.addIssue(n(l,h)),u}),f=await Reflect.apply(o,this,d);return await a._def.returns._def.type.parseAsync(f,i).catch(h=>{throw u.addIssue(s(f,h)),u})})}else{const a=this;return mr(function(...l){const u=a._def.args.safeParse(l,i);if(!u.success)throw new Lr([n(l,u.error)]);const d=Reflect.apply(o,this,u.data),f=a._def.returns.safeParse(d,i);if(!f.success)throw new Lr([s(d,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Jo({...this._def,args:Bn.create(t).rest(Fi.create())})}returns(t){return new Jo({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new Jo({args:t||Bn.create([]).rest(Fi.create()),returns:r||Fi.create(),typeName:Ue.ZodFunction,...He(n)})}}class Jl extends qe{get schema(){return this._def.getter()}_parse(t){const{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}Jl.create=(e,t)=>new Jl({getter:e,typeName:Ue.ZodLazy,...He(t)});class ec extends qe{_parse(t){if(t.data!==this._def.value){const r=this._getOrReturnCtx(t);return me(r,{received:r.data,code:oe.invalid_literal,expected:this._def.value}),$e}return{status:"valid",value:t.data}}get value(){return this._def.value}}ec.create=(e,t)=>new ec({value:e,typeName:Ue.ZodLiteral,...He(t)});function oE(e,t){return new fi({values:e,typeName:Ue.ZodEnum,...He(t)})}class fi extends qe{constructor(){super(...arguments),Xa.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),n=this._def.values;return me(r,{expected:nt.joinValues(n),received:r.parsedType,code:oe.invalid_type}),$e}if(Ed(this,Xa)||rE(this,Xa,new Set(this._def.values)),!Ed(this,Xa).has(t.data)){const r=this._getOrReturnCtx(t),n=this._def.values;return me(r,{received:r.data,code:oe.invalid_enum_value,options:n}),$e}return mr(t.data)}get options(){return this._def.values}get enum(){const t={};for(const r of this._def.values)t[r]=r;return t}get Values(){const t={};for(const r of this._def.values)t[r]=r;return t}get Enum(){const t={};for(const r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return fi.create(t,{...this._def,...r})}exclude(t,r=this._def){return fi.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}}Xa=new WeakMap;fi.create=oE;class tc extends qe{constructor(){super(...arguments),Qa.set(this,void 0)}_parse(t){const r=nt.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==xe.string&&n.parsedType!==xe.number){const s=nt.objectValues(r);return me(n,{expected:nt.joinValues(s),received:n.parsedType,code:oe.invalid_type}),$e}if(Ed(this,Qa)||rE(this,Qa,new Set(nt.getValidEnumValues(this._def.values))),!Ed(this,Qa).has(t.data)){const s=nt.objectValues(r);return me(n,{received:n.data,code:oe.invalid_enum_value,options:s}),$e}return mr(t.data)}get enum(){return this._def.values}}Qa=new WeakMap;tc.create=(e,t)=>new tc({values:e,typeName:Ue.ZodNativeEnum,...He(t)});class fa extends qe{unwrap(){return this._def.type}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==xe.promise&&r.common.async===!1)return me(r,{code:oe.invalid_type,expected:xe.promise,received:r.parsedType}),$e;const n=r.parsedType===xe.promise?r.data:Promise.resolve(r.data);return mr(n.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}}fa.create=(e,t)=>new fa({type:e,typeName:Ue.ZodPromise,...He(t)});class bn extends qe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ue.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:r,ctx:n}=this._processInputParams(t),s=this._def.effect||null,i={addIssue:o=>{me(n,o),o.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),s.type==="preprocess"){const o=s.transform(n.data,i);if(n.common.async)return Promise.resolve(o).then(async a=>{if(r.value==="aborted")return $e;const l=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return l.status==="aborted"?$e:l.status==="dirty"||r.value==="dirty"?Oo(l.value):l});{if(r.value==="aborted")return $e;const a=this._def.schema._parseSync({data:o,path:n.path,parent:n});return a.status==="aborted"?$e:a.status==="dirty"||r.value==="dirty"?Oo(a.value):a}}if(s.type==="refinement"){const o=a=>{const l=s.refinement(a,i);if(n.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){const a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?$e:(a.status==="dirty"&&r.dirty(),o(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?$e:(a.status==="dirty"&&r.dirty(),o(a.value).then(()=>({status:r.value,value:a.value}))))}if(s.type==="transform")if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Hl(o))return o;const a=s.transform(o.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>Hl(o)?Promise.resolve(s.transform(o.value,i)).then(a=>({status:r.value,value:a})):o);nt.assertNever(s)}}bn.create=(e,t,r)=>new bn({schema:e,typeName:Ue.ZodEffects,effect:t,...He(r)});bn.createWithPreprocess=(e,t,r)=>new bn({schema:t,effect:{type:"preprocess",transform:e},typeName:Ue.ZodEffects,...He(r)});class Un extends qe{_parse(t){return this._getType(t)===xe.undefined?mr(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Un.create=(e,t)=>new Un({innerType:e,typeName:Ue.ZodOptional,...He(t)});class hi extends qe{_parse(t){return this._getType(t)===xe.null?mr(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}hi.create=(e,t)=>new hi({innerType:e,typeName:Ue.ZodNullable,...He(t)});class rc extends qe{_parse(t){const{ctx:r}=this._processInputParams(t);let n=r.data;return r.parsedType===xe.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}rc.create=(e,t)=>new rc({innerType:e,typeName:Ue.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...He(t)});class nc extends qe{_parse(t){const{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Yl(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Lr(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Lr(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}nc.create=(e,t)=>new nc({innerType:e,typeName:Ue.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...He(t)});class Rd extends qe{_parse(t){if(this._getType(t)!==xe.nan){const n=this._getOrReturnCtx(t);return me(n,{code:oe.invalid_type,expected:xe.nan,received:n.parsedType}),$e}return{status:"valid",value:t.data}}}Rd.create=e=>new Rd({typeName:Ue.ZodNaN,...He(e)});const x6=Symbol("zod_brand");class zv extends qe{_parse(t){const{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class Cc extends qe{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?$e:i.status==="dirty"?(r.dirty(),Oo(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{const s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?$e:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(t,r){return new Cc({in:t,out:r,typeName:Ue.ZodPipeline})}}class sc extends qe{_parse(t){const r=this._def.innerType._parse(t),n=s=>(Hl(s)&&(s.value=Object.freeze(s.value)),s);return Yl(r)?r.then(s=>n(s)):n(r)}unwrap(){return this._def.innerType}}sc.create=(e,t)=>new sc({innerType:e,typeName:Ue.ZodReadonly,...He(t)});function aE(e,t={},r){return e?da.create().superRefine((n,s)=>{var i,o;if(!e(n)){const a=typeof t=="function"?t(n):typeof t=="string"?{message:t}:t,l=(o=(i=a.fatal)!==null&&i!==void 0?i:r)!==null&&o!==void 0?o:!0,u=typeof a=="string"?{message:a}:a;s.addIssue({code:"custom",...u,fatal:l})}}):da.create()}const w6={object:Rt.lazycreate};var Ue;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Ue||(Ue={}));const _6=(e,t={message:`Input not instance of ${e.name}`})=>aE(r=>r instanceof e,t),lE=hn.create,cE=ui.create,b6=Rd.create,S6=di.create,uE=Zl.create,k6=Gi.create,C6=jd.create,E6=Kl.create,j6=Gl.create,T6=da.create,N6=Fi.create,R6=Ss.create,P6=Td.create,D6=gn.create,A6=Rt.create,O6=Rt.strictCreate,M6=ql.create,I6=Mf.create,L6=Xl.create,F6=Bn.create,z6=Ql.create,U6=Nd.create,V6=qi.create,W6=Jo.create,$6=Jl.create,B6=ec.create,H6=fi.create,Y6=tc.create,Z6=fa.create,P0=bn.create,K6=Un.create,G6=hi.create,q6=bn.createWithPreprocess,X6=Cc.create,Q6=()=>lE().optional(),J6=()=>cE().optional(),ez=()=>uE().optional(),tz={string:e=>hn.create({...e,coerce:!0}),number:e=>ui.create({...e,coerce:!0}),boolean:e=>Zl.create({...e,coerce:!0}),bigint:e=>di.create({...e,coerce:!0}),date:e=>Gi.create({...e,coerce:!0})},rz=$e;var we=Object.freeze({__proto__:null,defaultErrorMap:ua,setErrorMap:r6,getErrorMap:kd,makeIssue:Cd,EMPTY_PATH:n6,addIssueToContext:me,ParseStatus:cr,INVALID:$e,DIRTY:Oo,OK:mr,isAborted:om,isDirty:am,isValid:Hl,isAsync:Yl,get util(){return nt},get objectUtil(){return im},ZodParsedType:xe,getParsedType:$s,ZodType:qe,datetimeRegex:iE,ZodString:hn,ZodNumber:ui,ZodBigInt:di,ZodBoolean:Zl,ZodDate:Gi,ZodSymbol:jd,ZodUndefined:Kl,ZodNull:Gl,ZodAny:da,ZodUnknown:Fi,ZodNever:Ss,ZodVoid:Td,ZodArray:gn,ZodObject:Rt,ZodUnion:ql,ZodDiscriminatedUnion:Mf,ZodIntersection:Xl,ZodTuple:Bn,ZodRecord:Ql,ZodMap:Nd,ZodSet:qi,ZodFunction:Jo,ZodLazy:Jl,ZodLiteral:ec,ZodEnum:fi,ZodNativeEnum:tc,ZodPromise:fa,ZodEffects:bn,ZodTransformer:bn,ZodOptional:Un,ZodNullable:hi,ZodDefault:rc,ZodCatch:nc,ZodNaN:Rd,BRAND:x6,ZodBranded:zv,ZodPipeline:Cc,ZodReadonly:sc,custom:aE,Schema:qe,ZodSchema:qe,late:w6,get ZodFirstPartyTypeKind(){return Ue},coerce:tz,any:T6,array:D6,bigint:S6,boolean:uE,date:k6,discriminatedUnion:I6,effect:P0,enum:H6,function:W6,instanceof:_6,intersection:L6,lazy:$6,literal:B6,map:U6,nan:b6,nativeEnum:Y6,never:R6,null:j6,nullable:G6,number:cE,object:A6,oboolean:ez,onumber:J6,optional:K6,ostring:Q6,pipeline:X6,preprocess:q6,promise:Z6,record:z6,set:V6,strictObject:O6,string:lE,symbol:C6,transformer:P0,tuple:F6,undefined:E6,union:M6,unknown:N6,void:P6,NEVER:rz,ZodIssueCode:oe,quotelessJson:t6,ZodError:Lr}),nz="Label",dE=x.forwardRef((e,t)=>c.jsx(Ve.label,{...e,ref:t,onMouseDown:r=>{var s;r.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));dE.displayName=nz;var fE=dE;const sz=uc("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Uv=x.forwardRef(({className:e,...t},r)=>c.jsx(fE,{ref:r,className:pe(sz(),e),...t}));Uv.displayName=fE.displayName;const nn=L5,hE=x.createContext({}),Ae=({...e})=>c.jsx(hE.Provider,{value:{name:e.name},children:c.jsx(V5,{...e})}),If=()=>{const e=x.useContext(hE),t=x.useContext(pE),{getFieldState:r,formState:n}=Of(),s=r(e.name,n);if(!e)throw new Error("useFormField should be used within ");const{id:i}=t;return{id:i,name:e.name,formItemId:`${i}-form-item`,formDescriptionId:`${i}-form-item-description`,formMessageId:`${i}-form-item-message`,...s}},pE=x.createContext({}),Te=x.forwardRef(({className:e,...t},r)=>{const n=x.useId();return c.jsx(pE.Provider,{value:{id:n},children:c.jsx("div",{ref:r,className:pe("space-y-2",e),...t})})});Te.displayName="FormItem";const Ne=x.forwardRef(({className:e,...t},r)=>{const{error:n,formItemId:s}=If();return c.jsx(Uv,{ref:r,className:pe(n&&"text-destructive",e),htmlFor:s,...t})});Ne.displayName="FormLabel";const Re=x.forwardRef(({...e},t)=>{const{error:r,formItemId:n,formDescriptionId:s,formMessageId:i}=If();return c.jsx(xs,{ref:t,id:n,"aria-describedby":r?`${s} ${i}`:`${s}`,"aria-invalid":!!r,...e})});Re.displayName="FormControl";const iz=x.forwardRef(({className:e,...t},r)=>{const{formDescriptionId:n}=If();return c.jsx("p",{ref:r,id:n,className:pe("text-sm text-muted-foreground",e),...t})});iz.displayName="FormDescription";const ke=x.forwardRef(({className:e,children:t,...r},n)=>{const{error:s,formMessageId:i}=If(),o=s?String(s==null?void 0:s.message):t;return o?c.jsx("p",{ref:n,id:i,className:pe("text-sm font-medium text-destructive",e),...r,children:o}):null});ke.displayName="FormMessage";function cm(e,[t,r]){return Math.min(r,Math.max(t,e))}var oz=[" ","Enter","ArrowUp","ArrowDown"],az=[" ","Enter"],Ec="Select",[Lf,Ff,lz]=rf(Ec),[ja,C8]=Qr(Ec,[lz,Sa]),zf=Sa(),[cz,xi]=ja(Ec),[uz,dz]=ja(Ec),mE=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:s,onOpenChange:i,value:o,defaultValue:a,onValueChange:l,dir:u,name:d,autoComplete:f,disabled:g,required:h}=e,y=zf(t),[m,w]=x.useState(null),[v,p]=x.useState(null),[_,C]=x.useState(!1),E=nf(u),[j=!1,R]=oi({prop:n,defaultProp:s,onChange:i}),[D,P]=oi({prop:o,defaultProp:a,onChange:l}),L=x.useRef(null),q=m?!!m.closest("form"):!0,[T,F]=x.useState(new Set),b=Array.from(T).map(W=>W.props.value).join(";");return c.jsx(Dg,{...y,children:c.jsxs(cz,{required:h,scope:t,trigger:m,onTriggerChange:w,valueNode:v,onValueNodeChange:p,valueNodeHasChildren:_,onValueNodeHasChildrenChange:C,contentId:zn(),value:D,onValueChange:P,open:j,onOpenChange:R,dir:E,triggerPointerDownPosRef:L,disabled:g,children:[c.jsx(Lf.Provider,{scope:t,children:c.jsx(uz,{scope:e.__scopeSelect,onNativeOptionAdd:x.useCallback(W=>{F(te=>new Set(te).add(W))},[]),onNativeOptionRemove:x.useCallback(W=>{F(te=>{const $=new Set(te);return $.delete(W),$})},[]),children:r})}),q?c.jsxs(VE,{"aria-hidden":!0,required:h,tabIndex:-1,name:d,autoComplete:f,value:D,onChange:W=>P(W.target.value),disabled:g,children:[D===void 0?c.jsx("option",{value:""}):null,Array.from(T)]},b):null]})})};mE.displayName=Ec;var gE="SelectTrigger",vE=x.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...s}=e,i=zf(r),o=xi(gE,r),a=o.disabled||n,l=Xe(t,o.onTriggerChange),u=Ff(r),[d,f,g]=WE(y=>{const m=u().filter(p=>!p.disabled),w=m.find(p=>p.value===o.value),v=$E(m,y,w);v!==void 0&&o.onValueChange(v.value)}),h=()=>{a||(o.onOpenChange(!0),g())};return c.jsx(Ag,{asChild:!0,...i,children:c.jsx(Ve.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":UE(o.value)?"":void 0,...s,ref:l,onClick:ue(s.onClick,y=>{y.currentTarget.focus()}),onPointerDown:ue(s.onPointerDown,y=>{const m=y.target;m.hasPointerCapture(y.pointerId)&&m.releasePointerCapture(y.pointerId),y.button===0&&y.ctrlKey===!1&&(h(),o.triggerPointerDownPosRef.current={x:Math.round(y.pageX),y:Math.round(y.pageY)},y.preventDefault())}),onKeyDown:ue(s.onKeyDown,y=>{const m=d.current!=="";!(y.ctrlKey||y.altKey||y.metaKey)&&y.key.length===1&&f(y.key),!(m&&y.key===" ")&&oz.includes(y.key)&&(h(),y.preventDefault())})})})});vE.displayName=gE;var yE="SelectValue",xE=x.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,children:i,placeholder:o="",...a}=e,l=xi(yE,r),{onValueNodeHasChildrenChange:u}=l,d=i!==void 0,f=Xe(t,l.onValueNodeChange);return nr(()=>{u(d)},[u,d]),c.jsx(Ve.span,{...a,ref:f,style:{pointerEvents:"none"},children:UE(l.value)?c.jsx(c.Fragment,{children:o}):i})});xE.displayName=yE;var fz="SelectIcon",wE=x.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...s}=e;return c.jsx(Ve.span,{"aria-hidden":!0,...s,ref:t,children:n||"▼"})});wE.displayName=fz;var hz="SelectPortal",_E=e=>c.jsx(fc,{asChild:!0,...e});_E.displayName=hz;var Xi="SelectContent",bE=x.forwardRef((e,t)=>{const r=xi(Xi,e.__scopeSelect),[n,s]=x.useState();if(nr(()=>{s(new DocumentFragment)},[]),!r.open){const i=n;return i?Cs.createPortal(c.jsx(SE,{scope:e.__scopeSelect,children:c.jsx(Lf.Slot,{scope:e.__scopeSelect,children:c.jsx("div",{children:e.children})})}),i):null}return c.jsx(kE,{...e,ref:t})});bE.displayName=Xi;var is=10,[SE,wi]=ja(Xi),pz="SelectContentImpl",kE=x.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:i,onPointerDownOutside:o,side:a,sideOffset:l,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:g,collisionPadding:h,sticky:y,hideWhenDetached:m,avoidCollisions:w,...v}=e,p=xi(Xi,r),[_,C]=x.useState(null),[E,j]=x.useState(null),R=Xe(t,fe=>C(fe)),[D,P]=x.useState(null),[L,q]=x.useState(null),T=Ff(r),[F,b]=x.useState(!1),W=x.useRef(!1);x.useEffect(()=>{if(_)return Ig(_)},[_]),Sg();const te=x.useCallback(fe=>{const[ve,...Se]=T().map(Ce=>Ce.ref.current),[Ie]=Se.slice(-1),De=document.activeElement;for(const Ce of fe)if(Ce===De||(Ce==null||Ce.scrollIntoView({block:"nearest"}),Ce===ve&&E&&(E.scrollTop=0),Ce===Ie&&E&&(E.scrollTop=E.scrollHeight),Ce==null||Ce.focus(),document.activeElement!==De))return},[T,E]),$=x.useCallback(()=>te([D,_]),[te,D,_]);x.useEffect(()=>{F&&$()},[F,$]);const{onOpenChange:Z,triggerPointerDownPosRef:I}=p;x.useEffect(()=>{if(_){let fe={x:0,y:0};const ve=Ie=>{var De,Ce;fe={x:Math.abs(Math.round(Ie.pageX)-(((De=I.current)==null?void 0:De.x)??0)),y:Math.abs(Math.round(Ie.pageY)-(((Ce=I.current)==null?void 0:Ce.y)??0))}},Se=Ie=>{fe.x<=10&&fe.y<=10?Ie.preventDefault():_.contains(Ie.target)||Z(!1),document.removeEventListener("pointermove",ve),I.current=null};return I.current!==null&&(document.addEventListener("pointermove",ve),document.addEventListener("pointerup",Se,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ve),document.removeEventListener("pointerup",Se,{capture:!0})}}},[_,Z,I]),x.useEffect(()=>{const fe=()=>Z(!1);return window.addEventListener("blur",fe),window.addEventListener("resize",fe),()=>{window.removeEventListener("blur",fe),window.removeEventListener("resize",fe)}},[Z]);const[Q,z]=WE(fe=>{const ve=T().filter(De=>!De.disabled),Se=ve.find(De=>De.ref.current===document.activeElement),Ie=$E(ve,fe,Se);Ie&&setTimeout(()=>Ie.ref.current.focus())}),V=x.useCallback((fe,ve,Se)=>{const Ie=!W.current&&!Se;(p.value!==void 0&&p.value===ve||Ie)&&(P(fe),Ie&&(W.current=!0))},[p.value]),de=x.useCallback(()=>_==null?void 0:_.focus(),[_]),ne=x.useCallback((fe,ve,Se)=>{const Ie=!W.current&&!Se;(p.value!==void 0&&p.value===ve||Ie)&&q(fe)},[p.value]),se=n==="popper"?um:CE,Pe=se===um?{side:a,sideOffset:l,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:g,collisionPadding:h,sticky:y,hideWhenDetached:m,avoidCollisions:w}:{};return c.jsx(SE,{scope:r,content:_,viewport:E,onViewportChange:j,itemRefCallback:V,selectedItem:D,onItemLeave:de,itemTextRefCallback:ne,focusSelectedItem:$,selectedItemText:L,position:n,isPositioned:F,searchRef:Q,children:c.jsx(uf,{as:xs,allowPinchZoom:!0,children:c.jsx(sf,{asChild:!0,trapped:p.open,onMountAutoFocus:fe=>{fe.preventDefault()},onUnmountAutoFocus:ue(s,fe=>{var ve;(ve=p.trigger)==null||ve.focus({preventScroll:!0}),fe.preventDefault()}),children:c.jsx(wa,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:fe=>fe.preventDefault(),onDismiss:()=>p.onOpenChange(!1),children:c.jsx(se,{role:"listbox",id:p.contentId,"data-state":p.open?"open":"closed",dir:p.dir,onContextMenu:fe=>fe.preventDefault(),...v,...Pe,onPlaced:()=>b(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:ue(v.onKeyDown,fe=>{const ve=fe.ctrlKey||fe.altKey||fe.metaKey;if(fe.key==="Tab"&&fe.preventDefault(),!ve&&fe.key.length===1&&z(fe.key),["ArrowUp","ArrowDown","Home","End"].includes(fe.key)){let Ie=T().filter(De=>!De.disabled).map(De=>De.ref.current);if(["ArrowUp","End"].includes(fe.key)&&(Ie=Ie.slice().reverse()),["ArrowUp","ArrowDown"].includes(fe.key)){const De=fe.target,Ce=Ie.indexOf(De);Ie=Ie.slice(Ce+1)}setTimeout(()=>te(Ie)),fe.preventDefault()}})})})})})})});kE.displayName=pz;var mz="SelectItemAlignedPosition",CE=x.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...s}=e,i=xi(Xi,r),o=wi(Xi,r),[a,l]=x.useState(null),[u,d]=x.useState(null),f=Xe(t,R=>d(R)),g=Ff(r),h=x.useRef(!1),y=x.useRef(!0),{viewport:m,selectedItem:w,selectedItemText:v,focusSelectedItem:p}=o,_=x.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&u&&m&&w&&v){const R=i.trigger.getBoundingClientRect(),D=u.getBoundingClientRect(),P=i.valueNode.getBoundingClientRect(),L=v.getBoundingClientRect();if(i.dir!=="rtl"){const De=L.left-D.left,Ce=P.left-De,rt=R.left-Ce,k=R.width+rt,J=Math.max(k,D.width),K=window.innerWidth-is,A=cm(Ce,[is,K-J]);a.style.minWidth=k+"px",a.style.left=A+"px"}else{const De=D.right-L.right,Ce=window.innerWidth-P.right-De,rt=window.innerWidth-R.right-Ce,k=R.width+rt,J=Math.max(k,D.width),K=window.innerWidth-is,A=cm(Ce,[is,K-J]);a.style.minWidth=k+"px",a.style.right=A+"px"}const q=g(),T=window.innerHeight-is*2,F=m.scrollHeight,b=window.getComputedStyle(u),W=parseInt(b.borderTopWidth,10),te=parseInt(b.paddingTop,10),$=parseInt(b.borderBottomWidth,10),Z=parseInt(b.paddingBottom,10),I=W+te+F+Z+$,Q=Math.min(w.offsetHeight*5,I),z=window.getComputedStyle(m),V=parseInt(z.paddingTop,10),de=parseInt(z.paddingBottom,10),ne=R.top+R.height/2-is,se=T-ne,Pe=w.offsetHeight/2,fe=w.offsetTop+Pe,ve=W+te+fe,Se=I-ve;if(ve<=ne){const De=w===q[q.length-1].ref.current;a.style.bottom="0px";const Ce=u.clientHeight-m.offsetTop-m.offsetHeight,rt=Math.max(se,Pe+(De?de:0)+Ce+$),k=ve+rt;a.style.height=k+"px"}else{const De=w===q[0].ref.current;a.style.top="0px";const rt=Math.max(ne,W+m.offsetTop+(De?V:0)+Pe)+Se;a.style.height=rt+"px",m.scrollTop=ve-ne+m.offsetTop}a.style.margin=`${is}px 0`,a.style.minHeight=Q+"px",a.style.maxHeight=T+"px",n==null||n(),requestAnimationFrame(()=>h.current=!0)}},[g,i.trigger,i.valueNode,a,u,m,w,v,i.dir,n]);nr(()=>_(),[_]);const[C,E]=x.useState();nr(()=>{u&&E(window.getComputedStyle(u).zIndex)},[u]);const j=x.useCallback(R=>{R&&y.current===!0&&(_(),p==null||p(),y.current=!1)},[_,p]);return c.jsx(vz,{scope:r,contentWrapper:a,shouldExpandOnScrollRef:h,onScrollButtonChange:j,children:c.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:c.jsx(Ve.div,{...s,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});CE.displayName=mz;var gz="SelectPopperPosition",um=x.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:s=is,...i}=e,o=zf(r);return c.jsx(Og,{...o,...i,ref:t,align:n,collisionPadding:s,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});um.displayName=gz;var[vz,Vv]=ja(Xi,{}),dm="SelectViewport",EE=x.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...s}=e,i=wi(dm,r),o=Vv(dm,r),a=Xe(t,i.onViewportChange),l=x.useRef(0);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),c.jsx(Lf.Slot,{scope:r,children:c.jsx(Ve.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:a,style:{position:"relative",flex:1,overflow:"auto",...s.style},onScroll:ue(s.onScroll,u=>{const d=u.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:g}=o;if(g!=null&&g.current&&f){const h=Math.abs(l.current-d.scrollTop);if(h>0){const y=window.innerHeight-is*2,m=parseFloat(f.style.minHeight),w=parseFloat(f.style.height),v=Math.max(m,w);if(v0?C:0,f.style.justifyContent="flex-end")}}}l.current=d.scrollTop})})})]})});EE.displayName=dm;var jE="SelectGroup",[yz,xz]=ja(jE),TE=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=zn();return c.jsx(yz,{scope:r,id:s,children:c.jsx(Ve.div,{role:"group","aria-labelledby":s,...n,ref:t})})});TE.displayName=jE;var NE="SelectLabel",RE=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=xz(NE,r);return c.jsx(Ve.div,{id:s.id,...n,ref:t})});RE.displayName=NE;var Pd="SelectItem",[wz,PE]=ja(Pd),DE=x.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:s=!1,textValue:i,...o}=e,a=xi(Pd,r),l=wi(Pd,r),u=a.value===n,[d,f]=x.useState(i??""),[g,h]=x.useState(!1),y=Xe(t,v=>{var p;return(p=l.itemRefCallback)==null?void 0:p.call(l,v,n,s)}),m=zn(),w=()=>{s||(a.onValueChange(n),a.onOpenChange(!1))};if(n==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return c.jsx(wz,{scope:r,value:n,disabled:s,textId:m,isSelected:u,onItemTextChange:x.useCallback(v=>{f(p=>p||((v==null?void 0:v.textContent)??"").trim())},[]),children:c.jsx(Lf.ItemSlot,{scope:r,value:n,disabled:s,textValue:d,children:c.jsx(Ve.div,{role:"option","aria-labelledby":m,"data-highlighted":g?"":void 0,"aria-selected":u&&g,"data-state":u?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...o,ref:y,onFocus:ue(o.onFocus,()=>h(!0)),onBlur:ue(o.onBlur,()=>h(!1)),onPointerUp:ue(o.onPointerUp,w),onPointerMove:ue(o.onPointerMove,v=>{var p;s?(p=l.onItemLeave)==null||p.call(l):v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ue(o.onPointerLeave,v=>{var p;v.currentTarget===document.activeElement&&((p=l.onItemLeave)==null||p.call(l))}),onKeyDown:ue(o.onKeyDown,v=>{var _;((_=l.searchRef)==null?void 0:_.current)!==""&&v.key===" "||(az.includes(v.key)&&w(),v.key===" "&&v.preventDefault())})})})})});DE.displayName=Pd;var Ja="SelectItemText",AE=x.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,...i}=e,o=xi(Ja,r),a=wi(Ja,r),l=PE(Ja,r),u=dz(Ja,r),[d,f]=x.useState(null),g=Xe(t,v=>f(v),l.onItemTextChange,v=>{var p;return(p=a.itemTextRefCallback)==null?void 0:p.call(a,v,l.value,l.disabled)}),h=d==null?void 0:d.textContent,y=x.useMemo(()=>c.jsx("option",{value:l.value,disabled:l.disabled,children:h},l.value),[l.disabled,l.value,h]),{onNativeOptionAdd:m,onNativeOptionRemove:w}=u;return nr(()=>(m(y),()=>w(y)),[m,w,y]),c.jsxs(c.Fragment,{children:[c.jsx(Ve.span,{id:l.textId,...i,ref:g}),l.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Cs.createPortal(i.children,o.valueNode):null]})});AE.displayName=Ja;var OE="SelectItemIndicator",ME=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return PE(OE,r).isSelected?c.jsx(Ve.span,{"aria-hidden":!0,...n,ref:t}):null});ME.displayName=OE;var fm="SelectScrollUpButton",IE=x.forwardRef((e,t)=>{const r=wi(fm,e.__scopeSelect),n=Vv(fm,e.__scopeSelect),[s,i]=x.useState(!1),o=Xe(t,n.onScrollButtonChange);return nr(()=>{if(r.viewport&&r.isPositioned){let a=function(){const u=l.scrollTop>0;i(u)};const l=r.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[r.viewport,r.isPositioned]),s?c.jsx(FE,{...e,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=r;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});IE.displayName=fm;var hm="SelectScrollDownButton",LE=x.forwardRef((e,t)=>{const r=wi(hm,e.__scopeSelect),n=Vv(hm,e.__scopeSelect),[s,i]=x.useState(!1),o=Xe(t,n.onScrollButtonChange);return nr(()=>{if(r.viewport&&r.isPositioned){let a=function(){const u=l.scrollHeight-l.clientHeight,d=Math.ceil(l.scrollTop)l.removeEventListener("scroll",a)}},[r.viewport,r.isPositioned]),s?c.jsx(FE,{...e,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=r;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});LE.displayName=hm;var FE=x.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...s}=e,i=wi("SelectScrollButton",r),o=x.useRef(null),a=Ff(r),l=x.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return x.useEffect(()=>()=>l(),[l]),nr(()=>{var d;const u=a().find(f=>f.ref.current===document.activeElement);(d=u==null?void 0:u.ref.current)==null||d.scrollIntoView({block:"nearest"})},[a]),c.jsx(Ve.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:ue(s.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(n,50))}),onPointerMove:ue(s.onPointerMove,()=>{var u;(u=i.onItemLeave)==null||u.call(i),o.current===null&&(o.current=window.setInterval(n,50))}),onPointerLeave:ue(s.onPointerLeave,()=>{l()})})}),_z="SelectSeparator",zE=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return c.jsx(Ve.div,{"aria-hidden":!0,...n,ref:t})});zE.displayName=_z;var pm="SelectArrow",bz=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=zf(r),i=xi(pm,r),o=wi(pm,r);return i.open&&o.position==="popper"?c.jsx(Mg,{...s,...n,ref:t}):null});bz.displayName=pm;function UE(e){return e===""||e===void 0}var VE=x.forwardRef((e,t)=>{const{value:r,...n}=e,s=x.useRef(null),i=Xe(t,s),o=Qk(r);return x.useEffect(()=>{const a=s.current,l=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(o!==r&&d){const f=new Event("change",{bubbles:!0});d.call(a,r),a.dispatchEvent(f)}},[o,r]),c.jsx(Sc,{asChild:!0,children:c.jsx("select",{...n,ref:i,defaultValue:r})})});VE.displayName="BubbleSelect";function WE(e){const t=At(e),r=x.useRef(""),n=x.useRef(0),s=x.useCallback(o=>{const a=r.current+o;t(a),function l(u){r.current=u,window.clearTimeout(n.current),u!==""&&(n.current=window.setTimeout(()=>l(""),1e3))}(a)},[t]),i=x.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,s,i]}function $E(e,t,r){const s=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=r?e.indexOf(r):-1;let o=Sz(e,Math.max(i,0));s.length===1&&(o=o.filter(u=>u!==r));const l=o.find(u=>u.textValue.toLowerCase().startsWith(s.toLowerCase()));return l!==r?l:void 0}function Sz(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var kz=mE,BE=vE,Cz=xE,Ez=wE,jz=_E,HE=bE,Tz=EE,Nz=TE,YE=RE,ZE=DE,Rz=AE,Pz=ME,KE=IE,GE=LE,qE=zE;const el=kz,tl=Nz,rl=Cz,Mo=x.forwardRef(({className:e,children:t,...r},n)=>c.jsxs(BE,{ref:n,className:pe("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[t,c.jsx(Ez,{asChild:!0,children:c.jsx(h1,{className:"h-4 w-4 opacity-50"})})]}));Mo.displayName=BE.displayName;const XE=x.forwardRef(({className:e,...t},r)=>c.jsx(KE,{ref:r,className:pe("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(zR,{className:"h-4 w-4"})}));XE.displayName=KE.displayName;const QE=x.forwardRef(({className:e,...t},r)=>c.jsx(GE,{ref:r,className:pe("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(h1,{className:"h-4 w-4"})}));QE.displayName=GE.displayName;const Io=x.forwardRef(({className:e,children:t,position:r="popper",...n},s)=>c.jsx(jz,{children:c.jsxs(HE,{ref:s,className:pe("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:[c.jsx(XE,{}),c.jsx(Tz,{className:pe("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),c.jsx(QE,{})]})}));Io.displayName=HE.displayName;const Lo=x.forwardRef(({className:e,...t},r)=>c.jsx(YE,{ref:r,className:pe("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Lo.displayName=YE.displayName;const Fo=x.forwardRef(({className:e,children:t,...r},n)=>c.jsxs(ZE,{ref:n,className:pe("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[c.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:c.jsx(Pz,{children:c.jsx(f1,{className:"h-4 w-4"})})}),c.jsx(Rz,{children:t})]}));Fo.displayName=ZE.displayName;const Dz=x.forwardRef(({className:e,...t},r)=>c.jsx(qE,{ref:r,className:pe("-mx-1 my-1 h-px bg-muted",e),...t}));Dz.displayName=qE.displayName;const mm=new Map([["aliyun-cdn",["阿里云-CDN","/imgs/providers/aliyun.svg"]],["aliyun-oss",["阿里云-OSS","/imgs/providers/aliyun.svg"]],["tencent-cdn",["腾讯云-CDN","/imgs/providers/tencent.svg"]],["ssh",["SSH部署","/imgs/providers/ssh.svg"]],["qiniu-cdn",["七牛云-CDN","/imgs/providers/qiniu.svg"]],["webhook",["Webhook","/imgs/providers/webhook.svg"]]]),Az=Array.from(mm.keys()),JE=qg,ej=Xg,Oz=Qg,tj=x.forwardRef(({className:e,...t},r)=>c.jsx(mc,{ref:r,className:pe("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));tj.displayName=mc.displayName;const Wv=x.forwardRef(({className:e,children:t,...r},n)=>c.jsxs(Oz,{children:[c.jsx(tj,{}),c.jsxs(gc,{ref:n,className:pe("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r,children:[t,c.jsxs(hf,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[c.jsx(xg,{className:"h-4 w-4"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Wv.displayName=gc.displayName;const $v=({className:e,...t})=>c.jsx("div",{className:pe("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});$v.displayName="DialogHeader";const Bv=x.forwardRef(({className:e,...t},r)=>c.jsx(vc,{ref:r,className:pe("text-lg font-semibold leading-none tracking-tight",e),...t}));Bv.displayName=vc.displayName;const Mz=x.forwardRef(({className:e,...t},r)=>c.jsx(yc,{ref:r,className:pe("text-sm text-muted-foreground",e),...t}));Mz.displayName=yc.displayName;function Iz(e,t){return x.useReducer((r,n)=>t[r][n]??r,e)}var Hv="ScrollArea",[rj,E8]=Qr(Hv),[Lz,sn]=rj(Hv),nj=x.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:n="hover",dir:s,scrollHideDelay:i=600,...o}=e,[a,l]=x.useState(null),[u,d]=x.useState(null),[f,g]=x.useState(null),[h,y]=x.useState(null),[m,w]=x.useState(null),[v,p]=x.useState(0),[_,C]=x.useState(0),[E,j]=x.useState(!1),[R,D]=x.useState(!1),P=Xe(t,q=>l(q)),L=nf(s);return c.jsx(Lz,{scope:r,type:n,dir:L,scrollHideDelay:i,scrollArea:a,viewport:u,onViewportChange:d,content:f,onContentChange:g,scrollbarX:h,onScrollbarXChange:y,scrollbarXEnabled:E,onScrollbarXEnabledChange:j,scrollbarY:m,onScrollbarYChange:w,scrollbarYEnabled:R,onScrollbarYEnabledChange:D,onCornerWidthChange:p,onCornerHeightChange:C,children:c.jsx(Ve.div,{dir:L,...o,ref:P,style:{position:"relative","--radix-scroll-area-corner-width":v+"px","--radix-scroll-area-corner-height":_+"px",...e.style}})})});nj.displayName=Hv;var sj="ScrollAreaViewport",ij=x.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:n,nonce:s,...i}=e,o=sn(sj,r),a=x.useRef(null),l=Xe(t,a,o.onViewportChange);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),c.jsx(Ve.div,{"data-radix-scroll-area-viewport":"",...i,ref:l,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...e.style},children:c.jsx("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});ij.displayName=sj;var Kn="ScrollAreaScrollbar",Yv=x.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=sn(Kn,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:o}=s,a=e.orientation==="horizontal";return x.useEffect(()=>(a?i(!0):o(!0),()=>{a?i(!1):o(!1)}),[a,i,o]),s.type==="hover"?c.jsx(Fz,{...n,ref:t,forceMount:r}):s.type==="scroll"?c.jsx(zz,{...n,ref:t,forceMount:r}):s.type==="auto"?c.jsx(oj,{...n,ref:t,forceMount:r}):s.type==="always"?c.jsx(Zv,{...n,ref:t}):null});Yv.displayName=Kn;var Fz=x.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=sn(Kn,e.__scopeScrollArea),[i,o]=x.useState(!1);return x.useEffect(()=>{const a=s.scrollArea;let l=0;if(a){const u=()=>{window.clearTimeout(l),o(!0)},d=()=>{l=window.setTimeout(()=>o(!1),s.scrollHideDelay)};return a.addEventListener("pointerenter",u),a.addEventListener("pointerleave",d),()=>{window.clearTimeout(l),a.removeEventListener("pointerenter",u),a.removeEventListener("pointerleave",d)}}},[s.scrollArea,s.scrollHideDelay]),c.jsx(Er,{present:r||i,children:c.jsx(oj,{"data-state":i?"visible":"hidden",...n,ref:t})})}),zz=x.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=sn(Kn,e.__scopeScrollArea),i=e.orientation==="horizontal",o=Vf(()=>l("SCROLL_END"),100),[a,l]=Iz("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return x.useEffect(()=>{if(a==="idle"){const u=window.setTimeout(()=>l("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(u)}},[a,s.scrollHideDelay,l]),x.useEffect(()=>{const u=s.viewport,d=i?"scrollLeft":"scrollTop";if(u){let f=u[d];const g=()=>{const h=u[d];f!==h&&(l("SCROLL"),o()),f=h};return u.addEventListener("scroll",g),()=>u.removeEventListener("scroll",g)}},[s.viewport,i,l,o]),c.jsx(Er,{present:r||a!=="hidden",children:c.jsx(Zv,{"data-state":a==="hidden"?"hidden":"visible",...n,ref:t,onPointerEnter:ue(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:ue(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),oj=x.forwardRef((e,t)=>{const r=sn(Kn,e.__scopeScrollArea),{forceMount:n,...s}=e,[i,o]=x.useState(!1),a=e.orientation==="horizontal",l=Vf(()=>{if(r.viewport){const u=r.viewport.offsetWidth{const{orientation:r="vertical",...n}=e,s=sn(Kn,e.__scopeScrollArea),i=x.useRef(null),o=x.useRef(0),[a,l]=x.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=dj(a.viewport,a.content),d={...n,sizes:a,onSizesChange:l,hasThumb:u>0&&u<1,onThumbChange:g=>i.current=g,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:g=>o.current=g};function f(g,h){return Hz(g,o.current,a,h)}return r==="horizontal"?c.jsx(Uz,{...d,ref:t,onThumbPositionChange:()=>{if(s.viewport&&i.current){const g=s.viewport.scrollLeft,h=D0(g,a,s.dir);i.current.style.transform=`translate3d(${h}px, 0, 0)`}},onWheelScroll:g=>{s.viewport&&(s.viewport.scrollLeft=g)},onDragScroll:g=>{s.viewport&&(s.viewport.scrollLeft=f(g,s.dir))}}):r==="vertical"?c.jsx(Vz,{...d,ref:t,onThumbPositionChange:()=>{if(s.viewport&&i.current){const g=s.viewport.scrollTop,h=D0(g,a);i.current.style.transform=`translate3d(0, ${h}px, 0)`}},onWheelScroll:g=>{s.viewport&&(s.viewport.scrollTop=g)},onDragScroll:g=>{s.viewport&&(s.viewport.scrollTop=f(g))}}):null}),Uz=x.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...s}=e,i=sn(Kn,e.__scopeScrollArea),[o,a]=x.useState(),l=x.useRef(null),u=Xe(t,l,i.onScrollbarXChange);return x.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),c.jsx(lj,{"data-orientation":"horizontal",...s,ref:u,sizes:r,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Uf(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,f)=>{if(i.viewport){const g=i.viewport.scrollLeft+d.deltaX;e.onWheelScroll(g),hj(g,f)&&d.preventDefault()}},onResize:()=>{l.current&&i.viewport&&o&&n({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:Ad(o.paddingLeft),paddingEnd:Ad(o.paddingRight)}})}})}),Vz=x.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...s}=e,i=sn(Kn,e.__scopeScrollArea),[o,a]=x.useState(),l=x.useRef(null),u=Xe(t,l,i.onScrollbarYChange);return x.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),c.jsx(lj,{"data-orientation":"vertical",...s,ref:u,sizes:r,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Uf(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,f)=>{if(i.viewport){const g=i.viewport.scrollTop+d.deltaY;e.onWheelScroll(g),hj(g,f)&&d.preventDefault()}},onResize:()=>{l.current&&i.viewport&&o&&n({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:Ad(o.paddingTop),paddingEnd:Ad(o.paddingBottom)}})}})}),[Wz,aj]=rj(Kn),lj=x.forwardRef((e,t)=>{const{__scopeScrollArea:r,sizes:n,hasThumb:s,onThumbChange:i,onThumbPointerUp:o,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:u,onWheelScroll:d,onResize:f,...g}=e,h=sn(Kn,r),[y,m]=x.useState(null),w=Xe(t,P=>m(P)),v=x.useRef(null),p=x.useRef(""),_=h.viewport,C=n.content-n.viewport,E=At(d),j=At(l),R=Vf(f,10);function D(P){if(v.current){const L=P.clientX-v.current.left,q=P.clientY-v.current.top;u({x:L,y:q})}}return x.useEffect(()=>{const P=L=>{const q=L.target;(y==null?void 0:y.contains(q))&&E(L,C)};return document.addEventListener("wheel",P,{passive:!1}),()=>document.removeEventListener("wheel",P,{passive:!1})},[_,y,C,E]),x.useEffect(j,[n,j]),ha(y,R),ha(h.content,R),c.jsx(Wz,{scope:r,scrollbar:y,hasThumb:s,onThumbChange:At(i),onThumbPointerUp:At(o),onThumbPositionChange:j,onThumbPointerDown:At(a),children:c.jsx(Ve.div,{...g,ref:w,style:{position:"absolute",...g.style},onPointerDown:ue(e.onPointerDown,P=>{P.button===0&&(P.target.setPointerCapture(P.pointerId),v.current=y.getBoundingClientRect(),p.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",h.viewport&&(h.viewport.style.scrollBehavior="auto"),D(P))}),onPointerMove:ue(e.onPointerMove,D),onPointerUp:ue(e.onPointerUp,P=>{const L=P.target;L.hasPointerCapture(P.pointerId)&&L.releasePointerCapture(P.pointerId),document.body.style.webkitUserSelect=p.current,h.viewport&&(h.viewport.style.scrollBehavior=""),v.current=null})})})}),Dd="ScrollAreaThumb",cj=x.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=aj(Dd,e.__scopeScrollArea);return c.jsx(Er,{present:r||s.hasThumb,children:c.jsx($z,{ref:t,...n})})}),$z=x.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:n,...s}=e,i=sn(Dd,r),o=aj(Dd,r),{onThumbPositionChange:a}=o,l=Xe(t,f=>o.onThumbChange(f)),u=x.useRef(),d=Vf(()=>{u.current&&(u.current(),u.current=void 0)},100);return x.useEffect(()=>{const f=i.viewport;if(f){const g=()=>{if(d(),!u.current){const h=Yz(f,a);u.current=h,a()}};return a(),f.addEventListener("scroll",g),()=>f.removeEventListener("scroll",g)}},[i.viewport,d,a]),c.jsx(Ve.div,{"data-state":o.hasThumb?"visible":"hidden",...s,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:ue(e.onPointerDownCapture,f=>{const h=f.target.getBoundingClientRect(),y=f.clientX-h.left,m=f.clientY-h.top;o.onThumbPointerDown({x:y,y:m})}),onPointerUp:ue(e.onPointerUp,o.onThumbPointerUp)})});cj.displayName=Dd;var Kv="ScrollAreaCorner",uj=x.forwardRef((e,t)=>{const r=sn(Kv,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?c.jsx(Bz,{...e,ref:t}):null});uj.displayName=Kv;var Bz=x.forwardRef((e,t)=>{const{__scopeScrollArea:r,...n}=e,s=sn(Kv,r),[i,o]=x.useState(0),[a,l]=x.useState(0),u=!!(i&&a);return ha(s.scrollbarX,()=>{var f;const d=((f=s.scrollbarX)==null?void 0:f.offsetHeight)||0;s.onCornerHeightChange(d),l(d)}),ha(s.scrollbarY,()=>{var f;const d=((f=s.scrollbarY)==null?void 0:f.offsetWidth)||0;s.onCornerWidthChange(d),o(d)}),u?c.jsx(Ve.div,{...n,ref:t,style:{width:i,height:a,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Ad(e){return e?parseInt(e,10):0}function dj(e,t){const r=e/t;return isNaN(r)?0:r}function Uf(e){const t=dj(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function Hz(e,t,r,n="ltr"){const s=Uf(r),i=s/2,o=t||i,a=s-o,l=r.scrollbar.paddingStart+o,u=r.scrollbar.size-r.scrollbar.paddingEnd-a,d=r.content-r.viewport,f=n==="ltr"?[0,d]:[d*-1,0];return fj([l,u],f)(e)}function D0(e,t,r="ltr"){const n=Uf(t),s=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-s,o=t.content-t.viewport,a=i-n,l=r==="ltr"?[0,o]:[o*-1,0],u=cm(e,l);return fj([0,o],[0,a])(u)}function fj(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function hj(e,t){return e>0&&e{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function s(){const i={left:e.scrollLeft,top:e.scrollTop},o=r.left!==i.left,a=r.top!==i.top;(o||a)&&t(),r=i,n=window.requestAnimationFrame(s)}(),()=>window.cancelAnimationFrame(n)};function Vf(e,t){const r=At(e),n=x.useRef(0);return x.useEffect(()=>()=>window.clearTimeout(n.current),[]),x.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function ha(e,t){const r=At(t);nr(()=>{let n=0;if(e){const s=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return s.observe(e),()=>{window.cancelAnimationFrame(n),s.unobserve(e)}}},[e,r])}var pj=nj,Zz=ij,Kz=uj;const Gv=x.forwardRef(({className:e,children:t,...r},n)=>c.jsxs(pj,{ref:n,className:pe("relative overflow-hidden",e),...r,children:[c.jsx(Zz,{className:"h-full w-full rounded-[inherit]",children:t}),c.jsx(mj,{}),c.jsx(Kz,{})]}));Gv.displayName=pj.displayName;const mj=x.forwardRef(({className:e,orientation:t="vertical",...r},n)=>c.jsx(Yv,{ref:n,orientation:t,className:pe("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...r,children:c.jsx(cj,{className:"relative flex-1 rounded-full bg-border"})}));mj.displayName=Yv.displayName;const zi=new Map([["tencent",["腾讯云","/imgs/providers/tencent.svg"]],["aliyun",["阿里云","/imgs/providers/aliyun.svg"]],["cloudflare",["Cloudflare","/imgs/providers/cloudflare.svg"]],["namesilo",["Namesilo","/imgs/providers/namesilo.svg"]],["godaddy",["GoDaddy","/imgs/providers/godaddy.svg"]],["qiniu",["七牛云","/imgs/providers/qiniu.svg"]],["ssh",["SSH部署","/imgs/providers/ssh.svg"]],["webhook",["Webhook","/imgs/providers/webhook.svg"]]]),_i=we.union([we.literal("aliyun"),we.literal("tencent"),we.literal("ssh"),we.literal("webhook"),we.literal("cloudflare"),we.literal("qiniu"),we.literal("namesilo"),we.literal("godaddy")],{message:"请选择云服务商"}),bi=e=>{switch(e){case"aliyun":case"tencent":return"all";case"ssh":case"webhook":case"qiniu":return"deploy";case"cloudflare":case"namesilo":case"godaddy":return"apply";default:return"all"}},Gz=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=En(),s=we.object({id:we.string().optional(),name:we.string().min(1).max(64),configType:_i,secretId:we.string().min(1).max(64),secretKey:we.string().min(1).max(64)});let i={secretId:"",secretKey:""};e&&(i=e.config);const o=tn({resolver:rn(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"tencent",secretId:i.secretId,secretKey:i.secretKey}}),a=async l=>{const u={id:l.id,name:l.name,configType:l.configType,usage:bi(l.configType),config:{secretId:l.secretId,secretKey:l.secretKey}};try{const d=await yi(u);if(t(),u.id=d.id,u.created=d.created,u.updated=d.updated,l.id){n(u);return}r(u)}catch(d){Object.entries(d.response.data).forEach(([g,h])=>{o.setError(g,{type:"manual",message:h.message})})}};return c.jsx(c.Fragment,{children:c.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:c.jsx(nn,{...o,children:c.jsxs("form",{onSubmit:l=>{l.stopPropagation(),o.handleSubmit(a)(l)},className:"space-y-8",children:[c.jsx(Ae,{control:o.control,name:"name",render:({field:l})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"名称"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入授权名称",...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"id",render:({field:l})=>c.jsxs(Te,{className:"hidden",children:[c.jsx(Ne,{children:"配置类型"}),c.jsx(Re,{children:c.jsx(Fe,{...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"configType",render:({field:l})=>c.jsxs(Te,{className:"hidden",children:[c.jsx(Ne,{children:"配置类型"}),c.jsx(Re,{children:c.jsx(Fe,{...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"secretId",render:({field:l})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"SecretId"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入SecretId",...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"secretKey",render:({field:l})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"SecretKey"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入SecretKey",...l})}),c.jsx(ke,{})]})}),c.jsx("div",{className:"flex justify-end",children:c.jsx(at,{type:"submit",children:"保存"})})]})})})})},qz=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=En(),s=we.object({id:we.string().optional(),name:we.string().min(1).max(64),configType:_i,accessKeyId:we.string().min(1).max(64),accessSecretId:we.string().min(1).max(64)});let i={accessKeyId:"",accessKeySecret:""};e&&(i=e.config);const o=tn({resolver:rn(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"aliyun",accessKeyId:i.accessKeyId,accessSecretId:i.accessKeySecret}}),a=async l=>{const u={id:l.id,name:l.name,configType:l.configType,usage:bi(l.configType),config:{accessKeyId:l.accessKeyId,accessKeySecret:l.accessSecretId}};try{const d=await yi(u);if(t(),u.id=d.id,u.created=d.created,u.updated=d.updated,l.id){n(u);return}r(u)}catch(d){Object.entries(d.response.data).forEach(([g,h])=>{o.setError(g,{type:"manual",message:h.message})});return}};return c.jsx(c.Fragment,{children:c.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:c.jsx(nn,{...o,children:c.jsxs("form",{onSubmit:l=>{l.stopPropagation(),o.handleSubmit(a)(l)},className:"space-y-8",children:[c.jsx(Ae,{control:o.control,name:"name",render:({field:l})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"名称"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入授权名称",...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"id",render:({field:l})=>c.jsxs(Te,{className:"hidden",children:[c.jsx(Ne,{children:"配置类型"}),c.jsx(Re,{children:c.jsx(Fe,{...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"configType",render:({field:l})=>c.jsxs(Te,{className:"hidden",children:[c.jsx(Ne,{children:"配置类型"}),c.jsx(Re,{children:c.jsx(Fe,{...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"accessKeyId",render:({field:l})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"AccessKeyId"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入AccessKeyId",...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"accessSecretId",render:({field:l})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"AccessKeySecret"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入AccessKeySecret",...l})}),c.jsx(ke,{})]})}),c.jsx(ke,{}),c.jsx("div",{className:"flex justify-end",children:c.jsx(at,{type:"submit",children:"保存"})})]})})})})},gj=x.forwardRef(({className:e,...t},r)=>c.jsx("textarea",{className:pe("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...t}));gj.displayName="Textarea";const Xz=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=En(),s=x.useRef(null),[i,o]=x.useState(""),a=we.object({id:we.string().optional(),name:we.string().min(1).max(64),configType:_i,host:we.string().ip({message:"请输入合法的IP地址"}),port:we.string().min(1).max(5),username:we.string().min(1).max(64),password:we.string().min(0).max(64),key:we.string().min(0).max(20480),keyFile:we.any().optional(),command:we.string().min(1).max(2048),certPath:we.string().min(0).max(2048),keyPath:we.string().min(0).max(2048)});let l={host:"127.0.0.1",port:"22",username:"root",password:"",key:"",keyFile:"",command:"sudo service nginx restart",certPath:"/etc/nginx/ssl/certificate.crt",keyPath:"/etc/nginx/ssl/private.key"};e&&(l=e.config);const u=tn({resolver:rn(a),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"ssh",host:l.host,port:l.port,username:l.username,password:l.password,key:l.key,keyFile:l.keyFile,certPath:l.certPath,keyPath:l.keyPath,command:l.command}}),d=async h=>{console.log(h);const y={id:h.id,name:h.name,configType:h.configType,usage:bi(h.configType),config:{host:h.host,port:h.port,username:h.username,password:h.password,key:h.key,command:h.command,certPath:h.certPath,keyPath:h.keyPath}};try{const m=await yi(y);if(t(),y.id=m.id,y.created=m.created,y.updated=m.updated,h.id){n(y);return}r(y)}catch(m){Object.entries(m.response.data).forEach(([v,p])=>{u.setError(v,{type:"manual",message:p.message})});return}},f=async h=>{var v;const y=(v=h.target.files)==null?void 0:v[0];if(!y)return;const m=y;o(m.name);const w=await C5(m);u.setValue("key",w)},g=()=>{var h;console.log(s.current),(h=s.current)==null||h.click()};return c.jsx(c.Fragment,{children:c.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:c.jsx(nn,{...u,children:c.jsxs("form",{onSubmit:h=>{h.stopPropagation(),u.handleSubmit(d)(h)},className:"space-y-3",children:[c.jsx(Ae,{control:u.control,name:"name",render:({field:h})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"名称"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入授权名称",...h})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:u.control,name:"id",render:({field:h})=>c.jsxs(Te,{className:"hidden",children:[c.jsx(Ne,{children:"配置类型"}),c.jsx(Re,{children:c.jsx(Fe,{...h})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:u.control,name:"configType",render:({field:h})=>c.jsxs(Te,{className:"hidden",children:[c.jsx(Ne,{children:"配置类型"}),c.jsx(Re,{children:c.jsx(Fe,{...h})}),c.jsx(ke,{})]})}),c.jsxs("div",{className:"flex space-x-2",children:[c.jsx(Ae,{control:u.control,name:"host",render:({field:h})=>c.jsxs(Te,{className:"grow",children:[c.jsx(Ne,{children:"服务器IP"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入Host",...h})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:u.control,name:"port",render:({field:h})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"SSH端口"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入Port",...h,type:"number"})}),c.jsx(ke,{})]})})]}),c.jsx(Ae,{control:u.control,name:"username",render:({field:h})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"用户名"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入用户名",...h})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:u.control,name:"password",render:({field:h})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"密码"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入密码",...h,type:"password"})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:u.control,name:"key",render:({field:h})=>c.jsxs(Te,{hidden:!0,children:[c.jsx(Ne,{children:"Key(使用证书登录)"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入Key",...h})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:u.control,name:"keyFile",render:({field:h})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"Key(使用证书登录)"}),c.jsx(Re,{children:c.jsxs("div",{children:[c.jsx(at,{type:"button",variant:"secondary",size:"sm",className:"w-48",onClick:g,children:i||"请选择文件"}),c.jsx(Fe,{placeholder:"请输入Key",...h,ref:s,className:"hidden",hidden:!0,type:"file",onChange:f})]})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:u.control,name:"certPath",render:({field:h})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"证书上传路径"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入证书上传路径",...h})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:u.control,name:"keyPath",render:({field:h})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"私钥上传路径"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入私钥上传路径",...h})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:u.control,name:"command",render:({field:h})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"Command"}),c.jsx(Re,{children:c.jsx(gj,{placeholder:"请输入要执行的命令",...h})}),c.jsx(ke,{})]})}),c.jsx(ke,{}),c.jsx("div",{className:"flex justify-end",children:c.jsx(at,{type:"submit",children:"保存"})})]})})})})},Qz=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=En(),s=we.object({id:we.string().optional(),name:we.string().min(1).max(64),configType:_i,url:we.string().url()});let i={url:""};e&&(i=e.config);const o=tn({resolver:rn(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"webhook",url:i.url}}),a=async l=>{console.log(l);const u={id:l.id,name:l.name,configType:l.configType,usage:bi(l.configType),config:{url:l.url}};try{const d=await yi(u);if(t(),u.id=d.id,u.created=d.created,u.updated=d.updated,l.id){n(u);return}r(u)}catch(d){Object.entries(d.response.data).forEach(([g,h])=>{o.setError(g,{type:"manual",message:h.message})})}};return c.jsx(c.Fragment,{children:c.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:c.jsx(nn,{...o,children:c.jsxs("form",{onSubmit:l=>{console.log(l),l.stopPropagation(),o.handleSubmit(a)(l)},className:"space-y-8",children:[c.jsx(Ae,{control:o.control,name:"name",render:({field:l})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"名称"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入授权名称",...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"id",render:({field:l})=>c.jsxs(Te,{className:"hidden",children:[c.jsx(Ne,{children:"配置类型"}),c.jsx(Re,{children:c.jsx(Fe,{...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"configType",render:({field:l})=>c.jsxs(Te,{className:"hidden",children:[c.jsx(Ne,{children:"配置类型"}),c.jsx(Re,{children:c.jsx(Fe,{...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"url",render:({field:l})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"Webhook Url"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入Webhook Url",...l})}),c.jsx(ke,{})]})}),c.jsx("div",{className:"flex justify-end",children:c.jsx(at,{type:"submit",children:"保存"})})]})})})})},Jz=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=En(),s=we.object({id:we.string().optional(),name:we.string().min(1).max(64),configType:_i,dnsApiToken:we.string().min(1).max(64)});let i={dnsApiToken:""};e&&(i=e.config);const o=tn({resolver:rn(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"cloudflare",dnsApiToken:i.dnsApiToken}}),a=async l=>{console.log(l);const u={id:l.id,name:l.name,configType:l.configType,usage:bi(l.configType),config:{dnsApiToken:l.dnsApiToken}};try{const d=await yi(u);if(t(),u.id=d.id,u.created=d.created,u.updated=d.updated,l.id){n(u);return}r(u)}catch(d){Object.entries(d.response.data).forEach(([g,h])=>{o.setError(g,{type:"manual",message:h.message})})}};return c.jsx(c.Fragment,{children:c.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:c.jsx(nn,{...o,children:c.jsxs("form",{onSubmit:l=>{console.log(l),l.stopPropagation(),o.handleSubmit(a)(l)},className:"space-y-8",children:[c.jsx(Ae,{control:o.control,name:"name",render:({field:l})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"名称"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入授权名称",...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"id",render:({field:l})=>c.jsxs(Te,{className:"hidden",children:[c.jsx(Ne,{children:"配置类型"}),c.jsx(Re,{children:c.jsx(Fe,{...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"configType",render:({field:l})=>c.jsxs(Te,{className:"hidden",children:[c.jsx(Ne,{children:"配置类型"}),c.jsx(Re,{children:c.jsx(Fe,{...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"dnsApiToken",render:({field:l})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"CLOUD_DNS_API_TOKEN"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入CLOUD_DNS_API_TOKEN",...l})}),c.jsx(ke,{})]})}),c.jsx("div",{className:"flex justify-end",children:c.jsx(at,{type:"submit",children:"保存"})})]})})})})},e8=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=En(),s=we.object({id:we.string().optional(),name:we.string().min(1).max(64),configType:_i,accessKey:we.string().min(1).max(64),secretKey:we.string().min(1).max(64)});let i={accessKey:"",secretKey:""};e&&(i=e.config);const o=tn({resolver:rn(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"qiniu",accessKey:i.accessKey,secretKey:i.secretKey}}),a=async l=>{const u={id:l.id,name:l.name,configType:l.configType,usage:bi(l.configType),config:{accessKey:l.accessKey,secretKey:l.secretKey}};try{const d=await yi(u);if(t(),u.id=d.id,u.created=d.created,u.updated=d.updated,l.id){n(u);return}r(u)}catch(d){Object.entries(d.response.data).forEach(([g,h])=>{o.setError(g,{type:"manual",message:h.message})});return}};return c.jsx(c.Fragment,{children:c.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:c.jsx(nn,{...o,children:c.jsxs("form",{onSubmit:l=>{l.stopPropagation(),o.handleSubmit(a)(l)},className:"space-y-8",children:[c.jsx(Ae,{control:o.control,name:"name",render:({field:l})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"名称"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入授权名称",...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"id",render:({field:l})=>c.jsxs(Te,{className:"hidden",children:[c.jsx(Ne,{children:"配置类型"}),c.jsx(Re,{children:c.jsx(Fe,{...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"configType",render:({field:l})=>c.jsxs(Te,{className:"hidden",children:[c.jsx(Ne,{children:"配置类型"}),c.jsx(Re,{children:c.jsx(Fe,{...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"accessKey",render:({field:l})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"AccessKey"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入AccessKey",...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"secretKey",render:({field:l})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"SecretKey"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入SecretKey",...l})}),c.jsx(ke,{})]})}),c.jsx(ke,{}),c.jsx("div",{className:"flex justify-end",children:c.jsx(at,{type:"submit",children:"保存"})})]})})})})},t8=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=En(),s=we.object({id:we.string().optional(),name:we.string().min(1).max(64),configType:_i,apiKey:we.string().min(1).max(64)});let i={apiKey:""};e&&(i=e.config);const o=tn({resolver:rn(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"namesilo",apiKey:i.apiKey}}),a=async l=>{console.log(l);const u={id:l.id,name:l.name,configType:l.configType,usage:bi(l.configType),config:{apiKey:l.apiKey}};try{const d=await yi(u);if(t(),u.id=d.id,u.created=d.created,u.updated=d.updated,l.id){n(u);return}r(u)}catch(d){Object.entries(d.response.data).forEach(([g,h])=>{o.setError(g,{type:"manual",message:h.message})})}};return c.jsx(c.Fragment,{children:c.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:c.jsx(nn,{...o,children:c.jsxs("form",{onSubmit:l=>{console.log(l),l.stopPropagation(),o.handleSubmit(a)(l)},className:"space-y-8",children:[c.jsx(Ae,{control:o.control,name:"name",render:({field:l})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"名称"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入授权名称",...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"id",render:({field:l})=>c.jsxs(Te,{className:"hidden",children:[c.jsx(Ne,{children:"配置类型"}),c.jsx(Re,{children:c.jsx(Fe,{...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"configType",render:({field:l})=>c.jsxs(Te,{className:"hidden",children:[c.jsx(Ne,{children:"配置类型"}),c.jsx(Re,{children:c.jsx(Fe,{...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"apiKey",render:({field:l})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"NAMESILO_API_KEY"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入NAMESILO_API_KEY",...l})}),c.jsx(ke,{})]})}),c.jsx("div",{className:"flex justify-end",children:c.jsx(at,{type:"submit",children:"保存"})})]})})})})},r8=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=En(),s=we.object({id:we.string().optional(),name:we.string().min(1).max(64),configType:_i,apiKey:we.string().min(1).max(64),apiSecret:we.string().min(1).max(64)});let i={apiKey:"",apiSecret:""};e&&(i=e.config);const o=tn({resolver:rn(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"godaddy",apiKey:i.apiKey,apiSecret:i.apiSecret}}),a=async l=>{console.log(l);const u={id:l.id,name:l.name,configType:l.configType,usage:bi(l.configType),config:{apiKey:l.apiKey,apiSecret:l.apiSecret}};try{const d=await yi(u);if(t(),u.id=d.id,u.created=d.created,u.updated=d.updated,l.id){n(u);return}r(u)}catch(d){Object.entries(d.response.data).forEach(([g,h])=>{o.setError(g,{type:"manual",message:h.message})})}};return c.jsx(c.Fragment,{children:c.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:c.jsx(nn,{...o,children:c.jsxs("form",{onSubmit:l=>{console.log(l),l.stopPropagation(),o.handleSubmit(a)(l)},className:"space-y-8",children:[c.jsx(Ae,{control:o.control,name:"name",render:({field:l})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"名称"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入授权名称",...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"id",render:({field:l})=>c.jsxs(Te,{className:"hidden",children:[c.jsx(Ne,{children:"配置类型"}),c.jsx(Re,{children:c.jsx(Fe,{...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"configType",render:({field:l})=>c.jsxs(Te,{className:"hidden",children:[c.jsx(Ne,{children:"配置类型"}),c.jsx(Re,{children:c.jsx(Fe,{...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"apiKey",render:({field:l})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"GODADDY_API_KEY"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入GODADDY_API_KEY",...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"apiSecret",render:({field:l})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"GODADDY_API_SECRET"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入GODADDY_API_SECRET",...l})}),c.jsx(ke,{})]})}),c.jsx("div",{className:"flex justify-end",children:c.jsx(at,{type:"submit",children:"保存"})})]})})})})};function gl({trigger:e,op:t,data:r,className:n}){const[s,i]=x.useState(!1),o=Array.from(zi.keys()),[a,l]=x.useState((r==null?void 0:r.configType)||"");let u=c.jsx(c.Fragment,{children:" "});switch(a){case"tencent":u=c.jsx(Gz,{data:r,onAfterReq:()=>{i(!1)}});break;case"aliyun":u=c.jsx(qz,{data:r,onAfterReq:()=>{i(!1)}});break;case"ssh":u=c.jsx(Xz,{data:r,onAfterReq:()=>{i(!1)}});break;case"webhook":u=c.jsx(Qz,{data:r,onAfterReq:()=>{i(!1)}});break;case"cloudflare":u=c.jsx(Jz,{data:r,onAfterReq:()=>{i(!1)}});break;case"qiniu":u=c.jsx(e8,{data:r,onAfterReq:()=>{i(!1)}});break;case"namesilo":u=c.jsx(t8,{data:r,onAfterReq:()=>{i(!1)}});break;case"godaddy":u=c.jsx(r8,{data:r,onAfterReq:()=>{i(!1)}});break}const d=f=>f==a?"border-primary":"";return c.jsxs(JE,{onOpenChange:i,open:s,children:[c.jsx(ej,{asChild:!0,className:pe(n),children:e}),c.jsxs(Wv,{className:"sm:max-w-[600px] w-full dark:text-stone-200",children:[c.jsx($v,{children:c.jsxs(Bv,{children:[t=="add"?"添加":"编辑","授权"]})}),c.jsx(Gv,{className:"max-h-[80vh]",children:c.jsxs("div",{className:"container py-3",children:[c.jsx(Uv,{children:"服务商"}),c.jsxs(el,{onValueChange:f=>{console.log(f),l(f)},defaultValue:a,children:[c.jsx(Mo,{className:"mt-3",children:c.jsx(rl,{placeholder:"请选择服务商"})}),c.jsx(Io,{children:c.jsxs(tl,{children:[c.jsx(Lo,{children:"服务商"}),o.map(f=>{var g,h;return c.jsx(Fo,{value:f,children:c.jsxs("div",{className:pe("flex items-center space-x-2 rounded cursor-pointer",d(f)),children:[c.jsx("img",{src:(g=zi.get(f))==null?void 0:g[1],className:"h-6 w-6"}),c.jsx("div",{children:(h=zi.get(f))==null?void 0:h[0]})]})},f)})]})})]}),u]})})]})]})}const n8=({className:e,trigger:t})=>{const{config:{emails:r},setEmails:n}=En(),[s,i]=x.useState(!1),o=we.object({email:we.string().email()}),a=tn({resolver:rn(o),defaultValues:{email:""}}),l=async u=>{if(r.content.emails.includes(u.email)){a.setError("email",{message:"邮箱已存在"});return}const d=[...r.content.emails,u.email];try{const f=await e3({...r,name:"emails",content:{emails:d}});n(f),a.reset(),a.clearErrors(),i(!1)}catch(f){Object.entries(f.response.data).forEach(([h,y])=>{a.setError(h,{type:"manual",message:y.message})})}};return c.jsxs(JE,{onOpenChange:i,open:s,children:[c.jsx(ej,{asChild:!0,className:pe(e),children:t}),c.jsxs(Wv,{className:"sm:max-w-[600px] w-full dark:text-stone-200",children:[c.jsx($v,{children:c.jsx(Bv,{children:"添加邮箱"})}),c.jsx("div",{className:"container py-3",children:c.jsx(nn,{...a,children:c.jsxs("form",{onSubmit:u=>{console.log(u),u.stopPropagation(),a.handleSubmit(l)(u)},className:"space-y-8",children:[c.jsx(Ae,{control:a.control,name:"email",render:({field:u})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"邮箱"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入邮箱",...u,type:"email"})}),c.jsx(ke,{})]})}),c.jsx("div",{className:"flex justify-end",children:c.jsx(at,{type:"submit",children:"保存"})})]})})})]})]})},s8=()=>{const{config:{accesses:e,emails:t}}=En(),[r,n]=x.useState(),s=Hn();x.useEffect(()=>{const y=new URLSearchParams(s.search).get("id");y&&(async()=>{const w=await R5(y);n(w)})()},[s.search]);const i=we.object({id:we.string().optional(),domain:we.string().regex(/^(?:\*\.)?([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}$/,{message:"请输入正确的域名"}),email:we.string().email().optional(),access:we.string().regex(/^[a-zA-Z0-9]+$/,{message:"请选择DNS服务商授权配置"}),targetAccess:we.string().regex(/^[a-zA-Z0-9]+$/,{message:"请选择部署服务商配置"}),targetType:we.string().regex(/^[a-zA-Z0-9-]+$/,{message:"请选择部署服务类型"})}),o=tn({resolver:rn(i),defaultValues:{id:"",domain:"",email:"",access:"",targetAccess:"",targetType:""}});x.useEffect(()=>{r&&o.reset({id:r.id,domain:r.domain,email:r.email,access:r.access,targetAccess:r.targetAccess,targetType:r.targetType})},[r,o]);const[a,l]=x.useState(r?r.targetType:""),u=e.filter(h=>{if(h.usage=="apply")return!1;if(a=="")return!0;const y=o.getValues().targetType.split("-");return h.configType===y[0]}),{toast:d}=Tf(),f=Sn(),g=async h=>{const y={id:h.id,crontab:"0 0 * * *",domain:h.domain,email:h.email,access:h.access,targetAccess:h.targetAccess,targetType:h.targetType};try{await sm(y);let m="域名编辑成功";y.id==""&&(m="域名添加成功"),d({title:"成功",description:m}),f("/domains")}catch(m){Object.entries(m.response.data).forEach(([v,p])=>{o.setError(v,{type:"manual",message:p.message})});return}};return c.jsx(c.Fragment,{children:c.jsxs("div",{className:"",children:[c.jsx(Pv,{}),c.jsxs("div",{className:"border-b dark:border-stone-500 h-10 text-muted-foreground",children:[r!=null&&r.id?"编辑":"新增","域名"]}),c.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:c.jsx(nn,{...o,children:c.jsxs("form",{onSubmit:o.handleSubmit(g),className:"space-y-8 dark:text-stone-200",children:[c.jsx(Ae,{control:o.control,name:"domain",render:({field:h})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"域名"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入域名",...h})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"email",render:({field:h})=>c.jsxs(Te,{children:[c.jsxs(Ne,{className:"flex w-full justify-between",children:[c.jsx("div",{children:"Email(申请证书需要提供邮箱)"}),c.jsx(n8,{trigger:c.jsxs("div",{className:"font-normal text-primary hover:underline cursor-pointer flex items-center",children:[c.jsx(yh,{size:14}),"新增"]})})]}),c.jsx(Re,{children:c.jsxs(el,{...h,value:h.value,onValueChange:y=>{o.setValue("email",y)},children:[c.jsx(Mo,{children:c.jsx(rl,{placeholder:"请选择邮箱"})}),c.jsx(Io,{children:c.jsxs(tl,{children:[c.jsx(Lo,{children:"邮箱列表"}),t.content.emails.map(y=>c.jsx(Fo,{value:y,children:c.jsx("div",{children:y})},y))]})})]})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"access",render:({field:h})=>c.jsxs(Te,{children:[c.jsxs(Ne,{className:"flex w-full justify-between",children:[c.jsx("div",{children:"DNS 服务商授权配置"}),c.jsx(gl,{trigger:c.jsxs("div",{className:"font-normal text-primary hover:underline cursor-pointer flex items-center",children:[c.jsx(yh,{size:14}),"新增"]}),op:"add"})]}),c.jsx(Re,{children:c.jsxs(el,{...h,value:h.value,onValueChange:y=>{o.setValue("access",y)},children:[c.jsx(Mo,{children:c.jsx(rl,{placeholder:"请选择授权配置"})}),c.jsx(Io,{children:c.jsxs(tl,{children:[c.jsx(Lo,{children:"服务商授权配置"}),e.filter(y=>y.usage!="deploy").map(y=>{var m;return c.jsx(Fo,{value:y.id,children:c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx("img",{className:"w-6",src:(m=zi.get(y.configType))==null?void 0:m[1]}),c.jsx("div",{children:y.name})]})},y.id)})]})})]})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"targetType",render:({field:h})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"部署服务类型"}),c.jsx(Re,{children:c.jsxs(el,{...h,onValueChange:y=>{l(y),o.setValue("targetType",y)},children:[c.jsx(Mo,{children:c.jsx(rl,{placeholder:"请选择部署服务类型"})}),c.jsx(Io,{children:c.jsxs(tl,{children:[c.jsx(Lo,{children:"部署服务类型"}),Az.map(y=>{var m,w;return c.jsx(Fo,{value:y,children:c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx("img",{className:"w-6",src:(m=mm.get(y))==null?void 0:m[1]}),c.jsx("div",{children:(w=mm.get(y))==null?void 0:w[0]})]})},y)})]})})]})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"targetAccess",render:({field:h})=>c.jsxs(Te,{children:[c.jsxs(Ne,{className:"w-full flex justify-between",children:[c.jsx("div",{children:"部署服务商授权配置"}),c.jsx(gl,{trigger:c.jsxs("div",{className:"font-normal text-primary hover:underline cursor-pointer flex items-center",children:[c.jsx(yh,{size:14}),"新增"]}),op:"add"})]}),c.jsx(Re,{children:c.jsxs(el,{...h,onValueChange:y=>{o.setValue("targetAccess",y)},children:[c.jsx(Mo,{children:c.jsx(rl,{placeholder:"请选择授权配置"})}),c.jsx(Io,{children:c.jsxs(tl,{children:[c.jsx(Lo,{children:"服务商授权配置"}),u.map(y=>{var m;return c.jsx(Fo,{value:y.id,children:c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx("img",{className:"w-6",src:(m=zi.get(y.configType))==null?void 0:m[1]}),c.jsx("div",{children:y.name})]})},y.id)})]})})]})}),c.jsx(ke,{})]})}),c.jsx("div",{className:"flex justify-end",children:c.jsx(at,{type:"submit",children:"保存"})})]})})})]})})},i8=()=>{const{config:e,deleteAccess:t}=En(),{accesses:r}=e,n=10,s=Math.ceil(r.length/n),i=Sn(),o=Hn(),a=new URLSearchParams(o.search),l=a.get("page"),u=l?Number(l):1,d=(u-1)*n,f=d+n,g=async h=>{const y=await XF(h);t(y.id)};return c.jsxs("div",{className:"",children:[c.jsxs("div",{className:"flex justify-between items-center",children:[c.jsx("div",{className:"text-muted-foreground",children:"授权管理"}),c.jsx(gl,{trigger:c.jsx(at,{children:"添加授权"}),op:"add"})]}),r.length===0?c.jsxs("div",{className:"flex flex-col items-center mt-10",children:[c.jsx("span",{className:"bg-orange-100 p-5 rounded-full",children:c.jsx($R,{size:40,className:"text-primary"})}),c.jsx("div",{className:"text-center text-sm text-muted-foreground mt-3",children:"请添加授权开始部署证书吧。"}),c.jsx(gl,{trigger:c.jsx(at,{children:"添加授权"}),op:"add",className:"mt-3"})]}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"hidden sm:flex sm:flex-row text-muted-foreground text-sm border-b dark:border-stone-500 sm:p-2 mt-5",children:[c.jsx("div",{className:"w-48",children:"名称"}),c.jsx("div",{className:"w-48",children:"服务商"}),c.jsx("div",{className:"w-52",children:"创建时间"}),c.jsx("div",{className:"w-52",children:"更新时间"}),c.jsx("div",{className:"grow",children:"操作"})]}),c.jsx("div",{className:"sm:hidden flex text-sm text-muted-foreground",children:"授权列表"}),r.slice(d,f).map(h=>{var y,m;return c.jsxs("div",{className:"flex flex-col sm:flex-row text-secondary-foreground border-b dark:border-stone-500 sm:p-2 hover:bg-muted/50 text-sm",children:[c.jsx("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center",children:h.name}),c.jsxs("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center space-x-2",children:[c.jsx("img",{src:(y=zi.get(h.configType))==null?void 0:y[1],className:"w-6"}),c.jsx("div",{children:(m=zi.get(h.configType))==null?void 0:m[0]})]}),c.jsxs("div",{className:"sm:w-52 w-full pt-1 sm:pt-0 flex items-center",children:["创建于 ",h.created&&ca(h.created)]}),c.jsxs("div",{className:"sm:w-52 w-full pt-1 sm:pt-0 flex items-center",children:["更新于 ",h.updated&&ca(h.updated)]}),c.jsxs("div",{className:"flex items-center grow justify-start pt-1 sm:pt-0",children:[c.jsx(gl,{trigger:c.jsx(at,{variant:"link",className:"p-0",children:"编辑"}),op:"edit",data:h}),c.jsx(Yt,{orientation:"vertical",className:"h-4 mx-2"}),c.jsx(at,{variant:"link",className:"p-0",onClick:()=>{g(h)},children:"删除"})]})]},h.id)}),c.jsx(kk,{totalPages:s,currentPage:u,onPageChange:h=>{a.set("page",h.toString()),i({search:a.toString()})}})]})]})},o8=uc("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),qv=x.forwardRef(({className:e,variant:t,...r},n)=>c.jsx("div",{ref:n,role:"alert",className:pe(o8({variant:t}),e),...r}));qv.displayName="Alert";const Xv=x.forwardRef(({className:e,...t},r)=>c.jsx("h5",{ref:r,className:pe("mb-1 font-medium leading-none tracking-tight",e),...t}));Xv.displayName="AlertTitle";const Qv=x.forwardRef(({className:e,...t},r)=>c.jsx("div",{ref:r,className:pe("text-sm [&_p]:leading-relaxed",e),...t}));Qv.displayName="AlertDescription";const vj=async e=>{let t=1;e.page&&(t=e.page);let r=50;e.perPage&&(r=e.perPage);let n="domain!=null";return e.domain&&(n=`domain="${e.domain}"`),await xt().collection("deployments").getList(t,r,{filter:n,sort:"-deployedAt",expand:"domain"})},a8=()=>{const e=Sn(),[t,r]=x.useState(),[n]=PR(),s=n.get("domain");return x.useEffect(()=>{(async()=>{const o={};s&&(o.domain=s);const a=await vj(o);r(a.items)})()},[s]),c.jsxs(Gv,{className:"h-[80vh] overflow-hidden",children:[c.jsx("div",{className:"text-muted-foreground",children:"部署历史"}),t!=null&&t.length?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"hidden sm:flex sm:flex-row text-muted-foreground text-sm border-b dark:border-stone-500 sm:p-2 mt-5",children:[c.jsx("div",{className:"w-48",children:"域名"}),c.jsx("div",{className:"w-24",children:"状态"}),c.jsx("div",{className:"w-56",children:"阶段"}),c.jsx("div",{className:"w-56 sm:ml-2 text-center",children:"最近执行时间"}),c.jsx("div",{className:"grow",children:"操作"})]}),c.jsx("div",{className:"sm:hidden flex text-sm text-muted-foreground",children:"部署历史"}),t==null?void 0:t.map(i=>{var o,a;return c.jsxs("div",{className:"flex flex-col sm:flex-row text-secondary-foreground border-b dark:border-stone-500 sm:p-2 hover:bg-muted/50 text-sm",children:[c.jsx("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center",children:(o=i.expand.domain)==null?void 0:o.domain}),c.jsx("div",{className:"sm:w-24 w-full pt-1 sm:pt-0 flex items-center",children:i.phase==="deploy"&&i.phaseSuccess?c.jsx(vg,{size:16,className:"text-green-700"}):c.jsx(yg,{size:16,className:"text-red-700"})}),c.jsx("div",{className:"sm:w-56 w-full pt-1 sm:pt-0 flex items-center",children:c.jsx(Ev,{phase:i.phase,phaseSuccess:i.phaseSuccess})}),c.jsx("div",{className:"sm:w-56 w-full pt-1 sm:pt-0 flex items-center sm:justify-center",children:ca(i.deployedAt)}),c.jsx("div",{className:"flex items-center grow justify-start pt-1 sm:pt-0 sm:ml-2",children:c.jsxs(Jg,{children:[c.jsx(ev,{asChild:!0,children:c.jsx(at,{variant:"link",className:"p-0",children:"日志"})}),c.jsxs(pf,{className:"sm:max-w-5xl",children:[c.jsx(tv,{children:c.jsxs(rv,{children:[(a=i.expand.domain)==null?void 0:a.domain,"-",i.id,"部署详情"]})}),c.jsxs("div",{className:"bg-gray-950 text-stone-100 p-5 text-sm h-[80dvh]",children:[i.log.check&&c.jsx(c.Fragment,{children:i.log.check.map(l=>c.jsxs("div",{className:"flex flex-col mt-2",children:[c.jsxs("div",{className:"flex",children:[c.jsxs("div",{children:["[",l.time,"]"]}),c.jsx("div",{className:"ml-2",children:l.message})]}),l.error&&c.jsx("div",{className:"mt-1 text-red-600",children:l.error})]}))}),i.log.apply&&c.jsx(c.Fragment,{children:i.log.apply.map(l=>c.jsxs("div",{className:"flex flex-col mt-2",children:[c.jsxs("div",{className:"flex",children:[c.jsxs("div",{children:["[",l.time,"]"]}),c.jsx("div",{className:"ml-2",children:l.message})]}),l.info&&l.info.map(u=>c.jsx("div",{className:"mt-1 text-green-600",children:u})),l.error&&c.jsx("div",{className:"mt-1 text-red-600",children:l.error})]}))}),i.log.deploy&&c.jsx(c.Fragment,{children:i.log.deploy.map(l=>c.jsxs("div",{className:"flex flex-col mt-2",children:[c.jsxs("div",{className:"flex",children:[c.jsxs("div",{children:["[",l.time,"]"]}),c.jsx("div",{className:"ml-2",children:l.message})]}),l.error&&c.jsx("div",{className:"mt-1 text-red-600",children:l.error})]}))})]})]})]})})]},i.id)})]}):c.jsx(c.Fragment,{children:c.jsxs(qv,{className:"max-w-[40em] mx-auto mt-20",children:[c.jsx(Xv,{children:"暂无数据"}),c.jsxs(Qv,{children:[c.jsxs("div",{className:"flex items-center mt-5",children:[c.jsx("div",{children:c.jsx(p1,{className:"text-yellow-400",size:36})}),c.jsxs("div",{className:"ml-2",children:[" ","你暂未创建任何部署,请先添加域名进行部署吧!"]})]}),c.jsx("div",{className:"mt-2 flex justify-end",children:c.jsx(at,{onClick:()=>{e("/")},children:"添加域名"})})]})]})})]})},gm=e=>e instanceof Error?e.message:typeof e=="object"&&e!==null&&"message"in e?String(e.message):typeof e=="string"?e:"Something went wrong",l8=we.object({username:we.string().email({message:"请输入正确的邮箱地址"}),password:we.string().min(10,{message:"密码至少10个字符"})}),c8=()=>{const e=tn({resolver:rn(l8),defaultValues:{username:"",password:""}}),t=async n=>{try{await xt().admins.authWithPassword(n.username,n.password),r("/")}catch(s){const i=gm(s);e.setError("username",{message:i}),e.setError("password",{message:i})}},r=Sn();return c.jsxs("div",{className:"max-w-[35em] border dark:border-stone-500 mx-auto mt-32 p-10 rounded-md shadow-md",children:[c.jsx("div",{className:"flex justify-center mb-10",children:c.jsx("img",{src:"/vite.svg",className:"w-16"})}),c.jsx(nn,{...e,children:c.jsxs("form",{onSubmit:e.handleSubmit(t),className:"space-y-8 dark:text-stone-200",children:[c.jsx(Ae,{control:e.control,name:"username",render:({field:n})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"用户名"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"email",...n})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:e.control,name:"password",render:({field:n})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"密码"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"shadcn",...n,type:"password"})}),c.jsx(ke,{})]})}),c.jsx("div",{className:"flex justify-end",children:c.jsx(at,{type:"submit",children:"登录"})})]})})]})},u8=()=>xt().authStore.isValid&&xt().authStore.isAdmin?c.jsx(u1,{to:"/"}):c.jsx("div",{className:"container",children:c.jsx(gg,{})}),d8=we.object({oldPassword:we.string().min(10,{message:"密码至少10个字符"}),newPassword:we.string().min(10,{message:"密码至少10个字符"}),confirmPassword:we.string().min(10,{message:"密码至少10个字符"})}).refine(e=>e.newPassword===e.confirmPassword,{message:"两次密码不一致",path:["confirmPassword"]}),f8=()=>{const{toast:e}=Tf(),t=Sn(),r=tn({resolver:rn(d8),defaultValues:{oldPassword:"",newPassword:"",confirmPassword:""}}),n=async s=>{var i,o;try{await xt().admins.authWithPassword((i=xt().authStore.model)==null?void 0:i.email,s.oldPassword)}catch(a){const l=gm(a);r.setError("oldPassword",{message:l})}try{await xt().admins.update((o=xt().authStore.model)==null?void 0:o.id,{password:s.newPassword,passwordConfirm:s.confirmPassword}),xt().authStore.clear(),e({title:"修改密码成功",description:"请重新登录"}),setTimeout(()=>{t("/login")},500)}catch(a){const l=gm(a);e({title:"修改密码失败",description:l,variant:"destructive"})}};return c.jsx(c.Fragment,{children:c.jsx(nn,{...r,children:c.jsxs("form",{onSubmit:r.handleSubmit(n),className:"space-y-8 dark:text-stone-200",children:[c.jsx(Ae,{control:r.control,name:"oldPassword",render:({field:s})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"当前密码"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"当前密码",...s,type:"password"})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:r.control,name:"newPassword",render:({field:s})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"新密码"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"newPassword",...s,type:"password"})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:r.control,name:"confirmPassword",render:({field:s})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"确认密码"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"confirmPassword",...s,type:"password"})}),c.jsx(ke,{})]})}),c.jsx("div",{className:"flex justify-end",children:c.jsx(at,{type:"submit",children:"确认修改"})})]})})})},h8=()=>c.jsxs("div",{children:[c.jsx(Pv,{}),c.jsx("div",{className:"text-muted-foreground border-b dark:border-stone-500 py-5",children:"设置密码"}),c.jsx("div",{className:"w-full sm:w-[35em] mt-10 flex flex-col p-3 mx-auto",children:c.jsx(gg,{})})]}),p8=()=>{const[e,t]=x.useState(),[r,n]=x.useState(),s=Sn();return x.useEffect(()=>{(async()=>{const o=await N5();t(o)})()},[]),x.useEffect(()=>{(async()=>{const a=await vj({perPage:8});n(a.items)})()},[]),c.jsxs("div",{className:"flex flex-col",children:[c.jsx("div",{className:"flex justify-between items-center",children:c.jsx("div",{className:"text-muted-foreground",children:"控制面板"})}),c.jsxs("div",{className:"flex mt-10 gap-5 flex-col flex-wrap md:flex-row",children:[c.jsxs("div",{className:"w-full md:w-[250px] 3xl:w-[300px] flex items-center rounded-md p-3 shadow-lg border",children:[c.jsx("div",{className:"p-3",children:c.jsx(ZR,{size:48,strokeWidth:1,className:"text-blue-400"})}),c.jsxs("div",{children:[c.jsx("div",{className:"text-muted-foreground font-semibold",children:"所有"}),c.jsxs("div",{className:"flex items-baseline",children:[c.jsx("div",{className:"text-3xl text-stone-700 dark:text-stone-200",children:e!=null&&e.total?c.jsx(dr,{to:"/domains",className:"hover:underline",children:e==null?void 0:e.total}):0}),c.jsx("div",{className:"ml-1 text-stone-700 dark:text-stone-200",children:"个"})]})]})]}),c.jsxs("div",{className:"w-full md:w-[250px] 3xl:w-[300px] flex items-center rounded-md p-3 shadow-lg border",children:[c.jsx("div",{className:"p-3",children:c.jsx(LR,{size:48,strokeWidth:1,className:"text-red-400"})}),c.jsxs("div",{children:[c.jsx("div",{className:"text-muted-foreground font-semibold",children:"即将过期"}),c.jsxs("div",{className:"flex items-baseline",children:[c.jsx("div",{className:"text-3xl text-stone-700 dark:text-stone-200",children:e!=null&&e.expired?c.jsx(dr,{to:"/domains?state=expired",className:"hover:underline",children:e==null?void 0:e.expired}):0}),c.jsx("div",{className:"ml-1 text-stone-700 dark:text-stone-200",children:"个"})]})]})]}),c.jsxs("div",{className:"border w-full md:w-[250px] 3xl:w-[300px] flex items-center rounded-md p-3 shadow-lg",children:[c.jsx("div",{className:"p-3",children:c.jsx(BR,{size:48,strokeWidth:1,className:"text-green-400"})}),c.jsxs("div",{children:[c.jsx("div",{className:"text-muted-foreground font-semibold",children:"启用中"}),c.jsxs("div",{className:"flex items-baseline",children:[c.jsx("div",{className:"text-3xl text-stone-700 dark:text-stone-200",children:e!=null&&e.enabled?c.jsx(dr,{to:"/domains?state=enabled",className:"hover:underline",children:e==null?void 0:e.enabled}):0}),c.jsx("div",{className:"ml-1 text-stone-700 dark:text-stone-200",children:"个"})]})]})]}),c.jsxs("div",{className:"border w-full md:w-[250px] 3xl:w-[300px] flex items-center rounded-md p-3 shadow-lg",children:[c.jsx("div",{className:"p-3",children:c.jsx(MR,{size:48,strokeWidth:1,className:"text-gray-400"})}),c.jsxs("div",{children:[c.jsx("div",{className:"text-muted-foreground font-semibold",children:"未启用"}),c.jsxs("div",{className:"flex items-baseline",children:[c.jsx("div",{className:"text-3xl text-stone-700 dark:text-stone-200",children:e!=null&&e.disabled?c.jsx(dr,{to:"/domains?state=disabled",className:"hover:underline",children:e==null?void 0:e.disabled}):0}),c.jsx("div",{className:"ml-1 text-stone-700 dark:text-stone-200",children:"个"})]})]})]})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-muted-foreground mt-5 text-sm",children:"部署历史"}),(r==null?void 0:r.length)==0?c.jsx(c.Fragment,{children:c.jsxs(qv,{className:"max-w-[40em] mt-10",children:[c.jsx(Xv,{children:"暂无数据"}),c.jsxs(Qv,{children:[c.jsxs("div",{className:"flex items-center mt-5",children:[c.jsx("div",{children:c.jsx(p1,{className:"text-yellow-400",size:36})}),c.jsxs("div",{className:"ml-2",children:[" ","你暂未创建任何部署,请先添加域名进行部署吧!"]})]}),c.jsx("div",{className:"mt-2 flex justify-end",children:c.jsx(at,{onClick:()=>{s("/")},children:"添加域名"})})]})]})}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"hidden sm:flex sm:flex-row text-muted-foreground text-sm border-b dark:border-stone-500 sm:p-2 mt-5",children:[c.jsx("div",{className:"w-48",children:"域名"}),c.jsx("div",{className:"w-24",children:"状态"}),c.jsx("div",{className:"w-56",children:"阶段"}),c.jsx("div",{className:"w-56 sm:ml-2 text-center",children:"最近执行时间"}),c.jsx("div",{className:"grow",children:"操作"})]}),c.jsx("div",{className:"sm:hidden flex text-sm text-muted-foreground",children:"部署历史"}),r==null?void 0:r.map(i=>{var o,a;return c.jsxs("div",{className:"flex flex-col sm:flex-row text-secondary-foreground border-b dark:border-stone-500 sm:p-2 hover:bg-muted/50 text-sm",children:[c.jsx("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center",children:(o=i.expand.domain)==null?void 0:o.domain}),c.jsx("div",{className:"sm:w-24 w-full pt-1 sm:pt-0 flex items-center",children:i.phase==="deploy"&&i.phaseSuccess?c.jsx(vg,{size:16,className:"text-green-700"}):c.jsx(yg,{size:16,className:"text-red-700"})}),c.jsx("div",{className:"sm:w-56 w-full pt-1 sm:pt-0 flex items-center",children:c.jsx(Ev,{phase:i.phase,phaseSuccess:i.phaseSuccess})}),c.jsx("div",{className:"sm:w-56 w-full pt-1 sm:pt-0 flex items-center sm:justify-center",children:ca(i.deployedAt)}),c.jsx("div",{className:"flex items-center grow justify-start pt-1 sm:pt-0 sm:ml-2",children:c.jsxs(Jg,{children:[c.jsx(ev,{asChild:!0,children:c.jsx(at,{variant:"link",className:"p-0",children:"日志"})}),c.jsxs(pf,{className:"sm:max-w-5xl",children:[c.jsx(tv,{children:c.jsxs(rv,{children:[(a=i.expand.domain)==null?void 0:a.domain,"-",i.id,"部署详情"]})}),c.jsxs("div",{className:"bg-gray-950 text-stone-100 p-5 text-sm h-[80dvh]",children:[i.log.check&&c.jsx(c.Fragment,{children:i.log.check.map(l=>c.jsxs("div",{className:"flex flex-col mt-2",children:[c.jsxs("div",{className:"flex",children:[c.jsxs("div",{children:["[",l.time,"]"]}),c.jsx("div",{className:"ml-2",children:l.message})]}),l.error&&c.jsx("div",{className:"mt-1 text-red-600",children:l.error})]}))}),i.log.apply&&c.jsx(c.Fragment,{children:i.log.apply.map(l=>c.jsxs("div",{className:"flex flex-col mt-2",children:[c.jsxs("div",{className:"flex",children:[c.jsxs("div",{children:["[",l.time,"]"]}),c.jsx("div",{className:"ml-2",children:l.message})]}),l.info&&l.info.map(u=>c.jsx("div",{className:"mt-1 text-green-600",children:u})),l.error&&c.jsx("div",{className:"mt-1 text-red-600",children:l.error})]}))}),i.log.deploy&&c.jsx(c.Fragment,{children:i.log.deploy.map(l=>c.jsxs("div",{className:"flex flex-col mt-2",children:[c.jsxs("div",{className:"flex",children:[c.jsxs("div",{children:["[",l.time,"]"]}),c.jsx("div",{className:"ml-2",children:l.message})]}),l.error&&c.jsx("div",{className:"mt-1 text-red-600",children:l.error})]}))})]})]})]})})]},i.id)})]})]})]})},m8=gR([{path:"/",element:c.jsx(c3,{}),children:[{path:"/",element:c.jsx(p8,{})},{path:"/domains",element:c.jsx(O5,{})},{path:"/edit",element:c.jsx(s8,{})},{path:"/access",element:c.jsx(i8,{})},{path:"/history",element:c.jsx(a8,{})},{path:"/setting",element:c.jsx(h8,{}),children:[{path:"/setting/password",element:c.jsx(f8,{})}]}]},{path:"/login",element:c.jsx(u8,{}),children:[{path:"/login",element:c.jsx(c8,{})}]},{path:"/about",element:c.jsx("div",{children:"About"})}]);Uh.createRoot(document.getElementById("root")).render(c.jsx(et.StrictMode,{children:c.jsx(n3,{defaultTheme:"dark",storageKey:"vite-ui-theme",children:c.jsx(CR,{router:m8})})}))});export default g8(); +\0`,ne+=i(z,2),ne+=j.magic,ne+=i(_,2),ne+=i(C,2),ne+=i(Q.crc32,4),ne+=i(Q.compressedSize,4),ne+=i(Q.uncompressedSize,4),ne+=i(D.length,2),ne+=i(W.length,2),{fileRecord:f.LOCAL_FILE_HEADER+ne+D+W,dirRecord:f.CENTRAL_FILE_HEADER+i(de,2)+ne+i(q.length,2)+"\0\0\0\0"+i(V,4)+i(w,4)+D+W+q}}var a=r("../utils"),l=r("../stream/GenericWorker"),u=r("../utf8"),d=r("../crc32"),f=r("../signature");function g(h,y,m,w){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=y,this.zipPlatform=m,this.encodeFileName=w,this.streamFiles=h,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(g,l),g.prototype.push=function(h){var y=h.meta.percent||0,m=this.entriesCount,w=this._sources.length;this.accumulate?this.contentBuffer.push(h):(this.bytesWritten+=h.data.length,l.prototype.push.call(this,{data:h.data,meta:{currentFile:this.currentFile,percent:m?(y+100*(m-w-1))/m:100}}))},g.prototype.openedSource=function(h){this.currentSourceOffset=this.bytesWritten,this.currentFile=h.file.name;var y=this.streamFiles&&!h.file.dir;if(y){var m=o(h,y,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:m.fileRecord,meta:{percent:0}})}else this.accumulate=!0},g.prototype.closedSource=function(h){this.accumulate=!1;var y=this.streamFiles&&!h.file.dir,m=o(h,y,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(m.dirRecord),y)this.push({data:function(w){return f.DATA_DESCRIPTOR+i(w.crc32,4)+i(w.compressedSize,4)+i(w.uncompressedSize,4)}(h),meta:{percent:100}});else for(this.push({data:m.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},g.prototype.flush=function(){for(var h=this.bytesWritten,y=0;y=this.index;l--)u=(u<<8)+this.byteAt(l);return this.index+=a,u},readString:function(a){return i.transformTo("string",this.readData(a))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var a=this.readInt(4);return new Date(Date.UTC(1980+(a>>25&127),(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1))}},n.exports=o},{"../utils":32}],19:[function(r,n,s){var i=r("./Uint8ArrayReader");function o(a){i.call(this,a)}r("../utils").inherits(o,i),o.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=o},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(r,n,s){var i=r("./DataReader");function o(a){i.call(this,a)}r("../utils").inherits(o,i),o.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+a)},o.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero},o.prototype.readAndCheckSignature=function(a){return a===this.readData(4)},o.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=o},{"../utils":32,"./DataReader":18}],21:[function(r,n,s){var i=r("./ArrayReader");function o(a){i.call(this,a)}r("../utils").inherits(o,i),o.prototype.readData=function(a){if(this.checkOffset(a),a===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=o},{"../utils":32,"./ArrayReader":17}],22:[function(r,n,s){var i=r("../utils"),o=r("../support"),a=r("./ArrayReader"),l=r("./StringReader"),u=r("./NodeBufferReader"),d=r("./Uint8ArrayReader");n.exports=function(f){var g=i.getTypeOf(f);return i.checkSupport(g),g!=="string"||o.uint8array?g==="nodebuffer"?new u(f):o.uint8array?new d(i.transformTo("uint8array",f)):new a(i.transformTo("array",f)):new l(f)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(r,n,s){s.LOCAL_FILE_HEADER="PK",s.CENTRAL_FILE_HEADER="PK",s.CENTRAL_DIRECTORY_END="PK",s.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",s.ZIP64_CENTRAL_DIRECTORY_END="PK",s.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(r,n,s){var i=r("./GenericWorker"),o=r("../utils");function a(l){i.call(this,"ConvertWorker to "+l),this.destType=l}o.inherits(a,i),a.prototype.processChunk=function(l){this.push({data:o.transformTo(this.destType,l.data),meta:l.meta})},n.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(r,n,s){var i=r("./GenericWorker"),o=r("../crc32");function a(){i.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}r("../utils").inherits(a,i),a.prototype.processChunk=function(l){this.streamInfo.crc32=o(l.data,this.streamInfo.crc32||0),this.push(l)},n.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(r,n,s){var i=r("../utils"),o=r("./GenericWorker");function a(l){o.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}i.inherits(a,o),a.prototype.processChunk=function(l){if(l){var u=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=u+l.data.length}o.prototype.processChunk.call(this,l)},n.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(r,n,s){var i=r("../utils"),o=r("./GenericWorker");function a(l){o.call(this,"DataWorker");var u=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(d){u.dataIsReady=!0,u.data=d,u.max=d&&d.length||0,u.type=i.getTypeOf(d),u.isPaused||u._tickAndRepeat()},function(d){u.error(d)})}i.inherits(a,o),a.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,i.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(i.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=null,u=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":l=this.data.substring(this.index,u);break;case"uint8array":l=this.data.subarray(this.index,u);break;case"array":case"nodebuffer":l=this.data.slice(this.index,u)}return this.index=u,this.push({data:l,meta:{percent:this.max?this.index/this.max*100:0}})},n.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(r,n,s){function i(o){this.name=o||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}i.prototype={push:function(o){this.emit("data",o)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(o){this.emit("error",o)}return!0},error:function(o){return!this.isFinished&&(this.isPaused?this.generatedError=o:(this.isFinished=!0,this.emit("error",o),this.previous&&this.previous.error(o),this.cleanUp()),!0)},on:function(o,a){return this._listeners[o].push(a),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(o,a){if(this._listeners[o])for(var l=0;l "+o:o}},n.exports=i},{}],29:[function(r,n,s){var i=r("../utils"),o=r("./ConvertWorker"),a=r("./GenericWorker"),l=r("../base64"),u=r("../support"),d=r("../external"),f=null;if(u.nodestream)try{f=r("../nodejs/NodejsStreamOutputAdapter")}catch{}function g(y,m){return new d.Promise(function(w,v){var p=[],_=y._internalType,C=y._outputType,E=y._mimeType;y.on("data",function(j,R){p.push(j),m&&m(R)}).on("error",function(j){p=[],v(j)}).on("end",function(){try{var j=function(R,D,P){switch(R){case"blob":return i.newBlob(i.transformTo("arraybuffer",D),P);case"base64":return l.encode(D);default:return i.transformTo(R,D)}}(C,function(R,D){var P,L=0,q=null,T=0;for(P=0;P"u")s.blob=!1;else{var i=new ArrayBuffer(0);try{s.blob=new Blob([i],{type:"application/zip"}).size===0}catch{try{var o=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);o.append(i),s.blob=o.getBlob("application/zip").size===0}catch{s.blob=!1}}}try{s.nodestream=!!r("readable-stream").Readable}catch{s.nodestream=!1}},{"readable-stream":16}],31:[function(r,n,s){for(var i=r("./utils"),o=r("./support"),a=r("./nodejsUtils"),l=r("./stream/GenericWorker"),u=new Array(256),d=0;d<256;d++)u[d]=252<=d?6:248<=d?5:240<=d?4:224<=d?3:192<=d?2:1;u[254]=u[254]=1;function f(){l.call(this,"utf-8 decode"),this.leftOver=null}function g(){l.call(this,"utf-8 encode")}s.utf8encode=function(h){return o.nodebuffer?a.newBufferFrom(h,"utf-8"):function(y){var m,w,v,p,_,C=y.length,E=0;for(p=0;p>>6:(w<65536?m[_++]=224|w>>>12:(m[_++]=240|w>>>18,m[_++]=128|w>>>12&63),m[_++]=128|w>>>6&63),m[_++]=128|63&w);return m}(h)},s.utf8decode=function(h){return o.nodebuffer?i.transformTo("nodebuffer",h).toString("utf-8"):function(y){var m,w,v,p,_=y.length,C=new Array(2*_);for(m=w=0;m<_;)if((v=y[m++])<128)C[w++]=v;else if(4<(p=u[v]))C[w++]=65533,m+=p-1;else{for(v&=p===2?31:p===3?15:7;1>10&1023,C[w++]=56320|1023&v)}return C.length!==w&&(C.subarray?C=C.subarray(0,w):C.length=w),i.applyFromCharCode(C)}(h=i.transformTo(o.uint8array?"uint8array":"array",h))},i.inherits(f,l),f.prototype.processChunk=function(h){var y=i.transformTo(o.uint8array?"uint8array":"array",h.data);if(this.leftOver&&this.leftOver.length){if(o.uint8array){var m=y;(y=new Uint8Array(m.length+this.leftOver.length)).set(this.leftOver,0),y.set(m,this.leftOver.length)}else y=this.leftOver.concat(y);this.leftOver=null}var w=function(p,_){var C;for((_=_||p.length)>p.length&&(_=p.length),C=_-1;0<=C&&(192&p[C])==128;)C--;return C<0||C===0?_:C+u[p[C]]>_?C:_}(y),v=y;w!==y.length&&(o.uint8array?(v=y.subarray(0,w),this.leftOver=y.subarray(w,y.length)):(v=y.slice(0,w),this.leftOver=y.slice(w,y.length))),this.push({data:s.utf8decode(v),meta:h.meta})},f.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:s.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},s.Utf8DecodeWorker=f,i.inherits(g,l),g.prototype.processChunk=function(h){this.push({data:s.utf8encode(h.data),meta:h.meta})},s.Utf8EncodeWorker=g},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(r,n,s){var i=r("./support"),o=r("./base64"),a=r("./nodejsUtils"),l=r("./external");function u(m){return m}function d(m,w){for(var v=0;v>8;this.dir=!!(16&this.externalFileAttributes),h==0&&(this.dosPermissions=63&this.externalFileAttributes),h==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var h=i(this.extraFields[1].value);this.uncompressedSize===o.MAX_VALUE_32BITS&&(this.uncompressedSize=h.readInt(8)),this.compressedSize===o.MAX_VALUE_32BITS&&(this.compressedSize=h.readInt(8)),this.localHeaderOffset===o.MAX_VALUE_32BITS&&(this.localHeaderOffset=h.readInt(8)),this.diskNumberStart===o.MAX_VALUE_32BITS&&(this.diskNumberStart=h.readInt(4))}},readExtraFields:function(h){var y,m,w,v=h.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});h.index+4>>6:(h<65536?g[w++]=224|h>>>12:(g[w++]=240|h>>>18,g[w++]=128|h>>>12&63),g[w++]=128|h>>>6&63),g[w++]=128|63&h);return g},s.buf2binstring=function(f){return d(f,f.length)},s.binstring2buf=function(f){for(var g=new i.Buf8(f.length),h=0,y=g.length;h>10&1023,p[y++]=56320|1023&m)}return d(p,y)},s.utf8border=function(f,g){var h;for((g=g||f.length)>f.length&&(g=f.length),h=g-1;0<=h&&(192&f[h])==128;)h--;return h<0||h===0?g:h+l[f[h]]>g?h:g}},{"./common":41}],43:[function(r,n,s){n.exports=function(i,o,a,l){for(var u=65535&i|0,d=i>>>16&65535|0,f=0;a!==0;){for(a-=f=2e3>>1:o>>>1;a[l]=o}return a}();n.exports=function(o,a,l,u){var d=i,f=u+l;o^=-1;for(var g=u;g>>8^d[255&(o^a[g])];return-1^o}},{}],46:[function(r,n,s){var i,o=r("../utils/common"),a=r("./trees"),l=r("./adler32"),u=r("./crc32"),d=r("./messages"),f=0,g=4,h=0,y=-2,m=-1,w=4,v=2,p=8,_=9,C=286,E=30,j=19,R=2*C+1,D=15,P=3,L=258,q=L+P+1,T=42,F=113,b=1,W=2,te=3,$=4;function Z(k,J){return k.msg=d[J],J}function I(k){return(k<<1)-(4k.avail_out&&(K=k.avail_out),K!==0&&(o.arraySet(k.output,J.pending_buf,J.pending_out,K,k.next_out),k.next_out+=K,J.pending_out+=K,k.total_out+=K,k.avail_out-=K,J.pending-=K,J.pending===0&&(J.pending_out=0))}function V(k,J){a._tr_flush_block(k,0<=k.block_start?k.block_start:-1,k.strstart-k.block_start,J),k.block_start=k.strstart,z(k.strm)}function de(k,J){k.pending_buf[k.pending++]=J}function ne(k,J){k.pending_buf[k.pending++]=J>>>8&255,k.pending_buf[k.pending++]=255&J}function se(k,J){var K,A,S=k.max_chain_length,N=k.strstart,O=k.prev_length,Y=k.nice_match,M=k.strstart>k.w_size-q?k.strstart-(k.w_size-q):0,H=k.window,X=k.w_mask,ee=k.prev,he=k.strstart+L,Be=H[N+O-1],ze=H[N+O];k.prev_length>=k.good_match&&(S>>=2),Y>k.lookahead&&(Y=k.lookahead);do if(H[(K=J)+O]===ze&&H[K+O-1]===Be&&H[K]===H[N]&&H[++K]===H[N+1]){N+=2,K++;do;while(H[++N]===H[++K]&&H[++N]===H[++K]&&H[++N]===H[++K]&&H[++N]===H[++K]&&H[++N]===H[++K]&&H[++N]===H[++K]&&H[++N]===H[++K]&&H[++N]===H[++K]&&NM&&--S!=0);return O<=k.lookahead?O:k.lookahead}function Pe(k){var J,K,A,S,N,O,Y,M,H,X,ee=k.w_size;do{if(S=k.window_size-k.lookahead-k.strstart,k.strstart>=ee+(ee-q)){for(o.arraySet(k.window,k.window,ee,ee,0),k.match_start-=ee,k.strstart-=ee,k.block_start-=ee,J=K=k.hash_size;A=k.head[--J],k.head[J]=ee<=A?A-ee:0,--K;);for(J=K=ee;A=k.prev[--J],k.prev[J]=ee<=A?A-ee:0,--K;);S+=ee}if(k.strm.avail_in===0)break;if(O=k.strm,Y=k.window,M=k.strstart+k.lookahead,H=S,X=void 0,X=O.avail_in,H=P)for(N=k.strstart-k.insert,k.ins_h=k.window[N],k.ins_h=(k.ins_h<=P&&(k.ins_h=(k.ins_h<=P)if(A=a._tr_tally(k,k.strstart-k.match_start,k.match_length-P),k.lookahead-=k.match_length,k.match_length<=k.max_lazy_match&&k.lookahead>=P){for(k.match_length--;k.strstart++,k.ins_h=(k.ins_h<=P&&(k.ins_h=(k.ins_h<=P&&k.match_length<=k.prev_length){for(S=k.strstart+k.lookahead-P,A=a._tr_tally(k,k.strstart-1-k.prev_match,k.prev_length-P),k.lookahead-=k.prev_length-1,k.prev_length-=2;++k.strstart<=S&&(k.ins_h=(k.ins_h<k.pending_buf_size-5&&(K=k.pending_buf_size-5);;){if(k.lookahead<=1){if(Pe(k),k.lookahead===0&&J===f)return b;if(k.lookahead===0)break}k.strstart+=k.lookahead,k.lookahead=0;var A=k.block_start+K;if((k.strstart===0||k.strstart>=A)&&(k.lookahead=k.strstart-A,k.strstart=A,V(k,!1),k.strm.avail_out===0)||k.strstart-k.block_start>=k.w_size-q&&(V(k,!1),k.strm.avail_out===0))return b}return k.insert=0,J===g?(V(k,!0),k.strm.avail_out===0?te:$):(k.strstart>k.block_start&&(V(k,!1),k.strm.avail_out),b)}),new Se(4,4,8,4,fe),new Se(4,5,16,8,fe),new Se(4,6,32,32,fe),new Se(4,4,16,16,ve),new Se(8,16,32,32,ve),new Se(8,16,128,128,ve),new Se(8,32,128,256,ve),new Se(32,128,258,1024,ve),new Se(32,258,258,4096,ve)],s.deflateInit=function(k,J){return rt(k,J,p,15,8,0)},s.deflateInit2=rt,s.deflateReset=Ce,s.deflateResetKeep=De,s.deflateSetHeader=function(k,J){return k&&k.state?k.state.wrap!==2?y:(k.state.gzhead=J,h):y},s.deflate=function(k,J){var K,A,S,N;if(!k||!k.state||5>8&255),de(A,A.gzhead.time>>16&255),de(A,A.gzhead.time>>24&255),de(A,A.level===9?2:2<=A.strategy||A.level<2?4:0),de(A,255&A.gzhead.os),A.gzhead.extra&&A.gzhead.extra.length&&(de(A,255&A.gzhead.extra.length),de(A,A.gzhead.extra.length>>8&255)),A.gzhead.hcrc&&(k.adler=u(k.adler,A.pending_buf,A.pending,0)),A.gzindex=0,A.status=69):(de(A,0),de(A,0),de(A,0),de(A,0),de(A,0),de(A,A.level===9?2:2<=A.strategy||A.level<2?4:0),de(A,3),A.status=F);else{var O=p+(A.w_bits-8<<4)<<8;O|=(2<=A.strategy||A.level<2?0:A.level<6?1:A.level===6?2:3)<<6,A.strstart!==0&&(O|=32),O+=31-O%31,A.status=F,ne(A,O),A.strstart!==0&&(ne(A,k.adler>>>16),ne(A,65535&k.adler)),k.adler=1}if(A.status===69)if(A.gzhead.extra){for(S=A.pending;A.gzindex<(65535&A.gzhead.extra.length)&&(A.pending!==A.pending_buf_size||(A.gzhead.hcrc&&A.pending>S&&(k.adler=u(k.adler,A.pending_buf,A.pending-S,S)),z(k),S=A.pending,A.pending!==A.pending_buf_size));)de(A,255&A.gzhead.extra[A.gzindex]),A.gzindex++;A.gzhead.hcrc&&A.pending>S&&(k.adler=u(k.adler,A.pending_buf,A.pending-S,S)),A.gzindex===A.gzhead.extra.length&&(A.gzindex=0,A.status=73)}else A.status=73;if(A.status===73)if(A.gzhead.name){S=A.pending;do{if(A.pending===A.pending_buf_size&&(A.gzhead.hcrc&&A.pending>S&&(k.adler=u(k.adler,A.pending_buf,A.pending-S,S)),z(k),S=A.pending,A.pending===A.pending_buf_size)){N=1;break}N=A.gzindexS&&(k.adler=u(k.adler,A.pending_buf,A.pending-S,S)),N===0&&(A.gzindex=0,A.status=91)}else A.status=91;if(A.status===91)if(A.gzhead.comment){S=A.pending;do{if(A.pending===A.pending_buf_size&&(A.gzhead.hcrc&&A.pending>S&&(k.adler=u(k.adler,A.pending_buf,A.pending-S,S)),z(k),S=A.pending,A.pending===A.pending_buf_size)){N=1;break}N=A.gzindexS&&(k.adler=u(k.adler,A.pending_buf,A.pending-S,S)),N===0&&(A.status=103)}else A.status=103;if(A.status===103&&(A.gzhead.hcrc?(A.pending+2>A.pending_buf_size&&z(k),A.pending+2<=A.pending_buf_size&&(de(A,255&k.adler),de(A,k.adler>>8&255),k.adler=0,A.status=F)):A.status=F),A.pending!==0){if(z(k),k.avail_out===0)return A.last_flush=-1,h}else if(k.avail_in===0&&I(J)<=I(K)&&J!==g)return Z(k,-5);if(A.status===666&&k.avail_in!==0)return Z(k,-5);if(k.avail_in!==0||A.lookahead!==0||J!==f&&A.status!==666){var Y=A.strategy===2?function(M,H){for(var X;;){if(M.lookahead===0&&(Pe(M),M.lookahead===0)){if(H===f)return b;break}if(M.match_length=0,X=a._tr_tally(M,0,M.window[M.strstart]),M.lookahead--,M.strstart++,X&&(V(M,!1),M.strm.avail_out===0))return b}return M.insert=0,H===g?(V(M,!0),M.strm.avail_out===0?te:$):M.last_lit&&(V(M,!1),M.strm.avail_out===0)?b:W}(A,J):A.strategy===3?function(M,H){for(var X,ee,he,Be,ze=M.window;;){if(M.lookahead<=L){if(Pe(M),M.lookahead<=L&&H===f)return b;if(M.lookahead===0)break}if(M.match_length=0,M.lookahead>=P&&0M.lookahead&&(M.match_length=M.lookahead)}if(M.match_length>=P?(X=a._tr_tally(M,1,M.match_length-P),M.lookahead-=M.match_length,M.strstart+=M.match_length,M.match_length=0):(X=a._tr_tally(M,0,M.window[M.strstart]),M.lookahead--,M.strstart++),X&&(V(M,!1),M.strm.avail_out===0))return b}return M.insert=0,H===g?(V(M,!0),M.strm.avail_out===0?te:$):M.last_lit&&(V(M,!1),M.strm.avail_out===0)?b:W}(A,J):i[A.level].func(A,J);if(Y!==te&&Y!==$||(A.status=666),Y===b||Y===te)return k.avail_out===0&&(A.last_flush=-1),h;if(Y===W&&(J===1?a._tr_align(A):J!==5&&(a._tr_stored_block(A,0,0,!1),J===3&&(Q(A.head),A.lookahead===0&&(A.strstart=0,A.block_start=0,A.insert=0))),z(k),k.avail_out===0))return A.last_flush=-1,h}return J!==g?h:A.wrap<=0?1:(A.wrap===2?(de(A,255&k.adler),de(A,k.adler>>8&255),de(A,k.adler>>16&255),de(A,k.adler>>24&255),de(A,255&k.total_in),de(A,k.total_in>>8&255),de(A,k.total_in>>16&255),de(A,k.total_in>>24&255)):(ne(A,k.adler>>>16),ne(A,65535&k.adler)),z(k),0=K.w_size&&(N===0&&(Q(K.head),K.strstart=0,K.block_start=0,K.insert=0),H=new o.Buf8(K.w_size),o.arraySet(H,J,X-K.w_size,K.w_size,0),J=H,X=K.w_size),O=k.avail_in,Y=k.next_in,M=k.input,k.avail_in=X,k.next_in=0,k.input=J,Pe(K);K.lookahead>=P;){for(A=K.strstart,S=K.lookahead-(P-1);K.ins_h=(K.ins_h<>>=P=D>>>24,_-=P,(P=D>>>16&255)===0)W[d++]=65535&D;else{if(!(16&P)){if(!(64&P)){D=C[(65535&D)+(p&(1<>>=P,_-=P),_<15&&(p+=b[l++]<<_,_+=8,p+=b[l++]<<_,_+=8),D=E[p&R];r:for(;;){if(p>>>=P=D>>>24,_-=P,!(16&(P=D>>>16&255))){if(!(64&P)){D=E[(65535&D)+(p&(1<>>=P,_-=P,(P=d-f)>3,p&=(1<<(_-=L<<3))-1,i.next_in=l,i.next_out=d,i.avail_in=l>>24&255)+(T>>>8&65280)+((65280&T)<<8)+((255&T)<<24)}function p(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new i.Buf16(320),this.work=new i.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function _(T){var F;return T&&T.state?(F=T.state,T.total_in=T.total_out=F.total=0,T.msg="",F.wrap&&(T.adler=1&F.wrap),F.mode=y,F.last=0,F.havedict=0,F.dmax=32768,F.head=null,F.hold=0,F.bits=0,F.lencode=F.lendyn=new i.Buf32(m),F.distcode=F.distdyn=new i.Buf32(w),F.sane=1,F.back=-1,g):h}function C(T){var F;return T&&T.state?((F=T.state).wsize=0,F.whave=0,F.wnext=0,_(T)):h}function E(T,F){var b,W;return T&&T.state?(W=T.state,F<0?(b=0,F=-F):(b=1+(F>>4),F<48&&(F&=15)),F&&(F<8||15=$.wsize?(i.arraySet($.window,F,b-$.wsize,$.wsize,0),$.wnext=0,$.whave=$.wsize):(W<(te=$.wsize-$.wnext)&&(te=W),i.arraySet($.window,F,b-W,te,$.wnext),(W-=te)?(i.arraySet($.window,F,b-W,W,0),$.wnext=W,$.whave=$.wsize):($.wnext+=te,$.wnext===$.wsize&&($.wnext=0),$.whave<$.wsize&&($.whave+=te))),0}s.inflateReset=C,s.inflateReset2=E,s.inflateResetKeep=_,s.inflateInit=function(T){return j(T,15)},s.inflateInit2=j,s.inflate=function(T,F){var b,W,te,$,Z,I,Q,z,V,de,ne,se,Pe,fe,ve,Se,Ie,De,Ce,rt,k,J,K,A,S=0,N=new i.Buf8(4),O=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!T||!T.state||!T.output||!T.input&&T.avail_in!==0)return h;(b=T.state).mode===12&&(b.mode=13),Z=T.next_out,te=T.output,Q=T.avail_out,$=T.next_in,W=T.input,I=T.avail_in,z=b.hold,V=b.bits,de=I,ne=Q,J=g;e:for(;;)switch(b.mode){case y:if(b.wrap===0){b.mode=13;break}for(;V<16;){if(I===0)break e;I--,z+=W[$++]<>>8&255,b.check=a(b.check,N,2,0),V=z=0,b.mode=2;break}if(b.flags=0,b.head&&(b.head.done=!1),!(1&b.wrap)||(((255&z)<<8)+(z>>8))%31){T.msg="incorrect header check",b.mode=30;break}if((15&z)!=8){T.msg="unknown compression method",b.mode=30;break}if(V-=4,k=8+(15&(z>>>=4)),b.wbits===0)b.wbits=k;else if(k>b.wbits){T.msg="invalid window size",b.mode=30;break}b.dmax=1<>8&1),512&b.flags&&(N[0]=255&z,N[1]=z>>>8&255,b.check=a(b.check,N,2,0)),V=z=0,b.mode=3;case 3:for(;V<32;){if(I===0)break e;I--,z+=W[$++]<>>8&255,N[2]=z>>>16&255,N[3]=z>>>24&255,b.check=a(b.check,N,4,0)),V=z=0,b.mode=4;case 4:for(;V<16;){if(I===0)break e;I--,z+=W[$++]<>8),512&b.flags&&(N[0]=255&z,N[1]=z>>>8&255,b.check=a(b.check,N,2,0)),V=z=0,b.mode=5;case 5:if(1024&b.flags){for(;V<16;){if(I===0)break e;I--,z+=W[$++]<>>8&255,b.check=a(b.check,N,2,0)),V=z=0}else b.head&&(b.head.extra=null);b.mode=6;case 6:if(1024&b.flags&&(I<(se=b.length)&&(se=I),se&&(b.head&&(k=b.head.extra_len-b.length,b.head.extra||(b.head.extra=new Array(b.head.extra_len)),i.arraySet(b.head.extra,W,$,se,k)),512&b.flags&&(b.check=a(b.check,W,se,$)),I-=se,$+=se,b.length-=se),b.length))break e;b.length=0,b.mode=7;case 7:if(2048&b.flags){if(I===0)break e;for(se=0;k=W[$+se++],b.head&&k&&b.length<65536&&(b.head.name+=String.fromCharCode(k)),k&&se>9&1,b.head.done=!0),T.adler=b.check=0,b.mode=12;break;case 10:for(;V<32;){if(I===0)break e;I--,z+=W[$++]<>>=7&V,V-=7&V,b.mode=27;break}for(;V<3;){if(I===0)break e;I--,z+=W[$++]<>>=1)){case 0:b.mode=14;break;case 1:if(L(b),b.mode=20,F!==6)break;z>>>=2,V-=2;break e;case 2:b.mode=17;break;case 3:T.msg="invalid block type",b.mode=30}z>>>=2,V-=2;break;case 14:for(z>>>=7&V,V-=7&V;V<32;){if(I===0)break e;I--,z+=W[$++]<>>16^65535)){T.msg="invalid stored block lengths",b.mode=30;break}if(b.length=65535&z,V=z=0,b.mode=15,F===6)break e;case 15:b.mode=16;case 16:if(se=b.length){if(I>>=5,V-=5,b.ndist=1+(31&z),z>>>=5,V-=5,b.ncode=4+(15&z),z>>>=4,V-=4,286>>=3,V-=3}for(;b.have<19;)b.lens[O[b.have++]]=0;if(b.lencode=b.lendyn,b.lenbits=7,K={bits:b.lenbits},J=u(0,b.lens,0,19,b.lencode,0,b.work,K),b.lenbits=K.bits,J){T.msg="invalid code lengths set",b.mode=30;break}b.have=0,b.mode=19;case 19:for(;b.have>>16&255,Ie=65535&S,!((ve=S>>>24)<=V);){if(I===0)break e;I--,z+=W[$++]<>>=ve,V-=ve,b.lens[b.have++]=Ie;else{if(Ie===16){for(A=ve+2;V>>=ve,V-=ve,b.have===0){T.msg="invalid bit length repeat",b.mode=30;break}k=b.lens[b.have-1],se=3+(3&z),z>>>=2,V-=2}else if(Ie===17){for(A=ve+3;V>>=ve)),z>>>=3,V-=3}else{for(A=ve+7;V>>=ve)),z>>>=7,V-=7}if(b.have+se>b.nlen+b.ndist){T.msg="invalid bit length repeat",b.mode=30;break}for(;se--;)b.lens[b.have++]=k}}if(b.mode===30)break;if(b.lens[256]===0){T.msg="invalid code -- missing end-of-block",b.mode=30;break}if(b.lenbits=9,K={bits:b.lenbits},J=u(d,b.lens,0,b.nlen,b.lencode,0,b.work,K),b.lenbits=K.bits,J){T.msg="invalid literal/lengths set",b.mode=30;break}if(b.distbits=6,b.distcode=b.distdyn,K={bits:b.distbits},J=u(f,b.lens,b.nlen,b.ndist,b.distcode,0,b.work,K),b.distbits=K.bits,J){T.msg="invalid distances set",b.mode=30;break}if(b.mode=20,F===6)break e;case 20:b.mode=21;case 21:if(6<=I&&258<=Q){T.next_out=Z,T.avail_out=Q,T.next_in=$,T.avail_in=I,b.hold=z,b.bits=V,l(T,ne),Z=T.next_out,te=T.output,Q=T.avail_out,$=T.next_in,W=T.input,I=T.avail_in,z=b.hold,V=b.bits,b.mode===12&&(b.back=-1);break}for(b.back=0;Se=(S=b.lencode[z&(1<>>16&255,Ie=65535&S,!((ve=S>>>24)<=V);){if(I===0)break e;I--,z+=W[$++]<>De)])>>>16&255,Ie=65535&S,!(De+(ve=S>>>24)<=V);){if(I===0)break e;I--,z+=W[$++]<>>=De,V-=De,b.back+=De}if(z>>>=ve,V-=ve,b.back+=ve,b.length=Ie,Se===0){b.mode=26;break}if(32&Se){b.back=-1,b.mode=12;break}if(64&Se){T.msg="invalid literal/length code",b.mode=30;break}b.extra=15&Se,b.mode=22;case 22:if(b.extra){for(A=b.extra;V>>=b.extra,V-=b.extra,b.back+=b.extra}b.was=b.length,b.mode=23;case 23:for(;Se=(S=b.distcode[z&(1<>>16&255,Ie=65535&S,!((ve=S>>>24)<=V);){if(I===0)break e;I--,z+=W[$++]<>De)])>>>16&255,Ie=65535&S,!(De+(ve=S>>>24)<=V);){if(I===0)break e;I--,z+=W[$++]<>>=De,V-=De,b.back+=De}if(z>>>=ve,V-=ve,b.back+=ve,64&Se){T.msg="invalid distance code",b.mode=30;break}b.offset=Ie,b.extra=15&Se,b.mode=24;case 24:if(b.extra){for(A=b.extra;V>>=b.extra,V-=b.extra,b.back+=b.extra}if(b.offset>b.dmax){T.msg="invalid distance too far back",b.mode=30;break}b.mode=25;case 25:if(Q===0)break e;if(se=ne-Q,b.offset>se){if((se=b.offset-se)>b.whave&&b.sane){T.msg="invalid distance too far back",b.mode=30;break}Pe=se>b.wnext?(se-=b.wnext,b.wsize-se):b.wnext-se,se>b.length&&(se=b.length),fe=b.window}else fe=te,Pe=Z-b.offset,se=b.length;for(QR?(P=Pe[fe+w[F]],V[de+w[F]]):(P=96,0),p=1<>Z)+(_-=p)]=D<<24|P<<16|L|0,_!==0;);for(p=1<>=1;if(p!==0?(z&=p-1,z+=p):z=0,F++,--ne[T]==0){if(T===W)break;T=f[g+w[F]]}if(te>>7)]}function de(S,N){S.pending_buf[S.pending++]=255&N,S.pending_buf[S.pending++]=N>>>8&255}function ne(S,N,O){S.bi_valid>v-O?(S.bi_buf|=N<>v-S.bi_valid,S.bi_valid+=O-v):(S.bi_buf|=N<>>=1,O<<=1,0<--N;);return O>>>1}function fe(S,N,O){var Y,M,H=new Array(w+1),X=0;for(Y=1;Y<=w;Y++)H[Y]=X=X+O[Y-1]<<1;for(M=0;M<=N;M++){var ee=S[2*M+1];ee!==0&&(S[2*M]=Pe(H[ee]++,ee))}}function ve(S){var N;for(N=0;N>1;1<=O;O--)De(S,H,O);for(M=he;O=S.heap[1],S.heap[1]=S.heap[S.heap_len--],De(S,H,1),Y=S.heap[1],S.heap[--S.heap_max]=O,S.heap[--S.heap_max]=Y,H[2*M]=H[2*O]+H[2*Y],S.depth[M]=(S.depth[O]>=S.depth[Y]?S.depth[O]:S.depth[Y])+1,H[2*O+1]=H[2*Y+1]=M,S.heap[1]=M++,De(S,H,1),2<=S.heap_len;);S.heap[--S.heap_max]=S.heap[1],function(ze,Et){var Wr,Bt,Gn,it,qn,Xn,$r=Et.dyn_tree,jc=Et.max_code,Tc=Et.stat_desc.static_tree,so=Et.stat_desc.has_stree,Nc=Et.stat_desc.extra_bits,io=Et.stat_desc.extra_base,jn=Et.stat_desc.max_length,Ds=0;for(it=0;it<=w;it++)ze.bl_count[it]=0;for($r[2*ze.heap[ze.heap_max]+1]=0,Wr=ze.heap_max+1;Wr>=7;M>>=1)if(1&Be&&ee.dyn_ltree[2*he]!==0)return o;if(ee.dyn_ltree[18]!==0||ee.dyn_ltree[20]!==0||ee.dyn_ltree[26]!==0)return a;for(he=32;he>>3,(H=S.static_len+3+7>>>3)<=M&&(M=H)):M=H=O+5,O+4<=M&&N!==-1?A(S,N,O,Y):S.strategy===4||H===M?(ne(S,2+(Y?1:0),3),Ce(S,q,T)):(ne(S,4+(Y?1:0),3),function(ee,he,Be,ze){var Et;for(ne(ee,he-257,5),ne(ee,Be-1,5),ne(ee,ze-4,4),Et=0;Et>>8&255,S.pending_buf[S.d_buf+2*S.last_lit+1]=255&N,S.pending_buf[S.l_buf+S.last_lit]=255&O,S.last_lit++,N===0?S.dyn_ltree[2*O]++:(S.matches++,N--,S.dyn_ltree[2*(b[O]+f+1)]++,S.dyn_dtree[2*V(N)]++),S.last_lit===S.lit_bufsize-1},s._tr_align=function(S){ne(S,2,3),se(S,_,q),function(N){N.bi_valid===16?(de(N,N.bi_buf),N.bi_buf=0,N.bi_valid=0):8<=N.bi_valid&&(N.pending_buf[N.pending++]=255&N.bi_buf,N.bi_buf>>=8,N.bi_valid-=8)}(S)}},{"../utils/common":41}],53:[function(r,n,s){n.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(r,n,s){(function(i){(function(o,a){if(!o.setImmediate){var l,u,d,f,g=1,h={},y=!1,m=o.document,w=Object.getPrototypeOf&&Object.getPrototypeOf(o);w=w&&w.setTimeout?w:o,l={}.toString.call(o.process)==="[object process]"?function(C){process.nextTick(function(){p(C)})}:function(){if(o.postMessage&&!o.importScripts){var C=!0,E=o.onmessage;return o.onmessage=function(){C=!1},o.postMessage("","*"),o.onmessage=E,C}}()?(f="setImmediate$"+Math.random()+"$",o.addEventListener?o.addEventListener("message",_,!1):o.attachEvent("onmessage",_),function(C){o.postMessage(f+C,"*")}):o.MessageChannel?((d=new MessageChannel).port1.onmessage=function(C){p(C.data)},function(C){d.port2.postMessage(C)}):m&&"onreadystatechange"in m.createElement("script")?(u=m.documentElement,function(C){var E=m.createElement("script");E.onreadystatechange=function(){p(C),E.onreadystatechange=null,u.removeChild(E),E=null},u.appendChild(E)}):function(C){setTimeout(p,0,C)},w.setImmediate=function(C){typeof C!="function"&&(C=new Function(""+C));for(var E=new Array(arguments.length-1),j=0;j"u"?i===void 0?this:i:self)}).call(this,typeof Oc<"u"?Oc:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(IC);var S5=IC.exports;const k5=vm(S5);function C5(e){return new Promise((t,r)=>{const n=new FileReader;n.onload=()=>{n.result?t(n.result.toString()):r("No content found")},n.onerror=()=>r(n.error),n.readAsText(e)})}const E5=async(e,t)=>{const r=new k5;t.forEach(i=>{r.file(i.name,i.content)});const n=await r.generateAsync({type:"blob"}),s=document.createElement("a");s.href=URL.createObjectURL(n),s.download=e,s.click()},ca=e=>{const t=new Date(e);return new Intl.DateTimeFormat("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1,timeZone:"Asia/Shanghai"}).format(t)},j5=e=>ca(e).split(" ")[0];function LC(e){const t=new Date;t.setUTCDate(t.getUTCDate()+e);const r=t.getUTCFullYear(),n=String(t.getUTCMonth()+1).padStart(2,"0"),s=String(t.getUTCDate()).padStart(2,"0"),i=String(t.getUTCHours()).padStart(2,"0"),o=String(t.getUTCMinutes()).padStart(2,"0"),a=String(t.getUTCSeconds()).padStart(2,"0");return`${r}-${n}-${s} ${i}:${o}:${a}`}const T5=async e=>{let t=1;e.page&&(t=e.page);let r=2;e.perPage&&(r=e.perPage);const n=xt();let s="";return e.state==="enabled"?s="enabled=true":e.state==="disabled"?s="enabled=false":e.state==="expired"&&(s=n.filter("expiredAt<{:expiredAt}",{expiredAt:LC(15)})),n.collection("domains").getList(t,r,{sort:"-created",expand:"lastDeployment",filter:s})},N5=async()=>{const e=xt(),t=await e.collection("domains").getList(1,1,{}),r=await e.collection("domains").getList(1,1,{filter:e.filter("expiredAt<{:expiredAt}",{expiredAt:LC(15)})}),n=await e.collection("domains").getList(1,1,{filter:"enabled=true"}),s=await e.collection("domains").getList(1,1,{filter:"enabled=false"});return{total:t.totalItems,expired:r.totalItems,enabled:n.totalItems,disabled:s.totalItems}},R5=async e=>await xt().collection("domains").getOne(e),sm=async e=>e.id?await xt().collection("domains").update(e.id,e):await xt().collection("domains").create(e),P5=async e=>await xt().collection("domains").delete(e),D5=(e,t)=>xt().collection("domains").subscribe(e,r=>{r.action==="update"&&t(r.record)},{expand:"lastDeployment"}),A5=e=>{xt().collection("domains").unsubscribe(e)},O5=()=>{const e=Tf(),t=Sn(),r=Hn(),n=new URLSearchParams(r.search),s=n.get("page"),i=n.get("state"),[o,a]=x.useState(0),l=()=>{t("/edit")},u=p=>{n.set("page",p.toString()),t(`?${n.toString()}`)},d=p=>{t(`/edit?id=${p}`)},f=p=>{t(`/history?domain=${p}`)},g=async p=>{try{await P5(p),y(h.filter(_=>_.id!==p))}catch(_){console.error("Error deleting domain:",_)}},[h,y]=x.useState([]);x.useEffect(()=>{(async()=>{const _=await T5({page:s?Number(s):1,perPage:10,state:i||""});y(_.items),a(_.totalPages)})()},[s,i]);const m=async p=>{const _=h.filter(R=>R.id===p),C=_[0].enabled,E=_[0];E.enabled=!C,await sm(E);const j=h.map(R=>R.id===p?{...R,checked:!C}:R);y(j)},w=async p=>{try{A5(p.id),D5(p.id,_=>{console.log(_);const C=h.map(E=>E.id===_.id?{..._}:E);y(C)}),p.rightnow=!0,await sm(p),e.toast({title:"操作成功",description:"已发起部署,请稍后查看部署日志。"})}catch{e.toast({title:"执行失败",description:c.jsxs(c.Fragment,{children:["执行失败,请查看",c.jsx(dr,{to:`/history?domain=${p.id}`,className:"underline text-blue-500",children:"部署日志"}),"查看详情。"]}),variant:"destructive"})}},v=async p=>{const _=`${p.id}-${p.domain}.zip`,C=[{name:`${p.domain}.pem`,content:p.certificate?p.certificate:""},{name:`${p.domain}.key`,content:p.privateKey?p.privateKey:""}];await E5(_,C)};return c.jsx(c.Fragment,{children:c.jsxs("div",{className:"",children:[c.jsx(Pv,{}),c.jsxs("div",{className:"flex justify-between items-center",children:[c.jsx("div",{className:"text-muted-foreground",children:"域名列表"}),c.jsx(at,{onClick:l,children:"新增域名"})]}),h.length?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"hidden sm:flex sm:flex-row text-muted-foreground text-sm border-b dark:border-stone-500 sm:p-2 mt-5",children:[c.jsx("div",{className:"w-40",children:"域名"}),c.jsx("div",{className:"w-48",children:"有效期限"}),c.jsx("div",{className:"w-32",children:"最近执行状态"}),c.jsx("div",{className:"w-64",children:"最近执行阶段"}),c.jsx("div",{className:"w-40 sm:ml-2",children:"最近执行时间"}),c.jsx("div",{className:"w-32",children:"是否启用"}),c.jsx("div",{className:"grow",children:"操作"})]}),c.jsx("div",{className:"sm:hidden flex text-sm text-muted-foreground",children:"域名"}),h.map(p=>{var _,C,E,j,R,D;return c.jsxs("div",{className:"flex flex-col sm:flex-row text-secondary-foreground border-b dark:border-stone-500 sm:p-2 hover:bg-muted/50 text-sm",children:[c.jsx("div",{className:"sm:w-40 w-full pt-1 sm:pt-0 flex items-center",children:p.domain}),c.jsx("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center",children:c.jsx("div",{children:p.expiredAt?c.jsxs(c.Fragment,{children:[c.jsx("div",{children:"有效期90天"}),c.jsxs("div",{children:[j5(p.expiredAt),"到期"]})]}):"---"})}),c.jsx("div",{className:"sm:w-32 w-full pt-1 sm:pt-0 flex items-center",children:p.lastDeployedAt&&((_=p.expand)!=null&&_.lastDeployment)?c.jsx(c.Fragment,{children:((C=p.expand.lastDeployment)==null?void 0:C.phase)==="deploy"&&((E=p.expand.lastDeployment)!=null&&E.phaseSuccess)?c.jsx(vg,{size:16,className:"text-green-700"}):c.jsx(yg,{size:16,className:"text-red-700"})}):"---"}),c.jsx("div",{className:"sm:w-64 w-full pt-1 sm:pt-0 flex items-center",children:p.lastDeployedAt&&((j=p.expand)!=null&&j.lastDeployment)?c.jsx(Ev,{phase:(R=p.expand.lastDeployment)==null?void 0:R.phase,phaseSuccess:(D=p.expand.lastDeployment)==null?void 0:D.phaseSuccess}):"---"}),c.jsx("div",{className:"sm:w-40 pt-1 sm:pt-0 sm:ml-2 flex items-center",children:p.lastDeployedAt?ca(p.lastDeployedAt):"---"}),c.jsx("div",{className:"sm:w-32 flex items-center",children:c.jsx(RC,{children:c.jsxs(w5,{children:[c.jsx(_5,{children:c.jsx(sC,{checked:p.enabled,onCheckedChange:()=>{m(p.id)}})}),c.jsx(Av,{children:c.jsx("div",{className:"border rounded-sm px-3 bg-background text-muted-foreground text-xs",children:p.enabled?"禁用":"启用"})})]})})}),c.jsxs("div",{className:"flex items-center grow justify-start pt-1 sm:pt-0",children:[c.jsx(at,{variant:"link",className:"p-0",onClick:()=>f(p.id),children:"部署历史"}),c.jsxs(y0,{when:!!p.enabled,children:[c.jsx(Yt,{orientation:"vertical",className:"h-4 mx-2"}),c.jsx(at,{variant:"link",className:"p-0",onClick:()=>w(p),children:"立即部署"})]}),c.jsxs(y0,{when:!!p.expiredAt,children:[c.jsx(Yt,{orientation:"vertical",className:"h-4 mx-2"}),c.jsx(at,{variant:"link",className:"p-0",onClick:()=>v(p),children:"下载"})]}),!p.enabled&&c.jsxs(c.Fragment,{children:[c.jsx(Yt,{orientation:"vertical",className:"h-4 mx-2"}),c.jsxs(_3,{children:[c.jsx(b3,{asChild:!0,children:c.jsx(at,{variant:"link",className:"p-0",children:"删除"})}),c.jsxs(Hk,{children:[c.jsxs(Yk,{children:[c.jsx(Kk,{children:"删除域名"}),c.jsx(Gk,{children:"确定要删除域名吗?"})]}),c.jsxs(Zk,{children:[c.jsx(Xk,{children:"取消"}),c.jsx(qk,{onClick:()=>{g(p.id)},children:"确认"})]})]})]}),c.jsx(Yt,{orientation:"vertical",className:"h-4 mx-2"}),c.jsx(at,{variant:"link",className:"p-0",onClick:()=>d(p.id),children:"编辑"})]})]})]},p.id)}),c.jsx(kk,{totalPages:o,currentPage:s?Number(s):1,onPageChange:p=>{u(p)}})]}):c.jsx(c.Fragment,{children:c.jsxs("div",{className:"flex flex-col items-center mt-10",children:[c.jsx("span",{className:"bg-orange-100 p-5 rounded-full",children:c.jsx(Ip,{size:40,className:"text-primary"})}),c.jsx("div",{className:"text-center text-sm text-muted-foreground mt-3",children:"请添加域名开始部署证书吧。"}),c.jsx(at,{onClick:l,className:"mt-3",children:"添加域名"})]})})]})})},Fe=x.forwardRef(({className:e,type:t,...r},n)=>c.jsx("input",{type:t,className:pe("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...r}));Fe.displayName="Input";var kc=e=>e.type==="checkbox",Ao=e=>e instanceof Date,hr=e=>e==null;const FC=e=>typeof e=="object";var qt=e=>!hr(e)&&!Array.isArray(e)&&FC(e)&&!Ao(e),zC=e=>qt(e)&&e.target?kc(e.target)?e.target.checked:e.target.value:e,M5=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,UC=(e,t)=>e.has(M5(t)),I5=e=>{const t=e.constructor&&e.constructor.prototype;return qt(t)&&t.hasOwnProperty("isPrototypeOf")},Ov=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function wr(e){let t;const r=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(Ov&&(e instanceof Blob||e instanceof FileList))&&(r||qt(e)))if(t=r?[]:{},!r&&!I5(e))t=e;else for(const n in e)e.hasOwnProperty(n)&&(t[n]=wr(e[n]));else return e;return t}var Af=e=>Array.isArray(e)?e.filter(Boolean):[],Ft=e=>e===void 0,le=(e,t,r)=>{if(!t||!qt(e))return r;const n=Af(t.split(/[,[\].]+?/)).reduce((s,i)=>hr(s)?s:s[i],e);return Ft(n)||n===e?Ft(e[t])?r:e[t]:n},On=e=>typeof e=="boolean",Mv=e=>/^\w*$/.test(e),VC=e=>Af(e.replace(/["|']|\]/g,"").split(/\.|\[/)),dt=(e,t,r)=>{let n=-1;const s=Mv(t)?[t]:VC(t),i=s.length,o=i-1;for(;++net.useContext(WC),L5=e=>{const{children:t,...r}=e;return et.createElement(WC.Provider,{value:r},t)};var $C=(e,t,r,n=!0)=>{const s={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(s,i,{get:()=>{const o=i;return t._proxyFormState[o]!==dn.all&&(t._proxyFormState[o]=!n||dn.all),r&&(r[o]=!0),e[o]}});return s},Nr=e=>qt(e)&&!Object.keys(e).length,BC=(e,t,r,n)=>{r(e);const{name:s,...i}=e;return Nr(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(o=>t[o]===(!n||dn.all))},pl=e=>Array.isArray(e)?e:[e],HC=(e,t,r)=>!e||!t||e===t||pl(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n)));function Iv(e){const t=et.useRef(e);t.current=e,et.useEffect(()=>{const r=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{r&&r.unsubscribe()}},[e.disabled])}function F5(e){const t=Of(),{control:r=t.control,disabled:n,name:s,exact:i}=e||{},[o,a]=et.useState(r._formState),l=et.useRef(!0),u=et.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),d=et.useRef(s);return d.current=s,Iv({disabled:n,next:f=>l.current&&HC(d.current,f.name,i)&&BC(f,u.current,r._updateFormState)&&a({...r._formState,...f}),subject:r._subjects.state}),et.useEffect(()=>(l.current=!0,u.current.isValid&&r._updateValid(!0),()=>{l.current=!1}),[r]),$C(o,r,u.current,!1)}var In=e=>typeof e=="string",YC=(e,t,r,n,s)=>In(e)?(n&&t.watch.add(e),le(r,e,s)):Array.isArray(e)?e.map(i=>(n&&t.watch.add(i),le(r,i))):(n&&(t.watchAll=!0),r);function z5(e){const t=Of(),{control:r=t.control,name:n,defaultValue:s,disabled:i,exact:o}=e||{},a=et.useRef(n);a.current=n,Iv({disabled:i,subject:r._subjects.values,next:d=>{HC(a.current,d.name,o)&&u(wr(YC(a.current,r._names,d.values||r._formValues,!1,s)))}});const[l,u]=et.useState(r._getWatch(n,s));return et.useEffect(()=>r._removeUnmounted()),l}function U5(e){const t=Of(),{name:r,disabled:n,control:s=t.control,shouldUnregister:i}=e,o=UC(s._names.array,r),a=z5({control:s,name:r,defaultValue:le(s._formValues,r,le(s._defaultValues,r,e.defaultValue)),exact:!0}),l=F5({control:s,name:r}),u=et.useRef(s.register(r,{...e.rules,value:a,...On(e.disabled)?{disabled:e.disabled}:{}}));return et.useEffect(()=>{const d=s._options.shouldUnregister||i,f=(g,h)=>{const y=le(s._fields,g);y&&y._f&&(y._f.mount=h)};if(f(r,!0),d){const g=wr(le(s._options.defaultValues,r));dt(s._defaultValues,r,g),Ft(le(s._formValues,r))&&dt(s._formValues,r,g)}return()=>{(o?d&&!s._state.action:d)?s.unregister(r):f(r,!1)}},[r,s,o,i]),et.useEffect(()=>{le(s._fields,r)&&s._updateDisabledField({disabled:n,fields:s._fields,name:r,value:le(s._fields,r)._f.value})},[n,r,s]),{field:{name:r,value:a,...On(n)||l.disabled?{disabled:l.disabled||n}:{},onChange:et.useCallback(d=>u.current.onChange({target:{value:zC(d),name:r},type:xd.CHANGE}),[r]),onBlur:et.useCallback(()=>u.current.onBlur({target:{value:le(s._formValues,r),name:r},type:xd.BLUR}),[r,s]),ref:d=>{const f=le(s._fields,r);f&&d&&(f._f.ref={focus:()=>d.focus(),select:()=>d.select(),setCustomValidity:g=>d.setCustomValidity(g),reportValidity:()=>d.reportValidity()})}},formState:l,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!le(l.errors,r)},isDirty:{enumerable:!0,get:()=>!!le(l.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!le(l.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!le(l.validatingFields,r)},error:{enumerable:!0,get:()=>le(l.errors,r)}})}}const V5=e=>e.render(U5(e));var ZC=(e,t,r,n,s)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:s||!0}}:{},_0=e=>({isOnSubmit:!e||e===dn.onSubmit,isOnBlur:e===dn.onBlur,isOnChange:e===dn.onChange,isOnAll:e===dn.all,isOnTouch:e===dn.onTouched}),b0=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const ml=(e,t,r,n)=>{for(const s of r||Object.keys(e)){const i=le(e,s);if(i){const{_f:o,...a}=i;if(o){if(o.refs&&o.refs[0]&&t(o.refs[0],s)&&!n)break;if(o.ref&&t(o.ref,o.name)&&!n)break;ml(a,t)}else qt(a)&&ml(a,t)}}};var W5=(e,t,r)=>{const n=pl(le(e,r));return dt(n,"root",t[r]),dt(e,r,n),e},Lv=e=>e.type==="file",Ks=e=>typeof e=="function",wd=e=>{if(!Ov)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Au=e=>In(e),Fv=e=>e.type==="radio",_d=e=>e instanceof RegExp;const S0={value:!1,isValid:!1},k0={value:!0,isValid:!0};var KC=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Ft(e[0].attributes.value)?Ft(e[0].value)||e[0].value===""?k0:{value:e[0].value,isValid:!0}:k0:S0}return S0};const C0={isValid:!1,value:null};var GC=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,C0):C0;function E0(e,t,r="validate"){if(Au(e)||Array.isArray(e)&&e.every(Au)||On(e)&&!e)return{type:r,message:Au(e)?e:"",ref:t}}var go=e=>qt(e)&&!_d(e)?e:{value:e,message:""},j0=async(e,t,r,n,s)=>{const{ref:i,refs:o,required:a,maxLength:l,minLength:u,min:d,max:f,pattern:g,validate:h,name:y,valueAsNumber:m,mount:w,disabled:v}=e._f,p=le(t,y);if(!w||v)return{};const _=o?o[0]:i,C=T=>{n&&_.reportValidity&&(_.setCustomValidity(On(T)?"":T||""),_.reportValidity())},E={},j=Fv(i),R=kc(i),D=j||R,P=(m||Lv(i))&&Ft(i.value)&&Ft(p)||wd(i)&&i.value===""||p===""||Array.isArray(p)&&!p.length,L=ZC.bind(null,y,r,E),q=(T,F,b,W=ts.maxLength,te=ts.minLength)=>{const $=T?F:b;E[y]={type:T?W:te,message:$,ref:i,...L(T?W:te,$)}};if(s?!Array.isArray(p)||!p.length:a&&(!D&&(P||hr(p))||On(p)&&!p||R&&!KC(o).isValid||j&&!GC(o).isValid)){const{value:T,message:F}=Au(a)?{value:!!a,message:a}:go(a);if(T&&(E[y]={type:ts.required,message:F,ref:_,...L(ts.required,F)},!r))return C(F),E}if(!P&&(!hr(d)||!hr(f))){let T,F;const b=go(f),W=go(d);if(!hr(p)&&!isNaN(p)){const te=i.valueAsNumber||p&&+p;hr(b.value)||(T=te>b.value),hr(W.value)||(F=tenew Date(new Date().toDateString()+" "+Q),Z=i.type=="time",I=i.type=="week";In(b.value)&&p&&(T=Z?$(p)>$(b.value):I?p>b.value:te>new Date(b.value)),In(W.value)&&p&&(F=Z?$(p)<$(W.value):I?p+T.value,W=!hr(F.value)&&p.length<+F.value;if((b||W)&&(q(b,T.message,F.message),!r))return C(E[y].message),E}if(g&&!P&&In(p)){const{value:T,message:F}=go(g);if(_d(T)&&!p.match(T)&&(E[y]={type:ts.pattern,message:F,ref:i,...L(ts.pattern,F)},!r))return C(F),E}if(h){if(Ks(h)){const T=await h(p,t),F=E0(T,_);if(F&&(E[y]={...F,...L(ts.validate,F.message)},!r))return C(F.message),E}else if(qt(h)){let T={};for(const F in h){if(!Nr(T)&&!r)break;const b=E0(await h[F](p,t),_,F);b&&(T={...b,...L(F,b.message)},C(b.message),r&&(E[y]=T))}if(!Nr(T)&&(E[y]={ref:_,...T},!r))return E}}return C(!0),E};function $5(e,t){const r=t.slice(0,-1).length;let n=0;for(;n{let e=[];return{get observers(){return e},next:s=>{for(const i of e)i.next&&i.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(i=>i!==s)}}),unsubscribe:()=>{e=[]}}},bd=e=>hr(e)||!FC(e);function Oi(e,t){if(bd(e)||bd(t))return e===t;if(Ao(e)&&Ao(t))return e.getTime()===t.getTime();const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(const s of r){const i=e[s];if(!n.includes(s))return!1;if(s!=="ref"){const o=t[s];if(Ao(i)&&Ao(o)||qt(i)&&qt(o)||Array.isArray(i)&&Array.isArray(o)?!Oi(i,o):i!==o)return!1}}return!0}var qC=e=>e.type==="select-multiple",H5=e=>Fv(e)||kc(e),Lh=e=>wd(e)&&e.isConnected,XC=e=>{for(const t in e)if(Ks(e[t]))return!0;return!1};function Sd(e,t={}){const r=Array.isArray(e);if(qt(e)||r)for(const n in e)Array.isArray(e[n])||qt(e[n])&&!XC(e[n])?(t[n]=Array.isArray(e[n])?[]:{},Sd(e[n],t[n])):hr(e[n])||(t[n]=!0);return t}function QC(e,t,r){const n=Array.isArray(e);if(qt(e)||n)for(const s in e)Array.isArray(e[s])||qt(e[s])&&!XC(e[s])?Ft(t)||bd(r[s])?r[s]=Array.isArray(e[s])?Sd(e[s],[]):{...Sd(e[s])}:QC(e[s],hr(t)?{}:t[s],r[s]):r[s]=!Oi(e[s],t[s]);return r}var du=(e,t)=>QC(e,t,Sd(t)),JC=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Ft(e)?e:t?e===""?NaN:e&&+e:r&&In(e)?new Date(e):n?n(e):e;function Fh(e){const t=e.ref;if(!(e.refs?e.refs.every(r=>r.disabled):t.disabled))return Lv(t)?t.files:Fv(t)?GC(e.refs).value:qC(t)?[...t.selectedOptions].map(({value:r})=>r):kc(t)?KC(e.refs).value:JC(Ft(t.value)?e.ref.value:t.value,e)}var Y5=(e,t,r,n)=>{const s={};for(const i of e){const o=le(t,i);o&&dt(s,i,o._f)}return{criteriaMode:r,names:[...e],fields:s,shouldUseNativeValidation:n}},Ba=e=>Ft(e)?e:_d(e)?e.source:qt(e)?_d(e.value)?e.value.source:e.value:e,Z5=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function T0(e,t,r){const n=le(e,r);if(n||Mv(r))return{error:n,name:r};const s=r.split(".");for(;s.length;){const i=s.join("."),o=le(t,i),a=le(e,i);if(o&&!Array.isArray(o)&&r!==i)return{name:r};if(a&&a.type)return{name:i,error:a};s.pop()}return{name:r}}var K5=(e,t,r,n,s)=>s.isOnAll?!1:!r&&s.isOnTouch?!(t||e):(r?n.isOnBlur:s.isOnBlur)?!e:(r?n.isOnChange:s.isOnChange)?e:!0,G5=(e,t)=>!Af(le(e,t)).length&&Ht(e,t);const q5={mode:dn.onSubmit,reValidateMode:dn.onChange,shouldFocusError:!0};function X5(e={}){let t={...q5,...e},r={submitCount:0,isDirty:!1,isLoading:Ks(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},n={},s=qt(t.defaultValues)||qt(t.values)?wr(t.defaultValues||t.values)||{}:{},i=t.shouldUnregister?{}:wr(s),o={action:!1,mount:!1,watch:!1},a={mount:new Set,unMount:new Set,array:new Set,watch:new Set},l,u=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},f={values:Ih(),array:Ih(),state:Ih()},g=_0(t.mode),h=_0(t.reValidateMode),y=t.criteriaMode===dn.all,m=S=>N=>{clearTimeout(u),u=setTimeout(S,N)},w=async S=>{if(d.isValid||S){const N=t.resolver?Nr((await D()).errors):await L(n,!0);N!==r.isValid&&f.state.next({isValid:N})}},v=(S,N)=>{(d.isValidating||d.validatingFields)&&((S||Array.from(a.mount)).forEach(O=>{O&&(N?dt(r.validatingFields,O,N):Ht(r.validatingFields,O))}),f.state.next({validatingFields:r.validatingFields,isValidating:!Nr(r.validatingFields)}))},p=(S,N=[],O,Y,M=!0,H=!0)=>{if(Y&&O){if(o.action=!0,H&&Array.isArray(le(n,S))){const X=O(le(n,S),Y.argA,Y.argB);M&&dt(n,S,X)}if(H&&Array.isArray(le(r.errors,S))){const X=O(le(r.errors,S),Y.argA,Y.argB);M&&dt(r.errors,S,X),G5(r.errors,S)}if(d.touchedFields&&H&&Array.isArray(le(r.touchedFields,S))){const X=O(le(r.touchedFields,S),Y.argA,Y.argB);M&&dt(r.touchedFields,S,X)}d.dirtyFields&&(r.dirtyFields=du(s,i)),f.state.next({name:S,isDirty:T(S,N),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else dt(i,S,N)},_=(S,N)=>{dt(r.errors,S,N),f.state.next({errors:r.errors})},C=S=>{r.errors=S,f.state.next({errors:r.errors,isValid:!1})},E=(S,N,O,Y)=>{const M=le(n,S);if(M){const H=le(i,S,Ft(O)?le(s,S):O);Ft(H)||Y&&Y.defaultChecked||N?dt(i,S,N?H:Fh(M._f)):W(S,H),o.mount&&w()}},j=(S,N,O,Y,M)=>{let H=!1,X=!1;const ee={name:S},he=!!(le(n,S)&&le(n,S)._f&&le(n,S)._f.disabled);if(!O||Y){d.isDirty&&(X=r.isDirty,r.isDirty=ee.isDirty=T(),H=X!==ee.isDirty);const Be=he||Oi(le(s,S),N);X=!!(!he&&le(r.dirtyFields,S)),Be||he?Ht(r.dirtyFields,S):dt(r.dirtyFields,S,!0),ee.dirtyFields=r.dirtyFields,H=H||d.dirtyFields&&X!==!Be}if(O){const Be=le(r.touchedFields,S);Be||(dt(r.touchedFields,S,O),ee.touchedFields=r.touchedFields,H=H||d.touchedFields&&Be!==O)}return H&&M&&f.state.next(ee),H?ee:{}},R=(S,N,O,Y)=>{const M=le(r.errors,S),H=d.isValid&&On(N)&&r.isValid!==N;if(e.delayError&&O?(l=m(()=>_(S,O)),l(e.delayError)):(clearTimeout(u),l=null,O?dt(r.errors,S,O):Ht(r.errors,S)),(O?!Oi(M,O):M)||!Nr(Y)||H){const X={...Y,...H&&On(N)?{isValid:N}:{},errors:r.errors,name:S};r={...r,...X},f.state.next(X)}},D=async S=>{v(S,!0);const N=await t.resolver(i,t.context,Y5(S||a.mount,n,t.criteriaMode,t.shouldUseNativeValidation));return v(S),N},P=async S=>{const{errors:N}=await D(S);if(S)for(const O of S){const Y=le(N,O);Y?dt(r.errors,O,Y):Ht(r.errors,O)}else r.errors=N;return N},L=async(S,N,O={valid:!0})=>{for(const Y in S){const M=S[Y];if(M){const{_f:H,...X}=M;if(H){const ee=a.array.has(H.name);v([Y],!0);const he=await j0(M,i,y,t.shouldUseNativeValidation&&!N,ee);if(v([Y]),he[H.name]&&(O.valid=!1,N))break;!N&&(le(he,H.name)?ee?W5(r.errors,he,H.name):dt(r.errors,H.name,he[H.name]):Ht(r.errors,H.name))}X&&await L(X,N,O)}}return O.valid},q=()=>{for(const S of a.unMount){const N=le(n,S);N&&(N._f.refs?N._f.refs.every(O=>!Lh(O)):!Lh(N._f.ref))&&Pe(S)}a.unMount=new Set},T=(S,N)=>(S&&N&&dt(i,S,N),!Oi(z(),s)),F=(S,N,O)=>YC(S,a,{...o.mount?i:Ft(N)?s:In(S)?{[S]:N}:N},O,N),b=S=>Af(le(o.mount?i:s,S,e.shouldUnregister?le(s,S,[]):[])),W=(S,N,O={})=>{const Y=le(n,S);let M=N;if(Y){const H=Y._f;H&&(!H.disabled&&dt(i,S,JC(N,H)),M=wd(H.ref)&&hr(N)?"":N,qC(H.ref)?[...H.ref.options].forEach(X=>X.selected=M.includes(X.value)):H.refs?kc(H.ref)?H.refs.length>1?H.refs.forEach(X=>(!X.defaultChecked||!X.disabled)&&(X.checked=Array.isArray(M)?!!M.find(ee=>ee===X.value):M===X.value)):H.refs[0]&&(H.refs[0].checked=!!M):H.refs.forEach(X=>X.checked=X.value===M):Lv(H.ref)?H.ref.value="":(H.ref.value=M,H.ref.type||f.values.next({name:S,values:{...i}})))}(O.shouldDirty||O.shouldTouch)&&j(S,M,O.shouldTouch,O.shouldDirty,!0),O.shouldValidate&&Q(S)},te=(S,N,O)=>{for(const Y in N){const M=N[Y],H=`${S}.${Y}`,X=le(n,H);(a.array.has(S)||!bd(M)||X&&!X._f)&&!Ao(M)?te(H,M,O):W(H,M,O)}},$=(S,N,O={})=>{const Y=le(n,S),M=a.array.has(S),H=wr(N);dt(i,S,H),M?(f.array.next({name:S,values:{...i}}),(d.isDirty||d.dirtyFields)&&O.shouldDirty&&f.state.next({name:S,dirtyFields:du(s,i),isDirty:T(S,H)})):Y&&!Y._f&&!hr(H)?te(S,H,O):W(S,H,O),b0(S,a)&&f.state.next({...r}),f.values.next({name:o.mount?S:void 0,values:{...i}})},Z=async S=>{o.mount=!0;const N=S.target;let O=N.name,Y=!0;const M=le(n,O),H=()=>N.type?Fh(M._f):zC(S),X=ee=>{Y=Number.isNaN(ee)||ee===le(i,O,ee)};if(M){let ee,he;const Be=H(),ze=S.type===xd.BLUR||S.type===xd.FOCUS_OUT,Et=!Z5(M._f)&&!t.resolver&&!le(r.errors,O)&&!M._f.deps||K5(ze,le(r.touchedFields,O),r.isSubmitted,h,g),Wr=b0(O,a,ze);dt(i,O,Be),ze?(M._f.onBlur&&M._f.onBlur(S),l&&l(0)):M._f.onChange&&M._f.onChange(S);const Bt=j(O,Be,ze,!1),Gn=!Nr(Bt)||Wr;if(!ze&&f.values.next({name:O,type:S.type,values:{...i}}),Et)return d.isValid&&w(),Gn&&f.state.next({name:O,...Wr?{}:Bt});if(!ze&&Wr&&f.state.next({...r}),t.resolver){const{errors:it}=await D([O]);if(X(Be),Y){const qn=T0(r.errors,n,O),Xn=T0(it,n,qn.name||O);ee=Xn.error,O=Xn.name,he=Nr(it)}}else v([O],!0),ee=(await j0(M,i,y,t.shouldUseNativeValidation))[O],v([O]),X(Be),Y&&(ee?he=!1:d.isValid&&(he=await L(n,!0)));Y&&(M._f.deps&&Q(M._f.deps),R(O,he,ee,Bt))}},I=(S,N)=>{if(le(r.errors,N)&&S.focus)return S.focus(),1},Q=async(S,N={})=>{let O,Y;const M=pl(S);if(t.resolver){const H=await P(Ft(S)?S:M);O=Nr(H),Y=S?!M.some(X=>le(H,X)):O}else S?(Y=(await Promise.all(M.map(async H=>{const X=le(n,H);return await L(X&&X._f?{[H]:X}:X)}))).every(Boolean),!(!Y&&!r.isValid)&&w()):Y=O=await L(n);return f.state.next({...!In(S)||d.isValid&&O!==r.isValid?{}:{name:S},...t.resolver||!S?{isValid:O}:{},errors:r.errors}),N.shouldFocus&&!Y&&ml(n,I,S?M:a.mount),Y},z=S=>{const N={...o.mount?i:s};return Ft(S)?N:In(S)?le(N,S):S.map(O=>le(N,O))},V=(S,N)=>({invalid:!!le((N||r).errors,S),isDirty:!!le((N||r).dirtyFields,S),error:le((N||r).errors,S),isValidating:!!le(r.validatingFields,S),isTouched:!!le((N||r).touchedFields,S)}),de=S=>{S&&pl(S).forEach(N=>Ht(r.errors,N)),f.state.next({errors:S?r.errors:{}})},ne=(S,N,O)=>{const Y=(le(n,S,{_f:{}})._f||{}).ref,M=le(r.errors,S)||{},{ref:H,message:X,type:ee,...he}=M;dt(r.errors,S,{...he,...N,ref:Y}),f.state.next({name:S,errors:r.errors,isValid:!1}),O&&O.shouldFocus&&Y&&Y.focus&&Y.focus()},se=(S,N)=>Ks(S)?f.values.subscribe({next:O=>S(F(void 0,N),O)}):F(S,N,!0),Pe=(S,N={})=>{for(const O of S?pl(S):a.mount)a.mount.delete(O),a.array.delete(O),N.keepValue||(Ht(n,O),Ht(i,O)),!N.keepError&&Ht(r.errors,O),!N.keepDirty&&Ht(r.dirtyFields,O),!N.keepTouched&&Ht(r.touchedFields,O),!N.keepIsValidating&&Ht(r.validatingFields,O),!t.shouldUnregister&&!N.keepDefaultValue&&Ht(s,O);f.values.next({values:{...i}}),f.state.next({...r,...N.keepDirty?{isDirty:T()}:{}}),!N.keepIsValid&&w()},fe=({disabled:S,name:N,field:O,fields:Y,value:M})=>{if(On(S)&&o.mount||S){const H=S?void 0:Ft(M)?Fh(O?O._f:le(Y,N)._f):M;dt(i,N,H),j(N,H,!1,!1,!0)}},ve=(S,N={})=>{let O=le(n,S);const Y=On(N.disabled);return dt(n,S,{...O||{},_f:{...O&&O._f?O._f:{ref:{name:S}},name:S,mount:!0,...N}}),a.mount.add(S),O?fe({field:O,disabled:N.disabled,name:S,value:N.value}):E(S,!0,N.value),{...Y?{disabled:N.disabled}:{},...t.progressive?{required:!!N.required,min:Ba(N.min),max:Ba(N.max),minLength:Ba(N.minLength),maxLength:Ba(N.maxLength),pattern:Ba(N.pattern)}:{},name:S,onChange:Z,onBlur:Z,ref:M=>{if(M){ve(S,N),O=le(n,S);const H=Ft(M.value)&&M.querySelectorAll&&M.querySelectorAll("input,select,textarea")[0]||M,X=H5(H),ee=O._f.refs||[];if(X?ee.find(he=>he===H):H===O._f.ref)return;dt(n,S,{_f:{...O._f,...X?{refs:[...ee.filter(Lh),H,...Array.isArray(le(s,S))?[{}]:[]],ref:{type:H.type,name:S}}:{ref:H}}}),E(S,!1,void 0,H)}else O=le(n,S,{}),O._f&&(O._f.mount=!1),(t.shouldUnregister||N.shouldUnregister)&&!(UC(a.array,S)&&o.action)&&a.unMount.add(S)}}},Se=()=>t.shouldFocusError&&ml(n,I,a.mount),Ie=S=>{On(S)&&(f.state.next({disabled:S}),ml(n,(N,O)=>{const Y=le(n,O);Y&&(N.disabled=Y._f.disabled||S,Array.isArray(Y._f.refs)&&Y._f.refs.forEach(M=>{M.disabled=Y._f.disabled||S}))},0,!1))},De=(S,N)=>async O=>{let Y;O&&(O.preventDefault&&O.preventDefault(),O.persist&&O.persist());let M=wr(i);if(f.state.next({isSubmitting:!0}),t.resolver){const{errors:H,values:X}=await D();r.errors=H,M=X}else await L(n);if(Ht(r.errors,"root"),Nr(r.errors)){f.state.next({errors:{}});try{await S(M,O)}catch(H){Y=H}}else N&&await N({...r.errors},O),Se(),setTimeout(Se);if(f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Nr(r.errors)&&!Y,submitCount:r.submitCount+1,errors:r.errors}),Y)throw Y},Ce=(S,N={})=>{le(n,S)&&(Ft(N.defaultValue)?$(S,wr(le(s,S))):($(S,N.defaultValue),dt(s,S,wr(N.defaultValue))),N.keepTouched||Ht(r.touchedFields,S),N.keepDirty||(Ht(r.dirtyFields,S),r.isDirty=N.defaultValue?T(S,wr(le(s,S))):T()),N.keepError||(Ht(r.errors,S),d.isValid&&w()),f.state.next({...r}))},rt=(S,N={})=>{const O=S?wr(S):s,Y=wr(O),M=Nr(S),H=M?s:Y;if(N.keepDefaultValues||(s=O),!N.keepValues){if(N.keepDirtyValues)for(const X of a.mount)le(r.dirtyFields,X)?dt(H,X,le(i,X)):$(X,le(H,X));else{if(Ov&&Ft(S))for(const X of a.mount){const ee=le(n,X);if(ee&&ee._f){const he=Array.isArray(ee._f.refs)?ee._f.refs[0]:ee._f.ref;if(wd(he)){const Be=he.closest("form");if(Be){Be.reset();break}}}}n={}}i=e.shouldUnregister?N.keepDefaultValues?wr(s):{}:wr(H),f.array.next({values:{...H}}),f.values.next({values:{...H}})}a={mount:N.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!d.isValid||!!N.keepIsValid||!!N.keepDirtyValues,o.watch=!!e.shouldUnregister,f.state.next({submitCount:N.keepSubmitCount?r.submitCount:0,isDirty:M?!1:N.keepDirty?r.isDirty:!!(N.keepDefaultValues&&!Oi(S,s)),isSubmitted:N.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:M?{}:N.keepDirtyValues?N.keepDefaultValues&&i?du(s,i):r.dirtyFields:N.keepDefaultValues&&S?du(s,S):N.keepDirty?r.dirtyFields:{},touchedFields:N.keepTouched?r.touchedFields:{},errors:N.keepErrors?r.errors:{},isSubmitSuccessful:N.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},k=(S,N)=>rt(Ks(S)?S(i):S,N);return{control:{register:ve,unregister:Pe,getFieldState:V,handleSubmit:De,setError:ne,_executeSchema:D,_getWatch:F,_getDirty:T,_updateValid:w,_removeUnmounted:q,_updateFieldArray:p,_updateDisabledField:fe,_getFieldArray:b,_reset:rt,_resetDefaultValues:()=>Ks(t.defaultValues)&&t.defaultValues().then(S=>{k(S,t.resetOptions),f.state.next({isLoading:!1})}),_updateFormState:S=>{r={...r,...S}},_disableForm:Ie,_subjects:f,_proxyFormState:d,_setErrors:C,get _fields(){return n},get _formValues(){return i},get _state(){return o},set _state(S){o=S},get _defaultValues(){return s},get _names(){return a},set _names(S){a=S},get _formState(){return r},set _formState(S){r=S},get _options(){return t},set _options(S){t={...t,...S}}},trigger:Q,register:ve,handleSubmit:De,watch:se,setValue:$,getValues:z,reset:k,resetField:Ce,clearErrors:de,unregister:Pe,setError:ne,setFocus:(S,N={})=>{const O=le(n,S),Y=O&&O._f;if(Y){const M=Y.refs?Y.refs[0]:Y.ref;M.focus&&(M.focus(),N.shouldSelect&&M.select())}},getFieldState:V}}function tn(e={}){const t=et.useRef(),r=et.useRef(),[n,s]=et.useState({isDirty:!1,isValidating:!1,isLoading:Ks(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:Ks(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...X5(e),formState:n});const i=t.current.control;return i._options=e,Iv({subject:i._subjects.state,next:o=>{BC(o,i._proxyFormState,i._updateFormState,!0)&&s({...i._formState})}}),et.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),et.useEffect(()=>{if(i._proxyFormState.isDirty){const o=i._getDirty();o!==n.isDirty&&i._subjects.state.next({isDirty:o})}},[i,n.isDirty]),et.useEffect(()=>{e.values&&!Oi(e.values,r.current)?(i._reset(e.values,i._options.resetOptions),r.current=e.values,s(o=>({...o}))):i._resetDefaultValues()},[e.values,i]),et.useEffect(()=>{e.errors&&i._setErrors(e.errors)},[e.errors,i]),et.useEffect(()=>{i._state.mount||(i._updateValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),et.useEffect(()=>{e.shouldUnregister&&i._subjects.values.next({values:i._getWatch()})},[e.shouldUnregister,i]),t.current.formState=$C(n,i),t.current}const N0=(e,t,r)=>{if(e&&"reportValidity"in e){const n=le(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},eE=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?N0(n.ref,r,e):n.refs&&n.refs.forEach(s=>N0(s,r,e))}},Q5=(e,t)=>{t.shouldUseNativeValidation&&eE(e,t);const r={};for(const n in e){const s=le(t.fields,n),i=Object.assign(e[n]||{},{ref:s&&s.ref});if(J5(t.names||Object.keys(e),n)){const o=Object.assign({},le(r,n));dt(o,"root",i),dt(r,n,o)}else dt(r,n,i)}return r},J5=(e,t)=>e.some(r=>r.startsWith(t+"."));var e6=function(e,t){for(var r={};e.length;){var n=e[0],s=n.code,i=n.message,o=n.path.join(".");if(!r[o])if("unionErrors"in n){var a=n.unionErrors[0].errors[0];r[o]={message:a.message,type:a.code}}else r[o]={message:i,type:s};if("unionErrors"in n&&n.unionErrors.forEach(function(d){return d.errors.forEach(function(f){return e.push(f)})}),t){var l=r[o].types,u=l&&l[n.code];r[o]=ZC(o,t,r,s,u?[].concat(u,n.message):n.message)}e.shift()}return r},rn=function(e,t,r){return r===void 0&&(r={}),function(n,s,i){try{return Promise.resolve(function(o,a){try{var l=Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](n,t)).then(function(u){return i.shouldUseNativeValidation&&eE({},i),{errors:{},values:r.raw?n:u}})}catch(u){return a(u)}return l&&l.then?l.then(void 0,a):l}(0,function(o){if(function(a){return Array.isArray(a==null?void 0:a.errors)}(o))return{values:{},errors:Q5(e6(o.errors,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw o}))}catch(o){return Promise.reject(o)}}},nt;(function(e){e.assertEqual=s=>s;function t(s){}e.assertIs=t;function r(s){throw new Error}e.assertNever=r,e.arrayToEnum=s=>{const i={};for(const o of s)i[o]=o;return i},e.getValidEnumValues=s=>{const i=e.objectKeys(s).filter(a=>typeof s[s[a]]!="number"),o={};for(const a of i)o[a]=s[a];return e.objectValues(o)},e.objectValues=s=>e.objectKeys(s).map(function(i){return s[i]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const i=[];for(const o in s)Object.prototype.hasOwnProperty.call(s,o)&&i.push(o);return i},e.find=(s,i)=>{for(const o of s)if(i(o))return o},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function n(s,i=" | "){return s.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}e.joinValues=n,e.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})(nt||(nt={}));var im;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(im||(im={}));const xe=nt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),$s=e=>{switch(typeof e){case"undefined":return xe.undefined;case"string":return xe.string;case"number":return isNaN(e)?xe.nan:xe.number;case"boolean":return xe.boolean;case"function":return xe.function;case"bigint":return xe.bigint;case"symbol":return xe.symbol;case"object":return Array.isArray(e)?xe.array:e===null?xe.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?xe.promise:typeof Map<"u"&&e instanceof Map?xe.map:typeof Set<"u"&&e instanceof Set?xe.set:typeof Date<"u"&&e instanceof Date?xe.date:xe.object;default:return xe.unknown}},oe=nt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),t6=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Lr extends Error{constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const r=t||function(i){return i.message},n={_errors:[]},s=i=>{for(const o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(s);else if(o.code==="invalid_return_type")s(o.returnTypeError);else if(o.code==="invalid_arguments")s(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let a=n,l=0;for(;lr.message){const r={},n=[];for(const s of this.issues)s.path.length>0?(r[s.path[0]]=r[s.path[0]]||[],r[s.path[0]].push(t(s))):n.push(t(s));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}Lr.create=e=>new Lr(e);const ua=(e,t)=>{let r;switch(e.code){case oe.invalid_type:e.received===xe.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case oe.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,nt.jsonStringifyReplacer)}`;break;case oe.unrecognized_keys:r=`Unrecognized key(s) in object: ${nt.joinValues(e.keys,", ")}`;break;case oe.invalid_union:r="Invalid input";break;case oe.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${nt.joinValues(e.options)}`;break;case oe.invalid_enum_value:r=`Invalid enum value. Expected ${nt.joinValues(e.options)}, received '${e.received}'`;break;case oe.invalid_arguments:r="Invalid function arguments";break;case oe.invalid_return_type:r="Invalid function return type";break;case oe.invalid_date:r="Invalid date";break;case oe.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:nt.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case oe.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case oe.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case oe.custom:r="Invalid input";break;case oe.invalid_intersection_types:r="Intersection results could not be merged";break;case oe.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case oe.not_finite:r="Number must be finite";break;default:r=t.defaultError,nt.assertNever(e)}return{message:r}};let tE=ua;function r6(e){tE=e}function kd(){return tE}const Cd=e=>{const{data:t,path:r,errorMaps:n,issueData:s}=e,i=[...r,...s.path||[]],o={...s,path:i};if(s.message!==void 0)return{...s,path:i,message:s.message};let a="";const l=n.filter(u=>!!u).slice().reverse();for(const u of l)a=u(o,{data:t,defaultError:a}).message;return{...s,path:i,message:a}},n6=[];function me(e,t){const r=kd(),n=Cd({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===ua?void 0:ua].filter(s=>!!s)});e.common.issues.push(n)}class cr{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){const n=[];for(const s of r){if(s.status==="aborted")return $e;s.status==="dirty"&&t.dirty(),n.push(s.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){const n=[];for(const s of r){const i=await s.key,o=await s.value;n.push({key:i,value:o})}return cr.mergeObjectSync(t,n)}static mergeObjectSync(t,r){const n={};for(const s of r){const{key:i,value:o}=s;if(i.status==="aborted"||o.status==="aborted")return $e;i.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||s.alwaysSet)&&(n[i.value]=o.value)}return{status:t.value,value:n}}}const $e=Object.freeze({status:"aborted"}),Oo=e=>({status:"dirty",value:e}),mr=e=>({status:"valid",value:e}),om=e=>e.status==="aborted",am=e=>e.status==="dirty",Hl=e=>e.status==="valid",Yl=e=>typeof Promise<"u"&&e instanceof Promise;function Ed(e,t,r,n){if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function rE(e,t,r,n,s){if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,r),r}var je;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(je||(je={}));var Xa,Qa;class $n{constructor(t,r,n,s){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const R0=(e,t)=>{if(Hl(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new Lr(e.common.issues);return this._error=r,this._error}}};function He(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:s}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:(o,a)=>{var l,u;const{message:d}=e;return o.code==="invalid_enum_value"?{message:d??a.defaultError}:typeof a.data>"u"?{message:(l=d??n)!==null&&l!==void 0?l:a.defaultError}:o.code!=="invalid_type"?{message:a.defaultError}:{message:(u=d??r)!==null&&u!==void 0?u:a.defaultError}},description:s}}class qe{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return $s(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:$s(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new cr,ctx:{common:t.parent.common,data:t.data,parsedType:$s(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(Yl(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){const r=this._parse(t);return Promise.resolve(r)}parse(t,r){const n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){var n;const s={common:{issues:[],async:(n=r==null?void 0:r.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:$s(t)},i=this._parseSync({data:t,path:s.path,parent:s});return R0(s,i)}async parseAsync(t,r){const n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){const n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:$s(t)},s=this._parse({data:t,path:n.path,parent:n}),i=await(Yl(s)?s:Promise.resolve(s));return R0(n,i)}refine(t,r){const n=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,i)=>{const o=t(s),a=()=>i.addIssue({code:oe.custom,...n(s)});return typeof Promise<"u"&&o instanceof Promise?o.then(l=>l?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(t,r){return this._refinement((n,s)=>t(n)?!0:(s.addIssue(typeof r=="function"?r(n,s):r),!1))}_refinement(t){return new bn({schema:this,typeName:Ue.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Un.create(this,this._def)}nullable(){return hi.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return gn.create(this,this._def)}promise(){return fa.create(this,this._def)}or(t){return ql.create([this,t],this._def)}and(t){return Xl.create(this,t,this._def)}transform(t){return new bn({...He(this._def),schema:this,typeName:Ue.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r=typeof t=="function"?t:()=>t;return new rc({...He(this._def),innerType:this,defaultValue:r,typeName:Ue.ZodDefault})}brand(){return new zv({typeName:Ue.ZodBranded,type:this,...He(this._def)})}catch(t){const r=typeof t=="function"?t:()=>t;return new nc({...He(this._def),innerType:this,catchValue:r,typeName:Ue.ZodCatch})}describe(t){const r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Cc.create(this,t)}readonly(){return sc.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const s6=/^c[^\s-]{8,}$/i,i6=/^[0-9a-z]+$/,o6=/^[0-9A-HJKMNP-TV-Z]{26}$/,a6=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,l6=/^[a-z0-9_-]{21}$/i,c6=/^[-+]?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)?)??$/,u6=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,d6="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let zh;const f6=/^(?:(?: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])$/,h6=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,p6=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,nE="((\\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])))",m6=new RegExp(`^${nE}$`);function sE(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function g6(e){return new RegExp(`^${sE(e)}$`)}function iE(e){let t=`${nE}T${sE(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function v6(e,t){return!!((t==="v4"||!t)&&f6.test(e)||(t==="v6"||!t)&&h6.test(e))}class hn extends qe{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==xe.string){const i=this._getOrReturnCtx(t);return me(i,{code:oe.invalid_type,expected:xe.string,received:i.parsedType}),$e}const n=new cr;let s;for(const i of this._def.checks)if(i.kind==="min")t.data.lengthi.value&&(s=this._getOrReturnCtx(t,s),me(s,{code:oe.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){const o=t.data.length>i.value,a=t.data.lengtht.test(s),{validation:r,code:oe.invalid_string,...je.errToObj(n)})}_addCheck(t){return new hn({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...je.errToObj(t)})}url(t){return this._addCheck({kind:"url",...je.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...je.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...je.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...je.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...je.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...je.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...je.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...je.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...je.errToObj(t)})}datetime(t){var r,n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(r=t==null?void 0:t.offset)!==null&&r!==void 0?r:!1,local:(n=t==null?void 0:t.local)!==null&&n!==void 0?n:!1,...je.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...je.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...je.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...je.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...je.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...je.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...je.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...je.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...je.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...je.errToObj(r)})}nonempty(t){return this.min(1,je.errToObj(t))}trim(){return new hn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new hn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new hn({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value{var t;return new hn({checks:[],typeName:Ue.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...He(e)})};function y6(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,s=r>n?r:n,i=parseInt(e.toFixed(s).replace(".","")),o=parseInt(t.toFixed(s).replace(".",""));return i%o/Math.pow(10,s)}class ui extends qe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==xe.number){const i=this._getOrReturnCtx(t);return me(i,{code:oe.invalid_type,expected:xe.number,received:i.parsedType}),$e}let n;const s=new cr;for(const i of this._def.checks)i.kind==="int"?nt.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),me(n,{code:oe.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):i.kind==="min"?(i.inclusive?t.datai.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),me(n,{code:oe.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?y6(t.data,i.value)!==0&&(n=this._getOrReturnCtx(t,n),me(n,{code:oe.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),me(n,{code:oe.not_finite,message:i.message}),s.dirty()):nt.assertNever(i);return{status:s.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,je.toString(r))}gt(t,r){return this.setLimit("min",t,!1,je.toString(r))}lte(t,r){return this.setLimit("max",t,!0,je.toString(r))}lt(t,r){return this.setLimit("max",t,!1,je.toString(r))}setLimit(t,r,n,s){return new ui({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:je.toString(s)}]})}_addCheck(t){return new ui({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:je.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:je.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:je.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:je.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:je.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:je.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:je.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:je.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:je.toString(t)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuet.kind==="int"||t.kind==="multipleOf"&&nt.isInteger(t.value))}get isFinite(){let t=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.valuenew ui({checks:[],typeName:Ue.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...He(e)});class di extends qe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==xe.bigint){const i=this._getOrReturnCtx(t);return me(i,{code:oe.invalid_type,expected:xe.bigint,received:i.parsedType}),$e}let n;const s=new cr;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?t.datai.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),me(n,{code:oe.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),me(n,{code:oe.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):nt.assertNever(i);return{status:s.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,je.toString(r))}gt(t,r){return this.setLimit("min",t,!1,je.toString(r))}lte(t,r){return this.setLimit("max",t,!0,je.toString(r))}lt(t,r){return this.setLimit("max",t,!1,je.toString(r))}setLimit(t,r,n,s){return new di({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:je.toString(s)}]})}_addCheck(t){return new di({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:je.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:je.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:je.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:je.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:je.toString(r)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value{var t;return new di({checks:[],typeName:Ue.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...He(e)})};class Zl extends qe{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==xe.boolean){const n=this._getOrReturnCtx(t);return me(n,{code:oe.invalid_type,expected:xe.boolean,received:n.parsedType}),$e}return mr(t.data)}}Zl.create=e=>new Zl({typeName:Ue.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...He(e)});class Gi extends qe{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==xe.date){const i=this._getOrReturnCtx(t);return me(i,{code:oe.invalid_type,expected:xe.date,received:i.parsedType}),$e}if(isNaN(t.data.getTime())){const i=this._getOrReturnCtx(t);return me(i,{code:oe.invalid_date}),$e}const n=new cr;let s;for(const i of this._def.checks)i.kind==="min"?t.data.getTime()i.value&&(s=this._getOrReturnCtx(t,s),me(s,{code:oe.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):nt.assertNever(i);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Gi({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:je.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:je.toString(r)})}get minDate(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuenew Gi({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Ue.ZodDate,...He(e)});class jd extends qe{_parse(t){if(this._getType(t)!==xe.symbol){const n=this._getOrReturnCtx(t);return me(n,{code:oe.invalid_type,expected:xe.symbol,received:n.parsedType}),$e}return mr(t.data)}}jd.create=e=>new jd({typeName:Ue.ZodSymbol,...He(e)});class Kl extends qe{_parse(t){if(this._getType(t)!==xe.undefined){const n=this._getOrReturnCtx(t);return me(n,{code:oe.invalid_type,expected:xe.undefined,received:n.parsedType}),$e}return mr(t.data)}}Kl.create=e=>new Kl({typeName:Ue.ZodUndefined,...He(e)});class Gl extends qe{_parse(t){if(this._getType(t)!==xe.null){const n=this._getOrReturnCtx(t);return me(n,{code:oe.invalid_type,expected:xe.null,received:n.parsedType}),$e}return mr(t.data)}}Gl.create=e=>new Gl({typeName:Ue.ZodNull,...He(e)});class da extends qe{constructor(){super(...arguments),this._any=!0}_parse(t){return mr(t.data)}}da.create=e=>new da({typeName:Ue.ZodAny,...He(e)});class Fi extends qe{constructor(){super(...arguments),this._unknown=!0}_parse(t){return mr(t.data)}}Fi.create=e=>new Fi({typeName:Ue.ZodUnknown,...He(e)});class Ss extends qe{_parse(t){const r=this._getOrReturnCtx(t);return me(r,{code:oe.invalid_type,expected:xe.never,received:r.parsedType}),$e}}Ss.create=e=>new Ss({typeName:Ue.ZodNever,...He(e)});class Td extends qe{_parse(t){if(this._getType(t)!==xe.undefined){const n=this._getOrReturnCtx(t);return me(n,{code:oe.invalid_type,expected:xe.void,received:n.parsedType}),$e}return mr(t.data)}}Td.create=e=>new Td({typeName:Ue.ZodVoid,...He(e)});class gn extends qe{_parse(t){const{ctx:r,status:n}=this._processInputParams(t),s=this._def;if(r.parsedType!==xe.array)return me(r,{code:oe.invalid_type,expected:xe.array,received:r.parsedType}),$e;if(s.exactLength!==null){const o=r.data.length>s.exactLength.value,a=r.data.lengths.maxLength.value&&(me(r,{code:oe.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,a)=>s.type._parseAsync(new $n(r,o,r.path,a)))).then(o=>cr.mergeArray(n,o));const i=[...r.data].map((o,a)=>s.type._parseSync(new $n(r,o,r.path,a)));return cr.mergeArray(n,i)}get element(){return this._def.type}min(t,r){return new gn({...this._def,minLength:{value:t,message:je.toString(r)}})}max(t,r){return new gn({...this._def,maxLength:{value:t,message:je.toString(r)}})}length(t,r){return new gn({...this._def,exactLength:{value:t,message:je.toString(r)}})}nonempty(t){return this.min(1,t)}}gn.create=(e,t)=>new gn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ue.ZodArray,...He(t)});function yo(e){if(e instanceof Rt){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=Un.create(yo(n))}return new Rt({...e._def,shape:()=>t})}else return e instanceof gn?new gn({...e._def,type:yo(e.element)}):e instanceof Un?Un.create(yo(e.unwrap())):e instanceof hi?hi.create(yo(e.unwrap())):e instanceof Bn?Bn.create(e.items.map(t=>yo(t))):e}class Rt extends qe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),r=nt.objectKeys(t);return this._cached={shape:t,keys:r}}_parse(t){if(this._getType(t)!==xe.object){const u=this._getOrReturnCtx(t);return me(u,{code:oe.invalid_type,expected:xe.object,received:u.parsedType}),$e}const{status:n,ctx:s}=this._processInputParams(t),{shape:i,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof Ss&&this._def.unknownKeys==="strip"))for(const u in s.data)o.includes(u)||a.push(u);const l=[];for(const u of o){const d=i[u],f=s.data[u];l.push({key:{status:"valid",value:u},value:d._parse(new $n(s,f,s.path,u)),alwaysSet:u in s.data})}if(this._def.catchall instanceof Ss){const u=this._def.unknownKeys;if(u==="passthrough")for(const d of a)l.push({key:{status:"valid",value:d},value:{status:"valid",value:s.data[d]}});else if(u==="strict")a.length>0&&(me(s,{code:oe.unrecognized_keys,keys:a}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const d of a){const f=s.data[d];l.push({key:{status:"valid",value:d},value:u._parse(new $n(s,f,s.path,d)),alwaysSet:d in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const u=[];for(const d of l){const f=await d.key,g=await d.value;u.push({key:f,value:g,alwaysSet:d.alwaysSet})}return u}).then(u=>cr.mergeObjectSync(n,u)):cr.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(t){return je.errToObj,new Rt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var s,i,o,a;const l=(o=(i=(s=this._def).errorMap)===null||i===void 0?void 0:i.call(s,r,n).message)!==null&&o!==void 0?o:n.defaultError;return r.code==="unrecognized_keys"?{message:(a=je.errToObj(t).message)!==null&&a!==void 0?a:l}:{message:l}}}:{}})}strip(){return new Rt({...this._def,unknownKeys:"strip"})}passthrough(){return new Rt({...this._def,unknownKeys:"passthrough"})}extend(t){return new Rt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Rt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Ue.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new Rt({...this._def,catchall:t})}pick(t){const r={};return nt.objectKeys(t).forEach(n=>{t[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new Rt({...this._def,shape:()=>r})}omit(t){const r={};return nt.objectKeys(this.shape).forEach(n=>{t[n]||(r[n]=this.shape[n])}),new Rt({...this._def,shape:()=>r})}deepPartial(){return yo(this)}partial(t){const r={};return nt.objectKeys(this.shape).forEach(n=>{const s=this.shape[n];t&&!t[n]?r[n]=s:r[n]=s.optional()}),new Rt({...this._def,shape:()=>r})}required(t){const r={};return nt.objectKeys(this.shape).forEach(n=>{if(t&&!t[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof Un;)i=i._def.innerType;r[n]=i}}),new Rt({...this._def,shape:()=>r})}keyof(){return oE(nt.objectKeys(this.shape))}}Rt.create=(e,t)=>new Rt({shape:()=>e,unknownKeys:"strip",catchall:Ss.create(),typeName:Ue.ZodObject,...He(t)});Rt.strictCreate=(e,t)=>new Rt({shape:()=>e,unknownKeys:"strict",catchall:Ss.create(),typeName:Ue.ZodObject,...He(t)});Rt.lazycreate=(e,t)=>new Rt({shape:e,unknownKeys:"strip",catchall:Ss.create(),typeName:Ue.ZodObject,...He(t)});class ql extends qe{_parse(t){const{ctx:r}=this._processInputParams(t),n=this._def.options;function s(i){for(const a of i)if(a.result.status==="valid")return a.result;for(const a of i)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;const o=i.map(a=>new Lr(a.ctx.common.issues));return me(r,{code:oe.invalid_union,unionErrors:o}),$e}if(r.common.async)return Promise.all(n.map(async i=>{const o={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(s);{let i;const o=[];for(const l of n){const u={...r,common:{...r.common,issues:[]},parent:null},d=l._parseSync({data:r.data,path:r.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!i&&(i={result:d,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;const a=o.map(l=>new Lr(l));return me(r,{code:oe.invalid_union,unionErrors:a}),$e}}get options(){return this._def.options}}ql.create=(e,t)=>new ql({options:e,typeName:Ue.ZodUnion,...He(t)});const rs=e=>e instanceof Jl?rs(e.schema):e instanceof bn?rs(e.innerType()):e instanceof ec?[e.value]:e instanceof fi?e.options:e instanceof tc?nt.objectValues(e.enum):e instanceof rc?rs(e._def.innerType):e instanceof Kl?[void 0]:e instanceof Gl?[null]:e instanceof Un?[void 0,...rs(e.unwrap())]:e instanceof hi?[null,...rs(e.unwrap())]:e instanceof zv||e instanceof sc?rs(e.unwrap()):e instanceof nc?rs(e._def.innerType):[];class Mf extends qe{_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==xe.object)return me(r,{code:oe.invalid_type,expected:xe.object,received:r.parsedType}),$e;const n=this.discriminator,s=r.data[n],i=this.optionsMap.get(s);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(me(r,{code:oe.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),$e)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){const s=new Map;for(const i of r){const o=rs(i.shape[t]);if(!o.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of o){if(s.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);s.set(a,i)}}return new Mf({typeName:Ue.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:s,...He(n)})}}function lm(e,t){const r=$s(e),n=$s(t);if(e===t)return{valid:!0,data:e};if(r===xe.object&&n===xe.object){const s=nt.objectKeys(t),i=nt.objectKeys(e).filter(a=>s.indexOf(a)!==-1),o={...e,...t};for(const a of i){const l=lm(e[a],t[a]);if(!l.valid)return{valid:!1};o[a]=l.data}return{valid:!0,data:o}}else if(r===xe.array&&n===xe.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let i=0;i{if(om(i)||om(o))return $e;const a=lm(i.value,o.value);return a.valid?((am(i)||am(o))&&r.dirty(),{status:r.value,value:a.data}):(me(n,{code:oe.invalid_intersection_types}),$e)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,o])=>s(i,o)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Xl.create=(e,t,r)=>new Xl({left:e,right:t,typeName:Ue.ZodIntersection,...He(r)});class Bn extends qe{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==xe.array)return me(n,{code:oe.invalid_type,expected:xe.array,received:n.parsedType}),$e;if(n.data.lengththis._def.items.length&&(me(n,{code:oe.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const i=[...n.data].map((o,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new $n(n,o,n.path,a)):null}).filter(o=>!!o);return n.common.async?Promise.all(i).then(o=>cr.mergeArray(r,o)):cr.mergeArray(r,i)}get items(){return this._def.items}rest(t){return new Bn({...this._def,rest:t})}}Bn.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Bn({items:e,typeName:Ue.ZodTuple,rest:null,...He(t)})};class Ql extends qe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==xe.object)return me(n,{code:oe.invalid_type,expected:xe.object,received:n.parsedType}),$e;const s=[],i=this._def.keyType,o=this._def.valueType;for(const a in n.data)s.push({key:i._parse(new $n(n,a,n.path,a)),value:o._parse(new $n(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?cr.mergeObjectAsync(r,s):cr.mergeObjectSync(r,s)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof qe?new Ql({keyType:t,valueType:r,typeName:Ue.ZodRecord,...He(n)}):new Ql({keyType:hn.create(),valueType:t,typeName:Ue.ZodRecord,...He(r)})}}class Nd extends qe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==xe.map)return me(n,{code:oe.invalid_type,expected:xe.map,received:n.parsedType}),$e;const s=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map(([a,l],u)=>({key:s._parse(new $n(n,a,n.path,[u,"key"])),value:i._parse(new $n(n,l,n.path,[u,"value"]))}));if(n.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of o){const u=await l.key,d=await l.value;if(u.status==="aborted"||d.status==="aborted")return $e;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),a.set(u.value,d.value)}return{status:r.value,value:a}})}else{const a=new Map;for(const l of o){const u=l.key,d=l.value;if(u.status==="aborted"||d.status==="aborted")return $e;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),a.set(u.value,d.value)}return{status:r.value,value:a}}}}Nd.create=(e,t,r)=>new Nd({valueType:t,keyType:e,typeName:Ue.ZodMap,...He(r)});class qi extends qe{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==xe.set)return me(n,{code:oe.invalid_type,expected:xe.set,received:n.parsedType}),$e;const s=this._def;s.minSize!==null&&n.data.sizes.maxSize.value&&(me(n,{code:oe.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());const i=this._def.valueType;function o(l){const u=new Set;for(const d of l){if(d.status==="aborted")return $e;d.status==="dirty"&&r.dirty(),u.add(d.value)}return{status:r.value,value:u}}const a=[...n.data.values()].map((l,u)=>i._parse(new $n(n,l,n.path,u)));return n.common.async?Promise.all(a).then(l=>o(l)):o(a)}min(t,r){return new qi({...this._def,minSize:{value:t,message:je.toString(r)}})}max(t,r){return new qi({...this._def,maxSize:{value:t,message:je.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}}qi.create=(e,t)=>new qi({valueType:e,minSize:null,maxSize:null,typeName:Ue.ZodSet,...He(t)});class Jo extends qe{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==xe.function)return me(r,{code:oe.invalid_type,expected:xe.function,received:r.parsedType}),$e;function n(a,l){return Cd({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,kd(),ua].filter(u=>!!u),issueData:{code:oe.invalid_arguments,argumentsError:l}})}function s(a,l){return Cd({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,kd(),ua].filter(u=>!!u),issueData:{code:oe.invalid_return_type,returnTypeError:l}})}const i={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof fa){const a=this;return mr(async function(...l){const u=new Lr([]),d=await a._def.args.parseAsync(l,i).catch(h=>{throw u.addIssue(n(l,h)),u}),f=await Reflect.apply(o,this,d);return await a._def.returns._def.type.parseAsync(f,i).catch(h=>{throw u.addIssue(s(f,h)),u})})}else{const a=this;return mr(function(...l){const u=a._def.args.safeParse(l,i);if(!u.success)throw new Lr([n(l,u.error)]);const d=Reflect.apply(o,this,u.data),f=a._def.returns.safeParse(d,i);if(!f.success)throw new Lr([s(d,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Jo({...this._def,args:Bn.create(t).rest(Fi.create())})}returns(t){return new Jo({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new Jo({args:t||Bn.create([]).rest(Fi.create()),returns:r||Fi.create(),typeName:Ue.ZodFunction,...He(n)})}}class Jl extends qe{get schema(){return this._def.getter()}_parse(t){const{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}Jl.create=(e,t)=>new Jl({getter:e,typeName:Ue.ZodLazy,...He(t)});class ec extends qe{_parse(t){if(t.data!==this._def.value){const r=this._getOrReturnCtx(t);return me(r,{received:r.data,code:oe.invalid_literal,expected:this._def.value}),$e}return{status:"valid",value:t.data}}get value(){return this._def.value}}ec.create=(e,t)=>new ec({value:e,typeName:Ue.ZodLiteral,...He(t)});function oE(e,t){return new fi({values:e,typeName:Ue.ZodEnum,...He(t)})}class fi extends qe{constructor(){super(...arguments),Xa.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),n=this._def.values;return me(r,{expected:nt.joinValues(n),received:r.parsedType,code:oe.invalid_type}),$e}if(Ed(this,Xa)||rE(this,Xa,new Set(this._def.values)),!Ed(this,Xa).has(t.data)){const r=this._getOrReturnCtx(t),n=this._def.values;return me(r,{received:r.data,code:oe.invalid_enum_value,options:n}),$e}return mr(t.data)}get options(){return this._def.values}get enum(){const t={};for(const r of this._def.values)t[r]=r;return t}get Values(){const t={};for(const r of this._def.values)t[r]=r;return t}get Enum(){const t={};for(const r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return fi.create(t,{...this._def,...r})}exclude(t,r=this._def){return fi.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}}Xa=new WeakMap;fi.create=oE;class tc extends qe{constructor(){super(...arguments),Qa.set(this,void 0)}_parse(t){const r=nt.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==xe.string&&n.parsedType!==xe.number){const s=nt.objectValues(r);return me(n,{expected:nt.joinValues(s),received:n.parsedType,code:oe.invalid_type}),$e}if(Ed(this,Qa)||rE(this,Qa,new Set(nt.getValidEnumValues(this._def.values))),!Ed(this,Qa).has(t.data)){const s=nt.objectValues(r);return me(n,{received:n.data,code:oe.invalid_enum_value,options:s}),$e}return mr(t.data)}get enum(){return this._def.values}}Qa=new WeakMap;tc.create=(e,t)=>new tc({values:e,typeName:Ue.ZodNativeEnum,...He(t)});class fa extends qe{unwrap(){return this._def.type}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==xe.promise&&r.common.async===!1)return me(r,{code:oe.invalid_type,expected:xe.promise,received:r.parsedType}),$e;const n=r.parsedType===xe.promise?r.data:Promise.resolve(r.data);return mr(n.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}}fa.create=(e,t)=>new fa({type:e,typeName:Ue.ZodPromise,...He(t)});class bn extends qe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ue.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:r,ctx:n}=this._processInputParams(t),s=this._def.effect||null,i={addIssue:o=>{me(n,o),o.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),s.type==="preprocess"){const o=s.transform(n.data,i);if(n.common.async)return Promise.resolve(o).then(async a=>{if(r.value==="aborted")return $e;const l=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return l.status==="aborted"?$e:l.status==="dirty"||r.value==="dirty"?Oo(l.value):l});{if(r.value==="aborted")return $e;const a=this._def.schema._parseSync({data:o,path:n.path,parent:n});return a.status==="aborted"?$e:a.status==="dirty"||r.value==="dirty"?Oo(a.value):a}}if(s.type==="refinement"){const o=a=>{const l=s.refinement(a,i);if(n.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){const a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?$e:(a.status==="dirty"&&r.dirty(),o(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?$e:(a.status==="dirty"&&r.dirty(),o(a.value).then(()=>({status:r.value,value:a.value}))))}if(s.type==="transform")if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Hl(o))return o;const a=s.transform(o.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>Hl(o)?Promise.resolve(s.transform(o.value,i)).then(a=>({status:r.value,value:a})):o);nt.assertNever(s)}}bn.create=(e,t,r)=>new bn({schema:e,typeName:Ue.ZodEffects,effect:t,...He(r)});bn.createWithPreprocess=(e,t,r)=>new bn({schema:t,effect:{type:"preprocess",transform:e},typeName:Ue.ZodEffects,...He(r)});class Un extends qe{_parse(t){return this._getType(t)===xe.undefined?mr(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Un.create=(e,t)=>new Un({innerType:e,typeName:Ue.ZodOptional,...He(t)});class hi extends qe{_parse(t){return this._getType(t)===xe.null?mr(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}hi.create=(e,t)=>new hi({innerType:e,typeName:Ue.ZodNullable,...He(t)});class rc extends qe{_parse(t){const{ctx:r}=this._processInputParams(t);let n=r.data;return r.parsedType===xe.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}rc.create=(e,t)=>new rc({innerType:e,typeName:Ue.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...He(t)});class nc extends qe{_parse(t){const{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Yl(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Lr(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Lr(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}nc.create=(e,t)=>new nc({innerType:e,typeName:Ue.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...He(t)});class Rd extends qe{_parse(t){if(this._getType(t)!==xe.nan){const n=this._getOrReturnCtx(t);return me(n,{code:oe.invalid_type,expected:xe.nan,received:n.parsedType}),$e}return{status:"valid",value:t.data}}}Rd.create=e=>new Rd({typeName:Ue.ZodNaN,...He(e)});const x6=Symbol("zod_brand");class zv extends qe{_parse(t){const{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class Cc extends qe{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?$e:i.status==="dirty"?(r.dirty(),Oo(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{const s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?$e:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(t,r){return new Cc({in:t,out:r,typeName:Ue.ZodPipeline})}}class sc extends qe{_parse(t){const r=this._def.innerType._parse(t),n=s=>(Hl(s)&&(s.value=Object.freeze(s.value)),s);return Yl(r)?r.then(s=>n(s)):n(r)}unwrap(){return this._def.innerType}}sc.create=(e,t)=>new sc({innerType:e,typeName:Ue.ZodReadonly,...He(t)});function aE(e,t={},r){return e?da.create().superRefine((n,s)=>{var i,o;if(!e(n)){const a=typeof t=="function"?t(n):typeof t=="string"?{message:t}:t,l=(o=(i=a.fatal)!==null&&i!==void 0?i:r)!==null&&o!==void 0?o:!0,u=typeof a=="string"?{message:a}:a;s.addIssue({code:"custom",...u,fatal:l})}}):da.create()}const w6={object:Rt.lazycreate};var Ue;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Ue||(Ue={}));const _6=(e,t={message:`Input not instance of ${e.name}`})=>aE(r=>r instanceof e,t),lE=hn.create,cE=ui.create,b6=Rd.create,S6=di.create,uE=Zl.create,k6=Gi.create,C6=jd.create,E6=Kl.create,j6=Gl.create,T6=da.create,N6=Fi.create,R6=Ss.create,P6=Td.create,D6=gn.create,A6=Rt.create,O6=Rt.strictCreate,M6=ql.create,I6=Mf.create,L6=Xl.create,F6=Bn.create,z6=Ql.create,U6=Nd.create,V6=qi.create,W6=Jo.create,$6=Jl.create,B6=ec.create,H6=fi.create,Y6=tc.create,Z6=fa.create,P0=bn.create,K6=Un.create,G6=hi.create,q6=bn.createWithPreprocess,X6=Cc.create,Q6=()=>lE().optional(),J6=()=>cE().optional(),ez=()=>uE().optional(),tz={string:e=>hn.create({...e,coerce:!0}),number:e=>ui.create({...e,coerce:!0}),boolean:e=>Zl.create({...e,coerce:!0}),bigint:e=>di.create({...e,coerce:!0}),date:e=>Gi.create({...e,coerce:!0})},rz=$e;var we=Object.freeze({__proto__:null,defaultErrorMap:ua,setErrorMap:r6,getErrorMap:kd,makeIssue:Cd,EMPTY_PATH:n6,addIssueToContext:me,ParseStatus:cr,INVALID:$e,DIRTY:Oo,OK:mr,isAborted:om,isDirty:am,isValid:Hl,isAsync:Yl,get util(){return nt},get objectUtil(){return im},ZodParsedType:xe,getParsedType:$s,ZodType:qe,datetimeRegex:iE,ZodString:hn,ZodNumber:ui,ZodBigInt:di,ZodBoolean:Zl,ZodDate:Gi,ZodSymbol:jd,ZodUndefined:Kl,ZodNull:Gl,ZodAny:da,ZodUnknown:Fi,ZodNever:Ss,ZodVoid:Td,ZodArray:gn,ZodObject:Rt,ZodUnion:ql,ZodDiscriminatedUnion:Mf,ZodIntersection:Xl,ZodTuple:Bn,ZodRecord:Ql,ZodMap:Nd,ZodSet:qi,ZodFunction:Jo,ZodLazy:Jl,ZodLiteral:ec,ZodEnum:fi,ZodNativeEnum:tc,ZodPromise:fa,ZodEffects:bn,ZodTransformer:bn,ZodOptional:Un,ZodNullable:hi,ZodDefault:rc,ZodCatch:nc,ZodNaN:Rd,BRAND:x6,ZodBranded:zv,ZodPipeline:Cc,ZodReadonly:sc,custom:aE,Schema:qe,ZodSchema:qe,late:w6,get ZodFirstPartyTypeKind(){return Ue},coerce:tz,any:T6,array:D6,bigint:S6,boolean:uE,date:k6,discriminatedUnion:I6,effect:P0,enum:H6,function:W6,instanceof:_6,intersection:L6,lazy:$6,literal:B6,map:U6,nan:b6,nativeEnum:Y6,never:R6,null:j6,nullable:G6,number:cE,object:A6,oboolean:ez,onumber:J6,optional:K6,ostring:Q6,pipeline:X6,preprocess:q6,promise:Z6,record:z6,set:V6,strictObject:O6,string:lE,symbol:C6,transformer:P0,tuple:F6,undefined:E6,union:M6,unknown:N6,void:P6,NEVER:rz,ZodIssueCode:oe,quotelessJson:t6,ZodError:Lr}),nz="Label",dE=x.forwardRef((e,t)=>c.jsx(Ve.label,{...e,ref:t,onMouseDown:r=>{var s;r.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));dE.displayName=nz;var fE=dE;const sz=uc("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Uv=x.forwardRef(({className:e,...t},r)=>c.jsx(fE,{ref:r,className:pe(sz(),e),...t}));Uv.displayName=fE.displayName;const nn=L5,hE=x.createContext({}),Ae=({...e})=>c.jsx(hE.Provider,{value:{name:e.name},children:c.jsx(V5,{...e})}),If=()=>{const e=x.useContext(hE),t=x.useContext(pE),{getFieldState:r,formState:n}=Of(),s=r(e.name,n);if(!e)throw new Error("useFormField should be used within ");const{id:i}=t;return{id:i,name:e.name,formItemId:`${i}-form-item`,formDescriptionId:`${i}-form-item-description`,formMessageId:`${i}-form-item-message`,...s}},pE=x.createContext({}),Te=x.forwardRef(({className:e,...t},r)=>{const n=x.useId();return c.jsx(pE.Provider,{value:{id:n},children:c.jsx("div",{ref:r,className:pe("space-y-2",e),...t})})});Te.displayName="FormItem";const Ne=x.forwardRef(({className:e,...t},r)=>{const{error:n,formItemId:s}=If();return c.jsx(Uv,{ref:r,className:pe(n&&"text-destructive",e),htmlFor:s,...t})});Ne.displayName="FormLabel";const Re=x.forwardRef(({...e},t)=>{const{error:r,formItemId:n,formDescriptionId:s,formMessageId:i}=If();return c.jsx(xs,{ref:t,id:n,"aria-describedby":r?`${s} ${i}`:`${s}`,"aria-invalid":!!r,...e})});Re.displayName="FormControl";const iz=x.forwardRef(({className:e,...t},r)=>{const{formDescriptionId:n}=If();return c.jsx("p",{ref:r,id:n,className:pe("text-sm text-muted-foreground",e),...t})});iz.displayName="FormDescription";const ke=x.forwardRef(({className:e,children:t,...r},n)=>{const{error:s,formMessageId:i}=If(),o=s?String(s==null?void 0:s.message):t;return o?c.jsx("p",{ref:n,id:i,className:pe("text-sm font-medium text-destructive",e),...r,children:o}):null});ke.displayName="FormMessage";function cm(e,[t,r]){return Math.min(r,Math.max(t,e))}var oz=[" ","Enter","ArrowUp","ArrowDown"],az=[" ","Enter"],Ec="Select",[Lf,Ff,lz]=rf(Ec),[ja,C8]=Qr(Ec,[lz,Sa]),zf=Sa(),[cz,xi]=ja(Ec),[uz,dz]=ja(Ec),mE=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:s,onOpenChange:i,value:o,defaultValue:a,onValueChange:l,dir:u,name:d,autoComplete:f,disabled:g,required:h}=e,y=zf(t),[m,w]=x.useState(null),[v,p]=x.useState(null),[_,C]=x.useState(!1),E=nf(u),[j=!1,R]=oi({prop:n,defaultProp:s,onChange:i}),[D,P]=oi({prop:o,defaultProp:a,onChange:l}),L=x.useRef(null),q=m?!!m.closest("form"):!0,[T,F]=x.useState(new Set),b=Array.from(T).map(W=>W.props.value).join(";");return c.jsx(Dg,{...y,children:c.jsxs(cz,{required:h,scope:t,trigger:m,onTriggerChange:w,valueNode:v,onValueNodeChange:p,valueNodeHasChildren:_,onValueNodeHasChildrenChange:C,contentId:zn(),value:D,onValueChange:P,open:j,onOpenChange:R,dir:E,triggerPointerDownPosRef:L,disabled:g,children:[c.jsx(Lf.Provider,{scope:t,children:c.jsx(uz,{scope:e.__scopeSelect,onNativeOptionAdd:x.useCallback(W=>{F(te=>new Set(te).add(W))},[]),onNativeOptionRemove:x.useCallback(W=>{F(te=>{const $=new Set(te);return $.delete(W),$})},[]),children:r})}),q?c.jsxs(VE,{"aria-hidden":!0,required:h,tabIndex:-1,name:d,autoComplete:f,value:D,onChange:W=>P(W.target.value),disabled:g,children:[D===void 0?c.jsx("option",{value:""}):null,Array.from(T)]},b):null]})})};mE.displayName=Ec;var gE="SelectTrigger",vE=x.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...s}=e,i=zf(r),o=xi(gE,r),a=o.disabled||n,l=Xe(t,o.onTriggerChange),u=Ff(r),[d,f,g]=WE(y=>{const m=u().filter(p=>!p.disabled),w=m.find(p=>p.value===o.value),v=$E(m,y,w);v!==void 0&&o.onValueChange(v.value)}),h=()=>{a||(o.onOpenChange(!0),g())};return c.jsx(Ag,{asChild:!0,...i,children:c.jsx(Ve.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":UE(o.value)?"":void 0,...s,ref:l,onClick:ue(s.onClick,y=>{y.currentTarget.focus()}),onPointerDown:ue(s.onPointerDown,y=>{const m=y.target;m.hasPointerCapture(y.pointerId)&&m.releasePointerCapture(y.pointerId),y.button===0&&y.ctrlKey===!1&&(h(),o.triggerPointerDownPosRef.current={x:Math.round(y.pageX),y:Math.round(y.pageY)},y.preventDefault())}),onKeyDown:ue(s.onKeyDown,y=>{const m=d.current!=="";!(y.ctrlKey||y.altKey||y.metaKey)&&y.key.length===1&&f(y.key),!(m&&y.key===" ")&&oz.includes(y.key)&&(h(),y.preventDefault())})})})});vE.displayName=gE;var yE="SelectValue",xE=x.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,children:i,placeholder:o="",...a}=e,l=xi(yE,r),{onValueNodeHasChildrenChange:u}=l,d=i!==void 0,f=Xe(t,l.onValueNodeChange);return nr(()=>{u(d)},[u,d]),c.jsx(Ve.span,{...a,ref:f,style:{pointerEvents:"none"},children:UE(l.value)?c.jsx(c.Fragment,{children:o}):i})});xE.displayName=yE;var fz="SelectIcon",wE=x.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...s}=e;return c.jsx(Ve.span,{"aria-hidden":!0,...s,ref:t,children:n||"▼"})});wE.displayName=fz;var hz="SelectPortal",_E=e=>c.jsx(fc,{asChild:!0,...e});_E.displayName=hz;var Xi="SelectContent",bE=x.forwardRef((e,t)=>{const r=xi(Xi,e.__scopeSelect),[n,s]=x.useState();if(nr(()=>{s(new DocumentFragment)},[]),!r.open){const i=n;return i?Cs.createPortal(c.jsx(SE,{scope:e.__scopeSelect,children:c.jsx(Lf.Slot,{scope:e.__scopeSelect,children:c.jsx("div",{children:e.children})})}),i):null}return c.jsx(kE,{...e,ref:t})});bE.displayName=Xi;var is=10,[SE,wi]=ja(Xi),pz="SelectContentImpl",kE=x.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:i,onPointerDownOutside:o,side:a,sideOffset:l,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:g,collisionPadding:h,sticky:y,hideWhenDetached:m,avoidCollisions:w,...v}=e,p=xi(Xi,r),[_,C]=x.useState(null),[E,j]=x.useState(null),R=Xe(t,fe=>C(fe)),[D,P]=x.useState(null),[L,q]=x.useState(null),T=Ff(r),[F,b]=x.useState(!1),W=x.useRef(!1);x.useEffect(()=>{if(_)return Ig(_)},[_]),Sg();const te=x.useCallback(fe=>{const[ve,...Se]=T().map(Ce=>Ce.ref.current),[Ie]=Se.slice(-1),De=document.activeElement;for(const Ce of fe)if(Ce===De||(Ce==null||Ce.scrollIntoView({block:"nearest"}),Ce===ve&&E&&(E.scrollTop=0),Ce===Ie&&E&&(E.scrollTop=E.scrollHeight),Ce==null||Ce.focus(),document.activeElement!==De))return},[T,E]),$=x.useCallback(()=>te([D,_]),[te,D,_]);x.useEffect(()=>{F&&$()},[F,$]);const{onOpenChange:Z,triggerPointerDownPosRef:I}=p;x.useEffect(()=>{if(_){let fe={x:0,y:0};const ve=Ie=>{var De,Ce;fe={x:Math.abs(Math.round(Ie.pageX)-(((De=I.current)==null?void 0:De.x)??0)),y:Math.abs(Math.round(Ie.pageY)-(((Ce=I.current)==null?void 0:Ce.y)??0))}},Se=Ie=>{fe.x<=10&&fe.y<=10?Ie.preventDefault():_.contains(Ie.target)||Z(!1),document.removeEventListener("pointermove",ve),I.current=null};return I.current!==null&&(document.addEventListener("pointermove",ve),document.addEventListener("pointerup",Se,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ve),document.removeEventListener("pointerup",Se,{capture:!0})}}},[_,Z,I]),x.useEffect(()=>{const fe=()=>Z(!1);return window.addEventListener("blur",fe),window.addEventListener("resize",fe),()=>{window.removeEventListener("blur",fe),window.removeEventListener("resize",fe)}},[Z]);const[Q,z]=WE(fe=>{const ve=T().filter(De=>!De.disabled),Se=ve.find(De=>De.ref.current===document.activeElement),Ie=$E(ve,fe,Se);Ie&&setTimeout(()=>Ie.ref.current.focus())}),V=x.useCallback((fe,ve,Se)=>{const Ie=!W.current&&!Se;(p.value!==void 0&&p.value===ve||Ie)&&(P(fe),Ie&&(W.current=!0))},[p.value]),de=x.useCallback(()=>_==null?void 0:_.focus(),[_]),ne=x.useCallback((fe,ve,Se)=>{const Ie=!W.current&&!Se;(p.value!==void 0&&p.value===ve||Ie)&&q(fe)},[p.value]),se=n==="popper"?um:CE,Pe=se===um?{side:a,sideOffset:l,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:g,collisionPadding:h,sticky:y,hideWhenDetached:m,avoidCollisions:w}:{};return c.jsx(SE,{scope:r,content:_,viewport:E,onViewportChange:j,itemRefCallback:V,selectedItem:D,onItemLeave:de,itemTextRefCallback:ne,focusSelectedItem:$,selectedItemText:L,position:n,isPositioned:F,searchRef:Q,children:c.jsx(uf,{as:xs,allowPinchZoom:!0,children:c.jsx(sf,{asChild:!0,trapped:p.open,onMountAutoFocus:fe=>{fe.preventDefault()},onUnmountAutoFocus:ue(s,fe=>{var ve;(ve=p.trigger)==null||ve.focus({preventScroll:!0}),fe.preventDefault()}),children:c.jsx(wa,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:fe=>fe.preventDefault(),onDismiss:()=>p.onOpenChange(!1),children:c.jsx(se,{role:"listbox",id:p.contentId,"data-state":p.open?"open":"closed",dir:p.dir,onContextMenu:fe=>fe.preventDefault(),...v,...Pe,onPlaced:()=>b(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:ue(v.onKeyDown,fe=>{const ve=fe.ctrlKey||fe.altKey||fe.metaKey;if(fe.key==="Tab"&&fe.preventDefault(),!ve&&fe.key.length===1&&z(fe.key),["ArrowUp","ArrowDown","Home","End"].includes(fe.key)){let Ie=T().filter(De=>!De.disabled).map(De=>De.ref.current);if(["ArrowUp","End"].includes(fe.key)&&(Ie=Ie.slice().reverse()),["ArrowUp","ArrowDown"].includes(fe.key)){const De=fe.target,Ce=Ie.indexOf(De);Ie=Ie.slice(Ce+1)}setTimeout(()=>te(Ie)),fe.preventDefault()}})})})})})})});kE.displayName=pz;var mz="SelectItemAlignedPosition",CE=x.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...s}=e,i=xi(Xi,r),o=wi(Xi,r),[a,l]=x.useState(null),[u,d]=x.useState(null),f=Xe(t,R=>d(R)),g=Ff(r),h=x.useRef(!1),y=x.useRef(!0),{viewport:m,selectedItem:w,selectedItemText:v,focusSelectedItem:p}=o,_=x.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&u&&m&&w&&v){const R=i.trigger.getBoundingClientRect(),D=u.getBoundingClientRect(),P=i.valueNode.getBoundingClientRect(),L=v.getBoundingClientRect();if(i.dir!=="rtl"){const De=L.left-D.left,Ce=P.left-De,rt=R.left-Ce,k=R.width+rt,J=Math.max(k,D.width),K=window.innerWidth-is,A=cm(Ce,[is,K-J]);a.style.minWidth=k+"px",a.style.left=A+"px"}else{const De=D.right-L.right,Ce=window.innerWidth-P.right-De,rt=window.innerWidth-R.right-Ce,k=R.width+rt,J=Math.max(k,D.width),K=window.innerWidth-is,A=cm(Ce,[is,K-J]);a.style.minWidth=k+"px",a.style.right=A+"px"}const q=g(),T=window.innerHeight-is*2,F=m.scrollHeight,b=window.getComputedStyle(u),W=parseInt(b.borderTopWidth,10),te=parseInt(b.paddingTop,10),$=parseInt(b.borderBottomWidth,10),Z=parseInt(b.paddingBottom,10),I=W+te+F+Z+$,Q=Math.min(w.offsetHeight*5,I),z=window.getComputedStyle(m),V=parseInt(z.paddingTop,10),de=parseInt(z.paddingBottom,10),ne=R.top+R.height/2-is,se=T-ne,Pe=w.offsetHeight/2,fe=w.offsetTop+Pe,ve=W+te+fe,Se=I-ve;if(ve<=ne){const De=w===q[q.length-1].ref.current;a.style.bottom="0px";const Ce=u.clientHeight-m.offsetTop-m.offsetHeight,rt=Math.max(se,Pe+(De?de:0)+Ce+$),k=ve+rt;a.style.height=k+"px"}else{const De=w===q[0].ref.current;a.style.top="0px";const rt=Math.max(ne,W+m.offsetTop+(De?V:0)+Pe)+Se;a.style.height=rt+"px",m.scrollTop=ve-ne+m.offsetTop}a.style.margin=`${is}px 0`,a.style.minHeight=Q+"px",a.style.maxHeight=T+"px",n==null||n(),requestAnimationFrame(()=>h.current=!0)}},[g,i.trigger,i.valueNode,a,u,m,w,v,i.dir,n]);nr(()=>_(),[_]);const[C,E]=x.useState();nr(()=>{u&&E(window.getComputedStyle(u).zIndex)},[u]);const j=x.useCallback(R=>{R&&y.current===!0&&(_(),p==null||p(),y.current=!1)},[_,p]);return c.jsx(vz,{scope:r,contentWrapper:a,shouldExpandOnScrollRef:h,onScrollButtonChange:j,children:c.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:c.jsx(Ve.div,{...s,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});CE.displayName=mz;var gz="SelectPopperPosition",um=x.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:s=is,...i}=e,o=zf(r);return c.jsx(Og,{...o,...i,ref:t,align:n,collisionPadding:s,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});um.displayName=gz;var[vz,Vv]=ja(Xi,{}),dm="SelectViewport",EE=x.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...s}=e,i=wi(dm,r),o=Vv(dm,r),a=Xe(t,i.onViewportChange),l=x.useRef(0);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),c.jsx(Lf.Slot,{scope:r,children:c.jsx(Ve.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:a,style:{position:"relative",flex:1,overflow:"auto",...s.style},onScroll:ue(s.onScroll,u=>{const d=u.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:g}=o;if(g!=null&&g.current&&f){const h=Math.abs(l.current-d.scrollTop);if(h>0){const y=window.innerHeight-is*2,m=parseFloat(f.style.minHeight),w=parseFloat(f.style.height),v=Math.max(m,w);if(v0?C:0,f.style.justifyContent="flex-end")}}}l.current=d.scrollTop})})})]})});EE.displayName=dm;var jE="SelectGroup",[yz,xz]=ja(jE),TE=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=zn();return c.jsx(yz,{scope:r,id:s,children:c.jsx(Ve.div,{role:"group","aria-labelledby":s,...n,ref:t})})});TE.displayName=jE;var NE="SelectLabel",RE=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=xz(NE,r);return c.jsx(Ve.div,{id:s.id,...n,ref:t})});RE.displayName=NE;var Pd="SelectItem",[wz,PE]=ja(Pd),DE=x.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:s=!1,textValue:i,...o}=e,a=xi(Pd,r),l=wi(Pd,r),u=a.value===n,[d,f]=x.useState(i??""),[g,h]=x.useState(!1),y=Xe(t,v=>{var p;return(p=l.itemRefCallback)==null?void 0:p.call(l,v,n,s)}),m=zn(),w=()=>{s||(a.onValueChange(n),a.onOpenChange(!1))};if(n==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return c.jsx(wz,{scope:r,value:n,disabled:s,textId:m,isSelected:u,onItemTextChange:x.useCallback(v=>{f(p=>p||((v==null?void 0:v.textContent)??"").trim())},[]),children:c.jsx(Lf.ItemSlot,{scope:r,value:n,disabled:s,textValue:d,children:c.jsx(Ve.div,{role:"option","aria-labelledby":m,"data-highlighted":g?"":void 0,"aria-selected":u&&g,"data-state":u?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...o,ref:y,onFocus:ue(o.onFocus,()=>h(!0)),onBlur:ue(o.onBlur,()=>h(!1)),onPointerUp:ue(o.onPointerUp,w),onPointerMove:ue(o.onPointerMove,v=>{var p;s?(p=l.onItemLeave)==null||p.call(l):v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ue(o.onPointerLeave,v=>{var p;v.currentTarget===document.activeElement&&((p=l.onItemLeave)==null||p.call(l))}),onKeyDown:ue(o.onKeyDown,v=>{var _;((_=l.searchRef)==null?void 0:_.current)!==""&&v.key===" "||(az.includes(v.key)&&w(),v.key===" "&&v.preventDefault())})})})})});DE.displayName=Pd;var Ja="SelectItemText",AE=x.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,...i}=e,o=xi(Ja,r),a=wi(Ja,r),l=PE(Ja,r),u=dz(Ja,r),[d,f]=x.useState(null),g=Xe(t,v=>f(v),l.onItemTextChange,v=>{var p;return(p=a.itemTextRefCallback)==null?void 0:p.call(a,v,l.value,l.disabled)}),h=d==null?void 0:d.textContent,y=x.useMemo(()=>c.jsx("option",{value:l.value,disabled:l.disabled,children:h},l.value),[l.disabled,l.value,h]),{onNativeOptionAdd:m,onNativeOptionRemove:w}=u;return nr(()=>(m(y),()=>w(y)),[m,w,y]),c.jsxs(c.Fragment,{children:[c.jsx(Ve.span,{id:l.textId,...i,ref:g}),l.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Cs.createPortal(i.children,o.valueNode):null]})});AE.displayName=Ja;var OE="SelectItemIndicator",ME=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return PE(OE,r).isSelected?c.jsx(Ve.span,{"aria-hidden":!0,...n,ref:t}):null});ME.displayName=OE;var fm="SelectScrollUpButton",IE=x.forwardRef((e,t)=>{const r=wi(fm,e.__scopeSelect),n=Vv(fm,e.__scopeSelect),[s,i]=x.useState(!1),o=Xe(t,n.onScrollButtonChange);return nr(()=>{if(r.viewport&&r.isPositioned){let a=function(){const u=l.scrollTop>0;i(u)};const l=r.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[r.viewport,r.isPositioned]),s?c.jsx(FE,{...e,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=r;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});IE.displayName=fm;var hm="SelectScrollDownButton",LE=x.forwardRef((e,t)=>{const r=wi(hm,e.__scopeSelect),n=Vv(hm,e.__scopeSelect),[s,i]=x.useState(!1),o=Xe(t,n.onScrollButtonChange);return nr(()=>{if(r.viewport&&r.isPositioned){let a=function(){const u=l.scrollHeight-l.clientHeight,d=Math.ceil(l.scrollTop)l.removeEventListener("scroll",a)}},[r.viewport,r.isPositioned]),s?c.jsx(FE,{...e,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=r;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});LE.displayName=hm;var FE=x.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...s}=e,i=wi("SelectScrollButton",r),o=x.useRef(null),a=Ff(r),l=x.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return x.useEffect(()=>()=>l(),[l]),nr(()=>{var d;const u=a().find(f=>f.ref.current===document.activeElement);(d=u==null?void 0:u.ref.current)==null||d.scrollIntoView({block:"nearest"})},[a]),c.jsx(Ve.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:ue(s.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(n,50))}),onPointerMove:ue(s.onPointerMove,()=>{var u;(u=i.onItemLeave)==null||u.call(i),o.current===null&&(o.current=window.setInterval(n,50))}),onPointerLeave:ue(s.onPointerLeave,()=>{l()})})}),_z="SelectSeparator",zE=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return c.jsx(Ve.div,{"aria-hidden":!0,...n,ref:t})});zE.displayName=_z;var pm="SelectArrow",bz=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=zf(r),i=xi(pm,r),o=wi(pm,r);return i.open&&o.position==="popper"?c.jsx(Mg,{...s,...n,ref:t}):null});bz.displayName=pm;function UE(e){return e===""||e===void 0}var VE=x.forwardRef((e,t)=>{const{value:r,...n}=e,s=x.useRef(null),i=Xe(t,s),o=Qk(r);return x.useEffect(()=>{const a=s.current,l=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(o!==r&&d){const f=new Event("change",{bubbles:!0});d.call(a,r),a.dispatchEvent(f)}},[o,r]),c.jsx(Sc,{asChild:!0,children:c.jsx("select",{...n,ref:i,defaultValue:r})})});VE.displayName="BubbleSelect";function WE(e){const t=At(e),r=x.useRef(""),n=x.useRef(0),s=x.useCallback(o=>{const a=r.current+o;t(a),function l(u){r.current=u,window.clearTimeout(n.current),u!==""&&(n.current=window.setTimeout(()=>l(""),1e3))}(a)},[t]),i=x.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,s,i]}function $E(e,t,r){const s=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=r?e.indexOf(r):-1;let o=Sz(e,Math.max(i,0));s.length===1&&(o=o.filter(u=>u!==r));const l=o.find(u=>u.textValue.toLowerCase().startsWith(s.toLowerCase()));return l!==r?l:void 0}function Sz(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var kz=mE,BE=vE,Cz=xE,Ez=wE,jz=_E,HE=bE,Tz=EE,Nz=TE,YE=RE,ZE=DE,Rz=AE,Pz=ME,KE=IE,GE=LE,qE=zE;const el=kz,tl=Nz,rl=Cz,Mo=x.forwardRef(({className:e,children:t,...r},n)=>c.jsxs(BE,{ref:n,className:pe("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[t,c.jsx(Ez,{asChild:!0,children:c.jsx(h1,{className:"h-4 w-4 opacity-50"})})]}));Mo.displayName=BE.displayName;const XE=x.forwardRef(({className:e,...t},r)=>c.jsx(KE,{ref:r,className:pe("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(zR,{className:"h-4 w-4"})}));XE.displayName=KE.displayName;const QE=x.forwardRef(({className:e,...t},r)=>c.jsx(GE,{ref:r,className:pe("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(h1,{className:"h-4 w-4"})}));QE.displayName=GE.displayName;const Io=x.forwardRef(({className:e,children:t,position:r="popper",...n},s)=>c.jsx(jz,{children:c.jsxs(HE,{ref:s,className:pe("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:[c.jsx(XE,{}),c.jsx(Tz,{className:pe("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),c.jsx(QE,{})]})}));Io.displayName=HE.displayName;const Lo=x.forwardRef(({className:e,...t},r)=>c.jsx(YE,{ref:r,className:pe("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Lo.displayName=YE.displayName;const Fo=x.forwardRef(({className:e,children:t,...r},n)=>c.jsxs(ZE,{ref:n,className:pe("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[c.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:c.jsx(Pz,{children:c.jsx(f1,{className:"h-4 w-4"})})}),c.jsx(Rz,{children:t})]}));Fo.displayName=ZE.displayName;const Dz=x.forwardRef(({className:e,...t},r)=>c.jsx(qE,{ref:r,className:pe("-mx-1 my-1 h-px bg-muted",e),...t}));Dz.displayName=qE.displayName;const mm=new Map([["aliyun-cdn",["阿里云-CDN","/imgs/providers/aliyun.svg"]],["aliyun-oss",["阿里云-OSS","/imgs/providers/aliyun.svg"]],["tencent-cdn",["腾讯云-CDN","/imgs/providers/tencent.svg"]],["ssh",["SSH部署","/imgs/providers/ssh.svg"]],["qiniu-cdn",["七牛云-CDN","/imgs/providers/qiniu.svg"]],["webhook",["Webhook","/imgs/providers/webhook.svg"]]]),Az=Array.from(mm.keys()),JE=qg,ej=Xg,Oz=Qg,tj=x.forwardRef(({className:e,...t},r)=>c.jsx(mc,{ref:r,className:pe("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));tj.displayName=mc.displayName;const Wv=x.forwardRef(({className:e,children:t,...r},n)=>c.jsxs(Oz,{children:[c.jsx(tj,{}),c.jsxs(gc,{ref:n,className:pe("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r,children:[t,c.jsxs(hf,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[c.jsx(xg,{className:"h-4 w-4"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Wv.displayName=gc.displayName;const $v=({className:e,...t})=>c.jsx("div",{className:pe("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});$v.displayName="DialogHeader";const Bv=x.forwardRef(({className:e,...t},r)=>c.jsx(vc,{ref:r,className:pe("text-lg font-semibold leading-none tracking-tight",e),...t}));Bv.displayName=vc.displayName;const Mz=x.forwardRef(({className:e,...t},r)=>c.jsx(yc,{ref:r,className:pe("text-sm text-muted-foreground",e),...t}));Mz.displayName=yc.displayName;function Iz(e,t){return x.useReducer((r,n)=>t[r][n]??r,e)}var Hv="ScrollArea",[rj,E8]=Qr(Hv),[Lz,sn]=rj(Hv),nj=x.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:n="hover",dir:s,scrollHideDelay:i=600,...o}=e,[a,l]=x.useState(null),[u,d]=x.useState(null),[f,g]=x.useState(null),[h,y]=x.useState(null),[m,w]=x.useState(null),[v,p]=x.useState(0),[_,C]=x.useState(0),[E,j]=x.useState(!1),[R,D]=x.useState(!1),P=Xe(t,q=>l(q)),L=nf(s);return c.jsx(Lz,{scope:r,type:n,dir:L,scrollHideDelay:i,scrollArea:a,viewport:u,onViewportChange:d,content:f,onContentChange:g,scrollbarX:h,onScrollbarXChange:y,scrollbarXEnabled:E,onScrollbarXEnabledChange:j,scrollbarY:m,onScrollbarYChange:w,scrollbarYEnabled:R,onScrollbarYEnabledChange:D,onCornerWidthChange:p,onCornerHeightChange:C,children:c.jsx(Ve.div,{dir:L,...o,ref:P,style:{position:"relative","--radix-scroll-area-corner-width":v+"px","--radix-scroll-area-corner-height":_+"px",...e.style}})})});nj.displayName=Hv;var sj="ScrollAreaViewport",ij=x.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:n,nonce:s,...i}=e,o=sn(sj,r),a=x.useRef(null),l=Xe(t,a,o.onViewportChange);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),c.jsx(Ve.div,{"data-radix-scroll-area-viewport":"",...i,ref:l,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...e.style},children:c.jsx("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});ij.displayName=sj;var Kn="ScrollAreaScrollbar",Yv=x.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=sn(Kn,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:o}=s,a=e.orientation==="horizontal";return x.useEffect(()=>(a?i(!0):o(!0),()=>{a?i(!1):o(!1)}),[a,i,o]),s.type==="hover"?c.jsx(Fz,{...n,ref:t,forceMount:r}):s.type==="scroll"?c.jsx(zz,{...n,ref:t,forceMount:r}):s.type==="auto"?c.jsx(oj,{...n,ref:t,forceMount:r}):s.type==="always"?c.jsx(Zv,{...n,ref:t}):null});Yv.displayName=Kn;var Fz=x.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=sn(Kn,e.__scopeScrollArea),[i,o]=x.useState(!1);return x.useEffect(()=>{const a=s.scrollArea;let l=0;if(a){const u=()=>{window.clearTimeout(l),o(!0)},d=()=>{l=window.setTimeout(()=>o(!1),s.scrollHideDelay)};return a.addEventListener("pointerenter",u),a.addEventListener("pointerleave",d),()=>{window.clearTimeout(l),a.removeEventListener("pointerenter",u),a.removeEventListener("pointerleave",d)}}},[s.scrollArea,s.scrollHideDelay]),c.jsx(Er,{present:r||i,children:c.jsx(oj,{"data-state":i?"visible":"hidden",...n,ref:t})})}),zz=x.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=sn(Kn,e.__scopeScrollArea),i=e.orientation==="horizontal",o=Vf(()=>l("SCROLL_END"),100),[a,l]=Iz("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return x.useEffect(()=>{if(a==="idle"){const u=window.setTimeout(()=>l("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(u)}},[a,s.scrollHideDelay,l]),x.useEffect(()=>{const u=s.viewport,d=i?"scrollLeft":"scrollTop";if(u){let f=u[d];const g=()=>{const h=u[d];f!==h&&(l("SCROLL"),o()),f=h};return u.addEventListener("scroll",g),()=>u.removeEventListener("scroll",g)}},[s.viewport,i,l,o]),c.jsx(Er,{present:r||a!=="hidden",children:c.jsx(Zv,{"data-state":a==="hidden"?"hidden":"visible",...n,ref:t,onPointerEnter:ue(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:ue(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),oj=x.forwardRef((e,t)=>{const r=sn(Kn,e.__scopeScrollArea),{forceMount:n,...s}=e,[i,o]=x.useState(!1),a=e.orientation==="horizontal",l=Vf(()=>{if(r.viewport){const u=r.viewport.offsetWidth{const{orientation:r="vertical",...n}=e,s=sn(Kn,e.__scopeScrollArea),i=x.useRef(null),o=x.useRef(0),[a,l]=x.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=dj(a.viewport,a.content),d={...n,sizes:a,onSizesChange:l,hasThumb:u>0&&u<1,onThumbChange:g=>i.current=g,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:g=>o.current=g};function f(g,h){return Hz(g,o.current,a,h)}return r==="horizontal"?c.jsx(Uz,{...d,ref:t,onThumbPositionChange:()=>{if(s.viewport&&i.current){const g=s.viewport.scrollLeft,h=D0(g,a,s.dir);i.current.style.transform=`translate3d(${h}px, 0, 0)`}},onWheelScroll:g=>{s.viewport&&(s.viewport.scrollLeft=g)},onDragScroll:g=>{s.viewport&&(s.viewport.scrollLeft=f(g,s.dir))}}):r==="vertical"?c.jsx(Vz,{...d,ref:t,onThumbPositionChange:()=>{if(s.viewport&&i.current){const g=s.viewport.scrollTop,h=D0(g,a);i.current.style.transform=`translate3d(0, ${h}px, 0)`}},onWheelScroll:g=>{s.viewport&&(s.viewport.scrollTop=g)},onDragScroll:g=>{s.viewport&&(s.viewport.scrollTop=f(g))}}):null}),Uz=x.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...s}=e,i=sn(Kn,e.__scopeScrollArea),[o,a]=x.useState(),l=x.useRef(null),u=Xe(t,l,i.onScrollbarXChange);return x.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),c.jsx(lj,{"data-orientation":"horizontal",...s,ref:u,sizes:r,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Uf(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,f)=>{if(i.viewport){const g=i.viewport.scrollLeft+d.deltaX;e.onWheelScroll(g),hj(g,f)&&d.preventDefault()}},onResize:()=>{l.current&&i.viewport&&o&&n({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:Ad(o.paddingLeft),paddingEnd:Ad(o.paddingRight)}})}})}),Vz=x.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...s}=e,i=sn(Kn,e.__scopeScrollArea),[o,a]=x.useState(),l=x.useRef(null),u=Xe(t,l,i.onScrollbarYChange);return x.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),c.jsx(lj,{"data-orientation":"vertical",...s,ref:u,sizes:r,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Uf(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,f)=>{if(i.viewport){const g=i.viewport.scrollTop+d.deltaY;e.onWheelScroll(g),hj(g,f)&&d.preventDefault()}},onResize:()=>{l.current&&i.viewport&&o&&n({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:Ad(o.paddingTop),paddingEnd:Ad(o.paddingBottom)}})}})}),[Wz,aj]=rj(Kn),lj=x.forwardRef((e,t)=>{const{__scopeScrollArea:r,sizes:n,hasThumb:s,onThumbChange:i,onThumbPointerUp:o,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:u,onWheelScroll:d,onResize:f,...g}=e,h=sn(Kn,r),[y,m]=x.useState(null),w=Xe(t,P=>m(P)),v=x.useRef(null),p=x.useRef(""),_=h.viewport,C=n.content-n.viewport,E=At(d),j=At(l),R=Vf(f,10);function D(P){if(v.current){const L=P.clientX-v.current.left,q=P.clientY-v.current.top;u({x:L,y:q})}}return x.useEffect(()=>{const P=L=>{const q=L.target;(y==null?void 0:y.contains(q))&&E(L,C)};return document.addEventListener("wheel",P,{passive:!1}),()=>document.removeEventListener("wheel",P,{passive:!1})},[_,y,C,E]),x.useEffect(j,[n,j]),ha(y,R),ha(h.content,R),c.jsx(Wz,{scope:r,scrollbar:y,hasThumb:s,onThumbChange:At(i),onThumbPointerUp:At(o),onThumbPositionChange:j,onThumbPointerDown:At(a),children:c.jsx(Ve.div,{...g,ref:w,style:{position:"absolute",...g.style},onPointerDown:ue(e.onPointerDown,P=>{P.button===0&&(P.target.setPointerCapture(P.pointerId),v.current=y.getBoundingClientRect(),p.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",h.viewport&&(h.viewport.style.scrollBehavior="auto"),D(P))}),onPointerMove:ue(e.onPointerMove,D),onPointerUp:ue(e.onPointerUp,P=>{const L=P.target;L.hasPointerCapture(P.pointerId)&&L.releasePointerCapture(P.pointerId),document.body.style.webkitUserSelect=p.current,h.viewport&&(h.viewport.style.scrollBehavior=""),v.current=null})})})}),Dd="ScrollAreaThumb",cj=x.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=aj(Dd,e.__scopeScrollArea);return c.jsx(Er,{present:r||s.hasThumb,children:c.jsx($z,{ref:t,...n})})}),$z=x.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:n,...s}=e,i=sn(Dd,r),o=aj(Dd,r),{onThumbPositionChange:a}=o,l=Xe(t,f=>o.onThumbChange(f)),u=x.useRef(),d=Vf(()=>{u.current&&(u.current(),u.current=void 0)},100);return x.useEffect(()=>{const f=i.viewport;if(f){const g=()=>{if(d(),!u.current){const h=Yz(f,a);u.current=h,a()}};return a(),f.addEventListener("scroll",g),()=>f.removeEventListener("scroll",g)}},[i.viewport,d,a]),c.jsx(Ve.div,{"data-state":o.hasThumb?"visible":"hidden",...s,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:ue(e.onPointerDownCapture,f=>{const h=f.target.getBoundingClientRect(),y=f.clientX-h.left,m=f.clientY-h.top;o.onThumbPointerDown({x:y,y:m})}),onPointerUp:ue(e.onPointerUp,o.onThumbPointerUp)})});cj.displayName=Dd;var Kv="ScrollAreaCorner",uj=x.forwardRef((e,t)=>{const r=sn(Kv,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?c.jsx(Bz,{...e,ref:t}):null});uj.displayName=Kv;var Bz=x.forwardRef((e,t)=>{const{__scopeScrollArea:r,...n}=e,s=sn(Kv,r),[i,o]=x.useState(0),[a,l]=x.useState(0),u=!!(i&&a);return ha(s.scrollbarX,()=>{var f;const d=((f=s.scrollbarX)==null?void 0:f.offsetHeight)||0;s.onCornerHeightChange(d),l(d)}),ha(s.scrollbarY,()=>{var f;const d=((f=s.scrollbarY)==null?void 0:f.offsetWidth)||0;s.onCornerWidthChange(d),o(d)}),u?c.jsx(Ve.div,{...n,ref:t,style:{width:i,height:a,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Ad(e){return e?parseInt(e,10):0}function dj(e,t){const r=e/t;return isNaN(r)?0:r}function Uf(e){const t=dj(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function Hz(e,t,r,n="ltr"){const s=Uf(r),i=s/2,o=t||i,a=s-o,l=r.scrollbar.paddingStart+o,u=r.scrollbar.size-r.scrollbar.paddingEnd-a,d=r.content-r.viewport,f=n==="ltr"?[0,d]:[d*-1,0];return fj([l,u],f)(e)}function D0(e,t,r="ltr"){const n=Uf(t),s=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-s,o=t.content-t.viewport,a=i-n,l=r==="ltr"?[0,o]:[o*-1,0],u=cm(e,l);return fj([0,o],[0,a])(u)}function fj(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function hj(e,t){return e>0&&e{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function s(){const i={left:e.scrollLeft,top:e.scrollTop},o=r.left!==i.left,a=r.top!==i.top;(o||a)&&t(),r=i,n=window.requestAnimationFrame(s)}(),()=>window.cancelAnimationFrame(n)};function Vf(e,t){const r=At(e),n=x.useRef(0);return x.useEffect(()=>()=>window.clearTimeout(n.current),[]),x.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function ha(e,t){const r=At(t);nr(()=>{let n=0;if(e){const s=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return s.observe(e),()=>{window.cancelAnimationFrame(n),s.unobserve(e)}}},[e,r])}var pj=nj,Zz=ij,Kz=uj;const Gv=x.forwardRef(({className:e,children:t,...r},n)=>c.jsxs(pj,{ref:n,className:pe("relative overflow-hidden",e),...r,children:[c.jsx(Zz,{className:"h-full w-full rounded-[inherit]",children:t}),c.jsx(mj,{}),c.jsx(Kz,{})]}));Gv.displayName=pj.displayName;const mj=x.forwardRef(({className:e,orientation:t="vertical",...r},n)=>c.jsx(Yv,{ref:n,orientation:t,className:pe("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...r,children:c.jsx(cj,{className:"relative flex-1 rounded-full bg-border"})}));mj.displayName=Yv.displayName;const zi=new Map([["tencent",["腾讯云","/imgs/providers/tencent.svg"]],["aliyun",["阿里云","/imgs/providers/aliyun.svg"]],["cloudflare",["Cloudflare","/imgs/providers/cloudflare.svg"]],["namesilo",["Namesilo","/imgs/providers/namesilo.svg"]],["godaddy",["GoDaddy","/imgs/providers/godaddy.svg"]],["qiniu",["七牛云","/imgs/providers/qiniu.svg"]],["ssh",["SSH部署","/imgs/providers/ssh.svg"]],["webhook",["Webhook","/imgs/providers/webhook.svg"]]]),_i=we.union([we.literal("aliyun"),we.literal("tencent"),we.literal("ssh"),we.literal("webhook"),we.literal("cloudflare"),we.literal("qiniu"),we.literal("namesilo"),we.literal("godaddy")],{message:"请选择云服务商"}),bi=e=>{switch(e){case"aliyun":case"tencent":return"all";case"ssh":case"webhook":case"qiniu":return"deploy";case"cloudflare":case"namesilo":case"godaddy":return"apply";default:return"all"}},Gz=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=En(),s=we.object({id:we.string().optional(),name:we.string().min(1).max(64),configType:_i,secretId:we.string().min(1).max(64),secretKey:we.string().min(1).max(64)});let i={secretId:"",secretKey:""};e&&(i=e.config);const o=tn({resolver:rn(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"tencent",secretId:i.secretId,secretKey:i.secretKey}}),a=async l=>{const u={id:l.id,name:l.name,configType:l.configType,usage:bi(l.configType),config:{secretId:l.secretId,secretKey:l.secretKey}};try{const d=await yi(u);if(t(),u.id=d.id,u.created=d.created,u.updated=d.updated,l.id){n(u);return}r(u)}catch(d){Object.entries(d.response.data).forEach(([g,h])=>{o.setError(g,{type:"manual",message:h.message})})}};return c.jsx(c.Fragment,{children:c.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:c.jsx(nn,{...o,children:c.jsxs("form",{onSubmit:l=>{l.stopPropagation(),o.handleSubmit(a)(l)},className:"space-y-8",children:[c.jsx(Ae,{control:o.control,name:"name",render:({field:l})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"名称"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入授权名称",...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"id",render:({field:l})=>c.jsxs(Te,{className:"hidden",children:[c.jsx(Ne,{children:"配置类型"}),c.jsx(Re,{children:c.jsx(Fe,{...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"configType",render:({field:l})=>c.jsxs(Te,{className:"hidden",children:[c.jsx(Ne,{children:"配置类型"}),c.jsx(Re,{children:c.jsx(Fe,{...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"secretId",render:({field:l})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"SecretId"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入SecretId",...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"secretKey",render:({field:l})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"SecretKey"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入SecretKey",...l})}),c.jsx(ke,{})]})}),c.jsx("div",{className:"flex justify-end",children:c.jsx(at,{type:"submit",children:"保存"})})]})})})})},qz=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=En(),s=we.object({id:we.string().optional(),name:we.string().min(1).max(64),configType:_i,accessKeyId:we.string().min(1).max(64),accessSecretId:we.string().min(1).max(64)});let i={accessKeyId:"",accessKeySecret:""};e&&(i=e.config);const o=tn({resolver:rn(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"aliyun",accessKeyId:i.accessKeyId,accessSecretId:i.accessKeySecret}}),a=async l=>{const u={id:l.id,name:l.name,configType:l.configType,usage:bi(l.configType),config:{accessKeyId:l.accessKeyId,accessKeySecret:l.accessSecretId}};try{const d=await yi(u);if(t(),u.id=d.id,u.created=d.created,u.updated=d.updated,l.id){n(u);return}r(u)}catch(d){Object.entries(d.response.data).forEach(([g,h])=>{o.setError(g,{type:"manual",message:h.message})});return}};return c.jsx(c.Fragment,{children:c.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:c.jsx(nn,{...o,children:c.jsxs("form",{onSubmit:l=>{l.stopPropagation(),o.handleSubmit(a)(l)},className:"space-y-8",children:[c.jsx(Ae,{control:o.control,name:"name",render:({field:l})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"名称"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入授权名称",...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"id",render:({field:l})=>c.jsxs(Te,{className:"hidden",children:[c.jsx(Ne,{children:"配置类型"}),c.jsx(Re,{children:c.jsx(Fe,{...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"configType",render:({field:l})=>c.jsxs(Te,{className:"hidden",children:[c.jsx(Ne,{children:"配置类型"}),c.jsx(Re,{children:c.jsx(Fe,{...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"accessKeyId",render:({field:l})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"AccessKeyId"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入AccessKeyId",...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"accessSecretId",render:({field:l})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"AccessKeySecret"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入AccessKeySecret",...l})}),c.jsx(ke,{})]})}),c.jsx(ke,{}),c.jsx("div",{className:"flex justify-end",children:c.jsx(at,{type:"submit",children:"保存"})})]})})})})},gj=x.forwardRef(({className:e,...t},r)=>c.jsx("textarea",{className:pe("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...t}));gj.displayName="Textarea";const Xz=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=En(),s=x.useRef(null),[i,o]=x.useState(""),a=we.object({id:we.string().optional(),name:we.string().min(1).max(64),configType:_i,host:we.string().ip({message:"请输入合法的IP地址"}),port:we.string().min(1).max(5),username:we.string().min(1).max(64),password:we.string().min(0).max(64),key:we.string().min(0).max(20480),keyFile:we.any().optional(),command:we.string().min(1).max(2048),certPath:we.string().min(0).max(2048),keyPath:we.string().min(0).max(2048)});let l={host:"127.0.0.1",port:"22",username:"root",password:"",key:"",keyFile:"",command:"sudo service nginx restart",certPath:"/etc/nginx/ssl/certificate.crt",keyPath:"/etc/nginx/ssl/private.key"};e&&(l=e.config);const u=tn({resolver:rn(a),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"ssh",host:l.host,port:l.port,username:l.username,password:l.password,key:l.key,keyFile:l.keyFile,certPath:l.certPath,keyPath:l.keyPath,command:l.command}}),d=async h=>{console.log(h);const y={id:h.id,name:h.name,configType:h.configType,usage:bi(h.configType),config:{host:h.host,port:h.port,username:h.username,password:h.password,key:h.key,command:h.command,certPath:h.certPath,keyPath:h.keyPath}};try{const m=await yi(y);if(t(),y.id=m.id,y.created=m.created,y.updated=m.updated,h.id){n(y);return}r(y)}catch(m){Object.entries(m.response.data).forEach(([v,p])=>{u.setError(v,{type:"manual",message:p.message})});return}},f=async h=>{var v;const y=(v=h.target.files)==null?void 0:v[0];if(!y)return;const m=y;o(m.name);const w=await C5(m);u.setValue("key",w)},g=()=>{var h;console.log(s.current),(h=s.current)==null||h.click()};return c.jsx(c.Fragment,{children:c.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:c.jsx(nn,{...u,children:c.jsxs("form",{onSubmit:h=>{h.stopPropagation(),u.handleSubmit(d)(h)},className:"space-y-3",children:[c.jsx(Ae,{control:u.control,name:"name",render:({field:h})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"名称"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入授权名称",...h})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:u.control,name:"id",render:({field:h})=>c.jsxs(Te,{className:"hidden",children:[c.jsx(Ne,{children:"配置类型"}),c.jsx(Re,{children:c.jsx(Fe,{...h})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:u.control,name:"configType",render:({field:h})=>c.jsxs(Te,{className:"hidden",children:[c.jsx(Ne,{children:"配置类型"}),c.jsx(Re,{children:c.jsx(Fe,{...h})}),c.jsx(ke,{})]})}),c.jsxs("div",{className:"flex space-x-2",children:[c.jsx(Ae,{control:u.control,name:"host",render:({field:h})=>c.jsxs(Te,{className:"grow",children:[c.jsx(Ne,{children:"服务器IP"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入Host",...h})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:u.control,name:"port",render:({field:h})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"SSH端口"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入Port",...h,type:"number"})}),c.jsx(ke,{})]})})]}),c.jsx(Ae,{control:u.control,name:"username",render:({field:h})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"用户名"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入用户名",...h})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:u.control,name:"password",render:({field:h})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"密码"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入密码",...h,type:"password"})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:u.control,name:"key",render:({field:h})=>c.jsxs(Te,{hidden:!0,children:[c.jsx(Ne,{children:"Key(使用证书登录)"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入Key",...h})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:u.control,name:"keyFile",render:({field:h})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"Key(使用证书登录)"}),c.jsx(Re,{children:c.jsxs("div",{children:[c.jsx(at,{type:"button",variant:"secondary",size:"sm",className:"w-48",onClick:g,children:i||"请选择文件"}),c.jsx(Fe,{placeholder:"请输入Key",...h,ref:s,className:"hidden",hidden:!0,type:"file",onChange:f})]})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:u.control,name:"certPath",render:({field:h})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"证书上传路径"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入证书上传路径",...h})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:u.control,name:"keyPath",render:({field:h})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"私钥上传路径"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入私钥上传路径",...h})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:u.control,name:"command",render:({field:h})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"Command"}),c.jsx(Re,{children:c.jsx(gj,{placeholder:"请输入要执行的命令",...h})}),c.jsx(ke,{})]})}),c.jsx(ke,{}),c.jsx("div",{className:"flex justify-end",children:c.jsx(at,{type:"submit",children:"保存"})})]})})})})},Qz=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=En(),s=we.object({id:we.string().optional(),name:we.string().min(1).max(64),configType:_i,url:we.string().url()});let i={url:""};e&&(i=e.config);const o=tn({resolver:rn(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"webhook",url:i.url}}),a=async l=>{console.log(l);const u={id:l.id,name:l.name,configType:l.configType,usage:bi(l.configType),config:{url:l.url}};try{const d=await yi(u);if(t(),u.id=d.id,u.created=d.created,u.updated=d.updated,l.id){n(u);return}r(u)}catch(d){Object.entries(d.response.data).forEach(([g,h])=>{o.setError(g,{type:"manual",message:h.message})})}};return c.jsx(c.Fragment,{children:c.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:c.jsx(nn,{...o,children:c.jsxs("form",{onSubmit:l=>{console.log(l),l.stopPropagation(),o.handleSubmit(a)(l)},className:"space-y-8",children:[c.jsx(Ae,{control:o.control,name:"name",render:({field:l})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"名称"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入授权名称",...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"id",render:({field:l})=>c.jsxs(Te,{className:"hidden",children:[c.jsx(Ne,{children:"配置类型"}),c.jsx(Re,{children:c.jsx(Fe,{...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"configType",render:({field:l})=>c.jsxs(Te,{className:"hidden",children:[c.jsx(Ne,{children:"配置类型"}),c.jsx(Re,{children:c.jsx(Fe,{...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"url",render:({field:l})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"Webhook Url"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入Webhook Url",...l})}),c.jsx(ke,{})]})}),c.jsx("div",{className:"flex justify-end",children:c.jsx(at,{type:"submit",children:"保存"})})]})})})})},Jz=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=En(),s=we.object({id:we.string().optional(),name:we.string().min(1).max(64),configType:_i,dnsApiToken:we.string().min(1).max(64)});let i={dnsApiToken:""};e&&(i=e.config);const o=tn({resolver:rn(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"cloudflare",dnsApiToken:i.dnsApiToken}}),a=async l=>{console.log(l);const u={id:l.id,name:l.name,configType:l.configType,usage:bi(l.configType),config:{dnsApiToken:l.dnsApiToken}};try{const d=await yi(u);if(t(),u.id=d.id,u.created=d.created,u.updated=d.updated,l.id){n(u);return}r(u)}catch(d){Object.entries(d.response.data).forEach(([g,h])=>{o.setError(g,{type:"manual",message:h.message})})}};return c.jsx(c.Fragment,{children:c.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:c.jsx(nn,{...o,children:c.jsxs("form",{onSubmit:l=>{console.log(l),l.stopPropagation(),o.handleSubmit(a)(l)},className:"space-y-8",children:[c.jsx(Ae,{control:o.control,name:"name",render:({field:l})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"名称"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入授权名称",...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"id",render:({field:l})=>c.jsxs(Te,{className:"hidden",children:[c.jsx(Ne,{children:"配置类型"}),c.jsx(Re,{children:c.jsx(Fe,{...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"configType",render:({field:l})=>c.jsxs(Te,{className:"hidden",children:[c.jsx(Ne,{children:"配置类型"}),c.jsx(Re,{children:c.jsx(Fe,{...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"dnsApiToken",render:({field:l})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"CLOUD_DNS_API_TOKEN"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入CLOUD_DNS_API_TOKEN",...l})}),c.jsx(ke,{})]})}),c.jsx("div",{className:"flex justify-end",children:c.jsx(at,{type:"submit",children:"保存"})})]})})})})},e8=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=En(),s=we.object({id:we.string().optional(),name:we.string().min(1).max(64),configType:_i,accessKey:we.string().min(1).max(64),secretKey:we.string().min(1).max(64)});let i={accessKey:"",secretKey:""};e&&(i=e.config);const o=tn({resolver:rn(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"qiniu",accessKey:i.accessKey,secretKey:i.secretKey}}),a=async l=>{const u={id:l.id,name:l.name,configType:l.configType,usage:bi(l.configType),config:{accessKey:l.accessKey,secretKey:l.secretKey}};try{const d=await yi(u);if(t(),u.id=d.id,u.created=d.created,u.updated=d.updated,l.id){n(u);return}r(u)}catch(d){Object.entries(d.response.data).forEach(([g,h])=>{o.setError(g,{type:"manual",message:h.message})});return}};return c.jsx(c.Fragment,{children:c.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:c.jsx(nn,{...o,children:c.jsxs("form",{onSubmit:l=>{l.stopPropagation(),o.handleSubmit(a)(l)},className:"space-y-8",children:[c.jsx(Ae,{control:o.control,name:"name",render:({field:l})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"名称"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入授权名称",...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"id",render:({field:l})=>c.jsxs(Te,{className:"hidden",children:[c.jsx(Ne,{children:"配置类型"}),c.jsx(Re,{children:c.jsx(Fe,{...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"configType",render:({field:l})=>c.jsxs(Te,{className:"hidden",children:[c.jsx(Ne,{children:"配置类型"}),c.jsx(Re,{children:c.jsx(Fe,{...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"accessKey",render:({field:l})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"AccessKey"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入AccessKey",...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"secretKey",render:({field:l})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"SecretKey"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入SecretKey",...l})}),c.jsx(ke,{})]})}),c.jsx(ke,{}),c.jsx("div",{className:"flex justify-end",children:c.jsx(at,{type:"submit",children:"保存"})})]})})})})},t8=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=En(),s=we.object({id:we.string().optional(),name:we.string().min(1).max(64),configType:_i,apiKey:we.string().min(1).max(64)});let i={apiKey:""};e&&(i=e.config);const o=tn({resolver:rn(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"namesilo",apiKey:i.apiKey}}),a=async l=>{console.log(l);const u={id:l.id,name:l.name,configType:l.configType,usage:bi(l.configType),config:{apiKey:l.apiKey}};try{const d=await yi(u);if(t(),u.id=d.id,u.created=d.created,u.updated=d.updated,l.id){n(u);return}r(u)}catch(d){Object.entries(d.response.data).forEach(([g,h])=>{o.setError(g,{type:"manual",message:h.message})})}};return c.jsx(c.Fragment,{children:c.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:c.jsx(nn,{...o,children:c.jsxs("form",{onSubmit:l=>{console.log(l),l.stopPropagation(),o.handleSubmit(a)(l)},className:"space-y-8",children:[c.jsx(Ae,{control:o.control,name:"name",render:({field:l})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"名称"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入授权名称",...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"id",render:({field:l})=>c.jsxs(Te,{className:"hidden",children:[c.jsx(Ne,{children:"配置类型"}),c.jsx(Re,{children:c.jsx(Fe,{...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"configType",render:({field:l})=>c.jsxs(Te,{className:"hidden",children:[c.jsx(Ne,{children:"配置类型"}),c.jsx(Re,{children:c.jsx(Fe,{...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"apiKey",render:({field:l})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"NAMESILO_API_KEY"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入NAMESILO_API_KEY",...l})}),c.jsx(ke,{})]})}),c.jsx("div",{className:"flex justify-end",children:c.jsx(at,{type:"submit",children:"保存"})})]})})})})},r8=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=En(),s=we.object({id:we.string().optional(),name:we.string().min(1).max(64),configType:_i,apiKey:we.string().min(1).max(64),apiSecret:we.string().min(1).max(64)});let i={apiKey:"",apiSecret:""};e&&(i=e.config);const o=tn({resolver:rn(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"godaddy",apiKey:i.apiKey,apiSecret:i.apiSecret}}),a=async l=>{console.log(l);const u={id:l.id,name:l.name,configType:l.configType,usage:bi(l.configType),config:{apiKey:l.apiKey,apiSecret:l.apiSecret}};try{const d=await yi(u);if(t(),u.id=d.id,u.created=d.created,u.updated=d.updated,l.id){n(u);return}r(u)}catch(d){Object.entries(d.response.data).forEach(([g,h])=>{o.setError(g,{type:"manual",message:h.message})})}};return c.jsx(c.Fragment,{children:c.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:c.jsx(nn,{...o,children:c.jsxs("form",{onSubmit:l=>{console.log(l),l.stopPropagation(),o.handleSubmit(a)(l)},className:"space-y-8",children:[c.jsx(Ae,{control:o.control,name:"name",render:({field:l})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"名称"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入授权名称",...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"id",render:({field:l})=>c.jsxs(Te,{className:"hidden",children:[c.jsx(Ne,{children:"配置类型"}),c.jsx(Re,{children:c.jsx(Fe,{...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"configType",render:({field:l})=>c.jsxs(Te,{className:"hidden",children:[c.jsx(Ne,{children:"配置类型"}),c.jsx(Re,{children:c.jsx(Fe,{...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"apiKey",render:({field:l})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"GODADDY_API_KEY"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入GODADDY_API_KEY",...l})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"apiSecret",render:({field:l})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"GODADDY_API_SECRET"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入GODADDY_API_SECRET",...l})}),c.jsx(ke,{})]})}),c.jsx("div",{className:"flex justify-end",children:c.jsx(at,{type:"submit",children:"保存"})})]})})})})};function gl({trigger:e,op:t,data:r,className:n}){const[s,i]=x.useState(!1),o=Array.from(zi.keys()),[a,l]=x.useState((r==null?void 0:r.configType)||"");let u=c.jsx(c.Fragment,{children:" "});switch(a){case"tencent":u=c.jsx(Gz,{data:r,onAfterReq:()=>{i(!1)}});break;case"aliyun":u=c.jsx(qz,{data:r,onAfterReq:()=>{i(!1)}});break;case"ssh":u=c.jsx(Xz,{data:r,onAfterReq:()=>{i(!1)}});break;case"webhook":u=c.jsx(Qz,{data:r,onAfterReq:()=>{i(!1)}});break;case"cloudflare":u=c.jsx(Jz,{data:r,onAfterReq:()=>{i(!1)}});break;case"qiniu":u=c.jsx(e8,{data:r,onAfterReq:()=>{i(!1)}});break;case"namesilo":u=c.jsx(t8,{data:r,onAfterReq:()=>{i(!1)}});break;case"godaddy":u=c.jsx(r8,{data:r,onAfterReq:()=>{i(!1)}});break}const d=f=>f==a?"border-primary":"";return c.jsxs(JE,{onOpenChange:i,open:s,children:[c.jsx(ej,{asChild:!0,className:pe(n),children:e}),c.jsxs(Wv,{className:"sm:max-w-[600px] w-full dark:text-stone-200",children:[c.jsx($v,{children:c.jsxs(Bv,{children:[t=="add"?"添加":"编辑","授权"]})}),c.jsx(Gv,{className:"max-h-[80vh]",children:c.jsxs("div",{className:"container py-3",children:[c.jsx(Uv,{children:"服务商"}),c.jsxs(el,{onValueChange:f=>{console.log(f),l(f)},defaultValue:a,children:[c.jsx(Mo,{className:"mt-3",children:c.jsx(rl,{placeholder:"请选择服务商"})}),c.jsx(Io,{children:c.jsxs(tl,{children:[c.jsx(Lo,{children:"服务商"}),o.map(f=>{var g,h;return c.jsx(Fo,{value:f,children:c.jsxs("div",{className:pe("flex items-center space-x-2 rounded cursor-pointer",d(f)),children:[c.jsx("img",{src:(g=zi.get(f))==null?void 0:g[1],className:"h-6 w-6"}),c.jsx("div",{children:(h=zi.get(f))==null?void 0:h[0]})]})},f)})]})})]}),u]})})]})]})}const n8=({className:e,trigger:t})=>{const{config:{emails:r},setEmails:n}=En(),[s,i]=x.useState(!1),o=we.object({email:we.string().email()}),a=tn({resolver:rn(o),defaultValues:{email:""}}),l=async u=>{if(r.content.emails.includes(u.email)){a.setError("email",{message:"邮箱已存在"});return}const d=[...r.content.emails,u.email];try{const f=await e3({...r,name:"emails",content:{emails:d}});n(f),a.reset(),a.clearErrors(),i(!1)}catch(f){Object.entries(f.response.data).forEach(([h,y])=>{a.setError(h,{type:"manual",message:y.message})})}};return c.jsxs(JE,{onOpenChange:i,open:s,children:[c.jsx(ej,{asChild:!0,className:pe(e),children:t}),c.jsxs(Wv,{className:"sm:max-w-[600px] w-full dark:text-stone-200",children:[c.jsx($v,{children:c.jsx(Bv,{children:"添加邮箱"})}),c.jsx("div",{className:"container py-3",children:c.jsx(nn,{...a,children:c.jsxs("form",{onSubmit:u=>{console.log(u),u.stopPropagation(),a.handleSubmit(l)(u)},className:"space-y-8",children:[c.jsx(Ae,{control:a.control,name:"email",render:({field:u})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"邮箱"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入邮箱",...u,type:"email"})}),c.jsx(ke,{})]})}),c.jsx("div",{className:"flex justify-end",children:c.jsx(at,{type:"submit",children:"保存"})})]})})})]})]})},s8=()=>{const{config:{accesses:e,emails:t}}=En(),[r,n]=x.useState(),s=Hn();x.useEffect(()=>{const y=new URLSearchParams(s.search).get("id");y&&(async()=>{const w=await R5(y);n(w)})()},[s.search]);const i=we.object({id:we.string().optional(),domain:we.string().regex(/^(?:\*\.)?([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}$/,{message:"请输入正确的域名"}),email:we.string().email().optional(),access:we.string().regex(/^[a-zA-Z0-9]+$/,{message:"请选择DNS服务商授权配置"}),targetAccess:we.string().regex(/^[a-zA-Z0-9]+$/,{message:"请选择部署服务商配置"}),targetType:we.string().regex(/^[a-zA-Z0-9-]+$/,{message:"请选择部署服务类型"})}),o=tn({resolver:rn(i),defaultValues:{id:"",domain:"",email:"",access:"",targetAccess:"",targetType:""}});x.useEffect(()=>{r&&o.reset({id:r.id,domain:r.domain,email:r.email,access:r.access,targetAccess:r.targetAccess,targetType:r.targetType})},[r,o]);const[a,l]=x.useState(r?r.targetType:""),u=e.filter(h=>{if(h.usage=="apply")return!1;if(a=="")return!0;const y=o.getValues().targetType.split("-");return h.configType===y[0]}),{toast:d}=Tf(),f=Sn(),g=async h=>{const y={id:h.id,crontab:"0 0 * * *",domain:h.domain,email:h.email,access:h.access,targetAccess:h.targetAccess,targetType:h.targetType};try{await sm(y);let m="域名编辑成功";y.id==""&&(m="域名添加成功"),d({title:"成功",description:m}),f("/domains")}catch(m){Object.entries(m.response.data).forEach(([v,p])=>{o.setError(v,{type:"manual",message:p.message})});return}};return c.jsx(c.Fragment,{children:c.jsxs("div",{className:"",children:[c.jsx(Pv,{}),c.jsxs("div",{className:"border-b dark:border-stone-500 h-10 text-muted-foreground",children:[r!=null&&r.id?"编辑":"新增","域名"]}),c.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:c.jsx(nn,{...o,children:c.jsxs("form",{onSubmit:o.handleSubmit(g),className:"space-y-8 dark:text-stone-200",children:[c.jsx(Ae,{control:o.control,name:"domain",render:({field:h})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"域名"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"请输入域名",...h})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"email",render:({field:h})=>c.jsxs(Te,{children:[c.jsxs(Ne,{className:"flex w-full justify-between",children:[c.jsx("div",{children:"Email(申请证书需要提供邮箱)"}),c.jsx(n8,{trigger:c.jsxs("div",{className:"font-normal text-primary hover:underline cursor-pointer flex items-center",children:[c.jsx(yh,{size:14}),"新增"]})})]}),c.jsx(Re,{children:c.jsxs(el,{...h,value:h.value,onValueChange:y=>{o.setValue("email",y)},children:[c.jsx(Mo,{children:c.jsx(rl,{placeholder:"请选择邮箱"})}),c.jsx(Io,{children:c.jsxs(tl,{children:[c.jsx(Lo,{children:"邮箱列表"}),t.content.emails.map(y=>c.jsx(Fo,{value:y,children:c.jsx("div",{children:y})},y))]})})]})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"access",render:({field:h})=>c.jsxs(Te,{children:[c.jsxs(Ne,{className:"flex w-full justify-between",children:[c.jsx("div",{children:"DNS 服务商授权配置"}),c.jsx(gl,{trigger:c.jsxs("div",{className:"font-normal text-primary hover:underline cursor-pointer flex items-center",children:[c.jsx(yh,{size:14}),"新增"]}),op:"add"})]}),c.jsx(Re,{children:c.jsxs(el,{...h,value:h.value,onValueChange:y=>{o.setValue("access",y)},children:[c.jsx(Mo,{children:c.jsx(rl,{placeholder:"请选择授权配置"})}),c.jsx(Io,{children:c.jsxs(tl,{children:[c.jsx(Lo,{children:"服务商授权配置"}),e.filter(y=>y.usage!="deploy").map(y=>{var m;return c.jsx(Fo,{value:y.id,children:c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx("img",{className:"w-6",src:(m=zi.get(y.configType))==null?void 0:m[1]}),c.jsx("div",{children:y.name})]})},y.id)})]})})]})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"targetType",render:({field:h})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"部署服务类型"}),c.jsx(Re,{children:c.jsxs(el,{...h,onValueChange:y=>{l(y),o.setValue("targetType",y)},children:[c.jsx(Mo,{children:c.jsx(rl,{placeholder:"请选择部署服务类型"})}),c.jsx(Io,{children:c.jsxs(tl,{children:[c.jsx(Lo,{children:"部署服务类型"}),Az.map(y=>{var m,w;return c.jsx(Fo,{value:y,children:c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx("img",{className:"w-6",src:(m=mm.get(y))==null?void 0:m[1]}),c.jsx("div",{children:(w=mm.get(y))==null?void 0:w[0]})]})},y)})]})})]})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:o.control,name:"targetAccess",render:({field:h})=>c.jsxs(Te,{children:[c.jsxs(Ne,{className:"w-full flex justify-between",children:[c.jsx("div",{children:"部署服务商授权配置"}),c.jsx(gl,{trigger:c.jsxs("div",{className:"font-normal text-primary hover:underline cursor-pointer flex items-center",children:[c.jsx(yh,{size:14}),"新增"]}),op:"add"})]}),c.jsx(Re,{children:c.jsxs(el,{...h,onValueChange:y=>{o.setValue("targetAccess",y)},children:[c.jsx(Mo,{children:c.jsx(rl,{placeholder:"请选择授权配置"})}),c.jsx(Io,{children:c.jsxs(tl,{children:[c.jsx(Lo,{children:"服务商授权配置"}),u.map(y=>{var m;return c.jsx(Fo,{value:y.id,children:c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx("img",{className:"w-6",src:(m=zi.get(y.configType))==null?void 0:m[1]}),c.jsx("div",{children:y.name})]})},y.id)})]})})]})}),c.jsx(ke,{})]})}),c.jsx("div",{className:"flex justify-end",children:c.jsx(at,{type:"submit",children:"保存"})})]})})})]})})},i8=()=>{const{config:e,deleteAccess:t}=En(),{accesses:r}=e,n=10,s=Math.ceil(r.length/n),i=Sn(),o=Hn(),a=new URLSearchParams(o.search),l=a.get("page"),u=l?Number(l):1,d=(u-1)*n,f=d+n,g=async h=>{const y=await XF(h);t(y.id)};return c.jsxs("div",{className:"",children:[c.jsxs("div",{className:"flex justify-between items-center",children:[c.jsx("div",{className:"text-muted-foreground",children:"授权管理"}),c.jsx(gl,{trigger:c.jsx(at,{children:"添加授权"}),op:"add"})]}),r.length===0?c.jsxs("div",{className:"flex flex-col items-center mt-10",children:[c.jsx("span",{className:"bg-orange-100 p-5 rounded-full",children:c.jsx($R,{size:40,className:"text-primary"})}),c.jsx("div",{className:"text-center text-sm text-muted-foreground mt-3",children:"请添加授权开始部署证书吧。"}),c.jsx(gl,{trigger:c.jsx(at,{children:"添加授权"}),op:"add",className:"mt-3"})]}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"hidden sm:flex sm:flex-row text-muted-foreground text-sm border-b dark:border-stone-500 sm:p-2 mt-5",children:[c.jsx("div",{className:"w-48",children:"名称"}),c.jsx("div",{className:"w-48",children:"服务商"}),c.jsx("div",{className:"w-52",children:"创建时间"}),c.jsx("div",{className:"w-52",children:"更新时间"}),c.jsx("div",{className:"grow",children:"操作"})]}),c.jsx("div",{className:"sm:hidden flex text-sm text-muted-foreground",children:"授权列表"}),r.slice(d,f).map(h=>{var y,m;return c.jsxs("div",{className:"flex flex-col sm:flex-row text-secondary-foreground border-b dark:border-stone-500 sm:p-2 hover:bg-muted/50 text-sm",children:[c.jsx("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center",children:h.name}),c.jsxs("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center space-x-2",children:[c.jsx("img",{src:(y=zi.get(h.configType))==null?void 0:y[1],className:"w-6"}),c.jsx("div",{children:(m=zi.get(h.configType))==null?void 0:m[0]})]}),c.jsxs("div",{className:"sm:w-52 w-full pt-1 sm:pt-0 flex items-center",children:["创建于 ",h.created&&ca(h.created)]}),c.jsxs("div",{className:"sm:w-52 w-full pt-1 sm:pt-0 flex items-center",children:["更新于 ",h.updated&&ca(h.updated)]}),c.jsxs("div",{className:"flex items-center grow justify-start pt-1 sm:pt-0",children:[c.jsx(gl,{trigger:c.jsx(at,{variant:"link",className:"p-0",children:"编辑"}),op:"edit",data:h}),c.jsx(Yt,{orientation:"vertical",className:"h-4 mx-2"}),c.jsx(at,{variant:"link",className:"p-0",onClick:()=>{g(h)},children:"删除"})]})]},h.id)}),c.jsx(kk,{totalPages:s,currentPage:u,onPageChange:h=>{a.set("page",h.toString()),i({search:a.toString()})}})]})]})},o8=uc("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),qv=x.forwardRef(({className:e,variant:t,...r},n)=>c.jsx("div",{ref:n,role:"alert",className:pe(o8({variant:t}),e),...r}));qv.displayName="Alert";const Xv=x.forwardRef(({className:e,...t},r)=>c.jsx("h5",{ref:r,className:pe("mb-1 font-medium leading-none tracking-tight",e),...t}));Xv.displayName="AlertTitle";const Qv=x.forwardRef(({className:e,...t},r)=>c.jsx("div",{ref:r,className:pe("text-sm [&_p]:leading-relaxed",e),...t}));Qv.displayName="AlertDescription";const vj=async e=>{let t=1;e.page&&(t=e.page);let r=50;e.perPage&&(r=e.perPage);let n="domain!=null";return e.domain&&(n=`domain="${e.domain}"`),await xt().collection("deployments").getList(t,r,{filter:n,sort:"-deployedAt",expand:"domain"})},a8=()=>{const e=Sn(),[t,r]=x.useState(),[n]=PR(),s=n.get("domain");return x.useEffect(()=>{(async()=>{const o={};s&&(o.domain=s);const a=await vj(o);r(a.items)})()},[s]),c.jsxs(Gv,{className:"h-[80vh] overflow-hidden",children:[c.jsx("div",{className:"text-muted-foreground",children:"部署历史"}),t!=null&&t.length?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"hidden sm:flex sm:flex-row text-muted-foreground text-sm border-b dark:border-stone-500 sm:p-2 mt-5",children:[c.jsx("div",{className:"w-48",children:"域名"}),c.jsx("div",{className:"w-24",children:"状态"}),c.jsx("div",{className:"w-56",children:"阶段"}),c.jsx("div",{className:"w-56 sm:ml-2 text-center",children:"最近执行时间"}),c.jsx("div",{className:"grow",children:"操作"})]}),c.jsx("div",{className:"sm:hidden flex text-sm text-muted-foreground",children:"部署历史"}),t==null?void 0:t.map(i=>{var o,a;return c.jsxs("div",{className:"flex flex-col sm:flex-row text-secondary-foreground border-b dark:border-stone-500 sm:p-2 hover:bg-muted/50 text-sm",children:[c.jsx("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center",children:(o=i.expand.domain)==null?void 0:o.domain}),c.jsx("div",{className:"sm:w-24 w-full pt-1 sm:pt-0 flex items-center",children:i.phase==="deploy"&&i.phaseSuccess?c.jsx(vg,{size:16,className:"text-green-700"}):c.jsx(yg,{size:16,className:"text-red-700"})}),c.jsx("div",{className:"sm:w-56 w-full pt-1 sm:pt-0 flex items-center",children:c.jsx(Ev,{phase:i.phase,phaseSuccess:i.phaseSuccess})}),c.jsx("div",{className:"sm:w-56 w-full pt-1 sm:pt-0 flex items-center sm:justify-center",children:ca(i.deployedAt)}),c.jsx("div",{className:"flex items-center grow justify-start pt-1 sm:pt-0 sm:ml-2",children:c.jsxs(Jg,{children:[c.jsx(ev,{asChild:!0,children:c.jsx(at,{variant:"link",className:"p-0",children:"日志"})}),c.jsxs(pf,{className:"sm:max-w-5xl",children:[c.jsx(tv,{children:c.jsxs(rv,{children:[(a=i.expand.domain)==null?void 0:a.domain,"-",i.id,"部署详情"]})}),c.jsxs("div",{className:"bg-gray-950 text-stone-100 p-5 text-sm h-[80dvh]",children:[i.log.check&&c.jsx(c.Fragment,{children:i.log.check.map(l=>c.jsxs("div",{className:"flex flex-col mt-2",children:[c.jsxs("div",{className:"flex",children:[c.jsxs("div",{children:["[",l.time,"]"]}),c.jsx("div",{className:"ml-2",children:l.message})]}),l.error&&c.jsx("div",{className:"mt-1 text-red-600",children:l.error})]}))}),i.log.apply&&c.jsx(c.Fragment,{children:i.log.apply.map(l=>c.jsxs("div",{className:"flex flex-col mt-2",children:[c.jsxs("div",{className:"flex",children:[c.jsxs("div",{children:["[",l.time,"]"]}),c.jsx("div",{className:"ml-2",children:l.message})]}),l.info&&l.info.map(u=>c.jsx("div",{className:"mt-1 text-green-600",children:u})),l.error&&c.jsx("div",{className:"mt-1 text-red-600",children:l.error})]}))}),i.log.deploy&&c.jsx(c.Fragment,{children:i.log.deploy.map(l=>c.jsxs("div",{className:"flex flex-col mt-2",children:[c.jsxs("div",{className:"flex",children:[c.jsxs("div",{children:["[",l.time,"]"]}),c.jsx("div",{className:"ml-2",children:l.message})]}),l.error&&c.jsx("div",{className:"mt-1 text-red-600",children:l.error})]}))})]})]})]})})]},i.id)})]}):c.jsx(c.Fragment,{children:c.jsxs(qv,{className:"max-w-[40em] mx-auto mt-20",children:[c.jsx(Xv,{children:"暂无数据"}),c.jsxs(Qv,{children:[c.jsxs("div",{className:"flex items-center mt-5",children:[c.jsx("div",{children:c.jsx(p1,{className:"text-yellow-400",size:36})}),c.jsxs("div",{className:"ml-2",children:[" ","你暂未创建任何部署,请先添加域名进行部署吧!"]})]}),c.jsx("div",{className:"mt-2 flex justify-end",children:c.jsx(at,{onClick:()=>{e("/")},children:"添加域名"})})]})]})})]})},gm=e=>e instanceof Error?e.message:typeof e=="object"&&e!==null&&"message"in e?String(e.message):typeof e=="string"?e:"Something went wrong",l8=we.object({username:we.string().email({message:"请输入正确的邮箱地址"}),password:we.string().min(10,{message:"密码至少10个字符"})}),c8=()=>{const e=tn({resolver:rn(l8),defaultValues:{username:"",password:""}}),t=async n=>{try{await xt().admins.authWithPassword(n.username,n.password),r("/")}catch(s){const i=gm(s);e.setError("username",{message:i}),e.setError("password",{message:i})}},r=Sn();return c.jsxs("div",{className:"max-w-[35em] border dark:border-stone-500 mx-auto mt-32 p-10 rounded-md shadow-md",children:[c.jsx("div",{className:"flex justify-center mb-10",children:c.jsx("img",{src:"/vite.svg",className:"w-16"})}),c.jsx(nn,{...e,children:c.jsxs("form",{onSubmit:e.handleSubmit(t),className:"space-y-8 dark:text-stone-200",children:[c.jsx(Ae,{control:e.control,name:"username",render:({field:n})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"用户名"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"email",...n})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:e.control,name:"password",render:({field:n})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"密码"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"shadcn",...n,type:"password"})}),c.jsx(ke,{})]})}),c.jsx("div",{className:"flex justify-end",children:c.jsx(at,{type:"submit",children:"登录"})})]})})]})},u8=()=>xt().authStore.isValid&&xt().authStore.isAdmin?c.jsx(u1,{to:"/"}):c.jsx("div",{className:"container",children:c.jsx(gg,{})}),d8=we.object({oldPassword:we.string().min(10,{message:"密码至少10个字符"}),newPassword:we.string().min(10,{message:"密码至少10个字符"}),confirmPassword:we.string().min(10,{message:"密码至少10个字符"})}).refine(e=>e.newPassword===e.confirmPassword,{message:"两次密码不一致",path:["confirmPassword"]}),f8=()=>{const{toast:e}=Tf(),t=Sn(),r=tn({resolver:rn(d8),defaultValues:{oldPassword:"",newPassword:"",confirmPassword:""}}),n=async s=>{var i,o;try{await xt().admins.authWithPassword((i=xt().authStore.model)==null?void 0:i.email,s.oldPassword)}catch(a){const l=gm(a);r.setError("oldPassword",{message:l})}try{await xt().admins.update((o=xt().authStore.model)==null?void 0:o.id,{password:s.newPassword,passwordConfirm:s.confirmPassword}),xt().authStore.clear(),e({title:"修改密码成功",description:"请重新登录"}),setTimeout(()=>{t("/login")},500)}catch(a){const l=gm(a);e({title:"修改密码失败",description:l,variant:"destructive"})}};return c.jsx(c.Fragment,{children:c.jsx(nn,{...r,children:c.jsxs("form",{onSubmit:r.handleSubmit(n),className:"space-y-8 dark:text-stone-200",children:[c.jsx(Ae,{control:r.control,name:"oldPassword",render:({field:s})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"当前密码"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"当前密码",...s,type:"password"})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:r.control,name:"newPassword",render:({field:s})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"新密码"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"newPassword",...s,type:"password"})}),c.jsx(ke,{})]})}),c.jsx(Ae,{control:r.control,name:"confirmPassword",render:({field:s})=>c.jsxs(Te,{children:[c.jsx(Ne,{children:"确认密码"}),c.jsx(Re,{children:c.jsx(Fe,{placeholder:"confirmPassword",...s,type:"password"})}),c.jsx(ke,{})]})}),c.jsx("div",{className:"flex justify-end",children:c.jsx(at,{type:"submit",children:"确认修改"})})]})})})},h8=()=>c.jsxs("div",{children:[c.jsx(Pv,{}),c.jsx("div",{className:"text-muted-foreground border-b dark:border-stone-500 py-5",children:"设置密码"}),c.jsx("div",{className:"w-full sm:w-[35em] mt-10 flex flex-col p-3 mx-auto",children:c.jsx(gg,{})})]}),p8=()=>{const[e,t]=x.useState(),[r,n]=x.useState(),s=Sn();return x.useEffect(()=>{(async()=>{const o=await N5();t(o)})()},[]),x.useEffect(()=>{(async()=>{const a=await vj({perPage:8});n(a.items)})()},[]),c.jsxs("div",{className:"flex flex-col",children:[c.jsx("div",{className:"flex justify-between items-center",children:c.jsx("div",{className:"text-muted-foreground",children:"控制面板"})}),c.jsxs("div",{className:"flex mt-10 gap-5 flex-col flex-wrap md:flex-row",children:[c.jsxs("div",{className:"w-full md:w-[250px] 3xl:w-[300px] flex items-center rounded-md p-3 shadow-lg border",children:[c.jsx("div",{className:"p-3",children:c.jsx(ZR,{size:48,strokeWidth:1,className:"text-blue-400"})}),c.jsxs("div",{children:[c.jsx("div",{className:"text-muted-foreground font-semibold",children:"所有"}),c.jsxs("div",{className:"flex items-baseline",children:[c.jsx("div",{className:"text-3xl text-stone-700 dark:text-stone-200",children:e!=null&&e.total?c.jsx(dr,{to:"/domains",className:"hover:underline",children:e==null?void 0:e.total}):0}),c.jsx("div",{className:"ml-1 text-stone-700 dark:text-stone-200",children:"个"})]})]})]}),c.jsxs("div",{className:"w-full md:w-[250px] 3xl:w-[300px] flex items-center rounded-md p-3 shadow-lg border",children:[c.jsx("div",{className:"p-3",children:c.jsx(LR,{size:48,strokeWidth:1,className:"text-red-400"})}),c.jsxs("div",{children:[c.jsx("div",{className:"text-muted-foreground font-semibold",children:"即将过期"}),c.jsxs("div",{className:"flex items-baseline",children:[c.jsx("div",{className:"text-3xl text-stone-700 dark:text-stone-200",children:e!=null&&e.expired?c.jsx(dr,{to:"/domains?state=expired",className:"hover:underline",children:e==null?void 0:e.expired}):0}),c.jsx("div",{className:"ml-1 text-stone-700 dark:text-stone-200",children:"个"})]})]})]}),c.jsxs("div",{className:"border w-full md:w-[250px] 3xl:w-[300px] flex items-center rounded-md p-3 shadow-lg",children:[c.jsx("div",{className:"p-3",children:c.jsx(BR,{size:48,strokeWidth:1,className:"text-green-400"})}),c.jsxs("div",{children:[c.jsx("div",{className:"text-muted-foreground font-semibold",children:"启用中"}),c.jsxs("div",{className:"flex items-baseline",children:[c.jsx("div",{className:"text-3xl text-stone-700 dark:text-stone-200",children:e!=null&&e.enabled?c.jsx(dr,{to:"/domains?state=enabled",className:"hover:underline",children:e==null?void 0:e.enabled}):0}),c.jsx("div",{className:"ml-1 text-stone-700 dark:text-stone-200",children:"个"})]})]})]}),c.jsxs("div",{className:"border w-full md:w-[250px] 3xl:w-[300px] flex items-center rounded-md p-3 shadow-lg",children:[c.jsx("div",{className:"p-3",children:c.jsx(MR,{size:48,strokeWidth:1,className:"text-gray-400"})}),c.jsxs("div",{children:[c.jsx("div",{className:"text-muted-foreground font-semibold",children:"未启用"}),c.jsxs("div",{className:"flex items-baseline",children:[c.jsx("div",{className:"text-3xl text-stone-700 dark:text-stone-200",children:e!=null&&e.disabled?c.jsx(dr,{to:"/domains?state=disabled",className:"hover:underline",children:e==null?void 0:e.disabled}):0}),c.jsx("div",{className:"ml-1 text-stone-700 dark:text-stone-200",children:"个"})]})]})]})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-muted-foreground mt-5 text-sm",children:"部署历史"}),(r==null?void 0:r.length)==0?c.jsx(c.Fragment,{children:c.jsxs(qv,{className:"max-w-[40em] mt-10",children:[c.jsx(Xv,{children:"暂无数据"}),c.jsxs(Qv,{children:[c.jsxs("div",{className:"flex items-center mt-5",children:[c.jsx("div",{children:c.jsx(p1,{className:"text-yellow-400",size:36})}),c.jsxs("div",{className:"ml-2",children:[" ","你暂未创建任何部署,请先添加域名进行部署吧!"]})]}),c.jsx("div",{className:"mt-2 flex justify-end",children:c.jsx(at,{onClick:()=>{s("/edit")},children:"添加域名"})})]})]})}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"hidden sm:flex sm:flex-row text-muted-foreground text-sm border-b dark:border-stone-500 sm:p-2 mt-5",children:[c.jsx("div",{className:"w-48",children:"域名"}),c.jsx("div",{className:"w-24",children:"状态"}),c.jsx("div",{className:"w-56",children:"阶段"}),c.jsx("div",{className:"w-56 sm:ml-2 text-center",children:"最近执行时间"}),c.jsx("div",{className:"grow",children:"操作"})]}),c.jsx("div",{className:"sm:hidden flex text-sm text-muted-foreground",children:"部署历史"}),r==null?void 0:r.map(i=>{var o,a;return c.jsxs("div",{className:"flex flex-col sm:flex-row text-secondary-foreground border-b dark:border-stone-500 sm:p-2 hover:bg-muted/50 text-sm",children:[c.jsx("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center",children:(o=i.expand.domain)==null?void 0:o.domain}),c.jsx("div",{className:"sm:w-24 w-full pt-1 sm:pt-0 flex items-center",children:i.phase==="deploy"&&i.phaseSuccess?c.jsx(vg,{size:16,className:"text-green-700"}):c.jsx(yg,{size:16,className:"text-red-700"})}),c.jsx("div",{className:"sm:w-56 w-full pt-1 sm:pt-0 flex items-center",children:c.jsx(Ev,{phase:i.phase,phaseSuccess:i.phaseSuccess})}),c.jsx("div",{className:"sm:w-56 w-full pt-1 sm:pt-0 flex items-center sm:justify-center",children:ca(i.deployedAt)}),c.jsx("div",{className:"flex items-center grow justify-start pt-1 sm:pt-0 sm:ml-2",children:c.jsxs(Jg,{children:[c.jsx(ev,{asChild:!0,children:c.jsx(at,{variant:"link",className:"p-0",children:"日志"})}),c.jsxs(pf,{className:"sm:max-w-5xl",children:[c.jsx(tv,{children:c.jsxs(rv,{children:[(a=i.expand.domain)==null?void 0:a.domain,"-",i.id,"部署详情"]})}),c.jsxs("div",{className:"bg-gray-950 text-stone-100 p-5 text-sm h-[80dvh]",children:[i.log.check&&c.jsx(c.Fragment,{children:i.log.check.map(l=>c.jsxs("div",{className:"flex flex-col mt-2",children:[c.jsxs("div",{className:"flex",children:[c.jsxs("div",{children:["[",l.time,"]"]}),c.jsx("div",{className:"ml-2",children:l.message})]}),l.error&&c.jsx("div",{className:"mt-1 text-red-600",children:l.error})]}))}),i.log.apply&&c.jsx(c.Fragment,{children:i.log.apply.map(l=>c.jsxs("div",{className:"flex flex-col mt-2",children:[c.jsxs("div",{className:"flex",children:[c.jsxs("div",{children:["[",l.time,"]"]}),c.jsx("div",{className:"ml-2",children:l.message})]}),l.info&&l.info.map(u=>c.jsx("div",{className:"mt-1 text-green-600",children:u})),l.error&&c.jsx("div",{className:"mt-1 text-red-600",children:l.error})]}))}),i.log.deploy&&c.jsx(c.Fragment,{children:i.log.deploy.map(l=>c.jsxs("div",{className:"flex flex-col mt-2",children:[c.jsxs("div",{className:"flex",children:[c.jsxs("div",{children:["[",l.time,"]"]}),c.jsx("div",{className:"ml-2",children:l.message})]}),l.error&&c.jsx("div",{className:"mt-1 text-red-600",children:l.error})]}))})]})]})]})})]},i.id)})]})]})]})},m8=gR([{path:"/",element:c.jsx(c3,{}),children:[{path:"/",element:c.jsx(p8,{})},{path:"/domains",element:c.jsx(O5,{})},{path:"/edit",element:c.jsx(s8,{})},{path:"/access",element:c.jsx(i8,{})},{path:"/history",element:c.jsx(a8,{})},{path:"/setting",element:c.jsx(h8,{}),children:[{path:"/setting/password",element:c.jsx(f8,{})}]}]},{path:"/login",element:c.jsx(u8,{}),children:[{path:"/login",element:c.jsx(c8,{})}]},{path:"/about",element:c.jsx("div",{children:"About"})}]);Uh.createRoot(document.getElementById("root")).render(c.jsx(et.StrictMode,{children:c.jsx(n3,{defaultTheme:"dark",storageKey:"vite-ui-theme",children:c.jsx(CR,{router:m8})})}))});export default g8(); diff --git a/ui/dist/index.html b/ui/dist/index.html index 554a80d1..43e1a8d6 100644 --- a/ui/dist/index.html +++ b/ui/dist/index.html @@ -5,7 +5,7 @@ Certimate - Your Trusted SSL Automation Partner - + diff --git a/ui/src/pages/dashboard/Dashboard.tsx b/ui/src/pages/dashboard/Dashboard.tsx index 7d9e10f3..5e3da9e9 100644 --- a/ui/src/pages/dashboard/Dashboard.tsx +++ b/ui/src/pages/dashboard/Dashboard.tsx @@ -171,7 +171,7 @@ const Dashboard = () => {