From 71f43c5bd45f40ddc5e8a448f4cf93d613f45516 Mon Sep 17 00:00:00 2001 From: Fu Diwei Date: Wed, 16 Oct 2024 12:30:15 +0800 Subject: [PATCH] feat: support ssh key passphrase --- internal/deployer/ssh.go | 33 +- .../{index-C9iolg9g.js => index-DIhd7QG6.js} | 6 +- ui/dist/assets/index-DipHpsma.js | 324 ------------------ ui/dist/index.html | 6 +- ui/src/components/certimate/AccessSSHForm.tsx | 34 +- ui/src/domain/access.ts | 1 + ui/src/i18n/locales/en/nls.access.json | 8 +- ui/src/i18n/locales/zh/nls.access.json | 7 +- 8 files changed, 70 insertions(+), 349 deletions(-) rename ui/dist/assets/{index-C9iolg9g.js => index-DIhd7QG6.js} (80%) delete mode 100644 ui/dist/assets/index-DipHpsma.js diff --git a/internal/deployer/ssh.go b/internal/deployer/ssh.go index a534b5f6..635a0639 100644 --- a/internal/deployer/ssh.go +++ b/internal/deployer/ssh.go @@ -18,11 +18,12 @@ type ssh struct { } type sshAccess struct { - Host string `json:"host"` - Username string `json:"username"` - Password string `json:"password"` - Key string `json:"key"` - Port string `json:"port"` + Host string `json:"host"` + Port string `json:"port"` + Username string `json:"username"` + Password string `json:"password"` + Key string `json:"key"` + KeyPassphrase string `json:"keyPassphrase"` } func NewSSH(option *DeployerOption) (Deployer, error) { @@ -45,6 +46,7 @@ func (s *ssh) Deploy(ctx context.Context) error { if err := json.Unmarshal([]byte(s.option.Access), access); err != nil { return err } + // 连接 client, err := s.getClient(access) if err != nil { @@ -57,7 +59,7 @@ func (s *ssh) Deploy(ctx context.Context) error { // 执行前置命令 preCommand := getDeployString(s.option.DeployConfig, "preCommand") if preCommand != "" { - err, stdout, stderr := s.sshExecCommand(client, preCommand) + stdout, stderr, err := s.sshExecCommand(client, preCommand) if err != nil { return fmt.Errorf("failed to run pre-command: %w, stdout: %s, stderr: %s", err, stdout, stderr) } @@ -78,7 +80,7 @@ func (s *ssh) Deploy(ctx context.Context) error { s.infos = append(s.infos, toStr("ssh上传私钥成功", nil)) // 执行命令 - err, stdout, stderr := s.sshExecCommand(client, getDeployString(s.option.DeployConfig, "command")) + stdout, stderr, err := s.sshExecCommand(client, getDeployString(s.option.DeployConfig, "command")) if err != nil { return fmt.Errorf("failed to run command: %w, stdout: %s, stderr: %s", err, stdout, stderr) } @@ -88,18 +90,19 @@ func (s *ssh) Deploy(ctx context.Context) error { return nil } -func (s *ssh) sshExecCommand(client *sshPkg.Client, command string) (error, string, string) { +func (s *ssh) sshExecCommand(client *sshPkg.Client, command string) (string, string, error) { session, err := client.NewSession() if err != nil { - return fmt.Errorf("failed to create ssh session: %w", err), "", "" + return "", "", fmt.Errorf("failed to create ssh session: %w", err) } + defer session.Close() var stdoutBuf bytes.Buffer session.Stdout = &stdoutBuf var stderrBuf bytes.Buffer session.Stderr = &stderrBuf err = session.Run(command) - return err, stdoutBuf.String(), stderrBuf.String() + return stdoutBuf.String(), stderrBuf.String(), err } func (s *ssh) upload(client *sshPkg.Client, content, path string) error { @@ -131,7 +134,15 @@ func (s *ssh) getClient(access *sshAccess) (*sshPkg.Client, error) { var authMethod sshPkg.AuthMethod if access.Key != "" { - signer, err := sshPkg.ParsePrivateKey([]byte(access.Key)) + var signer sshPkg.Signer + var err error + + if access.KeyPassphrase != "" { + signer, err = sshPkg.ParsePrivateKeyWithPassphrase([]byte(access.Key), []byte(access.KeyPassphrase)) + } else { + signer, err = sshPkg.ParsePrivateKey([]byte(access.Key)) + } + if err != nil { return nil, err } diff --git a/ui/dist/assets/index-C9iolg9g.js b/ui/dist/assets/index-DIhd7QG6.js similarity index 80% rename from ui/dist/assets/index-C9iolg9g.js rename to ui/dist/assets/index-DIhd7QG6.js index ae63a915..9bc1ce10 100644 --- a/ui/dist/assets/index-C9iolg9g.js +++ b/ui/dist/assets/index-DIhd7QG6.js @@ -303,8 +303,8 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do var dj;function xe(){return dj.apply(null,arguments)}function x4(e){dj=e}function Ar(e){return e instanceof Array||Object.prototype.toString.call(e)==="[object Array]"}function ni(e){return e!=null&&Object.prototype.toString.call(e)==="[object Object]"}function dt(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Zv(e){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(e).length===0;var t;for(t in e)if(dt(e,t))return!1;return!0}function Nn(e){return e===void 0}function zs(e){return typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]"}function cu(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function fj(e,t){var n=[],r,s=e.length;for(r=0;r>>0,r;for(r=0;r0)for(n=0;n=0;return(o?n?"+":"":"-")+Math.pow(10,Math.max(0,s)).toString().substr(1)+r}var Jv=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Qu=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,ep={},ba={};function Le(e,t,n,r){var s=r;typeof r=="string"&&(s=function(){return this[r]()}),e&&(ba[e]=s),t&&(ba[t[0]]=function(){return ns(s.apply(this,arguments),t[1],t[2])}),n&&(ba[n]=function(){return this.localeData().ordinal(s.apply(this,arguments),e)})}function k4(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function C4(e){var t=e.match(Jv),n,r;for(n=0,r=t.length;n=0&&Qu.test(e);)e=e.replace(Qu,r),Qu.lastIndex=0,n-=1;return e}var j4={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function E4(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(Jv).map(function(r){return r==="MMMM"||r==="MM"||r==="DD"||r==="dddd"?r.slice(1):r}).join(""),this._longDateFormat[e])}var N4="Invalid date";function T4(){return this._invalidDate}var P4="%d",R4=/\d{1,2}/;function A4(e){return this._ordinal.replace("%d",e)}var D4={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function O4(e,t,n,r){var s=this._relativeTime[n];return is(s)?s(e,t,n,r):s.replace(/%d/i,e)}function I4(e,t){var n=this._relativeTime[e>0?"future":"past"];return is(n)?n(t):n.replace(/%s/i,t)}var Cb={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function mr(e){return typeof e=="string"?Cb[e]||Cb[e.toLowerCase()]:void 0}function ex(e){var t={},n,r;for(r in e)dt(e,r)&&(n=mr(r),n&&(t[n]=e[r]));return t}var M4={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function L4(e){var t=[],n;for(n in e)dt(e,n)&&t.push({unit:n,priority:M4[n]});return t.sort(function(r,s){return r.priority-s.priority}),t}var gj=/\d/,er=/\d\d/,yj=/\d{3}/,tx=/\d{4}/,_h=/[+-]?\d{6}/,jt=/\d\d?/,vj=/\d\d\d\d?/,xj=/\d\d\d\d\d\d?/,Sh=/\d{1,3}/,nx=/\d{1,4}/,kh=/[+-]?\d{1,6}/,rl=/\d+/,Ch=/[+-]?\d+/,z4=/Z|[+-]\d\d:?\d\d/gi,jh=/Z|[+-]\d\d(?::?\d\d)?/gi,F4=/[+-]?\d+(\.\d{1,3})?/,du=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,sl=/^[1-9]\d?/,rx=/^([1-9]\d|\d)/,cf;cf={};function Ee(e,t,n){cf[e]=is(t)?t:function(r,s){return r&&n?n:t}}function $4(e,t){return dt(cf,e)?cf[e](t._strict,t._locale):new RegExp(U4(e))}function U4(e){return Ts(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,n,r,s,o){return n||r||s||o}))}function Ts(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function or(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function rt(e){var t=+e,n=0;return t!==0&&isFinite(t)&&(n=or(t)),n}var jg={};function vt(e,t){var n,r=t,s;for(typeof e=="string"&&(e=[e]),zs(t)&&(r=function(o,i){i[t]=rt(o)}),s=e.length,n=0;n68?1900:2e3)};var wj=ol("FullYear",!0);function H4(){return Eh(this.year())}function ol(e,t){return function(n){return n!=null?(bj(this,e,n),xe.updateOffset(this,t),this):jc(this,e)}}function jc(e,t){if(!e.isValid())return NaN;var n=e._d,r=e._isUTC;switch(t){case"Milliseconds":return r?n.getUTCMilliseconds():n.getMilliseconds();case"Seconds":return r?n.getUTCSeconds():n.getSeconds();case"Minutes":return r?n.getUTCMinutes():n.getMinutes();case"Hours":return r?n.getUTCHours():n.getHours();case"Date":return r?n.getUTCDate():n.getDate();case"Day":return r?n.getUTCDay():n.getDay();case"Month":return r?n.getUTCMonth():n.getMonth();case"FullYear":return r?n.getUTCFullYear():n.getFullYear();default:return NaN}}function bj(e,t,n){var r,s,o,i,a;if(!(!e.isValid()||isNaN(n))){switch(r=e._d,s=e._isUTC,t){case"Milliseconds":return void(s?r.setUTCMilliseconds(n):r.setMilliseconds(n));case"Seconds":return void(s?r.setUTCSeconds(n):r.setSeconds(n));case"Minutes":return void(s?r.setUTCMinutes(n):r.setMinutes(n));case"Hours":return void(s?r.setUTCHours(n):r.setHours(n));case"Date":return void(s?r.setUTCDate(n):r.setDate(n));case"FullYear":break;default:return}o=n,i=e.month(),a=e.date(),a=a===29&&i===1&&!Eh(o)?28:a,s?r.setUTCFullYear(o,i,a):r.setFullYear(o,i,a)}}function Y4(e){return e=mr(e),is(this[e])?this[e]():this}function K4(e,t){if(typeof e=="object"){e=ex(e);var n=L4(e),r,s=n.length;for(r=0;r=0?(a=new Date(e+400,t,n,r,s,o,i),isFinite(a.getFullYear())&&a.setFullYear(e)):a=new Date(e,t,n,r,s,o,i),a}function Ec(e){var t,n;return e<100&&e>=0?(n=Array.prototype.slice.call(arguments),n[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function uf(e,t,n){var r=7+t-n,s=(7+Ec(e,0,r).getUTCDay()-t)%7;return-s+r-1}function Ej(e,t,n,r,s){var o=(7+n-r)%7,i=uf(e,r,s),a=1+7*(t-1)+o+i,c,u;return a<=0?(c=e-1,u=Xl(c)+a):a>Xl(e)?(c=e+1,u=a-Xl(e)):(c=e,u=a),{year:c,dayOfYear:u}}function Nc(e,t,n){var r=uf(e.year(),t,n),s=Math.floor((e.dayOfYear()-r-1)/7)+1,o,i;return s<1?(i=e.year()-1,o=s+Ps(i,t,n)):s>Ps(e.year(),t,n)?(o=s-Ps(e.year(),t,n),i=e.year()+1):(i=e.year(),o=s),{week:o,year:i}}function Ps(e,t,n){var r=uf(e,t,n),s=uf(e+1,t,n);return(Xl(e)-r+s)/7}Le("w",["ww",2],"wo","week");Le("W",["WW",2],"Wo","isoWeek");Ee("w",jt,sl);Ee("ww",jt,er);Ee("W",jt,sl);Ee("WW",jt,er);fu(["w","ww","W","WW"],function(e,t,n,r){t[r.substr(0,1)]=rt(e)});function i3(e){return Nc(e,this._week.dow,this._week.doy).week}var a3={dow:0,doy:6};function l3(){return this._week.dow}function c3(){return this._week.doy}function u3(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,"d")}function d3(e){var t=Nc(this,1,4).week;return e==null?t:this.add((e-t)*7,"d")}Le("d",0,"do","day");Le("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)});Le("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)});Le("dddd",0,0,function(e){return this.localeData().weekdays(this,e)});Le("e",0,0,"weekday");Le("E",0,0,"isoWeekday");Ee("d",jt);Ee("e",jt);Ee("E",jt);Ee("dd",function(e,t){return t.weekdaysMinRegex(e)});Ee("ddd",function(e,t){return t.weekdaysShortRegex(e)});Ee("dddd",function(e,t){return t.weekdaysRegex(e)});fu(["dd","ddd","dddd"],function(e,t,n,r){var s=n._locale.weekdaysParse(e,r,n._strict);s!=null?t.d=s:Qe(n).invalidWeekday=e});fu(["d","e","E"],function(e,t,n,r){t[r]=rt(e)});function f3(e,t){return typeof e!="string"?e:isNaN(e)?(e=t.weekdaysParse(e),typeof e=="number"?e:null):parseInt(e,10)}function h3(e,t){return typeof e=="string"?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function ox(e,t){return e.slice(t,7).concat(e.slice(0,t))}var m3="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Nj="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),p3="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),g3=du,y3=du,v3=du;function x3(e,t){var n=Ar(this._weekdays)?this._weekdays:this._weekdays[e&&e!==!0&&this._weekdays.isFormat.test(t)?"format":"standalone"];return e===!0?ox(n,this._week.dow):e?n[e.day()]:n}function w3(e){return e===!0?ox(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function b3(e){return e===!0?ox(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function _3(e,t,n){var r,s,o,i=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)o=os([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(o,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(o,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(o,"").toLocaleLowerCase();return n?t==="dddd"?(s=$t.call(this._weekdaysParse,i),s!==-1?s:null):t==="ddd"?(s=$t.call(this._shortWeekdaysParse,i),s!==-1?s:null):(s=$t.call(this._minWeekdaysParse,i),s!==-1?s:null):t==="dddd"?(s=$t.call(this._weekdaysParse,i),s!==-1||(s=$t.call(this._shortWeekdaysParse,i),s!==-1)?s:(s=$t.call(this._minWeekdaysParse,i),s!==-1?s:null)):t==="ddd"?(s=$t.call(this._shortWeekdaysParse,i),s!==-1||(s=$t.call(this._weekdaysParse,i),s!==-1)?s:(s=$t.call(this._minWeekdaysParse,i),s!==-1?s:null)):(s=$t.call(this._minWeekdaysParse,i),s!==-1||(s=$t.call(this._weekdaysParse,i),s!==-1)?s:(s=$t.call(this._shortWeekdaysParse,i),s!==-1?s:null))}function S3(e,t,n){var r,s,o;if(this._weekdaysParseExact)return _3.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(s=os([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(s,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(s,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(s,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(o="^"+this.weekdays(s,"")+"|^"+this.weekdaysShort(s,"")+"|^"+this.weekdaysMin(s,""),this._weekdaysParse[r]=new RegExp(o.replace(".",""),"i")),n&&t==="dddd"&&this._fullWeekdaysParse[r].test(e))return r;if(n&&t==="ddd"&&this._shortWeekdaysParse[r].test(e))return r;if(n&&t==="dd"&&this._minWeekdaysParse[r].test(e))return r;if(!n&&this._weekdaysParse[r].test(e))return r}}function k3(e){if(!this.isValid())return e!=null?this:NaN;var t=jc(this,"Day");return e!=null?(e=f3(e,this.localeData()),this.add(e-t,"d")):t}function C3(e){if(!this.isValid())return e!=null?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return e==null?t:this.add(e-t,"d")}function j3(e){if(!this.isValid())return e!=null?this:NaN;if(e!=null){var t=h3(e,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function E3(e){return this._weekdaysParseExact?(dt(this,"_weekdaysRegex")||ix.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(dt(this,"_weekdaysRegex")||(this._weekdaysRegex=g3),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function N3(e){return this._weekdaysParseExact?(dt(this,"_weekdaysRegex")||ix.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(dt(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=y3),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function T3(e){return this._weekdaysParseExact?(dt(this,"_weekdaysRegex")||ix.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(dt(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=v3),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function ix(){function e(d,f){return f.length-d.length}var t=[],n=[],r=[],s=[],o,i,a,c,u;for(o=0;o<7;o++)i=os([2e3,1]).day(o),a=Ts(this.weekdaysMin(i,"")),c=Ts(this.weekdaysShort(i,"")),u=Ts(this.weekdays(i,"")),t.push(a),n.push(c),r.push(u),s.push(a),s.push(c),s.push(u);t.sort(e),n.sort(e),r.sort(e),s.sort(e),this._weekdaysRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+t.join("|")+")","i")}function ax(){return this.hours()%12||12}function P3(){return this.hours()||24}Le("H",["HH",2],0,"hour");Le("h",["hh",2],0,ax);Le("k",["kk",2],0,P3);Le("hmm",0,0,function(){return""+ax.apply(this)+ns(this.minutes(),2)});Le("hmmss",0,0,function(){return""+ax.apply(this)+ns(this.minutes(),2)+ns(this.seconds(),2)});Le("Hmm",0,0,function(){return""+this.hours()+ns(this.minutes(),2)});Le("Hmmss",0,0,function(){return""+this.hours()+ns(this.minutes(),2)+ns(this.seconds(),2)});function Tj(e,t){Le(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}Tj("a",!0);Tj("A",!1);function Pj(e,t){return t._meridiemParse}Ee("a",Pj);Ee("A",Pj);Ee("H",jt,rx);Ee("h",jt,sl);Ee("k",jt,sl);Ee("HH",jt,er);Ee("hh",jt,er);Ee("kk",jt,er);Ee("hmm",vj);Ee("hmmss",xj);Ee("Hmm",vj);Ee("Hmmss",xj);vt(["H","HH"],qt);vt(["k","kk"],function(e,t,n){var r=rt(e);t[qt]=r===24?0:r});vt(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e});vt(["h","hh"],function(e,t,n){t[qt]=rt(e),Qe(n).bigHour=!0});vt("hmm",function(e,t,n){var r=e.length-2;t[qt]=rt(e.substr(0,r)),t[kr]=rt(e.substr(r)),Qe(n).bigHour=!0});vt("hmmss",function(e,t,n){var r=e.length-4,s=e.length-2;t[qt]=rt(e.substr(0,r)),t[kr]=rt(e.substr(r,2)),t[js]=rt(e.substr(s)),Qe(n).bigHour=!0});vt("Hmm",function(e,t,n){var r=e.length-2;t[qt]=rt(e.substr(0,r)),t[kr]=rt(e.substr(r))});vt("Hmmss",function(e,t,n){var r=e.length-4,s=e.length-2;t[qt]=rt(e.substr(0,r)),t[kr]=rt(e.substr(r,2)),t[js]=rt(e.substr(s))});function R3(e){return(e+"").toLowerCase().charAt(0)==="p"}var A3=/[ap]\.?m?\.?/i,D3=ol("Hours",!0);function O3(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}var Rj={calendar:_4,longDateFormat:j4,invalidDate:N4,ordinal:P4,dayOfMonthOrdinalParse:R4,relativeTime:D4,months:Z4,monthsShort:_j,week:a3,weekdays:m3,weekdaysMin:p3,weekdaysShort:Nj,meridiemParse:A3},Tt={},kl={},Tc;function I3(e,t){var n,r=Math.min(e.length,t.length);for(n=0;n0;){if(s=Nh(o.slice(0,n).join("-")),s)return s;if(r&&r.length>=n&&I3(o,r)>=n-1)break;n--}t++}return Tc}function L3(e){return!!(e&&e.match("^[^/\\\\]*$"))}function Nh(e){var t=null,n;if(Tt[e]===void 0&&typeof Ed<"u"&&Ed&&Ed.exports&&L3(e))try{t=Tc._abbr,n=require,n("./locale/"+e),_o(t)}catch{Tt[e]=null}return Tt[e]}function _o(e,t){var n;return e&&(Nn(t)?n=Ys(e):n=lx(e,t),n?Tc=n:typeof console<"u"&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),Tc._abbr}function lx(e,t){if(t!==null){var n,r=Rj;if(t.abbr=e,Tt[e]!=null)mj("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),r=Tt[e]._config;else if(t.parentLocale!=null)if(Tt[t.parentLocale]!=null)r=Tt[t.parentLocale]._config;else if(n=Nh(t.parentLocale),n!=null)r=n._config;else return kl[t.parentLocale]||(kl[t.parentLocale]=[]),kl[t.parentLocale].push({name:e,config:t}),null;return Tt[e]=new Qv(kg(r,t)),kl[e]&&kl[e].forEach(function(s){lx(s.name,s.config)}),_o(e),Tt[e]}else return delete Tt[e],null}function z3(e,t){if(t!=null){var n,r,s=Rj;Tt[e]!=null&&Tt[e].parentLocale!=null?Tt[e].set(kg(Tt[e]._config,t)):(r=Nh(e),r!=null&&(s=r._config),t=kg(s,t),r==null&&(t.abbr=e),n=new Qv(t),n.parentLocale=Tt[e],Tt[e]=n),_o(e)}else Tt[e]!=null&&(Tt[e].parentLocale!=null?(Tt[e]=Tt[e].parentLocale,e===_o()&&_o(e)):Tt[e]!=null&&delete Tt[e]);return Tt[e]}function Ys(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return Tc;if(!Ar(e)){if(t=Nh(e),t)return t;e=[e]}return M3(e)}function F3(){return Cg(Tt)}function cx(e){var t,n=e._a;return n&&Qe(e).overflow===-2&&(t=n[Cs]<0||n[Cs]>11?Cs:n[Hr]<1||n[Hr]>sx(n[pn],n[Cs])?Hr:n[qt]<0||n[qt]>24||n[qt]===24&&(n[kr]!==0||n[js]!==0||n[qo]!==0)?qt:n[kr]<0||n[kr]>59?kr:n[js]<0||n[js]>59?js:n[qo]<0||n[qo]>999?qo:-1,Qe(e)._overflowDayOfYear&&(tHr)&&(t=Hr),Qe(e)._overflowWeeks&&t===-1&&(t=B4),Qe(e)._overflowWeekday&&t===-1&&(t=W4),Qe(e).overflow=t),e}var $3=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,U3=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,V3=/Z|[+-]\d\d(?::?\d\d)?/,Ju=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],tp=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],B3=/^\/?Date\((-?\d+)/i,W3=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,H3={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Aj(e){var t,n,r=e._i,s=$3.exec(r)||U3.exec(r),o,i,a,c,u=Ju.length,d=tp.length;if(s){for(Qe(e).iso=!0,t=0,n=u;tXl(i)||e._dayOfYear===0)&&(Qe(e)._overflowDayOfYear=!0),n=Ec(i,0,e._dayOfYear),e._a[Cs]=n.getUTCMonth(),e._a[Hr]=n.getUTCDate()),t=0;t<3&&e._a[t]==null;++t)e._a[t]=r[t]=s[t];for(;t<7;t++)e._a[t]=r[t]=e._a[t]==null?t===2?1:0:e._a[t];e._a[qt]===24&&e._a[kr]===0&&e._a[js]===0&&e._a[qo]===0&&(e._nextDay=!0,e._a[qt]=0),e._d=(e._useUTC?Ec:o3).apply(null,r),o=e._useUTC?e._d.getUTCDay():e._d.getDay(),e._tzm!=null&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[qt]=24),e._w&&typeof e._w.d<"u"&&e._w.d!==o&&(Qe(e).weekdayMismatch=!0)}}function J3(e){var t,n,r,s,o,i,a,c,u;t=e._w,t.GG!=null||t.W!=null||t.E!=null?(o=1,i=4,n=Hi(t.GG,e._a[pn],Nc(Ct(),1,4).year),r=Hi(t.W,1),s=Hi(t.E,1),(s<1||s>7)&&(c=!0)):(o=e._locale._week.dow,i=e._locale._week.doy,u=Nc(Ct(),o,i),n=Hi(t.gg,e._a[pn],u.year),r=Hi(t.w,u.week),t.d!=null?(s=t.d,(s<0||s>6)&&(c=!0)):t.e!=null?(s=t.e+o,(t.e<0||t.e>6)&&(c=!0)):s=o),r<1||r>Ps(n,o,i)?Qe(e)._overflowWeeks=!0:c!=null?Qe(e)._overflowWeekday=!0:(a=Ej(n,r,s,o,i),e._a[pn]=a.year,e._dayOfYear=a.dayOfYear)}xe.ISO_8601=function(){};xe.RFC_2822=function(){};function dx(e){if(e._f===xe.ISO_8601){Aj(e);return}if(e._f===xe.RFC_2822){Dj(e);return}e._a=[],Qe(e).empty=!0;var t=""+e._i,n,r,s,o,i,a=t.length,c=0,u,d;for(s=pj(e._f,e._locale).match(Jv)||[],d=s.length,n=0;n0&&Qe(e).unusedInput.push(i),t=t.slice(t.indexOf(r)+r.length),c+=r.length),ba[o]?(r?Qe(e).empty=!1:Qe(e).unusedTokens.push(o),V4(o,r,e)):e._strict&&!r&&Qe(e).unusedTokens.push(o);Qe(e).charsLeftOver=a-c,t.length>0&&Qe(e).unusedInput.push(t),e._a[qt]<=12&&Qe(e).bigHour===!0&&e._a[qt]>0&&(Qe(e).bigHour=void 0),Qe(e).parsedDateParts=e._a.slice(0),Qe(e).meridiem=e._meridiem,e._a[qt]=e5(e._locale,e._a[qt],e._meridiem),u=Qe(e).era,u!==null&&(e._a[pn]=e._locale.erasConvertYear(u,e._a[pn])),ux(e),cx(e)}function e5(e,t,n){var r;return n==null?t:e.meridiemHour!=null?e.meridiemHour(t,n):(e.isPM!=null&&(r=e.isPM(n),r&&t<12&&(t+=12),!r&&t===12&&(t=0)),t)}function t5(e){var t,n,r,s,o,i,a=!1,c=e._f.length;if(c===0){Qe(e).invalidFormat=!0,e._d=new Date(NaN);return}for(s=0;sthis?this:e:bh()});function Mj(e,t){var n,r;if(t.length===1&&Ar(t[0])&&(t=t[0]),!t.length)return Ct();for(n=t[0],r=1;rthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function _5(){if(!Nn(this._isDSTShifted))return this._isDSTShifted;var e={},t;return Xv(e,this),e=Oj(e),e._a?(t=e._isUTC?os(e._a):Ct(e._a),this._isDSTShifted=this.isValid()&&h5(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function S5(){return this.isValid()?!this._isUTC:!1}function k5(){return this.isValid()?this._isUTC:!1}function zj(){return this.isValid()?this._isUTC&&this._offset===0:!1}var C5=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,j5=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Lr(e,t){var n=e,r=null,s,o,i;return _d(e)?n={ms:e._milliseconds,d:e._days,M:e._months}:zs(e)||!isNaN(+e)?(n={},t?n[t]=+e:n.milliseconds=+e):(r=C5.exec(e))?(s=r[1]==="-"?-1:1,n={y:0,d:rt(r[Hr])*s,h:rt(r[qt])*s,m:rt(r[kr])*s,s:rt(r[js])*s,ms:rt(Eg(r[qo]*1e3))*s}):(r=j5.exec(e))?(s=r[1]==="-"?-1:1,n={y:Fo(r[2],s),M:Fo(r[3],s),w:Fo(r[4],s),d:Fo(r[5],s),h:Fo(r[6],s),m:Fo(r[7],s),s:Fo(r[8],s)}):n==null?n={}:typeof n=="object"&&("from"in n||"to"in n)&&(i=E5(Ct(n.from),Ct(n.to)),n={},n.ms=i.milliseconds,n.M=i.months),o=new Th(n),_d(e)&&dt(e,"_locale")&&(o._locale=e._locale),_d(e)&&dt(e,"_isValid")&&(o._isValid=e._isValid),o}Lr.fn=Th.prototype;Lr.invalid=f5;function Fo(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function Eb(e,t){var n={};return n.months=t.month()-e.month()+(t.year()-e.year())*12,e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function E5(e,t){var n;return e.isValid()&&t.isValid()?(t=hx(t,e),e.isBefore(t)?n=Eb(e,t):(n=Eb(t,e),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function Fj(e,t){return function(n,r){var s,o;return r!==null&&!isNaN(+r)&&(mj(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),o=n,n=r,r=o),s=Lr(n,r),$j(this,s,e),this}}function $j(e,t,n,r){var s=t._milliseconds,o=Eg(t._days),i=Eg(t._months);e.isValid()&&(r=r??!0,i&&kj(e,jc(e,"Month")+i*n),o&&bj(e,"Date",jc(e,"Date")+o*n),s&&e._d.setTime(e._d.valueOf()+s*n),r&&xe.updateOffset(e,o||i))}var N5=Fj(1,"add"),T5=Fj(-1,"subtract");function Uj(e){return typeof e=="string"||e instanceof String}function P5(e){return Dr(e)||cu(e)||Uj(e)||zs(e)||A5(e)||R5(e)||e===null||e===void 0}function R5(e){var t=ni(e)&&!Zv(e),n=!1,r=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],s,o,i=r.length;for(s=0;sn.valueOf():n.valueOf()9999?bd(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):is(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",bd(n,"Z")):bd(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Y5(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="",n,r,s,o;return this.isLocal()||(e=this.utcOffset()===0?"moment.utc":"moment.parseZone",t="Z"),n="["+e+'("]',r=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",s="-MM-DD[T]HH:mm:ss.SSS",o=t+'[")]',this.format(n+r+s+o)}function K5(e){e||(e=this.isUtc()?xe.defaultFormatUtc:xe.defaultFormat);var t=bd(this,e);return this.localeData().postformat(t)}function G5(e,t){return this.isValid()&&(Dr(e)&&e.isValid()||Ct(e).isValid())?Lr({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function Z5(e){return this.from(Ct(),e)}function q5(e,t){return this.isValid()&&(Dr(e)&&e.isValid()||Ct(e).isValid())?Lr({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function X5(e){return this.to(Ct(),e)}function Vj(e){var t;return e===void 0?this._locale._abbr:(t=Ys(e),t!=null&&(this._locale=t),this)}var Bj=hr("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return e===void 0?this.localeData():this.locale(e)});function Wj(){return this._locale}var df=1e3,_a=60*df,ff=60*_a,Hj=(365*400+97)*24*ff;function Sa(e,t){return(e%t+t)%t}function Yj(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-Hj:new Date(e,t,n).valueOf()}function Kj(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-Hj:Date.UTC(e,t,n)}function Q5(e){var t,n;if(e=mr(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?Kj:Yj,e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=Sa(t+(this._isUTC?0:this.utcOffset()*_a),ff);break;case"minute":t=this._d.valueOf(),t-=Sa(t,_a);break;case"second":t=this._d.valueOf(),t-=Sa(t,df);break}return this._d.setTime(t),xe.updateOffset(this,!0),this}function J5(e){var t,n;if(e=mr(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?Kj:Yj,e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=ff-Sa(t+(this._isUTC?0:this.utcOffset()*_a),ff)-1;break;case"minute":t=this._d.valueOf(),t+=_a-Sa(t,_a)-1;break;case"second":t=this._d.valueOf(),t+=df-Sa(t,df)-1;break}return this._d.setTime(t),xe.updateOffset(this,!0),this}function e6(){return this._d.valueOf()-(this._offset||0)*6e4}function t6(){return Math.floor(this.valueOf()/1e3)}function n6(){return new Date(this.valueOf())}function r6(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function s6(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function o6(){return this.isValid()?this.toISOString():null}function i6(){return qv(this)}function a6(){return uo({},Qe(this))}function l6(){return Qe(this).overflow}function c6(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}Le("N",0,0,"eraAbbr");Le("NN",0,0,"eraAbbr");Le("NNN",0,0,"eraAbbr");Le("NNNN",0,0,"eraName");Le("NNNNN",0,0,"eraNarrow");Le("y",["y",1],"yo","eraYear");Le("y",["yy",2],0,"eraYear");Le("y",["yyy",3],0,"eraYear");Le("y",["yyyy",4],0,"eraYear");Ee("N",mx);Ee("NN",mx);Ee("NNN",mx);Ee("NNNN",w6);Ee("NNNNN",b6);vt(["N","NN","NNN","NNNN","NNNNN"],function(e,t,n,r){var s=n._locale.erasParse(e,r,n._strict);s?Qe(n).era=s:Qe(n).invalidEra=e});Ee("y",rl);Ee("yy",rl);Ee("yyy",rl);Ee("yyyy",rl);Ee("yo",_6);vt(["y","yy","yyy","yyyy"],pn);vt(["yo"],function(e,t,n,r){var s;n._locale._eraYearOrdinalRegex&&(s=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[pn]=n._locale.eraYearOrdinalParse(e,s):t[pn]=parseInt(e,10)});function u6(e,t){var n,r,s,o=this._eras||Ys("en")._eras;for(n=0,r=o.length;n=0)return o[r]}function f6(e,t){var n=e.since<=e.until?1:-1;return t===void 0?xe(e.since).year():xe(e.since).year()+(t-e.offset)*n}function h6(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;eo&&(t=o),T6.call(this,e,t,n,r,s))}function T6(e,t,n,r,s){var o=Ej(e,t,n,r,s),i=Ec(o.year,0,o.dayOfYear);return this.year(i.getUTCFullYear()),this.month(i.getUTCMonth()),this.date(i.getUTCDate()),this}Le("Q",0,"Qo","quarter");Ee("Q",gj);vt("Q",function(e,t){t[Cs]=(rt(e)-1)*3});function P6(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}Le("D",["DD",2],"Do","date");Ee("D",jt,sl);Ee("DD",jt,er);Ee("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient});vt(["D","DD"],Hr);vt("Do",function(e,t){t[Hr]=rt(e.match(jt)[0])});var Zj=ol("Date",!0);Le("DDD",["DDDD",3],"DDDo","dayOfYear");Ee("DDD",Sh);Ee("DDDD",yj);vt(["DDD","DDDD"],function(e,t,n){n._dayOfYear=rt(e)});function R6(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return e==null?t:this.add(e-t,"d")}Le("m",["mm",2],0,"minute");Ee("m",jt,rx);Ee("mm",jt,er);vt(["m","mm"],kr);var A6=ol("Minutes",!1);Le("s",["ss",2],0,"second");Ee("s",jt,rx);Ee("ss",jt,er);vt(["s","ss"],js);var D6=ol("Seconds",!1);Le("S",0,0,function(){return~~(this.millisecond()/100)});Le(0,["SS",2],0,function(){return~~(this.millisecond()/10)});Le(0,["SSS",3],0,"millisecond");Le(0,["SSSS",4],0,function(){return this.millisecond()*10});Le(0,["SSSSS",5],0,function(){return this.millisecond()*100});Le(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3});Le(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4});Le(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5});Le(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6});Ee("S",Sh,gj);Ee("SS",Sh,er);Ee("SSS",Sh,yj);var fo,qj;for(fo="SSSS";fo.length<=9;fo+="S")Ee(fo,rl);function O6(e,t){t[qo]=rt(("0."+e)*1e3)}for(fo="S";fo.length<=9;fo+="S")vt(fo,O6);qj=ol("Milliseconds",!1);Le("z",0,0,"zoneAbbr");Le("zz",0,0,"zoneName");function I6(){return this._isUTC?"UTC":""}function M6(){return this._isUTC?"Coordinated Universal Time":""}var le=uu.prototype;le.add=N5;le.calendar=I5;le.clone=M5;le.diff=B5;le.endOf=J5;le.format=K5;le.from=G5;le.fromNow=Z5;le.to=q5;le.toNow=X5;le.get=Y4;le.invalidAt=l6;le.isAfter=L5;le.isBefore=z5;le.isBetween=F5;le.isSame=$5;le.isSameOrAfter=U5;le.isSameOrBefore=V5;le.isValid=i6;le.lang=Bj;le.locale=Vj;le.localeData=Wj;le.max=i5;le.min=o5;le.parsingFlags=a6;le.set=K4;le.startOf=Q5;le.subtract=T5;le.toArray=r6;le.toObject=s6;le.toDate=n6;le.toISOString=H5;le.inspect=Y5;typeof Symbol<"u"&&Symbol.for!=null&&(le[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"});le.toJSON=o6;le.toString=W5;le.unix=t6;le.valueOf=e6;le.creationData=c6;le.eraName=h6;le.eraNarrow=m6;le.eraAbbr=p6;le.eraYear=g6;le.year=wj;le.isLeapYear=H4;le.weekYear=S6;le.isoWeekYear=k6;le.quarter=le.quarters=P6;le.month=Cj;le.daysInMonth=n3;le.week=le.weeks=u3;le.isoWeek=le.isoWeeks=d3;le.weeksInYear=E6;le.weeksInWeekYear=N6;le.isoWeeksInYear=C6;le.isoWeeksInISOWeekYear=j6;le.date=Zj;le.day=le.days=k3;le.weekday=C3;le.isoWeekday=j3;le.dayOfYear=R6;le.hour=le.hours=D3;le.minute=le.minutes=A6;le.second=le.seconds=D6;le.millisecond=le.milliseconds=qj;le.utcOffset=p5;le.utc=y5;le.local=v5;le.parseZone=x5;le.hasAlignedHourOffset=w5;le.isDST=b5;le.isLocal=S5;le.isUtcOffset=k5;le.isUtc=zj;le.isUTC=zj;le.zoneAbbr=I6;le.zoneName=M6;le.dates=hr("dates accessor is deprecated. Use date instead.",Zj);le.months=hr("months accessor is deprecated. Use month instead",Cj);le.years=hr("years accessor is deprecated. Use year instead",wj);le.zone=hr("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",g5);le.isDSTShifted=hr("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",_5);function L6(e){return Ct(e*1e3)}function z6(){return Ct.apply(null,arguments).parseZone()}function Xj(e){return e}var ft=Qv.prototype;ft.calendar=S4;ft.longDateFormat=E4;ft.invalidDate=T4;ft.ordinal=A4;ft.preparse=Xj;ft.postformat=Xj;ft.relativeTime=O4;ft.pastFuture=I4;ft.set=b4;ft.eras=u6;ft.erasParse=d6;ft.erasConvertYear=f6;ft.erasAbbrRegex=v6;ft.erasNameRegex=y6;ft.erasNarrowRegex=x6;ft.months=Q4;ft.monthsShort=J4;ft.monthsParse=t3;ft.monthsRegex=s3;ft.monthsShortRegex=r3;ft.week=i3;ft.firstDayOfYear=c3;ft.firstDayOfWeek=l3;ft.weekdays=x3;ft.weekdaysMin=b3;ft.weekdaysShort=w3;ft.weekdaysParse=S3;ft.weekdaysRegex=E3;ft.weekdaysShortRegex=N3;ft.weekdaysMinRegex=T3;ft.isPM=R3;ft.meridiem=O3;function hf(e,t,n,r){var s=Ys(),o=os().set(r,t);return s[n](o,e)}function Qj(e,t,n){if(zs(e)&&(t=e,e=void 0),e=e||"",t!=null)return hf(e,t,n,"month");var r,s=[];for(r=0;r<12;r++)s[r]=hf(e,r,n,"month");return s}function gx(e,t,n,r){typeof e=="boolean"?(zs(t)&&(n=t,t=void 0),t=t||""):(t=e,n=t,e=!1,zs(t)&&(n=t,t=void 0),t=t||"");var s=Ys(),o=e?s._week.dow:0,i,a=[];if(n!=null)return hf(t,(n+o)%7,r,"day");for(i=0;i<7;i++)a[i]=hf(t,(i+o)%7,r,"day");return a}function F6(e,t){return Qj(e,t,"months")}function $6(e,t){return Qj(e,t,"monthsShort")}function U6(e,t,n){return gx(e,t,n,"weekdays")}function V6(e,t,n){return gx(e,t,n,"weekdaysShort")}function B6(e,t,n){return gx(e,t,n,"weekdaysMin")}_o("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,n=rt(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return e+n}});xe.lang=hr("moment.lang is deprecated. Use moment.locale instead.",_o);xe.langData=hr("moment.langData is deprecated. Use moment.localeData instead.",Ys);var gs=Math.abs;function W6(){var e=this._data;return this._milliseconds=gs(this._milliseconds),this._days=gs(this._days),this._months=gs(this._months),e.milliseconds=gs(e.milliseconds),e.seconds=gs(e.seconds),e.minutes=gs(e.minutes),e.hours=gs(e.hours),e.months=gs(e.months),e.years=gs(e.years),this}function Jj(e,t,n,r){var s=Lr(t,n);return e._milliseconds+=r*s._milliseconds,e._days+=r*s._days,e._months+=r*s._months,e._bubble()}function H6(e,t){return Jj(this,e,t,1)}function Y6(e,t){return Jj(this,e,t,-1)}function Nb(e){return e<0?Math.floor(e):Math.ceil(e)}function K6(){var e=this._milliseconds,t=this._days,n=this._months,r=this._data,s,o,i,a,c;return e>=0&&t>=0&&n>=0||e<=0&&t<=0&&n<=0||(e+=Nb(Tg(n)+t)*864e5,t=0,n=0),r.milliseconds=e%1e3,s=or(e/1e3),r.seconds=s%60,o=or(s/60),r.minutes=o%60,i=or(o/60),r.hours=i%24,t+=or(i/24),c=or(eE(t)),n+=c,t-=Nb(Tg(c)),a=or(n/12),n%=12,r.days=t,r.months=n,r.years=a,this}function eE(e){return e*4800/146097}function Tg(e){return e*146097/4800}function G6(e){if(!this.isValid())return NaN;var t,n,r=this._milliseconds;if(e=mr(e),e==="month"||e==="quarter"||e==="year")switch(t=this._days+r/864e5,n=this._months+eE(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Tg(this._months)),e){case"week":return t/7+r/6048e5;case"day":return t+r/864e5;case"hour":return t*24+r/36e5;case"minute":return t*1440+r/6e4;case"second":return t*86400+r/1e3;case"millisecond":return Math.floor(t*864e5)+r;default:throw new Error("Unknown unit "+e)}}function Ks(e){return function(){return this.as(e)}}var tE=Ks("ms"),Z6=Ks("s"),q6=Ks("m"),X6=Ks("h"),Q6=Ks("d"),J6=Ks("w"),e$=Ks("M"),t$=Ks("Q"),n$=Ks("y"),r$=tE;function s$(){return Lr(this)}function o$(e){return e=mr(e),this.isValid()?this[e+"s"]():NaN}function Ei(e){return function(){return this.isValid()?this._data[e]:NaN}}var i$=Ei("milliseconds"),a$=Ei("seconds"),l$=Ei("minutes"),c$=Ei("hours"),u$=Ei("days"),d$=Ei("months"),f$=Ei("years");function h$(){return or(this.days()/7)}var ws=Math.round,la={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function m$(e,t,n,r,s){return s.relativeTime(t||1,!!n,e,r)}function p$(e,t,n,r){var s=Lr(e).abs(),o=ws(s.as("s")),i=ws(s.as("m")),a=ws(s.as("h")),c=ws(s.as("d")),u=ws(s.as("M")),d=ws(s.as("w")),f=ws(s.as("y")),h=o<=n.ss&&["s",o]||o0,h[4]=r,m$.apply(null,h)}function g$(e){return e===void 0?ws:typeof e=="function"?(ws=e,!0):!1}function y$(e,t){return la[e]===void 0?!1:t===void 0?la[e]:(la[e]=t,e==="s"&&(la.ss=t-1),!0)}function v$(e,t){if(!this.isValid())return this.localeData().invalidDate();var n=!1,r=la,s,o;return typeof e=="object"&&(t=e,e=!1),typeof e=="boolean"&&(n=e),typeof t=="object"&&(r=Object.assign({},la,t),t.s!=null&&t.ss==null&&(r.ss=t.s-1)),s=this.localeData(),o=p$(this,!n,r,s),n&&(o=s.pastFuture(+this,o)),s.postformat(o)}var np=Math.abs;function Ui(e){return(e>0)-(e<0)||+e}function Rh(){if(!this.isValid())return this.localeData().invalidDate();var e=np(this._milliseconds)/1e3,t=np(this._days),n=np(this._months),r,s,o,i,a=this.asSeconds(),c,u,d,f;return a?(r=or(e/60),s=or(r/60),e%=60,r%=60,o=or(n/12),n%=12,i=e?e.toFixed(3).replace(/\.?0+$/,""):"",c=a<0?"-":"",u=Ui(this._months)!==Ui(a)?"-":"",d=Ui(this._days)!==Ui(a)?"-":"",f=Ui(this._milliseconds)!==Ui(a)?"-":"",c+"P"+(o?u+o+"Y":"")+(n?u+n+"M":"")+(t?d+t+"D":"")+(s||r||e?"T":"")+(s?f+s+"H":"")+(r?f+r+"M":"")+(e?f+i+"S":"")):"P0D"}var at=Th.prototype;at.isValid=d5;at.abs=W6;at.add=H6;at.subtract=Y6;at.as=G6;at.asMilliseconds=tE;at.asSeconds=Z6;at.asMinutes=q6;at.asHours=X6;at.asDays=Q6;at.asWeeks=J6;at.asMonths=e$;at.asQuarters=t$;at.asYears=n$;at.valueOf=r$;at._bubble=K6;at.clone=s$;at.get=o$;at.milliseconds=i$;at.seconds=a$;at.minutes=l$;at.hours=c$;at.days=u$;at.weeks=h$;at.months=d$;at.years=f$;at.humanize=v$;at.toISOString=Rh;at.toString=Rh;at.toJSON=Rh;at.locale=Vj;at.localeData=Wj;at.toIsoString=hr("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Rh);at.lang=Bj;Le("X",0,0,"unix");Le("x",0,0,"valueOf");Ee("x",Ch);Ee("X",F4);vt("X",function(e,t,n){n._d=new Date(parseFloat(e)*1e3)});vt("x",function(e,t,n){n._d=new Date(rt(e))});//! moment.js -xe.version="2.30.1";x4(Ct);xe.fn=le;xe.min=a5;xe.max=l5;xe.now=c5;xe.utc=os;xe.unix=L6;xe.months=F6;xe.isDate=cu;xe.locale=_o;xe.invalid=bh;xe.duration=Lr;xe.isMoment=Dr;xe.weekdays=U6;xe.parseZone=z6;xe.localeData=Ys;xe.isDuration=_d;xe.monthsShort=$6;xe.weekdaysMin=B6;xe.defineLocale=lx;xe.updateLocale=z3;xe.locales=F3;xe.weekdaysShort=V6;xe.normalizeUnits=mr;xe.relativeTimeRounding=g$;xe.relativeTimeThreshold=y$;xe.calendarFormat=O5;xe.prototype=le;xe.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};const x$=async()=>await ot().collection("access").getFullList({sort:"-created",filter:"deleted = null"}),as=async e=>e.id?await ot().collection("access").update(e.id,e):await ot().collection("access").create(e),w$=async e=>(e.deleted=xe.utc().format("YYYY-MM-DD HH:mm:ss"),await ot().collection("access").update(e.id,e)),Tb=async()=>await ot().collection("access_groups").getFullList({sort:"-created",expand:"access"}),b$=async e=>{const t=ot();if((await t.collection("access").getList(1,1,{filter:`group='${e}' && deleted=null`})).items.length>0)throw new Error("该分组下有授权配置,无法删除");await t.collection("access_groups").delete(e)},_$=async e=>{const t=ot();return e.id?await t.collection("access_groups").update(e.id,e):await t.collection("access_groups").create(e)},Pb=async e=>await ot().collection("access_groups").update(e.id,e),S$=async()=>{try{return await ot().collection("settings").getFirstListItem("name='emails'")}catch{return{content:{emails:[]}}}},yx=async e=>{try{return await ot().collection("settings").getFirstListItem(`name='${e}'`)}catch{return{name:e}}},il=async e=>{const t=ot();let n;return e.id?n=await t.collection("settings").update(e.id,e):n=await t.collection("settings").create(e),n},k$=(e,t)=>{switch(t.type){case"SET_ACCESSES":return{...e,accesses:t.payload};case"ADD_ACCESS":return{...e,accesses:[t.payload,...e.accesses]};case"DELETE_ACCESS":return{...e,accesses:e.accesses.filter(n=>n.id!==t.payload)};case"UPDATE_ACCESS":return{...e,accesses:e.accesses.map(n=>n.id===t.payload.id?t.payload:n)};case"SET_EMAILS":return{...e,emails:t.payload};case"ADD_EMAIL":return{...e,emails:{...e.emails,content:{emails:[...e.emails.content.emails,t.payload]}}};case"SET_ACCESS_GROUPS":return{...e,accessGroups:t.payload};default:return e}},nE=y.createContext({}),ln=()=>y.useContext(nE),C$=({children:e})=>{const[t,n]=y.useReducer(k$,{accesses:[],emails:{content:{emails:[]}},accessGroups:[]});y.useEffect(()=>{(async()=>{const d=await x$();n({type:"SET_ACCESSES",payload:d})})()},[]),y.useEffect(()=>{(async()=>{const d=await S$();n({type:"SET_EMAILS",payload:d})})()},[]),y.useEffect(()=>{(async()=>{const d=await Tb();n({type:"SET_ACCESS_GROUPS",payload:d})})()},[]);const r=y.useCallback(async()=>{const u=await Tb();n({type:"SET_ACCESS_GROUPS",payload:u})},[]),s=y.useCallback(u=>{n({type:"SET_EMAILS",payload:u})},[]),o=y.useCallback(u=>{n({type:"DELETE_ACCESS",payload:u})},[]),i=y.useCallback(u=>{n({type:"ADD_ACCESS",payload:u})},[]),a=y.useCallback(u=>{n({type:"UPDATE_ACCESS",payload:u})},[]),c=y.useCallback(u=>{n({type:"SET_ACCESS_GROUPS",payload:u})},[]);return l.jsx(nE.Provider,{value:{config:{accesses:t.accesses,emails:t.emails,accessGroups:t.accessGroups},deleteAccess:o,addAccess:i,setEmails:s,updateAccess:a,setAccessGroups:c,reloadAccessGroups:r},children:e&&e})};var j$="Separator",Rb="horizontal",E$=["horizontal","vertical"],rE=y.forwardRef((e,t)=>{const{decorative:n,orientation:r=Rb,...s}=e,o=N$(r)?r:Rb,a=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return l.jsx(Pe.div,{"data-orientation":o,...a,...s,ref:t})});rE.displayName=j$;function N$(e){return E$.includes(e)}var sE=rE;const br=y.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},s)=>l.jsx(sE,{ref:s,decorative:n,orientation:t,className:re("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));br.displayName=sE.displayName;const T$="Certimate v0.2.0",oE=()=>{const{t:e}=Ye();return l.jsxs("div",{className:"fixed right-0 bottom-0 w-full flex justify-between p-5",children:[l.jsx("div",{className:""}),l.jsxs("div",{className:"text-muted-foreground text-sm hover:text-stone-900 dark:hover:text-stone-200 flex",children:[l.jsxs("a",{href:"https://docs.certimate.me",target:"_blank",className:"flex items-center",children:[l.jsx(XO,{size:16}),l.jsx("div",{className:"ml-1",children:e("common.menu.document")})]}),l.jsx(br,{orientation:"vertical",className:"mx-2"}),l.jsx("a",{href:"https://github.com/usual2970/certimate/releases",target:"_blank",children:T$})]})]})};function P$(){const e=Jn(),t=Ir(),{t:n}=Ye();if(!ot().authStore.isValid||!ot().authStore.isAdmin)return l.jsx(KS,{to:"/login"});const r=t.pathname,s=a=>a==r?"bg-muted text-primary":"text-muted-foreground",o=()=>{ot().authStore.clear(),e("/login")},i=()=>{e("/setting/account")};return l.jsx(l.Fragment,{children:l.jsx(C$,{children:l.jsxs("div",{className:"grid min-h-screen w-full md:grid-cols-[180px_1fr] lg:grid-cols-[200px_1fr] 2xl:md:grid-cols-[280px_1fr] ",children:[l.jsx("div",{className:"hidden border-r dark:border-stone-500 bg-muted/40 md:block",children:l.jsxs("div",{className:"flex h-full max-h-screen flex-col gap-2",children:[l.jsx("div",{className:"flex h-14 items-center border-b dark:border-stone-500 px-4 lg:h-[60px] lg:px-6",children:l.jsxs(wn,{to:"/",className:"flex items-center gap-2 font-semibold",children:[l.jsx("img",{src:"/vite.svg",className:"w-[36px] h-[36px]"}),l.jsx("span",{className:"dark:text-white",children:"Certimate"})]})}),l.jsx("div",{className:"flex-1",children:l.jsxs("nav",{className:"grid items-start px-2 text-sm font-medium lg:px-4",children:[l.jsxs(wn,{to:"/",className:re("flex items-center gap-3 rounded-lg px-3 py-2 transition-all hover:text-primary",s("/")),children:[l.jsx(Yw,{className:"h-4 w-4"}),n("dashboard.page.title")]}),l.jsxs(wn,{to:"/domains",className:re("flex items-center gap-3 rounded-lg px-3 py-2 transition-all hover:text-primary",s("/domains")),children:[l.jsx(mg,{className:"h-4 w-4"}),n("domain.page.title")]}),l.jsxs(wn,{to:"/access",className:re("flex items-center gap-3 rounded-lg px-3 py-2 transition-all hover:text-primary",s("/access")),children:[l.jsx(Kw,{className:"h-4 w-4"}),n("access.page.title")]}),l.jsxs(wn,{to:"/history",className:re("flex items-center gap-3 rounded-lg px-3 py-2 transition-all hover:text-primary",s("/history")),children:[l.jsx(Hw,{className:"h-4 w-4"}),n("history.page.title")]})]})})]})}),l.jsxs("div",{className:"flex flex-col",children:[l.jsxs("header",{className:"flex h-14 items-center gap-4 border-b dark:border-stone-500 bg-muted/40 px-4 lg:h-[60px] lg:px-6",children:[l.jsxs(Wv,{children:[l.jsx(Hv,{asChild:!0,children:l.jsxs(Me,{variant:"outline",size:"icon",className:"shrink-0 md:hidden",children:[l.jsx(lI,{className:"h-5 w-5 dark:text-white"}),l.jsx("span",{className:"sr-only",children:"Toggle navigation menu"})]})}),l.jsx(wh,{side:"left",className:"flex flex-col",children:l.jsxs("nav",{className:"grid gap-2 text-lg font-medium",children:[l.jsxs(wn,{to:"/",className:"flex items-center gap-2 text-lg font-semibold",children:[l.jsx("img",{src:"/vite.svg",className:"w-[36px] h-[36px]"}),l.jsx("span",{className:"dark:text-white",children:"Certimate"}),l.jsx("span",{className:"sr-only",children:"Certimate"})]}),l.jsxs(wn,{to:"/",className:re("mx-[-0.65rem] flex items-center gap-4 rounded-xl px-3 py-2 hover:text-foreground",s("/")),children:[l.jsx(Yw,{className:"h-5 w-5"}),n("dashboard.page.title")]}),l.jsxs(wn,{to:"/domains",className:re("mx-[-0.65rem] flex items-center gap-4 rounded-xl px-3 py-2 hover:text-foreground",s("/domains")),children:[l.jsx(mg,{className:"h-5 w-5"}),n("domain.page.title")]}),l.jsxs(wn,{to:"/access",className:re("mx-[-0.65rem] flex items-center gap-4 rounded-xl px-3 py-2 hover:text-foreground",s("/access")),children:[l.jsx(Kw,{className:"h-5 w-5"}),n("access.page.title")]}),l.jsxs(wn,{to:"/history",className:re("mx-[-0.65rem] flex items-center gap-4 rounded-xl px-3 py-2 hover:text-foreground",s("/history")),children:[l.jsx(Hw,{className:"h-5 w-5"}),n("history.page.title")]})]})})]}),l.jsx("div",{className:"w-full flex-1"}),l.jsx(BF,{}),l.jsx(FF,{}),l.jsxs(Iv,{children:[l.jsx(Mv,{asChild:!0,children:l.jsxs(Me,{variant:"secondary",size:"icon",className:"rounded-full",children:[l.jsx(tI,{className:"h-5 w-5"}),l.jsx("span",{className:"sr-only",children:"Toggle user menu"})]})}),l.jsxs(vh,{align:"end",children:[l.jsx(ti,{onClick:i,children:n("common.menu.settings")}),l.jsx(ti,{onClick:o,children:n("common.menu.logout")})]})]})]}),l.jsxs("main",{className:"flex flex-1 flex-col gap-4 p-4 lg:gap-6 lg:p-6 relative",children:[l.jsx(tv,{}),l.jsx(oE,{})]})]})]})})})}var R$="VisuallyHidden",hu=y.forwardRef((e,t)=>l.jsx(Pe.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));hu.displayName=R$;var A$=hu,[Ah,YH]=on("Tooltip",[tl]),Dh=tl(),iE="TooltipProvider",D$=700,Pg="tooltip.open",[O$,vx]=Ah(iE),xx=e=>{const{__scopeTooltip:t,delayDuration:n=D$,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:o}=e,[i,a]=y.useState(!0),c=y.useRef(!1),u=y.useRef(0);return y.useEffect(()=>{const d=u.current;return()=>window.clearTimeout(d)},[]),l.jsx(O$,{scope:t,isOpenDelayed:i,delayDuration:n,onOpen:y.useCallback(()=>{window.clearTimeout(u.current),a(!1)},[]),onClose:y.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>a(!0),r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:y.useCallback(d=>{c.current=d},[]),disableHoverableContent:s,children:o})};xx.displayName=iE;var Oh="Tooltip",[I$,Ih]=Ah(Oh),aE=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:s=!1,onOpenChange:o,disableHoverableContent:i,delayDuration:a}=e,c=vx(Oh,e.__scopeTooltip),u=Dh(t),[d,f]=y.useState(null),h=Bn(),m=y.useRef(0),x=i??c.disableHoverableContent,p=a??c.delayDuration,w=y.useRef(!1),[g=!1,v]=Gn({prop:r,defaultProp:s,onChange:T=>{T?(c.onOpen(),document.dispatchEvent(new CustomEvent(Pg))):c.onClose(),o==null||o(T)}}),b=y.useMemo(()=>g?w.current?"delayed-open":"instant-open":"closed",[g]),_=y.useCallback(()=>{window.clearTimeout(m.current),w.current=!1,v(!0)},[v]),C=y.useCallback(()=>{window.clearTimeout(m.current),v(!1)},[v]),j=y.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{w.current=!0,v(!0)},p)},[p,v]);return y.useEffect(()=>()=>window.clearTimeout(m.current),[]),l.jsx(wv,{...u,children:l.jsx(I$,{scope:t,contentId:h,open:g,stateAttribute:b,trigger:d,onTriggerChange:f,onTriggerEnter:y.useCallback(()=>{c.isOpenDelayed?j():_()},[c.isOpenDelayed,j,_]),onTriggerLeave:y.useCallback(()=>{x?C():window.clearTimeout(m.current)},[C,x]),onOpen:_,onClose:C,disableHoverableContent:x,children:n})})};aE.displayName=Oh;var Rg="TooltipTrigger",lE=y.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=Ih(Rg,n),o=vx(Rg,n),i=Dh(n),a=y.useRef(null),c=Ge(t,a,s.onTriggerChange),u=y.useRef(!1),d=y.useRef(!1),f=y.useCallback(()=>u.current=!1,[]);return y.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),l.jsx(bv,{asChild:!0,...i,children:l.jsx(Pe.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:c,onPointerMove:ue(e.onPointerMove,h=>{h.pointerType!=="touch"&&!d.current&&!o.isPointerInTransitRef.current&&(s.onTriggerEnter(),d.current=!0)}),onPointerLeave:ue(e.onPointerLeave,()=>{s.onTriggerLeave(),d.current=!1}),onPointerDown:ue(e.onPointerDown,()=>{u.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:ue(e.onFocus,()=>{u.current||s.onOpen()}),onBlur:ue(e.onBlur,s.onClose),onClick:ue(e.onClick,s.onClose)})})});lE.displayName=Rg;var M$="TooltipPortal",[KH,L$]=Ah(M$,{forceMount:void 0}),Oa="TooltipContent",wx=y.forwardRef((e,t)=>{const n=L$(Oa,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...o}=e,i=Ih(Oa,e.__scopeTooltip);return l.jsx(an,{present:r||i.open,children:i.disableHoverableContent?l.jsx(cE,{side:s,...o,ref:t}):l.jsx(z$,{side:s,...o,ref:t})})}),z$=y.forwardRef((e,t)=>{const n=Ih(Oa,e.__scopeTooltip),r=vx(Oa,e.__scopeTooltip),s=y.useRef(null),o=Ge(t,s),[i,a]=y.useState(null),{trigger:c,onClose:u}=n,d=s.current,{onPointerInTransitChange:f}=r,h=y.useCallback(()=>{a(null),f(!1)},[f]),m=y.useCallback((x,p)=>{const w=x.currentTarget,g={x:x.clientX,y:x.clientY},v=V$(g,w.getBoundingClientRect()),b=B$(g,v),_=W$(p.getBoundingClientRect()),C=Y$([...b,..._]);a(C),f(!0)},[f]);return y.useEffect(()=>()=>h(),[h]),y.useEffect(()=>{if(c&&d){const x=w=>m(w,d),p=w=>m(w,c);return c.addEventListener("pointerleave",x),d.addEventListener("pointerleave",p),()=>{c.removeEventListener("pointerleave",x),d.removeEventListener("pointerleave",p)}}},[c,d,m,h]),y.useEffect(()=>{if(i){const x=p=>{const w=p.target,g={x:p.clientX,y:p.clientY},v=(c==null?void 0:c.contains(w))||(d==null?void 0:d.contains(w)),b=!H$(g,i);v?h():b&&(h(),u())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[c,d,i,u,h]),l.jsx(cE,{...e,ref:o})}),[F$,$$]=Ah(Oh,{isInside:!1}),cE=y.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:o,onPointerDownOutside:i,...a}=e,c=Ih(Oa,n),u=Dh(n),{onClose:d}=c;return y.useEffect(()=>(document.addEventListener(Pg,d),()=>document.removeEventListener(Pg,d)),[d]),y.useEffect(()=>{if(c.trigger){const f=h=>{const m=h.target;m!=null&&m.contains(c.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[c.trigger,d]),l.jsx(Qa,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:f=>f.preventDefault(),onDismiss:d,children:l.jsxs(_v,{"data-state":c.stateAttribute,...u,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[l.jsx(av,{children:r}),l.jsx(F$,{scope:n,isInside:!0,children:l.jsx(A$,{id:c.contentId,role:"tooltip",children:s||r})})]})})});wx.displayName=Oa;var uE="TooltipArrow",U$=y.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=Dh(n);return $$(uE,n).isInside?null:l.jsx(Sv,{...s,...r,ref:t})});U$.displayName=uE;function V$(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,s,o)){case o:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function B$(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function W$(e){const{top:t,right:n,bottom:r,left:s}=e;return[{x:s,y:t},{x:n,y:t},{x:n,y:r},{x:s,y:r}]}function H$(e,t){const{x:n,y:r}=e;let s=!1;for(let o=0,i=t.length-1;or!=d>r&&n<(u-a)*(r-c)/(d-c)+a&&(s=!s)}return s}function Y$(e){const t=e.slice();return t.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),K$(t)}function K$(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r=2;){const o=t[t.length-1],i=t[t.length-2];if((o.x-i.x)*(s.y-i.y)>=(o.y-i.y)*(s.x-i.x))t.pop();else break}t.push(s)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const s=e[r];for(;n.length>=2;){const o=n[n.length-1],i=n[n.length-2];if((o.x-i.x)*(s.y-i.y)>=(o.y-i.y)*(s.x-i.x))n.pop();else break}n.push(s)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var G$=xx,Z$=aE,q$=lE,dE=wx;const ur=({when:e,children:t,fallback:n})=>e?t:n,bx=({phase:e,phaseSuccess:t})=>{const{t:n}=Ye();let r=0;return e==="check"?r=1:e==="apply"?r=2:e==="deploy"&&(r=3),l.jsxs("div",{className:"flex items-center",children:[l.jsx("div",{className:re("text-xs text-nowrap",r===1?t?"text-green-600":"text-red-600":"",r>1?"text-green-600":""),children:n("history.props.stage.progress.check")}),l.jsx(br,{className:re("h-1 grow max-w-[60px]",r>1?"bg-green-600":"")}),l.jsx("div",{className:re("text-xs text-nowrap",r<2?"text-muted-foreground":"",r===2?t?"text-green-600":"text-red-600":"",r>2?"text-green-600":""),children:n("history.props.stage.progress.apply")}),l.jsx(br,{className:re("h-1 grow max-w-[60px]",r>2?"bg-green-600":"")}),l.jsx("div",{className:re("text-xs text-nowrap",r<3?"text-muted-foreground":"",r===3?t?"text-green-600":"text-red-600":"",r>3?"text-green-600":""),children:n("history.props.stage.progress.deploy")})]})},X$=G$,fE=Z$,hE=q$,mE=y.forwardRef(({className:e,sideOffset:t=4,...n},r)=>l.jsx(dE,{ref:r,sideOffset:t,className:re("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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",e),...n}));mE.displayName=dE.displayName;const _x=({deployment:e})=>{const t=n=>e.log[n]?e.log[n][e.log[n].length-1].error:"";return l.jsx(l.Fragment,{children:e.phase==="deploy"&&e.phaseSuccess||e.wholeSuccess?l.jsx(eI,{size:16,className:"text-green-700"}):l.jsx(l.Fragment,{children:t(e.phase).length?l.jsx(X$,{children:l.jsxs(fE,{children:[l.jsx(hE,{asChild:!0,className:"cursor-pointer",children:l.jsx(Bw,{size:16,className:"text-red-700"})}),l.jsx(mE,{className:"max-w-[35em]",children:t(e.phase)})]})}):l.jsx(Bw,{size:16,className:"text-red-700"})})})},pE=({className:e,...t})=>l.jsx("nav",{role:"navigation","aria-label":"pagination",className:re("mx-auto flex w-full justify-center",e),...t});pE.displayName="Pagination";const gE=y.forwardRef(({className:e,...t},n)=>l.jsx("ul",{ref:n,className:re("flex flex-row items-center gap-1",e),...t}));gE.displayName="PaginationContent";const Ag=y.forwardRef(({className:e,...t},n)=>l.jsx("li",{ref:n,className:re("",e),...t}));Ag.displayName="PaginationItem";const yE=({className:e,isActive:t,size:n="icon",...r})=>l.jsx("a",{"aria-current":t?"page":void 0,className:re(ch({variant:t?"outline":"ghost",size:n}),e),...r});yE.displayName="PaginationLink";const vE=({className:e,...t})=>{const{t:n}=Ye();return l.jsxs("span",{"aria-hidden":!0,className:re("flex h-9 w-9 items-center justify-center",e),...t,children:[l.jsx(nI,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:n("common.pagination.more")})]})};vE.displayName="PaginationEllipsis";const xE=({totalPages:e,currentPage:t,onPageChange:n})=>{const s=()=>{if(e>7){let u=[];const d=Math.max(2,t-1),f=Math.min(e-1,t+1),h=e-1;return u=o(d,f),t>3&&u.unshift("..."),t{let d=a;const f=[];for(;d<=c;)f.push(d),d+=u;return f},i=s();return l.jsx(l.Fragment,{children:l.jsx(pE,{className:"dark:text-stone-200 justify-end mt-3",children:l.jsx(gE,{children:i.map((a,c)=>a==="..."?l.jsx(Ag,{children:l.jsx(vE,{})},c):l.jsx(Ag,{children:l.jsx(yE,{href:"#",isActive:t==a,onClick:u=>{u.preventDefault(),n(a)},children:a})},c))})})})};var wE="AlertDialog",[Q$,GH]=on(wE,[WC]),Gs=WC(),bE=e=>{const{__scopeAlertDialog:t,...n}=e,r=Gs(t);return l.jsx(Uv,{...r,...n,modal:!0})};bE.displayName=wE;var J$="AlertDialogTrigger",_E=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Gs(n);return l.jsx(Vv,{...s,...r,ref:t})});_E.displayName=J$;var eU="AlertDialogPortal",SE=e=>{const{__scopeAlertDialog:t,...n}=e,r=Gs(t);return l.jsx(Bv,{...r,...n})};SE.displayName=eU;var tU="AlertDialogOverlay",kE=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Gs(n);return l.jsx(ou,{...s,...r,ref:t})});kE.displayName=tU;var ka="AlertDialogContent",[nU,rU]=Q$(ka),CE=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...s}=e,o=Gs(n),i=y.useRef(null),a=Ge(t,i),c=y.useRef(null);return l.jsx(ZF,{contentName:ka,titleName:jE,docsSlug:"alert-dialog",children:l.jsx(nU,{scope:n,cancelRef:c,children:l.jsxs(iu,{role:"alertdialog",...o,...s,ref:a,onOpenAutoFocus:ue(s.onOpenAutoFocus,u=>{var d;u.preventDefault(),(d=c.current)==null||d.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[l.jsx(av,{children:r}),l.jsx(oU,{contentRef:i})]})})})});CE.displayName=ka;var jE="AlertDialogTitle",EE=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Gs(n);return l.jsx(au,{...s,...r,ref:t})});EE.displayName=jE;var NE="AlertDialogDescription",TE=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Gs(n);return l.jsx(lu,{...s,...r,ref:t})});TE.displayName=NE;var sU="AlertDialogAction",PE=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Gs(n);return l.jsx(xh,{...s,...r,ref:t})});PE.displayName=sU;var RE="AlertDialogCancel",AE=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:s}=rU(RE,n),o=Gs(n),i=Ge(t,s);return l.jsx(xh,{...o,...r,ref:i})});AE.displayName=RE;var oU=({contentRef:e})=>{const t=`\`${ka}\` requires a description for the component to be accessible for screen reader users. +`+new Error().stack),n=!1}return t.apply(this,arguments)},t)}var kb={};function mj(e,t){xe.deprecationHandler!=null&&xe.deprecationHandler(e,t),kb[e]||(hj(t),kb[e]=!0)}xe.suppressDeprecationWarnings=!1;xe.deprecationHandler=null;function is(e){return typeof Function<"u"&&e instanceof Function||Object.prototype.toString.call(e)==="[object Function]"}function b4(e){var t,n;for(n in e)dt(e,n)&&(t=e[n],is(t)?this[n]=t:this["_"+n]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function kg(e,t){var n=uo({},e),r;for(r in t)dt(t,r)&&(ni(e[r])&&ni(t[r])?(n[r]={},uo(n[r],e[r]),uo(n[r],t[r])):t[r]!=null?n[r]=t[r]:delete n[r]);for(r in e)dt(e,r)&&!dt(t,r)&&ni(e[r])&&(n[r]=uo({},n[r]));return n}function Qv(e){e!=null&&this.set(e)}var Cg;Object.keys?Cg=Object.keys:Cg=function(e){var t,n=[];for(t in e)dt(e,t)&&n.push(t);return n};var _4={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function S4(e,t,n){var r=this._calendar[e]||this._calendar.sameElse;return is(r)?r.call(t,n):r}function ns(e,t,n){var r=""+Math.abs(e),s=t-r.length,o=e>=0;return(o?n?"+":"":"-")+Math.pow(10,Math.max(0,s)).toString().substr(1)+r}var Jv=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Qu=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,ep={},ba={};function Le(e,t,n,r){var s=r;typeof r=="string"&&(s=function(){return this[r]()}),e&&(ba[e]=s),t&&(ba[t[0]]=function(){return ns(s.apply(this,arguments),t[1],t[2])}),n&&(ba[n]=function(){return this.localeData().ordinal(s.apply(this,arguments),e)})}function k4(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function C4(e){var t=e.match(Jv),n,r;for(n=0,r=t.length;n=0&&Qu.test(e);)e=e.replace(Qu,r),Qu.lastIndex=0,n-=1;return e}var j4={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function E4(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(Jv).map(function(r){return r==="MMMM"||r==="MM"||r==="DD"||r==="dddd"?r.slice(1):r}).join(""),this._longDateFormat[e])}var N4="Invalid date";function T4(){return this._invalidDate}var P4="%d",R4=/\d{1,2}/;function A4(e){return this._ordinal.replace("%d",e)}var D4={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function O4(e,t,n,r){var s=this._relativeTime[n];return is(s)?s(e,t,n,r):s.replace(/%d/i,e)}function I4(e,t){var n=this._relativeTime[e>0?"future":"past"];return is(n)?n(t):n.replace(/%s/i,t)}var Cb={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function mr(e){return typeof e=="string"?Cb[e]||Cb[e.toLowerCase()]:void 0}function ex(e){var t={},n,r;for(r in e)dt(e,r)&&(n=mr(r),n&&(t[n]=e[r]));return t}var M4={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function L4(e){var t=[],n;for(n in e)dt(e,n)&&t.push({unit:n,priority:M4[n]});return t.sort(function(r,s){return r.priority-s.priority}),t}var gj=/\d/,er=/\d\d/,yj=/\d{3}/,tx=/\d{4}/,_h=/[+-]?\d{6}/,jt=/\d\d?/,vj=/\d\d\d\d?/,xj=/\d\d\d\d\d\d?/,Sh=/\d{1,3}/,nx=/\d{1,4}/,kh=/[+-]?\d{1,6}/,rl=/\d+/,Ch=/[+-]?\d+/,z4=/Z|[+-]\d\d:?\d\d/gi,jh=/Z|[+-]\d\d(?::?\d\d)?/gi,F4=/[+-]?\d+(\.\d{1,3})?/,du=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,sl=/^[1-9]\d?/,rx=/^([1-9]\d|\d)/,cf;cf={};function Ee(e,t,n){cf[e]=is(t)?t:function(r,s){return r&&n?n:t}}function $4(e,t){return dt(cf,e)?cf[e](t._strict,t._locale):new RegExp(U4(e))}function U4(e){return Ts(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,n,r,s,o){return n||r||s||o}))}function Ts(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function or(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function rt(e){var t=+e,n=0;return t!==0&&isFinite(t)&&(n=or(t)),n}var jg={};function vt(e,t){var n,r=t,s;for(typeof e=="string"&&(e=[e]),zs(t)&&(r=function(o,i){i[t]=rt(o)}),s=e.length,n=0;n68?1900:2e3)};var wj=ol("FullYear",!0);function H4(){return Eh(this.year())}function ol(e,t){return function(n){return n!=null?(bj(this,e,n),xe.updateOffset(this,t),this):jc(this,e)}}function jc(e,t){if(!e.isValid())return NaN;var n=e._d,r=e._isUTC;switch(t){case"Milliseconds":return r?n.getUTCMilliseconds():n.getMilliseconds();case"Seconds":return r?n.getUTCSeconds():n.getSeconds();case"Minutes":return r?n.getUTCMinutes():n.getMinutes();case"Hours":return r?n.getUTCHours():n.getHours();case"Date":return r?n.getUTCDate():n.getDate();case"Day":return r?n.getUTCDay():n.getDay();case"Month":return r?n.getUTCMonth():n.getMonth();case"FullYear":return r?n.getUTCFullYear():n.getFullYear();default:return NaN}}function bj(e,t,n){var r,s,o,i,a;if(!(!e.isValid()||isNaN(n))){switch(r=e._d,s=e._isUTC,t){case"Milliseconds":return void(s?r.setUTCMilliseconds(n):r.setMilliseconds(n));case"Seconds":return void(s?r.setUTCSeconds(n):r.setSeconds(n));case"Minutes":return void(s?r.setUTCMinutes(n):r.setMinutes(n));case"Hours":return void(s?r.setUTCHours(n):r.setHours(n));case"Date":return void(s?r.setUTCDate(n):r.setDate(n));case"FullYear":break;default:return}o=n,i=e.month(),a=e.date(),a=a===29&&i===1&&!Eh(o)?28:a,s?r.setUTCFullYear(o,i,a):r.setFullYear(o,i,a)}}function Y4(e){return e=mr(e),is(this[e])?this[e]():this}function K4(e,t){if(typeof e=="object"){e=ex(e);var n=L4(e),r,s=n.length;for(r=0;r=0?(a=new Date(e+400,t,n,r,s,o,i),isFinite(a.getFullYear())&&a.setFullYear(e)):a=new Date(e,t,n,r,s,o,i),a}function Ec(e){var t,n;return e<100&&e>=0?(n=Array.prototype.slice.call(arguments),n[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function uf(e,t,n){var r=7+t-n,s=(7+Ec(e,0,r).getUTCDay()-t)%7;return-s+r-1}function Ej(e,t,n,r,s){var o=(7+n-r)%7,i=uf(e,r,s),a=1+7*(t-1)+o+i,c,u;return a<=0?(c=e-1,u=Xl(c)+a):a>Xl(e)?(c=e+1,u=a-Xl(e)):(c=e,u=a),{year:c,dayOfYear:u}}function Nc(e,t,n){var r=uf(e.year(),t,n),s=Math.floor((e.dayOfYear()-r-1)/7)+1,o,i;return s<1?(i=e.year()-1,o=s+Ps(i,t,n)):s>Ps(e.year(),t,n)?(o=s-Ps(e.year(),t,n),i=e.year()+1):(i=e.year(),o=s),{week:o,year:i}}function Ps(e,t,n){var r=uf(e,t,n),s=uf(e+1,t,n);return(Xl(e)-r+s)/7}Le("w",["ww",2],"wo","week");Le("W",["WW",2],"Wo","isoWeek");Ee("w",jt,sl);Ee("ww",jt,er);Ee("W",jt,sl);Ee("WW",jt,er);fu(["w","ww","W","WW"],function(e,t,n,r){t[r.substr(0,1)]=rt(e)});function i3(e){return Nc(e,this._week.dow,this._week.doy).week}var a3={dow:0,doy:6};function l3(){return this._week.dow}function c3(){return this._week.doy}function u3(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,"d")}function d3(e){var t=Nc(this,1,4).week;return e==null?t:this.add((e-t)*7,"d")}Le("d",0,"do","day");Le("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)});Le("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)});Le("dddd",0,0,function(e){return this.localeData().weekdays(this,e)});Le("e",0,0,"weekday");Le("E",0,0,"isoWeekday");Ee("d",jt);Ee("e",jt);Ee("E",jt);Ee("dd",function(e,t){return t.weekdaysMinRegex(e)});Ee("ddd",function(e,t){return t.weekdaysShortRegex(e)});Ee("dddd",function(e,t){return t.weekdaysRegex(e)});fu(["dd","ddd","dddd"],function(e,t,n,r){var s=n._locale.weekdaysParse(e,r,n._strict);s!=null?t.d=s:Qe(n).invalidWeekday=e});fu(["d","e","E"],function(e,t,n,r){t[r]=rt(e)});function f3(e,t){return typeof e!="string"?e:isNaN(e)?(e=t.weekdaysParse(e),typeof e=="number"?e:null):parseInt(e,10)}function h3(e,t){return typeof e=="string"?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function ox(e,t){return e.slice(t,7).concat(e.slice(0,t))}var m3="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Nj="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),p3="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),g3=du,y3=du,v3=du;function x3(e,t){var n=Ar(this._weekdays)?this._weekdays:this._weekdays[e&&e!==!0&&this._weekdays.isFormat.test(t)?"format":"standalone"];return e===!0?ox(n,this._week.dow):e?n[e.day()]:n}function w3(e){return e===!0?ox(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function b3(e){return e===!0?ox(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function _3(e,t,n){var r,s,o,i=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)o=os([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(o,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(o,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(o,"").toLocaleLowerCase();return n?t==="dddd"?(s=$t.call(this._weekdaysParse,i),s!==-1?s:null):t==="ddd"?(s=$t.call(this._shortWeekdaysParse,i),s!==-1?s:null):(s=$t.call(this._minWeekdaysParse,i),s!==-1?s:null):t==="dddd"?(s=$t.call(this._weekdaysParse,i),s!==-1||(s=$t.call(this._shortWeekdaysParse,i),s!==-1)?s:(s=$t.call(this._minWeekdaysParse,i),s!==-1?s:null)):t==="ddd"?(s=$t.call(this._shortWeekdaysParse,i),s!==-1||(s=$t.call(this._weekdaysParse,i),s!==-1)?s:(s=$t.call(this._minWeekdaysParse,i),s!==-1?s:null)):(s=$t.call(this._minWeekdaysParse,i),s!==-1||(s=$t.call(this._weekdaysParse,i),s!==-1)?s:(s=$t.call(this._shortWeekdaysParse,i),s!==-1?s:null))}function S3(e,t,n){var r,s,o;if(this._weekdaysParseExact)return _3.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(s=os([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(s,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(s,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(s,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(o="^"+this.weekdays(s,"")+"|^"+this.weekdaysShort(s,"")+"|^"+this.weekdaysMin(s,""),this._weekdaysParse[r]=new RegExp(o.replace(".",""),"i")),n&&t==="dddd"&&this._fullWeekdaysParse[r].test(e))return r;if(n&&t==="ddd"&&this._shortWeekdaysParse[r].test(e))return r;if(n&&t==="dd"&&this._minWeekdaysParse[r].test(e))return r;if(!n&&this._weekdaysParse[r].test(e))return r}}function k3(e){if(!this.isValid())return e!=null?this:NaN;var t=jc(this,"Day");return e!=null?(e=f3(e,this.localeData()),this.add(e-t,"d")):t}function C3(e){if(!this.isValid())return e!=null?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return e==null?t:this.add(e-t,"d")}function j3(e){if(!this.isValid())return e!=null?this:NaN;if(e!=null){var t=h3(e,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function E3(e){return this._weekdaysParseExact?(dt(this,"_weekdaysRegex")||ix.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(dt(this,"_weekdaysRegex")||(this._weekdaysRegex=g3),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function N3(e){return this._weekdaysParseExact?(dt(this,"_weekdaysRegex")||ix.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(dt(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=y3),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function T3(e){return this._weekdaysParseExact?(dt(this,"_weekdaysRegex")||ix.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(dt(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=v3),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function ix(){function e(d,f){return f.length-d.length}var t=[],n=[],r=[],s=[],o,i,a,c,u;for(o=0;o<7;o++)i=os([2e3,1]).day(o),a=Ts(this.weekdaysMin(i,"")),c=Ts(this.weekdaysShort(i,"")),u=Ts(this.weekdays(i,"")),t.push(a),n.push(c),r.push(u),s.push(a),s.push(c),s.push(u);t.sort(e),n.sort(e),r.sort(e),s.sort(e),this._weekdaysRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+t.join("|")+")","i")}function ax(){return this.hours()%12||12}function P3(){return this.hours()||24}Le("H",["HH",2],0,"hour");Le("h",["hh",2],0,ax);Le("k",["kk",2],0,P3);Le("hmm",0,0,function(){return""+ax.apply(this)+ns(this.minutes(),2)});Le("hmmss",0,0,function(){return""+ax.apply(this)+ns(this.minutes(),2)+ns(this.seconds(),2)});Le("Hmm",0,0,function(){return""+this.hours()+ns(this.minutes(),2)});Le("Hmmss",0,0,function(){return""+this.hours()+ns(this.minutes(),2)+ns(this.seconds(),2)});function Tj(e,t){Le(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}Tj("a",!0);Tj("A",!1);function Pj(e,t){return t._meridiemParse}Ee("a",Pj);Ee("A",Pj);Ee("H",jt,rx);Ee("h",jt,sl);Ee("k",jt,sl);Ee("HH",jt,er);Ee("hh",jt,er);Ee("kk",jt,er);Ee("hmm",vj);Ee("hmmss",xj);Ee("Hmm",vj);Ee("Hmmss",xj);vt(["H","HH"],qt);vt(["k","kk"],function(e,t,n){var r=rt(e);t[qt]=r===24?0:r});vt(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e});vt(["h","hh"],function(e,t,n){t[qt]=rt(e),Qe(n).bigHour=!0});vt("hmm",function(e,t,n){var r=e.length-2;t[qt]=rt(e.substr(0,r)),t[kr]=rt(e.substr(r)),Qe(n).bigHour=!0});vt("hmmss",function(e,t,n){var r=e.length-4,s=e.length-2;t[qt]=rt(e.substr(0,r)),t[kr]=rt(e.substr(r,2)),t[js]=rt(e.substr(s)),Qe(n).bigHour=!0});vt("Hmm",function(e,t,n){var r=e.length-2;t[qt]=rt(e.substr(0,r)),t[kr]=rt(e.substr(r))});vt("Hmmss",function(e,t,n){var r=e.length-4,s=e.length-2;t[qt]=rt(e.substr(0,r)),t[kr]=rt(e.substr(r,2)),t[js]=rt(e.substr(s))});function R3(e){return(e+"").toLowerCase().charAt(0)==="p"}var A3=/[ap]\.?m?\.?/i,D3=ol("Hours",!0);function O3(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}var Rj={calendar:_4,longDateFormat:j4,invalidDate:N4,ordinal:P4,dayOfMonthOrdinalParse:R4,relativeTime:D4,months:Z4,monthsShort:_j,week:a3,weekdays:m3,weekdaysMin:p3,weekdaysShort:Nj,meridiemParse:A3},Tt={},kl={},Tc;function I3(e,t){var n,r=Math.min(e.length,t.length);for(n=0;n0;){if(s=Nh(o.slice(0,n).join("-")),s)return s;if(r&&r.length>=n&&I3(o,r)>=n-1)break;n--}t++}return Tc}function L3(e){return!!(e&&e.match("^[^/\\\\]*$"))}function Nh(e){var t=null,n;if(Tt[e]===void 0&&typeof Ed<"u"&&Ed&&Ed.exports&&L3(e))try{t=Tc._abbr,n=require,n("./locale/"+e),_o(t)}catch{Tt[e]=null}return Tt[e]}function _o(e,t){var n;return e&&(Nn(t)?n=Ys(e):n=lx(e,t),n?Tc=n:typeof console<"u"&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),Tc._abbr}function lx(e,t){if(t!==null){var n,r=Rj;if(t.abbr=e,Tt[e]!=null)mj("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),r=Tt[e]._config;else if(t.parentLocale!=null)if(Tt[t.parentLocale]!=null)r=Tt[t.parentLocale]._config;else if(n=Nh(t.parentLocale),n!=null)r=n._config;else return kl[t.parentLocale]||(kl[t.parentLocale]=[]),kl[t.parentLocale].push({name:e,config:t}),null;return Tt[e]=new Qv(kg(r,t)),kl[e]&&kl[e].forEach(function(s){lx(s.name,s.config)}),_o(e),Tt[e]}else return delete Tt[e],null}function z3(e,t){if(t!=null){var n,r,s=Rj;Tt[e]!=null&&Tt[e].parentLocale!=null?Tt[e].set(kg(Tt[e]._config,t)):(r=Nh(e),r!=null&&(s=r._config),t=kg(s,t),r==null&&(t.abbr=e),n=new Qv(t),n.parentLocale=Tt[e],Tt[e]=n),_o(e)}else Tt[e]!=null&&(Tt[e].parentLocale!=null?(Tt[e]=Tt[e].parentLocale,e===_o()&&_o(e)):Tt[e]!=null&&delete Tt[e]);return Tt[e]}function Ys(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return Tc;if(!Ar(e)){if(t=Nh(e),t)return t;e=[e]}return M3(e)}function F3(){return Cg(Tt)}function cx(e){var t,n=e._a;return n&&Qe(e).overflow===-2&&(t=n[Cs]<0||n[Cs]>11?Cs:n[Hr]<1||n[Hr]>sx(n[pn],n[Cs])?Hr:n[qt]<0||n[qt]>24||n[qt]===24&&(n[kr]!==0||n[js]!==0||n[qo]!==0)?qt:n[kr]<0||n[kr]>59?kr:n[js]<0||n[js]>59?js:n[qo]<0||n[qo]>999?qo:-1,Qe(e)._overflowDayOfYear&&(tHr)&&(t=Hr),Qe(e)._overflowWeeks&&t===-1&&(t=B4),Qe(e)._overflowWeekday&&t===-1&&(t=W4),Qe(e).overflow=t),e}var $3=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,U3=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,V3=/Z|[+-]\d\d(?::?\d\d)?/,Ju=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],tp=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],B3=/^\/?Date\((-?\d+)/i,W3=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,H3={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Aj(e){var t,n,r=e._i,s=$3.exec(r)||U3.exec(r),o,i,a,c,u=Ju.length,d=tp.length;if(s){for(Qe(e).iso=!0,t=0,n=u;tXl(i)||e._dayOfYear===0)&&(Qe(e)._overflowDayOfYear=!0),n=Ec(i,0,e._dayOfYear),e._a[Cs]=n.getUTCMonth(),e._a[Hr]=n.getUTCDate()),t=0;t<3&&e._a[t]==null;++t)e._a[t]=r[t]=s[t];for(;t<7;t++)e._a[t]=r[t]=e._a[t]==null?t===2?1:0:e._a[t];e._a[qt]===24&&e._a[kr]===0&&e._a[js]===0&&e._a[qo]===0&&(e._nextDay=!0,e._a[qt]=0),e._d=(e._useUTC?Ec:o3).apply(null,r),o=e._useUTC?e._d.getUTCDay():e._d.getDay(),e._tzm!=null&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[qt]=24),e._w&&typeof e._w.d<"u"&&e._w.d!==o&&(Qe(e).weekdayMismatch=!0)}}function J3(e){var t,n,r,s,o,i,a,c,u;t=e._w,t.GG!=null||t.W!=null||t.E!=null?(o=1,i=4,n=Hi(t.GG,e._a[pn],Nc(Ct(),1,4).year),r=Hi(t.W,1),s=Hi(t.E,1),(s<1||s>7)&&(c=!0)):(o=e._locale._week.dow,i=e._locale._week.doy,u=Nc(Ct(),o,i),n=Hi(t.gg,e._a[pn],u.year),r=Hi(t.w,u.week),t.d!=null?(s=t.d,(s<0||s>6)&&(c=!0)):t.e!=null?(s=t.e+o,(t.e<0||t.e>6)&&(c=!0)):s=o),r<1||r>Ps(n,o,i)?Qe(e)._overflowWeeks=!0:c!=null?Qe(e)._overflowWeekday=!0:(a=Ej(n,r,s,o,i),e._a[pn]=a.year,e._dayOfYear=a.dayOfYear)}xe.ISO_8601=function(){};xe.RFC_2822=function(){};function dx(e){if(e._f===xe.ISO_8601){Aj(e);return}if(e._f===xe.RFC_2822){Dj(e);return}e._a=[],Qe(e).empty=!0;var t=""+e._i,n,r,s,o,i,a=t.length,c=0,u,d;for(s=pj(e._f,e._locale).match(Jv)||[],d=s.length,n=0;n0&&Qe(e).unusedInput.push(i),t=t.slice(t.indexOf(r)+r.length),c+=r.length),ba[o]?(r?Qe(e).empty=!1:Qe(e).unusedTokens.push(o),V4(o,r,e)):e._strict&&!r&&Qe(e).unusedTokens.push(o);Qe(e).charsLeftOver=a-c,t.length>0&&Qe(e).unusedInput.push(t),e._a[qt]<=12&&Qe(e).bigHour===!0&&e._a[qt]>0&&(Qe(e).bigHour=void 0),Qe(e).parsedDateParts=e._a.slice(0),Qe(e).meridiem=e._meridiem,e._a[qt]=e5(e._locale,e._a[qt],e._meridiem),u=Qe(e).era,u!==null&&(e._a[pn]=e._locale.erasConvertYear(u,e._a[pn])),ux(e),cx(e)}function e5(e,t,n){var r;return n==null?t:e.meridiemHour!=null?e.meridiemHour(t,n):(e.isPM!=null&&(r=e.isPM(n),r&&t<12&&(t+=12),!r&&t===12&&(t=0)),t)}function t5(e){var t,n,r,s,o,i,a=!1,c=e._f.length;if(c===0){Qe(e).invalidFormat=!0,e._d=new Date(NaN);return}for(s=0;sthis?this:e:bh()});function Mj(e,t){var n,r;if(t.length===1&&Ar(t[0])&&(t=t[0]),!t.length)return Ct();for(n=t[0],r=1;rthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function _5(){if(!Nn(this._isDSTShifted))return this._isDSTShifted;var e={},t;return Xv(e,this),e=Oj(e),e._a?(t=e._isUTC?os(e._a):Ct(e._a),this._isDSTShifted=this.isValid()&&h5(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function S5(){return this.isValid()?!this._isUTC:!1}function k5(){return this.isValid()?this._isUTC:!1}function zj(){return this.isValid()?this._isUTC&&this._offset===0:!1}var C5=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,j5=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Lr(e,t){var n=e,r=null,s,o,i;return _d(e)?n={ms:e._milliseconds,d:e._days,M:e._months}:zs(e)||!isNaN(+e)?(n={},t?n[t]=+e:n.milliseconds=+e):(r=C5.exec(e))?(s=r[1]==="-"?-1:1,n={y:0,d:rt(r[Hr])*s,h:rt(r[qt])*s,m:rt(r[kr])*s,s:rt(r[js])*s,ms:rt(Eg(r[qo]*1e3))*s}):(r=j5.exec(e))?(s=r[1]==="-"?-1:1,n={y:Fo(r[2],s),M:Fo(r[3],s),w:Fo(r[4],s),d:Fo(r[5],s),h:Fo(r[6],s),m:Fo(r[7],s),s:Fo(r[8],s)}):n==null?n={}:typeof n=="object"&&("from"in n||"to"in n)&&(i=E5(Ct(n.from),Ct(n.to)),n={},n.ms=i.milliseconds,n.M=i.months),o=new Th(n),_d(e)&&dt(e,"_locale")&&(o._locale=e._locale),_d(e)&&dt(e,"_isValid")&&(o._isValid=e._isValid),o}Lr.fn=Th.prototype;Lr.invalid=f5;function Fo(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function Eb(e,t){var n={};return n.months=t.month()-e.month()+(t.year()-e.year())*12,e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function E5(e,t){var n;return e.isValid()&&t.isValid()?(t=hx(t,e),e.isBefore(t)?n=Eb(e,t):(n=Eb(t,e),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function Fj(e,t){return function(n,r){var s,o;return r!==null&&!isNaN(+r)&&(mj(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),o=n,n=r,r=o),s=Lr(n,r),$j(this,s,e),this}}function $j(e,t,n,r){var s=t._milliseconds,o=Eg(t._days),i=Eg(t._months);e.isValid()&&(r=r??!0,i&&kj(e,jc(e,"Month")+i*n),o&&bj(e,"Date",jc(e,"Date")+o*n),s&&e._d.setTime(e._d.valueOf()+s*n),r&&xe.updateOffset(e,o||i))}var N5=Fj(1,"add"),T5=Fj(-1,"subtract");function Uj(e){return typeof e=="string"||e instanceof String}function P5(e){return Dr(e)||cu(e)||Uj(e)||zs(e)||A5(e)||R5(e)||e===null||e===void 0}function R5(e){var t=ni(e)&&!Zv(e),n=!1,r=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],s,o,i=r.length;for(s=0;sn.valueOf():n.valueOf()9999?bd(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):is(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",bd(n,"Z")):bd(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Y5(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="",n,r,s,o;return this.isLocal()||(e=this.utcOffset()===0?"moment.utc":"moment.parseZone",t="Z"),n="["+e+'("]',r=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",s="-MM-DD[T]HH:mm:ss.SSS",o=t+'[")]',this.format(n+r+s+o)}function K5(e){e||(e=this.isUtc()?xe.defaultFormatUtc:xe.defaultFormat);var t=bd(this,e);return this.localeData().postformat(t)}function G5(e,t){return this.isValid()&&(Dr(e)&&e.isValid()||Ct(e).isValid())?Lr({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function Z5(e){return this.from(Ct(),e)}function q5(e,t){return this.isValid()&&(Dr(e)&&e.isValid()||Ct(e).isValid())?Lr({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function X5(e){return this.to(Ct(),e)}function Vj(e){var t;return e===void 0?this._locale._abbr:(t=Ys(e),t!=null&&(this._locale=t),this)}var Bj=hr("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return e===void 0?this.localeData():this.locale(e)});function Wj(){return this._locale}var df=1e3,_a=60*df,ff=60*_a,Hj=(365*400+97)*24*ff;function Sa(e,t){return(e%t+t)%t}function Yj(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-Hj:new Date(e,t,n).valueOf()}function Kj(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-Hj:Date.UTC(e,t,n)}function Q5(e){var t,n;if(e=mr(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?Kj:Yj,e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=Sa(t+(this._isUTC?0:this.utcOffset()*_a),ff);break;case"minute":t=this._d.valueOf(),t-=Sa(t,_a);break;case"second":t=this._d.valueOf(),t-=Sa(t,df);break}return this._d.setTime(t),xe.updateOffset(this,!0),this}function J5(e){var t,n;if(e=mr(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?Kj:Yj,e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=ff-Sa(t+(this._isUTC?0:this.utcOffset()*_a),ff)-1;break;case"minute":t=this._d.valueOf(),t+=_a-Sa(t,_a)-1;break;case"second":t=this._d.valueOf(),t+=df-Sa(t,df)-1;break}return this._d.setTime(t),xe.updateOffset(this,!0),this}function e6(){return this._d.valueOf()-(this._offset||0)*6e4}function t6(){return Math.floor(this.valueOf()/1e3)}function n6(){return new Date(this.valueOf())}function r6(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function s6(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function o6(){return this.isValid()?this.toISOString():null}function i6(){return qv(this)}function a6(){return uo({},Qe(this))}function l6(){return Qe(this).overflow}function c6(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}Le("N",0,0,"eraAbbr");Le("NN",0,0,"eraAbbr");Le("NNN",0,0,"eraAbbr");Le("NNNN",0,0,"eraName");Le("NNNNN",0,0,"eraNarrow");Le("y",["y",1],"yo","eraYear");Le("y",["yy",2],0,"eraYear");Le("y",["yyy",3],0,"eraYear");Le("y",["yyyy",4],0,"eraYear");Ee("N",mx);Ee("NN",mx);Ee("NNN",mx);Ee("NNNN",w6);Ee("NNNNN",b6);vt(["N","NN","NNN","NNNN","NNNNN"],function(e,t,n,r){var s=n._locale.erasParse(e,r,n._strict);s?Qe(n).era=s:Qe(n).invalidEra=e});Ee("y",rl);Ee("yy",rl);Ee("yyy",rl);Ee("yyyy",rl);Ee("yo",_6);vt(["y","yy","yyy","yyyy"],pn);vt(["yo"],function(e,t,n,r){var s;n._locale._eraYearOrdinalRegex&&(s=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[pn]=n._locale.eraYearOrdinalParse(e,s):t[pn]=parseInt(e,10)});function u6(e,t){var n,r,s,o=this._eras||Ys("en")._eras;for(n=0,r=o.length;n=0)return o[r]}function f6(e,t){var n=e.since<=e.until?1:-1;return t===void 0?xe(e.since).year():xe(e.since).year()+(t-e.offset)*n}function h6(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;eo&&(t=o),T6.call(this,e,t,n,r,s))}function T6(e,t,n,r,s){var o=Ej(e,t,n,r,s),i=Ec(o.year,0,o.dayOfYear);return this.year(i.getUTCFullYear()),this.month(i.getUTCMonth()),this.date(i.getUTCDate()),this}Le("Q",0,"Qo","quarter");Ee("Q",gj);vt("Q",function(e,t){t[Cs]=(rt(e)-1)*3});function P6(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}Le("D",["DD",2],"Do","date");Ee("D",jt,sl);Ee("DD",jt,er);Ee("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient});vt(["D","DD"],Hr);vt("Do",function(e,t){t[Hr]=rt(e.match(jt)[0])});var Zj=ol("Date",!0);Le("DDD",["DDDD",3],"DDDo","dayOfYear");Ee("DDD",Sh);Ee("DDDD",yj);vt(["DDD","DDDD"],function(e,t,n){n._dayOfYear=rt(e)});function R6(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return e==null?t:this.add(e-t,"d")}Le("m",["mm",2],0,"minute");Ee("m",jt,rx);Ee("mm",jt,er);vt(["m","mm"],kr);var A6=ol("Minutes",!1);Le("s",["ss",2],0,"second");Ee("s",jt,rx);Ee("ss",jt,er);vt(["s","ss"],js);var D6=ol("Seconds",!1);Le("S",0,0,function(){return~~(this.millisecond()/100)});Le(0,["SS",2],0,function(){return~~(this.millisecond()/10)});Le(0,["SSS",3],0,"millisecond");Le(0,["SSSS",4],0,function(){return this.millisecond()*10});Le(0,["SSSSS",5],0,function(){return this.millisecond()*100});Le(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3});Le(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4});Le(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5});Le(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6});Ee("S",Sh,gj);Ee("SS",Sh,er);Ee("SSS",Sh,yj);var fo,qj;for(fo="SSSS";fo.length<=9;fo+="S")Ee(fo,rl);function O6(e,t){t[qo]=rt(("0."+e)*1e3)}for(fo="S";fo.length<=9;fo+="S")vt(fo,O6);qj=ol("Milliseconds",!1);Le("z",0,0,"zoneAbbr");Le("zz",0,0,"zoneName");function I6(){return this._isUTC?"UTC":""}function M6(){return this._isUTC?"Coordinated Universal Time":""}var ce=uu.prototype;ce.add=N5;ce.calendar=I5;ce.clone=M5;ce.diff=B5;ce.endOf=J5;ce.format=K5;ce.from=G5;ce.fromNow=Z5;ce.to=q5;ce.toNow=X5;ce.get=Y4;ce.invalidAt=l6;ce.isAfter=L5;ce.isBefore=z5;ce.isBetween=F5;ce.isSame=$5;ce.isSameOrAfter=U5;ce.isSameOrBefore=V5;ce.isValid=i6;ce.lang=Bj;ce.locale=Vj;ce.localeData=Wj;ce.max=i5;ce.min=o5;ce.parsingFlags=a6;ce.set=K4;ce.startOf=Q5;ce.subtract=T5;ce.toArray=r6;ce.toObject=s6;ce.toDate=n6;ce.toISOString=H5;ce.inspect=Y5;typeof Symbol<"u"&&Symbol.for!=null&&(ce[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"});ce.toJSON=o6;ce.toString=W5;ce.unix=t6;ce.valueOf=e6;ce.creationData=c6;ce.eraName=h6;ce.eraNarrow=m6;ce.eraAbbr=p6;ce.eraYear=g6;ce.year=wj;ce.isLeapYear=H4;ce.weekYear=S6;ce.isoWeekYear=k6;ce.quarter=ce.quarters=P6;ce.month=Cj;ce.daysInMonth=n3;ce.week=ce.weeks=u3;ce.isoWeek=ce.isoWeeks=d3;ce.weeksInYear=E6;ce.weeksInWeekYear=N6;ce.isoWeeksInYear=C6;ce.isoWeeksInISOWeekYear=j6;ce.date=Zj;ce.day=ce.days=k3;ce.weekday=C3;ce.isoWeekday=j3;ce.dayOfYear=R6;ce.hour=ce.hours=D3;ce.minute=ce.minutes=A6;ce.second=ce.seconds=D6;ce.millisecond=ce.milliseconds=qj;ce.utcOffset=p5;ce.utc=y5;ce.local=v5;ce.parseZone=x5;ce.hasAlignedHourOffset=w5;ce.isDST=b5;ce.isLocal=S5;ce.isUtcOffset=k5;ce.isUtc=zj;ce.isUTC=zj;ce.zoneAbbr=I6;ce.zoneName=M6;ce.dates=hr("dates accessor is deprecated. Use date instead.",Zj);ce.months=hr("months accessor is deprecated. Use month instead",Cj);ce.years=hr("years accessor is deprecated. Use year instead",wj);ce.zone=hr("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",g5);ce.isDSTShifted=hr("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",_5);function L6(e){return Ct(e*1e3)}function z6(){return Ct.apply(null,arguments).parseZone()}function Xj(e){return e}var ft=Qv.prototype;ft.calendar=S4;ft.longDateFormat=E4;ft.invalidDate=T4;ft.ordinal=A4;ft.preparse=Xj;ft.postformat=Xj;ft.relativeTime=O4;ft.pastFuture=I4;ft.set=b4;ft.eras=u6;ft.erasParse=d6;ft.erasConvertYear=f6;ft.erasAbbrRegex=v6;ft.erasNameRegex=y6;ft.erasNarrowRegex=x6;ft.months=Q4;ft.monthsShort=J4;ft.monthsParse=t3;ft.monthsRegex=s3;ft.monthsShortRegex=r3;ft.week=i3;ft.firstDayOfYear=c3;ft.firstDayOfWeek=l3;ft.weekdays=x3;ft.weekdaysMin=b3;ft.weekdaysShort=w3;ft.weekdaysParse=S3;ft.weekdaysRegex=E3;ft.weekdaysShortRegex=N3;ft.weekdaysMinRegex=T3;ft.isPM=R3;ft.meridiem=O3;function hf(e,t,n,r){var s=Ys(),o=os().set(r,t);return s[n](o,e)}function Qj(e,t,n){if(zs(e)&&(t=e,e=void 0),e=e||"",t!=null)return hf(e,t,n,"month");var r,s=[];for(r=0;r<12;r++)s[r]=hf(e,r,n,"month");return s}function gx(e,t,n,r){typeof e=="boolean"?(zs(t)&&(n=t,t=void 0),t=t||""):(t=e,n=t,e=!1,zs(t)&&(n=t,t=void 0),t=t||"");var s=Ys(),o=e?s._week.dow:0,i,a=[];if(n!=null)return hf(t,(n+o)%7,r,"day");for(i=0;i<7;i++)a[i]=hf(t,(i+o)%7,r,"day");return a}function F6(e,t){return Qj(e,t,"months")}function $6(e,t){return Qj(e,t,"monthsShort")}function U6(e,t,n){return gx(e,t,n,"weekdays")}function V6(e,t,n){return gx(e,t,n,"weekdaysShort")}function B6(e,t,n){return gx(e,t,n,"weekdaysMin")}_o("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,n=rt(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return e+n}});xe.lang=hr("moment.lang is deprecated. Use moment.locale instead.",_o);xe.langData=hr("moment.langData is deprecated. Use moment.localeData instead.",Ys);var gs=Math.abs;function W6(){var e=this._data;return this._milliseconds=gs(this._milliseconds),this._days=gs(this._days),this._months=gs(this._months),e.milliseconds=gs(e.milliseconds),e.seconds=gs(e.seconds),e.minutes=gs(e.minutes),e.hours=gs(e.hours),e.months=gs(e.months),e.years=gs(e.years),this}function Jj(e,t,n,r){var s=Lr(t,n);return e._milliseconds+=r*s._milliseconds,e._days+=r*s._days,e._months+=r*s._months,e._bubble()}function H6(e,t){return Jj(this,e,t,1)}function Y6(e,t){return Jj(this,e,t,-1)}function Nb(e){return e<0?Math.floor(e):Math.ceil(e)}function K6(){var e=this._milliseconds,t=this._days,n=this._months,r=this._data,s,o,i,a,c;return e>=0&&t>=0&&n>=0||e<=0&&t<=0&&n<=0||(e+=Nb(Tg(n)+t)*864e5,t=0,n=0),r.milliseconds=e%1e3,s=or(e/1e3),r.seconds=s%60,o=or(s/60),r.minutes=o%60,i=or(o/60),r.hours=i%24,t+=or(i/24),c=or(eE(t)),n+=c,t-=Nb(Tg(c)),a=or(n/12),n%=12,r.days=t,r.months=n,r.years=a,this}function eE(e){return e*4800/146097}function Tg(e){return e*146097/4800}function G6(e){if(!this.isValid())return NaN;var t,n,r=this._milliseconds;if(e=mr(e),e==="month"||e==="quarter"||e==="year")switch(t=this._days+r/864e5,n=this._months+eE(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Tg(this._months)),e){case"week":return t/7+r/6048e5;case"day":return t+r/864e5;case"hour":return t*24+r/36e5;case"minute":return t*1440+r/6e4;case"second":return t*86400+r/1e3;case"millisecond":return Math.floor(t*864e5)+r;default:throw new Error("Unknown unit "+e)}}function Ks(e){return function(){return this.as(e)}}var tE=Ks("ms"),Z6=Ks("s"),q6=Ks("m"),X6=Ks("h"),Q6=Ks("d"),J6=Ks("w"),e$=Ks("M"),t$=Ks("Q"),n$=Ks("y"),r$=tE;function s$(){return Lr(this)}function o$(e){return e=mr(e),this.isValid()?this[e+"s"]():NaN}function Ei(e){return function(){return this.isValid()?this._data[e]:NaN}}var i$=Ei("milliseconds"),a$=Ei("seconds"),l$=Ei("minutes"),c$=Ei("hours"),u$=Ei("days"),d$=Ei("months"),f$=Ei("years");function h$(){return or(this.days()/7)}var ws=Math.round,la={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function m$(e,t,n,r,s){return s.relativeTime(t||1,!!n,e,r)}function p$(e,t,n,r){var s=Lr(e).abs(),o=ws(s.as("s")),i=ws(s.as("m")),a=ws(s.as("h")),c=ws(s.as("d")),u=ws(s.as("M")),d=ws(s.as("w")),f=ws(s.as("y")),h=o<=n.ss&&["s",o]||o0,h[4]=r,m$.apply(null,h)}function g$(e){return e===void 0?ws:typeof e=="function"?(ws=e,!0):!1}function y$(e,t){return la[e]===void 0?!1:t===void 0?la[e]:(la[e]=t,e==="s"&&(la.ss=t-1),!0)}function v$(e,t){if(!this.isValid())return this.localeData().invalidDate();var n=!1,r=la,s,o;return typeof e=="object"&&(t=e,e=!1),typeof e=="boolean"&&(n=e),typeof t=="object"&&(r=Object.assign({},la,t),t.s!=null&&t.ss==null&&(r.ss=t.s-1)),s=this.localeData(),o=p$(this,!n,r,s),n&&(o=s.pastFuture(+this,o)),s.postformat(o)}var np=Math.abs;function Ui(e){return(e>0)-(e<0)||+e}function Rh(){if(!this.isValid())return this.localeData().invalidDate();var e=np(this._milliseconds)/1e3,t=np(this._days),n=np(this._months),r,s,o,i,a=this.asSeconds(),c,u,d,f;return a?(r=or(e/60),s=or(r/60),e%=60,r%=60,o=or(n/12),n%=12,i=e?e.toFixed(3).replace(/\.?0+$/,""):"",c=a<0?"-":"",u=Ui(this._months)!==Ui(a)?"-":"",d=Ui(this._days)!==Ui(a)?"-":"",f=Ui(this._milliseconds)!==Ui(a)?"-":"",c+"P"+(o?u+o+"Y":"")+(n?u+n+"M":"")+(t?d+t+"D":"")+(s||r||e?"T":"")+(s?f+s+"H":"")+(r?f+r+"M":"")+(e?f+i+"S":"")):"P0D"}var at=Th.prototype;at.isValid=d5;at.abs=W6;at.add=H6;at.subtract=Y6;at.as=G6;at.asMilliseconds=tE;at.asSeconds=Z6;at.asMinutes=q6;at.asHours=X6;at.asDays=Q6;at.asWeeks=J6;at.asMonths=e$;at.asQuarters=t$;at.asYears=n$;at.valueOf=r$;at._bubble=K6;at.clone=s$;at.get=o$;at.milliseconds=i$;at.seconds=a$;at.minutes=l$;at.hours=c$;at.days=u$;at.weeks=h$;at.months=d$;at.years=f$;at.humanize=v$;at.toISOString=Rh;at.toString=Rh;at.toJSON=Rh;at.locale=Vj;at.localeData=Wj;at.toIsoString=hr("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Rh);at.lang=Bj;Le("X",0,0,"unix");Le("x",0,0,"valueOf");Ee("x",Ch);Ee("X",F4);vt("X",function(e,t,n){n._d=new Date(parseFloat(e)*1e3)});vt("x",function(e,t,n){n._d=new Date(rt(e))});//! moment.js +xe.version="2.30.1";x4(Ct);xe.fn=ce;xe.min=a5;xe.max=l5;xe.now=c5;xe.utc=os;xe.unix=L6;xe.months=F6;xe.isDate=cu;xe.locale=_o;xe.invalid=bh;xe.duration=Lr;xe.isMoment=Dr;xe.weekdays=U6;xe.parseZone=z6;xe.localeData=Ys;xe.isDuration=_d;xe.monthsShort=$6;xe.weekdaysMin=B6;xe.defineLocale=lx;xe.updateLocale=z3;xe.locales=F3;xe.weekdaysShort=V6;xe.normalizeUnits=mr;xe.relativeTimeRounding=g$;xe.relativeTimeThreshold=y$;xe.calendarFormat=O5;xe.prototype=ce;xe.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};const x$=async()=>await ot().collection("access").getFullList({sort:"-created",filter:"deleted = null"}),as=async e=>e.id?await ot().collection("access").update(e.id,e):await ot().collection("access").create(e),w$=async e=>(e.deleted=xe.utc().format("YYYY-MM-DD HH:mm:ss"),await ot().collection("access").update(e.id,e)),Tb=async()=>await ot().collection("access_groups").getFullList({sort:"-created",expand:"access"}),b$=async e=>{const t=ot();if((await t.collection("access").getList(1,1,{filter:`group='${e}' && deleted=null`})).items.length>0)throw new Error("该分组下有授权配置,无法删除");await t.collection("access_groups").delete(e)},_$=async e=>{const t=ot();return e.id?await t.collection("access_groups").update(e.id,e):await t.collection("access_groups").create(e)},Pb=async e=>await ot().collection("access_groups").update(e.id,e),S$=async()=>{try{return await ot().collection("settings").getFirstListItem("name='emails'")}catch{return{content:{emails:[]}}}},yx=async e=>{try{return await ot().collection("settings").getFirstListItem(`name='${e}'`)}catch{return{name:e}}},il=async e=>{const t=ot();let n;return e.id?n=await t.collection("settings").update(e.id,e):n=await t.collection("settings").create(e),n},k$=(e,t)=>{switch(t.type){case"SET_ACCESSES":return{...e,accesses:t.payload};case"ADD_ACCESS":return{...e,accesses:[t.payload,...e.accesses]};case"DELETE_ACCESS":return{...e,accesses:e.accesses.filter(n=>n.id!==t.payload)};case"UPDATE_ACCESS":return{...e,accesses:e.accesses.map(n=>n.id===t.payload.id?t.payload:n)};case"SET_EMAILS":return{...e,emails:t.payload};case"ADD_EMAIL":return{...e,emails:{...e.emails,content:{emails:[...e.emails.content.emails,t.payload]}}};case"SET_ACCESS_GROUPS":return{...e,accessGroups:t.payload};default:return e}},nE=y.createContext({}),ln=()=>y.useContext(nE),C$=({children:e})=>{const[t,n]=y.useReducer(k$,{accesses:[],emails:{content:{emails:[]}},accessGroups:[]});y.useEffect(()=>{(async()=>{const d=await x$();n({type:"SET_ACCESSES",payload:d})})()},[]),y.useEffect(()=>{(async()=>{const d=await S$();n({type:"SET_EMAILS",payload:d})})()},[]),y.useEffect(()=>{(async()=>{const d=await Tb();n({type:"SET_ACCESS_GROUPS",payload:d})})()},[]);const r=y.useCallback(async()=>{const u=await Tb();n({type:"SET_ACCESS_GROUPS",payload:u})},[]),s=y.useCallback(u=>{n({type:"SET_EMAILS",payload:u})},[]),o=y.useCallback(u=>{n({type:"DELETE_ACCESS",payload:u})},[]),i=y.useCallback(u=>{n({type:"ADD_ACCESS",payload:u})},[]),a=y.useCallback(u=>{n({type:"UPDATE_ACCESS",payload:u})},[]),c=y.useCallback(u=>{n({type:"SET_ACCESS_GROUPS",payload:u})},[]);return l.jsx(nE.Provider,{value:{config:{accesses:t.accesses,emails:t.emails,accessGroups:t.accessGroups},deleteAccess:o,addAccess:i,setEmails:s,updateAccess:a,setAccessGroups:c,reloadAccessGroups:r},children:e&&e})};var j$="Separator",Rb="horizontal",E$=["horizontal","vertical"],rE=y.forwardRef((e,t)=>{const{decorative:n,orientation:r=Rb,...s}=e,o=N$(r)?r:Rb,a=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return l.jsx(Pe.div,{"data-orientation":o,...a,...s,ref:t})});rE.displayName=j$;function N$(e){return E$.includes(e)}var sE=rE;const br=y.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},s)=>l.jsx(sE,{ref:s,decorative:n,orientation:t,className:re("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));br.displayName=sE.displayName;const T$="Certimate v0.2.1",oE=()=>{const{t:e}=Ye();return l.jsxs("div",{className:"fixed right-0 bottom-0 w-full flex justify-between p-5",children:[l.jsx("div",{className:""}),l.jsxs("div",{className:"text-muted-foreground text-sm hover:text-stone-900 dark:hover:text-stone-200 flex",children:[l.jsxs("a",{href:"https://docs.certimate.me",target:"_blank",className:"flex items-center",children:[l.jsx(XO,{size:16}),l.jsx("div",{className:"ml-1",children:e("common.menu.document")})]}),l.jsx(br,{orientation:"vertical",className:"mx-2"}),l.jsx("a",{href:"https://github.com/usual2970/certimate/releases",target:"_blank",children:T$})]})]})};function P$(){const e=Jn(),t=Ir(),{t:n}=Ye();if(!ot().authStore.isValid||!ot().authStore.isAdmin)return l.jsx(KS,{to:"/login"});const r=t.pathname,s=a=>a==r?"bg-muted text-primary":"text-muted-foreground",o=()=>{ot().authStore.clear(),e("/login")},i=()=>{e("/setting/account")};return l.jsx(l.Fragment,{children:l.jsx(C$,{children:l.jsxs("div",{className:"grid min-h-screen w-full md:grid-cols-[180px_1fr] lg:grid-cols-[200px_1fr] 2xl:md:grid-cols-[280px_1fr] ",children:[l.jsx("div",{className:"hidden border-r dark:border-stone-500 bg-muted/40 md:block",children:l.jsxs("div",{className:"flex h-full max-h-screen flex-col gap-2",children:[l.jsx("div",{className:"flex h-14 items-center border-b dark:border-stone-500 px-4 lg:h-[60px] lg:px-6",children:l.jsxs(wn,{to:"/",className:"flex items-center gap-2 font-semibold",children:[l.jsx("img",{src:"/vite.svg",className:"w-[36px] h-[36px]"}),l.jsx("span",{className:"dark:text-white",children:"Certimate"})]})}),l.jsx("div",{className:"flex-1",children:l.jsxs("nav",{className:"grid items-start px-2 text-sm font-medium lg:px-4",children:[l.jsxs(wn,{to:"/",className:re("flex items-center gap-3 rounded-lg px-3 py-2 transition-all hover:text-primary",s("/")),children:[l.jsx(Yw,{className:"h-4 w-4"}),n("dashboard.page.title")]}),l.jsxs(wn,{to:"/domains",className:re("flex items-center gap-3 rounded-lg px-3 py-2 transition-all hover:text-primary",s("/domains")),children:[l.jsx(mg,{className:"h-4 w-4"}),n("domain.page.title")]}),l.jsxs(wn,{to:"/access",className:re("flex items-center gap-3 rounded-lg px-3 py-2 transition-all hover:text-primary",s("/access")),children:[l.jsx(Kw,{className:"h-4 w-4"}),n("access.page.title")]}),l.jsxs(wn,{to:"/history",className:re("flex items-center gap-3 rounded-lg px-3 py-2 transition-all hover:text-primary",s("/history")),children:[l.jsx(Hw,{className:"h-4 w-4"}),n("history.page.title")]})]})})]})}),l.jsxs("div",{className:"flex flex-col",children:[l.jsxs("header",{className:"flex h-14 items-center gap-4 border-b dark:border-stone-500 bg-muted/40 px-4 lg:h-[60px] lg:px-6",children:[l.jsxs(Wv,{children:[l.jsx(Hv,{asChild:!0,children:l.jsxs(Me,{variant:"outline",size:"icon",className:"shrink-0 md:hidden",children:[l.jsx(lI,{className:"h-5 w-5 dark:text-white"}),l.jsx("span",{className:"sr-only",children:"Toggle navigation menu"})]})}),l.jsx(wh,{side:"left",className:"flex flex-col",children:l.jsxs("nav",{className:"grid gap-2 text-lg font-medium",children:[l.jsxs(wn,{to:"/",className:"flex items-center gap-2 text-lg font-semibold",children:[l.jsx("img",{src:"/vite.svg",className:"w-[36px] h-[36px]"}),l.jsx("span",{className:"dark:text-white",children:"Certimate"}),l.jsx("span",{className:"sr-only",children:"Certimate"})]}),l.jsxs(wn,{to:"/",className:re("mx-[-0.65rem] flex items-center gap-4 rounded-xl px-3 py-2 hover:text-foreground",s("/")),children:[l.jsx(Yw,{className:"h-5 w-5"}),n("dashboard.page.title")]}),l.jsxs(wn,{to:"/domains",className:re("mx-[-0.65rem] flex items-center gap-4 rounded-xl px-3 py-2 hover:text-foreground",s("/domains")),children:[l.jsx(mg,{className:"h-5 w-5"}),n("domain.page.title")]}),l.jsxs(wn,{to:"/access",className:re("mx-[-0.65rem] flex items-center gap-4 rounded-xl px-3 py-2 hover:text-foreground",s("/access")),children:[l.jsx(Kw,{className:"h-5 w-5"}),n("access.page.title")]}),l.jsxs(wn,{to:"/history",className:re("mx-[-0.65rem] flex items-center gap-4 rounded-xl px-3 py-2 hover:text-foreground",s("/history")),children:[l.jsx(Hw,{className:"h-5 w-5"}),n("history.page.title")]})]})})]}),l.jsx("div",{className:"w-full flex-1"}),l.jsx(BF,{}),l.jsx(FF,{}),l.jsxs(Iv,{children:[l.jsx(Mv,{asChild:!0,children:l.jsxs(Me,{variant:"secondary",size:"icon",className:"rounded-full",children:[l.jsx(tI,{className:"h-5 w-5"}),l.jsx("span",{className:"sr-only",children:"Toggle user menu"})]})}),l.jsxs(vh,{align:"end",children:[l.jsx(ti,{onClick:i,children:n("common.menu.settings")}),l.jsx(ti,{onClick:o,children:n("common.menu.logout")})]})]})]}),l.jsxs("main",{className:"flex flex-1 flex-col gap-4 p-4 lg:gap-6 lg:p-6 relative",children:[l.jsx(tv,{}),l.jsx(oE,{})]})]})]})})})}var R$="VisuallyHidden",hu=y.forwardRef((e,t)=>l.jsx(Pe.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));hu.displayName=R$;var A$=hu,[Ah,YH]=on("Tooltip",[tl]),Dh=tl(),iE="TooltipProvider",D$=700,Pg="tooltip.open",[O$,vx]=Ah(iE),xx=e=>{const{__scopeTooltip:t,delayDuration:n=D$,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:o}=e,[i,a]=y.useState(!0),c=y.useRef(!1),u=y.useRef(0);return y.useEffect(()=>{const d=u.current;return()=>window.clearTimeout(d)},[]),l.jsx(O$,{scope:t,isOpenDelayed:i,delayDuration:n,onOpen:y.useCallback(()=>{window.clearTimeout(u.current),a(!1)},[]),onClose:y.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>a(!0),r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:y.useCallback(d=>{c.current=d},[]),disableHoverableContent:s,children:o})};xx.displayName=iE;var Oh="Tooltip",[I$,Ih]=Ah(Oh),aE=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:s=!1,onOpenChange:o,disableHoverableContent:i,delayDuration:a}=e,c=vx(Oh,e.__scopeTooltip),u=Dh(t),[d,f]=y.useState(null),h=Bn(),m=y.useRef(0),x=i??c.disableHoverableContent,p=a??c.delayDuration,w=y.useRef(!1),[g=!1,v]=Gn({prop:r,defaultProp:s,onChange:T=>{T?(c.onOpen(),document.dispatchEvent(new CustomEvent(Pg))):c.onClose(),o==null||o(T)}}),b=y.useMemo(()=>g?w.current?"delayed-open":"instant-open":"closed",[g]),_=y.useCallback(()=>{window.clearTimeout(m.current),w.current=!1,v(!0)},[v]),C=y.useCallback(()=>{window.clearTimeout(m.current),v(!1)},[v]),j=y.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{w.current=!0,v(!0)},p)},[p,v]);return y.useEffect(()=>()=>window.clearTimeout(m.current),[]),l.jsx(wv,{...u,children:l.jsx(I$,{scope:t,contentId:h,open:g,stateAttribute:b,trigger:d,onTriggerChange:f,onTriggerEnter:y.useCallback(()=>{c.isOpenDelayed?j():_()},[c.isOpenDelayed,j,_]),onTriggerLeave:y.useCallback(()=>{x?C():window.clearTimeout(m.current)},[C,x]),onOpen:_,onClose:C,disableHoverableContent:x,children:n})})};aE.displayName=Oh;var Rg="TooltipTrigger",lE=y.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=Ih(Rg,n),o=vx(Rg,n),i=Dh(n),a=y.useRef(null),c=Ge(t,a,s.onTriggerChange),u=y.useRef(!1),d=y.useRef(!1),f=y.useCallback(()=>u.current=!1,[]);return y.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),l.jsx(bv,{asChild:!0,...i,children:l.jsx(Pe.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:c,onPointerMove:ue(e.onPointerMove,h=>{h.pointerType!=="touch"&&!d.current&&!o.isPointerInTransitRef.current&&(s.onTriggerEnter(),d.current=!0)}),onPointerLeave:ue(e.onPointerLeave,()=>{s.onTriggerLeave(),d.current=!1}),onPointerDown:ue(e.onPointerDown,()=>{u.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:ue(e.onFocus,()=>{u.current||s.onOpen()}),onBlur:ue(e.onBlur,s.onClose),onClick:ue(e.onClick,s.onClose)})})});lE.displayName=Rg;var M$="TooltipPortal",[KH,L$]=Ah(M$,{forceMount:void 0}),Oa="TooltipContent",wx=y.forwardRef((e,t)=>{const n=L$(Oa,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...o}=e,i=Ih(Oa,e.__scopeTooltip);return l.jsx(an,{present:r||i.open,children:i.disableHoverableContent?l.jsx(cE,{side:s,...o,ref:t}):l.jsx(z$,{side:s,...o,ref:t})})}),z$=y.forwardRef((e,t)=>{const n=Ih(Oa,e.__scopeTooltip),r=vx(Oa,e.__scopeTooltip),s=y.useRef(null),o=Ge(t,s),[i,a]=y.useState(null),{trigger:c,onClose:u}=n,d=s.current,{onPointerInTransitChange:f}=r,h=y.useCallback(()=>{a(null),f(!1)},[f]),m=y.useCallback((x,p)=>{const w=x.currentTarget,g={x:x.clientX,y:x.clientY},v=V$(g,w.getBoundingClientRect()),b=B$(g,v),_=W$(p.getBoundingClientRect()),C=Y$([...b,..._]);a(C),f(!0)},[f]);return y.useEffect(()=>()=>h(),[h]),y.useEffect(()=>{if(c&&d){const x=w=>m(w,d),p=w=>m(w,c);return c.addEventListener("pointerleave",x),d.addEventListener("pointerleave",p),()=>{c.removeEventListener("pointerleave",x),d.removeEventListener("pointerleave",p)}}},[c,d,m,h]),y.useEffect(()=>{if(i){const x=p=>{const w=p.target,g={x:p.clientX,y:p.clientY},v=(c==null?void 0:c.contains(w))||(d==null?void 0:d.contains(w)),b=!H$(g,i);v?h():b&&(h(),u())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[c,d,i,u,h]),l.jsx(cE,{...e,ref:o})}),[F$,$$]=Ah(Oh,{isInside:!1}),cE=y.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:o,onPointerDownOutside:i,...a}=e,c=Ih(Oa,n),u=Dh(n),{onClose:d}=c;return y.useEffect(()=>(document.addEventListener(Pg,d),()=>document.removeEventListener(Pg,d)),[d]),y.useEffect(()=>{if(c.trigger){const f=h=>{const m=h.target;m!=null&&m.contains(c.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[c.trigger,d]),l.jsx(Qa,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:f=>f.preventDefault(),onDismiss:d,children:l.jsxs(_v,{"data-state":c.stateAttribute,...u,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[l.jsx(av,{children:r}),l.jsx(F$,{scope:n,isInside:!0,children:l.jsx(A$,{id:c.contentId,role:"tooltip",children:s||r})})]})})});wx.displayName=Oa;var uE="TooltipArrow",U$=y.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=Dh(n);return $$(uE,n).isInside?null:l.jsx(Sv,{...s,...r,ref:t})});U$.displayName=uE;function V$(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,s,o)){case o:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function B$(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function W$(e){const{top:t,right:n,bottom:r,left:s}=e;return[{x:s,y:t},{x:n,y:t},{x:n,y:r},{x:s,y:r}]}function H$(e,t){const{x:n,y:r}=e;let s=!1;for(let o=0,i=t.length-1;or!=d>r&&n<(u-a)*(r-c)/(d-c)+a&&(s=!s)}return s}function Y$(e){const t=e.slice();return t.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),K$(t)}function K$(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r=2;){const o=t[t.length-1],i=t[t.length-2];if((o.x-i.x)*(s.y-i.y)>=(o.y-i.y)*(s.x-i.x))t.pop();else break}t.push(s)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const s=e[r];for(;n.length>=2;){const o=n[n.length-1],i=n[n.length-2];if((o.x-i.x)*(s.y-i.y)>=(o.y-i.y)*(s.x-i.x))n.pop();else break}n.push(s)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var G$=xx,Z$=aE,q$=lE,dE=wx;const ur=({when:e,children:t,fallback:n})=>e?t:n,bx=({phase:e,phaseSuccess:t})=>{const{t:n}=Ye();let r=0;return e==="check"?r=1:e==="apply"?r=2:e==="deploy"&&(r=3),l.jsxs("div",{className:"flex items-center",children:[l.jsx("div",{className:re("text-xs text-nowrap",r===1?t?"text-green-600":"text-red-600":"",r>1?"text-green-600":""),children:n("history.props.stage.progress.check")}),l.jsx(br,{className:re("h-1 grow max-w-[60px]",r>1?"bg-green-600":"")}),l.jsx("div",{className:re("text-xs text-nowrap",r<2?"text-muted-foreground":"",r===2?t?"text-green-600":"text-red-600":"",r>2?"text-green-600":""),children:n("history.props.stage.progress.apply")}),l.jsx(br,{className:re("h-1 grow max-w-[60px]",r>2?"bg-green-600":"")}),l.jsx("div",{className:re("text-xs text-nowrap",r<3?"text-muted-foreground":"",r===3?t?"text-green-600":"text-red-600":"",r>3?"text-green-600":""),children:n("history.props.stage.progress.deploy")})]})},X$=G$,fE=Z$,hE=q$,mE=y.forwardRef(({className:e,sideOffset:t=4,...n},r)=>l.jsx(dE,{ref:r,sideOffset:t,className:re("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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",e),...n}));mE.displayName=dE.displayName;const _x=({deployment:e})=>{const t=n=>e.log[n]?e.log[n][e.log[n].length-1].error:"";return l.jsx(l.Fragment,{children:e.phase==="deploy"&&e.phaseSuccess||e.wholeSuccess?l.jsx(eI,{size:16,className:"text-green-700"}):l.jsx(l.Fragment,{children:t(e.phase).length?l.jsx(X$,{children:l.jsxs(fE,{children:[l.jsx(hE,{asChild:!0,className:"cursor-pointer",children:l.jsx(Bw,{size:16,className:"text-red-700"})}),l.jsx(mE,{className:"max-w-[35em]",children:t(e.phase)})]})}):l.jsx(Bw,{size:16,className:"text-red-700"})})})},pE=({className:e,...t})=>l.jsx("nav",{role:"navigation","aria-label":"pagination",className:re("mx-auto flex w-full justify-center",e),...t});pE.displayName="Pagination";const gE=y.forwardRef(({className:e,...t},n)=>l.jsx("ul",{ref:n,className:re("flex flex-row items-center gap-1",e),...t}));gE.displayName="PaginationContent";const Ag=y.forwardRef(({className:e,...t},n)=>l.jsx("li",{ref:n,className:re("",e),...t}));Ag.displayName="PaginationItem";const yE=({className:e,isActive:t,size:n="icon",...r})=>l.jsx("a",{"aria-current":t?"page":void 0,className:re(ch({variant:t?"outline":"ghost",size:n}),e),...r});yE.displayName="PaginationLink";const vE=({className:e,...t})=>{const{t:n}=Ye();return l.jsxs("span",{"aria-hidden":!0,className:re("flex h-9 w-9 items-center justify-center",e),...t,children:[l.jsx(nI,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:n("common.pagination.more")})]})};vE.displayName="PaginationEllipsis";const xE=({totalPages:e,currentPage:t,onPageChange:n})=>{const s=()=>{if(e>7){let u=[];const d=Math.max(2,t-1),f=Math.min(e-1,t+1),h=e-1;return u=o(d,f),t>3&&u.unshift("..."),t{let d=a;const f=[];for(;d<=c;)f.push(d),d+=u;return f},i=s();return l.jsx(l.Fragment,{children:l.jsx(pE,{className:"dark:text-stone-200 justify-end mt-3",children:l.jsx(gE,{children:i.map((a,c)=>a==="..."?l.jsx(Ag,{children:l.jsx(vE,{})},c):l.jsx(Ag,{children:l.jsx(yE,{href:"#",isActive:t==a,onClick:u=>{u.preventDefault(),n(a)},children:a})},c))})})})};var wE="AlertDialog",[Q$,GH]=on(wE,[WC]),Gs=WC(),bE=e=>{const{__scopeAlertDialog:t,...n}=e,r=Gs(t);return l.jsx(Uv,{...r,...n,modal:!0})};bE.displayName=wE;var J$="AlertDialogTrigger",_E=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Gs(n);return l.jsx(Vv,{...s,...r,ref:t})});_E.displayName=J$;var eU="AlertDialogPortal",SE=e=>{const{__scopeAlertDialog:t,...n}=e,r=Gs(t);return l.jsx(Bv,{...r,...n})};SE.displayName=eU;var tU="AlertDialogOverlay",kE=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Gs(n);return l.jsx(ou,{...s,...r,ref:t})});kE.displayName=tU;var ka="AlertDialogContent",[nU,rU]=Q$(ka),CE=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...s}=e,o=Gs(n),i=y.useRef(null),a=Ge(t,i),c=y.useRef(null);return l.jsx(ZF,{contentName:ka,titleName:jE,docsSlug:"alert-dialog",children:l.jsx(nU,{scope:n,cancelRef:c,children:l.jsxs(iu,{role:"alertdialog",...o,...s,ref:a,onOpenAutoFocus:ue(s.onOpenAutoFocus,u=>{var d;u.preventDefault(),(d=c.current)==null||d.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[l.jsx(av,{children:r}),l.jsx(oU,{contentRef:i})]})})})});CE.displayName=ka;var jE="AlertDialogTitle",EE=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Gs(n);return l.jsx(au,{...s,...r,ref:t})});EE.displayName=jE;var NE="AlertDialogDescription",TE=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Gs(n);return l.jsx(lu,{...s,...r,ref:t})});TE.displayName=NE;var sU="AlertDialogAction",PE=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Gs(n);return l.jsx(xh,{...s,...r,ref:t})});PE.displayName=sU;var RE="AlertDialogCancel",AE=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:s}=rU(RE,n),o=Gs(n),i=Ge(t,s);return l.jsx(xh,{...o,...r,ref:i})});AE.displayName=RE;var oU=({contentRef:e})=>{const t=`\`${ka}\` requires a description for the component to be accessible for screen reader users. You can add a description to the \`${ka}\` by passing a \`${NE}\` component as a child, which also benefits sighted users by adding visible context to the dialog. @@ -321,4 +321,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(n){e.exports=n()})(function(){return function n(r,s,o){function i(u,d){if(!s[u]){if(!r[u]){var f=typeof td=="function"&&td;if(!d&&f)return f(u,!0);if(a)return a(u,!0);var h=new Error("Cannot find module '"+u+"'");throw h.code="MODULE_NOT_FOUND",h}var m=s[u]={exports:{}};r[u][0].call(m.exports,function(x){var p=r[u][1][x];return i(p||x)},m,m.exports,n,r,s,o)}return s[u].exports}for(var a=typeof td=="function"&&td,c=0;c>2,m=(3&u)<<4|d>>4,x=1>6:64,p=2>4,d=(15&h)<<4|(m=a.indexOf(c.charAt(p++)))>>2,f=(3&m)<<6|(x=a.indexOf(c.charAt(p++))),v[w++]=u,m!==64&&(v[w++]=d),x!==64&&(v[w++]=f);return v}},{"./support":30,"./utils":32}],2:[function(n,r,s){var o=n("./external"),i=n("./stream/DataWorker"),a=n("./stream/Crc32Probe"),c=n("./stream/DataLengthProbe");function u(d,f,h,m,x){this.compressedSize=d,this.uncompressedSize=f,this.crc32=h,this.compression=m,this.compressedContent=x}u.prototype={getContentWorker:function(){var d=new i(o.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new c("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 i(o.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,h){return d.pipe(new a).pipe(new c("uncompressedSize")).pipe(f.compressWorker(h)).pipe(new c("compressedSize")).withStreamInfo("compression",f)},r.exports=u},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(n,r,s){var o=n("./stream/GenericWorker");s.STORE={magic:"\0\0",compressWorker:function(){return new o("STORE compression")},uncompressWorker:function(){return new o("STORE decompression")}},s.DEFLATE=n("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(n,r,s){var o=n("./utils"),i=function(){for(var a,c=[],u=0;u<256;u++){a=u;for(var d=0;d<8;d++)a=1&a?3988292384^a>>>1:a>>>1;c[u]=a}return c}();r.exports=function(a,c){return a!==void 0&&a.length?o.getTypeOf(a)!=="string"?function(u,d,f,h){var m=i,x=h+f;u^=-1;for(var p=h;p>>8^m[255&(u^d[p])];return-1^u}(0|c,a,a.length,0):function(u,d,f,h){var m=i,x=h+f;u^=-1;for(var p=h;p>>8^m[255&(u^d.charCodeAt(p))];return-1^u}(0|c,a,a.length,0):0}},{"./utils":32}],5:[function(n,r,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(n,r,s){var o=null;o=typeof Promise<"u"?Promise:n("lie"),r.exports={Promise:o}},{lie:37}],7:[function(n,r,s){var o=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",i=n("pako"),a=n("./utils"),c=n("./stream/GenericWorker"),u=o?"uint8array":"array";function d(f,h){c.call(this,"FlateWorker/"+f),this._pako=null,this._pakoAction=f,this._pakoOptions=h,this.meta={}}s.magic="\b\0",a.inherits(d,c),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(){c.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},d.prototype.cleanUp=function(){c.prototype.cleanUp.call(this),this._pako=null},d.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var f=this;this._pako.onData=function(h){f.push({data:h,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(n,r,s){function o(m,x){var p,w="";for(p=0;p>>=8;return w}function i(m,x,p,w,g,v){var b,_,C=m.file,j=m.compression,T=v!==u.utf8encode,R=a.transformTo("string",v(C.name)),A=a.transformTo("string",u.utf8encode(C.name)),O=C.comment,G=a.transformTo("string",v(O)),N=a.transformTo("string",u.utf8encode(O)),z=A.length!==C.name.length,S=N.length!==O.length,U="",J="",F="",W=C.dir,I=C.date,X={crc32:0,compressedSize:0,uncompressedSize:0};x&&!p||(X.crc32=m.crc32,X.compressedSize=m.compressedSize,X.uncompressedSize=m.uncompressedSize);var $=0;x&&($|=8),T||!z&&!S||($|=2048);var B=0,he=0;W&&(B|=16),g==="UNIX"?(he=798,B|=function(oe,Oe){var me=oe;return oe||(me=Oe?16893:33204),(65535&me)<<16}(C.unixPermissions,W)):(he=20,B|=function(oe){return 63&(oe||0)}(C.dosPermissions)),b=I.getUTCHours(),b<<=6,b|=I.getUTCMinutes(),b<<=5,b|=I.getUTCSeconds()/2,_=I.getUTCFullYear()-1980,_<<=4,_|=I.getUTCMonth()+1,_<<=5,_|=I.getUTCDate(),z&&(J=o(1,1)+o(d(R),4)+A,U+="up"+o(J.length,2)+J),S&&(F=o(1,1)+o(d(G),4)+N,U+="uc"+o(F.length,2)+F);var se="";return se+=` -\0`,se+=o($,2),se+=j.magic,se+=o(b,2),se+=o(_,2),se+=o(X.crc32,4),se+=o(X.compressedSize,4),se+=o(X.uncompressedSize,4),se+=o(R.length,2),se+=o(U.length,2),{fileRecord:f.LOCAL_FILE_HEADER+se+R+U,dirRecord:f.CENTRAL_FILE_HEADER+o(he,2)+se+o(G.length,2)+"\0\0\0\0"+o(B,4)+o(w,4)+R+U+G}}var a=n("../utils"),c=n("../stream/GenericWorker"),u=n("../utf8"),d=n("../crc32"),f=n("../signature");function h(m,x,p,w){c.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=x,this.zipPlatform=p,this.encodeFileName=w,this.streamFiles=m,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(h,c),h.prototype.push=function(m){var x=m.meta.percent||0,p=this.entriesCount,w=this._sources.length;this.accumulate?this.contentBuffer.push(m):(this.bytesWritten+=m.data.length,c.prototype.push.call(this,{data:m.data,meta:{currentFile:this.currentFile,percent:p?(x+100*(p-w-1))/p:100}}))},h.prototype.openedSource=function(m){this.currentSourceOffset=this.bytesWritten,this.currentFile=m.file.name;var x=this.streamFiles&&!m.file.dir;if(x){var p=i(m,x,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:p.fileRecord,meta:{percent:0}})}else this.accumulate=!0},h.prototype.closedSource=function(m){this.accumulate=!1;var x=this.streamFiles&&!m.file.dir,p=i(m,x,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(p.dirRecord),x)this.push({data:function(w){return f.DATA_DESCRIPTOR+o(w.crc32,4)+o(w.compressedSize,4)+o(w.uncompressedSize,4)}(m),meta:{percent:100}});else for(this.push({data:p.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},h.prototype.flush=function(){for(var m=this.bytesWritten,x=0;x=this.index;c--)u=(u<<8)+this.byteAt(c);return this.index+=a,u},readString:function(a){return o.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))}},r.exports=i},{"../utils":32}],19:[function(n,r,s){var o=n("./Uint8ArrayReader");function i(a){o.call(this,a)}n("../utils").inherits(i,o),i.prototype.readData=function(a){this.checkOffset(a);var c=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,c},r.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(n,r,s){var o=n("./DataReader");function i(a){o.call(this,a)}n("../utils").inherits(i,o),i.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+a)},i.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero},i.prototype.readAndCheckSignature=function(a){return a===this.readData(4)},i.prototype.readData=function(a){this.checkOffset(a);var c=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,c},r.exports=i},{"../utils":32,"./DataReader":18}],21:[function(n,r,s){var o=n("./ArrayReader");function i(a){o.call(this,a)}n("../utils").inherits(i,o),i.prototype.readData=function(a){if(this.checkOffset(a),a===0)return new Uint8Array(0);var c=this.data.subarray(this.zero+this.index,this.zero+this.index+a);return this.index+=a,c},r.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(n,r,s){var o=n("../utils"),i=n("../support"),a=n("./ArrayReader"),c=n("./StringReader"),u=n("./NodeBufferReader"),d=n("./Uint8ArrayReader");r.exports=function(f){var h=o.getTypeOf(f);return o.checkSupport(h),h!=="string"||i.uint8array?h==="nodebuffer"?new u(f):i.uint8array?new d(o.transformTo("uint8array",f)):new a(o.transformTo("array",f)):new c(f)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(n,r,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(n,r,s){var o=n("./GenericWorker"),i=n("../utils");function a(c){o.call(this,"ConvertWorker to "+c),this.destType=c}i.inherits(a,o),a.prototype.processChunk=function(c){this.push({data:i.transformTo(this.destType,c.data),meta:c.meta})},r.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(n,r,s){var o=n("./GenericWorker"),i=n("../crc32");function a(){o.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}n("../utils").inherits(a,o),a.prototype.processChunk=function(c){this.streamInfo.crc32=i(c.data,this.streamInfo.crc32||0),this.push(c)},r.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(n,r,s){var o=n("../utils"),i=n("./GenericWorker");function a(c){i.call(this,"DataLengthProbe for "+c),this.propName=c,this.withStreamInfo(c,0)}o.inherits(a,i),a.prototype.processChunk=function(c){if(c){var u=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=u+c.data.length}i.prototype.processChunk.call(this,c)},r.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(n,r,s){var o=n("../utils"),i=n("./GenericWorker");function a(c){i.call(this,"DataWorker");var u=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,c.then(function(d){u.dataIsReady=!0,u.data=d,u.max=d&&d.length||0,u.type=o.getTypeOf(d),u.isPaused||u._tickAndRepeat()},function(d){u.error(d)})}o.inherits(a,i),a.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,o.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(o.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var c=null,u=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":c=this.data.substring(this.index,u);break;case"uint8array":c=this.data.subarray(this.index,u);break;case"array":case"nodebuffer":c=this.data.slice(this.index,u)}return this.index=u,this.push({data:c,meta:{percent:this.max?this.index/this.max*100:0}})},r.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(n,r,s){function o(i){this.name=i||"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}o.prototype={push:function(i){this.emit("data",i)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(i){this.emit("error",i)}return!0},error:function(i){return!this.isFinished&&(this.isPaused?this.generatedError=i:(this.isFinished=!0,this.emit("error",i),this.previous&&this.previous.error(i),this.cleanUp()),!0)},on:function(i,a){return this._listeners[i].push(a),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(i,a){if(this._listeners[i])for(var c=0;c "+i:i}},r.exports=o},{}],29:[function(n,r,s){var o=n("../utils"),i=n("./ConvertWorker"),a=n("./GenericWorker"),c=n("../base64"),u=n("../support"),d=n("../external"),f=null;if(u.nodestream)try{f=n("../nodejs/NodejsStreamOutputAdapter")}catch{}function h(x,p){return new d.Promise(function(w,g){var v=[],b=x._internalType,_=x._outputType,C=x._mimeType;x.on("data",function(j,T){v.push(j),p&&p(T)}).on("error",function(j){v=[],g(j)}).on("end",function(){try{var j=function(T,R,A){switch(T){case"blob":return o.newBlob(o.transformTo("arraybuffer",R),A);case"base64":return c.encode(R);default:return o.transformTo(T,R)}}(_,function(T,R){var A,O=0,G=null,N=0;for(A=0;A"u")s.blob=!1;else{var o=new ArrayBuffer(0);try{s.blob=new Blob([o],{type:"application/zip"}).size===0}catch{try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);i.append(o),s.blob=i.getBlob("application/zip").size===0}catch{s.blob=!1}}}try{s.nodestream=!!n("readable-stream").Readable}catch{s.nodestream=!1}},{"readable-stream":16}],31:[function(n,r,s){for(var o=n("./utils"),i=n("./support"),a=n("./nodejsUtils"),c=n("./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(){c.call(this,"utf-8 decode"),this.leftOver=null}function h(){c.call(this,"utf-8 encode")}s.utf8encode=function(m){return i.nodebuffer?a.newBufferFrom(m,"utf-8"):function(x){var p,w,g,v,b,_=x.length,C=0;for(v=0;v<_;v++)(64512&(w=x.charCodeAt(v)))==55296&&v+1<_&&(64512&(g=x.charCodeAt(v+1)))==56320&&(w=65536+(w-55296<<10)+(g-56320),v++),C+=w<128?1:w<2048?2:w<65536?3:4;for(p=i.uint8array?new Uint8Array(C):new Array(C),v=b=0;b>>6:(w<65536?p[b++]=224|w>>>12:(p[b++]=240|w>>>18,p[b++]=128|w>>>12&63),p[b++]=128|w>>>6&63),p[b++]=128|63&w);return p}(m)},s.utf8decode=function(m){return i.nodebuffer?o.transformTo("nodebuffer",m).toString("utf-8"):function(x){var p,w,g,v,b=x.length,_=new Array(2*b);for(p=w=0;p>10&1023,_[w++]=56320|1023&g)}return _.length!==w&&(_.subarray?_=_.subarray(0,w):_.length=w),o.applyFromCharCode(_)}(m=o.transformTo(i.uint8array?"uint8array":"array",m))},o.inherits(f,c),f.prototype.processChunk=function(m){var x=o.transformTo(i.uint8array?"uint8array":"array",m.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var p=x;(x=new Uint8Array(p.length+this.leftOver.length)).set(this.leftOver,0),x.set(p,this.leftOver.length)}else x=this.leftOver.concat(x);this.leftOver=null}var w=function(v,b){var _;for((b=b||v.length)>v.length&&(b=v.length),_=b-1;0<=_&&(192&v[_])==128;)_--;return _<0||_===0?b:_+u[v[_]]>b?_:b}(x),g=x;w!==x.length&&(i.uint8array?(g=x.subarray(0,w),this.leftOver=x.subarray(w,x.length)):(g=x.slice(0,w),this.leftOver=x.slice(w,x.length))),this.push({data:s.utf8decode(g),meta:m.meta})},f.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:s.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},s.Utf8DecodeWorker=f,o.inherits(h,c),h.prototype.processChunk=function(m){this.push({data:s.utf8encode(m.data),meta:m.meta})},s.Utf8EncodeWorker=h},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(n,r,s){var o=n("./support"),i=n("./base64"),a=n("./nodejsUtils"),c=n("./external");function u(p){return p}function d(p,w){for(var g=0;g>8;this.dir=!!(16&this.externalFileAttributes),m==0&&(this.dosPermissions=63&this.externalFileAttributes),m==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var m=o(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=m.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=m.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=m.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=m.readInt(4))}},readExtraFields:function(m){var x,p,w,g=m.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});m.index+4>>6:(m<65536?h[w++]=224|m>>>12:(h[w++]=240|m>>>18,h[w++]=128|m>>>12&63),h[w++]=128|m>>>6&63),h[w++]=128|63&m);return h},s.buf2binstring=function(f){return d(f,f.length)},s.binstring2buf=function(f){for(var h=new o.Buf8(f.length),m=0,x=h.length;m>10&1023,v[x++]=56320|1023&p)}return d(v,x)},s.utf8border=function(f,h){var m;for((h=h||f.length)>f.length&&(h=f.length),m=h-1;0<=m&&(192&f[m])==128;)m--;return m<0||m===0?h:m+c[f[m]]>h?m:h}},{"./common":41}],43:[function(n,r,s){r.exports=function(o,i,a,c){for(var u=65535&o|0,d=o>>>16&65535|0,f=0;a!==0;){for(a-=f=2e3>>1:i>>>1;a[c]=i}return a}();r.exports=function(i,a,c,u){var d=o,f=u+c;i^=-1;for(var h=u;h>>8^d[255&(i^a[h])];return-1^i}},{}],46:[function(n,r,s){var o,i=n("../utils/common"),a=n("./trees"),c=n("./adler32"),u=n("./crc32"),d=n("./messages"),f=0,h=4,m=0,x=-2,p=-1,w=4,g=2,v=8,b=9,_=286,C=30,j=19,T=2*_+1,R=15,A=3,O=258,G=O+A+1,N=42,z=113,S=1,U=2,J=3,F=4;function W(E,ee){return E.msg=d[ee],ee}function I(E){return(E<<1)-(4E.avail_out&&(Z=E.avail_out),Z!==0&&(i.arraySet(E.output,ee.pending_buf,ee.pending_out,Z,E.next_out),E.next_out+=Z,ee.pending_out+=Z,E.total_out+=Z,E.avail_out-=Z,ee.pending-=Z,ee.pending===0&&(ee.pending_out=0))}function B(E,ee){a._tr_flush_block(E,0<=E.block_start?E.block_start:-1,E.strstart-E.block_start,ee),E.block_start=E.strstart,$(E.strm)}function he(E,ee){E.pending_buf[E.pending++]=ee}function se(E,ee){E.pending_buf[E.pending++]=ee>>>8&255,E.pending_buf[E.pending++]=255&ee}function oe(E,ee){var Z,D,k=E.max_chain_length,P=E.strstart,M=E.prev_length,K=E.nice_match,L=E.strstart>E.w_size-G?E.strstart-(E.w_size-G):0,Y=E.window,Q=E.w_mask,te=E.prev,ge=E.strstart+O,Ke=Y[P+M-1],Ue=Y[P+M];E.prev_length>=E.good_match&&(k>>=2),K>E.lookahead&&(K=E.lookahead);do if(Y[(Z=ee)+M]===Ue&&Y[Z+M-1]===Ke&&Y[Z]===Y[P]&&Y[++Z]===Y[P+1]){P+=2,Z++;do;while(Y[++P]===Y[++Z]&&Y[++P]===Y[++Z]&&Y[++P]===Y[++Z]&&Y[++P]===Y[++Z]&&Y[++P]===Y[++Z]&&Y[++P]===Y[++Z]&&Y[++P]===Y[++Z]&&Y[++P]===Y[++Z]&&PL&&--k!=0);return M<=E.lookahead?M:E.lookahead}function Oe(E){var ee,Z,D,k,P,M,K,L,Y,Q,te=E.w_size;do{if(k=E.window_size-E.lookahead-E.strstart,E.strstart>=te+(te-G)){for(i.arraySet(E.window,E.window,te,te,0),E.match_start-=te,E.strstart-=te,E.block_start-=te,ee=Z=E.hash_size;D=E.head[--ee],E.head[ee]=te<=D?D-te:0,--Z;);for(ee=Z=te;D=E.prev[--ee],E.prev[ee]=te<=D?D-te:0,--Z;);k+=te}if(E.strm.avail_in===0)break;if(M=E.strm,K=E.window,L=E.strstart+E.lookahead,Y=k,Q=void 0,Q=M.avail_in,Y=A)for(P=E.strstart-E.insert,E.ins_h=E.window[P],E.ins_h=(E.ins_h<=A&&(E.ins_h=(E.ins_h<=A)if(D=a._tr_tally(E,E.strstart-E.match_start,E.match_length-A),E.lookahead-=E.match_length,E.match_length<=E.max_lazy_match&&E.lookahead>=A){for(E.match_length--;E.strstart++,E.ins_h=(E.ins_h<=A&&(E.ins_h=(E.ins_h<=A&&E.match_length<=E.prev_length){for(k=E.strstart+E.lookahead-A,D=a._tr_tally(E,E.strstart-1-E.prev_match,E.prev_length-A),E.lookahead-=E.prev_length-1,E.prev_length-=2;++E.strstart<=k&&(E.ins_h=(E.ins_h<E.pending_buf_size-5&&(Z=E.pending_buf_size-5);;){if(E.lookahead<=1){if(Oe(E),E.lookahead===0&&ee===f)return S;if(E.lookahead===0)break}E.strstart+=E.lookahead,E.lookahead=0;var D=E.block_start+Z;if((E.strstart===0||E.strstart>=D)&&(E.lookahead=E.strstart-D,E.strstart=D,B(E,!1),E.strm.avail_out===0)||E.strstart-E.block_start>=E.w_size-G&&(B(E,!1),E.strm.avail_out===0))return S}return E.insert=0,ee===h?(B(E,!0),E.strm.avail_out===0?J:F):(E.strstart>E.block_start&&(B(E,!1),E.strm.avail_out),S)}),new Te(4,4,8,4,me),new Te(4,5,16,8,me),new Te(4,6,32,32,me),new Te(4,4,16,16,we),new Te(8,16,32,32,we),new Te(8,16,128,128,we),new Te(8,32,128,256,we),new Te(32,128,258,1024,we),new Te(32,258,258,4096,we)],s.deflateInit=function(E,ee){return st(E,ee,v,15,8,0)},s.deflateInit2=st,s.deflateReset=Re,s.deflateResetKeep=Ie,s.deflateSetHeader=function(E,ee){return E&&E.state?E.state.wrap!==2?x:(E.state.gzhead=ee,m):x},s.deflate=function(E,ee){var Z,D,k,P;if(!E||!E.state||5>8&255),he(D,D.gzhead.time>>16&255),he(D,D.gzhead.time>>24&255),he(D,D.level===9?2:2<=D.strategy||D.level<2?4:0),he(D,255&D.gzhead.os),D.gzhead.extra&&D.gzhead.extra.length&&(he(D,255&D.gzhead.extra.length),he(D,D.gzhead.extra.length>>8&255)),D.gzhead.hcrc&&(E.adler=u(E.adler,D.pending_buf,D.pending,0)),D.gzindex=0,D.status=69):(he(D,0),he(D,0),he(D,0),he(D,0),he(D,0),he(D,D.level===9?2:2<=D.strategy||D.level<2?4:0),he(D,3),D.status=z);else{var M=v+(D.w_bits-8<<4)<<8;M|=(2<=D.strategy||D.level<2?0:D.level<6?1:D.level===6?2:3)<<6,D.strstart!==0&&(M|=32),M+=31-M%31,D.status=z,se(D,M),D.strstart!==0&&(se(D,E.adler>>>16),se(D,65535&E.adler)),E.adler=1}if(D.status===69)if(D.gzhead.extra){for(k=D.pending;D.gzindex<(65535&D.gzhead.extra.length)&&(D.pending!==D.pending_buf_size||(D.gzhead.hcrc&&D.pending>k&&(E.adler=u(E.adler,D.pending_buf,D.pending-k,k)),$(E),k=D.pending,D.pending!==D.pending_buf_size));)he(D,255&D.gzhead.extra[D.gzindex]),D.gzindex++;D.gzhead.hcrc&&D.pending>k&&(E.adler=u(E.adler,D.pending_buf,D.pending-k,k)),D.gzindex===D.gzhead.extra.length&&(D.gzindex=0,D.status=73)}else D.status=73;if(D.status===73)if(D.gzhead.name){k=D.pending;do{if(D.pending===D.pending_buf_size&&(D.gzhead.hcrc&&D.pending>k&&(E.adler=u(E.adler,D.pending_buf,D.pending-k,k)),$(E),k=D.pending,D.pending===D.pending_buf_size)){P=1;break}P=D.gzindexk&&(E.adler=u(E.adler,D.pending_buf,D.pending-k,k)),P===0&&(D.gzindex=0,D.status=91)}else D.status=91;if(D.status===91)if(D.gzhead.comment){k=D.pending;do{if(D.pending===D.pending_buf_size&&(D.gzhead.hcrc&&D.pending>k&&(E.adler=u(E.adler,D.pending_buf,D.pending-k,k)),$(E),k=D.pending,D.pending===D.pending_buf_size)){P=1;break}P=D.gzindexk&&(E.adler=u(E.adler,D.pending_buf,D.pending-k,k)),P===0&&(D.status=103)}else D.status=103;if(D.status===103&&(D.gzhead.hcrc?(D.pending+2>D.pending_buf_size&&$(E),D.pending+2<=D.pending_buf_size&&(he(D,255&E.adler),he(D,E.adler>>8&255),E.adler=0,D.status=z)):D.status=z),D.pending!==0){if($(E),E.avail_out===0)return D.last_flush=-1,m}else if(E.avail_in===0&&I(ee)<=I(Z)&&ee!==h)return W(E,-5);if(D.status===666&&E.avail_in!==0)return W(E,-5);if(E.avail_in!==0||D.lookahead!==0||ee!==f&&D.status!==666){var K=D.strategy===2?function(L,Y){for(var Q;;){if(L.lookahead===0&&(Oe(L),L.lookahead===0)){if(Y===f)return S;break}if(L.match_length=0,Q=a._tr_tally(L,0,L.window[L.strstart]),L.lookahead--,L.strstart++,Q&&(B(L,!1),L.strm.avail_out===0))return S}return L.insert=0,Y===h?(B(L,!0),L.strm.avail_out===0?J:F):L.last_lit&&(B(L,!1),L.strm.avail_out===0)?S:U}(D,ee):D.strategy===3?function(L,Y){for(var Q,te,ge,Ke,Ue=L.window;;){if(L.lookahead<=O){if(Oe(L),L.lookahead<=O&&Y===f)return S;if(L.lookahead===0)break}if(L.match_length=0,L.lookahead>=A&&0L.lookahead&&(L.match_length=L.lookahead)}if(L.match_length>=A?(Q=a._tr_tally(L,1,L.match_length-A),L.lookahead-=L.match_length,L.strstart+=L.match_length,L.match_length=0):(Q=a._tr_tally(L,0,L.window[L.strstart]),L.lookahead--,L.strstart++),Q&&(B(L,!1),L.strm.avail_out===0))return S}return L.insert=0,Y===h?(B(L,!0),L.strm.avail_out===0?J:F):L.last_lit&&(B(L,!1),L.strm.avail_out===0)?S:U}(D,ee):o[D.level].func(D,ee);if(K!==J&&K!==F||(D.status=666),K===S||K===J)return E.avail_out===0&&(D.last_flush=-1),m;if(K===U&&(ee===1?a._tr_align(D):ee!==5&&(a._tr_stored_block(D,0,0,!1),ee===3&&(X(D.head),D.lookahead===0&&(D.strstart=0,D.block_start=0,D.insert=0))),$(E),E.avail_out===0))return D.last_flush=-1,m}return ee!==h?m:D.wrap<=0?1:(D.wrap===2?(he(D,255&E.adler),he(D,E.adler>>8&255),he(D,E.adler>>16&255),he(D,E.adler>>24&255),he(D,255&E.total_in),he(D,E.total_in>>8&255),he(D,E.total_in>>16&255),he(D,E.total_in>>24&255)):(se(D,E.adler>>>16),se(D,65535&E.adler)),$(E),0=Z.w_size&&(P===0&&(X(Z.head),Z.strstart=0,Z.block_start=0,Z.insert=0),Y=new i.Buf8(Z.w_size),i.arraySet(Y,ee,Q-Z.w_size,Z.w_size,0),ee=Y,Q=Z.w_size),M=E.avail_in,K=E.next_in,L=E.input,E.avail_in=Q,E.next_in=0,E.input=ee,Oe(Z);Z.lookahead>=A;){for(D=Z.strstart,k=Z.lookahead-(A-1);Z.ins_h=(Z.ins_h<>>=A=R>>>24,b-=A,(A=R>>>16&255)===0)U[d++]=65535&R;else{if(!(16&A)){if(!(64&A)){R=_[(65535&R)+(v&(1<>>=A,b-=A),b<15&&(v+=S[c++]<>>=A=R>>>24,b-=A,!(16&(A=R>>>16&255))){if(!(64&A)){R=C[(65535&R)+(v&(1<>>=A,b-=A,(A=d-f)>3,v&=(1<<(b-=O<<3))-1,o.next_in=c,o.next_out=d,o.avail_in=c>>24&255)+(N>>>8&65280)+((65280&N)<<8)+((255&N)<<24)}function v(){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 o.Buf16(320),this.work=new o.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function b(N){var z;return N&&N.state?(z=N.state,N.total_in=N.total_out=z.total=0,N.msg="",z.wrap&&(N.adler=1&z.wrap),z.mode=x,z.last=0,z.havedict=0,z.dmax=32768,z.head=null,z.hold=0,z.bits=0,z.lencode=z.lendyn=new o.Buf32(p),z.distcode=z.distdyn=new o.Buf32(w),z.sane=1,z.back=-1,h):m}function _(N){var z;return N&&N.state?((z=N.state).wsize=0,z.whave=0,z.wnext=0,b(N)):m}function C(N,z){var S,U;return N&&N.state?(U=N.state,z<0?(S=0,z=-z):(S=1+(z>>4),z<48&&(z&=15)),z&&(z<8||15=F.wsize?(o.arraySet(F.window,z,S-F.wsize,F.wsize,0),F.wnext=0,F.whave=F.wsize):(U<(J=F.wsize-F.wnext)&&(J=U),o.arraySet(F.window,z,S-U,J,F.wnext),(U-=J)?(o.arraySet(F.window,z,S-U,U,0),F.wnext=U,F.whave=F.wsize):(F.wnext+=J,F.wnext===F.wsize&&(F.wnext=0),F.whave>>8&255,S.check=a(S.check,P,2,0),B=$=0,S.mode=2;break}if(S.flags=0,S.head&&(S.head.done=!1),!(1&S.wrap)||(((255&$)<<8)+($>>8))%31){N.msg="incorrect header check",S.mode=30;break}if((15&$)!=8){N.msg="unknown compression method",S.mode=30;break}if(B-=4,E=8+(15&($>>>=4)),S.wbits===0)S.wbits=E;else if(E>S.wbits){N.msg="invalid window size",S.mode=30;break}S.dmax=1<>8&1),512&S.flags&&(P[0]=255&$,P[1]=$>>>8&255,S.check=a(S.check,P,2,0)),B=$=0,S.mode=3;case 3:for(;B<32;){if(I===0)break e;I--,$+=U[F++]<>>8&255,P[2]=$>>>16&255,P[3]=$>>>24&255,S.check=a(S.check,P,4,0)),B=$=0,S.mode=4;case 4:for(;B<16;){if(I===0)break e;I--,$+=U[F++]<>8),512&S.flags&&(P[0]=255&$,P[1]=$>>>8&255,S.check=a(S.check,P,2,0)),B=$=0,S.mode=5;case 5:if(1024&S.flags){for(;B<16;){if(I===0)break e;I--,$+=U[F++]<>>8&255,S.check=a(S.check,P,2,0)),B=$=0}else S.head&&(S.head.extra=null);S.mode=6;case 6:if(1024&S.flags&&(I<(oe=S.length)&&(oe=I),oe&&(S.head&&(E=S.head.extra_len-S.length,S.head.extra||(S.head.extra=new Array(S.head.extra_len)),o.arraySet(S.head.extra,U,F,oe,E)),512&S.flags&&(S.check=a(S.check,U,oe,F)),I-=oe,F+=oe,S.length-=oe),S.length))break e;S.length=0,S.mode=7;case 7:if(2048&S.flags){if(I===0)break e;for(oe=0;E=U[F+oe++],S.head&&E&&S.length<65536&&(S.head.name+=String.fromCharCode(E)),E&&oe>9&1,S.head.done=!0),N.adler=S.check=0,S.mode=12;break;case 10:for(;B<32;){if(I===0)break e;I--,$+=U[F++]<>>=7&B,B-=7&B,S.mode=27;break}for(;B<3;){if(I===0)break e;I--,$+=U[F++]<>>=1)){case 0:S.mode=14;break;case 1:if(O(S),S.mode=20,z!==6)break;$>>>=2,B-=2;break e;case 2:S.mode=17;break;case 3:N.msg="invalid block type",S.mode=30}$>>>=2,B-=2;break;case 14:for($>>>=7&B,B-=7&B;B<32;){if(I===0)break e;I--,$+=U[F++]<>>16^65535)){N.msg="invalid stored block lengths",S.mode=30;break}if(S.length=65535&$,B=$=0,S.mode=15,z===6)break e;case 15:S.mode=16;case 16:if(oe=S.length){if(I>>=5,B-=5,S.ndist=1+(31&$),$>>>=5,B-=5,S.ncode=4+(15&$),$>>>=4,B-=4,286>>=3,B-=3}for(;S.have<19;)S.lens[M[S.have++]]=0;if(S.lencode=S.lendyn,S.lenbits=7,Z={bits:S.lenbits},ee=u(0,S.lens,0,19,S.lencode,0,S.work,Z),S.lenbits=Z.bits,ee){N.msg="invalid code lengths set",S.mode=30;break}S.have=0,S.mode=19;case 19:for(;S.have>>16&255,Fe=65535&k,!((we=k>>>24)<=B);){if(I===0)break e;I--,$+=U[F++]<>>=we,B-=we,S.lens[S.have++]=Fe;else{if(Fe===16){for(D=we+2;B>>=we,B-=we,S.have===0){N.msg="invalid bit length repeat",S.mode=30;break}E=S.lens[S.have-1],oe=3+(3&$),$>>>=2,B-=2}else if(Fe===17){for(D=we+3;B>>=we)),$>>>=3,B-=3}else{for(D=we+7;B>>=we)),$>>>=7,B-=7}if(S.have+oe>S.nlen+S.ndist){N.msg="invalid bit length repeat",S.mode=30;break}for(;oe--;)S.lens[S.have++]=E}}if(S.mode===30)break;if(S.lens[256]===0){N.msg="invalid code -- missing end-of-block",S.mode=30;break}if(S.lenbits=9,Z={bits:S.lenbits},ee=u(d,S.lens,0,S.nlen,S.lencode,0,S.work,Z),S.lenbits=Z.bits,ee){N.msg="invalid literal/lengths set",S.mode=30;break}if(S.distbits=6,S.distcode=S.distdyn,Z={bits:S.distbits},ee=u(f,S.lens,S.nlen,S.ndist,S.distcode,0,S.work,Z),S.distbits=Z.bits,ee){N.msg="invalid distances set",S.mode=30;break}if(S.mode=20,z===6)break e;case 20:S.mode=21;case 21:if(6<=I&&258<=X){N.next_out=W,N.avail_out=X,N.next_in=F,N.avail_in=I,S.hold=$,S.bits=B,c(N,se),W=N.next_out,J=N.output,X=N.avail_out,F=N.next_in,U=N.input,I=N.avail_in,$=S.hold,B=S.bits,S.mode===12&&(S.back=-1);break}for(S.back=0;Te=(k=S.lencode[$&(1<>>16&255,Fe=65535&k,!((we=k>>>24)<=B);){if(I===0)break e;I--,$+=U[F++]<>Ie)])>>>16&255,Fe=65535&k,!(Ie+(we=k>>>24)<=B);){if(I===0)break e;I--,$+=U[F++]<>>=Ie,B-=Ie,S.back+=Ie}if($>>>=we,B-=we,S.back+=we,S.length=Fe,Te===0){S.mode=26;break}if(32&Te){S.back=-1,S.mode=12;break}if(64&Te){N.msg="invalid literal/length code",S.mode=30;break}S.extra=15&Te,S.mode=22;case 22:if(S.extra){for(D=S.extra;B>>=S.extra,B-=S.extra,S.back+=S.extra}S.was=S.length,S.mode=23;case 23:for(;Te=(k=S.distcode[$&(1<>>16&255,Fe=65535&k,!((we=k>>>24)<=B);){if(I===0)break e;I--,$+=U[F++]<>Ie)])>>>16&255,Fe=65535&k,!(Ie+(we=k>>>24)<=B);){if(I===0)break e;I--,$+=U[F++]<>>=Ie,B-=Ie,S.back+=Ie}if($>>>=we,B-=we,S.back+=we,64&Te){N.msg="invalid distance code",S.mode=30;break}S.offset=Fe,S.extra=15&Te,S.mode=24;case 24:if(S.extra){for(D=S.extra;B>>=S.extra,B-=S.extra,S.back+=S.extra}if(S.offset>S.dmax){N.msg="invalid distance too far back",S.mode=30;break}S.mode=25;case 25:if(X===0)break e;if(oe=se-X,S.offset>oe){if((oe=S.offset-oe)>S.whave&&S.sane){N.msg="invalid distance too far back",S.mode=30;break}Oe=oe>S.wnext?(oe-=S.wnext,S.wsize-oe):S.wnext-oe,oe>S.length&&(oe=S.length),me=S.window}else me=J,Oe=W-S.offset,oe=S.length;for(XT?(A=Oe[me+w[z]],B[he+w[z]]):(A=96,0),v=1<>W)+(b-=v)]=R<<24|A<<16|O|0,b!==0;);for(v=1<>=1;if(v!==0?($&=v-1,$+=v):$=0,z++,--se[N]==0){if(N===U)break;N=f[h+w[z]]}if(J>>7)]}function he(k,P){k.pending_buf[k.pending++]=255&P,k.pending_buf[k.pending++]=P>>>8&255}function se(k,P,M){k.bi_valid>g-M?(k.bi_buf|=P<>g-k.bi_valid,k.bi_valid+=M-g):(k.bi_buf|=P<>>=1,M<<=1,0<--P;);return M>>>1}function me(k,P,M){var K,L,Y=new Array(w+1),Q=0;for(K=1;K<=w;K++)Y[K]=Q=Q+M[K-1]<<1;for(L=0;L<=P;L++){var te=k[2*L+1];te!==0&&(k[2*L]=Oe(Y[te]++,te))}}function we(k){var P;for(P=0;P>1;1<=M;M--)Ie(k,Y,M);for(L=ge;M=k.heap[1],k.heap[1]=k.heap[k.heap_len--],Ie(k,Y,1),K=k.heap[1],k.heap[--k.heap_max]=M,k.heap[--k.heap_max]=K,Y[2*L]=Y[2*M]+Y[2*K],k.depth[L]=(k.depth[M]>=k.depth[K]?k.depth[M]:k.depth[K])+1,Y[2*M+1]=Y[2*K+1]=L,k.heap[1]=L++,Ie(k,Y,1),2<=k.heap_len;);k.heap[--k.heap_max]=k.heap[1],function(Ue,Et){var tr,Yt,ds,lt,fs,hs,nr=Et.dyn_tree,vu=Et.max_code,xu=Et.stat_desc.static_tree,Ri=Et.stat_desc.has_stree,wu=Et.stat_desc.extra_bits,Ai=Et.stat_desc.extra_base,Fr=Et.stat_desc.max_length,qs=0;for(lt=0;lt<=w;lt++)Ue.bl_count[lt]=0;for(nr[2*Ue.heap[Ue.heap_max]+1]=0,tr=Ue.heap_max+1;tr>=7;L>>=1)if(1&Ke&&te.dyn_ltree[2*ge]!==0)return i;if(te.dyn_ltree[18]!==0||te.dyn_ltree[20]!==0||te.dyn_ltree[26]!==0)return a;for(ge=32;ge>>3,(Y=k.static_len+3+7>>>3)<=L&&(L=Y)):L=Y=M+5,M+4<=L&&P!==-1?D(k,P,M,K):k.strategy===4||Y===L?(se(k,2+(K?1:0),3),Re(k,G,N)):(se(k,4+(K?1:0),3),function(te,ge,Ke,Ue){var Et;for(se(te,ge-257,5),se(te,Ke-1,5),se(te,Ue-4,4),Et=0;Et>>8&255,k.pending_buf[k.d_buf+2*k.last_lit+1]=255&P,k.pending_buf[k.l_buf+k.last_lit]=255&M,k.last_lit++,P===0?k.dyn_ltree[2*M]++:(k.matches++,P--,k.dyn_ltree[2*(S[M]+f+1)]++,k.dyn_dtree[2*B(P)]++),k.last_lit===k.lit_bufsize-1},s._tr_align=function(k){se(k,2,3),oe(k,b,G),function(P){P.bi_valid===16?(he(P,P.bi_buf),P.bi_buf=0,P.bi_valid=0):8<=P.bi_valid&&(P.pending_buf[P.pending++]=255&P.bi_buf,P.bi_buf>>=8,P.bi_valid-=8)}(k)}},{"../utils/common":41}],53:[function(n,r,s){r.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(n,r,s){(function(o){(function(i,a){if(!i.setImmediate){var c,u,d,f,h=1,m={},x=!1,p=i.document,w=Object.getPrototypeOf&&Object.getPrototypeOf(i);w=w&&w.setTimeout?w:i,c={}.toString.call(i.process)==="[object process]"?function(_){process.nextTick(function(){v(_)})}:function(){if(i.postMessage&&!i.importScripts){var _=!0,C=i.onmessage;return i.onmessage=function(){_=!1},i.postMessage("","*"),i.onmessage=C,_}}()?(f="setImmediate$"+Math.random()+"$",i.addEventListener?i.addEventListener("message",b,!1):i.attachEvent("onmessage",b),function(_){i.postMessage(f+_,"*")}):i.MessageChannel?((d=new MessageChannel).port1.onmessage=function(_){v(_.data)},function(_){d.port2.postMessage(_)}):p&&"onreadystatechange"in p.createElement("script")?(u=p.documentElement,function(_){var C=p.createElement("script");C.onreadystatechange=function(){v(_),C.onreadystatechange=null,u.removeChild(C),C=null},u.appendChild(C)}):function(_){setTimeout(v,0,_)},w.setImmediate=function(_){typeof _!="function"&&(_=new Function(""+_));for(var C=new Array(arguments.length-1),j=0;j"u"?o===void 0?this:o:self)}).call(this,typeof Cu<"u"?Cu:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(pN);var UU=pN.exports;const VU=Uf(UU);function BU(e){return new Promise((t,n)=>{const r=new FileReader;r.onload=()=>{r.result?t(r.result.toString()):n("No content found")},r.onerror=()=>n(r.error),r.readAsText(e)})}const WU=async(e,t)=>{const n=new VU;t.forEach(o=>{n.file(o.name,o.content)});const r=await n.generateAsync({type:"blob"}),s=document.createElement("a");s.href=URL.createObjectURL(r),s.download=e,s.click()},Ia=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)},HU=e=>Ia(e).split(" ")[0];function gN(e){const t=new Date;t.setUTCDate(t.getUTCDate()+e);const n=t.getUTCFullYear(),r=String(t.getUTCMonth()+1).padStart(2,"0"),s=String(t.getUTCDate()).padStart(2,"0"),o=String(t.getUTCHours()).padStart(2,"0"),i=String(t.getUTCMinutes()).padStart(2,"0"),a=String(t.getUTCSeconds()).padStart(2,"0");return`${n}-${r}-${s} ${o}:${i}:${a}`}const YU=async e=>{const t=ot();let n=1;e.page&&(n=e.page);let r=2;e.perPage&&(r=e.perPage);let s="";return e.state==="enabled"?s="enabled=true":e.state==="disabled"?s="enabled=false":e.state==="expired"&&(s=t.filter("expiredAt<{:expiredAt}",{expiredAt:gN(15)})),t.collection("domains").getList(n,r,{sort:"-created",expand:"lastDeployment",filter:s})},KU=async()=>{const e=ot(),t=await e.collection("domains").getList(1,1,{}),n=await e.collection("domains").getList(1,1,{filter:e.filter("expiredAt<{:expiredAt}",{expiredAt:gN(15)})}),r=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:n.totalItems,enabled:r.totalItems,disabled:s.totalItems}},GU=async e=>await ot().collection("domains").getOne(e),mf=async e=>e.id?await ot().collection("domains").update(e.id,e):await ot().collection("domains").create(e),ZU=async e=>await ot().collection("domains").delete(e),qU=(e,t)=>ot().collection("domains").subscribe(e,n=>{n.action==="update"&&t(n.record)},{expand:"lastDeployment"}),XU=e=>{ot().collection("domains").unsubscribe(e)},QU=()=>{const e=zr(),t=Jn(),{t:n}=Ye(),r=Ir(),s=new URLSearchParams(r.search),o=s.get("page"),i=s.get("state"),[a,c]=y.useState(0),u=()=>{t("/edit")},d=_=>{s.set("page",_.toString()),t(`?${s.toString()}`)},f=_=>{t(`/edit?id=${_}`)},h=_=>{t(`/history?domain=${_}`)},m=async _=>{try{await ZU(_),p(x.filter(C=>C.id!==_))}catch(C){console.error("Error deleting domain:",C)}},[x,p]=y.useState([]);y.useEffect(()=>{(async()=>{const C=await YU({page:o?Number(o):1,perPage:10,state:i||""});p(C.items),c(C.totalPages)})()},[o,i]);const w=async _=>{const C=x.filter(A=>A.id===_),j=C[0].enabled,T=C[0];T.enabled=!j,await mf(T);const R=x.map(A=>A.id===_?{...A,checked:!j}:A);p(R)},g=async _=>{try{XU(_.id??""),qU(_.id??"",C=>{const j=x.map(T=>T.id===C.id?{...C}:T);p(j)}),_.rightnow=!0,await mf(_),e.toast({title:n("domain.deploy.started.message"),description:n("domain.deploy.started.tips")})}catch{e.toast({title:n("domain.deploy.failed.message"),description:l.jsxs(WO,{i18nKey:"domain.deploy.failed.tips",children:["text1",l.jsx(wn,{to:`/history?domain=${_.id}`,className:"underline text-blue-500",children:"text2"}),"text3"]}),variant:"destructive"})}},v=async _=>{await g({..._,deployed:!1})},b=async _=>{const C=`${_.id}-${_.domain}.zip`,j=[{name:`${_.domain}.pem`,content:_.certificate?_.certificate:""},{name:`${_.domain}.key`,content:_.privateKey?_.privateKey:""}];await WU(C,j)};return l.jsx(l.Fragment,{children:l.jsxs("div",{className:"",children:[l.jsx(Px,{}),l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsx("div",{className:"text-muted-foreground",children:n("domain.page.title")}),l.jsx(Me,{onClick:u,children:n("domain.add")})]}),x.length?l.jsxs(l.Fragment,{children:[l.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:[l.jsx("div",{className:"w-36",children:n("common.text.domain")}),l.jsx("div",{className:"w-40",children:n("domain.props.expiry")}),l.jsx("div",{className:"w-32",children:n("domain.props.last_execution_status")}),l.jsx("div",{className:"w-64",children:n("domain.props.last_execution_stage")}),l.jsx("div",{className:"w-40 sm:ml-2",children:n("domain.props.last_execution_time")}),l.jsx("div",{className:"w-24",children:n("domain.props.enable")}),l.jsx("div",{className:"grow",children:n("common.text.operations")})]}),x.map(_=>{var C,j,T,R;return l.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:[l.jsx("div",{className:"sm:w-36 w-full pt-1 sm:pt-0 flex items-center truncate",children:_.domain.split(";").map(A=>l.jsxs(l.Fragment,{children:[A,l.jsx("br",{})]}))}),l.jsx("div",{className:"sm:w-40 w-full pt-1 sm:pt-0 flex items-center",children:l.jsx("div",{children:_.expiredAt?l.jsxs(l.Fragment,{children:[l.jsx("div",{children:n("domain.props.expiry.date1",{date:90})}),l.jsx("div",{children:n("domain.props.expiry.date2",{date:HU(_.expiredAt)})})]}):"---"})}),l.jsx("div",{className:"sm:w-32 w-full pt-1 sm:pt-0 flex items-center",children:_.lastDeployedAt&&((C=_.expand)!=null&&C.lastDeployment)?l.jsx(l.Fragment,{children:l.jsx(_x,{deployment:_.expand.lastDeployment})}):"---"}),l.jsx("div",{className:"sm:w-64 w-full pt-1 sm:pt-0 flex items-center",children:_.lastDeployedAt&&((j=_.expand)!=null&&j.lastDeployment)?l.jsx(bx,{phase:(T=_.expand.lastDeployment)==null?void 0:T.phase,phaseSuccess:(R=_.expand.lastDeployment)==null?void 0:R.phaseSuccess}):"---"}),l.jsx("div",{className:"sm:w-40 pt-1 sm:pt-0 sm:ml-2 flex items-center",children:_.lastDeployedAt?Ia(_.lastDeployedAt):"---"}),l.jsx("div",{className:"sm:w-24 flex items-center",children:l.jsx(xx,{children:l.jsxs(fE,{children:[l.jsx(hE,{children:l.jsx(mu,{checked:_.enabled,onCheckedChange:()=>{w(_.id??"")}})}),l.jsx(wx,{children:l.jsx("div",{className:"border rounded-sm px-3 bg-background text-muted-foreground text-xs",children:_.enabled?n("domain.props.enable.disabled"):n("domain.props.enable.enabled")})})]})})}),l.jsxs("div",{className:"flex items-center grow justify-start pt-1 sm:pt-0",children:[l.jsx(Me,{variant:"link",className:"p-0",onClick:()=>h(_.id??""),children:n("domain.history")}),l.jsxs(ur,{when:!!_.enabled,children:[l.jsx(br,{orientation:"vertical",className:"h-4 mx-2"}),l.jsx(Me,{variant:"link",className:"p-0",onClick:()=>g(_),children:n("domain.deploy")})]}),l.jsxs(ur,{when:!!(_.enabled&&_.deployed),children:[l.jsx(br,{orientation:"vertical",className:"h-4 mx-2"}),l.jsx(Me,{variant:"link",className:"p-0",onClick:()=>v(_),children:n("domain.deploy_forced")})]}),l.jsxs(ur,{when:!!_.expiredAt,children:[l.jsx(br,{orientation:"vertical",className:"h-4 mx-2"}),l.jsx(Me,{variant:"link",className:"p-0",onClick:()=>b(_),children:n("common.download")})]}),!_.enabled&&l.jsxs(l.Fragment,{children:[l.jsx(br,{orientation:"vertical",className:"h-4 mx-2"}),l.jsxs(Sx,{children:[l.jsx(kx,{asChild:!0,children:l.jsx(Me,{variant:"link",className:"p-0",children:n("common.delete")})}),l.jsxs(Mh,{children:[l.jsxs(Lh,{children:[l.jsx(Fh,{children:n("domain.delete")}),l.jsx($h,{children:n("domain.delete.confirm")})]}),l.jsxs(zh,{children:[l.jsx(Vh,{children:n("common.cancel")}),l.jsx(Uh,{onClick:()=>{m(_.id??"")},children:n("common.confirm")})]})]})]}),l.jsx(br,{orientation:"vertical",className:"h-4 mx-2"}),l.jsx(Me,{variant:"link",className:"p-0",onClick:()=>f(_.id??""),children:n("common.edit")})]})]})]},_.id)}),l.jsx(xE,{totalPages:a,currentPage:o?Number(o):1,onPageChange:_=>{d(_)}})]}):l.jsx(l.Fragment,{children:l.jsxs("div",{className:"flex flex-col items-center mt-10",children:[l.jsx("span",{className:"bg-orange-100 p-5 rounded-full",children:l.jsx(mg,{size:40,className:"text-primary"})}),l.jsx("div",{className:"text-center text-sm text-muted-foreground mt-3",children:n("domain.nodata")}),l.jsx(Me,{onClick:u,className:"mt-3",children:n("domain.add")})]})})]})})};var pu=e=>e.type==="checkbox",ca=e=>e instanceof Date,_n=e=>e==null;const yN=e=>typeof e=="object";var Xt=e=>!_n(e)&&!Array.isArray(e)&&yN(e)&&!ca(e),vN=e=>Xt(e)&&e.target?pu(e.target)?e.target.checked:e.target.value:e,JU=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,xN=(e,t)=>e.has(JU(t)),e8=e=>{const t=e.constructor&&e.constructor.prototype;return Xt(t)&&t.hasOwnProperty("isPrototypeOf")},Rx=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Tn(e){let t;const n=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(Rx&&(e instanceof Blob||e instanceof FileList))&&(n||Xt(e)))if(t=n?[]:{},!n&&!e8(e))t=e;else for(const r in e)e.hasOwnProperty(r)&&(t[r]=Tn(e[r]));else return e;return t}var Hh=e=>Array.isArray(e)?e.filter(Boolean):[],Ft=e=>e===void 0,de=(e,t,n)=>{if(!t||!Xt(e))return n;const r=Hh(t.split(/[,[\].]+?/)).reduce((s,o)=>_n(s)?s:s[o],e);return Ft(r)||r===e?Ft(e[t])?n:e[t]:r},Yr=e=>typeof e=="boolean",Ax=e=>/^\w*$/.test(e),wN=e=>Hh(e.replace(/["|']|\]/g,"").split(/\.|\[/)),mt=(e,t,n)=>{let r=-1;const s=Ax(t)?[t]:wN(t),o=s.length,i=o-1;for(;++rWe.useContext(bN),t8=e=>{const{children:t,...n}=e;return We.createElement(bN.Provider,{value:n},t)};var _N=(e,t,n,r=!0)=>{const s={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(s,o,{get:()=>{const i=o;return t._proxyFormState[i]!==_r.all&&(t._proxyFormState[i]=!r||_r.all),n&&(n[i]=!0),e[i]}});return s},Ln=e=>Xt(e)&&!Object.keys(e).length,SN=(e,t,n,r)=>{n(e);const{name:s,...o}=e;return Ln(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(i=>t[i]===(!r||_r.all))},Jl=e=>Array.isArray(e)?e:[e],kN=(e,t,n)=>!e||!t||e===t||Jl(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r)));function Dx(e){const t=We.useRef(e);t.current=e,We.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}function n8(e){const t=Yh(),{control:n=t.control,disabled:r,name:s,exact:o}=e||{},[i,a]=We.useState(n._formState),c=We.useRef(!0),u=We.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),d=We.useRef(s);return d.current=s,Dx({disabled:r,next:f=>c.current&&kN(d.current,f.name,o)&&SN(f,u.current,n._updateFormState)&&a({...n._formState,...f}),subject:n._subjects.state}),We.useEffect(()=>(c.current=!0,u.current.isValid&&n._updateValid(!0),()=>{c.current=!1}),[n]),_N(i,n,u.current,!1)}var Gr=e=>typeof e=="string",CN=(e,t,n,r,s)=>Gr(e)?(r&&t.watch.add(e),de(n,e,s)):Array.isArray(e)?e.map(o=>(r&&t.watch.add(o),de(n,o))):(r&&(t.watchAll=!0),n);function r8(e){const t=Yh(),{control:n=t.control,name:r,defaultValue:s,disabled:o,exact:i}=e||{},a=We.useRef(r);a.current=r,Dx({disabled:o,subject:n._subjects.values,next:d=>{kN(a.current,d.name,i)&&u(Tn(CN(a.current,n._names,d.values||n._formValues,!1,s)))}});const[c,u]=We.useState(n._getWatch(r,s));return We.useEffect(()=>n._removeUnmounted()),c}function s8(e){const t=Yh(),{name:n,disabled:r,control:s=t.control,shouldUnregister:o}=e,i=xN(s._names.array,n),a=r8({control:s,name:n,defaultValue:de(s._formValues,n,de(s._defaultValues,n,e.defaultValue)),exact:!0}),c=n8({control:s,name:n}),u=We.useRef(s.register(n,{...e.rules,value:a,...Yr(e.disabled)?{disabled:e.disabled}:{}}));return We.useEffect(()=>{const d=s._options.shouldUnregister||o,f=(h,m)=>{const x=de(s._fields,h);x&&x._f&&(x._f.mount=m)};if(f(n,!0),d){const h=Tn(de(s._options.defaultValues,n));mt(s._defaultValues,n,h),Ft(de(s._formValues,n))&&mt(s._formValues,n,h)}return()=>{(i?d&&!s._state.action:d)?s.unregister(n):f(n,!1)}},[n,s,i,o]),We.useEffect(()=>{de(s._fields,n)&&s._updateDisabledField({disabled:r,fields:s._fields,name:n,value:de(s._fields,n)._f.value})},[r,n,s]),{field:{name:n,value:a,...Yr(r)||c.disabled?{disabled:c.disabled||r}:{},onChange:We.useCallback(d=>u.current.onChange({target:{value:vN(d),name:n},type:pf.CHANGE}),[n]),onBlur:We.useCallback(()=>u.current.onBlur({target:{value:de(s._formValues,n),name:n},type:pf.BLUR}),[n,s]),ref:d=>{const f=de(s._fields,n);f&&d&&(f._f.ref={focus:()=>d.focus(),select:()=>d.select(),setCustomValidity:h=>d.setCustomValidity(h),reportValidity:()=>d.reportValidity()})}},formState:c,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!de(c.errors,n)},isDirty:{enumerable:!0,get:()=>!!de(c.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!de(c.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!de(c.validatingFields,n)},error:{enumerable:!0,get:()=>de(c.errors,n)}})}}const o8=e=>e.render(s8(e));var jN=(e,t,n,r,s)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:s||!0}}:{},Ob=e=>({isOnSubmit:!e||e===_r.onSubmit,isOnBlur:e===_r.onBlur,isOnChange:e===_r.onChange,isOnAll:e===_r.all,isOnTouch:e===_r.onTouched}),Ib=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const ec=(e,t,n,r)=>{for(const s of n||Object.keys(e)){const o=de(e,s);if(o){const{_f:i,...a}=o;if(i){if(i.refs&&i.refs[0]&&t(i.refs[0],s)&&!r)break;if(i.ref&&t(i.ref,i.name)&&!r)break;ec(a,t)}else Xt(a)&&ec(a,t)}}};var i8=(e,t,n)=>{const r=Jl(de(e,n));return mt(r,"root",t[n]),mt(e,n,r),e},Ox=e=>e.type==="file",ho=e=>typeof e=="function",gf=e=>{if(!Rx)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},jd=e=>Gr(e),Ix=e=>e.type==="radio",yf=e=>e instanceof RegExp;const Mb={value:!1,isValid:!1},Lb={value:!0,isValid:!0};var EN=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.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===""?Lb:{value:e[0].value,isValid:!0}:Lb:Mb}return Mb};const zb={isValid:!1,value:null};var NN=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,zb):zb;function Fb(e,t,n="validate"){if(jd(e)||Array.isArray(e)&&e.every(jd)||Yr(e)&&!e)return{type:n,message:jd(e)?e:"",ref:t}}var Vi=e=>Xt(e)&&!yf(e)?e:{value:e,message:""},$b=async(e,t,n,r,s)=>{const{ref:o,refs:i,required:a,maxLength:c,minLength:u,min:d,max:f,pattern:h,validate:m,name:x,valueAsNumber:p,mount:w,disabled:g}=e._f,v=de(t,x);if(!w||g)return{};const b=i?i[0]:o,_=N=>{r&&b.reportValidity&&(b.setCustomValidity(Yr(N)?"":N||""),b.reportValidity())},C={},j=Ix(o),T=pu(o),R=j||T,A=(p||Ox(o))&&Ft(o.value)&&Ft(v)||gf(o)&&o.value===""||v===""||Array.isArray(v)&&!v.length,O=jN.bind(null,x,n,C),G=(N,z,S,U=ys.maxLength,J=ys.minLength)=>{const F=N?z:S;C[x]={type:N?U:J,message:F,ref:o,...O(N?U:J,F)}};if(s?!Array.isArray(v)||!v.length:a&&(!R&&(A||_n(v))||Yr(v)&&!v||T&&!EN(i).isValid||j&&!NN(i).isValid)){const{value:N,message:z}=jd(a)?{value:!!a,message:a}:Vi(a);if(N&&(C[x]={type:ys.required,message:z,ref:b,...O(ys.required,z)},!n))return _(z),C}if(!A&&(!_n(d)||!_n(f))){let N,z;const S=Vi(f),U=Vi(d);if(!_n(v)&&!isNaN(v)){const J=o.valueAsNumber||v&&+v;_n(S.value)||(N=J>S.value),_n(U.value)||(z=Jnew Date(new Date().toDateString()+" "+X),W=o.type=="time",I=o.type=="week";Gr(S.value)&&v&&(N=W?F(v)>F(S.value):I?v>S.value:J>new Date(S.value)),Gr(U.value)&&v&&(z=W?F(v)+N.value,U=!_n(z.value)&&v.length<+z.value;if((S||U)&&(G(S,N.message,z.message),!n))return _(C[x].message),C}if(h&&!A&&Gr(v)){const{value:N,message:z}=Vi(h);if(yf(N)&&!v.match(N)&&(C[x]={type:ys.pattern,message:z,ref:o,...O(ys.pattern,z)},!n))return _(z),C}if(m){if(ho(m)){const N=await m(v,t),z=Fb(N,b);if(z&&(C[x]={...z,...O(ys.validate,z.message)},!n))return _(z.message),C}else if(Xt(m)){let N={};for(const z in m){if(!Ln(N)&&!n)break;const S=Fb(await m[z](v,t),b,z);S&&(N={...S,...O(z,S.message)},_(S.message),n&&(C[x]=N))}if(!Ln(N)&&(C[x]={ref:b,...N},!n))return C}}return _(!0),C};function a8(e,t){const n=t.slice(0,-1).length;let r=0;for(;r{let e=[];return{get observers(){return e},next:s=>{for(const o of e)o.next&&o.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(o=>o!==s)}}),unsubscribe:()=>{e=[]}}},vf=e=>_n(e)||!yN(e);function Xo(e,t){if(vf(e)||vf(t))return e===t;if(ca(e)&&ca(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const s of n){const o=e[s];if(!r.includes(s))return!1;if(s!=="ref"){const i=t[s];if(ca(o)&&ca(i)||Xt(o)&&Xt(i)||Array.isArray(o)&&Array.isArray(i)?!Xo(o,i):o!==i)return!1}}return!0}var TN=e=>e.type==="select-multiple",c8=e=>Ix(e)||pu(e),ap=e=>gf(e)&&e.isConnected,PN=e=>{for(const t in e)if(ho(e[t]))return!0;return!1};function xf(e,t={}){const n=Array.isArray(e);if(Xt(e)||n)for(const r in e)Array.isArray(e[r])||Xt(e[r])&&!PN(e[r])?(t[r]=Array.isArray(e[r])?[]:{},xf(e[r],t[r])):_n(e[r])||(t[r]=!0);return t}function RN(e,t,n){const r=Array.isArray(e);if(Xt(e)||r)for(const s in e)Array.isArray(e[s])||Xt(e[s])&&!PN(e[s])?Ft(t)||vf(n[s])?n[s]=Array.isArray(e[s])?xf(e[s],[]):{...xf(e[s])}:RN(e[s],_n(t)?{}:t[s],n[s]):n[s]=!Xo(e[s],t[s]);return n}var nd=(e,t)=>RN(e,t,xf(t)),AN=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>Ft(e)?e:t?e===""?NaN:e&&+e:n&&Gr(e)?new Date(e):r?r(e):e;function lp(e){const t=e.ref;if(!(e.refs?e.refs.every(n=>n.disabled):t.disabled))return Ox(t)?t.files:Ix(t)?NN(e.refs).value:TN(t)?[...t.selectedOptions].map(({value:n})=>n):pu(t)?EN(e.refs).value:AN(Ft(t.value)?e.ref.value:t.value,e)}var u8=(e,t,n,r)=>{const s={};for(const o of e){const i=de(t,o);i&&mt(s,o,i._f)}return{criteriaMode:n,names:[...e],fields:s,shouldUseNativeValidation:r}},jl=e=>Ft(e)?e:yf(e)?e.source:Xt(e)?yf(e.value)?e.value.source:e.value:e,d8=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function Ub(e,t,n){const r=de(e,n);if(r||Ax(n))return{error:r,name:n};const s=n.split(".");for(;s.length;){const o=s.join("."),i=de(t,o),a=de(e,o);if(i&&!Array.isArray(i)&&n!==o)return{name:n};if(a&&a.type)return{name:o,error:a};s.pop()}return{name:n}}var f8=(e,t,n,r,s)=>s.isOnAll?!1:!n&&s.isOnTouch?!(t||e):(n?r.isOnBlur:s.isOnBlur)?!e:(n?r.isOnChange:s.isOnChange)?e:!0,h8=(e,t)=>!Hh(de(e,t)).length&&Kt(e,t);const m8={mode:_r.onSubmit,reValidateMode:_r.onChange,shouldFocusError:!0};function p8(e={}){let t={...m8,...e},n={submitCount:0,isDirty:!1,isLoading:ho(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},s=Xt(t.defaultValues)||Xt(t.values)?Tn(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:Tn(s),i={action:!1,mount:!1,watch:!1},a={mount:new Set,unMount:new Set,array:new Set,watch:new Set},c,u=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},f={values:ip(),array:ip(),state:ip()},h=Ob(t.mode),m=Ob(t.reValidateMode),x=t.criteriaMode===_r.all,p=k=>P=>{clearTimeout(u),u=setTimeout(k,P)},w=async k=>{if(d.isValid||k){const P=t.resolver?Ln((await R()).errors):await O(r,!0);P!==n.isValid&&f.state.next({isValid:P})}},g=(k,P)=>{(d.isValidating||d.validatingFields)&&((k||Array.from(a.mount)).forEach(M=>{M&&(P?mt(n.validatingFields,M,P):Kt(n.validatingFields,M))}),f.state.next({validatingFields:n.validatingFields,isValidating:!Ln(n.validatingFields)}))},v=(k,P=[],M,K,L=!0,Y=!0)=>{if(K&&M){if(i.action=!0,Y&&Array.isArray(de(r,k))){const Q=M(de(r,k),K.argA,K.argB);L&&mt(r,k,Q)}if(Y&&Array.isArray(de(n.errors,k))){const Q=M(de(n.errors,k),K.argA,K.argB);L&&mt(n.errors,k,Q),h8(n.errors,k)}if(d.touchedFields&&Y&&Array.isArray(de(n.touchedFields,k))){const Q=M(de(n.touchedFields,k),K.argA,K.argB);L&&mt(n.touchedFields,k,Q)}d.dirtyFields&&(n.dirtyFields=nd(s,o)),f.state.next({name:k,isDirty:N(k,P),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else mt(o,k,P)},b=(k,P)=>{mt(n.errors,k,P),f.state.next({errors:n.errors})},_=k=>{n.errors=k,f.state.next({errors:n.errors,isValid:!1})},C=(k,P,M,K)=>{const L=de(r,k);if(L){const Y=de(o,k,Ft(M)?de(s,k):M);Ft(Y)||K&&K.defaultChecked||P?mt(o,k,P?Y:lp(L._f)):U(k,Y),i.mount&&w()}},j=(k,P,M,K,L)=>{let Y=!1,Q=!1;const te={name:k},ge=!!(de(r,k)&&de(r,k)._f&&de(r,k)._f.disabled);if(!M||K){d.isDirty&&(Q=n.isDirty,n.isDirty=te.isDirty=N(),Y=Q!==te.isDirty);const Ke=ge||Xo(de(s,k),P);Q=!!(!ge&&de(n.dirtyFields,k)),Ke||ge?Kt(n.dirtyFields,k):mt(n.dirtyFields,k,!0),te.dirtyFields=n.dirtyFields,Y=Y||d.dirtyFields&&Q!==!Ke}if(M){const Ke=de(n.touchedFields,k);Ke||(mt(n.touchedFields,k,M),te.touchedFields=n.touchedFields,Y=Y||d.touchedFields&&Ke!==M)}return Y&&L&&f.state.next(te),Y?te:{}},T=(k,P,M,K)=>{const L=de(n.errors,k),Y=d.isValid&&Yr(P)&&n.isValid!==P;if(e.delayError&&M?(c=p(()=>b(k,M)),c(e.delayError)):(clearTimeout(u),c=null,M?mt(n.errors,k,M):Kt(n.errors,k)),(M?!Xo(L,M):L)||!Ln(K)||Y){const Q={...K,...Y&&Yr(P)?{isValid:P}:{},errors:n.errors,name:k};n={...n,...Q},f.state.next(Q)}},R=async k=>{g(k,!0);const P=await t.resolver(o,t.context,u8(k||a.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return g(k),P},A=async k=>{const{errors:P}=await R(k);if(k)for(const M of k){const K=de(P,M);K?mt(n.errors,M,K):Kt(n.errors,M)}else n.errors=P;return P},O=async(k,P,M={valid:!0})=>{for(const K in k){const L=k[K];if(L){const{_f:Y,...Q}=L;if(Y){const te=a.array.has(Y.name);g([K],!0);const ge=await $b(L,o,x,t.shouldUseNativeValidation&&!P,te);if(g([K]),ge[Y.name]&&(M.valid=!1,P))break;!P&&(de(ge,Y.name)?te?i8(n.errors,ge,Y.name):mt(n.errors,Y.name,ge[Y.name]):Kt(n.errors,Y.name))}Q&&await O(Q,P,M)}}return M.valid},G=()=>{for(const k of a.unMount){const P=de(r,k);P&&(P._f.refs?P._f.refs.every(M=>!ap(M)):!ap(P._f.ref))&&Oe(k)}a.unMount=new Set},N=(k,P)=>(k&&P&&mt(o,k,P),!Xo($(),s)),z=(k,P,M)=>CN(k,a,{...i.mount?o:Ft(P)?s:Gr(k)?{[k]:P}:P},M,P),S=k=>Hh(de(i.mount?o:s,k,e.shouldUnregister?de(s,k,[]):[])),U=(k,P,M={})=>{const K=de(r,k);let L=P;if(K){const Y=K._f;Y&&(!Y.disabled&&mt(o,k,AN(P,Y)),L=gf(Y.ref)&&_n(P)?"":P,TN(Y.ref)?[...Y.ref.options].forEach(Q=>Q.selected=L.includes(Q.value)):Y.refs?pu(Y.ref)?Y.refs.length>1?Y.refs.forEach(Q=>(!Q.defaultChecked||!Q.disabled)&&(Q.checked=Array.isArray(L)?!!L.find(te=>te===Q.value):L===Q.value)):Y.refs[0]&&(Y.refs[0].checked=!!L):Y.refs.forEach(Q=>Q.checked=Q.value===L):Ox(Y.ref)?Y.ref.value="":(Y.ref.value=L,Y.ref.type||f.values.next({name:k,values:{...o}})))}(M.shouldDirty||M.shouldTouch)&&j(k,L,M.shouldTouch,M.shouldDirty,!0),M.shouldValidate&&X(k)},J=(k,P,M)=>{for(const K in P){const L=P[K],Y=`${k}.${K}`,Q=de(r,Y);(a.array.has(k)||!vf(L)||Q&&!Q._f)&&!ca(L)?J(Y,L,M):U(Y,L,M)}},F=(k,P,M={})=>{const K=de(r,k),L=a.array.has(k),Y=Tn(P);mt(o,k,Y),L?(f.array.next({name:k,values:{...o}}),(d.isDirty||d.dirtyFields)&&M.shouldDirty&&f.state.next({name:k,dirtyFields:nd(s,o),isDirty:N(k,Y)})):K&&!K._f&&!_n(Y)?J(k,Y,M):U(k,Y,M),Ib(k,a)&&f.state.next({...n}),f.values.next({name:i.mount?k:void 0,values:{...o}})},W=async k=>{i.mount=!0;const P=k.target;let M=P.name,K=!0;const L=de(r,M),Y=()=>P.type?lp(L._f):vN(k),Q=te=>{K=Number.isNaN(te)||te===de(o,M,te)};if(L){let te,ge;const Ke=Y(),Ue=k.type===pf.BLUR||k.type===pf.FOCUS_OUT,Et=!d8(L._f)&&!t.resolver&&!de(n.errors,M)&&!L._f.deps||f8(Ue,de(n.touchedFields,M),n.isSubmitted,m,h),tr=Ib(M,a,Ue);mt(o,M,Ke),Ue?(L._f.onBlur&&L._f.onBlur(k),c&&c(0)):L._f.onChange&&L._f.onChange(k);const Yt=j(M,Ke,Ue,!1),ds=!Ln(Yt)||tr;if(!Ue&&f.values.next({name:M,type:k.type,values:{...o}}),Et)return d.isValid&&w(),ds&&f.state.next({name:M,...tr?{}:Yt});if(!Ue&&tr&&f.state.next({...n}),t.resolver){const{errors:lt}=await R([M]);if(Q(Ke),K){const fs=Ub(n.errors,r,M),hs=Ub(lt,r,fs.name||M);te=hs.error,M=hs.name,ge=Ln(lt)}}else g([M],!0),te=(await $b(L,o,x,t.shouldUseNativeValidation))[M],g([M]),Q(Ke),K&&(te?ge=!1:d.isValid&&(ge=await O(r,!0)));K&&(L._f.deps&&X(L._f.deps),T(M,ge,te,Yt))}},I=(k,P)=>{if(de(n.errors,P)&&k.focus)return k.focus(),1},X=async(k,P={})=>{let M,K;const L=Jl(k);if(t.resolver){const Y=await A(Ft(k)?k:L);M=Ln(Y),K=k?!L.some(Q=>de(Y,Q)):M}else k?(K=(await Promise.all(L.map(async Y=>{const Q=de(r,Y);return await O(Q&&Q._f?{[Y]:Q}:Q)}))).every(Boolean),!(!K&&!n.isValid)&&w()):K=M=await O(r);return f.state.next({...!Gr(k)||d.isValid&&M!==n.isValid?{}:{name:k},...t.resolver||!k?{isValid:M}:{},errors:n.errors}),P.shouldFocus&&!K&&ec(r,I,k?L:a.mount),K},$=k=>{const P={...i.mount?o:s};return Ft(k)?P:Gr(k)?de(P,k):k.map(M=>de(P,M))},B=(k,P)=>({invalid:!!de((P||n).errors,k),isDirty:!!de((P||n).dirtyFields,k),error:de((P||n).errors,k),isValidating:!!de(n.validatingFields,k),isTouched:!!de((P||n).touchedFields,k)}),he=k=>{k&&Jl(k).forEach(P=>Kt(n.errors,P)),f.state.next({errors:k?n.errors:{}})},se=(k,P,M)=>{const K=(de(r,k,{_f:{}})._f||{}).ref,L=de(n.errors,k)||{},{ref:Y,message:Q,type:te,...ge}=L;mt(n.errors,k,{...ge,...P,ref:K}),f.state.next({name:k,errors:n.errors,isValid:!1}),M&&M.shouldFocus&&K&&K.focus&&K.focus()},oe=(k,P)=>ho(k)?f.values.subscribe({next:M=>k(z(void 0,P),M)}):z(k,P,!0),Oe=(k,P={})=>{for(const M of k?Jl(k):a.mount)a.mount.delete(M),a.array.delete(M),P.keepValue||(Kt(r,M),Kt(o,M)),!P.keepError&&Kt(n.errors,M),!P.keepDirty&&Kt(n.dirtyFields,M),!P.keepTouched&&Kt(n.touchedFields,M),!P.keepIsValidating&&Kt(n.validatingFields,M),!t.shouldUnregister&&!P.keepDefaultValue&&Kt(s,M);f.values.next({values:{...o}}),f.state.next({...n,...P.keepDirty?{isDirty:N()}:{}}),!P.keepIsValid&&w()},me=({disabled:k,name:P,field:M,fields:K,value:L})=>{if(Yr(k)&&i.mount||k){const Y=k?void 0:Ft(L)?lp(M?M._f:de(K,P)._f):L;mt(o,P,Y),j(P,Y,!1,!1,!0)}},we=(k,P={})=>{let M=de(r,k);const K=Yr(P.disabled);return mt(r,k,{...M||{},_f:{...M&&M._f?M._f:{ref:{name:k}},name:k,mount:!0,...P}}),a.mount.add(k),M?me({field:M,disabled:P.disabled,name:k,value:P.value}):C(k,!0,P.value),{...K?{disabled:P.disabled}:{},...t.progressive?{required:!!P.required,min:jl(P.min),max:jl(P.max),minLength:jl(P.minLength),maxLength:jl(P.maxLength),pattern:jl(P.pattern)}:{},name:k,onChange:W,onBlur:W,ref:L=>{if(L){we(k,P),M=de(r,k);const Y=Ft(L.value)&&L.querySelectorAll&&L.querySelectorAll("input,select,textarea")[0]||L,Q=c8(Y),te=M._f.refs||[];if(Q?te.find(ge=>ge===Y):Y===M._f.ref)return;mt(r,k,{_f:{...M._f,...Q?{refs:[...te.filter(ap),Y,...Array.isArray(de(s,k))?[{}]:[]],ref:{type:Y.type,name:k}}:{ref:Y}}}),C(k,!1,void 0,Y)}else M=de(r,k,{}),M._f&&(M._f.mount=!1),(t.shouldUnregister||P.shouldUnregister)&&!(xN(a.array,k)&&i.action)&&a.unMount.add(k)}}},Te=()=>t.shouldFocusError&&ec(r,I,a.mount),Fe=k=>{Yr(k)&&(f.state.next({disabled:k}),ec(r,(P,M)=>{const K=de(r,M);K&&(P.disabled=K._f.disabled||k,Array.isArray(K._f.refs)&&K._f.refs.forEach(L=>{L.disabled=K._f.disabled||k}))},0,!1))},Ie=(k,P)=>async M=>{let K;M&&(M.preventDefault&&M.preventDefault(),M.persist&&M.persist());let L=Tn(o);if(f.state.next({isSubmitting:!0}),t.resolver){const{errors:Y,values:Q}=await R();n.errors=Y,L=Q}else await O(r);if(Kt(n.errors,"root"),Ln(n.errors)){f.state.next({errors:{}});try{await k(L,M)}catch(Y){K=Y}}else P&&await P({...n.errors},M),Te(),setTimeout(Te);if(f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Ln(n.errors)&&!K,submitCount:n.submitCount+1,errors:n.errors}),K)throw K},Re=(k,P={})=>{de(r,k)&&(Ft(P.defaultValue)?F(k,Tn(de(s,k))):(F(k,P.defaultValue),mt(s,k,Tn(P.defaultValue))),P.keepTouched||Kt(n.touchedFields,k),P.keepDirty||(Kt(n.dirtyFields,k),n.isDirty=P.defaultValue?N(k,Tn(de(s,k))):N()),P.keepError||(Kt(n.errors,k),d.isValid&&w()),f.state.next({...n}))},st=(k,P={})=>{const M=k?Tn(k):s,K=Tn(M),L=Ln(k),Y=L?s:K;if(P.keepDefaultValues||(s=M),!P.keepValues){if(P.keepDirtyValues)for(const Q of a.mount)de(n.dirtyFields,Q)?mt(Y,Q,de(o,Q)):F(Q,de(Y,Q));else{if(Rx&&Ft(k))for(const Q of a.mount){const te=de(r,Q);if(te&&te._f){const ge=Array.isArray(te._f.refs)?te._f.refs[0]:te._f.ref;if(gf(ge)){const Ke=ge.closest("form");if(Ke){Ke.reset();break}}}}r={}}o=e.shouldUnregister?P.keepDefaultValues?Tn(s):{}:Tn(Y),f.array.next({values:{...Y}}),f.values.next({values:{...Y}})}a={mount:P.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!d.isValid||!!P.keepIsValid||!!P.keepDirtyValues,i.watch=!!e.shouldUnregister,f.state.next({submitCount:P.keepSubmitCount?n.submitCount:0,isDirty:L?!1:P.keepDirty?n.isDirty:!!(P.keepDefaultValues&&!Xo(k,s)),isSubmitted:P.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:L?{}:P.keepDirtyValues?P.keepDefaultValues&&o?nd(s,o):n.dirtyFields:P.keepDefaultValues&&k?nd(s,k):P.keepDirty?n.dirtyFields:{},touchedFields:P.keepTouched?n.touchedFields:{},errors:P.keepErrors?n.errors:{},isSubmitSuccessful:P.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},E=(k,P)=>st(ho(k)?k(o):k,P);return{control:{register:we,unregister:Oe,getFieldState:B,handleSubmit:Ie,setError:se,_executeSchema:R,_getWatch:z,_getDirty:N,_updateValid:w,_removeUnmounted:G,_updateFieldArray:v,_updateDisabledField:me,_getFieldArray:S,_reset:st,_resetDefaultValues:()=>ho(t.defaultValues)&&t.defaultValues().then(k=>{E(k,t.resetOptions),f.state.next({isLoading:!1})}),_updateFormState:k=>{n={...n,...k}},_disableForm:Fe,_subjects:f,_proxyFormState:d,_setErrors:_,get _fields(){return r},get _formValues(){return o},get _state(){return i},set _state(k){i=k},get _defaultValues(){return s},get _names(){return a},set _names(k){a=k},get _formState(){return n},set _formState(k){n=k},get _options(){return t},set _options(k){t={...t,...k}}},trigger:X,register:we,handleSubmit:Ie,watch:oe,setValue:F,getValues:$,reset:E,resetField:Re,clearErrors:he,unregister:Oe,setError:se,setFocus:(k,P={})=>{const M=de(r,k),K=M&&M._f;if(K){const L=K.refs?K.refs[0]:K.ref;L.focus&&(L.focus(),P.shouldSelect&&L.select())}},getFieldState:B}}function cn(e={}){const t=We.useRef(),n=We.useRef(),[r,s]=We.useState({isDirty:!1,isValidating:!1,isLoading:ho(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:ho(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...p8(e),formState:r});const o=t.current.control;return o._options=e,Dx({subject:o._subjects.state,next:i=>{SN(i,o._proxyFormState,o._updateFormState,!0)&&s({...o._formState})}}),We.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),We.useEffect(()=>{if(o._proxyFormState.isDirty){const i=o._getDirty();i!==r.isDirty&&o._subjects.state.next({isDirty:i})}},[o,r.isDirty]),We.useEffect(()=>{e.values&&!Xo(e.values,n.current)?(o._reset(e.values,o._options.resetOptions),n.current=e.values,s(i=>({...i}))):o._resetDefaultValues()},[e.values,o]),We.useEffect(()=>{e.errors&&o._setErrors(e.errors)},[e.errors,o]),We.useEffect(()=>{o._state.mount||(o._updateValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),We.useEffect(()=>{e.shouldUnregister&&o._subjects.values.next({values:o._getWatch()})},[e.shouldUnregister,o]),t.current.formState=_N(r,o),t.current}var it;(function(e){e.assertEqual=s=>s;function t(s){}e.assertIs=t;function n(s){throw new Error}e.assertNever=n,e.arrayToEnum=s=>{const o={};for(const i of s)o[i]=i;return o},e.getValidEnumValues=s=>{const o=e.objectKeys(s).filter(a=>typeof s[s[a]]!="number"),i={};for(const a of o)i[a]=s[a];return e.objectValues(i)},e.objectValues=s=>e.objectKeys(s).map(function(o){return s[o]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const o=[];for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&o.push(i);return o},e.find=(s,o)=>{for(const i of s)if(o(i))return i},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function r(s,o=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(o)}e.joinValues=r,e.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(it||(it={}));var Mg;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(Mg||(Mg={}));const _e=it.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ao=e=>{switch(typeof e){case"undefined":return _e.undefined;case"string":return _e.string;case"number":return isNaN(e)?_e.nan:_e.number;case"boolean":return _e.boolean;case"function":return _e.function;case"bigint":return _e.bigint;case"symbol":return _e.symbol;case"object":return Array.isArray(e)?_e.array:e===null?_e.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?_e.promise:typeof Map<"u"&&e instanceof Map?_e.map:typeof Set<"u"&&e instanceof Set?_e.set:typeof Date<"u"&&e instanceof Date?_e.date:_e.object;default:return _e.unknown}},ae=it.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"]),g8=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Yn extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(o){return o.message},r={_errors:[]},s=o=>{for(const i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)r._errors.push(n(i));else{let a=r,c=0;for(;cn.message){const n={},r=[];for(const s of this.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(t(s))):r.push(t(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Yn.create=e=>new Yn(e);const Ma=(e,t)=>{let n;switch(e.code){case ae.invalid_type:e.received===_e.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case ae.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,it.jsonStringifyReplacer)}`;break;case ae.unrecognized_keys:n=`Unrecognized key(s) in object: ${it.joinValues(e.keys,", ")}`;break;case ae.invalid_union:n="Invalid input";break;case ae.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${it.joinValues(e.options)}`;break;case ae.invalid_enum_value:n=`Invalid enum value. Expected ${it.joinValues(e.options)}, received '${e.received}'`;break;case ae.invalid_arguments:n="Invalid function arguments";break;case ae.invalid_return_type:n="Invalid function return type";break;case ae.invalid_date:n="Invalid date";break;case ae.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:it.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case ae.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case ae.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case ae.custom:n="Invalid input";break;case ae.invalid_intersection_types:n="Intersection results could not be merged";break;case ae.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case ae.not_finite:n="Number must be finite";break;default:n=t.defaultError,it.assertNever(e)}return{message:n}};let DN=Ma;function y8(e){DN=e}function wf(){return DN}const bf=e=>{const{data:t,path:n,errorMaps:r,issueData:s}=e,o=[...n,...s.path||[]],i={...s,path:o};if(s.message!==void 0)return{...s,path:o,message:s.message};let a="";const c=r.filter(u=>!!u).slice().reverse();for(const u of c)a=u(i,{data:t,defaultError:a}).message;return{...s,path:o,message:a}},v8=[];function ve(e,t){const n=wf(),r=bf({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Ma?void 0:Ma].filter(s=>!!s)});e.common.issues.push(r)}class yn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const s of n){if(s.status==="aborted")return He;s.status==="dirty"&&t.dirty(),r.push(s.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const s of n){const o=await s.key,i=await s.value;r.push({key:o,value:i})}return yn.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const s of n){const{key:o,value:i}=s;if(o.status==="aborted"||i.status==="aborted")return He;o.status==="dirty"&&t.dirty(),i.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof i.value<"u"||s.alwaysSet)&&(r[o.value]=i.value)}return{status:t.value,value:r}}}const He=Object.freeze({status:"aborted"}),ua=e=>({status:"dirty",value:e}),kn=e=>({status:"valid",value:e}),Lg=e=>e.status==="aborted",zg=e=>e.status==="dirty",Pc=e=>e.status==="valid",Rc=e=>typeof Promise<"u"&&e instanceof Promise;function _f(e,t,n,r){if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function ON(e,t,n,r,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,n),n}var De;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(De||(De={}));var Ml,Ll;class rs{constructor(t,n,r,s){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,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 Vb=(e,t)=>{if(Pc(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 n=new Yn(e.common.issues);return this._error=n,this._error}}};function Ze(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:s}=e;if(t&&(n||r))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:(i,a)=>{var c,u;const{message:d}=e;return i.code==="invalid_enum_value"?{message:d??a.defaultError}:typeof a.data>"u"?{message:(c=d??r)!==null&&c!==void 0?c:a.defaultError}:i.code!=="invalid_type"?{message:a.defaultError}:{message:(u=d??n)!==null&&u!==void 0?u:a.defaultError}},description:s}}class et{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 ao(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:ao(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new yn,ctx:{common:t.parent.common,data:t.data,parsedType:ao(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(Rc(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const s={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ao(t)},o=this._parseSync({data:t,path:s.path,parent:s});return Vb(s,o)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ao(t)},s=this._parse({data:t,path:r.path,parent:r}),o=await(Rc(s)?s:Promise.resolve(s));return Vb(r,o)}refine(t,n){const r=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,o)=>{const i=t(s),a=()=>o.addIssue({code:ae.custom,...r(s)});return typeof Promise<"u"&&i instanceof Promise?i.then(c=>c?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(t,n){return this._refinement((r,s)=>t(r)?!0:(s.addIssue(typeof n=="function"?n(r,s):n),!1))}_refinement(t){return new Or({schema:this,typeName:Ve.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Jr.create(this,this._def)}nullable(){return Ro.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Nr.create(this,this._def)}promise(){return za.create(this,this._def)}or(t){return Ic.create([this,t],this._def)}and(t){return Mc.create(this,t,this._def)}transform(t){return new Or({...Ze(this._def),schema:this,typeName:Ve.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new Uc({...Ze(this._def),innerType:this,defaultValue:n,typeName:Ve.ZodDefault})}brand(){return new Mx({typeName:Ve.ZodBranded,type:this,...Ze(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new Vc({...Ze(this._def),innerType:this,catchValue:n,typeName:Ve.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return gu.create(this,t)}readonly(){return Bc.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const x8=/^c[^\s-]{8,}$/i,w8=/^[0-9a-z]+$/,b8=/^[0-9A-HJKMNP-TV-Z]{26}$/,_8=/^[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,S8=/^[a-z0-9_-]{21}$/i,k8=/^[-+]?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)?)??$/,C8=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,j8="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let cp;const E8=/^(?:(?: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])$/,N8=/^(([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})))$/,T8=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,IN="((\\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])))",P8=new RegExp(`^${IN}$`);function MN(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 R8(e){return new RegExp(`^${MN(e)}$`)}function LN(e){let t=`${IN}T${MN(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function A8(e,t){return!!((t==="v4"||!t)&&E8.test(e)||(t==="v6"||!t)&&N8.test(e))}class Cr extends et{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==_e.string){const o=this._getOrReturnCtx(t);return ve(o,{code:ae.invalid_type,expected:_e.string,received:o.parsedType}),He}const r=new yn;let s;for(const o of this._def.checks)if(o.kind==="min")t.data.lengtho.value&&(s=this._getOrReturnCtx(t,s),ve(s,{code:ae.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const i=t.data.length>o.value,a=t.data.lengtht.test(s),{validation:n,code:ae.invalid_string,...De.errToObj(r)})}_addCheck(t){return new Cr({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...De.errToObj(t)})}url(t){return this._addCheck({kind:"url",...De.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...De.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...De.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...De.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...De.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...De.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...De.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...De.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...De.errToObj(t)})}datetime(t){var n,r;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:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,local:(r=t==null?void 0:t.local)!==null&&r!==void 0?r:!1,...De.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,...De.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...De.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...De.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...De.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...De.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...De.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...De.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...De.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...De.errToObj(n)})}nonempty(t){return this.min(1,De.errToObj(t))}trim(){return new Cr({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Cr({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Cr({...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 n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value{var t;return new Cr({checks:[],typeName:Ve.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Ze(e)})};function D8(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,s=n>r?n:r,o=parseInt(e.toFixed(s).replace(".","")),i=parseInt(t.toFixed(s).replace(".",""));return o%i/Math.pow(10,s)}class No extends et{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)!==_e.number){const o=this._getOrReturnCtx(t);return ve(o,{code:ae.invalid_type,expected:_e.number,received:o.parsedType}),He}let r;const s=new yn;for(const o of this._def.checks)o.kind==="int"?it.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),ve(r,{code:ae.invalid_type,expected:"integer",received:"float",message:o.message}),s.dirty()):o.kind==="min"?(o.inclusive?t.datao.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),ve(r,{code:ae.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="multipleOf"?D8(t.data,o.value)!==0&&(r=this._getOrReturnCtx(t,r),ve(r,{code:ae.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),ve(r,{code:ae.not_finite,message:o.message}),s.dirty()):it.assertNever(o);return{status:s.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,De.toString(n))}gt(t,n){return this.setLimit("min",t,!1,De.toString(n))}lte(t,n){return this.setLimit("max",t,!0,De.toString(n))}lt(t,n){return this.setLimit("max",t,!1,De.toString(n))}setLimit(t,n,r,s){return new No({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:De.toString(s)}]})}_addCheck(t){return new No({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:De.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:De.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:De.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:De.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:De.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:De.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:De.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:De.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:De.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.valuet.kind==="int"||t.kind==="multipleOf"&&it.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.valuenew No({checks:[],typeName:Ve.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Ze(e)});class To extends et{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)!==_e.bigint){const o=this._getOrReturnCtx(t);return ve(o,{code:ae.invalid_type,expected:_e.bigint,received:o.parsedType}),He}let r;const s=new yn;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.datao.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),ve(r,{code:ae.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),ve(r,{code:ae.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):it.assertNever(o);return{status:s.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,De.toString(n))}gt(t,n){return this.setLimit("min",t,!1,De.toString(n))}lte(t,n){return this.setLimit("max",t,!0,De.toString(n))}lt(t,n){return this.setLimit("max",t,!1,De.toString(n))}setLimit(t,n,r,s){return new To({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:De.toString(s)}]})}_addCheck(t){return new To({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:De.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:De.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:De.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:De.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:De.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value{var t;return new To({checks:[],typeName:Ve.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Ze(e)})};class Ac extends et{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==_e.boolean){const r=this._getOrReturnCtx(t);return ve(r,{code:ae.invalid_type,expected:_e.boolean,received:r.parsedType}),He}return kn(t.data)}}Ac.create=e=>new Ac({typeName:Ve.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Ze(e)});class mi extends et{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==_e.date){const o=this._getOrReturnCtx(t);return ve(o,{code:ae.invalid_type,expected:_e.date,received:o.parsedType}),He}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return ve(o,{code:ae.invalid_date}),He}const r=new yn;let s;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()o.value&&(s=this._getOrReturnCtx(t,s),ve(s,{code:ae.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):it.assertNever(o);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new mi({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:De.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:De.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.valuenew mi({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Ve.ZodDate,...Ze(e)});class Sf extends et{_parse(t){if(this._getType(t)!==_e.symbol){const r=this._getOrReturnCtx(t);return ve(r,{code:ae.invalid_type,expected:_e.symbol,received:r.parsedType}),He}return kn(t.data)}}Sf.create=e=>new Sf({typeName:Ve.ZodSymbol,...Ze(e)});class Dc extends et{_parse(t){if(this._getType(t)!==_e.undefined){const r=this._getOrReturnCtx(t);return ve(r,{code:ae.invalid_type,expected:_e.undefined,received:r.parsedType}),He}return kn(t.data)}}Dc.create=e=>new Dc({typeName:Ve.ZodUndefined,...Ze(e)});class Oc extends et{_parse(t){if(this._getType(t)!==_e.null){const r=this._getOrReturnCtx(t);return ve(r,{code:ae.invalid_type,expected:_e.null,received:r.parsedType}),He}return kn(t.data)}}Oc.create=e=>new Oc({typeName:Ve.ZodNull,...Ze(e)});class La extends et{constructor(){super(...arguments),this._any=!0}_parse(t){return kn(t.data)}}La.create=e=>new La({typeName:Ve.ZodAny,...Ze(e)});class ri extends et{constructor(){super(...arguments),this._unknown=!0}_parse(t){return kn(t.data)}}ri.create=e=>new ri({typeName:Ve.ZodUnknown,...Ze(e)});class Fs extends et{_parse(t){const n=this._getOrReturnCtx(t);return ve(n,{code:ae.invalid_type,expected:_e.never,received:n.parsedType}),He}}Fs.create=e=>new Fs({typeName:Ve.ZodNever,...Ze(e)});class kf extends et{_parse(t){if(this._getType(t)!==_e.undefined){const r=this._getOrReturnCtx(t);return ve(r,{code:ae.invalid_type,expected:_e.void,received:r.parsedType}),He}return kn(t.data)}}kf.create=e=>new kf({typeName:Ve.ZodVoid,...Ze(e)});class Nr extends et{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),s=this._def;if(n.parsedType!==_e.array)return ve(n,{code:ae.invalid_type,expected:_e.array,received:n.parsedType}),He;if(s.exactLength!==null){const i=n.data.length>s.exactLength.value,a=n.data.lengths.maxLength.value&&(ve(n,{code:ae.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((i,a)=>s.type._parseAsync(new rs(n,i,n.path,a)))).then(i=>yn.mergeArray(r,i));const o=[...n.data].map((i,a)=>s.type._parseSync(new rs(n,i,n.path,a)));return yn.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new Nr({...this._def,minLength:{value:t,message:De.toString(n)}})}max(t,n){return new Nr({...this._def,maxLength:{value:t,message:De.toString(n)}})}length(t,n){return new Nr({...this._def,exactLength:{value:t,message:De.toString(n)}})}nonempty(t){return this.min(1,t)}}Nr.create=(e,t)=>new Nr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ve.ZodArray,...Ze(t)});function Yi(e){if(e instanceof Rt){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Jr.create(Yi(r))}return new Rt({...e._def,shape:()=>t})}else return e instanceof Nr?new Nr({...e._def,type:Yi(e.element)}):e instanceof Jr?Jr.create(Yi(e.unwrap())):e instanceof Ro?Ro.create(Yi(e.unwrap())):e instanceof ss?ss.create(e.items.map(t=>Yi(t))):e}class Rt extends et{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(),n=it.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==_e.object){const u=this._getOrReturnCtx(t);return ve(u,{code:ae.invalid_type,expected:_e.object,received:u.parsedType}),He}const{status:r,ctx:s}=this._processInputParams(t),{shape:o,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof Fs&&this._def.unknownKeys==="strip"))for(const u in s.data)i.includes(u)||a.push(u);const c=[];for(const u of i){const d=o[u],f=s.data[u];c.push({key:{status:"valid",value:u},value:d._parse(new rs(s,f,s.path,u)),alwaysSet:u in s.data})}if(this._def.catchall instanceof Fs){const u=this._def.unknownKeys;if(u==="passthrough")for(const d of a)c.push({key:{status:"valid",value:d},value:{status:"valid",value:s.data[d]}});else if(u==="strict")a.length>0&&(ve(s,{code:ae.unrecognized_keys,keys:a}),r.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];c.push({key:{status:"valid",value:d},value:u._parse(new rs(s,f,s.path,d)),alwaysSet:d in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const u=[];for(const d of c){const f=await d.key,h=await d.value;u.push({key:f,value:h,alwaysSet:d.alwaysSet})}return u}).then(u=>yn.mergeObjectSync(r,u)):yn.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(t){return De.errToObj,new Rt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var s,o,i,a;const c=(i=(o=(s=this._def).errorMap)===null||o===void 0?void 0:o.call(s,n,r).message)!==null&&i!==void 0?i:r.defaultError;return n.code==="unrecognized_keys"?{message:(a=De.errToObj(t).message)!==null&&a!==void 0?a:c}:{message:c}}}:{}})}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:Ve.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Rt({...this._def,catchall:t})}pick(t){const n={};return it.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new Rt({...this._def,shape:()=>n})}omit(t){const n={};return it.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new Rt({...this._def,shape:()=>n})}deepPartial(){return Yi(this)}partial(t){const n={};return it.objectKeys(this.shape).forEach(r=>{const s=this.shape[r];t&&!t[r]?n[r]=s:n[r]=s.optional()}),new Rt({...this._def,shape:()=>n})}required(t){const n={};return it.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof Jr;)o=o._def.innerType;n[r]=o}}),new Rt({...this._def,shape:()=>n})}keyof(){return zN(it.objectKeys(this.shape))}}Rt.create=(e,t)=>new Rt({shape:()=>e,unknownKeys:"strip",catchall:Fs.create(),typeName:Ve.ZodObject,...Ze(t)});Rt.strictCreate=(e,t)=>new Rt({shape:()=>e,unknownKeys:"strict",catchall:Fs.create(),typeName:Ve.ZodObject,...Ze(t)});Rt.lazycreate=(e,t)=>new Rt({shape:e,unknownKeys:"strip",catchall:Fs.create(),typeName:Ve.ZodObject,...Ze(t)});class Ic extends et{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function s(o){for(const a of o)if(a.result.status==="valid")return a.result;for(const a of o)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const i=o.map(a=>new Yn(a.ctx.common.issues));return ve(n,{code:ae.invalid_union,unionErrors:i}),He}if(n.common.async)return Promise.all(r.map(async o=>{const i={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:i}),ctx:i}})).then(s);{let o;const i=[];for(const c of r){const u={...n,common:{...n.common,issues:[]},parent:null},d=c._parseSync({data:n.data,path:n.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!o&&(o={result:d,ctx:u}),u.common.issues.length&&i.push(u.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const a=i.map(c=>new Yn(c));return ve(n,{code:ae.invalid_union,unionErrors:a}),He}}get options(){return this._def.options}}Ic.create=(e,t)=>new Ic({options:e,typeName:Ve.ZodUnion,...Ze(t)});const vs=e=>e instanceof zc?vs(e.schema):e instanceof Or?vs(e.innerType()):e instanceof Fc?[e.value]:e instanceof Po?e.options:e instanceof $c?it.objectValues(e.enum):e instanceof Uc?vs(e._def.innerType):e instanceof Dc?[void 0]:e instanceof Oc?[null]:e instanceof Jr?[void 0,...vs(e.unwrap())]:e instanceof Ro?[null,...vs(e.unwrap())]:e instanceof Mx||e instanceof Bc?vs(e.unwrap()):e instanceof Vc?vs(e._def.innerType):[];class Kh extends et{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==_e.object)return ve(n,{code:ae.invalid_type,expected:_e.object,received:n.parsedType}),He;const r=this.discriminator,s=n.data[r],o=this.optionsMap.get(s);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(ve(n,{code:ae.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),He)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const s=new Map;for(const o of n){const i=vs(o.shape[t]);if(!i.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of i){if(s.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);s.set(a,o)}}return new Kh({typeName:Ve.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:s,...Ze(r)})}}function Fg(e,t){const n=ao(e),r=ao(t);if(e===t)return{valid:!0,data:e};if(n===_e.object&&r===_e.object){const s=it.objectKeys(t),o=it.objectKeys(e).filter(a=>s.indexOf(a)!==-1),i={...e,...t};for(const a of o){const c=Fg(e[a],t[a]);if(!c.valid)return{valid:!1};i[a]=c.data}return{valid:!0,data:i}}else if(n===_e.array&&r===_e.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let o=0;o{if(Lg(o)||Lg(i))return He;const a=Fg(o.value,i.value);return a.valid?((zg(o)||zg(i))&&n.dirty(),{status:n.value,value:a.data}):(ve(r,{code:ae.invalid_intersection_types}),He)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,i])=>s(o,i)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Mc.create=(e,t,n)=>new Mc({left:e,right:t,typeName:Ve.ZodIntersection,...Ze(n)});class ss extends et{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==_e.array)return ve(r,{code:ae.invalid_type,expected:_e.array,received:r.parsedType}),He;if(r.data.lengththis._def.items.length&&(ve(r,{code:ae.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((i,a)=>{const c=this._def.items[a]||this._def.rest;return c?c._parse(new rs(r,i,r.path,a)):null}).filter(i=>!!i);return r.common.async?Promise.all(o).then(i=>yn.mergeArray(n,i)):yn.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new ss({...this._def,rest:t})}}ss.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ss({items:e,typeName:Ve.ZodTuple,rest:null,...Ze(t)})};class Lc extends et{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==_e.object)return ve(r,{code:ae.invalid_type,expected:_e.object,received:r.parsedType}),He;const s=[],o=this._def.keyType,i=this._def.valueType;for(const a in r.data)s.push({key:o._parse(new rs(r,a,r.path,a)),value:i._parse(new rs(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?yn.mergeObjectAsync(n,s):yn.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof et?new Lc({keyType:t,valueType:n,typeName:Ve.ZodRecord,...Ze(r)}):new Lc({keyType:Cr.create(),valueType:t,typeName:Ve.ZodRecord,...Ze(n)})}}class Cf extends et{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==_e.map)return ve(r,{code:ae.invalid_type,expected:_e.map,received:r.parsedType}),He;const s=this._def.keyType,o=this._def.valueType,i=[...r.data.entries()].map(([a,c],u)=>({key:s._parse(new rs(r,a,r.path,[u,"key"])),value:o._parse(new rs(r,c,r.path,[u,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const c of i){const u=await c.key,d=await c.value;if(u.status==="aborted"||d.status==="aborted")return He;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),a.set(u.value,d.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const c of i){const u=c.key,d=c.value;if(u.status==="aborted"||d.status==="aborted")return He;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),a.set(u.value,d.value)}return{status:n.value,value:a}}}}Cf.create=(e,t,n)=>new Cf({valueType:t,keyType:e,typeName:Ve.ZodMap,...Ze(n)});class pi extends et{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==_e.set)return ve(r,{code:ae.invalid_type,expected:_e.set,received:r.parsedType}),He;const s=this._def;s.minSize!==null&&r.data.sizes.maxSize.value&&(ve(r,{code:ae.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const o=this._def.valueType;function i(c){const u=new Set;for(const d of c){if(d.status==="aborted")return He;d.status==="dirty"&&n.dirty(),u.add(d.value)}return{status:n.value,value:u}}const a=[...r.data.values()].map((c,u)=>o._parse(new rs(r,c,r.path,u)));return r.common.async?Promise.all(a).then(c=>i(c)):i(a)}min(t,n){return new pi({...this._def,minSize:{value:t,message:De.toString(n)}})}max(t,n){return new pi({...this._def,maxSize:{value:t,message:De.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}pi.create=(e,t)=>new pi({valueType:e,minSize:null,maxSize:null,typeName:Ve.ZodSet,...Ze(t)});class Ca extends et{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==_e.function)return ve(n,{code:ae.invalid_type,expected:_e.function,received:n.parsedType}),He;function r(a,c){return bf({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,wf(),Ma].filter(u=>!!u),issueData:{code:ae.invalid_arguments,argumentsError:c}})}function s(a,c){return bf({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,wf(),Ma].filter(u=>!!u),issueData:{code:ae.invalid_return_type,returnTypeError:c}})}const o={errorMap:n.common.contextualErrorMap},i=n.data;if(this._def.returns instanceof za){const a=this;return kn(async function(...c){const u=new Yn([]),d=await a._def.args.parseAsync(c,o).catch(m=>{throw u.addIssue(r(c,m)),u}),f=await Reflect.apply(i,this,d);return await a._def.returns._def.type.parseAsync(f,o).catch(m=>{throw u.addIssue(s(f,m)),u})})}else{const a=this;return kn(function(...c){const u=a._def.args.safeParse(c,o);if(!u.success)throw new Yn([r(c,u.error)]);const d=Reflect.apply(i,this,u.data),f=a._def.returns.safeParse(d,o);if(!f.success)throw new Yn([s(d,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Ca({...this._def,args:ss.create(t).rest(ri.create())})}returns(t){return new Ca({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new Ca({args:t||ss.create([]).rest(ri.create()),returns:n||ri.create(),typeName:Ve.ZodFunction,...Ze(r)})}}class zc extends et{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}zc.create=(e,t)=>new zc({getter:e,typeName:Ve.ZodLazy,...Ze(t)});class Fc extends et{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return ve(n,{received:n.data,code:ae.invalid_literal,expected:this._def.value}),He}return{status:"valid",value:t.data}}get value(){return this._def.value}}Fc.create=(e,t)=>new Fc({value:e,typeName:Ve.ZodLiteral,...Ze(t)});function zN(e,t){return new Po({values:e,typeName:Ve.ZodEnum,...Ze(t)})}class Po extends et{constructor(){super(...arguments),Ml.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return ve(n,{expected:it.joinValues(r),received:n.parsedType,code:ae.invalid_type}),He}if(_f(this,Ml)||ON(this,Ml,new Set(this._def.values)),!_f(this,Ml).has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return ve(n,{received:n.data,code:ae.invalid_enum_value,options:r}),He}return kn(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return Po.create(t,{...this._def,...n})}exclude(t,n=this._def){return Po.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}Ml=new WeakMap;Po.create=zN;class $c extends et{constructor(){super(...arguments),Ll.set(this,void 0)}_parse(t){const n=it.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==_e.string&&r.parsedType!==_e.number){const s=it.objectValues(n);return ve(r,{expected:it.joinValues(s),received:r.parsedType,code:ae.invalid_type}),He}if(_f(this,Ll)||ON(this,Ll,new Set(it.getValidEnumValues(this._def.values))),!_f(this,Ll).has(t.data)){const s=it.objectValues(n);return ve(r,{received:r.data,code:ae.invalid_enum_value,options:s}),He}return kn(t.data)}get enum(){return this._def.values}}Ll=new WeakMap;$c.create=(e,t)=>new $c({values:e,typeName:Ve.ZodNativeEnum,...Ze(t)});class za extends et{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==_e.promise&&n.common.async===!1)return ve(n,{code:ae.invalid_type,expected:_e.promise,received:n.parsedType}),He;const r=n.parsedType===_e.promise?n.data:Promise.resolve(n.data);return kn(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}za.create=(e,t)=>new za({type:e,typeName:Ve.ZodPromise,...Ze(t)});class Or extends et{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ve.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=this._def.effect||null,o={addIssue:i=>{ve(r,i),i.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),s.type==="preprocess"){const i=s.transform(r.data,o);if(r.common.async)return Promise.resolve(i).then(async a=>{if(n.value==="aborted")return He;const c=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return c.status==="aborted"?He:c.status==="dirty"||n.value==="dirty"?ua(c.value):c});{if(n.value==="aborted")return He;const a=this._def.schema._parseSync({data:i,path:r.path,parent:r});return a.status==="aborted"?He:a.status==="dirty"||n.value==="dirty"?ua(a.value):a}}if(s.type==="refinement"){const i=a=>{const c=s.refinement(a,o);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?He:(a.status==="dirty"&&n.dirty(),i(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?He:(a.status==="dirty"&&n.dirty(),i(a.value).then(()=>({status:n.value,value:a.value}))))}if(s.type==="transform")if(r.common.async===!1){const i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Pc(i))return i;const a=s.transform(i.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>Pc(i)?Promise.resolve(s.transform(i.value,o)).then(a=>({status:n.value,value:a})):i);it.assertNever(s)}}Or.create=(e,t,n)=>new Or({schema:e,typeName:Ve.ZodEffects,effect:t,...Ze(n)});Or.createWithPreprocess=(e,t,n)=>new Or({schema:t,effect:{type:"preprocess",transform:e},typeName:Ve.ZodEffects,...Ze(n)});class Jr extends et{_parse(t){return this._getType(t)===_e.undefined?kn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Jr.create=(e,t)=>new Jr({innerType:e,typeName:Ve.ZodOptional,...Ze(t)});class Ro extends et{_parse(t){return this._getType(t)===_e.null?kn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Ro.create=(e,t)=>new Ro({innerType:e,typeName:Ve.ZodNullable,...Ze(t)});class Uc extends et{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===_e.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Uc.create=(e,t)=>new Uc({innerType:e,typeName:Ve.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Ze(t)});class Vc extends et{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Rc(s)?s.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Yn(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Yn(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Vc.create=(e,t)=>new Vc({innerType:e,typeName:Ve.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Ze(t)});class jf extends et{_parse(t){if(this._getType(t)!==_e.nan){const r=this._getOrReturnCtx(t);return ve(r,{code:ae.invalid_type,expected:_e.nan,received:r.parsedType}),He}return{status:"valid",value:t.data}}}jf.create=e=>new jf({typeName:Ve.ZodNaN,...Ze(e)});const O8=Symbol("zod_brand");class Mx extends et{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class gu extends et{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?He:o.status==="dirty"?(n.dirty(),ua(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?He:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(t,n){return new gu({in:t,out:n,typeName:Ve.ZodPipeline})}}class Bc extends et{_parse(t){const n=this._def.innerType._parse(t),r=s=>(Pc(s)&&(s.value=Object.freeze(s.value)),s);return Rc(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}Bc.create=(e,t)=>new Bc({innerType:e,typeName:Ve.ZodReadonly,...Ze(t)});function FN(e,t={},n){return e?La.create().superRefine((r,s)=>{var o,i;if(!e(r)){const a=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,c=(i=(o=a.fatal)!==null&&o!==void 0?o:n)!==null&&i!==void 0?i:!0,u=typeof a=="string"?{message:a}:a;s.addIssue({code:"custom",...u,fatal:c})}}):La.create()}const I8={object:Rt.lazycreate};var Ve;(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"})(Ve||(Ve={}));const M8=(e,t={message:`Input not instance of ${e.name}`})=>FN(n=>n instanceof e,t),$N=Cr.create,UN=No.create,L8=jf.create,z8=To.create,VN=Ac.create,F8=mi.create,$8=Sf.create,U8=Dc.create,V8=Oc.create,B8=La.create,W8=ri.create,H8=Fs.create,Y8=kf.create,K8=Nr.create,G8=Rt.create,Z8=Rt.strictCreate,q8=Ic.create,X8=Kh.create,Q8=Mc.create,J8=ss.create,eV=Lc.create,tV=Cf.create,nV=pi.create,rV=Ca.create,sV=zc.create,oV=Fc.create,iV=Po.create,aV=$c.create,lV=za.create,Bb=Or.create,cV=Jr.create,uV=Ro.create,dV=Or.createWithPreprocess,fV=gu.create,hV=()=>$N().optional(),mV=()=>UN().optional(),pV=()=>VN().optional(),gV={string:e=>Cr.create({...e,coerce:!0}),number:e=>No.create({...e,coerce:!0}),boolean:e=>Ac.create({...e,coerce:!0}),bigint:e=>To.create({...e,coerce:!0}),date:e=>mi.create({...e,coerce:!0})},yV=He;var ce=Object.freeze({__proto__:null,defaultErrorMap:Ma,setErrorMap:y8,getErrorMap:wf,makeIssue:bf,EMPTY_PATH:v8,addIssueToContext:ve,ParseStatus:yn,INVALID:He,DIRTY:ua,OK:kn,isAborted:Lg,isDirty:zg,isValid:Pc,isAsync:Rc,get util(){return it},get objectUtil(){return Mg},ZodParsedType:_e,getParsedType:ao,ZodType:et,datetimeRegex:LN,ZodString:Cr,ZodNumber:No,ZodBigInt:To,ZodBoolean:Ac,ZodDate:mi,ZodSymbol:Sf,ZodUndefined:Dc,ZodNull:Oc,ZodAny:La,ZodUnknown:ri,ZodNever:Fs,ZodVoid:kf,ZodArray:Nr,ZodObject:Rt,ZodUnion:Ic,ZodDiscriminatedUnion:Kh,ZodIntersection:Mc,ZodTuple:ss,ZodRecord:Lc,ZodMap:Cf,ZodSet:pi,ZodFunction:Ca,ZodLazy:zc,ZodLiteral:Fc,ZodEnum:Po,ZodNativeEnum:$c,ZodPromise:za,ZodEffects:Or,ZodTransformer:Or,ZodOptional:Jr,ZodNullable:Ro,ZodDefault:Uc,ZodCatch:Vc,ZodNaN:jf,BRAND:O8,ZodBranded:Mx,ZodPipeline:gu,ZodReadonly:Bc,custom:FN,Schema:et,ZodSchema:et,late:I8,get ZodFirstPartyTypeKind(){return Ve},coerce:gV,any:B8,array:K8,bigint:z8,boolean:VN,date:F8,discriminatedUnion:X8,effect:Bb,enum:iV,function:rV,instanceof:M8,intersection:Q8,lazy:sV,literal:oV,map:tV,nan:L8,nativeEnum:aV,never:H8,null:V8,nullable:uV,number:UN,object:G8,oboolean:pV,onumber:mV,optional:cV,ostring:hV,pipeline:fV,preprocess:dV,promise:lV,record:eV,set:nV,strictObject:Z8,string:$N,symbol:$8,transformer:Bb,tuple:J8,undefined:U8,union:q8,unknown:W8,void:Y8,NEVER:yV,ZodIssueCode:ae,quotelessJson:g8,ZodError:Yn});const Wb=(e,t,n)=>{if(e&&"reportValidity"in e){const r=de(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},BN=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?Wb(r.ref,n,e):r.refs&&r.refs.forEach(s=>Wb(s,n,e))}},vV=(e,t)=>{t.shouldUseNativeValidation&&BN(e,t);const n={};for(const r in e){const s=de(t.fields,r),o=Object.assign(e[r]||{},{ref:s&&s.ref});if(xV(t.names||Object.keys(e),r)){const i=Object.assign({},de(n,r));mt(i,"root",o),mt(n,r,i)}else mt(n,r,o)}return n},xV=(e,t)=>e.some(n=>n.startsWith(t+"."));var wV=function(e,t){for(var n={};e.length;){var r=e[0],s=r.code,o=r.message,i=r.path.join(".");if(!n[i])if("unionErrors"in r){var a=r.unionErrors[0].errors[0];n[i]={message:a.message,type:a.code}}else n[i]={message:o,type:s};if("unionErrors"in r&&r.unionErrors.forEach(function(d){return d.errors.forEach(function(f){return e.push(f)})}),t){var c=n[i].types,u=c&&c[r.code];n[i]=jN(i,t,n,s,u?[].concat(u,r.message):r.message)}e.shift()}return n},un=function(e,t,n){return n===void 0&&(n={}),function(r,s,o){try{return Promise.resolve(function(i,a){try{var c=Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(u){return o.shouldUseNativeValidation&&BN({},o),{errors:{},values:n.raw?r:u}})}catch(u){return a(u)}return c&&c.then?c.then(void 0,a):c}(0,function(i){if(function(a){return Array.isArray(a==null?void 0:a.errors)}(i))return{values:{},errors:vV(wV(i.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw i}))}catch(i){return Promise.reject(i)}}};const WN=y.forwardRef(({...e},t)=>l.jsx("nav",{ref:t,"aria-label":"breadcrumb",...e}));WN.displayName="Breadcrumb";const HN=y.forwardRef(({className:e,...t},n)=>l.jsx("ol",{ref:n,className:re("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",e),...t}));HN.displayName="BreadcrumbList";const $g=y.forwardRef(({className:e,...t},n)=>l.jsx("li",{ref:n,className:re("inline-flex items-center gap-1.5",e),...t}));$g.displayName="BreadcrumbItem";const YN=y.forwardRef(({asChild:e,className:t,...n},r)=>{const s=e?es:"a";return l.jsx(s,{ref:r,className:re("transition-colors hover:text-foreground",t),...n})});YN.displayName="BreadcrumbLink";const KN=y.forwardRef(({className:e,...t},n)=>l.jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:re("font-normal text-foreground",e),...t}));KN.displayName="BreadcrumbPage";const GN=({children:e,className:t,...n})=>l.jsx("li",{role:"presentation","aria-hidden":"true",className:re("[&>svg]:size-3.5",t),...n,children:e??l.jsx(rk,{})});GN.displayName="BreadcrumbSeparator";var bV="Label",ZN=y.forwardRef((e,t)=>l.jsx(Pe.label,{...e,ref:t,onMouseDown:n=>{var s;n.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));ZN.displayName=bV;var qN=ZN;const _V=Jc("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Vt=y.forwardRef(({className:e,...t},n)=>l.jsx(qN,{ref:n,className:re(_V(),e),...t}));Vt.displayName=qN.displayName;const dn=t8,XN=y.createContext({}),ke=({...e})=>l.jsx(XN.Provider,{value:{name:e.name},children:l.jsx(o8,{...e})}),Gh=()=>{const e=y.useContext(XN),t=y.useContext(QN),{getFieldState:n,formState:r}=Yh(),s=n(e.name,r);if(!e)throw new Error("useFormField should be used within ");const{id:o}=t;return{id:o,name:e.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...s}},QN=y.createContext({}),Se=y.forwardRef(({className:e,...t},n)=>{const r=y.useId();return l.jsx(QN.Provider,{value:{id:r},children:l.jsx("div",{ref:n,className:re("space-y-2",e),...t})})});Se.displayName="FormItem";const Ce=y.forwardRef(({className:e,...t},n)=>{const{error:r,formItemId:s}=Gh();return l.jsx(Vt,{ref:n,className:re(r&&"text-destructive",e),htmlFor:s,...t})});Ce.displayName="FormLabel";const je=y.forwardRef(({...e},t)=>{const{error:n,formItemId:r,formDescriptionId:s,formMessageId:o}=Gh();return l.jsx(es,{ref:t,id:r,"aria-describedby":n?`${s} ${o}`:`${s}`,"aria-invalid":!!n,...e})});je.displayName="FormControl";const SV=y.forwardRef(({className:e,...t},n)=>{const{formDescriptionId:r}=Gh();return l.jsx("p",{ref:n,id:r,className:re("text-sm text-muted-foreground",e),...t})});SV.displayName="FormDescription";const ye=y.forwardRef(({className:e,children:t,...n},r)=>{const{error:s,formMessageId:o}=Gh(),{t:i}=Ye(),a=s?i(String(s==null?void 0:s.message)):t;return a?l.jsx("p",{ref:r,id:o,className:re("text-sm font-medium text-destructive",e),...n,children:a}):null});ye.displayName="FormMessage";const pe=y.forwardRef(({className:e,type:t,...n},r)=>l.jsx("input",{type:t,className:re("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:r,...n}));pe.displayName="Input";function Ug(e,[t,n]){return Math.min(n,Math.max(t,e))}var kV=[" ","Enter","ArrowUp","ArrowDown"],CV=[" ","Enter"],yu="Select",[Zh,qh,jV]=eu(yu),[al,XH]=on(yu,[jV,tl]),Xh=tl(),[EV,Lo]=al(yu),[NV,TV]=al(yu),JN=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:o,value:i,defaultValue:a,onValueChange:c,dir:u,name:d,autoComplete:f,disabled:h,required:m}=e,x=Xh(t),[p,w]=y.useState(null),[g,v]=y.useState(null),[b,_]=y.useState(!1),C=Si(u),[j=!1,T]=Gn({prop:r,defaultProp:s,onChange:o}),[R,A]=Gn({prop:i,defaultProp:a,onChange:c}),O=y.useRef(null),G=p?!!p.closest("form"):!0,[N,z]=y.useState(new Set),S=Array.from(N).map(U=>U.props.value).join(";");return l.jsx(wv,{...x,children:l.jsxs(EV,{required:m,scope:t,trigger:p,onTriggerChange:w,valueNode:g,onValueNodeChange:v,valueNodeHasChildren:b,onValueNodeHasChildrenChange:_,contentId:Bn(),value:R,onValueChange:A,open:j,onOpenChange:T,dir:C,triggerPointerDownPosRef:O,disabled:h,children:[l.jsx(Zh.Provider,{scope:t,children:l.jsx(NV,{scope:e.__scopeSelect,onNativeOptionAdd:y.useCallback(U=>{z(J=>new Set(J).add(U))},[]),onNativeOptionRemove:y.useCallback(U=>{z(J=>{const F=new Set(J);return F.delete(U),F})},[]),children:n})}),G?l.jsxs(C2,{"aria-hidden":!0,required:m,tabIndex:-1,name:d,autoComplete:f,value:R,onChange:U=>A(U.target.value),disabled:h,children:[R===void 0?l.jsx("option",{value:""}):null,Array.from(N)]},S):null]})})};JN.displayName=yu;var e2="SelectTrigger",t2=y.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,o=Xh(n),i=Lo(e2,n),a=i.disabled||r,c=Ge(t,i.onTriggerChange),u=qh(n),[d,f,h]=j2(x=>{const p=u().filter(v=>!v.disabled),w=p.find(v=>v.value===i.value),g=E2(p,x,w);g!==void 0&&i.onValueChange(g.value)}),m=()=>{a||(i.onOpenChange(!0),h())};return l.jsx(bv,{asChild:!0,...o,children:l.jsx(Pe.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":k2(i.value)?"":void 0,...s,ref:c,onClick:ue(s.onClick,x=>{x.currentTarget.focus()}),onPointerDown:ue(s.onPointerDown,x=>{const p=x.target;p.hasPointerCapture(x.pointerId)&&p.releasePointerCapture(x.pointerId),x.button===0&&x.ctrlKey===!1&&(m(),i.triggerPointerDownPosRef.current={x:Math.round(x.pageX),y:Math.round(x.pageY)},x.preventDefault())}),onKeyDown:ue(s.onKeyDown,x=>{const p=d.current!=="";!(x.ctrlKey||x.altKey||x.metaKey)&&x.key.length===1&&f(x.key),!(p&&x.key===" ")&&kV.includes(x.key)&&(m(),x.preventDefault())})})})});t2.displayName=e2;var n2="SelectValue",r2=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:o,placeholder:i="",...a}=e,c=Lo(n2,n),{onValueNodeHasChildrenChange:u}=c,d=o!==void 0,f=Ge(t,c.onValueNodeChange);return en(()=>{u(d)},[u,d]),l.jsx(Pe.span,{...a,ref:f,style:{pointerEvents:"none"},children:k2(c.value)?l.jsx(l.Fragment,{children:i}):o})});r2.displayName=n2;var PV="SelectIcon",s2=y.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return l.jsx(Pe.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});s2.displayName=PV;var RV="SelectPortal",o2=e=>l.jsx(nu,{asChild:!0,...e});o2.displayName=RV;var gi="SelectContent",i2=y.forwardRef((e,t)=>{const n=Lo(gi,e.__scopeSelect),[r,s]=y.useState();if(en(()=>{s(new DocumentFragment)},[]),!n.open){const o=r;return o?Vs.createPortal(l.jsx(a2,{scope:e.__scopeSelect,children:l.jsx(Zh.Slot,{scope:e.__scopeSelect,children:l.jsx("div",{children:e.children})})}),o):null}return l.jsx(l2,{...e,ref:t})});i2.displayName=gi;var bs=10,[a2,zo]=al(gi),AV="SelectContentImpl",l2=y.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:o,onPointerDownOutside:i,side:a,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:h,collisionPadding:m,sticky:x,hideWhenDetached:p,avoidCollisions:w,...g}=e,v=Lo(gi,n),[b,_]=y.useState(null),[C,j]=y.useState(null),T=Ge(t,me=>_(me)),[R,A]=y.useState(null),[O,G]=y.useState(null),N=qh(n),[z,S]=y.useState(!1),U=y.useRef(!1);y.useEffect(()=>{if(b)return jv(b)},[b]),uv();const J=y.useCallback(me=>{const[we,...Te]=N().map(Re=>Re.ref.current),[Fe]=Te.slice(-1),Ie=document.activeElement;for(const Re of me)if(Re===Ie||(Re==null||Re.scrollIntoView({block:"nearest"}),Re===we&&C&&(C.scrollTop=0),Re===Fe&&C&&(C.scrollTop=C.scrollHeight),Re==null||Re.focus(),document.activeElement!==Ie))return},[N,C]),F=y.useCallback(()=>J([R,b]),[J,R,b]);y.useEffect(()=>{z&&F()},[z,F]);const{onOpenChange:W,triggerPointerDownPosRef:I}=v;y.useEffect(()=>{if(b){let me={x:0,y:0};const we=Fe=>{var Ie,Re;me={x:Math.abs(Math.round(Fe.pageX)-(((Ie=I.current)==null?void 0:Ie.x)??0)),y:Math.abs(Math.round(Fe.pageY)-(((Re=I.current)==null?void 0:Re.y)??0))}},Te=Fe=>{me.x<=10&&me.y<=10?Fe.preventDefault():b.contains(Fe.target)||W(!1),document.removeEventListener("pointermove",we),I.current=null};return I.current!==null&&(document.addEventListener("pointermove",we),document.addEventListener("pointerup",Te,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",we),document.removeEventListener("pointerup",Te,{capture:!0})}}},[b,W,I]),y.useEffect(()=>{const me=()=>W(!1);return window.addEventListener("blur",me),window.addEventListener("resize",me),()=>{window.removeEventListener("blur",me),window.removeEventListener("resize",me)}},[W]);const[X,$]=j2(me=>{const we=N().filter(Ie=>!Ie.disabled),Te=we.find(Ie=>Ie.ref.current===document.activeElement),Fe=E2(we,me,Te);Fe&&setTimeout(()=>Fe.ref.current.focus())}),B=y.useCallback((me,we,Te)=>{const Fe=!U.current&&!Te;(v.value!==void 0&&v.value===we||Fe)&&(A(me),Fe&&(U.current=!0))},[v.value]),he=y.useCallback(()=>b==null?void 0:b.focus(),[b]),se=y.useCallback((me,we,Te)=>{const Fe=!U.current&&!Te;(v.value!==void 0&&v.value===we||Fe)&&G(me)},[v.value]),oe=r==="popper"?Vg:c2,Oe=oe===Vg?{side:a,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:h,collisionPadding:m,sticky:x,hideWhenDetached:p,avoidCollisions:w}:{};return l.jsx(a2,{scope:n,content:b,viewport:C,onViewportChange:j,itemRefCallback:B,selectedItem:R,onItemLeave:he,itemTextRefCallback:se,focusSelectedItem:F,selectedItemText:O,position:r,isPositioned:z,searchRef:X,children:l.jsx(ph,{as:es,allowPinchZoom:!0,children:l.jsx(uh,{asChild:!0,trapped:v.open,onMountAutoFocus:me=>{me.preventDefault()},onUnmountAutoFocus:ue(s,me=>{var we;(we=v.trigger)==null||we.focus({preventScroll:!0}),me.preventDefault()}),children:l.jsx(Qa,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:me=>me.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:l.jsx(oe,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:me=>me.preventDefault(),...g,...Oe,onPlaced:()=>S(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:ue(g.onKeyDown,me=>{const we=me.ctrlKey||me.altKey||me.metaKey;if(me.key==="Tab"&&me.preventDefault(),!we&&me.key.length===1&&$(me.key),["ArrowUp","ArrowDown","Home","End"].includes(me.key)){let Fe=N().filter(Ie=>!Ie.disabled).map(Ie=>Ie.ref.current);if(["ArrowUp","End"].includes(me.key)&&(Fe=Fe.slice().reverse()),["ArrowUp","ArrowDown"].includes(me.key)){const Ie=me.target,Re=Fe.indexOf(Ie);Fe=Fe.slice(Re+1)}setTimeout(()=>J(Fe)),me.preventDefault()}})})})})})})});l2.displayName=AV;var DV="SelectItemAlignedPosition",c2=y.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,o=Lo(gi,n),i=zo(gi,n),[a,c]=y.useState(null),[u,d]=y.useState(null),f=Ge(t,T=>d(T)),h=qh(n),m=y.useRef(!1),x=y.useRef(!0),{viewport:p,selectedItem:w,selectedItemText:g,focusSelectedItem:v}=i,b=y.useCallback(()=>{if(o.trigger&&o.valueNode&&a&&u&&p&&w&&g){const T=o.trigger.getBoundingClientRect(),R=u.getBoundingClientRect(),A=o.valueNode.getBoundingClientRect(),O=g.getBoundingClientRect();if(o.dir!=="rtl"){const Ie=O.left-R.left,Re=A.left-Ie,st=T.left-Re,E=T.width+st,ee=Math.max(E,R.width),Z=window.innerWidth-bs,D=Ug(Re,[bs,Z-ee]);a.style.minWidth=E+"px",a.style.left=D+"px"}else{const Ie=R.right-O.right,Re=window.innerWidth-A.right-Ie,st=window.innerWidth-T.right-Re,E=T.width+st,ee=Math.max(E,R.width),Z=window.innerWidth-bs,D=Ug(Re,[bs,Z-ee]);a.style.minWidth=E+"px",a.style.right=D+"px"}const G=h(),N=window.innerHeight-bs*2,z=p.scrollHeight,S=window.getComputedStyle(u),U=parseInt(S.borderTopWidth,10),J=parseInt(S.paddingTop,10),F=parseInt(S.borderBottomWidth,10),W=parseInt(S.paddingBottom,10),I=U+J+z+W+F,X=Math.min(w.offsetHeight*5,I),$=window.getComputedStyle(p),B=parseInt($.paddingTop,10),he=parseInt($.paddingBottom,10),se=T.top+T.height/2-bs,oe=N-se,Oe=w.offsetHeight/2,me=w.offsetTop+Oe,we=U+J+me,Te=I-we;if(we<=se){const Ie=w===G[G.length-1].ref.current;a.style.bottom="0px";const Re=u.clientHeight-p.offsetTop-p.offsetHeight,st=Math.max(oe,Oe+(Ie?he:0)+Re+F),E=we+st;a.style.height=E+"px"}else{const Ie=w===G[0].ref.current;a.style.top="0px";const st=Math.max(se,U+p.offsetTop+(Ie?B:0)+Oe)+Te;a.style.height=st+"px",p.scrollTop=we-se+p.offsetTop}a.style.margin=`${bs}px 0`,a.style.minHeight=X+"px",a.style.maxHeight=N+"px",r==null||r(),requestAnimationFrame(()=>m.current=!0)}},[h,o.trigger,o.valueNode,a,u,p,w,g,o.dir,r]);en(()=>b(),[b]);const[_,C]=y.useState();en(()=>{u&&C(window.getComputedStyle(u).zIndex)},[u]);const j=y.useCallback(T=>{T&&x.current===!0&&(b(),v==null||v(),x.current=!1)},[b,v]);return l.jsx(IV,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:m,onScrollButtonChange:j,children:l.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:_},children:l.jsx(Pe.div,{...s,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});c2.displayName=DV;var OV="SelectPopperPosition",Vg=y.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=bs,...o}=e,i=Xh(n);return l.jsx(_v,{...i,...o,ref:t,align:r,collisionPadding:s,style:{boxSizing:"border-box",...o.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)"}})});Vg.displayName=OV;var[IV,Lx]=al(gi,{}),Bg="SelectViewport",u2=y.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,o=zo(Bg,n),i=Lx(Bg,n),a=Ge(t,o.onViewportChange),c=y.useRef(0);return l.jsxs(l.Fragment,{children:[l.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:r}),l.jsx(Zh.Slot,{scope:n,children:l.jsx(Pe.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:h}=i;if(h!=null&&h.current&&f){const m=Math.abs(c.current-d.scrollTop);if(m>0){const x=window.innerHeight-bs*2,p=parseFloat(f.style.minHeight),w=parseFloat(f.style.height),g=Math.max(p,w);if(g0?_:0,f.style.justifyContent="flex-end")}}}c.current=d.scrollTop})})})]})});u2.displayName=Bg;var d2="SelectGroup",[MV,LV]=al(d2),f2=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Bn();return l.jsx(MV,{scope:n,id:s,children:l.jsx(Pe.div,{role:"group","aria-labelledby":s,...r,ref:t})})});f2.displayName=d2;var h2="SelectLabel",m2=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=LV(h2,n);return l.jsx(Pe.div,{id:s.id,...r,ref:t})});m2.displayName=h2;var Ef="SelectItem",[zV,p2]=al(Ef),g2=y.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:o,...i}=e,a=Lo(Ef,n),c=zo(Ef,n),u=a.value===r,[d,f]=y.useState(o??""),[h,m]=y.useState(!1),x=Ge(t,g=>{var v;return(v=c.itemRefCallback)==null?void 0:v.call(c,g,r,s)}),p=Bn(),w=()=>{s||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")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 l.jsx(zV,{scope:n,value:r,disabled:s,textId:p,isSelected:u,onItemTextChange:y.useCallback(g=>{f(v=>v||((g==null?void 0:g.textContent)??"").trim())},[]),children:l.jsx(Zh.ItemSlot,{scope:n,value:r,disabled:s,textValue:d,children:l.jsx(Pe.div,{role:"option","aria-labelledby":p,"data-highlighted":h?"":void 0,"aria-selected":u&&h,"data-state":u?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...i,ref:x,onFocus:ue(i.onFocus,()=>m(!0)),onBlur:ue(i.onBlur,()=>m(!1)),onPointerUp:ue(i.onPointerUp,w),onPointerMove:ue(i.onPointerMove,g=>{var v;s?(v=c.onItemLeave)==null||v.call(c):g.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ue(i.onPointerLeave,g=>{var v;g.currentTarget===document.activeElement&&((v=c.onItemLeave)==null||v.call(c))}),onKeyDown:ue(i.onKeyDown,g=>{var b;((b=c.searchRef)==null?void 0:b.current)!==""&&g.key===" "||(CV.includes(g.key)&&w(),g.key===" "&&g.preventDefault())})})})})});g2.displayName=Ef;var zl="SelectItemText",y2=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...o}=e,i=Lo(zl,n),a=zo(zl,n),c=p2(zl,n),u=TV(zl,n),[d,f]=y.useState(null),h=Ge(t,g=>f(g),c.onItemTextChange,g=>{var v;return(v=a.itemTextRefCallback)==null?void 0:v.call(a,g,c.value,c.disabled)}),m=d==null?void 0:d.textContent,x=y.useMemo(()=>l.jsx("option",{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:p,onNativeOptionRemove:w}=u;return en(()=>(p(x),()=>w(x)),[p,w,x]),l.jsxs(l.Fragment,{children:[l.jsx(Pe.span,{id:c.textId,...o,ref:h}),c.isSelected&&i.valueNode&&!i.valueNodeHasChildren?Vs.createPortal(o.children,i.valueNode):null]})});y2.displayName=zl;var v2="SelectItemIndicator",x2=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return p2(v2,n).isSelected?l.jsx(Pe.span,{"aria-hidden":!0,...r,ref:t}):null});x2.displayName=v2;var Wg="SelectScrollUpButton",w2=y.forwardRef((e,t)=>{const n=zo(Wg,e.__scopeSelect),r=Lx(Wg,e.__scopeSelect),[s,o]=y.useState(!1),i=Ge(t,r.onScrollButtonChange);return en(()=>{if(n.viewport&&n.isPositioned){let a=function(){const u=c.scrollTop>0;o(u)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),s?l.jsx(_2,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop-c.offsetHeight)}}):null});w2.displayName=Wg;var Hg="SelectScrollDownButton",b2=y.forwardRef((e,t)=>{const n=zo(Hg,e.__scopeSelect),r=Lx(Hg,e.__scopeSelect),[s,o]=y.useState(!1),i=Ge(t,r.onScrollButtonChange);return en(()=>{if(n.viewport&&n.isPositioned){let a=function(){const u=c.scrollHeight-c.clientHeight,d=Math.ceil(c.scrollTop)c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),s?l.jsx(_2,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});b2.displayName=Hg;var _2=y.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,o=zo("SelectScrollButton",n),i=y.useRef(null),a=qh(n),c=y.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return y.useEffect(()=>()=>c(),[c]),en(()=>{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]),l.jsx(Pe.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:ue(s.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(r,50))}),onPointerMove:ue(s.onPointerMove,()=>{var u;(u=o.onItemLeave)==null||u.call(o),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:ue(s.onPointerLeave,()=>{c()})})}),FV="SelectSeparator",S2=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return l.jsx(Pe.div,{"aria-hidden":!0,...r,ref:t})});S2.displayName=FV;var Yg="SelectArrow",$V=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Xh(n),o=Lo(Yg,n),i=zo(Yg,n);return o.open&&i.position==="popper"?l.jsx(Sv,{...s,...r,ref:t}):null});$V.displayName=Yg;function k2(e){return e===""||e===void 0}var C2=y.forwardRef((e,t)=>{const{value:n,...r}=e,s=y.useRef(null),o=Ge(t,s),i=Cx(n);return y.useEffect(()=>{const a=s.current,c=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(i!==n&&d){const f=new Event("change",{bubbles:!0});d.call(a,n),a.dispatchEvent(f)}},[i,n]),l.jsx(hu,{asChild:!0,children:l.jsx("select",{...r,ref:o,defaultValue:n})})});C2.displayName="BubbleSelect";function j2(e){const t=Ot(e),n=y.useRef(""),r=y.useRef(0),s=y.useCallback(i=>{const a=n.current+i;t(a),function c(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>c(""),1e3))}(a)},[t]),o=y.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return y.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,o]}function E2(e,t,n){const s=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let i=UV(e,Math.max(o,0));s.length===1&&(i=i.filter(u=>u!==n));const c=i.find(u=>u.textValue.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}function UV(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var VV=JN,N2=t2,BV=r2,WV=s2,HV=o2,T2=i2,YV=u2,KV=f2,P2=m2,R2=g2,GV=y2,ZV=x2,A2=w2,D2=b2,O2=S2;const Fa=VV,Wc=KV,$a=BV,yi=y.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(N2,{ref:r,className:re("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),...n,children:[t,l.jsx(WV,{asChild:!0,children:l.jsx(rv,{className:"h-4 w-4 opacity-50"})})]}));yi.displayName=N2.displayName;const I2=y.forwardRef(({className:e,...t},n)=>l.jsx(A2,{ref:n,className:re("flex cursor-default items-center justify-center py-1",e),...t,children:l.jsx(JO,{className:"h-4 w-4"})}));I2.displayName=A2.displayName;const M2=y.forwardRef(({className:e,...t},n)=>l.jsx(D2,{ref:n,className:re("flex cursor-default items-center justify-center py-1",e),...t,children:l.jsx(rv,{className:"h-4 w-4"})}));M2.displayName=D2.displayName;const vi=y.forwardRef(({className:e,children:t,position:n="popper",...r},s)=>l.jsx(HV,{children:l.jsxs(T2,{ref:s,className:re("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",n==="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:n,...r,children:[l.jsx(I2,{}),l.jsx(YV,{className:re("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),l.jsx(M2,{})]})}));vi.displayName=T2.displayName;const Ua=y.forwardRef(({className:e,...t},n)=>l.jsx(P2,{ref:n,className:re("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Ua.displayName=P2.displayName;const Ao=y.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(R2,{ref:r,className:re("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),...n,children:[l.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:l.jsx(ZV,{children:l.jsx(nk,{className:"h-4 w-4"})})}),l.jsx(GV,{children:t})]}));Ao.displayName=R2.displayName;const qV=y.forwardRef(({className:e,...t},n)=>l.jsx(O2,{ref:n,className:re("-mx-1 my-1 h-px bg-muted",e),...t}));qV.displayName=O2.displayName;const ll=Uv,cl=Vv,XV=Bv,L2=y.forwardRef(({className:e,...t},n)=>l.jsx(ou,{ref:n,className:re("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}));L2.displayName=ou.displayName;const Ni=y.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(XV,{children:[l.jsx(L2,{}),l.jsxs(iu,{ref:r,className:re("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),...n,children:[t,l.jsxs(xh,{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:[l.jsx(iv,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Ni.displayName=iu.displayName;const Ti=({className:e,...t})=>l.jsx("div",{className:re("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Ti.displayName="DialogHeader";const Qh=({className:e,...t})=>l.jsx("div",{className:re("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Qh.displayName="DialogFooter";const Pi=y.forwardRef(({className:e,...t},n)=>l.jsx(au,{ref:n,className:re("text-lg font-semibold leading-none tracking-tight",e),...t}));Pi.displayName=au.displayName;const z2=y.forwardRef(({className:e,...t},n)=>l.jsx(lu,{ref:n,className:re("text-sm text-muted-foreground",e),...t}));z2.displayName=lu.displayName;function QV(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var zx="ScrollArea",[F2,QH]=on(zx),[JV,pr]=F2(zx),$2=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:s,scrollHideDelay:o=600,...i}=e,[a,c]=y.useState(null),[u,d]=y.useState(null),[f,h]=y.useState(null),[m,x]=y.useState(null),[p,w]=y.useState(null),[g,v]=y.useState(0),[b,_]=y.useState(0),[C,j]=y.useState(!1),[T,R]=y.useState(!1),A=Ge(t,G=>c(G)),O=Si(s);return l.jsx(JV,{scope:n,type:r,dir:O,scrollHideDelay:o,scrollArea:a,viewport:u,onViewportChange:d,content:f,onContentChange:h,scrollbarX:m,onScrollbarXChange:x,scrollbarXEnabled:C,onScrollbarXEnabledChange:j,scrollbarY:p,onScrollbarYChange:w,scrollbarYEnabled:T,onScrollbarYEnabledChange:R,onCornerWidthChange:v,onCornerHeightChange:_,children:l.jsx(Pe.div,{dir:O,...i,ref:A,style:{position:"relative","--radix-scroll-area-corner-width":g+"px","--radix-scroll-area-corner-height":b+"px",...e.style}})})});$2.displayName=zx;var U2="ScrollAreaViewport",V2=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:s,...o}=e,i=pr(U2,n),a=y.useRef(null),c=Ge(t,a,i.onViewportChange);return l.jsxs(l.Fragment,{children:[l.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}),l.jsx(Pe.div,{"data-radix-scroll-area-viewport":"",...o,ref:c,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style},children:l.jsx("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});V2.displayName=U2;var ls="ScrollAreaScrollbar",Fx=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=pr(ls,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:i}=s,a=e.orientation==="horizontal";return y.useEffect(()=>(a?o(!0):i(!0),()=>{a?o(!1):i(!1)}),[a,o,i]),s.type==="hover"?l.jsx(eB,{...r,ref:t,forceMount:n}):s.type==="scroll"?l.jsx(tB,{...r,ref:t,forceMount:n}):s.type==="auto"?l.jsx(B2,{...r,ref:t,forceMount:n}):s.type==="always"?l.jsx($x,{...r,ref:t}):null});Fx.displayName=ls;var eB=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=pr(ls,e.__scopeScrollArea),[o,i]=y.useState(!1);return y.useEffect(()=>{const a=s.scrollArea;let c=0;if(a){const u=()=>{window.clearTimeout(c),i(!0)},d=()=>{c=window.setTimeout(()=>i(!1),s.scrollHideDelay)};return a.addEventListener("pointerenter",u),a.addEventListener("pointerleave",d),()=>{window.clearTimeout(c),a.removeEventListener("pointerenter",u),a.removeEventListener("pointerleave",d)}}},[s.scrollArea,s.scrollHideDelay]),l.jsx(an,{present:n||o,children:l.jsx(B2,{"data-state":o?"visible":"hidden",...r,ref:t})})}),tB=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=pr(ls,e.__scopeScrollArea),o=e.orientation==="horizontal",i=em(()=>c("SCROLL_END"),100),[a,c]=QV("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 y.useEffect(()=>{if(a==="idle"){const u=window.setTimeout(()=>c("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(u)}},[a,s.scrollHideDelay,c]),y.useEffect(()=>{const u=s.viewport,d=o?"scrollLeft":"scrollTop";if(u){let f=u[d];const h=()=>{const m=u[d];f!==m&&(c("SCROLL"),i()),f=m};return u.addEventListener("scroll",h),()=>u.removeEventListener("scroll",h)}},[s.viewport,o,c,i]),l.jsx(an,{present:n||a!=="hidden",children:l.jsx($x,{"data-state":a==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:ue(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:ue(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),B2=y.forwardRef((e,t)=>{const n=pr(ls,e.__scopeScrollArea),{forceMount:r,...s}=e,[o,i]=y.useState(!1),a=e.orientation==="horizontal",c=em(()=>{if(n.viewport){const u=n.viewport.offsetWidth{const{orientation:n="vertical",...r}=e,s=pr(ls,e.__scopeScrollArea),o=y.useRef(null),i=y.useRef(0),[a,c]=y.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=G2(a.viewport,a.content),d={...r,sizes:a,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:h=>o.current=h,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:h=>i.current=h};function f(h,m){return aB(h,i.current,a,m)}return n==="horizontal"?l.jsx(nB,{...d,ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const h=s.viewport.scrollLeft,m=Hb(h,a,s.dir);o.current.style.transform=`translate3d(${m}px, 0, 0)`}},onWheelScroll:h=>{s.viewport&&(s.viewport.scrollLeft=h)},onDragScroll:h=>{s.viewport&&(s.viewport.scrollLeft=f(h,s.dir))}}):n==="vertical"?l.jsx(rB,{...d,ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const h=s.viewport.scrollTop,m=Hb(h,a);o.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:h=>{s.viewport&&(s.viewport.scrollTop=h)},onDragScroll:h=>{s.viewport&&(s.viewport.scrollTop=f(h))}}):null}),nB=y.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...s}=e,o=pr(ls,e.__scopeScrollArea),[i,a]=y.useState(),c=y.useRef(null),u=Ge(t,c,o.onScrollbarXChange);return y.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),l.jsx(H2,{"data-orientation":"horizontal",...s,ref:u,sizes:n,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Jh(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,f)=>{if(o.viewport){const h=o.viewport.scrollLeft+d.deltaX;e.onWheelScroll(h),q2(h,f)&&d.preventDefault()}},onResize:()=>{c.current&&o.viewport&&i&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:Tf(i.paddingLeft),paddingEnd:Tf(i.paddingRight)}})}})}),rB=y.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...s}=e,o=pr(ls,e.__scopeScrollArea),[i,a]=y.useState(),c=y.useRef(null),u=Ge(t,c,o.onScrollbarYChange);return y.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),l.jsx(H2,{"data-orientation":"vertical",...s,ref:u,sizes:n,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Jh(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,f)=>{if(o.viewport){const h=o.viewport.scrollTop+d.deltaY;e.onWheelScroll(h),q2(h,f)&&d.preventDefault()}},onResize:()=>{c.current&&o.viewport&&i&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:Tf(i.paddingTop),paddingEnd:Tf(i.paddingBottom)}})}})}),[sB,W2]=F2(ls),H2=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:s,onThumbChange:o,onThumbPointerUp:i,onThumbPointerDown:a,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:d,onResize:f,...h}=e,m=pr(ls,n),[x,p]=y.useState(null),w=Ge(t,A=>p(A)),g=y.useRef(null),v=y.useRef(""),b=m.viewport,_=r.content-r.viewport,C=Ot(d),j=Ot(c),T=em(f,10);function R(A){if(g.current){const O=A.clientX-g.current.left,G=A.clientY-g.current.top;u({x:O,y:G})}}return y.useEffect(()=>{const A=O=>{const G=O.target;(x==null?void 0:x.contains(G))&&C(O,_)};return document.addEventListener("wheel",A,{passive:!1}),()=>document.removeEventListener("wheel",A,{passive:!1})},[b,x,_,C]),y.useEffect(j,[r,j]),Va(x,T),Va(m.content,T),l.jsx(sB,{scope:n,scrollbar:x,hasThumb:s,onThumbChange:Ot(o),onThumbPointerUp:Ot(i),onThumbPositionChange:j,onThumbPointerDown:Ot(a),children:l.jsx(Pe.div,{...h,ref:w,style:{position:"absolute",...h.style},onPointerDown:ue(e.onPointerDown,A=>{A.button===0&&(A.target.setPointerCapture(A.pointerId),g.current=x.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),R(A))}),onPointerMove:ue(e.onPointerMove,R),onPointerUp:ue(e.onPointerUp,A=>{const O=A.target;O.hasPointerCapture(A.pointerId)&&O.releasePointerCapture(A.pointerId),document.body.style.webkitUserSelect=v.current,m.viewport&&(m.viewport.style.scrollBehavior=""),g.current=null})})})}),Nf="ScrollAreaThumb",Y2=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=W2(Nf,e.__scopeScrollArea);return l.jsx(an,{present:n||s.hasThumb,children:l.jsx(oB,{ref:t,...r})})}),oB=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...s}=e,o=pr(Nf,n),i=W2(Nf,n),{onThumbPositionChange:a}=i,c=Ge(t,f=>i.onThumbChange(f)),u=y.useRef(),d=em(()=>{u.current&&(u.current(),u.current=void 0)},100);return y.useEffect(()=>{const f=o.viewport;if(f){const h=()=>{if(d(),!u.current){const m=lB(f,a);u.current=m,a()}};return a(),f.addEventListener("scroll",h),()=>f.removeEventListener("scroll",h)}},[o.viewport,d,a]),l.jsx(Pe.div,{"data-state":i.hasThumb?"visible":"hidden",...s,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:ue(e.onPointerDownCapture,f=>{const m=f.target.getBoundingClientRect(),x=f.clientX-m.left,p=f.clientY-m.top;i.onThumbPointerDown({x,y:p})}),onPointerUp:ue(e.onPointerUp,i.onThumbPointerUp)})});Y2.displayName=Nf;var Ux="ScrollAreaCorner",K2=y.forwardRef((e,t)=>{const n=pr(Ux,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?l.jsx(iB,{...e,ref:t}):null});K2.displayName=Ux;var iB=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,s=pr(Ux,n),[o,i]=y.useState(0),[a,c]=y.useState(0),u=!!(o&&a);return Va(s.scrollbarX,()=>{var f;const d=((f=s.scrollbarX)==null?void 0:f.offsetHeight)||0;s.onCornerHeightChange(d),c(d)}),Va(s.scrollbarY,()=>{var f;const d=((f=s.scrollbarY)==null?void 0:f.offsetWidth)||0;s.onCornerWidthChange(d),i(d)}),u?l.jsx(Pe.div,{...r,ref:t,style:{width:o,height:a,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Tf(e){return e?parseInt(e,10):0}function G2(e,t){const n=e/t;return isNaN(n)?0:n}function Jh(e){const t=G2(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function aB(e,t,n,r="ltr"){const s=Jh(n),o=s/2,i=t||o,a=s-i,c=n.scrollbar.paddingStart+i,u=n.scrollbar.size-n.scrollbar.paddingEnd-a,d=n.content-n.viewport,f=r==="ltr"?[0,d]:[d*-1,0];return Z2([c,u],f)(e)}function Hb(e,t,n="ltr"){const r=Jh(t),s=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-s,i=t.content-t.viewport,a=o-r,c=n==="ltr"?[0,i]:[i*-1,0],u=Ug(e,c);return Z2([0,i],[0,a])(u)}function Z2(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function q2(e,t){return e>0&&e{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function s(){const o={left:e.scrollLeft,top:e.scrollTop},i=n.left!==o.left,a=n.top!==o.top;(i||a)&&t(),n=o,r=window.requestAnimationFrame(s)}(),()=>window.cancelAnimationFrame(r)};function em(e,t){const n=Ot(e),r=y.useRef(0);return y.useEffect(()=>()=>window.clearTimeout(r.current),[]),y.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Va(e,t){const n=Ot(t);en(()=>{let r=0;if(e){const s=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return s.observe(e),()=>{window.cancelAnimationFrame(r),s.unobserve(e)}}},[e,n])}var X2=$2,cB=V2,uB=K2;const tm=y.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(X2,{ref:r,className:re("relative overflow-hidden",e),...n,children:[l.jsx(cB,{className:"h-full w-full rounded-[inherit]",children:t}),l.jsx(Q2,{}),l.jsx(uB,{})]}));tm.displayName=X2.displayName;const Q2=y.forwardRef(({className:e,orientation:t="vertical",...n},r)=>l.jsx(Fx,{ref:r,orientation:t,className:re("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),...n,children:l.jsx(Y2,{className:"relative flex-1 rounded-full bg-border"})}));Q2.displayName=Fx.displayName;const Rs=new Map([["aliyun",["common.provider.aliyun","/imgs/providers/aliyun.svg"]],["tencent",["common.provider.tencent","/imgs/providers/tencent.svg"]],["huaweicloud",["common.provider.huaweicloud","/imgs/providers/huaweicloud.svg"]],["qiniu",["common.provider.qiniu","/imgs/providers/qiniu.svg"]],["cloudflare",["common.provider.cloudflare","/imgs/providers/cloudflare.svg"]],["namesilo",["common.provider.namesilo","/imgs/providers/namesilo.svg"]],["godaddy",["common.provider.godaddy","/imgs/providers/godaddy.svg"]],["local",["common.provider.local","/imgs/providers/local.svg"]],["ssh",["common.provider.ssh","/imgs/providers/ssh.svg"]],["webhook",["common.provider.webhook","/imgs/providers/webhook.svg"]]]),Yb=e=>Rs.get(e),cs=ce.union([ce.literal("aliyun"),ce.literal("tencent"),ce.literal("huaweicloud"),ce.literal("qiniu"),ce.literal("cloudflare"),ce.literal("namesilo"),ce.literal("godaddy"),ce.literal("local"),ce.literal("ssh"),ce.literal("webhook")],{message:"access.authorization.form.type.placeholder"}),us=e=>{switch(e){case"aliyun":case"tencent":case"huaweicloud":return"all";case"qiniu":case"local":case"ssh":case"webhook":return"deploy";case"cloudflare":case"namesilo":case"godaddy":return"apply";default:return"all"}},dB=({data:e,op:t,onAfterReq:n})=>{const{addAccess:r,updateAccess:s}=ln(),{t:o}=Ye(),i=ce.object({id:ce.string().optional(),name:ce.string().min(1,"access.authorization.form.name.placeholder").max(64,o("common.errmsg.string_max",{max:64})),configType:cs,accessKeyId:ce.string().min(1,"access.authorization.form.access_key_id.placeholder").max(64,o("common.errmsg.string_max",{max:64})),accessSecretId:ce.string().min(1,"access.authorization.form.access_key_secret.placeholder").max(64,o("common.errmsg.string_max",{max:64}))});let a={accessKeyId:"",accessKeySecret:""};e&&(a=e.config);const c=cn({resolver:un(i),defaultValues:{id:e==null?void 0:e.id,name:(e==null?void 0:e.name)||"",configType:"aliyun",accessKeyId:a.accessKeyId,accessSecretId:a.accessKeySecret}}),u=async d=>{const f={id:d.id,name:d.name,configType:d.configType,usage:us(d.configType),config:{accessKeyId:d.accessKeyId,accessKeySecret:d.accessSecretId}};try{f.id=t=="copy"?"":f.id;const h=await as(f);if(n(),f.id=h.id,f.created=h.created,f.updated=h.updated,d.id&&t=="edit"){s(f);return}r(f)}catch(h){Object.entries(h.response.data).forEach(([x,p])=>{c.setError(x,{type:"manual",message:p.message})});return}};return l.jsx(l.Fragment,{children:l.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:l.jsx(dn,{...c,children:l.jsxs("form",{onSubmit:d=>{d.stopPropagation(),c.handleSubmit(u)(d)},className:"space-y-8",children:[l.jsx(ke,{control:c.control,name:"name",render:({field:d})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:o("access.authorization.form.name.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:o("access.authorization.form.name.placeholder"),...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"id",render:({field:d})=>l.jsxs(Se,{className:"hidden",children:[l.jsx(Ce,{children:o("access.authorization.form.config.label")}),l.jsx(je,{children:l.jsx(pe,{...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"configType",render:({field:d})=>l.jsxs(Se,{className:"hidden",children:[l.jsx(Ce,{children:o("access.authorization.form.config.label")}),l.jsx(je,{children:l.jsx(pe,{...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"accessKeyId",render:({field:d})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:o("access.authorization.form.access_key_id.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:o("access.authorization.form.access_key_id.placeholder"),...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"accessSecretId",render:({field:d})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:o("access.authorization.form.access_key_secret.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:o("access.authorization.form.access_key_secret.placeholder"),...d})}),l.jsx(ye,{})]})}),l.jsx(ye,{}),l.jsx("div",{className:"flex justify-end",children:l.jsx(Me,{type:"submit",children:o("common.save")})})]})})})})},fB=({data:e,op:t,onAfterReq:n})=>{const{addAccess:r,updateAccess:s}=ln(),{t:o}=Ye(),i=ce.object({id:ce.string().optional(),name:ce.string().min(1,"access.authorization.form.name.placeholder").max(64,o("common.errmsg.string_max",{max:64})),configType:cs,secretId:ce.string().min(1,"access.authorization.form.secret_id.placeholder").max(64,o("common.errmsg.string_max",{max:64})),secretKey:ce.string().min(1,"access.authorization.form.secret_key.placeholder").max(64,o("common.errmsg.string_max",{max:64}))});let a={secretId:"",secretKey:""};e&&(a=e.config);const c=cn({resolver:un(i),defaultValues:{id:e==null?void 0:e.id,name:(e==null?void 0:e.name)||"",configType:"tencent",secretId:a.secretId,secretKey:a.secretKey}}),u=async d=>{const f={id:d.id,name:d.name,configType:d.configType,usage:us(d.configType),config:{secretId:d.secretId,secretKey:d.secretKey}};try{f.id=t=="copy"?"":f.id;const h=await as(f);if(n(),f.id=h.id,f.created=h.created,f.updated=h.updated,d.id&&t=="edit"){s(f);return}r(f)}catch(h){Object.entries(h.response.data).forEach(([x,p])=>{c.setError(x,{type:"manual",message:p.message})})}};return l.jsx(l.Fragment,{children:l.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:l.jsx(dn,{...c,children:l.jsxs("form",{onSubmit:d=>{d.stopPropagation(),c.handleSubmit(u)(d)},className:"space-y-8",children:[l.jsx(ke,{control:c.control,name:"name",render:({field:d})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:o("access.authorization.form.name.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:o("access.authorization.form.name.placeholder"),...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"id",render:({field:d})=>l.jsxs(Se,{className:"hidden",children:[l.jsx(Ce,{children:o("access.authorization.form.config.label")}),l.jsx(je,{children:l.jsx(pe,{...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"configType",render:({field:d})=>l.jsxs(Se,{className:"hidden",children:[l.jsx(Ce,{children:o("access.authorization.form.config.label")}),l.jsx(je,{children:l.jsx(pe,{...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"secretId",render:({field:d})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:o("access.authorization.form.secret_id.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:o("access.authorization.form.secret_id.placeholder"),...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"secretKey",render:({field:d})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:o("access.authorization.form.secret_key.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:o("access.authorization.form.secret_key.placeholder"),...d})}),l.jsx(ye,{})]})}),l.jsx("div",{className:"flex justify-end",children:l.jsx(Me,{type:"submit",children:o("common.save")})})]})})})})},hB=({data:e,op:t,onAfterReq:n})=>{const{addAccess:r,updateAccess:s}=ln(),{t:o}=Ye(),i=ce.object({id:ce.string().optional(),name:ce.string().min(1,"access.authorization.form.name.placeholder").max(64,o("common.errmsg.string_max",{max:64})),configType:cs,region:ce.string().min(1,"access.authorization.form.region.placeholder").max(64,o("common.errmsg.string_max",{max:64})),accessKeyId:ce.string().min(1,"access.authorization.form.access_key_id.placeholder").max(64,o("common.errmsg.string_max",{max:64})),secretAccessKey:ce.string().min(1,"access.authorization.form.access_key_secret.placeholder").max(64,o("common.errmsg.string_max",{max:64}))});let a={region:"cn-north-1",accessKeyId:"",secretAccessKey:""};e&&(a=e.config);const c=cn({resolver:un(i),defaultValues:{id:e==null?void 0:e.id,name:(e==null?void 0:e.name)||"",configType:"huaweicloud",region:a.region,accessKeyId:a.accessKeyId,secretAccessKey:a.secretAccessKey}}),u=async d=>{const f={id:d.id,name:d.name,configType:d.configType,usage:us(d.configType),config:{region:d.region,accessKeyId:d.accessKeyId,secretAccessKey:d.secretAccessKey}};try{f.id=t=="copy"?"":f.id;const h=await as(f);if(n(),f.id=h.id,f.created=h.created,f.updated=h.updated,d.id&&t=="edit"){s(f);return}r(f)}catch(h){Object.entries(h.response.data).forEach(([x,p])=>{c.setError(x,{type:"manual",message:p.message})});return}};return l.jsx(l.Fragment,{children:l.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:l.jsx(dn,{...c,children:l.jsxs("form",{onSubmit:d=>{d.stopPropagation(),c.handleSubmit(u)(d)},className:"space-y-8",children:[l.jsx(ke,{control:c.control,name:"name",render:({field:d})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:o("access.authorization.form.name.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:o("access.authorization.form.name.placeholder"),...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"id",render:({field:d})=>l.jsxs(Se,{className:"hidden",children:[l.jsx(Ce,{children:o("access.authorization.form.config.label")}),l.jsx(je,{children:l.jsx(pe,{...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"configType",render:({field:d})=>l.jsxs(Se,{className:"hidden",children:[l.jsx(Ce,{children:o("access.authorization.form.config.label")}),l.jsx(je,{children:l.jsx(pe,{...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"region",render:({field:d})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:o("access.authorization.form.region.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:o("access.authorization.form.region.placeholder"),...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"accessKeyId",render:({field:d})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:o("access.authorization.form.access_key_id.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:o("access.authorization.form.access_key_id.placeholder"),...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"secretAccessKey",render:({field:d})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:o("access.authorization.form.access_key_secret.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:o("access.authorization.form.access_key_secret.placeholder"),...d})}),l.jsx(ye,{})]})}),l.jsx(ye,{}),l.jsx("div",{className:"flex justify-end",children:l.jsx(Me,{type:"submit",children:o("common.save")})})]})})})})},mB=({data:e,op:t,onAfterReq:n})=>{const{addAccess:r,updateAccess:s}=ln(),{t:o}=Ye(),i=ce.object({id:ce.string().optional(),name:ce.string().min(1,"access.authorization.form.name.placeholder").max(64,o("common.errmsg.string_max",{max:64})),configType:cs,accessKey:ce.string().min(1,"access.authorization.form.access_key.placeholder").max(64),secretKey:ce.string().min(1,"access.authorization.form.secret_key.placeholder").max(64)});let a={accessKey:"",secretKey:""};e&&(a=e.config);const c=cn({resolver:un(i),defaultValues:{id:e==null?void 0:e.id,name:(e==null?void 0:e.name)||"",configType:"qiniu",accessKey:a.accessKey,secretKey:a.secretKey}}),u=async d=>{const f={id:d.id,name:d.name,configType:d.configType,usage:us(d.configType),config:{accessKey:d.accessKey,secretKey:d.secretKey}};try{f.id=t=="copy"?"":f.id;const h=await as(f);if(n(),f.id=h.id,f.created=h.created,f.updated=h.updated,d.id&&t=="edit"){s(f);return}r(f)}catch(h){Object.entries(h.response.data).forEach(([x,p])=>{c.setError(x,{type:"manual",message:p.message})});return}};return l.jsx(l.Fragment,{children:l.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:l.jsx(dn,{...c,children:l.jsxs("form",{onSubmit:d=>{d.stopPropagation(),c.handleSubmit(u)(d)},className:"space-y-8",children:[l.jsx(ke,{control:c.control,name:"name",render:({field:d})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:o("access.authorization.form.name.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:o("access.authorization.form.name.placeholder"),...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"id",render:({field:d})=>l.jsxs(Se,{className:"hidden",children:[l.jsx(Ce,{children:o("access.authorization.form.config.label")}),l.jsx(je,{children:l.jsx(pe,{...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"configType",render:({field:d})=>l.jsxs(Se,{className:"hidden",children:[l.jsx(Ce,{children:o("access.authorization.form.config.label")}),l.jsx(je,{children:l.jsx(pe,{...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"accessKey",render:({field:d})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:o("access.authorization.form.access_key.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:o("access.authorization.form.access_key.placeholder"),...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"secretKey",render:({field:d})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:o("access.authorization.form.secret_key.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:o("access.authorization.form.secret_key.placeholder"),...d})}),l.jsx(ye,{})]})}),l.jsx(ye,{}),l.jsx("div",{className:"flex justify-end",children:l.jsx(Me,{type:"submit",children:o("common.save")})})]})})})})},pB=({data:e,op:t,onAfterReq:n})=>{const{addAccess:r,updateAccess:s}=ln(),{t:o}=Ye(),i=ce.object({id:ce.string().optional(),name:ce.string().min(1,"access.authorization.form.name.placeholder").max(64,o("common.errmsg.string_max",{max:64})),configType:cs,dnsApiToken:ce.string().min(1,"access.authorization.form.cloud_dns_api_token.placeholder").max(64,o("common.errmsg.string_max",{max:64}))});let a={dnsApiToken:""};e&&(a=e.config);const c=cn({resolver:un(i),defaultValues:{id:e==null?void 0:e.id,name:(e==null?void 0:e.name)||"",configType:"cloudflare",dnsApiToken:a.dnsApiToken}}),u=async d=>{const f={id:d.id,name:d.name,configType:d.configType,usage:us(d.configType),config:{dnsApiToken:d.dnsApiToken}};try{f.id=t=="copy"?"":f.id;const h=await as(f);if(n(),f.id=h.id,f.created=h.created,f.updated=h.updated,d.id&&t=="edit"){s(f);return}r(f)}catch(h){Object.entries(h.response.data).forEach(([x,p])=>{c.setError(x,{type:"manual",message:p.message})})}};return l.jsx(l.Fragment,{children:l.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:l.jsx(dn,{...c,children:l.jsxs("form",{onSubmit:d=>{d.stopPropagation(),c.handleSubmit(u)(d)},className:"space-y-8",children:[l.jsx(ke,{control:c.control,name:"name",render:({field:d})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:o("access.authorization.form.name.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:o("access.authorization.form.name.placeholder"),...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"id",render:({field:d})=>l.jsxs(Se,{className:"hidden",children:[l.jsx(Ce,{children:o("access.authorization.form.config.label")}),l.jsx(je,{children:l.jsx(pe,{...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"configType",render:({field:d})=>l.jsxs(Se,{className:"hidden",children:[l.jsx(Ce,{children:o("access.authorization.form.config.label")}),l.jsx(je,{children:l.jsx(pe,{...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"dnsApiToken",render:({field:d})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:o("access.authorization.form.cloud_dns_api_token.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:o("access.authorization.form.cloud_dns_api_token.placeholder"),...d})}),l.jsx(ye,{})]})}),l.jsx("div",{className:"flex justify-end",children:l.jsx(Me,{type:"submit",children:o("common.save")})})]})})})})},gB=({data:e,op:t,onAfterReq:n})=>{const{addAccess:r,updateAccess:s}=ln(),{t:o}=Ye(),i=ce.object({id:ce.string().optional(),name:ce.string().min(1,"access.authorization.form.name.placeholder").max(64,o("common.errmsg.string_max",{max:64})),configType:cs,apiKey:ce.string().min(1,"access.authorization.form.namesilo_api_key.placeholder").max(64,o("common.errmsg.string_max",{max:64}))});let a={apiKey:""};e&&(a=e.config);const c=cn({resolver:un(i),defaultValues:{id:e==null?void 0:e.id,name:(e==null?void 0:e.name)||"",configType:"namesilo",apiKey:a.apiKey}}),u=async d=>{const f={id:d.id,name:d.name,configType:d.configType,usage:us(d.configType),config:{apiKey:d.apiKey}};try{f.id=t=="copy"?"":f.id;const h=await as(f);if(n(),f.id=h.id,f.created=h.created,f.updated=h.updated,d.id&&t=="edit"){s(f);return}r(f)}catch(h){Object.entries(h.response.data).forEach(([x,p])=>{c.setError(x,{type:"manual",message:p.message})})}};return l.jsx(l.Fragment,{children:l.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:l.jsx(dn,{...c,children:l.jsxs("form",{onSubmit:d=>{d.stopPropagation(),c.handleSubmit(u)(d)},className:"space-y-8",children:[l.jsx(ke,{control:c.control,name:"name",render:({field:d})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:o("access.authorization.form.name.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:o("access.authorization.form.name.placeholder"),...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"id",render:({field:d})=>l.jsxs(Se,{className:"hidden",children:[l.jsx(Ce,{children:o("access.authorization.form.config.label")}),l.jsx(je,{children:l.jsx(pe,{...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"configType",render:({field:d})=>l.jsxs(Se,{className:"hidden",children:[l.jsx(Ce,{children:o("access.authorization.form.config.label")}),l.jsx(je,{children:l.jsx(pe,{...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"apiKey",render:({field:d})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:o("access.authorization.form.namesilo_api_key.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:o("access.authorization.form.namesilo_api_key.placeholder"),...d})}),l.jsx(ye,{})]})}),l.jsx("div",{className:"flex justify-end",children:l.jsx(Me,{type:"submit",children:o("common.save")})})]})})})})},yB=({data:e,op:t,onAfterReq:n})=>{const{addAccess:r,updateAccess:s}=ln(),{t:o}=Ye(),i=ce.object({id:ce.string().optional(),name:ce.string().min(1,"access.authorization.form.name.placeholder").max(64,o("common.errmsg.string_max",{max:64})),configType:cs,apiKey:ce.string().min(1,"access.authorization.form.godaddy_api_key.placeholder").max(64,o("common.errmsg.string_max",{max:64})),apiSecret:ce.string().min(1,"access.authorization.form.godaddy_api_secret.placeholder").max(64,o("common.errmsg.string_max",{max:64}))});let a={apiKey:"",apiSecret:""};e&&(a=e.config);const c=cn({resolver:un(i),defaultValues:{id:e==null?void 0:e.id,name:(e==null?void 0:e.name)||"",configType:"godaddy",apiKey:a.apiKey,apiSecret:a.apiSecret}}),u=async d=>{const f={id:d.id,name:d.name,configType:d.configType,usage:us(d.configType),config:{apiKey:d.apiKey,apiSecret:d.apiSecret}};try{f.id=t=="copy"?"":f.id;const h=await as(f);if(n(),f.id=h.id,f.created=h.created,f.updated=h.updated,d.id&&t=="edit"){s(f);return}r(f)}catch(h){Object.entries(h.response.data).forEach(([x,p])=>{c.setError(x,{type:"manual",message:p.message})})}};return l.jsx(l.Fragment,{children:l.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:l.jsx(dn,{...c,children:l.jsxs("form",{onSubmit:d=>{d.stopPropagation(),c.handleSubmit(u)(d)},className:"space-y-8",children:[l.jsx(ke,{control:c.control,name:"name",render:({field:d})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:o("access.authorization.form.name.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:o("access.authorization.form.name.placeholder"),...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"id",render:({field:d})=>l.jsxs(Se,{className:"hidden",children:[l.jsx(Ce,{children:o("access.authorization.form.config.label")}),l.jsx(je,{children:l.jsx(pe,{...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"configType",render:({field:d})=>l.jsxs(Se,{className:"hidden",children:[l.jsx(Ce,{children:o("access.authorization.form.config.label")}),l.jsx(je,{children:l.jsx(pe,{...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"apiKey",render:({field:d})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:o("access.authorization.form.godaddy_api_key.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:o("access.authorization.form.godaddy_api_key.placeholder"),...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"apiSecret",render:({field:d})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:o("access.authorization.form.godaddy_api_secret.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:o("access.authorization.form.godaddy_api_secret.placeholder"),...d})}),l.jsx(ye,{})]})}),l.jsx("div",{className:"flex justify-end",children:l.jsx(Me,{type:"submit",children:o("common.save")})})]})})})})},vB=({data:e,op:t,onAfterReq:n})=>{const{addAccess:r,updateAccess:s,reloadAccessGroups:o}=ln(),{t:i}=Ye(),a=ce.object({id:ce.string().optional(),name:ce.string().min(1,"access.authorization.form.name.placeholder").max(64,i("common.errmsg.string_max",{max:64})),configType:cs}),c=cn({resolver:un(a),defaultValues:{id:e==null?void 0:e.id,name:(e==null?void 0:e.name)||"",configType:"local"}}),u=async d=>{const f={id:d.id,name:d.name,configType:d.configType,usage:us(d.configType),config:{}};try{f.id=t=="copy"?"":f.id;const h=await as(f);n(),f.id=h.id,f.created=h.created,f.updated=h.updated,d.id&&t=="edit"?s(f):r(f),o()}catch(h){Object.entries(h.response.data).forEach(([x,p])=>{c.setError(x,{type:"manual",message:p.message})});return}};return l.jsx(l.Fragment,{children:l.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:l.jsx(dn,{...c,children:l.jsxs("form",{onSubmit:d=>{d.stopPropagation(),c.handleSubmit(u)(d)},className:"space-y-3",children:[l.jsx(ke,{control:c.control,name:"name",render:({field:d})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:i("access.authorization.form.name.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:i("access.authorization.form.name.placeholder"),...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"id",render:({field:d})=>l.jsxs(Se,{className:"hidden",children:[l.jsx(Ce,{children:i("access.authorization.form.config.label")}),l.jsx(je,{children:l.jsx(pe,{...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"configType",render:({field:d})=>l.jsxs(Se,{className:"hidden",children:[l.jsx(Ce,{children:i("access.authorization.form.config.label")}),l.jsx(je,{children:l.jsx(pe,{...d})}),l.jsx(ye,{})]})}),l.jsx(ye,{}),l.jsx("div",{className:"flex justify-end",children:l.jsx(Me,{type:"submit",children:i("common.save")})})]})})})})},Vx=({className:e,trigger:t})=>{const{reloadAccessGroups:n}=ln(),[r,s]=y.useState(!1),{t:o}=Ye(),i=ce.object({name:ce.string().min(1,"access.group.form.name.errmsg.empty").max(64,o("common.errmsg.string_max",{max:64}))}),a=cn({resolver:un(i),defaultValues:{name:""}}),c=async u=>{try{await _$({name:u.name}),n(),s(!1)}catch(d){Object.entries(d.response.data).forEach(([h,m])=>{a.setError(h,{type:"manual",message:m.message})})}};return l.jsxs(ll,{onOpenChange:s,open:r,children:[l.jsx(cl,{asChild:!0,className:re(e),children:t}),l.jsxs(Ni,{className:"sm:max-w-[600px] w-full dark:text-stone-200",children:[l.jsx(Ti,{children:l.jsx(Pi,{children:o("access.group.add")})}),l.jsx("div",{className:"container py-3",children:l.jsx(dn,{...a,children:l.jsxs("form",{onSubmit:u=>{u.stopPropagation(),a.handleSubmit(c)(u)},className:"space-y-8",children:[l.jsx(ke,{control:a.control,name:"name",render:({field:u})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:o("access.group.form.name.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:o("access.group.form.name.errmsg.empty"),...u,type:"text"})}),l.jsx(ye,{})]})}),l.jsx("div",{className:"flex justify-end",children:l.jsx(Me,{type:"submit",children:o("common.save")})})]})})})]})]})},xB=({data:e,op:t,onAfterReq:n})=>{const{addAccess:r,updateAccess:s,reloadAccessGroups:o,config:{accessGroups:i}}=ln(),a=y.useRef(null),[c,u]=y.useState(""),{t:d}=Ye(),f=e&&e.group?e.group:"",h=/^(?:\*\.)?([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}$/,m=/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,x=ce.object({id:ce.string().optional(),name:ce.string().min(1,"access.authorization.form.name.placeholder").max(64,d("common.errmsg.string_max",{max:64})),configType:cs,host:ce.string().refine(_=>m.test(_)||h.test(_),{message:"common.errmsg.host_invalid"}),group:ce.string().optional(),port:ce.string().min(1,"access.authorization.form.ssh_port.placeholder").max(5,d("common.errmsg.string_max",{max:5})),username:ce.string().min(1,"username.not.empty").max(64,d("common.errmsg.string_max",{max:64})),password:ce.string().min(0,"password.not.empty").max(64,d("common.errmsg.string_max",{max:64})),key:ce.string().min(0,"access.authorization.form.ssh_key.placeholder").max(20480,d("common.errmsg.string_max",{max:20480})),keyFile:ce.any().optional()});let p={host:"127.0.0.1",port:"22",username:"root",password:"",key:"",keyFile:""};e&&(p=e.config);const w=cn({resolver:un(x),defaultValues:{id:e==null?void 0:e.id,name:(e==null?void 0:e.name)||"",configType:"ssh",group:e==null?void 0:e.group,host:p.host,port:p.port,username:p.username,password:p.password,key:p.key,keyFile:p.keyFile}}),g=async _=>{let C=_.group;C=="emptyId"&&(C="");const j={id:_.id,name:_.name,configType:_.configType,usage:us(_.configType),group:C,config:{host:_.host,port:_.port,username:_.username,password:_.password,key:_.key}};try{j.id=t=="copy"?"":j.id;const T=await as(j);n(),j.id=T.id,j.created=T.created,j.updated=T.updated,_.id&&t=="edit"?s(j):r(j),C!=f&&(f&&await Pb({id:f,"access-":j.id}),C&&await Pb({id:C,"access+":j.id})),o()}catch(T){Object.entries(T.response.data).forEach(([A,O])=>{w.setError(A,{type:"manual",message:O.message})});return}},v=async _=>{var R;const C=(R=_.target.files)==null?void 0:R[0];if(!C)return;const j=C;u(j.name);const T=await BU(j);w.setValue("key",T)},b=()=>{var _;(_=a.current)==null||_.click()};return l.jsx(l.Fragment,{children:l.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:l.jsx(dn,{...w,children:l.jsxs("form",{onSubmit:_=>{_.stopPropagation(),w.handleSubmit(g)(_)},className:"space-y-3",children:[l.jsx(ke,{control:w.control,name:"name",render:({field:_})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:d("access.authorization.form.name.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:d("access.authorization.form.name.placeholder"),..._})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:w.control,name:"group",render:({field:_})=>l.jsxs(Se,{children:[l.jsxs(Ce,{className:"w-full flex justify-between",children:[l.jsx("div",{children:d("access.authorization.form.ssh_group.label")}),l.jsx(Vx,{trigger:l.jsxs("div",{className:"font-normal text-primary hover:underline cursor-pointer flex items-center",children:[l.jsx(di,{size:14}),d("common.add")]})})]}),l.jsx(je,{children:l.jsxs(Fa,{..._,value:_.value,defaultValue:"emptyId",onValueChange:C=>{w.setValue("group",C)},children:[l.jsx(yi,{children:l.jsx($a,{placeholder:d("access.authorization.form.access_group.placeholder")})}),l.jsxs(vi,{children:[l.jsx(Ao,{value:"emptyId",children:l.jsx("div",{className:re("flex items-center space-x-2 rounded cursor-pointer"),children:"--"})}),i.map(C=>l.jsx(Ao,{value:C.id?C.id:"",children:l.jsx("div",{className:re("flex items-center space-x-2 rounded cursor-pointer"),children:C.name})},C.id))]})]})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:w.control,name:"id",render:({field:_})=>l.jsxs(Se,{className:"hidden",children:[l.jsx(Ce,{children:d("access.authorization.form.config.label")}),l.jsx(je,{children:l.jsx(pe,{..._})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:w.control,name:"configType",render:({field:_})=>l.jsxs(Se,{className:"hidden",children:[l.jsx(Ce,{children:d("access.authorization.form.config.label")}),l.jsx(je,{children:l.jsx(pe,{..._})}),l.jsx(ye,{})]})}),l.jsxs("div",{className:"flex space-x-2",children:[l.jsx(ke,{control:w.control,name:"host",render:({field:_})=>l.jsxs(Se,{className:"grow",children:[l.jsx(Ce,{children:d("access.authorization.form.ssh_host.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:d("access.authorization.form.ssh_host.placeholder"),..._})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:w.control,name:"port",render:({field:_})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:d("access.authorization.form.ssh_port.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:d("access.authorization.form.ssh_port.placeholder"),..._,type:"number"})}),l.jsx(ye,{})]})})]}),l.jsx(ke,{control:w.control,name:"username",render:({field:_})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:d("access.authorization.form.username.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:d("access.authorization.form.username.placeholder"),..._})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:w.control,name:"password",render:({field:_})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:d("access.authorization.form.password.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:d("access.authorization.form.password.placeholder"),..._,type:"password"})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:w.control,name:"key",render:({field:_})=>l.jsxs(Se,{hidden:!0,children:[l.jsx(Ce,{children:d("access.authorization.form.ssh_key.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:d("access.authorization.form.ssh_key.placeholder"),..._})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:w.control,name:"keyFile",render:({field:_})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:d("access.authorization.form.ssh_key.label")}),l.jsx(je,{children:l.jsxs("div",{children:[l.jsx(Me,{type:"button",variant:"secondary",size:"sm",className:"w-48",onClick:b,children:c||d("access.authorization.form.ssh_key_file.placeholder")}),l.jsx(pe,{placeholder:d("access.authorization.form.ssh_key.placeholder"),..._,ref:a,className:"hidden",hidden:!0,type:"file",onChange:v})]})}),l.jsx(ye,{})]})}),l.jsx(ye,{}),l.jsx("div",{className:"flex justify-end",children:l.jsx(Me,{type:"submit",children:d("common.save")})})]})})})})},wB=({data:e,op:t,onAfterReq:n})=>{const{addAccess:r,updateAccess:s}=ln(),{t:o}=Ye(),i=ce.object({id:ce.string().optional(),name:ce.string().min(1,"access.authorization.form.name.placeholder").max(64,o("common.errmsg.string_max",{max:64})),configType:cs,url:ce.string().url("common.errmsg.url_invalid")});let a={url:""};e&&(a=e.config);const c=cn({resolver:un(i),defaultValues:{id:e==null?void 0:e.id,name:(e==null?void 0:e.name)||"",configType:"webhook",url:a.url}}),u=async d=>{const f={id:d.id,name:d.name,configType:d.configType,usage:us(d.configType),config:{url:d.url}};try{f.id=t=="copy"?"":f.id;const h=await as(f);if(n(),f.id=h.id,f.created=h.created,f.updated=h.updated,d.id&&t=="edit"){s(f);return}r(f)}catch(h){Object.entries(h.response.data).forEach(([x,p])=>{c.setError(x,{type:"manual",message:p.message})})}};return l.jsx(l.Fragment,{children:l.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:l.jsx(dn,{...c,children:l.jsxs("form",{onSubmit:d=>{d.stopPropagation(),c.handleSubmit(u)(d)},className:"space-y-8",children:[l.jsx(ke,{control:c.control,name:"name",render:({field:d})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:o("access.authorization.form.name.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:o("access.authorization.form.name.placeholder"),...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"id",render:({field:d})=>l.jsxs(Se,{className:"hidden",children:[l.jsx(Ce,{children:o("access.authorization.form.config.label")}),l.jsx(je,{children:l.jsx(pe,{...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"configType",render:({field:d})=>l.jsxs(Se,{className:"hidden",children:[l.jsx(Ce,{children:o("access.authorization.form.config.label")}),l.jsx(je,{children:l.jsx(pe,{...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"url",render:({field:d})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:o("access.authorization.form.webhook_url.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:o("access.authorization.form.webhook_url.placeholder"),...d})}),l.jsx(ye,{})]})}),l.jsx("div",{className:"flex justify-end",children:l.jsx(Me,{type:"submit",children:o("common.save")})})]})})})})},da=({trigger:e,op:t,data:n,className:r})=>{const[s,o]=y.useState(!1),{t:i}=Ye(),a=Array.from(Rs.keys()),[c,u]=y.useState((n==null?void 0:n.configType)||"");let d=l.jsx(l.Fragment,{children:" "});switch(c){case"aliyun":d=l.jsx(dB,{data:n,op:t,onAfterReq:()=>{o(!1)}});break;case"tencent":d=l.jsx(fB,{data:n,op:t,onAfterReq:()=>{o(!1)}});break;case"huaweicloud":d=l.jsx(hB,{data:n,op:t,onAfterReq:()=>{o(!1)}});break;case"qiniu":d=l.jsx(mB,{data:n,op:t,onAfterReq:()=>{o(!1)}});break;case"cloudflare":d=l.jsx(pB,{data:n,op:t,onAfterReq:()=>{o(!1)}});break;case"namesilo":d=l.jsx(gB,{data:n,op:t,onAfterReq:()=>{o(!1)}});break;case"godaddy":d=l.jsx(yB,{data:n,op:t,onAfterReq:()=>{o(!1)}});break;case"local":d=l.jsx(vB,{data:n,op:t,onAfterReq:()=>{o(!1)}});break;case"ssh":d=l.jsx(xB,{data:n,op:t,onAfterReq:()=>{o(!1)}});break;case"webhook":d=l.jsx(wB,{data:n,op:t,onAfterReq:()=>{o(!1)}});break}const f=h=>h==c?"border-primary":"";return l.jsxs(ll,{onOpenChange:o,open:s,children:[l.jsx(cl,{asChild:!0,className:re(r),children:e}),l.jsxs(Ni,{className:"sm:max-w-[600px] w-full dark:text-stone-200",children:[l.jsx(Ti,{children:l.jsx(Pi,{children:t=="add"?i("access.authorization.add"):t=="edit"?i("access.authorization.edit"):i("access.authorization.copy")})}),l.jsx(tm,{className:"max-h-[80vh]",children:l.jsxs("div",{className:"container py-3",children:[l.jsx(Vt,{children:i("access.authorization.form.type.label")}),l.jsxs(Fa,{onValueChange:h=>{u(h)},defaultValue:c,children:[l.jsx(yi,{className:"mt-3",children:l.jsx($a,{placeholder:i("access.authorization.form.type.placeholder")})}),l.jsx(vi,{children:l.jsxs(Wc,{children:[l.jsx(Ua,{children:i("access.authorization.form.type.list")}),a.map(h=>{var m,x;return l.jsx(Ao,{value:h,children:l.jsxs("div",{className:re("flex items-center space-x-2 rounded cursor-pointer",f(h)),children:[l.jsx("img",{src:(m=Rs.get(h))==null?void 0:m[1],className:"h-6 w-6"}),l.jsx("div",{children:i(((x=Rs.get(h))==null?void 0:x[0])||"")})]})},h)})]})})]}),d]})})]})]})};var J2=Symbol.for("immer-nothing"),Kb=Symbol.for("immer-draftable"),Zn=Symbol.for("immer-state");function Sr(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Ba=Object.getPrototypeOf;function Wa(e){return!!e&&!!e[Zn]}function xi(e){var t;return e?eT(e)||Array.isArray(e)||!!e[Kb]||!!((t=e.constructor)!=null&&t[Kb])||rm(e)||sm(e):!1}var bB=Object.prototype.constructor.toString();function eT(e){if(!e||typeof e!="object")return!1;const t=Ba(e);if(t===null)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===bB}function Pf(e,t){nm(e)===0?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function nm(e){const t=e[Zn];return t?t.type_:Array.isArray(e)?1:rm(e)?2:sm(e)?3:0}function Kg(e,t){return nm(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function tT(e,t,n){const r=nm(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function _B(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function rm(e){return e instanceof Map}function sm(e){return e instanceof Set}function Vo(e){return e.copy_||e.base_}function Gg(e,t){if(rm(e))return new Map(e);if(sm(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=eT(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[Zn];let s=Reflect.ownKeys(r);for(let o=0;o1&&(e.set=e.add=e.clear=e.delete=SB),Object.freeze(e),t&&Object.entries(e).forEach(([n,r])=>Bx(r,!0))),e}function SB(){Sr(2)}function om(e){return Object.isFrozen(e)}var kB={};function wi(e){const t=kB[e];return t||Sr(0,e),t}var Hc;function nT(){return Hc}function CB(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Gb(e,t){t&&(wi("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Zg(e){qg(e),e.drafts_.forEach(jB),e.drafts_=null}function qg(e){e===Hc&&(Hc=e.parent_)}function Zb(e){return Hc=CB(Hc,e)}function jB(e){const t=e[Zn];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function qb(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Zn].modified_&&(Zg(t),Sr(4)),xi(e)&&(e=Rf(t,e),t.parent_||Af(t,e)),t.patches_&&wi("Patches").generateReplacementPatches_(n[Zn].base_,e,t.patches_,t.inversePatches_)):e=Rf(t,n,[]),Zg(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==J2?e:void 0}function Rf(e,t,n){if(om(t))return t;const r=t[Zn];if(!r)return Pf(t,(s,o)=>Xb(e,r,t,s,o,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return Af(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const s=r.copy_;let o=s,i=!1;r.type_===3&&(o=new Set(s),s.clear(),i=!0),Pf(o,(a,c)=>Xb(e,r,s,a,c,n,i)),Af(e,s,!1),n&&e.patches_&&wi("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function Xb(e,t,n,r,s,o,i){if(Wa(s)){const a=o&&t&&t.type_!==3&&!Kg(t.assigned_,r)?o.concat(r):void 0,c=Rf(e,s,a);if(tT(n,r,c),Wa(c))e.canAutoFreeze_=!1;else return}else i&&n.add(s);if(xi(s)&&!om(s)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Rf(e,s),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&Object.prototype.propertyIsEnumerable.call(n,r)&&Af(e,s)}}function Af(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Bx(t,n)}function EB(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:nT(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let s=r,o=Wx;n&&(s=[r],o=Yc);const{revoke:i,proxy:a}=Proxy.revocable(s,o);return r.draft_=a,r.revoke_=i,a}var Wx={get(e,t){if(t===Zn)return e;const n=Vo(e);if(!Kg(n,t))return NB(e,n,t);const r=n[t];return e.finalized_||!xi(r)?r:r===up(e.base_,t)?(dp(e),e.copy_[t]=Qg(r,e)):r},has(e,t){return t in Vo(e)},ownKeys(e){return Reflect.ownKeys(Vo(e))},set(e,t,n){const r=rT(Vo(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const s=up(Vo(e),t),o=s==null?void 0:s[Zn];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(_B(n,s)&&(n!==void 0||Kg(e.base_,t)))return!0;dp(e),Xg(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return up(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,dp(e),Xg(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Vo(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){Sr(11)},getPrototypeOf(e){return Ba(e.base_)},setPrototypeOf(){Sr(12)}},Yc={};Pf(Wx,(e,t)=>{Yc[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Yc.deleteProperty=function(e,t){return Yc.set.call(this,e,t,void 0)};Yc.set=function(e,t,n){return Wx.set.call(this,e[0],t,n,e[0])};function up(e,t){const n=e[Zn];return(n?Vo(n):e)[t]}function NB(e,t,n){var s;const r=rT(t,n);return r?"value"in r?r.value:(s=r.get)==null?void 0:s.call(e.draft_):void 0}function rT(e,t){if(!(t in e))return;let n=Ba(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Ba(n)}}function Xg(e){e.modified_||(e.modified_=!0,e.parent_&&Xg(e.parent_))}function dp(e){e.copy_||(e.copy_=Gg(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var TB=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const o=n;n=t;const i=this;return function(c=o,...u){return i.produce(c,d=>n.call(this,d,...u))}}typeof n!="function"&&Sr(6),r!==void 0&&typeof r!="function"&&Sr(7);let s;if(xi(t)){const o=Zb(this),i=Qg(t,void 0);let a=!0;try{s=n(i),a=!1}finally{a?Zg(o):qg(o)}return Gb(o,r),qb(s,o)}else if(!t||typeof t!="object"){if(s=n(t),s===void 0&&(s=t),s===J2&&(s=void 0),this.autoFreeze_&&Bx(s,!0),r){const o=[],i=[];wi("Patches").generateReplacementPatches_(t,s,o,i),r(o,i)}return s}else Sr(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(i,...a)=>this.produceWithPatches(i,c=>t(c,...a));let r,s;return[this.produce(t,n,(i,a)=>{r=i,s=a}),r,s]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){xi(e)||Sr(8),Wa(e)&&(e=PB(e));const t=Zb(this),n=Qg(e,void 0);return n[Zn].isManual_=!0,qg(t),n}finishDraft(e,t){const n=e&&e[Zn];(!n||!n.isManual_)&&Sr(9);const{scope_:r}=n;return Gb(r,t),qb(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const s=t[n];if(s.path.length===0&&s.op==="replace"){e=s.value;break}}n>-1&&(t=t.slice(n+1));const r=wi("Patches").applyPatches_;return Wa(e)?r(e,t):this.produce(e,s=>r(s,t))}};function Qg(e,t){const n=rm(e)?wi("MapSet").proxyMap_(e,t):sm(e)?wi("MapSet").proxySet_(e,t):EB(e,t);return(t?t.scope_:nT()).drafts_.push(n),n}function PB(e){return Wa(e)||Sr(10,e),sT(e)}function sT(e){if(!xi(e)||om(e))return e;const t=e[Zn];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Gg(e,t.scope_.immer_.useStrictShallowCopy_)}else n=Gg(e,!0);return Pf(n,(r,s)=>{tT(n,r,sT(s))}),t&&(t.finalized_=!1),n}var qn=new TB,Zr=qn.produce;qn.produceWithPatches.bind(qn);qn.setAutoFreeze.bind(qn);qn.setUseStrictShallowCopy.bind(qn);qn.applyPatches.bind(qn);qn.createDraft.bind(qn);qn.finishDraft.bind(qn);const RB="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let AB=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e));for(;e--;)t+=RB[n[e]&63];return t};const DB=Jc("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"}}),im=y.forwardRef(({className:e,variant:t,...n},r)=>l.jsx("div",{ref:r,role:"alert",className:re(DB({variant:t}),e),...n}));im.displayName="Alert";const Hx=y.forwardRef(({className:e,...t},n)=>l.jsx("h5",{ref:n,className:re("mb-1 font-medium leading-none tracking-tight",e),...t}));Hx.displayName="AlertTitle";const am=y.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:re("text-sm [&_p]:leading-relaxed",e),...t}));am.displayName="AlertDescription";const Df=y.forwardRef(({className:e,...t},n)=>l.jsx("textarea",{className:re("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:n,...t}));Df.displayName="Textarea";const OB=({variables:e,onValueChange:t})=>{const[n,r]=y.useState([]),{t:s}=Ye();y.useEffect(()=>{e&&r(e)},[e]);const o=c=>{const u=n.findIndex(f=>f.key===c.key),d=Zr(n,f=>{u===-1?f.push(c):f[u]=c});r(d),t==null||t(d)},i=c=>{const u=[...n];u.splice(c,1),r(u),t==null||t(u)},a=(c,u)=>{const d=[...n];d[c]=u,r(d),t==null||t(d)};return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex justify-between dark:text-stone-200",children:[l.jsx(Vt,{children:s("domain.deployment.form.variables.label")}),l.jsx(ur,{when:!!(n!=null&&n.length),children:l.jsx(fp,{variable:{key:"",value:""},trigger:l.jsxs("div",{className:"flex items-center text-primary",children:[l.jsx(di,{size:16,className:"cursor-pointer "}),l.jsx("div",{className:"text-sm ",children:s("common.add")})]}),onSave:c=>{o(c)}})})]}),l.jsx(ur,{when:!!(n!=null&&n.length),fallback:l.jsxs("div",{className:"border rounded-md p-3 text-sm mt-2 flex flex-col items-center",children:[l.jsx("div",{className:"text-muted-foreground",children:s("domain.deployment.form.variables.empty")}),l.jsx(fp,{trigger:l.jsxs("div",{className:"flex items-center text-primary",children:[l.jsx(di,{size:16,className:"cursor-pointer "}),l.jsx("div",{className:"text-sm ",children:s("common.add")})]}),variable:{key:"",value:""},onSave:c=>{o(c)}})]}),children:l.jsx("div",{className:"border p-3 rounded-md text-stone-700 text-sm dark:text-stone-200",children:n==null?void 0:n.map((c,u)=>l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsxs("div",{children:[c.key,"=",c.value]}),l.jsxs("div",{className:"flex space-x-2",children:[l.jsx(fp,{trigger:l.jsx(sv,{size:16,className:"cursor-pointer"}),variable:c,onSave:d=>{a(u,d)}}),l.jsx(ov,{size:16,className:"cursor-pointer",onClick:()=>{i(u)}})]})]},u))})})]})},fp=({variable:e,trigger:t,onSave:n})=>{const[r,s]=y.useState({key:"",value:""});y.useEffect(()=>{e&&s(e)},[e]);const{t:o}=Ye(),[i,a]=y.useState(!1),[c,u]=y.useState({}),d=()=>{if(!r.key){u({key:o("domain.deployment.form.variables.key.required")});return}if(!r.value){u({value:o("domain.deployment.form.variables.value.required")});return}n==null||n(r),a(!1),u({})};return l.jsxs(ll,{open:i,onOpenChange:()=>{a(!i)},children:[l.jsx(cl,{children:t}),l.jsxs(Ni,{className:"dark:text-stone-200",children:[l.jsxs(Ti,{className:"flex flex-col",children:[l.jsx(Pi,{children:o("domain.deployment.form.variables.label")}),l.jsxs("div",{className:"pt-5 flex flex-col items-start",children:[l.jsx(Vt,{children:o("domain.deployment.form.variables.key")}),l.jsx(pe,{placeholder:o("domain.deployment.form.variables.key.placeholder"),value:r==null?void 0:r.key,onChange:f=>{s({...r,key:f.target.value})},className:"w-full mt-1"}),l.jsx("div",{className:"text-red-500 text-sm mt-1",children:c==null?void 0:c.key})]}),l.jsxs("div",{className:"pt-2 flex flex-col items-start",children:[l.jsx(Vt,{children:o("domain.deployment.form.variables.value")}),l.jsx(pe,{placeholder:o("domain.deployment.form.variables.value.placeholder"),value:r==null?void 0:r.value,onChange:f=>{s({...r,value:f.target.value})},className:"w-full mt-1"}),l.jsx("div",{className:"text-red-500 text-sm mt-1",children:c==null?void 0:c.value})]})]}),l.jsx(Qh,{children:l.jsx("div",{className:"flex justify-end",children:l.jsx(Me,{onClick:()=>{d()},children:o("common.save")})})})]})]})},Of=new Map([["aliyun-oss",["common.provider.aliyun.oss","/imgs/providers/aliyun.svg"]],["aliyun-cdn",["common.provider.aliyun.cdn","/imgs/providers/aliyun.svg"]],["aliyun-dcdn",["common.provider.aliyun.dcdn","/imgs/providers/aliyun.svg"]],["tencent-cdn",["common.provider.tencent.cdn","/imgs/providers/tencent.svg"]],["qiniu-cdn",["common.provider.qiniu.cdn","/imgs/providers/qiniu.svg"]],["local",["common.provider.local","/imgs/providers/local.svg"]],["ssh",["common.provider.ssh","/imgs/providers/ssh.svg"]],["webhook",["common.provider.webhook","/imgs/providers/webhook.svg"]]]),IB=Array.from(Of.keys()),oT=y.createContext({}),Ha=()=>y.useContext(oT),MB=({deploys:e,onChange:t})=>{const[n,r]=y.useState([]),{t:s}=Ye();y.useEffect(()=>{r(e)},[e]);const o=c=>{c.id=AB();const u=[...n,c];r(u),t(u)},i=c=>{const u=n.filter(d=>d.id!==c);r(u),t(u)},a=c=>{const u=n.map(d=>d.id===c.id?{...c}:d);r(u),t(u)};return l.jsx(l.Fragment,{children:l.jsxs(ur,{when:n.length>0,fallback:l.jsx(im,{className:"w-full border dark:border-stone-400",children:l.jsxs(am,{className:"flex flex-col items-center",children:[l.jsx("div",{children:s("domain.deployment.nodata")}),l.jsx("div",{className:"flex justify-end mt-2",children:l.jsx(Jg,{onSave:c=>{o(c)},trigger:l.jsx(Me,{size:"sm",children:s("common.add")})})})]})}),children:[l.jsx("div",{className:"flex justify-end py-2 border-b dark:border-stone-400",children:l.jsx(Jg,{trigger:l.jsx(Me,{size:"sm",children:s("common.add")}),onSave:c=>{o(c)}})}),l.jsx("div",{className:"w-full md:w-[35em] rounded mt-5 border dark:border-stone-400 dark:text-stone-200",children:l.jsx("div",{className:"",children:n.map(c=>l.jsx(LB,{item:c,onDelete:()=>{i(c.id??"")},onSave:u=>{a(u)}},c.id))})})]})})},LB=({item:e,onDelete:t,onSave:n})=>{const{config:{accesses:r}}=ln(),{t:s}=Ye(),o=r.find(c=>c.id===e.access),i=()=>{if(!o)return"";const c=Rs.get(o.configType);return c?c[1]:""},a=()=>{if(!o)return"";const c=Of.get(e.type);return c?s(c[0]):""};return l.jsxs("div",{className:"flex justify-between text-sm p-3 items-center text-stone-700 dark:text-stone-200",children:[l.jsxs("div",{className:"flex space-x-2 items-center",children:[l.jsx("div",{children:l.jsx("img",{src:i(),className:"w-9"})}),l.jsxs("div",{className:"text-stone-600 flex-col flex space-y-0 dark:text-stone-200",children:[l.jsx("div",{children:a()}),l.jsx("div",{children:o==null?void 0:o.name})]})]}),l.jsxs("div",{className:"flex space-x-2",children:[l.jsx(Jg,{trigger:l.jsx(sv,{size:16,className:"cursor-pointer"}),deployConfig:e,onSave:c=>{n(c)}}),l.jsx(ov,{size:16,className:"cursor-pointer",onClick:()=>{t()}})]})]})},Jg=({trigger:e,deployConfig:t,onSave:n})=>{const{config:{accesses:r}}=ln(),[s,o]=y.useState(),[i,a]=y.useState({access:"",type:""}),[c,u]=y.useState({}),[d,f]=y.useState(!1);y.useEffect(()=>{a(t?{...t}:{access:"",type:""})},[t]),y.useEffect(()=>{const w=i.type.split("-");let g;w&&w.length>1?g=w[1]:g=i.type,o(g),u({})},[i.type]);const h=y.useCallback(w=>{w.type!==i.type?a({...w,access:"",config:{}}):a({...w})},[i.type]),{t:m}=Ye(),x=r.filter(w=>{if(w.usage=="apply")return!1;if(i.type=="")return!0;const g=i.type.split("-");return w.configType===g[0]}),p=()=>{const w={...c};i.type===""?w.type=m("domain.deployment.form.access.placeholder"):w.type="",i.access===""?w.access=m("domain.deployment.form.access.placeholder"):w.access="",u(w);for(const g in w)if(w[g]!=="")return;n(i),a({access:"",type:""}),u({}),f(!1)};return l.jsx(oT.Provider,{value:{deploy:i,setDeploy:h,error:c,setError:u},children:l.jsxs(ll,{open:d,onOpenChange:f,children:[l.jsx(cl,{children:e}),l.jsxs(Ni,{className:"dark:text-stone-200",children:[l.jsxs(Ti,{children:[l.jsx(Pi,{children:m("history.page.title")}),l.jsx(z2,{})]}),l.jsxs("div",{children:[l.jsx(Vt,{children:m("domain.deployment.form.type.label")}),l.jsxs(Fa,{value:i.type,onValueChange:w=>{h({...i,type:w})},children:[l.jsx(yi,{className:"mt-2",children:l.jsx($a,{placeholder:m("domain.deployment.form.type.placeholder")})}),l.jsx(vi,{children:l.jsxs(Wc,{children:[l.jsx(Ua,{children:m("domain.deployment.form.type.list")}),IB.map(w=>{var g,v;return l.jsx(Ao,{value:w,children:l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx("img",{className:"w-6",src:(g=Of.get(w))==null?void 0:g[1]}),l.jsx("div",{children:m(((v=Of.get(w))==null?void 0:v[0])??"")})]})},w)})]})})]}),l.jsx("div",{className:"text-red-500 text-sm mt-1",children:c.type})]}),l.jsxs("div",{children:[l.jsxs(Vt,{className:"flex justify-between",children:[l.jsx("div",{children:m("domain.deployment.form.access.label")}),l.jsx(da,{trigger:l.jsxs("div",{className:"font-normal text-primary hover:underline cursor-pointer flex items-center",children:[l.jsx(di,{size:14}),m("common.add")]}),op:"add"})]}),l.jsxs(Fa,{value:i.access,onValueChange:w=>{h({...i,access:w})},children:[l.jsx(yi,{className:"mt-2",children:l.jsx($a,{placeholder:m("domain.deployment.form.access.placeholder")})}),l.jsx(vi,{children:l.jsxs(Wc,{children:[l.jsx(Ua,{children:m("domain.deployment.form.access.list")}),x.map(w=>{var g;return l.jsx(Ao,{value:w.id,children:l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx("img",{className:"w-6",src:(g=Rs.get(w.configType))==null?void 0:g[1]}),l.jsx("div",{children:w.name})]})},w.id)})]})})]}),l.jsx("div",{className:"text-red-500 text-sm mt-1",children:c.access})]}),l.jsx(zB,{type:s}),l.jsx(Qh,{children:l.jsx(Me,{onClick:w=>{w.stopPropagation(),p()},children:m("common.save")})})]})]})})},zB=({type:e})=>(()=>{switch(e){case"ssh":return l.jsx(Qb,{});case"local":return l.jsx(Qb,{});case"cdn":return l.jsx(hp,{});case"dcdn":return l.jsx(hp,{});case"oss":return l.jsx(FB,{});case"webhook":return l.jsx($B,{});default:return l.jsx(hp,{})}})(),Qb=()=>{var s,o,i,a;const{t:e}=Ye(),{setError:t}=Ha();y.useEffect(()=>{t({})},[]);const{deploy:n,setDeploy:r}=Ha();return y.useEffect(()=>{n.id||r({...n,config:{certPath:"/etc/nginx/ssl/nginx.crt",keyPath:"/etc/nginx/ssl/nginx.key",preCommand:"",command:"sudo service nginx reload"}})},[]),l.jsx(l.Fragment,{children:l.jsxs("div",{className:"flex flex-col space-y-2",children:[l.jsxs("div",{children:[l.jsx(Vt,{children:e("access.authorization.form.ssh_cert_path.label")}),l.jsx(pe,{placeholder:e("access.authorization.form.ssh_cert_path.label"),className:"w-full mt-1",value:(s=n==null?void 0:n.config)==null?void 0:s.certPath,onChange:c=>{const u=Zr(n,d=>{d.config||(d.config={}),d.config.certPath=c.target.value});r(u)}})]}),l.jsxs("div",{children:[l.jsx(Vt,{children:e("access.authorization.form.ssh_key_path.label")}),l.jsx(pe,{placeholder:e("access.authorization.form.ssh_key_path.placeholder"),className:"w-full mt-1",value:(o=n==null?void 0:n.config)==null?void 0:o.keyPath,onChange:c=>{const u=Zr(n,d=>{d.config||(d.config={}),d.config.keyPath=c.target.value});r(u)}})]}),l.jsxs("div",{children:[l.jsx(Vt,{children:e("access.authorization.form.ssh_pre_command.label")}),l.jsx(Df,{className:"mt-1",value:(i=n==null?void 0:n.config)==null?void 0:i.preCommand,placeholder:e("access.authorization.form.ssh_pre_command.placeholder"),onChange:c=>{const u=Zr(n,d=>{d.config||(d.config={}),d.config.preCommand=c.target.value});r(u)}})]}),l.jsxs("div",{children:[l.jsx(Vt,{children:e("access.authorization.form.ssh_command.label")}),l.jsx(Df,{className:"mt-1",value:(a=n==null?void 0:n.config)==null?void 0:a.command,placeholder:e("access.authorization.form.ssh_command.placeholder"),onChange:c=>{const u=Zr(n,d=>{d.config||(d.config={}),d.config.command=c.target.value});r(u)}})]})]})})},hp=()=>{var i;const{deploy:e,setDeploy:t,error:n,setError:r}=Ha(),{t:s}=Ye();y.useEffect(()=>{r({})},[]),y.useEffect(()=>{var c;const a=o.safeParse((c=e.config)==null?void 0:c.domain);a.success?r({...n,domain:""}):r({...n,domain:JSON.parse(a.error.message)[0].message})},[e]);const o=ce.string().regex(/^(?:\*\.)?([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}$/,{message:s("common.errmsg.domain_invalid")});return l.jsx("div",{className:"flex flex-col space-y-2",children:l.jsxs("div",{children:[l.jsx(Vt,{children:s("domain.deployment.form.cdn_domain.label")}),l.jsx(pe,{placeholder:s("domain.deployment.form.cdn_domain.placeholder"),className:"w-full mt-1",value:(i=e==null?void 0:e.config)==null?void 0:i.domain,onChange:a=>{const c=a.target.value,u=o.safeParse(c);u.success?r({...n,domain:""}):r({...n,domain:JSON.parse(u.error.message)[0].message});const d=Zr(e,f=>{f.config||(f.config={}),f.config.domain=c});t(d)}}),l.jsx("div",{className:"text-red-600 text-sm mt-1",children:n==null?void 0:n.domain})]})})},FB=()=>{var a,c,u;const{deploy:e,setDeploy:t,error:n,setError:r}=Ha(),{t:s}=Ye();y.useEffect(()=>{r({})},[]),y.useEffect(()=>{var f;const d=o.safeParse((f=e.config)==null?void 0:f.domain);d.success?r({...n,domain:""}):r({...n,domain:JSON.parse(d.error.message)[0].message})},[e]),y.useEffect(()=>{var f;const d=i.safeParse((f=e.config)==null?void 0:f.domain);d.success?r({...n,bucket:""}):r({...n,bucket:JSON.parse(d.error.message)[0].message})},[]),y.useEffect(()=>{e.id||t({...e,config:{endpoint:"oss-cn-hangzhou.aliyuncs.com",bucket:"",domain:""}})},[]);const o=ce.string().regex(/^(?:\*\.)?([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}$/,{message:s("common.errmsg.domain_invalid")}),i=ce.string().min(1,{message:s("domain.deployment.form.oss_bucket.placeholder")});return l.jsx("div",{className:"flex flex-col space-y-2",children:l.jsxs("div",{children:[l.jsx(Vt,{children:s("domain.deployment.form.oss_endpoint.label")}),l.jsx(pe,{className:"w-full mt-1",value:(a=e==null?void 0:e.config)==null?void 0:a.endpoint,onChange:d=>{const f=d.target.value,h=Zr(e,m=>{m.config||(m.config={}),m.config.endpoint=f});t(h)}}),l.jsx("div",{className:"text-red-600 text-sm mt-1",children:n==null?void 0:n.endpoint}),l.jsx(Vt,{children:s("domain.deployment.form.oss_bucket")}),l.jsx(pe,{placeholder:s("domain.deployment.form.oss_bucket.placeholder"),className:"w-full mt-1",value:(c=e==null?void 0:e.config)==null?void 0:c.bucket,onChange:d=>{const f=d.target.value,h=i.safeParse(f);h.success?r({...n,bucket:""}):r({...n,bucket:JSON.parse(h.error.message)[0].message});const m=Zr(e,x=>{x.config||(x.config={}),x.config.bucket=f});t(m)}}),l.jsx("div",{className:"text-red-600 text-sm mt-1",children:n==null?void 0:n.bucket}),l.jsx(Vt,{children:s("domain.deployment.form.cdn_domain.label")}),l.jsx(pe,{placeholder:s("domain.deployment.form.cdn_domain.label"),className:"w-full mt-1",value:(u=e==null?void 0:e.config)==null?void 0:u.domain,onChange:d=>{const f=d.target.value,h=o.safeParse(f);h.success?r({...n,domain:""}):r({...n,domain:JSON.parse(h.error.message)[0].message});const m=Zr(e,x=>{x.config||(x.config={}),x.config.domain=f});t(m)}}),l.jsx("div",{className:"text-red-600 text-sm mt-1",children:n==null?void 0:n.domain})]})})},$B=()=>{var r;const{deploy:e,setDeploy:t}=Ha(),{setError:n}=Ha();return y.useEffect(()=>{n({})},[]),l.jsx(l.Fragment,{children:l.jsx(OB,{variables:(r=e==null?void 0:e.config)==null?void 0:r.variables,onValueChange:s=>{const o=Zr(e,i=>{i.config||(i.config={}),i.config.variables=s});t(o)}})})},UB=({className:e,trigger:t})=>{const{config:{emails:n},setEmails:r}=ln(),[s,o]=y.useState(!1),{t:i}=Ye(),a=ce.object({email:ce.string().email("common.errmsg.email_invalid")}),c=cn({resolver:un(a),defaultValues:{email:""}}),u=async d=>{if(n.content.emails.includes(d.email)){c.setError("email",{message:"common.errmsg.email_duplicate"});return}const f=[...n.content.emails,d.email];try{const h=await il({...n,name:"emails",content:{emails:f}});r(h),c.reset(),c.clearErrors(),o(!1)}catch(h){Object.entries(h.response.data).forEach(([x,p])=>{c.setError(x,{type:"manual",message:p.message})})}};return l.jsxs(ll,{onOpenChange:o,open:s,children:[l.jsx(cl,{asChild:!0,className:re(e),children:t}),l.jsxs(Ni,{className:"sm:max-w-[600px] w-full dark:text-stone-200",children:[l.jsx(Ti,{children:l.jsx(Pi,{children:i("domain.application.form.email.add")})}),l.jsx("div",{className:"container py-3",children:l.jsx(dn,{...c,children:l.jsxs("form",{onSubmit:d=>{d.stopPropagation(),c.handleSubmit(u)(d)},className:"space-y-8",children:[l.jsx(ke,{control:c.control,name:"email",render:({field:d})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:i("domain.application.form.email.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:i("common.errmsg.email_empty"),...d,type:"email"})}),l.jsx(ye,{})]})}),l.jsx("div",{className:"flex justify-end",children:l.jsx(Me,{type:"submit",children:i("common.save")})})]})})})]})]})},iT={domain:"common.text.domain",ip:"common.text.ip",dns:"common.text.dns"},Jb=({value:e,className:t,onValueChange:n,valueType:r="domain"})=>{const[s,o]=y.useState([]),{t:i}=Ye();y.useMemo(()=>{e&&o(e.split(";"))},[e]),y.useEffect(()=>{(()=>{n(s.join(";"))})()},[s]);const a=d=>{s.includes(d)||o([...s,d])},c=(d,f)=>{const h=[...s];h[d]=f,o(h)},u=d=>{const f=[...s];f.splice(d,1),o(f)};return l.jsx(l.Fragment,{children:l.jsxs("div",{className:re(t),children:[l.jsxs(Ce,{className:"flex justify-between items-center",children:[l.jsx("div",{children:i(iT[r])}),l.jsx(ur,{when:s.length>0,children:l.jsx(mp,{op:"add",onValueChange:d=>{a(d)},valueType:r,value:"",trigger:l.jsxs("div",{className:"flex items-center text-primary",children:[l.jsx(di,{size:16,className:"cursor-pointer "}),l.jsx("div",{className:"text-sm ",children:i("common.add")})]})})})]}),l.jsx(je,{children:l.jsx(ur,{when:s.length>0,fallback:l.jsxs("div",{className:"border rounded-md p-3 text-sm mt-2 flex flex-col items-center",children:[l.jsx("div",{className:"text-muted-foreground",children:i("common.text."+r+".empty")}),l.jsx(mp,{value:"",trigger:i("common.add"),onValueChange:a,valueType:r})]}),children:l.jsx("div",{className:"border rounded-md p-3 text-sm mt-2 text-gray-700 space-y-2 dark:text-white dark:border-stone-700 dark:bg-stone-950",children:s.map((d,f)=>l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsx("div",{children:d}),l.jsxs("div",{className:"flex space-x-2",children:[l.jsx(mp,{op:"edit",valueType:r,trigger:l.jsx(sv,{size:16,className:"cursor-pointer text-gray-600 dark:text-white"}),value:d,onValueChange:h=>{c(f,h)}}),l.jsx(ov,{size:16,className:"cursor-pointer",onClick:()=>{u(f)}})]})]},f))})})})]})})},mp=({trigger:e,value:t,onValueChange:n,op:r="add",valueType:s})=>{const[o,i]=y.useState(""),[a,c]=y.useState(!1),[u,d]=y.useState(""),{t:f}=Ye();y.useEffect(()=>{i(t)},[t]);const h=ce.string().regex(/^(?:\*\.)?([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}$/,{message:f("common.errmsg.domain_invalid")}),m=ce.string().ip({message:f("common.errmsg.ip_invalid")}),x={domain:h,dns:m,host:m},p=y.useCallback(()=>{const g=x[s].safeParse(o);if(!g.success){d(JSON.parse(g.error.message)[0].message);return}i(""),c(!1),d(""),n(o)},[o]);return l.jsxs(ll,{open:a,onOpenChange:w=>{c(w)},children:[l.jsx(cl,{className:"text-primary",children:e}),l.jsxs(Ni,{className:"dark:text-white",children:[l.jsx(Ti,{children:l.jsx(Pi,{className:"dark:text-white",children:f(iT[s])})}),l.jsx(pe,{value:o,className:"dark:text-white",onChange:w=>{i(w.target.value)}}),l.jsx(ur,{when:u.length>0,children:l.jsx("div",{className:"text-red-500 text-sm",children:u})}),l.jsx(Qh,{children:l.jsx(Me,{onClick:()=>{p()},children:f(r==="add"?"common.add":"common.confirm")})})]})]})},VB=()=>{const{config:{accesses:e,emails:t}}=ln(),[n,r]=y.useState({}),s=Ir(),{t:o}=Ye(),[i,a]=y.useState("apply");y.useEffect(()=>{const x=new URLSearchParams(s.search).get("id");x&&(async()=>{const w=await GU(x);r(w)})()},[s.search]);const c=ce.object({id:ce.string().optional(),domain:ce.string().min(1,{message:"common.errmsg.domain_invalid"}),email:ce.string().email("common.errmsg.email_invalid").optional(),access:ce.string().regex(/^[a-zA-Z0-9]+$/,{message:"domain.application.form.access.errmsg.empty"}),nameservers:ce.string().optional(),timeout:ce.number().optional()}),u=cn({resolver:un(c),defaultValues:{id:"",domain:"",email:"",access:"",nameservers:"",timeout:60}});y.useEffect(()=>{var m,x,p,w;n&&u.reset({id:n.id,domain:n.domain,email:(m=n.applyConfig)==null?void 0:m.email,access:(x=n.applyConfig)==null?void 0:x.access,nameservers:(p=n.applyConfig)==null?void 0:p.nameservers,timeout:(w=n.applyConfig)==null?void 0:w.timeout})},[n,u]);const{toast:d}=zr(),f=async m=>{const x={id:m.id,crontab:"0 0 * * *",domain:m.domain,email:m.email,access:m.access,applyConfig:{email:m.email??"",access:m.access,nameservers:m.nameservers,timeout:m.timeout}};try{const p=await mf(x);let w=o("domain.application.form.domain.changed.message");x.id==""&&(w=o("domain.application.form.domain.added.message")),d({title:o("common.save.succeeded.message"),description:w}),n!=null&&n.id||a("deploy"),r({...p})}catch(p){Object.entries(p.response.data).forEach(([g,v])=>{u.setError(g,{type:"manual",message:v.message})});return}},h=async m=>{const x={...n,deployConfig:m};try{const p=await mf(x);let w=o("domain.application.form.domain.changed.message");x.id==""&&(w=o("domain.application.form.domain.added.message")),d({title:o("common.save.succeeded.message"),description:w}),n!=null&&n.id||a("deploy"),r({...p})}catch(p){Object.entries(p.response.data).forEach(([g,v])=>{u.setError(g,{type:"manual",message:v.message})});return}};return l.jsx(l.Fragment,{children:l.jsxs("div",{className:"",children:[l.jsx(Px,{}),l.jsx("div",{className:" h-5 text-muted-foreground",children:l.jsx(WN,{children:l.jsxs(HN,{children:[l.jsx($g,{children:l.jsx(YN,{href:"#/domains",children:o("domain.page.title")})}),l.jsx(GN,{}),l.jsx($g,{children:l.jsx(KN,{children:n!=null&&n.id?o("domain.edit"):o("domain.add")})})]})})}),l.jsxs("div",{className:"mt-5 flex w-full justify-center md:space-x-10 flex-col md:flex-row",children:[l.jsxs("div",{className:"w-full md:w-[200px] text-muted-foreground space-x-3 md:space-y-3 flex-row md:flex-col flex md:mt-5",children:[l.jsx("div",{className:re("cursor-pointer text-right",i==="apply"?"text-primary":""),onClick:()=>{a("apply")},children:o("domain.application.tab")}),l.jsx("div",{className:re("cursor-pointer text-right",i==="deploy"?"text-primary":""),onClick:()=>{if(!(n!=null&&n.id)){d({title:o("domain.application.unsaved.message"),description:o("domain.application.unsaved.message"),variant:"destructive"});return}a("deploy")},children:o("domain.deployment.tab")})]}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("div",{className:re("w-full md:w-[35em] p-5 rounded mt-3 md:mt-0",i=="deploy"&&"hidden"),children:l.jsx(dn,{...u,children:l.jsxs("form",{onSubmit:u.handleSubmit(f),className:"space-y-8 dark:text-stone-200",children:[l.jsx(ke,{control:u.control,name:"domain",render:({field:m})=>l.jsxs(Se,{children:[l.jsx(l.Fragment,{children:l.jsx(Jb,{value:m.value,valueType:"domain",onValueChange:x=>{u.setValue("domain",x)}})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:u.control,name:"email",render:({field:m})=>l.jsxs(Se,{children:[l.jsxs(Ce,{className:"flex w-full justify-between",children:[l.jsx("div",{children:o("domain.application.form.email.label")+" "+o("domain.application.form.email.tips")}),l.jsx(UB,{trigger:l.jsxs("div",{className:"font-normal text-primary hover:underline cursor-pointer flex items-center",children:[l.jsx(di,{size:14}),o("common.add")]})})]}),l.jsx(je,{children:l.jsxs(Fa,{...m,value:m.value,onValueChange:x=>{u.setValue("email",x)},children:[l.jsx(yi,{children:l.jsx($a,{placeholder:o("domain.application.form.email.errmsg.empty")})}),l.jsx(vi,{children:l.jsxs(Wc,{children:[l.jsx(Ua,{children:o("domain.application.form.email.list")}),t.content.emails.map(x=>l.jsx(Ao,{value:x,children:l.jsx("div",{children:x})},x))]})})]})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:u.control,name:"access",render:({field:m})=>l.jsxs(Se,{children:[l.jsxs(Ce,{className:"flex w-full justify-between",children:[l.jsx("div",{children:o("domain.application.form.access.label")}),l.jsx(da,{trigger:l.jsxs("div",{className:"font-normal text-primary hover:underline cursor-pointer flex items-center",children:[l.jsx(di,{size:14}),o("common.add")]}),op:"add"})]}),l.jsx(je,{children:l.jsxs(Fa,{...m,value:m.value,onValueChange:x=>{u.setValue("access",x)},children:[l.jsx(yi,{children:l.jsx($a,{placeholder:o("domain.application.form.access.placeholder")})}),l.jsx(vi,{children:l.jsxs(Wc,{children:[l.jsx(Ua,{children:o("domain.application.form.access.list")}),e.filter(x=>x.usage!="deploy").map(x=>{var p;return l.jsx(Ao,{value:x.id,children:l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx("img",{className:"w-6",src:(p=Rs.get(x.configType))==null?void 0:p[1]}),l.jsx("div",{children:x.name})]})},x.id)})]})})]})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:u.control,name:"timeout",render:({field:m})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:o("domain.application.form.timeout.label")}),l.jsx(je,{children:l.jsx(pe,{type:"number",placeholder:o("ddomain.application.form.timeout.placeholder"),...m,value:m.value,onChange:x=>{u.setValue("timeout",parseInt(x.target.value))}})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:u.control,name:"nameservers",render:({field:m})=>l.jsxs(Se,{children:[l.jsx(Jb,{value:m.value??"",onValueChange:x=>{u.setValue("nameservers",x)},valueType:"dns"}),l.jsx(ye,{})]})}),l.jsx("div",{className:"flex justify-end",children:l.jsx(Me,{type:"submit",children:n!=null&&n.id?o("common.save"):o("common.next")})})]})})}),l.jsx("div",{className:re("flex flex-col space-y-5 w-full md:w-[35em]",i=="apply"&&"hidden"),children:l.jsx(MB,{deploys:(n==null?void 0:n.deployConfig)??[],onChange:m=>{h(m)}})})]})]})]})})};var Yx="Tabs",[BB,JH]=on(Yx,[nl]),aT=nl(),[WB,Kx]=BB(Yx),lT=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:o,orientation:i="horizontal",dir:a,activationMode:c="automatic",...u}=e,d=Si(a),[f,h]=Gn({prop:r,onChange:s,defaultProp:o});return l.jsx(WB,{scope:n,baseId:Bn(),value:f,onValueChange:h,orientation:i,dir:d,activationMode:c,children:l.jsx(Pe.div,{dir:d,"data-orientation":i,...u,ref:t})})});lT.displayName=Yx;var cT="TabsList",uT=y.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...s}=e,o=Kx(cT,n),i=aT(n);return l.jsx(kv,{asChild:!0,...i,orientation:o.orientation,dir:o.dir,loop:r,children:l.jsx(Pe.div,{role:"tablist","aria-orientation":o.orientation,...s,ref:t})})});uT.displayName=cT;var dT="TabsTrigger",fT=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...o}=e,i=Kx(dT,n),a=aT(n),c=pT(i.baseId,r),u=gT(i.baseId,r),d=r===i.value;return l.jsx(Cv,{asChild:!0,...a,focusable:!s,active:d,children:l.jsx(Pe.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:c,...o,ref:t,onMouseDown:ue(e.onMouseDown,f=>{!s&&f.button===0&&f.ctrlKey===!1?i.onValueChange(r):f.preventDefault()}),onKeyDown:ue(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&i.onValueChange(r)}),onFocus:ue(e.onFocus,()=>{const f=i.activationMode!=="manual";!d&&!s&&f&&i.onValueChange(r)})})})});fT.displayName=dT;var hT="TabsContent",mT=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:s,children:o,...i}=e,a=Kx(hT,n),c=pT(a.baseId,r),u=gT(a.baseId,r),d=r===a.value,f=y.useRef(d);return y.useEffect(()=>{const h=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(h)},[]),l.jsx(an,{present:s||d,children:({present:h})=>l.jsx(Pe.div,{"data-state":d?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":c,hidden:!h,id:u,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:h&&o})})});mT.displayName=hT;function pT(e,t){return`${e}-trigger-${t}`}function gT(e,t){return`${e}-content-${t}`}var HB=lT,yT=uT,vT=fT,xT=mT;const wT=HB,Gx=y.forwardRef(({className:e,...t},n)=>l.jsx(yT,{ref:n,className:re("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Gx.displayName=yT.displayName;const Qo=y.forwardRef(({className:e,...t},n)=>l.jsx(vT,{ref:n,className:re("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));Qo.displayName=vT.displayName;const If=y.forwardRef(({className:e,...t},n)=>l.jsx(xT,{ref:n,className:re("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));If.displayName=xT.displayName;const bT=y.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:re("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));bT.displayName="Card";const _T=y.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:re("flex flex-col space-y-1.5 p-6",e),...t}));_T.displayName="CardHeader";const ST=y.forwardRef(({className:e,...t},n)=>l.jsx("h3",{ref:n,className:re("text-2xl font-semibold leading-none tracking-tight",e),...t}));ST.displayName="CardTitle";const kT=y.forwardRef(({className:e,...t},n)=>l.jsx("p",{ref:n,className:re("text-sm text-muted-foreground",e),...t}));kT.displayName="CardDescription";const CT=y.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:re("p-6 pt-0",e),...t}));CT.displayName="CardContent";const jT=y.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:re("flex items-center p-6 pt-0",e),...t}));jT.displayName="CardFooter";const $s=e=>e instanceof Error?e.message:typeof e=="object"&&e!==null&&"message"in e?String(e.message):typeof e=="string"?e:"Something went wrong",YB=()=>{const{config:{accessGroups:e},reloadAccessGroups:t}=ln(),{toast:n}=zr(),r=Jn(),{t:s}=Ye(),o=async a=>{try{await b$(a),t()}catch(c){n({title:s("common.delete.failed.message"),description:$s(c),variant:"destructive"});return}},i=()=>{r("/access")};return l.jsxs("div",{className:"mt-10",children:[l.jsx(ur,{when:e.length==0,children:l.jsx(l.Fragment,{children:l.jsxs("div",{className:"flex flex-col items-center mt-10",children:[l.jsx("span",{className:"bg-orange-100 p-5 rounded-full",children:l.jsx(Ww,{size:40,className:"text-primary"})}),l.jsx("div",{className:"text-center text-sm text-muted-foreground mt-3",children:s("access.group.domains.nodata")}),l.jsx(Vx,{trigger:l.jsx(Me,{children:s("access.group.add")}),className:"mt-3"})]})})}),l.jsx(tm,{className:"h-[75vh] overflow-hidden",children:l.jsx("div",{className:"flex gap-5 flex-wrap",children:e.map(a=>l.jsxs(bT,{className:"w-full md:w-[350px]",children:[l.jsxs(_T,{children:[l.jsx(ST,{children:a.name}),l.jsx(kT,{children:s("access.group.total",{total:a.expand?a.expand.access.length:0})})]}),l.jsx(CT,{className:"min-h-[180px]",children:a.expand?l.jsx(l.Fragment,{children:a.expand.access.slice(0,3).map(c=>l.jsx("div",{className:"flex flex-col mb-3",children:l.jsxs("div",{className:"flex items-center",children:[l.jsx("div",{className:"",children:l.jsx("img",{src:Yb(c.configType)[1],alt:"provider",className:"w-8 h-8"})}),l.jsxs("div",{className:"ml-3",children:[l.jsx("div",{className:"text-sm font-semibold text-gray-700 dark:text-gray-200",children:c.name}),l.jsx("div",{className:"text-xs text-muted-foreground",children:Yb(c.configType)[0]})]})]})},c.id))}):l.jsx(l.Fragment,{children:l.jsxs("div",{className:"flex text-gray-700 dark:text-gray-200 items-center",children:[l.jsx("div",{children:l.jsx(Ww,{size:40})}),l.jsx("div",{className:"ml-2",children:s("access.group.nodata")})]})})}),l.jsx(jT,{children:l.jsxs("div",{className:"flex justify-end w-full",children:[l.jsx(ur,{when:!!(a.expand&&a.expand.access.length>0),children:l.jsx("div",{children:l.jsx(Me,{size:"sm",variant:"link",onClick:()=>{r(`/access?accessGroupId=${a.id}&tab=access`,{replace:!0})},children:s("access.group.domains")})})}),l.jsx(ur,{when:!a.expand||a.expand.access.length==0,children:l.jsx("div",{children:l.jsx(Me,{size:"sm",onClick:i,children:s("access.authorization.add")})})}),l.jsx("div",{className:"ml-3",children:l.jsxs(Sx,{children:[l.jsx(kx,{asChild:!0,children:l.jsx(Me,{variant:"destructive",size:"sm",children:s("common.delete")})}),l.jsxs(Mh,{children:[l.jsxs(Lh,{children:[l.jsx(Fh,{className:"dark:text-gray-200",children:s("access.group.delete")}),l.jsx($h,{children:s("access.group.delete.confirm")})]}),l.jsxs(zh,{children:[l.jsx(Vh,{className:"dark:text-gray-200",children:s("common.cancel")}),l.jsx(Uh,{onClick:()=>{o(a.id?a.id:"")},children:s("common.confirm")})]})]})]})})]})})]}))})})]})},KB=()=>{const{t:e}=Ye(),{config:t,deleteAccess:n}=ln(),{accesses:r}=t,s=10,o=Math.ceil(r.length/s),i=Jn(),a=Ir(),c=new URLSearchParams(a.search),u=c.get("page"),d=u?Number(u):1,f=c.get("tab"),h=c.get("accessGroupId"),m=(d-1)*s,x=m+s,p=async g=>{const v=await w$(g);n(v.id)},w=g=>{c.set("tab",g),i({search:c.toString()})};return l.jsxs("div",{className:"",children:[l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsx("div",{className:"text-muted-foreground",children:e("access.page.title")}),f!="access_group"?l.jsx(da,{trigger:l.jsx(Me,{children:e("access.authorization.add")}),op:"add"}):l.jsx(Vx,{trigger:l.jsx(Me,{children:e("access.group.add")})})]}),l.jsxs(wT,{defaultValue:f||"access",value:f||"access",className:"w-full mt-5",children:[l.jsxs(Gx,{className:"space-x-5 px-3",children:[l.jsx(Qo,{value:"access",onClick:()=>{w("access")},children:e("access.authorization.tab")}),l.jsx(Qo,{value:"access_group",onClick:()=>{w("access_group")},children:e("access.group.tab")})]}),l.jsx(If,{value:"access",children:r.length===0?l.jsxs("div",{className:"flex flex-col items-center mt-10",children:[l.jsx("span",{className:"bg-orange-100 p-5 rounded-full",children:l.jsx(sI,{size:40,className:"text-primary"})}),l.jsx("div",{className:"text-center text-sm text-muted-foreground mt-3",children:e("access.authorization.nodata")}),l.jsx(da,{trigger:l.jsx(Me,{children:e("access.authorization.add")}),op:"add",className:"mt-3"})]}):l.jsxs(l.Fragment,{children:[l.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:[l.jsx("div",{className:"w-48",children:e("common.text.name")}),l.jsx("div",{className:"w-48",children:e("common.text.provider")}),l.jsx("div",{className:"w-60",children:e("common.text.created_at")}),l.jsx("div",{className:"w-60",children:e("common.text.updated_at")}),l.jsx("div",{className:"grow",children:e("common.text.operations")})]}),r.filter(g=>h?g.group==h:!0).slice(m,x).map(g=>{var v,b;return l.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:[l.jsx("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center",children:g.name}),l.jsxs("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center space-x-2",children:[l.jsx("img",{src:(v=Rs.get(g.configType))==null?void 0:v[1],className:"w-6"}),l.jsx("div",{children:e(((b=Rs.get(g.configType))==null?void 0:b[0])||"")})]}),l.jsx("div",{className:"sm:w-60 w-full pt-1 sm:pt-0 flex items-center",children:g.created&&Ia(g.created)}),l.jsx("div",{className:"sm:w-60 w-full pt-1 sm:pt-0 flex items-center",children:g.updated&&Ia(g.updated)}),l.jsxs("div",{className:"flex items-center grow justify-start pt-1 sm:pt-0",children:[l.jsx(da,{trigger:l.jsx(Me,{variant:"link",className:"p-0",children:e("common.edit")}),op:"edit",data:g}),l.jsx(br,{orientation:"vertical",className:"h-4 mx-2"}),l.jsx(da,{trigger:l.jsx(Me,{variant:"link",className:"p-0",children:e("common.copy")}),op:"copy",data:g}),l.jsx(br,{orientation:"vertical",className:"h-4 mx-2"}),l.jsxs(Sx,{children:[l.jsx(kx,{asChild:!0,children:l.jsx(Me,{variant:"link",className:"p-0",children:e("common.delete")})}),l.jsxs(Mh,{children:[l.jsxs(Lh,{children:[l.jsx(Fh,{className:"dark:text-gray-200",children:e("access.authorization.delete")}),l.jsx($h,{children:e("access.authorization.delete.confirm")})]}),l.jsxs(zh,{children:[l.jsx(Vh,{className:"dark:text-gray-200",children:e("common.cancel")}),l.jsx(Uh,{onClick:()=>{p(g)},children:e("common.confirm")})]})]})]})]})]},g.id)}),l.jsx(xE,{totalPages:o,currentPage:d,onPageChange:g=>{c.set("page",g.toString()),i({search:c.toString()})}})]})}),l.jsx(If,{value:"access_group",children:l.jsx(YB,{})})]})]})},ET=async e=>{let t=1;e.page&&(t=e.page);let n=50;e.perPage&&(n=e.perPage);let r="domain!=null";return e.domain&&(r=`domain="${e.domain}"`),await ot().collection("deployments").getList(t,n,{filter:r,sort:"-deployedAt",expand:"domain"})},GB=()=>{const e=Jn(),[t,n]=y.useState(),[r]=SO(),{t:s}=Ye(),o=r.get("domain");return y.useEffect(()=>{(async()=>{const a={};o&&(a.domain=o);const c=await ET(a);n(c.items)})()},[o]),l.jsxs(tm,{className:"h-[80vh] overflow-hidden",children:[l.jsx("div",{className:"text-muted-foreground",children:s("history.page.title")}),t!=null&&t.length?l.jsxs(l.Fragment,{children:[l.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:[l.jsx("div",{className:"w-48",children:s("history.props.domain")}),l.jsx("div",{className:"w-24",children:s("history.props.status")}),l.jsx("div",{className:"w-56",children:s("history.props.stage")}),l.jsx("div",{className:"w-56 sm:ml-2 text-center",children:s("history.props.last_execution_time")}),l.jsx("div",{className:"grow",children:s("common.text.operations")})]}),t==null?void 0:t.map(i=>{var a,c;return l.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:[l.jsx("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center",children:(a=i.expand.domain)==null?void 0:a.domain.split(";").map(u=>l.jsxs(l.Fragment,{children:[u,l.jsx("br",{})]}))}),l.jsx("div",{className:"sm:w-24 w-full pt-1 sm:pt-0 flex items-center",children:l.jsx(_x,{deployment:i})}),l.jsx("div",{className:"sm:w-56 w-full pt-1 sm:pt-0 flex items-center",children:l.jsx(bx,{phase:i.phase,phaseSuccess:i.phaseSuccess})}),l.jsx("div",{className:"sm:w-56 w-full pt-1 sm:pt-0 flex items-center sm:justify-center",children:Ia(i.deployedAt)}),l.jsx("div",{className:"flex items-center grow justify-start pt-1 sm:pt-0 sm:ml-2",children:l.jsxs(Wv,{children:[l.jsx(Hv,{asChild:!0,children:l.jsx(Me,{variant:"link",className:"p-0",children:s("history.log")})}),l.jsxs(wh,{className:"sm:max-w-5xl",children:[l.jsx(Yv,{children:l.jsxs(Kv,{children:[(c=i.expand.domain)==null?void 0:c.domain,"-",i.id,s("history.log")]})}),l.jsxs("div",{className:"bg-gray-950 text-stone-100 p-5 text-sm h-[80dvh]",children:[i.log.check&&l.jsx(l.Fragment,{children:i.log.check.map(u=>l.jsxs("div",{className:"flex flex-col mt-2",children:[l.jsxs("div",{className:"flex",children:[l.jsxs("div",{children:["[",u.time,"]"]}),l.jsx("div",{className:"ml-2",children:u.message})]}),u.error&&l.jsx("div",{className:"mt-1 text-red-600",children:u.error})]}))}),i.log.apply&&l.jsx(l.Fragment,{children:i.log.apply.map(u=>l.jsxs("div",{className:"flex flex-col mt-2",children:[l.jsxs("div",{className:"flex",children:[l.jsxs("div",{children:["[",u.time,"]"]}),l.jsx("div",{className:"ml-2",children:u.message})]}),u.info&&u.info.map(d=>l.jsx("div",{className:"mt-1 text-green-600",children:d})),u.error&&l.jsx("div",{className:"mt-1 text-red-600",children:u.error})]}))}),i.log.deploy&&l.jsx(l.Fragment,{children:i.log.deploy.map(u=>l.jsxs("div",{className:"flex flex-col mt-2",children:[l.jsxs("div",{className:"flex",children:[l.jsxs("div",{children:["[",u.time,"]"]}),l.jsx("div",{className:"ml-2",children:u.message})]}),u.error&&l.jsx("div",{className:"mt-1 text-red-600",children:u.error})]}))})]})]})]})})]},i.id)})]}):l.jsx(l.Fragment,{children:l.jsxs(im,{className:"max-w-[40em] mx-auto mt-20",children:[l.jsx(Hx,{children:s("common.text.nodata")}),l.jsxs(am,{children:[l.jsxs("div",{className:"flex items-center mt-5",children:[l.jsx("div",{children:l.jsx(ok,{className:"text-yellow-400",size:36})}),l.jsxs("div",{className:"ml-2",children:[" ",s("history.nodata")]})]}),l.jsx("div",{className:"mt-2 flex justify-end",children:l.jsx(Me,{onClick:()=>{e("/")},children:s("domain.add")})})]})]})})]})},ZB=ce.object({username:ce.string().email({message:"login.username.errmsg.invalid"}),password:ce.string().min(10,{message:"login.password.errmsg.invalid"})}),qB=()=>{const{t:e}=Ye(),t=cn({resolver:un(ZB),defaultValues:{username:"",password:""}}),n=async s=>{try{await ot().admins.authWithPassword(s.username,s.password),r("/")}catch(o){const i=$s(o);t.setError("username",{message:i}),t.setError("password",{message:i})}},r=Jn();return l.jsxs("div",{className:"max-w-[35em] border dark:border-stone-500 mx-auto mt-32 p-10 rounded-md shadow-md",children:[l.jsx("div",{className:"flex justify-center mb-10",children:l.jsx("img",{src:"/vite.svg",className:"w-16"})}),l.jsx(dn,{...t,children:l.jsxs("form",{onSubmit:t.handleSubmit(n),className:"space-y-8 dark:text-stone-200",children:[l.jsx(ke,{control:t.control,name:"username",render:({field:s})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:e("login.username.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:e("login.username.placeholder"),...s})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:t.control,name:"password",render:({field:s})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:e("login.password.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:e("login.password.placeholder"),...s,type:"password"})}),l.jsx(ye,{})]})}),l.jsx("div",{className:"flex justify-end",children:l.jsx(Me,{type:"submit",children:e("login.submit")})})]})})]})},XB=()=>ot().authStore.isValid&&ot().authStore.isAdmin?l.jsx(KS,{to:"/"}):l.jsxs("div",{className:"container",children:[l.jsx(tv,{}),l.jsx(oE,{})]}),QB=ce.object({oldPassword:ce.string().min(10,{message:"settings.password.password.errmsg.length"}),newPassword:ce.string().min(10,{message:"settings.password.password.errmsg.length"}),confirmPassword:ce.string().min(10,{message:"settings.password.password.errmsg.length"})}).refine(e=>e.newPassword===e.confirmPassword,{message:"settings.password.password.errmsg.not_matched",path:["confirmPassword"]}),JB=()=>{const{toast:e}=zr(),t=Jn(),{t:n}=Ye(),r=cn({resolver:un(QB),defaultValues:{oldPassword:"",newPassword:"",confirmPassword:""}}),s=async o=>{var i,a;try{await ot().admins.authWithPassword((i=ot().authStore.model)==null?void 0:i.email,o.oldPassword)}catch(c){const u=$s(c);r.setError("oldPassword",{message:u})}try{await ot().admins.update((a=ot().authStore.model)==null?void 0:a.id,{password:o.newPassword,passwordConfirm:o.confirmPassword}),ot().authStore.clear(),e({title:n("settings.password.changed.message"),description:n("settings.account.relogin.message")}),setTimeout(()=>{t("/login")},500)}catch(c){const u=$s(c);e({title:n("settings.password.failed.message"),description:u,variant:"destructive"})}};return l.jsx(l.Fragment,{children:l.jsx("div",{className:"w-full md:max-w-[35em]",children:l.jsx(dn,{...r,children:l.jsxs("form",{onSubmit:r.handleSubmit(s),className:"space-y-8 dark:text-stone-200",children:[l.jsx(ke,{control:r.control,name:"oldPassword",render:({field:o})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:n("settings.password.current_password.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:n("settings.password.current_password.placeholder"),...o,type:"password"})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:r.control,name:"newPassword",render:({field:o})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:n("settings.password.new_password.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:n("settings.password.new_password.placeholder"),...o,type:"password"})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:r.control,name:"confirmPassword",render:({field:o})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:n("settings.password.confirm_password.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:n("settings.password.confirm_password.placeholder"),...o,type:"password"})}),l.jsx(ye,{})]})}),l.jsx("div",{className:"flex justify-end",children:l.jsx(Me,{type:"submit",children:n("common.update")})})]})})})})},eW=()=>{const e=Ir(),[t,n]=y.useState("account"),r=Jn(),{t:s}=Ye();return y.useEffect(()=>{const i=e.pathname.split("/")[2];n(i)},[e]),l.jsxs("div",{children:[l.jsx(Px,{}),l.jsx("div",{className:"text-muted-foreground border-b dark:border-stone-500 py-5",children:s("settings.page.title")}),l.jsx("div",{className:"w-full mt-5 p-0 md:p-3 flex justify-center",children:l.jsxs(wT,{defaultValue:"account",className:"w-full",value:t,children:[l.jsxs(Gx,{className:"mx-auto",children:[l.jsxs(Qo,{value:"account",onClick:()=>{r("/setting/account")},className:"px-5",children:[l.jsx(hI,{size:14}),l.jsx("div",{className:"ml-1",children:s("settings.account.tab")})]}),l.jsxs(Qo,{value:"password",onClick:()=>{r("/setting/password")},className:"px-5",children:[l.jsx(rI,{size:14}),l.jsx("div",{className:"ml-1",children:s("settings.password.tab")})]}),l.jsxs(Qo,{value:"notify",onClick:()=>{r("/setting/notify")},className:"px-5",children:[l.jsx(aI,{size:14}),l.jsx("div",{className:"ml-1",children:s("settings.notification.tab")})]}),l.jsxs(Qo,{value:"ssl-provider",onClick:()=>{r("/setting/ssl-provider")},className:"px-5",children:[l.jsx(uI,{size:14}),l.jsx("div",{className:"ml-1",children:s("settings.ca.tab")})]})]}),l.jsx(If,{value:t,children:l.jsx("div",{className:"mt-5 w-full md:w-[45em]",children:l.jsx(tv,{})})})]})})]})},tW=()=>{const[e,t]=y.useState(),[n,r]=y.useState(),s=Jn(),{t:o}=Ye();return y.useEffect(()=>{(async()=>{const a=await KU();t(a)})()},[]),y.useEffect(()=>{(async()=>{const c=await ET({perPage:8});r(c.items)})()},[]),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("div",{className:"flex justify-between items-center",children:l.jsx("div",{className:"text-muted-foreground",children:o("dashboard.page.title")})}),l.jsxs("div",{className:"flex mt-10 gap-5 flex-col flex-wrap md:flex-row",children:[l.jsxs("div",{className:"w-full md:w-[250px] 3xl:w-[300px] flex items-center rounded-md p-3 shadow-lg border",children:[l.jsx("div",{className:"p-3",children:l.jsx(dI,{size:48,strokeWidth:1,className:"text-blue-400"})}),l.jsxs("div",{children:[l.jsx("div",{className:"text-muted-foreground font-semibold",children:o("dashboard.statistics.all")}),l.jsxs("div",{className:"flex items-baseline",children:[l.jsx("div",{className:"text-3xl text-stone-700 dark:text-stone-200",children:e!=null&&e.total?l.jsx(wn,{to:"/domains",className:"hover:underline",children:e==null?void 0:e.total}):0}),l.jsx("div",{className:"ml-1 text-stone-700 dark:text-stone-200",children:o("dashboard.statistics.unit")})]})]})]}),l.jsxs("div",{className:"w-full md:w-[250px] 3xl:w-[300px] flex items-center rounded-md p-3 shadow-lg border",children:[l.jsx("div",{className:"p-3",children:l.jsx(QO,{size:48,strokeWidth:1,className:"text-red-400"})}),l.jsxs("div",{children:[l.jsx("div",{className:"text-muted-foreground font-semibold",children:o("dashboard.statistics.near_expired")}),l.jsxs("div",{className:"flex items-baseline",children:[l.jsx("div",{className:"text-3xl text-stone-700 dark:text-stone-200",children:e!=null&&e.expired?l.jsx(wn,{to:"/domains?state=expired",className:"hover:underline",children:e==null?void 0:e.expired}):0}),l.jsx("div",{className:"ml-1 text-stone-700 dark:text-stone-200",children:o("dashboard.statistics.unit")})]})]})]}),l.jsxs("div",{className:"border w-full md:w-[250px] 3xl:w-[300px] flex items-center rounded-md p-3 shadow-lg",children:[l.jsx("div",{className:"p-3",children:l.jsx(iI,{size:48,strokeWidth:1,className:"text-green-400"})}),l.jsxs("div",{children:[l.jsx("div",{className:"text-muted-foreground font-semibold",children:o("dashboard.statistics.enabled")}),l.jsxs("div",{className:"flex items-baseline",children:[l.jsx("div",{className:"text-3xl text-stone-700 dark:text-stone-200",children:e!=null&&e.enabled?l.jsx(wn,{to:"/domains?state=enabled",className:"hover:underline",children:e==null?void 0:e.enabled}):0}),l.jsx("div",{className:"ml-1 text-stone-700 dark:text-stone-200",children:o("dashboard.statistics.unit")})]})]})]}),l.jsxs("div",{className:"border w-full md:w-[250px] 3xl:w-[300px] flex items-center rounded-md p-3 shadow-lg",children:[l.jsx("div",{className:"p-3",children:l.jsx(qO,{size:48,strokeWidth:1,className:"text-gray-400"})}),l.jsxs("div",{children:[l.jsx("div",{className:"text-muted-foreground font-semibold",children:o("dashboard.statistics.disabled")}),l.jsxs("div",{className:"flex items-baseline",children:[l.jsx("div",{className:"text-3xl text-stone-700 dark:text-stone-200",children:e!=null&&e.disabled?l.jsx(wn,{to:"/domains?state=disabled",className:"hover:underline",children:e==null?void 0:e.disabled}):0}),l.jsx("div",{className:"ml-1 text-stone-700 dark:text-stone-200",children:o("dashboard.statistics.unit")})]})]})]})]}),l.jsx("div",{className:"my-4",children:l.jsx("hr",{})}),l.jsxs("div",{children:[l.jsx("div",{className:"text-muted-foreground mt-5 text-sm",children:o("dashboard.history")}),(n==null?void 0:n.length)==0?l.jsx(l.Fragment,{children:l.jsxs(im,{className:"max-w-[40em] mt-10",children:[l.jsx(Hx,{children:o("common.text.nodata")}),l.jsxs(am,{children:[l.jsxs("div",{className:"flex items-center mt-5",children:[l.jsx("div",{children:l.jsx(ok,{className:"text-yellow-400",size:36})}),l.jsxs("div",{className:"ml-2",children:[" ",o("history.nodata")]})]}),l.jsx("div",{className:"mt-2 flex justify-end",children:l.jsx(Me,{onClick:()=>{s("/edit")},children:o("domain.add")})})]})]})}):l.jsxs(l.Fragment,{children:[l.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:[l.jsx("div",{className:"w-48",children:o("history.props.domain")}),l.jsx("div",{className:"w-24",children:o("history.props.status")}),l.jsx("div",{className:"w-56",children:o("history.props.stage")}),l.jsx("div",{className:"w-56 sm:ml-2 text-center",children:o("history.props.last_execution_time")}),l.jsx("div",{className:"grow",children:o("common.text.operations")})]}),n==null?void 0:n.map(i=>{var a,c;return l.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:[l.jsx("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center",children:(a=i.expand.domain)==null?void 0:a.domain.split(";").map(u=>l.jsxs(l.Fragment,{children:[u,l.jsx("br",{})]}))}),l.jsx("div",{className:"sm:w-24 w-full pt-1 sm:pt-0 flex items-center",children:l.jsx(_x,{deployment:i})}),l.jsx("div",{className:"sm:w-56 w-full pt-1 sm:pt-0 flex items-center",children:l.jsx(bx,{phase:i.phase,phaseSuccess:i.phaseSuccess})}),l.jsx("div",{className:"sm:w-56 w-full pt-1 sm:pt-0 flex items-center sm:justify-center",children:Ia(i.deployedAt)}),l.jsx("div",{className:"flex items-center grow justify-start pt-1 sm:pt-0 sm:ml-2",children:l.jsxs(Wv,{children:[l.jsx(Hv,{asChild:!0,children:l.jsx(Me,{variant:"link",className:"p-0",children:o("history.log")})}),l.jsxs(wh,{className:"sm:max-w-5xl",children:[l.jsx(Yv,{children:l.jsxs(Kv,{children:[(c=i.expand.domain)==null?void 0:c.domain,"-",i.id,o("history.log")]})}),l.jsxs("div",{className:"bg-gray-950 text-stone-100 p-5 text-sm h-[80dvh]",children:[i.log.check&&l.jsx(l.Fragment,{children:i.log.check.map(u=>l.jsxs("div",{className:"flex flex-col mt-2",children:[l.jsxs("div",{className:"flex",children:[l.jsxs("div",{children:["[",u.time,"]"]}),l.jsx("div",{className:"ml-2",children:u.message})]}),u.error&&l.jsx("div",{className:"mt-1 text-red-600",children:u.error})]}))}),i.log.apply&&l.jsx(l.Fragment,{children:i.log.apply.map(u=>l.jsxs("div",{className:"flex flex-col mt-2",children:[l.jsxs("div",{className:"flex",children:[l.jsxs("div",{children:["[",u.time,"]"]}),l.jsx("div",{className:"ml-2",children:u.message})]}),u.info&&u.info.map(d=>l.jsx("div",{className:"mt-1 text-green-600",children:d})),u.error&&l.jsx("div",{className:"mt-1 text-red-600",children:u.error})]}))}),i.log.deploy&&l.jsx(l.Fragment,{children:i.log.deploy.map(u=>l.jsxs("div",{className:"flex flex-col mt-2",children:[l.jsxs("div",{className:"flex",children:[l.jsxs("div",{children:["[",u.time,"]"]}),l.jsx("div",{className:"ml-2",children:u.message})]}),u.error&&l.jsx("div",{className:"mt-1 text-red-600",children:u.error})]}))})]})]})]})})]},i.id)})]})]})]})},nW=ce.object({email:ce.string().email("settings.account.email.errmsg.invalid")}),rW=()=>{var a;const{toast:e}=zr(),t=Jn(),{t:n}=Ye(),[r,s]=y.useState(!1),o=cn({resolver:un(nW),defaultValues:{email:(a=ot().authStore.model)==null?void 0:a.email}}),i=async c=>{var u;try{await ot().admins.update((u=ot().authStore.model)==null?void 0:u.id,{email:c.email}),ot().authStore.clear(),e({title:n("settings.account.email.changed.message"),description:n("settings.account.relogin.message")}),setTimeout(()=>{t("/login")},500)}catch(d){const f=$s(d);e({title:n("settings.account.email.failed.message"),description:f,variant:"destructive"})}};return l.jsx(l.Fragment,{children:l.jsx("div",{className:"w-full md:max-w-[35em]",children:l.jsx(dn,{...o,children:l.jsxs("form",{onSubmit:o.handleSubmit(i),className:"space-y-8 dark:text-stone-200",children:[l.jsx(ke,{control:o.control,name:"email",render:({field:c})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:n("settings.account.email.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:n("settings.account.email.placeholder"),...c,type:"email",onChange:u=>{s(!0),o.setValue("email",u.target.value)}})}),l.jsx(ye,{})]})}),l.jsx("div",{className:"flex justify-end",children:r?l.jsx(Me,{type:"submit",children:n("common.update")}):l.jsx(Me,{type:"submit",disabled:!0,variant:"secondary",children:n("common.update")})})]})})})})};var Zx="Collapsible",[sW,NT]=on(Zx),[oW,qx]=sW(Zx),TT=y.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:o,onOpenChange:i,...a}=e,[c=!1,u]=Gn({prop:r,defaultProp:s,onChange:i});return l.jsx(oW,{scope:n,disabled:o,contentId:Bn(),open:c,onOpenToggle:y.useCallback(()=>u(d=>!d),[u]),children:l.jsx(Pe.div,{"data-state":Qx(c),"data-disabled":o?"":void 0,...a,ref:t})})});TT.displayName=Zx;var PT="CollapsibleTrigger",RT=y.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,s=qx(PT,n);return l.jsx(Pe.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":Qx(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:t,onClick:ue(e.onClick,s.onOpenToggle)})});RT.displayName=PT;var Xx="CollapsibleContent",AT=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=qx(Xx,e.__scopeCollapsible);return l.jsx(an,{present:n||s.open,children:({present:o})=>l.jsx(iW,{...r,ref:t,present:o})})});AT.displayName=Xx;var iW=y.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:s,...o}=e,i=qx(Xx,n),[a,c]=y.useState(r),u=y.useRef(null),d=Ge(t,u),f=y.useRef(0),h=f.current,m=y.useRef(0),x=m.current,p=i.open||a,w=y.useRef(p),g=y.useRef();return y.useEffect(()=>{const v=requestAnimationFrame(()=>w.current=!1);return()=>cancelAnimationFrame(v)},[]),en(()=>{const v=u.current;if(v){g.current=g.current||{transitionDuration:v.style.transitionDuration,animationName:v.style.animationName},v.style.transitionDuration="0s",v.style.animationName="none";const b=v.getBoundingClientRect();f.current=b.height,m.current=b.width,w.current||(v.style.transitionDuration=g.current.transitionDuration,v.style.animationName=g.current.animationName),c(r)}},[i.open,r]),l.jsx(Pe.div,{"data-state":Qx(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!p,...o,ref:d,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":x?`${x}px`:void 0,...e.style},children:p&&s})});function Qx(e){return e?"open":"closed"}var aW=TT,lW=RT,cW=AT,Zs="Accordion",uW=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[Jx,dW,fW]=eu(Zs),[lm,e9]=on(Zs,[fW,NT]),e0=NT(),DT=We.forwardRef((e,t)=>{const{type:n,...r}=e,s=r,o=r;return l.jsx(Jx.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?l.jsx(gW,{...o,ref:t}):l.jsx(pW,{...s,ref:t})})});DT.displayName=Zs;var[OT,hW]=lm(Zs),[IT,mW]=lm(Zs,{collapsible:!1}),pW=We.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},collapsible:o=!1,...i}=e,[a,c]=Gn({prop:n,defaultProp:r,onChange:s});return l.jsx(OT,{scope:e.__scopeAccordion,value:a?[a]:[],onItemOpen:c,onItemClose:We.useCallback(()=>o&&c(""),[o,c]),children:l.jsx(IT,{scope:e.__scopeAccordion,collapsible:o,children:l.jsx(MT,{...i,ref:t})})})}),gW=We.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...o}=e,[i=[],a]=Gn({prop:n,defaultProp:r,onChange:s}),c=We.useCallback(d=>a((f=[])=>[...f,d]),[a]),u=We.useCallback(d=>a((f=[])=>f.filter(h=>h!==d)),[a]);return l.jsx(OT,{scope:e.__scopeAccordion,value:i,onItemOpen:c,onItemClose:u,children:l.jsx(IT,{scope:e.__scopeAccordion,collapsible:!0,children:l.jsx(MT,{...o,ref:t})})})}),[yW,cm]=lm(Zs),MT=We.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:s,orientation:o="vertical",...i}=e,a=We.useRef(null),c=Ge(a,t),u=dW(n),f=Si(s)==="ltr",h=ue(e.onKeyDown,m=>{var R;if(!uW.includes(m.key))return;const x=m.target,p=u().filter(A=>{var O;return!((O=A.ref.current)!=null&&O.disabled)}),w=p.findIndex(A=>A.ref.current===x),g=p.length;if(w===-1)return;m.preventDefault();let v=w;const b=0,_=g-1,C=()=>{v=w+1,v>_&&(v=b)},j=()=>{v=w-1,v{const{__scopeAccordion:n,value:r,...s}=e,o=cm(Mf,n),i=hW(Mf,n),a=e0(n),c=Bn(),u=r&&i.value.includes(r)||!1,d=o.disabled||e.disabled;return l.jsx(vW,{scope:n,open:u,disabled:d,triggerId:c,children:l.jsx(aW,{"data-orientation":o.orientation,"data-state":BT(u),...a,...s,ref:t,disabled:d,open:u,onOpenChange:f=>{f?i.onItemOpen(r):i.onItemClose(r)}})})});LT.displayName=Mf;var zT="AccordionHeader",FT=We.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=cm(Zs,n),o=t0(zT,n);return l.jsx(Pe.h3,{"data-orientation":s.orientation,"data-state":BT(o.open),"data-disabled":o.disabled?"":void 0,...r,ref:t})});FT.displayName=zT;var ey="AccordionTrigger",$T=We.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=cm(Zs,n),o=t0(ey,n),i=mW(ey,n),a=e0(n);return l.jsx(Jx.ItemSlot,{scope:n,children:l.jsx(lW,{"aria-disabled":o.open&&!i.collapsible||void 0,"data-orientation":s.orientation,id:o.triggerId,...a,...r,ref:t})})});$T.displayName=ey;var UT="AccordionContent",VT=We.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=cm(Zs,n),o=t0(UT,n),i=e0(n);return l.jsx(cW,{role:"region","aria-labelledby":o.triggerId,"data-orientation":s.orientation,...i,...r,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});VT.displayName=UT;function BT(e){return e?"open":"closed"}var xW=DT,wW=LT,bW=FT,WT=$T,HT=VT;const e1=xW,Fl=y.forwardRef(({className:e,...t},n)=>l.jsx(wW,{ref:n,className:re("border-b",e),...t}));Fl.displayName="AccordionItem";const $l=y.forwardRef(({className:e,children:t,...n},r)=>l.jsx(bW,{className:"flex",children:l.jsxs(WT,{ref:r,className:re("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...n,children:[t,l.jsx(rv,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));$l.displayName=WT.displayName;const Ul=y.forwardRef(({className:e,children:t,...n},r)=>l.jsx(HT,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:l.jsx("div",{className:re("pb-4 pt-0",e),children:t})}));Ul.displayName=HT.displayName;const _W=(e,t)=>{switch(t.type){case"SET_CHANNEL":{const n=t.payload.channel;return{...e,content:{...e.content,[n]:t.payload.data}}}case"SET_CHANNELS":return{...t.payload};default:return e}},YT=y.createContext({}),n0=()=>y.useContext(YT),SW=({children:e})=>{const[t,n]=y.useReducer(_W,{});y.useEffect(()=>{(async()=>{const i=await yx("notifyChannels");n({type:"SET_CHANNELS",payload:i})})()},[]);const r=y.useCallback(o=>{n({type:"SET_CHANNEL",payload:o})},[]),s=y.useCallback(o=>{n({type:"SET_CHANNELS",payload:o})},[]);return l.jsx(YT.Provider,{value:{config:t,setChannel:r,setChannels:s},children:e})},kW=()=>{const{config:e,setChannels:t}=n0(),{t:n}=Ye(),[r,s]=y.useState({id:e.id??"",name:"notifyChannels",data:{accessToken:"",secret:"",enabled:!1}});y.useEffect(()=>{const c=(()=>{const u={accessToken:"",secret:"",enabled:!1};if(!e.content)return u;const d=e.content;return d.dingtalk?d.dingtalk:u})();s({id:e.id??"",name:"dingtalk",data:c})},[e]);const{toast:o}=zr(),i=async()=>{try{const a=await il({...e,name:"notifyChannels",content:{...e.content,dingtalk:{...r.data}}});t(a),o({title:n("common.save.succeeded.message"),description:n("settings.notification.config.saved.message")})}catch(a){const c=$s(a);o({title:n("common.save.failed.message"),description:`${n("settings.notification.config.failed.message")}: ${c}`,variant:"destructive"})}};return l.jsxs("div",{children:[l.jsx(pe,{placeholder:"AccessToken",value:r.data.accessToken,onChange:a=>{s({...r,data:{...r.data,accessToken:a.target.value}})}}),l.jsx(pe,{placeholder:n("settings.notification.dingtalk.secret.placeholder"),className:"mt-2",value:r.data.secret,onChange:a=>{s({...r,data:{...r.data,secret:a.target.value}})}}),l.jsxs("div",{className:"flex items-center space-x-1 mt-2",children:[l.jsx(mu,{id:"airplane-mode",checked:r.data.enabled,onCheckedChange:()=>{s({...r,data:{...r.data,enabled:!r.data.enabled}})}}),l.jsx(Vt,{htmlFor:"airplane-mode",children:n("settings.notification.config.enable")})]}),l.jsx("div",{className:"flex justify-end mt-2",children:l.jsx(Me,{onClick:()=>{i()},children:n("common.save")})})]})},CW={title:"您有 {COUNT} 张证书即将过期",content:"有 {COUNT} 张证书即将过期,域名分别为 {DOMAINS},请保持关注!"},jW=()=>{const[e,t]=y.useState(""),[n,r]=y.useState([CW]),{toast:s}=zr(),{t:o}=Ye();y.useEffect(()=>{(async()=>{const d=await yx("templates");d.content&&(r(d.content.notifyTemplates),t(d.id?d.id:""))})()},[]);const i=u=>{const d=n[0];r([{...d,title:u}])},a=u=>{const d=n[0];r([{...d,content:u}])},c=async()=>{const u=await il({id:e,content:{notifyTemplates:n},name:"templates"});u.id&&t(u.id),s({title:o("common.save.succeeded.message"),description:o("settings.notification.template.saved.message")})};return l.jsxs("div",{children:[l.jsx(pe,{value:n[0].title,onChange:u=>{i(u.target.value)}}),l.jsx("div",{className:"text-muted-foreground text-sm mt-1",children:o("settings.notification.template.variables.tips.title")}),l.jsx(Df,{className:"mt-2",value:n[0].content,onChange:u=>{a(u.target.value)}}),l.jsx("div",{className:"text-muted-foreground text-sm mt-1",children:o("settings.notification.template.variables.tips.content")}),l.jsx("div",{className:"flex justify-end mt-2",children:l.jsx(Me,{onClick:c,children:o("common.save")})})]})},EW=()=>{const{config:e,setChannels:t}=n0(),{t:n}=Ye(),[r,s]=y.useState({id:e.id??"",name:"notifyChannels",data:{apiToken:"",chatId:"",enabled:!1}});y.useEffect(()=>{const c=(()=>{const u={apiToken:"",chatId:"",enabled:!1};if(!e.content)return u;const d=e.content;return d.telegram?d.telegram:u})();s({id:e.id??"",name:"common.provider.telegram",data:c})},[e]);const{toast:o}=zr(),i=async()=>{try{const a=await il({...e,name:"notifyChannels",content:{...e.content,telegram:{...r.data}}});t(a),o({title:n("common.save.succeeded.message"),description:n("settings.notification.config.saved.message")})}catch(a){const c=$s(a);o({title:n("common.save.failed.message"),description:`${n("settings.notification.config.failed.message")}: ${c}`,variant:"destructive"})}};return l.jsxs("div",{children:[l.jsx(pe,{placeholder:"ApiToken",value:r.data.apiToken,onChange:a=>{s({...r,data:{...r.data,apiToken:a.target.value}})}}),l.jsx(pe,{placeholder:"ChatId",value:r.data.chatId,onChange:a=>{s({...r,data:{...r.data,chatId:a.target.value}})}}),l.jsxs("div",{className:"flex items-center space-x-1 mt-2",children:[l.jsx(mu,{id:"airplane-mode",checked:r.data.enabled,onCheckedChange:()=>{s({...r,data:{...r.data,enabled:!r.data.enabled}})}}),l.jsx(Vt,{htmlFor:"airplane-mode",children:n("settings.notification.config.enable")})]}),l.jsx("div",{className:"flex justify-end mt-2",children:l.jsx(Me,{onClick:()=>{i()},children:n("common.save")})})]})};function NW(e){try{return new URL(e),!0}catch{return!1}}const TW=()=>{const{config:e,setChannels:t}=n0(),{t:n}=Ye(),[r,s]=y.useState({id:e.id??"",name:"notifyChannels",data:{url:"",enabled:!1}});y.useEffect(()=>{const c=(()=>{const u={url:"",enabled:!1};if(!e.content)return u;const d=e.content;return d.webhook?d.webhook:u})();s({id:e.id??"",name:"webhook",data:c})},[e]);const{toast:o}=zr(),i=async()=>{try{if(r.data.url=r.data.url.trim(),!NW(r.data.url)){o({title:n("common.save.failed.message"),description:n("settings.notification.url.errmsg.invalid"),variant:"destructive"});return}const a=await il({...e,name:"notifyChannels",content:{...e.content,webhook:{...r.data}}});t(a),o({title:n("common.save.succeeded.message"),description:n("settings.notification.config.saved.message")})}catch(a){const c=$s(a);o({title:n("common.save.failed.message"),description:`${n("settings.notification.config.failed.message")}: ${c}`,variant:"destructive"})}};return l.jsxs("div",{children:[l.jsx(pe,{placeholder:"Url",value:r.data.url,onChange:a=>{s({...r,data:{...r.data,url:a.target.value}})}}),l.jsxs("div",{className:"flex items-center space-x-1 mt-2",children:[l.jsx(mu,{id:"airplane-mode",checked:r.data.enabled,onCheckedChange:()=>{s({...r,data:{...r.data,enabled:!r.data.enabled}})}}),l.jsx(Vt,{htmlFor:"airplane-mode",children:n("settings.notification.config.enable")})]}),l.jsx("div",{className:"flex justify-end mt-2",children:l.jsx(Me,{onClick:()=>{i()},children:n("common.save")})})]})},PW=()=>{const{t:e}=Ye();return l.jsx(l.Fragment,{children:l.jsxs(SW,{children:[l.jsx("div",{className:"border rounded-sm p-5 shadow-lg",children:l.jsx(e1,{type:"multiple",className:"dark:text-stone-200",children:l.jsxs(Fl,{value:"item-1",className:"dark:border-stone-200",children:[l.jsx($l,{children:e("settings.notification.template.label")}),l.jsx(Ul,{children:l.jsx(jW,{})})]})})}),l.jsx("div",{className:"border rounded-md p-5 mt-7 shadow-lg",children:l.jsxs(e1,{type:"single",className:"dark:text-stone-200",children:[l.jsxs(Fl,{value:"item-2",className:"dark:border-stone-200",children:[l.jsx($l,{children:e("common.provider.dingtalk")}),l.jsx(Ul,{children:l.jsx(kW,{})})]}),l.jsxs(Fl,{value:"item-4",className:"dark:border-stone-200",children:[l.jsx($l,{children:e("common.provider.telegram")}),l.jsx(Ul,{children:l.jsx(EW,{})})]}),l.jsxs(Fl,{value:"item-5",className:"dark:border-stone-200",children:[l.jsx($l,{children:e("common.provider.webhook")}),l.jsx(Ul,{children:l.jsx(TW,{})})]})]})})]})})};var r0="Radio",[RW,KT]=on(r0),[AW,DW]=RW(r0),GT=y.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:s=!1,required:o,disabled:i,value:a="on",onCheck:c,...u}=e,[d,f]=y.useState(null),h=Ge(t,p=>f(p)),m=y.useRef(!1),x=d?!!d.closest("form"):!0;return l.jsxs(AW,{scope:n,checked:s,disabled:i,children:[l.jsx(Pe.button,{type:"button",role:"radio","aria-checked":s,"data-state":XT(s),"data-disabled":i?"":void 0,disabled:i,value:a,...u,ref:h,onClick:ue(e.onClick,p=>{s||c==null||c(),x&&(m.current=p.isPropagationStopped(),m.current||p.stopPropagation())})}),x&&l.jsx(OW,{control:d,bubbles:!m.current,name:r,value:a,checked:s,required:o,disabled:i,style:{transform:"translateX(-100%)"}})]})});GT.displayName=r0;var ZT="RadioIndicator",qT=y.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...s}=e,o=DW(ZT,n);return l.jsx(an,{present:r||o.checked,children:l.jsx(Pe.span,{"data-state":XT(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:t})})});qT.displayName=ZT;var OW=e=>{const{control:t,checked:n,bubbles:r=!0,...s}=e,o=y.useRef(null),i=Cx(n),a=yv(t);return y.useEffect(()=>{const c=o.current,u=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(u,"checked").set;if(i!==n&&f){const h=new Event("click",{bubbles:r});f.call(c,n),c.dispatchEvent(h)}},[i,n,r]),l.jsx("input",{type:"radio","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:o,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function XT(e){return e?"checked":"unchecked"}var IW=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],s0="RadioGroup",[MW,t9]=on(s0,[nl,KT]),QT=nl(),JT=KT(),[LW,zW]=MW(s0),eP=y.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:s,value:o,required:i=!1,disabled:a=!1,orientation:c,dir:u,loop:d=!0,onValueChange:f,...h}=e,m=QT(n),x=Si(u),[p,w]=Gn({prop:o,defaultProp:s,onChange:f});return l.jsx(LW,{scope:n,name:r,required:i,disabled:a,value:p,onValueChange:w,children:l.jsx(kv,{asChild:!0,...m,orientation:c,dir:x,loop:d,children:l.jsx(Pe.div,{role:"radiogroup","aria-required":i,"aria-orientation":c,"data-disabled":a?"":void 0,dir:x,...h,ref:t})})})});eP.displayName=s0;var tP="RadioGroupItem",nP=y.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...s}=e,o=zW(tP,n),i=o.disabled||r,a=QT(n),c=JT(n),u=y.useRef(null),d=Ge(t,u),f=o.value===s.value,h=y.useRef(!1);return y.useEffect(()=>{const m=p=>{IW.includes(p.key)&&(h.current=!0)},x=()=>h.current=!1;return document.addEventListener("keydown",m),document.addEventListener("keyup",x),()=>{document.removeEventListener("keydown",m),document.removeEventListener("keyup",x)}},[]),l.jsx(Cv,{asChild:!0,...a,focusable:!i,active:f,children:l.jsx(GT,{disabled:i,required:o.required,checked:f,...c,...s,name:o.name,ref:d,onCheck:()=>o.onValueChange(s.value),onKeyDown:ue(m=>{m.key==="Enter"&&m.preventDefault()}),onFocus:ue(s.onFocus,()=>{var m;h.current&&((m=u.current)==null||m.click())})})})});nP.displayName=tP;var FW="RadioGroupIndicator",rP=y.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,s=JT(n);return l.jsx(qT,{...s,...r,ref:t})});rP.displayName=FW;var sP=eP,oP=nP,$W=rP;const iP=y.forwardRef(({className:e,...t},n)=>l.jsx(sP,{className:re("grid gap-2",e),...t,ref:n}));iP.displayName=sP.displayName;const ty=y.forwardRef(({className:e,...t},n)=>l.jsx(oP,{ref:n,className:re("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:l.jsx($W,{className:"flex items-center justify-center",children:l.jsx(sk,{className:"h-2.5 w-2.5 fill-current text-current"})})}));ty.displayName=oP.displayName;const UW=()=>{const{t:e}=Ye(),t=ce.object({provider:ce.enum(["letsencrypt","zerossl"],{message:e("settings.ca.provider.errmsg.empty")}),eabKid:ce.string().optional(),eabHmacKey:ce.string().optional()}),n=cn({resolver:un(t),defaultValues:{provider:"letsencrypt"}}),[r,s]=y.useState("letsencrypt"),[o,i]=y.useState(),{toast:a}=zr();y.useEffect(()=>{(async()=>{const f=await yx("ssl-provider");if(f){i(f);const h=f.content;n.setValue("provider",h.provider),n.setValue("eabKid",h.config[h.provider].eabKid),n.setValue("eabHmacKey",h.config[h.provider].eabHmacKey),s(h.provider)}else n.setValue("provider","letsencrypt"),s("letsencrypt")})()},[]);const c=d=>r===d?"border-primary":"",u=async d=>{if(d.provider==="zerossl"&&(d.eabKid||n.setError("eabKid",{message:e("settings.ca.eab_kid_hmac_key.errmsg.empty")}),d.eabHmacKey||n.setError("eabHmacKey",{message:e("settings.ca.eab_kid_hmac_key.errmsg.empty")}),!d.eabKid||!d.eabHmacKey))return;const f={id:o==null?void 0:o.id,name:"ssl-provider",content:{provider:d.provider,config:{letsencrypt:{},zerossl:{eabKid:d.eabKid??"",eabHmacKey:d.eabHmacKey??""}}}};try{await il(f),a({title:e("common.update.succeeded.message"),description:e("common.update.succeeded.message")})}catch(h){const m=$s(h);a({title:e("common.update.failed.message"),description:m,variant:"destructive"})}};return l.jsx(l.Fragment,{children:l.jsx("div",{className:"w-full md:max-w-[35em]",children:l.jsx(dn,{...n,children:l.jsxs("form",{onSubmit:n.handleSubmit(u),className:"space-y-8 dark:text-stone-200",children:[l.jsx(ke,{control:n.control,name:"provider",render:({field:d})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:e("common.text.ca")}),l.jsx(je,{children:l.jsxs(iP,{...d,className:"flex",onValueChange:f=>{s(f),n.setValue("provider",f)},value:r,children:[l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx(ty,{value:"letsencrypt",id:"letsencrypt"}),l.jsx(Vt,{htmlFor:"letsencrypt",children:l.jsxs("div",{className:re("flex items-center space-x-2 border p-2 rounded cursor-pointer",c("letsencrypt")),children:[l.jsx("img",{src:"/imgs/providers/letsencrypt.svg",className:"h-6"}),l.jsx("div",{children:"Let's Encrypt"})]})})]}),l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx(ty,{value:"zerossl",id:"zerossl"}),l.jsx(Vt,{htmlFor:"zerossl",children:l.jsxs("div",{className:re("flex items-center space-x-2 border p-2 rounded cursor-pointer",c("zerossl")),children:[l.jsx("img",{src:"/imgs/providers/zerossl.svg",className:"h-6"}),l.jsx("div",{children:"ZeroSSL"})]})})]})]})}),l.jsx(ke,{control:n.control,name:"eabKid",render:({field:f})=>l.jsxs(Se,{hidden:r!=="zerossl",children:[l.jsx(Ce,{children:"EAB_KID"}),l.jsx(je,{children:l.jsx(pe,{placeholder:e("settings.ca.eab_kid.errmsg.empty"),...f,type:"text"})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:n.control,name:"eabHmacKey",render:({field:f})=>l.jsxs(Se,{hidden:r!=="zerossl",children:[l.jsx(Ce,{children:"EAB_HMAC_KEY"}),l.jsx(je,{children:l.jsx(pe,{placeholder:e("settings.ca.eab_hmac_key.errmsg.empty"),...f,type:"text"})}),l.jsx(ye,{})]})}),l.jsx(ye,{})]})}),l.jsx("div",{className:"flex justify-end",children:l.jsx(Me,{type:"submit",children:e("common.update")})})]})})})})},VW=lO([{path:"/",element:l.jsx(P$,{}),children:[{path:"/",element:l.jsx(tW,{})},{path:"/domains",element:l.jsx(QU,{})},{path:"/edit",element:l.jsx(VB,{})},{path:"/access",element:l.jsx(KB,{})},{path:"/history",element:l.jsx(GB,{})},{path:"/setting",element:l.jsx(eW,{}),children:[{path:"/setting/password",element:l.jsx(JB,{})},{path:"/setting/account",element:l.jsx(rW,{})},{path:"/setting/notify",element:l.jsx(PW,{})},{path:"/setting/ssl-provider",element:l.jsx(UW,{})}]}]},{path:"/login",element:l.jsx(XB,{}),children:[{path:"/login",element:l.jsx(qB,{})}]},{path:"/about",element:l.jsx("div",{children:"About"})}]),BW={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};class Lf{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,n)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=t||BW,this.options=n,this.debug=n.debug}log(){for(var t=arguments.length,n=new Array(t),r=0;r{this.observers[r]||(this.observers[r]=new Map);const s=this.observers[r].get(n)||0;this.observers[r].set(n,s+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s{let[a,c]=i;for(let u=0;u{let[a,c]=i;for(let u=0;u{let e,t;const n=new Promise((r,s)=>{e=r,t=s});return n.resolve=e,n.reject=t,n},t1=e=>e==null?"":""+e,WW=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},HW=/###/g,n1=e=>e&&e.indexOf("###")>-1?e.replace(HW,"."):e,r1=e=>!e||typeof e=="string",tc=(e,t,n)=>{const r=typeof t!="string"?t:t.split(".");let s=0;for(;s{const{obj:r,k:s}=tc(e,t,Object);if(r!==void 0||t.length===1){r[s]=n;return}let o=t[t.length-1],i=t.slice(0,t.length-1),a=tc(e,i,Object);for(;a.obj===void 0&&i.length;)o=`${i[i.length-1]}.${o}`,i=i.slice(0,i.length-1),a=tc(e,i,Object),a&&a.obj&&typeof a.obj[`${a.k}.${o}`]<"u"&&(a.obj=void 0);a.obj[`${a.k}.${o}`]=n},YW=(e,t,n,r)=>{const{obj:s,k:o}=tc(e,t,Object);s[o]=s[o]||[],s[o].push(n)},zf=(e,t)=>{const{obj:n,k:r}=tc(e,t);if(n)return n[r]},KW=(e,t,n)=>{const r=zf(e,n);return r!==void 0?r:zf(t,n)},aP=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?typeof e[r]=="string"||e[r]instanceof String||typeof t[r]=="string"||t[r]instanceof String?n&&(e[r]=t[r]):aP(e[r],t[r],n):e[r]=t[r]);return e},Bi=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var GW={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const ZW=e=>typeof e=="string"?e.replace(/[&<>"'\/]/g,t=>GW[t]):e;class qW{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const XW=[" ",",","?","!",";"],QW=new qW(20),JW=(e,t,n)=>{t=t||"",n=n||"";const r=XW.filter(i=>t.indexOf(i)<0&&n.indexOf(i)<0);if(r.length===0)return!0;const s=QW.getRegExp(`(${r.map(i=>i==="?"?"\\?":i).join("|")})`);let o=!s.test(e);if(!o){const i=e.indexOf(n);i>0&&!s.test(e.substring(0,i))&&(o=!0)}return o},ny=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return e[t];const r=t.split(n);let s=e;for(let o=0;o-1&&ce&&e.indexOf("_")>0?e.replace("_","-"):e;class o1 extends um{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,i=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;t.indexOf(".")>-1?a=t.split("."):(a=[t,n],r&&(Array.isArray(r)?a.push(...r):typeof r=="string"&&o?a.push(...r.split(o)):a.push(r)));const c=zf(this.data,a);return!c&&!n&&!r&&t.indexOf(".")>-1&&(t=a[0],n=a[1],r=a.slice(2).join(".")),c||!i||typeof r!="string"?c:ny(this.data&&this.data[t]&&this.data[t][n],r,o)}addResource(t,n,r,s){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const i=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let a=[t,n];r&&(a=a.concat(i?r.split(i):r)),t.indexOf(".")>-1&&(a=t.split("."),s=n,n=a[1]),this.addNamespaces(n),s1(this.data,a,s),o.silent||this.emit("added",t,n,r,s)}addResources(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const o in r)(typeof r[o]=="string"||Array.isArray(r[o]))&&this.addResource(t,n,o,r[o],{silent:!0});s.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,s,o){let i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},a=[t,n];t.indexOf(".")>-1&&(a=t.split("."),s=r,r=n,n=a[1]),this.addNamespaces(n);let c=zf(this.data,a)||{};i.skipCopy||(r=JSON.parse(JSON.stringify(r))),s?aP(c,r,o):c={...c,...r},s1(this.data,a,c),i.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(t,n)}:this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(s=>n[s]&&Object.keys(n[s]).length>0)}toJSON(){return this.data}}var lP={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,s){return e.forEach(o=>{this.processors[o]&&(t=this.processors[o].process(t,n,r,s))}),t}};const i1={};class $f extends um{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),WW(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=qr.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(t==null)return!1;const r=this.resolve(t,n);return r&&r.res!==void 0}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const s=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let o=n.ns||this.options.defaultNS||[];const i=r&&t.indexOf(r)>-1,a=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!JW(t,r,s);if(i&&!a){const c=t.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:t,namespaces:o};const u=t.split(r);(r!==s||r===s&&this.options.ns.indexOf(u[0])>-1)&&(o=u.shift()),t=u.join(s)}return typeof o=="string"&&(o=[o]),{key:t,namespaces:o}}translate(t,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const s=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:i,namespaces:a}=this.extractFromKey(t[t.length-1],n),c=a[a.length-1],u=n.lng||this.language,d=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&u.toLowerCase()==="cimode"){if(d){const _=n.nsSeparator||this.options.nsSeparator;return s?{res:`${c}${_}${i}`,usedKey:i,exactUsedKey:i,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:`${c}${_}${i}`}return s?{res:i,usedKey:i,exactUsedKey:i,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:i}const f=this.resolve(t,n);let h=f&&f.res;const m=f&&f.usedKey||i,x=f&&f.exactUsedKey||i,p=Object.prototype.toString.apply(h),w=["[object Number]","[object Function]","[object RegExp]"],g=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject;if(v&&h&&(typeof h!="string"&&typeof h!="boolean"&&typeof h!="number")&&w.indexOf(p)<0&&!(typeof g=="string"&&Array.isArray(h))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const _=this.options.returnedObjectHandler?this.options.returnedObjectHandler(m,h,{...n,ns:a}):`key '${i} (${this.language})' returned an object instead of string.`;return s?(f.res=_,f.usedParams=this.getUsedParamsDetails(n),f):_}if(o){const _=Array.isArray(h),C=_?[]:{},j=_?x:m;for(const T in h)if(Object.prototype.hasOwnProperty.call(h,T)){const R=`${j}${o}${T}`;C[T]=this.translate(R,{...n,joinArrays:!1,ns:a}),C[T]===R&&(C[T]=h[T])}h=C}}else if(v&&typeof g=="string"&&Array.isArray(h))h=h.join(g),h&&(h=this.extendTranslation(h,t,n,r));else{let _=!1,C=!1;const j=n.count!==void 0&&typeof n.count!="string",T=$f.hasDefaultValue(n),R=j?this.pluralResolver.getSuffix(u,n.count,n):"",A=n.ordinal&&j?this.pluralResolver.getSuffix(u,n.count,{ordinal:!1}):"",O=j&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),G=O&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${R}`]||n[`defaultValue${A}`]||n.defaultValue;!this.isValidLookup(h)&&T&&(_=!0,h=G),this.isValidLookup(h)||(C=!0,h=i);const z=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&C?void 0:h,S=T&&G!==h&&this.options.updateMissing;if(C||_||S){if(this.logger.log(S?"updateKey":"missingKey",u,c,i,S?G:h),o){const W=this.resolve(i,{...n,keySeparator:!1});W&&W.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let U=[];const J=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&J&&J[0])for(let W=0;W{const $=T&&X!==h?X:z;this.options.missingKeyHandler?this.options.missingKeyHandler(W,c,I,$,S,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(W,c,I,$,S,n),this.emit("missingKey",W,c,I,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&j?U.forEach(W=>{const I=this.pluralResolver.getSuffixes(W,n);O&&n[`defaultValue${this.options.pluralSeparator}zero`]&&I.indexOf(`${this.options.pluralSeparator}zero`)<0&&I.push(`${this.options.pluralSeparator}zero`),I.forEach(X=>{F([W],i+X,n[`defaultValue${X}`]||G)})}):F(U,i,G))}h=this.extendTranslation(h,t,n,f,r),C&&h===i&&this.options.appendNamespaceToMissingKey&&(h=`${c}:${i}`),(C||_)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?h=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}:${i}`:i,_?h:void 0):h=this.options.parseMissingKeyHandler(h))}return s?(f.res=h,f.usedParams=this.getUsedParamsDetails(n),f):h}extendTranslation(t,n,r,s,o){var i=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const u=typeof t=="string"&&(r&&r.interpolation&&r.interpolation.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let d;if(u){const h=t.match(this.interpolator.nestingRegexp);d=h&&h.length}let f=r.replace&&typeof r.replace!="string"?r.replace:r;if(this.options.interpolation.defaultVariables&&(f={...this.options.interpolation.defaultVariables,...f}),t=this.interpolator.interpolate(t,f,r.lng||this.language||s.usedLng,r),u){const h=t.match(this.interpolator.nestingRegexp),m=h&&h.length;d1&&arguments[1]!==void 0?arguments[1]:{},r,s,o,i,a;return typeof t=="string"&&(t=[t]),t.forEach(c=>{if(this.isValidLookup(r))return;const u=this.extractFromKey(c,n),d=u.key;s=d;let f=u.namespaces;this.options.fallbackNS&&(f=f.concat(this.options.fallbackNS));const h=n.count!==void 0&&typeof n.count!="string",m=h&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),x=n.context!==void 0&&(typeof n.context=="string"||typeof n.context=="number")&&n.context!=="",p=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);f.forEach(w=>{this.isValidLookup(r)||(a=w,!i1[`${p[0]}-${w}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(a)&&(i1[`${p[0]}-${w}`]=!0,this.logger.warn(`key "${s}" for languages "${p.join(", ")}" won't get resolved as namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach(g=>{if(this.isValidLookup(r))return;i=g;const v=[d];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(v,d,g,w,n);else{let _;h&&(_=this.pluralResolver.getSuffix(g,n.count,n));const C=`${this.options.pluralSeparator}zero`,j=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(h&&(v.push(d+_),n.ordinal&&_.indexOf(j)===0&&v.push(d+_.replace(j,this.options.pluralSeparator)),m&&v.push(d+C)),x){const T=`${d}${this.options.contextSeparator}${n.context}`;v.push(T),h&&(v.push(T+_),n.ordinal&&_.indexOf(j)===0&&v.push(T+_.replace(j,this.options.pluralSeparator)),m&&v.push(T+C))}}let b;for(;b=v.pop();)this.isValidLookup(r)||(o=b,r=this.getResource(g,w,b,n))}))})}),{res:r,usedKey:s,exactUsedKey:o,usedLng:i,usedNS:a}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,n,r,s):this.resourceStore.getResource(t,n,r,s)}getUsedParamsDetails(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&typeof t.replace!="string";let s=r?t.replace:t;if(r&&typeof t.count<"u"&&(s.count=t.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!r){s={...s};for(const o of n)delete s[o]}return s}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}const pp=e=>e.charAt(0).toUpperCase()+e.slice(1);class a1{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=qr.create("languageUtils")}getScriptPartFromCode(t){if(t=Ff(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=Ff(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(typeof t=="string"&&t.indexOf("-")>-1){const n=["hans","hant","latn","cyrl","cans","mong","arab"];let r=t.split("-");return this.options.lowerCaseLng?r=r.map(s=>s.toLowerCase()):r.length===2?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=pp(r[1].toLowerCase()))):r.length===3&&(r[0]=r[0].toLowerCase(),r[1].length===2&&(r[1]=r[1].toUpperCase()),r[0]!=="sgn"&&r[2].length===2&&(r[2]=r[2].toUpperCase()),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=pp(r[1].toLowerCase())),n.indexOf(r[2].toLowerCase())>-1&&(r[2]=pp(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const s=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(s))&&(n=s)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const s=this.getLanguagePartFromCode(r);if(this.isSupportedCode(s))return n=s;n=this.options.supportedLngs.find(o=>{if(o===s)return o;if(!(o.indexOf("-")<0&&s.indexOf("-")<0)&&(o.indexOf("-")>0&&s.indexOf("-")<0&&o.substring(0,o.indexOf("-"))===s||o.indexOf(s)===0&&s.length>1))return o})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),typeof t=="string"&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],t),s=[],o=i=>{i&&(this.isSupportedCode(i)?s.push(i):this.logger.warn(`rejecting language code not found in supportedLngs: ${i}`))};return typeof t=="string"&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(t))):typeof t=="string"&&o(this.formatLanguageCode(t)),r.forEach(i=>{s.indexOf(i)<0&&o(this.formatLanguageCode(i))}),s}}let eH=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],tH={1:e=>+(e>1),2:e=>+(e!=1),3:e=>0,4:e=>e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2,5:e=>e==0?0:e==1?1:e==2?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5,6:e=>e==1?0:e>=2&&e<=4?1:2,7:e=>e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2,8:e=>e==1?0:e==2?1:e!=8&&e!=11?2:3,9:e=>+(e>=2),10:e=>e==1?0:e==2?1:e<7?2:e<11?3:4,11:e=>e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3,12:e=>+(e%10!=1||e%100==11),13:e=>+(e!==0),14:e=>e==1?0:e==2?1:e==3?2:3,15:e=>e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2,16:e=>e%10==1&&e%100!=11?0:e!==0?1:2,17:e=>e==1||e%10==1&&e%100!=11?0:1,18:e=>e==0?0:e==1?1:2,19:e=>e==1?0:e==0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3,20:e=>e==1?0:e==0||e%100>0&&e%100<20?1:2,21:e=>e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0,22:e=>e==1?0:e==2?1:(e<0||e>10)&&e%10==0?2:3};const nH=["v1","v2","v3"],rH=["v4"],l1={zero:0,one:1,two:2,few:3,many:4,other:5},sH=()=>{const e={};return eH.forEach(t=>{t.lngs.forEach(n=>{e[n]={numbers:t.nr,plurals:tH[t.fc]}})}),e};class oH{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=n,this.logger=qr.create("pluralResolver"),(!this.options.compatibilityJSON||rH.includes(this.options.compatibilityJSON))&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=sH(),this.pluralRulesCache={}}addRule(t,n){this.rules[t]=n}clearCache(){this.pluralRulesCache={}}getRule(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{const r=Ff(t==="dev"?"en":t),s=n.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:r,type:s});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];const i=new Intl.PluralRules(r,{type:s});return this.pluralRulesCache[o]=i,i}catch{return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}needsPlural(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return this.shouldUseIntlApi()?r&&r.resolvedOptions().pluralCategories.length>1:r&&r.numbers.length>1}getPluralFormsOfKey(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,r).map(s=>`${n}${s}`)}getSuffixes(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((s,o)=>l1[s]-l1[o]).map(s=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${s}`):r.numbers.map(s=>this.getSuffix(t,s,n)):[]}getSuffix(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const s=this.getRule(t,r);return s?this.shouldUseIntlApi()?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${s.select(n)}`:this.getSuffixRetroCompatible(s,n):(this.logger.warn(`no plural rule found for: ${t}`),"")}getSuffixRetroCompatible(t,n){const r=t.noAbs?t.plurals(n):t.plurals(Math.abs(n));let s=t.numbers[r];this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1&&(s===2?s="plural":s===1&&(s=""));const o=()=>this.options.prepend&&s.toString()?this.options.prepend+s.toString():s.toString();return this.options.compatibilityJSON==="v1"?s===1?"":typeof s=="number"?`_plural_${s.toString()}`:o():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1?o():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}shouldUseIntlApi(){return!nH.includes(this.options.compatibilityJSON)}}const c1=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=KW(e,t,n);return!o&&s&&typeof n=="string"&&(o=ny(e,n,r),o===void 0&&(o=ny(t,n,r))),o},gp=e=>e.replace(/\$/g,"$$$$");class iH{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=qr.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||(n=>n),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:s,prefix:o,prefixEscaped:i,suffix:a,suffixEscaped:c,formatSeparator:u,unescapeSuffix:d,unescapePrefix:f,nestingPrefix:h,nestingPrefixEscaped:m,nestingSuffix:x,nestingSuffixEscaped:p,nestingOptionsSeparator:w,maxReplaces:g,alwaysFormat:v}=t.interpolation;this.escape=n!==void 0?n:ZW,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=o?Bi(o):i||"{{",this.suffix=a?Bi(a):c||"}}",this.formatSeparator=u||",",this.unescapePrefix=d?"":f||"-",this.unescapeSuffix=this.unescapePrefix?"":d||"",this.nestingPrefix=h?Bi(h):m||Bi("$t("),this.nestingSuffix=x?Bi(x):p||Bi(")"),this.nestingOptionsSeparator=w||",",this.maxReplaces=g||1e3,this.alwaysFormat=v!==void 0?v:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>n&&n.source===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(t,n,r,s){let o,i,a;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=m=>{if(m.indexOf(this.formatSeparator)<0){const g=c1(n,c,m,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(g,void 0,r,{...s,...n,interpolationkey:m}):g}const x=m.split(this.formatSeparator),p=x.shift().trim(),w=x.join(this.formatSeparator).trim();return this.format(c1(n,c,p,this.options.keySeparator,this.options.ignoreJSONStructure),w,r,{...s,...n,interpolationkey:p})};this.resetRegExp();const d=s&&s.missingInterpolationHandler||this.options.missingInterpolationHandler,f=s&&s.interpolation&&s.interpolation.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:m=>gp(m)},{regex:this.regexp,safeValue:m=>this.escapeValue?gp(this.escape(m)):gp(m)}].forEach(m=>{for(a=0;o=m.regex.exec(t);){const x=o[1].trim();if(i=u(x),i===void 0)if(typeof d=="function"){const w=d(t,o,s);i=typeof w=="string"?w:""}else if(s&&Object.prototype.hasOwnProperty.call(s,x))i="";else if(f){i=o[0];continue}else this.logger.warn(`missed to pass in variable ${x} for interpolating ${t}`),i="";else typeof i!="string"&&!this.useRawValueToEscape&&(i=t1(i));const p=m.safeValue(i);if(t=t.replace(o[0],p),f?(m.regex.lastIndex+=i.length,m.regex.lastIndex-=o[0].length):m.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),t}nest(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,o,i;const a=(c,u)=>{const d=this.nestingOptionsSeparator;if(c.indexOf(d)<0)return c;const f=c.split(new RegExp(`${d}[ ]*{`));let h=`{${f[1]}`;c=f[0],h=this.interpolate(h,i);const m=h.match(/'/g),x=h.match(/"/g);(m&&m.length%2===0&&!x||x.length%2!==0)&&(h=h.replace(/'/g,'"'));try{i=JSON.parse(h),u&&(i={...u,...i})}catch(p){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,p),`${c}${d}${h}`}return i.defaultValue&&i.defaultValue.indexOf(this.prefix)>-1&&delete i.defaultValue,c};for(;s=this.nestingRegexp.exec(t);){let c=[];i={...r},i=i.replace&&typeof i.replace!="string"?i.replace:i,i.applyPostProcessor=!1,delete i.defaultValue;let u=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){const d=s[1].split(this.formatSeparator).map(f=>f.trim());s[1]=d.shift(),c=d,u=!0}if(o=n(a.call(this,s[1].trim(),i),i),o&&s[0]===t&&typeof o!="string")return o;typeof o!="string"&&(o=t1(o)),o||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${t}`),o=""),u&&(o=c.reduce((d,f)=>this.format(d,f,r.lng,{...r,interpolationkey:s[1].trim()}),o.trim())),t=t.replace(s[0],o),this.regexp.lastIndex=0}return t}}const aH=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const s=r[1].substring(0,r[1].length-1);t==="currency"&&s.indexOf(":")<0?n.currency||(n.currency=s.trim()):t==="relativetime"&&s.indexOf(":")<0?n.range||(n.range=s.trim()):s.split(";").forEach(i=>{if(i){const[a,...c]=i.split(":"),u=c.join(":").trim().replace(/^'+|'+$/g,""),d=a.trim();n[d]||(n[d]=u),u==="false"&&(n[d]=!1),u==="true"&&(n[d]=!0),isNaN(u)||(n[d]=parseInt(u,10))}})}return{formatName:t,formatOptions:n}},Wi=e=>{const t={};return(n,r,s)=>{let o=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(o={...o,[s.interpolationkey]:void 0});const i=r+JSON.stringify(o);let a=t[i];return a||(a=e(Ff(r),s),t[i]=a),a(n)}};class lH{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=qr.create("formatter"),this.options=t,this.formats={number:Wi((n,r)=>{const s=new Intl.NumberFormat(n,{...r});return o=>s.format(o)}),currency:Wi((n,r)=>{const s=new Intl.NumberFormat(n,{...r,style:"currency"});return o=>s.format(o)}),datetime:Wi((n,r)=>{const s=new Intl.DateTimeFormat(n,{...r});return o=>s.format(o)}),relativetime:Wi((n,r)=>{const s=new Intl.RelativeTimeFormat(n,{...r});return o=>s.format(o,r.range||"day")}),list:Wi((n,r)=>{const s=new Intl.ListFormat(n,{...r});return o=>s.format(o)})},this.init(t)}init(t){const r=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||","}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=Wi(n)}format(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=n.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(a=>a.indexOf(")")>-1)){const a=o.findIndex(c=>c.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,a)].join(this.formatSeparator)}return o.reduce((a,c)=>{const{formatName:u,formatOptions:d}=aH(c);if(this.formats[u]){let f=a;try{const h=s&&s.formatParams&&s.formatParams[s.interpolationkey]||{},m=h.locale||h.lng||s.locale||s.lng||r;f=this.formats[u](a,m,{...d,...s,...h})}catch(h){this.logger.warn(h)}return f}else this.logger.warn(`there was no format function for ${u}`);return a},t)}}const cH=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class uH extends um{constructor(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=s,this.logger=qr.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(r,s.backend,s)}queueLoad(t,n,r,s){const o={},i={},a={},c={};return t.forEach(u=>{let d=!0;n.forEach(f=>{const h=`${u}|${f}`;!r.reload&&this.store.hasResourceBundle(u,f)?this.state[h]=2:this.state[h]<0||(this.state[h]===1?i[h]===void 0&&(i[h]=!0):(this.state[h]=1,d=!1,i[h]===void 0&&(i[h]=!0),o[h]===void 0&&(o[h]=!0),c[f]===void 0&&(c[f]=!0)))}),d||(a[u]=!0)}),(Object.keys(o).length||Object.keys(i).length)&&this.queue.push({pending:i,pendingCount:Object.keys(i).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(o),pending:Object.keys(i),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(c)}}loaded(t,n,r){const s=t.split("|"),o=s[0],i=s[1];n&&this.emit("failedLoading",o,i,n),!n&&r&&this.store.addResourceBundle(o,i,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const a={};this.queue.forEach(c=>{YW(c.loaded,[o],i),cH(c,t),n&&c.errors.push(n),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(u=>{a[u]||(a[u]={});const d=c.loaded[u];d.length&&d.forEach(f=>{a[u][f]===void 0&&(a[u][f]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(c=>!c.done)}read(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,i=arguments.length>5?arguments[5]:void 0;if(!t.length)return i(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:s,wait:o,callback:i});return}this.readingCalls++;const a=(u,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const f=this.waitingReads.shift();this.read(f.lng,f.ns,f.fcName,f.tried,f.wait,f.callback)}if(u&&d&&s{this.read.call(this,t,n,r,s+1,o*2,i)},o);return}i(u,d)},c=this.backend[r].bind(this.backend);if(c.length===2){try{const u=c(t,n);u&&typeof u.then=="function"?u.then(d=>a(null,d)).catch(a):a(null,u)}catch(u){a(u)}return}return c(t,n,a)}prepareLoading(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();typeof t=="string"&&(t=this.languageUtils.toResolveHierarchy(t)),typeof n=="string"&&(n=[n]);const o=this.queueLoad(t,n,r,s);if(!o.toLoad.length)return o.pending.length||s(),null;o.toLoad.forEach(i=>{this.loadOne(i)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=t.split("|"),s=r[0],o=r[1];this.read(s,o,"read",void 0,void 0,(i,a)=>{i&&this.logger.warn(`${n}loading namespace ${o} for language ${s} failed`,i),!i&&a&&this.logger.log(`${n}loaded namespace ${o} for language ${s}`,a),this.loaded(t,i,a)})}saveMissing(t,n,r,s,o){let i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend&&this.backend.create){const c={...i,isUpdate:o},u=this.backend.create.bind(this.backend);if(u.length<6)try{let d;u.length===5?d=u(t,n,r,s,c):d=u(t,n,r,s),d&&typeof d.then=="function"?d.then(f=>a(null,f)).catch(a):a(null,d)}catch(d){a(d)}else u(t,n,r,s,a,c)}!t||!t[0]||this.store.addResource(t[0],n,r,s)}}}const u1=()=>({debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),typeof e[1]=="string"&&(t.defaultValue=e[1]),typeof e[2]=="string"&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),d1=e=>(typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),rd=()=>{},dH=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class Kc extends um{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=d1(t),this.services={},this.logger=qr,this.modules={external:[]},dH(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initImmediate)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(){var t=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof n=="function"&&(r=n,n={}),!n.defaultNS&&n.defaultNS!==!1&&n.ns&&(typeof n.ns=="string"?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const s=u1();this.options={...s,...this.options,...d1(n)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...s.interpolation,...this.options.interpolation}),n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);const o=d=>d?typeof d=="function"?new d:d:null;if(!this.options.isClone){this.modules.logger?qr.init(o(this.modules.logger),this.options):qr.init(null,this.options);let d;this.modules.formatter?d=this.modules.formatter:typeof Intl<"u"&&(d=lH);const f=new a1(this.options);this.store=new o1(this.options.resources,this.options);const h=this.services;h.logger=qr,h.resourceStore=this.store,h.languageUtils=f,h.pluralResolver=new oH(f,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),d&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(h.formatter=o(d),h.formatter.init(h,this.options),this.options.interpolation.format=h.formatter.format.bind(h.formatter)),h.interpolator=new iH(this.options),h.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},h.backendConnector=new uH(o(this.modules.backend),h.resourceStore,h,this.options),h.backendConnector.on("*",function(m){for(var x=arguments.length,p=new Array(x>1?x-1:0),w=1;w1?x-1:0),w=1;w{m.init&&m.init(this)})}if(this.format=this.options.interpolation.format,r||(r=rd),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const d=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);d.length>0&&d[0]!=="dev"&&(this.options.lng=d[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(d=>{this[d]=function(){return t.store[d](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(d=>{this[d]=function(){return t.store[d](...arguments),t}});const c=El(),u=()=>{const d=(f,h)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),c.resolve(h),r(f,h)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return d(null,this.t.bind(this));this.changeLanguage(this.options.lng,d)};return this.options.resources||!this.options.initImmediate?u():setTimeout(u,0),c}loadResources(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:rd;const s=typeof t=="string"?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(s&&s.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const o=[],i=a=>{if(!a||a==="cimode")return;this.services.languageUtils.toResolveHierarchy(a).forEach(u=>{u!=="cimode"&&o.indexOf(u)<0&&o.push(u)})};s?i(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(c=>i(c)),this.options.preload&&this.options.preload.forEach(a=>i(a)),this.services.backendConnector.load(o,this.options.ns,a=>{!a&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(a)})}else r(null)}reloadResources(t,n,r){const s=El();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=rd),this.services.backendConnector.reload(t,n,o=>{s.resolve(),r(o)}),s}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&lP.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1))for(let n=0;n-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(t,n){var r=this;this.isLanguageChangingTo=t;const s=El();this.emit("languageChanging",t);const o=c=>{this.language=c,this.languages=this.services.languageUtils.toResolveHierarchy(c),this.resolvedLanguage=void 0,this.setResolvedLanguage(c)},i=(c,u)=>{u?(o(u),this.translator.changeLanguage(u),this.isLanguageChangingTo=void 0,this.emit("languageChanged",u),this.logger.log("languageChanged",u)):this.isLanguageChangingTo=void 0,s.resolve(function(){return r.t(...arguments)}),n&&n(c,function(){return r.t(...arguments)})},a=c=>{!t&&!c&&this.services.languageDetector&&(c=[]);const u=typeof c=="string"?c:this.services.languageUtils.getBestMatchFromCodes(c);u&&(this.language||o(u),this.translator.language||this.translator.changeLanguage(u),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(u)),this.loadResources(u,d=>{i(d,u)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(t),s}getFixedT(t,n,r){var s=this;const o=function(i,a){let c;if(typeof a!="object"){for(var u=arguments.length,d=new Array(u>2?u-2:0),f=2;f`${c.keyPrefix}${h}${x}`):m=c.keyPrefix?`${c.keyPrefix}${h}${i}`:i,s.t(m,c)};return typeof t=="string"?o.lng=t:o.lngs=t,o.ns=n,o.keyPrefix=r,o}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const i=(a,c)=>{const u=this.services.backendConnector.state[`${a}|${c}`];return u===-1||u===0||u===2};if(n.precheck){const a=n.precheck(this,i);if(a!==void 0)return a}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||i(r,t)&&(!s||i(o,t)))}loadNamespaces(t,n){const r=El();return this.options.ns?(typeof t=="string"&&(t=[t]),t.forEach(s=>{this.options.ns.indexOf(s)<0&&this.options.ns.push(s)}),this.loadResources(s=>{r.resolve(),n&&n(s)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=El();typeof t=="string"&&(t=[t]);const s=this.options.preload||[],o=t.filter(i=>s.indexOf(i)<0&&this.services.languageUtils.isSupportedCode(i));return o.length?(this.options.preload=s.concat(o),this.loadResources(i=>{r.resolve(),n&&n(i)}),r):(n&&n(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!t)return"rtl";const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=this.services&&this.services.languageUtils||new a1(u1());return n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new Kc(t,n)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:rd;const r=t.forkResourceStore;r&&delete t.forkResourceStore;const s={...this.options,...t,isClone:!0},o=new Kc(s);return(t.debug!==void 0||t.prefix!==void 0)&&(o.logger=o.logger.clone(t)),["store","services","language"].forEach(a=>{o[a]=this[a]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},r&&(o.store=new o1(this.store.data,s),o.services.resourceStore=o.store),o.translator=new $f(o.services,s),o.translator.on("*",function(a){for(var c=arguments.length,u=new Array(c>1?c-1:0),d=1;d{if(t)for(const n in t)e[n]===void 0&&(e[n]=t[n])}),e}const f1=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,pH=(e,t,n)=>{const r=n||{};r.path=r.path||"/";const s=encodeURIComponent(t);let o=`${e}=${s}`;if(r.maxAge>0){const i=r.maxAge-0;if(Number.isNaN(i))throw new Error("maxAge should be a Number");o+=`; Max-Age=${Math.floor(i)}`}if(r.domain){if(!f1.test(r.domain))throw new TypeError("option domain is invalid");o+=`; Domain=${r.domain}`}if(r.path){if(!f1.test(r.path))throw new TypeError("option path is invalid");o+=`; Path=${r.path}`}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");o+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(o+="; HttpOnly"),r.secure&&(o+="; Secure"),r.sameSite)switch(typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return o},h1={create(e,t,n,r){let s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(s.expires=new Date,s.expires.setTime(s.expires.getTime()+n*60*1e3)),r&&(s.domain=r),document.cookie=pH(e,encodeURIComponent(t),s)},read(e){const t=`${e}=`,n=document.cookie.split(";");for(let r=0;r-1&&(s=window.location.hash.substring(window.location.hash.indexOf("?")));const i=s.substring(1).split("&");for(let a=0;a0&&i[a].substring(0,c)===t&&(n=i[a].substring(c+1))}}return n}};let Nl=null;const m1=()=>{if(Nl!==null)return Nl;try{Nl=window!=="undefined"&&window.localStorage!==null;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch{Nl=!1}return Nl};var vH={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&m1())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:n}=t;n&&m1()&&window.localStorage.setItem(n,e)}};let Tl=null;const p1=()=>{if(Tl!==null)return Tl;try{Tl=window!=="undefined"&&window.sessionStorage!==null;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch{Tl=!1}return Tl};var xH={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&p1())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:n}=t;n&&p1()&&window.sessionStorage.setItem(n,e)}},wH={name:"navigator",lookup(e){const t=[];if(typeof navigator<"u"){const{languages:n,userLanguage:r,language:s}=navigator;if(n)for(let o=0;o0?t:void 0}},bH={name:"htmlTag",lookup(e){let{htmlTag:t}=e,n;const r=t||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},_H={name:"path",lookup(e){var s;let{lookupFromPathIndex:t}=e;if(typeof window>"u")return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(n)?(s=n[typeof t=="number"?t:0])==null?void 0:s.replace("/",""):void 0}},SH={name:"subdomain",lookup(e){var s,o;let{lookupFromSubdomainIndex:t}=e;const n=typeof t=="number"?t+1:1,r=typeof window<"u"&&((o=(s=window.location)==null?void 0:s.hostname)==null?void 0:o.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(r)return r[n]}};function kH(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e}}class cP{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(t,n)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=t||{languageUtils:{}},this.options=mH(n,this.options||{},kH()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=s=>s.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(gH),this.addDetector(yH),this.addDetector(vH),this.addDetector(xH),this.addDetector(wH),this.addDetector(bH),this.addDetector(_H),this.addDetector(SH)}addDetector(t){return this.detectors[t.name]=t,this}detect(t){t||(t=this.options.order);let n=[];return t.forEach(r=>{if(this.detectors[r]){let s=this.detectors[r].lookup(this.options);s&&typeof s=="string"&&(s=[s]),s&&(n=n.concat(s))}}),n=n.map(r=>this.options.convertDetectedLanguage(r)),this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}cacheUserLanguage(t,n){n||(n=this.options.caches),n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(t)>-1||n.forEach(r=>{this.detectors[r]&&this.detectors[r].cacheUserLanguage(t,this.options)}))}}cP.type="languageDetector";const CH={"common.add":"新增","common.save":"保存","common.save.succeeded.message":"保存成功","common.save.failed.message":"保存失败","common.edit":"编辑","common.copy":"复制","common.download":"下载","common.delete":"刪除","common.delete.succeeded.message":"删除成功","common.delete.failed.message":"删除失败","common.next":"下一步","common.confirm":"确认","common.cancel":"取消","common.submit":"提交","common.update":"更新","common.update.succeeded.message":"修改成功","common.update.failed.message":"修改失败","common.text.domain":"域名","common.text.domain.empty":"无域名","common.text.ip":"IP 地址","common.text.ip.empty":"无 IP 地址","common.text.dns":"DNS(域名服务器)","common.text.dns.empty":"无 DNS 地址","common.text.ca":"CA(证书颁发机构)","common.text.name":"名称","common.text.provider":"服务商","common.text.created_at":"创建时间","common.text.updated_at":"更新时间","common.text.operations":"操作","common.text.nodata":"暂无数据","common.menu.settings":"系统设置","common.menu.logout":"退出登录","common.menu.document":"文档","common.pagination.next":"下一页","common.pagination.prev":"上一页","common.pagination.more":"更多","common.theme.light":"浅色","common.theme.dark":"暗黑","common.theme.system":"跟随系统","common.errmsg.string_max":"请输入不超过 {{max}} 个字符","common.errmsg.email_empty":"请输入邮箱","common.errmsg.email_invalid":"请输入正确的邮箱","common.errmsg.email_duplicate":"邮箱已存在","common.errmsg.domain_invalid":"请输入正确的域名","common.errmsg.host_invalid":"请输入正确的域名或 IP 地址","common.errmsg.ip_invalid":"请输入正确的 IP 地址","common.errmsg.url_invalid":"请输入正确的 URL","common.provider.tencent":"腾讯云","common.provider.tencent.cdn":"腾讯云 - CDN","common.provider.aliyun":"阿里云","common.provider.aliyun.oss":"阿里云 - OSS","common.provider.aliyun.cdn":"阿里云 - CDN","common.provider.aliyun.dcdn":"阿里云 - DCDN","common.provider.huaweicloud":"华为云","common.provider.qiniu":"七牛云","common.provider.qiniu.cdn":"七牛云 - CDN","common.provider.cloudflare":"Cloudflare","common.provider.namesilo":"Namesilo","common.provider.godaddy":"GoDaddy","common.provider.local":"本地部署","common.provider.ssh":"SSH 部署","common.provider.webhook":"Webhook","common.provider.dingtalk":"钉钉","common.provider.telegram":"Telegram"},jH={"login.username.label":"用户名","login.username.placeholder":"请输入用户名/邮箱","login.username.errmsg.invalid":"请输入正确的用户名/邮箱","login.password.label":"密码","login.password.placeholder":"请输入密码","login.password.errmsg.invalid":"密码至少 10 个字符","login.submit":"登录"},EH={"dashboard.page.title":"仪表盘","dashboard.statistics.all":"所有","dashboard.statistics.near_expired":"即将过期","dashboard.statistics.enabled":"启用中","dashboard.statistics.disabled":"未启用","dashboard.statistics.unit":"个","dashboard.history":"部署历史"},NH={"settings.page.title":"系统设置","settings.account.relogin.message":"请重新登录","settings.account.tab":"账号","settings.account.email.label":"登录邮箱","settings.account.email.errmsg.invalid":"请输入正确的邮箱地址","settings.account.email.placeholder":"请输入邮箱","settings.account.email.changed.message":"修改账户邮箱成功","settings.account.email.failed.message":"修改账户邮箱失败","settings.password.tab":"密码","settings.password.password.errmsg.length":"密码至少10个字符","settings.password.password.errmsg.not_matched":"两次密码不一致","settings.password.current_password.label":"当前密码","settings.password.current_password.placeholder":"请输入旧密码","settings.password.new_password.label":"新密码","settings.password.new_password.placeholder":"请输入新密码","settings.password.confirm_password.label":"确认密码","settings.password.confirm_password.placeholder":"请再次输入新密码","settings.password.changed.message":"修改密码成功","settings.password.failed.message":"修改密码失败","settings.notification.tab":"消息推送","settings.notification.template.label":"内容模板","settings.notification.template.saved.message":"通知模板保存成功","settings.notification.template.variables.tips.title":"可选的变量({COUNT}: 即将过期张数)","settings.notification.template.variables.tips.content":"可选的变量({COUNT}: 即将过期张数;{DOMAINS}: 域名列表)","settings.notification.config.enable":"是否启用","settings.notification.config.saved.message":"配置保存成功","settings.notification.config.failed.message":"配置保存失败","settings.notification.dingtalk.secret.placeholder":"加签的签名","settings.notification.url.errmsg.invalid":"URL 格式不正确","settings.ca.tab":"证书颁发机构(CA)","settings.ca.provider.errmsg.empty":"请选择证书分发机构","settings.ca.eab_kid.errmsg.empty":"请输入EAB_KID","settings.ca.eab_hmac_key.errmsg.empty":"请输入EAB_HMAC_KEY","settings.ca.eab_kid_hmac_key.errmsg.empty":"请输入EAB_KID和EAB_HMAC_KEY"},TH={"domain.page.title":"域名列表","domain.nodata":"请添加域名开始部署证书吧。","domain.add":"新增域名","domain.edit":"编辑域名","domain.delete":"删除域名","domain.delete.confirm":"确定要删除域名吗?","domain.history":"部署历史","domain.deploy":"立即部署","domain.deploy.started.message":"开始部署","domain.deploy.started.tips":"已发起部署,请稍后查看部署日志。","domain.deploy.failed.message":"执行失败","domain.deploy.failed.tips":"执行失败,请在 <1>部署历史 查看详情。","domain.deploy_forced":"强行部署","domain.props.expiry":"有效期限","domain.props.expiry.date1":"有效期 {{date}} 天","domain.props.expiry.date2":"{{date}} 到期","domain.props.last_execution_status":"最近执行状态","domain.props.last_execution_stage":"最近执行阶段","domain.props.last_execution_time":"最近执行时间","domain.props.enable":"是否启用","domain.props.enable.enabled":"启用","domain.props.enable.disabled":"禁用","domain.application.tab":"申请配置","domain.application.form.domain.added.message":"域名添加成功","domain.application.form.domain.changed.message":"域名编辑成功","domain.application.form.email.label":"邮箱","domain.application.form.email.tips":"(申请证书需要提供邮箱)","domain.application.form.email.add":"添加邮箱","domain.application.form.email.list":"邮箱列表","domain.application.form.email.errmsg.empty":"请选择邮箱","domain.application.form.access.label":"DNS 服务商授权配置","domain.application.form.access.placeholder":"请选择 DNS 服务商授权配置","domain.application.form.access.errmsg.empty":"请选择 DNS 服务商授权配置","domain.application.form.access.list":"已有的 DNS 服务商授权配置","domain.application.form.timeout.label":"超时时间","domain.application.form.timeoue.placeholder":"超时时间(单位:秒)","domain.application.unsaved.message":"请先保存申请配置","domain.deployment.tab":"部署配置","domain.deployment.nodata":"暂无部署配置,请添加后开始部署证书吧","domain.deployment.form.type.label":"部署方式","domain.deployment.form.type.placeholder":"请选择部署方式","domain.deployment.form.type.list":"支持的部署方式","domain.deployment.form.access.label":"授权配置","domain.deployment.form.access.placeholder":"请选择授权配置","domain.deployment.form.access.list":"已有的服务商授权配置","domain.deployment.form.cdn_domain.label":"部署到域名","domain.deployment.form.cdn_domain.placeholder":"请输入 CDN 域名","domain.deployment.form.oss_endpoint.label":"Endpoint","domain.deployment.form.oss_bucket":"存储桶","domain.deployment.form.oss_bucket.placeholder":"请输入存储桶名","domain.deployment.form.variables.label":"变量","domain.deployment.form.variables.key":"变量名","domain.deployment.form.variables.value":"值","domain.deployment.form.variables.empty":"尚未添加变量","domain.deployment.form.variables.key.required":"变量名不能为空","domain.deployment.form.variables.value.required":"变量值不能为空","domain.deployment.form.variables.key.placeholder":"请输入变量名","domain.deployment.form.variables.value.placeholder":"请输入变量值"},PH={"access.page.title":"授权管理","access.authorization.tab":"授权","access.authorization.nodata":"请添加授权开始部署证书吧。","access.authorization.add":"新增授权","access.authorization.edit":"编辑授权","access.authorization.copy":"复制授权","access.authorization.delete":"删除授权","access.authorization.delete.confirm":"确定要删除授权吗?","access.authorization.form.type.label":"服务商","access.authorization.form.type.placeholder":"请选择服务商","access.authorization.form.type.list":"服务商列表","access.authorization.form.name.label":"名称","access.authorization.form.name.placeholder":"请输入授权名称","access.authorization.form.config.label":"配置类型","access.authorization.form.region.label":"Region","access.authorization.form.region.placeholder":"请输入区域","access.authorization.form.access_key_id.label":"AccessKeyId","access.authorization.form.access_key_id.placeholder":"请输入 AccessKeyId","access.authorization.form.access_key_secret.label":"AccessKeySecret","access.authorization.form.access_key_secret.placeholder":"请输入 AccessKeySecret","access.authorization.form.access_key.label":"AccessKey","access.authorization.form.access_key.placeholder":"请输入 AccessKey","access.authorization.form.secret_id.label":"SecretId","access.authorization.form.secret_id.placeholder":"请输入 SecretId","access.authorization.form.secret_key.label":"SecretKey","access.authorization.form.secret_key.placeholder":"请输入 SecretKey","access.authorization.form.cloud_dns_api_token.label":"CLOUD_DNS_API_TOKEN","access.authorization.form.cloud_dns_api_token.placeholder":"请输入 CLOUD_DNS_API_TOKEN","access.authorization.form.godaddy_api_key.label":"GO_DADDY_API_KEY","access.authorization.form.godaddy_api_key.placeholder":"请输入 GO_DADDY_API_KEY","access.authorization.form.godaddy_api_secret.label":"GO_DADDY_API_SECRET","access.authorization.form.godaddy_api_secret.placeholder":"请输入 GO_DADDY_API_SECRET","access.authorization.form.namesilo_api_key.label":"NAMESILO_API_KEY","access.authorization.form.namesilo_api_key.placeholder":"请输入 NAMESILO_API_KEY","access.authorization.form.username.label":"用户名","access.authorization.form.username.placeholder":"请输入用户名","access.authorization.form.password.label":"密码","access.authorization.form.password.placeholder":"请输入密码","access.authorization.form.access_group.placeholder":"请选择分组","access.authorization.form.ssh_group.label":"授权配置组(用于将一个域名证书部署到多个 SSH 主机)","access.authorization.form.ssh_host.label":"服务器 Host","access.authorization.form.ssh_host.placeholder":"请输入 Host","access.authorization.form.ssh_port.label":"SSH 端口","access.authorization.form.ssh_port.placeholder":"请输入 Port","access.authorization.form.ssh_key.label":"Key(使用私钥登录)","access.authorization.form.ssh_key.placeholder":"请输入 Key","access.authorization.form.ssh_key_file.placeholder":"请选择文件","access.authorization.form.ssh_key.label.passphrase":"私钥密码","access.authorization.form.ssh_key_path.label":"私钥保存路径","access.authorization.form.ssh_key_path.placeholder":"请输入私钥保存路径","access.authorization.form.ssh_cert_path.label":"证书保存路径","access.authorization.form.ssh_cert_path.placeholder":"请输入证书保存路径","access.authorization.form.ssh_pre_command.label":"前置 Command","access.authorization.form.ssh_pre_command.placeholder":"在部署证书前执行的前置命令","access.authorization.form.ssh_command.label":"Command","access.authorization.form.ssh_command.placeholder":"请输入要执行的命令","access.authorization.form.webhook_url.label":"Webhook URL","access.authorization.form.webhook_url.placeholder":"请输入 Webhook URL","access.group.tab":"授权组","access.group.nodata":"暂无部署授权配置,请添加后开始使用吧","access.group.total":"共有 {{total}} 个部署授权配置","access.group.add":"添加授权组","access.group.delete":"删除组","access.group.delete.confirm":"确定要删除部署授权组吗?","access.group.form.name.label":"组名","access.group.form.name.errmsg.empty":"请输入组名","access.group.domains":"所有授权","access.group.domains.nodata":"请添加域名开始部署证书吧。"},RH={"history.page.title":"部署","history.nodata":"你暂未创建任何部署,请先添加域名进行部署吧!","history.props.domain":"域名","history.props.status":"状态","history.props.stage":"阶段","history.props.stage.progress.check":"检查","history.props.stage.progress.apply":"获取","history.props.stage.progress.deploy":"部署","history.props.last_execution_time":"最近执行时间","history.log":"日志"},AH=Object.freeze({...CH,...jH,...EH,...NH,...TH,...PH,...RH}),DH={"common.save":"Save","common.save.succeeded.message":"Save Successful","common.save.failed.message":"Save Failed","common.add":"Add","common.edit":"Edit","common.copy":"Copy","common.download":"Download","common.delete":"Delete","common.delete.succeeded.message":"Delete Successful","common.delete.failed.message":"Delete Failed","common.next":"Next","common.confirm":"Confirm","common.cancel":"Cancel","common.submit":"Submit","common.update":"Update","common.update.succeeded.message":"Update Successful","common.update.failed.message":"Update Failed","common.text.domain":"Domain","common.text.domain.empty":"No Domain","common.text.ip":"IP Address","common.text.ip.empty":"No IP address","common.text.dns":"Domain Name Server","common.text.dns.empty":"No DNS","common.text.ca":"Certificate Authority","common.text.provider":"Provider","common.text.name":"Name","common.text.created_at":"Created At","common.text.updated_at":"Updated At","common.text.operations":"Operations","common.text.nodata":"No data available","common.menu.settings":"Settings","common.menu.logout":"Logout","common.menu.document":"Document","common.pagination.next":"Next","common.pagination.prev":"Previous","common.pagination.more":"More pages","common.theme.light":"Light","common.theme.dark":"Dark","common.theme.system":"System","common.errmsg.string_max":"Please enter no more than {{max}} characters","common.errmsg.email_invalid":"Please enter a valid email address","common.errmsg.email_empty":"Please enter email","common.errmsg.email_duplicate":"Email already exists","common.errmsg.domain_invalid":"Please enter domain","common.errmsg.host_invalid":"Please enter the correct domain name or IP","common.errmsg.ip_invalid":"Please enter IP","common.errmsg.url_invalid":"Please enter a valid URL","common.provider.aliyun":"Alibaba Cloud","common.provider.aliyun.oss":"Alibaba Cloud - OSS","common.provider.aliyun.cdn":"Alibaba Cloud - CDN","common.provider.aliyun.dcdn":"Alibaba Cloud - DCDN","common.provider.tencent":"Tencent","common.provider.tencent.cdn":"Tencent - CDN","common.provider.huaweicloud":"Huawei Cloud","common.provider.qiniu":"Qiniu","common.provider.qiniu.cdn":"Qiniu - CDN","common.provider.cloudflare":"Cloudflare","common.provider.namesilo":"Namesilo","common.provider.godaddy":"GoDaddy","common.provider.local":"Local Deployment","common.provider.ssh":"SSH Deployment","common.provider.webhook":"Webhook","common.provider.dingtalk":"DingTalk","common.provider.telegram":"Telegram"},OH={"login.username.label":"Username","login.username.placeholder":"Username/Email","login.username.errmsg.invalid":"Please enter a valid email address","login.password.label":"Password","login.password.placeholder":"Password","login.password.errmsg.invalid":"Password should be at least 10 characters","login.submit":"Log In"},IH={"dashboard.page.title":"Dashboard","dashboard.statistics.all":"All","dashboard.statistics.near_expired":"About to Expire","dashboard.statistics.enabled":"Enabled","dashboard.statistics.disabled":"Not Enabled","dashboard.statistics.unit":"","dashboard.history":"Deployment History"},MH={"settings.page.title":"Settings","settings.account.relogin.message":"Please login again","settings.account.tab":"Account","settings.account.email.label":"Email","settings.account.email.placeholder":"Please enter email","settings.account.email.errmsg.invalid":"Please enter a valid email address","settings.account.email.changed.message":"Account email altered successfully","settings.account.email.failed.message":"Account email alteration failed","settings.password.tab":"Password","settings.password.current_password.label":"Current Password","settings.password.current_password.placeholder":"Please enter the current password","settings.password.new_password.label":"New Password","settings.password.new_password.placeholder":"Please enter the new password","settings.password.confirm_password.label":"Confirm Password","settings.password.confirm_password.placeholder":"Please enter the new password again","settings.password.password.errmsg.length":"Password should be at least 10 characters","settings.password.password.errmsg.not_matched":"Passwords do not match","settings.password.changed.message":"Password changed successfully","settings.password.failed.message":"Password change failed","settings.notification.tab":"Notification","settings.notification.template.label":"Template","settings.notification.template.saved.message":"Notification template saved successfully","settings.notification.template.variables.tips.title":"Optional variables ({COUNT}: number of expiring soon)","settings.notification.template.variables.tips.content":"Optional variables ({COUNT}: number of expiring soon. {DOMAINS}: Domain list)","settings.notification.config.enable":"Enable","settings.notification.config.saved.message":"Configuration saved successfully","settings.notification.config.failed.message":"Configuration save failed","settings.notification.dingtalk.secret.placeholder":"Signature for signed addition","settings.notification.url.errmsg.invalid":"Invalid Url format","settings.ca.tab":"Certificate Authority","settings.ca.provider.errmsg.empty":"Please select a Certificate Authority","settings.ca.eab_kid.errmsg.empty":"Please enter EAB_KID","settings.ca.eab_hmac_key.errmsg.empty":"Please enter EAB_HMAC_KEY.","settings.ca.eab_kid_hmac_key.errmsg.empty":"Please enter EAB_KID and EAB_HMAC_KEY"},LH={"domain.page.title":"Domain List","domain.nodata":"Please add a domain to start deploying the certificate.","domain.add":"Add Domain","domain.edit":"Edit Domain","domain.delete":"Delete Domain","domain.delete.confirm":"Are you sure you want to delete this domain?","domain.history":"Deployment History","domain.deploy":"Deploy Now","domain.deploy.started.message":"Deploy Started","domain.deploy.started.tips":"Deployment initiated, please check the deployment log later.","domain.deploy.failed.message":"Execution Failed","domain.deploy.failed.tips":"Execution failed, please check the details in <1>Deployment History.","domain.deploy_forced":"Force Deployment","domain.props.expiry":"Validity Period","domain.props.expiry.date1":"Valid for {{date}} days","domain.props.expiry.date2":"Expiry on {{date}}","domain.props.last_execution_status":"Last Execution Status","domain.props.last_execution_stage":"Last Execution Stage","domain.props.last_execution_time":"Last Execution Time","domain.props.enable":"Enable","domain.props.enable.enabled":"Enable","domain.props.enable.disabled":"Disable","domain.application.tab":"Apply Settings","domain.application.form.domain.added.message":"Domain added successfully","domain.application.form.domain.changed.message":"Domain updated successfully","domain.application.form.email.label":"Email","domain.application.form.email.tips":"(A email is required to apply for a certificate)","domain.application.form.email.add":"Add Email","domain.application.form.email.list":"Email List","domain.application.form.email.errmsg.empty":"Please select email","domain.application.form.access.label":"DNS Provider Authorization Configuration","domain.application.form.access.placeholder":"Please select DNS provider authorization configuration","domain.application.form.access.errmsg.empty":"Please select DNS provider authorization configuration","domain.application.form.access.list":"Provider Authorization Configurations","domain.application.form.timeout.label":"Timeout","domain.application.form.timeoue.placeholder":"Timeout (seconds)","domain.application.unsaved.message":"Please save applyment configuration first","domain.deployment.tab":"Deploy Settings","domain.deployment.nodata":"Deployment not added yet","domain.deployment.form.type.label":"Deploy Method","domain.deployment.form.type.placeholder":"Please select deploy method","domain.deployment.form.type.list":"Deploy Method List","domain.deployment.form.access.label":"Access Configuration","domain.deployment.form.access.placeholder":"Please select provider authorization configuration","domain.deployment.form.access.list":"Provider Authorization Configurations","domain.deployment.form.cdn_domain.label":"Deploy to domain","domain.deployment.form.cdn_domain.placeholder":"Please enter CDN domain","domain.deployment.form.oss_endpoint.label":"Endpoint","domain.deployment.form.oss_bucket":"Bucket","domain.deployment.form.oss_bucket.placeholder":"Please enter Bucket","domain.deployment.form.variables.label":"Variable","domain.deployment.form.variables.key":"Name","domain.deployment.form.variables.value":"Value","domain.deployment.form.variables.empty":"Variable not added yet","domain.deployment.form.variables.key.required":"Variable name cannot be empty","domain.deployment.form.variables.value.required":"Variable value cannot be empty","domain.deployment.form.variables.key.placeholder":"Variable name","domain.deployment.form.variables.value.placeholder":"Variable value"},zH={"access.page.title":"Authorization Management","access.authorization.tab":"Authorization","access.authorization.nodata":"Please add authorization to start deploying certificate.","access.authorization.add":"Add Authorization","access.authorization.edit":"Edit Authorization","access.authorization.copy":"Copy Authorization","access.authorization.delete":"Delete Authorization","access.authorization.delete.confirm":"Are you sure you want to delete the deployment authorization?","access.authorization.form.type.label":"Provider","access.authorization.form.type.placeholder":"Please select a provider","access.authorization.form.type.list":"Authorization List","access.authorization.form.name.label":"Name","access.authorization.form.name.placeholder":"Please enter authorization name","access.authorization.form.config.label":"Configuration Type","access.authorization.form.region.label":"Region","access.authorization.form.region.placeholder":"Please enter Region","access.authorization.form.access_key_id.label":"AccessKeyId","access.authorization.form.access_key_id.placeholder":"Please enter AccessKeyId","access.authorization.form.access_key_secret.label":"AccessKeySecret","access.authorization.form.access_key_secret.placeholder":"Please enter AccessKeySecret","access.authorization.form.access_key.label":"AccessKey","access.authorization.form.access_key.placeholder":"Please enter AccessKey","access.authorization.form.secret_id.label":"SecretId","access.authorization.form.secret_id.placeholder":"Please enter SecretId","access.authorization.form.secret_key.label":"SecretKey","access.authorization.form.secret_key.placeholder":"Please enter SecretKey","access.authorization.form.cloud_dns_api_token.label":"CLOUD_DNS_API_TOKEN","access.authorization.form.cloud_dns_api_token.placeholder":"Please enter CLOUD_DNS_API_TOKEN","access.authorization.form.godaddy_api_key.label":"GO_DADDY_API_KEY","access.authorization.form.godaddy_api_key.placeholder":"Please enter GO_DADDY_API_KEY","access.authorization.form.godaddy_api_secret.label":"GO_DADDY_API_SECRET","access.authorization.form.godaddy_api_secret.placeholder":"Please enter GO_DADDY_API_SECRET","access.authorization.form.namesilo_api_key.label":"NAMESILO_API_KEY","access.authorization.form.namesilo_api_key.placeholder":"Please enter NAMESILO_API_KEY","access.authorization.form.username.label":"Username","access.authorization.form.username.placeholder":"Please enter username","access.authorization.form.password.label":"Password","access.authorization.form.password.placeholder":"Please enter password","access.authorization.form.access_group.placeholder":"Please select a group","access.authorization.form.ssh_group.label":"Authorization Configuration Group (used to deploy a single domain certificate to multiple SSH hosts)","access.authorization.form.ssh_host.label":"Server Host","access.authorization.form.ssh_host.placeholder":"Please enter Host","access.authorization.form.ssh_port.label":"SSH Port","access.authorization.form.ssh_port.placeholder":"Please enter Port","access.authorization.form.ssh_key.label":"Key (Log in using private key)","access.authorization.form.ssh_key.placeholder":"Please enter Key","access.authorization.form.ssh_key_file.placeholder":"Please select file","access.authorization.form.ssh_key_path.label":"Private Key Save Path","access.authorization.form.ssh_key_path.placeholder":"Please enter private key save path","access.authorization.form.ssh_cert_path.label":"Certificate Save Path","access.authorization.form.ssh_cert_path.placeholder":"Please enter certificate save path","access.authorization.form.ssh_pre_command.label":"Pre-deployment Command","access.authorization.form.ssh_pre_command.placeholder":"Command to be executed before deploying the certificate","access.authorization.form.ssh_command.label":"Command","access.authorization.form.ssh_command.placeholder":"Please enter command","access.authorization.form.webhook_url.label":"Webhook URL","access.authorization.form.webhook_url.placeholder":"Please enter Webhook URL","access.group.tab":"Authorization Group","access.group.nodata":"No deployment authorization configuration yet, please add after starting use.","access.group.total":"Totally {{total}} deployment authorization configuration","access.group.add":"Add Group","access.group.delete":"Delete Group","access.group.delete.confirm":"Are you sure you want to delete the deployment authorization group?","access.group.form.name.label":"Group Name","access.group.form.name.errmsg.empty":"Please enter group name","access.group.domains":"All Authorizations","access.group.domains.nodata":"Please add a domain to start deploying the certificate."},FH={"history.page.title":"Deployment","history.nodata":"You have not created any deployments yet, please add a domain to start deployment!","history.props.domain":"Domain","history.props.status":"Status","history.props.stage":"Stage","history.props.stage.progress.check":"Check","history.props.stage.progress.apply":"Apply","history.props.stage.progress.deploy":"Deploy","history.props.last_execution_time":"Last Execution Time","history.log":"Log"},$H=Object.freeze({...DH,...OH,...IH,...MH,...LH,...zH,...FH}),UH={zh:{name:"简体中文",translation:AH},en:{name:"English",translation:$H}};vn.use(cP).use(VO).init({resources:UH,fallbackLng:"zh",debug:!0,interpolation:{escapeValue:!1},backend:{loadPath:"/locales/{{lng}}.json"}});yp.createRoot(document.getElementById("root")).render(l.jsx(We.StrictMode,{children:l.jsx(UF,{defaultTheme:"system",storageKey:"vite-ui-theme",children:l.jsx(yO,{router:VW})})}))});export default VH(); +\0`,se+=o($,2),se+=j.magic,se+=o(b,2),se+=o(_,2),se+=o(X.crc32,4),se+=o(X.compressedSize,4),se+=o(X.uncompressedSize,4),se+=o(R.length,2),se+=o(U.length,2),{fileRecord:f.LOCAL_FILE_HEADER+se+R+U,dirRecord:f.CENTRAL_FILE_HEADER+o(he,2)+se+o(G.length,2)+"\0\0\0\0"+o(B,4)+o(w,4)+R+U+G}}var a=n("../utils"),c=n("../stream/GenericWorker"),u=n("../utf8"),d=n("../crc32"),f=n("../signature");function h(m,x,p,w){c.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=x,this.zipPlatform=p,this.encodeFileName=w,this.streamFiles=m,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(h,c),h.prototype.push=function(m){var x=m.meta.percent||0,p=this.entriesCount,w=this._sources.length;this.accumulate?this.contentBuffer.push(m):(this.bytesWritten+=m.data.length,c.prototype.push.call(this,{data:m.data,meta:{currentFile:this.currentFile,percent:p?(x+100*(p-w-1))/p:100}}))},h.prototype.openedSource=function(m){this.currentSourceOffset=this.bytesWritten,this.currentFile=m.file.name;var x=this.streamFiles&&!m.file.dir;if(x){var p=i(m,x,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:p.fileRecord,meta:{percent:0}})}else this.accumulate=!0},h.prototype.closedSource=function(m){this.accumulate=!1;var x=this.streamFiles&&!m.file.dir,p=i(m,x,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(p.dirRecord),x)this.push({data:function(w){return f.DATA_DESCRIPTOR+o(w.crc32,4)+o(w.compressedSize,4)+o(w.uncompressedSize,4)}(m),meta:{percent:100}});else for(this.push({data:p.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},h.prototype.flush=function(){for(var m=this.bytesWritten,x=0;x=this.index;c--)u=(u<<8)+this.byteAt(c);return this.index+=a,u},readString:function(a){return o.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))}},r.exports=i},{"../utils":32}],19:[function(n,r,s){var o=n("./Uint8ArrayReader");function i(a){o.call(this,a)}n("../utils").inherits(i,o),i.prototype.readData=function(a){this.checkOffset(a);var c=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,c},r.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(n,r,s){var o=n("./DataReader");function i(a){o.call(this,a)}n("../utils").inherits(i,o),i.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+a)},i.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero},i.prototype.readAndCheckSignature=function(a){return a===this.readData(4)},i.prototype.readData=function(a){this.checkOffset(a);var c=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,c},r.exports=i},{"../utils":32,"./DataReader":18}],21:[function(n,r,s){var o=n("./ArrayReader");function i(a){o.call(this,a)}n("../utils").inherits(i,o),i.prototype.readData=function(a){if(this.checkOffset(a),a===0)return new Uint8Array(0);var c=this.data.subarray(this.zero+this.index,this.zero+this.index+a);return this.index+=a,c},r.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(n,r,s){var o=n("../utils"),i=n("../support"),a=n("./ArrayReader"),c=n("./StringReader"),u=n("./NodeBufferReader"),d=n("./Uint8ArrayReader");r.exports=function(f){var h=o.getTypeOf(f);return o.checkSupport(h),h!=="string"||i.uint8array?h==="nodebuffer"?new u(f):i.uint8array?new d(o.transformTo("uint8array",f)):new a(o.transformTo("array",f)):new c(f)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(n,r,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(n,r,s){var o=n("./GenericWorker"),i=n("../utils");function a(c){o.call(this,"ConvertWorker to "+c),this.destType=c}i.inherits(a,o),a.prototype.processChunk=function(c){this.push({data:i.transformTo(this.destType,c.data),meta:c.meta})},r.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(n,r,s){var o=n("./GenericWorker"),i=n("../crc32");function a(){o.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}n("../utils").inherits(a,o),a.prototype.processChunk=function(c){this.streamInfo.crc32=i(c.data,this.streamInfo.crc32||0),this.push(c)},r.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(n,r,s){var o=n("../utils"),i=n("./GenericWorker");function a(c){i.call(this,"DataLengthProbe for "+c),this.propName=c,this.withStreamInfo(c,0)}o.inherits(a,i),a.prototype.processChunk=function(c){if(c){var u=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=u+c.data.length}i.prototype.processChunk.call(this,c)},r.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(n,r,s){var o=n("../utils"),i=n("./GenericWorker");function a(c){i.call(this,"DataWorker");var u=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,c.then(function(d){u.dataIsReady=!0,u.data=d,u.max=d&&d.length||0,u.type=o.getTypeOf(d),u.isPaused||u._tickAndRepeat()},function(d){u.error(d)})}o.inherits(a,i),a.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,o.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(o.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var c=null,u=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":c=this.data.substring(this.index,u);break;case"uint8array":c=this.data.subarray(this.index,u);break;case"array":case"nodebuffer":c=this.data.slice(this.index,u)}return this.index=u,this.push({data:c,meta:{percent:this.max?this.index/this.max*100:0}})},r.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(n,r,s){function o(i){this.name=i||"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}o.prototype={push:function(i){this.emit("data",i)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(i){this.emit("error",i)}return!0},error:function(i){return!this.isFinished&&(this.isPaused?this.generatedError=i:(this.isFinished=!0,this.emit("error",i),this.previous&&this.previous.error(i),this.cleanUp()),!0)},on:function(i,a){return this._listeners[i].push(a),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(i,a){if(this._listeners[i])for(var c=0;c "+i:i}},r.exports=o},{}],29:[function(n,r,s){var o=n("../utils"),i=n("./ConvertWorker"),a=n("./GenericWorker"),c=n("../base64"),u=n("../support"),d=n("../external"),f=null;if(u.nodestream)try{f=n("../nodejs/NodejsStreamOutputAdapter")}catch{}function h(x,p){return new d.Promise(function(w,g){var v=[],b=x._internalType,_=x._outputType,C=x._mimeType;x.on("data",function(j,T){v.push(j),p&&p(T)}).on("error",function(j){v=[],g(j)}).on("end",function(){try{var j=function(T,R,A){switch(T){case"blob":return o.newBlob(o.transformTo("arraybuffer",R),A);case"base64":return c.encode(R);default:return o.transformTo(T,R)}}(_,function(T,R){var A,O=0,G=null,N=0;for(A=0;A"u")s.blob=!1;else{var o=new ArrayBuffer(0);try{s.blob=new Blob([o],{type:"application/zip"}).size===0}catch{try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);i.append(o),s.blob=i.getBlob("application/zip").size===0}catch{s.blob=!1}}}try{s.nodestream=!!n("readable-stream").Readable}catch{s.nodestream=!1}},{"readable-stream":16}],31:[function(n,r,s){for(var o=n("./utils"),i=n("./support"),a=n("./nodejsUtils"),c=n("./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(){c.call(this,"utf-8 decode"),this.leftOver=null}function h(){c.call(this,"utf-8 encode")}s.utf8encode=function(m){return i.nodebuffer?a.newBufferFrom(m,"utf-8"):function(x){var p,w,g,v,b,_=x.length,C=0;for(v=0;v<_;v++)(64512&(w=x.charCodeAt(v)))==55296&&v+1<_&&(64512&(g=x.charCodeAt(v+1)))==56320&&(w=65536+(w-55296<<10)+(g-56320),v++),C+=w<128?1:w<2048?2:w<65536?3:4;for(p=i.uint8array?new Uint8Array(C):new Array(C),v=b=0;b>>6:(w<65536?p[b++]=224|w>>>12:(p[b++]=240|w>>>18,p[b++]=128|w>>>12&63),p[b++]=128|w>>>6&63),p[b++]=128|63&w);return p}(m)},s.utf8decode=function(m){return i.nodebuffer?o.transformTo("nodebuffer",m).toString("utf-8"):function(x){var p,w,g,v,b=x.length,_=new Array(2*b);for(p=w=0;p>10&1023,_[w++]=56320|1023&g)}return _.length!==w&&(_.subarray?_=_.subarray(0,w):_.length=w),o.applyFromCharCode(_)}(m=o.transformTo(i.uint8array?"uint8array":"array",m))},o.inherits(f,c),f.prototype.processChunk=function(m){var x=o.transformTo(i.uint8array?"uint8array":"array",m.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var p=x;(x=new Uint8Array(p.length+this.leftOver.length)).set(this.leftOver,0),x.set(p,this.leftOver.length)}else x=this.leftOver.concat(x);this.leftOver=null}var w=function(v,b){var _;for((b=b||v.length)>v.length&&(b=v.length),_=b-1;0<=_&&(192&v[_])==128;)_--;return _<0||_===0?b:_+u[v[_]]>b?_:b}(x),g=x;w!==x.length&&(i.uint8array?(g=x.subarray(0,w),this.leftOver=x.subarray(w,x.length)):(g=x.slice(0,w),this.leftOver=x.slice(w,x.length))),this.push({data:s.utf8decode(g),meta:m.meta})},f.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:s.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},s.Utf8DecodeWorker=f,o.inherits(h,c),h.prototype.processChunk=function(m){this.push({data:s.utf8encode(m.data),meta:m.meta})},s.Utf8EncodeWorker=h},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(n,r,s){var o=n("./support"),i=n("./base64"),a=n("./nodejsUtils"),c=n("./external");function u(p){return p}function d(p,w){for(var g=0;g>8;this.dir=!!(16&this.externalFileAttributes),m==0&&(this.dosPermissions=63&this.externalFileAttributes),m==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var m=o(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=m.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=m.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=m.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=m.readInt(4))}},readExtraFields:function(m){var x,p,w,g=m.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});m.index+4>>6:(m<65536?h[w++]=224|m>>>12:(h[w++]=240|m>>>18,h[w++]=128|m>>>12&63),h[w++]=128|m>>>6&63),h[w++]=128|63&m);return h},s.buf2binstring=function(f){return d(f,f.length)},s.binstring2buf=function(f){for(var h=new o.Buf8(f.length),m=0,x=h.length;m>10&1023,v[x++]=56320|1023&p)}return d(v,x)},s.utf8border=function(f,h){var m;for((h=h||f.length)>f.length&&(h=f.length),m=h-1;0<=m&&(192&f[m])==128;)m--;return m<0||m===0?h:m+c[f[m]]>h?m:h}},{"./common":41}],43:[function(n,r,s){r.exports=function(o,i,a,c){for(var u=65535&o|0,d=o>>>16&65535|0,f=0;a!==0;){for(a-=f=2e3>>1:i>>>1;a[c]=i}return a}();r.exports=function(i,a,c,u){var d=o,f=u+c;i^=-1;for(var h=u;h>>8^d[255&(i^a[h])];return-1^i}},{}],46:[function(n,r,s){var o,i=n("../utils/common"),a=n("./trees"),c=n("./adler32"),u=n("./crc32"),d=n("./messages"),f=0,h=4,m=0,x=-2,p=-1,w=4,g=2,v=8,b=9,_=286,C=30,j=19,T=2*_+1,R=15,A=3,O=258,G=O+A+1,N=42,z=113,S=1,U=2,J=3,F=4;function W(E,ee){return E.msg=d[ee],ee}function I(E){return(E<<1)-(4E.avail_out&&(Z=E.avail_out),Z!==0&&(i.arraySet(E.output,ee.pending_buf,ee.pending_out,Z,E.next_out),E.next_out+=Z,ee.pending_out+=Z,E.total_out+=Z,E.avail_out-=Z,ee.pending-=Z,ee.pending===0&&(ee.pending_out=0))}function B(E,ee){a._tr_flush_block(E,0<=E.block_start?E.block_start:-1,E.strstart-E.block_start,ee),E.block_start=E.strstart,$(E.strm)}function he(E,ee){E.pending_buf[E.pending++]=ee}function se(E,ee){E.pending_buf[E.pending++]=ee>>>8&255,E.pending_buf[E.pending++]=255&ee}function oe(E,ee){var Z,D,k=E.max_chain_length,P=E.strstart,M=E.prev_length,K=E.nice_match,L=E.strstart>E.w_size-G?E.strstart-(E.w_size-G):0,Y=E.window,Q=E.w_mask,te=E.prev,ge=E.strstart+O,Ke=Y[P+M-1],Ue=Y[P+M];E.prev_length>=E.good_match&&(k>>=2),K>E.lookahead&&(K=E.lookahead);do if(Y[(Z=ee)+M]===Ue&&Y[Z+M-1]===Ke&&Y[Z]===Y[P]&&Y[++Z]===Y[P+1]){P+=2,Z++;do;while(Y[++P]===Y[++Z]&&Y[++P]===Y[++Z]&&Y[++P]===Y[++Z]&&Y[++P]===Y[++Z]&&Y[++P]===Y[++Z]&&Y[++P]===Y[++Z]&&Y[++P]===Y[++Z]&&Y[++P]===Y[++Z]&&PL&&--k!=0);return M<=E.lookahead?M:E.lookahead}function Oe(E){var ee,Z,D,k,P,M,K,L,Y,Q,te=E.w_size;do{if(k=E.window_size-E.lookahead-E.strstart,E.strstart>=te+(te-G)){for(i.arraySet(E.window,E.window,te,te,0),E.match_start-=te,E.strstart-=te,E.block_start-=te,ee=Z=E.hash_size;D=E.head[--ee],E.head[ee]=te<=D?D-te:0,--Z;);for(ee=Z=te;D=E.prev[--ee],E.prev[ee]=te<=D?D-te:0,--Z;);k+=te}if(E.strm.avail_in===0)break;if(M=E.strm,K=E.window,L=E.strstart+E.lookahead,Y=k,Q=void 0,Q=M.avail_in,Y=A)for(P=E.strstart-E.insert,E.ins_h=E.window[P],E.ins_h=(E.ins_h<=A&&(E.ins_h=(E.ins_h<=A)if(D=a._tr_tally(E,E.strstart-E.match_start,E.match_length-A),E.lookahead-=E.match_length,E.match_length<=E.max_lazy_match&&E.lookahead>=A){for(E.match_length--;E.strstart++,E.ins_h=(E.ins_h<=A&&(E.ins_h=(E.ins_h<=A&&E.match_length<=E.prev_length){for(k=E.strstart+E.lookahead-A,D=a._tr_tally(E,E.strstart-1-E.prev_match,E.prev_length-A),E.lookahead-=E.prev_length-1,E.prev_length-=2;++E.strstart<=k&&(E.ins_h=(E.ins_h<E.pending_buf_size-5&&(Z=E.pending_buf_size-5);;){if(E.lookahead<=1){if(Oe(E),E.lookahead===0&&ee===f)return S;if(E.lookahead===0)break}E.strstart+=E.lookahead,E.lookahead=0;var D=E.block_start+Z;if((E.strstart===0||E.strstart>=D)&&(E.lookahead=E.strstart-D,E.strstart=D,B(E,!1),E.strm.avail_out===0)||E.strstart-E.block_start>=E.w_size-G&&(B(E,!1),E.strm.avail_out===0))return S}return E.insert=0,ee===h?(B(E,!0),E.strm.avail_out===0?J:F):(E.strstart>E.block_start&&(B(E,!1),E.strm.avail_out),S)}),new Te(4,4,8,4,me),new Te(4,5,16,8,me),new Te(4,6,32,32,me),new Te(4,4,16,16,we),new Te(8,16,32,32,we),new Te(8,16,128,128,we),new Te(8,32,128,256,we),new Te(32,128,258,1024,we),new Te(32,258,258,4096,we)],s.deflateInit=function(E,ee){return st(E,ee,v,15,8,0)},s.deflateInit2=st,s.deflateReset=Re,s.deflateResetKeep=Ie,s.deflateSetHeader=function(E,ee){return E&&E.state?E.state.wrap!==2?x:(E.state.gzhead=ee,m):x},s.deflate=function(E,ee){var Z,D,k,P;if(!E||!E.state||5>8&255),he(D,D.gzhead.time>>16&255),he(D,D.gzhead.time>>24&255),he(D,D.level===9?2:2<=D.strategy||D.level<2?4:0),he(D,255&D.gzhead.os),D.gzhead.extra&&D.gzhead.extra.length&&(he(D,255&D.gzhead.extra.length),he(D,D.gzhead.extra.length>>8&255)),D.gzhead.hcrc&&(E.adler=u(E.adler,D.pending_buf,D.pending,0)),D.gzindex=0,D.status=69):(he(D,0),he(D,0),he(D,0),he(D,0),he(D,0),he(D,D.level===9?2:2<=D.strategy||D.level<2?4:0),he(D,3),D.status=z);else{var M=v+(D.w_bits-8<<4)<<8;M|=(2<=D.strategy||D.level<2?0:D.level<6?1:D.level===6?2:3)<<6,D.strstart!==0&&(M|=32),M+=31-M%31,D.status=z,se(D,M),D.strstart!==0&&(se(D,E.adler>>>16),se(D,65535&E.adler)),E.adler=1}if(D.status===69)if(D.gzhead.extra){for(k=D.pending;D.gzindex<(65535&D.gzhead.extra.length)&&(D.pending!==D.pending_buf_size||(D.gzhead.hcrc&&D.pending>k&&(E.adler=u(E.adler,D.pending_buf,D.pending-k,k)),$(E),k=D.pending,D.pending!==D.pending_buf_size));)he(D,255&D.gzhead.extra[D.gzindex]),D.gzindex++;D.gzhead.hcrc&&D.pending>k&&(E.adler=u(E.adler,D.pending_buf,D.pending-k,k)),D.gzindex===D.gzhead.extra.length&&(D.gzindex=0,D.status=73)}else D.status=73;if(D.status===73)if(D.gzhead.name){k=D.pending;do{if(D.pending===D.pending_buf_size&&(D.gzhead.hcrc&&D.pending>k&&(E.adler=u(E.adler,D.pending_buf,D.pending-k,k)),$(E),k=D.pending,D.pending===D.pending_buf_size)){P=1;break}P=D.gzindexk&&(E.adler=u(E.adler,D.pending_buf,D.pending-k,k)),P===0&&(D.gzindex=0,D.status=91)}else D.status=91;if(D.status===91)if(D.gzhead.comment){k=D.pending;do{if(D.pending===D.pending_buf_size&&(D.gzhead.hcrc&&D.pending>k&&(E.adler=u(E.adler,D.pending_buf,D.pending-k,k)),$(E),k=D.pending,D.pending===D.pending_buf_size)){P=1;break}P=D.gzindexk&&(E.adler=u(E.adler,D.pending_buf,D.pending-k,k)),P===0&&(D.status=103)}else D.status=103;if(D.status===103&&(D.gzhead.hcrc?(D.pending+2>D.pending_buf_size&&$(E),D.pending+2<=D.pending_buf_size&&(he(D,255&E.adler),he(D,E.adler>>8&255),E.adler=0,D.status=z)):D.status=z),D.pending!==0){if($(E),E.avail_out===0)return D.last_flush=-1,m}else if(E.avail_in===0&&I(ee)<=I(Z)&&ee!==h)return W(E,-5);if(D.status===666&&E.avail_in!==0)return W(E,-5);if(E.avail_in!==0||D.lookahead!==0||ee!==f&&D.status!==666){var K=D.strategy===2?function(L,Y){for(var Q;;){if(L.lookahead===0&&(Oe(L),L.lookahead===0)){if(Y===f)return S;break}if(L.match_length=0,Q=a._tr_tally(L,0,L.window[L.strstart]),L.lookahead--,L.strstart++,Q&&(B(L,!1),L.strm.avail_out===0))return S}return L.insert=0,Y===h?(B(L,!0),L.strm.avail_out===0?J:F):L.last_lit&&(B(L,!1),L.strm.avail_out===0)?S:U}(D,ee):D.strategy===3?function(L,Y){for(var Q,te,ge,Ke,Ue=L.window;;){if(L.lookahead<=O){if(Oe(L),L.lookahead<=O&&Y===f)return S;if(L.lookahead===0)break}if(L.match_length=0,L.lookahead>=A&&0L.lookahead&&(L.match_length=L.lookahead)}if(L.match_length>=A?(Q=a._tr_tally(L,1,L.match_length-A),L.lookahead-=L.match_length,L.strstart+=L.match_length,L.match_length=0):(Q=a._tr_tally(L,0,L.window[L.strstart]),L.lookahead--,L.strstart++),Q&&(B(L,!1),L.strm.avail_out===0))return S}return L.insert=0,Y===h?(B(L,!0),L.strm.avail_out===0?J:F):L.last_lit&&(B(L,!1),L.strm.avail_out===0)?S:U}(D,ee):o[D.level].func(D,ee);if(K!==J&&K!==F||(D.status=666),K===S||K===J)return E.avail_out===0&&(D.last_flush=-1),m;if(K===U&&(ee===1?a._tr_align(D):ee!==5&&(a._tr_stored_block(D,0,0,!1),ee===3&&(X(D.head),D.lookahead===0&&(D.strstart=0,D.block_start=0,D.insert=0))),$(E),E.avail_out===0))return D.last_flush=-1,m}return ee!==h?m:D.wrap<=0?1:(D.wrap===2?(he(D,255&E.adler),he(D,E.adler>>8&255),he(D,E.adler>>16&255),he(D,E.adler>>24&255),he(D,255&E.total_in),he(D,E.total_in>>8&255),he(D,E.total_in>>16&255),he(D,E.total_in>>24&255)):(se(D,E.adler>>>16),se(D,65535&E.adler)),$(E),0=Z.w_size&&(P===0&&(X(Z.head),Z.strstart=0,Z.block_start=0,Z.insert=0),Y=new i.Buf8(Z.w_size),i.arraySet(Y,ee,Q-Z.w_size,Z.w_size,0),ee=Y,Q=Z.w_size),M=E.avail_in,K=E.next_in,L=E.input,E.avail_in=Q,E.next_in=0,E.input=ee,Oe(Z);Z.lookahead>=A;){for(D=Z.strstart,k=Z.lookahead-(A-1);Z.ins_h=(Z.ins_h<>>=A=R>>>24,b-=A,(A=R>>>16&255)===0)U[d++]=65535&R;else{if(!(16&A)){if(!(64&A)){R=_[(65535&R)+(v&(1<>>=A,b-=A),b<15&&(v+=S[c++]<>>=A=R>>>24,b-=A,!(16&(A=R>>>16&255))){if(!(64&A)){R=C[(65535&R)+(v&(1<>>=A,b-=A,(A=d-f)>3,v&=(1<<(b-=O<<3))-1,o.next_in=c,o.next_out=d,o.avail_in=c>>24&255)+(N>>>8&65280)+((65280&N)<<8)+((255&N)<<24)}function v(){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 o.Buf16(320),this.work=new o.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function b(N){var z;return N&&N.state?(z=N.state,N.total_in=N.total_out=z.total=0,N.msg="",z.wrap&&(N.adler=1&z.wrap),z.mode=x,z.last=0,z.havedict=0,z.dmax=32768,z.head=null,z.hold=0,z.bits=0,z.lencode=z.lendyn=new o.Buf32(p),z.distcode=z.distdyn=new o.Buf32(w),z.sane=1,z.back=-1,h):m}function _(N){var z;return N&&N.state?((z=N.state).wsize=0,z.whave=0,z.wnext=0,b(N)):m}function C(N,z){var S,U;return N&&N.state?(U=N.state,z<0?(S=0,z=-z):(S=1+(z>>4),z<48&&(z&=15)),z&&(z<8||15=F.wsize?(o.arraySet(F.window,z,S-F.wsize,F.wsize,0),F.wnext=0,F.whave=F.wsize):(U<(J=F.wsize-F.wnext)&&(J=U),o.arraySet(F.window,z,S-U,J,F.wnext),(U-=J)?(o.arraySet(F.window,z,S-U,U,0),F.wnext=U,F.whave=F.wsize):(F.wnext+=J,F.wnext===F.wsize&&(F.wnext=0),F.whave>>8&255,S.check=a(S.check,P,2,0),B=$=0,S.mode=2;break}if(S.flags=0,S.head&&(S.head.done=!1),!(1&S.wrap)||(((255&$)<<8)+($>>8))%31){N.msg="incorrect header check",S.mode=30;break}if((15&$)!=8){N.msg="unknown compression method",S.mode=30;break}if(B-=4,E=8+(15&($>>>=4)),S.wbits===0)S.wbits=E;else if(E>S.wbits){N.msg="invalid window size",S.mode=30;break}S.dmax=1<>8&1),512&S.flags&&(P[0]=255&$,P[1]=$>>>8&255,S.check=a(S.check,P,2,0)),B=$=0,S.mode=3;case 3:for(;B<32;){if(I===0)break e;I--,$+=U[F++]<>>8&255,P[2]=$>>>16&255,P[3]=$>>>24&255,S.check=a(S.check,P,4,0)),B=$=0,S.mode=4;case 4:for(;B<16;){if(I===0)break e;I--,$+=U[F++]<>8),512&S.flags&&(P[0]=255&$,P[1]=$>>>8&255,S.check=a(S.check,P,2,0)),B=$=0,S.mode=5;case 5:if(1024&S.flags){for(;B<16;){if(I===0)break e;I--,$+=U[F++]<>>8&255,S.check=a(S.check,P,2,0)),B=$=0}else S.head&&(S.head.extra=null);S.mode=6;case 6:if(1024&S.flags&&(I<(oe=S.length)&&(oe=I),oe&&(S.head&&(E=S.head.extra_len-S.length,S.head.extra||(S.head.extra=new Array(S.head.extra_len)),o.arraySet(S.head.extra,U,F,oe,E)),512&S.flags&&(S.check=a(S.check,U,oe,F)),I-=oe,F+=oe,S.length-=oe),S.length))break e;S.length=0,S.mode=7;case 7:if(2048&S.flags){if(I===0)break e;for(oe=0;E=U[F+oe++],S.head&&E&&S.length<65536&&(S.head.name+=String.fromCharCode(E)),E&&oe>9&1,S.head.done=!0),N.adler=S.check=0,S.mode=12;break;case 10:for(;B<32;){if(I===0)break e;I--,$+=U[F++]<>>=7&B,B-=7&B,S.mode=27;break}for(;B<3;){if(I===0)break e;I--,$+=U[F++]<>>=1)){case 0:S.mode=14;break;case 1:if(O(S),S.mode=20,z!==6)break;$>>>=2,B-=2;break e;case 2:S.mode=17;break;case 3:N.msg="invalid block type",S.mode=30}$>>>=2,B-=2;break;case 14:for($>>>=7&B,B-=7&B;B<32;){if(I===0)break e;I--,$+=U[F++]<>>16^65535)){N.msg="invalid stored block lengths",S.mode=30;break}if(S.length=65535&$,B=$=0,S.mode=15,z===6)break e;case 15:S.mode=16;case 16:if(oe=S.length){if(I>>=5,B-=5,S.ndist=1+(31&$),$>>>=5,B-=5,S.ncode=4+(15&$),$>>>=4,B-=4,286>>=3,B-=3}for(;S.have<19;)S.lens[M[S.have++]]=0;if(S.lencode=S.lendyn,S.lenbits=7,Z={bits:S.lenbits},ee=u(0,S.lens,0,19,S.lencode,0,S.work,Z),S.lenbits=Z.bits,ee){N.msg="invalid code lengths set",S.mode=30;break}S.have=0,S.mode=19;case 19:for(;S.have>>16&255,Fe=65535&k,!((we=k>>>24)<=B);){if(I===0)break e;I--,$+=U[F++]<>>=we,B-=we,S.lens[S.have++]=Fe;else{if(Fe===16){for(D=we+2;B>>=we,B-=we,S.have===0){N.msg="invalid bit length repeat",S.mode=30;break}E=S.lens[S.have-1],oe=3+(3&$),$>>>=2,B-=2}else if(Fe===17){for(D=we+3;B>>=we)),$>>>=3,B-=3}else{for(D=we+7;B>>=we)),$>>>=7,B-=7}if(S.have+oe>S.nlen+S.ndist){N.msg="invalid bit length repeat",S.mode=30;break}for(;oe--;)S.lens[S.have++]=E}}if(S.mode===30)break;if(S.lens[256]===0){N.msg="invalid code -- missing end-of-block",S.mode=30;break}if(S.lenbits=9,Z={bits:S.lenbits},ee=u(d,S.lens,0,S.nlen,S.lencode,0,S.work,Z),S.lenbits=Z.bits,ee){N.msg="invalid literal/lengths set",S.mode=30;break}if(S.distbits=6,S.distcode=S.distdyn,Z={bits:S.distbits},ee=u(f,S.lens,S.nlen,S.ndist,S.distcode,0,S.work,Z),S.distbits=Z.bits,ee){N.msg="invalid distances set",S.mode=30;break}if(S.mode=20,z===6)break e;case 20:S.mode=21;case 21:if(6<=I&&258<=X){N.next_out=W,N.avail_out=X,N.next_in=F,N.avail_in=I,S.hold=$,S.bits=B,c(N,se),W=N.next_out,J=N.output,X=N.avail_out,F=N.next_in,U=N.input,I=N.avail_in,$=S.hold,B=S.bits,S.mode===12&&(S.back=-1);break}for(S.back=0;Te=(k=S.lencode[$&(1<>>16&255,Fe=65535&k,!((we=k>>>24)<=B);){if(I===0)break e;I--,$+=U[F++]<>Ie)])>>>16&255,Fe=65535&k,!(Ie+(we=k>>>24)<=B);){if(I===0)break e;I--,$+=U[F++]<>>=Ie,B-=Ie,S.back+=Ie}if($>>>=we,B-=we,S.back+=we,S.length=Fe,Te===0){S.mode=26;break}if(32&Te){S.back=-1,S.mode=12;break}if(64&Te){N.msg="invalid literal/length code",S.mode=30;break}S.extra=15&Te,S.mode=22;case 22:if(S.extra){for(D=S.extra;B>>=S.extra,B-=S.extra,S.back+=S.extra}S.was=S.length,S.mode=23;case 23:for(;Te=(k=S.distcode[$&(1<>>16&255,Fe=65535&k,!((we=k>>>24)<=B);){if(I===0)break e;I--,$+=U[F++]<>Ie)])>>>16&255,Fe=65535&k,!(Ie+(we=k>>>24)<=B);){if(I===0)break e;I--,$+=U[F++]<>>=Ie,B-=Ie,S.back+=Ie}if($>>>=we,B-=we,S.back+=we,64&Te){N.msg="invalid distance code",S.mode=30;break}S.offset=Fe,S.extra=15&Te,S.mode=24;case 24:if(S.extra){for(D=S.extra;B>>=S.extra,B-=S.extra,S.back+=S.extra}if(S.offset>S.dmax){N.msg="invalid distance too far back",S.mode=30;break}S.mode=25;case 25:if(X===0)break e;if(oe=se-X,S.offset>oe){if((oe=S.offset-oe)>S.whave&&S.sane){N.msg="invalid distance too far back",S.mode=30;break}Oe=oe>S.wnext?(oe-=S.wnext,S.wsize-oe):S.wnext-oe,oe>S.length&&(oe=S.length),me=S.window}else me=J,Oe=W-S.offset,oe=S.length;for(XT?(A=Oe[me+w[z]],B[he+w[z]]):(A=96,0),v=1<>W)+(b-=v)]=R<<24|A<<16|O|0,b!==0;);for(v=1<>=1;if(v!==0?($&=v-1,$+=v):$=0,z++,--se[N]==0){if(N===U)break;N=f[h+w[z]]}if(J>>7)]}function he(k,P){k.pending_buf[k.pending++]=255&P,k.pending_buf[k.pending++]=P>>>8&255}function se(k,P,M){k.bi_valid>g-M?(k.bi_buf|=P<>g-k.bi_valid,k.bi_valid+=M-g):(k.bi_buf|=P<>>=1,M<<=1,0<--P;);return M>>>1}function me(k,P,M){var K,L,Y=new Array(w+1),Q=0;for(K=1;K<=w;K++)Y[K]=Q=Q+M[K-1]<<1;for(L=0;L<=P;L++){var te=k[2*L+1];te!==0&&(k[2*L]=Oe(Y[te]++,te))}}function we(k){var P;for(P=0;P>1;1<=M;M--)Ie(k,Y,M);for(L=ge;M=k.heap[1],k.heap[1]=k.heap[k.heap_len--],Ie(k,Y,1),K=k.heap[1],k.heap[--k.heap_max]=M,k.heap[--k.heap_max]=K,Y[2*L]=Y[2*M]+Y[2*K],k.depth[L]=(k.depth[M]>=k.depth[K]?k.depth[M]:k.depth[K])+1,Y[2*M+1]=Y[2*K+1]=L,k.heap[1]=L++,Ie(k,Y,1),2<=k.heap_len;);k.heap[--k.heap_max]=k.heap[1],function(Ue,Et){var tr,Yt,ds,lt,fs,hs,nr=Et.dyn_tree,vu=Et.max_code,xu=Et.stat_desc.static_tree,Ri=Et.stat_desc.has_stree,wu=Et.stat_desc.extra_bits,Ai=Et.stat_desc.extra_base,Fr=Et.stat_desc.max_length,qs=0;for(lt=0;lt<=w;lt++)Ue.bl_count[lt]=0;for(nr[2*Ue.heap[Ue.heap_max]+1]=0,tr=Ue.heap_max+1;tr>=7;L>>=1)if(1&Ke&&te.dyn_ltree[2*ge]!==0)return i;if(te.dyn_ltree[18]!==0||te.dyn_ltree[20]!==0||te.dyn_ltree[26]!==0)return a;for(ge=32;ge>>3,(Y=k.static_len+3+7>>>3)<=L&&(L=Y)):L=Y=M+5,M+4<=L&&P!==-1?D(k,P,M,K):k.strategy===4||Y===L?(se(k,2+(K?1:0),3),Re(k,G,N)):(se(k,4+(K?1:0),3),function(te,ge,Ke,Ue){var Et;for(se(te,ge-257,5),se(te,Ke-1,5),se(te,Ue-4,4),Et=0;Et>>8&255,k.pending_buf[k.d_buf+2*k.last_lit+1]=255&P,k.pending_buf[k.l_buf+k.last_lit]=255&M,k.last_lit++,P===0?k.dyn_ltree[2*M]++:(k.matches++,P--,k.dyn_ltree[2*(S[M]+f+1)]++,k.dyn_dtree[2*B(P)]++),k.last_lit===k.lit_bufsize-1},s._tr_align=function(k){se(k,2,3),oe(k,b,G),function(P){P.bi_valid===16?(he(P,P.bi_buf),P.bi_buf=0,P.bi_valid=0):8<=P.bi_valid&&(P.pending_buf[P.pending++]=255&P.bi_buf,P.bi_buf>>=8,P.bi_valid-=8)}(k)}},{"../utils/common":41}],53:[function(n,r,s){r.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(n,r,s){(function(o){(function(i,a){if(!i.setImmediate){var c,u,d,f,h=1,m={},x=!1,p=i.document,w=Object.getPrototypeOf&&Object.getPrototypeOf(i);w=w&&w.setTimeout?w:i,c={}.toString.call(i.process)==="[object process]"?function(_){process.nextTick(function(){v(_)})}:function(){if(i.postMessage&&!i.importScripts){var _=!0,C=i.onmessage;return i.onmessage=function(){_=!1},i.postMessage("","*"),i.onmessage=C,_}}()?(f="setImmediate$"+Math.random()+"$",i.addEventListener?i.addEventListener("message",b,!1):i.attachEvent("onmessage",b),function(_){i.postMessage(f+_,"*")}):i.MessageChannel?((d=new MessageChannel).port1.onmessage=function(_){v(_.data)},function(_){d.port2.postMessage(_)}):p&&"onreadystatechange"in p.createElement("script")?(u=p.documentElement,function(_){var C=p.createElement("script");C.onreadystatechange=function(){v(_),C.onreadystatechange=null,u.removeChild(C),C=null},u.appendChild(C)}):function(_){setTimeout(v,0,_)},w.setImmediate=function(_){typeof _!="function"&&(_=new Function(""+_));for(var C=new Array(arguments.length-1),j=0;j"u"?o===void 0?this:o:self)}).call(this,typeof Cu<"u"?Cu:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(pN);var UU=pN.exports;const VU=Uf(UU);function BU(e){return new Promise((t,n)=>{const r=new FileReader;r.onload=()=>{r.result?t(r.result.toString()):n("No content found")},r.onerror=()=>n(r.error),r.readAsText(e)})}const WU=async(e,t)=>{const n=new VU;t.forEach(o=>{n.file(o.name,o.content)});const r=await n.generateAsync({type:"blob"}),s=document.createElement("a");s.href=URL.createObjectURL(r),s.download=e,s.click()},Ia=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)},HU=e=>Ia(e).split(" ")[0];function gN(e){const t=new Date;t.setUTCDate(t.getUTCDate()+e);const n=t.getUTCFullYear(),r=String(t.getUTCMonth()+1).padStart(2,"0"),s=String(t.getUTCDate()).padStart(2,"0"),o=String(t.getUTCHours()).padStart(2,"0"),i=String(t.getUTCMinutes()).padStart(2,"0"),a=String(t.getUTCSeconds()).padStart(2,"0");return`${n}-${r}-${s} ${o}:${i}:${a}`}const YU=async e=>{const t=ot();let n=1;e.page&&(n=e.page);let r=2;e.perPage&&(r=e.perPage);let s="";return e.state==="enabled"?s="enabled=true":e.state==="disabled"?s="enabled=false":e.state==="expired"&&(s=t.filter("expiredAt<{:expiredAt}",{expiredAt:gN(15)})),t.collection("domains").getList(n,r,{sort:"-created",expand:"lastDeployment",filter:s})},KU=async()=>{const e=ot(),t=await e.collection("domains").getList(1,1,{}),n=await e.collection("domains").getList(1,1,{filter:e.filter("expiredAt<{:expiredAt}",{expiredAt:gN(15)})}),r=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:n.totalItems,enabled:r.totalItems,disabled:s.totalItems}},GU=async e=>await ot().collection("domains").getOne(e),mf=async e=>e.id?await ot().collection("domains").update(e.id,e):await ot().collection("domains").create(e),ZU=async e=>await ot().collection("domains").delete(e),qU=(e,t)=>ot().collection("domains").subscribe(e,n=>{n.action==="update"&&t(n.record)},{expand:"lastDeployment"}),XU=e=>{ot().collection("domains").unsubscribe(e)},QU=()=>{const e=zr(),t=Jn(),{t:n}=Ye(),r=Ir(),s=new URLSearchParams(r.search),o=s.get("page"),i=s.get("state"),[a,c]=y.useState(0),u=()=>{t("/edit")},d=_=>{s.set("page",_.toString()),t(`?${s.toString()}`)},f=_=>{t(`/edit?id=${_}`)},h=_=>{t(`/history?domain=${_}`)},m=async _=>{try{await ZU(_),p(x.filter(C=>C.id!==_))}catch(C){console.error("Error deleting domain:",C)}},[x,p]=y.useState([]);y.useEffect(()=>{(async()=>{const C=await YU({page:o?Number(o):1,perPage:10,state:i||""});p(C.items),c(C.totalPages)})()},[o,i]);const w=async _=>{const C=x.filter(A=>A.id===_),j=C[0].enabled,T=C[0];T.enabled=!j,await mf(T);const R=x.map(A=>A.id===_?{...A,checked:!j}:A);p(R)},g=async _=>{try{XU(_.id??""),qU(_.id??"",C=>{const j=x.map(T=>T.id===C.id?{...C}:T);p(j)}),_.rightnow=!0,await mf(_),e.toast({title:n("domain.deploy.started.message"),description:n("domain.deploy.started.tips")})}catch{e.toast({title:n("domain.deploy.failed.message"),description:l.jsxs(WO,{i18nKey:"domain.deploy.failed.tips",children:["text1",l.jsx(wn,{to:`/history?domain=${_.id}`,className:"underline text-blue-500",children:"text2"}),"text3"]}),variant:"destructive"})}},v=async _=>{await g({..._,deployed:!1})},b=async _=>{const C=`${_.id}-${_.domain}.zip`,j=[{name:`${_.domain}.pem`,content:_.certificate?_.certificate:""},{name:`${_.domain}.key`,content:_.privateKey?_.privateKey:""}];await WU(C,j)};return l.jsx(l.Fragment,{children:l.jsxs("div",{className:"",children:[l.jsx(Px,{}),l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsx("div",{className:"text-muted-foreground",children:n("domain.page.title")}),l.jsx(Me,{onClick:u,children:n("domain.add")})]}),x.length?l.jsxs(l.Fragment,{children:[l.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:[l.jsx("div",{className:"w-36",children:n("common.text.domain")}),l.jsx("div",{className:"w-40",children:n("domain.props.expiry")}),l.jsx("div",{className:"w-32",children:n("domain.props.last_execution_status")}),l.jsx("div",{className:"w-64",children:n("domain.props.last_execution_stage")}),l.jsx("div",{className:"w-40 sm:ml-2",children:n("domain.props.last_execution_time")}),l.jsx("div",{className:"w-24",children:n("domain.props.enable")}),l.jsx("div",{className:"grow",children:n("common.text.operations")})]}),x.map(_=>{var C,j,T,R;return l.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:[l.jsx("div",{className:"sm:w-36 w-full pt-1 sm:pt-0 flex items-center truncate",children:_.domain.split(";").map(A=>l.jsxs(l.Fragment,{children:[A,l.jsx("br",{})]}))}),l.jsx("div",{className:"sm:w-40 w-full pt-1 sm:pt-0 flex items-center",children:l.jsx("div",{children:_.expiredAt?l.jsxs(l.Fragment,{children:[l.jsx("div",{children:n("domain.props.expiry.date1",{date:90})}),l.jsx("div",{children:n("domain.props.expiry.date2",{date:HU(_.expiredAt)})})]}):"---"})}),l.jsx("div",{className:"sm:w-32 w-full pt-1 sm:pt-0 flex items-center",children:_.lastDeployedAt&&((C=_.expand)!=null&&C.lastDeployment)?l.jsx(l.Fragment,{children:l.jsx(_x,{deployment:_.expand.lastDeployment})}):"---"}),l.jsx("div",{className:"sm:w-64 w-full pt-1 sm:pt-0 flex items-center",children:_.lastDeployedAt&&((j=_.expand)!=null&&j.lastDeployment)?l.jsx(bx,{phase:(T=_.expand.lastDeployment)==null?void 0:T.phase,phaseSuccess:(R=_.expand.lastDeployment)==null?void 0:R.phaseSuccess}):"---"}),l.jsx("div",{className:"sm:w-40 pt-1 sm:pt-0 sm:ml-2 flex items-center",children:_.lastDeployedAt?Ia(_.lastDeployedAt):"---"}),l.jsx("div",{className:"sm:w-24 flex items-center",children:l.jsx(xx,{children:l.jsxs(fE,{children:[l.jsx(hE,{children:l.jsx(mu,{checked:_.enabled,onCheckedChange:()=>{w(_.id??"")}})}),l.jsx(wx,{children:l.jsx("div",{className:"border rounded-sm px-3 bg-background text-muted-foreground text-xs",children:_.enabled?n("domain.props.enable.disabled"):n("domain.props.enable.enabled")})})]})})}),l.jsxs("div",{className:"flex items-center grow justify-start pt-1 sm:pt-0",children:[l.jsx(Me,{variant:"link",className:"p-0",onClick:()=>h(_.id??""),children:n("domain.history")}),l.jsxs(ur,{when:!!_.enabled,children:[l.jsx(br,{orientation:"vertical",className:"h-4 mx-2"}),l.jsx(Me,{variant:"link",className:"p-0",onClick:()=>g(_),children:n("domain.deploy")})]}),l.jsxs(ur,{when:!!(_.enabled&&_.deployed),children:[l.jsx(br,{orientation:"vertical",className:"h-4 mx-2"}),l.jsx(Me,{variant:"link",className:"p-0",onClick:()=>v(_),children:n("domain.deploy_forced")})]}),l.jsxs(ur,{when:!!_.expiredAt,children:[l.jsx(br,{orientation:"vertical",className:"h-4 mx-2"}),l.jsx(Me,{variant:"link",className:"p-0",onClick:()=>b(_),children:n("common.download")})]}),!_.enabled&&l.jsxs(l.Fragment,{children:[l.jsx(br,{orientation:"vertical",className:"h-4 mx-2"}),l.jsxs(Sx,{children:[l.jsx(kx,{asChild:!0,children:l.jsx(Me,{variant:"link",className:"p-0",children:n("common.delete")})}),l.jsxs(Mh,{children:[l.jsxs(Lh,{children:[l.jsx(Fh,{children:n("domain.delete")}),l.jsx($h,{children:n("domain.delete.confirm")})]}),l.jsxs(zh,{children:[l.jsx(Vh,{children:n("common.cancel")}),l.jsx(Uh,{onClick:()=>{m(_.id??"")},children:n("common.confirm")})]})]})]}),l.jsx(br,{orientation:"vertical",className:"h-4 mx-2"}),l.jsx(Me,{variant:"link",className:"p-0",onClick:()=>f(_.id??""),children:n("common.edit")})]})]})]},_.id)}),l.jsx(xE,{totalPages:a,currentPage:o?Number(o):1,onPageChange:_=>{d(_)}})]}):l.jsx(l.Fragment,{children:l.jsxs("div",{className:"flex flex-col items-center mt-10",children:[l.jsx("span",{className:"bg-orange-100 p-5 rounded-full",children:l.jsx(mg,{size:40,className:"text-primary"})}),l.jsx("div",{className:"text-center text-sm text-muted-foreground mt-3",children:n("domain.nodata")}),l.jsx(Me,{onClick:u,className:"mt-3",children:n("domain.add")})]})})]})})};var pu=e=>e.type==="checkbox",ca=e=>e instanceof Date,_n=e=>e==null;const yN=e=>typeof e=="object";var Xt=e=>!_n(e)&&!Array.isArray(e)&&yN(e)&&!ca(e),vN=e=>Xt(e)&&e.target?pu(e.target)?e.target.checked:e.target.value:e,JU=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,xN=(e,t)=>e.has(JU(t)),e8=e=>{const t=e.constructor&&e.constructor.prototype;return Xt(t)&&t.hasOwnProperty("isPrototypeOf")},Rx=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Tn(e){let t;const n=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(Rx&&(e instanceof Blob||e instanceof FileList))&&(n||Xt(e)))if(t=n?[]:{},!n&&!e8(e))t=e;else for(const r in e)e.hasOwnProperty(r)&&(t[r]=Tn(e[r]));else return e;return t}var Hh=e=>Array.isArray(e)?e.filter(Boolean):[],Ft=e=>e===void 0,de=(e,t,n)=>{if(!t||!Xt(e))return n;const r=Hh(t.split(/[,[\].]+?/)).reduce((s,o)=>_n(s)?s:s[o],e);return Ft(r)||r===e?Ft(e[t])?n:e[t]:r},Yr=e=>typeof e=="boolean",Ax=e=>/^\w*$/.test(e),wN=e=>Hh(e.replace(/["|']|\]/g,"").split(/\.|\[/)),mt=(e,t,n)=>{let r=-1;const s=Ax(t)?[t]:wN(t),o=s.length,i=o-1;for(;++rWe.useContext(bN),t8=e=>{const{children:t,...n}=e;return We.createElement(bN.Provider,{value:n},t)};var _N=(e,t,n,r=!0)=>{const s={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(s,o,{get:()=>{const i=o;return t._proxyFormState[i]!==_r.all&&(t._proxyFormState[i]=!r||_r.all),n&&(n[i]=!0),e[i]}});return s},Ln=e=>Xt(e)&&!Object.keys(e).length,SN=(e,t,n,r)=>{n(e);const{name:s,...o}=e;return Ln(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(i=>t[i]===(!r||_r.all))},Jl=e=>Array.isArray(e)?e:[e],kN=(e,t,n)=>!e||!t||e===t||Jl(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r)));function Dx(e){const t=We.useRef(e);t.current=e,We.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}function n8(e){const t=Yh(),{control:n=t.control,disabled:r,name:s,exact:o}=e||{},[i,a]=We.useState(n._formState),c=We.useRef(!0),u=We.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),d=We.useRef(s);return d.current=s,Dx({disabled:r,next:f=>c.current&&kN(d.current,f.name,o)&&SN(f,u.current,n._updateFormState)&&a({...n._formState,...f}),subject:n._subjects.state}),We.useEffect(()=>(c.current=!0,u.current.isValid&&n._updateValid(!0),()=>{c.current=!1}),[n]),_N(i,n,u.current,!1)}var Gr=e=>typeof e=="string",CN=(e,t,n,r,s)=>Gr(e)?(r&&t.watch.add(e),de(n,e,s)):Array.isArray(e)?e.map(o=>(r&&t.watch.add(o),de(n,o))):(r&&(t.watchAll=!0),n);function r8(e){const t=Yh(),{control:n=t.control,name:r,defaultValue:s,disabled:o,exact:i}=e||{},a=We.useRef(r);a.current=r,Dx({disabled:o,subject:n._subjects.values,next:d=>{kN(a.current,d.name,i)&&u(Tn(CN(a.current,n._names,d.values||n._formValues,!1,s)))}});const[c,u]=We.useState(n._getWatch(r,s));return We.useEffect(()=>n._removeUnmounted()),c}function s8(e){const t=Yh(),{name:n,disabled:r,control:s=t.control,shouldUnregister:o}=e,i=xN(s._names.array,n),a=r8({control:s,name:n,defaultValue:de(s._formValues,n,de(s._defaultValues,n,e.defaultValue)),exact:!0}),c=n8({control:s,name:n}),u=We.useRef(s.register(n,{...e.rules,value:a,...Yr(e.disabled)?{disabled:e.disabled}:{}}));return We.useEffect(()=>{const d=s._options.shouldUnregister||o,f=(h,m)=>{const x=de(s._fields,h);x&&x._f&&(x._f.mount=m)};if(f(n,!0),d){const h=Tn(de(s._options.defaultValues,n));mt(s._defaultValues,n,h),Ft(de(s._formValues,n))&&mt(s._formValues,n,h)}return()=>{(i?d&&!s._state.action:d)?s.unregister(n):f(n,!1)}},[n,s,i,o]),We.useEffect(()=>{de(s._fields,n)&&s._updateDisabledField({disabled:r,fields:s._fields,name:n,value:de(s._fields,n)._f.value})},[r,n,s]),{field:{name:n,value:a,...Yr(r)||c.disabled?{disabled:c.disabled||r}:{},onChange:We.useCallback(d=>u.current.onChange({target:{value:vN(d),name:n},type:pf.CHANGE}),[n]),onBlur:We.useCallback(()=>u.current.onBlur({target:{value:de(s._formValues,n),name:n},type:pf.BLUR}),[n,s]),ref:d=>{const f=de(s._fields,n);f&&d&&(f._f.ref={focus:()=>d.focus(),select:()=>d.select(),setCustomValidity:h=>d.setCustomValidity(h),reportValidity:()=>d.reportValidity()})}},formState:c,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!de(c.errors,n)},isDirty:{enumerable:!0,get:()=>!!de(c.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!de(c.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!de(c.validatingFields,n)},error:{enumerable:!0,get:()=>de(c.errors,n)}})}}const o8=e=>e.render(s8(e));var jN=(e,t,n,r,s)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:s||!0}}:{},Ob=e=>({isOnSubmit:!e||e===_r.onSubmit,isOnBlur:e===_r.onBlur,isOnChange:e===_r.onChange,isOnAll:e===_r.all,isOnTouch:e===_r.onTouched}),Ib=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const ec=(e,t,n,r)=>{for(const s of n||Object.keys(e)){const o=de(e,s);if(o){const{_f:i,...a}=o;if(i){if(i.refs&&i.refs[0]&&t(i.refs[0],s)&&!r)break;if(i.ref&&t(i.ref,i.name)&&!r)break;ec(a,t)}else Xt(a)&&ec(a,t)}}};var i8=(e,t,n)=>{const r=Jl(de(e,n));return mt(r,"root",t[n]),mt(e,n,r),e},Ox=e=>e.type==="file",ho=e=>typeof e=="function",gf=e=>{if(!Rx)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},jd=e=>Gr(e),Ix=e=>e.type==="radio",yf=e=>e instanceof RegExp;const Mb={value:!1,isValid:!1},Lb={value:!0,isValid:!0};var EN=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.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===""?Lb:{value:e[0].value,isValid:!0}:Lb:Mb}return Mb};const zb={isValid:!1,value:null};var NN=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,zb):zb;function Fb(e,t,n="validate"){if(jd(e)||Array.isArray(e)&&e.every(jd)||Yr(e)&&!e)return{type:n,message:jd(e)?e:"",ref:t}}var Vi=e=>Xt(e)&&!yf(e)?e:{value:e,message:""},$b=async(e,t,n,r,s)=>{const{ref:o,refs:i,required:a,maxLength:c,minLength:u,min:d,max:f,pattern:h,validate:m,name:x,valueAsNumber:p,mount:w,disabled:g}=e._f,v=de(t,x);if(!w||g)return{};const b=i?i[0]:o,_=N=>{r&&b.reportValidity&&(b.setCustomValidity(Yr(N)?"":N||""),b.reportValidity())},C={},j=Ix(o),T=pu(o),R=j||T,A=(p||Ox(o))&&Ft(o.value)&&Ft(v)||gf(o)&&o.value===""||v===""||Array.isArray(v)&&!v.length,O=jN.bind(null,x,n,C),G=(N,z,S,U=ys.maxLength,J=ys.minLength)=>{const F=N?z:S;C[x]={type:N?U:J,message:F,ref:o,...O(N?U:J,F)}};if(s?!Array.isArray(v)||!v.length:a&&(!R&&(A||_n(v))||Yr(v)&&!v||T&&!EN(i).isValid||j&&!NN(i).isValid)){const{value:N,message:z}=jd(a)?{value:!!a,message:a}:Vi(a);if(N&&(C[x]={type:ys.required,message:z,ref:b,...O(ys.required,z)},!n))return _(z),C}if(!A&&(!_n(d)||!_n(f))){let N,z;const S=Vi(f),U=Vi(d);if(!_n(v)&&!isNaN(v)){const J=o.valueAsNumber||v&&+v;_n(S.value)||(N=J>S.value),_n(U.value)||(z=Jnew Date(new Date().toDateString()+" "+X),W=o.type=="time",I=o.type=="week";Gr(S.value)&&v&&(N=W?F(v)>F(S.value):I?v>S.value:J>new Date(S.value)),Gr(U.value)&&v&&(z=W?F(v)+N.value,U=!_n(z.value)&&v.length<+z.value;if((S||U)&&(G(S,N.message,z.message),!n))return _(C[x].message),C}if(h&&!A&&Gr(v)){const{value:N,message:z}=Vi(h);if(yf(N)&&!v.match(N)&&(C[x]={type:ys.pattern,message:z,ref:o,...O(ys.pattern,z)},!n))return _(z),C}if(m){if(ho(m)){const N=await m(v,t),z=Fb(N,b);if(z&&(C[x]={...z,...O(ys.validate,z.message)},!n))return _(z.message),C}else if(Xt(m)){let N={};for(const z in m){if(!Ln(N)&&!n)break;const S=Fb(await m[z](v,t),b,z);S&&(N={...S,...O(z,S.message)},_(S.message),n&&(C[x]=N))}if(!Ln(N)&&(C[x]={ref:b,...N},!n))return C}}return _(!0),C};function a8(e,t){const n=t.slice(0,-1).length;let r=0;for(;r{let e=[];return{get observers(){return e},next:s=>{for(const o of e)o.next&&o.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(o=>o!==s)}}),unsubscribe:()=>{e=[]}}},vf=e=>_n(e)||!yN(e);function Xo(e,t){if(vf(e)||vf(t))return e===t;if(ca(e)&&ca(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const s of n){const o=e[s];if(!r.includes(s))return!1;if(s!=="ref"){const i=t[s];if(ca(o)&&ca(i)||Xt(o)&&Xt(i)||Array.isArray(o)&&Array.isArray(i)?!Xo(o,i):o!==i)return!1}}return!0}var TN=e=>e.type==="select-multiple",c8=e=>Ix(e)||pu(e),ap=e=>gf(e)&&e.isConnected,PN=e=>{for(const t in e)if(ho(e[t]))return!0;return!1};function xf(e,t={}){const n=Array.isArray(e);if(Xt(e)||n)for(const r in e)Array.isArray(e[r])||Xt(e[r])&&!PN(e[r])?(t[r]=Array.isArray(e[r])?[]:{},xf(e[r],t[r])):_n(e[r])||(t[r]=!0);return t}function RN(e,t,n){const r=Array.isArray(e);if(Xt(e)||r)for(const s in e)Array.isArray(e[s])||Xt(e[s])&&!PN(e[s])?Ft(t)||vf(n[s])?n[s]=Array.isArray(e[s])?xf(e[s],[]):{...xf(e[s])}:RN(e[s],_n(t)?{}:t[s],n[s]):n[s]=!Xo(e[s],t[s]);return n}var nd=(e,t)=>RN(e,t,xf(t)),AN=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>Ft(e)?e:t?e===""?NaN:e&&+e:n&&Gr(e)?new Date(e):r?r(e):e;function lp(e){const t=e.ref;if(!(e.refs?e.refs.every(n=>n.disabled):t.disabled))return Ox(t)?t.files:Ix(t)?NN(e.refs).value:TN(t)?[...t.selectedOptions].map(({value:n})=>n):pu(t)?EN(e.refs).value:AN(Ft(t.value)?e.ref.value:t.value,e)}var u8=(e,t,n,r)=>{const s={};for(const o of e){const i=de(t,o);i&&mt(s,o,i._f)}return{criteriaMode:n,names:[...e],fields:s,shouldUseNativeValidation:r}},jl=e=>Ft(e)?e:yf(e)?e.source:Xt(e)?yf(e.value)?e.value.source:e.value:e,d8=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function Ub(e,t,n){const r=de(e,n);if(r||Ax(n))return{error:r,name:n};const s=n.split(".");for(;s.length;){const o=s.join("."),i=de(t,o),a=de(e,o);if(i&&!Array.isArray(i)&&n!==o)return{name:n};if(a&&a.type)return{name:o,error:a};s.pop()}return{name:n}}var f8=(e,t,n,r,s)=>s.isOnAll?!1:!n&&s.isOnTouch?!(t||e):(n?r.isOnBlur:s.isOnBlur)?!e:(n?r.isOnChange:s.isOnChange)?e:!0,h8=(e,t)=>!Hh(de(e,t)).length&&Kt(e,t);const m8={mode:_r.onSubmit,reValidateMode:_r.onChange,shouldFocusError:!0};function p8(e={}){let t={...m8,...e},n={submitCount:0,isDirty:!1,isLoading:ho(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},s=Xt(t.defaultValues)||Xt(t.values)?Tn(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:Tn(s),i={action:!1,mount:!1,watch:!1},a={mount:new Set,unMount:new Set,array:new Set,watch:new Set},c,u=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},f={values:ip(),array:ip(),state:ip()},h=Ob(t.mode),m=Ob(t.reValidateMode),x=t.criteriaMode===_r.all,p=k=>P=>{clearTimeout(u),u=setTimeout(k,P)},w=async k=>{if(d.isValid||k){const P=t.resolver?Ln((await R()).errors):await O(r,!0);P!==n.isValid&&f.state.next({isValid:P})}},g=(k,P)=>{(d.isValidating||d.validatingFields)&&((k||Array.from(a.mount)).forEach(M=>{M&&(P?mt(n.validatingFields,M,P):Kt(n.validatingFields,M))}),f.state.next({validatingFields:n.validatingFields,isValidating:!Ln(n.validatingFields)}))},v=(k,P=[],M,K,L=!0,Y=!0)=>{if(K&&M){if(i.action=!0,Y&&Array.isArray(de(r,k))){const Q=M(de(r,k),K.argA,K.argB);L&&mt(r,k,Q)}if(Y&&Array.isArray(de(n.errors,k))){const Q=M(de(n.errors,k),K.argA,K.argB);L&&mt(n.errors,k,Q),h8(n.errors,k)}if(d.touchedFields&&Y&&Array.isArray(de(n.touchedFields,k))){const Q=M(de(n.touchedFields,k),K.argA,K.argB);L&&mt(n.touchedFields,k,Q)}d.dirtyFields&&(n.dirtyFields=nd(s,o)),f.state.next({name:k,isDirty:N(k,P),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else mt(o,k,P)},b=(k,P)=>{mt(n.errors,k,P),f.state.next({errors:n.errors})},_=k=>{n.errors=k,f.state.next({errors:n.errors,isValid:!1})},C=(k,P,M,K)=>{const L=de(r,k);if(L){const Y=de(o,k,Ft(M)?de(s,k):M);Ft(Y)||K&&K.defaultChecked||P?mt(o,k,P?Y:lp(L._f)):U(k,Y),i.mount&&w()}},j=(k,P,M,K,L)=>{let Y=!1,Q=!1;const te={name:k},ge=!!(de(r,k)&&de(r,k)._f&&de(r,k)._f.disabled);if(!M||K){d.isDirty&&(Q=n.isDirty,n.isDirty=te.isDirty=N(),Y=Q!==te.isDirty);const Ke=ge||Xo(de(s,k),P);Q=!!(!ge&&de(n.dirtyFields,k)),Ke||ge?Kt(n.dirtyFields,k):mt(n.dirtyFields,k,!0),te.dirtyFields=n.dirtyFields,Y=Y||d.dirtyFields&&Q!==!Ke}if(M){const Ke=de(n.touchedFields,k);Ke||(mt(n.touchedFields,k,M),te.touchedFields=n.touchedFields,Y=Y||d.touchedFields&&Ke!==M)}return Y&&L&&f.state.next(te),Y?te:{}},T=(k,P,M,K)=>{const L=de(n.errors,k),Y=d.isValid&&Yr(P)&&n.isValid!==P;if(e.delayError&&M?(c=p(()=>b(k,M)),c(e.delayError)):(clearTimeout(u),c=null,M?mt(n.errors,k,M):Kt(n.errors,k)),(M?!Xo(L,M):L)||!Ln(K)||Y){const Q={...K,...Y&&Yr(P)?{isValid:P}:{},errors:n.errors,name:k};n={...n,...Q},f.state.next(Q)}},R=async k=>{g(k,!0);const P=await t.resolver(o,t.context,u8(k||a.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return g(k),P},A=async k=>{const{errors:P}=await R(k);if(k)for(const M of k){const K=de(P,M);K?mt(n.errors,M,K):Kt(n.errors,M)}else n.errors=P;return P},O=async(k,P,M={valid:!0})=>{for(const K in k){const L=k[K];if(L){const{_f:Y,...Q}=L;if(Y){const te=a.array.has(Y.name);g([K],!0);const ge=await $b(L,o,x,t.shouldUseNativeValidation&&!P,te);if(g([K]),ge[Y.name]&&(M.valid=!1,P))break;!P&&(de(ge,Y.name)?te?i8(n.errors,ge,Y.name):mt(n.errors,Y.name,ge[Y.name]):Kt(n.errors,Y.name))}Q&&await O(Q,P,M)}}return M.valid},G=()=>{for(const k of a.unMount){const P=de(r,k);P&&(P._f.refs?P._f.refs.every(M=>!ap(M)):!ap(P._f.ref))&&Oe(k)}a.unMount=new Set},N=(k,P)=>(k&&P&&mt(o,k,P),!Xo($(),s)),z=(k,P,M)=>CN(k,a,{...i.mount?o:Ft(P)?s:Gr(k)?{[k]:P}:P},M,P),S=k=>Hh(de(i.mount?o:s,k,e.shouldUnregister?de(s,k,[]):[])),U=(k,P,M={})=>{const K=de(r,k);let L=P;if(K){const Y=K._f;Y&&(!Y.disabled&&mt(o,k,AN(P,Y)),L=gf(Y.ref)&&_n(P)?"":P,TN(Y.ref)?[...Y.ref.options].forEach(Q=>Q.selected=L.includes(Q.value)):Y.refs?pu(Y.ref)?Y.refs.length>1?Y.refs.forEach(Q=>(!Q.defaultChecked||!Q.disabled)&&(Q.checked=Array.isArray(L)?!!L.find(te=>te===Q.value):L===Q.value)):Y.refs[0]&&(Y.refs[0].checked=!!L):Y.refs.forEach(Q=>Q.checked=Q.value===L):Ox(Y.ref)?Y.ref.value="":(Y.ref.value=L,Y.ref.type||f.values.next({name:k,values:{...o}})))}(M.shouldDirty||M.shouldTouch)&&j(k,L,M.shouldTouch,M.shouldDirty,!0),M.shouldValidate&&X(k)},J=(k,P,M)=>{for(const K in P){const L=P[K],Y=`${k}.${K}`,Q=de(r,Y);(a.array.has(k)||!vf(L)||Q&&!Q._f)&&!ca(L)?J(Y,L,M):U(Y,L,M)}},F=(k,P,M={})=>{const K=de(r,k),L=a.array.has(k),Y=Tn(P);mt(o,k,Y),L?(f.array.next({name:k,values:{...o}}),(d.isDirty||d.dirtyFields)&&M.shouldDirty&&f.state.next({name:k,dirtyFields:nd(s,o),isDirty:N(k,Y)})):K&&!K._f&&!_n(Y)?J(k,Y,M):U(k,Y,M),Ib(k,a)&&f.state.next({...n}),f.values.next({name:i.mount?k:void 0,values:{...o}})},W=async k=>{i.mount=!0;const P=k.target;let M=P.name,K=!0;const L=de(r,M),Y=()=>P.type?lp(L._f):vN(k),Q=te=>{K=Number.isNaN(te)||te===de(o,M,te)};if(L){let te,ge;const Ke=Y(),Ue=k.type===pf.BLUR||k.type===pf.FOCUS_OUT,Et=!d8(L._f)&&!t.resolver&&!de(n.errors,M)&&!L._f.deps||f8(Ue,de(n.touchedFields,M),n.isSubmitted,m,h),tr=Ib(M,a,Ue);mt(o,M,Ke),Ue?(L._f.onBlur&&L._f.onBlur(k),c&&c(0)):L._f.onChange&&L._f.onChange(k);const Yt=j(M,Ke,Ue,!1),ds=!Ln(Yt)||tr;if(!Ue&&f.values.next({name:M,type:k.type,values:{...o}}),Et)return d.isValid&&w(),ds&&f.state.next({name:M,...tr?{}:Yt});if(!Ue&&tr&&f.state.next({...n}),t.resolver){const{errors:lt}=await R([M]);if(Q(Ke),K){const fs=Ub(n.errors,r,M),hs=Ub(lt,r,fs.name||M);te=hs.error,M=hs.name,ge=Ln(lt)}}else g([M],!0),te=(await $b(L,o,x,t.shouldUseNativeValidation))[M],g([M]),Q(Ke),K&&(te?ge=!1:d.isValid&&(ge=await O(r,!0)));K&&(L._f.deps&&X(L._f.deps),T(M,ge,te,Yt))}},I=(k,P)=>{if(de(n.errors,P)&&k.focus)return k.focus(),1},X=async(k,P={})=>{let M,K;const L=Jl(k);if(t.resolver){const Y=await A(Ft(k)?k:L);M=Ln(Y),K=k?!L.some(Q=>de(Y,Q)):M}else k?(K=(await Promise.all(L.map(async Y=>{const Q=de(r,Y);return await O(Q&&Q._f?{[Y]:Q}:Q)}))).every(Boolean),!(!K&&!n.isValid)&&w()):K=M=await O(r);return f.state.next({...!Gr(k)||d.isValid&&M!==n.isValid?{}:{name:k},...t.resolver||!k?{isValid:M}:{},errors:n.errors}),P.shouldFocus&&!K&&ec(r,I,k?L:a.mount),K},$=k=>{const P={...i.mount?o:s};return Ft(k)?P:Gr(k)?de(P,k):k.map(M=>de(P,M))},B=(k,P)=>({invalid:!!de((P||n).errors,k),isDirty:!!de((P||n).dirtyFields,k),error:de((P||n).errors,k),isValidating:!!de(n.validatingFields,k),isTouched:!!de((P||n).touchedFields,k)}),he=k=>{k&&Jl(k).forEach(P=>Kt(n.errors,P)),f.state.next({errors:k?n.errors:{}})},se=(k,P,M)=>{const K=(de(r,k,{_f:{}})._f||{}).ref,L=de(n.errors,k)||{},{ref:Y,message:Q,type:te,...ge}=L;mt(n.errors,k,{...ge,...P,ref:K}),f.state.next({name:k,errors:n.errors,isValid:!1}),M&&M.shouldFocus&&K&&K.focus&&K.focus()},oe=(k,P)=>ho(k)?f.values.subscribe({next:M=>k(z(void 0,P),M)}):z(k,P,!0),Oe=(k,P={})=>{for(const M of k?Jl(k):a.mount)a.mount.delete(M),a.array.delete(M),P.keepValue||(Kt(r,M),Kt(o,M)),!P.keepError&&Kt(n.errors,M),!P.keepDirty&&Kt(n.dirtyFields,M),!P.keepTouched&&Kt(n.touchedFields,M),!P.keepIsValidating&&Kt(n.validatingFields,M),!t.shouldUnregister&&!P.keepDefaultValue&&Kt(s,M);f.values.next({values:{...o}}),f.state.next({...n,...P.keepDirty?{isDirty:N()}:{}}),!P.keepIsValid&&w()},me=({disabled:k,name:P,field:M,fields:K,value:L})=>{if(Yr(k)&&i.mount||k){const Y=k?void 0:Ft(L)?lp(M?M._f:de(K,P)._f):L;mt(o,P,Y),j(P,Y,!1,!1,!0)}},we=(k,P={})=>{let M=de(r,k);const K=Yr(P.disabled);return mt(r,k,{...M||{},_f:{...M&&M._f?M._f:{ref:{name:k}},name:k,mount:!0,...P}}),a.mount.add(k),M?me({field:M,disabled:P.disabled,name:k,value:P.value}):C(k,!0,P.value),{...K?{disabled:P.disabled}:{},...t.progressive?{required:!!P.required,min:jl(P.min),max:jl(P.max),minLength:jl(P.minLength),maxLength:jl(P.maxLength),pattern:jl(P.pattern)}:{},name:k,onChange:W,onBlur:W,ref:L=>{if(L){we(k,P),M=de(r,k);const Y=Ft(L.value)&&L.querySelectorAll&&L.querySelectorAll("input,select,textarea")[0]||L,Q=c8(Y),te=M._f.refs||[];if(Q?te.find(ge=>ge===Y):Y===M._f.ref)return;mt(r,k,{_f:{...M._f,...Q?{refs:[...te.filter(ap),Y,...Array.isArray(de(s,k))?[{}]:[]],ref:{type:Y.type,name:k}}:{ref:Y}}}),C(k,!1,void 0,Y)}else M=de(r,k,{}),M._f&&(M._f.mount=!1),(t.shouldUnregister||P.shouldUnregister)&&!(xN(a.array,k)&&i.action)&&a.unMount.add(k)}}},Te=()=>t.shouldFocusError&&ec(r,I,a.mount),Fe=k=>{Yr(k)&&(f.state.next({disabled:k}),ec(r,(P,M)=>{const K=de(r,M);K&&(P.disabled=K._f.disabled||k,Array.isArray(K._f.refs)&&K._f.refs.forEach(L=>{L.disabled=K._f.disabled||k}))},0,!1))},Ie=(k,P)=>async M=>{let K;M&&(M.preventDefault&&M.preventDefault(),M.persist&&M.persist());let L=Tn(o);if(f.state.next({isSubmitting:!0}),t.resolver){const{errors:Y,values:Q}=await R();n.errors=Y,L=Q}else await O(r);if(Kt(n.errors,"root"),Ln(n.errors)){f.state.next({errors:{}});try{await k(L,M)}catch(Y){K=Y}}else P&&await P({...n.errors},M),Te(),setTimeout(Te);if(f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Ln(n.errors)&&!K,submitCount:n.submitCount+1,errors:n.errors}),K)throw K},Re=(k,P={})=>{de(r,k)&&(Ft(P.defaultValue)?F(k,Tn(de(s,k))):(F(k,P.defaultValue),mt(s,k,Tn(P.defaultValue))),P.keepTouched||Kt(n.touchedFields,k),P.keepDirty||(Kt(n.dirtyFields,k),n.isDirty=P.defaultValue?N(k,Tn(de(s,k))):N()),P.keepError||(Kt(n.errors,k),d.isValid&&w()),f.state.next({...n}))},st=(k,P={})=>{const M=k?Tn(k):s,K=Tn(M),L=Ln(k),Y=L?s:K;if(P.keepDefaultValues||(s=M),!P.keepValues){if(P.keepDirtyValues)for(const Q of a.mount)de(n.dirtyFields,Q)?mt(Y,Q,de(o,Q)):F(Q,de(Y,Q));else{if(Rx&&Ft(k))for(const Q of a.mount){const te=de(r,Q);if(te&&te._f){const ge=Array.isArray(te._f.refs)?te._f.refs[0]:te._f.ref;if(gf(ge)){const Ke=ge.closest("form");if(Ke){Ke.reset();break}}}}r={}}o=e.shouldUnregister?P.keepDefaultValues?Tn(s):{}:Tn(Y),f.array.next({values:{...Y}}),f.values.next({values:{...Y}})}a={mount:P.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!d.isValid||!!P.keepIsValid||!!P.keepDirtyValues,i.watch=!!e.shouldUnregister,f.state.next({submitCount:P.keepSubmitCount?n.submitCount:0,isDirty:L?!1:P.keepDirty?n.isDirty:!!(P.keepDefaultValues&&!Xo(k,s)),isSubmitted:P.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:L?{}:P.keepDirtyValues?P.keepDefaultValues&&o?nd(s,o):n.dirtyFields:P.keepDefaultValues&&k?nd(s,k):P.keepDirty?n.dirtyFields:{},touchedFields:P.keepTouched?n.touchedFields:{},errors:P.keepErrors?n.errors:{},isSubmitSuccessful:P.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},E=(k,P)=>st(ho(k)?k(o):k,P);return{control:{register:we,unregister:Oe,getFieldState:B,handleSubmit:Ie,setError:se,_executeSchema:R,_getWatch:z,_getDirty:N,_updateValid:w,_removeUnmounted:G,_updateFieldArray:v,_updateDisabledField:me,_getFieldArray:S,_reset:st,_resetDefaultValues:()=>ho(t.defaultValues)&&t.defaultValues().then(k=>{E(k,t.resetOptions),f.state.next({isLoading:!1})}),_updateFormState:k=>{n={...n,...k}},_disableForm:Fe,_subjects:f,_proxyFormState:d,_setErrors:_,get _fields(){return r},get _formValues(){return o},get _state(){return i},set _state(k){i=k},get _defaultValues(){return s},get _names(){return a},set _names(k){a=k},get _formState(){return n},set _formState(k){n=k},get _options(){return t},set _options(k){t={...t,...k}}},trigger:X,register:we,handleSubmit:Ie,watch:oe,setValue:F,getValues:$,reset:E,resetField:Re,clearErrors:he,unregister:Oe,setError:se,setFocus:(k,P={})=>{const M=de(r,k),K=M&&M._f;if(K){const L=K.refs?K.refs[0]:K.ref;L.focus&&(L.focus(),P.shouldSelect&&L.select())}},getFieldState:B}}function cn(e={}){const t=We.useRef(),n=We.useRef(),[r,s]=We.useState({isDirty:!1,isValidating:!1,isLoading:ho(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:ho(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...p8(e),formState:r});const o=t.current.control;return o._options=e,Dx({subject:o._subjects.state,next:i=>{SN(i,o._proxyFormState,o._updateFormState,!0)&&s({...o._formState})}}),We.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),We.useEffect(()=>{if(o._proxyFormState.isDirty){const i=o._getDirty();i!==r.isDirty&&o._subjects.state.next({isDirty:i})}},[o,r.isDirty]),We.useEffect(()=>{e.values&&!Xo(e.values,n.current)?(o._reset(e.values,o._options.resetOptions),n.current=e.values,s(i=>({...i}))):o._resetDefaultValues()},[e.values,o]),We.useEffect(()=>{e.errors&&o._setErrors(e.errors)},[e.errors,o]),We.useEffect(()=>{o._state.mount||(o._updateValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),We.useEffect(()=>{e.shouldUnregister&&o._subjects.values.next({values:o._getWatch()})},[e.shouldUnregister,o]),t.current.formState=_N(r,o),t.current}var it;(function(e){e.assertEqual=s=>s;function t(s){}e.assertIs=t;function n(s){throw new Error}e.assertNever=n,e.arrayToEnum=s=>{const o={};for(const i of s)o[i]=i;return o},e.getValidEnumValues=s=>{const o=e.objectKeys(s).filter(a=>typeof s[s[a]]!="number"),i={};for(const a of o)i[a]=s[a];return e.objectValues(i)},e.objectValues=s=>e.objectKeys(s).map(function(o){return s[o]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const o=[];for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&o.push(i);return o},e.find=(s,o)=>{for(const i of s)if(o(i))return i},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function r(s,o=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(o)}e.joinValues=r,e.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(it||(it={}));var Mg;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(Mg||(Mg={}));const _e=it.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ao=e=>{switch(typeof e){case"undefined":return _e.undefined;case"string":return _e.string;case"number":return isNaN(e)?_e.nan:_e.number;case"boolean":return _e.boolean;case"function":return _e.function;case"bigint":return _e.bigint;case"symbol":return _e.symbol;case"object":return Array.isArray(e)?_e.array:e===null?_e.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?_e.promise:typeof Map<"u"&&e instanceof Map?_e.map:typeof Set<"u"&&e instanceof Set?_e.set:typeof Date<"u"&&e instanceof Date?_e.date:_e.object;default:return _e.unknown}},ae=it.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"]),g8=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Yn extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(o){return o.message},r={_errors:[]},s=o=>{for(const i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)r._errors.push(n(i));else{let a=r,c=0;for(;cn.message){const n={},r=[];for(const s of this.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(t(s))):r.push(t(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Yn.create=e=>new Yn(e);const Ma=(e,t)=>{let n;switch(e.code){case ae.invalid_type:e.received===_e.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case ae.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,it.jsonStringifyReplacer)}`;break;case ae.unrecognized_keys:n=`Unrecognized key(s) in object: ${it.joinValues(e.keys,", ")}`;break;case ae.invalid_union:n="Invalid input";break;case ae.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${it.joinValues(e.options)}`;break;case ae.invalid_enum_value:n=`Invalid enum value. Expected ${it.joinValues(e.options)}, received '${e.received}'`;break;case ae.invalid_arguments:n="Invalid function arguments";break;case ae.invalid_return_type:n="Invalid function return type";break;case ae.invalid_date:n="Invalid date";break;case ae.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:it.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case ae.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case ae.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case ae.custom:n="Invalid input";break;case ae.invalid_intersection_types:n="Intersection results could not be merged";break;case ae.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case ae.not_finite:n="Number must be finite";break;default:n=t.defaultError,it.assertNever(e)}return{message:n}};let DN=Ma;function y8(e){DN=e}function wf(){return DN}const bf=e=>{const{data:t,path:n,errorMaps:r,issueData:s}=e,o=[...n,...s.path||[]],i={...s,path:o};if(s.message!==void 0)return{...s,path:o,message:s.message};let a="";const c=r.filter(u=>!!u).slice().reverse();for(const u of c)a=u(i,{data:t,defaultError:a}).message;return{...s,path:o,message:a}},v8=[];function ve(e,t){const n=wf(),r=bf({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Ma?void 0:Ma].filter(s=>!!s)});e.common.issues.push(r)}class yn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const s of n){if(s.status==="aborted")return He;s.status==="dirty"&&t.dirty(),r.push(s.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const s of n){const o=await s.key,i=await s.value;r.push({key:o,value:i})}return yn.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const s of n){const{key:o,value:i}=s;if(o.status==="aborted"||i.status==="aborted")return He;o.status==="dirty"&&t.dirty(),i.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof i.value<"u"||s.alwaysSet)&&(r[o.value]=i.value)}return{status:t.value,value:r}}}const He=Object.freeze({status:"aborted"}),ua=e=>({status:"dirty",value:e}),kn=e=>({status:"valid",value:e}),Lg=e=>e.status==="aborted",zg=e=>e.status==="dirty",Pc=e=>e.status==="valid",Rc=e=>typeof Promise<"u"&&e instanceof Promise;function _f(e,t,n,r){if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function ON(e,t,n,r,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,n),n}var De;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(De||(De={}));var Ml,Ll;class rs{constructor(t,n,r,s){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,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 Vb=(e,t)=>{if(Pc(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 n=new Yn(e.common.issues);return this._error=n,this._error}}};function Ze(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:s}=e;if(t&&(n||r))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:(i,a)=>{var c,u;const{message:d}=e;return i.code==="invalid_enum_value"?{message:d??a.defaultError}:typeof a.data>"u"?{message:(c=d??r)!==null&&c!==void 0?c:a.defaultError}:i.code!=="invalid_type"?{message:a.defaultError}:{message:(u=d??n)!==null&&u!==void 0?u:a.defaultError}},description:s}}class et{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 ao(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:ao(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new yn,ctx:{common:t.parent.common,data:t.data,parsedType:ao(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(Rc(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const s={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ao(t)},o=this._parseSync({data:t,path:s.path,parent:s});return Vb(s,o)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ao(t)},s=this._parse({data:t,path:r.path,parent:r}),o=await(Rc(s)?s:Promise.resolve(s));return Vb(r,o)}refine(t,n){const r=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,o)=>{const i=t(s),a=()=>o.addIssue({code:ae.custom,...r(s)});return typeof Promise<"u"&&i instanceof Promise?i.then(c=>c?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(t,n){return this._refinement((r,s)=>t(r)?!0:(s.addIssue(typeof n=="function"?n(r,s):n),!1))}_refinement(t){return new Or({schema:this,typeName:Ve.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Jr.create(this,this._def)}nullable(){return Ro.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Nr.create(this,this._def)}promise(){return za.create(this,this._def)}or(t){return Ic.create([this,t],this._def)}and(t){return Mc.create(this,t,this._def)}transform(t){return new Or({...Ze(this._def),schema:this,typeName:Ve.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new Uc({...Ze(this._def),innerType:this,defaultValue:n,typeName:Ve.ZodDefault})}brand(){return new Mx({typeName:Ve.ZodBranded,type:this,...Ze(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new Vc({...Ze(this._def),innerType:this,catchValue:n,typeName:Ve.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return gu.create(this,t)}readonly(){return Bc.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const x8=/^c[^\s-]{8,}$/i,w8=/^[0-9a-z]+$/,b8=/^[0-9A-HJKMNP-TV-Z]{26}$/,_8=/^[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,S8=/^[a-z0-9_-]{21}$/i,k8=/^[-+]?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)?)??$/,C8=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,j8="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let cp;const E8=/^(?:(?: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])$/,N8=/^(([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})))$/,T8=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,IN="((\\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])))",P8=new RegExp(`^${IN}$`);function MN(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 R8(e){return new RegExp(`^${MN(e)}$`)}function LN(e){let t=`${IN}T${MN(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function A8(e,t){return!!((t==="v4"||!t)&&E8.test(e)||(t==="v6"||!t)&&N8.test(e))}class Cr extends et{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==_e.string){const o=this._getOrReturnCtx(t);return ve(o,{code:ae.invalid_type,expected:_e.string,received:o.parsedType}),He}const r=new yn;let s;for(const o of this._def.checks)if(o.kind==="min")t.data.lengtho.value&&(s=this._getOrReturnCtx(t,s),ve(s,{code:ae.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const i=t.data.length>o.value,a=t.data.lengtht.test(s),{validation:n,code:ae.invalid_string,...De.errToObj(r)})}_addCheck(t){return new Cr({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...De.errToObj(t)})}url(t){return this._addCheck({kind:"url",...De.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...De.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...De.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...De.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...De.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...De.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...De.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...De.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...De.errToObj(t)})}datetime(t){var n,r;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:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,local:(r=t==null?void 0:t.local)!==null&&r!==void 0?r:!1,...De.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,...De.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...De.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...De.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...De.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...De.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...De.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...De.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...De.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...De.errToObj(n)})}nonempty(t){return this.min(1,De.errToObj(t))}trim(){return new Cr({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Cr({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Cr({...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 n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value{var t;return new Cr({checks:[],typeName:Ve.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Ze(e)})};function D8(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,s=n>r?n:r,o=parseInt(e.toFixed(s).replace(".","")),i=parseInt(t.toFixed(s).replace(".",""));return o%i/Math.pow(10,s)}class No extends et{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)!==_e.number){const o=this._getOrReturnCtx(t);return ve(o,{code:ae.invalid_type,expected:_e.number,received:o.parsedType}),He}let r;const s=new yn;for(const o of this._def.checks)o.kind==="int"?it.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),ve(r,{code:ae.invalid_type,expected:"integer",received:"float",message:o.message}),s.dirty()):o.kind==="min"?(o.inclusive?t.datao.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),ve(r,{code:ae.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="multipleOf"?D8(t.data,o.value)!==0&&(r=this._getOrReturnCtx(t,r),ve(r,{code:ae.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),ve(r,{code:ae.not_finite,message:o.message}),s.dirty()):it.assertNever(o);return{status:s.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,De.toString(n))}gt(t,n){return this.setLimit("min",t,!1,De.toString(n))}lte(t,n){return this.setLimit("max",t,!0,De.toString(n))}lt(t,n){return this.setLimit("max",t,!1,De.toString(n))}setLimit(t,n,r,s){return new No({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:De.toString(s)}]})}_addCheck(t){return new No({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:De.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:De.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:De.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:De.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:De.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:De.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:De.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:De.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:De.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.valuet.kind==="int"||t.kind==="multipleOf"&&it.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.valuenew No({checks:[],typeName:Ve.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Ze(e)});class To extends et{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)!==_e.bigint){const o=this._getOrReturnCtx(t);return ve(o,{code:ae.invalid_type,expected:_e.bigint,received:o.parsedType}),He}let r;const s=new yn;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.datao.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),ve(r,{code:ae.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),ve(r,{code:ae.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):it.assertNever(o);return{status:s.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,De.toString(n))}gt(t,n){return this.setLimit("min",t,!1,De.toString(n))}lte(t,n){return this.setLimit("max",t,!0,De.toString(n))}lt(t,n){return this.setLimit("max",t,!1,De.toString(n))}setLimit(t,n,r,s){return new To({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:De.toString(s)}]})}_addCheck(t){return new To({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:De.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:De.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:De.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:De.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:De.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value{var t;return new To({checks:[],typeName:Ve.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Ze(e)})};class Ac extends et{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==_e.boolean){const r=this._getOrReturnCtx(t);return ve(r,{code:ae.invalid_type,expected:_e.boolean,received:r.parsedType}),He}return kn(t.data)}}Ac.create=e=>new Ac({typeName:Ve.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Ze(e)});class mi extends et{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==_e.date){const o=this._getOrReturnCtx(t);return ve(o,{code:ae.invalid_type,expected:_e.date,received:o.parsedType}),He}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return ve(o,{code:ae.invalid_date}),He}const r=new yn;let s;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()o.value&&(s=this._getOrReturnCtx(t,s),ve(s,{code:ae.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):it.assertNever(o);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new mi({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:De.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:De.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.valuenew mi({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Ve.ZodDate,...Ze(e)});class Sf extends et{_parse(t){if(this._getType(t)!==_e.symbol){const r=this._getOrReturnCtx(t);return ve(r,{code:ae.invalid_type,expected:_e.symbol,received:r.parsedType}),He}return kn(t.data)}}Sf.create=e=>new Sf({typeName:Ve.ZodSymbol,...Ze(e)});class Dc extends et{_parse(t){if(this._getType(t)!==_e.undefined){const r=this._getOrReturnCtx(t);return ve(r,{code:ae.invalid_type,expected:_e.undefined,received:r.parsedType}),He}return kn(t.data)}}Dc.create=e=>new Dc({typeName:Ve.ZodUndefined,...Ze(e)});class Oc extends et{_parse(t){if(this._getType(t)!==_e.null){const r=this._getOrReturnCtx(t);return ve(r,{code:ae.invalid_type,expected:_e.null,received:r.parsedType}),He}return kn(t.data)}}Oc.create=e=>new Oc({typeName:Ve.ZodNull,...Ze(e)});class La extends et{constructor(){super(...arguments),this._any=!0}_parse(t){return kn(t.data)}}La.create=e=>new La({typeName:Ve.ZodAny,...Ze(e)});class ri extends et{constructor(){super(...arguments),this._unknown=!0}_parse(t){return kn(t.data)}}ri.create=e=>new ri({typeName:Ve.ZodUnknown,...Ze(e)});class Fs extends et{_parse(t){const n=this._getOrReturnCtx(t);return ve(n,{code:ae.invalid_type,expected:_e.never,received:n.parsedType}),He}}Fs.create=e=>new Fs({typeName:Ve.ZodNever,...Ze(e)});class kf extends et{_parse(t){if(this._getType(t)!==_e.undefined){const r=this._getOrReturnCtx(t);return ve(r,{code:ae.invalid_type,expected:_e.void,received:r.parsedType}),He}return kn(t.data)}}kf.create=e=>new kf({typeName:Ve.ZodVoid,...Ze(e)});class Nr extends et{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),s=this._def;if(n.parsedType!==_e.array)return ve(n,{code:ae.invalid_type,expected:_e.array,received:n.parsedType}),He;if(s.exactLength!==null){const i=n.data.length>s.exactLength.value,a=n.data.lengths.maxLength.value&&(ve(n,{code:ae.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((i,a)=>s.type._parseAsync(new rs(n,i,n.path,a)))).then(i=>yn.mergeArray(r,i));const o=[...n.data].map((i,a)=>s.type._parseSync(new rs(n,i,n.path,a)));return yn.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new Nr({...this._def,minLength:{value:t,message:De.toString(n)}})}max(t,n){return new Nr({...this._def,maxLength:{value:t,message:De.toString(n)}})}length(t,n){return new Nr({...this._def,exactLength:{value:t,message:De.toString(n)}})}nonempty(t){return this.min(1,t)}}Nr.create=(e,t)=>new Nr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ve.ZodArray,...Ze(t)});function Yi(e){if(e instanceof Rt){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Jr.create(Yi(r))}return new Rt({...e._def,shape:()=>t})}else return e instanceof Nr?new Nr({...e._def,type:Yi(e.element)}):e instanceof Jr?Jr.create(Yi(e.unwrap())):e instanceof Ro?Ro.create(Yi(e.unwrap())):e instanceof ss?ss.create(e.items.map(t=>Yi(t))):e}class Rt extends et{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(),n=it.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==_e.object){const u=this._getOrReturnCtx(t);return ve(u,{code:ae.invalid_type,expected:_e.object,received:u.parsedType}),He}const{status:r,ctx:s}=this._processInputParams(t),{shape:o,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof Fs&&this._def.unknownKeys==="strip"))for(const u in s.data)i.includes(u)||a.push(u);const c=[];for(const u of i){const d=o[u],f=s.data[u];c.push({key:{status:"valid",value:u},value:d._parse(new rs(s,f,s.path,u)),alwaysSet:u in s.data})}if(this._def.catchall instanceof Fs){const u=this._def.unknownKeys;if(u==="passthrough")for(const d of a)c.push({key:{status:"valid",value:d},value:{status:"valid",value:s.data[d]}});else if(u==="strict")a.length>0&&(ve(s,{code:ae.unrecognized_keys,keys:a}),r.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];c.push({key:{status:"valid",value:d},value:u._parse(new rs(s,f,s.path,d)),alwaysSet:d in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const u=[];for(const d of c){const f=await d.key,h=await d.value;u.push({key:f,value:h,alwaysSet:d.alwaysSet})}return u}).then(u=>yn.mergeObjectSync(r,u)):yn.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(t){return De.errToObj,new Rt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var s,o,i,a;const c=(i=(o=(s=this._def).errorMap)===null||o===void 0?void 0:o.call(s,n,r).message)!==null&&i!==void 0?i:r.defaultError;return n.code==="unrecognized_keys"?{message:(a=De.errToObj(t).message)!==null&&a!==void 0?a:c}:{message:c}}}:{}})}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:Ve.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Rt({...this._def,catchall:t})}pick(t){const n={};return it.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new Rt({...this._def,shape:()=>n})}omit(t){const n={};return it.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new Rt({...this._def,shape:()=>n})}deepPartial(){return Yi(this)}partial(t){const n={};return it.objectKeys(this.shape).forEach(r=>{const s=this.shape[r];t&&!t[r]?n[r]=s:n[r]=s.optional()}),new Rt({...this._def,shape:()=>n})}required(t){const n={};return it.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof Jr;)o=o._def.innerType;n[r]=o}}),new Rt({...this._def,shape:()=>n})}keyof(){return zN(it.objectKeys(this.shape))}}Rt.create=(e,t)=>new Rt({shape:()=>e,unknownKeys:"strip",catchall:Fs.create(),typeName:Ve.ZodObject,...Ze(t)});Rt.strictCreate=(e,t)=>new Rt({shape:()=>e,unknownKeys:"strict",catchall:Fs.create(),typeName:Ve.ZodObject,...Ze(t)});Rt.lazycreate=(e,t)=>new Rt({shape:e,unknownKeys:"strip",catchall:Fs.create(),typeName:Ve.ZodObject,...Ze(t)});class Ic extends et{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function s(o){for(const a of o)if(a.result.status==="valid")return a.result;for(const a of o)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const i=o.map(a=>new Yn(a.ctx.common.issues));return ve(n,{code:ae.invalid_union,unionErrors:i}),He}if(n.common.async)return Promise.all(r.map(async o=>{const i={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:i}),ctx:i}})).then(s);{let o;const i=[];for(const c of r){const u={...n,common:{...n.common,issues:[]},parent:null},d=c._parseSync({data:n.data,path:n.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!o&&(o={result:d,ctx:u}),u.common.issues.length&&i.push(u.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const a=i.map(c=>new Yn(c));return ve(n,{code:ae.invalid_union,unionErrors:a}),He}}get options(){return this._def.options}}Ic.create=(e,t)=>new Ic({options:e,typeName:Ve.ZodUnion,...Ze(t)});const vs=e=>e instanceof zc?vs(e.schema):e instanceof Or?vs(e.innerType()):e instanceof Fc?[e.value]:e instanceof Po?e.options:e instanceof $c?it.objectValues(e.enum):e instanceof Uc?vs(e._def.innerType):e instanceof Dc?[void 0]:e instanceof Oc?[null]:e instanceof Jr?[void 0,...vs(e.unwrap())]:e instanceof Ro?[null,...vs(e.unwrap())]:e instanceof Mx||e instanceof Bc?vs(e.unwrap()):e instanceof Vc?vs(e._def.innerType):[];class Kh extends et{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==_e.object)return ve(n,{code:ae.invalid_type,expected:_e.object,received:n.parsedType}),He;const r=this.discriminator,s=n.data[r],o=this.optionsMap.get(s);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(ve(n,{code:ae.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),He)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const s=new Map;for(const o of n){const i=vs(o.shape[t]);if(!i.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of i){if(s.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);s.set(a,o)}}return new Kh({typeName:Ve.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:s,...Ze(r)})}}function Fg(e,t){const n=ao(e),r=ao(t);if(e===t)return{valid:!0,data:e};if(n===_e.object&&r===_e.object){const s=it.objectKeys(t),o=it.objectKeys(e).filter(a=>s.indexOf(a)!==-1),i={...e,...t};for(const a of o){const c=Fg(e[a],t[a]);if(!c.valid)return{valid:!1};i[a]=c.data}return{valid:!0,data:i}}else if(n===_e.array&&r===_e.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let o=0;o{if(Lg(o)||Lg(i))return He;const a=Fg(o.value,i.value);return a.valid?((zg(o)||zg(i))&&n.dirty(),{status:n.value,value:a.data}):(ve(r,{code:ae.invalid_intersection_types}),He)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,i])=>s(o,i)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Mc.create=(e,t,n)=>new Mc({left:e,right:t,typeName:Ve.ZodIntersection,...Ze(n)});class ss extends et{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==_e.array)return ve(r,{code:ae.invalid_type,expected:_e.array,received:r.parsedType}),He;if(r.data.lengththis._def.items.length&&(ve(r,{code:ae.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((i,a)=>{const c=this._def.items[a]||this._def.rest;return c?c._parse(new rs(r,i,r.path,a)):null}).filter(i=>!!i);return r.common.async?Promise.all(o).then(i=>yn.mergeArray(n,i)):yn.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new ss({...this._def,rest:t})}}ss.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ss({items:e,typeName:Ve.ZodTuple,rest:null,...Ze(t)})};class Lc extends et{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==_e.object)return ve(r,{code:ae.invalid_type,expected:_e.object,received:r.parsedType}),He;const s=[],o=this._def.keyType,i=this._def.valueType;for(const a in r.data)s.push({key:o._parse(new rs(r,a,r.path,a)),value:i._parse(new rs(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?yn.mergeObjectAsync(n,s):yn.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof et?new Lc({keyType:t,valueType:n,typeName:Ve.ZodRecord,...Ze(r)}):new Lc({keyType:Cr.create(),valueType:t,typeName:Ve.ZodRecord,...Ze(n)})}}class Cf extends et{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==_e.map)return ve(r,{code:ae.invalid_type,expected:_e.map,received:r.parsedType}),He;const s=this._def.keyType,o=this._def.valueType,i=[...r.data.entries()].map(([a,c],u)=>({key:s._parse(new rs(r,a,r.path,[u,"key"])),value:o._parse(new rs(r,c,r.path,[u,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const c of i){const u=await c.key,d=await c.value;if(u.status==="aborted"||d.status==="aborted")return He;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),a.set(u.value,d.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const c of i){const u=c.key,d=c.value;if(u.status==="aborted"||d.status==="aborted")return He;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),a.set(u.value,d.value)}return{status:n.value,value:a}}}}Cf.create=(e,t,n)=>new Cf({valueType:t,keyType:e,typeName:Ve.ZodMap,...Ze(n)});class pi extends et{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==_e.set)return ve(r,{code:ae.invalid_type,expected:_e.set,received:r.parsedType}),He;const s=this._def;s.minSize!==null&&r.data.sizes.maxSize.value&&(ve(r,{code:ae.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const o=this._def.valueType;function i(c){const u=new Set;for(const d of c){if(d.status==="aborted")return He;d.status==="dirty"&&n.dirty(),u.add(d.value)}return{status:n.value,value:u}}const a=[...r.data.values()].map((c,u)=>o._parse(new rs(r,c,r.path,u)));return r.common.async?Promise.all(a).then(c=>i(c)):i(a)}min(t,n){return new pi({...this._def,minSize:{value:t,message:De.toString(n)}})}max(t,n){return new pi({...this._def,maxSize:{value:t,message:De.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}pi.create=(e,t)=>new pi({valueType:e,minSize:null,maxSize:null,typeName:Ve.ZodSet,...Ze(t)});class Ca extends et{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==_e.function)return ve(n,{code:ae.invalid_type,expected:_e.function,received:n.parsedType}),He;function r(a,c){return bf({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,wf(),Ma].filter(u=>!!u),issueData:{code:ae.invalid_arguments,argumentsError:c}})}function s(a,c){return bf({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,wf(),Ma].filter(u=>!!u),issueData:{code:ae.invalid_return_type,returnTypeError:c}})}const o={errorMap:n.common.contextualErrorMap},i=n.data;if(this._def.returns instanceof za){const a=this;return kn(async function(...c){const u=new Yn([]),d=await a._def.args.parseAsync(c,o).catch(m=>{throw u.addIssue(r(c,m)),u}),f=await Reflect.apply(i,this,d);return await a._def.returns._def.type.parseAsync(f,o).catch(m=>{throw u.addIssue(s(f,m)),u})})}else{const a=this;return kn(function(...c){const u=a._def.args.safeParse(c,o);if(!u.success)throw new Yn([r(c,u.error)]);const d=Reflect.apply(i,this,u.data),f=a._def.returns.safeParse(d,o);if(!f.success)throw new Yn([s(d,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Ca({...this._def,args:ss.create(t).rest(ri.create())})}returns(t){return new Ca({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new Ca({args:t||ss.create([]).rest(ri.create()),returns:n||ri.create(),typeName:Ve.ZodFunction,...Ze(r)})}}class zc extends et{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}zc.create=(e,t)=>new zc({getter:e,typeName:Ve.ZodLazy,...Ze(t)});class Fc extends et{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return ve(n,{received:n.data,code:ae.invalid_literal,expected:this._def.value}),He}return{status:"valid",value:t.data}}get value(){return this._def.value}}Fc.create=(e,t)=>new Fc({value:e,typeName:Ve.ZodLiteral,...Ze(t)});function zN(e,t){return new Po({values:e,typeName:Ve.ZodEnum,...Ze(t)})}class Po extends et{constructor(){super(...arguments),Ml.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return ve(n,{expected:it.joinValues(r),received:n.parsedType,code:ae.invalid_type}),He}if(_f(this,Ml)||ON(this,Ml,new Set(this._def.values)),!_f(this,Ml).has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return ve(n,{received:n.data,code:ae.invalid_enum_value,options:r}),He}return kn(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return Po.create(t,{...this._def,...n})}exclude(t,n=this._def){return Po.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}Ml=new WeakMap;Po.create=zN;class $c extends et{constructor(){super(...arguments),Ll.set(this,void 0)}_parse(t){const n=it.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==_e.string&&r.parsedType!==_e.number){const s=it.objectValues(n);return ve(r,{expected:it.joinValues(s),received:r.parsedType,code:ae.invalid_type}),He}if(_f(this,Ll)||ON(this,Ll,new Set(it.getValidEnumValues(this._def.values))),!_f(this,Ll).has(t.data)){const s=it.objectValues(n);return ve(r,{received:r.data,code:ae.invalid_enum_value,options:s}),He}return kn(t.data)}get enum(){return this._def.values}}Ll=new WeakMap;$c.create=(e,t)=>new $c({values:e,typeName:Ve.ZodNativeEnum,...Ze(t)});class za extends et{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==_e.promise&&n.common.async===!1)return ve(n,{code:ae.invalid_type,expected:_e.promise,received:n.parsedType}),He;const r=n.parsedType===_e.promise?n.data:Promise.resolve(n.data);return kn(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}za.create=(e,t)=>new za({type:e,typeName:Ve.ZodPromise,...Ze(t)});class Or extends et{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ve.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=this._def.effect||null,o={addIssue:i=>{ve(r,i),i.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),s.type==="preprocess"){const i=s.transform(r.data,o);if(r.common.async)return Promise.resolve(i).then(async a=>{if(n.value==="aborted")return He;const c=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return c.status==="aborted"?He:c.status==="dirty"||n.value==="dirty"?ua(c.value):c});{if(n.value==="aborted")return He;const a=this._def.schema._parseSync({data:i,path:r.path,parent:r});return a.status==="aborted"?He:a.status==="dirty"||n.value==="dirty"?ua(a.value):a}}if(s.type==="refinement"){const i=a=>{const c=s.refinement(a,o);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?He:(a.status==="dirty"&&n.dirty(),i(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?He:(a.status==="dirty"&&n.dirty(),i(a.value).then(()=>({status:n.value,value:a.value}))))}if(s.type==="transform")if(r.common.async===!1){const i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Pc(i))return i;const a=s.transform(i.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>Pc(i)?Promise.resolve(s.transform(i.value,o)).then(a=>({status:n.value,value:a})):i);it.assertNever(s)}}Or.create=(e,t,n)=>new Or({schema:e,typeName:Ve.ZodEffects,effect:t,...Ze(n)});Or.createWithPreprocess=(e,t,n)=>new Or({schema:t,effect:{type:"preprocess",transform:e},typeName:Ve.ZodEffects,...Ze(n)});class Jr extends et{_parse(t){return this._getType(t)===_e.undefined?kn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Jr.create=(e,t)=>new Jr({innerType:e,typeName:Ve.ZodOptional,...Ze(t)});class Ro extends et{_parse(t){return this._getType(t)===_e.null?kn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Ro.create=(e,t)=>new Ro({innerType:e,typeName:Ve.ZodNullable,...Ze(t)});class Uc extends et{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===_e.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Uc.create=(e,t)=>new Uc({innerType:e,typeName:Ve.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Ze(t)});class Vc extends et{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Rc(s)?s.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Yn(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Yn(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Vc.create=(e,t)=>new Vc({innerType:e,typeName:Ve.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Ze(t)});class jf extends et{_parse(t){if(this._getType(t)!==_e.nan){const r=this._getOrReturnCtx(t);return ve(r,{code:ae.invalid_type,expected:_e.nan,received:r.parsedType}),He}return{status:"valid",value:t.data}}}jf.create=e=>new jf({typeName:Ve.ZodNaN,...Ze(e)});const O8=Symbol("zod_brand");class Mx extends et{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class gu extends et{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?He:o.status==="dirty"?(n.dirty(),ua(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?He:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(t,n){return new gu({in:t,out:n,typeName:Ve.ZodPipeline})}}class Bc extends et{_parse(t){const n=this._def.innerType._parse(t),r=s=>(Pc(s)&&(s.value=Object.freeze(s.value)),s);return Rc(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}Bc.create=(e,t)=>new Bc({innerType:e,typeName:Ve.ZodReadonly,...Ze(t)});function FN(e,t={},n){return e?La.create().superRefine((r,s)=>{var o,i;if(!e(r)){const a=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,c=(i=(o=a.fatal)!==null&&o!==void 0?o:n)!==null&&i!==void 0?i:!0,u=typeof a=="string"?{message:a}:a;s.addIssue({code:"custom",...u,fatal:c})}}):La.create()}const I8={object:Rt.lazycreate};var Ve;(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"})(Ve||(Ve={}));const M8=(e,t={message:`Input not instance of ${e.name}`})=>FN(n=>n instanceof e,t),$N=Cr.create,UN=No.create,L8=jf.create,z8=To.create,VN=Ac.create,F8=mi.create,$8=Sf.create,U8=Dc.create,V8=Oc.create,B8=La.create,W8=ri.create,H8=Fs.create,Y8=kf.create,K8=Nr.create,G8=Rt.create,Z8=Rt.strictCreate,q8=Ic.create,X8=Kh.create,Q8=Mc.create,J8=ss.create,eV=Lc.create,tV=Cf.create,nV=pi.create,rV=Ca.create,sV=zc.create,oV=Fc.create,iV=Po.create,aV=$c.create,lV=za.create,Bb=Or.create,cV=Jr.create,uV=Ro.create,dV=Or.createWithPreprocess,fV=gu.create,hV=()=>$N().optional(),mV=()=>UN().optional(),pV=()=>VN().optional(),gV={string:e=>Cr.create({...e,coerce:!0}),number:e=>No.create({...e,coerce:!0}),boolean:e=>Ac.create({...e,coerce:!0}),bigint:e=>To.create({...e,coerce:!0}),date:e=>mi.create({...e,coerce:!0})},yV=He;var le=Object.freeze({__proto__:null,defaultErrorMap:Ma,setErrorMap:y8,getErrorMap:wf,makeIssue:bf,EMPTY_PATH:v8,addIssueToContext:ve,ParseStatus:yn,INVALID:He,DIRTY:ua,OK:kn,isAborted:Lg,isDirty:zg,isValid:Pc,isAsync:Rc,get util(){return it},get objectUtil(){return Mg},ZodParsedType:_e,getParsedType:ao,ZodType:et,datetimeRegex:LN,ZodString:Cr,ZodNumber:No,ZodBigInt:To,ZodBoolean:Ac,ZodDate:mi,ZodSymbol:Sf,ZodUndefined:Dc,ZodNull:Oc,ZodAny:La,ZodUnknown:ri,ZodNever:Fs,ZodVoid:kf,ZodArray:Nr,ZodObject:Rt,ZodUnion:Ic,ZodDiscriminatedUnion:Kh,ZodIntersection:Mc,ZodTuple:ss,ZodRecord:Lc,ZodMap:Cf,ZodSet:pi,ZodFunction:Ca,ZodLazy:zc,ZodLiteral:Fc,ZodEnum:Po,ZodNativeEnum:$c,ZodPromise:za,ZodEffects:Or,ZodTransformer:Or,ZodOptional:Jr,ZodNullable:Ro,ZodDefault:Uc,ZodCatch:Vc,ZodNaN:jf,BRAND:O8,ZodBranded:Mx,ZodPipeline:gu,ZodReadonly:Bc,custom:FN,Schema:et,ZodSchema:et,late:I8,get ZodFirstPartyTypeKind(){return Ve},coerce:gV,any:B8,array:K8,bigint:z8,boolean:VN,date:F8,discriminatedUnion:X8,effect:Bb,enum:iV,function:rV,instanceof:M8,intersection:Q8,lazy:sV,literal:oV,map:tV,nan:L8,nativeEnum:aV,never:H8,null:V8,nullable:uV,number:UN,object:G8,oboolean:pV,onumber:mV,optional:cV,ostring:hV,pipeline:fV,preprocess:dV,promise:lV,record:eV,set:nV,strictObject:Z8,string:$N,symbol:$8,transformer:Bb,tuple:J8,undefined:U8,union:q8,unknown:W8,void:Y8,NEVER:yV,ZodIssueCode:ae,quotelessJson:g8,ZodError:Yn});const Wb=(e,t,n)=>{if(e&&"reportValidity"in e){const r=de(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},BN=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?Wb(r.ref,n,e):r.refs&&r.refs.forEach(s=>Wb(s,n,e))}},vV=(e,t)=>{t.shouldUseNativeValidation&&BN(e,t);const n={};for(const r in e){const s=de(t.fields,r),o=Object.assign(e[r]||{},{ref:s&&s.ref});if(xV(t.names||Object.keys(e),r)){const i=Object.assign({},de(n,r));mt(i,"root",o),mt(n,r,i)}else mt(n,r,o)}return n},xV=(e,t)=>e.some(n=>n.startsWith(t+"."));var wV=function(e,t){for(var n={};e.length;){var r=e[0],s=r.code,o=r.message,i=r.path.join(".");if(!n[i])if("unionErrors"in r){var a=r.unionErrors[0].errors[0];n[i]={message:a.message,type:a.code}}else n[i]={message:o,type:s};if("unionErrors"in r&&r.unionErrors.forEach(function(d){return d.errors.forEach(function(f){return e.push(f)})}),t){var c=n[i].types,u=c&&c[r.code];n[i]=jN(i,t,n,s,u?[].concat(u,r.message):r.message)}e.shift()}return n},un=function(e,t,n){return n===void 0&&(n={}),function(r,s,o){try{return Promise.resolve(function(i,a){try{var c=Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(u){return o.shouldUseNativeValidation&&BN({},o),{errors:{},values:n.raw?r:u}})}catch(u){return a(u)}return c&&c.then?c.then(void 0,a):c}(0,function(i){if(function(a){return Array.isArray(a==null?void 0:a.errors)}(i))return{values:{},errors:vV(wV(i.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw i}))}catch(i){return Promise.reject(i)}}};const WN=y.forwardRef(({...e},t)=>l.jsx("nav",{ref:t,"aria-label":"breadcrumb",...e}));WN.displayName="Breadcrumb";const HN=y.forwardRef(({className:e,...t},n)=>l.jsx("ol",{ref:n,className:re("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",e),...t}));HN.displayName="BreadcrumbList";const $g=y.forwardRef(({className:e,...t},n)=>l.jsx("li",{ref:n,className:re("inline-flex items-center gap-1.5",e),...t}));$g.displayName="BreadcrumbItem";const YN=y.forwardRef(({asChild:e,className:t,...n},r)=>{const s=e?es:"a";return l.jsx(s,{ref:r,className:re("transition-colors hover:text-foreground",t),...n})});YN.displayName="BreadcrumbLink";const KN=y.forwardRef(({className:e,...t},n)=>l.jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:re("font-normal text-foreground",e),...t}));KN.displayName="BreadcrumbPage";const GN=({children:e,className:t,...n})=>l.jsx("li",{role:"presentation","aria-hidden":"true",className:re("[&>svg]:size-3.5",t),...n,children:e??l.jsx(rk,{})});GN.displayName="BreadcrumbSeparator";var bV="Label",ZN=y.forwardRef((e,t)=>l.jsx(Pe.label,{...e,ref:t,onMouseDown:n=>{var s;n.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));ZN.displayName=bV;var qN=ZN;const _V=Jc("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Vt=y.forwardRef(({className:e,...t},n)=>l.jsx(qN,{ref:n,className:re(_V(),e),...t}));Vt.displayName=qN.displayName;const dn=t8,XN=y.createContext({}),ke=({...e})=>l.jsx(XN.Provider,{value:{name:e.name},children:l.jsx(o8,{...e})}),Gh=()=>{const e=y.useContext(XN),t=y.useContext(QN),{getFieldState:n,formState:r}=Yh(),s=n(e.name,r);if(!e)throw new Error("useFormField should be used within ");const{id:o}=t;return{id:o,name:e.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...s}},QN=y.createContext({}),Se=y.forwardRef(({className:e,...t},n)=>{const r=y.useId();return l.jsx(QN.Provider,{value:{id:r},children:l.jsx("div",{ref:n,className:re("space-y-2",e),...t})})});Se.displayName="FormItem";const Ce=y.forwardRef(({className:e,...t},n)=>{const{error:r,formItemId:s}=Gh();return l.jsx(Vt,{ref:n,className:re(r&&"text-destructive",e),htmlFor:s,...t})});Ce.displayName="FormLabel";const je=y.forwardRef(({...e},t)=>{const{error:n,formItemId:r,formDescriptionId:s,formMessageId:o}=Gh();return l.jsx(es,{ref:t,id:r,"aria-describedby":n?`${s} ${o}`:`${s}`,"aria-invalid":!!n,...e})});je.displayName="FormControl";const SV=y.forwardRef(({className:e,...t},n)=>{const{formDescriptionId:r}=Gh();return l.jsx("p",{ref:n,id:r,className:re("text-sm text-muted-foreground",e),...t})});SV.displayName="FormDescription";const ye=y.forwardRef(({className:e,children:t,...n},r)=>{const{error:s,formMessageId:o}=Gh(),{t:i}=Ye(),a=s?i(String(s==null?void 0:s.message)):t;return a?l.jsx("p",{ref:r,id:o,className:re("text-sm font-medium text-destructive",e),...n,children:a}):null});ye.displayName="FormMessage";const pe=y.forwardRef(({className:e,type:t,...n},r)=>l.jsx("input",{type:t,className:re("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:r,...n}));pe.displayName="Input";function Ug(e,[t,n]){return Math.min(n,Math.max(t,e))}var kV=[" ","Enter","ArrowUp","ArrowDown"],CV=[" ","Enter"],yu="Select",[Zh,qh,jV]=eu(yu),[al,XH]=on(yu,[jV,tl]),Xh=tl(),[EV,Lo]=al(yu),[NV,TV]=al(yu),JN=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:o,value:i,defaultValue:a,onValueChange:c,dir:u,name:d,autoComplete:f,disabled:h,required:m}=e,x=Xh(t),[p,w]=y.useState(null),[g,v]=y.useState(null),[b,_]=y.useState(!1),C=Si(u),[j=!1,T]=Gn({prop:r,defaultProp:s,onChange:o}),[R,A]=Gn({prop:i,defaultProp:a,onChange:c}),O=y.useRef(null),G=p?!!p.closest("form"):!0,[N,z]=y.useState(new Set),S=Array.from(N).map(U=>U.props.value).join(";");return l.jsx(wv,{...x,children:l.jsxs(EV,{required:m,scope:t,trigger:p,onTriggerChange:w,valueNode:g,onValueNodeChange:v,valueNodeHasChildren:b,onValueNodeHasChildrenChange:_,contentId:Bn(),value:R,onValueChange:A,open:j,onOpenChange:T,dir:C,triggerPointerDownPosRef:O,disabled:h,children:[l.jsx(Zh.Provider,{scope:t,children:l.jsx(NV,{scope:e.__scopeSelect,onNativeOptionAdd:y.useCallback(U=>{z(J=>new Set(J).add(U))},[]),onNativeOptionRemove:y.useCallback(U=>{z(J=>{const F=new Set(J);return F.delete(U),F})},[]),children:n})}),G?l.jsxs(C2,{"aria-hidden":!0,required:m,tabIndex:-1,name:d,autoComplete:f,value:R,onChange:U=>A(U.target.value),disabled:h,children:[R===void 0?l.jsx("option",{value:""}):null,Array.from(N)]},S):null]})})};JN.displayName=yu;var e2="SelectTrigger",t2=y.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,o=Xh(n),i=Lo(e2,n),a=i.disabled||r,c=Ge(t,i.onTriggerChange),u=qh(n),[d,f,h]=j2(x=>{const p=u().filter(v=>!v.disabled),w=p.find(v=>v.value===i.value),g=E2(p,x,w);g!==void 0&&i.onValueChange(g.value)}),m=()=>{a||(i.onOpenChange(!0),h())};return l.jsx(bv,{asChild:!0,...o,children:l.jsx(Pe.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":k2(i.value)?"":void 0,...s,ref:c,onClick:ue(s.onClick,x=>{x.currentTarget.focus()}),onPointerDown:ue(s.onPointerDown,x=>{const p=x.target;p.hasPointerCapture(x.pointerId)&&p.releasePointerCapture(x.pointerId),x.button===0&&x.ctrlKey===!1&&(m(),i.triggerPointerDownPosRef.current={x:Math.round(x.pageX),y:Math.round(x.pageY)},x.preventDefault())}),onKeyDown:ue(s.onKeyDown,x=>{const p=d.current!=="";!(x.ctrlKey||x.altKey||x.metaKey)&&x.key.length===1&&f(x.key),!(p&&x.key===" ")&&kV.includes(x.key)&&(m(),x.preventDefault())})})})});t2.displayName=e2;var n2="SelectValue",r2=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:o,placeholder:i="",...a}=e,c=Lo(n2,n),{onValueNodeHasChildrenChange:u}=c,d=o!==void 0,f=Ge(t,c.onValueNodeChange);return en(()=>{u(d)},[u,d]),l.jsx(Pe.span,{...a,ref:f,style:{pointerEvents:"none"},children:k2(c.value)?l.jsx(l.Fragment,{children:i}):o})});r2.displayName=n2;var PV="SelectIcon",s2=y.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return l.jsx(Pe.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});s2.displayName=PV;var RV="SelectPortal",o2=e=>l.jsx(nu,{asChild:!0,...e});o2.displayName=RV;var gi="SelectContent",i2=y.forwardRef((e,t)=>{const n=Lo(gi,e.__scopeSelect),[r,s]=y.useState();if(en(()=>{s(new DocumentFragment)},[]),!n.open){const o=r;return o?Vs.createPortal(l.jsx(a2,{scope:e.__scopeSelect,children:l.jsx(Zh.Slot,{scope:e.__scopeSelect,children:l.jsx("div",{children:e.children})})}),o):null}return l.jsx(l2,{...e,ref:t})});i2.displayName=gi;var bs=10,[a2,zo]=al(gi),AV="SelectContentImpl",l2=y.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:o,onPointerDownOutside:i,side:a,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:h,collisionPadding:m,sticky:x,hideWhenDetached:p,avoidCollisions:w,...g}=e,v=Lo(gi,n),[b,_]=y.useState(null),[C,j]=y.useState(null),T=Ge(t,me=>_(me)),[R,A]=y.useState(null),[O,G]=y.useState(null),N=qh(n),[z,S]=y.useState(!1),U=y.useRef(!1);y.useEffect(()=>{if(b)return jv(b)},[b]),uv();const J=y.useCallback(me=>{const[we,...Te]=N().map(Re=>Re.ref.current),[Fe]=Te.slice(-1),Ie=document.activeElement;for(const Re of me)if(Re===Ie||(Re==null||Re.scrollIntoView({block:"nearest"}),Re===we&&C&&(C.scrollTop=0),Re===Fe&&C&&(C.scrollTop=C.scrollHeight),Re==null||Re.focus(),document.activeElement!==Ie))return},[N,C]),F=y.useCallback(()=>J([R,b]),[J,R,b]);y.useEffect(()=>{z&&F()},[z,F]);const{onOpenChange:W,triggerPointerDownPosRef:I}=v;y.useEffect(()=>{if(b){let me={x:0,y:0};const we=Fe=>{var Ie,Re;me={x:Math.abs(Math.round(Fe.pageX)-(((Ie=I.current)==null?void 0:Ie.x)??0)),y:Math.abs(Math.round(Fe.pageY)-(((Re=I.current)==null?void 0:Re.y)??0))}},Te=Fe=>{me.x<=10&&me.y<=10?Fe.preventDefault():b.contains(Fe.target)||W(!1),document.removeEventListener("pointermove",we),I.current=null};return I.current!==null&&(document.addEventListener("pointermove",we),document.addEventListener("pointerup",Te,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",we),document.removeEventListener("pointerup",Te,{capture:!0})}}},[b,W,I]),y.useEffect(()=>{const me=()=>W(!1);return window.addEventListener("blur",me),window.addEventListener("resize",me),()=>{window.removeEventListener("blur",me),window.removeEventListener("resize",me)}},[W]);const[X,$]=j2(me=>{const we=N().filter(Ie=>!Ie.disabled),Te=we.find(Ie=>Ie.ref.current===document.activeElement),Fe=E2(we,me,Te);Fe&&setTimeout(()=>Fe.ref.current.focus())}),B=y.useCallback((me,we,Te)=>{const Fe=!U.current&&!Te;(v.value!==void 0&&v.value===we||Fe)&&(A(me),Fe&&(U.current=!0))},[v.value]),he=y.useCallback(()=>b==null?void 0:b.focus(),[b]),se=y.useCallback((me,we,Te)=>{const Fe=!U.current&&!Te;(v.value!==void 0&&v.value===we||Fe)&&G(me)},[v.value]),oe=r==="popper"?Vg:c2,Oe=oe===Vg?{side:a,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:h,collisionPadding:m,sticky:x,hideWhenDetached:p,avoidCollisions:w}:{};return l.jsx(a2,{scope:n,content:b,viewport:C,onViewportChange:j,itemRefCallback:B,selectedItem:R,onItemLeave:he,itemTextRefCallback:se,focusSelectedItem:F,selectedItemText:O,position:r,isPositioned:z,searchRef:X,children:l.jsx(ph,{as:es,allowPinchZoom:!0,children:l.jsx(uh,{asChild:!0,trapped:v.open,onMountAutoFocus:me=>{me.preventDefault()},onUnmountAutoFocus:ue(s,me=>{var we;(we=v.trigger)==null||we.focus({preventScroll:!0}),me.preventDefault()}),children:l.jsx(Qa,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:me=>me.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:l.jsx(oe,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:me=>me.preventDefault(),...g,...Oe,onPlaced:()=>S(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:ue(g.onKeyDown,me=>{const we=me.ctrlKey||me.altKey||me.metaKey;if(me.key==="Tab"&&me.preventDefault(),!we&&me.key.length===1&&$(me.key),["ArrowUp","ArrowDown","Home","End"].includes(me.key)){let Fe=N().filter(Ie=>!Ie.disabled).map(Ie=>Ie.ref.current);if(["ArrowUp","End"].includes(me.key)&&(Fe=Fe.slice().reverse()),["ArrowUp","ArrowDown"].includes(me.key)){const Ie=me.target,Re=Fe.indexOf(Ie);Fe=Fe.slice(Re+1)}setTimeout(()=>J(Fe)),me.preventDefault()}})})})})})})});l2.displayName=AV;var DV="SelectItemAlignedPosition",c2=y.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,o=Lo(gi,n),i=zo(gi,n),[a,c]=y.useState(null),[u,d]=y.useState(null),f=Ge(t,T=>d(T)),h=qh(n),m=y.useRef(!1),x=y.useRef(!0),{viewport:p,selectedItem:w,selectedItemText:g,focusSelectedItem:v}=i,b=y.useCallback(()=>{if(o.trigger&&o.valueNode&&a&&u&&p&&w&&g){const T=o.trigger.getBoundingClientRect(),R=u.getBoundingClientRect(),A=o.valueNode.getBoundingClientRect(),O=g.getBoundingClientRect();if(o.dir!=="rtl"){const Ie=O.left-R.left,Re=A.left-Ie,st=T.left-Re,E=T.width+st,ee=Math.max(E,R.width),Z=window.innerWidth-bs,D=Ug(Re,[bs,Z-ee]);a.style.minWidth=E+"px",a.style.left=D+"px"}else{const Ie=R.right-O.right,Re=window.innerWidth-A.right-Ie,st=window.innerWidth-T.right-Re,E=T.width+st,ee=Math.max(E,R.width),Z=window.innerWidth-bs,D=Ug(Re,[bs,Z-ee]);a.style.minWidth=E+"px",a.style.right=D+"px"}const G=h(),N=window.innerHeight-bs*2,z=p.scrollHeight,S=window.getComputedStyle(u),U=parseInt(S.borderTopWidth,10),J=parseInt(S.paddingTop,10),F=parseInt(S.borderBottomWidth,10),W=parseInt(S.paddingBottom,10),I=U+J+z+W+F,X=Math.min(w.offsetHeight*5,I),$=window.getComputedStyle(p),B=parseInt($.paddingTop,10),he=parseInt($.paddingBottom,10),se=T.top+T.height/2-bs,oe=N-se,Oe=w.offsetHeight/2,me=w.offsetTop+Oe,we=U+J+me,Te=I-we;if(we<=se){const Ie=w===G[G.length-1].ref.current;a.style.bottom="0px";const Re=u.clientHeight-p.offsetTop-p.offsetHeight,st=Math.max(oe,Oe+(Ie?he:0)+Re+F),E=we+st;a.style.height=E+"px"}else{const Ie=w===G[0].ref.current;a.style.top="0px";const st=Math.max(se,U+p.offsetTop+(Ie?B:0)+Oe)+Te;a.style.height=st+"px",p.scrollTop=we-se+p.offsetTop}a.style.margin=`${bs}px 0`,a.style.minHeight=X+"px",a.style.maxHeight=N+"px",r==null||r(),requestAnimationFrame(()=>m.current=!0)}},[h,o.trigger,o.valueNode,a,u,p,w,g,o.dir,r]);en(()=>b(),[b]);const[_,C]=y.useState();en(()=>{u&&C(window.getComputedStyle(u).zIndex)},[u]);const j=y.useCallback(T=>{T&&x.current===!0&&(b(),v==null||v(),x.current=!1)},[b,v]);return l.jsx(IV,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:m,onScrollButtonChange:j,children:l.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:_},children:l.jsx(Pe.div,{...s,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});c2.displayName=DV;var OV="SelectPopperPosition",Vg=y.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=bs,...o}=e,i=Xh(n);return l.jsx(_v,{...i,...o,ref:t,align:r,collisionPadding:s,style:{boxSizing:"border-box",...o.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)"}})});Vg.displayName=OV;var[IV,Lx]=al(gi,{}),Bg="SelectViewport",u2=y.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,o=zo(Bg,n),i=Lx(Bg,n),a=Ge(t,o.onViewportChange),c=y.useRef(0);return l.jsxs(l.Fragment,{children:[l.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:r}),l.jsx(Zh.Slot,{scope:n,children:l.jsx(Pe.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:h}=i;if(h!=null&&h.current&&f){const m=Math.abs(c.current-d.scrollTop);if(m>0){const x=window.innerHeight-bs*2,p=parseFloat(f.style.minHeight),w=parseFloat(f.style.height),g=Math.max(p,w);if(g0?_:0,f.style.justifyContent="flex-end")}}}c.current=d.scrollTop})})})]})});u2.displayName=Bg;var d2="SelectGroup",[MV,LV]=al(d2),f2=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Bn();return l.jsx(MV,{scope:n,id:s,children:l.jsx(Pe.div,{role:"group","aria-labelledby":s,...r,ref:t})})});f2.displayName=d2;var h2="SelectLabel",m2=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=LV(h2,n);return l.jsx(Pe.div,{id:s.id,...r,ref:t})});m2.displayName=h2;var Ef="SelectItem",[zV,p2]=al(Ef),g2=y.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:o,...i}=e,a=Lo(Ef,n),c=zo(Ef,n),u=a.value===r,[d,f]=y.useState(o??""),[h,m]=y.useState(!1),x=Ge(t,g=>{var v;return(v=c.itemRefCallback)==null?void 0:v.call(c,g,r,s)}),p=Bn(),w=()=>{s||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")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 l.jsx(zV,{scope:n,value:r,disabled:s,textId:p,isSelected:u,onItemTextChange:y.useCallback(g=>{f(v=>v||((g==null?void 0:g.textContent)??"").trim())},[]),children:l.jsx(Zh.ItemSlot,{scope:n,value:r,disabled:s,textValue:d,children:l.jsx(Pe.div,{role:"option","aria-labelledby":p,"data-highlighted":h?"":void 0,"aria-selected":u&&h,"data-state":u?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...i,ref:x,onFocus:ue(i.onFocus,()=>m(!0)),onBlur:ue(i.onBlur,()=>m(!1)),onPointerUp:ue(i.onPointerUp,w),onPointerMove:ue(i.onPointerMove,g=>{var v;s?(v=c.onItemLeave)==null||v.call(c):g.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ue(i.onPointerLeave,g=>{var v;g.currentTarget===document.activeElement&&((v=c.onItemLeave)==null||v.call(c))}),onKeyDown:ue(i.onKeyDown,g=>{var b;((b=c.searchRef)==null?void 0:b.current)!==""&&g.key===" "||(CV.includes(g.key)&&w(),g.key===" "&&g.preventDefault())})})})})});g2.displayName=Ef;var zl="SelectItemText",y2=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...o}=e,i=Lo(zl,n),a=zo(zl,n),c=p2(zl,n),u=TV(zl,n),[d,f]=y.useState(null),h=Ge(t,g=>f(g),c.onItemTextChange,g=>{var v;return(v=a.itemTextRefCallback)==null?void 0:v.call(a,g,c.value,c.disabled)}),m=d==null?void 0:d.textContent,x=y.useMemo(()=>l.jsx("option",{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:p,onNativeOptionRemove:w}=u;return en(()=>(p(x),()=>w(x)),[p,w,x]),l.jsxs(l.Fragment,{children:[l.jsx(Pe.span,{id:c.textId,...o,ref:h}),c.isSelected&&i.valueNode&&!i.valueNodeHasChildren?Vs.createPortal(o.children,i.valueNode):null]})});y2.displayName=zl;var v2="SelectItemIndicator",x2=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return p2(v2,n).isSelected?l.jsx(Pe.span,{"aria-hidden":!0,...r,ref:t}):null});x2.displayName=v2;var Wg="SelectScrollUpButton",w2=y.forwardRef((e,t)=>{const n=zo(Wg,e.__scopeSelect),r=Lx(Wg,e.__scopeSelect),[s,o]=y.useState(!1),i=Ge(t,r.onScrollButtonChange);return en(()=>{if(n.viewport&&n.isPositioned){let a=function(){const u=c.scrollTop>0;o(u)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),s?l.jsx(_2,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop-c.offsetHeight)}}):null});w2.displayName=Wg;var Hg="SelectScrollDownButton",b2=y.forwardRef((e,t)=>{const n=zo(Hg,e.__scopeSelect),r=Lx(Hg,e.__scopeSelect),[s,o]=y.useState(!1),i=Ge(t,r.onScrollButtonChange);return en(()=>{if(n.viewport&&n.isPositioned){let a=function(){const u=c.scrollHeight-c.clientHeight,d=Math.ceil(c.scrollTop)c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),s?l.jsx(_2,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});b2.displayName=Hg;var _2=y.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,o=zo("SelectScrollButton",n),i=y.useRef(null),a=qh(n),c=y.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return y.useEffect(()=>()=>c(),[c]),en(()=>{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]),l.jsx(Pe.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:ue(s.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(r,50))}),onPointerMove:ue(s.onPointerMove,()=>{var u;(u=o.onItemLeave)==null||u.call(o),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:ue(s.onPointerLeave,()=>{c()})})}),FV="SelectSeparator",S2=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return l.jsx(Pe.div,{"aria-hidden":!0,...r,ref:t})});S2.displayName=FV;var Yg="SelectArrow",$V=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Xh(n),o=Lo(Yg,n),i=zo(Yg,n);return o.open&&i.position==="popper"?l.jsx(Sv,{...s,...r,ref:t}):null});$V.displayName=Yg;function k2(e){return e===""||e===void 0}var C2=y.forwardRef((e,t)=>{const{value:n,...r}=e,s=y.useRef(null),o=Ge(t,s),i=Cx(n);return y.useEffect(()=>{const a=s.current,c=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(i!==n&&d){const f=new Event("change",{bubbles:!0});d.call(a,n),a.dispatchEvent(f)}},[i,n]),l.jsx(hu,{asChild:!0,children:l.jsx("select",{...r,ref:o,defaultValue:n})})});C2.displayName="BubbleSelect";function j2(e){const t=Ot(e),n=y.useRef(""),r=y.useRef(0),s=y.useCallback(i=>{const a=n.current+i;t(a),function c(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>c(""),1e3))}(a)},[t]),o=y.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return y.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,o]}function E2(e,t,n){const s=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let i=UV(e,Math.max(o,0));s.length===1&&(i=i.filter(u=>u!==n));const c=i.find(u=>u.textValue.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}function UV(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var VV=JN,N2=t2,BV=r2,WV=s2,HV=o2,T2=i2,YV=u2,KV=f2,P2=m2,R2=g2,GV=y2,ZV=x2,A2=w2,D2=b2,O2=S2;const Fa=VV,Wc=KV,$a=BV,yi=y.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(N2,{ref:r,className:re("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),...n,children:[t,l.jsx(WV,{asChild:!0,children:l.jsx(rv,{className:"h-4 w-4 opacity-50"})})]}));yi.displayName=N2.displayName;const I2=y.forwardRef(({className:e,...t},n)=>l.jsx(A2,{ref:n,className:re("flex cursor-default items-center justify-center py-1",e),...t,children:l.jsx(JO,{className:"h-4 w-4"})}));I2.displayName=A2.displayName;const M2=y.forwardRef(({className:e,...t},n)=>l.jsx(D2,{ref:n,className:re("flex cursor-default items-center justify-center py-1",e),...t,children:l.jsx(rv,{className:"h-4 w-4"})}));M2.displayName=D2.displayName;const vi=y.forwardRef(({className:e,children:t,position:n="popper",...r},s)=>l.jsx(HV,{children:l.jsxs(T2,{ref:s,className:re("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",n==="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:n,...r,children:[l.jsx(I2,{}),l.jsx(YV,{className:re("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),l.jsx(M2,{})]})}));vi.displayName=T2.displayName;const Ua=y.forwardRef(({className:e,...t},n)=>l.jsx(P2,{ref:n,className:re("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Ua.displayName=P2.displayName;const Ao=y.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(R2,{ref:r,className:re("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),...n,children:[l.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:l.jsx(ZV,{children:l.jsx(nk,{className:"h-4 w-4"})})}),l.jsx(GV,{children:t})]}));Ao.displayName=R2.displayName;const qV=y.forwardRef(({className:e,...t},n)=>l.jsx(O2,{ref:n,className:re("-mx-1 my-1 h-px bg-muted",e),...t}));qV.displayName=O2.displayName;const ll=Uv,cl=Vv,XV=Bv,L2=y.forwardRef(({className:e,...t},n)=>l.jsx(ou,{ref:n,className:re("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}));L2.displayName=ou.displayName;const Ni=y.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(XV,{children:[l.jsx(L2,{}),l.jsxs(iu,{ref:r,className:re("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),...n,children:[t,l.jsxs(xh,{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:[l.jsx(iv,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Ni.displayName=iu.displayName;const Ti=({className:e,...t})=>l.jsx("div",{className:re("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Ti.displayName="DialogHeader";const Qh=({className:e,...t})=>l.jsx("div",{className:re("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Qh.displayName="DialogFooter";const Pi=y.forwardRef(({className:e,...t},n)=>l.jsx(au,{ref:n,className:re("text-lg font-semibold leading-none tracking-tight",e),...t}));Pi.displayName=au.displayName;const z2=y.forwardRef(({className:e,...t},n)=>l.jsx(lu,{ref:n,className:re("text-sm text-muted-foreground",e),...t}));z2.displayName=lu.displayName;function QV(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var zx="ScrollArea",[F2,QH]=on(zx),[JV,pr]=F2(zx),$2=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:s,scrollHideDelay:o=600,...i}=e,[a,c]=y.useState(null),[u,d]=y.useState(null),[f,h]=y.useState(null),[m,x]=y.useState(null),[p,w]=y.useState(null),[g,v]=y.useState(0),[b,_]=y.useState(0),[C,j]=y.useState(!1),[T,R]=y.useState(!1),A=Ge(t,G=>c(G)),O=Si(s);return l.jsx(JV,{scope:n,type:r,dir:O,scrollHideDelay:o,scrollArea:a,viewport:u,onViewportChange:d,content:f,onContentChange:h,scrollbarX:m,onScrollbarXChange:x,scrollbarXEnabled:C,onScrollbarXEnabledChange:j,scrollbarY:p,onScrollbarYChange:w,scrollbarYEnabled:T,onScrollbarYEnabledChange:R,onCornerWidthChange:v,onCornerHeightChange:_,children:l.jsx(Pe.div,{dir:O,...i,ref:A,style:{position:"relative","--radix-scroll-area-corner-width":g+"px","--radix-scroll-area-corner-height":b+"px",...e.style}})})});$2.displayName=zx;var U2="ScrollAreaViewport",V2=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:s,...o}=e,i=pr(U2,n),a=y.useRef(null),c=Ge(t,a,i.onViewportChange);return l.jsxs(l.Fragment,{children:[l.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}),l.jsx(Pe.div,{"data-radix-scroll-area-viewport":"",...o,ref:c,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style},children:l.jsx("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});V2.displayName=U2;var ls="ScrollAreaScrollbar",Fx=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=pr(ls,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:i}=s,a=e.orientation==="horizontal";return y.useEffect(()=>(a?o(!0):i(!0),()=>{a?o(!1):i(!1)}),[a,o,i]),s.type==="hover"?l.jsx(eB,{...r,ref:t,forceMount:n}):s.type==="scroll"?l.jsx(tB,{...r,ref:t,forceMount:n}):s.type==="auto"?l.jsx(B2,{...r,ref:t,forceMount:n}):s.type==="always"?l.jsx($x,{...r,ref:t}):null});Fx.displayName=ls;var eB=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=pr(ls,e.__scopeScrollArea),[o,i]=y.useState(!1);return y.useEffect(()=>{const a=s.scrollArea;let c=0;if(a){const u=()=>{window.clearTimeout(c),i(!0)},d=()=>{c=window.setTimeout(()=>i(!1),s.scrollHideDelay)};return a.addEventListener("pointerenter",u),a.addEventListener("pointerleave",d),()=>{window.clearTimeout(c),a.removeEventListener("pointerenter",u),a.removeEventListener("pointerleave",d)}}},[s.scrollArea,s.scrollHideDelay]),l.jsx(an,{present:n||o,children:l.jsx(B2,{"data-state":o?"visible":"hidden",...r,ref:t})})}),tB=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=pr(ls,e.__scopeScrollArea),o=e.orientation==="horizontal",i=em(()=>c("SCROLL_END"),100),[a,c]=QV("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 y.useEffect(()=>{if(a==="idle"){const u=window.setTimeout(()=>c("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(u)}},[a,s.scrollHideDelay,c]),y.useEffect(()=>{const u=s.viewport,d=o?"scrollLeft":"scrollTop";if(u){let f=u[d];const h=()=>{const m=u[d];f!==m&&(c("SCROLL"),i()),f=m};return u.addEventListener("scroll",h),()=>u.removeEventListener("scroll",h)}},[s.viewport,o,c,i]),l.jsx(an,{present:n||a!=="hidden",children:l.jsx($x,{"data-state":a==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:ue(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:ue(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),B2=y.forwardRef((e,t)=>{const n=pr(ls,e.__scopeScrollArea),{forceMount:r,...s}=e,[o,i]=y.useState(!1),a=e.orientation==="horizontal",c=em(()=>{if(n.viewport){const u=n.viewport.offsetWidth{const{orientation:n="vertical",...r}=e,s=pr(ls,e.__scopeScrollArea),o=y.useRef(null),i=y.useRef(0),[a,c]=y.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=G2(a.viewport,a.content),d={...r,sizes:a,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:h=>o.current=h,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:h=>i.current=h};function f(h,m){return aB(h,i.current,a,m)}return n==="horizontal"?l.jsx(nB,{...d,ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const h=s.viewport.scrollLeft,m=Hb(h,a,s.dir);o.current.style.transform=`translate3d(${m}px, 0, 0)`}},onWheelScroll:h=>{s.viewport&&(s.viewport.scrollLeft=h)},onDragScroll:h=>{s.viewport&&(s.viewport.scrollLeft=f(h,s.dir))}}):n==="vertical"?l.jsx(rB,{...d,ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const h=s.viewport.scrollTop,m=Hb(h,a);o.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:h=>{s.viewport&&(s.viewport.scrollTop=h)},onDragScroll:h=>{s.viewport&&(s.viewport.scrollTop=f(h))}}):null}),nB=y.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...s}=e,o=pr(ls,e.__scopeScrollArea),[i,a]=y.useState(),c=y.useRef(null),u=Ge(t,c,o.onScrollbarXChange);return y.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),l.jsx(H2,{"data-orientation":"horizontal",...s,ref:u,sizes:n,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Jh(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,f)=>{if(o.viewport){const h=o.viewport.scrollLeft+d.deltaX;e.onWheelScroll(h),q2(h,f)&&d.preventDefault()}},onResize:()=>{c.current&&o.viewport&&i&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:Tf(i.paddingLeft),paddingEnd:Tf(i.paddingRight)}})}})}),rB=y.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...s}=e,o=pr(ls,e.__scopeScrollArea),[i,a]=y.useState(),c=y.useRef(null),u=Ge(t,c,o.onScrollbarYChange);return y.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),l.jsx(H2,{"data-orientation":"vertical",...s,ref:u,sizes:n,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Jh(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,f)=>{if(o.viewport){const h=o.viewport.scrollTop+d.deltaY;e.onWheelScroll(h),q2(h,f)&&d.preventDefault()}},onResize:()=>{c.current&&o.viewport&&i&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:Tf(i.paddingTop),paddingEnd:Tf(i.paddingBottom)}})}})}),[sB,W2]=F2(ls),H2=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:s,onThumbChange:o,onThumbPointerUp:i,onThumbPointerDown:a,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:d,onResize:f,...h}=e,m=pr(ls,n),[x,p]=y.useState(null),w=Ge(t,A=>p(A)),g=y.useRef(null),v=y.useRef(""),b=m.viewport,_=r.content-r.viewport,C=Ot(d),j=Ot(c),T=em(f,10);function R(A){if(g.current){const O=A.clientX-g.current.left,G=A.clientY-g.current.top;u({x:O,y:G})}}return y.useEffect(()=>{const A=O=>{const G=O.target;(x==null?void 0:x.contains(G))&&C(O,_)};return document.addEventListener("wheel",A,{passive:!1}),()=>document.removeEventListener("wheel",A,{passive:!1})},[b,x,_,C]),y.useEffect(j,[r,j]),Va(x,T),Va(m.content,T),l.jsx(sB,{scope:n,scrollbar:x,hasThumb:s,onThumbChange:Ot(o),onThumbPointerUp:Ot(i),onThumbPositionChange:j,onThumbPointerDown:Ot(a),children:l.jsx(Pe.div,{...h,ref:w,style:{position:"absolute",...h.style},onPointerDown:ue(e.onPointerDown,A=>{A.button===0&&(A.target.setPointerCapture(A.pointerId),g.current=x.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),R(A))}),onPointerMove:ue(e.onPointerMove,R),onPointerUp:ue(e.onPointerUp,A=>{const O=A.target;O.hasPointerCapture(A.pointerId)&&O.releasePointerCapture(A.pointerId),document.body.style.webkitUserSelect=v.current,m.viewport&&(m.viewport.style.scrollBehavior=""),g.current=null})})})}),Nf="ScrollAreaThumb",Y2=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=W2(Nf,e.__scopeScrollArea);return l.jsx(an,{present:n||s.hasThumb,children:l.jsx(oB,{ref:t,...r})})}),oB=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...s}=e,o=pr(Nf,n),i=W2(Nf,n),{onThumbPositionChange:a}=i,c=Ge(t,f=>i.onThumbChange(f)),u=y.useRef(),d=em(()=>{u.current&&(u.current(),u.current=void 0)},100);return y.useEffect(()=>{const f=o.viewport;if(f){const h=()=>{if(d(),!u.current){const m=lB(f,a);u.current=m,a()}};return a(),f.addEventListener("scroll",h),()=>f.removeEventListener("scroll",h)}},[o.viewport,d,a]),l.jsx(Pe.div,{"data-state":i.hasThumb?"visible":"hidden",...s,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:ue(e.onPointerDownCapture,f=>{const m=f.target.getBoundingClientRect(),x=f.clientX-m.left,p=f.clientY-m.top;i.onThumbPointerDown({x,y:p})}),onPointerUp:ue(e.onPointerUp,i.onThumbPointerUp)})});Y2.displayName=Nf;var Ux="ScrollAreaCorner",K2=y.forwardRef((e,t)=>{const n=pr(Ux,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?l.jsx(iB,{...e,ref:t}):null});K2.displayName=Ux;var iB=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,s=pr(Ux,n),[o,i]=y.useState(0),[a,c]=y.useState(0),u=!!(o&&a);return Va(s.scrollbarX,()=>{var f;const d=((f=s.scrollbarX)==null?void 0:f.offsetHeight)||0;s.onCornerHeightChange(d),c(d)}),Va(s.scrollbarY,()=>{var f;const d=((f=s.scrollbarY)==null?void 0:f.offsetWidth)||0;s.onCornerWidthChange(d),i(d)}),u?l.jsx(Pe.div,{...r,ref:t,style:{width:o,height:a,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Tf(e){return e?parseInt(e,10):0}function G2(e,t){const n=e/t;return isNaN(n)?0:n}function Jh(e){const t=G2(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function aB(e,t,n,r="ltr"){const s=Jh(n),o=s/2,i=t||o,a=s-i,c=n.scrollbar.paddingStart+i,u=n.scrollbar.size-n.scrollbar.paddingEnd-a,d=n.content-n.viewport,f=r==="ltr"?[0,d]:[d*-1,0];return Z2([c,u],f)(e)}function Hb(e,t,n="ltr"){const r=Jh(t),s=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-s,i=t.content-t.viewport,a=o-r,c=n==="ltr"?[0,i]:[i*-1,0],u=Ug(e,c);return Z2([0,i],[0,a])(u)}function Z2(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function q2(e,t){return e>0&&e{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function s(){const o={left:e.scrollLeft,top:e.scrollTop},i=n.left!==o.left,a=n.top!==o.top;(i||a)&&t(),n=o,r=window.requestAnimationFrame(s)}(),()=>window.cancelAnimationFrame(r)};function em(e,t){const n=Ot(e),r=y.useRef(0);return y.useEffect(()=>()=>window.clearTimeout(r.current),[]),y.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Va(e,t){const n=Ot(t);en(()=>{let r=0;if(e){const s=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return s.observe(e),()=>{window.cancelAnimationFrame(r),s.unobserve(e)}}},[e,n])}var X2=$2,cB=V2,uB=K2;const tm=y.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(X2,{ref:r,className:re("relative overflow-hidden",e),...n,children:[l.jsx(cB,{className:"h-full w-full rounded-[inherit]",children:t}),l.jsx(Q2,{}),l.jsx(uB,{})]}));tm.displayName=X2.displayName;const Q2=y.forwardRef(({className:e,orientation:t="vertical",...n},r)=>l.jsx(Fx,{ref:r,orientation:t,className:re("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),...n,children:l.jsx(Y2,{className:"relative flex-1 rounded-full bg-border"})}));Q2.displayName=Fx.displayName;const Rs=new Map([["aliyun",["common.provider.aliyun","/imgs/providers/aliyun.svg"]],["tencent",["common.provider.tencent","/imgs/providers/tencent.svg"]],["huaweicloud",["common.provider.huaweicloud","/imgs/providers/huaweicloud.svg"]],["qiniu",["common.provider.qiniu","/imgs/providers/qiniu.svg"]],["cloudflare",["common.provider.cloudflare","/imgs/providers/cloudflare.svg"]],["namesilo",["common.provider.namesilo","/imgs/providers/namesilo.svg"]],["godaddy",["common.provider.godaddy","/imgs/providers/godaddy.svg"]],["local",["common.provider.local","/imgs/providers/local.svg"]],["ssh",["common.provider.ssh","/imgs/providers/ssh.svg"]],["webhook",["common.provider.webhook","/imgs/providers/webhook.svg"]]]),Yb=e=>Rs.get(e),cs=le.union([le.literal("aliyun"),le.literal("tencent"),le.literal("huaweicloud"),le.literal("qiniu"),le.literal("cloudflare"),le.literal("namesilo"),le.literal("godaddy"),le.literal("local"),le.literal("ssh"),le.literal("webhook")],{message:"access.authorization.form.type.placeholder"}),us=e=>{switch(e){case"aliyun":case"tencent":case"huaweicloud":return"all";case"qiniu":case"local":case"ssh":case"webhook":return"deploy";case"cloudflare":case"namesilo":case"godaddy":return"apply";default:return"all"}},dB=({data:e,op:t,onAfterReq:n})=>{const{addAccess:r,updateAccess:s}=ln(),{t:o}=Ye(),i=le.object({id:le.string().optional(),name:le.string().min(1,"access.authorization.form.name.placeholder").max(64,o("common.errmsg.string_max",{max:64})),configType:cs,accessKeyId:le.string().min(1,"access.authorization.form.access_key_id.placeholder").max(64,o("common.errmsg.string_max",{max:64})),accessSecretId:le.string().min(1,"access.authorization.form.access_key_secret.placeholder").max(64,o("common.errmsg.string_max",{max:64}))});let a={accessKeyId:"",accessKeySecret:""};e&&(a=e.config);const c=cn({resolver:un(i),defaultValues:{id:e==null?void 0:e.id,name:(e==null?void 0:e.name)||"",configType:"aliyun",accessKeyId:a.accessKeyId,accessSecretId:a.accessKeySecret}}),u=async d=>{const f={id:d.id,name:d.name,configType:d.configType,usage:us(d.configType),config:{accessKeyId:d.accessKeyId,accessKeySecret:d.accessSecretId}};try{f.id=t=="copy"?"":f.id;const h=await as(f);if(n(),f.id=h.id,f.created=h.created,f.updated=h.updated,d.id&&t=="edit"){s(f);return}r(f)}catch(h){Object.entries(h.response.data).forEach(([x,p])=>{c.setError(x,{type:"manual",message:p.message})});return}};return l.jsx(l.Fragment,{children:l.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:l.jsx(dn,{...c,children:l.jsxs("form",{onSubmit:d=>{d.stopPropagation(),c.handleSubmit(u)(d)},className:"space-y-8",children:[l.jsx(ke,{control:c.control,name:"name",render:({field:d})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:o("access.authorization.form.name.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:o("access.authorization.form.name.placeholder"),...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"id",render:({field:d})=>l.jsxs(Se,{className:"hidden",children:[l.jsx(Ce,{children:o("access.authorization.form.config.label")}),l.jsx(je,{children:l.jsx(pe,{...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"configType",render:({field:d})=>l.jsxs(Se,{className:"hidden",children:[l.jsx(Ce,{children:o("access.authorization.form.config.label")}),l.jsx(je,{children:l.jsx(pe,{...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"accessKeyId",render:({field:d})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:o("access.authorization.form.access_key_id.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:o("access.authorization.form.access_key_id.placeholder"),...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"accessSecretId",render:({field:d})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:o("access.authorization.form.access_key_secret.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:o("access.authorization.form.access_key_secret.placeholder"),...d})}),l.jsx(ye,{})]})}),l.jsx(ye,{}),l.jsx("div",{className:"flex justify-end",children:l.jsx(Me,{type:"submit",children:o("common.save")})})]})})})})},fB=({data:e,op:t,onAfterReq:n})=>{const{addAccess:r,updateAccess:s}=ln(),{t:o}=Ye(),i=le.object({id:le.string().optional(),name:le.string().min(1,"access.authorization.form.name.placeholder").max(64,o("common.errmsg.string_max",{max:64})),configType:cs,secretId:le.string().min(1,"access.authorization.form.secret_id.placeholder").max(64,o("common.errmsg.string_max",{max:64})),secretKey:le.string().min(1,"access.authorization.form.secret_key.placeholder").max(64,o("common.errmsg.string_max",{max:64}))});let a={secretId:"",secretKey:""};e&&(a=e.config);const c=cn({resolver:un(i),defaultValues:{id:e==null?void 0:e.id,name:(e==null?void 0:e.name)||"",configType:"tencent",secretId:a.secretId,secretKey:a.secretKey}}),u=async d=>{const f={id:d.id,name:d.name,configType:d.configType,usage:us(d.configType),config:{secretId:d.secretId,secretKey:d.secretKey}};try{f.id=t=="copy"?"":f.id;const h=await as(f);if(n(),f.id=h.id,f.created=h.created,f.updated=h.updated,d.id&&t=="edit"){s(f);return}r(f)}catch(h){Object.entries(h.response.data).forEach(([x,p])=>{c.setError(x,{type:"manual",message:p.message})})}};return l.jsx(l.Fragment,{children:l.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:l.jsx(dn,{...c,children:l.jsxs("form",{onSubmit:d=>{d.stopPropagation(),c.handleSubmit(u)(d)},className:"space-y-8",children:[l.jsx(ke,{control:c.control,name:"name",render:({field:d})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:o("access.authorization.form.name.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:o("access.authorization.form.name.placeholder"),...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"id",render:({field:d})=>l.jsxs(Se,{className:"hidden",children:[l.jsx(Ce,{children:o("access.authorization.form.config.label")}),l.jsx(je,{children:l.jsx(pe,{...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"configType",render:({field:d})=>l.jsxs(Se,{className:"hidden",children:[l.jsx(Ce,{children:o("access.authorization.form.config.label")}),l.jsx(je,{children:l.jsx(pe,{...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"secretId",render:({field:d})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:o("access.authorization.form.secret_id.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:o("access.authorization.form.secret_id.placeholder"),...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"secretKey",render:({field:d})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:o("access.authorization.form.secret_key.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:o("access.authorization.form.secret_key.placeholder"),...d})}),l.jsx(ye,{})]})}),l.jsx("div",{className:"flex justify-end",children:l.jsx(Me,{type:"submit",children:o("common.save")})})]})})})})},hB=({data:e,op:t,onAfterReq:n})=>{const{addAccess:r,updateAccess:s}=ln(),{t:o}=Ye(),i=le.object({id:le.string().optional(),name:le.string().min(1,"access.authorization.form.name.placeholder").max(64,o("common.errmsg.string_max",{max:64})),configType:cs,region:le.string().min(1,"access.authorization.form.region.placeholder").max(64,o("common.errmsg.string_max",{max:64})),accessKeyId:le.string().min(1,"access.authorization.form.access_key_id.placeholder").max(64,o("common.errmsg.string_max",{max:64})),secretAccessKey:le.string().min(1,"access.authorization.form.access_key_secret.placeholder").max(64,o("common.errmsg.string_max",{max:64}))});let a={region:"cn-north-1",accessKeyId:"",secretAccessKey:""};e&&(a=e.config);const c=cn({resolver:un(i),defaultValues:{id:e==null?void 0:e.id,name:(e==null?void 0:e.name)||"",configType:"huaweicloud",region:a.region,accessKeyId:a.accessKeyId,secretAccessKey:a.secretAccessKey}}),u=async d=>{const f={id:d.id,name:d.name,configType:d.configType,usage:us(d.configType),config:{region:d.region,accessKeyId:d.accessKeyId,secretAccessKey:d.secretAccessKey}};try{f.id=t=="copy"?"":f.id;const h=await as(f);if(n(),f.id=h.id,f.created=h.created,f.updated=h.updated,d.id&&t=="edit"){s(f);return}r(f)}catch(h){Object.entries(h.response.data).forEach(([x,p])=>{c.setError(x,{type:"manual",message:p.message})});return}};return l.jsx(l.Fragment,{children:l.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:l.jsx(dn,{...c,children:l.jsxs("form",{onSubmit:d=>{d.stopPropagation(),c.handleSubmit(u)(d)},className:"space-y-8",children:[l.jsx(ke,{control:c.control,name:"name",render:({field:d})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:o("access.authorization.form.name.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:o("access.authorization.form.name.placeholder"),...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"id",render:({field:d})=>l.jsxs(Se,{className:"hidden",children:[l.jsx(Ce,{children:o("access.authorization.form.config.label")}),l.jsx(je,{children:l.jsx(pe,{...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"configType",render:({field:d})=>l.jsxs(Se,{className:"hidden",children:[l.jsx(Ce,{children:o("access.authorization.form.config.label")}),l.jsx(je,{children:l.jsx(pe,{...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"region",render:({field:d})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:o("access.authorization.form.region.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:o("access.authorization.form.region.placeholder"),...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"accessKeyId",render:({field:d})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:o("access.authorization.form.access_key_id.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:o("access.authorization.form.access_key_id.placeholder"),...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"secretAccessKey",render:({field:d})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:o("access.authorization.form.access_key_secret.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:o("access.authorization.form.access_key_secret.placeholder"),...d})}),l.jsx(ye,{})]})}),l.jsx(ye,{}),l.jsx("div",{className:"flex justify-end",children:l.jsx(Me,{type:"submit",children:o("common.save")})})]})})})})},mB=({data:e,op:t,onAfterReq:n})=>{const{addAccess:r,updateAccess:s}=ln(),{t:o}=Ye(),i=le.object({id:le.string().optional(),name:le.string().min(1,"access.authorization.form.name.placeholder").max(64,o("common.errmsg.string_max",{max:64})),configType:cs,accessKey:le.string().min(1,"access.authorization.form.access_key.placeholder").max(64),secretKey:le.string().min(1,"access.authorization.form.secret_key.placeholder").max(64)});let a={accessKey:"",secretKey:""};e&&(a=e.config);const c=cn({resolver:un(i),defaultValues:{id:e==null?void 0:e.id,name:(e==null?void 0:e.name)||"",configType:"qiniu",accessKey:a.accessKey,secretKey:a.secretKey}}),u=async d=>{const f={id:d.id,name:d.name,configType:d.configType,usage:us(d.configType),config:{accessKey:d.accessKey,secretKey:d.secretKey}};try{f.id=t=="copy"?"":f.id;const h=await as(f);if(n(),f.id=h.id,f.created=h.created,f.updated=h.updated,d.id&&t=="edit"){s(f);return}r(f)}catch(h){Object.entries(h.response.data).forEach(([x,p])=>{c.setError(x,{type:"manual",message:p.message})});return}};return l.jsx(l.Fragment,{children:l.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:l.jsx(dn,{...c,children:l.jsxs("form",{onSubmit:d=>{d.stopPropagation(),c.handleSubmit(u)(d)},className:"space-y-8",children:[l.jsx(ke,{control:c.control,name:"name",render:({field:d})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:o("access.authorization.form.name.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:o("access.authorization.form.name.placeholder"),...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"id",render:({field:d})=>l.jsxs(Se,{className:"hidden",children:[l.jsx(Ce,{children:o("access.authorization.form.config.label")}),l.jsx(je,{children:l.jsx(pe,{...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"configType",render:({field:d})=>l.jsxs(Se,{className:"hidden",children:[l.jsx(Ce,{children:o("access.authorization.form.config.label")}),l.jsx(je,{children:l.jsx(pe,{...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"accessKey",render:({field:d})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:o("access.authorization.form.access_key.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:o("access.authorization.form.access_key.placeholder"),...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"secretKey",render:({field:d})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:o("access.authorization.form.secret_key.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:o("access.authorization.form.secret_key.placeholder"),...d})}),l.jsx(ye,{})]})}),l.jsx(ye,{}),l.jsx("div",{className:"flex justify-end",children:l.jsx(Me,{type:"submit",children:o("common.save")})})]})})})})},pB=({data:e,op:t,onAfterReq:n})=>{const{addAccess:r,updateAccess:s}=ln(),{t:o}=Ye(),i=le.object({id:le.string().optional(),name:le.string().min(1,"access.authorization.form.name.placeholder").max(64,o("common.errmsg.string_max",{max:64})),configType:cs,dnsApiToken:le.string().min(1,"access.authorization.form.cloud_dns_api_token.placeholder").max(64,o("common.errmsg.string_max",{max:64}))});let a={dnsApiToken:""};e&&(a=e.config);const c=cn({resolver:un(i),defaultValues:{id:e==null?void 0:e.id,name:(e==null?void 0:e.name)||"",configType:"cloudflare",dnsApiToken:a.dnsApiToken}}),u=async d=>{const f={id:d.id,name:d.name,configType:d.configType,usage:us(d.configType),config:{dnsApiToken:d.dnsApiToken}};try{f.id=t=="copy"?"":f.id;const h=await as(f);if(n(),f.id=h.id,f.created=h.created,f.updated=h.updated,d.id&&t=="edit"){s(f);return}r(f)}catch(h){Object.entries(h.response.data).forEach(([x,p])=>{c.setError(x,{type:"manual",message:p.message})})}};return l.jsx(l.Fragment,{children:l.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:l.jsx(dn,{...c,children:l.jsxs("form",{onSubmit:d=>{d.stopPropagation(),c.handleSubmit(u)(d)},className:"space-y-8",children:[l.jsx(ke,{control:c.control,name:"name",render:({field:d})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:o("access.authorization.form.name.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:o("access.authorization.form.name.placeholder"),...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"id",render:({field:d})=>l.jsxs(Se,{className:"hidden",children:[l.jsx(Ce,{children:o("access.authorization.form.config.label")}),l.jsx(je,{children:l.jsx(pe,{...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"configType",render:({field:d})=>l.jsxs(Se,{className:"hidden",children:[l.jsx(Ce,{children:o("access.authorization.form.config.label")}),l.jsx(je,{children:l.jsx(pe,{...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"dnsApiToken",render:({field:d})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:o("access.authorization.form.cloud_dns_api_token.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:o("access.authorization.form.cloud_dns_api_token.placeholder"),...d})}),l.jsx(ye,{})]})}),l.jsx("div",{className:"flex justify-end",children:l.jsx(Me,{type:"submit",children:o("common.save")})})]})})})})},gB=({data:e,op:t,onAfterReq:n})=>{const{addAccess:r,updateAccess:s}=ln(),{t:o}=Ye(),i=le.object({id:le.string().optional(),name:le.string().min(1,"access.authorization.form.name.placeholder").max(64,o("common.errmsg.string_max",{max:64})),configType:cs,apiKey:le.string().min(1,"access.authorization.form.namesilo_api_key.placeholder").max(64,o("common.errmsg.string_max",{max:64}))});let a={apiKey:""};e&&(a=e.config);const c=cn({resolver:un(i),defaultValues:{id:e==null?void 0:e.id,name:(e==null?void 0:e.name)||"",configType:"namesilo",apiKey:a.apiKey}}),u=async d=>{const f={id:d.id,name:d.name,configType:d.configType,usage:us(d.configType),config:{apiKey:d.apiKey}};try{f.id=t=="copy"?"":f.id;const h=await as(f);if(n(),f.id=h.id,f.created=h.created,f.updated=h.updated,d.id&&t=="edit"){s(f);return}r(f)}catch(h){Object.entries(h.response.data).forEach(([x,p])=>{c.setError(x,{type:"manual",message:p.message})})}};return l.jsx(l.Fragment,{children:l.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:l.jsx(dn,{...c,children:l.jsxs("form",{onSubmit:d=>{d.stopPropagation(),c.handleSubmit(u)(d)},className:"space-y-8",children:[l.jsx(ke,{control:c.control,name:"name",render:({field:d})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:o("access.authorization.form.name.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:o("access.authorization.form.name.placeholder"),...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"id",render:({field:d})=>l.jsxs(Se,{className:"hidden",children:[l.jsx(Ce,{children:o("access.authorization.form.config.label")}),l.jsx(je,{children:l.jsx(pe,{...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"configType",render:({field:d})=>l.jsxs(Se,{className:"hidden",children:[l.jsx(Ce,{children:o("access.authorization.form.config.label")}),l.jsx(je,{children:l.jsx(pe,{...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"apiKey",render:({field:d})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:o("access.authorization.form.namesilo_api_key.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:o("access.authorization.form.namesilo_api_key.placeholder"),...d})}),l.jsx(ye,{})]})}),l.jsx("div",{className:"flex justify-end",children:l.jsx(Me,{type:"submit",children:o("common.save")})})]})})})})},yB=({data:e,op:t,onAfterReq:n})=>{const{addAccess:r,updateAccess:s}=ln(),{t:o}=Ye(),i=le.object({id:le.string().optional(),name:le.string().min(1,"access.authorization.form.name.placeholder").max(64,o("common.errmsg.string_max",{max:64})),configType:cs,apiKey:le.string().min(1,"access.authorization.form.godaddy_api_key.placeholder").max(64,o("common.errmsg.string_max",{max:64})),apiSecret:le.string().min(1,"access.authorization.form.godaddy_api_secret.placeholder").max(64,o("common.errmsg.string_max",{max:64}))});let a={apiKey:"",apiSecret:""};e&&(a=e.config);const c=cn({resolver:un(i),defaultValues:{id:e==null?void 0:e.id,name:(e==null?void 0:e.name)||"",configType:"godaddy",apiKey:a.apiKey,apiSecret:a.apiSecret}}),u=async d=>{const f={id:d.id,name:d.name,configType:d.configType,usage:us(d.configType),config:{apiKey:d.apiKey,apiSecret:d.apiSecret}};try{f.id=t=="copy"?"":f.id;const h=await as(f);if(n(),f.id=h.id,f.created=h.created,f.updated=h.updated,d.id&&t=="edit"){s(f);return}r(f)}catch(h){Object.entries(h.response.data).forEach(([x,p])=>{c.setError(x,{type:"manual",message:p.message})})}};return l.jsx(l.Fragment,{children:l.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:l.jsx(dn,{...c,children:l.jsxs("form",{onSubmit:d=>{d.stopPropagation(),c.handleSubmit(u)(d)},className:"space-y-8",children:[l.jsx(ke,{control:c.control,name:"name",render:({field:d})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:o("access.authorization.form.name.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:o("access.authorization.form.name.placeholder"),...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"id",render:({field:d})=>l.jsxs(Se,{className:"hidden",children:[l.jsx(Ce,{children:o("access.authorization.form.config.label")}),l.jsx(je,{children:l.jsx(pe,{...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"configType",render:({field:d})=>l.jsxs(Se,{className:"hidden",children:[l.jsx(Ce,{children:o("access.authorization.form.config.label")}),l.jsx(je,{children:l.jsx(pe,{...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"apiKey",render:({field:d})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:o("access.authorization.form.godaddy_api_key.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:o("access.authorization.form.godaddy_api_key.placeholder"),...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"apiSecret",render:({field:d})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:o("access.authorization.form.godaddy_api_secret.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:o("access.authorization.form.godaddy_api_secret.placeholder"),...d})}),l.jsx(ye,{})]})}),l.jsx("div",{className:"flex justify-end",children:l.jsx(Me,{type:"submit",children:o("common.save")})})]})})})})},vB=({data:e,op:t,onAfterReq:n})=>{const{addAccess:r,updateAccess:s,reloadAccessGroups:o}=ln(),{t:i}=Ye(),a=le.object({id:le.string().optional(),name:le.string().min(1,"access.authorization.form.name.placeholder").max(64,i("common.errmsg.string_max",{max:64})),configType:cs}),c=cn({resolver:un(a),defaultValues:{id:e==null?void 0:e.id,name:(e==null?void 0:e.name)||"",configType:"local"}}),u=async d=>{const f={id:d.id,name:d.name,configType:d.configType,usage:us(d.configType),config:{}};try{f.id=t=="copy"?"":f.id;const h=await as(f);n(),f.id=h.id,f.created=h.created,f.updated=h.updated,d.id&&t=="edit"?s(f):r(f),o()}catch(h){Object.entries(h.response.data).forEach(([x,p])=>{c.setError(x,{type:"manual",message:p.message})});return}};return l.jsx(l.Fragment,{children:l.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:l.jsx(dn,{...c,children:l.jsxs("form",{onSubmit:d=>{d.stopPropagation(),c.handleSubmit(u)(d)},className:"space-y-3",children:[l.jsx(ke,{control:c.control,name:"name",render:({field:d})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:i("access.authorization.form.name.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:i("access.authorization.form.name.placeholder"),...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"id",render:({field:d})=>l.jsxs(Se,{className:"hidden",children:[l.jsx(Ce,{children:i("access.authorization.form.config.label")}),l.jsx(je,{children:l.jsx(pe,{...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"configType",render:({field:d})=>l.jsxs(Se,{className:"hidden",children:[l.jsx(Ce,{children:i("access.authorization.form.config.label")}),l.jsx(je,{children:l.jsx(pe,{...d})}),l.jsx(ye,{})]})}),l.jsx(ye,{}),l.jsx("div",{className:"flex justify-end",children:l.jsx(Me,{type:"submit",children:i("common.save")})})]})})})})},Vx=({className:e,trigger:t})=>{const{reloadAccessGroups:n}=ln(),[r,s]=y.useState(!1),{t:o}=Ye(),i=le.object({name:le.string().min(1,"access.group.form.name.errmsg.empty").max(64,o("common.errmsg.string_max",{max:64}))}),a=cn({resolver:un(i),defaultValues:{name:""}}),c=async u=>{try{await _$({name:u.name}),n(),s(!1)}catch(d){Object.entries(d.response.data).forEach(([h,m])=>{a.setError(h,{type:"manual",message:m.message})})}};return l.jsxs(ll,{onOpenChange:s,open:r,children:[l.jsx(cl,{asChild:!0,className:re(e),children:t}),l.jsxs(Ni,{className:"sm:max-w-[600px] w-full dark:text-stone-200",children:[l.jsx(Ti,{children:l.jsx(Pi,{children:o("access.group.add")})}),l.jsx("div",{className:"container py-3",children:l.jsx(dn,{...a,children:l.jsxs("form",{onSubmit:u=>{u.stopPropagation(),a.handleSubmit(c)(u)},className:"space-y-8",children:[l.jsx(ke,{control:a.control,name:"name",render:({field:u})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:o("access.group.form.name.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:o("access.group.form.name.errmsg.empty"),...u,type:"text"})}),l.jsx(ye,{})]})}),l.jsx("div",{className:"flex justify-end",children:l.jsx(Me,{type:"submit",children:o("common.save")})})]})})})]})]})},xB=({data:e,op:t,onAfterReq:n})=>{const{addAccess:r,updateAccess:s,reloadAccessGroups:o,config:{accessGroups:i}}=ln(),a=y.useRef(null),[c,u]=y.useState(""),{t:d}=Ye(),f=e&&e.group?e.group:"",h=/^(?:\*\.)?([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}$/,m=/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,x=le.object({id:le.string().optional(),name:le.string().min(1,"access.authorization.form.name.placeholder").max(64,d("common.errmsg.string_max",{max:64})),configType:cs,host:le.string().refine(_=>m.test(_)||h.test(_),{message:"common.errmsg.host_invalid"}),group:le.string().optional(),port:le.string().min(1,"access.authorization.form.ssh_port.placeholder").max(5,d("common.errmsg.string_max",{max:5})),username:le.string().min(1,"access.authorization.form.ssh_username.placeholder").max(64,d("common.errmsg.string_max",{max:64})),password:le.string().min(0,"access.authorization.form.ssh_password.placeholder").max(64,d("common.errmsg.string_max",{max:64})),key:le.string().min(0,"access.authorization.form.ssh_key.placeholder").max(20480,d("common.errmsg.string_max",{max:20480})),keyFile:le.any().optional(),keyPassphrase:le.string().min(0,"access.authorization.form.ssh_key_passphrase.placeholder").max(2048,d("common.errmsg.string_max",{max:2048}))});let p={host:"127.0.0.1",port:"22",username:"root",password:"",key:"",keyFile:"",keyPassphrase:""};e&&(p=e.config);const w=cn({resolver:un(x),defaultValues:{id:e==null?void 0:e.id,name:(e==null?void 0:e.name)||"",configType:"ssh",group:e==null?void 0:e.group,host:p.host,port:p.port,username:p.username,password:p.password,key:p.key,keyFile:p.keyFile,keyPassphrase:p.keyPassphrase}}),g=async _=>{let C=_.group;C=="emptyId"&&(C="");const j={id:_.id,name:_.name,configType:_.configType,usage:us(_.configType),group:C,config:{host:_.host,port:_.port,username:_.username,password:_.password,key:_.key,keyPassphrase:_.keyPassphrase}};try{j.id=t=="copy"?"":j.id;const T=await as(j);n(),j.id=T.id,j.created=T.created,j.updated=T.updated,_.id&&t=="edit"?s(j):r(j),C!=f&&(f&&await Pb({id:f,"access-":j.id}),C&&await Pb({id:C,"access+":j.id})),o()}catch(T){Object.entries(T.response.data).forEach(([A,O])=>{w.setError(A,{type:"manual",message:O.message})});return}},v=async _=>{var R;const C=(R=_.target.files)==null?void 0:R[0];if(!C)return;const j=C;u(j.name);const T=await BU(j);w.setValue("key",T)},b=()=>{var _;(_=a.current)==null||_.click()};return l.jsx(l.Fragment,{children:l.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:l.jsx(dn,{...w,children:l.jsxs("form",{onSubmit:_=>{_.stopPropagation(),w.handleSubmit(g)(_)},className:"space-y-3",children:[l.jsx(ke,{control:w.control,name:"name",render:({field:_})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:d("access.authorization.form.name.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:d("access.authorization.form.name.placeholder"),..._})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:w.control,name:"group",render:({field:_})=>l.jsxs(Se,{children:[l.jsxs(Ce,{className:"w-full flex justify-between",children:[l.jsx("div",{children:d("access.authorization.form.ssh_group.label")}),l.jsx(Vx,{trigger:l.jsxs("div",{className:"font-normal text-primary hover:underline cursor-pointer flex items-center",children:[l.jsx(di,{size:14}),d("common.add")]})})]}),l.jsx(je,{children:l.jsxs(Fa,{..._,value:_.value,defaultValue:"emptyId",onValueChange:C=>{w.setValue("group",C)},children:[l.jsx(yi,{children:l.jsx($a,{placeholder:d("access.authorization.form.access_group.placeholder")})}),l.jsxs(vi,{children:[l.jsx(Ao,{value:"emptyId",children:l.jsx("div",{className:re("flex items-center space-x-2 rounded cursor-pointer"),children:"--"})}),i.map(C=>l.jsx(Ao,{value:C.id?C.id:"",children:l.jsx("div",{className:re("flex items-center space-x-2 rounded cursor-pointer"),children:C.name})},C.id))]})]})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:w.control,name:"id",render:({field:_})=>l.jsxs(Se,{className:"hidden",children:[l.jsx(Ce,{children:d("access.authorization.form.config.label")}),l.jsx(je,{children:l.jsx(pe,{..._})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:w.control,name:"configType",render:({field:_})=>l.jsxs(Se,{className:"hidden",children:[l.jsx(Ce,{children:d("access.authorization.form.config.label")}),l.jsx(je,{children:l.jsx(pe,{..._})}),l.jsx(ye,{})]})}),l.jsxs("div",{className:"flex space-x-2",children:[l.jsx(ke,{control:w.control,name:"host",render:({field:_})=>l.jsxs(Se,{className:"grow",children:[l.jsx(Ce,{children:d("access.authorization.form.ssh_host.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:d("access.authorization.form.ssh_host.placeholder"),..._})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:w.control,name:"port",render:({field:_})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:d("access.authorization.form.ssh_port.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:d("access.authorization.form.ssh_port.placeholder"),..._,type:"number"})}),l.jsx(ye,{})]})})]}),l.jsx(ke,{control:w.control,name:"username",render:({field:_})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:d("access.authorization.form.ssh_username.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:d("access.authorization.form.ssh_username.placeholder"),..._})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:w.control,name:"password",render:({field:_})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:d("access.authorization.form.ssh_password.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:d("access.authorization.form.ssh_password.placeholder"),..._,type:"password"})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:w.control,name:"key",render:({field:_})=>l.jsxs(Se,{hidden:!0,children:[l.jsx(Ce,{children:d("access.authorization.form.ssh_key.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:d("access.authorization.form.ssh_key.placeholder"),..._})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:w.control,name:"keyFile",render:({field:_})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:d("access.authorization.form.ssh_key.label")}),l.jsx(je,{children:l.jsxs("div",{children:[l.jsx(Me,{type:"button",variant:"secondary",size:"sm",className:"w-48",onClick:b,children:c||d("access.authorization.form.ssh_key_file.placeholder")}),l.jsx(pe,{placeholder:d("access.authorization.form.ssh_key.placeholder"),..._,ref:a,className:"hidden",hidden:!0,type:"file",onChange:v})]})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:w.control,name:"keyPassphrase",render:({field:_})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:d("access.authorization.form.ssh_key_passphrase.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:d("access.authorization.form.ssh_key_passphrase.placeholder"),..._,type:"password"})}),l.jsx(ye,{})]})}),l.jsx(ye,{}),l.jsx("div",{className:"flex justify-end",children:l.jsx(Me,{type:"submit",children:d("common.save")})})]})})})})},wB=({data:e,op:t,onAfterReq:n})=>{const{addAccess:r,updateAccess:s}=ln(),{t:o}=Ye(),i=le.object({id:le.string().optional(),name:le.string().min(1,"access.authorization.form.name.placeholder").max(64,o("common.errmsg.string_max",{max:64})),configType:cs,url:le.string().url("common.errmsg.url_invalid")});let a={url:""};e&&(a=e.config);const c=cn({resolver:un(i),defaultValues:{id:e==null?void 0:e.id,name:(e==null?void 0:e.name)||"",configType:"webhook",url:a.url}}),u=async d=>{const f={id:d.id,name:d.name,configType:d.configType,usage:us(d.configType),config:{url:d.url}};try{f.id=t=="copy"?"":f.id;const h=await as(f);if(n(),f.id=h.id,f.created=h.created,f.updated=h.updated,d.id&&t=="edit"){s(f);return}r(f)}catch(h){Object.entries(h.response.data).forEach(([x,p])=>{c.setError(x,{type:"manual",message:p.message})})}};return l.jsx(l.Fragment,{children:l.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:l.jsx(dn,{...c,children:l.jsxs("form",{onSubmit:d=>{d.stopPropagation(),c.handleSubmit(u)(d)},className:"space-y-8",children:[l.jsx(ke,{control:c.control,name:"name",render:({field:d})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:o("access.authorization.form.name.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:o("access.authorization.form.name.placeholder"),...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"id",render:({field:d})=>l.jsxs(Se,{className:"hidden",children:[l.jsx(Ce,{children:o("access.authorization.form.config.label")}),l.jsx(je,{children:l.jsx(pe,{...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"configType",render:({field:d})=>l.jsxs(Se,{className:"hidden",children:[l.jsx(Ce,{children:o("access.authorization.form.config.label")}),l.jsx(je,{children:l.jsx(pe,{...d})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:c.control,name:"url",render:({field:d})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:o("access.authorization.form.webhook_url.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:o("access.authorization.form.webhook_url.placeholder"),...d})}),l.jsx(ye,{})]})}),l.jsx("div",{className:"flex justify-end",children:l.jsx(Me,{type:"submit",children:o("common.save")})})]})})})})},da=({trigger:e,op:t,data:n,className:r})=>{const[s,o]=y.useState(!1),{t:i}=Ye(),a=Array.from(Rs.keys()),[c,u]=y.useState((n==null?void 0:n.configType)||"");let d=l.jsx(l.Fragment,{children:" "});switch(c){case"aliyun":d=l.jsx(dB,{data:n,op:t,onAfterReq:()=>{o(!1)}});break;case"tencent":d=l.jsx(fB,{data:n,op:t,onAfterReq:()=>{o(!1)}});break;case"huaweicloud":d=l.jsx(hB,{data:n,op:t,onAfterReq:()=>{o(!1)}});break;case"qiniu":d=l.jsx(mB,{data:n,op:t,onAfterReq:()=>{o(!1)}});break;case"cloudflare":d=l.jsx(pB,{data:n,op:t,onAfterReq:()=>{o(!1)}});break;case"namesilo":d=l.jsx(gB,{data:n,op:t,onAfterReq:()=>{o(!1)}});break;case"godaddy":d=l.jsx(yB,{data:n,op:t,onAfterReq:()=>{o(!1)}});break;case"local":d=l.jsx(vB,{data:n,op:t,onAfterReq:()=>{o(!1)}});break;case"ssh":d=l.jsx(xB,{data:n,op:t,onAfterReq:()=>{o(!1)}});break;case"webhook":d=l.jsx(wB,{data:n,op:t,onAfterReq:()=>{o(!1)}});break}const f=h=>h==c?"border-primary":"";return l.jsxs(ll,{onOpenChange:o,open:s,children:[l.jsx(cl,{asChild:!0,className:re(r),children:e}),l.jsxs(Ni,{className:"sm:max-w-[600px] w-full dark:text-stone-200",children:[l.jsx(Ti,{children:l.jsx(Pi,{children:t=="add"?i("access.authorization.add"):t=="edit"?i("access.authorization.edit"):i("access.authorization.copy")})}),l.jsx(tm,{className:"max-h-[80vh]",children:l.jsxs("div",{className:"container py-3",children:[l.jsx(Vt,{children:i("access.authorization.form.type.label")}),l.jsxs(Fa,{onValueChange:h=>{u(h)},defaultValue:c,children:[l.jsx(yi,{className:"mt-3",children:l.jsx($a,{placeholder:i("access.authorization.form.type.placeholder")})}),l.jsx(vi,{children:l.jsxs(Wc,{children:[l.jsx(Ua,{children:i("access.authorization.form.type.list")}),a.map(h=>{var m,x;return l.jsx(Ao,{value:h,children:l.jsxs("div",{className:re("flex items-center space-x-2 rounded cursor-pointer",f(h)),children:[l.jsx("img",{src:(m=Rs.get(h))==null?void 0:m[1],className:"h-6 w-6"}),l.jsx("div",{children:i(((x=Rs.get(h))==null?void 0:x[0])||"")})]})},h)})]})})]}),d]})})]})]})};var J2=Symbol.for("immer-nothing"),Kb=Symbol.for("immer-draftable"),Zn=Symbol.for("immer-state");function Sr(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Ba=Object.getPrototypeOf;function Wa(e){return!!e&&!!e[Zn]}function xi(e){var t;return e?eT(e)||Array.isArray(e)||!!e[Kb]||!!((t=e.constructor)!=null&&t[Kb])||rm(e)||sm(e):!1}var bB=Object.prototype.constructor.toString();function eT(e){if(!e||typeof e!="object")return!1;const t=Ba(e);if(t===null)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===bB}function Pf(e,t){nm(e)===0?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function nm(e){const t=e[Zn];return t?t.type_:Array.isArray(e)?1:rm(e)?2:sm(e)?3:0}function Kg(e,t){return nm(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function tT(e,t,n){const r=nm(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function _B(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function rm(e){return e instanceof Map}function sm(e){return e instanceof Set}function Vo(e){return e.copy_||e.base_}function Gg(e,t){if(rm(e))return new Map(e);if(sm(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=eT(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[Zn];let s=Reflect.ownKeys(r);for(let o=0;o1&&(e.set=e.add=e.clear=e.delete=SB),Object.freeze(e),t&&Object.entries(e).forEach(([n,r])=>Bx(r,!0))),e}function SB(){Sr(2)}function om(e){return Object.isFrozen(e)}var kB={};function wi(e){const t=kB[e];return t||Sr(0,e),t}var Hc;function nT(){return Hc}function CB(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Gb(e,t){t&&(wi("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Zg(e){qg(e),e.drafts_.forEach(jB),e.drafts_=null}function qg(e){e===Hc&&(Hc=e.parent_)}function Zb(e){return Hc=CB(Hc,e)}function jB(e){const t=e[Zn];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function qb(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Zn].modified_&&(Zg(t),Sr(4)),xi(e)&&(e=Rf(t,e),t.parent_||Af(t,e)),t.patches_&&wi("Patches").generateReplacementPatches_(n[Zn].base_,e,t.patches_,t.inversePatches_)):e=Rf(t,n,[]),Zg(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==J2?e:void 0}function Rf(e,t,n){if(om(t))return t;const r=t[Zn];if(!r)return Pf(t,(s,o)=>Xb(e,r,t,s,o,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return Af(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const s=r.copy_;let o=s,i=!1;r.type_===3&&(o=new Set(s),s.clear(),i=!0),Pf(o,(a,c)=>Xb(e,r,s,a,c,n,i)),Af(e,s,!1),n&&e.patches_&&wi("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function Xb(e,t,n,r,s,o,i){if(Wa(s)){const a=o&&t&&t.type_!==3&&!Kg(t.assigned_,r)?o.concat(r):void 0,c=Rf(e,s,a);if(tT(n,r,c),Wa(c))e.canAutoFreeze_=!1;else return}else i&&n.add(s);if(xi(s)&&!om(s)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Rf(e,s),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&Object.prototype.propertyIsEnumerable.call(n,r)&&Af(e,s)}}function Af(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Bx(t,n)}function EB(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:nT(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let s=r,o=Wx;n&&(s=[r],o=Yc);const{revoke:i,proxy:a}=Proxy.revocable(s,o);return r.draft_=a,r.revoke_=i,a}var Wx={get(e,t){if(t===Zn)return e;const n=Vo(e);if(!Kg(n,t))return NB(e,n,t);const r=n[t];return e.finalized_||!xi(r)?r:r===up(e.base_,t)?(dp(e),e.copy_[t]=Qg(r,e)):r},has(e,t){return t in Vo(e)},ownKeys(e){return Reflect.ownKeys(Vo(e))},set(e,t,n){const r=rT(Vo(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const s=up(Vo(e),t),o=s==null?void 0:s[Zn];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(_B(n,s)&&(n!==void 0||Kg(e.base_,t)))return!0;dp(e),Xg(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return up(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,dp(e),Xg(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Vo(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){Sr(11)},getPrototypeOf(e){return Ba(e.base_)},setPrototypeOf(){Sr(12)}},Yc={};Pf(Wx,(e,t)=>{Yc[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Yc.deleteProperty=function(e,t){return Yc.set.call(this,e,t,void 0)};Yc.set=function(e,t,n){return Wx.set.call(this,e[0],t,n,e[0])};function up(e,t){const n=e[Zn];return(n?Vo(n):e)[t]}function NB(e,t,n){var s;const r=rT(t,n);return r?"value"in r?r.value:(s=r.get)==null?void 0:s.call(e.draft_):void 0}function rT(e,t){if(!(t in e))return;let n=Ba(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Ba(n)}}function Xg(e){e.modified_||(e.modified_=!0,e.parent_&&Xg(e.parent_))}function dp(e){e.copy_||(e.copy_=Gg(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var TB=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const o=n;n=t;const i=this;return function(c=o,...u){return i.produce(c,d=>n.call(this,d,...u))}}typeof n!="function"&&Sr(6),r!==void 0&&typeof r!="function"&&Sr(7);let s;if(xi(t)){const o=Zb(this),i=Qg(t,void 0);let a=!0;try{s=n(i),a=!1}finally{a?Zg(o):qg(o)}return Gb(o,r),qb(s,o)}else if(!t||typeof t!="object"){if(s=n(t),s===void 0&&(s=t),s===J2&&(s=void 0),this.autoFreeze_&&Bx(s,!0),r){const o=[],i=[];wi("Patches").generateReplacementPatches_(t,s,o,i),r(o,i)}return s}else Sr(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(i,...a)=>this.produceWithPatches(i,c=>t(c,...a));let r,s;return[this.produce(t,n,(i,a)=>{r=i,s=a}),r,s]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){xi(e)||Sr(8),Wa(e)&&(e=PB(e));const t=Zb(this),n=Qg(e,void 0);return n[Zn].isManual_=!0,qg(t),n}finishDraft(e,t){const n=e&&e[Zn];(!n||!n.isManual_)&&Sr(9);const{scope_:r}=n;return Gb(r,t),qb(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const s=t[n];if(s.path.length===0&&s.op==="replace"){e=s.value;break}}n>-1&&(t=t.slice(n+1));const r=wi("Patches").applyPatches_;return Wa(e)?r(e,t):this.produce(e,s=>r(s,t))}};function Qg(e,t){const n=rm(e)?wi("MapSet").proxyMap_(e,t):sm(e)?wi("MapSet").proxySet_(e,t):EB(e,t);return(t?t.scope_:nT()).drafts_.push(n),n}function PB(e){return Wa(e)||Sr(10,e),sT(e)}function sT(e){if(!xi(e)||om(e))return e;const t=e[Zn];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Gg(e,t.scope_.immer_.useStrictShallowCopy_)}else n=Gg(e,!0);return Pf(n,(r,s)=>{tT(n,r,sT(s))}),t&&(t.finalized_=!1),n}var qn=new TB,Zr=qn.produce;qn.produceWithPatches.bind(qn);qn.setAutoFreeze.bind(qn);qn.setUseStrictShallowCopy.bind(qn);qn.applyPatches.bind(qn);qn.createDraft.bind(qn);qn.finishDraft.bind(qn);const RB="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let AB=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e));for(;e--;)t+=RB[n[e]&63];return t};const DB=Jc("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"}}),im=y.forwardRef(({className:e,variant:t,...n},r)=>l.jsx("div",{ref:r,role:"alert",className:re(DB({variant:t}),e),...n}));im.displayName="Alert";const Hx=y.forwardRef(({className:e,...t},n)=>l.jsx("h5",{ref:n,className:re("mb-1 font-medium leading-none tracking-tight",e),...t}));Hx.displayName="AlertTitle";const am=y.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:re("text-sm [&_p]:leading-relaxed",e),...t}));am.displayName="AlertDescription";const Df=y.forwardRef(({className:e,...t},n)=>l.jsx("textarea",{className:re("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:n,...t}));Df.displayName="Textarea";const OB=({variables:e,onValueChange:t})=>{const[n,r]=y.useState([]),{t:s}=Ye();y.useEffect(()=>{e&&r(e)},[e]);const o=c=>{const u=n.findIndex(f=>f.key===c.key),d=Zr(n,f=>{u===-1?f.push(c):f[u]=c});r(d),t==null||t(d)},i=c=>{const u=[...n];u.splice(c,1),r(u),t==null||t(u)},a=(c,u)=>{const d=[...n];d[c]=u,r(d),t==null||t(d)};return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex justify-between dark:text-stone-200",children:[l.jsx(Vt,{children:s("domain.deployment.form.variables.label")}),l.jsx(ur,{when:!!(n!=null&&n.length),children:l.jsx(fp,{variable:{key:"",value:""},trigger:l.jsxs("div",{className:"flex items-center text-primary",children:[l.jsx(di,{size:16,className:"cursor-pointer "}),l.jsx("div",{className:"text-sm ",children:s("common.add")})]}),onSave:c=>{o(c)}})})]}),l.jsx(ur,{when:!!(n!=null&&n.length),fallback:l.jsxs("div",{className:"border rounded-md p-3 text-sm mt-2 flex flex-col items-center",children:[l.jsx("div",{className:"text-muted-foreground",children:s("domain.deployment.form.variables.empty")}),l.jsx(fp,{trigger:l.jsxs("div",{className:"flex items-center text-primary",children:[l.jsx(di,{size:16,className:"cursor-pointer "}),l.jsx("div",{className:"text-sm ",children:s("common.add")})]}),variable:{key:"",value:""},onSave:c=>{o(c)}})]}),children:l.jsx("div",{className:"border p-3 rounded-md text-stone-700 text-sm dark:text-stone-200",children:n==null?void 0:n.map((c,u)=>l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsxs("div",{children:[c.key,"=",c.value]}),l.jsxs("div",{className:"flex space-x-2",children:[l.jsx(fp,{trigger:l.jsx(sv,{size:16,className:"cursor-pointer"}),variable:c,onSave:d=>{a(u,d)}}),l.jsx(ov,{size:16,className:"cursor-pointer",onClick:()=>{i(u)}})]})]},u))})})]})},fp=({variable:e,trigger:t,onSave:n})=>{const[r,s]=y.useState({key:"",value:""});y.useEffect(()=>{e&&s(e)},[e]);const{t:o}=Ye(),[i,a]=y.useState(!1),[c,u]=y.useState({}),d=()=>{if(!r.key){u({key:o("domain.deployment.form.variables.key.required")});return}if(!r.value){u({value:o("domain.deployment.form.variables.value.required")});return}n==null||n(r),a(!1),u({})};return l.jsxs(ll,{open:i,onOpenChange:()=>{a(!i)},children:[l.jsx(cl,{children:t}),l.jsxs(Ni,{className:"dark:text-stone-200",children:[l.jsxs(Ti,{className:"flex flex-col",children:[l.jsx(Pi,{children:o("domain.deployment.form.variables.label")}),l.jsxs("div",{className:"pt-5 flex flex-col items-start",children:[l.jsx(Vt,{children:o("domain.deployment.form.variables.key")}),l.jsx(pe,{placeholder:o("domain.deployment.form.variables.key.placeholder"),value:r==null?void 0:r.key,onChange:f=>{s({...r,key:f.target.value})},className:"w-full mt-1"}),l.jsx("div",{className:"text-red-500 text-sm mt-1",children:c==null?void 0:c.key})]}),l.jsxs("div",{className:"pt-2 flex flex-col items-start",children:[l.jsx(Vt,{children:o("domain.deployment.form.variables.value")}),l.jsx(pe,{placeholder:o("domain.deployment.form.variables.value.placeholder"),value:r==null?void 0:r.value,onChange:f=>{s({...r,value:f.target.value})},className:"w-full mt-1"}),l.jsx("div",{className:"text-red-500 text-sm mt-1",children:c==null?void 0:c.value})]})]}),l.jsx(Qh,{children:l.jsx("div",{className:"flex justify-end",children:l.jsx(Me,{onClick:()=>{d()},children:o("common.save")})})})]})]})},Of=new Map([["aliyun-oss",["common.provider.aliyun.oss","/imgs/providers/aliyun.svg"]],["aliyun-cdn",["common.provider.aliyun.cdn","/imgs/providers/aliyun.svg"]],["aliyun-dcdn",["common.provider.aliyun.dcdn","/imgs/providers/aliyun.svg"]],["tencent-cdn",["common.provider.tencent.cdn","/imgs/providers/tencent.svg"]],["qiniu-cdn",["common.provider.qiniu.cdn","/imgs/providers/qiniu.svg"]],["local",["common.provider.local","/imgs/providers/local.svg"]],["ssh",["common.provider.ssh","/imgs/providers/ssh.svg"]],["webhook",["common.provider.webhook","/imgs/providers/webhook.svg"]]]),IB=Array.from(Of.keys()),oT=y.createContext({}),Ha=()=>y.useContext(oT),MB=({deploys:e,onChange:t})=>{const[n,r]=y.useState([]),{t:s}=Ye();y.useEffect(()=>{r(e)},[e]);const o=c=>{c.id=AB();const u=[...n,c];r(u),t(u)},i=c=>{const u=n.filter(d=>d.id!==c);r(u),t(u)},a=c=>{const u=n.map(d=>d.id===c.id?{...c}:d);r(u),t(u)};return l.jsx(l.Fragment,{children:l.jsxs(ur,{when:n.length>0,fallback:l.jsx(im,{className:"w-full border dark:border-stone-400",children:l.jsxs(am,{className:"flex flex-col items-center",children:[l.jsx("div",{children:s("domain.deployment.nodata")}),l.jsx("div",{className:"flex justify-end mt-2",children:l.jsx(Jg,{onSave:c=>{o(c)},trigger:l.jsx(Me,{size:"sm",children:s("common.add")})})})]})}),children:[l.jsx("div",{className:"flex justify-end py-2 border-b dark:border-stone-400",children:l.jsx(Jg,{trigger:l.jsx(Me,{size:"sm",children:s("common.add")}),onSave:c=>{o(c)}})}),l.jsx("div",{className:"w-full md:w-[35em] rounded mt-5 border dark:border-stone-400 dark:text-stone-200",children:l.jsx("div",{className:"",children:n.map(c=>l.jsx(LB,{item:c,onDelete:()=>{i(c.id??"")},onSave:u=>{a(u)}},c.id))})})]})})},LB=({item:e,onDelete:t,onSave:n})=>{const{config:{accesses:r}}=ln(),{t:s}=Ye(),o=r.find(c=>c.id===e.access),i=()=>{if(!o)return"";const c=Rs.get(o.configType);return c?c[1]:""},a=()=>{if(!o)return"";const c=Of.get(e.type);return c?s(c[0]):""};return l.jsxs("div",{className:"flex justify-between text-sm p-3 items-center text-stone-700 dark:text-stone-200",children:[l.jsxs("div",{className:"flex space-x-2 items-center",children:[l.jsx("div",{children:l.jsx("img",{src:i(),className:"w-9"})}),l.jsxs("div",{className:"text-stone-600 flex-col flex space-y-0 dark:text-stone-200",children:[l.jsx("div",{children:a()}),l.jsx("div",{children:o==null?void 0:o.name})]})]}),l.jsxs("div",{className:"flex space-x-2",children:[l.jsx(Jg,{trigger:l.jsx(sv,{size:16,className:"cursor-pointer"}),deployConfig:e,onSave:c=>{n(c)}}),l.jsx(ov,{size:16,className:"cursor-pointer",onClick:()=>{t()}})]})]})},Jg=({trigger:e,deployConfig:t,onSave:n})=>{const{config:{accesses:r}}=ln(),[s,o]=y.useState(),[i,a]=y.useState({access:"",type:""}),[c,u]=y.useState({}),[d,f]=y.useState(!1);y.useEffect(()=>{a(t?{...t}:{access:"",type:""})},[t]),y.useEffect(()=>{const w=i.type.split("-");let g;w&&w.length>1?g=w[1]:g=i.type,o(g),u({})},[i.type]);const h=y.useCallback(w=>{w.type!==i.type?a({...w,access:"",config:{}}):a({...w})},[i.type]),{t:m}=Ye(),x=r.filter(w=>{if(w.usage=="apply")return!1;if(i.type=="")return!0;const g=i.type.split("-");return w.configType===g[0]}),p=()=>{const w={...c};i.type===""?w.type=m("domain.deployment.form.access.placeholder"):w.type="",i.access===""?w.access=m("domain.deployment.form.access.placeholder"):w.access="",u(w);for(const g in w)if(w[g]!=="")return;n(i),a({access:"",type:""}),u({}),f(!1)};return l.jsx(oT.Provider,{value:{deploy:i,setDeploy:h,error:c,setError:u},children:l.jsxs(ll,{open:d,onOpenChange:f,children:[l.jsx(cl,{children:e}),l.jsxs(Ni,{className:"dark:text-stone-200",children:[l.jsxs(Ti,{children:[l.jsx(Pi,{children:m("history.page.title")}),l.jsx(z2,{})]}),l.jsxs("div",{children:[l.jsx(Vt,{children:m("domain.deployment.form.type.label")}),l.jsxs(Fa,{value:i.type,onValueChange:w=>{h({...i,type:w})},children:[l.jsx(yi,{className:"mt-2",children:l.jsx($a,{placeholder:m("domain.deployment.form.type.placeholder")})}),l.jsx(vi,{children:l.jsxs(Wc,{children:[l.jsx(Ua,{children:m("domain.deployment.form.type.list")}),IB.map(w=>{var g,v;return l.jsx(Ao,{value:w,children:l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx("img",{className:"w-6",src:(g=Of.get(w))==null?void 0:g[1]}),l.jsx("div",{children:m(((v=Of.get(w))==null?void 0:v[0])??"")})]})},w)})]})})]}),l.jsx("div",{className:"text-red-500 text-sm mt-1",children:c.type})]}),l.jsxs("div",{children:[l.jsxs(Vt,{className:"flex justify-between",children:[l.jsx("div",{children:m("domain.deployment.form.access.label")}),l.jsx(da,{trigger:l.jsxs("div",{className:"font-normal text-primary hover:underline cursor-pointer flex items-center",children:[l.jsx(di,{size:14}),m("common.add")]}),op:"add"})]}),l.jsxs(Fa,{value:i.access,onValueChange:w=>{h({...i,access:w})},children:[l.jsx(yi,{className:"mt-2",children:l.jsx($a,{placeholder:m("domain.deployment.form.access.placeholder")})}),l.jsx(vi,{children:l.jsxs(Wc,{children:[l.jsx(Ua,{children:m("domain.deployment.form.access.list")}),x.map(w=>{var g;return l.jsx(Ao,{value:w.id,children:l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx("img",{className:"w-6",src:(g=Rs.get(w.configType))==null?void 0:g[1]}),l.jsx("div",{children:w.name})]})},w.id)})]})})]}),l.jsx("div",{className:"text-red-500 text-sm mt-1",children:c.access})]}),l.jsx(zB,{type:s}),l.jsx(Qh,{children:l.jsx(Me,{onClick:w=>{w.stopPropagation(),p()},children:m("common.save")})})]})]})})},zB=({type:e})=>(()=>{switch(e){case"ssh":return l.jsx(Qb,{});case"local":return l.jsx(Qb,{});case"cdn":return l.jsx(hp,{});case"dcdn":return l.jsx(hp,{});case"oss":return l.jsx(FB,{});case"webhook":return l.jsx($B,{});default:return l.jsx(hp,{})}})(),Qb=()=>{var s,o,i,a;const{t:e}=Ye(),{setError:t}=Ha();y.useEffect(()=>{t({})},[]);const{deploy:n,setDeploy:r}=Ha();return y.useEffect(()=>{n.id||r({...n,config:{certPath:"/etc/nginx/ssl/nginx.crt",keyPath:"/etc/nginx/ssl/nginx.key",preCommand:"",command:"sudo service nginx reload"}})},[]),l.jsx(l.Fragment,{children:l.jsxs("div",{className:"flex flex-col space-y-2",children:[l.jsxs("div",{children:[l.jsx(Vt,{children:e("access.authorization.form.ssh_cert_path.label")}),l.jsx(pe,{placeholder:e("access.authorization.form.ssh_cert_path.label"),className:"w-full mt-1",value:(s=n==null?void 0:n.config)==null?void 0:s.certPath,onChange:c=>{const u=Zr(n,d=>{d.config||(d.config={}),d.config.certPath=c.target.value});r(u)}})]}),l.jsxs("div",{children:[l.jsx(Vt,{children:e("access.authorization.form.ssh_key_path.label")}),l.jsx(pe,{placeholder:e("access.authorization.form.ssh_key_path.placeholder"),className:"w-full mt-1",value:(o=n==null?void 0:n.config)==null?void 0:o.keyPath,onChange:c=>{const u=Zr(n,d=>{d.config||(d.config={}),d.config.keyPath=c.target.value});r(u)}})]}),l.jsxs("div",{children:[l.jsx(Vt,{children:e("access.authorization.form.ssh_pre_command.label")}),l.jsx(Df,{className:"mt-1",value:(i=n==null?void 0:n.config)==null?void 0:i.preCommand,placeholder:e("access.authorization.form.ssh_pre_command.placeholder"),onChange:c=>{const u=Zr(n,d=>{d.config||(d.config={}),d.config.preCommand=c.target.value});r(u)}})]}),l.jsxs("div",{children:[l.jsx(Vt,{children:e("access.authorization.form.ssh_command.label")}),l.jsx(Df,{className:"mt-1",value:(a=n==null?void 0:n.config)==null?void 0:a.command,placeholder:e("access.authorization.form.ssh_command.placeholder"),onChange:c=>{const u=Zr(n,d=>{d.config||(d.config={}),d.config.command=c.target.value});r(u)}})]})]})})},hp=()=>{var i;const{deploy:e,setDeploy:t,error:n,setError:r}=Ha(),{t:s}=Ye();y.useEffect(()=>{r({})},[]),y.useEffect(()=>{var c;const a=o.safeParse((c=e.config)==null?void 0:c.domain);a.success?r({...n,domain:""}):r({...n,domain:JSON.parse(a.error.message)[0].message})},[e]);const o=le.string().regex(/^(?:\*\.)?([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}$/,{message:s("common.errmsg.domain_invalid")});return l.jsx("div",{className:"flex flex-col space-y-2",children:l.jsxs("div",{children:[l.jsx(Vt,{children:s("domain.deployment.form.cdn_domain.label")}),l.jsx(pe,{placeholder:s("domain.deployment.form.cdn_domain.placeholder"),className:"w-full mt-1",value:(i=e==null?void 0:e.config)==null?void 0:i.domain,onChange:a=>{const c=a.target.value,u=o.safeParse(c);u.success?r({...n,domain:""}):r({...n,domain:JSON.parse(u.error.message)[0].message});const d=Zr(e,f=>{f.config||(f.config={}),f.config.domain=c});t(d)}}),l.jsx("div",{className:"text-red-600 text-sm mt-1",children:n==null?void 0:n.domain})]})})},FB=()=>{var a,c,u;const{deploy:e,setDeploy:t,error:n,setError:r}=Ha(),{t:s}=Ye();y.useEffect(()=>{r({})},[]),y.useEffect(()=>{var f;const d=o.safeParse((f=e.config)==null?void 0:f.domain);d.success?r({...n,domain:""}):r({...n,domain:JSON.parse(d.error.message)[0].message})},[e]),y.useEffect(()=>{var f;const d=i.safeParse((f=e.config)==null?void 0:f.domain);d.success?r({...n,bucket:""}):r({...n,bucket:JSON.parse(d.error.message)[0].message})},[]),y.useEffect(()=>{e.id||t({...e,config:{endpoint:"oss-cn-hangzhou.aliyuncs.com",bucket:"",domain:""}})},[]);const o=le.string().regex(/^(?:\*\.)?([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}$/,{message:s("common.errmsg.domain_invalid")}),i=le.string().min(1,{message:s("domain.deployment.form.oss_bucket.placeholder")});return l.jsx("div",{className:"flex flex-col space-y-2",children:l.jsxs("div",{children:[l.jsx(Vt,{children:s("domain.deployment.form.oss_endpoint.label")}),l.jsx(pe,{className:"w-full mt-1",value:(a=e==null?void 0:e.config)==null?void 0:a.endpoint,onChange:d=>{const f=d.target.value,h=Zr(e,m=>{m.config||(m.config={}),m.config.endpoint=f});t(h)}}),l.jsx("div",{className:"text-red-600 text-sm mt-1",children:n==null?void 0:n.endpoint}),l.jsx(Vt,{children:s("domain.deployment.form.oss_bucket")}),l.jsx(pe,{placeholder:s("domain.deployment.form.oss_bucket.placeholder"),className:"w-full mt-1",value:(c=e==null?void 0:e.config)==null?void 0:c.bucket,onChange:d=>{const f=d.target.value,h=i.safeParse(f);h.success?r({...n,bucket:""}):r({...n,bucket:JSON.parse(h.error.message)[0].message});const m=Zr(e,x=>{x.config||(x.config={}),x.config.bucket=f});t(m)}}),l.jsx("div",{className:"text-red-600 text-sm mt-1",children:n==null?void 0:n.bucket}),l.jsx(Vt,{children:s("domain.deployment.form.cdn_domain.label")}),l.jsx(pe,{placeholder:s("domain.deployment.form.cdn_domain.label"),className:"w-full mt-1",value:(u=e==null?void 0:e.config)==null?void 0:u.domain,onChange:d=>{const f=d.target.value,h=o.safeParse(f);h.success?r({...n,domain:""}):r({...n,domain:JSON.parse(h.error.message)[0].message});const m=Zr(e,x=>{x.config||(x.config={}),x.config.domain=f});t(m)}}),l.jsx("div",{className:"text-red-600 text-sm mt-1",children:n==null?void 0:n.domain})]})})},$B=()=>{var r;const{deploy:e,setDeploy:t}=Ha(),{setError:n}=Ha();return y.useEffect(()=>{n({})},[]),l.jsx(l.Fragment,{children:l.jsx(OB,{variables:(r=e==null?void 0:e.config)==null?void 0:r.variables,onValueChange:s=>{const o=Zr(e,i=>{i.config||(i.config={}),i.config.variables=s});t(o)}})})},UB=({className:e,trigger:t})=>{const{config:{emails:n},setEmails:r}=ln(),[s,o]=y.useState(!1),{t:i}=Ye(),a=le.object({email:le.string().email("common.errmsg.email_invalid")}),c=cn({resolver:un(a),defaultValues:{email:""}}),u=async d=>{if(n.content.emails.includes(d.email)){c.setError("email",{message:"common.errmsg.email_duplicate"});return}const f=[...n.content.emails,d.email];try{const h=await il({...n,name:"emails",content:{emails:f}});r(h),c.reset(),c.clearErrors(),o(!1)}catch(h){Object.entries(h.response.data).forEach(([x,p])=>{c.setError(x,{type:"manual",message:p.message})})}};return l.jsxs(ll,{onOpenChange:o,open:s,children:[l.jsx(cl,{asChild:!0,className:re(e),children:t}),l.jsxs(Ni,{className:"sm:max-w-[600px] w-full dark:text-stone-200",children:[l.jsx(Ti,{children:l.jsx(Pi,{children:i("domain.application.form.email.add")})}),l.jsx("div",{className:"container py-3",children:l.jsx(dn,{...c,children:l.jsxs("form",{onSubmit:d=>{d.stopPropagation(),c.handleSubmit(u)(d)},className:"space-y-8",children:[l.jsx(ke,{control:c.control,name:"email",render:({field:d})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:i("domain.application.form.email.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:i("common.errmsg.email_empty"),...d,type:"email"})}),l.jsx(ye,{})]})}),l.jsx("div",{className:"flex justify-end",children:l.jsx(Me,{type:"submit",children:i("common.save")})})]})})})]})]})},iT={domain:"common.text.domain",ip:"common.text.ip",dns:"common.text.dns"},Jb=({value:e,className:t,onValueChange:n,valueType:r="domain"})=>{const[s,o]=y.useState([]),{t:i}=Ye();y.useMemo(()=>{e&&o(e.split(";"))},[e]),y.useEffect(()=>{(()=>{n(s.join(";"))})()},[s]);const a=d=>{s.includes(d)||o([...s,d])},c=(d,f)=>{const h=[...s];h[d]=f,o(h)},u=d=>{const f=[...s];f.splice(d,1),o(f)};return l.jsx(l.Fragment,{children:l.jsxs("div",{className:re(t),children:[l.jsxs(Ce,{className:"flex justify-between items-center",children:[l.jsx("div",{children:i(iT[r])}),l.jsx(ur,{when:s.length>0,children:l.jsx(mp,{op:"add",onValueChange:d=>{a(d)},valueType:r,value:"",trigger:l.jsxs("div",{className:"flex items-center text-primary",children:[l.jsx(di,{size:16,className:"cursor-pointer "}),l.jsx("div",{className:"text-sm ",children:i("common.add")})]})})})]}),l.jsx(je,{children:l.jsx(ur,{when:s.length>0,fallback:l.jsxs("div",{className:"border rounded-md p-3 text-sm mt-2 flex flex-col items-center",children:[l.jsx("div",{className:"text-muted-foreground",children:i("common.text."+r+".empty")}),l.jsx(mp,{value:"",trigger:i("common.add"),onValueChange:a,valueType:r})]}),children:l.jsx("div",{className:"border rounded-md p-3 text-sm mt-2 text-gray-700 space-y-2 dark:text-white dark:border-stone-700 dark:bg-stone-950",children:s.map((d,f)=>l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsx("div",{children:d}),l.jsxs("div",{className:"flex space-x-2",children:[l.jsx(mp,{op:"edit",valueType:r,trigger:l.jsx(sv,{size:16,className:"cursor-pointer text-gray-600 dark:text-white"}),value:d,onValueChange:h=>{c(f,h)}}),l.jsx(ov,{size:16,className:"cursor-pointer",onClick:()=>{u(f)}})]})]},f))})})})]})})},mp=({trigger:e,value:t,onValueChange:n,op:r="add",valueType:s})=>{const[o,i]=y.useState(""),[a,c]=y.useState(!1),[u,d]=y.useState(""),{t:f}=Ye();y.useEffect(()=>{i(t)},[t]);const h=le.string().regex(/^(?:\*\.)?([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}$/,{message:f("common.errmsg.domain_invalid")}),m=le.string().ip({message:f("common.errmsg.ip_invalid")}),x={domain:h,dns:m,host:m},p=y.useCallback(()=>{const g=x[s].safeParse(o);if(!g.success){d(JSON.parse(g.error.message)[0].message);return}i(""),c(!1),d(""),n(o)},[o]);return l.jsxs(ll,{open:a,onOpenChange:w=>{c(w)},children:[l.jsx(cl,{className:"text-primary",children:e}),l.jsxs(Ni,{className:"dark:text-white",children:[l.jsx(Ti,{children:l.jsx(Pi,{className:"dark:text-white",children:f(iT[s])})}),l.jsx(pe,{value:o,className:"dark:text-white",onChange:w=>{i(w.target.value)}}),l.jsx(ur,{when:u.length>0,children:l.jsx("div",{className:"text-red-500 text-sm",children:u})}),l.jsx(Qh,{children:l.jsx(Me,{onClick:()=>{p()},children:f(r==="add"?"common.add":"common.confirm")})})]})]})},VB=()=>{const{config:{accesses:e,emails:t}}=ln(),[n,r]=y.useState({}),s=Ir(),{t:o}=Ye(),[i,a]=y.useState("apply");y.useEffect(()=>{const x=new URLSearchParams(s.search).get("id");x&&(async()=>{const w=await GU(x);r(w)})()},[s.search]);const c=le.object({id:le.string().optional(),domain:le.string().min(1,{message:"common.errmsg.domain_invalid"}),email:le.string().email("common.errmsg.email_invalid").optional(),access:le.string().regex(/^[a-zA-Z0-9]+$/,{message:"domain.application.form.access.errmsg.empty"}),nameservers:le.string().optional(),timeout:le.number().optional()}),u=cn({resolver:un(c),defaultValues:{id:"",domain:"",email:"",access:"",nameservers:"",timeout:60}});y.useEffect(()=>{var m,x,p,w;n&&u.reset({id:n.id,domain:n.domain,email:(m=n.applyConfig)==null?void 0:m.email,access:(x=n.applyConfig)==null?void 0:x.access,nameservers:(p=n.applyConfig)==null?void 0:p.nameservers,timeout:(w=n.applyConfig)==null?void 0:w.timeout})},[n,u]);const{toast:d}=zr(),f=async m=>{const x={id:m.id,crontab:"0 0 * * *",domain:m.domain,email:m.email,access:m.access,applyConfig:{email:m.email??"",access:m.access,nameservers:m.nameservers,timeout:m.timeout}};try{const p=await mf(x);let w=o("domain.application.form.domain.changed.message");x.id==""&&(w=o("domain.application.form.domain.added.message")),d({title:o("common.save.succeeded.message"),description:w}),n!=null&&n.id||a("deploy"),r({...p})}catch(p){Object.entries(p.response.data).forEach(([g,v])=>{u.setError(g,{type:"manual",message:v.message})});return}},h=async m=>{const x={...n,deployConfig:m};try{const p=await mf(x);let w=o("domain.application.form.domain.changed.message");x.id==""&&(w=o("domain.application.form.domain.added.message")),d({title:o("common.save.succeeded.message"),description:w}),n!=null&&n.id||a("deploy"),r({...p})}catch(p){Object.entries(p.response.data).forEach(([g,v])=>{u.setError(g,{type:"manual",message:v.message})});return}};return l.jsx(l.Fragment,{children:l.jsxs("div",{className:"",children:[l.jsx(Px,{}),l.jsx("div",{className:" h-5 text-muted-foreground",children:l.jsx(WN,{children:l.jsxs(HN,{children:[l.jsx($g,{children:l.jsx(YN,{href:"#/domains",children:o("domain.page.title")})}),l.jsx(GN,{}),l.jsx($g,{children:l.jsx(KN,{children:n!=null&&n.id?o("domain.edit"):o("domain.add")})})]})})}),l.jsxs("div",{className:"mt-5 flex w-full justify-center md:space-x-10 flex-col md:flex-row",children:[l.jsxs("div",{className:"w-full md:w-[200px] text-muted-foreground space-x-3 md:space-y-3 flex-row md:flex-col flex md:mt-5",children:[l.jsx("div",{className:re("cursor-pointer text-right",i==="apply"?"text-primary":""),onClick:()=>{a("apply")},children:o("domain.application.tab")}),l.jsx("div",{className:re("cursor-pointer text-right",i==="deploy"?"text-primary":""),onClick:()=>{if(!(n!=null&&n.id)){d({title:o("domain.application.unsaved.message"),description:o("domain.application.unsaved.message"),variant:"destructive"});return}a("deploy")},children:o("domain.deployment.tab")})]}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("div",{className:re("w-full md:w-[35em] p-5 rounded mt-3 md:mt-0",i=="deploy"&&"hidden"),children:l.jsx(dn,{...u,children:l.jsxs("form",{onSubmit:u.handleSubmit(f),className:"space-y-8 dark:text-stone-200",children:[l.jsx(ke,{control:u.control,name:"domain",render:({field:m})=>l.jsxs(Se,{children:[l.jsx(l.Fragment,{children:l.jsx(Jb,{value:m.value,valueType:"domain",onValueChange:x=>{u.setValue("domain",x)}})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:u.control,name:"email",render:({field:m})=>l.jsxs(Se,{children:[l.jsxs(Ce,{className:"flex w-full justify-between",children:[l.jsx("div",{children:o("domain.application.form.email.label")+" "+o("domain.application.form.email.tips")}),l.jsx(UB,{trigger:l.jsxs("div",{className:"font-normal text-primary hover:underline cursor-pointer flex items-center",children:[l.jsx(di,{size:14}),o("common.add")]})})]}),l.jsx(je,{children:l.jsxs(Fa,{...m,value:m.value,onValueChange:x=>{u.setValue("email",x)},children:[l.jsx(yi,{children:l.jsx($a,{placeholder:o("domain.application.form.email.errmsg.empty")})}),l.jsx(vi,{children:l.jsxs(Wc,{children:[l.jsx(Ua,{children:o("domain.application.form.email.list")}),t.content.emails.map(x=>l.jsx(Ao,{value:x,children:l.jsx("div",{children:x})},x))]})})]})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:u.control,name:"access",render:({field:m})=>l.jsxs(Se,{children:[l.jsxs(Ce,{className:"flex w-full justify-between",children:[l.jsx("div",{children:o("domain.application.form.access.label")}),l.jsx(da,{trigger:l.jsxs("div",{className:"font-normal text-primary hover:underline cursor-pointer flex items-center",children:[l.jsx(di,{size:14}),o("common.add")]}),op:"add"})]}),l.jsx(je,{children:l.jsxs(Fa,{...m,value:m.value,onValueChange:x=>{u.setValue("access",x)},children:[l.jsx(yi,{children:l.jsx($a,{placeholder:o("domain.application.form.access.placeholder")})}),l.jsx(vi,{children:l.jsxs(Wc,{children:[l.jsx(Ua,{children:o("domain.application.form.access.list")}),e.filter(x=>x.usage!="deploy").map(x=>{var p;return l.jsx(Ao,{value:x.id,children:l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx("img",{className:"w-6",src:(p=Rs.get(x.configType))==null?void 0:p[1]}),l.jsx("div",{children:x.name})]})},x.id)})]})})]})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:u.control,name:"timeout",render:({field:m})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:o("domain.application.form.timeout.label")}),l.jsx(je,{children:l.jsx(pe,{type:"number",placeholder:o("ddomain.application.form.timeout.placeholder"),...m,value:m.value,onChange:x=>{u.setValue("timeout",parseInt(x.target.value))}})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:u.control,name:"nameservers",render:({field:m})=>l.jsxs(Se,{children:[l.jsx(Jb,{value:m.value??"",onValueChange:x=>{u.setValue("nameservers",x)},valueType:"dns"}),l.jsx(ye,{})]})}),l.jsx("div",{className:"flex justify-end",children:l.jsx(Me,{type:"submit",children:n!=null&&n.id?o("common.save"):o("common.next")})})]})})}),l.jsx("div",{className:re("flex flex-col space-y-5 w-full md:w-[35em]",i=="apply"&&"hidden"),children:l.jsx(MB,{deploys:(n==null?void 0:n.deployConfig)??[],onChange:m=>{h(m)}})})]})]})]})})};var Yx="Tabs",[BB,JH]=on(Yx,[nl]),aT=nl(),[WB,Kx]=BB(Yx),lT=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:o,orientation:i="horizontal",dir:a,activationMode:c="automatic",...u}=e,d=Si(a),[f,h]=Gn({prop:r,onChange:s,defaultProp:o});return l.jsx(WB,{scope:n,baseId:Bn(),value:f,onValueChange:h,orientation:i,dir:d,activationMode:c,children:l.jsx(Pe.div,{dir:d,"data-orientation":i,...u,ref:t})})});lT.displayName=Yx;var cT="TabsList",uT=y.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...s}=e,o=Kx(cT,n),i=aT(n);return l.jsx(kv,{asChild:!0,...i,orientation:o.orientation,dir:o.dir,loop:r,children:l.jsx(Pe.div,{role:"tablist","aria-orientation":o.orientation,...s,ref:t})})});uT.displayName=cT;var dT="TabsTrigger",fT=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...o}=e,i=Kx(dT,n),a=aT(n),c=pT(i.baseId,r),u=gT(i.baseId,r),d=r===i.value;return l.jsx(Cv,{asChild:!0,...a,focusable:!s,active:d,children:l.jsx(Pe.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:c,...o,ref:t,onMouseDown:ue(e.onMouseDown,f=>{!s&&f.button===0&&f.ctrlKey===!1?i.onValueChange(r):f.preventDefault()}),onKeyDown:ue(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&i.onValueChange(r)}),onFocus:ue(e.onFocus,()=>{const f=i.activationMode!=="manual";!d&&!s&&f&&i.onValueChange(r)})})})});fT.displayName=dT;var hT="TabsContent",mT=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:s,children:o,...i}=e,a=Kx(hT,n),c=pT(a.baseId,r),u=gT(a.baseId,r),d=r===a.value,f=y.useRef(d);return y.useEffect(()=>{const h=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(h)},[]),l.jsx(an,{present:s||d,children:({present:h})=>l.jsx(Pe.div,{"data-state":d?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":c,hidden:!h,id:u,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:h&&o})})});mT.displayName=hT;function pT(e,t){return`${e}-trigger-${t}`}function gT(e,t){return`${e}-content-${t}`}var HB=lT,yT=uT,vT=fT,xT=mT;const wT=HB,Gx=y.forwardRef(({className:e,...t},n)=>l.jsx(yT,{ref:n,className:re("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Gx.displayName=yT.displayName;const Qo=y.forwardRef(({className:e,...t},n)=>l.jsx(vT,{ref:n,className:re("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));Qo.displayName=vT.displayName;const If=y.forwardRef(({className:e,...t},n)=>l.jsx(xT,{ref:n,className:re("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));If.displayName=xT.displayName;const bT=y.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:re("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));bT.displayName="Card";const _T=y.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:re("flex flex-col space-y-1.5 p-6",e),...t}));_T.displayName="CardHeader";const ST=y.forwardRef(({className:e,...t},n)=>l.jsx("h3",{ref:n,className:re("text-2xl font-semibold leading-none tracking-tight",e),...t}));ST.displayName="CardTitle";const kT=y.forwardRef(({className:e,...t},n)=>l.jsx("p",{ref:n,className:re("text-sm text-muted-foreground",e),...t}));kT.displayName="CardDescription";const CT=y.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:re("p-6 pt-0",e),...t}));CT.displayName="CardContent";const jT=y.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:re("flex items-center p-6 pt-0",e),...t}));jT.displayName="CardFooter";const $s=e=>e instanceof Error?e.message:typeof e=="object"&&e!==null&&"message"in e?String(e.message):typeof e=="string"?e:"Something went wrong",YB=()=>{const{config:{accessGroups:e},reloadAccessGroups:t}=ln(),{toast:n}=zr(),r=Jn(),{t:s}=Ye(),o=async a=>{try{await b$(a),t()}catch(c){n({title:s("common.delete.failed.message"),description:$s(c),variant:"destructive"});return}},i=()=>{r("/access")};return l.jsxs("div",{className:"mt-10",children:[l.jsx(ur,{when:e.length==0,children:l.jsx(l.Fragment,{children:l.jsxs("div",{className:"flex flex-col items-center mt-10",children:[l.jsx("span",{className:"bg-orange-100 p-5 rounded-full",children:l.jsx(Ww,{size:40,className:"text-primary"})}),l.jsx("div",{className:"text-center text-sm text-muted-foreground mt-3",children:s("access.group.domains.nodata")}),l.jsx(Vx,{trigger:l.jsx(Me,{children:s("access.group.add")}),className:"mt-3"})]})})}),l.jsx(tm,{className:"h-[75vh] overflow-hidden",children:l.jsx("div",{className:"flex gap-5 flex-wrap",children:e.map(a=>l.jsxs(bT,{className:"w-full md:w-[350px]",children:[l.jsxs(_T,{children:[l.jsx(ST,{children:a.name}),l.jsx(kT,{children:s("access.group.total",{total:a.expand?a.expand.access.length:0})})]}),l.jsx(CT,{className:"min-h-[180px]",children:a.expand?l.jsx(l.Fragment,{children:a.expand.access.slice(0,3).map(c=>l.jsx("div",{className:"flex flex-col mb-3",children:l.jsxs("div",{className:"flex items-center",children:[l.jsx("div",{className:"",children:l.jsx("img",{src:Yb(c.configType)[1],alt:"provider",className:"w-8 h-8"})}),l.jsxs("div",{className:"ml-3",children:[l.jsx("div",{className:"text-sm font-semibold text-gray-700 dark:text-gray-200",children:c.name}),l.jsx("div",{className:"text-xs text-muted-foreground",children:Yb(c.configType)[0]})]})]})},c.id))}):l.jsx(l.Fragment,{children:l.jsxs("div",{className:"flex text-gray-700 dark:text-gray-200 items-center",children:[l.jsx("div",{children:l.jsx(Ww,{size:40})}),l.jsx("div",{className:"ml-2",children:s("access.group.nodata")})]})})}),l.jsx(jT,{children:l.jsxs("div",{className:"flex justify-end w-full",children:[l.jsx(ur,{when:!!(a.expand&&a.expand.access.length>0),children:l.jsx("div",{children:l.jsx(Me,{size:"sm",variant:"link",onClick:()=>{r(`/access?accessGroupId=${a.id}&tab=access`,{replace:!0})},children:s("access.group.domains")})})}),l.jsx(ur,{when:!a.expand||a.expand.access.length==0,children:l.jsx("div",{children:l.jsx(Me,{size:"sm",onClick:i,children:s("access.authorization.add")})})}),l.jsx("div",{className:"ml-3",children:l.jsxs(Sx,{children:[l.jsx(kx,{asChild:!0,children:l.jsx(Me,{variant:"destructive",size:"sm",children:s("common.delete")})}),l.jsxs(Mh,{children:[l.jsxs(Lh,{children:[l.jsx(Fh,{className:"dark:text-gray-200",children:s("access.group.delete")}),l.jsx($h,{children:s("access.group.delete.confirm")})]}),l.jsxs(zh,{children:[l.jsx(Vh,{className:"dark:text-gray-200",children:s("common.cancel")}),l.jsx(Uh,{onClick:()=>{o(a.id?a.id:"")},children:s("common.confirm")})]})]})]})})]})})]}))})})]})},KB=()=>{const{t:e}=Ye(),{config:t,deleteAccess:n}=ln(),{accesses:r}=t,s=10,o=Math.ceil(r.length/s),i=Jn(),a=Ir(),c=new URLSearchParams(a.search),u=c.get("page"),d=u?Number(u):1,f=c.get("tab"),h=c.get("accessGroupId"),m=(d-1)*s,x=m+s,p=async g=>{const v=await w$(g);n(v.id)},w=g=>{c.set("tab",g),i({search:c.toString()})};return l.jsxs("div",{className:"",children:[l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsx("div",{className:"text-muted-foreground",children:e("access.page.title")}),f!="access_group"?l.jsx(da,{trigger:l.jsx(Me,{children:e("access.authorization.add")}),op:"add"}):l.jsx(Vx,{trigger:l.jsx(Me,{children:e("access.group.add")})})]}),l.jsxs(wT,{defaultValue:f||"access",value:f||"access",className:"w-full mt-5",children:[l.jsxs(Gx,{className:"space-x-5 px-3",children:[l.jsx(Qo,{value:"access",onClick:()=>{w("access")},children:e("access.authorization.tab")}),l.jsx(Qo,{value:"access_group",onClick:()=>{w("access_group")},children:e("access.group.tab")})]}),l.jsx(If,{value:"access",children:r.length===0?l.jsxs("div",{className:"flex flex-col items-center mt-10",children:[l.jsx("span",{className:"bg-orange-100 p-5 rounded-full",children:l.jsx(sI,{size:40,className:"text-primary"})}),l.jsx("div",{className:"text-center text-sm text-muted-foreground mt-3",children:e("access.authorization.nodata")}),l.jsx(da,{trigger:l.jsx(Me,{children:e("access.authorization.add")}),op:"add",className:"mt-3"})]}):l.jsxs(l.Fragment,{children:[l.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:[l.jsx("div",{className:"w-48",children:e("common.text.name")}),l.jsx("div",{className:"w-48",children:e("common.text.provider")}),l.jsx("div",{className:"w-60",children:e("common.text.created_at")}),l.jsx("div",{className:"w-60",children:e("common.text.updated_at")}),l.jsx("div",{className:"grow",children:e("common.text.operations")})]}),r.filter(g=>h?g.group==h:!0).slice(m,x).map(g=>{var v,b;return l.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:[l.jsx("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center",children:g.name}),l.jsxs("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center space-x-2",children:[l.jsx("img",{src:(v=Rs.get(g.configType))==null?void 0:v[1],className:"w-6"}),l.jsx("div",{children:e(((b=Rs.get(g.configType))==null?void 0:b[0])||"")})]}),l.jsx("div",{className:"sm:w-60 w-full pt-1 sm:pt-0 flex items-center",children:g.created&&Ia(g.created)}),l.jsx("div",{className:"sm:w-60 w-full pt-1 sm:pt-0 flex items-center",children:g.updated&&Ia(g.updated)}),l.jsxs("div",{className:"flex items-center grow justify-start pt-1 sm:pt-0",children:[l.jsx(da,{trigger:l.jsx(Me,{variant:"link",className:"p-0",children:e("common.edit")}),op:"edit",data:g}),l.jsx(br,{orientation:"vertical",className:"h-4 mx-2"}),l.jsx(da,{trigger:l.jsx(Me,{variant:"link",className:"p-0",children:e("common.copy")}),op:"copy",data:g}),l.jsx(br,{orientation:"vertical",className:"h-4 mx-2"}),l.jsxs(Sx,{children:[l.jsx(kx,{asChild:!0,children:l.jsx(Me,{variant:"link",className:"p-0",children:e("common.delete")})}),l.jsxs(Mh,{children:[l.jsxs(Lh,{children:[l.jsx(Fh,{className:"dark:text-gray-200",children:e("access.authorization.delete")}),l.jsx($h,{children:e("access.authorization.delete.confirm")})]}),l.jsxs(zh,{children:[l.jsx(Vh,{className:"dark:text-gray-200",children:e("common.cancel")}),l.jsx(Uh,{onClick:()=>{p(g)},children:e("common.confirm")})]})]})]})]})]},g.id)}),l.jsx(xE,{totalPages:o,currentPage:d,onPageChange:g=>{c.set("page",g.toString()),i({search:c.toString()})}})]})}),l.jsx(If,{value:"access_group",children:l.jsx(YB,{})})]})]})},ET=async e=>{let t=1;e.page&&(t=e.page);let n=50;e.perPage&&(n=e.perPage);let r="domain!=null";return e.domain&&(r=`domain="${e.domain}"`),await ot().collection("deployments").getList(t,n,{filter:r,sort:"-deployedAt",expand:"domain"})},GB=()=>{const e=Jn(),[t,n]=y.useState(),[r]=SO(),{t:s}=Ye(),o=r.get("domain");return y.useEffect(()=>{(async()=>{const a={};o&&(a.domain=o);const c=await ET(a);n(c.items)})()},[o]),l.jsxs(tm,{className:"h-[80vh] overflow-hidden",children:[l.jsx("div",{className:"text-muted-foreground",children:s("history.page.title")}),t!=null&&t.length?l.jsxs(l.Fragment,{children:[l.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:[l.jsx("div",{className:"w-48",children:s("history.props.domain")}),l.jsx("div",{className:"w-24",children:s("history.props.status")}),l.jsx("div",{className:"w-56",children:s("history.props.stage")}),l.jsx("div",{className:"w-56 sm:ml-2 text-center",children:s("history.props.last_execution_time")}),l.jsx("div",{className:"grow",children:s("common.text.operations")})]}),t==null?void 0:t.map(i=>{var a,c;return l.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:[l.jsx("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center",children:(a=i.expand.domain)==null?void 0:a.domain.split(";").map(u=>l.jsxs(l.Fragment,{children:[u,l.jsx("br",{})]}))}),l.jsx("div",{className:"sm:w-24 w-full pt-1 sm:pt-0 flex items-center",children:l.jsx(_x,{deployment:i})}),l.jsx("div",{className:"sm:w-56 w-full pt-1 sm:pt-0 flex items-center",children:l.jsx(bx,{phase:i.phase,phaseSuccess:i.phaseSuccess})}),l.jsx("div",{className:"sm:w-56 w-full pt-1 sm:pt-0 flex items-center sm:justify-center",children:Ia(i.deployedAt)}),l.jsx("div",{className:"flex items-center grow justify-start pt-1 sm:pt-0 sm:ml-2",children:l.jsxs(Wv,{children:[l.jsx(Hv,{asChild:!0,children:l.jsx(Me,{variant:"link",className:"p-0",children:s("history.log")})}),l.jsxs(wh,{className:"sm:max-w-5xl",children:[l.jsx(Yv,{children:l.jsxs(Kv,{children:[(c=i.expand.domain)==null?void 0:c.domain,"-",i.id,s("history.log")]})}),l.jsxs("div",{className:"bg-gray-950 text-stone-100 p-5 text-sm h-[80dvh]",children:[i.log.check&&l.jsx(l.Fragment,{children:i.log.check.map(u=>l.jsxs("div",{className:"flex flex-col mt-2",children:[l.jsxs("div",{className:"flex",children:[l.jsxs("div",{children:["[",u.time,"]"]}),l.jsx("div",{className:"ml-2",children:u.message})]}),u.error&&l.jsx("div",{className:"mt-1 text-red-600",children:u.error})]}))}),i.log.apply&&l.jsx(l.Fragment,{children:i.log.apply.map(u=>l.jsxs("div",{className:"flex flex-col mt-2",children:[l.jsxs("div",{className:"flex",children:[l.jsxs("div",{children:["[",u.time,"]"]}),l.jsx("div",{className:"ml-2",children:u.message})]}),u.info&&u.info.map(d=>l.jsx("div",{className:"mt-1 text-green-600",children:d})),u.error&&l.jsx("div",{className:"mt-1 text-red-600",children:u.error})]}))}),i.log.deploy&&l.jsx(l.Fragment,{children:i.log.deploy.map(u=>l.jsxs("div",{className:"flex flex-col mt-2",children:[l.jsxs("div",{className:"flex",children:[l.jsxs("div",{children:["[",u.time,"]"]}),l.jsx("div",{className:"ml-2",children:u.message})]}),u.error&&l.jsx("div",{className:"mt-1 text-red-600",children:u.error})]}))})]})]})]})})]},i.id)})]}):l.jsx(l.Fragment,{children:l.jsxs(im,{className:"max-w-[40em] mx-auto mt-20",children:[l.jsx(Hx,{children:s("common.text.nodata")}),l.jsxs(am,{children:[l.jsxs("div",{className:"flex items-center mt-5",children:[l.jsx("div",{children:l.jsx(ok,{className:"text-yellow-400",size:36})}),l.jsxs("div",{className:"ml-2",children:[" ",s("history.nodata")]})]}),l.jsx("div",{className:"mt-2 flex justify-end",children:l.jsx(Me,{onClick:()=>{e("/")},children:s("domain.add")})})]})]})})]})},ZB=le.object({username:le.string().email({message:"login.username.errmsg.invalid"}),password:le.string().min(10,{message:"login.password.errmsg.invalid"})}),qB=()=>{const{t:e}=Ye(),t=cn({resolver:un(ZB),defaultValues:{username:"",password:""}}),n=async s=>{try{await ot().admins.authWithPassword(s.username,s.password),r("/")}catch(o){const i=$s(o);t.setError("username",{message:i}),t.setError("password",{message:i})}},r=Jn();return l.jsxs("div",{className:"max-w-[35em] border dark:border-stone-500 mx-auto mt-32 p-10 rounded-md shadow-md",children:[l.jsx("div",{className:"flex justify-center mb-10",children:l.jsx("img",{src:"/vite.svg",className:"w-16"})}),l.jsx(dn,{...t,children:l.jsxs("form",{onSubmit:t.handleSubmit(n),className:"space-y-8 dark:text-stone-200",children:[l.jsx(ke,{control:t.control,name:"username",render:({field:s})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:e("login.username.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:e("login.username.placeholder"),...s})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:t.control,name:"password",render:({field:s})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:e("login.password.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:e("login.password.placeholder"),...s,type:"password"})}),l.jsx(ye,{})]})}),l.jsx("div",{className:"flex justify-end",children:l.jsx(Me,{type:"submit",children:e("login.submit")})})]})})]})},XB=()=>ot().authStore.isValid&&ot().authStore.isAdmin?l.jsx(KS,{to:"/"}):l.jsxs("div",{className:"container",children:[l.jsx(tv,{}),l.jsx(oE,{})]}),QB=le.object({oldPassword:le.string().min(10,{message:"settings.password.password.errmsg.length"}),newPassword:le.string().min(10,{message:"settings.password.password.errmsg.length"}),confirmPassword:le.string().min(10,{message:"settings.password.password.errmsg.length"})}).refine(e=>e.newPassword===e.confirmPassword,{message:"settings.password.password.errmsg.not_matched",path:["confirmPassword"]}),JB=()=>{const{toast:e}=zr(),t=Jn(),{t:n}=Ye(),r=cn({resolver:un(QB),defaultValues:{oldPassword:"",newPassword:"",confirmPassword:""}}),s=async o=>{var i,a;try{await ot().admins.authWithPassword((i=ot().authStore.model)==null?void 0:i.email,o.oldPassword)}catch(c){const u=$s(c);r.setError("oldPassword",{message:u})}try{await ot().admins.update((a=ot().authStore.model)==null?void 0:a.id,{password:o.newPassword,passwordConfirm:o.confirmPassword}),ot().authStore.clear(),e({title:n("settings.password.changed.message"),description:n("settings.account.relogin.message")}),setTimeout(()=>{t("/login")},500)}catch(c){const u=$s(c);e({title:n("settings.password.failed.message"),description:u,variant:"destructive"})}};return l.jsx(l.Fragment,{children:l.jsx("div",{className:"w-full md:max-w-[35em]",children:l.jsx(dn,{...r,children:l.jsxs("form",{onSubmit:r.handleSubmit(s),className:"space-y-8 dark:text-stone-200",children:[l.jsx(ke,{control:r.control,name:"oldPassword",render:({field:o})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:n("settings.password.current_password.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:n("settings.password.current_password.placeholder"),...o,type:"password"})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:r.control,name:"newPassword",render:({field:o})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:n("settings.password.new_password.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:n("settings.password.new_password.placeholder"),...o,type:"password"})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:r.control,name:"confirmPassword",render:({field:o})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:n("settings.password.confirm_password.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:n("settings.password.confirm_password.placeholder"),...o,type:"password"})}),l.jsx(ye,{})]})}),l.jsx("div",{className:"flex justify-end",children:l.jsx(Me,{type:"submit",children:n("common.update")})})]})})})})},eW=()=>{const e=Ir(),[t,n]=y.useState("account"),r=Jn(),{t:s}=Ye();return y.useEffect(()=>{const i=e.pathname.split("/")[2];n(i)},[e]),l.jsxs("div",{children:[l.jsx(Px,{}),l.jsx("div",{className:"text-muted-foreground border-b dark:border-stone-500 py-5",children:s("settings.page.title")}),l.jsx("div",{className:"w-full mt-5 p-0 md:p-3 flex justify-center",children:l.jsxs(wT,{defaultValue:"account",className:"w-full",value:t,children:[l.jsxs(Gx,{className:"mx-auto",children:[l.jsxs(Qo,{value:"account",onClick:()=>{r("/setting/account")},className:"px-5",children:[l.jsx(hI,{size:14}),l.jsx("div",{className:"ml-1",children:s("settings.account.tab")})]}),l.jsxs(Qo,{value:"password",onClick:()=>{r("/setting/password")},className:"px-5",children:[l.jsx(rI,{size:14}),l.jsx("div",{className:"ml-1",children:s("settings.password.tab")})]}),l.jsxs(Qo,{value:"notify",onClick:()=>{r("/setting/notify")},className:"px-5",children:[l.jsx(aI,{size:14}),l.jsx("div",{className:"ml-1",children:s("settings.notification.tab")})]}),l.jsxs(Qo,{value:"ssl-provider",onClick:()=>{r("/setting/ssl-provider")},className:"px-5",children:[l.jsx(uI,{size:14}),l.jsx("div",{className:"ml-1",children:s("settings.ca.tab")})]})]}),l.jsx(If,{value:t,children:l.jsx("div",{className:"mt-5 w-full md:w-[45em]",children:l.jsx(tv,{})})})]})})]})},tW=()=>{const[e,t]=y.useState(),[n,r]=y.useState(),s=Jn(),{t:o}=Ye();return y.useEffect(()=>{(async()=>{const a=await KU();t(a)})()},[]),y.useEffect(()=>{(async()=>{const c=await ET({perPage:8});r(c.items)})()},[]),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("div",{className:"flex justify-between items-center",children:l.jsx("div",{className:"text-muted-foreground",children:o("dashboard.page.title")})}),l.jsxs("div",{className:"flex mt-10 gap-5 flex-col flex-wrap md:flex-row",children:[l.jsxs("div",{className:"w-full md:w-[250px] 3xl:w-[300px] flex items-center rounded-md p-3 shadow-lg border",children:[l.jsx("div",{className:"p-3",children:l.jsx(dI,{size:48,strokeWidth:1,className:"text-blue-400"})}),l.jsxs("div",{children:[l.jsx("div",{className:"text-muted-foreground font-semibold",children:o("dashboard.statistics.all")}),l.jsxs("div",{className:"flex items-baseline",children:[l.jsx("div",{className:"text-3xl text-stone-700 dark:text-stone-200",children:e!=null&&e.total?l.jsx(wn,{to:"/domains",className:"hover:underline",children:e==null?void 0:e.total}):0}),l.jsx("div",{className:"ml-1 text-stone-700 dark:text-stone-200",children:o("dashboard.statistics.unit")})]})]})]}),l.jsxs("div",{className:"w-full md:w-[250px] 3xl:w-[300px] flex items-center rounded-md p-3 shadow-lg border",children:[l.jsx("div",{className:"p-3",children:l.jsx(QO,{size:48,strokeWidth:1,className:"text-red-400"})}),l.jsxs("div",{children:[l.jsx("div",{className:"text-muted-foreground font-semibold",children:o("dashboard.statistics.near_expired")}),l.jsxs("div",{className:"flex items-baseline",children:[l.jsx("div",{className:"text-3xl text-stone-700 dark:text-stone-200",children:e!=null&&e.expired?l.jsx(wn,{to:"/domains?state=expired",className:"hover:underline",children:e==null?void 0:e.expired}):0}),l.jsx("div",{className:"ml-1 text-stone-700 dark:text-stone-200",children:o("dashboard.statistics.unit")})]})]})]}),l.jsxs("div",{className:"border w-full md:w-[250px] 3xl:w-[300px] flex items-center rounded-md p-3 shadow-lg",children:[l.jsx("div",{className:"p-3",children:l.jsx(iI,{size:48,strokeWidth:1,className:"text-green-400"})}),l.jsxs("div",{children:[l.jsx("div",{className:"text-muted-foreground font-semibold",children:o("dashboard.statistics.enabled")}),l.jsxs("div",{className:"flex items-baseline",children:[l.jsx("div",{className:"text-3xl text-stone-700 dark:text-stone-200",children:e!=null&&e.enabled?l.jsx(wn,{to:"/domains?state=enabled",className:"hover:underline",children:e==null?void 0:e.enabled}):0}),l.jsx("div",{className:"ml-1 text-stone-700 dark:text-stone-200",children:o("dashboard.statistics.unit")})]})]})]}),l.jsxs("div",{className:"border w-full md:w-[250px] 3xl:w-[300px] flex items-center rounded-md p-3 shadow-lg",children:[l.jsx("div",{className:"p-3",children:l.jsx(qO,{size:48,strokeWidth:1,className:"text-gray-400"})}),l.jsxs("div",{children:[l.jsx("div",{className:"text-muted-foreground font-semibold",children:o("dashboard.statistics.disabled")}),l.jsxs("div",{className:"flex items-baseline",children:[l.jsx("div",{className:"text-3xl text-stone-700 dark:text-stone-200",children:e!=null&&e.disabled?l.jsx(wn,{to:"/domains?state=disabled",className:"hover:underline",children:e==null?void 0:e.disabled}):0}),l.jsx("div",{className:"ml-1 text-stone-700 dark:text-stone-200",children:o("dashboard.statistics.unit")})]})]})]})]}),l.jsx("div",{className:"my-4",children:l.jsx("hr",{})}),l.jsxs("div",{children:[l.jsx("div",{className:"text-muted-foreground mt-5 text-sm",children:o("dashboard.history")}),(n==null?void 0:n.length)==0?l.jsx(l.Fragment,{children:l.jsxs(im,{className:"max-w-[40em] mt-10",children:[l.jsx(Hx,{children:o("common.text.nodata")}),l.jsxs(am,{children:[l.jsxs("div",{className:"flex items-center mt-5",children:[l.jsx("div",{children:l.jsx(ok,{className:"text-yellow-400",size:36})}),l.jsxs("div",{className:"ml-2",children:[" ",o("history.nodata")]})]}),l.jsx("div",{className:"mt-2 flex justify-end",children:l.jsx(Me,{onClick:()=>{s("/edit")},children:o("domain.add")})})]})]})}):l.jsxs(l.Fragment,{children:[l.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:[l.jsx("div",{className:"w-48",children:o("history.props.domain")}),l.jsx("div",{className:"w-24",children:o("history.props.status")}),l.jsx("div",{className:"w-56",children:o("history.props.stage")}),l.jsx("div",{className:"w-56 sm:ml-2 text-center",children:o("history.props.last_execution_time")}),l.jsx("div",{className:"grow",children:o("common.text.operations")})]}),n==null?void 0:n.map(i=>{var a,c;return l.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:[l.jsx("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center",children:(a=i.expand.domain)==null?void 0:a.domain.split(";").map(u=>l.jsxs(l.Fragment,{children:[u,l.jsx("br",{})]}))}),l.jsx("div",{className:"sm:w-24 w-full pt-1 sm:pt-0 flex items-center",children:l.jsx(_x,{deployment:i})}),l.jsx("div",{className:"sm:w-56 w-full pt-1 sm:pt-0 flex items-center",children:l.jsx(bx,{phase:i.phase,phaseSuccess:i.phaseSuccess})}),l.jsx("div",{className:"sm:w-56 w-full pt-1 sm:pt-0 flex items-center sm:justify-center",children:Ia(i.deployedAt)}),l.jsx("div",{className:"flex items-center grow justify-start pt-1 sm:pt-0 sm:ml-2",children:l.jsxs(Wv,{children:[l.jsx(Hv,{asChild:!0,children:l.jsx(Me,{variant:"link",className:"p-0",children:o("history.log")})}),l.jsxs(wh,{className:"sm:max-w-5xl",children:[l.jsx(Yv,{children:l.jsxs(Kv,{children:[(c=i.expand.domain)==null?void 0:c.domain,"-",i.id,o("history.log")]})}),l.jsxs("div",{className:"bg-gray-950 text-stone-100 p-5 text-sm h-[80dvh]",children:[i.log.check&&l.jsx(l.Fragment,{children:i.log.check.map(u=>l.jsxs("div",{className:"flex flex-col mt-2",children:[l.jsxs("div",{className:"flex",children:[l.jsxs("div",{children:["[",u.time,"]"]}),l.jsx("div",{className:"ml-2",children:u.message})]}),u.error&&l.jsx("div",{className:"mt-1 text-red-600",children:u.error})]}))}),i.log.apply&&l.jsx(l.Fragment,{children:i.log.apply.map(u=>l.jsxs("div",{className:"flex flex-col mt-2",children:[l.jsxs("div",{className:"flex",children:[l.jsxs("div",{children:["[",u.time,"]"]}),l.jsx("div",{className:"ml-2",children:u.message})]}),u.info&&u.info.map(d=>l.jsx("div",{className:"mt-1 text-green-600",children:d})),u.error&&l.jsx("div",{className:"mt-1 text-red-600",children:u.error})]}))}),i.log.deploy&&l.jsx(l.Fragment,{children:i.log.deploy.map(u=>l.jsxs("div",{className:"flex flex-col mt-2",children:[l.jsxs("div",{className:"flex",children:[l.jsxs("div",{children:["[",u.time,"]"]}),l.jsx("div",{className:"ml-2",children:u.message})]}),u.error&&l.jsx("div",{className:"mt-1 text-red-600",children:u.error})]}))})]})]})]})})]},i.id)})]})]})]})},nW=le.object({email:le.string().email("settings.account.email.errmsg.invalid")}),rW=()=>{var a;const{toast:e}=zr(),t=Jn(),{t:n}=Ye(),[r,s]=y.useState(!1),o=cn({resolver:un(nW),defaultValues:{email:(a=ot().authStore.model)==null?void 0:a.email}}),i=async c=>{var u;try{await ot().admins.update((u=ot().authStore.model)==null?void 0:u.id,{email:c.email}),ot().authStore.clear(),e({title:n("settings.account.email.changed.message"),description:n("settings.account.relogin.message")}),setTimeout(()=>{t("/login")},500)}catch(d){const f=$s(d);e({title:n("settings.account.email.failed.message"),description:f,variant:"destructive"})}};return l.jsx(l.Fragment,{children:l.jsx("div",{className:"w-full md:max-w-[35em]",children:l.jsx(dn,{...o,children:l.jsxs("form",{onSubmit:o.handleSubmit(i),className:"space-y-8 dark:text-stone-200",children:[l.jsx(ke,{control:o.control,name:"email",render:({field:c})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:n("settings.account.email.label")}),l.jsx(je,{children:l.jsx(pe,{placeholder:n("settings.account.email.placeholder"),...c,type:"email",onChange:u=>{s(!0),o.setValue("email",u.target.value)}})}),l.jsx(ye,{})]})}),l.jsx("div",{className:"flex justify-end",children:r?l.jsx(Me,{type:"submit",children:n("common.update")}):l.jsx(Me,{type:"submit",disabled:!0,variant:"secondary",children:n("common.update")})})]})})})})};var Zx="Collapsible",[sW,NT]=on(Zx),[oW,qx]=sW(Zx),TT=y.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:o,onOpenChange:i,...a}=e,[c=!1,u]=Gn({prop:r,defaultProp:s,onChange:i});return l.jsx(oW,{scope:n,disabled:o,contentId:Bn(),open:c,onOpenToggle:y.useCallback(()=>u(d=>!d),[u]),children:l.jsx(Pe.div,{"data-state":Qx(c),"data-disabled":o?"":void 0,...a,ref:t})})});TT.displayName=Zx;var PT="CollapsibleTrigger",RT=y.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,s=qx(PT,n);return l.jsx(Pe.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":Qx(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:t,onClick:ue(e.onClick,s.onOpenToggle)})});RT.displayName=PT;var Xx="CollapsibleContent",AT=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=qx(Xx,e.__scopeCollapsible);return l.jsx(an,{present:n||s.open,children:({present:o})=>l.jsx(iW,{...r,ref:t,present:o})})});AT.displayName=Xx;var iW=y.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:s,...o}=e,i=qx(Xx,n),[a,c]=y.useState(r),u=y.useRef(null),d=Ge(t,u),f=y.useRef(0),h=f.current,m=y.useRef(0),x=m.current,p=i.open||a,w=y.useRef(p),g=y.useRef();return y.useEffect(()=>{const v=requestAnimationFrame(()=>w.current=!1);return()=>cancelAnimationFrame(v)},[]),en(()=>{const v=u.current;if(v){g.current=g.current||{transitionDuration:v.style.transitionDuration,animationName:v.style.animationName},v.style.transitionDuration="0s",v.style.animationName="none";const b=v.getBoundingClientRect();f.current=b.height,m.current=b.width,w.current||(v.style.transitionDuration=g.current.transitionDuration,v.style.animationName=g.current.animationName),c(r)}},[i.open,r]),l.jsx(Pe.div,{"data-state":Qx(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!p,...o,ref:d,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":x?`${x}px`:void 0,...e.style},children:p&&s})});function Qx(e){return e?"open":"closed"}var aW=TT,lW=RT,cW=AT,Zs="Accordion",uW=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[Jx,dW,fW]=eu(Zs),[lm,e9]=on(Zs,[fW,NT]),e0=NT(),DT=We.forwardRef((e,t)=>{const{type:n,...r}=e,s=r,o=r;return l.jsx(Jx.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?l.jsx(gW,{...o,ref:t}):l.jsx(pW,{...s,ref:t})})});DT.displayName=Zs;var[OT,hW]=lm(Zs),[IT,mW]=lm(Zs,{collapsible:!1}),pW=We.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},collapsible:o=!1,...i}=e,[a,c]=Gn({prop:n,defaultProp:r,onChange:s});return l.jsx(OT,{scope:e.__scopeAccordion,value:a?[a]:[],onItemOpen:c,onItemClose:We.useCallback(()=>o&&c(""),[o,c]),children:l.jsx(IT,{scope:e.__scopeAccordion,collapsible:o,children:l.jsx(MT,{...i,ref:t})})})}),gW=We.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...o}=e,[i=[],a]=Gn({prop:n,defaultProp:r,onChange:s}),c=We.useCallback(d=>a((f=[])=>[...f,d]),[a]),u=We.useCallback(d=>a((f=[])=>f.filter(h=>h!==d)),[a]);return l.jsx(OT,{scope:e.__scopeAccordion,value:i,onItemOpen:c,onItemClose:u,children:l.jsx(IT,{scope:e.__scopeAccordion,collapsible:!0,children:l.jsx(MT,{...o,ref:t})})})}),[yW,cm]=lm(Zs),MT=We.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:s,orientation:o="vertical",...i}=e,a=We.useRef(null),c=Ge(a,t),u=dW(n),f=Si(s)==="ltr",h=ue(e.onKeyDown,m=>{var R;if(!uW.includes(m.key))return;const x=m.target,p=u().filter(A=>{var O;return!((O=A.ref.current)!=null&&O.disabled)}),w=p.findIndex(A=>A.ref.current===x),g=p.length;if(w===-1)return;m.preventDefault();let v=w;const b=0,_=g-1,C=()=>{v=w+1,v>_&&(v=b)},j=()=>{v=w-1,v{const{__scopeAccordion:n,value:r,...s}=e,o=cm(Mf,n),i=hW(Mf,n),a=e0(n),c=Bn(),u=r&&i.value.includes(r)||!1,d=o.disabled||e.disabled;return l.jsx(vW,{scope:n,open:u,disabled:d,triggerId:c,children:l.jsx(aW,{"data-orientation":o.orientation,"data-state":BT(u),...a,...s,ref:t,disabled:d,open:u,onOpenChange:f=>{f?i.onItemOpen(r):i.onItemClose(r)}})})});LT.displayName=Mf;var zT="AccordionHeader",FT=We.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=cm(Zs,n),o=t0(zT,n);return l.jsx(Pe.h3,{"data-orientation":s.orientation,"data-state":BT(o.open),"data-disabled":o.disabled?"":void 0,...r,ref:t})});FT.displayName=zT;var ey="AccordionTrigger",$T=We.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=cm(Zs,n),o=t0(ey,n),i=mW(ey,n),a=e0(n);return l.jsx(Jx.ItemSlot,{scope:n,children:l.jsx(lW,{"aria-disabled":o.open&&!i.collapsible||void 0,"data-orientation":s.orientation,id:o.triggerId,...a,...r,ref:t})})});$T.displayName=ey;var UT="AccordionContent",VT=We.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=cm(Zs,n),o=t0(UT,n),i=e0(n);return l.jsx(cW,{role:"region","aria-labelledby":o.triggerId,"data-orientation":s.orientation,...i,...r,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});VT.displayName=UT;function BT(e){return e?"open":"closed"}var xW=DT,wW=LT,bW=FT,WT=$T,HT=VT;const e1=xW,Fl=y.forwardRef(({className:e,...t},n)=>l.jsx(wW,{ref:n,className:re("border-b",e),...t}));Fl.displayName="AccordionItem";const $l=y.forwardRef(({className:e,children:t,...n},r)=>l.jsx(bW,{className:"flex",children:l.jsxs(WT,{ref:r,className:re("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...n,children:[t,l.jsx(rv,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));$l.displayName=WT.displayName;const Ul=y.forwardRef(({className:e,children:t,...n},r)=>l.jsx(HT,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:l.jsx("div",{className:re("pb-4 pt-0",e),children:t})}));Ul.displayName=HT.displayName;const _W=(e,t)=>{switch(t.type){case"SET_CHANNEL":{const n=t.payload.channel;return{...e,content:{...e.content,[n]:t.payload.data}}}case"SET_CHANNELS":return{...t.payload};default:return e}},YT=y.createContext({}),n0=()=>y.useContext(YT),SW=({children:e})=>{const[t,n]=y.useReducer(_W,{});y.useEffect(()=>{(async()=>{const i=await yx("notifyChannels");n({type:"SET_CHANNELS",payload:i})})()},[]);const r=y.useCallback(o=>{n({type:"SET_CHANNEL",payload:o})},[]),s=y.useCallback(o=>{n({type:"SET_CHANNELS",payload:o})},[]);return l.jsx(YT.Provider,{value:{config:t,setChannel:r,setChannels:s},children:e})},kW=()=>{const{config:e,setChannels:t}=n0(),{t:n}=Ye(),[r,s]=y.useState({id:e.id??"",name:"notifyChannels",data:{accessToken:"",secret:"",enabled:!1}});y.useEffect(()=>{const c=(()=>{const u={accessToken:"",secret:"",enabled:!1};if(!e.content)return u;const d=e.content;return d.dingtalk?d.dingtalk:u})();s({id:e.id??"",name:"dingtalk",data:c})},[e]);const{toast:o}=zr(),i=async()=>{try{const a=await il({...e,name:"notifyChannels",content:{...e.content,dingtalk:{...r.data}}});t(a),o({title:n("common.save.succeeded.message"),description:n("settings.notification.config.saved.message")})}catch(a){const c=$s(a);o({title:n("common.save.failed.message"),description:`${n("settings.notification.config.failed.message")}: ${c}`,variant:"destructive"})}};return l.jsxs("div",{children:[l.jsx(pe,{placeholder:"AccessToken",value:r.data.accessToken,onChange:a=>{s({...r,data:{...r.data,accessToken:a.target.value}})}}),l.jsx(pe,{placeholder:n("settings.notification.dingtalk.secret.placeholder"),className:"mt-2",value:r.data.secret,onChange:a=>{s({...r,data:{...r.data,secret:a.target.value}})}}),l.jsxs("div",{className:"flex items-center space-x-1 mt-2",children:[l.jsx(mu,{id:"airplane-mode",checked:r.data.enabled,onCheckedChange:()=>{s({...r,data:{...r.data,enabled:!r.data.enabled}})}}),l.jsx(Vt,{htmlFor:"airplane-mode",children:n("settings.notification.config.enable")})]}),l.jsx("div",{className:"flex justify-end mt-2",children:l.jsx(Me,{onClick:()=>{i()},children:n("common.save")})})]})},CW={title:"您有 {COUNT} 张证书即将过期",content:"有 {COUNT} 张证书即将过期,域名分别为 {DOMAINS},请保持关注!"},jW=()=>{const[e,t]=y.useState(""),[n,r]=y.useState([CW]),{toast:s}=zr(),{t:o}=Ye();y.useEffect(()=>{(async()=>{const d=await yx("templates");d.content&&(r(d.content.notifyTemplates),t(d.id?d.id:""))})()},[]);const i=u=>{const d=n[0];r([{...d,title:u}])},a=u=>{const d=n[0];r([{...d,content:u}])},c=async()=>{const u=await il({id:e,content:{notifyTemplates:n},name:"templates"});u.id&&t(u.id),s({title:o("common.save.succeeded.message"),description:o("settings.notification.template.saved.message")})};return l.jsxs("div",{children:[l.jsx(pe,{value:n[0].title,onChange:u=>{i(u.target.value)}}),l.jsx("div",{className:"text-muted-foreground text-sm mt-1",children:o("settings.notification.template.variables.tips.title")}),l.jsx(Df,{className:"mt-2",value:n[0].content,onChange:u=>{a(u.target.value)}}),l.jsx("div",{className:"text-muted-foreground text-sm mt-1",children:o("settings.notification.template.variables.tips.content")}),l.jsx("div",{className:"flex justify-end mt-2",children:l.jsx(Me,{onClick:c,children:o("common.save")})})]})},EW=()=>{const{config:e,setChannels:t}=n0(),{t:n}=Ye(),[r,s]=y.useState({id:e.id??"",name:"notifyChannels",data:{apiToken:"",chatId:"",enabled:!1}});y.useEffect(()=>{const c=(()=>{const u={apiToken:"",chatId:"",enabled:!1};if(!e.content)return u;const d=e.content;return d.telegram?d.telegram:u})();s({id:e.id??"",name:"common.provider.telegram",data:c})},[e]);const{toast:o}=zr(),i=async()=>{try{const a=await il({...e,name:"notifyChannels",content:{...e.content,telegram:{...r.data}}});t(a),o({title:n("common.save.succeeded.message"),description:n("settings.notification.config.saved.message")})}catch(a){const c=$s(a);o({title:n("common.save.failed.message"),description:`${n("settings.notification.config.failed.message")}: ${c}`,variant:"destructive"})}};return l.jsxs("div",{children:[l.jsx(pe,{placeholder:"ApiToken",value:r.data.apiToken,onChange:a=>{s({...r,data:{...r.data,apiToken:a.target.value}})}}),l.jsx(pe,{placeholder:"ChatId",value:r.data.chatId,onChange:a=>{s({...r,data:{...r.data,chatId:a.target.value}})}}),l.jsxs("div",{className:"flex items-center space-x-1 mt-2",children:[l.jsx(mu,{id:"airplane-mode",checked:r.data.enabled,onCheckedChange:()=>{s({...r,data:{...r.data,enabled:!r.data.enabled}})}}),l.jsx(Vt,{htmlFor:"airplane-mode",children:n("settings.notification.config.enable")})]}),l.jsx("div",{className:"flex justify-end mt-2",children:l.jsx(Me,{onClick:()=>{i()},children:n("common.save")})})]})};function NW(e){try{return new URL(e),!0}catch{return!1}}const TW=()=>{const{config:e,setChannels:t}=n0(),{t:n}=Ye(),[r,s]=y.useState({id:e.id??"",name:"notifyChannels",data:{url:"",enabled:!1}});y.useEffect(()=>{const c=(()=>{const u={url:"",enabled:!1};if(!e.content)return u;const d=e.content;return d.webhook?d.webhook:u})();s({id:e.id??"",name:"webhook",data:c})},[e]);const{toast:o}=zr(),i=async()=>{try{if(r.data.url=r.data.url.trim(),!NW(r.data.url)){o({title:n("common.save.failed.message"),description:n("settings.notification.url.errmsg.invalid"),variant:"destructive"});return}const a=await il({...e,name:"notifyChannels",content:{...e.content,webhook:{...r.data}}});t(a),o({title:n("common.save.succeeded.message"),description:n("settings.notification.config.saved.message")})}catch(a){const c=$s(a);o({title:n("common.save.failed.message"),description:`${n("settings.notification.config.failed.message")}: ${c}`,variant:"destructive"})}};return l.jsxs("div",{children:[l.jsx(pe,{placeholder:"Url",value:r.data.url,onChange:a=>{s({...r,data:{...r.data,url:a.target.value}})}}),l.jsxs("div",{className:"flex items-center space-x-1 mt-2",children:[l.jsx(mu,{id:"airplane-mode",checked:r.data.enabled,onCheckedChange:()=>{s({...r,data:{...r.data,enabled:!r.data.enabled}})}}),l.jsx(Vt,{htmlFor:"airplane-mode",children:n("settings.notification.config.enable")})]}),l.jsx("div",{className:"flex justify-end mt-2",children:l.jsx(Me,{onClick:()=>{i()},children:n("common.save")})})]})},PW=()=>{const{t:e}=Ye();return l.jsx(l.Fragment,{children:l.jsxs(SW,{children:[l.jsx("div",{className:"border rounded-sm p-5 shadow-lg",children:l.jsx(e1,{type:"multiple",className:"dark:text-stone-200",children:l.jsxs(Fl,{value:"item-1",className:"dark:border-stone-200",children:[l.jsx($l,{children:e("settings.notification.template.label")}),l.jsx(Ul,{children:l.jsx(jW,{})})]})})}),l.jsx("div",{className:"border rounded-md p-5 mt-7 shadow-lg",children:l.jsxs(e1,{type:"single",className:"dark:text-stone-200",children:[l.jsxs(Fl,{value:"item-2",className:"dark:border-stone-200",children:[l.jsx($l,{children:e("common.provider.dingtalk")}),l.jsx(Ul,{children:l.jsx(kW,{})})]}),l.jsxs(Fl,{value:"item-4",className:"dark:border-stone-200",children:[l.jsx($l,{children:e("common.provider.telegram")}),l.jsx(Ul,{children:l.jsx(EW,{})})]}),l.jsxs(Fl,{value:"item-5",className:"dark:border-stone-200",children:[l.jsx($l,{children:e("common.provider.webhook")}),l.jsx(Ul,{children:l.jsx(TW,{})})]})]})})]})})};var r0="Radio",[RW,KT]=on(r0),[AW,DW]=RW(r0),GT=y.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:s=!1,required:o,disabled:i,value:a="on",onCheck:c,...u}=e,[d,f]=y.useState(null),h=Ge(t,p=>f(p)),m=y.useRef(!1),x=d?!!d.closest("form"):!0;return l.jsxs(AW,{scope:n,checked:s,disabled:i,children:[l.jsx(Pe.button,{type:"button",role:"radio","aria-checked":s,"data-state":XT(s),"data-disabled":i?"":void 0,disabled:i,value:a,...u,ref:h,onClick:ue(e.onClick,p=>{s||c==null||c(),x&&(m.current=p.isPropagationStopped(),m.current||p.stopPropagation())})}),x&&l.jsx(OW,{control:d,bubbles:!m.current,name:r,value:a,checked:s,required:o,disabled:i,style:{transform:"translateX(-100%)"}})]})});GT.displayName=r0;var ZT="RadioIndicator",qT=y.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...s}=e,o=DW(ZT,n);return l.jsx(an,{present:r||o.checked,children:l.jsx(Pe.span,{"data-state":XT(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:t})})});qT.displayName=ZT;var OW=e=>{const{control:t,checked:n,bubbles:r=!0,...s}=e,o=y.useRef(null),i=Cx(n),a=yv(t);return y.useEffect(()=>{const c=o.current,u=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(u,"checked").set;if(i!==n&&f){const h=new Event("click",{bubbles:r});f.call(c,n),c.dispatchEvent(h)}},[i,n,r]),l.jsx("input",{type:"radio","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:o,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function XT(e){return e?"checked":"unchecked"}var IW=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],s0="RadioGroup",[MW,t9]=on(s0,[nl,KT]),QT=nl(),JT=KT(),[LW,zW]=MW(s0),eP=y.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:s,value:o,required:i=!1,disabled:a=!1,orientation:c,dir:u,loop:d=!0,onValueChange:f,...h}=e,m=QT(n),x=Si(u),[p,w]=Gn({prop:o,defaultProp:s,onChange:f});return l.jsx(LW,{scope:n,name:r,required:i,disabled:a,value:p,onValueChange:w,children:l.jsx(kv,{asChild:!0,...m,orientation:c,dir:x,loop:d,children:l.jsx(Pe.div,{role:"radiogroup","aria-required":i,"aria-orientation":c,"data-disabled":a?"":void 0,dir:x,...h,ref:t})})})});eP.displayName=s0;var tP="RadioGroupItem",nP=y.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...s}=e,o=zW(tP,n),i=o.disabled||r,a=QT(n),c=JT(n),u=y.useRef(null),d=Ge(t,u),f=o.value===s.value,h=y.useRef(!1);return y.useEffect(()=>{const m=p=>{IW.includes(p.key)&&(h.current=!0)},x=()=>h.current=!1;return document.addEventListener("keydown",m),document.addEventListener("keyup",x),()=>{document.removeEventListener("keydown",m),document.removeEventListener("keyup",x)}},[]),l.jsx(Cv,{asChild:!0,...a,focusable:!i,active:f,children:l.jsx(GT,{disabled:i,required:o.required,checked:f,...c,...s,name:o.name,ref:d,onCheck:()=>o.onValueChange(s.value),onKeyDown:ue(m=>{m.key==="Enter"&&m.preventDefault()}),onFocus:ue(s.onFocus,()=>{var m;h.current&&((m=u.current)==null||m.click())})})})});nP.displayName=tP;var FW="RadioGroupIndicator",rP=y.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,s=JT(n);return l.jsx(qT,{...s,...r,ref:t})});rP.displayName=FW;var sP=eP,oP=nP,$W=rP;const iP=y.forwardRef(({className:e,...t},n)=>l.jsx(sP,{className:re("grid gap-2",e),...t,ref:n}));iP.displayName=sP.displayName;const ty=y.forwardRef(({className:e,...t},n)=>l.jsx(oP,{ref:n,className:re("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:l.jsx($W,{className:"flex items-center justify-center",children:l.jsx(sk,{className:"h-2.5 w-2.5 fill-current text-current"})})}));ty.displayName=oP.displayName;const UW=()=>{const{t:e}=Ye(),t=le.object({provider:le.enum(["letsencrypt","zerossl"],{message:e("settings.ca.provider.errmsg.empty")}),eabKid:le.string().optional(),eabHmacKey:le.string().optional()}),n=cn({resolver:un(t),defaultValues:{provider:"letsencrypt"}}),[r,s]=y.useState("letsencrypt"),[o,i]=y.useState(),{toast:a}=zr();y.useEffect(()=>{(async()=>{const f=await yx("ssl-provider");if(f){i(f);const h=f.content;n.setValue("provider",h.provider),n.setValue("eabKid",h.config[h.provider].eabKid),n.setValue("eabHmacKey",h.config[h.provider].eabHmacKey),s(h.provider)}else n.setValue("provider","letsencrypt"),s("letsencrypt")})()},[]);const c=d=>r===d?"border-primary":"",u=async d=>{if(d.provider==="zerossl"&&(d.eabKid||n.setError("eabKid",{message:e("settings.ca.eab_kid_hmac_key.errmsg.empty")}),d.eabHmacKey||n.setError("eabHmacKey",{message:e("settings.ca.eab_kid_hmac_key.errmsg.empty")}),!d.eabKid||!d.eabHmacKey))return;const f={id:o==null?void 0:o.id,name:"ssl-provider",content:{provider:d.provider,config:{letsencrypt:{},zerossl:{eabKid:d.eabKid??"",eabHmacKey:d.eabHmacKey??""}}}};try{await il(f),a({title:e("common.update.succeeded.message"),description:e("common.update.succeeded.message")})}catch(h){const m=$s(h);a({title:e("common.update.failed.message"),description:m,variant:"destructive"})}};return l.jsx(l.Fragment,{children:l.jsx("div",{className:"w-full md:max-w-[35em]",children:l.jsx(dn,{...n,children:l.jsxs("form",{onSubmit:n.handleSubmit(u),className:"space-y-8 dark:text-stone-200",children:[l.jsx(ke,{control:n.control,name:"provider",render:({field:d})=>l.jsxs(Se,{children:[l.jsx(Ce,{children:e("common.text.ca")}),l.jsx(je,{children:l.jsxs(iP,{...d,className:"flex",onValueChange:f=>{s(f),n.setValue("provider",f)},value:r,children:[l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx(ty,{value:"letsencrypt",id:"letsencrypt"}),l.jsx(Vt,{htmlFor:"letsencrypt",children:l.jsxs("div",{className:re("flex items-center space-x-2 border p-2 rounded cursor-pointer",c("letsencrypt")),children:[l.jsx("img",{src:"/imgs/providers/letsencrypt.svg",className:"h-6"}),l.jsx("div",{children:"Let's Encrypt"})]})})]}),l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx(ty,{value:"zerossl",id:"zerossl"}),l.jsx(Vt,{htmlFor:"zerossl",children:l.jsxs("div",{className:re("flex items-center space-x-2 border p-2 rounded cursor-pointer",c("zerossl")),children:[l.jsx("img",{src:"/imgs/providers/zerossl.svg",className:"h-6"}),l.jsx("div",{children:"ZeroSSL"})]})})]})]})}),l.jsx(ke,{control:n.control,name:"eabKid",render:({field:f})=>l.jsxs(Se,{hidden:r!=="zerossl",children:[l.jsx(Ce,{children:"EAB_KID"}),l.jsx(je,{children:l.jsx(pe,{placeholder:e("settings.ca.eab_kid.errmsg.empty"),...f,type:"text"})}),l.jsx(ye,{})]})}),l.jsx(ke,{control:n.control,name:"eabHmacKey",render:({field:f})=>l.jsxs(Se,{hidden:r!=="zerossl",children:[l.jsx(Ce,{children:"EAB_HMAC_KEY"}),l.jsx(je,{children:l.jsx(pe,{placeholder:e("settings.ca.eab_hmac_key.errmsg.empty"),...f,type:"text"})}),l.jsx(ye,{})]})}),l.jsx(ye,{})]})}),l.jsx("div",{className:"flex justify-end",children:l.jsx(Me,{type:"submit",children:e("common.update")})})]})})})})},VW=lO([{path:"/",element:l.jsx(P$,{}),children:[{path:"/",element:l.jsx(tW,{})},{path:"/domains",element:l.jsx(QU,{})},{path:"/edit",element:l.jsx(VB,{})},{path:"/access",element:l.jsx(KB,{})},{path:"/history",element:l.jsx(GB,{})},{path:"/setting",element:l.jsx(eW,{}),children:[{path:"/setting/password",element:l.jsx(JB,{})},{path:"/setting/account",element:l.jsx(rW,{})},{path:"/setting/notify",element:l.jsx(PW,{})},{path:"/setting/ssl-provider",element:l.jsx(UW,{})}]}]},{path:"/login",element:l.jsx(XB,{}),children:[{path:"/login",element:l.jsx(qB,{})}]},{path:"/about",element:l.jsx("div",{children:"About"})}]),BW={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};class Lf{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,n)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=t||BW,this.options=n,this.debug=n.debug}log(){for(var t=arguments.length,n=new Array(t),r=0;r{this.observers[r]||(this.observers[r]=new Map);const s=this.observers[r].get(n)||0;this.observers[r].set(n,s+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s{let[a,c]=i;for(let u=0;u{let[a,c]=i;for(let u=0;u{let e,t;const n=new Promise((r,s)=>{e=r,t=s});return n.resolve=e,n.reject=t,n},t1=e=>e==null?"":""+e,WW=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},HW=/###/g,n1=e=>e&&e.indexOf("###")>-1?e.replace(HW,"."):e,r1=e=>!e||typeof e=="string",tc=(e,t,n)=>{const r=typeof t!="string"?t:t.split(".");let s=0;for(;s{const{obj:r,k:s}=tc(e,t,Object);if(r!==void 0||t.length===1){r[s]=n;return}let o=t[t.length-1],i=t.slice(0,t.length-1),a=tc(e,i,Object);for(;a.obj===void 0&&i.length;)o=`${i[i.length-1]}.${o}`,i=i.slice(0,i.length-1),a=tc(e,i,Object),a&&a.obj&&typeof a.obj[`${a.k}.${o}`]<"u"&&(a.obj=void 0);a.obj[`${a.k}.${o}`]=n},YW=(e,t,n,r)=>{const{obj:s,k:o}=tc(e,t,Object);s[o]=s[o]||[],s[o].push(n)},zf=(e,t)=>{const{obj:n,k:r}=tc(e,t);if(n)return n[r]},KW=(e,t,n)=>{const r=zf(e,n);return r!==void 0?r:zf(t,n)},aP=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?typeof e[r]=="string"||e[r]instanceof String||typeof t[r]=="string"||t[r]instanceof String?n&&(e[r]=t[r]):aP(e[r],t[r],n):e[r]=t[r]);return e},Bi=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var GW={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const ZW=e=>typeof e=="string"?e.replace(/[&<>"'\/]/g,t=>GW[t]):e;class qW{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const XW=[" ",",","?","!",";"],QW=new qW(20),JW=(e,t,n)=>{t=t||"",n=n||"";const r=XW.filter(i=>t.indexOf(i)<0&&n.indexOf(i)<0);if(r.length===0)return!0;const s=QW.getRegExp(`(${r.map(i=>i==="?"?"\\?":i).join("|")})`);let o=!s.test(e);if(!o){const i=e.indexOf(n);i>0&&!s.test(e.substring(0,i))&&(o=!0)}return o},ny=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return e[t];const r=t.split(n);let s=e;for(let o=0;o-1&&ce&&e.indexOf("_")>0?e.replace("_","-"):e;class o1 extends um{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,i=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;t.indexOf(".")>-1?a=t.split("."):(a=[t,n],r&&(Array.isArray(r)?a.push(...r):typeof r=="string"&&o?a.push(...r.split(o)):a.push(r)));const c=zf(this.data,a);return!c&&!n&&!r&&t.indexOf(".")>-1&&(t=a[0],n=a[1],r=a.slice(2).join(".")),c||!i||typeof r!="string"?c:ny(this.data&&this.data[t]&&this.data[t][n],r,o)}addResource(t,n,r,s){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const i=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let a=[t,n];r&&(a=a.concat(i?r.split(i):r)),t.indexOf(".")>-1&&(a=t.split("."),s=n,n=a[1]),this.addNamespaces(n),s1(this.data,a,s),o.silent||this.emit("added",t,n,r,s)}addResources(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const o in r)(typeof r[o]=="string"||Array.isArray(r[o]))&&this.addResource(t,n,o,r[o],{silent:!0});s.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,s,o){let i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},a=[t,n];t.indexOf(".")>-1&&(a=t.split("."),s=r,r=n,n=a[1]),this.addNamespaces(n);let c=zf(this.data,a)||{};i.skipCopy||(r=JSON.parse(JSON.stringify(r))),s?aP(c,r,o):c={...c,...r},s1(this.data,a,c),i.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(t,n)}:this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(s=>n[s]&&Object.keys(n[s]).length>0)}toJSON(){return this.data}}var lP={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,s){return e.forEach(o=>{this.processors[o]&&(t=this.processors[o].process(t,n,r,s))}),t}};const i1={};class $f extends um{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),WW(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=qr.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(t==null)return!1;const r=this.resolve(t,n);return r&&r.res!==void 0}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const s=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let o=n.ns||this.options.defaultNS||[];const i=r&&t.indexOf(r)>-1,a=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!JW(t,r,s);if(i&&!a){const c=t.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:t,namespaces:o};const u=t.split(r);(r!==s||r===s&&this.options.ns.indexOf(u[0])>-1)&&(o=u.shift()),t=u.join(s)}return typeof o=="string"&&(o=[o]),{key:t,namespaces:o}}translate(t,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const s=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:i,namespaces:a}=this.extractFromKey(t[t.length-1],n),c=a[a.length-1],u=n.lng||this.language,d=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&u.toLowerCase()==="cimode"){if(d){const _=n.nsSeparator||this.options.nsSeparator;return s?{res:`${c}${_}${i}`,usedKey:i,exactUsedKey:i,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:`${c}${_}${i}`}return s?{res:i,usedKey:i,exactUsedKey:i,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:i}const f=this.resolve(t,n);let h=f&&f.res;const m=f&&f.usedKey||i,x=f&&f.exactUsedKey||i,p=Object.prototype.toString.apply(h),w=["[object Number]","[object Function]","[object RegExp]"],g=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject;if(v&&h&&(typeof h!="string"&&typeof h!="boolean"&&typeof h!="number")&&w.indexOf(p)<0&&!(typeof g=="string"&&Array.isArray(h))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const _=this.options.returnedObjectHandler?this.options.returnedObjectHandler(m,h,{...n,ns:a}):`key '${i} (${this.language})' returned an object instead of string.`;return s?(f.res=_,f.usedParams=this.getUsedParamsDetails(n),f):_}if(o){const _=Array.isArray(h),C=_?[]:{},j=_?x:m;for(const T in h)if(Object.prototype.hasOwnProperty.call(h,T)){const R=`${j}${o}${T}`;C[T]=this.translate(R,{...n,joinArrays:!1,ns:a}),C[T]===R&&(C[T]=h[T])}h=C}}else if(v&&typeof g=="string"&&Array.isArray(h))h=h.join(g),h&&(h=this.extendTranslation(h,t,n,r));else{let _=!1,C=!1;const j=n.count!==void 0&&typeof n.count!="string",T=$f.hasDefaultValue(n),R=j?this.pluralResolver.getSuffix(u,n.count,n):"",A=n.ordinal&&j?this.pluralResolver.getSuffix(u,n.count,{ordinal:!1}):"",O=j&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),G=O&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${R}`]||n[`defaultValue${A}`]||n.defaultValue;!this.isValidLookup(h)&&T&&(_=!0,h=G),this.isValidLookup(h)||(C=!0,h=i);const z=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&C?void 0:h,S=T&&G!==h&&this.options.updateMissing;if(C||_||S){if(this.logger.log(S?"updateKey":"missingKey",u,c,i,S?G:h),o){const W=this.resolve(i,{...n,keySeparator:!1});W&&W.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let U=[];const J=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&J&&J[0])for(let W=0;W{const $=T&&X!==h?X:z;this.options.missingKeyHandler?this.options.missingKeyHandler(W,c,I,$,S,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(W,c,I,$,S,n),this.emit("missingKey",W,c,I,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&j?U.forEach(W=>{const I=this.pluralResolver.getSuffixes(W,n);O&&n[`defaultValue${this.options.pluralSeparator}zero`]&&I.indexOf(`${this.options.pluralSeparator}zero`)<0&&I.push(`${this.options.pluralSeparator}zero`),I.forEach(X=>{F([W],i+X,n[`defaultValue${X}`]||G)})}):F(U,i,G))}h=this.extendTranslation(h,t,n,f,r),C&&h===i&&this.options.appendNamespaceToMissingKey&&(h=`${c}:${i}`),(C||_)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?h=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}:${i}`:i,_?h:void 0):h=this.options.parseMissingKeyHandler(h))}return s?(f.res=h,f.usedParams=this.getUsedParamsDetails(n),f):h}extendTranslation(t,n,r,s,o){var i=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const u=typeof t=="string"&&(r&&r.interpolation&&r.interpolation.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let d;if(u){const h=t.match(this.interpolator.nestingRegexp);d=h&&h.length}let f=r.replace&&typeof r.replace!="string"?r.replace:r;if(this.options.interpolation.defaultVariables&&(f={...this.options.interpolation.defaultVariables,...f}),t=this.interpolator.interpolate(t,f,r.lng||this.language||s.usedLng,r),u){const h=t.match(this.interpolator.nestingRegexp),m=h&&h.length;d1&&arguments[1]!==void 0?arguments[1]:{},r,s,o,i,a;return typeof t=="string"&&(t=[t]),t.forEach(c=>{if(this.isValidLookup(r))return;const u=this.extractFromKey(c,n),d=u.key;s=d;let f=u.namespaces;this.options.fallbackNS&&(f=f.concat(this.options.fallbackNS));const h=n.count!==void 0&&typeof n.count!="string",m=h&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),x=n.context!==void 0&&(typeof n.context=="string"||typeof n.context=="number")&&n.context!=="",p=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);f.forEach(w=>{this.isValidLookup(r)||(a=w,!i1[`${p[0]}-${w}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(a)&&(i1[`${p[0]}-${w}`]=!0,this.logger.warn(`key "${s}" for languages "${p.join(", ")}" won't get resolved as namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach(g=>{if(this.isValidLookup(r))return;i=g;const v=[d];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(v,d,g,w,n);else{let _;h&&(_=this.pluralResolver.getSuffix(g,n.count,n));const C=`${this.options.pluralSeparator}zero`,j=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(h&&(v.push(d+_),n.ordinal&&_.indexOf(j)===0&&v.push(d+_.replace(j,this.options.pluralSeparator)),m&&v.push(d+C)),x){const T=`${d}${this.options.contextSeparator}${n.context}`;v.push(T),h&&(v.push(T+_),n.ordinal&&_.indexOf(j)===0&&v.push(T+_.replace(j,this.options.pluralSeparator)),m&&v.push(T+C))}}let b;for(;b=v.pop();)this.isValidLookup(r)||(o=b,r=this.getResource(g,w,b,n))}))})}),{res:r,usedKey:s,exactUsedKey:o,usedLng:i,usedNS:a}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,n,r,s):this.resourceStore.getResource(t,n,r,s)}getUsedParamsDetails(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&typeof t.replace!="string";let s=r?t.replace:t;if(r&&typeof t.count<"u"&&(s.count=t.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!r){s={...s};for(const o of n)delete s[o]}return s}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}const pp=e=>e.charAt(0).toUpperCase()+e.slice(1);class a1{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=qr.create("languageUtils")}getScriptPartFromCode(t){if(t=Ff(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=Ff(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(typeof t=="string"&&t.indexOf("-")>-1){const n=["hans","hant","latn","cyrl","cans","mong","arab"];let r=t.split("-");return this.options.lowerCaseLng?r=r.map(s=>s.toLowerCase()):r.length===2?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=pp(r[1].toLowerCase()))):r.length===3&&(r[0]=r[0].toLowerCase(),r[1].length===2&&(r[1]=r[1].toUpperCase()),r[0]!=="sgn"&&r[2].length===2&&(r[2]=r[2].toUpperCase()),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=pp(r[1].toLowerCase())),n.indexOf(r[2].toLowerCase())>-1&&(r[2]=pp(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const s=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(s))&&(n=s)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const s=this.getLanguagePartFromCode(r);if(this.isSupportedCode(s))return n=s;n=this.options.supportedLngs.find(o=>{if(o===s)return o;if(!(o.indexOf("-")<0&&s.indexOf("-")<0)&&(o.indexOf("-")>0&&s.indexOf("-")<0&&o.substring(0,o.indexOf("-"))===s||o.indexOf(s)===0&&s.length>1))return o})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),typeof t=="string"&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],t),s=[],o=i=>{i&&(this.isSupportedCode(i)?s.push(i):this.logger.warn(`rejecting language code not found in supportedLngs: ${i}`))};return typeof t=="string"&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(t))):typeof t=="string"&&o(this.formatLanguageCode(t)),r.forEach(i=>{s.indexOf(i)<0&&o(this.formatLanguageCode(i))}),s}}let eH=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],tH={1:e=>+(e>1),2:e=>+(e!=1),3:e=>0,4:e=>e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2,5:e=>e==0?0:e==1?1:e==2?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5,6:e=>e==1?0:e>=2&&e<=4?1:2,7:e=>e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2,8:e=>e==1?0:e==2?1:e!=8&&e!=11?2:3,9:e=>+(e>=2),10:e=>e==1?0:e==2?1:e<7?2:e<11?3:4,11:e=>e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3,12:e=>+(e%10!=1||e%100==11),13:e=>+(e!==0),14:e=>e==1?0:e==2?1:e==3?2:3,15:e=>e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2,16:e=>e%10==1&&e%100!=11?0:e!==0?1:2,17:e=>e==1||e%10==1&&e%100!=11?0:1,18:e=>e==0?0:e==1?1:2,19:e=>e==1?0:e==0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3,20:e=>e==1?0:e==0||e%100>0&&e%100<20?1:2,21:e=>e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0,22:e=>e==1?0:e==2?1:(e<0||e>10)&&e%10==0?2:3};const nH=["v1","v2","v3"],rH=["v4"],l1={zero:0,one:1,two:2,few:3,many:4,other:5},sH=()=>{const e={};return eH.forEach(t=>{t.lngs.forEach(n=>{e[n]={numbers:t.nr,plurals:tH[t.fc]}})}),e};class oH{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=n,this.logger=qr.create("pluralResolver"),(!this.options.compatibilityJSON||rH.includes(this.options.compatibilityJSON))&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=sH(),this.pluralRulesCache={}}addRule(t,n){this.rules[t]=n}clearCache(){this.pluralRulesCache={}}getRule(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{const r=Ff(t==="dev"?"en":t),s=n.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:r,type:s});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];const i=new Intl.PluralRules(r,{type:s});return this.pluralRulesCache[o]=i,i}catch{return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}needsPlural(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return this.shouldUseIntlApi()?r&&r.resolvedOptions().pluralCategories.length>1:r&&r.numbers.length>1}getPluralFormsOfKey(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,r).map(s=>`${n}${s}`)}getSuffixes(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((s,o)=>l1[s]-l1[o]).map(s=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${s}`):r.numbers.map(s=>this.getSuffix(t,s,n)):[]}getSuffix(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const s=this.getRule(t,r);return s?this.shouldUseIntlApi()?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${s.select(n)}`:this.getSuffixRetroCompatible(s,n):(this.logger.warn(`no plural rule found for: ${t}`),"")}getSuffixRetroCompatible(t,n){const r=t.noAbs?t.plurals(n):t.plurals(Math.abs(n));let s=t.numbers[r];this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1&&(s===2?s="plural":s===1&&(s=""));const o=()=>this.options.prepend&&s.toString()?this.options.prepend+s.toString():s.toString();return this.options.compatibilityJSON==="v1"?s===1?"":typeof s=="number"?`_plural_${s.toString()}`:o():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1?o():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}shouldUseIntlApi(){return!nH.includes(this.options.compatibilityJSON)}}const c1=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=KW(e,t,n);return!o&&s&&typeof n=="string"&&(o=ny(e,n,r),o===void 0&&(o=ny(t,n,r))),o},gp=e=>e.replace(/\$/g,"$$$$");class iH{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=qr.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||(n=>n),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:s,prefix:o,prefixEscaped:i,suffix:a,suffixEscaped:c,formatSeparator:u,unescapeSuffix:d,unescapePrefix:f,nestingPrefix:h,nestingPrefixEscaped:m,nestingSuffix:x,nestingSuffixEscaped:p,nestingOptionsSeparator:w,maxReplaces:g,alwaysFormat:v}=t.interpolation;this.escape=n!==void 0?n:ZW,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=o?Bi(o):i||"{{",this.suffix=a?Bi(a):c||"}}",this.formatSeparator=u||",",this.unescapePrefix=d?"":f||"-",this.unescapeSuffix=this.unescapePrefix?"":d||"",this.nestingPrefix=h?Bi(h):m||Bi("$t("),this.nestingSuffix=x?Bi(x):p||Bi(")"),this.nestingOptionsSeparator=w||",",this.maxReplaces=g||1e3,this.alwaysFormat=v!==void 0?v:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>n&&n.source===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(t,n,r,s){let o,i,a;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=m=>{if(m.indexOf(this.formatSeparator)<0){const g=c1(n,c,m,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(g,void 0,r,{...s,...n,interpolationkey:m}):g}const x=m.split(this.formatSeparator),p=x.shift().trim(),w=x.join(this.formatSeparator).trim();return this.format(c1(n,c,p,this.options.keySeparator,this.options.ignoreJSONStructure),w,r,{...s,...n,interpolationkey:p})};this.resetRegExp();const d=s&&s.missingInterpolationHandler||this.options.missingInterpolationHandler,f=s&&s.interpolation&&s.interpolation.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:m=>gp(m)},{regex:this.regexp,safeValue:m=>this.escapeValue?gp(this.escape(m)):gp(m)}].forEach(m=>{for(a=0;o=m.regex.exec(t);){const x=o[1].trim();if(i=u(x),i===void 0)if(typeof d=="function"){const w=d(t,o,s);i=typeof w=="string"?w:""}else if(s&&Object.prototype.hasOwnProperty.call(s,x))i="";else if(f){i=o[0];continue}else this.logger.warn(`missed to pass in variable ${x} for interpolating ${t}`),i="";else typeof i!="string"&&!this.useRawValueToEscape&&(i=t1(i));const p=m.safeValue(i);if(t=t.replace(o[0],p),f?(m.regex.lastIndex+=i.length,m.regex.lastIndex-=o[0].length):m.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),t}nest(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,o,i;const a=(c,u)=>{const d=this.nestingOptionsSeparator;if(c.indexOf(d)<0)return c;const f=c.split(new RegExp(`${d}[ ]*{`));let h=`{${f[1]}`;c=f[0],h=this.interpolate(h,i);const m=h.match(/'/g),x=h.match(/"/g);(m&&m.length%2===0&&!x||x.length%2!==0)&&(h=h.replace(/'/g,'"'));try{i=JSON.parse(h),u&&(i={...u,...i})}catch(p){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,p),`${c}${d}${h}`}return i.defaultValue&&i.defaultValue.indexOf(this.prefix)>-1&&delete i.defaultValue,c};for(;s=this.nestingRegexp.exec(t);){let c=[];i={...r},i=i.replace&&typeof i.replace!="string"?i.replace:i,i.applyPostProcessor=!1,delete i.defaultValue;let u=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){const d=s[1].split(this.formatSeparator).map(f=>f.trim());s[1]=d.shift(),c=d,u=!0}if(o=n(a.call(this,s[1].trim(),i),i),o&&s[0]===t&&typeof o!="string")return o;typeof o!="string"&&(o=t1(o)),o||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${t}`),o=""),u&&(o=c.reduce((d,f)=>this.format(d,f,r.lng,{...r,interpolationkey:s[1].trim()}),o.trim())),t=t.replace(s[0],o),this.regexp.lastIndex=0}return t}}const aH=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const s=r[1].substring(0,r[1].length-1);t==="currency"&&s.indexOf(":")<0?n.currency||(n.currency=s.trim()):t==="relativetime"&&s.indexOf(":")<0?n.range||(n.range=s.trim()):s.split(";").forEach(i=>{if(i){const[a,...c]=i.split(":"),u=c.join(":").trim().replace(/^'+|'+$/g,""),d=a.trim();n[d]||(n[d]=u),u==="false"&&(n[d]=!1),u==="true"&&(n[d]=!0),isNaN(u)||(n[d]=parseInt(u,10))}})}return{formatName:t,formatOptions:n}},Wi=e=>{const t={};return(n,r,s)=>{let o=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(o={...o,[s.interpolationkey]:void 0});const i=r+JSON.stringify(o);let a=t[i];return a||(a=e(Ff(r),s),t[i]=a),a(n)}};class lH{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=qr.create("formatter"),this.options=t,this.formats={number:Wi((n,r)=>{const s=new Intl.NumberFormat(n,{...r});return o=>s.format(o)}),currency:Wi((n,r)=>{const s=new Intl.NumberFormat(n,{...r,style:"currency"});return o=>s.format(o)}),datetime:Wi((n,r)=>{const s=new Intl.DateTimeFormat(n,{...r});return o=>s.format(o)}),relativetime:Wi((n,r)=>{const s=new Intl.RelativeTimeFormat(n,{...r});return o=>s.format(o,r.range||"day")}),list:Wi((n,r)=>{const s=new Intl.ListFormat(n,{...r});return o=>s.format(o)})},this.init(t)}init(t){const r=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||","}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=Wi(n)}format(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=n.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(a=>a.indexOf(")")>-1)){const a=o.findIndex(c=>c.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,a)].join(this.formatSeparator)}return o.reduce((a,c)=>{const{formatName:u,formatOptions:d}=aH(c);if(this.formats[u]){let f=a;try{const h=s&&s.formatParams&&s.formatParams[s.interpolationkey]||{},m=h.locale||h.lng||s.locale||s.lng||r;f=this.formats[u](a,m,{...d,...s,...h})}catch(h){this.logger.warn(h)}return f}else this.logger.warn(`there was no format function for ${u}`);return a},t)}}const cH=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class uH extends um{constructor(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=s,this.logger=qr.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(r,s.backend,s)}queueLoad(t,n,r,s){const o={},i={},a={},c={};return t.forEach(u=>{let d=!0;n.forEach(f=>{const h=`${u}|${f}`;!r.reload&&this.store.hasResourceBundle(u,f)?this.state[h]=2:this.state[h]<0||(this.state[h]===1?i[h]===void 0&&(i[h]=!0):(this.state[h]=1,d=!1,i[h]===void 0&&(i[h]=!0),o[h]===void 0&&(o[h]=!0),c[f]===void 0&&(c[f]=!0)))}),d||(a[u]=!0)}),(Object.keys(o).length||Object.keys(i).length)&&this.queue.push({pending:i,pendingCount:Object.keys(i).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(o),pending:Object.keys(i),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(c)}}loaded(t,n,r){const s=t.split("|"),o=s[0],i=s[1];n&&this.emit("failedLoading",o,i,n),!n&&r&&this.store.addResourceBundle(o,i,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const a={};this.queue.forEach(c=>{YW(c.loaded,[o],i),cH(c,t),n&&c.errors.push(n),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(u=>{a[u]||(a[u]={});const d=c.loaded[u];d.length&&d.forEach(f=>{a[u][f]===void 0&&(a[u][f]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(c=>!c.done)}read(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,i=arguments.length>5?arguments[5]:void 0;if(!t.length)return i(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:s,wait:o,callback:i});return}this.readingCalls++;const a=(u,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const f=this.waitingReads.shift();this.read(f.lng,f.ns,f.fcName,f.tried,f.wait,f.callback)}if(u&&d&&s{this.read.call(this,t,n,r,s+1,o*2,i)},o);return}i(u,d)},c=this.backend[r].bind(this.backend);if(c.length===2){try{const u=c(t,n);u&&typeof u.then=="function"?u.then(d=>a(null,d)).catch(a):a(null,u)}catch(u){a(u)}return}return c(t,n,a)}prepareLoading(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();typeof t=="string"&&(t=this.languageUtils.toResolveHierarchy(t)),typeof n=="string"&&(n=[n]);const o=this.queueLoad(t,n,r,s);if(!o.toLoad.length)return o.pending.length||s(),null;o.toLoad.forEach(i=>{this.loadOne(i)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=t.split("|"),s=r[0],o=r[1];this.read(s,o,"read",void 0,void 0,(i,a)=>{i&&this.logger.warn(`${n}loading namespace ${o} for language ${s} failed`,i),!i&&a&&this.logger.log(`${n}loaded namespace ${o} for language ${s}`,a),this.loaded(t,i,a)})}saveMissing(t,n,r,s,o){let i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend&&this.backend.create){const c={...i,isUpdate:o},u=this.backend.create.bind(this.backend);if(u.length<6)try{let d;u.length===5?d=u(t,n,r,s,c):d=u(t,n,r,s),d&&typeof d.then=="function"?d.then(f=>a(null,f)).catch(a):a(null,d)}catch(d){a(d)}else u(t,n,r,s,a,c)}!t||!t[0]||this.store.addResource(t[0],n,r,s)}}}const u1=()=>({debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),typeof e[1]=="string"&&(t.defaultValue=e[1]),typeof e[2]=="string"&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),d1=e=>(typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),rd=()=>{},dH=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class Kc extends um{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=d1(t),this.services={},this.logger=qr,this.modules={external:[]},dH(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initImmediate)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(){var t=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof n=="function"&&(r=n,n={}),!n.defaultNS&&n.defaultNS!==!1&&n.ns&&(typeof n.ns=="string"?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const s=u1();this.options={...s,...this.options,...d1(n)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...s.interpolation,...this.options.interpolation}),n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);const o=d=>d?typeof d=="function"?new d:d:null;if(!this.options.isClone){this.modules.logger?qr.init(o(this.modules.logger),this.options):qr.init(null,this.options);let d;this.modules.formatter?d=this.modules.formatter:typeof Intl<"u"&&(d=lH);const f=new a1(this.options);this.store=new o1(this.options.resources,this.options);const h=this.services;h.logger=qr,h.resourceStore=this.store,h.languageUtils=f,h.pluralResolver=new oH(f,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),d&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(h.formatter=o(d),h.formatter.init(h,this.options),this.options.interpolation.format=h.formatter.format.bind(h.formatter)),h.interpolator=new iH(this.options),h.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},h.backendConnector=new uH(o(this.modules.backend),h.resourceStore,h,this.options),h.backendConnector.on("*",function(m){for(var x=arguments.length,p=new Array(x>1?x-1:0),w=1;w1?x-1:0),w=1;w{m.init&&m.init(this)})}if(this.format=this.options.interpolation.format,r||(r=rd),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const d=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);d.length>0&&d[0]!=="dev"&&(this.options.lng=d[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(d=>{this[d]=function(){return t.store[d](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(d=>{this[d]=function(){return t.store[d](...arguments),t}});const c=El(),u=()=>{const d=(f,h)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),c.resolve(h),r(f,h)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return d(null,this.t.bind(this));this.changeLanguage(this.options.lng,d)};return this.options.resources||!this.options.initImmediate?u():setTimeout(u,0),c}loadResources(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:rd;const s=typeof t=="string"?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(s&&s.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const o=[],i=a=>{if(!a||a==="cimode")return;this.services.languageUtils.toResolveHierarchy(a).forEach(u=>{u!=="cimode"&&o.indexOf(u)<0&&o.push(u)})};s?i(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(c=>i(c)),this.options.preload&&this.options.preload.forEach(a=>i(a)),this.services.backendConnector.load(o,this.options.ns,a=>{!a&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(a)})}else r(null)}reloadResources(t,n,r){const s=El();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=rd),this.services.backendConnector.reload(t,n,o=>{s.resolve(),r(o)}),s}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&lP.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1))for(let n=0;n-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(t,n){var r=this;this.isLanguageChangingTo=t;const s=El();this.emit("languageChanging",t);const o=c=>{this.language=c,this.languages=this.services.languageUtils.toResolveHierarchy(c),this.resolvedLanguage=void 0,this.setResolvedLanguage(c)},i=(c,u)=>{u?(o(u),this.translator.changeLanguage(u),this.isLanguageChangingTo=void 0,this.emit("languageChanged",u),this.logger.log("languageChanged",u)):this.isLanguageChangingTo=void 0,s.resolve(function(){return r.t(...arguments)}),n&&n(c,function(){return r.t(...arguments)})},a=c=>{!t&&!c&&this.services.languageDetector&&(c=[]);const u=typeof c=="string"?c:this.services.languageUtils.getBestMatchFromCodes(c);u&&(this.language||o(u),this.translator.language||this.translator.changeLanguage(u),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(u)),this.loadResources(u,d=>{i(d,u)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(t),s}getFixedT(t,n,r){var s=this;const o=function(i,a){let c;if(typeof a!="object"){for(var u=arguments.length,d=new Array(u>2?u-2:0),f=2;f`${c.keyPrefix}${h}${x}`):m=c.keyPrefix?`${c.keyPrefix}${h}${i}`:i,s.t(m,c)};return typeof t=="string"?o.lng=t:o.lngs=t,o.ns=n,o.keyPrefix=r,o}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const i=(a,c)=>{const u=this.services.backendConnector.state[`${a}|${c}`];return u===-1||u===0||u===2};if(n.precheck){const a=n.precheck(this,i);if(a!==void 0)return a}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||i(r,t)&&(!s||i(o,t)))}loadNamespaces(t,n){const r=El();return this.options.ns?(typeof t=="string"&&(t=[t]),t.forEach(s=>{this.options.ns.indexOf(s)<0&&this.options.ns.push(s)}),this.loadResources(s=>{r.resolve(),n&&n(s)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=El();typeof t=="string"&&(t=[t]);const s=this.options.preload||[],o=t.filter(i=>s.indexOf(i)<0&&this.services.languageUtils.isSupportedCode(i));return o.length?(this.options.preload=s.concat(o),this.loadResources(i=>{r.resolve(),n&&n(i)}),r):(n&&n(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!t)return"rtl";const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=this.services&&this.services.languageUtils||new a1(u1());return n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new Kc(t,n)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:rd;const r=t.forkResourceStore;r&&delete t.forkResourceStore;const s={...this.options,...t,isClone:!0},o=new Kc(s);return(t.debug!==void 0||t.prefix!==void 0)&&(o.logger=o.logger.clone(t)),["store","services","language"].forEach(a=>{o[a]=this[a]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},r&&(o.store=new o1(this.store.data,s),o.services.resourceStore=o.store),o.translator=new $f(o.services,s),o.translator.on("*",function(a){for(var c=arguments.length,u=new Array(c>1?c-1:0),d=1;d{if(t)for(const n in t)e[n]===void 0&&(e[n]=t[n])}),e}const f1=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,pH=(e,t,n)=>{const r=n||{};r.path=r.path||"/";const s=encodeURIComponent(t);let o=`${e}=${s}`;if(r.maxAge>0){const i=r.maxAge-0;if(Number.isNaN(i))throw new Error("maxAge should be a Number");o+=`; Max-Age=${Math.floor(i)}`}if(r.domain){if(!f1.test(r.domain))throw new TypeError("option domain is invalid");o+=`; Domain=${r.domain}`}if(r.path){if(!f1.test(r.path))throw new TypeError("option path is invalid");o+=`; Path=${r.path}`}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");o+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(o+="; HttpOnly"),r.secure&&(o+="; Secure"),r.sameSite)switch(typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return o},h1={create(e,t,n,r){let s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(s.expires=new Date,s.expires.setTime(s.expires.getTime()+n*60*1e3)),r&&(s.domain=r),document.cookie=pH(e,encodeURIComponent(t),s)},read(e){const t=`${e}=`,n=document.cookie.split(";");for(let r=0;r-1&&(s=window.location.hash.substring(window.location.hash.indexOf("?")));const i=s.substring(1).split("&");for(let a=0;a0&&i[a].substring(0,c)===t&&(n=i[a].substring(c+1))}}return n}};let Nl=null;const m1=()=>{if(Nl!==null)return Nl;try{Nl=window!=="undefined"&&window.localStorage!==null;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch{Nl=!1}return Nl};var vH={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&m1())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:n}=t;n&&m1()&&window.localStorage.setItem(n,e)}};let Tl=null;const p1=()=>{if(Tl!==null)return Tl;try{Tl=window!=="undefined"&&window.sessionStorage!==null;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch{Tl=!1}return Tl};var xH={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&p1())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:n}=t;n&&p1()&&window.sessionStorage.setItem(n,e)}},wH={name:"navigator",lookup(e){const t=[];if(typeof navigator<"u"){const{languages:n,userLanguage:r,language:s}=navigator;if(n)for(let o=0;o0?t:void 0}},bH={name:"htmlTag",lookup(e){let{htmlTag:t}=e,n;const r=t||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},_H={name:"path",lookup(e){var s;let{lookupFromPathIndex:t}=e;if(typeof window>"u")return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(n)?(s=n[typeof t=="number"?t:0])==null?void 0:s.replace("/",""):void 0}},SH={name:"subdomain",lookup(e){var s,o;let{lookupFromSubdomainIndex:t}=e;const n=typeof t=="number"?t+1:1,r=typeof window<"u"&&((o=(s=window.location)==null?void 0:s.hostname)==null?void 0:o.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(r)return r[n]}};function kH(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e}}class cP{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(t,n)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=t||{languageUtils:{}},this.options=mH(n,this.options||{},kH()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=s=>s.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(gH),this.addDetector(yH),this.addDetector(vH),this.addDetector(xH),this.addDetector(wH),this.addDetector(bH),this.addDetector(_H),this.addDetector(SH)}addDetector(t){return this.detectors[t.name]=t,this}detect(t){t||(t=this.options.order);let n=[];return t.forEach(r=>{if(this.detectors[r]){let s=this.detectors[r].lookup(this.options);s&&typeof s=="string"&&(s=[s]),s&&(n=n.concat(s))}}),n=n.map(r=>this.options.convertDetectedLanguage(r)),this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}cacheUserLanguage(t,n){n||(n=this.options.caches),n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(t)>-1||n.forEach(r=>{this.detectors[r]&&this.detectors[r].cacheUserLanguage(t,this.options)}))}}cP.type="languageDetector";const CH={"common.add":"新增","common.save":"保存","common.save.succeeded.message":"保存成功","common.save.failed.message":"保存失败","common.edit":"编辑","common.copy":"复制","common.download":"下载","common.delete":"刪除","common.delete.succeeded.message":"删除成功","common.delete.failed.message":"删除失败","common.next":"下一步","common.confirm":"确认","common.cancel":"取消","common.submit":"提交","common.update":"更新","common.update.succeeded.message":"修改成功","common.update.failed.message":"修改失败","common.text.domain":"域名","common.text.domain.empty":"无域名","common.text.ip":"IP 地址","common.text.ip.empty":"无 IP 地址","common.text.dns":"DNS(域名服务器)","common.text.dns.empty":"无 DNS 地址","common.text.ca":"CA(证书颁发机构)","common.text.name":"名称","common.text.provider":"服务商","common.text.created_at":"创建时间","common.text.updated_at":"更新时间","common.text.operations":"操作","common.text.nodata":"暂无数据","common.menu.settings":"系统设置","common.menu.logout":"退出登录","common.menu.document":"文档","common.pagination.next":"下一页","common.pagination.prev":"上一页","common.pagination.more":"更多","common.theme.light":"浅色","common.theme.dark":"暗黑","common.theme.system":"跟随系统","common.errmsg.string_max":"请输入不超过 {{max}} 个字符","common.errmsg.email_empty":"请输入邮箱","common.errmsg.email_invalid":"请输入正确的邮箱","common.errmsg.email_duplicate":"邮箱已存在","common.errmsg.domain_invalid":"请输入正确的域名","common.errmsg.host_invalid":"请输入正确的域名或 IP 地址","common.errmsg.ip_invalid":"请输入正确的 IP 地址","common.errmsg.url_invalid":"请输入正确的 URL","common.provider.tencent":"腾讯云","common.provider.tencent.cdn":"腾讯云 - CDN","common.provider.aliyun":"阿里云","common.provider.aliyun.oss":"阿里云 - OSS","common.provider.aliyun.cdn":"阿里云 - CDN","common.provider.aliyun.dcdn":"阿里云 - DCDN","common.provider.huaweicloud":"华为云","common.provider.qiniu":"七牛云","common.provider.qiniu.cdn":"七牛云 - CDN","common.provider.cloudflare":"Cloudflare","common.provider.namesilo":"Namesilo","common.provider.godaddy":"GoDaddy","common.provider.local":"本地部署","common.provider.ssh":"SSH 部署","common.provider.webhook":"Webhook","common.provider.dingtalk":"钉钉","common.provider.telegram":"Telegram"},jH={"login.username.label":"用户名","login.username.placeholder":"请输入用户名/邮箱","login.username.errmsg.invalid":"请输入正确的用户名/邮箱","login.password.label":"密码","login.password.placeholder":"请输入密码","login.password.errmsg.invalid":"密码至少 10 个字符","login.submit":"登录"},EH={"dashboard.page.title":"仪表盘","dashboard.statistics.all":"所有","dashboard.statistics.near_expired":"即将过期","dashboard.statistics.enabled":"启用中","dashboard.statistics.disabled":"未启用","dashboard.statistics.unit":"个","dashboard.history":"部署历史"},NH={"settings.page.title":"系统设置","settings.account.relogin.message":"请重新登录","settings.account.tab":"账号","settings.account.email.label":"登录邮箱","settings.account.email.errmsg.invalid":"请输入正确的邮箱地址","settings.account.email.placeholder":"请输入邮箱","settings.account.email.changed.message":"修改账户邮箱成功","settings.account.email.failed.message":"修改账户邮箱失败","settings.password.tab":"密码","settings.password.password.errmsg.length":"密码至少10个字符","settings.password.password.errmsg.not_matched":"两次密码不一致","settings.password.current_password.label":"当前密码","settings.password.current_password.placeholder":"请输入旧密码","settings.password.new_password.label":"新密码","settings.password.new_password.placeholder":"请输入新密码","settings.password.confirm_password.label":"确认密码","settings.password.confirm_password.placeholder":"请再次输入新密码","settings.password.changed.message":"修改密码成功","settings.password.failed.message":"修改密码失败","settings.notification.tab":"消息推送","settings.notification.template.label":"内容模板","settings.notification.template.saved.message":"通知模板保存成功","settings.notification.template.variables.tips.title":"可选的变量({COUNT}: 即将过期张数)","settings.notification.template.variables.tips.content":"可选的变量({COUNT}: 即将过期张数;{DOMAINS}: 域名列表)","settings.notification.config.enable":"是否启用","settings.notification.config.saved.message":"配置保存成功","settings.notification.config.failed.message":"配置保存失败","settings.notification.dingtalk.secret.placeholder":"加签的签名","settings.notification.url.errmsg.invalid":"URL 格式不正确","settings.ca.tab":"证书颁发机构(CA)","settings.ca.provider.errmsg.empty":"请选择证书分发机构","settings.ca.eab_kid.errmsg.empty":"请输入EAB_KID","settings.ca.eab_hmac_key.errmsg.empty":"请输入EAB_HMAC_KEY","settings.ca.eab_kid_hmac_key.errmsg.empty":"请输入EAB_KID和EAB_HMAC_KEY"},TH={"domain.page.title":"域名列表","domain.nodata":"请添加域名开始部署证书吧。","domain.add":"新增域名","domain.edit":"编辑域名","domain.delete":"删除域名","domain.delete.confirm":"确定要删除域名吗?","domain.history":"部署历史","domain.deploy":"立即部署","domain.deploy.started.message":"开始部署","domain.deploy.started.tips":"已发起部署,请稍后查看部署日志。","domain.deploy.failed.message":"执行失败","domain.deploy.failed.tips":"执行失败,请在 <1>部署历史 查看详情。","domain.deploy_forced":"强行部署","domain.props.expiry":"有效期限","domain.props.expiry.date1":"有效期 {{date}} 天","domain.props.expiry.date2":"{{date}} 到期","domain.props.last_execution_status":"最近执行状态","domain.props.last_execution_stage":"最近执行阶段","domain.props.last_execution_time":"最近执行时间","domain.props.enable":"是否启用","domain.props.enable.enabled":"启用","domain.props.enable.disabled":"禁用","domain.application.tab":"申请配置","domain.application.form.domain.added.message":"域名添加成功","domain.application.form.domain.changed.message":"域名编辑成功","domain.application.form.email.label":"邮箱","domain.application.form.email.tips":"(申请证书需要提供邮箱)","domain.application.form.email.add":"添加邮箱","domain.application.form.email.list":"邮箱列表","domain.application.form.email.errmsg.empty":"请选择邮箱","domain.application.form.access.label":"DNS 服务商授权配置","domain.application.form.access.placeholder":"请选择 DNS 服务商授权配置","domain.application.form.access.errmsg.empty":"请选择 DNS 服务商授权配置","domain.application.form.access.list":"已有的 DNS 服务商授权配置","domain.application.form.timeout.label":"超时时间","domain.application.form.timeoue.placeholder":"超时时间(单位:秒)","domain.application.unsaved.message":"请先保存申请配置","domain.deployment.tab":"部署配置","domain.deployment.nodata":"暂无部署配置,请添加后开始部署证书吧","domain.deployment.form.type.label":"部署方式","domain.deployment.form.type.placeholder":"请选择部署方式","domain.deployment.form.type.list":"支持的部署方式","domain.deployment.form.access.label":"授权配置","domain.deployment.form.access.placeholder":"请选择授权配置","domain.deployment.form.access.list":"已有的服务商授权配置","domain.deployment.form.cdn_domain.label":"部署到域名","domain.deployment.form.cdn_domain.placeholder":"请输入 CDN 域名","domain.deployment.form.oss_endpoint.label":"Endpoint","domain.deployment.form.oss_bucket":"存储桶","domain.deployment.form.oss_bucket.placeholder":"请输入存储桶名","domain.deployment.form.variables.label":"变量","domain.deployment.form.variables.key":"变量名","domain.deployment.form.variables.value":"值","domain.deployment.form.variables.empty":"尚未添加变量","domain.deployment.form.variables.key.required":"变量名不能为空","domain.deployment.form.variables.value.required":"变量值不能为空","domain.deployment.form.variables.key.placeholder":"请输入变量名","domain.deployment.form.variables.value.placeholder":"请输入变量值"},PH={"access.page.title":"授权管理","access.authorization.tab":"授权","access.authorization.nodata":"请添加授权开始部署证书吧。","access.authorization.add":"新增授权","access.authorization.edit":"编辑授权","access.authorization.copy":"复制授权","access.authorization.delete":"删除授权","access.authorization.delete.confirm":"确定要删除授权吗?","access.authorization.form.type.label":"服务商","access.authorization.form.type.placeholder":"请选择服务商","access.authorization.form.type.list":"服务商列表","access.authorization.form.name.label":"名称","access.authorization.form.name.placeholder":"请输入授权名称","access.authorization.form.config.label":"配置类型","access.authorization.form.region.label":"Region","access.authorization.form.region.placeholder":"请输入区域","access.authorization.form.access_key_id.label":"AccessKeyId","access.authorization.form.access_key_id.placeholder":"请输入 AccessKeyId","access.authorization.form.access_key_secret.label":"AccessKeySecret","access.authorization.form.access_key_secret.placeholder":"请输入 AccessKeySecret","access.authorization.form.access_key.label":"AccessKey","access.authorization.form.access_key.placeholder":"请输入 AccessKey","access.authorization.form.secret_id.label":"SecretId","access.authorization.form.secret_id.placeholder":"请输入 SecretId","access.authorization.form.secret_key.label":"SecretKey","access.authorization.form.secret_key.placeholder":"请输入 SecretKey","access.authorization.form.cloud_dns_api_token.label":"CLOUD_DNS_API_TOKEN","access.authorization.form.cloud_dns_api_token.placeholder":"请输入 CLOUD_DNS_API_TOKEN","access.authorization.form.godaddy_api_key.label":"GO_DADDY_API_KEY","access.authorization.form.godaddy_api_key.placeholder":"请输入 GO_DADDY_API_KEY","access.authorization.form.godaddy_api_secret.label":"GO_DADDY_API_SECRET","access.authorization.form.godaddy_api_secret.placeholder":"请输入 GO_DADDY_API_SECRET","access.authorization.form.namesilo_api_key.label":"NAMESILO_API_KEY","access.authorization.form.namesilo_api_key.placeholder":"请输入 NAMESILO_API_KEY","access.authorization.form.username.label":"用户名","access.authorization.form.username.placeholder":"请输入用户名","access.authorization.form.password.label":"密码","access.authorization.form.password.placeholder":"请输入密码","access.authorization.form.access_group.placeholder":"请选择分组","access.authorization.form.ssh_group.label":"授权配置组(用于将一个域名证书部署到多个 SSH 主机)","access.authorization.form.ssh_host.label":"服务器 Host","access.authorization.form.ssh_host.placeholder":"请输入 Host","access.authorization.form.ssh_port.label":"SSH 端口","access.authorization.form.ssh_port.placeholder":"请输入 Port","access.authorization.form.ssh_username.label":"用户名","access.authorization.form.ssh_username.placeholder":"请输入用户名","access.authorization.form.ssh_password.label":"密码(使用密码登录)","access.authorization.form.ssh_password.placeholder":"请输入密码","access.authorization.form.ssh_key.label":"Key(使用私钥登录)","access.authorization.form.ssh_key.placeholder":"请输入 Key","access.authorization.form.ssh_key_file.placeholder":"请选择文件","access.authorization.form.ssh_key_passphrase.label":"Key 口令(使用私钥登录)","access.authorization.form.ssh_key_passphrase.placeholder":"请输入 Key 口令","access.authorization.form.ssh_key_path.label":"私钥保存路径","access.authorization.form.ssh_key_path.placeholder":"请输入私钥保存路径","access.authorization.form.ssh_cert_path.label":"证书保存路径","access.authorization.form.ssh_cert_path.placeholder":"请输入证书保存路径","access.authorization.form.ssh_pre_command.label":"前置 Command","access.authorization.form.ssh_pre_command.placeholder":"在部署证书前执行的前置命令","access.authorization.form.ssh_command.label":"Command","access.authorization.form.ssh_command.placeholder":"请输入要执行的命令","access.authorization.form.webhook_url.label":"Webhook URL","access.authorization.form.webhook_url.placeholder":"请输入 Webhook URL","access.group.tab":"授权组","access.group.nodata":"暂无部署授权配置,请添加后开始使用吧","access.group.total":"共有 {{total}} 个部署授权配置","access.group.add":"添加授权组","access.group.delete":"删除组","access.group.delete.confirm":"确定要删除部署授权组吗?","access.group.form.name.label":"组名","access.group.form.name.errmsg.empty":"请输入组名","access.group.domains":"所有授权","access.group.domains.nodata":"请添加域名开始部署证书吧。"},RH={"history.page.title":"部署","history.nodata":"你暂未创建任何部署,请先添加域名进行部署吧!","history.props.domain":"域名","history.props.status":"状态","history.props.stage":"阶段","history.props.stage.progress.check":"检查","history.props.stage.progress.apply":"获取","history.props.stage.progress.deploy":"部署","history.props.last_execution_time":"最近执行时间","history.log":"日志"},AH=Object.freeze({...CH,...jH,...EH,...NH,...TH,...PH,...RH}),DH={"common.save":"Save","common.save.succeeded.message":"Save Successful","common.save.failed.message":"Save Failed","common.add":"Add","common.edit":"Edit","common.copy":"Copy","common.download":"Download","common.delete":"Delete","common.delete.succeeded.message":"Delete Successful","common.delete.failed.message":"Delete Failed","common.next":"Next","common.confirm":"Confirm","common.cancel":"Cancel","common.submit":"Submit","common.update":"Update","common.update.succeeded.message":"Update Successful","common.update.failed.message":"Update Failed","common.text.domain":"Domain","common.text.domain.empty":"No Domain","common.text.ip":"IP Address","common.text.ip.empty":"No IP address","common.text.dns":"Domain Name Server","common.text.dns.empty":"No DNS","common.text.ca":"Certificate Authority","common.text.provider":"Provider","common.text.name":"Name","common.text.created_at":"Created At","common.text.updated_at":"Updated At","common.text.operations":"Operations","common.text.nodata":"No data available","common.menu.settings":"Settings","common.menu.logout":"Logout","common.menu.document":"Document","common.pagination.next":"Next","common.pagination.prev":"Previous","common.pagination.more":"More pages","common.theme.light":"Light","common.theme.dark":"Dark","common.theme.system":"System","common.errmsg.string_max":"Please enter no more than {{max}} characters","common.errmsg.email_invalid":"Please enter a valid email address","common.errmsg.email_empty":"Please enter email","common.errmsg.email_duplicate":"Email already exists","common.errmsg.domain_invalid":"Please enter domain","common.errmsg.host_invalid":"Please enter the correct domain name or IP","common.errmsg.ip_invalid":"Please enter IP","common.errmsg.url_invalid":"Please enter a valid URL","common.provider.aliyun":"Alibaba Cloud","common.provider.aliyun.oss":"Alibaba Cloud - OSS","common.provider.aliyun.cdn":"Alibaba Cloud - CDN","common.provider.aliyun.dcdn":"Alibaba Cloud - DCDN","common.provider.tencent":"Tencent","common.provider.tencent.cdn":"Tencent - CDN","common.provider.huaweicloud":"Huawei Cloud","common.provider.qiniu":"Qiniu","common.provider.qiniu.cdn":"Qiniu - CDN","common.provider.cloudflare":"Cloudflare","common.provider.namesilo":"Namesilo","common.provider.godaddy":"GoDaddy","common.provider.local":"Local Deployment","common.provider.ssh":"SSH Deployment","common.provider.webhook":"Webhook","common.provider.dingtalk":"DingTalk","common.provider.telegram":"Telegram"},OH={"login.username.label":"Username","login.username.placeholder":"Username/Email","login.username.errmsg.invalid":"Please enter a valid email address","login.password.label":"Password","login.password.placeholder":"Password","login.password.errmsg.invalid":"Password should be at least 10 characters","login.submit":"Log In"},IH={"dashboard.page.title":"Dashboard","dashboard.statistics.all":"All","dashboard.statistics.near_expired":"About to Expire","dashboard.statistics.enabled":"Enabled","dashboard.statistics.disabled":"Not Enabled","dashboard.statistics.unit":"","dashboard.history":"Deployment History"},MH={"settings.page.title":"Settings","settings.account.relogin.message":"Please login again","settings.account.tab":"Account","settings.account.email.label":"Email","settings.account.email.placeholder":"Please enter email","settings.account.email.errmsg.invalid":"Please enter a valid email address","settings.account.email.changed.message":"Account email altered successfully","settings.account.email.failed.message":"Account email alteration failed","settings.password.tab":"Password","settings.password.current_password.label":"Current Password","settings.password.current_password.placeholder":"Please enter the current password","settings.password.new_password.label":"New Password","settings.password.new_password.placeholder":"Please enter the new password","settings.password.confirm_password.label":"Confirm Password","settings.password.confirm_password.placeholder":"Please enter the new password again","settings.password.password.errmsg.length":"Password should be at least 10 characters","settings.password.password.errmsg.not_matched":"Passwords do not match","settings.password.changed.message":"Password changed successfully","settings.password.failed.message":"Password change failed","settings.notification.tab":"Notification","settings.notification.template.label":"Template","settings.notification.template.saved.message":"Notification template saved successfully","settings.notification.template.variables.tips.title":"Optional variables ({COUNT}: number of expiring soon)","settings.notification.template.variables.tips.content":"Optional variables ({COUNT}: number of expiring soon. {DOMAINS}: Domain list)","settings.notification.config.enable":"Enable","settings.notification.config.saved.message":"Configuration saved successfully","settings.notification.config.failed.message":"Configuration save failed","settings.notification.dingtalk.secret.placeholder":"Signature for signed addition","settings.notification.url.errmsg.invalid":"Invalid Url format","settings.ca.tab":"Certificate Authority","settings.ca.provider.errmsg.empty":"Please select a Certificate Authority","settings.ca.eab_kid.errmsg.empty":"Please enter EAB_KID","settings.ca.eab_hmac_key.errmsg.empty":"Please enter EAB_HMAC_KEY.","settings.ca.eab_kid_hmac_key.errmsg.empty":"Please enter EAB_KID and EAB_HMAC_KEY"},LH={"domain.page.title":"Domain List","domain.nodata":"Please add a domain to start deploying the certificate.","domain.add":"Add Domain","domain.edit":"Edit Domain","domain.delete":"Delete Domain","domain.delete.confirm":"Are you sure you want to delete this domain?","domain.history":"Deployment History","domain.deploy":"Deploy Now","domain.deploy.started.message":"Deploy Started","domain.deploy.started.tips":"Deployment initiated, please check the deployment log later.","domain.deploy.failed.message":"Execution Failed","domain.deploy.failed.tips":"Execution failed, please check the details in <1>Deployment History.","domain.deploy_forced":"Force Deployment","domain.props.expiry":"Validity Period","domain.props.expiry.date1":"Valid for {{date}} days","domain.props.expiry.date2":"Expiry on {{date}}","domain.props.last_execution_status":"Last Execution Status","domain.props.last_execution_stage":"Last Execution Stage","domain.props.last_execution_time":"Last Execution Time","domain.props.enable":"Enable","domain.props.enable.enabled":"Enable","domain.props.enable.disabled":"Disable","domain.application.tab":"Apply Settings","domain.application.form.domain.added.message":"Domain added successfully","domain.application.form.domain.changed.message":"Domain updated successfully","domain.application.form.email.label":"Email","domain.application.form.email.tips":"(A email is required to apply for a certificate)","domain.application.form.email.add":"Add Email","domain.application.form.email.list":"Email List","domain.application.form.email.errmsg.empty":"Please select email","domain.application.form.access.label":"DNS Provider Authorization Configuration","domain.application.form.access.placeholder":"Please select DNS provider authorization configuration","domain.application.form.access.errmsg.empty":"Please select DNS provider authorization configuration","domain.application.form.access.list":"Provider Authorization Configurations","domain.application.form.timeout.label":"Timeout","domain.application.form.timeoue.placeholder":"Timeout (seconds)","domain.application.unsaved.message":"Please save applyment configuration first","domain.deployment.tab":"Deploy Settings","domain.deployment.nodata":"Deployment not added yet","domain.deployment.form.type.label":"Deploy Method","domain.deployment.form.type.placeholder":"Please select deploy method","domain.deployment.form.type.list":"Deploy Method List","domain.deployment.form.access.label":"Access Configuration","domain.deployment.form.access.placeholder":"Please select provider authorization configuration","domain.deployment.form.access.list":"Provider Authorization Configurations","domain.deployment.form.cdn_domain.label":"Deploy to domain","domain.deployment.form.cdn_domain.placeholder":"Please enter CDN domain","domain.deployment.form.oss_endpoint.label":"Endpoint","domain.deployment.form.oss_bucket":"Bucket","domain.deployment.form.oss_bucket.placeholder":"Please enter Bucket","domain.deployment.form.variables.label":"Variable","domain.deployment.form.variables.key":"Name","domain.deployment.form.variables.value":"Value","domain.deployment.form.variables.empty":"Variable not added yet","domain.deployment.form.variables.key.required":"Variable name cannot be empty","domain.deployment.form.variables.value.required":"Variable value cannot be empty","domain.deployment.form.variables.key.placeholder":"Variable name","domain.deployment.form.variables.value.placeholder":"Variable value"},zH={"access.page.title":"Authorization Management","access.authorization.tab":"Authorization","access.authorization.nodata":"Please add authorization to start deploying certificate.","access.authorization.add":"Add Authorization","access.authorization.edit":"Edit Authorization","access.authorization.copy":"Copy Authorization","access.authorization.delete":"Delete Authorization","access.authorization.delete.confirm":"Are you sure you want to delete the deployment authorization?","access.authorization.form.type.label":"Provider","access.authorization.form.type.placeholder":"Please select a provider","access.authorization.form.type.list":"Authorization List","access.authorization.form.name.label":"Name","access.authorization.form.name.placeholder":"Please enter authorization name","access.authorization.form.config.label":"Configuration Type","access.authorization.form.region.label":"Region","access.authorization.form.region.placeholder":"Please enter Region","access.authorization.form.access_key_id.label":"AccessKeyId","access.authorization.form.access_key_id.placeholder":"Please enter AccessKeyId","access.authorization.form.access_key_secret.label":"AccessKeySecret","access.authorization.form.access_key_secret.placeholder":"Please enter AccessKeySecret","access.authorization.form.access_key.label":"AccessKey","access.authorization.form.access_key.placeholder":"Please enter AccessKey","access.authorization.form.secret_id.label":"SecretId","access.authorization.form.secret_id.placeholder":"Please enter SecretId","access.authorization.form.secret_key.label":"SecretKey","access.authorization.form.secret_key.placeholder":"Please enter SecretKey","access.authorization.form.cloud_dns_api_token.label":"CLOUD_DNS_API_TOKEN","access.authorization.form.cloud_dns_api_token.placeholder":"Please enter CLOUD_DNS_API_TOKEN","access.authorization.form.godaddy_api_key.label":"GO_DADDY_API_KEY","access.authorization.form.godaddy_api_key.placeholder":"Please enter GO_DADDY_API_KEY","access.authorization.form.godaddy_api_secret.label":"GO_DADDY_API_SECRET","access.authorization.form.godaddy_api_secret.placeholder":"Please enter GO_DADDY_API_SECRET","access.authorization.form.namesilo_api_key.label":"NAMESILO_API_KEY","access.authorization.form.namesilo_api_key.placeholder":"Please enter NAMESILO_API_KEY","access.authorization.form.username.label":"Username","access.authorization.form.username.placeholder":"Please enter username","access.authorization.form.password.label":"Password","access.authorization.form.password.placeholder":"Please enter password","access.authorization.form.access_group.placeholder":"Please select a group","access.authorization.form.ssh_group.label":"Authorization Configuration Group (used to deploy a single domain certificate to multiple SSH hosts)","access.authorization.form.ssh_host.label":"Server Host","access.authorization.form.ssh_host.placeholder":"Please enter Host","access.authorization.form.ssh_port.label":"SSH Port","access.authorization.form.ssh_port.placeholder":"Please enter Port","access.authorization.form.ssh_username.label":"Username","access.authorization.form.ssh_username.placeholder":"Please enter username","access.authorization.form.ssh_password.label":"Password (Log-in using password)","access.authorization.form.ssh_password.placeholder":"Please enter password","access.authorization.form.ssh_key.label":"Key (Log-in using private key)","access.authorization.form.ssh_key.placeholder":"Please enter Key","access.authorization.form.ssh_key_file.placeholder":"Please select file","access.authorization.form.ssh_key_passphrase.label":"Key Passphrase (Log-in using private key)","access.authorization.form.ssh_key_passphrase.placeholder":"Please enter Key Passphrase","access.authorization.form.ssh_key_path.label":"Private Key Save Path","access.authorization.form.ssh_key_path.placeholder":"Please enter private key save path","access.authorization.form.ssh_cert_path.label":"Certificate Save Path","access.authorization.form.ssh_cert_path.placeholder":"Please enter certificate save path","access.authorization.form.ssh_pre_command.label":"Pre-deployment Command","access.authorization.form.ssh_pre_command.placeholder":"Command to be executed before deploying the certificate","access.authorization.form.ssh_command.label":"Command","access.authorization.form.ssh_command.placeholder":"Please enter command","access.authorization.form.webhook_url.label":"Webhook URL","access.authorization.form.webhook_url.placeholder":"Please enter Webhook URL","access.group.tab":"Authorization Group","access.group.nodata":"No deployment authorization configuration yet, please add after starting use.","access.group.total":"Totally {{total}} deployment authorization configuration","access.group.add":"Add Group","access.group.delete":"Delete Group","access.group.delete.confirm":"Are you sure you want to delete the deployment authorization group?","access.group.form.name.label":"Group Name","access.group.form.name.errmsg.empty":"Please enter group name","access.group.domains":"All Authorizations","access.group.domains.nodata":"Please add a domain to start deploying the certificate."},FH={"history.page.title":"Deployment","history.nodata":"You have not created any deployments yet, please add a domain to start deployment!","history.props.domain":"Domain","history.props.status":"Status","history.props.stage":"Stage","history.props.stage.progress.check":"Check","history.props.stage.progress.apply":"Apply","history.props.stage.progress.deploy":"Deploy","history.props.last_execution_time":"Last Execution Time","history.log":"Log"},$H=Object.freeze({...DH,...OH,...IH,...MH,...LH,...zH,...FH}),UH={zh:{name:"简体中文",translation:AH},en:{name:"English",translation:$H}};vn.use(cP).use(VO).init({resources:UH,fallbackLng:"zh",debug:!0,interpolation:{escapeValue:!1},backend:{loadPath:"/locales/{{lng}}.json"}});yp.createRoot(document.getElementById("root")).render(l.jsx(We.StrictMode,{children:l.jsx(UF,{defaultTheme:"system",storageKey:"vite-ui-theme",children:l.jsx(yO,{router:VW})})}))});export default VH(); diff --git a/ui/dist/assets/index-DipHpsma.js b/ui/dist/assets/index-DipHpsma.js deleted file mode 100644 index d543c8e9..00000000 --- a/ui/dist/assets/index-DipHpsma.js +++ /dev/null @@ -1,324 +0,0 @@ -var gP=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var BH=gP((r9,Nd)=>{function y1(e,t){for(var n=0;nr[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();var ju=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Vf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var v1={exports:{}},Bf={},x1={exports:{}},nt={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Zc=Symbol.for("react.element"),yP=Symbol.for("react.portal"),vP=Symbol.for("react.fragment"),xP=Symbol.for("react.strict_mode"),wP=Symbol.for("react.profiler"),bP=Symbol.for("react.provider"),_P=Symbol.for("react.context"),SP=Symbol.for("react.forward_ref"),kP=Symbol.for("react.suspense"),CP=Symbol.for("react.memo"),jP=Symbol.for("react.lazy"),c0=Symbol.iterator;function EP(e){return e===null||typeof e!="object"?null:(e=c0&&e[c0]||e["@@iterator"],typeof e=="function"?e:null)}var w1={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b1=Object.assign,_1={};function Ka(e,t,n){this.props=e,this.context=t,this.refs=_1,this.updater=n||w1}Ka.prototype.isReactComponent={};Ka.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Ka.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function S1(){}S1.prototype=Ka.prototype;function sy(e,t,n){this.props=e,this.context=t,this.refs=_1,this.updater=n||w1}var oy=sy.prototype=new S1;oy.constructor=sy;b1(oy,Ka.prototype);oy.isPureReactComponent=!0;var u0=Array.isArray,k1=Object.prototype.hasOwnProperty,iy={current:null},C1={key:!0,ref:!0,__self:!0,__source:!0};function j1(e,t,n){var r,s={},o=null,i=null;if(t!=null)for(r in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(o=""+t.key),t)k1.call(t,r)&&!C1.hasOwnProperty(r)&&(s[r]=t[r]);var a=arguments.length-2;if(a===1)s.children=n;else if(1>>1,B=W[$];if(0>>1;$s(oe,X))Oes(me,oe)?(W[$]=me,W[Oe]=X,$=Oe):(W[$]=oe,W[se]=X,$=se);else if(Oes(me,X))W[$]=me,W[Oe]=X,$=Oe;else break e}}return I}function s(W,I){var X=W.sortIndex-I.sortIndex;return X!==0?X:W.id-I.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var i=Date,a=i.now();e.unstable_now=function(){return i.now()-a}}var c=[],u=[],d=1,f=null,h=3,m=!1,x=!1,p=!1,w=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(W){for(var I=n(u);I!==null;){if(I.callback===null)r(u);else if(I.startTime<=W)r(u),I.sortIndex=I.expirationTime,t(c,I);else break;I=n(u)}}function _(W){if(p=!1,b(W),!x)if(n(c)!==null)x=!0,J(C);else{var I=n(u);I!==null&&F(_,I.startTime-W)}}function C(W,I){x=!1,p&&(p=!1,y(R),R=-1),m=!0;var X=h;try{for(b(I),f=n(c);f!==null&&(!(f.expirationTime>I)||W&&!G());){var $=f.callback;if(typeof $=="function"){f.callback=null,h=f.priorityLevel;var B=$(f.expirationTime<=I);I=e.unstable_now(),typeof B=="function"?f.callback=B:f===n(c)&&r(c),b(I)}else r(c);f=n(c)}if(f!==null)var he=!0;else{var se=n(u);se!==null&&F(_,se.startTime-I),he=!1}return he}finally{f=null,h=X,m=!1}}var j=!1,T=null,R=-1,A=5,O=-1;function G(){return!(e.unstable_now()-OW||125$?(W.sortIndex=X,t(u,W),n(c)===null&&W===n(u)&&(p?(y(R),R=-1):p=!0,F(_,X-$))):(W.sortIndex=B,t(c,W),x||m||(x=!0,J(C))),W},e.unstable_shouldYield=G,e.unstable_wrapCallback=function(W){var I=h;return function(){var X=h;h=I;try{return W.apply(this,arguments)}finally{h=X}}}})(A1);R1.exports=A1;var zP=R1.exports;/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var FP=g,Gn=zP;function ie(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),xp=Object.prototype.hasOwnProperty,$P=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,f0={},h0={};function UP(e){return xp.call(h0,e)?!0:xp.call(f0,e)?!1:$P.test(e)?h0[e]=!0:(f0[e]=!0,!1)}function VP(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function BP(e,t,n,r){if(t===null||typeof t>"u"||VP(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function En(e,t,n,r,s,o,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=i}var on={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){on[e]=new En(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];on[t]=new En(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){on[e]=new En(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){on[e]=new En(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){on[e]=new En(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){on[e]=new En(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){on[e]=new En(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){on[e]=new En(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){on[e]=new En(e,5,!1,e.toLowerCase(),null,!1,!1)});var ly=/[\-:]([a-z])/g;function cy(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(ly,cy);on[t]=new En(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(ly,cy);on[t]=new En(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(ly,cy);on[t]=new En(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){on[e]=new En(e,1,!1,e.toLowerCase(),null,!1,!1)});on.xlinkHref=new En("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){on[e]=new En(e,1,!1,e.toLowerCase(),null,!0,!0)});function uy(e,t,n,r){var s=on.hasOwnProperty(t)?on[t]:null;(s!==null?s.type!==0:r||!(2a||s[i]!==o[a]){var c=` -`+s[i].replace(" at new "," at ");return e.displayName&&c.includes("")&&(c=c.replace("",e.displayName)),c}while(1<=i&&0<=a);break}}}finally{pm=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Rl(e):""}function WP(e){switch(e.tag){case 5:return Rl(e.type);case 16:return Rl("Lazy");case 13:return Rl("Suspense");case 19:return Rl("SuspenseList");case 0:case 2:case 15:return e=gm(e.type,!1),e;case 11:return e=gm(e.type.render,!1),e;case 1:return e=gm(e.type,!0),e;default:return""}}function Sp(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Zi:return"Fragment";case Gi:return"Portal";case wp:return"Profiler";case dy:return"StrictMode";case bp:return"Suspense";case _p:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case I1:return(e.displayName||"Context")+".Consumer";case O1:return(e._context.displayName||"Context")+".Provider";case fy:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case hy:return t=e.displayName||null,t!==null?t:Sp(e.type)||"Memo";case so:t=e._payload,e=e._init;try{return Sp(e(t))}catch{}}return null}function HP(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Sp(t);case 8:return t===dy?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ko(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function L1(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function YP(e){var t=L1(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(i){r=""+i,o.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(i){r=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Tu(e){e._valueTracker||(e._valueTracker=YP(e))}function z1(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=L1(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Td(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function kp(e,t){var n=t.checked;return Mt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function p0(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ko(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function F1(e,t){t=t.checked,t!=null&&uy(e,"checked",t,!1)}function Cp(e,t){F1(e,t);var n=ko(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?jp(e,t.type,n):t.hasOwnProperty("defaultValue")&&jp(e,t.type,ko(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function g0(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function jp(e,t,n){(t!=="number"||Td(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Al=Array.isArray;function ha(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s"+t.valueOf().toString()+"",t=Pu.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function sc(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Bl={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},KP=["Webkit","ms","Moz","O"];Object.keys(Bl).forEach(function(e){KP.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Bl[t]=Bl[e]})});function B1(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Bl.hasOwnProperty(e)&&Bl[e]?(""+t).trim():t+"px"}function W1(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=B1(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var GP=Mt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Tp(e,t){if(t){if(GP[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ie(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ie(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ie(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ie(62))}}function Pp(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Rp=null;function my(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ap=null,ma=null,pa=null;function x0(e){if(e=Qc(e)){if(typeof Ap!="function")throw Error(ie(280));var t=e.stateNode;t&&(t=Gf(t),Ap(e.stateNode,e.type,t))}}function H1(e){ma?pa?pa.push(e):pa=[e]:ma=e}function Y1(){if(ma){var e=ma,t=pa;if(pa=ma=null,x0(e),t)for(e=0;e>>=0,e===0?32:31-(oR(e)/iR|0)|0}var Ru=64,Au=4194304;function Dl(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Dd(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,o=e.pingedLanes,i=n&268435455;if(i!==0){var a=i&~s;a!==0?r=Dl(a):(o&=i,o!==0&&(r=Dl(o)))}else i=n&~s,i!==0?r=Dl(i):o!==0&&(r=Dl(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,o=t&-t,s>=o||s===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function qc(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Er(t),e[t]=n}function uR(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Hl),N0=" ",T0=!1;function f_(e,t){switch(e){case"keyup":return zR.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function h_(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var qi=!1;function $R(e,t){switch(e){case"compositionend":return h_(t);case"keypress":return t.which!==32?null:(T0=!0,N0);case"textInput":return e=t.data,e===N0&&T0?null:e;default:return null}}function UR(e,t){if(qi)return e==="compositionend"||!_y&&f_(e,t)?(e=u_(),ld=xy=co=null,qi=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=D0(n)}}function y_(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?y_(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function v_(){for(var e=window,t=Td();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Td(e.document)}return t}function Sy(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function qR(e){var t=v_(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&y_(n.ownerDocument.documentElement,n)){if(r!==null&&Sy(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=n.textContent.length,o=Math.min(r.start,s);r=r.end===void 0?o:Math.min(r.end,s),!e.extend&&o>r&&(s=r,r=o,o=s),s=O0(n,o);var i=O0(n,r);s&&i&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Xi=null,zp=null,Kl=null,Fp=!1;function I0(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Fp||Xi==null||Xi!==Td(r)||(r=Xi,"selectionStart"in r&&Sy(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Kl&&uc(Kl,r)||(Kl=r,r=Md(zp,"onSelect"),0ea||(e.current=Hp[ea],Hp[ea]=null,ea--)}function bt(e,t){ea++,Hp[ea]=e.current,e.current=t}var Co={},yn=Io(Co),Dn=Io(!1),oi=Co;function Na(e,t){var n=e.type.contextTypes;if(!n)return Co;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},o;for(o in n)s[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function On(e){return e=e.childContextTypes,e!=null}function zd(){kt(Dn),kt(yn)}function V0(e,t,n){if(yn.current!==Co)throw Error(ie(168));bt(yn,t),bt(Dn,n)}function E_(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(ie(108,HP(e)||"Unknown",s));return Mt({},n,r)}function Fd(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Co,oi=yn.current,bt(yn,e),bt(Dn,Dn.current),!0}function B0(e,t,n){var r=e.stateNode;if(!r)throw Error(ie(169));n?(e=E_(e,t,oi),r.__reactInternalMemoizedMergedChildContext=e,kt(Dn),kt(yn),bt(yn,e)):kt(Dn),bt(Dn,n)}var Ss=null,Zf=!1,Pm=!1;function N_(e){Ss===null?Ss=[e]:Ss.push(e)}function lA(e){Zf=!0,N_(e)}function Mo(){if(!Pm&&Ss!==null){Pm=!0;var e=0,t=gt;try{var n=Ss;for(gt=1;e>=i,s-=i,ks=1<<32-Er(t)+s|n<R?(A=T,T=null):A=T.sibling;var O=h(y,T,b[R],_);if(O===null){T===null&&(T=A);break}e&&T&&O.alternate===null&&t(y,T),v=o(O,v,R),j===null?C=O:j.sibling=O,j=O,T=A}if(R===b.length)return n(y,T),Pt&&Uo(y,R),C;if(T===null){for(;RR?(A=T,T=null):A=T.sibling;var G=h(y,T,O.value,_);if(G===null){T===null&&(T=A);break}e&&T&&G.alternate===null&&t(y,T),v=o(G,v,R),j===null?C=G:j.sibling=G,j=G,T=A}if(O.done)return n(y,T),Pt&&Uo(y,R),C;if(T===null){for(;!O.done;R++,O=b.next())O=f(y,O.value,_),O!==null&&(v=o(O,v,R),j===null?C=O:j.sibling=O,j=O);return Pt&&Uo(y,R),C}for(T=r(y,T);!O.done;R++,O=b.next())O=m(T,y,R,O.value,_),O!==null&&(e&&O.alternate!==null&&T.delete(O.key===null?R:O.key),v=o(O,v,R),j===null?C=O:j.sibling=O,j=O);return e&&T.forEach(function(N){return t(y,N)}),Pt&&Uo(y,R),C}function w(y,v,b,_){if(typeof b=="object"&&b!==null&&b.type===Zi&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case Nu:e:{for(var C=b.key,j=v;j!==null;){if(j.key===C){if(C=b.type,C===Zi){if(j.tag===7){n(y,j.sibling),v=s(j,b.props.children),v.return=y,y=v;break e}}else if(j.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===so&&Y0(C)===j.type){n(y,j.sibling),v=s(j,b.props),v.ref=yl(y,j,b),v.return=y,y=v;break e}n(y,j);break}else t(y,j);j=j.sibling}b.type===Zi?(v=ti(b.props.children,y.mode,_,b.key),v.return=y,y=v):(_=gd(b.type,b.key,b.props,null,y.mode,_),_.ref=yl(y,v,b),_.return=y,y=_)}return i(y);case Gi:e:{for(j=b.key;v!==null;){if(v.key===j)if(v.tag===4&&v.stateNode.containerInfo===b.containerInfo&&v.stateNode.implementation===b.implementation){n(y,v.sibling),v=s(v,b.children||[]),v.return=y,y=v;break e}else{n(y,v);break}else t(y,v);v=v.sibling}v=zm(b,y.mode,_),v.return=y,y=v}return i(y);case so:return j=b._init,w(y,v,j(b._payload),_)}if(Al(b))return x(y,v,b,_);if(fl(b))return p(y,v,b,_);Fu(y,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,v!==null&&v.tag===6?(n(y,v.sibling),v=s(v,b),v.return=y,y=v):(n(y,v),v=Lm(b,y.mode,_),v.return=y,y=v),i(y)):n(y,v)}return w}var Pa=A_(!0),D_=A_(!1),Vd=Io(null),Bd=null,ra=null,Ey=null;function Ny(){Ey=ra=Bd=null}function Ty(e){var t=Vd.current;kt(Vd),e._currentValue=t}function Gp(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function ya(e,t){Bd=e,Ey=ra=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(An=!0),e.firstContext=null)}function fr(e){var t=e._currentValue;if(Ey!==e)if(e={context:e,memoizedValue:t,next:null},ra===null){if(Bd===null)throw Error(ie(308));ra=e,Bd.dependencies={lanes:0,firstContext:e}}else ra=ra.next=e;return t}var Yo=null;function Py(e){Yo===null?Yo=[e]:Yo.push(e)}function O_(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,Py(t)):(n.next=s.next,s.next=n),t.interleaved=n,Is(e,r)}function Is(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var oo=!1;function Ry(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function I_(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Ns(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function xo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ct&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,Is(e,n)}return s=r.interleaved,s===null?(t.next=t,Py(r)):(t.next=s.next,s.next=t),r.interleaved=t,Is(e,n)}function ud(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,gy(e,n)}}function K0(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?s=o=i:o=o.next=i,n=n.next}while(n!==null);o===null?s=o=t:o=o.next=t}else s=o=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Wd(e,t,n,r){var s=e.updateQueue;oo=!1;var o=s.firstBaseUpdate,i=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var c=a,u=c.next;c.next=null,i===null?o=u:i.next=u,i=c;var d=e.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==i&&(a===null?d.firstBaseUpdate=u:a.next=u,d.lastBaseUpdate=c))}if(o!==null){var f=s.baseState;i=0,d=u=c=null,a=o;do{var h=a.lane,m=a.eventTime;if((r&h)===h){d!==null&&(d=d.next={eventTime:m,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var x=e,p=a;switch(h=t,m=n,p.tag){case 1:if(x=p.payload,typeof x=="function"){f=x.call(m,f,h);break e}f=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=p.payload,h=typeof x=="function"?x.call(m,f,h):x,h==null)break e;f=Mt({},f,h);break e;case 2:oo=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,h=s.effects,h===null?s.effects=[a]:h.push(a))}else m={eventTime:m,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(u=d=m,c=f):d=d.next=m,i|=h;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;h=a,a=h.next,h.next=null,s.lastBaseUpdate=h,s.shared.pending=null}}while(!0);if(d===null&&(c=f),s.baseState=c,s.firstBaseUpdate=u,s.lastBaseUpdate=d,t=s.shared.interleaved,t!==null){s=t;do i|=s.lane,s=s.next;while(s!==t)}else o===null&&(s.shared.lanes=0);li|=i,e.lanes=i,e.memoizedState=f}}function G0(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Am.transition;Am.transition={};try{e(!1),t()}finally{gt=n,Am.transition=r}}function Q_(){return hr().memoizedState}function fA(e,t,n){var r=bo(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},J_(e))eS(t,n);else if(n=O_(e,t,n,r),n!==null){var s=kn();Nr(n,e,r,s),tS(n,t,r)}}function hA(e,t,n){var r=bo(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(J_(e))eS(t,s);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var i=t.lastRenderedState,a=o(i,n);if(s.hasEagerState=!0,s.eagerState=a,Pr(a,i)){var c=t.interleaved;c===null?(s.next=s,Py(t)):(s.next=c.next,c.next=s),t.interleaved=s;return}}catch{}finally{}n=O_(e,t,s,r),n!==null&&(s=kn(),Nr(n,e,r,s),tS(n,t,r))}}function J_(e){var t=e.alternate;return e===It||t!==null&&t===It}function eS(e,t){Gl=Yd=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function tS(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,gy(e,n)}}var Kd={readContext:fr,useCallback:hn,useContext:hn,useEffect:hn,useImperativeHandle:hn,useInsertionEffect:hn,useLayoutEffect:hn,useMemo:hn,useReducer:hn,useRef:hn,useState:hn,useDebugValue:hn,useDeferredValue:hn,useTransition:hn,useMutableSource:hn,useSyncExternalStore:hn,useId:hn,unstable_isNewReconciler:!1},mA={readContext:fr,useCallback:function(e,t){return Br().memoizedState=[e,t===void 0?null:t],e},useContext:fr,useEffect:q0,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,fd(4194308,4,K_.bind(null,t,e),n)},useLayoutEffect:function(e,t){return fd(4194308,4,e,t)},useInsertionEffect:function(e,t){return fd(4,2,e,t)},useMemo:function(e,t){var n=Br();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Br();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=fA.bind(null,It,e),[r.memoizedState,e]},useRef:function(e){var t=Br();return e={current:e},t.memoizedState=e},useState:Z0,useDebugValue:Fy,useDeferredValue:function(e){return Br().memoizedState=e},useTransition:function(){var e=Z0(!1),t=e[0];return e=dA.bind(null,e[1]),Br().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=It,s=Br();if(Pt){if(n===void 0)throw Error(ie(407));n=n()}else{if(n=t(),en===null)throw Error(ie(349));ai&30||F_(r,t,n)}s.memoizedState=n;var o={value:n,getSnapshot:t};return s.queue=o,q0(U_.bind(null,r,o,e),[e]),r.flags|=2048,vc(9,$_.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Br(),t=en.identifierPrefix;if(Pt){var n=Cs,r=ks;n=(r&~(1<<32-Er(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=gc++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),n==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[Wr]=t,e[hc]=r,dS(e,t,!1,!1),t.stateNode=e;e:{switch(i=Pp(n,r),n){case"dialog":St("cancel",e),St("close",e),s=r;break;case"iframe":case"object":case"embed":St("load",e),s=r;break;case"video":case"audio":for(s=0;sDa&&(t.flags|=128,r=!0,vl(o,!1),t.lanes=4194304)}else{if(!r)if(e=Hd(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),vl(o,!0),o.tail===null&&o.tailMode==="hidden"&&!i.alternate&&!Pt)return mn(t),null}else 2*Ut()-o.renderingStartTime>Da&&n!==1073741824&&(t.flags|=128,r=!0,vl(o,!1),t.lanes=4194304);o.isBackwards?(i.sibling=t.child,t.child=i):(n=o.last,n!==null?n.sibling=i:t.child=i,o.last=i)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Ut(),t.sibling=null,n=Dt.current,bt(Dt,r?n&1|2:n&1),t):(mn(t),null);case 22:case 23:return Hy(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Fn&1073741824&&(mn(t),t.subtreeFlags&6&&(t.flags|=8192)):mn(t),null;case 24:return null;case 25:return null}throw Error(ie(156,t.tag))}function _A(e,t){switch(Cy(t),t.tag){case 1:return On(t.type)&&zd(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ra(),kt(Dn),kt(yn),Oy(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Dy(t),null;case 13:if(kt(Dt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ie(340));Ta()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return kt(Dt),null;case 4:return Ra(),null;case 10:return Ty(t.type._context),null;case 22:case 23:return Hy(),null;case 24:return null;default:return null}}var Uu=!1,pn=!1,SA=typeof WeakSet=="function"?WeakSet:Set,Ne=null;function sa(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){zt(e,t,r)}else n.current=null}function rg(e,t,n){try{n()}catch(r){zt(e,t,r)}}var aw=!1;function kA(e,t){if($p=Od,e=v_(),Sy(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var i=0,a=-1,c=-1,u=0,d=0,f=e,h=null;t:for(;;){for(var m;f!==n||s!==0&&f.nodeType!==3||(a=i+s),f!==o||r!==0&&f.nodeType!==3||(c=i+r),f.nodeType===3&&(i+=f.nodeValue.length),(m=f.firstChild)!==null;)h=f,f=m;for(;;){if(f===e)break t;if(h===n&&++u===s&&(a=i),h===o&&++d===r&&(c=i),(m=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=m}n=a===-1||c===-1?null:{start:a,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Up={focusedElem:e,selectionRange:n},Od=!1,Ne=t;Ne!==null;)if(t=Ne,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ne=e;else for(;Ne!==null;){t=Ne;try{var x=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var p=x.memoizedProps,w=x.memoizedState,y=t.stateNode,v=y.getSnapshotBeforeUpdate(t.elementType===t.type?p:vr(t.type,p),w);y.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var b=t.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ie(163))}}catch(_){zt(t,t.return,_)}if(e=t.sibling,e!==null){e.return=t.return,Ne=e;break}Ne=t.return}return x=aw,aw=!1,x}function Zl(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var o=s.destroy;s.destroy=void 0,o!==void 0&&rg(t,n,o)}s=s.next}while(s!==r)}}function Qf(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function sg(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function mS(e){var t=e.alternate;t!==null&&(e.alternate=null,mS(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Wr],delete t[hc],delete t[Wp],delete t[iA],delete t[aA])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function pS(e){return e.tag===5||e.tag===3||e.tag===4}function lw(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||pS(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function og(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ld));else if(r!==4&&(e=e.child,e!==null))for(og(e,t,n),e=e.sibling;e!==null;)og(e,t,n),e=e.sibling}function ig(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(ig(e,t,n),e=e.sibling;e!==null;)ig(e,t,n),e=e.sibling}var rn=null,xr=!1;function Js(e,t,n){for(n=n.child;n!==null;)gS(e,t,n),n=n.sibling}function gS(e,t,n){if(Qr&&typeof Qr.onCommitFiberUnmount=="function")try{Qr.onCommitFiberUnmount(Wf,n)}catch{}switch(n.tag){case 5:pn||sa(n,t);case 6:var r=rn,s=xr;rn=null,Js(e,t,n),rn=r,xr=s,rn!==null&&(xr?(e=rn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):rn.removeChild(n.stateNode));break;case 18:rn!==null&&(xr?(e=rn,n=n.stateNode,e.nodeType===8?Tm(e.parentNode,n):e.nodeType===1&&Tm(e,n),lc(e)):Tm(rn,n.stateNode));break;case 4:r=rn,s=xr,rn=n.stateNode.containerInfo,xr=!0,Js(e,t,n),rn=r,xr=s;break;case 0:case 11:case 14:case 15:if(!pn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var o=s,i=o.destroy;o=o.tag,i!==void 0&&(o&2||o&4)&&rg(n,t,i),s=s.next}while(s!==r)}Js(e,t,n);break;case 1:if(!pn&&(sa(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){zt(n,t,a)}Js(e,t,n);break;case 21:Js(e,t,n);break;case 22:n.mode&1?(pn=(r=pn)||n.memoizedState!==null,Js(e,t,n),pn=r):Js(e,t,n);break;default:Js(e,t,n)}}function cw(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new SA),t.forEach(function(r){var s=DA.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function yr(e,t){var n=t.deletions;if(n!==null)for(var r=0;rs&&(s=i),r&=~o}if(r=s,r=Ut()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*jA(r/1960))-r,10e?16:e,uo===null)var r=!1;else{if(e=uo,uo=null,qd=0,ct&6)throw Error(ie(331));var s=ct;for(ct|=4,Ne=e.current;Ne!==null;){var o=Ne,i=o.child;if(Ne.flags&16){var a=o.deletions;if(a!==null){for(var c=0;cUt()-By?ei(e,0):Vy|=n),In(e,t)}function kS(e,t){t===0&&(e.mode&1?(t=Au,Au<<=1,!(Au&130023424)&&(Au=4194304)):t=1);var n=kn();e=Is(e,t),e!==null&&(qc(e,t,n),In(e,n))}function AA(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),kS(e,n)}function DA(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(ie(314))}r!==null&&r.delete(t),kS(e,n)}var CS;CS=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Dn.current)An=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return An=!1,wA(e,t,n);An=!!(e.flags&131072)}else An=!1,Pt&&t.flags&1048576&&T_(t,Ud,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;hd(e,t),e=t.pendingProps;var s=Na(t,yn.current);ya(t,n),s=My(null,t,r,e,s,n);var o=Ly();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,On(r)?(o=!0,Fd(t)):o=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Ry(t),s.updater=Xf,t.stateNode=s,s._reactInternals=t,qp(t,r,e,n),t=Jp(null,t,r,!0,o,n)):(t.tag=0,Pt&&o&&ky(t),_n(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(hd(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=IA(r),e=vr(r,e),s){case 0:t=Qp(null,t,r,e,n);break e;case 1:t=sw(null,t,r,e,n);break e;case 11:t=nw(null,t,r,e,n);break e;case 14:t=rw(null,t,r,vr(r.type,e),n);break e}throw Error(ie(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:vr(r,s),Qp(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:vr(r,s),sw(e,t,r,s,n);case 3:e:{if(lS(t),e===null)throw Error(ie(387));r=t.pendingProps,o=t.memoizedState,s=o.element,I_(e,t),Wd(t,r,null,n);var i=t.memoizedState;if(r=i.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){s=Aa(Error(ie(423)),t),t=ow(e,t,r,n,s);break e}else if(r!==s){s=Aa(Error(ie(424)),t),t=ow(e,t,r,n,s);break e}else for(Vn=vo(t.stateNode.containerInfo.firstChild),Bn=t,Pt=!0,br=null,n=D_(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ta(),r===s){t=Ms(e,t,n);break e}_n(e,t,r,n)}t=t.child}return t;case 5:return M_(t),e===null&&Kp(t),r=t.type,s=t.pendingProps,o=e!==null?e.memoizedProps:null,i=s.children,Vp(r,s)?i=null:o!==null&&Vp(r,o)&&(t.flags|=32),aS(e,t),_n(e,t,i,n),t.child;case 6:return e===null&&Kp(t),null;case 13:return cS(e,t,n);case 4:return Ay(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Pa(t,null,r,n):_n(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:vr(r,s),nw(e,t,r,s,n);case 7:return _n(e,t,t.pendingProps,n),t.child;case 8:return _n(e,t,t.pendingProps.children,n),t.child;case 12:return _n(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,o=t.memoizedProps,i=s.value,bt(Vd,r._currentValue),r._currentValue=i,o!==null)if(Pr(o.value,i)){if(o.children===s.children&&!Dn.current){t=Ms(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var a=o.dependencies;if(a!==null){i=o.child;for(var c=a.firstContext;c!==null;){if(c.context===r){if(o.tag===1){c=Ns(-1,n&-n),c.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Gp(o.return,n,t),a.lanes|=n;break}c=c.next}}else if(o.tag===10)i=o.type===t.type?null:o.child;else if(o.tag===18){if(i=o.return,i===null)throw Error(ie(341));i.lanes|=n,a=i.alternate,a!==null&&(a.lanes|=n),Gp(i,n,t),i=o.sibling}else i=o.child;if(i!==null)i.return=o;else for(i=o;i!==null;){if(i===t){i=null;break}if(o=i.sibling,o!==null){o.return=i.return,i=o;break}i=i.return}o=i}_n(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,ya(t,n),s=fr(s),r=r(s),t.flags|=1,_n(e,t,r,n),t.child;case 14:return r=t.type,s=vr(r,t.pendingProps),s=vr(r.type,s),rw(e,t,r,s,n);case 15:return oS(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:vr(r,s),hd(e,t),t.tag=1,On(r)?(e=!0,Fd(t)):e=!1,ya(t,n),nS(t,r,s),qp(t,r,s,n),Jp(null,t,r,!0,e,n);case 19:return uS(e,t,n);case 22:return iS(e,t,n)}throw Error(ie(156,t.tag))};function jS(e,t){return J1(e,t)}function OA(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ar(e,t,n,r){return new OA(e,t,n,r)}function Ky(e){return e=e.prototype,!(!e||!e.isReactComponent)}function IA(e){if(typeof e=="function")return Ky(e)?1:0;if(e!=null){if(e=e.$$typeof,e===fy)return 11;if(e===hy)return 14}return 2}function _o(e,t){var n=e.alternate;return n===null?(n=ar(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function gd(e,t,n,r,s,o){var i=2;if(r=e,typeof e=="function")Ky(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case Zi:return ti(n.children,s,o,t);case dy:i=8,s|=8;break;case wp:return e=ar(12,n,t,s|2),e.elementType=wp,e.lanes=o,e;case bp:return e=ar(13,n,t,s),e.elementType=bp,e.lanes=o,e;case _p:return e=ar(19,n,t,s),e.elementType=_p,e.lanes=o,e;case M1:return eh(n,s,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case O1:i=10;break e;case I1:i=9;break e;case fy:i=11;break e;case hy:i=14;break e;case so:i=16,r=null;break e}throw Error(ie(130,e==null?e:typeof e,""))}return t=ar(i,n,t,s),t.elementType=e,t.type=r,t.lanes=o,t}function ti(e,t,n,r){return e=ar(7,e,r,t),e.lanes=n,e}function eh(e,t,n,r){return e=ar(22,e,r,t),e.elementType=M1,e.lanes=n,e.stateNode={isHidden:!1},e}function Lm(e,t,n){return e=ar(6,e,null,t),e.lanes=n,e}function zm(e,t,n){return t=ar(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function MA(e,t,n,r,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=vm(0),this.expirationTimes=vm(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=vm(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Gy(e,t,n,r,s,o,i,a,c){return e=new MA(e,t,n,a,c),t===1?(t=1,o===!0&&(t|=8)):t=0,o=ar(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ry(o),e}function LA(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(PS)}catch(e){console.error(e)}}PS(),P1.exports=Qn;var Bs=P1.exports;const RS=Vf(Bs),VA=y1({__proto__:null,default:RS},[Bs]);var yw=Bs;vp.createRoot=yw.createRoot,vp.hydrateRoot=yw.hydrateRoot;/** - * @remix-run/router v1.18.0 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function At(){return At=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function ui(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function WA(){return Math.random().toString(36).substr(2,8)}function xw(e,t){return{usr:e.state,key:e.key,idx:t}}function wc(e,t,n,r){return n===void 0&&(n=null),At({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Ws(t):t,{state:n,key:t&&t.key||r||WA()})}function di(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Ws(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function HA(e,t,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:o=!1}=r,i=s.history,a=Ht.Pop,c=null,u=d();u==null&&(u=0,i.replaceState(At({},i.state,{idx:u}),""));function d(){return(i.state||{idx:null}).idx}function f(){a=Ht.Pop;let w=d(),y=w==null?null:w-u;u=w,c&&c({action:a,location:p.location,delta:y})}function h(w,y){a=Ht.Push;let v=wc(p.location,w,y);n&&n(v,w),u=d()+1;let b=xw(v,u),_=p.createHref(v);try{i.pushState(b,"",_)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;s.location.assign(_)}o&&c&&c({action:a,location:p.location,delta:1})}function m(w,y){a=Ht.Replace;let v=wc(p.location,w,y);n&&n(v,w),u=d();let b=xw(v,u),_=p.createHref(v);i.replaceState(b,"",_),o&&c&&c({action:a,location:p.location,delta:0})}function x(w){let y=s.location.origin!=="null"?s.location.origin:s.location.href,v=typeof w=="string"?w:di(w);return v=v.replace(/ $/,"%20"),tt(y,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,y)}let p={get action(){return a},get location(){return e(s,i)},listen(w){if(c)throw new Error("A history only accepts one active listener");return s.addEventListener(vw,f),c=w,()=>{s.removeEventListener(vw,f),c=null}},createHref(w){return t(s,w)},createURL:x,encodeLocation(w){let y=x(w);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:h,replace:m,go(w){return i.go(w)}};return p}var wt;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(wt||(wt={}));const YA=new Set(["lazy","caseSensitive","path","id","index","children"]);function KA(e){return e.index===!0}function bc(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((s,o)=>{let i=[...n,String(o)],a=typeof s.id=="string"?s.id:i.join("-");if(tt(s.index!==!0||!s.children,"Cannot specify children on an index route"),tt(!r[a],'Found a route id collision on id "'+a+`". Route id's must be globally unique within Data Router usages`),KA(s)){let c=At({},s,t(s),{id:a});return r[a]=c,c}else{let c=At({},s,t(s),{id:a,children:void 0});return r[a]=c,s.children&&(c.children=bc(s.children,t,i,r)),c}})}function Wo(e,t,n){return n===void 0&&(n="/"),yd(e,t,n,!1)}function yd(e,t,n,r){let s=typeof t=="string"?Ws(t):t,o=qa(s.pathname||"/",n);if(o==null)return null;let i=AS(e);ZA(i);let a=null;for(let c=0;a==null&&c{let c={relativePath:a===void 0?o.path||"":a,caseSensitive:o.caseSensitive===!0,childrenIndex:i,route:o};c.relativePath.startsWith("/")&&(tt(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let u=Ts([r,c.relativePath]),d=n.concat(c);o.children&&o.children.length>0&&(tt(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),AS(o.children,t,d,u)),!(o.path==null&&!o.index)&&t.push({path:u,score:nD(u,o.index),routesMeta:d})};return e.forEach((o,i)=>{var a;if(o.path===""||!((a=o.path)!=null&&a.includes("?")))s(o,i);else for(let c of DS(o.path))s(o,i,c)}),t}function DS(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return s?[o,""]:[o];let i=DS(r.join("/")),a=[];return a.push(...i.map(c=>c===""?o:[o,c].join("/"))),s&&a.push(...i),a.map(c=>e.startsWith("/")&&c===""?"/":c)}function ZA(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:rD(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const qA=/^:[\w-]+$/,XA=3,QA=2,JA=1,eD=10,tD=-2,ww=e=>e==="*";function nD(e,t){let n=e.split("/"),r=n.length;return n.some(ww)&&(r+=tD),t&&(r+=QA),n.filter(s=>!ww(s)).reduce((s,o)=>s+(qA.test(o)?XA:o===""?JA:eD),r)}function rD(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function sD(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,s={},o="/",i=[];for(let a=0;a{let{paramName:h,isOptional:m}=d;if(h==="*"){let p=a[f]||"";i=o.slice(0,o.length-p.length).replace(/(.)\/+$/,"$1")}const x=a[f];return m&&!x?u[h]=void 0:u[h]=(x||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:i,pattern:e}}function oD(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),ui(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,a,c)=>(r.push({paramName:a,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function iD(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ui(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function qa(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function aD(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?Ws(e):e;return{pathname:n?n.startsWith("/")?n:lD(n,t):t,search:uD(r),hash:dD(s)}}function lD(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function Fm(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function OS(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function oh(e,t){let n=OS(e);return t?n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function ih(e,t,n,r){r===void 0&&(r=!1);let s;typeof e=="string"?s=Ws(e):(s=At({},e),tt(!s.pathname||!s.pathname.includes("?"),Fm("?","pathname","search",s)),tt(!s.pathname||!s.pathname.includes("#"),Fm("#","pathname","hash",s)),tt(!s.search||!s.search.includes("#"),Fm("#","search","hash",s)));let o=e===""||s.pathname==="",i=o?"/":s.pathname,a;if(i==null)a=n;else{let f=t.length-1;if(!r&&i.startsWith("..")){let h=i.split("/");for(;h[0]==="..";)h.shift(),f-=1;s.pathname=h.join("/")}a=f>=0?t[f]:"/"}let c=aD(s,a),u=i&&i!=="/"&&i.endsWith("/"),d=(o||i===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const Ts=e=>e.join("/").replace(/\/\/+/g,"/"),cD=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),uD=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,dD=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class Qy{constructor(t,n,r,s){s===void 0&&(s=!1),this.status=t,this.statusText=n||"",this.internal=s,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function ah(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const IS=["post","put","patch","delete"],fD=new Set(IS),hD=["get",...IS],mD=new Set(hD),pD=new Set([301,302,303,307,308]),gD=new Set([307,308]),$m={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},yD={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},wl={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Jy=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,vD=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),MS="remix-router-transitions";function xD(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;tt(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let s;if(e.mapRouteProperties)s=e.mapRouteProperties;else if(e.detectErrorBoundary){let V=e.detectErrorBoundary;s=H=>({hasErrorBoundary:V(H)})}else s=vD;let o={},i=bc(e.routes,s,void 0,o),a,c=e.basename||"/",u=e.unstable_dataStrategy||kD,d=e.unstable_patchRoutesOnMiss,f=At({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),h=null,m=new Set,x=null,p=null,w=null,y=e.hydrationData!=null,v=Wo(i,e.history.location,c),b=null;if(v==null&&!d){let V=wn(404,{pathname:e.history.location.pathname}),{matches:H,route:q}=Rw(i);v=H,b={[q.id]:V}}v&&d&&!e.hydrationData&&fm(v,i,e.history.location.pathname).active&&(v=null);let _;if(!v)_=!1,v=[];else if(v.some(V=>V.route.lazy))_=!1;else if(!v.some(V=>V.route.loader))_=!0;else if(f.v7_partialHydration){let V=e.hydrationData?e.hydrationData.loaderData:null,H=e.hydrationData?e.hydrationData.errors:null,q=ne=>ne.route.loader?typeof ne.route.loader=="function"&&ne.route.loader.hydrate===!0?!1:V&&V[ne.route.id]!==void 0||H&&H[ne.route.id]!==void 0:!0;if(H){let ne=v.findIndex(be=>H[be.route.id]!==void 0);_=v.slice(0,ne+1).every(q)}else _=v.every(q)}else _=e.hydrationData!=null;let C,j={historyAction:e.history.action,location:e.history.location,matches:v,initialized:_,navigation:$m,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||b,fetchers:new Map,blockers:new Map},T=Ht.Pop,R=!1,A,O=!1,G=new Map,N=null,z=!1,S=!1,U=[],J=[],F=new Map,W=0,I=-1,X=new Map,$=new Set,B=new Map,he=new Map,se=new Set,oe=new Map,Oe=new Map,me=new Map,we=!1;function Te(){if(h=e.history.listen(V=>{let{action:H,location:q,delta:ne}=V;if(we){we=!1;return}ui(Oe.size===0||ne!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let be=bu({currentLocation:j.location,nextLocation:q,historyAction:H});if(be&&ne!=null){we=!0,e.history.go(ne*-1),Ai(be,{state:"blocked",location:q,proceed(){Ai(be,{state:"proceeding",proceed:void 0,reset:void 0,location:q}),e.history.go(ne)},reset(){let Ae=new Map(j.blockers);Ae.set(be,wl),Re({blockers:Ae})}});return}return Z(H,q)}),n){LD(t,G);let V=()=>zD(t,G);t.addEventListener("pagehide",V),N=()=>t.removeEventListener("pagehide",V)}return j.initialized||Z(Ht.Pop,j.location,{initialHydration:!0}),C}function Fe(){h&&h(),N&&N(),m.clear(),A&&A.abort(),j.fetchers.forEach((V,H)=>Kt(H)),j.blockers.forEach((V,H)=>wu(H))}function Ie(V){return m.add(V),()=>m.delete(V)}function Re(V,H){H===void 0&&(H={}),j=At({},j,V);let q=[],ne=[];f.v7_fetcherPersist&&j.fetchers.forEach((be,Ae)=>{be.state==="idle"&&(se.has(Ae)?ne.push(Ae):q.push(Ae))}),[...m].forEach(be=>be(j,{deletedFetchers:ne,unstable_viewTransitionOpts:H.viewTransitionOpts,unstable_flushSync:H.flushSync===!0})),f.v7_fetcherPersist&&(q.forEach(be=>j.fetchers.delete(be)),ne.forEach(be=>Kt(be)))}function st(V,H,q){var ne,be;let{flushSync:Ae}=q===void 0?{}:q,Be=j.actionData!=null&&j.navigation.formMethod!=null&&wr(j.navigation.formMethod)&&j.navigation.state==="loading"&&((ne=V.state)==null?void 0:ne._isRedirect)!==!0,fe;H.actionData?Object.keys(H.actionData).length>0?fe=H.actionData:fe=null:Be?fe=j.actionData:fe=null;let qe=H.loaderData?Tw(j.loaderData,H.loaderData,H.matches||[],H.errors):j.loaderData,ze=j.blockers;ze.size>0&&(ze=new Map(ze),ze.forEach((pt,xt)=>ze.set(xt,wl)));let $e=R===!0||j.navigation.formMethod!=null&&wr(j.navigation.formMethod)&&((be=V.state)==null?void 0:be._isRedirect)!==!0;a&&(i=a,a=void 0),z||T===Ht.Pop||(T===Ht.Push?e.history.push(V,V.state):T===Ht.Replace&&e.history.replace(V,V.state));let yt;if(T===Ht.Pop){let pt=G.get(j.location.pathname);pt&&pt.has(V.pathname)?yt={currentLocation:j.location,nextLocation:V}:G.has(V.pathname)&&(yt={currentLocation:V,nextLocation:j.location})}else if(O){let pt=G.get(j.location.pathname);pt?pt.add(V.pathname):(pt=new Set([V.pathname]),G.set(j.location.pathname,pt)),yt={currentLocation:j.location,nextLocation:V}}Re(At({},H,{actionData:fe,loaderData:qe,historyAction:T,location:V,initialized:!0,navigation:$m,revalidation:"idle",restoreScrollPosition:a0(V,H.matches||j.matches),preventScrollReset:$e,blockers:ze}),{viewTransitionOpts:yt,flushSync:Ae===!0}),T=Ht.Pop,R=!1,O=!1,z=!1,S=!1,U=[],J=[]}async function E(V,H){if(typeof V=="number"){e.history.go(V);return}let q=dg(j.location,j.matches,c,f.v7_prependBasename,V,f.v7_relativeSplatPath,H==null?void 0:H.fromRouteId,H==null?void 0:H.relative),{path:ne,submission:be,error:Ae}=_w(f.v7_normalizeFormMethod,!1,q,H),Be=j.location,fe=wc(j.location,ne,H&&H.state);fe=At({},fe,e.history.encodeLocation(fe));let qe=H&&H.replace!=null?H.replace:void 0,ze=Ht.Push;qe===!0?ze=Ht.Replace:qe===!1||be!=null&&wr(be.formMethod)&&be.formAction===j.location.pathname+j.location.search&&(ze=Ht.Replace);let $e=H&&"preventScrollReset"in H?H.preventScrollReset===!0:void 0,yt=(H&&H.unstable_flushSync)===!0,pt=bu({currentLocation:Be,nextLocation:fe,historyAction:ze});if(pt){Ai(pt,{state:"blocked",location:fe,proceed(){Ai(pt,{state:"proceeding",proceed:void 0,reset:void 0,location:fe}),E(V,H)},reset(){let xt=new Map(j.blockers);xt.set(pt,wl),Re({blockers:xt})}});return}return await Z(ze,fe,{submission:be,pendingError:Ae,preventScrollReset:$e,replace:H&&H.replace,enableViewTransition:H&&H.unstable_viewTransition,flushSync:yt})}function ee(){if(Ke(),Re({revalidation:"loading"}),j.navigation.state!=="submitting"){if(j.navigation.state==="idle"){Z(j.historyAction,j.location,{startUninterruptedRevalidation:!0});return}Z(T||j.historyAction,j.navigation.location,{overrideNavigation:j.navigation})}}async function Z(V,H,q){A&&A.abort(),A=null,T=V,z=(q&&q.startUninterruptedRevalidation)===!0,fP(j.location,j.matches),R=(q&&q.preventScrollReset)===!0,O=(q&&q.enableViewTransition)===!0;let ne=a||i,be=q&&q.overrideNavigation,Ae=Wo(ne,H,c),Be=(q&&q.flushSync)===!0,fe=fm(Ae,ne,H.pathname);if(fe.active&&fe.matches&&(Ae=fe.matches),!Ae){let{error:ht,notFoundMatches:nn,route:Bt}=Di(H.pathname);st(H,{matches:nn,loaderData:{},errors:{[Bt.id]:ht}},{flushSync:Be});return}if(j.initialized&&!S&&PD(j.location,H)&&!(q&&q.submission&&wr(q.submission.formMethod))){st(H,{matches:Ae},{flushSync:Be});return}A=new AbortController;let qe=zi(e.history,H,A.signal,q&&q.submission),ze;if(q&&q.pendingError)ze=[ia(Ae).route.id,{type:wt.error,error:q.pendingError}];else if(q&&q.submission&&wr(q.submission.formMethod)){let ht=await D(qe,H,q.submission,Ae,fe.active,{replace:q.replace,flushSync:Be});if(ht.shortCircuited)return;if(ht.pendingActionResult){let[nn,Bt]=ht.pendingActionResult;if($n(Bt)&&ah(Bt.error)&&Bt.error.status===404){A=null,st(H,{matches:ht.matches,loaderData:{},errors:{[nn]:Bt.error}});return}}Ae=ht.matches||Ae,ze=ht.pendingActionResult,be=Um(H,q.submission),Be=!1,fe.active=!1,qe=zi(e.history,qe.url,qe.signal)}let{shortCircuited:$e,matches:yt,loaderData:pt,errors:xt}=await k(qe,H,Ae,fe.active,be,q&&q.submission,q&&q.fetcherSubmission,q&&q.replace,q&&q.initialHydration===!0,Be,ze);$e||(A=null,st(H,At({matches:yt||Ae},Pw(ze),{loaderData:pt,errors:xt})))}async function D(V,H,q,ne,be,Ae){Ae===void 0&&(Ae={}),Ke();let Be=ID(H,q);if(Re({navigation:Be},{flushSync:Ae.flushSync===!0}),be){let ze=await _u(ne,H.pathname,V.signal);if(ze.type==="aborted")return{shortCircuited:!0};if(ze.type==="error"){let{boundaryId:$e,error:yt}=$r(H.pathname,ze);return{matches:ze.partialMatches,pendingActionResult:[$e,{type:wt.error,error:yt}]}}else if(ze.matches)ne=ze.matches;else{let{notFoundMatches:$e,error:yt,route:pt}=Di(H.pathname);return{matches:$e,pendingActionResult:[pt.id,{type:wt.error,error:yt}]}}}let fe,qe=Il(ne,H);if(!qe.route.action&&!qe.route.lazy)fe={type:wt.error,error:wn(405,{method:V.method,pathname:H.pathname,routeId:qe.route.id})};else if(fe=(await te("action",V,[qe],ne))[0],V.signal.aborted)return{shortCircuited:!0};if(Zo(fe)){let ze;return Ae&&Ae.replace!=null?ze=Ae.replace:ze=jw(fe.response.headers.get("Location"),new URL(V.url),c)===j.location.pathname+j.location.search,await Q(V,fe,{submission:q,replace:ze}),{shortCircuited:!0}}if(Go(fe))throw wn(400,{type:"defer-action"});if($n(fe)){let ze=ia(ne,qe.route.id);return(Ae&&Ae.replace)!==!0&&(T=Ht.Push),{matches:ne,pendingActionResult:[ze.route.id,fe]}}return{matches:ne,pendingActionResult:[qe.route.id,fe]}}async function k(V,H,q,ne,be,Ae,Be,fe,qe,ze,$e){let yt=be||Um(H,Ae),pt=Ae||Be||Ow(yt),xt=!z&&(!f.v7_partialHydration||!qe);if(ne){if(xt){let Lt=P($e);Re(At({navigation:yt},Lt!==void 0?{actionData:Lt}:{}),{flushSync:ze})}let Je=await _u(q,H.pathname,V.signal);if(Je.type==="aborted")return{shortCircuited:!0};if(Je.type==="error"){let{boundaryId:Lt,error:Mn}=$r(H.pathname,Je);return{matches:Je.partialMatches,loaderData:{},errors:{[Lt]:Mn}}}else if(Je.matches)q=Je.matches;else{let{error:Lt,notFoundMatches:Mn,route:Nt}=Di(H.pathname);return{matches:Mn,loaderData:{},errors:{[Nt.id]:Lt}}}}let ht=a||i,[nn,Bt]=Sw(e.history,j,q,pt,H,f.v7_partialHydration&&qe===!0,f.v7_skipActionErrorRevalidation,S,U,J,se,B,$,ht,c,$e);if(Xs(Je=>!(q&&q.some(Lt=>Lt.route.id===Je))||nn&&nn.some(Lt=>Lt.route.id===Je)),I=++W,nn.length===0&&Bt.length===0){let Je=ms();return st(H,At({matches:q,loaderData:{},errors:$e&&$n($e[1])?{[$e[0]]:$e[1].error}:null},Pw($e),Je?{fetchers:new Map(j.fetchers)}:{}),{flushSync:ze}),{shortCircuited:!0}}if(xt){let Je={};if(!ne){Je.navigation=yt;let Lt=P($e);Lt!==void 0&&(Je.actionData=Lt)}Bt.length>0&&(Je.fetchers=M(Bt)),Re(Je,{flushSync:ze})}Bt.forEach(Je=>{F.has(Je.key)&<(Je.key),Je.controller&&F.set(Je.key,Je.controller)});let dl=()=>Bt.forEach(Je=>lt(Je.key));A&&A.signal.addEventListener("abort",dl);let{loaderResults:Qs,fetcherResults:Oi}=await ge(j.matches,q,nn,Bt,V);if(V.signal.aborted)return{shortCircuited:!0};A&&A.signal.removeEventListener("abort",dl),Bt.forEach(Je=>F.delete(Je.key));let Ii=Aw([...Qs,...Oi]);if(Ii){if(Ii.idx>=nn.length){let Je=Bt[Ii.idx-nn.length].key;$.add(Je)}return await Q(V,Ii.result,{replace:fe}),{shortCircuited:!0}}let{loaderData:Mi,errors:Ur}=Nw(j,q,nn,Qs,$e,Bt,Oi,oe);oe.forEach((Je,Lt)=>{Je.subscribe(Mn=>{(Mn||Je.done)&&oe.delete(Lt)})}),f.v7_partialHydration&&qe&&j.errors&&Object.entries(j.errors).filter(Je=>{let[Lt]=Je;return!nn.some(Mn=>Mn.route.id===Lt)}).forEach(Je=>{let[Lt,Mn]=Je;Ur=Object.assign(Ur||{},{[Lt]:Mn})});let Su=ms(),ku=rr(I),Cu=Su||ku||Bt.length>0;return At({matches:q,loaderData:Mi,errors:Ur},Cu?{fetchers:new Map(j.fetchers)}:{})}function P(V){if(V&&!$n(V[1]))return{[V[0]]:V[1].data};if(j.actionData)return Object.keys(j.actionData).length===0?null:j.actionData}function M(V){return V.forEach(H=>{let q=j.fetchers.get(H.key),ne=bl(void 0,q?q.data:void 0);j.fetchers.set(H.key,ne)}),new Map(j.fetchers)}function K(V,H,q,ne){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");F.has(V)&<(V);let be=(ne&&ne.unstable_flushSync)===!0,Ae=a||i,Be=dg(j.location,j.matches,c,f.v7_prependBasename,q,f.v7_relativeSplatPath,H,ne==null?void 0:ne.relative),fe=Wo(Ae,Be,c),qe=fm(fe,Ae,Be);if(qe.active&&qe.matches&&(fe=qe.matches),!fe){Et(V,H,wn(404,{pathname:Be}),{flushSync:be});return}let{path:ze,submission:$e,error:yt}=_w(f.v7_normalizeFormMethod,!0,Be,ne);if(yt){Et(V,H,yt,{flushSync:be});return}let pt=Il(fe,ze);if(R=(ne&&ne.preventScrollReset)===!0,$e&&wr($e.formMethod)){L(V,H,ze,pt,fe,qe.active,be,$e);return}B.set(V,{routeId:H,path:ze}),Y(V,H,ze,pt,fe,qe.active,be,$e)}async function L(V,H,q,ne,be,Ae,Be,fe){Ke(),B.delete(V);function qe(Nt){if(!Nt.route.action&&!Nt.route.lazy){let ps=wn(405,{method:fe.formMethod,pathname:q,routeId:H});return Et(V,H,ps,{flushSync:Be}),!0}return!1}if(!Ae&&qe(ne))return;let ze=j.fetchers.get(V);Ue(V,MD(fe,ze),{flushSync:Be});let $e=new AbortController,yt=zi(e.history,q,$e.signal,fe);if(Ae){let Nt=await _u(be,q,yt.signal);if(Nt.type==="aborted")return;if(Nt.type==="error"){let{error:ps}=$r(q,Nt);Et(V,H,ps,{flushSync:Be});return}else if(Nt.matches){if(be=Nt.matches,ne=Il(be,q),qe(ne))return}else{Et(V,H,wn(404,{pathname:q}),{flushSync:Be});return}}F.set(V,$e);let pt=W,ht=(await te("action",yt,[ne],be))[0];if(yt.signal.aborted){F.get(V)===$e&&F.delete(V);return}if(f.v7_fetcherPersist&&se.has(V)){if(Zo(ht)||$n(ht)){Ue(V,no(void 0));return}}else{if(Zo(ht))if(F.delete(V),I>pt){Ue(V,no(void 0));return}else return $.add(V),Ue(V,bl(fe)),Q(yt,ht,{fetcherSubmission:fe});if($n(ht)){Et(V,H,ht.error);return}}if(Go(ht))throw wn(400,{type:"defer-action"});let nn=j.navigation.location||j.location,Bt=zi(e.history,nn,$e.signal),dl=a||i,Qs=j.navigation.state!=="idle"?Wo(dl,j.navigation.location,c):j.matches;tt(Qs,"Didn't find any matches after fetcher action");let Oi=++W;X.set(V,Oi);let Ii=bl(fe,ht.data);j.fetchers.set(V,Ii);let[Mi,Ur]=Sw(e.history,j,Qs,fe,nn,!1,f.v7_skipActionErrorRevalidation,S,U,J,se,B,$,dl,c,[ne.route.id,ht]);Ur.filter(Nt=>Nt.key!==V).forEach(Nt=>{let ps=Nt.key,l0=j.fetchers.get(ps),pP=bl(void 0,l0?l0.data:void 0);j.fetchers.set(ps,pP),F.has(ps)&<(ps),Nt.controller&&F.set(ps,Nt.controller)}),Re({fetchers:new Map(j.fetchers)});let Su=()=>Ur.forEach(Nt=>lt(Nt.key));$e.signal.addEventListener("abort",Su);let{loaderResults:ku,fetcherResults:Cu}=await ge(j.matches,Qs,Mi,Ur,Bt);if($e.signal.aborted)return;$e.signal.removeEventListener("abort",Su),X.delete(V),F.delete(V),Ur.forEach(Nt=>F.delete(Nt.key));let Je=Aw([...ku,...Cu]);if(Je){if(Je.idx>=Mi.length){let Nt=Ur[Je.idx-Mi.length].key;$.add(Nt)}return Q(Bt,Je.result)}let{loaderData:Lt,errors:Mn}=Nw(j,j.matches,Mi,ku,void 0,Ur,Cu,oe);if(j.fetchers.has(V)){let Nt=no(ht.data);j.fetchers.set(V,Nt)}rr(Oi),j.navigation.state==="loading"&&Oi>I?(tt(T,"Expected pending action"),A&&A.abort(),st(j.navigation.location,{matches:Qs,loaderData:Lt,errors:Mn,fetchers:new Map(j.fetchers)})):(Re({errors:Mn,loaderData:Tw(j.loaderData,Lt,Qs,Mn),fetchers:new Map(j.fetchers)}),S=!1)}async function Y(V,H,q,ne,be,Ae,Be,fe){let qe=j.fetchers.get(V);Ue(V,bl(fe,qe?qe.data:void 0),{flushSync:Be});let ze=new AbortController,$e=zi(e.history,q,ze.signal);if(Ae){let ht=await _u(be,q,$e.signal);if(ht.type==="aborted")return;if(ht.type==="error"){let{error:nn}=$r(q,ht);Et(V,H,nn,{flushSync:Be});return}else if(ht.matches)be=ht.matches,ne=Il(be,q);else{Et(V,H,wn(404,{pathname:q}),{flushSync:Be});return}}F.set(V,ze);let yt=W,xt=(await te("loader",$e,[ne],be))[0];if(Go(xt)&&(xt=await US(xt,$e.signal,!0)||xt),F.get(V)===ze&&F.delete(V),!$e.signal.aborted){if(se.has(V)){Ue(V,no(void 0));return}if(Zo(xt))if(I>yt){Ue(V,no(void 0));return}else{$.add(V),await Q($e,xt);return}if($n(xt)){Et(V,H,xt.error);return}tt(!Go(xt),"Unhandled fetcher deferred data"),Ue(V,no(xt.data))}}async function Q(V,H,q){let{submission:ne,fetcherSubmission:be,replace:Ae}=q===void 0?{}:q;H.response.headers.has("X-Remix-Revalidate")&&(S=!0);let Be=H.response.headers.get("Location");tt(Be,"Expected a Location header on the redirect Response"),Be=jw(Be,new URL(V.url),c);let fe=wc(j.location,Be,{_isRedirect:!0});if(n){let xt=!1;if(H.response.headers.has("X-Remix-Reload-Document"))xt=!0;else if(Jy.test(Be)){const ht=e.history.createURL(Be);xt=ht.origin!==t.location.origin||qa(ht.pathname,c)==null}if(xt){Ae?t.location.replace(Be):t.location.assign(Be);return}}A=null;let qe=Ae===!0?Ht.Replace:Ht.Push,{formMethod:ze,formAction:$e,formEncType:yt}=j.navigation;!ne&&!be&&ze&&$e&&yt&&(ne=Ow(j.navigation));let pt=ne||be;if(gD.has(H.response.status)&&pt&&wr(pt.formMethod))await Z(qe,fe,{submission:At({},pt,{formAction:Be}),preventScrollReset:R});else{let xt=Um(fe,ne);await Z(qe,fe,{overrideNavigation:xt,fetcherSubmission:be,preventScrollReset:R})}}async function te(V,H,q,ne){try{let be=await CD(u,V,H,q,ne,o,s);return await Promise.all(be.map((Ae,Be)=>{if(AD(Ae)){let fe=Ae.result;return{type:wt.redirect,response:ND(fe,H,q[Be].route.id,ne,c,f.v7_relativeSplatPath)}}return ED(Ae)}))}catch(be){return q.map(()=>({type:wt.error,error:be}))}}async function ge(V,H,q,ne,be){let[Ae,...Be]=await Promise.all([q.length?te("loader",be,q,H):[],...ne.map(fe=>{if(fe.matches&&fe.match&&fe.controller){let qe=zi(e.history,fe.path,fe.controller.signal);return te("loader",qe,[fe.match],fe.matches).then(ze=>ze[0])}else return Promise.resolve({type:wt.error,error:wn(404,{pathname:fe.path})})})]);return await Promise.all([Dw(V,q,Ae,Ae.map(()=>be.signal),!1,j.loaderData),Dw(V,ne.map(fe=>fe.match),Be,ne.map(fe=>fe.controller?fe.controller.signal:null),!0)]),{loaderResults:Ae,fetcherResults:Be}}function Ke(){S=!0,U.push(...Xs()),B.forEach((V,H)=>{F.has(H)&&(J.push(H),lt(H))})}function Ue(V,H,q){q===void 0&&(q={}),j.fetchers.set(V,H),Re({fetchers:new Map(j.fetchers)},{flushSync:(q&&q.flushSync)===!0})}function Et(V,H,q,ne){ne===void 0&&(ne={});let be=ia(j.matches,H);Kt(V),Re({errors:{[be.route.id]:q},fetchers:new Map(j.fetchers)},{flushSync:(ne&&ne.flushSync)===!0})}function nr(V){return f.v7_fetcherPersist&&(he.set(V,(he.get(V)||0)+1),se.has(V)&&se.delete(V)),j.fetchers.get(V)||yD}function Kt(V){let H=j.fetchers.get(V);F.has(V)&&!(H&&H.state==="loading"&&X.has(V))&<(V),B.delete(V),X.delete(V),$.delete(V),se.delete(V),j.fetchers.delete(V)}function fs(V){if(f.v7_fetcherPersist){let H=(he.get(V)||0)-1;H<=0?(he.delete(V),se.add(V)):he.set(V,H)}else Kt(V);Re({fetchers:new Map(j.fetchers)})}function lt(V){let H=F.get(V);tt(H,"Expected fetch controller: "+V),H.abort(),F.delete(V)}function hs(V){for(let H of V){let q=nr(H),ne=no(q.data);j.fetchers.set(H,ne)}}function ms(){let V=[],H=!1;for(let q of $){let ne=j.fetchers.get(q);tt(ne,"Expected fetcher: "+q),ne.state==="loading"&&($.delete(q),V.push(q),H=!0)}return hs(V),H}function rr(V){let H=[];for(let[q,ne]of X)if(ne0}function xu(V,H){let q=j.blockers.get(V)||wl;return Oe.get(V)!==H&&Oe.set(V,H),q}function wu(V){j.blockers.delete(V),Oe.delete(V)}function Ai(V,H){let q=j.blockers.get(V)||wl;tt(q.state==="unblocked"&&H.state==="blocked"||q.state==="blocked"&&H.state==="blocked"||q.state==="blocked"&&H.state==="proceeding"||q.state==="blocked"&&H.state==="unblocked"||q.state==="proceeding"&&H.state==="unblocked","Invalid blocker state transition: "+q.state+" -> "+H.state);let ne=new Map(j.blockers);ne.set(V,H),Re({blockers:ne})}function bu(V){let{currentLocation:H,nextLocation:q,historyAction:ne}=V;if(Oe.size===0)return;Oe.size>1&&ui(!1,"A router only supports one blocker at a time");let be=Array.from(Oe.entries()),[Ae,Be]=be[be.length-1],fe=j.blockers.get(Ae);if(!(fe&&fe.state==="proceeding")&&Be({currentLocation:H,nextLocation:q,historyAction:ne}))return Ae}function Di(V){let H=wn(404,{pathname:V}),q=a||i,{matches:ne,route:be}=Rw(q);return Xs(),{notFoundMatches:ne,route:be,error:H}}function $r(V,H){return{boundaryId:ia(H.partialMatches).route.id,error:wn(400,{type:"route-discovery",pathname:V,message:H.error!=null&&"message"in H.error?H.error:String(H.error)})}}function Xs(V){let H=[];return oe.forEach((q,ne)=>{(!V||V(ne))&&(q.cancel(),H.push(ne),oe.delete(ne))}),H}function dP(V,H,q){if(x=V,w=H,p=q||null,!y&&j.navigation===$m){y=!0;let ne=a0(j.location,j.matches);ne!=null&&Re({restoreScrollPosition:ne})}return()=>{x=null,w=null,p=null}}function i0(V,H){return p&&p(V,H.map(ne=>GA(ne,j.loaderData)))||V.key}function fP(V,H){if(x&&w){let q=i0(V,H);x[q]=w()}}function a0(V,H){if(x){let q=i0(V,H),ne=x[q];if(typeof ne=="number")return ne}return null}function fm(V,H,q){if(d)if(V){let ne=V[V.length-1].route;if(ne.path&&(ne.path==="*"||ne.path.endsWith("/*")))return{active:!0,matches:yd(H,q,c,!0)}}else return{active:!0,matches:yd(H,q,c,!0)||[]};return{active:!1,matches:null}}async function _u(V,H,q){let ne=V,be=ne.length>0?ne[ne.length-1].route:null;for(;;){let Ae=a==null,Be=a||i;try{await SD(d,H,ne,Be,o,s,me,q)}catch($e){return{type:"error",error:$e,partialMatches:ne}}finally{Ae&&(i=[...i])}if(q.aborted)return{type:"aborted"};let fe=Wo(Be,H,c),qe=!1;if(fe){let $e=fe[fe.length-1].route;if($e.index)return{type:"success",matches:fe};if($e.path&&$e.path.length>0)if($e.path==="*")qe=!0;else return{type:"success",matches:fe}}let ze=yd(Be,H,c,!0);if(!ze||ne.map($e=>$e.route.id).join("-")===ze.map($e=>$e.route.id).join("-"))return{type:"success",matches:qe?fe:null};if(ne=ze,be=ne[ne.length-1].route,be.path==="*")return{type:"success",matches:ne}}}function hP(V){o={},a=bc(V,s,void 0,o)}function mP(V,H){let q=a==null;zS(V,H,a||i,o,s),q&&(i=[...i],Re({}))}return C={get basename(){return c},get future(){return f},get state(){return j},get routes(){return i},get window(){return t},initialize:Te,subscribe:Ie,enableScrollRestoration:dP,navigate:E,fetch:K,revalidate:ee,createHref:V=>e.history.createHref(V),encodeLocation:V=>e.history.encodeLocation(V),getFetcher:nr,deleteFetcher:fs,dispose:Fe,getBlocker:xu,deleteBlocker:wu,patchRoutes:mP,_internalFetchControllers:F,_internalActiveDeferreds:oe,_internalSetRoutes:hP},C}function wD(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function dg(e,t,n,r,s,o,i,a){let c,u;if(i){c=[];for(let f of t)if(c.push(f),f.route.id===i){u=f;break}}else c=t,u=t[t.length-1];let d=ih(s||".",oh(c,o),qa(e.pathname,n)||e.pathname,a==="path");return s==null&&(d.search=e.search,d.hash=e.hash),(s==null||s===""||s===".")&&u&&u.route.index&&!ev(d.search)&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),r&&n!=="/"&&(d.pathname=d.pathname==="/"?n:Ts([n,d.pathname])),di(d)}function _w(e,t,n,r){if(!r||!wD(r))return{path:n};if(r.formMethod&&!OD(r.formMethod))return{path:n,error:wn(405,{method:r.formMethod})};let s=()=>({path:n,error:wn(400,{type:"invalid-body"})}),o=r.formMethod||"get",i=e?o.toUpperCase():o.toLowerCase(),a=FS(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!wr(i))return s();let h=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((m,x)=>{let[p,w]=x;return""+m+p+"="+w+` -`},""):String(r.body);return{path:n,submission:{formMethod:i,formAction:a,formEncType:r.formEncType,formData:void 0,json:void 0,text:h}}}else if(r.formEncType==="application/json"){if(!wr(i))return s();try{let h=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:i,formAction:a,formEncType:r.formEncType,formData:void 0,json:h,text:void 0}}}catch{return s()}}}tt(typeof FormData=="function","FormData is not available in this environment");let c,u;if(r.formData)c=fg(r.formData),u=r.formData;else if(r.body instanceof FormData)c=fg(r.body),u=r.body;else if(r.body instanceof URLSearchParams)c=r.body,u=Ew(c);else if(r.body==null)c=new URLSearchParams,u=new FormData;else try{c=new URLSearchParams(r.body),u=Ew(c)}catch{return s()}let d={formMethod:i,formAction:a,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(wr(d.formMethod))return{path:n,submission:d};let f=Ws(n);return t&&f.search&&ev(f.search)&&c.append("index",""),f.search="?"+c,{path:di(f),submission:d}}function bD(e,t){let n=e;if(t){let r=e.findIndex(s=>s.route.id===t);r>=0&&(n=e.slice(0,r))}return n}function Sw(e,t,n,r,s,o,i,a,c,u,d,f,h,m,x,p){let w=p?$n(p[1])?p[1].error:p[1].data:void 0,y=e.createURL(t.location),v=e.createURL(s),b=p&&$n(p[1])?p[0]:void 0,_=b?bD(n,b):n,C=p?p[1].statusCode:void 0,j=i&&C&&C>=400,T=_.filter((A,O)=>{let{route:G}=A;if(G.lazy)return!0;if(G.loader==null)return!1;if(o)return typeof G.loader!="function"||G.loader.hydrate?!0:t.loaderData[G.id]===void 0&&(!t.errors||t.errors[G.id]===void 0);if(_D(t.loaderData,t.matches[O],A)||c.some(S=>S===A.route.id))return!0;let N=t.matches[O],z=A;return kw(A,At({currentUrl:y,currentParams:N.params,nextUrl:v,nextParams:z.params},r,{actionResult:w,actionStatus:C,defaultShouldRevalidate:j?!1:a||y.pathname+y.search===v.pathname+v.search||y.search!==v.search||LS(N,z)}))}),R=[];return f.forEach((A,O)=>{if(o||!n.some(U=>U.route.id===A.routeId)||d.has(O))return;let G=Wo(m,A.path,x);if(!G){R.push({key:O,routeId:A.routeId,path:A.path,matches:null,match:null,controller:null});return}let N=t.fetchers.get(O),z=Il(G,A.path),S=!1;h.has(O)?S=!1:u.includes(O)?S=!0:N&&N.state!=="idle"&&N.data===void 0?S=a:S=kw(z,At({currentUrl:y,currentParams:t.matches[t.matches.length-1].params,nextUrl:v,nextParams:n[n.length-1].params},r,{actionResult:w,actionStatus:C,defaultShouldRevalidate:j?!1:a})),S&&R.push({key:O,routeId:A.routeId,path:A.path,matches:G,match:z,controller:new AbortController})}),[T,R]}function _D(e,t,n){let r=!t||n.route.id!==t.route.id,s=e[n.route.id]===void 0;return r||s}function LS(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function kw(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}async function SD(e,t,n,r,s,o,i,a){let c=[t,...n.map(u=>u.route.id)].join("-");try{let u=i.get(c);u||(u=e({path:t,matches:n,patch:(d,f)=>{a.aborted||zS(d,f,r,s,o)}}),i.set(c,u)),u&&RD(u)&&await u}finally{i.delete(c)}}function zS(e,t,n,r,s){if(e){var o;let i=r[e];tt(i,"No route found to patch children into: routeId = "+e);let a=bc(t,s,[e,"patch",String(((o=i.children)==null?void 0:o.length)||"0")],r);i.children?i.children.push(...a):i.children=a}else{let i=bc(t,s,["patch",String(n.length||"0")],r);n.push(...i)}}async function Cw(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let s=n[e.id];tt(s,"No route found in manifest");let o={};for(let i in r){let c=s[i]!==void 0&&i!=="hasErrorBoundary";ui(!c,'Route "'+s.id+'" has a static property "'+i+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+i+'" will be ignored.')),!c&&!YA.has(i)&&(o[i]=r[i])}Object.assign(s,o),Object.assign(s,At({},t(s),{lazy:void 0}))}function kD(e){return Promise.all(e.matches.map(t=>t.resolve()))}async function CD(e,t,n,r,s,o,i,a){let c=r.reduce((f,h)=>f.add(h.route.id),new Set),u=new Set,d=await e({matches:s.map(f=>{let h=c.has(f.route.id);return At({},f,{shouldLoad:h,resolve:x=>(u.add(f.route.id),h?jD(t,n,f,o,i,x,a):Promise.resolve({type:wt.data,result:void 0}))})}),request:n,params:s[0].params,context:a});return s.forEach(f=>tt(u.has(f.route.id),'`match.resolve()` was not called for route id "'+f.route.id+'". You must call `match.resolve()` on every match passed to `dataStrategy` to ensure all routes are properly loaded.')),d.filter((f,h)=>c.has(s[h].route.id))}async function jD(e,t,n,r,s,o,i){let a,c,u=d=>{let f,h=new Promise((p,w)=>f=w);c=()=>f(),t.signal.addEventListener("abort",c);let m=p=>typeof d!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+n.route.id+"]"))):d({request:t,params:n.params,context:i},...p!==void 0?[p]:[]),x;return o?x=o(p=>m(p)):x=(async()=>{try{return{type:"data",result:await m()}}catch(p){return{type:"error",result:p}}})(),Promise.race([x,h])};try{let d=n.route[e];if(n.route.lazy)if(d){let f,[h]=await Promise.all([u(d).catch(m=>{f=m}),Cw(n.route,s,r)]);if(f!==void 0)throw f;a=h}else if(await Cw(n.route,s,r),d=n.route[e],d)a=await u(d);else if(e==="action"){let f=new URL(t.url),h=f.pathname+f.search;throw wn(405,{method:t.method,pathname:h,routeId:n.route.id})}else return{type:wt.data,result:void 0};else if(d)a=await u(d);else{let f=new URL(t.url),h=f.pathname+f.search;throw wn(404,{pathname:h})}tt(a.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(d){return{type:wt.error,result:d}}finally{c&&t.signal.removeEventListener("abort",c)}return a}async function ED(e){let{result:t,type:n,status:r}=e;if($S(t)){let i;try{let a=t.headers.get("Content-Type");a&&/\bapplication\/json\b/.test(a)?t.body==null?i=null:i=await t.json():i=await t.text()}catch(a){return{type:wt.error,error:a}}return n===wt.error?{type:wt.error,error:new Qy(t.status,t.statusText,i),statusCode:t.status,headers:t.headers}:{type:wt.data,data:i,statusCode:t.status,headers:t.headers}}if(n===wt.error)return{type:wt.error,error:t,statusCode:ah(t)?t.status:r};if(DD(t)){var s,o;return{type:wt.deferred,deferredData:t,statusCode:(s=t.init)==null?void 0:s.status,headers:((o=t.init)==null?void 0:o.headers)&&new Headers(t.init.headers)}}return{type:wt.data,data:t,statusCode:r}}function ND(e,t,n,r,s,o){let i=e.headers.get("Location");if(tt(i,"Redirects returned/thrown from loaders/actions must have a Location header"),!Jy.test(i)){let a=r.slice(0,r.findIndex(c=>c.route.id===n)+1);i=dg(new URL(t.url),a,s,!0,i,o),e.headers.set("Location",i)}return e}function jw(e,t,n){if(Jy.test(e)){let r=e,s=r.startsWith("//")?new URL(t.protocol+r):new URL(r),o=qa(s.pathname,n)!=null;if(s.origin===t.origin&&o)return s.pathname+s.search+s.hash}return e}function zi(e,t,n,r){let s=e.createURL(FS(t)).toString(),o={signal:n};if(r&&wr(r.formMethod)){let{formMethod:i,formEncType:a}=r;o.method=i.toUpperCase(),a==="application/json"?(o.headers=new Headers({"Content-Type":a}),o.body=JSON.stringify(r.json)):a==="text/plain"?o.body=r.text:a==="application/x-www-form-urlencoded"&&r.formData?o.body=fg(r.formData):o.body=r.formData}return new Request(s,o)}function fg(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function Ew(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function TD(e,t,n,r,s,o){let i={},a=null,c,u=!1,d={},f=r&&$n(r[1])?r[1].error:void 0;return n.forEach((h,m)=>{let x=t[m].route.id;if(tt(!Zo(h),"Cannot handle redirect results in processLoaderData"),$n(h)){let p=h.error;f!==void 0&&(p=f,f=void 0),a=a||{};{let w=ia(e,x);a[w.route.id]==null&&(a[w.route.id]=p)}i[x]=void 0,u||(u=!0,c=ah(h.error)?h.error.status:500),h.headers&&(d[x]=h.headers)}else Go(h)?(s.set(x,h.deferredData),i[x]=h.deferredData.data,h.statusCode!=null&&h.statusCode!==200&&!u&&(c=h.statusCode),h.headers&&(d[x]=h.headers)):(i[x]=h.data,h.statusCode&&h.statusCode!==200&&!u&&(c=h.statusCode),h.headers&&(d[x]=h.headers))}),f!==void 0&&r&&(a={[r[0]]:f},i[r[0]]=void 0),{loaderData:i,errors:a,statusCode:c||200,loaderHeaders:d}}function Nw(e,t,n,r,s,o,i,a){let{loaderData:c,errors:u}=TD(t,n,r,s,a);for(let d=0;dr.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function Rw(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function wn(e,t){let{pathname:n,routeId:r,method:s,type:o,message:i}=t===void 0?{}:t,a="Unknown Server Error",c="Unknown @remix-run/router error";return e===400?(a="Bad Request",o==="route-discovery"?c='Unable to match URL "'+n+'" - the `unstable_patchRoutesOnMiss()` '+(`function threw the following error: -`+i):s&&n&&r?c="You made a "+s+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":o==="defer-action"?c="defer() is not supported in actions":o==="invalid-body"&&(c="Unable to encode submission body")):e===403?(a="Forbidden",c='Route "'+r+'" does not match URL "'+n+'"'):e===404?(a="Not Found",c='No route matches URL "'+n+'"'):e===405&&(a="Method Not Allowed",s&&n&&r?c="You made a "+s.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":s&&(c='Invalid request method "'+s.toUpperCase()+'"')),new Qy(e||500,a,new Error(c),!0)}function Aw(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(Zo(n))return{result:n,idx:t}}}function FS(e){let t=typeof e=="string"?Ws(e):e;return di(At({},t,{hash:""}))}function PD(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function RD(e){return typeof e=="object"&&e!=null&&"then"in e}function AD(e){return $S(e.result)&&pD.has(e.result.status)}function Go(e){return e.type===wt.deferred}function $n(e){return e.type===wt.error}function Zo(e){return(e&&e.type)===wt.redirect}function DD(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function $S(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function OD(e){return mD.has(e.toLowerCase())}function wr(e){return fD.has(e.toLowerCase())}async function Dw(e,t,n,r,s,o){for(let i=0;if.route.id===c.route.id),d=u!=null&&!LS(u,c)&&(o&&o[c.route.id])!==void 0;if(Go(a)&&(s||d)){let f=r[i];tt(f,"Expected an AbortSignal for revalidating fetcher deferred result"),await US(a,f,s).then(h=>{h&&(n[i]=h||n[i])})}}}async function US(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:wt.data,data:e.deferredData.unwrappedData}}catch(s){return{type:wt.error,error:s}}return{type:wt.data,data:e.deferredData.data}}}function ev(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Il(e,t){let n=typeof t=="string"?Ws(t).search:t.search;if(e[e.length-1].route.index&&ev(n||""))return e[e.length-1];let r=OS(e);return r[r.length-1]}function Ow(e){let{formMethod:t,formAction:n,formEncType:r,text:s,formData:o,json:i}=e;if(!(!t||!n||!r)){if(s!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:s};if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:o,json:void 0,text:void 0};if(i!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:i,text:void 0}}}function Um(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function ID(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function bl(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function MD(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function no(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function LD(e,t){try{let n=e.sessionStorage.getItem(MS);if(n){let r=JSON.parse(n);for(let[s,o]of Object.entries(r||{}))o&&Array.isArray(o)&&t.set(s,new Set(o||[]))}}catch{}}function zD(e,t){if(t.size>0){let n={};for(let[r,s]of t)n[r]=[...s];try{e.sessionStorage.setItem(MS,JSON.stringify(n))}catch(r){ui(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/** - * React Router v6.25.1 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function Jd(){return Jd=Object.assign?Object.assign.bind():function(e){for(var t=1;t{a.current=!0}),g.useCallback(function(u,d){if(d===void 0&&(d={}),!a.current)return;if(typeof u=="number"){r.go(u);return}let f=ih(u,JSON.parse(i),o,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Ts([t,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[t,r,i,o,e])}const UD=g.createContext(null);function VD(e){let t=g.useContext(Hs).outlet;return t&&g.createElement(UD.Provider,{value:e},t)}function HS(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=g.useContext(Lo),{matches:s}=g.useContext(Hs),{pathname:o}=Mr(),i=JSON.stringify(oh(s,r.v7_relativeSplatPath));return g.useMemo(()=>ih(e,JSON.parse(i),o,n==="path"),[e,i,o,n])}function BD(e,t,n,r){Xa()||tt(!1);let{navigator:s}=g.useContext(Lo),{matches:o}=g.useContext(Hs),i=o[o.length-1],a=i?i.params:{};i&&i.pathname;let c=i?i.pathnameBase:"/";i&&i.route;let u=Mr(),d;d=u;let f=d.pathname||"/",h=f;if(c!=="/"){let p=c.replace(/^\//,"").split("/");h="/"+f.replace(/^\//,"").split("/").slice(p.length).join("/")}let m=Wo(e,{pathname:h});return GD(m&&m.map(p=>Object.assign({},p,{params:Object.assign({},a,p.params),pathname:Ts([c,s.encodeLocation?s.encodeLocation(p.pathname).pathname:p.pathname]),pathnameBase:p.pathnameBase==="/"?c:Ts([c,s.encodeLocation?s.encodeLocation(p.pathnameBase).pathname:p.pathnameBase])})),o,n,r)}function WD(){let e=QD(),t=ah(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return g.createElement(g.Fragment,null,g.createElement("h2",null,"Unexpected Application Error!"),g.createElement("h3",{style:{fontStyle:"italic"}},t),n?g.createElement("pre",{style:s},n):null,null)}const HD=g.createElement(WD,null);class YD extends g.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?g.createElement(Hs.Provider,{value:this.props.routeContext},g.createElement(BS.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function KD(e){let{routeContext:t,match:n,children:r}=e,s=g.useContext(lh);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),g.createElement(Hs.Provider,{value:t},r)}function GD(e,t,n,r){var s;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var o;if((o=n)!=null&&o.errors)e=n.matches;else return null}let i=e,a=(s=n)==null?void 0:s.errors;if(a!=null){let d=i.findIndex(f=>f.route.id&&(a==null?void 0:a[f.route.id])!==void 0);d>=0||tt(!1),i=i.slice(0,Math.min(i.length,d+1))}let c=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d=0?i=i.slice(0,u+1):i=[i[0]];break}}}return i.reduceRight((d,f,h)=>{let m,x=!1,p=null,w=null;n&&(m=a&&f.route.id?a[f.route.id]:void 0,p=f.route.errorElement||HD,c&&(u<0&&h===0?(eO("route-fallback"),x=!0,w=null):u===h&&(x=!0,w=f.route.hydrateFallbackElement||null)));let y=t.concat(i.slice(0,h+1)),v=()=>{let b;return m?b=p:x?b=w:f.route.Component?b=g.createElement(f.route.Component,null):f.route.element?b=f.route.element:b=d,g.createElement(KD,{match:f,routeContext:{outlet:d,matches:y,isDataRoute:n!=null},children:b})};return n&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?g.createElement(YD,{location:n.location,revalidation:n.revalidation,component:p,error:m,children:v(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):v()},null)}var YS=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(YS||{}),ef=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(ef||{});function ZD(e){let t=g.useContext(lh);return t||tt(!1),t}function qD(e){let t=g.useContext(VS);return t||tt(!1),t}function XD(e){let t=g.useContext(Hs);return t||tt(!1),t}function KS(e){let t=XD(),n=t.matches[t.matches.length-1];return n.route.id||tt(!1),n.route.id}function QD(){var e;let t=g.useContext(BS),n=qD(ef.UseRouteError),r=KS(ef.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function JD(){let{router:e}=ZD(YS.UseNavigateStable),t=KS(ef.UseNavigateStable),n=g.useRef(!1);return WS(()=>{n.current=!0}),g.useCallback(function(s,o){o===void 0&&(o={}),n.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,Jd({fromRouteId:t},o)))},[e,t])}const Iw={};function eO(e,t,n){Iw[e]||(Iw[e]=!0)}function GS(e){let{to:t,replace:n,state:r,relative:s}=e;Xa()||tt(!1);let{future:o,static:i}=g.useContext(Lo),{matches:a}=g.useContext(Hs),{pathname:c}=Mr(),u=er(),d=ih(t,oh(a,o.v7_relativeSplatPath),c,s==="path"),f=JSON.stringify(d);return g.useEffect(()=>u(JSON.parse(f),{replace:n,state:r,relative:s}),[u,f,s,n,r]),null}function nv(e){return VD(e.context)}function tO(e){let{basename:t="/",children:n=null,location:r,navigationType:s=Ht.Pop,navigator:o,static:i=!1,future:a}=e;Xa()&&tt(!1);let c=t.replace(/^\/*/,"/"),u=g.useMemo(()=>({basename:c,navigator:o,static:i,future:Jd({v7_relativeSplatPath:!1},a)}),[c,a,o,i]);typeof r=="string"&&(r=Ws(r));let{pathname:d="/",search:f="",hash:h="",state:m=null,key:x="default"}=r,p=g.useMemo(()=>{let w=qa(d,c);return w==null?null:{location:{pathname:w,search:f,hash:h,state:m,key:x},navigationType:s}},[c,d,f,h,m,x,s]);return p==null?null:g.createElement(Lo.Provider,{value:u},g.createElement(tv.Provider,{children:n,value:p}))}new Promise(()=>{});function nO(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:g.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:g.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:g.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/** - * React Router DOM v6.25.1 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function _c(){return _c=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function sO(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function oO(e,t){return e.button===0&&(!t||t==="_self")&&!sO(e)}function hg(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(s=>[n,s]):[[n,r]])},[]))}function iO(e,t){let n=hg(e);return t&&t.forEach((r,s)=>{n.has(s)||t.getAll(s).forEach(o=>{n.append(s,o)})}),n}const aO=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],lO="6";try{window.__reactRouterVersion=lO}catch{}function cO(e,t){return xD({basename:void 0,future:_c({},void 0,{v7_prependBasename:!0}),history:BA({window:void 0}),hydrationData:uO(),routes:e,mapRouteProperties:nO,unstable_dataStrategy:void 0,unstable_patchRoutesOnMiss:void 0,window:void 0}).initialize()}function uO(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=_c({},t,{errors:dO(t.errors)})),t}function dO(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,s]of t)if(s&&s.__type==="RouteErrorResponse")n[r]=new Qy(s.status,s.statusText,s.data,s.internal===!0);else if(s&&s.__type==="Error"){if(s.__subType){let o=window[s.__subType];if(typeof o=="function")try{let i=new o(s.message);i.stack="",n[r]=i}catch{}}if(n[r]==null){let o=new Error(s.message);o.stack="",n[r]=o}}else n[r]=s;return n}const fO=g.createContext({isTransitioning:!1}),hO=g.createContext(new Map),mO="startTransition",Mw=N1[mO],pO="flushSync",Lw=VA[pO];function gO(e){Mw?Mw(e):e()}function _l(e){Lw?Lw(e):e()}class yO{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function vO(e){let{fallbackElement:t,router:n,future:r}=e,[s,o]=g.useState(n.state),[i,a]=g.useState(),[c,u]=g.useState({isTransitioning:!1}),[d,f]=g.useState(),[h,m]=g.useState(),[x,p]=g.useState(),w=g.useRef(new Map),{v7_startTransition:y}=r||{},v=g.useCallback(R=>{y?gO(R):R()},[y]),b=g.useCallback((R,A)=>{let{deletedFetchers:O,unstable_flushSync:G,unstable_viewTransitionOpts:N}=A;O.forEach(S=>w.current.delete(S)),R.fetchers.forEach((S,U)=>{S.data!==void 0&&w.current.set(U,S.data)});let z=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!N||z){G?_l(()=>o(R)):v(()=>o(R));return}if(G){_l(()=>{h&&(d&&d.resolve(),h.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:N.currentLocation,nextLocation:N.nextLocation})});let S=n.window.document.startViewTransition(()=>{_l(()=>o(R))});S.finished.finally(()=>{_l(()=>{f(void 0),m(void 0),a(void 0),u({isTransitioning:!1})})}),_l(()=>m(S));return}h?(d&&d.resolve(),h.skipTransition(),p({state:R,currentLocation:N.currentLocation,nextLocation:N.nextLocation})):(a(R),u({isTransitioning:!0,flushSync:!1,currentLocation:N.currentLocation,nextLocation:N.nextLocation}))},[n.window,h,d,w,v]);g.useLayoutEffect(()=>n.subscribe(b),[n,b]),g.useEffect(()=>{c.isTransitioning&&!c.flushSync&&f(new yO)},[c]),g.useEffect(()=>{if(d&&i&&n.window){let R=i,A=d.promise,O=n.window.document.startViewTransition(async()=>{v(()=>o(R)),await A});O.finished.finally(()=>{f(void 0),m(void 0),a(void 0),u({isTransitioning:!1})}),m(O)}},[v,i,d,n.window]),g.useEffect(()=>{d&&i&&s.location.key===i.location.key&&d.resolve()},[d,h,s.location,i]),g.useEffect(()=>{!c.isTransitioning&&x&&(a(x.state),u({isTransitioning:!0,flushSync:!1,currentLocation:x.currentLocation,nextLocation:x.nextLocation}),p(void 0))},[c.isTransitioning,x]),g.useEffect(()=>{},[]);let _=g.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:R=>n.navigate(R),push:(R,A,O)=>n.navigate(R,{state:A,preventScrollReset:O==null?void 0:O.preventScrollReset}),replace:(R,A,O)=>n.navigate(R,{replace:!0,state:A,preventScrollReset:O==null?void 0:O.preventScrollReset})}),[n]),C=n.basename||"/",j=g.useMemo(()=>({router:n,navigator:_,static:!1,basename:C}),[n,_,C]),T=g.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return g.createElement(g.Fragment,null,g.createElement(lh.Provider,{value:j},g.createElement(VS.Provider,{value:s},g.createElement(hO.Provider,{value:w.current},g.createElement(fO.Provider,{value:c},g.createElement(tO,{basename:C,location:s.location,navigationType:s.historyAction,navigator:_,future:T},s.initialized||n.future.v7_partialHydration?g.createElement(xO,{routes:n.routes,future:n.future,state:s}):t))))),null)}const xO=g.memo(wO);function wO(e){let{routes:t,future:n,state:r}=e;return BD(t,void 0,r,n)}const bO=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",_O=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,bn=g.forwardRef(function(t,n){let{onClick:r,relative:s,reloadDocument:o,replace:i,state:a,target:c,to:u,preventScrollReset:d,unstable_viewTransition:f}=t,h=rO(t,aO),{basename:m}=g.useContext(Lo),x,p=!1;if(typeof u=="string"&&_O.test(u)&&(x=u,bO))try{let b=new URL(window.location.href),_=u.startsWith("//")?new URL(b.protocol+u):new URL(u),C=qa(_.pathname,m);_.origin===b.origin&&C!=null?u=C+_.search+_.hash:p=!0}catch{}let w=FD(u,{relative:s}),y=SO(u,{replace:i,state:a,target:c,preventScrollReset:d,relative:s,unstable_viewTransition:f});function v(b){r&&r(b),b.defaultPrevented||y(b)}return g.createElement("a",_c({},h,{href:x||w,onClick:p||o?r:v,ref:n,target:c}))});var zw;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(zw||(zw={}));var Fw;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Fw||(Fw={}));function SO(e,t){let{target:n,replace:r,state:s,preventScrollReset:o,relative:i,unstable_viewTransition:a}=t===void 0?{}:t,c=er(),u=Mr(),d=HS(e,{relative:i});return g.useCallback(f=>{if(oO(f,n)){f.preventDefault();let h=r!==void 0?r:di(u)===di(d);c(e,{replace:h,state:s,preventScrollReset:o,relative:i,unstable_viewTransition:a})}},[u,c,d,r,s,n,e,o,i,a])}function kO(e){let t=g.useRef(hg(e)),n=g.useRef(!1),r=Mr(),s=g.useMemo(()=>iO(r.search,n.current?null:t.current),[r.search]),o=er(),i=g.useCallback((a,c)=>{const u=hg(typeof a=="function"?a(s):a);n.current=!0,o("?"+u,c)},[o,s]);return[s,i]}/** - * @license lucide-react v0.417.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const CO=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ZS=(...e)=>e.filter((t,n,r)=>!!t&&r.indexOf(t)===n).join(" ");/** - * @license lucide-react v0.417.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */var jO={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** - * @license lucide-react v0.417.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const EO=g.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:o,iconNode:i,...a},c)=>g.createElement("svg",{ref:c,...jO,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:ZS("lucide",s),...a},[...i.map(([u,d])=>g.createElement(u,d)),...Array.isArray(o)?o:[o]]));/** - * @license lucide-react v0.417.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ut=(e,t)=>{const n=g.forwardRef(({className:r,...s},o)=>g.createElement(EO,{ref:o,iconNode:t,className:ZS(`lucide-${CO(e)}`,r),...s}));return n.displayName=`${e}`,n};/** - * @license lucide-react v0.417.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const NO=ut("Ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]);/** - * @license lucide-react v0.417.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const TO=ut("BookOpen",[["path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z",key:"vv98re"}],["path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z",key:"1cyq3y"}]]);/** - * @license lucide-react v0.417.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const PO=ut("CalendarX2",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 13V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h8",key:"3spt84"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"m17 22 5-5",key:"1k6ppv"}],["path",{d:"m17 17 5 5",key:"p7ous7"}]]);/** - * @license lucide-react v0.417.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const qS=ut("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** - * @license lucide-react v0.417.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const rv=ut("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** - * @license lucide-react v0.417.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const XS=ut("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** - * @license lucide-react v0.417.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const RO=ut("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** - * @license lucide-react v0.417.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const AO=ut("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** - * @license lucide-react v0.417.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const DO=ut("CircleUser",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]]);/** - * @license lucide-react v0.417.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const $w=ut("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/** - * @license lucide-react v0.417.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const QS=ut("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** - * @license lucide-react v0.417.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const mg=ut("Earth",[["path",{d:"M21.54 15H17a2 2 0 0 0-2 2v4.54",key:"1djwo0"}],["path",{d:"M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17",key:"1tzkfa"}],["path",{d:"M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05",key:"14pb5j"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** - * @license lucide-react v0.417.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const OO=ut("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/** - * @license lucide-react v0.417.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Uw=ut("Group",[["path",{d:"M3 7V5c0-1.1.9-2 2-2h2",key:"adw53z"}],["path",{d:"M17 3h2c1.1 0 2 .9 2 2v2",key:"an4l38"}],["path",{d:"M21 17v2c0 1.1-.9 2-2 2h-2",key:"144t0e"}],["path",{d:"M7 21H5c-1.1 0-2-.9-2-2v-2",key:"rtnfgi"}],["rect",{width:"7",height:"5",x:"7",y:"7",rx:"1",key:"1eyiv7"}],["rect",{width:"7",height:"5",x:"10",y:"12",rx:"1",key:"1qlmkx"}]]);/** - * @license lucide-react v0.417.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Vw=ut("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/** - * @license lucide-react v0.417.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Bw=ut("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/** - * @license lucide-react v0.417.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const IO=ut("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/** - * @license lucide-react v0.417.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const MO=ut("Key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);/** - * @license lucide-react v0.417.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const LO=ut("Languages",[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]);/** - * @license lucide-react v0.417.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const zO=ut("LoaderPinwheel",[["path",{d:"M2 12c0-2.8 2.2-5 5-5s5 2.2 5 5 2.2 5 5 5 5-2.2 5-5",key:"1cg5zf"}],["path",{d:"M7 20.7a1 1 0 1 1 5-8.7 1 1 0 1 0 5-8.6",key:"1gnrpi"}],["path",{d:"M7 3.3a1 1 0 1 1 5 8.6 1 1 0 1 0 5 8.6",key:"u9yy5q"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** - * @license lucide-react v0.417.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const FO=ut("Megaphone",[["path",{d:"m3 11 18-5v12L3 14v-3z",key:"n962bs"}],["path",{d:"M11.6 16.8a3 3 0 1 1-5.8-1.6",key:"1yl0tm"}]]);/** - * @license lucide-react v0.417.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const $O=ut("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/** - * @license lucide-react v0.417.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const UO=ut("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/** - * @license lucide-react v0.417.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const fi=ut("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** - * @license lucide-react v0.417.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ww=ut("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/** - * @license lucide-react v0.417.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const VO=ut("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** - * @license lucide-react v0.417.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const JS=ut("Smile",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]]);/** - * @license lucide-react v0.417.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const sv=ut("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/** - * @license lucide-react v0.417.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const BO=ut("SquareSigma",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M16 8.9V7H8l4 5-4 5h8v-1.9",key:"9nih0i"}]]);/** - * @license lucide-react v0.417.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const WO=ut("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/** - * @license lucide-react v0.417.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ov=ut("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** - * @license lucide-react v0.417.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const HO=ut("UserRound",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]);/** - * @license lucide-react v0.417.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const iv=ut("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);var YO={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0};const KO=Vf(YO);var GO=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function Hw(e){var t={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},n=e.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(t.name=n[1],(KO[n[1]]||e.charAt(e.length-2)==="/")&&(t.voidElement=!0),t.name.startsWith("!--"))){var r=e.indexOf("-->");return{type:"comment",comment:r!==-1?e.slice(4,r):""}}for(var s=new RegExp(GO),o=null;(o=s.exec(e))!==null;)if(o[0].trim())if(o[1]){var i=o[1].trim(),a=[i,""];i.indexOf("=")>-1&&(a=i.split("=")),t.attrs[a[0]]=a[1],s.lastIndex--}else o[2]&&(t.attrs[o[2]]=o[3].trim().substring(1,o[3].length-1));return t}var ZO=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,qO=/^\s*$/,XO=Object.create(null);function ek(e,t){switch(t.type){case"text":return e+t.content;case"tag":return e+="<"+t.name+(t.attrs?function(n){var r=[];for(var s in n)r.push(s+'="'+n[s]+'"');return r.length?" "+r.join(" "):""}(t.attrs):"")+(t.voidElement?"/>":">"),t.voidElement?e:e+t.children.reduce(ek,"")+"";case"comment":return e+""}}var QO={parse:function(e,t){t||(t={}),t.components||(t.components=XO);var n,r=[],s=[],o=-1,i=!1;if(e.indexOf("<")!==0){var a=e.indexOf("<");r.push({type:"text",content:a===-1?e:e.substring(0,a)})}return e.replace(ZO,function(c,u){if(i){if(c!=="")return;i=!1}var d,f=c.charAt(1)!=="/",h=c.startsWith("