diff --git a/pkg/authority/v1alpha1/ca.pb.go b/api/mesh/ca.pb.go similarity index 99% rename from pkg/authority/v1alpha1/ca.pb.go rename to api/mesh/ca.pb.go index d74df2c21..4fdeceb3b 100644 --- a/pkg/authority/v1alpha1/ca.pb.go +++ b/api/mesh/ca.pb.go @@ -20,7 +20,7 @@ // protoc v3.21.6 // source: v1alpha1/ca.proto -package v1alpha1 +package mesh import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" diff --git a/pkg/authority/v1alpha1/ca.proto b/api/mesh/ca.proto similarity index 100% rename from pkg/authority/v1alpha1/ca.proto rename to api/mesh/ca.proto diff --git a/pkg/authority/v1alpha1/ca_grpc.pb.go b/api/mesh/ca_grpc.pb.go similarity index 96% rename from pkg/authority/v1alpha1/ca_grpc.pb.go rename to api/mesh/ca_grpc.pb.go index bc4303b00..4b91ab01f 100644 --- a/pkg/authority/v1alpha1/ca_grpc.pb.go +++ b/api/mesh/ca_grpc.pb.go @@ -4,7 +4,7 @@ // - protoc v3.21.6 // source: v1alpha1/ca.proto -package v1alpha1 +package mesh import ( context "context" @@ -18,7 +18,7 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 -// AuthorityServiceClient is the client API for AuthorityService service. +// AuthorityServiceClient is the clientgen API for AuthorityService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type AuthorityServiceClient interface { @@ -42,7 +42,7 @@ func (c *authorityServiceClient) CreateIdentity(ctx context.Context, in *Identit return out, nil } -// AuthorityServiceServer is the server API for AuthorityService service. +// AuthorityServiceServer is the cp-server API for AuthorityService service. // All implementations must embed UnimplementedAuthorityServiceServer // for forward compatibility type AuthorityServiceServer interface { @@ -104,7 +104,7 @@ var AuthorityService_ServiceDesc = grpc.ServiceDesc{ Metadata: "v1alpha1/ca.proto", } -// RuleServiceClient is the client API for RuleService service. +// RuleServiceClient is the clientgen API for RuleService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type RuleServiceClient interface { @@ -150,7 +150,7 @@ func (x *ruleServiceObserveClient) Recv() (*ObserveResponse, error) { return m, nil } -// RuleServiceServer is the server API for RuleService service. +// RuleServiceServer is the cp-server API for RuleService service. // All implementations must embed UnimplementedRuleServiceServer // for forward compatibility type RuleServiceServer interface { diff --git a/cmd/admin/README.md b/app/dubbo-cp/README.md similarity index 100% rename from cmd/admin/README.md rename to app/dubbo-cp/README.md diff --git a/app/dubbo-cp/cmd/console.go b/app/dubbo-cp/cmd/console.go new file mode 100644 index 000000000..9e815d423 --- /dev/null +++ b/app/dubbo-cp/cmd/console.go @@ -0,0 +1,90 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package cmd + +import ( + "fmt" + "github.com/apache/dubbo-admin/pkg/admin" + "github.com/apache/dubbo-admin/pkg/config" + dubbo_cp "github.com/apache/dubbo-admin/pkg/config/app/dubbo-cp" + "github.com/apache/dubbo-admin/pkg/core/bootstrap" + "github.com/apache/dubbo-admin/pkg/core/cmd" + "github.com/apache/dubbo-admin/pkg/core/logger" + "github.com/spf13/cobra" + "time" +) + +func newConsoleCmdWithOpts(opts cmd.RunCmdOpts) *cobra.Command { + args := struct { + configPath string + }{} + + cmd := &cobra.Command{ + Use: "console", + Short: "Launch Dubbo Admin console server.", + Long: `Launch Dubbo Admin console server.`, + RunE: func(cmd *cobra.Command, _ []string) error { + cfg := dubbo_cp.DefaultConfig() + err := config.Load(args.configPath, &cfg) + if err != nil { + logger.Sugar().Error(err, "could not load the configuration") + return err + } + gracefulCtx, ctx := opts.SetupSignalHandler() + + rt, err := bootstrap.Bootstrap(gracefulCtx, &cfg) + if err != nil { + logger.Sugar().Error(err, "unable to set up Control Plane runtime") + return err + } + cfgForDisplay, err := config.ConfigForDisplay(&cfg) + if err != nil { + logger.Sugar().Error(err, "unable to prepare config for display") + return err + } + cfgBytes, err := config.ToJson(cfgForDisplay) + if err != nil { + logger.Sugar().Error(err, "unable to convert config to json") + return err + } + logger.Sugar().Info(fmt.Sprintf("Current config %s", cfgBytes)) + + if err := admin.Setup(rt); err != nil { + logger.Sugar().Error(err, "unable to set up Metrics") + } + logger.Sugar().Info("starting Control Plane") + if err := rt.Start(gracefulCtx.Done()); err != nil { + logger.Sugar().Error(err, "problem running Control Plane") + return err + } + + logger.Sugar().Info("Stop signal received. Waiting 3 seconds for components to stop gracefully...") + select { + case <-ctx.Done(): + case <-time.After(gracefullyShutdownDuration): + } + logger.Sugar().Info("Stopping Control Plane") + return nil + }, + } + + // flags + cmd.PersistentFlags().StringVarP(&args.configPath, "config-file", "c", "", "configuration file") + + return cmd +} diff --git a/cmd/admin/cmd/root.go b/app/dubbo-cp/cmd/root.go similarity index 59% rename from cmd/admin/cmd/root.go rename to app/dubbo-cp/cmd/root.go index 58a073d51..49e30595e 100644 --- a/cmd/admin/cmd/root.go +++ b/app/dubbo-cp/cmd/root.go @@ -1,11 +1,26 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package cmd import ( - "github.com/apache/dubbo-admin/pkg/logger" - "github.com/apache/dubbo-admin/pkg/version" - - corecmd "github.com/apache/dubbo-admin/pkg/core/cmd" - + cmd2 "github.com/apache/dubbo-admin/pkg/core/cmd" + "github.com/apache/dubbo-admin/pkg/core/cmd/version" + "github.com/apache/dubbo-admin/pkg/core/logger" "github.com/spf13/cobra" "os" ) @@ -38,7 +53,8 @@ func GetRootCmd(args []string) *cobra.Command { //cmd.PersistentFlags().IntVar(&args.maxAge, "log-max-age", 30, "maximum number of days to retain old log files based on the timestamp encoded in their filename") // sub-commands - cmd.AddCommand(newRunCmdWithOpts(corecmd.DefaultRunCmdOpts)) + cmd.AddCommand(newRunCmdWithOpts(cmd2.DefaultRunCmdOpts)) + cmd.AddCommand(newConsoleCmdWithOpts(cmd2.DefaultRunCmdOpts)) cmd.AddCommand(version.NewVersionCmd()) return cmd diff --git a/app/dubbo-cp/cmd/run.go b/app/dubbo-cp/cmd/run.go new file mode 100644 index 000000000..2c42891a2 --- /dev/null +++ b/app/dubbo-cp/cmd/run.go @@ -0,0 +1,116 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package cmd + +import ( + "fmt" + "github.com/apache/dubbo-admin/pkg/admin" + "github.com/apache/dubbo-admin/pkg/authority" + "github.com/apache/dubbo-admin/pkg/config" + dubbo_cp "github.com/apache/dubbo-admin/pkg/config/app/dubbo-cp" + "github.com/apache/dubbo-admin/pkg/core/bootstrap" + "github.com/apache/dubbo-admin/pkg/core/cert" + "github.com/apache/dubbo-admin/pkg/core/cmd" + "github.com/apache/dubbo-admin/pkg/core/logger" + "github.com/apache/dubbo-admin/pkg/cp-server" + "github.com/apache/dubbo-admin/pkg/rule" + "github.com/spf13/cobra" + "time" +) + +const gracefullyShutdownDuration = 3 * time.Second + +// This is the open file limit below which the control plane may not +// reasonably have enough descriptors to accept all its clients. +const minOpenFileLimit = 4096 + +func newRunCmdWithOpts(opts cmd.RunCmdOpts) *cobra.Command { + args := struct { + configPath string + }{} + cmd := &cobra.Command{ + Use: "run", + Short: "Launch Dubbo Admin", + Long: `Launch Dubbo Admin.`, + RunE: func(cmd *cobra.Command, _ []string) error { + cfg := dubbo_cp.DefaultConfig() + err := config.Load(args.configPath, &cfg) + if err != nil { + logger.Sugar().Error(err, "could not load the configuration") + return err + } + gracefulCtx, ctx := opts.SetupSignalHandler() + + rt, err := bootstrap.Bootstrap(gracefulCtx, &cfg) + if err != nil { + logger.Sugar().Error(err, "unable to set up Control Plane runtime") + return err + } + cfgForDisplay, err := config.ConfigForDisplay(&cfg) + if err != nil { + logger.Sugar().Error(err, "unable to prepare config for display") + return err + } + cfgBytes, err := config.ToJson(cfgForDisplay) + if err != nil { + logger.Sugar().Error(err, "unable to convert config to json") + return err + } + logger.Sugar().Info(fmt.Sprintf("Current config %s", cfgBytes)) + + if err := admin.Setup(rt); err != nil { + logger.Sugar().Error(err, "unable to set up Metrics") + } + + if err := cert.Setup(rt); err != nil { + logger.Sugar().Error(err, "unable to set up certProvider") + } + + if err := authority.Setup(rt); err != nil { + logger.Sugar().Error(err, "unable to set up authority") + } + + if err := rule.Setup(rt); err != nil { + logger.Sugar().Error(err, "unable to set up rule") + } + + if err := cp_server.Setup(rt); err != nil { + logger.Sugar().Error(err, "unable to set up grpc server") + } + + logger.Sugar().Info("starting Control Plane") + if err := rt.Start(gracefulCtx.Done()); err != nil { + logger.Sugar().Error(err, "problem running Control Plane") + return err + } + + logger.Sugar().Info("Stop signal received. Waiting 3 seconds for components to stop gracefully...") + select { + case <-ctx.Done(): + case <-time.After(gracefullyShutdownDuration): + } + logger.Sugar().Info("Stopping Control Plane") + return nil + }, + } + + // flags + cmd.PersistentFlags().StringVarP(&args.configPath, "config-file", "c", "", "configuration file") + + return cmd +} diff --git a/cmd/admin/main.go b/app/dubbo-cp/main.go similarity index 95% rename from cmd/admin/main.go rename to app/dubbo-cp/main.go index 6dc3e4498..ceb96327c 100644 --- a/cmd/admin/main.go +++ b/app/dubbo-cp/main.go @@ -19,8 +19,9 @@ package main import ( "fmt" - "github.com/apache/dubbo-admin/cmd/admin/cmd" "os" + + "github.com/apache/dubbo-admin/app/dubbo-cp/cmd" ) func main() { diff --git a/cmd/ui/dist/OpenSans.css b/app/dubbo-ui/dist/OpenSans.css similarity index 100% rename from cmd/ui/dist/OpenSans.css rename to app/dubbo-ui/dist/OpenSans.css diff --git a/cmd/ui/dist/dubbo-admin-info.json b/app/dubbo-ui/dist/dubbo-admin-info.json similarity index 100% rename from cmd/ui/dist/dubbo-admin-info.json rename to app/dubbo-ui/dist/dubbo-admin-info.json diff --git a/cmd/ui/dist/dubbo.ico b/app/dubbo-ui/dist/dubbo.ico similarity index 100% rename from cmd/ui/dist/dubbo.ico rename to app/dubbo-ui/dist/dubbo.ico diff --git a/cmd/ui/dist/echarts-en.min.js b/app/dubbo-ui/dist/echarts-en.min.js similarity index 99% rename from cmd/ui/dist/echarts-en.min.js rename to app/dubbo-ui/dist/echarts-en.min.js index 58942301a..f8928a88d 100644 --- a/cmd/ui/dist/echarts-en.min.js +++ b/app/dubbo-ui/dist/echarts-en.min.js @@ -1 +1 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.echarts={})}(this,function(t){"use strict";function e(t,e){"createCanvas"===t&&(Gx=null),Bx[t]=e}function i(t){if(null==t||"object"!=typeof t)return t;var e=t,n=kx.call(t);if("[object Array]"===n){if(!O(t)){e=[];for(var o=0,a=t.length;on_||t<-n_}function vt(t){this._target=t.target,this._life=t.life||1e3,this._delay=t.delay||0,this._initialized=!1,this.loop=null!=t.loop&&t.loop,this.gap=t.gap||0,this.easing=t.easing||"Linear",this.onframe=t.onframe,this.ondestroy=t.ondestroy,this.onrestart=t.onrestart,this._pausedTime=0,this._paused=!1}function yt(t){return(t=Math.round(t))<0?0:t>255?255:t}function xt(t){return(t=Math.round(t))<0?0:t>360?360:t}function _t(t){return t<0?0:t>1?1:t}function wt(t){return yt(t.length&&"%"===t.charAt(t.length-1)?parseFloat(t)/100*255:parseInt(t,10))}function bt(t){return _t(t.length&&"%"===t.charAt(t.length-1)?parseFloat(t)/100:parseFloat(t))}function St(t,e,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}function Mt(t,e,i){return t+(e-t)*i}function It(t,e,i,n,o){return t[0]=e,t[1]=i,t[2]=n,t[3]=o,t}function Dt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function Tt(t,e){g_&&Dt(g_,e),g_=p_.put(t,g_||e.slice())}function At(t,e){if(t){e=e||[];var i=p_.get(t);if(i)return Dt(e,i);var n=(t+="").replace(/ /g,"").toLowerCase();if(n in f_)return Dt(e,f_[n]),Tt(t,e),e;if("#"!==n.charAt(0)){var o=n.indexOf("("),a=n.indexOf(")");if(-1!==o&&a+1===n.length){var r=n.substr(0,o),s=n.substr(o+1,a-(o+1)).split(","),l=1;switch(r){case"rgba":if(4!==s.length)return void It(e,0,0,0,1);l=bt(s.pop());case"rgb":return 3!==s.length?void It(e,0,0,0,1):(It(e,wt(s[0]),wt(s[1]),wt(s[2]),l),Tt(t,e),e);case"hsla":return 4!==s.length?void It(e,0,0,0,1):(s[3]=bt(s[3]),Ct(s,e),Tt(t,e),e);case"hsl":return 3!==s.length?void It(e,0,0,0,1):(Ct(s,e),Tt(t,e),e);default:return}}It(e,0,0,0,1)}else{if(4===n.length)return(u=parseInt(n.substr(1),16))>=0&&u<=4095?(It(e,(3840&u)>>4|(3840&u)>>8,240&u|(240&u)>>4,15&u|(15&u)<<4,1),Tt(t,e),e):void It(e,0,0,0,1);if(7===n.length){var u=parseInt(n.substr(1),16);return u>=0&&u<=16777215?(It(e,(16711680&u)>>16,(65280&u)>>8,255&u,1),Tt(t,e),e):void It(e,0,0,0,1)}}}}function Ct(t,e){var i=(parseFloat(t[0])%360+360)%360/360,n=bt(t[1]),o=bt(t[2]),a=o<=.5?o*(n+1):o+n-o*n,r=2*o-a;return e=e||[],It(e,yt(255*St(r,a,i+1/3)),yt(255*St(r,a,i)),yt(255*St(r,a,i-1/3)),1),4===t.length&&(e[3]=t[3]),e}function Lt(t){if(t){var e,i,n=t[0]/255,o=t[1]/255,a=t[2]/255,r=Math.min(n,o,a),s=Math.max(n,o,a),l=s-r,u=(s+r)/2;if(0===l)e=0,i=0;else{i=u<.5?l/(s+r):l/(2-s-r);var h=((s-n)/6+l/2)/l,c=((s-o)/6+l/2)/l,d=((s-a)/6+l/2)/l;n===s?e=d-c:o===s?e=1/3+h-d:a===s&&(e=2/3+c-h),e<0&&(e+=1),e>1&&(e-=1)}var f=[360*e,i,u];return null!=t[3]&&f.push(t[3]),f}}function kt(t,e){var i=At(t);if(i){for(var n=0;n<3;n++)i[n]=e<0?i[n]*(1-e)|0:(255-i[n])*e+i[n]|0,i[n]>255?i[n]=255:t[n]<0&&(i[n]=0);return Rt(i,4===i.length?"rgba":"rgb")}}function Pt(t){var e=At(t);if(e)return((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1)}function Nt(t,e,i){if(e&&e.length&&t>=0&&t<=1){i=i||[];var n=t*(e.length-1),o=Math.floor(n),a=Math.ceil(n),r=e[o],s=e[a],l=n-o;return i[0]=yt(Mt(r[0],s[0],l)),i[1]=yt(Mt(r[1],s[1],l)),i[2]=yt(Mt(r[2],s[2],l)),i[3]=_t(Mt(r[3],s[3],l)),i}}function Ot(t,e,i){if(e&&e.length&&t>=0&&t<=1){var n=t*(e.length-1),o=Math.floor(n),a=Math.ceil(n),r=At(e[o]),s=At(e[a]),l=n-o,u=Rt([yt(Mt(r[0],s[0],l)),yt(Mt(r[1],s[1],l)),yt(Mt(r[2],s[2],l)),_t(Mt(r[3],s[3],l))],"rgba");return i?{color:u,leftIndex:o,rightIndex:a,value:n}:u}}function Et(t,e,i,n){if(t=At(t))return t=Lt(t),null!=e&&(t[0]=xt(e)),null!=i&&(t[1]=bt(i)),null!=n&&(t[2]=bt(n)),Rt(Ct(t),"rgba")}function zt(t,e){if((t=At(t))&&null!=e)return t[3]=_t(e),Rt(t,"rgba")}function Rt(t,e){if(t&&t.length){var i=t[0]+","+t[1]+","+t[2];return"rgba"!==e&&"hsva"!==e&&"hsla"!==e||(i+=","+t[3]),e+"("+i+")"}}function Bt(t,e){return t[e]}function Vt(t,e,i){t[e]=i}function Gt(t,e,i){return(e-t)*i+t}function Ft(t,e,i){return i>.5?e:t}function Wt(t,e,i,n,o){var a=t.length;if(1==o)for(s=0;so)t.length=o;else for(r=n;r=0&&!(m[i]<=e);i--);i=Math.min(i,u-2)}else{for(i=L;ie);i++);i=Math.min(i-1,u-2)}L=i,k=e;var n=m[i+1]-m[i];if(0!==n)if(I=(e-m[i])/n,l)if(T=v[i],D=v[0===i?i:i-1],A=v[i>u-2?u-1:i+1],C=v[i>u-3?u-1:i+2],d)Ut(D,T,A,C,I,I*I,I*I*I,r(t,o),g);else{if(f)a=Ut(D,T,A,C,I,I*I,I*I*I,P,1),a=Yt(P);else{if(p)return Ft(T,A,I);a=jt(D,T,A,C,I,I*I,I*I*I)}s(t,o,a)}else if(d)Wt(v[i],v[i+1],I,r(t,o),g);else{var a;if(f)Wt(v[i],v[i+1],I,P,1),a=Yt(P);else{if(p)return Ft(v[i],v[i+1],I);a=Gt(v[i],v[i+1],I)}s(t,o,a)}},ondestroy:i});return e&&"spline"!==e&&(N.easing=e),N}}}function Kt(t,e,i,n){i<0&&(t+=i,i=-i),n<0&&(e+=n,n=-n),this.x=t,this.y=e,this.width=i,this.height=n}function Jt(t){for(var e=0;t>=k_;)e|=1&t,t>>=1;return t+e}function Qt(t,e,i,n){var o=e+1;if(o===i)return 1;if(n(t[o++],t[e])<0){for(;o=0;)o++;return o-e}function te(t,e,i){for(i--;e>>1])<0?l=a:s=a+1;var u=n-s;switch(u){case 3:t[s+3]=t[s+2];case 2:t[s+2]=t[s+1];case 1:t[s+1]=t[s];break;default:for(;u>0;)t[s+u]=t[s+u-1],u--}t[s]=r}}function ie(t,e,i,n,o,a){var r=0,s=0,l=1;if(a(t,e[i+o])>0){for(s=n-o;l0;)r=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),r+=o,l+=o}else{for(s=o+1;ls&&(l=s);var u=r;r=o-l,l=o-u}for(r++;r>>1);a(t,e[i+h])>0?r=h+1:l=h}return l}function ne(t,e,i,n,o,a){var r=0,s=0,l=1;if(a(t,e[i+o])<0){for(s=o+1;ls&&(l=s);var u=r;r=o-l,l=o-u}else{for(s=n-o;l=0;)r=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),r+=o,l+=o}for(r++;r>>1);a(t,e[i+h])<0?l=h:r=h+1}return l}function oe(t,e){function i(i){var s=a[i],u=r[i],h=a[i+1],c=r[i+1];r[i]=u+c,i===l-3&&(a[i+1]=a[i+2],r[i+1]=r[i+2]),l--;var d=ne(t[h],t,s,u,0,e);s+=d,0!==(u-=d)&&0!==(c=ie(t[s+u-1],t,h,c,c-1,e))&&(u<=c?n(s,u,h,c):o(s,u,h,c))}function n(i,n,o,a){var r=0;for(r=0;r=P_||f>=P_);if(p)break;g<0&&(g=0),g+=2}if((s=g)<1&&(s=1),1===n){for(r=0;r=0;r--)t[f+r]=t[d+r];if(0===n){v=!0;break}}if(t[c--]=u[h--],1==--a){v=!0;break}if(0!=(m=a-ie(t[l],u,0,a,a-1,e))){for(a-=m,f=(c-=m)+1,d=(h-=m)+1,r=0;r=P_||m>=P_);if(v)break;p<0&&(p=0),p+=2}if((s=p)<1&&(s=1),1===a){for(f=(c-=n)+1,d=(l-=n)+1,r=n-1;r>=0;r--)t[f+r]=t[d+r];t[c]=u[h]}else{if(0===a)throw new Error;for(d=c-(a-1),r=0;r=0;r--)t[f+r]=t[d+r];t[c]=u[h]}else for(d=c-(a-1),r=0;r1;){var t=l-2;if(t>=1&&r[t-1]<=r[t]+r[t+1]||t>=2&&r[t-2]<=r[t]+r[t-1])r[t-1]r[t+1])break;i(t)}},this.forceMergeRuns=function(){for(;l>1;){var t=l-2;t>0&&r[t-1]s&&(l=s),ee(t,i,i+l,i+a,e),a=l}r.pushRun(i,a),r.mergeRuns(),o-=a,i+=a}while(0!==o);r.forceMergeRuns()}}function re(t,e){return t.zlevel===e.zlevel?t.z===e.z?t.z2-e.z2:t.z-e.z:t.zlevel-e.zlevel}function se(t,e,i){var n=null==e.x?0:e.x,o=null==e.x2?1:e.x2,a=null==e.y?0:e.y,r=null==e.y2?0:e.y2;return e.global||(n=n*i.width+i.x,o=o*i.width+i.x,a=a*i.height+i.y,r=r*i.height+i.y),n=isNaN(n)?0:n,o=isNaN(o)?1:o,a=isNaN(a)?0:a,r=isNaN(r)?0:r,t.createLinearGradient(n,a,o,r)}function le(t,e,i){var n=i.width,o=i.height,a=Math.min(n,o),r=null==e.x?.5:e.x,s=null==e.y?.5:e.y,l=null==e.r?.5:e.r;return e.global||(r=r*n+i.x,s=s*o+i.y,l*=a),t.createRadialGradient(r,s,0,r,s,l)}function ue(){return!1}function he(t,e,i){var n=Vx(),o=e.getWidth(),a=e.getHeight(),r=n.style;return r&&(r.position="absolute",r.left=0,r.top=0,r.width=o+"px",r.height=a+"px",n.setAttribute("data-zr-dom-id",t)),n.width=o*i,n.height=a*i,n}function ce(t){if("string"==typeof t){var e=Z_.get(t);return e&&e.image}return t}function de(t,e,i,n,o){if(t){if("string"==typeof t){if(e&&e.__zrImageSrc===t||!i)return e;var a=Z_.get(t),r={hostEl:i,cb:n,cbPayload:o};return a?!pe(e=a.image)&&a.pending.push(r):(!e&&(e=new Image),e.onload=fe,Z_.put(t,e.__cachedImgObj={image:e,pending:[r]}),e.src=e.__zrImageSrc=t),e}return t}return e}function fe(){var t=this.__cachedImgObj;this.onload=this.__cachedImgObj=null;for(var e=0;eX_&&(j_=0,U_={}),j_++,U_[i]=o,o}function me(t,e,i,n,o,a,r){return a?ye(t,e,i,n,o,a,r):ve(t,e,i,n,o,r)}function ve(t,e,i,n,o,a){var r=Ae(t,e,o,a),s=ge(t,e);o&&(s+=o[1]+o[3]);var l=r.outerHeight,u=new Kt(xe(0,s,i),_e(0,l,n),s,l);return u.lineHeight=r.lineHeight,u}function ye(t,e,i,n,o,a,r){var s=Ce(t,{rich:a,truncate:r,font:e,textAlign:i,textPadding:o}),l=s.outerWidth,u=s.outerHeight;return new Kt(xe(0,l,i),_e(0,u,n),l,u)}function xe(t,e,i){return"right"===i?t-=e:"center"===i&&(t-=e/2),t}function _e(t,e,i){return"middle"===i?t-=e/2:"bottom"===i&&(t-=e),t}function we(t,e,i){var n=e.x,o=e.y,a=e.height,r=e.width,s=a/2,l="left",u="top";switch(t){case"left":n-=i,o+=s,l="right",u="middle";break;case"right":n+=i+r,o+=s,u="middle";break;case"top":n+=r/2,o-=i,l="center",u="bottom";break;case"bottom":n+=r/2,o+=a+i,l="center";break;case"inside":n+=r/2,o+=s,l="center",u="middle";break;case"insideLeft":n+=i,o+=s,u="middle";break;case"insideRight":n+=r-i,o+=s,l="right",u="middle";break;case"insideTop":n+=r/2,o+=i,l="center";break;case"insideBottom":n+=r/2,o+=a-i,l="center",u="bottom";break;case"insideTopLeft":n+=i,o+=i;break;case"insideTopRight":n+=r-i,o+=i,l="right";break;case"insideBottomLeft":n+=i,o+=a-i,u="bottom";break;case"insideBottomRight":n+=r-i,o+=a-i,l="right",u="bottom"}return{x:n,y:o,textAlign:l,textVerticalAlign:u}}function be(t,e,i,n,o){if(!e)return"";var a=(t+"").split("\n");o=Se(e,i,n,o);for(var r=0,s=a.length;r=r;l++)s-=r;var u=ge(i);return u>s&&(i="",u=0),s=t-u,n.ellipsis=i,n.ellipsisWidth=u,n.contentWidth=s,n.containerWidth=t,n}function Me(t,e){var i=e.containerWidth,n=e.font,o=e.contentWidth;if(!i)return"";var a=ge(t,n);if(a<=i)return t;for(var r=0;;r++){if(a<=o||r>=e.maxIterations){t+=e.ellipsis;break}var s=0===r?Ie(t,o,e.ascCharWidth,e.cnCharWidth):a>0?Math.floor(t.length*o/a):0;a=ge(t=t.substr(0,s),n)}return""===t&&(t=e.placeholder),t}function Ie(t,e,i,n){for(var o=0,a=0,r=t.length;al)t="",a=[];else if(null!=u)for(var h=Se(u-(i?i[1]+i[3]:0),e,n.ellipsis,{minChar:n.minChar,placeholder:n.placeholder}),c=0,d=a.length;co&&Le(i,t.substring(o,a)),Le(i,n[2],n[1]),o=Y_.lastIndex}of)return{lines:[],width:0,height:0};k.textWidth=ge(k.text,_);var b=y.textWidth,S=null==b||"auto"===b;if("string"==typeof b&&"%"===b.charAt(b.length-1))k.percentWidth=b,u.push(k),b=0;else{if(S){b=k.textWidth;var M=y.textBackgroundColor,I=M&&M.image;I&&pe(I=ce(I))&&(b=Math.max(b,I.width*w/I.height))}var D=x?x[1]+x[3]:0;b+=D;var C=null!=d?d-m:null;null!=C&&Cl&&(i*=l/(c=i+n),n*=l/c),o+a>l&&(o*=l/(c=o+a),a*=l/c),n+o>u&&(n*=u/(c=n+o),o*=u/c),i+a>u&&(i*=u/(c=i+a),a*=u/c),t.moveTo(r+i,s),t.lineTo(r+l-n,s),0!==n&&t.arc(r+l-n,s+n,n,-Math.PI/2,0),t.lineTo(r+l,s+u-o),0!==o&&t.arc(r+l-o,s+u-o,o,0,Math.PI/2),t.lineTo(r+a,s+u),0!==a&&t.arc(r+a,s+u-a,a,Math.PI/2,Math.PI),t.lineTo(r,s+i),0!==i&&t.arc(r+i,s+i,i,Math.PI,1.5*Math.PI)}function Ne(t){return Oe(t),d(t.rich,Oe),t}function Oe(t){if(t){t.font=ke(t);var e=t.textAlign;"middle"===e&&(e="center"),t.textAlign=null==e||K_[e]?e:"left";var i=t.textVerticalAlign||t.textBaseline;"center"===i&&(i="middle"),t.textVerticalAlign=null==i||J_[i]?i:"top",t.textPadding&&(t.textPadding=L(t.textPadding))}}function Ee(t,e,i,n,o){n.rich?Re(t,e,i,n,o):ze(t,e,i,n,o)}function ze(t,e,i,n,o){var a=Ue(e,"font",n.font||q_),r=n.textPadding,s=t.__textCotentBlock;s&&!t.__dirty||(s=t.__textCotentBlock=Ae(i,a,r,n.truncate));var l=s.outerHeight,u=s.lines,h=s.lineHeight,c=Ze(l,n,o),d=c.baseX,f=c.baseY,p=c.textAlign,g=c.textVerticalAlign;Ve(e,n,o,d,f);var m=_e(f,l,g),v=d,y=m,x=Fe(n);if(x||r){var _=ge(i,a);r&&(_+=r[1]+r[3]);var w=xe(d,_,p);x&&We(t,e,n,w,m,_,l),r&&(v=qe(d,p,r),y+=r[0])}Ue(e,"textAlign",p||"left"),Ue(e,"textBaseline","middle"),Ue(e,"shadowBlur",n.textShadowBlur||0),Ue(e,"shadowColor",n.textShadowColor||"transparent"),Ue(e,"shadowOffsetX",n.textShadowOffsetX||0),Ue(e,"shadowOffsetY",n.textShadowOffsetY||0),y+=h/2;var b=n.textStrokeWidth,S=je(n.textStroke,b),M=Xe(n.textFill);S&&(Ue(e,"lineWidth",b),Ue(e,"strokeStyle",S)),M&&Ue(e,"fillStyle",M);for(var I=0;I=0&&"right"===(_=b[C]).textAlign;)Ge(t,e,_,n,M,v,A,"right"),I-=_.width,A-=_.width,C--;for(T+=(a-(T-m)-(y-A)-I)/2;D<=C;)Ge(t,e,_=b[D],n,M,v,T+_.width/2,"center"),T+=_.width,D++;v+=M}}function Ve(t,e,i,n,o){if(i&&e.textRotation){var a=e.textOrigin;"center"===a?(n=i.width/2+i.x,o=i.height/2+i.y):a&&(n=a[0]+i.x,o=a[1]+i.y),t.translate(n,o),t.rotate(-e.textRotation),t.translate(-n,-o)}}function Ge(t,e,i,n,o,a,r,s){var l=n.rich[i.styleName]||{},u=i.textVerticalAlign,h=a+o/2;"top"===u?h=a+i.height/2:"bottom"===u&&(h=a+o-i.height/2),!i.isLineHolder&&Fe(l)&&We(t,e,l,"right"===s?r-i.width:"center"===s?r-i.width/2:r,h-i.height/2,i.width,i.height);var c=i.textPadding;c&&(r=qe(r,s,c),h-=i.height/2-c[2]-i.textHeight/2),Ue(e,"shadowBlur",A(l.textShadowBlur,n.textShadowBlur,0)),Ue(e,"shadowColor",l.textShadowColor||n.textShadowColor||"transparent"),Ue(e,"shadowOffsetX",A(l.textShadowOffsetX,n.textShadowOffsetX,0)),Ue(e,"shadowOffsetY",A(l.textShadowOffsetY,n.textShadowOffsetY,0)),Ue(e,"textAlign",s),Ue(e,"textBaseline","middle"),Ue(e,"font",i.font||q_);var d=je(l.textStroke||n.textStroke,p),f=Xe(l.textFill||n.textFill),p=T(l.textStrokeWidth,n.textStrokeWidth);d&&(Ue(e,"lineWidth",p),Ue(e,"strokeStyle",d),e.strokeText(i.text,r,h)),f&&(Ue(e,"fillStyle",f),e.fillText(i.text,r,h))}function Fe(t){return t.textBackgroundColor||t.textBorderWidth&&t.textBorderColor}function We(t,e,i,n,o,a,r){var s=i.textBackgroundColor,l=i.textBorderWidth,u=i.textBorderColor,h=_(s);if(Ue(e,"shadowBlur",i.textBoxShadowBlur||0),Ue(e,"shadowColor",i.textBoxShadowColor||"transparent"),Ue(e,"shadowOffsetX",i.textBoxShadowOffsetX||0),Ue(e,"shadowOffsetY",i.textBoxShadowOffsetY||0),h||l&&u){e.beginPath();var c=i.textBorderRadius;c?Pe(e,{x:n,y:o,width:a,height:r,r:c}):e.rect(n,o,a,r),e.closePath()}if(h)Ue(e,"fillStyle",s),e.fill();else if(w(s)){var d=s.image;(d=de(d,null,t,He,s))&&pe(d)&&e.drawImage(d,n,o,a,r)}l&&u&&(Ue(e,"lineWidth",l),Ue(e,"strokeStyle",u),e.stroke())}function He(t,e){e.image=t}function Ze(t,e,i){var n=e.x||0,o=e.y||0,a=e.textAlign,r=e.textVerticalAlign;if(i){var s=e.textPosition;if(s instanceof Array)n=i.x+Ye(s[0],i.width),o=i.y+Ye(s[1],i.height);else{var l=we(s,i,e.textDistance);n=l.x,o=l.y,a=a||l.textAlign,r=r||l.textVerticalAlign}var u=e.textOffset;u&&(n+=u[0],o+=u[1])}return{baseX:n,baseY:o,textAlign:a,textVerticalAlign:r}}function Ue(t,e,i){return t[e]=E_(t,e,i),t[e]}function je(t,e){return null==t||e<=0||"transparent"===t||"none"===t?null:t.image||t.colorStops?"#000":t}function Xe(t){return null==t||"none"===t?null:t.image||t.colorStops?"#000":t}function Ye(t,e){return"string"==typeof t?t.lastIndexOf("%")>=0?parseFloat(t)/100*e:parseFloat(t):t}function qe(t,e,i){return"right"===e?t-i[1]:"center"===e?t+i[3]/2-i[1]/2:t+i[3]}function $e(t,e){return null!=t&&(t||e.textBackgroundColor||e.textBorderWidth&&e.textBorderColor||e.textPadding)}function Ke(t){t=t||{},D_.call(this,t);for(var e in t)t.hasOwnProperty(e)&&"style"!==e&&(this[e]=t[e]);this.style=new R_(t.style,this),this._rect=null,this.__clipPaths=[]}function Je(t){Ke.call(this,t)}function Qe(t){return parseInt(t,10)}function ti(t){return!!t&&(!!t.__builtin__||"function"==typeof t.resize&&"function"==typeof t.refresh)}function ei(t,e,i){return ew.copy(t.getBoundingRect()),t.transform&&ew.applyTransform(t.transform),iw.width=e,iw.height=i,!ew.intersect(iw)}function ii(t,e){if(t==e)return!1;if(!t||!e||t.length!==e.length)return!0;for(var i=0;i=0){var o="touchend"!=n?e.targetTouches[0]:e.changedTouches[0];o&&ri(t,o,e,i)}else ri(t,e,e,i),e.zrDelta=e.wheelDelta?e.wheelDelta/120:-(e.detail||0)/3;var a=e.button;return null==e.which&&void 0!==a&&aw.test(e.type)&&(e.which=1&a?1:2&a?3:4&a?2:0),e}function ui(t,e,i){ow?t.addEventListener(e,i):t.attachEvent("on"+e,i)}function hi(t,e,i){ow?t.removeEventListener(e,i):t.detachEvent("on"+e,i)}function ci(t){return t.which>1}function di(t){var e=t[1][0]-t[0][0],i=t[1][1]-t[0][1];return Math.sqrt(e*e+i*i)}function fi(t){return[(t[0][0]+t[1][0])/2,(t[0][1]+t[1][1])/2]}function pi(t){return"mousewheel"===t&&Ax.browser.firefox?"DOMMouseScroll":t}function gi(t,e,i){var n=t._gestureMgr;"start"===i&&n.clear();var o=n.recognize(e,t.handler.findHover(e.zrX,e.zrY,null).target,t.dom);if("end"===i&&n.clear(),o){var a=o.type;e.gestureEvent=a,t.handler.dispatchToElement({target:o.target},a,o.event)}}function mi(t){t._touching=!0,clearTimeout(t._touchTimer),t._touchTimer=setTimeout(function(){t._touching=!1},700)}function vi(t){var e=t.pointerType;return"pen"===e||"touch"===e}function yi(t){function e(t,e){return function(){if(!e._touching)return t.apply(e,arguments)}}d(cw,function(e){t._handlers[e]=m(pw[e],t)}),d(fw,function(e){t._handlers[e]=m(pw[e],t)}),d(hw,function(i){t._handlers[i]=e(pw[i],t)})}function xi(t){function e(e,i){d(e,function(e){ui(t,pi(e),i._handlers[e])},i)}$x.call(this),this.dom=t,this._touching=!1,this._touchTimer,this._gestureMgr=new lw,this._handlers={},yi(this),Ax.pointerEventsSupported?e(fw,this):(Ax.touchEventsSupported&&e(cw,this),e(hw,this))}function _i(t,e){var i=new xw(Dx(),t,e);return yw[i.id]=i,i}function wi(t,e){vw[t]=e}function bi(t){delete yw[t]}function Si(t){return t instanceof Array?t:null==t?[]:[t]}function Mi(t,e,i){if(t){t[e]=t[e]||{},t.emphasis=t.emphasis||{},t.emphasis[e]=t.emphasis[e]||{};for(var n=0,o=i.length;n=i.length&&i.push({option:t})}}),i}function Ai(t){var e=z();ww(t,function(t,i){var n=t.exist;n&&e.set(n.id,t)}),ww(t,function(t,i){var n=t.option;k(!n||null==n.id||!e.get(n.id)||e.get(n.id)===t,"id duplicates: "+(n&&n.id)),n&&null!=n.id&&e.set(n.id,t),!t.keyInfo&&(t.keyInfo={})}),ww(t,function(t,i){var n=t.exist,o=t.option,a=t.keyInfo;if(bw(o)){if(a.name=null!=o.name?o.name+"":n?n.name:Mw+i,n)a.id=n.id;else if(null!=o.id)a.id=o.id+"";else{var r=0;do{a.id="\0"+a.name+"\0"+r++}while(e.get(a.id))}e.set(a.id,t)}})}function Ci(t){var e=t.name;return!(!e||!e.indexOf(Mw))}function Li(t){return bw(t)&&t.id&&0===(t.id+"").indexOf("\0_ec_\0")}function ki(t,e){function i(t,e,i){for(var n=0,o=t.length;n-Rw&&tRw||t<-Rw}function Xi(t,e,i,n,o){var a=1-o;return a*a*(a*t+3*o*e)+o*o*(o*n+3*a*i)}function Yi(t,e,i,n,o){var a=1-o;return 3*(((e-t)*a+2*(i-e)*o)*a+(n-i)*o*o)}function qi(t,e,i,n,o,a){var r=n+3*(e-i)-t,s=3*(i-2*e+t),l=3*(e-t),u=t-o,h=s*s-3*r*l,c=s*l-9*r*u,d=l*l-3*s*u,f=0;if(Ui(h)&&Ui(c))Ui(s)?a[0]=0:(M=-l/s)>=0&&M<=1&&(a[f++]=M);else{var p=c*c-4*h*d;if(Ui(p)){var g=c/h,m=-g/2;(M=-s/r+g)>=0&&M<=1&&(a[f++]=M),m>=0&&m<=1&&(a[f++]=m)}else if(p>0){var v=zw(p),y=h*s+1.5*r*(-c+v),x=h*s+1.5*r*(-c-v);(M=(-s-((y=y<0?-Ew(-y,Gw):Ew(y,Gw))+(x=x<0?-Ew(-x,Gw):Ew(x,Gw))))/(3*r))>=0&&M<=1&&(a[f++]=M)}else{var _=(2*h*s-3*r*c)/(2*zw(h*h*h)),w=Math.acos(_)/3,b=zw(h),S=Math.cos(w),M=(-s-2*b*S)/(3*r),m=(-s+b*(S+Vw*Math.sin(w)))/(3*r),I=(-s+b*(S-Vw*Math.sin(w)))/(3*r);M>=0&&M<=1&&(a[f++]=M),m>=0&&m<=1&&(a[f++]=m),I>=0&&I<=1&&(a[f++]=I)}}return f}function $i(t,e,i,n,o){var a=6*i-12*e+6*t,r=9*e+3*n-3*t-9*i,s=3*e-3*t,l=0;if(Ui(r))ji(a)&&(c=-s/a)>=0&&c<=1&&(o[l++]=c);else{var u=a*a-4*r*s;if(Ui(u))o[0]=-a/(2*r);else if(u>0){var h=zw(u),c=(-a+h)/(2*r),d=(-a-h)/(2*r);c>=0&&c<=1&&(o[l++]=c),d>=0&&d<=1&&(o[l++]=d)}}return l}function Ki(t,e,i,n,o,a){var r=(e-t)*o+t,s=(i-e)*o+e,l=(n-i)*o+i,u=(s-r)*o+r,h=(l-s)*o+s,c=(h-u)*o+u;a[0]=t,a[1]=r,a[2]=u,a[3]=c,a[4]=c,a[5]=h,a[6]=l,a[7]=n}function Ji(t,e,i,n,o,a,r,s,l,u,h){var c,d,f,p,g,m=.005,v=1/0;Fw[0]=l,Fw[1]=u;for(var y=0;y<1;y+=.05)Ww[0]=Xi(t,i,o,r,y),Ww[1]=Xi(e,n,a,s,y),(p=Xx(Fw,Ww))=0&&p=0&&c<=1&&(o[l++]=c);else{var u=r*r-4*a*s;if(Ui(u))(c=-r/(2*a))>=0&&c<=1&&(o[l++]=c);else if(u>0){var h=zw(u),c=(-r+h)/(2*a),d=(-r-h)/(2*a);c>=0&&c<=1&&(o[l++]=c),d>=0&&d<=1&&(o[l++]=d)}}return l}function nn(t,e,i){var n=t+i-2*e;return 0===n?.5:(t-e)/n}function on(t,e,i,n,o){var a=(e-t)*n+t,r=(i-e)*n+e,s=(r-a)*n+a;o[0]=t,o[1]=a,o[2]=s,o[3]=s,o[4]=r,o[5]=i}function an(t,e,i,n,o,a,r,s,l){var u,h=.005,c=1/0;Fw[0]=r,Fw[1]=s;for(var d=0;d<1;d+=.05)Ww[0]=Qi(t,i,o,d),Ww[1]=Qi(e,n,a,d),(m=Xx(Fw,Ww))=0&&m1e-4)return s[0]=t-i,s[1]=e-n,l[0]=t+i,void(l[1]=e+n);if(qw[0]=Xw(o)*i+t,qw[1]=jw(o)*n+e,$w[0]=Xw(a)*i+t,$w[1]=jw(a)*n+e,u(s,qw,$w),h(l,qw,$w),(o%=Yw)<0&&(o+=Yw),(a%=Yw)<0&&(a+=Yw),o>a&&!r?a+=Yw:oo&&(Kw[0]=Xw(f)*i+t,Kw[1]=jw(f)*n+e,u(s,Kw,s),h(l,Kw,l))}function cn(t,e,i,n,o,a,r){if(0===o)return!1;var s=o,l=0,u=t;if(r>e+s&&r>n+s||rt+s&&a>i+s||ae+c&&h>n+c&&h>a+c&&h>s+c||ht+c&&u>i+c&&u>o+c&&u>r+c||ue+u&&l>n+u&&l>a+u||lt+u&&s>i+u&&s>o+u||si||h+uo&&(o+=pb);var d=Math.atan2(l,s);return d<0&&(d+=pb),d>=n&&d<=o||d+pb>=n&&d+pb<=o}function mn(t,e,i,n,o,a){if(a>e&&a>n||ao?r:0}function vn(t,e){return Math.abs(t-e)e&&u>n&&u>a&&u>s||u1&&yn(),c=Xi(e,n,a,s,xb[0]),p>1&&(d=Xi(e,n,a,s,xb[1]))),2==p?me&&s>n&&s>a||s=0&&u<=1){for(var h=0,c=Qi(e,n,a,u),d=0;di||s<-i)return 0;u=Math.sqrt(i*i-s*s);yb[0]=-u,yb[1]=u;var l=Math.abs(n-o);if(l<1e-4)return 0;if(l%mb<1e-4){n=0,o=mb;p=a?1:-1;return r>=yb[0]+t&&r<=yb[1]+t?p:0}if(a){var u=n;n=pn(o),o=pn(u)}else n=pn(n),o=pn(o);n>o&&(o+=mb);for(var h=0,c=0;c<2;c++){var d=yb[c];if(d+t>r){var f=Math.atan2(s,d),p=a?1:-1;f<0&&(f=mb+f),(f>=n&&f<=o||f+mb>=n&&f+mb<=o)&&(f>Math.PI/2&&f<1.5*Math.PI&&(p=-p),h+=p)}}return h}function bn(t,e,i,n,o){for(var a=0,r=0,s=0,l=0,u=0,h=0;h1&&(i||(a+=mn(r,s,l,u,n,o))),1==h&&(l=r=t[h],u=s=t[h+1]),c){case gb.M:r=l=t[h++],s=u=t[h++];break;case gb.L:if(i){if(cn(r,s,t[h],t[h+1],e,n,o))return!0}else a+=mn(r,s,t[h],t[h+1],n,o)||0;r=t[h++],s=t[h++];break;case gb.C:if(i){if(dn(r,s,t[h++],t[h++],t[h++],t[h++],t[h],t[h+1],e,n,o))return!0}else a+=xn(r,s,t[h++],t[h++],t[h++],t[h++],t[h],t[h+1],n,o)||0;r=t[h++],s=t[h++];break;case gb.Q:if(i){if(fn(r,s,t[h++],t[h++],t[h],t[h+1],e,n,o))return!0}else a+=_n(r,s,t[h++],t[h++],t[h],t[h+1],n,o)||0;r=t[h++],s=t[h++];break;case gb.A:var d=t[h++],f=t[h++],p=t[h++],g=t[h++],m=t[h++],v=t[h++],y=(t[h++],1-t[h++]),x=Math.cos(m)*p+d,_=Math.sin(m)*g+f;h>1?a+=mn(r,s,x,_,n,o):(l=x,u=_);var w=(n-d)*g/p+d;if(i){if(gn(d,f,g,m,m+v,y,e,w,o))return!0}else a+=wn(d,f,g,m,m+v,y,w,o);r=Math.cos(m+v)*p+d,s=Math.sin(m+v)*g+f;break;case gb.R:l=r=t[h++],u=s=t[h++];var x=l+t[h++],_=u+t[h++];if(i){if(cn(l,u,x,u,e,n,o)||cn(x,u,x,_,e,n,o)||cn(x,_,l,_,e,n,o)||cn(l,_,l,u,e,n,o))return!0}else a+=mn(x,u,x,_,n,o),a+=mn(l,_,l,u,n,o);break;case gb.Z:if(i){if(cn(r,s,l,u,e,n,o))return!0}else a+=mn(r,s,l,u,n,o);r=l,s=u}}return i||vn(s,u)||(a+=mn(r,s,l,u,n,o)||0),0!==a}function Sn(t,e,i){return bn(t,0,!1,e,i)}function Mn(t,e,i,n){return bn(t,e,!0,i,n)}function In(t){Ke.call(this,t),this.path=null}function Dn(t,e,i,n,o,a,r,s,l,u,h){var c=l*(Pb/180),d=kb(c)*(t-i)/2+Lb(c)*(e-n)/2,f=-1*Lb(c)*(t-i)/2+kb(c)*(e-n)/2,p=d*d/(r*r)+f*f/(s*s);p>1&&(r*=Cb(p),s*=Cb(p));var g=(o===a?-1:1)*Cb((r*r*(s*s)-r*r*(f*f)-s*s*(d*d))/(r*r*(f*f)+s*s*(d*d)))||0,m=g*r*f/s,v=g*-s*d/r,y=(t+i)/2+kb(c)*m-Lb(c)*v,x=(e+n)/2+Lb(c)*m+kb(c)*v,_=Eb([1,0],[(d-m)/r,(f-v)/s]),w=[(d-m)/r,(f-v)/s],b=[(-1*d-m)/r,(-1*f-v)/s],S=Eb(w,b);Ob(w,b)<=-1&&(S=Pb),Ob(w,b)>=1&&(S=0),0===a&&S>0&&(S-=2*Pb),1===a&&S<0&&(S+=2*Pb),h.addData(u,y,x,r,s,_,S,c,a)}function Tn(t){if(!t)return[];var e,i=t.replace(/-/g," -").replace(/ /g," ").replace(/ /g,",").replace(/,,/g,",");for(e=0;e0&&""===f[0]&&f.shift();for(var p=0;p=2){if(o&&"spline"!==o){var a=Hb(n,o,i,e.smoothConstraint);t.moveTo(n[0][0],n[0][1]);for(var r=n.length,s=0;s<(i?r:r-1);s++){var l=a[2*s],u=a[2*s+1],h=n[(s+1)%r];t.bezierCurveTo(l[0],l[1],u[0],u[1],h[0],h[1])}}else{"spline"===o&&(n=Wb(n,i)),t.moveTo(n[0][0],n[0][1]);for(var s=1,c=n.length;s=0)&&(n={textFill:null,textStroke:t.textStroke,textStrokeWidth:t.textStrokeWidth},t.textFill="#fff",null==t.textStroke&&(t.textStroke=i.autoColor,null==t.textStrokeWidth&&(t.textStrokeWidth=2))),n}function uo(t){var e=t.insideRollback;e&&(t.textFill=e.textFill,t.textStroke=e.textStroke,t.textStrokeWidth=e.textStrokeWidth)}function ho(t,e){var i=e||e.getModel("textStyle");return P([t.fontStyle||i&&i.getShallow("fontStyle")||"",t.fontWeight||i&&i.getShallow("fontWeight")||"",(t.fontSize||i&&i.getShallow("fontSize")||12)+"px",t.fontFamily||i&&i.getShallow("fontFamily")||"sans-serif"].join(" "))}function co(t,e,i,n,o,a){if("function"==typeof o&&(a=o,o=null),n&&n.isAnimationEnabled()){var r=t?"Update":"",s=n.getShallow("animationDuration"+r),l=n.getShallow("animationEasing"+r),u=n.getShallow("animationDelay"+r);"function"==typeof u&&(u=u(o,n.getAnimationDelayParams?n.getAnimationDelayParams(e,o):null)),"function"==typeof s&&(s=s(o)),s>0?e.animateTo(i,s,u||0,l,a,!!a):(e.stopAnimation(),e.attr(i),a&&a())}else e.stopAnimation(),e.attr(i),a&&a()}function fo(t,e,i,n,o){co(!0,t,e,i,n,o)}function po(t,e,i,n,o){co(!1,t,e,i,n,o)}function go(t,e){for(var i=lt([]);t&&t!==e;)ht(i,t.getLocalTransform(),i),t=t.parent;return i}function mo(t,e,i){return e&&!c(e)&&(e=o_.getLocalTransform(e)),i&&(e=pt([],e)),Q([],t,e)}function vo(t,e,i){var n=0===e[4]||0===e[5]||0===e[0]?1:Math.abs(2*e[4]/e[0]),o=0===e[4]||0===e[5]||0===e[2]?1:Math.abs(2*e[4]/e[2]),a=["left"===t?-n:"right"===t?n:0,"top"===t?-o:"bottom"===t?o:0];return a=mo(a,e,i),Math.abs(a[0])>Math.abs(a[1])?a[0]>0?"right":"left":a[1]>0?"bottom":"top"}function yo(t,e,i,n){function o(t){var e={position:F(t.position),rotation:t.rotation};return t.shape&&(e.shape=a({},t.shape)),e}if(t&&e){var r=function(t){var e={};return t.traverse(function(t){!t.isGroup&&t.anid&&(e[t.anid]=t)}),e}(t);e.traverse(function(t){if(!t.isGroup&&t.anid){var e=r[t.anid];if(e){var n=o(t);t.attr(o(e)),fo(t,n,i,t.dataIndex)}}})}}function xo(t,e){return f(t,function(t){var i=t[0];i=nS(i,e.x),i=oS(i,e.x+e.width);var n=t[1];return n=nS(n,e.y),n=oS(n,e.y+e.height),[i,n]})}function _o(t,e,i){var n=(e=a({rectHover:!0},e)).style={strokeNoScale:!0};if(i=i||{x:-1,y:-1,width:2,height:2},t)return 0===t.indexOf("image://")?(n.image=t.slice(8),r(n,i),new Je(e)):zn(t.replace("path://",""),e,i,"center")}function wo(t,e,i){this.parentModel=e,this.ecModel=i,this.option=t}function bo(t,e,i){for(var n=0;n0){if(t<=e[0])return i[0];if(t>=e[1])return i[1]}else{if(t>=e[0])return i[0];if(t<=e[1])return i[1]}else{if(t===e[0])return i[0];if(t===e[1])return i[1]}return(t-e[0])/o*a+i[0]}function To(t,e){switch(t){case"center":case"middle":t="50%";break;case"left":case"top":t="0%";break;case"right":case"bottom":t="100%"}return"string"==typeof t?Io(t).match(/%$/)?parseFloat(t)/100*e:parseFloat(t):null==t?NaN:+t}function Ao(t,e,i){return null==e&&(e=10),e=Math.min(Math.max(0,e),20),t=(+t).toFixed(e),i?t:+t}function Co(t){return t.sort(function(t,e){return t-e}),t}function Lo(t){if(t=+t,isNaN(t))return 0;for(var e=1,i=0;Math.round(t*e)/e!==t;)e*=10,i++;return i}function ko(t){var e=t.toString(),i=e.indexOf("e");if(i>0){var n=+e.slice(i+1);return n<0?-n:0}var o=e.indexOf(".");return o<0?0:e.length-1-o}function Po(t,e){var i=Math.log,n=Math.LN10,o=Math.floor(i(t[1]-t[0])/n),a=Math.round(i(Math.abs(e[1]-e[0]))/n),r=Math.min(Math.max(-o+a,0),20);return isFinite(r)?r:20}function No(t,e,i){if(!t[e])return 0;var n=p(t,function(t,e){return t+(isNaN(e)?0:e)},0);if(0===n)return 0;for(var o=Math.pow(10,i),a=f(t,function(t){return(isNaN(t)?0:t)/n*o*100}),r=100*o,s=f(a,function(t){return Math.floor(t)}),l=p(s,function(t,e){return t+e},0),u=f(a,function(t,e){return t-s[e]});lh&&(h=u[d],c=d);++s[c],u[c]=0,++l}return s[e]/o}function Oo(t){var e=2*Math.PI;return(t%e+e)%e}function Eo(t){return t>-gS&&t=-20?+t.toFixed(n<0?-n:0):t}function Go(t){function e(t,i,n){return t.interval[n]=0}function Wo(t){return isNaN(t)?"-":(t=(t+"").split("."))[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(t.length>1?"."+t[1]:"")}function Ho(t,e){return t=(t||"").toLowerCase().replace(/-(.)/g,function(t,e){return e.toUpperCase()}),e&&t&&(t=t.charAt(0).toUpperCase()+t.slice(1)),t}function Zo(t){return String(t).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function Uo(t,e,i){y(e)||(e=[e]);var n=e.length;if(!n)return"";for(var o=e[0].$vars||[],a=0;a':'':""}function Yo(t,e){return t+="","0000".substr(0,e-t.length)+t}function qo(t,e,i){"week"!==t&&"month"!==t&&"quarter"!==t&&"half-year"!==t&&"year"!==t||(t="MM-dd\nyyyy");var n=zo(e),o=i?"UTC":"",a=n["get"+o+"FullYear"](),r=n["get"+o+"Month"]()+1,s=n["get"+o+"Date"](),l=n["get"+o+"Hours"](),u=n["get"+o+"Minutes"](),h=n["get"+o+"Seconds"](),c=n["get"+o+"Milliseconds"]();return t=t.replace("MM",Yo(r,2)).replace("M",r).replace("yyyy",a).replace("yy",a%100).replace("dd",Yo(s,2)).replace("d",s).replace("hh",Yo(l,2)).replace("h",l).replace("mm",Yo(u,2)).replace("m",u).replace("ss",Yo(h,2)).replace("s",h).replace("SSS",Yo(c,3))}function $o(t){return t?t.charAt(0).toUpperCase()+t.substr(1):t}function Ko(t,e,i,n,o){var a=0,r=0;null==n&&(n=1/0),null==o&&(o=1/0);var s=0;e.eachChild(function(l,u){var h,c,d=l.position,f=l.getBoundingRect(),p=e.childAt(u+1),g=p&&p.getBoundingRect();if("horizontal"===t){var m=f.width+(g?-g.x+f.x:0);(h=a+m)>n||l.newline?(a=0,h=m,r+=s+i,s=f.height):s=Math.max(s,f.height)}else{var v=f.height+(g?-g.y+f.y:0);(c=r+v)>o||l.newline?(a+=s+i,r=0,c=v,s=f.width):s=Math.max(s,f.width)}l.newline||(d[0]=a,d[1]=r,"horizontal"===t?a=h+i:r=c+i)})}function Jo(t,e,i){var n=e.width,o=e.height,a=To(t.x,n),r=To(t.y,o),s=To(t.x2,n),l=To(t.y2,o);return(isNaN(a)||isNaN(parseFloat(t.x)))&&(a=0),(isNaN(s)||isNaN(parseFloat(t.x2)))&&(s=n),(isNaN(r)||isNaN(parseFloat(t.y)))&&(r=0),(isNaN(l)||isNaN(parseFloat(t.y2)))&&(l=o),i=xS(i||0),{width:Math.max(s-a-i[1]-i[3],0),height:Math.max(l-r-i[0]-i[2],0)}}function Qo(t,e,i){i=xS(i||0);var n=e.width,o=e.height,a=To(t.left,n),r=To(t.top,o),s=To(t.right,n),l=To(t.bottom,o),u=To(t.width,n),h=To(t.height,o),c=i[2]+i[0],d=i[1]+i[3],f=t.aspect;switch(isNaN(u)&&(u=n-s-d-a),isNaN(h)&&(h=o-l-c-r),null!=f&&(isNaN(u)&&isNaN(h)&&(f>n/o?u=.8*n:h=.8*o),isNaN(u)&&(u=f*h),isNaN(h)&&(h=u/f)),isNaN(a)&&(a=n-s-u-d),isNaN(r)&&(r=o-l-h-c),t.left||t.right){case"center":a=n/2-u/2-i[3];break;case"right":a=n-u-d}switch(t.top||t.bottom){case"middle":case"center":r=o/2-h/2-i[0];break;case"bottom":r=o-h-c}a=a||0,r=r||0,isNaN(u)&&(u=n-d-a-(s||0)),isNaN(h)&&(h=o-c-r-(l||0));var p=new Kt(a+i[3],r+i[0],u,h);return p.margin=i,p}function ta(t,e,i,n,o){var a=!o||!o.hv||o.hv[0],s=!o||!o.hv||o.hv[1],l=o&&o.boundingMode||"all";if(a||s){var u;if("raw"===l)u="group"===t.type?new Kt(0,0,+e.width||0,+e.height||0):t.getBoundingRect();else if(u=t.getBoundingRect(),t.needLocalTransform()){var h=t.getLocalTransform();(u=u.clone()).applyTransform(h)}e=Qo(r({width:u.width,height:u.height},e),i,n);var c=t.position,d=a?e.x-u.x:0,f=s?e.y-u.y:0;t.attr("position","raw"===l?[d,f]:[c[0]+d,c[1]+f])}}function ea(t,e){return null!=t[TS[e][0]]||null!=t[TS[e][1]]&&null!=t[TS[e][2]]}function ia(t,e,i){function n(i,n){var r={},l=0,u={},h=0;if(IS(i,function(e){u[e]=t[e]}),IS(i,function(t){o(e,t)&&(r[t]=u[t]=e[t]),a(r,t)&&l++,a(u,t)&&h++}),s[n])return a(e,i[1])?u[i[2]]=null:a(e,i[2])&&(u[i[1]]=null),u;if(2!==h&&l){if(l>=2)return r;for(var c=0;ce)return t[n];return t[i-1]}function ra(t){var e=t.get("coordinateSystem"),i={coordSysName:e,coordSysDims:[],axisMap:z(),categoryAxisMap:z()},n=zS[e];if(n)return n(t,i,i.axisMap,i.categoryAxisMap),i}function sa(t){return"category"===t.get("type")}function la(t){this.fromDataset=t.fromDataset,this.data=t.data||(t.sourceFormat===GS?{}:[]),this.sourceFormat=t.sourceFormat||FS,this.seriesLayoutBy=t.seriesLayoutBy||HS,this.dimensionsDefine=t.dimensionsDefine,this.encodeDefine=t.encodeDefine&&z(t.encodeDefine),this.startIndex=t.startIndex||0,this.dimensionsDetectCount=t.dimensionsDetectCount}function ua(t){var e=t.option.source,i=FS;if(S(e))i=WS;else if(y(e))for(var n=0,o=e.length;n=e:"max"===i?t<=e:t===e}function Oa(t,e){return t.join(",")===e.join(",")}function Ea(t,e){$S(e=e||{},function(e,i){if(null!=e){var n=t[i];if(kS.hasClass(i)){e=Si(e);var o=Ti(n=Si(n),e);t[i]=JS(o,function(t){return t.option&&t.exist?QS(t.exist,t.option,!0):t.exist||t.option})}else t[i]=QS(n,e,!0)}})}function za(t){var e=t&&t.itemStyle;if(e)for(var i=0,o=nM.length;i=0;p--){var g=t[p];if(s||(d=g.data.rawIndexOf(g.stackedByDimension,c)),d>=0){var m=g.data.getByRawIndex(g.stackResultDimension,d);if(h>=0&&m>0||h<=0&&m<0){h+=m,f=m;break}}}return n[0]=h,n[1]=f,n});r.hostModel.setData(l),e.data=l})}function Ya(t,e){la.isInstance(t)||(t=la.seriesDataToSource(t)),this._source=t;var i=this._data=t.data,n=t.sourceFormat;n===WS&&(this._offset=0,this._dimSize=e,this._data=i),a(this,uM[n===BS?n+"_"+t.seriesLayoutBy:n])}function qa(){return this._data.length}function $a(t){return this._data[t]}function Ka(t){for(var e=0;ee.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function cr(t,e){d(t.CHANGABLE_METHODS,function(i){t.wrapMethod(i,v(dr,e))})}function dr(t){var e=fr(t);e&&e.setOutputEnd(this.count())}function fr(t){var e=(t.ecModel||{}).scheduler,i=e&&e.getPipeline(t.uid);if(i){var n=i.currentTask;if(n){var o=n.agentStubMap;o&&(n=o.get(t.uid))}return n}}function pr(){this.group=new L_,this.uid=Mo("viewChart"),this.renderTask=nr({plan:vr,reset:yr}),this.renderTask.context={view:this}}function gr(t,e){if(t&&(t.trigger(e),"group"===t.type))for(var i=0;i=0?n():c=setTimeout(n,-a),u=o};return d.clear=function(){c&&(clearTimeout(c),c=null)},d.debounceNextCall=function(t){l=t},d}function _r(t,e,i,n){var o=t[e];if(o){var a=o[MM]||o,r=o[DM];if(o[IM]!==i||r!==n){if(null==i||!n)return t[e]=a;(o=t[e]=xr(a,i,"debounce"===n))[MM]=a,o[DM]=n,o[IM]=i}return o}}function wr(t,e){var i=t[e];i&&i[MM]&&(t[e]=i[MM])}function br(t,e,i,n){this.ecInstance=t,this.api=e,this.unfinished,this._dataProcessorHandlers=i.slice(),this._visualHandlers=n.slice(),this._stageTaskMap=z()}function Sr(t,e,i,n,o){function a(t,e){return t.setDirty&&(!t.dirtyMap||t.dirtyMap.get(e.__pipeline.id))}o=o||{};var r;d(e,function(e,s){if(!o.visualType||o.visualType===e.visualType){var l=t._stageTaskMap.get(e.uid),u=l.seriesTaskMap,h=l.overallTask;if(h){var c,d=h.agentStubMap;d.each(function(t){a(o,t)&&(t.dirty(),c=!0)}),c&&h.dirty(),PM(h,n);var f=t.getPerformArgs(h,o.block);d.each(function(t){t.perform(f)}),r|=h.perform(f)}else u&&u.each(function(s,l){a(o,s)&&s.dirty();var u=t.getPerformArgs(s,o.block);u.skip=!e.performRawSeries&&i.isSeriesFiltered(s.context.model),PM(s,n),r|=s.perform(u)})}}),t.unfinished|=r}function Mr(t,e,i,n,o){function a(i){var a=i.uid,s=r.get(a)||r.set(a,nr({plan:Lr,reset:kr,count:Nr}));s.context={model:i,ecModel:n,api:o,useClearVisual:e.isVisual&&!e.isLayout,plan:e.plan,reset:e.reset,scheduler:t},Or(t,i,s)}var r=i.seriesTaskMap||(i.seriesTaskMap=z()),s=e.seriesType,l=e.getTargetSeries;e.createOnAllSeries?n.eachRawSeries(a):s?n.eachRawSeriesByType(s,a):l&&l(n,o).each(a);var u=t._pipelineMap;r.each(function(t,e){u.get(e)||(t.dispose(),r.removeKey(e))})}function Ir(t,e,i,n,o){function a(e){var i=e.uid,n=s.get(i)||s.set(i,nr({reset:Tr,onDirty:Cr}));n.context={model:e,overallProgress:h,isOverallFilter:c},n.agent=r,n.__block=h,Or(t,e,n)}var r=i.overallTask=i.overallTask||nr({reset:Dr});r.context={ecModel:n,api:o,overallReset:e.overallReset,scheduler:t};var s=r.agentStubMap=r.agentStubMap||z(),l=e.seriesType,u=e.getTargetSeries,h=!0,c=e.isOverallFilter;l?n.eachRawSeriesByType(l,a):u?u(n,o).each(a):(h=!1,d(n.getSeries(),a));var f=t._pipelineMap;s.each(function(t,e){f.get(e)||(t.dispose(),s.removeKey(e))})}function Dr(t){t.overallReset(t.ecModel,t.api,t.payload)}function Tr(t,e){return t.overallProgress&&Ar}function Ar(){this.agent.dirty(),this.getDownstream().dirty()}function Cr(){this.agent&&this.agent.dirty()}function Lr(t){return t.plan&&t.plan(t.model,t.ecModel,t.api,t.payload)}function kr(t){if(t.useClearVisual&&t.data.clearAllVisual(),(t.resetDefines=Si(t.reset(t.model,t.ecModel,t.api,t.payload))).length)return Pr}function Pr(t,e){for(var i=e.data,n=e.resetDefines,o=0;oe.get("hoverLayerThreshold")&&!Ax.node&&i.traverse(function(t){t.isGroup||(t.useHoverLayer=!0)})}function es(t,e){var i=t.get("blendMode")||null;e.group.traverse(function(t){t.isGroup||t.style.blend!==i&&t.setStyle("blend",i),t.eachPendingDisplayable&&t.eachPendingDisplayable(function(t){t.setStyle("blend",i)})})}function is(t,e){var i=t.get("z"),n=t.get("zlevel");e.group.traverse(function(t){"group"!==t.type&&(null!=i&&(t.z=i),null!=n&&(t.zlevel=n))})}function ns(t){var e=t._coordSysMgr;return a(new Aa(t),{getCoordinateSystems:m(e.getCoordinateSystems,e),getComponentByElement:function(e){for(;e;){var i=e.__ecComponentInfo;if(null!=i)return t._model.getComponent(i.mainType,i.index);e=e.parent}}})}function os(t){function e(t,e){for(var n=0;n65535?SI:MI}function As(t){var e=t.constructor;return e===Array?t.slice():new e(t)}function Cs(t,e){d(II.concat(e.__wrappedMethods||[]),function(i){e.hasOwnProperty(i)&&(t[i]=e[i])}),t.__wrappedMethods=e.__wrappedMethods}function Ls(t){var e=t._invertedIndicesMap;d(e,function(i,n){var o=t._dimensionInfos[n].ordinalMeta;if(o){i=e[n]=new SI(o.categories.length);for(a=0;a=0?this._indices[t]:-1}function Ns(t,e){var i=t._idList[e];return null==i&&(i=t._getIdFromStore(e)),null==i&&(i=wI+e),i}function Os(t){return y(t)||(t=[t]),t}function Es(t,e){var i=t.dimensions,n=new DI(f(i,t.getDimensionInfo,t),t.hostModel);Cs(n,t);for(var o=n._storage={},r=t._storage,s=a({},t._rawExtent),u=0;u=0?(o[h]=zs(r[h]),s[h]=Rs()):o[h]=r[h])}return n}function zs(t){for(var e=new Array(t.length),i=0;in&&(r=o.interval=n);var s=o.intervalPrecision=Ks(r);return Qs(o.niceTickExtent=[NI(Math.ceil(t[0]/r)*r,s),NI(Math.floor(t[1]/r)*r,s)],t),o}function Ks(t){return ko(t)+2}function Js(t,e,i){t[e]=Math.max(Math.min(t[e],i[1]),i[0])}function Qs(t,e){!isFinite(t[0])&&(t[0]=e[0]),!isFinite(t[1])&&(t[1]=e[1]),Js(t,0,e),Js(t,1,e),t[0]>t[1]&&(t[0]=t[1])}function tl(t,e,i,n){var o=[];if(!t)return o;e[0]1e4)return[];return e[1]>(o.length?o[o.length-1]:i[1])&&o.push(e[1]),o}function el(t){return t.get("stack")||zI+t.seriesIndex}function il(t){return t.dim+t.index}function nl(t,e){var i=[],n=t.axis;if("category"===n.type){for(var o=n.getBandWidth(),a=0;a=0?"p":"n",b=m;p&&(a[r][_]||(a[r][_]={p:m,n:m}),b=a[r][_][w]);var S,M,I,D;if(g)S=b,M=(T=i.dataToPoint([x,_]))[1]+l,I=T[0]-m,D=u,Math.abs(I)0&&s>0&&!l&&(r=0),r<0&&s<0&&!u&&(s=0));var c=e.ecModel;if(c&&"time"===a){var d,f=[];if(c.eachSeriesByType("bar",function(t){t.coordinateSystem&&"cartesian2d"===t.coordinateSystem.type&&(f.push(t),d|=t.getBaseAxis()===e.axis)}),d){var p=ul(r,s,e,f);r=p.min,s=p.max}}return[r,s]}function ul(t,e,i,n){var o=i.axis.getExtent(),a=o[1]-o[0],r=ol(n)[i.axis.dim+i.axis.index];if(void 0===r)return{min:t,max:e};var s=1/0;d(r,function(t){s=Math.min(t.offset,s)});var l=-1/0;d(r,function(t){l=Math.max(t.offset+t.width,l)}),s=Math.abs(s),l=Math.abs(l);var u=s+l,h=e-t,c=h/(1-(s+l)/a)-h;return e+=c*(l/u),t-=c*(s/u),{min:t,max:e}}function hl(t,e){var i=ll(t,e),n=null!=e.getMin(),o=null!=e.getMax(),a=e.get("splitNumber");"log"===t.type&&(t.base=e.get("logBase"));var r=t.type;t.setExtent(i[0],i[1]),t.niceExtent({splitNumber:a,fixMin:n,fixMax:o,minInterval:"interval"===r||"time"===r?e.get("minInterval"):null,maxInterval:"interval"===r||"time"===r?e.get("maxInterval"):null});var s=e.get("interval");null!=s&&t.setInterval&&t.setInterval(s)}function cl(t,e){if(e=e||t.get("type"))switch(e){case"category":return new PI(t.getOrdinalMeta?t.getOrdinalMeta():t.getCategories(),[1/0,-1/0]);case"value":return new EI;default:return(js.getClass(e)||EI).create(t)}}function dl(t,e,i,n,o){var a,r=0,s=0,l=(n-o)/180*Math.PI,u=1;e.length>40&&(u=Math.floor(e.length/40));for(var h=0;h1?u:(r+1)*u-1}function fl(t,e){var i=t.scale,n=i.getTicksLabels(),o=i.getTicks();return"string"==typeof e?(e=function(t){return function(e){return t.replace("{value}",null!=e?e:"")}}(e),f(n,e)):"function"==typeof e?f(o,function(i,n){return e(pl(t,i),n)},this):n}function pl(t,e){return"category"===t.type?t.scale.getLabel(e):e}function gl(t,e){if("image"!==this.type){var i=this.style,n=this.shape;n&&"line"===n.symbolType?i.stroke=t:this.__isEmptyBrush?(i.stroke=t,i.fill=e||"#fff"):(i.fill&&(i.fill=t),i.stroke&&(i.stroke=t)),this.dirty(!1)}}function ml(t,e,i,n,o,a,r){var s=0===t.indexOf("empty");s&&(t=t.substr(5,1).toLowerCase()+t.substr(6));var l;return l=0===t.indexOf("image://")?Rn(t.slice(8),new Kt(e,i,n,o),r?"center":"cover"):0===t.indexOf("path://")?zn(t.slice(7),{},new Kt(e,i,n,o),r?"center":"cover"):new aD({shape:{symbolType:t,x:e,y:i,width:n,height:o}}),l.__isEmptyBrush=s,l.setColor=gl,l.setColor(a),l}function vl(t,e){return Math.abs(t-e)>1^-(1&s),l=l>>1^-(1&l),o=s+=o,a=l+=a,n.push([s/i,l/i])}return n}function bl(t,e){var i=(t[1]-t[0])/e/2;t[0]+=i,t[1]-=i}function Sl(t,e){var i=t.mapDimension("defaultedLabel",!0),n=i.length;if(1===n)return er(t,e,i[0]);if(n){for(var o=[],a=0;a0?i=n[0]:n[1]<0&&(i=n[1]),i}function Ol(t,e,i,n){var o=NaN;t.stacked&&(o=i.get(i.getCalculationInfo("stackedOverDimension"),n)),isNaN(o)&&(o=t.valueStart);var a=t.baseDataOffset,r=[];return r[a]=i.get(t.baseDim,n),r[1-a]=o,e.dataToPoint(r)}function El(t,e){var i=[];return e.diff(t).add(function(t){i.push({cmd:"+",idx:t})}).update(function(t,e){i.push({cmd:"=",idx:e,idx1:t})}).remove(function(t){i.push({cmd:"-",idx:t})}).execute(),i}function zl(t){return isNaN(t[0])||isNaN(t[1])}function Rl(t,e,i,n,o,a,r,s,l,u,h){return null==u?Bl(e,"x")?Vl(t,e,i,n,o,a,r,s,l,"x",h):Bl(e,"y")?Vl(t,e,i,n,o,a,r,s,l,"y",h):Gl.apply(this,arguments):"none"!==u&&Bl(e,u)?Vl.apply(this,arguments):Gl.apply(this,arguments)}function Bl(t,e){if(t.length<=1)return!0;for(var i="x"===e?0:1,n=t[0][i],o=0,a=1;a=0!=o>=0)return!1;isNaN(r)||0===r||(o=r,n=t[a][i])}return!0}function Vl(t,e,i,n,o,a,r,s,l,u,h){for(var c=0,d=i,f=0;f=o||d<0)break;if(zl(p)){if(h){d+=a;continue}break}if(d===i)t[a>0?"moveTo":"lineTo"](p[0],p[1]);else if(l>0){var g=e[c],m="y"===u?1:0,v=(p[m]-g[m])*l;ID(TD,g),TD[m]=g[m]+v,ID(AD,p),AD[m]=p[m]-v,t.bezierCurveTo(TD[0],TD[1],AD[0],AD[1],p[0],p[1])}else t.lineTo(p[0],p[1]);c=d,d+=a}return f}function Gl(t,e,i,n,o,a,r,s,l,u,h){for(var c=0,d=i,f=0;f=o||d<0)break;if(zl(p)){if(h){d+=a;continue}break}if(d===i)t[a>0?"moveTo":"lineTo"](p[0],p[1]),ID(TD,p);else if(l>0){var g=d+a,m=e[g];if(h)for(;m&&zl(e[g]);)m=e[g+=a];var v=.5,y=e[c];if(!(m=e[g])||zl(m))ID(AD,p);else{zl(m)&&!h&&(m=p),U(DD,m,y);var x,_;if("x"===u||"y"===u){var w="x"===u?0:1;x=Math.abs(p[w]-y[w]),_=Math.abs(p[w]-m[w])}else x=jx(p,y),_=jx(p,m);MD(AD,p,DD,-l*(1-(v=_/(_+x))))}bD(TD,TD,s),SD(TD,TD,r),bD(AD,AD,s),SD(AD,AD,r),t.bezierCurveTo(TD[0],TD[1],AD[0],AD[1],p[0],p[1]),MD(TD,p,DD,l*v)}else t.lineTo(p[0],p[1]);c=d,d+=a}return f}function Fl(t,e){var i=[1/0,1/0],n=[-1/0,-1/0];if(e)for(var o=0;on[0]&&(n[0]=a[0]),a[1]>n[1]&&(n[1]=a[1])}return{min:e?i:n,max:e?n:i}}function Wl(t,e){if(t.length===e.length){for(var i=0;ie[0]?1:-1;e[0]+=n*i,e[1]-=n*i}return e}function Ul(t,e,i){if(!i.valueDim)return[];for(var n=[],o=0,a=e.count();o=0;a--){var r=i[a].dimension,s=t.dimensions[r],l=t.getDimensionInfo(s);if("x"===(n=l&&l.coordDim)||"y"===n){o=i[a];break}}if(o){var u=e.getAxis(n),h=f(o.stops,function(t){return{coord:u.toGlobalCoord(u.dataToCoord(t.value)),color:t.color}}),c=h.length,p=o.outerColors.slice();c&&h[0].coord>h[c-1].coord&&(h.reverse(),p.reverse());var g=h[0].coord-10,m=h[c-1].coord+10,v=m-g;if(v<.001)return"transparent";d(h,function(t){t.offset=(t.coord-g)/v}),h.push({offset:c?h[c-1].offset:.5,color:p[1]||"transparent"}),h.unshift({offset:c?h[0].offset:.5,color:p[0]||"transparent"});var y=new Qb(0,0,0,0,h,!0);return y[n]=g,y[n+"2"]=m,y}}}function Kl(t){return this._axes[t]}function Jl(t){ED.call(this,t)}function Ql(t,e){return e.type||(e.data?"category":"value")}function tu(t,e,i){return t.getCoordSysModel()===e}function eu(t,e){var i=e*Math.PI/180,n=t.plain(),o=n.width,a=n.height,r=o*Math.cos(i)+a*Math.sin(i),s=o*Math.sin(i)+a*Math.cos(i);return new Kt(n.x,n.y,r,s)}function iu(t){var e,i=t.model,n=i.get("axisLabel.show")?i.getFormattedLabels():[],o=i.getModel("axisLabel"),a=1,r=n.length;r>40&&(a=Math.ceil(r/40));for(var s=0;sn[1],l="start"===e&&!s||"start"!==e&&s;return Eo(r-YD/2)?(a=l?"bottom":"top",o="center"):Eo(r-1.5*YD)?(a=l?"top":"bottom",o="center"):(a="middle",o=r<1.5*YD&&r>YD/2?l?"left":"right":l?"right":"left"),{rotation:r,textAlign:o,textVerticalAlign:a}}function cu(t){var e=t.get("tooltip");return t.get("silent")||!(t.get("triggerEvent")||e&&e.show)}function du(t,e,i){var n=t.get("axisLabel.showMinLabel"),o=t.get("axisLabel.showMaxLabel");e=e||[],i=i||[];var a=e[0],r=e[1],s=e[e.length-1],l=e[e.length-2],u=i[0],h=i[1],c=i[i.length-1],d=i[i.length-2];!1===n?(fu(a),fu(u)):pu(a,r)&&(n?(fu(r),fu(h)):(fu(a),fu(u))),!1===o?(fu(s),fu(c)):pu(l,s)&&(o?(fu(l),fu(d)):(fu(s),fu(c)))}function fu(t){t&&(t.ignore=!0)}function pu(t,e,i){var n=t&&t.getBoundingRect().clone(),o=e&&e.getBoundingRect().clone();if(n&&o){var a=lt([]);return dt(a,a,-t.rotation),n.applyTransform(ht([],a,t.getLocalTransform())),o.applyTransform(ht([],a,e.getLocalTransform())),n.intersect(o)}}function gu(t){return"middle"===t||"center"===t}function mu(t,e,i){var n=e.axis;if(e.get("axisTick.show")&&!n.scale.isBlank()){for(var o=e.getModel("axisTick"),a=o.getModel("lineStyle"),s=o.get("length"),l=QD(o,i.labelInterval),u=n.getTicksCoords(o.get("alignWithLabel")),h=n.scale.getTicks(),c=e.get("axisLabel.showMinLabel"),d=e.get("axisLabel.showMaxLabel"),f=[],p=[],g=t._transform,m=[],v=u.length,y=0;y=0||t===e}function Mu(t){var e=Iu(t);if(e){var i=e.axisPointerModel,n=e.axis.scale,o=i.option,a=i.get("status"),r=i.get("value");null!=r&&(r=n.parse(r));var s=Tu(i);null==a&&(o.status=s?"show":"hide");var l=n.getExtent().slice();l[0]>l[1]&&l.reverse(),(null==r||r>l[1])&&(r=l[1]),r0?"bottom":"top":o.width>0?"left":"right";l||Pu(t.style,d,n,u,a,i,p),eo(t,d)}function Ru(t,e){var i=t.get(dT)||0;return Math.min(i,Math.abs(e.width),Math.abs(e.height))}function Bu(t,e,i,n){var o=e.getData(),a=this.dataIndex,r=o.getName(a),s=e.get("selectedOffset");n.dispatchAction({type:"pieToggleSelect",from:t,name:r,seriesId:e.id}),o.each(function(t){Vu(o.getItemGraphicEl(t),o.getItemLayout(t),e.isSelected(o.getName(t)),s,i)})}function Vu(t,e,i,n,o){var a=(e.startAngle+e.endAngle)/2,r=Math.cos(a),s=Math.sin(a),l=i?n:0,u=[r*l,s*l];o?t.animate().when(200,{position:u}).start("bounceOut"):t.attr("position",u)}function Gu(t,e){function i(){a.ignore=a.hoverIgnore,r.ignore=r.hoverIgnore}function n(){a.ignore=a.normalIgnore,r.ignore=r.normalIgnore}L_.call(this);var o=new Gb({z2:2}),a=new Ub,r=new zb;this.add(o),this.add(a),this.add(r),this.updateData(t,e,!0),this.on("emphasis",i).on("normal",n).on("mouseover",i).on("mouseout",n)}function Fu(t,e,i,n,o,a,r){function s(e,i){for(var n=e;n>=0&&(t[n].y-=i,!(n>0&&t[n].y>t[n-1].y+t[n-1].height));n--);}function l(t,e,i,n,o,a){for(var r=e?Number.MAX_VALUE:0,s=0,l=t.length;s=r&&(d=r-10),!e&&d<=r&&(d=r+10),t[s].x=i+d*a,r=d}}t.sort(function(t,e){return t.y-e.y});for(var u,h=0,c=t.length,d=[],f=[],p=0;pe&&a+1t[a].y+t[a].height)return void s(a,n/2);s(i-1,n/2)}(p,c,-u),h=t[p].y+t[p].height;r-h<0&&s(c-1,h-r);for(p=0;p=i?f.push(t[p]):d.push(t[p]);l(d,!1,e,i,n,o),l(f,!0,e,i,n,o)}function Wu(t,e,i,n,o,a){for(var r=[],s=[],l=0;l1?(p.width=l,p.height=l/d):(p.height=l,p.width=l*d),p.y=s[1]-p.height/2,p.x=s[0]-p.width/2}else(a=t.getBoxLayoutParams()).aspect=d,p=Qo(a,{width:u,height:h});this.setViewRect(p.x,p.y,p.width,p.height),this.setCenter(t.get("center")),this.setZoom(t.get("zoom"))}function th(t,e){d(e.get("geoCoord"),function(e,i){t.addGeoCoord(i,e)})}function eh(t,e,i){oh(t)[e]=i}function ih(t,e,i){var n=oh(t);n[e]===i&&(n[e]=null)}function nh(t,e){return!!oh(t)[e]}function oh(t){return t[FT]||(t[FT]={})}function ah(t){this.pointerChecker,this._zr=t,this._opt={};var e=m,n=e(rh,this),o=e(sh,this),a=e(lh,this),s=e(uh,this),l=e(hh,this);$x.call(this),this.setPointerChecker=function(t){this.pointerChecker=t},this.enable=function(e,u){this.disable(),this._opt=r(i(u)||{},{zoomOnMouseWheel:!0,moveOnMouseMove:!0,preventDefaultMouseMove:!0}),null==e&&(e=!0),!0!==e&&"move"!==e&&"pan"!==e||(t.on("mousedown",n),t.on("mousemove",o),t.on("mouseup",a)),!0!==e&&"scale"!==e&&"zoom"!==e||(t.on("mousewheel",s),t.on("pinch",l))},this.disable=function(){t.off("mousedown",n),t.off("mousemove",o),t.off("mouseup",a),t.off("mousewheel",s),t.off("pinch",l)},this.dispose=this.disable,this.isDragging=function(){return this._dragging},this.isPinching=function(){return this._pinching}}function rh(t){if(!(ci(t)||t.target&&t.target.draggable)){var e=t.offsetX,i=t.offsetY;this.pointerChecker&&this.pointerChecker(t,e,i)&&(this._x=e,this._y=i,this._dragging=!0)}}function sh(t){if(!ci(t)&&dh(this,"moveOnMouseMove",t)&&this._dragging&&"pinch"!==t.gestureEvent&&!nh(this._zr,"globalPan")){var e=t.offsetX,i=t.offsetY,n=this._x,o=this._y,a=e-n,r=i-o;this._x=e,this._y=i,this._opt.preventDefaultMouseMove&&rw(t.event),this.trigger("pan",a,r,n,o,e,i)}}function lh(t){ci(t)||(this._dragging=!1)}function uh(t){if(dh(this,"zoomOnMouseWheel",t)&&0!==t.wheelDelta){var e=t.wheelDelta>0?1.1:1/1.1;ch.call(this,t,e,t.offsetX,t.offsetY)}}function hh(t){if(!nh(this._zr,"globalPan")){var e=t.pinchScale>1?1.1:1/1.1;ch.call(this,t,e,t.pinchX,t.pinchY)}}function ch(t,e,i,n){this.pointerChecker&&this.pointerChecker(t,i,n)&&(rw(t.event),this.trigger("zoom",e,i,n))}function dh(t,e,i){var n=t._opt[e];return n&&(!_(n)||i.event[n+"Key"])}function fh(t,e,i){var n=t.target,o=n.position;o[0]+=e,o[1]+=i,n.dirty()}function ph(t,e,i,n){var o=t.target,a=t.zoomLimit,r=o.position,s=o.scale,l=t.zoom=t.zoom||1;if(l*=e,a){var u=a.min||0,h=a.max||1/0;l=Math.max(Math.min(h,l),u)}var c=l/t.zoom;t.zoom=l,r[0]-=(i-r[0])*(c-1),r[1]-=(n-r[1])*(c-1),s[0]*=c,s[1]*=c,o.dirty()}function gh(t,e,i){var n=e.getComponentByElement(t.topTarget),o=n&&n.coordinateSystem;return n&&n!==i&&!WT[n.mainType]&&o&&o.model!==i}function mh(t,e){var i=t.getItemStyle(),n=t.get("areaColor");return null!=n&&(i.fill=n),i}function vh(t,e,i,n,o){i.off("click"),i.off("mousedown"),e.get("selectedMode")&&(i.on("mousedown",function(){t._mouseDownFlag=!0}),i.on("click",function(a){if(t._mouseDownFlag){t._mouseDownFlag=!1;for(var r=a.target;!r.__regions;)r=r.parent;if(r){var s={type:("geo"===e.mainType?"geo":"map")+"ToggleSelect",batch:f(r.__regions,function(t){return{name:t.name,from:o.uid}})};s[e.mainType+"Id"]=e.id,n.dispatchAction(s),yh(e,i)}}}))}function yh(t,e){e.eachChild(function(e){d(e.__regions,function(i){e.trigger(t.isSelected(i.name)?"emphasis":"normal")})})}function xh(t,e){var i=new L_;this._controller=new ah(t.getZr()),this._controllerHost={target:e?i:null},this.group=i,this._updateGroup=e,this._mouseDownFlag}function _h(t,e,i){var n=t.getZoom(),o=t.getCenter(),a=e.zoom,r=t.dataToPoint(o);if(null!=e.dx&&null!=e.dy){r[0]-=e.dx,r[1]-=e.dy;o=t.pointToData(r);t.setCenter(o)}if(null!=a){if(i){var s=i.min||0,l=i.max||1/0;a=Math.max(Math.min(n*a,l),s)/n}t.scale[0]*=a,t.scale[1]*=a;var u=t.position,h=(e.originX-u[0])*(a-1),c=(e.originY-u[1])*(a-1);u[0]-=h,u[1]-=c,t.updateTransform();o=t.pointToData(r);t.setCenter(o),t.setZoom(a*n)}return{center:t.getCenter(),zoom:t.getZoom()}}function wh(t,e){var i={};return d(t,function(t){t.each(t.mapDimension("value"),function(e,n){var o="ec-"+t.getName(n);i[o]=i[o]||[],isNaN(e)||i[o].push(e)})}),t[0].map(t[0].mapDimension("value"),function(n,o){for(var a="ec-"+t[0].getName(o),r=0,s=1/0,l=-1/0,u=i[a].length,h=0;h=0;o--){var a=i[o];a.hierNode={defaultAncestor:null,ancestor:a,prelim:0,modifier:0,change:0,shift:0,i:o,thread:null},n.push(a)}}function Nh(t,e){var i=t.isExpand?t.children:[],n=t.parentNode.children,o=t.hierNode.i?n[t.hierNode.i-1]:null;if(i.length){Bh(t);var a=(i[0].hierNode.prelim+i[i.length-1].hierNode.prelim)/2;o?(t.hierNode.prelim=o.hierNode.prelim+e(t,o),t.hierNode.modifier=t.hierNode.prelim-a):t.hierNode.prelim=a}else o&&(t.hierNode.prelim=o.hierNode.prelim+e(t,o));t.parentNode.hierNode.defaultAncestor=Vh(t,o,t.parentNode.hierNode.defaultAncestor||n[0],e)}function Oh(t){var e=t.hierNode.prelim+t.parentNode.hierNode.modifier;t.setLayout({x:e},!0),t.hierNode.modifier+=t.parentNode.hierNode.modifier}function Eh(t){return arguments.length?t:Zh}function zh(t,e){var i={};return t-=Math.PI/2,i.x=e*Math.cos(t),i.y=e*Math.sin(t),i}function Rh(t,e){return Qo(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function Bh(t){for(var e=t.children,i=e.length,n=0,o=0;--i>=0;){var a=e[i];a.hierNode.prelim+=n,a.hierNode.modifier+=n,o+=a.hierNode.change,n+=a.hierNode.shift+o}}function Vh(t,e,i,n){if(e){for(var o=t,a=t,r=a.parentNode.children[0],s=e,l=o.hierNode.modifier,u=a.hierNode.modifier,h=r.hierNode.modifier,c=s.hierNode.modifier;s=Gh(s),a=Fh(a),s&&a;){o=Gh(o),r=Fh(r),o.hierNode.ancestor=t;var d=s.hierNode.prelim+c-a.hierNode.prelim-u+n(s,a);d>0&&(Hh(Wh(s,t,i),t,d),u+=d,l+=d),c+=s.hierNode.modifier,u+=a.hierNode.modifier,l+=o.hierNode.modifier,h+=r.hierNode.modifier}s&&!Gh(o)&&(o.hierNode.thread=s,o.hierNode.modifier+=c-l),a&&!Fh(r)&&(r.hierNode.thread=a,r.hierNode.modifier+=u-h,i=t)}return i}function Gh(t){var e=t.children;return e.length&&t.isExpand?e[e.length-1]:t.hierNode.thread}function Fh(t){var e=t.children;return e.length&&t.isExpand?e[0]:t.hierNode.thread}function Wh(t,e,i){return t.hierNode.ancestor.parentNode===e.parentNode?t.hierNode.ancestor:i}function Hh(t,e,i){var n=i/(e.hierNode.i-t.hierNode.i);e.hierNode.change-=n,e.hierNode.shift+=i,e.hierNode.modifier+=i,e.hierNode.prelim+=i,t.hierNode.change+=n}function Zh(t,e){return t.parentNode===e.parentNode?1:2}function Uh(t,e){var i=t.getItemLayout(e);return i&&!isNaN(i.x)&&!isNaN(i.y)&&"none"!==t.getItemVisual(e,"symbol")}function jh(t,e,i){return i.itemModel=e,i.itemStyle=e.getModel("itemStyle").getItemStyle(),i.hoverItemStyle=e.getModel("emphasis.itemStyle").getItemStyle(),i.lineStyle=e.getModel("lineStyle").getLineStyle(),i.labelModel=e.getModel("label"),i.hoverLabelModel=e.getModel("emphasis.label"),!1===t.isExpand&&0!==t.children.length?i.symbolInnerColor=i.itemStyle.fill:i.symbolInnerColor="#fff",i}function Xh(t,e,i,n,o,a){var s=!i,l=t.tree.getNodeByDataIndex(e),a=jh(l,l.getModel(),a),u=t.tree.root,h=l.parentNode===u?l:l.parentNode||l,c=t.getItemGraphicEl(h.dataIndex),d=h.getLayout(),f=c?{x:c.position[0],y:c.position[1],rawX:c.__radialOldRawX,rawY:c.__radialOldRawY}:d,p=l.getLayout();s?(i=new Dl(t,e,a)).attr("position",[f.x,f.y]):i.updateData(t,e,a),i.__radialOldRawX=i.__radialRawX,i.__radialOldRawY=i.__radialRawY,i.__radialRawX=p.rawX,i.__radialRawY=p.rawY,n.add(i),t.setItemGraphicEl(e,i),fo(i,{position:[p.x,p.y]},o);var g=i.getSymbolPath();if("radial"===a.layout){var m,v,y=u.children[0],x=y.getLayout(),_=y.children.length;if(p.x===x.x&&!0===l.isExpand){var w={};w.x=(y.children[0].getLayout().x+y.children[_-1].getLayout().x)/2,w.y=(y.children[0].getLayout().y+y.children[_-1].getLayout().y)/2,(m=Math.atan2(w.y-x.y,w.x-x.x))<0&&(m=2*Math.PI+m),(v=w.xx.x)||(m-=Math.PI);var b=v?"left":"right";g.setStyle({textPosition:b,textRotation:-m,textOrigin:"center",verticalAlign:"middle"})}if(l.parentNode&&l.parentNode!==u){var S=i.__edge;S||(S=i.__edge=new qb({shape:qh(a,f,f),style:r({opacity:0},a.lineStyle)})),fo(S,{shape:qh(a,d,p),style:{opacity:1}},o),n.add(S)}}function Yh(t,e,i,n,o,a){for(var r,s=t.tree.getNodeByDataIndex(e),l=t.tree.root,a=jh(s,s.getModel(),a),u=s.parentNode===l?s:s.parentNode||s;null==(r=u.getLayout());)u=u.parentNode===l?u:u.parentNode||u;fo(i,{position:[r.x+1,r.y+1]},o,function(){n.remove(i),t.setItemGraphicEl(e,null)}),i.fadeOut(null,{keepLabel:!0});var h=i.__edge;h&&fo(h,{shape:qh(a,r,r),style:{opacity:0}},o,function(){n.remove(h)})}function qh(t,e,i){var n,o,a,r,s=t.orient;if("radial"===t.layout){var l=e.rawX,u=e.rawY,h=i.rawX,c=i.rawY,d=zh(l,u),f=zh(l,u+(c-u)*t.curvature),p=zh(h,c+(u-c)*t.curvature),g=zh(h,c);return{x1:d.x,y1:d.y,x2:g.x,y2:g.y,cpx1:f.x,cpy1:f.y,cpx2:p.x,cpy2:p.y}}var l=e.x,u=e.y,h=i.x,c=i.y;return"horizontal"===s&&(n=l+(h-l)*t.curvature,o=u,a=h+(l-h)*t.curvature,r=c),"vertical"===s&&(n=l,o=u+(c-u)*t.curvature,a=h,r=c+(u-c)*t.curvature),{x1:l,y1:u,x2:h,y2:c,cpx1:n,cpy1:o,cpx2:a,cpy2:r}}function $h(t,e,i){for(var n,o=[t],a=[];n=o.pop();)if(a.push(n),n.isExpand){var r=n.children;if(r.length)for(var s=0;s=0;a--)n.push(o[a])}}function Jh(t,e,i){if(t&&l(e,t.type)>=0){var n=i.getData().tree.root,o=t.targetNode;if(o&&n.contains(o))return{node:o};var a=t.targetNodeId;if(null!=a&&(o=n.getNodeById(a)))return{node:o}}}function Qh(t){for(var e=[];t;)(t=t.parentNode)&&e.push(t);return e.reverse()}function tc(t,e){return l(Qh(t),e)>=0}function ec(t,e){for(var i=[];t;){var n=t.dataIndex;i.push({name:t.name,dataIndex:n,value:e.getRawValue(n)}),t=t.parentNode}return i.reverse(),i}function ic(t){var e=0;d(t.children,function(t){ic(t);var i=t.value;y(i)&&(i=i[0]),e+=i});var i=t.value;y(i)&&(i=i[0]),(null==i||isNaN(i))&&(i=e),i<0&&(i=0),y(t.value)?t.value[0]=i:t.value=i}function nc(t,e){var i=e.get("color");if(i){var n;return d(t=t||[],function(t){var e=new wo(t),i=e.get("color");(e.get("itemStyle.color")||i&&"none"!==i)&&(n=!0)}),n||((t[0]||(t[0]={})).color=i.slice()),t}}function oc(t){this.group=new L_,t.add(this.group)}function ac(t,e,i,n,o,a){var r=[[o?t:t-YT,e],[t+i,e],[t+i,e+n],[o?t:t-YT,e+n]];return!a&&r.splice(2,0,[t+i+YT,e+n/2]),!o&&r.push([t,e+n/2]),r}function rc(t,e,i){t.eventData={componentType:"series",componentSubType:"treemap",seriesIndex:e.componentIndex,seriesName:e.name,seriesType:"treemap",selfType:"breadcrumb",nodeData:{dataIndex:i&&i.dataIndex,name:i&&i.name},treePathInfo:i&&ec(i,e)}}function sc(){var t,e=[],i={};return{add:function(t,n,o,a,r){return _(a)&&(r=a,a=0),!i[t.id]&&(i[t.id]=1,e.push({el:t,target:n,time:o,delay:a,easing:r}),!0)},done:function(e){return t=e,this},start:function(){for(var n=e.length,o=0,a=e.length;o=0;a--)null==i[a]&&(delete n[e[a]],e.pop())}function dc(t,e){var i=t.visual,n=[];w(i)?hA(i,function(t){n.push(t)}):null!=i&&n.push(i);var o={color:1,symbol:1};e||1!==n.length||o.hasOwnProperty(t.type)||(n[1]=n[0]),_c(t,n)}function fc(t){return{applyVisual:function(e,i,n){e=this.mapValueToVisual(e),n("color",t(i("color"),e))},_doMap:yc([0,1])}}function pc(t){var e=this.option.visual;return e[Math.round(Do(t,[0,1],[0,e.length-1],!0))]||{}}function gc(t){return function(e,i,n){n(t,this.mapValueToVisual(e))}}function mc(t){var e=this.option.visual;return e[this.option.loop&&t!==dA?t%e.length:t]}function vc(){return this.option.visual[0]}function yc(t){return{linear:function(e){return Do(e,t,this.option.visual,!0)},category:mc,piecewise:function(e,i){var n=xc.call(this,i);return null==n&&(n=Do(e,t,this.option.visual,!0)),n},fixed:vc}}function xc(t){var e=this.option,i=e.pieceList;if(e.hasSpecialVisual){var n=i[fA.findPieceIndex(t,i)];if(n&&n.visual)return n.visual[this.type]}}function _c(t,e){return t.visual=e,"color"===t.type&&(t.parsedVisual=f(e,function(t){return At(t)})),e}function wc(t,e,i){return t?e<=i:e=o.length||t===o[t.depth])&&bc(t,Cc(r,h,t,e,g,a),i,n,o,a)})}else l=Mc(h),t.setVisual("color",l)}}function Sc(t,e,i,n){var o=a({},e);return d(["color","colorAlpha","colorSaturation"],function(a){var r=t.get(a,!0);null==r&&i&&(r=i[a]),null==r&&(r=e[a]),null==r&&(r=n.get(a)),null!=r&&(o[a]=r)}),o}function Mc(t){var e=Dc(t,"color");if(e){var i=Dc(t,"colorAlpha"),n=Dc(t,"colorSaturation");return n&&(e=Et(e,null,null,n)),i&&(e=zt(e,i)),e}}function Ic(t,e){return null!=e?Et(e,null,null,t):null}function Dc(t,e){var i=t[e];if(null!=i&&"none"!==i)return i}function Tc(t,e,i,n,o,a){if(a&&a.length){var r=Ac(e,"color")||null!=o.color&&"none"!==o.color&&(Ac(e,"colorAlpha")||Ac(e,"colorSaturation"));if(r){var s=e.get("visualMin"),l=e.get("visualMax"),u=i.dataExtent.slice();null!=s&&su[1]&&(u[1]=l);var h=e.get("colorMappingBy"),c={type:r.name,dataExtent:u,visual:r.range};"color"!==c.type||"index"!==h&&"id"!==h?c.mappingMethod="linear":(c.mappingMethod="category",c.loop=!0);var d=new fA(c);return d.__drColorMappingBy=h,d}}}function Ac(t,e){var i=t.get(e);return mA(i)&&i.length?{name:e,range:i}:null}function Cc(t,e,i,n,o,r){var s=a({},e);if(o){var l=o.type,u="color"===l&&o.__drColorMappingBy,h="index"===u?n:"id"===u?r.mapIdToIndex(i.getId()):i.getValue(t.get("visualDimension"));s[l]=o.mapValueToVisual(h)}return s}function Lc(t,e,i,n){var o,a;if(!t.isRemoved()){var r=t.getLayout();o=r.width,a=r.height;var s=(f=t.getModel()).get(SA),l=f.get(MA)/2,u=Gc(f),h=Math.max(s,u),c=s-l,d=h-l,f=t.getModel();t.setLayout({borderWidth:s,upperHeight:h,upperLabelHeight:u},!0);var p=(o=xA(o-2*c,0))*(a=xA(a-c-d,0)),g=kc(t,f,p,e,i,n);if(g.length){var m={x:c,y:d,width:o,height:a},v=_A(o,a),y=1/0,x=[];x.area=0;for(var _=0,w=g.length;_=0;l--){var u=o["asc"===n?r-l-1:l].getValue();u/i*es[1]&&(s[1]=e)})}else s=[NaN,NaN];return{sum:n,dataExtent:s}}function Ec(t,e,i){for(var n,o=0,a=1/0,r=0,s=t.length;ro&&(o=n));var l=t.area*t.area,u=e*e*i;return l?xA(u*o/l,l/(u*a)):1/0}function zc(t,e,i,n,o){var a=e===i.width?0:1,r=1-a,s=["x","y"],l=["width","height"],u=i[s[a]],h=e?t.area/e:0;(o||h>i[l[r]])&&(h=i[l[r]]);for(var c=0,d=t.length;cmS&&(u=mS),a=s}u=0?n+=u:n-=u:p>=0?n-=u:n+=u}return n}function nd(t,e){return t.getVisual("opacity")||t.getModel().get(e)}function od(t,e,i){var n=t.getGraphicEl(),o=nd(t,e);null!=i&&(null==o&&(o=1),o*=i),n.downplay&&n.downplay(),n.traverse(function(t){"group"!==t.type&&t.setStyle("opacity",o)})}function ad(t,e){var i=nd(t,e),n=t.getGraphicEl();n.highlight&&n.highlight(),n.traverse(function(t){"group"!==t.type&&t.setStyle("opacity",i)})}function rd(t){return t instanceof Array||(t=[t,t]),t}function sd(t){var e=t.coordinateSystem;if(!e||"view"===e.type){var i=t.getGraph();i.eachNode(function(t){var e=t.getModel();t.setLayout([+e.get("x"),+e.get("y")])}),ld(i)}}function ld(t){t.eachEdge(function(t){var e=t.getModel().get("lineStyle.curveness")||0,i=F(t.node1.getLayout()),n=F(t.node2.getLayout()),o=[i,n];+e&&o.push([(i[0]+n[0])/2-(i[1]-n[1])*e,(i[1]+n[1])/2-(n[0]-i[0])*e]),t.setLayout(o)})}function ud(t){var e=t.coordinateSystem;if(!e||"view"===e.type){var i=e.getBoundingRect(),n=t.getData(),o=n.graph,a=0,r=n.getSum("value"),s=2*Math.PI/(r||n.count()),l=i.width/2+i.x,u=i.height/2+i.y,h=Math.min(i.width,i.height)/2;o.eachNode(function(t){var e=t.getValue("value");a+=s*(r?e:1)/2,t.setLayout([h*Math.cos(a)+l,h*Math.sin(a)+u]),a+=s*(r?e:1)/2}),n.setLayout({cx:l,cy:u}),o.eachEdge(function(t){var e,i=t.getModel().get("lineStyle.curveness")||0,n=F(t.node1.getLayout()),o=F(t.node2.getLayout()),a=(n[0]+o[0])/2,r=(n[1]+o[1])/2;+i&&(e=[l*(i*=3)+a*(1-i),u*i+r*(1-i)]),t.setLayout([n,o,e])})}}function hd(t,e,i){for(var n=i.rect,o=n.width,a=n.height,r=[n.x+o/2,n.y+a/2],s=null==i.gravity?.1:i.gravity,l=0;l0?-1:i<0?1:e?-1:1}}function wd(t,e){return Math.min(e[1],Math.max(e[0],t))}function bd(t,e,i){this._axesMap=z(),this._axesLayout={},this.dimensions=t.dimensions,this._rect,this._model=t,this._init(t,e,i)}function Sd(t,e){return nC(oC(t,e[0]),e[1])}function Md(t,e){var i=e.layoutLength/(e.axisCount-1);return{position:i*t,axisNameAvailableWidth:i,axisLabelShow:!0}}function Id(t,e){var i,n,o=e.layoutLength,a=e.axisExpandWidth,r=e.axisCount,s=e.axisCollapseWidth,l=e.winInnerIndices,u=s,h=!1;return tyC}function Gd(t){var e=t.length-1;return e<0&&(e=0),[t[0],t[e]]}function Fd(t,e,i,n){var o=new L_;return o.add(new jb({name:"main",style:Ud(i),silent:!0,draggable:!0,cursor:"move",drift:cC(t,e,o,"nswe"),ondragend:cC(Bd,e,{isEnd:!0})})),dC(n,function(i){o.add(new jb({name:i,style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:cC(t,e,o,i),ondragend:cC(Bd,e,{isEnd:!0})}))}),o}function Wd(t,e,i,n){var o=n.brushStyle.lineWidth||0,a=gC(o,xC),r=i[0][0],s=i[1][0],l=r-o/2,u=s-o/2,h=i[0][1],c=i[1][1],d=h-a+o/2,f=c-a+o/2,p=h-r,g=c-s,m=p+o,v=g+o;Zd(t,e,"main",r,s,p,g),n.transformable&&(Zd(t,e,"w",l,u,a,v),Zd(t,e,"e",d,u,a,v),Zd(t,e,"n",l,u,m,a),Zd(t,e,"s",l,f,m,a),Zd(t,e,"nw",l,u,a,a),Zd(t,e,"ne",d,u,a,a),Zd(t,e,"sw",l,f,a,a),Zd(t,e,"se",d,f,a,a))}function Hd(t,e){var i=e.__brushOption,n=i.transformable,o=e.childAt(0);o.useStyle(Ud(i)),o.attr({silent:!n,cursor:n?"move":"default"}),dC(["w","e","n","s","se","sw","ne","nw"],function(i){var o=e.childOfName(i),a=Yd(t,i);o&&o.attr({silent:!n,invisible:!n,cursor:n?bC[a]+"-resize":null})})}function Zd(t,e,i,n,o,a,r){var s=e.childOfName(i);s&&s.setShape(Qd(Jd(t,e,[[n,o],[n+a,o+r]])))}function Ud(t){return r({strokeNoScale:!0},t.brushStyle)}function jd(t,e,i,n){var o=[pC(t,i),pC(e,n)],a=[gC(t,i),gC(e,n)];return[[o[0],a[0]],[o[1],a[1]]]}function Xd(t){return go(t.group)}function Yd(t,e){if(e.length>1)return("e"===(n=[Yd(t,(e=e.split(""))[0]),Yd(t,e[1])])[0]||"w"===n[0])&&n.reverse(),n.join("");var i={left:"w",right:"e",top:"n",bottom:"s"},n=vo({w:"left",e:"right",n:"top",s:"bottom"}[e],Xd(t));return i[n]}function qd(t,e,i,n,o,a,r,s){var l=n.__brushOption,u=t(l.range),h=Kd(i,a,r);dC(o.split(""),function(t){var e=wC[t];u[e[0]][e[1]]+=h[e[0]]}),l.range=e(jd(u[0][0],u[1][0],u[0][1],u[1][1])),Nd(i,n),Bd(i,{isEnd:!1})}function $d(t,e,i,n,o){var a=e.__brushOption.range,r=Kd(t,i,n);dC(a,function(t){t[0]+=r[0],t[1]+=r[1]}),Nd(t,e),Bd(t,{isEnd:!1})}function Kd(t,e,i){var n=t.group,o=n.transformCoordToLocal(e,i),a=n.transformCoordToLocal(0,0);return[o[0]-a[0],o[1]-a[1]]}function Jd(t,e,n){var o=zd(t,e);return o&&!0!==o?o.clipPath(n,t._transform):i(n)}function Qd(t){var e=pC(t[0][0],t[1][0]),i=pC(t[0][1],t[1][1]);return{x:e,y:i,width:gC(t[0][0],t[1][0])-e,height:gC(t[0][1],t[1][1])-i}}function tf(t,e,i){if(t._brushType){var n=t._zr,o=t._covers,a=Ed(t,e,i);if(!t._dragging)for(var r=0;r=i.length)return e;for(var o=-1,a=e.length,r=i[n++],s={},l={};++o=i.length)return t;var a=[],r=n[o++];return d(t,function(t,i){a.push({key:i,values:e(t,o)})}),r?a.sort(function(t,e){return r(t.key,e.key)}):a}var i=[],n=[];return{key:function(t){return i.push(t),this},sortKeys:function(t){return n[i.length-1]=t,this},entries:function(i){return e(t(i,0),0)}}}function If(t,e){return Qo(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function Df(t,e,i,n,o,a,r){Af(t,i,o),kf(t,e,a,n,r),Bf(t)}function Tf(t){d(t,function(t){var e=Ff(t.outEdges,Uf),i=Ff(t.inEdges,Uf),n=Math.max(e,i);t.setLayout({value:n},!0)})}function Af(t,e,i){for(var n=t,o=null,a=0;n.length;){o=[];for(var r=0,s=n.length;r0;o--)Of(a,r*=.99),Nf(a,n,i),zf(a,r),Nf(a,n,i)}function Pf(t,e,i,n,o){var a=[];d(e,function(t){var e=t.length,i=0;d(t,function(t){i+=t.getLayout().value});var r=(n-(e-1)*o)/i;a.push(r)}),a.sort(function(t,e){return t-e});var r=a[0];d(e,function(t){d(t,function(t,e){t.setLayout({y:e},!0);var i=t.getLayout().value*r;t.setLayout({dy:i},!0)})}),d(i,function(t){var e=+t.getValue()*r;t.setLayout({dy:e},!0)})}function Nf(t,e,i){d(t,function(t){var n,o,a,r=0,s=t.length;for(t.sort(Hf),a=0;a0){l=n.getLayout().y+o;n.setLayout({y:l},!0)}r=n.getLayout().y+n.getLayout().dy+e}if((o=r-e-i)>0){var l=n.getLayout().y-o;for(n.setLayout({y:l},!0),r=n.getLayout().y,a=s-2;a>=0;--a)(o=(n=t[a]).getLayout().y+n.getLayout().dy+e-r)>0&&(l=n.getLayout().y-o,n.setLayout({y:l},!0)),r=n.getLayout().y}})}function Of(t,e){d(t.slice().reverse(),function(t){d(t,function(t){if(t.outEdges.length){var i=Ff(t.outEdges,Ef)/Ff(t.outEdges,Uf),n=t.getLayout().y+(i-Wf(t))*e;t.setLayout({y:n},!0)}})})}function Ef(t){return Wf(t.node2)*t.getValue()}function zf(t,e){d(t,function(t){d(t,function(t){if(t.inEdges.length){var i=Ff(t.inEdges,Rf)/Ff(t.inEdges,Uf),n=t.getLayout().y+(i-Wf(t))*e;t.setLayout({y:n},!0)}})})}function Rf(t){return Wf(t.node1)*t.getValue()}function Bf(t){d(t,function(t){t.outEdges.sort(Vf),t.inEdges.sort(Gf)}),d(t,function(t){var e=0,i=0;d(t.outEdges,function(t){t.setLayout({sy:e},!0),e+=t.getLayout().dy}),d(t.inEdges,function(t){t.setLayout({ty:i},!0),i+=t.getLayout().dy})})}function Vf(t,e){return t.node2.getLayout().y-e.node2.getLayout().y}function Gf(t,e){return t.node1.getLayout().y-e.node1.getLayout().y}function Ff(t,e){for(var i=0,n=t.length,o=-1;++oe?1:t===e?0:NaN}function Uf(t){return t.getValue()}function jf(t,e,i,n){L_.call(this),this.bodyIndex,this.whiskerIndex,this.styleUpdater=i,this._createContent(t,e,n),this.updateData(t,e,n),this._seriesModel}function Xf(t,e,i){return f(t,function(t){return t=t.slice(),t[e]=i.initBaseline,t})}function Yf(t){var e={};return d(t,function(t,i){e["ends"+i]=t}),e}function qf(t){this.group=new L_,this.styleUpdater=t}function $f(t,e,i){var n=e.getItemModel(i),o=n.getModel(BC),a=e.getItemVisual(i,"color"),r=o.getItemStyle(["borderColor"]),s=t.childAt(t.whiskerIndex);s.style.set(r),s.style.stroke=a,s.dirty();var l=t.childAt(t.bodyIndex);l.style.set(r),l.style.stroke=a,l.dirty(),eo(t,n.getModel(VC).getItemStyle())}function Kf(t){var e=[],i=[];return t.eachSeriesByType("boxplot",function(t){var n=t.getBaseAxis(),o=l(i,n);o<0&&(o=i.length,i[o]=n,e[o]={axis:n,seriesModels:[]}),e[o].seriesModels.push(t)}),e}function Jf(t){var e,i,n=t.axis,o=t.seriesModels,a=o.length,r=t.boxWidthList=[],s=t.boxOffsetList=[],l=[];if("category"===n.type)i=n.getBandWidth();else{var u=0;FC(o,function(t){u=Math.max(u,t.getData().count())}),e=n.getExtent(),Math.abs(e[1]-e[0])}FC(o,function(t){var e=t.get("boxWidth");y(e)||(e=[e,e]),l.push([To(e[0],i)||0,To(e[1],i)||0])});var h=.8*i-2,c=h/a*.3,d=(h-c*(a-1))/a,f=d/2-h/2;FC(o,function(t,e){s.push(f),f+=c+d,r.push(Math.min(Math.max(d,l[e][0]),l[e][1]))})}function Qf(t,e,i){var n,o=t.coordinateSystem,a=t.getData(),r=i/2,s=t.get("layout"),l="horizontal"===s?0:1,u=1-l,h=["x","y"],c=[];d(a.dimensions,function(t){var e=a.getDimensionInfo(t).coordDim;e===h[u]?c.push(t):e===h[l]&&(n=t)}),null==n||c.length<5||a.each([n].concat(c),function(){function t(t){var i=[];i[l]=d,i[u]=t;var n;return isNaN(d)||isNaN(t)?n=[NaN,NaN]:(n=o.dataToPoint(i))[l]+=e,n}function i(t,e){var i=t.slice(),n=t.slice();i[l]+=r,n[l]-=r,e?y.push(i,n):y.push(n,i)}function n(t){var e=[t.slice(),t.slice()];e[0][l]-=r,e[1][l]+=r,v.push(e)}var h=arguments,d=h[0],f=h[c.length+1],p=t(h[3]),g=t(h[1]),m=t(h[5]),v=[[g,t(h[2])],[m,t(h[4])]];n(g),n(m),n(p);var y=[];i(v[0][1],0),i(v[1][1],1),a.setItemLayout(f,{chartLayout:s,initBaseline:p[u],median:p,bodyEnds:y,whiskerEnds:v})})}function tp(t,e,i){var n=e.getItemModel(i),o=n.getModel(WC),a=e.getItemVisual(i,"color"),r=e.getItemVisual(i,"borderColor")||a,s=o.getItemStyle(["color","color0","borderColor","borderColor0"]),l=t.childAt(t.whiskerIndex);l.useStyle(s),l.style.stroke=r;var u=t.childAt(t.bodyIndex);u.useStyle(s),u.style.fill=a,u.style.stroke=r,eo(t,n.getModel(HC).getItemStyle())}function ep(t,e){var i,n=t.getBaseAxis(),o="category"===n.type?n.getBandWidth():(i=n.getExtent(),Math.abs(i[1]-i[0])/e.count()),a=To(YC(t.get("barMaxWidth"),o),o),r=To(YC(t.get("barMinWidth"),1),o),s=t.get("barWidth");return null!=s?To(s,o):Math.max(Math.min(o/2,a),r)}function ip(t){return y(t)||(t=[+t,+t]),t}function np(t,e){t.eachChild(function(t){t.attr({z:e.z,zlevel:e.zlevel,style:{stroke:"stroke"===e.brushType?e.color:null,fill:"fill"===e.brushType?e.color:null}})})}function op(t,e){L_.call(this);var i=new Dl(t,e),n=new L_;this.add(i),this.add(n),n.beforeUpdate=function(){this.attr(i.getScale())},this.updateData(t,e)}function ap(t){var e=t.data;e&&e[0]&&e[0][0]&&e[0][0].coord&&(t.data=f(e,function(t){var e={coords:[t[0].coord,t[1].coord]};return t[0].name&&(e.fromName=t[0].name),t[1].name&&(e.toName=t[1].name),o([e,t[0],t[1]])}))}function rp(t,e,i){L_.call(this),this.add(this.createLine(t,e,i)),this._updateEffectSymbol(t,e)}function sp(t,e,i){L_.call(this),this._createPolyline(t,e,i)}function lp(t,e,i){rp.call(this,t,e,i),this._lastFrame=0,this._lastFramePercent=0}function up(){this.group=new L_}function hp(t){return t instanceof Array||(t=[t,t]),t}function cp(){var t=Vx();this.canvas=t,this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={}}function dp(t,e,i){var n=t[1]-t[0],o=(e=f(e,function(e){return{interval:[(e.interval[0]-t[0])/n,(e.interval[1]-t[0])/n]}})).length,a=0;return function(t){for(n=a;n=0;n--){var r=e[n].interval;if(r[0]<=t&&t<=r[1]){a=n;break}}return n>=0&&n=e[0]&&t<=e[1]}}function pp(t){var e=t.dimensions;return"lng"===e[0]&&"lat"===e[1]}function gp(t,e,i,n){var o=t.getItemLayout(e),a=i.get("symbolRepeat"),r=i.get("symbolClip"),s=i.get("symbolPosition")||"start",l=(i.get("symbolRotate")||0)*Math.PI/180||0,u=i.get("symbolPatternSize")||2,h=i.isAnimationEnabled(),c={dataIndex:e,layout:o,itemModel:i,symbolType:t.getItemVisual(e,"symbol")||"circle",color:t.getItemVisual(e,"color"),symbolClip:r,symbolRepeat:a,symbolRepeatDirection:i.get("symbolRepeatDirection"),symbolPatternSize:u,rotation:l,animationModel:h?i:null,hoverAnimation:h&&i.get("hoverAnimation"),z2:i.getShallow("z",!0)||0};mp(i,a,o,n,c),yp(t,e,o,a,r,c.boundingLength,c.pxSign,u,n,c),xp(i,c.symbolScale,l,n,c);var d=c.symbolSize,f=i.get("symbolOffset");return y(f)&&(f=[To(f[0],d[0]),To(f[1],d[1])]),_p(i,d,o,a,r,f,s,c.valueLineWidth,c.boundingLength,c.repeatCutLength,n,c),c}function mp(t,e,i,n,o){var a,r=n.valueDim,s=t.get("symbolBoundingData"),l=n.coordSys.getOtherAxis(n.coordSys.getBaseAxis()),u=l.toGlobalCoord(l.dataToCoord(0)),h=1-+(i[r.wh]<=0);if(y(s)){var c=[vp(l,s[0])-u,vp(l,s[1])-u];c[1]0?1:a<0?-1:0}function vp(t,e){return t.toGlobalCoord(t.dataToCoord(t.scale.parse(e)))}function yp(t,e,i,n,o,a,r,s,l,u){var h=l.valueDim,c=l.categoryDim,d=Math.abs(i[c.wh]),f=t.getItemVisual(e,"symbolSize");y(f)?f=f.slice():(null==f&&(f="100%"),f=[f,f]),f[c.index]=To(f[c.index],d),f[h.index]=To(f[h.index],n?d:Math.abs(a)),u.symbolSize=f,(u.symbolScale=[f[0]/s,f[1]/s])[h.index]*=(l.isHorizontal?-1:1)*r}function xp(t,e,i,n,o){var a=t.get(uL)||0;a&&(cL.attr({scale:e.slice(),rotation:i}),cL.updateTransform(),a/=cL.getLineScale(),a*=e[n.valueDim.index]),o.valueLineWidth=a}function _p(t,e,i,n,o,r,s,l,u,h,c,d){var f=c.categoryDim,p=c.valueDim,g=d.pxSign,m=Math.max(e[p.index]+l,0),v=m;if(n){var y=Math.abs(u),x=D(t.get("symbolMargin"),"15%")+"",_=!1;x.lastIndexOf("!")===x.length-1&&(_=!0,x=x.slice(0,x.length-1)),x=To(x,e[p.index]);var w=Math.max(m+2*x,0),b=_?0:2*x,S=Fo(n),M=S?n:Rp((y+b)/w);w=m+2*(x=(y-M*m)/2/(_?M:M-1)),b=_?0:2*x,S||"fixed"===n||(M=h?Rp((Math.abs(h)+b)/w):0),v=M*w-b,d.repeatTimes=M,d.symbolMargin=x}var I=g*(v/2),T=d.pathPosition=[];T[f.index]=i[f.wh]/2,T[p.index]="start"===s?I:"end"===s?u-I:u/2,r&&(T[0]+=r[0],T[1]+=r[1]);var A=d.bundlePosition=[];A[f.index]=i[f.xy],A[p.index]=i[p.xy];var C=d.barRectShape=a({},i);C[p.wh]=g*Math.max(Math.abs(i[p.wh]),Math.abs(T[p.index]+I)),C[f.wh]=i[f.wh];var L=d.clipShape={};L[f.xy]=-i[f.xy],L[f.wh]=c.ecSize[f.wh],L[p.xy]=0,L[p.wh]=i[p.wh]}function wp(t){var e=t.symbolPatternSize,i=ml(t.symbolType,-e/2,-e/2,e,e,t.color);return i.attr({culling:!0}),"image"!==i.type&&i.setStyle({strokeNoScale:!0}),i}function bp(t,e,i,n){function o(t){var e=l.slice(),n=i.pxSign,o=t;return("start"===i.symbolRepeatDirection?n>0:n<0)&&(o=h-1-t),e[u.index]=d*(o-h/2+.5)+l[u.index],{position:e,scale:i.symbolScale.slice(),rotation:i.rotation}}var a=t.__pictorialBundle,r=i.symbolSize,s=i.valueLineWidth,l=i.pathPosition,u=e.valueDim,h=i.repeatTimes||0,c=0,d=r[e.valueDim.index]+s+2*i.symbolMargin;for(Op(t,function(t){t.__pictorialAnimationIndex=c,t.__pictorialRepeatTimes=h,c0)],d=t.__pictorialBarRect;Pu(d.style,h,a,n,e.seriesModel,o,c),eo(d,h)}function Rp(t){var e=Math.round(t);return Math.abs(t-e)<1e-4?e:Math.ceil(t)}function Bp(t,e,i){this.dimension="single",this.dimensions=["single"],this._axis=null,this._rect,this._init(t,e,i),this.model=t}function Vp(t,e){e=e||{};var i=t.coordinateSystem,n=t.axis,o={},a=n.position,r=n.orient,s=i.getRect(),l=[s.x,s.x+s.width,s.y,s.y+s.height],u={horizontal:{top:l[2],bottom:l[3]},vertical:{left:l[0],right:l[1]}};o.position=["vertical"===r?u.vertical[a]:l[0],"horizontal"===r?u.horizontal[a]:l[3]];var h={horizontal:0,vertical:1};o.rotation=Math.PI/2*h[r];var c={top:-1,bottom:1,right:1,left:-1};o.labelDirection=o.tickDirection=o.nameDirection=c[a],t.get("axisTick.inside")&&(o.tickDirection=-o.tickDirection),D(e.labelInside,t.get("axisLabel.inside"))&&(o.labelDirection=-o.labelDirection);var d=e.rotate;return null==d&&(d=t.get("axisLabel.rotate")),o.labelRotation="top"===a?-d:d,o.labelInterval=n.getLabelInterval(),o.z2=1,o}function Gp(t,e,i,n,o){var r=t.axis;if(!r.scale.isBlank()&&r.containData(e))if(t.involveSeries){var s=Fp(e,t),l=s.payloadBatch,u=s.snapToValue;l[0]&&null==o.seriesIndex&&a(o,l[0]),!n&&t.snap&&r.containData(u)&&null!=u&&(e=u),i.showPointer(t,e,l,o),i.showTooltip(t,s,u)}else i.showPointer(t,e)}function Fp(t,e){var i=e.axis,n=i.dim,o=t,a=[],r=Number.MAX_VALUE,s=-1;return _L(e.seriesModels,function(e,l){var u,h,c=e.getData().mapDimension(n,!0);if(e.getAxisTooltipData){var d=e.getAxisTooltipData(c,t,i);h=d.dataIndices,u=d.nestestValue}else{if(!(h=e.getData().indicesOfNearest(c[0],t,"category"===i.type?.5:null)).length)return;u=e.getData().get(c[0],h[0])}if(null!=u&&isFinite(u)){var f=t-u,p=Math.abs(f);p<=r&&((p=0&&s<0)&&(r=p,s=f,o=u,a.length=0),_L(h,function(t){a.push({seriesIndex:e.seriesIndex,dataIndexInside:t,dataIndex:e.getData().getRawIndex(t)})}))}}),{payloadBatch:a,snapToValue:o}}function Wp(t,e,i,n){t[e.key]={value:i,payloadBatch:n}}function Hp(t,e,i,n){var o=i.payloadBatch,a=e.axis,r=a.model,s=e.axisPointerModel;if(e.triggerTooltip&&o.length){var l=e.coordSys.model,u=Au(l),h=t.map[u];h||(h=t.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},t.list.push(h)),h.dataByAxis.push({axisDim:a.dim,axisIndex:r.componentIndex,axisType:r.type,axisId:r.id,value:n,valueLabelOpt:{precision:s.get("label.precision"),formatter:s.get("label.formatter")},seriesDataIndices:o.slice()})}}function Zp(t,e,i){var n=i.axesInfo=[];_L(e,function(e,i){var o=e.axisPointerModel.option,a=t[i];a?(!e.useHandle&&(o.status="show"),o.value=a.value,o.seriesDataIndices=(a.payloadBatch||[]).slice()):!e.useHandle&&(o.status="hide"),"show"===o.status&&n.push({axisDim:e.axis.dim,axisIndex:e.axis.model.componentIndex,value:o.value})})}function Up(t,e,i,n){if(!qp(e)&&t.list.length){var o=((t.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};n({type:"showTip",escapeConnect:!0,x:e[0],y:e[1],tooltipOption:i.tooltipOption,position:i.position,dataIndexInside:o.dataIndexInside,dataIndex:o.dataIndex,seriesIndex:o.seriesIndex,dataByCoordSys:t.list})}else n({type:"hideTip"})}function jp(t,e,i){var n=i.getZr(),o=bL(n).axisPointerLastHighlights||{},a=bL(n).axisPointerLastHighlights={};_L(t,function(t,e){var i=t.axisPointerModel.option;"show"===i.status&&_L(i.seriesDataIndices,function(t){var e=t.seriesIndex+" | "+t.dataIndex;a[e]=t})});var r=[],s=[];d(o,function(t,e){!a[e]&&s.push(t)}),d(a,function(t,e){!o[e]&&r.push(t)}),s.length&&i.dispatchAction({type:"downplay",escapeConnect:!0,batch:s}),r.length&&i.dispatchAction({type:"highlight",escapeConnect:!0,batch:r})}function Xp(t,e){for(var i=0;i<(t||[]).length;i++){var n=t[i];if(e.axis.dim===n.axisDim&&e.axis.model.componentIndex===n.axisIndex)return n}}function Yp(t){var e=t.axis.model,i={},n=i.axisDim=t.axis.dim;return i.axisIndex=i[n+"AxisIndex"]=e.componentIndex,i.axisName=i[n+"AxisName"]=e.name,i.axisId=i[n+"AxisId"]=e.id,i}function qp(t){return!t||null==t[0]||isNaN(t[0])||null==t[1]||isNaN(t[1])}function $p(t,e,i){if(!Ax.node){var n=e.getZr();SL(n).records||(SL(n).records={}),Kp(n,e),(SL(n).records[t]||(SL(n).records[t]={})).handler=i}}function Kp(t,e){function i(i,n){t.on(i,function(i){var o=eg(e);ML(SL(t).records,function(t){t&&n(t,i,o.dispatchAction)}),Jp(o.pendings,e)})}SL(t).initialized||(SL(t).initialized=!0,i("click",v(tg,"click")),i("mousemove",v(tg,"mousemove")),i("globalout",Qp))}function Jp(t,e){var i,n=t.showTip.length,o=t.hideTip.length;n?i=t.showTip[n-1]:o&&(i=t.hideTip[o-1]),i&&(i.dispatchAction=null,e.dispatchAction(i))}function Qp(t,e,i){t.handler("leave",null,i)}function tg(t,e,i,n){e.handler(t,i,n)}function eg(t){var e={showTip:[],hideTip:[]},i=function(n){var o=e[n.type];o?o.push(n):(n.dispatchAction=i,t.dispatchAction(n))};return{dispatchAction:i,pendings:e}}function ig(t,e){if(!Ax.node){var i=e.getZr();(SL(i).records||{})[t]&&(SL(i).records[t]=null)}}function ng(){}function og(t,e,i,n){ag(DL(i).lastProp,n)||(DL(i).lastProp=n,e?fo(i,n,t):(i.stopAnimation(),i.attr(n)))}function ag(t,e){if(w(t)&&w(e)){var i=!0;return d(e,function(e,n){i=i&&ag(t[n],e)}),!!i}return t===e}function rg(t,e){t[e.get("label.show")?"show":"hide"]()}function sg(t){return{position:t.position.slice(),rotation:t.rotation||0}}function lg(t,e,i){var n=e.get("z"),o=e.get("zlevel");t&&t.traverse(function(t){"group"!==t.type&&(null!=n&&(t.z=n),null!=o&&(t.zlevel=o),t.silent=i)})}function ug(t){var e,i=t.get("type"),n=t.getModel(i+"Style");return"line"===i?(e=n.getLineStyle()).fill=null:"shadow"===i&&((e=n.getAreaStyle()).stroke=null),e}function hg(t,e,i,n,o){var a=dg(i.get("value"),e.axis,e.ecModel,i.get("seriesDataIndices"),{precision:i.get("label.precision"),formatter:i.get("label.formatter")}),r=i.getModel("label"),s=xS(r.get("padding")||0),l=r.getFont(),u=me(a,l),h=o.position,c=u.width+s[1]+s[3],d=u.height+s[0]+s[2],f=o.align;"right"===f&&(h[0]-=c),"center"===f&&(h[0]-=c/2);var p=o.verticalAlign;"bottom"===p&&(h[1]-=d),"middle"===p&&(h[1]-=d/2),cg(h,c,d,n);var g=r.get("backgroundColor");g&&"auto"!==g||(g=e.get("axisLine.lineStyle.color")),t.label={shape:{x:0,y:0,width:c,height:d,r:r.get("borderRadius")},position:h.slice(),style:{text:a,textFont:l,textFill:r.getTextColor(),textPosition:"inside",fill:g,stroke:r.get("borderColor")||"transparent",lineWidth:r.get("borderWidth")||0,shadowBlur:r.get("shadowBlur"),shadowColor:r.get("shadowColor"),shadowOffsetX:r.get("shadowOffsetX"),shadowOffsetY:r.get("shadowOffsetY")},z2:10}}function cg(t,e,i,n){var o=n.getWidth(),a=n.getHeight();t[0]=Math.min(t[0]+e,o)-e,t[1]=Math.min(t[1]+i,a)-i,t[0]=Math.max(t[0],0),t[1]=Math.max(t[1],0)}function dg(t,e,i,n,o){var a=e.scale.getLabel(t,{precision:o.precision}),r=o.formatter;if(r){var s={value:pl(e,t),seriesData:[]};d(n,function(t){var e=i.getSeriesByIndex(t.seriesIndex),n=t.dataIndexInside,o=e&&e.getDataParams(n);o&&s.seriesData.push(o)}),_(r)?a=r.replace("{value}",a):x(r)&&(a=r(s))}return a}function fg(t,e,i){var n=st();return dt(n,n,i.rotation),ct(n,n,i.position),mo([t.dataToCoord(e),(i.labelOffset||0)+(i.labelDirection||1)*(i.labelMargin||0)],n)}function pg(t,e,i,n,o,a){var r=qD.innerTextLayout(i.rotation,0,i.labelDirection);i.labelMargin=o.get("label.margin"),hg(e,n,o,a,{position:fg(n.axis,t,i),align:r.textAlign,verticalAlign:r.textVerticalAlign})}function gg(t,e,i){return i=i||0,{x1:t[i],y1:t[1-i],x2:e[i],y2:e[1-i]}}function mg(t,e,i){return i=i||0,{x:t[i],y:t[1-i],width:e[i],height:e[1-i]}}function vg(t,e,i,n,o,a){return{cx:t,cy:e,r0:i,r:n,startAngle:o,endAngle:a,clockwise:!0}}function yg(t,e){var i={};return i[e.dim+"AxisIndex"]=e.index,t.getCartesian(i)}function xg(t){return"x"===t.dim?0:1}function _g(t){return t.isHorizontal()?0:1}function wg(t,e){var i=t.getRect();return[i[kL[e]],i[kL[e]]+i[PL[e]]]}function bg(t,e,i){var n=new jb({shape:{x:t.x-10,y:t.y-10,width:0,height:t.height+20}});return po(n,{shape:{width:t.width+20,height:t.height+20}},e,i),n}function Sg(t,e,i){if(t.count())for(var n,o=e.coordinateSystem,a=e.getLayerSeries(),r=t.mapDimension("single"),s=t.mapDimension("value"),l=f(a,function(e){return f(e.indices,function(e){var i=o.dataToPoint(t.get(r,e));return i[1]=t.get(s,e),i})}),u=Mg(l),h=u.y0,c=i/u.max,d=a.length,p=a[0].indices.length,g=0;ga&&(a=u),n.push(u)}for(var h=0;ha&&(a=d)}return r.y0=o,r.max=a,r}function Ig(t){var e=0;d(t.children,function(t){Ig(t);var i=t.value;y(i)&&(i=i[0]),e+=i});var i=t.value;y(i)&&(i=i[0]),(null==i||isNaN(i))&&(i=e),i<0&&(i=0),y(t.value)?t.value[0]=i:t.value=i}function Dg(t,e,i){function n(){r.ignore=r.hoverIgnore}function o(){r.ignore=r.normalIgnore}L_.call(this);var a=new Gb({z2:RL}),r=new zb({z2:BL,silent:t.getModel("label").get("silent")});this.add(a),this.add(r),this.updateData(!0,t,"normal",e,i),this.on("emphasis",n).on("normal",o).on("mouseover",n).on("mouseout",o)}function Tg(t,e,i){var n=t.getVisual("color"),o=t.getVisual("visualMeta");o&&0!==o.length||(n=null);var a=t.getModel("itemStyle").get("color");if(a)return a;if(n)return n;if(0===t.depth)return i.option.color[0];var r=i.option.color.length;return a=i.option.color[Ag(t)%r]}function Ag(t){for(var e=t;e.depth>1;)e=e.parentNode;return l(t.getAncestors()[0].children,e)}function Cg(t,e,i){return i!==zL.NONE&&(i===zL.SELF?t===e:i===zL.ANCESTOR?t===e||t.isAncestorOf(e):t===e||t.isDescendantOf(e))}function Lg(t,e){var i=t.children||[];t.children=kg(i,e),i.length&&d(t.children,function(t){Lg(t,e)})}function kg(t,e){if("function"==typeof e)return t.sort(e);var i="asc"===e;return t.sort(function(t,e){var n=(t.getValue()-e.getValue())*(i?1:-1);return 0===n?(t.dataIndex-e.dataIndex)*(i?-1:1):n})}function Pg(t,e){return e=e||[0,0],f(["x","y"],function(i,n){var o=this.getAxis(i),a=e[n],r=t[n]/2;return"category"===o.type?o.getBandWidth():Math.abs(o.dataToCoord(a-r)-o.dataToCoord(a+r))},this)}function Ng(t,e){return e=e||[0,0],f([0,1],function(i){var n=e[i],o=t[i]/2,a=[],r=[];return a[i]=n-o,r[i]=n+o,a[1-i]=r[1-i]=e[1-i],Math.abs(this.dataToPoint(a)[i]-this.dataToPoint(r)[i])},this)}function Og(t,e){var i=this.getAxis(),n=e instanceof Array?e[0]:e,o=(t instanceof Array?t[0]:t)/2;return"category"===i.type?i.getBandWidth():Math.abs(i.dataToCoord(n-o)-i.dataToCoord(n+o))}function Eg(t,e){return f(["Radius","Angle"],function(i,n){var o=this["get"+i+"Axis"](),a=e[n],r=t[n]/2,s="dataTo"+i,l="category"===o.type?o.getBandWidth():Math.abs(o[s](a-r)-o[s](a+r));return"Angle"===i&&(l=l*Math.PI/180),l},this)}function zg(t){var e,i=t.type;if("path"===i){var n=t.shape;(e=zn(n.pathData,null,{x:n.x||0,y:n.y||0,width:n.width||0,height:n.height||0},"center")).__customPathData=t.pathData}else"image"===i?(e=new Je({})).__customImagePath=t.style.image:"text"===i?(e=new zb({})).__customText=t.style.text:e=new(0,sS[i.charAt(0).toUpperCase()+i.slice(1)]);return e.__customGraphicType=i,e.name=t.name,e}function Rg(t,e,n,o,a,r){var s={},l=n.style||{};if(n.shape&&(s.shape=i(n.shape)),n.position&&(s.position=n.position.slice()),n.scale&&(s.scale=n.scale.slice()),n.origin&&(s.origin=n.origin.slice()),n.rotation&&(s.rotation=n.rotation),"image"===t.type&&n.style){u=s.style={};d(["x","y","width","height"],function(e){Bg(e,u,l,t.style,r)})}if("text"===t.type&&n.style){var u=s.style={};d(["x","y"],function(e){Bg(e,u,l,t.style,r)}),!l.hasOwnProperty("textFill")&&l.fill&&(l.textFill=l.fill),!l.hasOwnProperty("textStroke")&&l.stroke&&(l.textStroke=l.stroke)}if("group"!==t.type&&(t.useStyle(l),r)){t.style.opacity=0;var h=l.opacity;null==h&&(h=1),po(t,{style:{opacity:h}},o,e)}r?t.attr(s):fo(t,s,o,e),t.attr({z2:n.z2||0,silent:n.silent}),!1!==n.styleEmphasis&&eo(t,n.styleEmphasis)}function Bg(t,e,i,n,o){null==i[t]||o||(e[t]=i[t],i[t]=n[t])}function Vg(t,e,i,n){function o(t){null==t&&(t=h),v&&(c=e.getItemModel(t),d=c.getModel(UL),f=c.getModel(jL),p=e.getItemVisual(t,"color"),v=!1)}var s=t.get("renderItem"),l=t.coordinateSystem,u={};l&&(u=l.prepareCustoms?l.prepareCustoms():YL[l.type](l));var h,c,d,f,p,g=r({getWidth:n.getWidth,getHeight:n.getHeight,getZr:n.getZr,getDevicePixelRatio:n.getDevicePixelRatio,value:function(t,i){return null==i&&(i=h),e.get(e.getDimension(t||0),i)},style:function(i,n){null==n&&(n=h),o(n);var r=c.getModel(HL).getItemStyle();null!=p&&(r.fill=p);var s=e.getItemVisual(n,"opacity");return null!=s&&(r.opacity=s),no(r,d,null,{autoColor:p,isRectText:!0}),r.text=d.getShallow("show")?T(t.getFormattedLabel(n,"normal"),Sl(e,n)):null,i&&a(r,i),r},styleEmphasis:function(i,n){null==n&&(n=h),o(n);var r=c.getModel(ZL).getItemStyle();return no(r,f,null,{isRectText:!0},!0),r.text=f.getShallow("show")?A(t.getFormattedLabel(n,"emphasis"),t.getFormattedLabel(n,"normal"),Sl(e,n)):null,i&&a(r,i),r},visual:function(t,i){return null==i&&(i=h),e.getItemVisual(i,t)},barLayout:function(t){if(l.getBaseAxis)return nl(r({axis:l.getBaseAxis()},t),n)},currentSeriesIndices:function(){return i.getCurrentSeriesIndices()},font:function(t){return ho(t,i)}},u.api||{}),m={context:{},seriesId:t.id,seriesName:t.name,seriesIndex:t.seriesIndex,coordSys:u.coordSys,dataInsideLength:e.count(),encode:Gg(t.getData())},v=!0;return function(t){return h=t,v=!0,s&&s(r({dataIndexInside:t,dataIndex:e.getRawIndex(t)},m),g)||{}}}function Gg(t){var e={};return d(t.dimensions,function(i,n){var o=t.getDimensionInfo(i);if(!o.isExtraCoord){var a=o.coordDim;(e[a]=e[a]||[])[o.coordDimIndex]=n}}),e}function Fg(t,e,i,n,o,a){return(t=Wg(t,e,i,n,o,a))&&a.setItemGraphicEl(e,t),t}function Wg(t,e,i,n,o,a){var r=i.type;if(!t||r===t.__customGraphicType||"path"===r&&i.pathData===t.__customPathData||"image"===r&&i.style.image===t.__customImagePath||"text"===r&&i.style.text===t.__customText||(o.remove(t),t=null),null!=r){var s=!t;if(!t&&(t=zg(i)),Rg(t,e,i,n,a,s),"group"===r){var l=t.children()||[],u=i.children||[];if(i.diffChildrenByName)Hg({oldChildren:l,newChildren:u,dataIndex:e,animatableModel:n,group:t,data:a});else{for(var h=0;hn?t-=l+a:t+=a),null!=r&&(e+u+r>o?e-=u+r:e+=r),[t,e]}function pm(t,e,i,n,o){var a=gm(i),r=a.width,s=a.height;return t=Math.min(t+r,n)-r,e=Math.min(e+s,o)-s,t=Math.max(t,0),e=Math.max(e,0),[t,e]}function gm(t){var e=t.clientWidth,i=t.clientHeight;if(document.defaultView&&document.defaultView.getComputedStyle){var n=document.defaultView.getComputedStyle(t);n&&(e+=parseInt(n.paddingLeft,10)+parseInt(n.paddingRight,10)+parseInt(n.borderLeftWidth,10)+parseInt(n.borderRightWidth,10),i+=parseInt(n.paddingTop,10)+parseInt(n.paddingBottom,10)+parseInt(n.borderTopWidth,10)+parseInt(n.borderBottomWidth,10))}return{width:e,height:i}}function mm(t,e,i){var n=i[0],o=i[1],a=0,r=0,s=e.width,l=e.height;switch(t){case"inside":a=e.x+s/2-n/2,r=e.y+l/2-o/2;break;case"top":a=e.x+s/2-n/2,r=e.y-o-5;break;case"bottom":a=e.x+s/2-n/2,r=e.y+l+5;break;case"left":a=e.x-n-5,r=e.y+l/2-o/2;break;case"right":a=e.x+s+5,r=e.y+l/2-o/2}return[a,r]}function vm(t){return"center"===t||"middle"===t}function ym(t){return t.get("stack")||"__ec_stack_"+t.seriesIndex}function xm(t){return t.dim}function _m(t,e){var i={};d(t,function(t,e){var n=t.getData(),o=t.coordinateSystem.getBaseAxis(),a=o.getExtent(),r="category"===o.type?o.getBandWidth():Math.abs(a[1]-a[0])/n.count(),s=i[xm(o)]||{bandWidth:r,remainedWidth:r,autoWidthCount:0,categoryGap:"20%",gap:"30%",stacks:{}},l=s.stacks;i[xm(o)]=s;var u=ym(t);l[u]||s.autoWidthCount++,l[u]=l[u]||{width:0,maxWidth:0};var h=To(t.get("barWidth"),r),c=To(t.get("barMaxWidth"),r),d=t.get("barGap"),f=t.get("barCategoryGap");h&&!l[u].width&&(h=Math.min(s.remainedWidth,h),l[u].width=h,s.remainedWidth-=h),c&&(l[u].maxWidth=c),null!=d&&(s.gap=d),null!=f&&(s.categoryGap=f)});var n={};return d(i,function(t,e){n[e]={};var i=t.stacks,o=t.bandWidth,a=To(t.categoryGap,o),r=To(t.gap,1),s=t.remainedWidth,l=t.autoWidthCount,u=(s-a)/(l+(l-1)*r);u=Math.max(u,0),d(i,function(t,e){var i=t.maxWidth;i&&ie[0]&&(e=e.slice().reverse());var n=t.coordToPoint([e[0],i]),o=t.coordToPoint([e[1],i]);return{x1:n[0],y1:n[1],x2:o[0],y2:o[1]}}function Am(t){return t.getRadiusAxis().inverse?0:1}function Cm(t,e,i){return{position:[t.cx,t.cy],rotation:i/180*Math.PI,labelDirection:-1,tickDirection:-1,nameDirection:1,labelRotate:e.getModel("axisLabel").get("rotate"),z2:1}}function Lm(t,e,i,n,o){var a=e.axis,r=a.dataToCoord(t),s=n.getAngleAxis().getExtent()[0];s=s/180*Math.PI;var l,u,h,c=n.getRadiusAxis().getExtent();if("radius"===a.dim){var d=st();dt(d,d,s),ct(d,d,[n.cx,n.cy]),l=mo([r,-o],d);var f=e.getModel("axisLabel").get("rotate")||0,p=qD.innerTextLayout(s,f*Math.PI/180,-1);u=p.textAlign,h=p.textVerticalAlign}else{var g=c[1];l=n.coordToPoint([g+o,r]);var m=n.cx,v=n.cy;u=Math.abs(l[0]-m)/g<.3?"center":l[0]>m?"left":"right",h=Math.abs(l[1]-v)/g<.3?"middle":l[1]>v?"top":"bottom"}return{position:l,align:u,verticalAlign:h}}function km(t,e){e.update="updateView",hs(e,function(e,i){var n={};return i.eachComponent({mainType:"geo",query:e},function(i){i[t](e.name),d(i.coordinateSystem.regions,function(t){n[t.name]=i.isSelected(t.name)||!1})}),{selected:n,name:e.name}})}function Pm(t){var e={};d(t,function(t){e[t]=1}),t.length=0,d(e,function(e,i){t.push(i)})}function Nm(t){if(t)for(var e in t)if(t.hasOwnProperty(e))return!0}function Om(t,e,n){function o(){var t=function(){};return t.prototype.__hidden=t.prototype,new t}var a={};return Sk(e,function(e){var r=a[e]=o();Sk(t[e],function(t,o){if(fA.isValidType(o)){var a={type:o,visual:t};n&&n(a,e),r[o]=new fA(a),"opacity"===o&&((a=i(a)).type="colorAlpha",r.__hidden.__alphaForOpacity=new fA(a))}})}),a}function Em(t,e,n){var o;d(n,function(t){e.hasOwnProperty(t)&&Nm(e[t])&&(o=!0)}),o&&d(n,function(n){e.hasOwnProperty(n)&&Nm(e[n])?t[n]=i(e[n]):delete t[n]})}function zm(t,e,i,n,o,a){function r(t){return i.getItemVisual(h,t)}function s(t,e){i.setItemVisual(h,t,e)}function l(t,l){h=null==a?t:l;var c=i.getRawDataItem(h);if(!c||!1!==c.visualMap)for(var d=n.call(o,t),f=e[d],p=u[d],g=0,m=p.length;g1)return!1;var h=Hm(i-t,o-t,n-e,a-e)/l;return!(h<0||h>1)}function Wm(t){return t<=1e-6&&t>=-1e-6}function Hm(t,e,i,n){return t*n-e*i}function Zm(t,e,i){var n=this._targetInfoList=[],o={},a=jm(e,t);Ik(kk,function(t,e){(!i||!i.include||Dk(i.include,e)>=0)&&t(a,n,o)})}function Um(t){return t[0]>t[1]&&t.reverse(),t}function jm(t,e){return Oi(t,e,{includeMainTypes:Ck})}function Xm(t,e,i,n){var o=i.getAxis(["x","y"][t]),a=Um(f([0,1],function(t){return e?o.coordToData(o.toLocalCoord(n[t])):o.toGlobalCoord(o.dataToCoord(n[t]))})),r=[];return r[t]=a,r[1-t]=[NaN,NaN],{values:a,xyMinMax:r}}function Ym(t,e,i,n){return[e[0]-n[t]*i[0],e[1]-n[t]*i[1]]}function qm(t,e){var i=$m(t),n=$m(e),o=[i[0]/n[0],i[1]/n[1]];return isNaN(o[0])&&(o[0]=1),isNaN(o[1])&&(o[1]=1),o}function $m(t){return t?[t[0][1]-t[0][0],t[1][1]-t[1][0]]:[NaN,NaN]}function Km(t,e,i,n,o){if(o){var a=t.getZr();a[Bk]||(a[Rk]||(a[Rk]=Jm),_r(a,Rk,i,e)(t,n))}}function Jm(t,e){if(!t.isDisposed()){var i=t.getZr();i[Bk]=!0,t.dispatchAction({type:"brushSelect",batch:e}),i[Bk]=!1}}function Qm(t,e,i,n){for(var o=0,a=e.length;o=0}function fv(t,e,i){function n(t,e){return l(e.nodes,t)>=0}function o(t,n){var o=!1;return e(function(e){d(i(t,e)||[],function(t){n.records[e.name][t]&&(o=!0)})}),o}function a(t,n){n.nodes.push(t),e(function(e){d(i(t,e)||[],function(t){n.records[e.name][t]=!0})})}return function(i){var r={nodes:[],records:{}};if(e(function(t){r.records[t.name]={}}),!i)return r;a(i,r);var s;do{s=!1,t(function(t){!n(t,r)&&o(t,r)&&(a(t,r),s=!0)})}while(s);return r}}function pv(t,e,i){var n=[1/0,-1/0];return $k(i,function(t){var i=t.getData();i&&$k(i.mapDimension(e,!0),function(t){var e=i.getApproximateExtent(t);e[0]n[1]&&(n[1]=e[1])})}),n[1]0?0:NaN);var r=i.getMax(!0);return null!=r&&"dataMax"!==r&&"function"!=typeof r?e[1]=r:o&&(e[1]=a>0?a-1:NaN),i.get("scale",!0)||(e[0]>0&&(e[0]=0),e[1]<0&&(e[1]=0)),e}function mv(t,e){var i=t.getAxisModel(),n=t._percentWindow,o=t._valueWindow;if(n){var a=Po(o,[0,500]);a=Math.min(a,20);var r=e||0===n[0]&&100===n[1];i.setRange(r?null:+o[0].toFixed(a),r?null:+o[1].toFixed(a))}}function vv(t){var e=t._minMaxSpan={},i=t._dataZoomModel;$k(["min","max"],function(n){e[n+"Span"]=i.get(n+"Span");var o=i.get(n+"ValueSpan");if(null!=o&&(e[n+"ValueSpan"]=o,null!=(o=t.getAxisModel().axis.scale.parse(o)))){var a=t._dataExtent;e[n+"Span"]=Do(a[0]+o,a,[0,100],!0)}})}function yv(t){var e={};return Qk(["start","end","startValue","endValue","throttle"],function(i){t.hasOwnProperty(i)&&(e[i]=t[i])}),e}function xv(t,e){var i=t._rangePropMode,n=t.get("rangeMode");Qk([["start","startValue"],["end","endValue"]],function(t,o){var a=null!=e[t[0]],r=null!=e[t[1]];a&&!r?i[o]="percent":!a&&r?i[o]="value":n?i[o]=n[o]:a&&(i[o]="percent")})}function _v(t){return{x:"y",y:"x",radius:"angle",angle:"radius"}[t]}function wv(t){return"vertical"===t?"ns-resize":"ew-resize"}function bv(t,e){var i=Dv(t),n=e.dataZoomId,o=e.coordId;d(i,function(t,i){var a=t.dataZoomInfos;a[n]&&l(e.allCoordIds,o)<0&&(delete a[n],t.count--)}),Av(i);var a=i[o];a||((a=i[o]={coordId:o,dataZoomInfos:{},count:0}).controller=Tv(t,a),a.dispatchAction=v(Pv,t)),!a.dataZoomInfos[n]&&a.count++,a.dataZoomInfos[n]=e;var r=Nv(a.dataZoomInfos);a.controller.enable(r.controlType,r.opt),a.controller.setPointerChecker(e.containsPoint),_r(a,"dispatchAction",e.throttleRate,"fixRate")}function Sv(t,e){var i=Dv(t);d(i,function(t){t.controller.dispose();var i=t.dataZoomInfos;i[e]&&(delete i[e],t.count--)}),Av(i)}function Mv(t,e){if(t&&"dataZoom"===t.type&&t.batch)for(var i=0,n=t.batch.length;in["type_"+e]&&(e=o),a(i,t.roamControllerOpt)}),{controlType:e,opt:i}}function Ov(t,e){return t&&t.hasOwnProperty&&t.hasOwnProperty(e)}function Ev(t,e,i,n){for(var o=e.targetVisuals[n],a=fA.prepareVisualTypes(o),r={color:t.getData().getVisual("color")},s=0,l=a.length;s=0&&(r[a]=+r[a].toFixed(h)),r}function $v(t,e){var n=t.getData(),o=t.coordinateSystem;if(e&&!Yv(e)&&!y(e.coord)&&o){var a=o.dimensions,r=Kv(e,n,o,t);if((e=i(e)).type&&XP[e.type]&&r.baseAxis&&r.valueAxis){var s=UP(a,r.baseAxis.dim),l=UP(a,r.valueAxis.dim);e.coord=XP[e.type](n,r.baseDataDim,r.valueDataDim,s,l),e.value=e.coord[l]}else{for(var u=[null!=e.xAxis?e.xAxis:e.radiusAxis,null!=e.yAxis?e.yAxis:e.angleAxis],h=0;h<2;h++)XP[u[h]]&&(u[h]=ey(n,n.mapDimension(a[h]),u[h]));e.coord=u}}return e}function Kv(t,e,i,n){var o={};return null!=t.valueIndex||null!=t.valueDim?(o.valueDataDim=null!=t.valueIndex?e.getDimension(t.valueIndex):t.valueDim,o.valueAxis=i.getAxis(Jv(n,o.valueDataDim)),o.baseAxis=i.getOtherAxis(o.valueAxis),o.baseDataDim=e.mapDimension(o.baseAxis.dim)):(o.baseAxis=n.getBaseAxis(),o.valueAxis=i.getOtherAxis(o.baseAxis),o.baseDataDim=e.mapDimension(o.baseAxis.dim),o.valueDataDim=e.mapDimension(o.valueAxis.dim)),o}function Jv(t,e){var i=t.getData(),n=i.dimensions;e=i.getDimension(e);for(var o=0;o=0)return!0}function Ly(t){for(var e=t.split(/\n+/g),i=[],n=f(Ay(e.shift()).split(fN),function(t){return{name:t,data:[]}}),o=0;o=0&&!i[o][n];o--);if(o<0){var a=t.queryComponents({mainType:"dataZoom",subType:"select",id:n})[0];if(a){var r=a.getPercentRange();i[0][n]={dataZoomId:n,start:r[0],end:r[1]}}}}),i.push(e)}function zy(t){var e=Vy(t),i=e[e.length-1];e.length>1&&e.pop();var n={};return pN(i,function(t,i){for(var o=e.length-1;o>=0;o--)if(t=e[o][i]){n[i]=t;break}}),n}function Ry(t){t[gN]=null}function By(t){return Vy(t).length}function Vy(t){var e=t[gN];return e||(e=t[gN]=[{}]),e}function Gy(t,e,i){(this._brushController=new Dd(i.getZr())).on("brush",m(this._onBrush,this)).mount(),this._isZoomActive}function Fy(t){var e={};return d(["xAxisIndex","yAxisIndex"],function(i){e[i]=t[i],null==e[i]&&(e[i]="all"),(!1===e[i]||"none"===e[i])&&(e[i]=[])}),e}function Wy(t,e){t.setIconStatus("back",By(e)>1?"emphasis":"normal")}function Hy(t,e,i,n,o){var a=i._isZoomActive;n&&"takeGlobalCursor"===n.type&&(a="dataZoomSelect"===n.key&&n.dataZoomSelectActive),i._isZoomActive=a,t.setIconStatus("zoom",a?"emphasis":"normal");var r=new Zm(Fy(t.option),e,{include:["grid"]});i._brushController.setPanels(r.makePanelOpts(o,function(t){return t.xAxisDeclared&&!t.yAxisDeclared?"lineX":!t.xAxisDeclared&&t.yAxisDeclared?"lineY":"rect"})).enableBrush(!!a&&{brushType:"auto",brushStyle:{lineWidth:0,fill:"rgba(0,0,0,0.2)"}})}function Zy(t){this.model=t}function Uy(t){return bN(t)}function jy(){if(!IN&&DN){IN=!0;var t=DN.styleSheets;t.length<31?DN.createStyleSheet().addRule(".zrvml","behavior:url(#default#VML)"):t[0].addRule(".zrvml","behavior:url(#default#VML)")}}function Xy(t){return parseInt(t,10)}function Yy(t,e){jy(),this.root=t,this.storage=e;var i=document.createElement("div"),n=document.createElement("div");i.style.cssText="display:inline-block;overflow:hidden;position:relative;width:300px;height:150px;",n.style.cssText="position:absolute;left:0;top:0;",t.appendChild(i),this._vmlRoot=n,this._vmlViewport=i,this.resize();var o=e.delFromStorage,a=e.addToStorage;e.delFromStorage=function(t){o.call(e,t),t&&t.onRemove&&t.onRemove(n)},e.addToStorage=function(t){t.onAdd&&t.onAdd(n),a.call(e,t)},this._firstPaint=!0}function qy(t){return function(){M_('In IE8.0 VML mode painter not support method "'+t+'"')}}function $y(t){return document.createElementNS(rO,t)}function Ky(t){return hO(1e4*t)/1e4}function Jy(t){return t-mO}function Qy(t,e){var i=e?t.textFill:t.fill;return null!=i&&i!==uO}function tx(t,e){var i=e?t.textStroke:t.stroke;return null!=i&&i!==uO}function ex(t,e){e&&ix(t,"transform","matrix("+lO.call(e,",")+")")}function ix(t,e,i){(!i||"linear"!==i.type&&"radial"!==i.type)&&t.setAttribute(e,i)}function nx(t,e,i){t.setAttributeNS("http://www.w3.org/1999/xlink",e,i)}function ox(t,e,i){if(Qy(e,i)){var n=i?e.textFill:e.fill;n="transparent"===n?uO:n,"none"!==t.getAttribute("clip-path")&&n===uO&&(n="rgba(0, 0, 0, 0.002)"),ix(t,"fill",n),ix(t,"fill-opacity",e.opacity)}else ix(t,"fill",uO);if(tx(e,i)){var o=i?e.textStroke:e.stroke;ix(t,"stroke",o="transparent"===o?uO:o),ix(t,"stroke-width",(i?e.textStrokeWidth:e.lineWidth)/(!i&&e.strokeNoScale?e.host.getLineScale():1)),ix(t,"paint-order",i?"stroke":"fill"),ix(t,"stroke-opacity",e.opacity),e.lineDash?(ix(t,"stroke-dasharray",e.lineDash.join(",")),ix(t,"stroke-dashoffset",hO(e.lineDashOffset||0))):ix(t,"stroke-dasharray",""),e.lineCap&&ix(t,"stroke-linecap",e.lineCap),e.lineJoin&&ix(t,"stroke-linejoin",e.lineJoin),e.miterLimit&&ix(t,"stroke-miterlimit",e.miterLimit)}else ix(t,"stroke",uO)}function ax(t){for(var e=[],i=t.data,n=t.len(),o=0;o=pO||!Jy(g)&&(d>-fO&&d<0||d>fO)==!!p;var y=Ky(s+u*dO(c)),x=Ky(l+h*cO(c));m&&(d=p?pO-1e-4:1e-4-pO,v=!0,9===o&&e.push("M",y,x));var _=Ky(s+u*dO(c+d)),w=Ky(l+h*cO(c+d));e.push("A",Ky(u),Ky(h),hO(f*gO),+v,+p,_,w);break;case sO.Z:a="Z";break;case sO.R:var _=Ky(i[o++]),w=Ky(i[o++]),b=Ky(i[o++]),S=Ky(i[o++]);e.push("M",_,w,"L",_+b,w,"L",_+b,w+S,"L",_,w+S,"L",_,w)}a&&e.push(a);for(var M=0;M=11)}}(navigator.userAgent),Cx={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1,"[object CanvasPattern]":1,"[object Image]":1,"[object Canvas]":1},Lx={"[object Int8Array]":1,"[object Uint8Array]":1,"[object Uint8ClampedArray]":1,"[object Int16Array]":1,"[object Uint16Array]":1,"[object Int32Array]":1,"[object Uint32Array]":1,"[object Float32Array]":1,"[object Float64Array]":1},kx=Object.prototype.toString,Px=Array.prototype,Nx=Px.forEach,Ox=Px.filter,Ex=Px.slice,zx=Px.map,Rx=Px.reduce,Bx={},Vx=function(){return Bx.createCanvas()};Bx.createCanvas=function(){return document.createElement("canvas")};var Gx,Fx="__ec_primitive__";E.prototype={constructor:E,get:function(t){return this.hasOwnProperty(t)?this[t]:null},set:function(t,e){return this[t]=e},each:function(t,e){void 0!==e&&(t=m(t,e));for(var i in this)this.hasOwnProperty(i)&&t(this[i],i)},removeKey:function(t){delete this[t]}};var Wx=(Object.freeze||Object)({$override:e,clone:i,merge:n,mergeAll:o,extend:a,defaults:r,createCanvas:Vx,getContext:s,indexOf:l,inherits:u,mixin:h,isArrayLike:c,each:d,map:f,reduce:p,filter:g,find:function(t,e,i){if(t&&e)for(var n=0,o=t.length;n3&&(e=qx.call(e,1));for(var n=this._$handlers[t],o=n.length,a=0;a4&&(e=qx.call(e,1,e.length-1));for(var n=e[e.length-1],o=this._$handlers[t],a=o.length,r=0;r=0;a--){var r;if(n[a]!==i&&!n[a].ignore&&(r=rt(n[a],t,e))&&(!o.topTarget&&(o.topTarget=n[a]),r!==Kx)){o.target=n[a];break}}return o}},d(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(t){Qx.prototype[t]=function(e){var i=this.findHover(e.zrX,e.zrY),n=i.target;if("mousedown"===t)this._downEl=n,this._downPoint=[e.zrX,e.zrY],this._upEl=n;else if("mouseup"===t)this._upEl=n;else if("click"===t){if(this._downEl!==this._upEl||!this._downPoint||jx(this._downPoint,[e.zrX,e.zrY])>4)return;this._downPoint=null}this.dispatchToElement(i,t,e)}}),h(Qx,$x),h(Qx,it);var t_="undefined"==typeof Float32Array?Array:Float32Array,e_=(Object.freeze||Object)({create:st,identity:lt,copy:ut,mul:ht,translate:ct,rotate:dt,scale:ft,invert:pt,clone:gt}),i_=lt,n_=5e-5,o_=function(t){(t=t||{}).position||(this.position=[0,0]),null==t.rotation&&(this.rotation=0),t.scale||(this.scale=[1,1]),this.origin=this.origin||null},a_=o_.prototype;a_.transform=null,a_.needLocalTransform=function(){return mt(this.rotation)||mt(this.position[0])||mt(this.position[1])||mt(this.scale[0]-1)||mt(this.scale[1]-1)},a_.updateTransform=function(){var t=this.parent,e=t&&t.transform,i=this.needLocalTransform(),n=this.transform;i||e?(n=n||st(),i?this.getLocalTransform(n):i_(n),e&&(i?ht(n,t.transform,n):ut(n,t.transform)),this.transform=n,this.invTransform=this.invTransform||st(),pt(this.invTransform,n)):n&&i_(n)},a_.getLocalTransform=function(t){return o_.getLocalTransform(this,t)},a_.setTransform=function(t){var e=this.transform,i=t.dpr||1;e?t.setTransform(i*e[0],i*e[1],i*e[2],i*e[3],i*e[4],i*e[5]):t.setTransform(i,0,0,i,0,0)},a_.restoreTransform=function(t){var e=t.dpr||1;t.setTransform(e,0,0,e,0,0)};var r_=[];a_.decomposeTransform=function(){if(this.transform){var t=this.parent,e=this.transform;t&&t.transform&&(ht(r_,t.invTransform,e),e=r_);var i=e[0]*e[0]+e[1]*e[1],n=e[2]*e[2]+e[3]*e[3],o=this.position,a=this.scale;mt(i-1)&&(i=Math.sqrt(i)),mt(n-1)&&(n=Math.sqrt(n)),e[0]<0&&(i=-i),e[3]<0&&(n=-n),o[0]=e[4],o[1]=e[5],a[0]=i,a[1]=n,this.rotation=Math.atan2(-e[1]/n,e[0]/i)}},a_.getGlobalScale=function(){var t=this.transform;if(!t)return[1,1];var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]),i=Math.sqrt(t[2]*t[2]+t[3]*t[3]);return t[0]<0&&(e=-e),t[3]<0&&(i=-i),[e,i]},a_.transformCoordToLocal=function(t,e){var i=[t,e],n=this.invTransform;return n&&Q(i,i,n),i},a_.transformCoordToGlobal=function(t,e){var i=[t,e],n=this.transform;return n&&Q(i,i,n),i},o_.getLocalTransform=function(t,e){i_(e=e||[]);var i=t.origin,n=t.scale||[1,1],o=t.rotation||0,a=t.position||[0,0];return i&&(e[4]-=i[0],e[5]-=i[1]),ft(e,e,n),o&&dt(e,e,o),i&&(e[4]+=i[0],e[5]+=i[1]),e[4]+=a[0],e[5]+=a[1],e};var s_={linear:function(t){return t},quadraticIn:function(t){return t*t},quadraticOut:function(t){return t*(2-t)},quadraticInOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},cubicIn:function(t){return t*t*t},cubicOut:function(t){return--t*t*t+1},cubicInOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},quarticIn:function(t){return t*t*t*t},quarticOut:function(t){return 1- --t*t*t*t},quarticInOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},quinticIn:function(t){return t*t*t*t*t},quinticOut:function(t){return--t*t*t*t*t+1},quinticInOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},sinusoidalIn:function(t){return 1-Math.cos(t*Math.PI/2)},sinusoidalOut:function(t){return Math.sin(t*Math.PI/2)},sinusoidalInOut:function(t){return.5*(1-Math.cos(Math.PI*t))},exponentialIn:function(t){return 0===t?0:Math.pow(1024,t-1)},exponentialOut:function(t){return 1===t?1:1-Math.pow(2,-10*t)},exponentialInOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))},circularIn:function(t){return 1-Math.sqrt(1-t*t)},circularOut:function(t){return Math.sqrt(1- --t*t)},circularInOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},elasticIn:function(t){var e,i=.1;return 0===t?0:1===t?1:(!i||i<1?(i=1,e=.1):e=.4*Math.asin(1/i)/(2*Math.PI),-i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4))},elasticOut:function(t){var e,i=.1;return 0===t?0:1===t?1:(!i||i<1?(i=1,e=.1):e=.4*Math.asin(1/i)/(2*Math.PI),i*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/.4)+1)},elasticInOut:function(t){var e,i=.1;return 0===t?0:1===t?1:(!i||i<1?(i=1,e=.1):e=.4*Math.asin(1/i)/(2*Math.PI),(t*=2)<1?i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4)*-.5:i*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4)*.5+1)},backIn:function(t){var e=1.70158;return t*t*((e+1)*t-e)},backOut:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},backInOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)},bounceIn:function(t){return 1-s_.bounceOut(1-t)},bounceOut:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},bounceInOut:function(t){return t<.5?.5*s_.bounceIn(2*t):.5*s_.bounceOut(2*t-1)+.5}};vt.prototype={constructor:vt,step:function(t,e){if(this._initialized||(this._startTime=t+this._delay,this._initialized=!0),this._paused)this._pausedTime+=e;else{var i=(t-this._startTime-this._pausedTime)/this._life;if(!(i<0)){i=Math.min(i,1);var n=this.easing,o="string"==typeof n?s_[n]:n,a="function"==typeof o?o(i):i;return this.fire("frame",a),1==i?this.loop?(this.restart(t),"restart"):(this._needsRemove=!0,"destroy"):null}}},restart:function(t){var e=(t-this._startTime-this._pausedTime)%this._life;this._startTime=t-e+this.gap,this._pausedTime=0,this._needsRemove=!1},fire:function(t,e){this[t="on"+t]&&this[t](this._target,e)},pause:function(){this._paused=!0},resume:function(){this._paused=!1}};var l_=function(){this.head=null,this.tail=null,this._len=0},u_=l_.prototype;u_.insert=function(t){var e=new h_(t);return this.insertEntry(e),e},u_.insertEntry=function(t){this.head?(this.tail.next=t,t.prev=this.tail,t.next=null,this.tail=t):this.head=this.tail=t,this._len++},u_.remove=function(t){var e=t.prev,i=t.next;e?e.next=i:this.head=i,i?i.prev=e:this.tail=e,t.next=t.prev=null,this._len--},u_.len=function(){return this._len},u_.clear=function(){this.head=this.tail=null,this._len=0};var h_=function(t){this.value=t,this.next,this.prev},c_=function(t){this._list=new l_,this._map={},this._maxSize=t||10,this._lastRemovedEntry=null},d_=c_.prototype;d_.put=function(t,e){var i=this._list,n=this._map,o=null;if(null==n[t]){var a=i.len(),r=this._lastRemovedEntry;if(a>=this._maxSize&&a>0){var s=i.head;i.remove(s),delete n[s.key],o=s.value,this._lastRemovedEntry=s}r?r.value=e:r=new h_(e),r.key=t,i.insertEntry(r),n[t]=r}return o},d_.get=function(t){var e=this._map[t],i=this._list;if(null!=e)return e!==i.tail&&(i.remove(e),i.insertEntry(e)),e.value},d_.clear=function(){this._list.clear(),this._map={}};var f_={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]},p_=new c_(20),g_=null,m_=Nt,v_=Ot,y_=(Object.freeze||Object)({parse:At,lift:kt,toHex:Pt,fastLerp:Nt,fastMapToColor:m_,lerp:Ot,mapToColor:v_,modifyHSL:Et,modifyAlpha:zt,stringify:Rt}),x_=Array.prototype.slice,__=function(t,e,i,n){this._tracks={},this._target=t,this._loop=e||!1,this._getter=i||Bt,this._setter=n||Vt,this._clipCount=0,this._delay=0,this._doneList=[],this._onframeList=[],this._clipList=[]};__.prototype={when:function(t,e){var i=this._tracks;for(var n in e)if(e.hasOwnProperty(n)){if(!i[n]){i[n]=[];var o=this._getter(this._target,n);if(null==o)continue;0!==t&&i[n].push({time:0,value:Xt(o)})}i[n].push({time:t,value:e[n]})}return this},during:function(t){return this._onframeList.push(t),this},pause:function(){for(var t=0;t0&&this.animate(t,!1).when(null==n?500:n,a).delay(o||0),this}};var D_=function(t){o_.call(this,t),$x.call(this,t),I_.call(this,t),this.id=t.id||Dx()};D_.prototype={type:"element",name:"",__zr:null,ignore:!1,clipPath:null,isGroup:!1,drift:function(t,e){switch(this.draggable){case"horizontal":e=0;break;case"vertical":t=0}var i=this.transform;i||(i=this.transform=[1,0,0,1,0,0]),i[4]+=t,i[5]+=e,this.decomposeTransform(),this.dirty(!1)},beforeUpdate:function(){},afterUpdate:function(){},update:function(){this.updateTransform()},traverse:function(t,e){},attrKV:function(t,e){if("position"===t||"scale"===t||"origin"===t){if(e){var i=this[t];i||(i=this[t]=[]),i[0]=e[0],i[1]=e[1]}}else this[t]=e},hide:function(){this.ignore=!0,this.__zr&&this.__zr.refresh()},show:function(){this.ignore=!1,this.__zr&&this.__zr.refresh()},attr:function(t,e){if("string"==typeof t)this.attrKV(t,e);else if(w(t))for(var i in t)t.hasOwnProperty(i)&&this.attrKV(i,t[i]);return this.dirty(!1),this},setClipPath:function(t){var e=this.__zr;e&&t.addSelfToZr(e),this.clipPath&&this.clipPath!==t&&this.removeClipPath(),this.clipPath=t,t.__zr=e,t.__clipTarget=this,this.dirty(!1)},removeClipPath:function(){var t=this.clipPath;t&&(t.__zr&&t.removeSelfFromZr(t.__zr),t.__zr=null,t.__clipTarget=null,this.clipPath=null,this.dirty(!1))},addSelfToZr:function(t){this.__zr=t;var e=this.animators;if(e)for(var i=0;i=i.x&&t<=i.x+i.width&&e>=i.y&&e<=i.y+i.height},clone:function(){return new Kt(this.x,this.y,this.width,this.height)},copy:function(t){this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height},plain:function(){return{x:this.x,y:this.y,width:this.width,height:this.height}}},Kt.create=function(t){return new Kt(t.x,t.y,t.width,t.height)};var L_=function(t){t=t||{},D_.call(this,t);for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);this._children=[],this.__storage=null,this.__dirty=!0};L_.prototype={constructor:L_,isGroup:!0,type:"group",silent:!1,children:function(){return this._children.slice()},childAt:function(t){return this._children[t]},childOfName:function(t){for(var e=this._children,i=0;i=0&&(i.splice(n,0,t),this._doAdd(t))}return this},_doAdd:function(t){t.parent&&t.parent.remove(t),t.parent=this;var e=this.__storage,i=this.__zr;e&&e!==t.__storage&&(e.addToStorage(t),t instanceof L_&&t.addChildrenToStorage(e)),i&&i.refresh()},remove:function(t){var e=this.__zr,i=this.__storage,n=this._children,o=l(n,t);return o<0?this:(n.splice(o,1),t.parent=null,i&&(i.delFromStorage(t),t instanceof L_&&t.delChildrenFromStorage(i)),e&&e.refresh(),this)},removeAll:function(){var t,e,i=this._children,n=this.__storage;for(e=0;e=0&&(this.delFromStorage(t),this._roots.splice(o,1),t instanceof L_&&t.delChildrenFromStorage(this))}},addToStorage:function(t){return t&&(t.__storage=this,t.dirty(!1)),this},delFromStorage:function(t){return t&&(t.__storage=null),this},dispose:function(){this._renderList=this._roots=null},displayableSortFunc:re};var O_={shadowBlur:1,shadowOffsetX:1,shadowOffsetY:1,textShadowBlur:1,textShadowOffsetX:1,textShadowOffsetY:1,textBoxShadowBlur:1,textBoxShadowOffsetX:1,textBoxShadowOffsetY:1},E_=function(t,e,i){return O_.hasOwnProperty(e)?i*=t.dpr:i},z_=[["shadowBlur",0],["shadowOffsetX",0],["shadowOffsetY",0],["shadowColor","#000"],["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]],R_=function(t,e){this.extendFrom(t,!1),this.host=e};R_.prototype={constructor:R_,host:null,fill:"#000",stroke:null,opacity:1,lineDash:null,lineDashOffset:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,lineWidth:1,strokeNoScale:!1,text:null,font:null,textFont:null,fontStyle:null,fontWeight:null,fontSize:null,fontFamily:null,textTag:null,textFill:"#000",textStroke:null,textWidth:null,textHeight:null,textStrokeWidth:0,textLineHeight:null,textPosition:"inside",textRect:null,textOffset:null,textAlign:null,textVerticalAlign:null,textDistance:5,textShadowColor:"transparent",textShadowBlur:0,textShadowOffsetX:0,textShadowOffsetY:0,textBoxShadowColor:"transparent",textBoxShadowBlur:0,textBoxShadowOffsetX:0,textBoxShadowOffsetY:0,transformText:!1,textRotation:0,textOrigin:null,textBackgroundColor:null,textBorderColor:null,textBorderWidth:0,textBorderRadius:0,textPadding:null,rich:null,truncate:null,blend:null,bind:function(t,e,i){for(var n=this,o=i&&i.style,a=!o,r=0;r0},extendFrom:function(t,e){if(t)for(var i in t)!t.hasOwnProperty(i)||!0!==e&&(!1===e?this.hasOwnProperty(i):null==t[i])||(this[i]=t[i])},set:function(t,e){"string"==typeof t?this[t]=e:this.extendFrom(t,!0)},clone:function(){var t=new this.constructor;return t.extendFrom(this,!0),t},getGradient:function(t,e,i){for(var n=("radial"===e.type?le:se)(t,e,i),o=e.colorStops,a=0;a=0&&i.splice(n,1),t.__hoverMir=null},clearHover:function(t){for(var e=this._hoverElements,i=0;i15)break}s.__drawIndex=m,s.__drawIndex0&&t>n[0]){for(r=0;rt);r++);a=i[n[r]]}if(n.splice(r+1,0,t),i[t]=e,!e.virtual)if(a){var l=a.dom;l.nextSibling?s.insertBefore(e.dom,l.nextSibling):s.appendChild(e.dom)}else s.firstChild?s.insertBefore(e.dom,s.firstChild):s.appendChild(e.dom)}else M_("Layer of zlevel "+t+" is not valid")},eachLayer:function(t,e){var i,n,o=this._zlevelList;for(n=0;n0?.01:0),this._needsManuallyCompositing),a.__builtin__||M_("ZLevel "+s+" has been used by unkown layer "+a.id),a!==i&&(a.__used=!0,a.__startIndex!==o&&(a.__dirty=!0),a.__startIndex=o,a.incremental?a.__drawIndex=-1:a.__drawIndex=o,e(o),i=a),r.__dirty&&(a.__dirty=!0,a.incremental&&a.__drawIndex<0&&(a.__drawIndex=o))}e(o),this.eachBuiltinLayer(function(t,e){!t.__used&&t.getElementCount()>0&&(t.__dirty=!0,t.__startIndex=t.__endIndex=t.__drawIndex=0),t.__dirty&&t.__drawIndex<0&&(t.__drawIndex=t.__startIndex)})},clear:function(){return this.eachBuiltinLayer(this._clearLayer),this},_clearLayer:function(t){t.clear()},setBackgroundColor:function(t){this._backgroundColor=t},configLayer:function(t,e){if(e){var i=this._layerConfig;i[t]?n(i[t],e,!0):i[t]=e;for(var o=0;o=0&&this._clips.splice(e,1)},removeAnimator:function(t){for(var e=t.getClips(),i=0;i1&&n&&n.length>1){var a=di(n)/di(o);!isFinite(a)&&(a=1),e.pinchScale=a;var r=fi(n);return e.pinchX=r[0],e.pinchY=r[1],{type:"pinch",target:t[0].target,event:e}}}}},hw=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],cw=["touchstart","touchend","touchmove"],dw={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},fw=f(hw,function(t){var e=t.replace("mouse","pointer");return dw[e]?e:t}),pw={mousemove:function(t){t=li(this.dom,t),this.trigger("mousemove",t)},mouseout:function(t){var e=(t=li(this.dom,t)).toElement||t.relatedTarget;if(e!=this.dom)for(;e&&9!=e.nodeType;){if(e===this.dom)return;e=e.parentNode}this.trigger("mouseout",t)},touchstart:function(t){(t=li(this.dom,t)).zrByTouch=!0,this._lastTouchMoment=new Date,gi(this,t,"start"),pw.mousemove.call(this,t),pw.mousedown.call(this,t),mi(this)},touchmove:function(t){(t=li(this.dom,t)).zrByTouch=!0,gi(this,t,"change"),pw.mousemove.call(this,t),mi(this)},touchend:function(t){(t=li(this.dom,t)).zrByTouch=!0,gi(this,t,"end"),pw.mouseup.call(this,t),+new Date-this._lastTouchMoment<300&&pw.click.call(this,t),mi(this)},pointerdown:function(t){pw.mousedown.call(this,t)},pointermove:function(t){vi(t)||pw.mousemove.call(this,t)},pointerup:function(t){pw.mouseup.call(this,t)},pointerout:function(t){vi(t)||pw.mouseout.call(this,t)}};d(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(t){pw[t]=function(e){e=li(this.dom,e),this.trigger(t,e)}});var gw=xi.prototype;gw.dispose=function(){for(var t=hw.concat(cw),e=0;e=0||n&&l(n,r)<0)){var s=e.getShallow(r);null!=s&&(o[t[a][0]]=s)}}return o}},kw=Lw([["lineWidth","width"],["stroke","color"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]),Pw={getLineStyle:function(t){var e=kw(this,t),i=this.getLineDash(e.lineWidth);return i&&(e.lineDash=i),e},getLineDash:function(t){null==t&&(t=1);var e=this.get("type"),i=Math.max(t,2),n=4*t;return"solid"===e||null==e?null:"dashed"===e?[n,n]:[i,i]}},Nw=Lw([["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]]),Ow={getAreaStyle:function(t,e){return Nw(this,t,e)}},Ew=Math.pow,zw=Math.sqrt,Rw=1e-8,Bw=1e-4,Vw=zw(3),Gw=1/3,Fw=V(),Ww=V(),Hw=V(),Zw=Math.min,Uw=Math.max,jw=Math.sin,Xw=Math.cos,Yw=2*Math.PI,qw=V(),$w=V(),Kw=V(),Jw=[],Qw=[],tb={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},eb=[],ib=[],nb=[],ob=[],ab=Math.min,rb=Math.max,sb=Math.cos,lb=Math.sin,ub=Math.sqrt,hb=Math.abs,cb="undefined"!=typeof Float32Array,db=function(t){this._saveData=!t,this._saveData&&(this.data=[]),this._ctx=null};db.prototype={constructor:db,_xi:0,_yi:0,_x0:0,_y0:0,_ux:0,_uy:0,_len:0,_lineDash:null,_dashOffset:0,_dashIdx:0,_dashSum:0,setScale:function(t,e){this._ux=hb(1/b_/t)||0,this._uy=hb(1/b_/e)||0},getContext:function(){return this._ctx},beginPath:function(t){return this._ctx=t,t&&t.beginPath(),t&&(this.dpr=t.dpr),this._saveData&&(this._len=0),this._lineDash&&(this._lineDash=null,this._dashOffset=0),this},moveTo:function(t,e){return this.addData(tb.M,t,e),this._ctx&&this._ctx.moveTo(t,e),this._x0=t,this._y0=e,this._xi=t,this._yi=e,this},lineTo:function(t,e){var i=hb(t-this._xi)>this._ux||hb(e-this._yi)>this._uy||this._len<5;return this.addData(tb.L,t,e),this._ctx&&i&&(this._needsDash()?this._dashedLineTo(t,e):this._ctx.lineTo(t,e)),i&&(this._xi=t,this._yi=e),this},bezierCurveTo:function(t,e,i,n,o,a){return this.addData(tb.C,t,e,i,n,o,a),this._ctx&&(this._needsDash()?this._dashedBezierTo(t,e,i,n,o,a):this._ctx.bezierCurveTo(t,e,i,n,o,a)),this._xi=o,this._yi=a,this},quadraticCurveTo:function(t,e,i,n){return this.addData(tb.Q,t,e,i,n),this._ctx&&(this._needsDash()?this._dashedQuadraticTo(t,e,i,n):this._ctx.quadraticCurveTo(t,e,i,n)),this._xi=i,this._yi=n,this},arc:function(t,e,i,n,o,a){return this.addData(tb.A,t,e,i,i,n,o-n,0,a?0:1),this._ctx&&this._ctx.arc(t,e,i,n,o,a),this._xi=sb(o)*i+t,this._yi=lb(o)*i+t,this},arcTo:function(t,e,i,n,o){return this._ctx&&this._ctx.arcTo(t,e,i,n,o),this},rect:function(t,e,i,n){return this._ctx&&this._ctx.rect(t,e,i,n),this.addData(tb.R,t,e,i,n),this},closePath:function(){this.addData(tb.Z);var t=this._ctx,e=this._x0,i=this._y0;return t&&(this._needsDash()&&this._dashedLineTo(e,i),t.closePath()),this._xi=e,this._yi=i,this},fill:function(t){t&&t.fill(),this.toStatic()},stroke:function(t){t&&t.stroke(),this.toStatic()},setLineDash:function(t){if(t instanceof Array){this._lineDash=t,this._dashIdx=0;for(var e=0,i=0;ie.length&&(this._expandData(),e=this.data);for(var i=0;i0&&f<=t||h<0&&f>=t||0==h&&(c>0&&p<=e||c<0&&p>=e);)f+=h*(i=r[n=this._dashIdx]),p+=c*i,this._dashIdx=(n+1)%g,h>0&&fl||c>0&&pu||s[n%2?"moveTo":"lineTo"](h>=0?ab(f,t):rb(f,t),c>=0?ab(p,e):rb(p,e));h=f-t,c=p-e,this._dashOffset=-ub(h*h+c*c)},_dashedBezierTo:function(t,e,i,n,o,a){var r,s,l,u,h,c=this._dashSum,d=this._dashOffset,f=this._lineDash,p=this._ctx,g=this._xi,m=this._yi,v=Xi,y=0,x=this._dashIdx,_=f.length,w=0;for(d<0&&(d=c+d),d%=c,r=0;r<1;r+=.1)s=v(g,t,i,o,r+.1)-v(g,t,i,o,r),l=v(m,e,n,a,r+.1)-v(m,e,n,a,r),y+=ub(s*s+l*l);for(;x<_&&!((w+=f[x])>d);x++);for(r=(w-d)/y;r<=1;)u=v(g,t,i,o,r),h=v(m,e,n,a,r),x%2?p.moveTo(u,h):p.lineTo(u,h),r+=f[x]/y,x=(x+1)%_;x%2!=0&&p.lineTo(o,a),s=o-u,l=a-h,this._dashOffset=-ub(s*s+l*l)},_dashedQuadraticTo:function(t,e,i,n){var o=i,a=n;i=(i+2*t)/3,n=(n+2*e)/3,t=(this._xi+2*t)/3,e=(this._yi+2*e)/3,this._dashedBezierTo(t,e,i,n,o,a)},toStatic:function(){var t=this.data;t instanceof Array&&(t.length=this._len,cb&&(this.data=new Float32Array(t)))},getBoundingRect:function(){eb[0]=eb[1]=nb[0]=nb[1]=Number.MAX_VALUE,ib[0]=ib[1]=ob[0]=ob[1]=-Number.MAX_VALUE;for(var t=this.data,e=0,i=0,n=0,o=0,a=0;al||hb(r-o)>u||c===h-1)&&(t.lineTo(a,r),n=a,o=r);break;case tb.C:t.bezierCurveTo(s[c++],s[c++],s[c++],s[c++],s[c++],s[c++]),n=s[c-2],o=s[c-1];break;case tb.Q:t.quadraticCurveTo(s[c++],s[c++],s[c++],s[c++]),n=s[c-2],o=s[c-1];break;case tb.A:var f=s[c++],p=s[c++],g=s[c++],m=s[c++],v=s[c++],y=s[c++],x=s[c++],_=s[c++],w=g>m?g:m,b=g>m?1:g/m,S=g>m?m/g:1,M=v+y;Math.abs(g-m)>.001?(t.translate(f,p),t.rotate(x),t.scale(b,S),t.arc(0,0,w,v,M,1-_),t.scale(1/b,1/S),t.rotate(-x),t.translate(-f,-p)):t.arc(f,p,w,v,M,1-_),1==c&&(e=sb(v)*g+f,i=lb(v)*m+p),n=sb(M)*g+f,o=lb(M)*m+p;break;case tb.R:e=n=s[c],i=o=s[c+1],t.rect(s[c++],s[c++],s[c++],s[c++]);break;case tb.Z:t.closePath(),n=e,o=i}}}},db.CMD=tb;var fb=2*Math.PI,pb=2*Math.PI,gb=db.CMD,mb=2*Math.PI,vb=1e-4,yb=[-1,-1,-1],xb=[-1,-1],_b=F_.prototype.getCanvasPattern,wb=Math.abs,bb=new db(!0);In.prototype={constructor:In,type:"path",__dirtyPath:!0,strokeContainThreshold:5,brush:function(t,e){var i=this.style,n=this.path||bb,o=i.hasStroke(),a=i.hasFill(),r=i.fill,s=i.stroke,l=a&&!!r.colorStops,u=o&&!!s.colorStops,h=a&&!!r.image,c=o&&!!s.image;if(i.bind(t,this,e),this.setTransform(t),this.__dirty){var d;l&&(d=d||this.getBoundingRect(),this._fillGradient=i.getGradient(t,r,d)),u&&(d=d||this.getBoundingRect(),this._strokeGradient=i.getGradient(t,s,d))}l?t.fillStyle=this._fillGradient:h&&(t.fillStyle=_b.call(r,t)),u?t.strokeStyle=this._strokeGradient:c&&(t.strokeStyle=_b.call(s,t));var f=i.lineDash,p=i.lineDashOffset,g=!!t.setLineDash,m=this.getGlobalScale();n.setScale(m[0],m[1]),this.__dirtyPath||f&&!g&&o?(n.beginPath(t),f&&!g&&(n.setLineDash(f),n.setLineDashOffset(p)),this.buildPath(n,this.shape,!1),this.path&&(this.__dirtyPath=!1)):(t.beginPath(),this.path.rebuildPath(t)),a&&n.fill(t),f&&g&&(t.setLineDash(f),t.lineDashOffset=p),o&&n.stroke(t),f&&g&&t.setLineDash([]),null!=i.text&&(this.restoreTransform(t),this.drawRectText(t,this.getBoundingRect()))},buildPath:function(t,e,i){},createPathProxy:function(){this.path=new db},getBoundingRect:function(){var t=this._rect,e=this.style,i=!t;if(i){var n=this.path;n||(n=this.path=new db),this.__dirtyPath&&(n.beginPath(),this.buildPath(n,this.shape,!1)),t=n.getBoundingRect()}if(this._rect=t,e.hasStroke()){var o=this._rectWithStroke||(this._rectWithStroke=t.clone());if(this.__dirty||i){o.copy(t);var a=e.lineWidth,r=e.strokeNoScale?this.getLineScale():1;e.hasFill()||(a=Math.max(a,this.strokeContainThreshold||4)),r>1e-10&&(o.width+=a/r,o.height+=a/r,o.x-=a/r/2,o.y-=a/r/2)}return o}return t},contain:function(t,e){var i=this.transformCoordToLocal(t,e),n=this.getBoundingRect(),o=this.style;if(t=i[0],e=i[1],n.contain(t,e)){var a=this.path.data;if(o.hasStroke()){var r=o.lineWidth,s=o.strokeNoScale?this.getLineScale():1;if(s>1e-10&&(o.hasFill()||(r=Math.max(r,this.strokeContainThreshold)),Mn(a,r/s,t,e)))return!0}if(o.hasFill())return Sn(a,t,e)}return!1},dirty:function(t){null==t&&(t=!0),t&&(this.__dirtyPath=t,this._rect=null),this.__dirty=!0,this.__zr&&this.__zr.refresh(),this.__clipTarget&&this.__clipTarget.dirty()},animateShape:function(t){return this.animate("shape",t)},attrKV:function(t,e){"shape"===t?(this.setShape(e),this.__dirtyPath=!0,this._rect=null):Ke.prototype.attrKV.call(this,t,e)},setShape:function(t,e){var i=this.shape;if(i){if(w(t))for(var n in t)t.hasOwnProperty(n)&&(i[n]=t[n]);else i[t]=e;this.dirty(!0)}return this},getLineScale:function(){var t=this.transform;return t&&wb(t[0]-1)>1e-10&&wb(t[3]-1)>1e-10?Math.sqrt(wb(t[0]*t[3]-t[2]*t[1])):1}},In.extend=function(t){var e=function(e){In.call(this,e),t.style&&this.style.extendFrom(t.style,!1);var i=t.shape;if(i){this.shape=this.shape||{};var n=this.shape;for(var o in i)!n.hasOwnProperty(o)&&i.hasOwnProperty(o)&&(n[o]=i[o])}t.init&&t.init.call(this,e)};u(e,In);for(var i in t)"style"!==i&&"shape"!==i&&(e.prototype[i]=t[i]);return e},u(In,Ke);var Sb=db.CMD,Mb=[[],[],[]],Ib=Math.sqrt,Db=Math.atan2,Tb=function(t,e){var i,n,o,a,r,s,l=t.data,u=Sb.M,h=Sb.C,c=Sb.L,d=Sb.R,f=Sb.A,p=Sb.Q;for(o=0,a=0;o=11?function(){var e,i=this.__clipPaths,n=this.style;if(i)for(var o=0;oi-2?i-1:c+1],u=t[c>i-3?i-1:c+2]);var p=d*d,g=d*p;n.push([kn(s[0],f[0],l[0],u[0],d,p,g),kn(s[1],f[1],l[1],u[1],d,p,g)])}return n},Hb=function(t,e,i,n){var o,a,r,s,l=[],u=[],h=[],c=[];if(n){r=[1/0,1/0],s=[-1/0,-1/0];for(var d=0,f=t.length;d=i&&a>=o)return{x:i,y:o,width:n-i,height:a-o}},createIcon:_o,Group:L_,Image:Je,Text:zb,Circle:Rb,Sector:Gb,Ring:Fb,Polygon:Zb,Polyline:Ub,Rect:jb,Line:Xb,BezierCurve:qb,Arc:$b,IncrementalDisplayable:On,CompoundPath:Kb,LinearGradient:Qb,RadialGradient:tS,BoundingRect:Kt}),lS=["textStyle","color"],uS={getTextColor:function(t){var e=this.ecModel;return this.getShallow("color")||(!t&&e?e.get(lS):null)},getFont:function(){return ho({fontStyle:this.getShallow("fontStyle"),fontWeight:this.getShallow("fontWeight"),fontSize:this.getShallow("fontSize"),fontFamily:this.getShallow("fontFamily")},this.ecModel)},getTextRect:function(t){return me(t,this.getFont(),this.getShallow("align"),this.getShallow("verticalAlign")||this.getShallow("baseline"),this.getShallow("padding"),this.getShallow("rich"),this.getShallow("truncateText"))}},hS=Lw([["fill","color"],["stroke","borderColor"],["lineWidth","borderWidth"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["textPosition"],["textAlign"]]),cS={getItemStyle:function(t,e){var i=hS(this,t,e),n=this.getBorderLineDash();return n&&(i.lineDash=n),i},getBorderLineDash:function(){var t=this.get("borderType");return"solid"===t||null==t?null:"dashed"===t?[5,5]:[1,1]}},dS=h,fS=Ni();wo.prototype={constructor:wo,init:null,mergeOption:function(t){n(this.option,t,!0)},get:function(t,e){return null==t?this.option:bo(this.option,this.parsePath(t),!e&&So(this,t))},getShallow:function(t,e){var i=this.option,n=null==i?i:i[t],o=!e&&So(this,t);return null==n&&o&&(n=o.getShallow(t)),n},getModel:function(t,e){var i,n=null==t?this.option:bo(this.option,t=this.parsePath(t));return e=e||(i=So(this,t))&&i.getModel(t),new wo(n,e,this.ecModel)},isEmpty:function(){return null==this.option},restoreData:function(){},clone:function(){return new(0,this.constructor)(i(this.option))},setReadOnly:function(t){},parsePath:function(t){return"string"==typeof t&&(t=t.split(".")),t},customizeGetParent:function(t){fS(this).getParent=t},isAnimationEnabled:function(){if(!Ax.node){if(null!=this.option.animation)return!!this.option.animation;if(this.parentModel)return this.parentModel.isAnimationEnabled()}}},Gi(wo),Fi(wo),dS(wo,Pw),dS(wo,Ow),dS(wo,uS),dS(wo,cS);var pS=0,gS=1e-4,mS=9007199254740991,vS=/^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d\d)(?::(\d\d)(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/,yS=(Object.freeze||Object)({linearMap:Do,parsePercent:To,round:Ao,asc:Co,getPrecision:Lo,getPrecisionSafe:ko,getPixelPrecision:Po,getPercentWithPrecision:No,MAX_SAFE_INTEGER:mS,remRadian:Oo,isRadianAroundZero:Eo,parseDate:zo,quantity:Ro,nice:Vo,reformIntervals:Go,isNumeric:Fo}),xS=L,_S=["a","b","c","d","e","f","g"],wS=function(t,e){return"{"+t+(null==e?"":e)+"}"},bS=be,SS=me,MS=(Object.freeze||Object)({addCommas:Wo,toCamelCase:Ho,normalizeCssArray:xS,encodeHTML:Zo,formatTpl:Uo,formatTplSimple:jo,getTooltipMarker:Xo,formatTime:qo,capitalFirst:$o,truncateText:bS,getTextRect:SS}),IS=d,DS=["left","right","top","bottom","width","height"],TS=[["width","left","right"],["height","top","bottom"]],AS=Ko,CS=(v(Ko,"vertical"),v(Ko,"horizontal"),{getBoxLayoutParams:function(){return{left:this.get("left"),top:this.get("top"),right:this.get("right"),bottom:this.get("bottom"),width:this.get("width"),height:this.get("height")}}}),LS=Ni(),kS=wo.extend({type:"component",id:"",name:"",mainType:"",subType:"",componentIndex:0,defaultOption:null,ecModel:null,dependentModels:[],uid:null,layoutMode:null,$constructor:function(t,e,i,n){wo.call(this,t,e,i,n),this.uid=Mo("ec_cpt_model")},init:function(t,e,i,n){this.mergeDefaultAndTheme(t,i)},mergeDefaultAndTheme:function(t,e){var i=this.layoutMode,o=i?na(t):{};n(t,e.getTheme().get(this.mainType)),n(t,this.getDefaultOption()),i&&ia(t,o,i)},mergeOption:function(t,e){n(this.option,t,!0);var i=this.layoutMode;i&&ia(this.option,t,i)},optionUpdated:function(t,e){},getDefaultOption:function(){var t=LS(this);if(!t.defaultOption){for(var e=[],i=this.constructor;i;){var o=i.prototype.defaultOption;o&&e.push(o),i=i.superClass}for(var a={},r=e.length-1;r>=0;r--)a=n(a,e[r],!0);t.defaultOption=a}return t.defaultOption},getReferringComponents:function(t){return this.ecModel.queryComponents({mainType:t,index:this.get(t+"Index",!0),id:this.get(t+"Id",!0)})}});Zi(kS,{registerWhenExtend:!0}),function(t){var e={};t.registerSubTypeDefaulter=function(t,i){t=Bi(t),e[t.main]=i},t.determineSubType=function(i,n){var o=n.type;if(!o){var a=Bi(i).main;t.hasSubTypes(i)&&e[a]&&(o=e[a](n))}return o}}(kS),function(t,e){function i(t){var i={},a=[];return d(t,function(r){var s=n(i,r),u=o(s.originalDeps=e(r),t);s.entryCount=u.length,0===s.entryCount&&a.push(r),d(u,function(t){l(s.predecessor,t)<0&&s.predecessor.push(t);var e=n(i,t);l(e.successor,t)<0&&e.successor.push(r)})}),{graph:i,noEntryList:a}}function n(t,e){return t[e]||(t[e]={predecessor:[],successor:[]}),t[e]}function o(t,e){var i=[];return d(t,function(t){l(e,t)>=0&&i.push(t)}),i}t.topologicalTravel=function(t,e,n,o){function a(t){s[t].entryCount--,0===s[t].entryCount&&l.push(t)}if(t.length){var r=i(e),s=r.graph,l=r.noEntryList,u={};for(d(t,function(t){u[t]=!0});l.length;){var h=l.pop(),c=s[h],f=!!u[h];f&&(n.call(o,h,c.originalDeps.slice()),delete u[h]),d(c.successor,f?function(t){u[t]=!0,a(t)}:a)}d(u,function(){throw new Error("Circle dependency may exists")})}}}(kS,function(t){var e=[];return d(kS.getClassesByMainType(t),function(t){e=e.concat(t.prototype.dependencies||[])}),e=f(e,function(t){return Bi(t).main}),"dataset"!==t&&l(e,"dataset")<=0&&e.unshift("dataset"),e}),h(kS,CS);var PS="";"undefined"!=typeof navigator&&(PS=navigator.platform||"");var NS={color:["#c23531","#2f4554","#61a0a8","#d48265","#91c7ae","#749f83","#ca8622","#bda29a","#6e7074","#546570","#c4ccd3"],gradientColor:["#f6efa6","#d88273","#bf444c"],textStyle:{fontFamily:PS.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,animation:"auto",animationDuration:1e3,animationDurationUpdate:300,animationEasing:"exponentialOut",animationEasingUpdate:"cubicOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1},OS=Ni(),ES={clearColorPalette:function(){OS(this).colorIdx=0,OS(this).colorNameMap={}},getColorFromPalette:function(t,e,i){var n=OS(e=e||this),o=n.colorIdx||0,a=n.colorNameMap=n.colorNameMap||{};if(a.hasOwnProperty(t))return a[t];var r=Si(this.get("color",!0)),s=this.get("colorLayer",!0),l=null!=i&&s?aa(s,i):r;if((l=l||r)&&l.length){var u=l[o];return t&&(a[t]=u),n.colorIdx=(o+1)%l.length,u}}},zS={cartesian2d:function(t,e,i,n){var o=t.getReferringComponents("xAxis")[0],a=t.getReferringComponents("yAxis")[0];e.coordSysDims=["x","y"],i.set("x",o),i.set("y",a),sa(o)&&(n.set("x",o),e.firstCategoryDimIndex=0),sa(a)&&(n.set("y",a),e.firstCategoryDimIndex=1)},singleAxis:function(t,e,i,n){var o=t.getReferringComponents("singleAxis")[0];e.coordSysDims=["single"],i.set("single",o),sa(o)&&(n.set("single",o),e.firstCategoryDimIndex=0)},polar:function(t,e,i,n){var o=t.getReferringComponents("polar")[0],a=o.findAxisModel("radiusAxis"),r=o.findAxisModel("angleAxis");e.coordSysDims=["radius","angle"],i.set("radius",a),i.set("angle",r),sa(a)&&(n.set("radius",a),e.firstCategoryDimIndex=0),sa(r)&&(n.set("angle",r),e.firstCategoryDimIndex=1)},geo:function(t,e,i,n){e.coordSysDims=["lng","lat"]},parallel:function(t,e,i,n){var o=t.ecModel,a=o.getComponent("parallel",t.get("parallelIndex")),r=e.coordSysDims=a.dimensions.slice();d(a.parallelAxisIndex,function(t,a){var s=o.getComponent("parallelAxis",t),l=r[a];i.set(l,s),sa(s)&&null==e.firstCategoryDimIndex&&(n.set(l,s),e.firstCategoryDimIndex=a)})}},RS="original",BS="arrayRows",VS="objectRows",GS="keyedColumns",FS="unknown",WS="typedArray",HS="column",ZS="row";la.seriesDataToSource=function(t){return new la({data:t,sourceFormat:S(t)?WS:RS,fromDataset:!1})},Fi(la);var US=Ni(),jS="\0_ec_inner",XS=wo.extend({constructor:XS,init:function(t,e,i,n){i=i||{},this.option=null,this._theme=new wo(i),this._optionManager=n},setOption:function(t,e){k(!(jS in t),"please use chart.getOption()"),this._optionManager.setOption(t,e),this.resetOption(null)},resetOption:function(t){var e=!1,i=this._optionManager;if(!t||"recreate"===t){var n=i.mountOption("recreate"===t);this.option&&"recreate"!==t?(this.restoreData(),this.mergeOption(n)):Sa.call(this,n),e=!0}if("timeline"!==t&&"media"!==t||this.restoreData(),!t||"recreate"===t||"timeline"===t){var o=i.getTimelineOption(this);o&&(this.mergeOption(o),e=!0)}if(!t||"recreate"===t||"media"===t){var a=i.getMediaOption(this,this._api);a.length&&d(a,function(t){this.mergeOption(t,e=!0)},this)}return e},mergeOption:function(t){var e=this.option,o=this._componentsMap,r=[];ca(this),d(t,function(t,o){null!=t&&(kS.hasClass(o)?o&&r.push(o):e[o]=null==e[o]?i(t):n(e[o],t,!0))}),kS.topologicalTravel(r,kS.getAllClassMainTypes(),function(i,n){var r=Si(t[i]),s=Ti(o.get(i),r);Ai(s),d(s,function(t,e){var n=t.option;w(n)&&(t.keyInfo.mainType=i,t.keyInfo.subType=Ia(i,n,t.exist))});var l=Ma(o,n);e[i]=[],o.set(i,[]),d(s,function(t,n){var r=t.exist,s=t.option;if(k(w(s)||r,"Empty component definition"),s){var u=kS.getClass(i,t.keyInfo.subType,!0);if(r&&r instanceof u)r.name=t.keyInfo.name,r.mergeOption(s,this),r.optionUpdated(s,!1);else{var h=a({dependentModels:l,componentIndex:n},t.keyInfo);a(r=new u(s,this,this,h),h),r.init(s,this,this,h),r.optionUpdated(null,!0)}}else r.mergeOption({},this),r.optionUpdated({},!1);o.get(i)[n]=r,e[i][n]=r.option},this),"series"===i&&Da(this,o.get("series"))},this),this._seriesIndicesMap=z(this._seriesIndices=this._seriesIndices||[])},getOption:function(){var t=i(this.option);return d(t,function(e,i){if(kS.hasClass(i)){for(var n=(e=Si(e)).length-1;n>=0;n--)Li(e[n])&&e.splice(n,1);t[i]=e}}),delete t[jS],t},getTheme:function(){return this._theme},getComponent:function(t,e){var i=this._componentsMap.get(t);if(i)return i[e||0]},queryComponents:function(t){var e=t.mainType;if(!e)return[];var i=t.index,n=t.id,o=t.name,a=this._componentsMap.get(e);if(!a||!a.length)return[];var r;if(null!=i)y(i)||(i=[i]),r=g(f(i,function(t){return a[t]}),function(t){return!!t});else if(null!=n){var s=y(n);r=g(a,function(t){return s&&l(n,t.id)>=0||!s&&t.id===n})}else if(null!=o){var u=y(o);r=g(a,function(t){return u&&l(o,t.name)>=0||!u&&t.name===o})}else r=a.slice();return Ta(r,t)},findComponents:function(t){var e=t.query,i=t.mainType,n=function(t){var e=i+"Index",n=i+"Id",o=i+"Name";return!t||null==t[e]&&null==t[n]&&null==t[o]?null:{mainType:i,index:t[e],id:t[n],name:t[o]}}(e);return function(e){return t.filter?g(e,t.filter):e}(Ta(n?this.queryComponents(n):this._componentsMap.get(i),t))},eachComponent:function(t,e,i){var n=this._componentsMap;"function"==typeof t?(i=e,e=t,n.each(function(t,n){d(t,function(t,o){e.call(i,n,t,o)})})):_(t)?d(n.get(t),e,i):w(t)&&d(this.findComponents(t),e,i)},getSeriesByName:function(t){return g(this._componentsMap.get("series"),function(e){return e.name===t})},getSeriesByIndex:function(t){return this._componentsMap.get("series")[t]},getSeriesByType:function(t){return g(this._componentsMap.get("series"),function(e){return e.subType===t})},getSeries:function(){return this._componentsMap.get("series").slice()},getSeriesCount:function(){return this._componentsMap.get("series").length},eachSeries:function(t,e){d(this._seriesIndices,function(i){var n=this._componentsMap.get("series")[i];t.call(e,n,i)},this)},eachRawSeries:function(t,e){d(this._componentsMap.get("series"),t,e)},eachSeriesByType:function(t,e,i){d(this._seriesIndices,function(n){var o=this._componentsMap.get("series")[n];o.subType===t&&e.call(i,o,n)},this)},eachRawSeriesByType:function(t,e,i){return d(this.getSeriesByType(t),e,i)},isSeriesFiltered:function(t){return null==this._seriesIndicesMap.get(t.componentIndex)},getCurrentSeriesIndices:function(){return(this._seriesIndices||[]).slice()},filterSeries:function(t,e){Da(this,g(this._componentsMap.get("series"),t,e))},restoreData:function(t){var e=this._componentsMap;Da(this,e.get("series"));var i=[];e.each(function(t,e){i.push(e)}),kS.topologicalTravel(i,kS.getAllClassMainTypes(),function(i,n){d(e.get(i),function(e){("series"!==i||!wa(e,t))&&e.restoreData()})})}});h(XS,ES);var YS=["getDom","getZr","getWidth","getHeight","getDevicePixelRatio","dispatchAction","isDisposed","on","off","getDataURL","getConnectedDataURL","getModel","getOption","getViewOfComponentModel","getViewOfSeriesModel"],qS={};Ca.prototype={constructor:Ca,create:function(t,e){var i=[];d(qS,function(n,o){var a=n.create(t,e);i=i.concat(a||[])}),this._coordinateSystems=i},update:function(t,e){d(this._coordinateSystems,function(i){i.update&&i.update(t,e)})},getCoordinateSystems:function(){return this._coordinateSystems.slice()}},Ca.register=function(t,e){qS[t]=e},Ca.get=function(t){return qS[t]};var $S=d,KS=i,JS=f,QS=n,tM=/^(min|max)?(.+)$/;La.prototype={constructor:La,setOption:function(t,e){t&&d(Si(t.series),function(t){t&&t.data&&S(t.data)&&N(t.data)}),t=KS(t,!0);var i=this._optionBackup,n=ka.call(this,t,e,!i);this._newBaseOption=n.baseOption,i?(Ea(i.baseOption,n.baseOption),n.timelineOptions.length&&(i.timelineOptions=n.timelineOptions),n.mediaList.length&&(i.mediaList=n.mediaList),n.mediaDefault&&(i.mediaDefault=n.mediaDefault)):this._optionBackup=n},mountOption:function(t){var e=this._optionBackup;return this._timelineOptions=JS(e.timelineOptions,KS),this._mediaList=JS(e.mediaList,KS),this._mediaDefault=KS(e.mediaDefault),this._currentMediaIndices=[],KS(t?e.baseOption:this._newBaseOption)},getTimelineOption:function(t){var e,i=this._timelineOptions;if(i.length){var n=t.getComponent("timeline");n&&(e=KS(i[n.getCurrentIndex()],!0))}return e},getMediaOption:function(t){var e=this._api.getWidth(),i=this._api.getHeight(),n=this._mediaList,o=this._mediaDefault,a=[],r=[];if(!n.length&&!o)return r;for(var s=0,l=n.length;s1||l&&!r?function(i){function n(t,i){var n=o.getDimensionInfo(i);if(n&&!1!==n.otherDims.tooltip){var a=n.type,l=Xo({color:u,type:"subItem"}),h=(r?l+Zo(n.displayName||"-")+": ":"")+Zo("ordinal"===a?t+"":"time"===a?e?"":qo("yyyy/MM/dd hh:mm:ss",t):Wo(t));h&&s.push(h)}}var r=p(i,function(t,e,i){var n=o.getDimensionInfo(i);return t|=n&&!1!==n.tooltip&&null!=n.displayName},0),s=[];return a.length?d(a,function(e){n(er(o,t,e),e)}):d(i,n),(r?"
":"")+s.join(r?"
":", ")}(s):n(r?er(o,t,a[0]):l?s[0]:s),c=Xo(u),f=o.getName(t),g=this.name;return Ci(this)||(g=""),g=g?Zo(g)+(e?": ":"
"):"",e?c+g+h:g+c+(f?Zo(f)+": "+h:h)},isAnimationEnabled:function(){if(Ax.node)return!1;var t=this.getShallow("animation");return t&&this.getData().count()>this.getShallow("animationThreshold")&&(t=!1),t},restoreData:function(){this.dataTask.dirty()},getColorFromPalette:function(t,e,i){var n=this.ecModel,o=ES.getColorFromPalette.call(this,t,e,i);return o||(o=n.getColorFromPalette(t,e,i)),o},coordDimToDataDim:function(t){return this.getRawData().mapDimension(t,!0)},getProgressive:function(){return this.get("progressive")},getProgressiveThreshold:function(){return this.get("progressiveThreshold")},getAxisTooltipData:null,getTooltipPosition:null,pipeTask:null,preventIncremental:null,pipelineContext:null});h(mM,fM),h(mM,ES);var vM=function(){this.group=new L_,this.uid=Mo("viewComponent")};vM.prototype={constructor:vM,init:function(t,e){},render:function(t,e,i,n){},dispose:function(){}};var yM=vM.prototype;yM.updateView=yM.updateLayout=yM.updateVisual=function(t,e,i,n){},Gi(vM),Zi(vM,{registerWhenExtend:!0});var xM=function(){var t=Ni();return function(e){var i=t(e),n=e.pipelineContext,o=i.large,a=i.canProgressiveRender,r=i.large=n.large,s=i.canProgressiveRender=n.canProgressiveRender;return!!(o^r||a^s)&&"reset"}},_M=Ni(),wM=xM();pr.prototype={type:"chart",init:function(t,e){},render:function(t,e,i,n){},highlight:function(t,e,i,n){mr(t.getData(),n,"emphasis")},downplay:function(t,e,i,n){mr(t.getData(),n,"normal")},remove:function(t,e){this.group.removeAll()},dispose:function(){},incrementalPrepareRender:null,incrementalRender:null,updateTransform:null};var bM=pr.prototype;bM.updateView=bM.updateLayout=bM.updateVisual=function(t,e,i,n){this.render(t,e,i,n)},Gi(pr),Zi(pr,{registerWhenExtend:!0}),pr.markUpdateMethod=function(t,e){_M(t).updateMethod=e};var SM={incrementalPrepareRender:{progress:function(t,e){e.view.incrementalRender(t,e.model,e.ecModel,e.api,e.payload)}},render:{forceFirstProgress:!0,progress:function(t,e){e.view.render(e.model,e.ecModel,e.api,e.payload)}}},MM="\0__throttleOriginMethod",IM="\0__throttleRate",DM="\0__throttleType",TM={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var i=t.getData(),n=(t.visualColorAccessPath||"itemStyle.color").split("."),o=t.get(n)||t.getColorFromPalette(t.name,null,e.getSeriesCount());if(i.setVisual("color",o),!e.isSeriesFiltered(t)){"function"!=typeof o||o instanceof Jb||i.each(function(e){i.setItemVisual(e,"color",o(t.getDataParams(e)))});return{dataEach:i.hasItemOption?function(t,e){var i=t.getItemModel(e).get(n,!0);null!=i&&t.setItemVisual(e,"color",i)}:null}}}},AM={toolbox:{brush:{title:{rect:"Box Select",polygon:"Lasso Select",lineX:"Horizontally Select",lineY:"Vertically Select",keep:"Keep Selections",clear:"Clear Selections"}},dataView:{title:"Data View",lang:["Data View","Close","Refresh"]},dataZoom:{title:{zoom:"Zoom",back:"Zoom Reset"}},magicType:{title:{line:"Switch to Line Chart",bar:"Switch to Bar Chart",stack:"Stack",tiled:"Tile"}},restore:{title:"Restore"},saveAsImage:{title:"Save as Image",lang:["Right Click to Save Image"]}}},CM=function(t,e){function i(t,e){if("string"!=typeof t)return t;var i=t;return d(e,function(t,e){i=i.replace(new RegExp("\\{\\s*"+e+"\\s*\\}","g"),t)}),i}function n(t){var e=a.get(t);if(null==e){for(var i=t.split("."),n=AM.aria,o=0;o1?"series.multiple.prefix":"series.single.prefix"),{seriesCount:r}),e.eachSeries(function(t,e){if(e1?"multiple":"single")+".";a=i(a=n(s?u+"withName":u+"withoutName"),{seriesId:t.seriesIndex,seriesName:t.get("name"),seriesType:o(t.subType)});var c=t.getData();window.data=c,c.count()>l?a+=i(n("data.partialData"),{displayCnt:l}):a+=n("data.allData");for(var d=[],p=0;pi.bockIndex?i.step:null}}},kM.getPipeline=function(t){return this._pipelineMap.get(t)},kM.updateStreamModes=function(t,e){var i=this._pipelineMap.get(t.uid),n=t.getData().count(),o=i.progressiveEnabled&&e.incrementalPrepareRender&&n>=i.threshold,a=t.get("large")&&n>=t.get("largeThreshold");t.pipelineContext=i.context={canProgressiveRender:o,large:a}},kM.restorePipelines=function(t){var e=this,i=e._pipelineMap=z();t.eachSeries(function(t){var n=t.getProgressive(),o=t.uid;i.set(o,{id:o,head:null,tail:null,threshold:t.getProgressiveThreshold(),progressiveEnabled:n&&!(t.preventIncremental&&t.preventIncremental()),bockIndex:-1,step:n||700,count:0}),Or(e,t,t.dataTask)})},kM.prepareStageTasks=function(){var t=this._stageTaskMap,e=this.ecInstance.getModel(),i=this.api;d([this._dataProcessorHandlers,this._visualHandlers],function(n){d(n,function(n){var o=t.get(n.uid)||t.set(n.uid,[]);n.reset&&Mr(this,n,o,e,i),n.overallReset&&Ir(this,n,o,e,i)},this)},this)},kM.prepareView=function(t,e,i,n){var o=t.renderTask,a=o.context;a.model=e,a.ecModel=i,a.api=n,o.__block=!t.incrementalPrepareRender,Or(this,e,o)},kM.performDataProcessorTasks=function(t,e){Sr(this,this._dataProcessorHandlers,t,e,{block:!0})},kM.performVisualTasks=function(t,e,i){Sr(this,this._visualHandlers,t,e,i)},kM.performSeriesTasks=function(t){var e;t.eachSeries(function(t){e|=t.dataTask.perform()}),this.unfinished|=e},kM.plan=function(){this._pipelineMap.each(function(t){var e=t.tail;do{if(e.__block){t.bockIndex=e.__idxInPipeline;break}e=e.getUpstream()}while(e)})};var PM=kM.updatePayload=function(t,e){"remain"!==e&&(t.context.payload=e)};br.wrapStageHandler=function(t,e){return x(t)&&(t={overallReset:t,seriesType:Er(t)}),t.uid=Mo("stageHandler"),e&&(t.visualType=e),t};var NM,OM={},EM={};zr(OM,XS),zr(EM,Aa),OM.eachSeriesByType=OM.eachRawSeriesByType=function(t){NM=t},OM.eachComponent=function(t){"series"===t.mainType&&t.subType&&(NM=t.subType)};var zM=["#37A2DA","#32C5E9","#67E0E3","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#E062AE","#E690D1","#e7bcf3","#9d96f5","#8378EA","#96BFFF"],RM={color:zM,colorLayer:[["#37A2DA","#ffd85c","#fd7b5f"],["#37A2DA","#67E0E3","#FFDB5C","#ff9f7f","#E062AE","#9d96f5"],["#37A2DA","#32C5E9","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#e7bcf3","#8378EA","#96BFFF"],zM]},BM=["#dd6b66","#759aa0","#e69d87","#8dc1a9","#ea7e53","#eedd78","#73a373","#73b9bc","#7289ab","#91ca8c","#f49f42"],VM={color:BM,backgroundColor:"#333",tooltip:{axisPointer:{lineStyle:{color:"#eee"},crossStyle:{color:"#eee"}}},legend:{textStyle:{color:"#eee"}},textStyle:{color:"#eee"},title:{textStyle:{color:"#eee"}},toolbox:{iconStyle:{normal:{borderColor:"#eee"}}},dataZoom:{textStyle:{color:"#eee"}},visualMap:{textStyle:{color:"#eee"}},timeline:{lineStyle:{color:"#eee"},itemStyle:{normal:{color:BM[1]}},label:{normal:{textStyle:{color:"#eee"}}},controlStyle:{normal:{color:"#eee",borderColor:"#eee"}}},timeAxis:{axisLine:{lineStyle:{color:"#eee"}},axisTick:{lineStyle:{color:"#eee"}},axisLabel:{textStyle:{color:"#eee"}},splitLine:{lineStyle:{type:"dashed",color:"#aaa"}},splitArea:{areaStyle:{color:"#eee"}}},logAxis:{axisLine:{lineStyle:{color:"#eee"}},axisTick:{lineStyle:{color:"#eee"}},axisLabel:{textStyle:{color:"#eee"}},splitLine:{lineStyle:{type:"dashed",color:"#aaa"}},splitArea:{areaStyle:{color:"#eee"}}},valueAxis:{axisLine:{lineStyle:{color:"#eee"}},axisTick:{lineStyle:{color:"#eee"}},axisLabel:{textStyle:{color:"#eee"}},splitLine:{lineStyle:{type:"dashed",color:"#aaa"}},splitArea:{areaStyle:{color:"#eee"}}},categoryAxis:{axisLine:{lineStyle:{color:"#eee"}},axisTick:{lineStyle:{color:"#eee"}},axisLabel:{textStyle:{color:"#eee"}},splitLine:{lineStyle:{type:"dashed",color:"#aaa"}},splitArea:{areaStyle:{color:"#eee"}}},line:{symbol:"circle"},graph:{color:BM},gauge:{title:{textStyle:{color:"#eee"}}},candlestick:{itemStyle:{normal:{color:"#FD1050",color0:"#0CF49B",borderColor:"#FD1050",borderColor0:"#0CF49B"}}}};VM.categoryAxis.splitLine.show=!1;var GM=k,FM=d,WM=x,HM=w,ZM=kS.parseClassType,UM={zrender:"4.0.3"},jM=1e3,XM=1e3,YM=3e3,qM={PROCESSOR:{FILTER:jM,STATISTIC:5e3},VISUAL:{LAYOUT:XM,GLOBAL:2e3,CHART:YM,COMPONENT:4e3,BRUSH:5e3}},$M="__flagInMainProcess",KM="__optionUpdated",JM=/^[a-zA-Z0-9_]+$/;Br.prototype.on=Rr("on"),Br.prototype.off=Rr("off"),Br.prototype.one=Rr("one"),h(Br,$x);var QM=Vr.prototype;QM._onframe=function(){if(!this._disposed){var t=this._scheduler;if(this[KM]){var e=this[KM].silent;this[$M]=!0,Fr(this),tI.update.call(this),this[$M]=!1,this[KM]=!1,Ur.call(this,e),jr.call(this,e)}else if(t.unfinished){var i=1,n=this._model;this._api;t.unfinished=!1;do{var o=+new Date;t.performSeriesTasks(n),t.performDataProcessorTasks(n),Hr(this,n),t.performVisualTasks(n),Jr(this,this._model,0,"remain"),i-=+new Date-o}while(i>0&&t.unfinished);t.unfinished||this._zr.flush()}}},QM.getDom=function(){return this._dom},QM.getZr=function(){return this._zr},QM.setOption=function(t,e,i){var n;if(HM(e)&&(i=e.lazyUpdate,n=e.silent,e=e.notMerge),this[$M]=!0,!this._model||e){var o=new La(this._api),a=this._theme,r=this._model=new XS(null,null,a,o);r.scheduler=this._scheduler,r.init(null,null,a,o)}this._model.setOption(t,aI),i?(this[KM]={silent:n},this[$M]=!1):(Fr(this),tI.update.call(this),this._zr.flush(),this[KM]=!1,this[$M]=!1,Ur.call(this,n),jr.call(this,n))},QM.setTheme=function(){console.log("ECharts#setTheme() is DEPRECATED in ECharts 3.0")},QM.getModel=function(){return this._model},QM.getOption=function(){return this._model&&this._model.getOption()},QM.getWidth=function(){return this._zr.getWidth()},QM.getHeight=function(){return this._zr.getHeight()},QM.getDevicePixelRatio=function(){return this._zr.painter.dpr||window.devicePixelRatio||1},QM.getRenderedCanvas=function(t){if(Ax.canvasSupported)return(t=t||{}).pixelRatio=t.pixelRatio||1,t.backgroundColor=t.backgroundColor||this._model.get("backgroundColor"),this._zr.painter.getRenderedCanvas(t)},QM.getSvgDataUrl=function(){if(Ax.svgSupported){var t=this._zr;return d(t.storage.getDisplayList(),function(t){t.stopAnimation(!0)}),t.painter.pathToDataUrl()}},QM.getDataURL=function(t){var e=(t=t||{}).excludeComponents,i=this._model,n=[],o=this;FM(e,function(t){i.eachComponent({mainType:t},function(t){var e=o._componentsMap[t.__viewId];e.group.ignore||(n.push(e),e.group.ignore=!0)})});var a="svg"===this._zr.painter.getType()?this.getSvgDataUrl():this.getRenderedCanvas(t).toDataURL("image/"+(t&&t.type||"png"));return FM(n,function(t){t.group.ignore=!1}),a},QM.getConnectedDataURL=function(t){if(Ax.canvasSupported){var e=this.group,n=Math.min,o=Math.max;if(cI[e]){var a=1/0,r=1/0,s=-1/0,l=-1/0,u=[],h=t&&t.pixelRatio||1;d(hI,function(h,c){if(h.group===e){var d=h.getRenderedCanvas(i(t)),f=h.getDom().getBoundingClientRect();a=n(f.left,a),r=n(f.top,r),s=o(f.right,s),l=o(f.bottom,l),u.push({dom:d,left:f.left,top:f.top})}});var c=(s*=h)-(a*=h),f=(l*=h)-(r*=h),p=Vx();p.width=c,p.height=f;var g=_i(p);return FM(u,function(t){var e=new Je({style:{x:t.left*h-a,y:t.top*h-r,image:t.dom}});g.add(e)}),g.refreshImmediately(),p.toDataURL("image/"+(t&&t.type||"png"))}return this.getDataURL(t)}},QM.convertToPixel=v(Gr,"convertToPixel"),QM.convertFromPixel=v(Gr,"convertFromPixel"),QM.containPixel=function(t,e){var i;return t=Oi(this._model,t),d(t,function(t,n){n.indexOf("Models")>=0&&d(t,function(t){var o=t.coordinateSystem;if(o&&o.containPoint)i|=!!o.containPoint(e);else if("seriesModels"===n){var a=this._chartsMap[t.__viewId];a&&a.containPoint&&(i|=a.containPoint(e,t))}},this)},this),!!i},QM.getVisual=function(t,e){var i=(t=Oi(this._model,t,{defaultMainType:"series"})).seriesModel.getData(),n=t.hasOwnProperty("dataIndexInside")?t.dataIndexInside:t.hasOwnProperty("dataIndex")?i.indexOfRawIndex(t.dataIndex):null;return null!=n?i.getItemVisual(n,e):i.getVisual(e)},QM.getViewOfComponentModel=function(t){return this._componentsMap[t.__viewId]},QM.getViewOfSeriesModel=function(t){return this._chartsMap[t.__viewId]};var tI={prepareAndUpdate:function(t){Fr(this),tI.update.call(this,t)},update:function(t){var e=this._model,i=this._api,n=this._zr,o=this._coordSysMgr,a=this._scheduler;if(e){e.restoreData(t),a.performSeriesTasks(e),o.create(e,i),a.performDataProcessorTasks(e,t),Hr(this,e),o.update(e,i),qr(e),a.performVisualTasks(e,t),$r(this,e,i,t);var r=e.get("backgroundColor")||"transparent";if(Ax.canvasSupported)n.setBackgroundColor(r);else{var s=At(r);r=Rt(s,"rgb"),0===s[3]&&(r="transparent")}Qr(e,i)}},updateTransform:function(t){var e=this._model,i=this,n=this._api;if(e){var o=[];e.eachComponent(function(a,r){var s=i.getViewOfComponentModel(r);if(s&&s.__alive)if(s.updateTransform){var l=s.updateTransform(r,e,n,t);l&&l.update&&o.push(s)}else o.push(s)});var a=z();e.eachSeries(function(o){var r=i._chartsMap[o.__viewId];if(r.updateTransform){var s=r.updateTransform(o,e,n,t);s&&s.update&&a.set(o.uid,1)}else a.set(o.uid,1)}),qr(e),this._scheduler.performVisualTasks(e,t,{setDirty:!0,dirtyMap:a}),Jr(i,e,0,t,a),Qr(e,this._api)}},updateView:function(t){var e=this._model;e&&(pr.markUpdateMethod(t,"updateView"),qr(e),this._scheduler.performVisualTasks(e,t,{setDirty:!0}),$r(this,this._model,this._api,t),Qr(e,this._api))},updateVisual:function(t){tI.update.call(this,t)},updateLayout:function(t){tI.update.call(this,t)}};QM.resize=function(t){this._zr.resize(t);var e=this._model;if(this._loadingFX&&this._loadingFX.resize(),e){var i=e.resetOption("media"),n=t&&t.silent;this[$M]=!0,i&&Fr(this),tI.update.call(this),this[$M]=!1,Ur.call(this,n),jr.call(this,n)}},QM.showLoading=function(t,e){if(HM(t)&&(e=t,t=""),t=t||"default",this.hideLoading(),uI[t]){var i=uI[t](this._api,e),n=this._zr;this._loadingFX=i,n.add(i)}},QM.hideLoading=function(){this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null},QM.makeActionFromEvent=function(t){var e=a({},t);return e.type=nI[t.type],e},QM.dispatchAction=function(t,e){HM(e)||(e={silent:!!e}),iI[t.type]&&this._model&&(this[$M]?this._pendingActions.push(t):(Zr.call(this,t,e.silent),e.flush?this._zr.flush(!0):!1!==e.flush&&Ax.browser.weChat&&this._throttledZrFlush(),Ur.call(this,e.silent),jr.call(this,e.silent)))},QM.appendData=function(t){var e=t.seriesIndex;this.getModel().getSeriesByIndex(e).appendData(t),this._scheduler.unfinished=!0},QM.on=Rr("on"),QM.off=Rr("off"),QM.one=Rr("one");var eI=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","globalout","contextmenu"];QM._initEvents=function(){FM(eI,function(t){this._zr.on(t,function(e){var i,n=this.getModel(),o=e.target;if("globalout"===t)i={};else if(o&&null!=o.dataIndex){var r=o.dataModel||n.getSeriesByIndex(o.seriesIndex);i=r&&r.getDataParams(o.dataIndex,o.dataType)||{}}else o&&o.eventData&&(i=a({},o.eventData));i&&(i.event=e,i.type=t,this.trigger(t,i))},this)},this),FM(nI,function(t,e){this._messageCenter.on(e,function(t){this.trigger(e,t)},this)},this)},QM.isDisposed=function(){return this._disposed},QM.clear=function(){this.setOption({series:[]},!0)},QM.dispose=function(){if(!this._disposed){this._disposed=!0,zi(this.getDom(),pI,"");var t=this._api,e=this._model;FM(this._componentsViews,function(i){i.dispose(e,t)}),FM(this._chartsViews,function(i){i.dispose(e,t)}),this._zr.dispose(),delete hI[this.id]}},h(Vr,$x);var iI={},nI={},oI=[],aI=[],rI=[],sI=[],lI={},uI={},hI={},cI={},dI=new Date-0,fI=new Date-0,pI="_echarts_instance_",gI={},mI=as;fs(2e3,TM),ls(sM),us(5e3,function(t){var e=z();t.eachSeries(function(t){var i=t.get("stack");if(i){var n=e.get(i)||e.set(i,[]),o=t.getData(),a={stackResultDimension:o.getCalculationInfo("stackResultDimension"),stackedOverDimension:o.getCalculationInfo("stackedOverDimension"),stackedDimension:o.getCalculationInfo("stackedDimension"),stackedByDimension:o.getCalculationInfo("stackedByDimension"),isStackedByIndex:o.getCalculationInfo("isStackedByIndex"),data:o,seriesModel:t};if(!a.stackedDimension||!a.isStackedByIndex&&!a.stackedByDimension)return;n.length&&o.setCalculationInfo("stackedOnSeries",n[n.length-1].seriesModel),n.push(a)}}),e.each(Xa)}),gs("default",function(t,e){r(e=e||{},{text:"loading",color:"#c23531",textColor:"#000",maskColor:"rgba(255, 255, 255, 0.8)",zlevel:0});var i=new jb({style:{fill:e.maskColor},zlevel:e.zlevel,z:1e4}),n=new $b({shape:{startAngle:-LM/2,endAngle:-LM/2+.1,r:10},style:{stroke:e.color,lineCap:"round",lineWidth:5},zlevel:e.zlevel,z:10001}),o=new jb({style:{fill:"none",text:e.text,textPosition:"right",textDistance:10,textFill:e.textColor},zlevel:e.zlevel,z:10001});n.animateShape(!0).when(1e3,{endAngle:3*LM/2}).start("circularInOut"),n.animateShape(!0).when(1e3,{startAngle:3*LM/2}).delay(300).start("circularInOut");var a=new L_;return a.add(n),a.add(o),a.add(i),a.resize=function(){var e=t.getWidth()/2,a=t.getHeight()/2;n.setShape({cx:e,cy:a});var r=n.shape.r;o.setShape({x:e-r,y:a-r,width:2*r,height:2*r}),i.setShape({x:0,y:0,width:t.getWidth(),height:t.getHeight()})},a.resize(),a}),hs({type:"highlight",event:"highlight",update:"highlight"},B),hs({type:"downplay",event:"downplay",update:"downplay"},B),ss("light",RM),ss("dark",VM);var vI={};bs.prototype={constructor:bs,add:function(t){return this._add=t,this},update:function(t){return this._update=t,this},remove:function(t){return this._remove=t,this},execute:function(){var t=this._old,e=this._new,i={},n=[],o=[];for(Ss(t,{},n,"_oldKeyGetter",this),Ss(e,i,o,"_newKeyGetter",this),a=0;a=e)){for(var i,n=this._chunkSize,o=this._rawData,a=this._storage,r=this.dimensions,s=this._dimensionInfos,l=this._nameList,u=this._idList,h=this._rawExtent,c=this._nameRepeatCount={},d=this._chunkCount,f=d-1,p=0;ph[I][1]&&(h[I][1]=T)}if(!o.pure){var A=l[_];w&&!A&&(null!=i?A=this._getNameFromStore(_):null!=w.name&&(l[_]=A=w.name));var C=null==w?null:w.id;null==C&&null!=A&&(c[A]=c[A]||0,C=A,c[A]>0&&(C+="__ec__"+c[A]),c[A]++),null!=C&&(u[_]=C)}}!o.persistent&&o.clean&&o.clean(),this._rawCount=this._count=e,this._extent={},Ls(this)}},TI._getNameFromStore=function(t){var e=this._nameDimIdx;if(null!=e){var i=this._chunkSize,n=Math.floor(t/i),o=t%i,a=this.dimensions[e],r=this._dimensionInfos[a].ordinalMeta;if(r)return r.categories[t];var s=this._storage[a][n];return s&&s[o]}},TI._getIdFromStore=function(t){var e=this._idDimIdx;if(null!=e){var i=this._chunkSize,n=Math.floor(t/i),o=t%i,a=this.dimensions[e],r=this._dimensionInfos[a].ordinalMeta;if(r)return r.categories[t];var s=this._storage[a][n];return s&&s[o]}},TI.count=function(){return this._count},TI.getIndices=function(){if(this._indices)return new(t=this._indices.constructor)(this._indices.buffer,0,this._count);for(var t=Ts(this),e=new t(this.count()),i=0;i=0&&e=0&&ea&&(a=s)}return i=[o,a],this._extent[t]=i,i},TI.getApproximateExtent=function(t){return t=this.getDimension(t),this._approximateExtent[t]||this.getDataExtent(t)},TI.setApproximateExtent=function(t,e){e=this.getDimension(e),this._approximateExtent[e]=t.slice()},TI.getCalculationInfo=function(t){return this._calculationInfo[t]},TI.setCalculationInfo=function(t,e){xI(t)?a(this._calculationInfo,t):this._calculationInfo[t]=e},TI.getSum=function(t){var e=0;if(this._storage[t])for(var i=0,n=this.count();i=this._rawCount||t<0)return-1;var e=this._indices,i=e[t];if(null!=i&&it))return a;o=a-1}}return-1},TI.indicesOfNearest=function(t,e,i){var n=[];if(!this._storage[t])return n;null==i&&(i=1/0);for(var o=Number.MAX_VALUE,a=-1,r=0,s=this.count();r=0&&a<0)&&(o=u,a=l,n.length=0),n.push(r))}return n},TI.getRawIndex=ks,TI.getRawDataItem=function(t){if(this._rawData.persistent)return this._rawData.getItem(this.getRawIndex(t));for(var e=[],i=0;i=l&&w<=u&&(a[r++]=c),c++;h=!0}else if(2===n){for(var d=this._storage[s],v=this._storage[e[1]],y=t[e[1]][0],x=t[e[1]][1],f=0;f=l&&w<=u&&b>=y&&b<=x&&(a[r++]=c),c++}h=!0}}if(!h)if(1===n)for(m=0;m=l&&w<=u&&(a[r++]=M)}else for(m=0;mt[I][1])&&(S=!1)}S&&(a[r++]=this.getRawIndex(m))}return rb[1]&&(b[1]=w)}}}return o},TI.downSample=function(t,e,i,n){for(var o=Es(this,[t]),a=o._storage,r=[],s=Math.floor(1/e),l=a[t],u=this.count(),h=this._chunkSize,c=o._rawExtent[t],d=new(Ts(this))(u),f=0,p=0;pu-p&&(s=u-p,r.length=s);for(var g=0;gc[1]&&(c[1]=x),d[f++]=_}return o._count=f,o._indices=d,o.getRawIndex=Ps,o},TI.getItemModel=function(t){var e=this.hostModel;return new wo(this.getRawDataItem(t),e,e&&e.ecModel)},TI.diff=function(t){var e=this;return new bs(t?t.getIndices():[],this.getIndices(),function(e){return Ns(t,e)},function(t){return Ns(e,t)})},TI.getVisual=function(t){var e=this._visual;return e&&e[t]},TI.setVisual=function(t,e){if(xI(t))for(var i in t)t.hasOwnProperty(i)&&this.setVisual(i,t[i]);else this._visual=this._visual||{},this._visual[t]=e},TI.setLayout=function(t,e){if(xI(t))for(var i in t)t.hasOwnProperty(i)&&this.setLayout(i,t[i]);else this._layout[t]=e},TI.getLayout=function(t){return this._layout[t]},TI.getItemLayout=function(t){return this._itemLayouts[t]},TI.setItemLayout=function(t,e,i){this._itemLayouts[t]=i?a(this._itemLayouts[t]||{},e):e},TI.clearItemLayouts=function(){this._itemLayouts.length=0},TI.getItemVisual=function(t,e,i){var n=this._itemVisuals[t],o=n&&n[e];return null!=o||i?o:this.getVisual(e)},TI.setItemVisual=function(t,e,i){var n=this._itemVisuals[t]||{},o=this.hasItemVisual;if(this._itemVisuals[t]=n,xI(e))for(var a in e)e.hasOwnProperty(a)&&(n[a]=e[a],o[a]=!0);else n[e]=i,o[e]=!0},TI.clearAllVisual=function(){this._visual={},this._itemVisuals=[],this.hasItemVisual={}};var AI=function(t){t.seriesIndex=this.seriesIndex,t.dataIndex=this.dataIndex,t.dataType=this.dataType};TI.setItemGraphicEl=function(t,e){var i=this.hostModel;e&&(e.dataIndex=t,e.dataType=this.dataType,e.seriesIndex=i&&i.seriesIndex,"group"===e.type&&e.traverse(AI,e)),this._graphicEls[t]=e},TI.getItemGraphicEl=function(t){return this._graphicEls[t]},TI.eachItemGraphicEl=function(t,e){d(this._graphicEls,function(i,n){i&&t&&t.call(e,i,n)})},TI.cloneShallow=function(t){if(!t){var e=f(this.dimensions,this.getDimensionInfo,this);t=new DI(e,this.hostModel)}if(t._storage=this._storage,Cs(t,this),this._indices){var n=this._indices.constructor;t._indices=new n(this._indices)}else t._indices=null;return t.getRawIndex=t._indices?Ps:ks,t._extent=i(this._extent),t._approximateExtent=i(this._approximateExtent),t},TI.wrapMethod=function(t,e){var i=this[t];"function"==typeof i&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(t),this[t]=function(){var t=i.apply(this,arguments);return e.apply(this,[t].concat(C(arguments)))})},TI.TRANSFERABLE_METHODS=["cloneShallow","downSample","map"],TI.CHANGABLE_METHODS=["filterSelf","selectRange"];var CI=function(t,e){return e=e||{},Bs(e.coordDimensions||[],t,{dimsDef:e.dimensionsDefine||t.dimensionsDefine,encodeDef:e.encodeDefine||t.encodeDefine,dimCount:e.dimensionsCount,generateCoord:e.generateCoord,generateCoordCount:e.generateCoordCount})};js.prototype.parse=function(t){return t},js.prototype.getSetting=function(t){return this._setting[t]},js.prototype.contain=function(t){var e=this._extent;return t>=e[0]&&t<=e[1]},js.prototype.normalize=function(t){var e=this._extent;return e[1]===e[0]?.5:(t-e[0])/(e[1]-e[0])},js.prototype.scale=function(t){var e=this._extent;return t*(e[1]-e[0])+e[0]},js.prototype.unionExtent=function(t){var e=this._extent;t[0]e[1]&&(e[1]=t[1])},js.prototype.unionExtentFromData=function(t,e){this.unionExtent(t.getApproximateExtent(e))},js.prototype.getExtent=function(){return this._extent.slice()},js.prototype.setExtent=function(t,e){var i=this._extent;isNaN(t)||(i[0]=t),isNaN(e)||(i[1]=e)},js.prototype.getTicksLabels=function(){for(var t=[],e=this.getTicks(),i=0;ie[1]&&(e[1]=t[1]),EI.prototype.setExtent.call(this,e[0],e[1])},getInterval:function(){return this._interval},setInterval:function(t){this._interval=t,this._niceExtent=this._extent.slice(),this._intervalPrecision=Ks(t)},getTicks:function(){return tl(this._interval,this._extent,this._niceExtent,this._intervalPrecision)},getTicksLabels:function(){for(var t=[],e=this.getTicks(),i=0;i>>1;t[o][1]i&&(a=i);var r=WI.length,s=GI(WI,a,0,r),l=WI[Math.min(s,r-1)],u=l[1];"year"===l[0]&&(u*=Vo(o/u/t,!0));var h=this.getSetting("useUTC")?0:60*new Date(+n[0]||+n[1]).getTimezoneOffset()*1e3,c=[Math.round(BI((n[0]-h)/u)*u+h),Math.round(VI((n[1]-h)/u)*u+h)];Qs(c,n),this._stepLvl=l,this._interval=u,this._niceExtent=c},parse:function(t){return+zo(t)}});d(["contain","normalize"],function(t){FI.prototype[t]=function(e){return RI[t].call(this,this.parse(e))}});var WI=[["hh:mm:ss",1e3],["hh:mm:ss",5e3],["hh:mm:ss",1e4],["hh:mm:ss",15e3],["hh:mm:ss",3e4],["hh:mm\nMM-dd",6e4],["hh:mm\nMM-dd",3e5],["hh:mm\nMM-dd",6e5],["hh:mm\nMM-dd",9e5],["hh:mm\nMM-dd",18e5],["hh:mm\nMM-dd",36e5],["hh:mm\nMM-dd",72e5],["hh:mm\nMM-dd",216e5],["hh:mm\nMM-dd",432e5],["MM-dd\nyyyy",864e5],["MM-dd\nyyyy",1728e5],["MM-dd\nyyyy",2592e5],["MM-dd\nyyyy",3456e5],["MM-dd\nyyyy",432e6],["MM-dd\nyyyy",5184e5],["week",6048e5],["MM-dd\nyyyy",864e6],["week",12096e5],["week",18144e5],["month",26784e5],["week",36288e5],["month",53568e5],["week",36288e5],["quarter",8208e6],["month",107136e5],["month",13392e6],["half-year",16416e6],["month",214272e5],["month",26784e6],["year",32832e6]];FI.create=function(t){return new FI({useUTC:t.ecModel.get("useUTC")})};var HI=js.prototype,ZI=EI.prototype,UI=ko,jI=Ao,XI=Math.floor,YI=Math.ceil,qI=Math.pow,$I=Math.log,KI=js.extend({type:"log",base:10,$constructor:function(){js.apply(this,arguments),this._originalScale=new EI},getTicks:function(){var t=this._originalScale,e=this._extent,i=t.getExtent();return f(ZI.getTicks.call(this),function(n){var o=Ao(qI(this.base,n));return o=n===e[0]&&t.__fixMin?sl(o,i[0]):o,o=n===e[1]&&t.__fixMax?sl(o,i[1]):o},this)},getLabel:ZI.getLabel,scale:function(t){return t=HI.scale.call(this,t),qI(this.base,t)},setExtent:function(t,e){var i=this.base;t=$I(t)/$I(i),e=$I(e)/$I(i),ZI.setExtent.call(this,t,e)},getExtent:function(){var t=this.base,e=HI.getExtent.call(this);e[0]=qI(t,e[0]),e[1]=qI(t,e[1]);var i=this._originalScale,n=i.getExtent();return i.__fixMin&&(e[0]=sl(e[0],n[0])),i.__fixMax&&(e[1]=sl(e[1],n[1])),e},unionExtent:function(t){this._originalScale.unionExtent(t);var e=this.base;t[0]=$I(t[0])/$I(e),t[1]=$I(t[1])/$I(e),HI.unionExtent.call(this,t)},unionExtentFromData:function(t,e){this.unionExtent(t.getApproximateExtent(e))},niceTicks:function(t){t=t||10;var e=this._extent,i=e[1]-e[0];if(!(i===1/0||i<=0)){var n=Ro(i);for(t/i*n<=.5&&(n*=10);!isNaN(n)&&Math.abs(n)<1&&Math.abs(n)>0;)n*=10;var o=[Ao(YI(e[0]/n)*n),Ao(XI(e[1]/n)*n)];this._interval=n,this._niceExtent=o}},niceExtent:function(t){ZI.niceExtent.call(this,t);var e=this._originalScale;e.__fixMin=t.fixMin,e.__fixMax=t.fixMax}});d(["contain","normalize"],function(t){KI.prototype[t]=function(e){return e=$I(e)/$I(this.base),HI[t].call(this,e)}}),KI.create=function(){return new KI};var JI={getFormattedLabels:function(){return fl(this.axis,this.get("axisLabel.formatter"))},getMin:function(t){var e=this.option,i=t||null==e.rangeStart?e.min:e.rangeStart;return this.axis&&null!=i&&"dataMin"!==i&&"function"!=typeof i&&!I(i)&&(i=this.axis.scale.parse(i)),i},getMax:function(t){var e=this.option,i=t||null==e.rangeEnd?e.max:e.rangeEnd;return this.axis&&null!=i&&"dataMax"!==i&&"function"!=typeof i&&!I(i)&&(i=this.axis.scale.parse(i)),i},getNeedCrossZero:function(){var t=this.option;return null==t.rangeStart&&null==t.rangeEnd&&!t.scale},getCoordSysModel:B,setRange:function(t,e){this.option.rangeStart=t,this.option.rangeEnd=e},resetRange:function(){this.option.rangeStart=this.option.rangeEnd=null}},QI=En({type:"triangle",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(t,e){var i=e.cx,n=e.cy,o=e.width/2,a=e.height/2;t.moveTo(i,n-a),t.lineTo(i+o,n+a),t.lineTo(i-o,n+a),t.closePath()}}),tD=En({type:"diamond",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(t,e){var i=e.cx,n=e.cy,o=e.width/2,a=e.height/2;t.moveTo(i,n-a),t.lineTo(i+o,n),t.lineTo(i,n+a),t.lineTo(i-o,n),t.closePath()}}),eD=En({type:"pin",shape:{x:0,y:0,width:0,height:0},buildPath:function(t,e){var i=e.x,n=e.y,o=e.width/5*3,a=Math.max(o,e.height),r=o/2,s=r*r/(a-r),l=n-a+r+s,u=Math.asin(s/r),h=Math.cos(u)*r,c=Math.sin(u),d=Math.cos(u),f=.6*r,p=.7*r;t.moveTo(i-h,l+s),t.arc(i,l,r,Math.PI-u,2*Math.PI+u),t.bezierCurveTo(i+h-c*f,l+s+d*f,i,n-p,i,n),t.bezierCurveTo(i,n-p,i-h+c*f,l+s+d*f,i-h,l+s),t.closePath()}}),iD=En({type:"arrow",shape:{x:0,y:0,width:0,height:0},buildPath:function(t,e){var i=e.height,n=e.width,o=e.x,a=e.y,r=n/3*2;t.moveTo(o,a),t.lineTo(o+r,a+i),t.lineTo(o,a+i/4*3),t.lineTo(o-r,a+i),t.lineTo(o,a),t.closePath()}}),nD={line:function(t,e,i,n,o){o.x1=t,o.y1=e+n/2,o.x2=t+i,o.y2=e+n/2},rect:function(t,e,i,n,o){o.x=t,o.y=e,o.width=i,o.height=n},roundRect:function(t,e,i,n,o){o.x=t,o.y=e,o.width=i,o.height=n,o.r=Math.min(i,n)/4},square:function(t,e,i,n,o){var a=Math.min(i,n);o.x=t,o.y=e,o.width=a,o.height=a},circle:function(t,e,i,n,o){o.cx=t+i/2,o.cy=e+n/2,o.r=Math.min(i,n)/2},diamond:function(t,e,i,n,o){o.cx=t+i/2,o.cy=e+n/2,o.width=i,o.height=n},pin:function(t,e,i,n,o){o.x=t+i/2,o.y=e+n/2,o.width=i,o.height=n},arrow:function(t,e,i,n,o){o.x=t+i/2,o.y=e+n/2,o.width=i,o.height=n},triangle:function(t,e,i,n,o){o.cx=t+i/2,o.cy=e+n/2,o.width=i,o.height=n}},oD={};d({line:Xb,rect:jb,roundRect:jb,square:jb,circle:Rb,diamond:tD,pin:eD,arrow:iD,triangle:QI},function(t,e){oD[e]=new t});var aD=En({type:"symbol",shape:{symbolType:"",x:0,y:0,width:0,height:0},beforeBrush:function(){var t=this.style;"pin"===this.shape.symbolType&&"inside"===t.textPosition&&(t.textPosition=["50%","40%"],t.textAlign="center",t.textVerticalAlign="middle")},buildPath:function(t,e,i){var n=e.symbolType,o=oD[n];"none"!==e.symbolType&&(o||(o=oD[n="rect"]),nD[n](e.x,e.y,e.width,e.height,o.shape),o.buildPath(t,o.shape,i))}}),rD={isDimensionStacked:Ws,enableDataStack:Fs},sD=(Object.freeze||Object)({createList:function(t){return Hs(t.getSource(),t)},getLayoutRect:Qo,dataStack:rD,createScale:function(t,e){var i=e;wo.isInstance(e)||h(i=new wo(e),JI);var n=cl(i);return n.setExtent(t[0],t[1]),hl(n,i),n},mixinAxisModelCommonMethods:function(t){h(t,JI)},completeDimensions:Bs,createDimensions:CI,createSymbol:ml}),lD=1e-8;xl.prototype={constructor:xl,properties:null,getBoundingRect:function(){var t=this._rect;if(t)return t;for(var e=Number.MAX_VALUE,i=[e,e],n=[-e,-e],o=[],a=[],r=this.geometries,s=0;s0}),function(t){var e=t.properties,i=t.geometry,n=i.coordinates,o=[];"Polygon"===i.type&&o.push({type:"polygon",exterior:n[0],interiors:n.slice(1)}),"MultiPolygon"===i.type&&d(n,function(t){t[0]&&o.push({type:"polygon",exterior:t[0],interiors:t.slice(1)})});var a=new xl(e.name,o,e.cp);return a.properties=e,a})},hD=Do,cD=[0,1],dD=function(t,e,i){this.dim=t,this.scale=e,this._extent=i||[0,0],this.inverse=!1,this.onBand=!1,this._labelInterval};dD.prototype={constructor:dD,contain:function(t){var e=this._extent,i=Math.min(e[0],e[1]),n=Math.max(e[0],e[1]);return t>=i&&t<=n},containData:function(t){return this.contain(this.dataToCoord(t))},getExtent:function(){return this._extent.slice()},getPixelPrecision:function(t){return Po(t||this.scale.getExtent(),this._extent)},setExtent:function(t,e){var i=this._extent;i[0]=t,i[1]=e},dataToCoord:function(t,e){var i=this._extent,n=this.scale;return t=n.normalize(t),this.onBand&&"ordinal"===n.type&&bl(i=i.slice(),n.count()),hD(t,cD,i,e)},coordToData:function(t,e){var i=this._extent,n=this.scale;this.onBand&&"ordinal"===n.type&&bl(i=i.slice(),n.count());var o=hD(t,i,cD,e);return this.scale.scale(o)},pointToData:function(t,e){},getTicksCoords:function(t){if(this.onBand&&!t){for(var e=this.getBands(),i=[],n=0;n0&&zl(i[o-1]);o--);for(;n0&&zl(i[a-1]);a--);for(;o=0){var r=o.getItemGraphicEl(a);if(!r){var s=o.getItemLayout(a);if(!s)return;(r=new Dl(o,a)).position=s,r.setZ(t.get("zlevel"),t.get("z")),r.ignore=isNaN(s[0])||isNaN(s[1]),r.__temp=!0,o.setItemGraphicEl(a,r),r.stopSymbolAnimation(!0),this.group.add(r)}r.highlight()}else pr.prototype.highlight.call(this,t,e,i,n)},downplay:function(t,e,i,n){var o=t.getData(),a=Pi(o,n);if(null!=a&&a>=0){var r=o.getItemGraphicEl(a);r&&(r.__temp?(o.setItemGraphicEl(a,null),this.group.remove(r)):r.downplay())}else pr.prototype.downplay.call(this,t,e,i,n)},_newPolyline:function(t){var e=this._polyline;return e&&this._lineGroup.remove(e),e=new CD({shape:{points:t},silent:!0,z2:10}),this._lineGroup.add(e),this._polyline=e,e},_newPolygon:function(t,e){var i=this._polygon;return i&&this._lineGroup.remove(i),i=new LD({shape:{points:t,stackedOnPoints:e},silent:!0}),this._lineGroup.add(i),this._polygon=i,i},_getSymbolIgnoreFunc:function(t,e){var i=e.getAxesByScale("ordinal")[0];if(i&&i.isLabelIgnored)return m(i.isLabelIgnored,i)},_updateAnimation:function(t,e,i,n,o,a){var r=this._polyline,s=this._polygon,l=t.hostModel,u=wD(this._data,t,this._stackedOnPoints,e,this._coordSys,i,this._valueOrigin,a),h=u.current,c=u.stackedOnCurrent,d=u.next,f=u.stackedOnNext;o&&(h=ql(u.current,i,o),c=ql(u.stackedOnCurrent,i,o),d=ql(u.next,i,o),f=ql(u.stackedOnNext,i,o)),r.shape.__points=u.current,r.shape.points=h,fo(r,{shape:{points:d}},l),s&&(s.setShape({points:h,stackedOnPoints:c}),fo(s,{shape:{points:d,stackedOnPoints:f}},l));for(var p=[],g=u.status,m=0;me&&(e=t[i]);return e},min:function(t){for(var e=1/0,i=0;ie[1]&&e.reverse(),e},getOtherAxis:function(){this.grid.getOtherAxis()},isLabelIgnored:function(t){if("category"===this.type){var e=this.getLabelInterval();return"function"==typeof e&&!e(t,this.scale.getLabel(t))||t%(e+1)}},pointToData:function(t,e){return this.coordToData(this.toLocalCoord(t["x"===this.dim?0:1]),e)},toLocalCoord:null,toGlobalCoord:null},u(zD,dD);var RD={show:!0,zlevel:0,z:0,inverse:!1,name:"",nameLocation:"end",nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:!0,onZeroAxisIndex:null,lineStyle:{color:"#333",width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15]},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}}},BD={};BD.categoryAxis=n({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},RD),BD.valueAxis=n({boundaryGap:[0,0],splitNumber:5},RD),BD.timeAxis=r({scale:!0,min:"dataMin",max:"dataMax"},BD.valueAxis),BD.logAxis=r({scale:!0,logBase:10},BD.valueAxis);var VD=["value","category","time","log"],GD=function(t,e,i,a){d(VD,function(r){e.extend({type:t+"Axis."+r,mergeDefaultAndTheme:function(e,o){var a=this.layoutMode,s=a?na(e):{};n(e,o.getTheme().get(r+"Axis")),n(e,this.getDefaultOption()),e.type=i(t,e),a&&ia(e,s,a)},optionUpdated:function(){"category"===this.option.type&&(this.__ordinalMeta=Xs.createByAxisModel(this))},getCategories:function(){if("category"===this.option.type)return this.__ordinalMeta.categories},getOrdinalMeta:function(){return this.__ordinalMeta},defaultOption:o([{},BD[r+"Axis"],a],!0)})}),kS.registerSubTypeDefaulter(t+"Axis",v(i,t))},FD=kS.extend({type:"cartesian2dAxis",axis:null,init:function(){FD.superApply(this,"init",arguments),this.resetRange()},mergeOption:function(){FD.superApply(this,"mergeOption",arguments),this.resetRange()},restoreData:function(){FD.superApply(this,"restoreData",arguments),this.resetRange()},getCoordSysModel:function(){return this.ecModel.queryComponents({mainType:"grid",index:this.option.gridIndex,id:this.option.gridId})[0]}});n(FD.prototype,JI);var WD={offset:0};GD("x",FD,Ql,WD),GD("y",FD,Ql,WD),kS.extend({type:"grid",dependencies:["xAxis","yAxis"],layoutMode:"box",coordinateSystem:null,defaultOption:{show:!1,zlevel:0,z:0,left:"10%",top:60,right:"10%",bottom:60,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"}});var HD=d,ZD=function(t){var e=t.scale.getExtent(),i=e[0],n=e[1];return!(i>0&&n>0||i<0&&n<0)},UD=hl,jD=nu.prototype;jD.type="grid",jD.axisPointerEnabled=!0,jD.getRect=function(){return this._rect},jD.update=function(t,e){var i=this._axesMap;this._updateScale(t,this.model),HD(i.x,function(t){UD(t.scale,t.model)}),HD(i.y,function(t){UD(t.scale,t.model)}),HD(i.x,function(t){ou(i,"y",t)}),HD(i.y,function(t){ou(i,"x",t)}),this.resize(this.model,e)},jD.resize=function(t,e,i){function n(){HD(a,function(t){var e=t.isHorizontal(),i=e?[0,o.width]:[0,o.height],n=t.inverse?1:0;t.setExtent(i[n],i[1-n]),ru(t,e?o.x:o.y)})}var o=Qo(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()});this._rect=o;var a=this._axesList;n(),!i&&t.get("containLabel")&&(HD(a,function(t){if(!t.model.get("axisLabel.inside")){var e=iu(t);if(e){var i=t.isHorizontal()?"height":"width",n=t.model.get("axisLabel.margin");o[i]-=e[i]+n,"top"===t.position?o.y+=e.height+n:"left"===t.position&&(o.x+=e.width+n)}}}),n())},jD.getAxis=function(t,e){var i=this._axesMap[t];if(null!=i){if(null==e)for(var n in i)if(i.hasOwnProperty(n))return i[n];return i[e]}},jD.getAxes=function(){return this._axesList.slice()},jD.getCartesian=function(t,e){if(null!=t&&null!=e){var i="x"+t+"y"+e;return this._coordsMap[i]}w(t)&&(e=t.yAxisIndex,t=t.xAxisIndex);for(var n=0,o=this._coordsList;nu[1]?-1:1,c=["start"===o?u[0]-h*l:"end"===o?u[1]+h*l:(u[0]+u[1])/2,gu(o)?t.labelOffset+r*l:0],d=e.get("nameRotate");null!=d&&(d=d*YD/180);var f;gu(o)?n=KD(t.rotation,null!=d?d:t.rotation,r):(n=hu(t,o,d||0,u),null!=(f=t.axisNameAvailableWidth)&&(f=Math.abs(f/Math.sin(n.rotation)),!isFinite(f)&&(f=null)));var p=s.getFont(),g=e.get("nameTruncate",!0)||{},m=g.ellipsis,v=D(t.nameTruncateMaxWidth,g.maxWidth,f),y=null!=m&&null!=v?bS(i,v,p,m,{minChar:2,placeholder:g.placeholder}):i,x=e.get("tooltip",!0),_=e.mainType,w={componentType:_,name:i,$vars:["name"]};w[_+"Index"]=e.componentIndex;var b=new zb({anid:"name",__fullText:i,__truncatedText:y,position:c,rotation:n.rotation,silent:cu(e),z2:1,tooltip:x&&x.show?a({content:i,formatter:function(){return i},formatterParams:w},x):null});no(b.style,s,{text:y,textFont:p,textFill:s.getTextColor()||e.get("axisLine.lineStyle.color"),textAlign:n.textAlign,textVerticalAlign:n.textVerticalAlign}),e.get("triggerEvent")&&(b.eventData=uu(e),b.eventData.targetType="axisName",b.eventData.name=i),this._dumbGroup.add(b),b.updateTransform(),this.group.add(b),b.decomposeTransform()}}},KD=qD.innerTextLayout=function(t,e,i){var n,o,a=Oo(e-t);return Eo(a)?(o=i>0?"top":"bottom",n="center"):Eo(a-YD)?(o=i>0?"bottom":"top",n="center"):(o="middle",n=a>0&&a0?"right":"left":i>0?"left":"right"),{rotation:a,textAlign:n,textVerticalAlign:o}},JD=qD.ifIgnoreOnTick=function(t,e,i,n,o,a){if(0===e&&o||e===n-1&&a)return!1;var r,s=t.scale;return"ordinal"===s.type&&("function"==typeof i?(r=s.getTicks()[e],!i(r,s.getLabel(r))):e%(i+1))},QD=qD.getInterval=function(t,e){var i=t.get("interval");return null!=i&&"auto"!=i||(i=e),i},tT=d,eT=v,iT=vs({type:"axis",_axisPointer:null,axisPointerClass:null,render:function(t,e,i,n){this.axisPointerClass&&Mu(t),iT.superApply(this,"render",arguments),Cu(this,t,0,i,0,!0)},updateAxisPointer:function(t,e,i,n,o){Cu(this,t,0,i,0,!1)},remove:function(t,e){var i=this._axisPointer;i&&i.remove(e),iT.superApply(this,"remove",arguments)},dispose:function(t,e){Lu(this,e),iT.superApply(this,"dispose",arguments)}}),nT=[];iT.registerAxisPointerClass=function(t,e){nT[t]=e},iT.getAxisPointerClass=function(t){return t&&nT[t]};var oT=qD.ifIgnoreOnTick,aT=qD.getInterval,rT=["axisLine","axisTickLabel","axisName"],sT=["splitArea","splitLine"],lT=iT.extend({type:"cartesianAxis",axisPointerClass:"CartesianAxisPointer",render:function(t,e,i,n){this.group.removeAll();var o=this._axisGroup;if(this._axisGroup=new L_,this.group.add(this._axisGroup),t.get("show")){var a=t.getCoordSysModel(),r=ku(a,t),s=new qD(t,r);d(rT,s.add,s),this._axisGroup.add(s.getGroup()),d(sT,function(e){t.get(e+".show")&&this["_"+e](t,a,r.labelInterval)},this),yo(o,this._axisGroup,t),lT.superCall(this,"render",t,e,i,n)}},_splitLine:function(t,e,i){var n=t.axis;if(!n.scale.isBlank()){var o=t.getModel("splitLine"),a=o.getModel("lineStyle"),s=a.get("color"),l=aT(o,i);s=y(s)?s:[s];for(var u=e.coordinateSystem.getRect(),h=n.isHorizontal(),c=0,d=n.getTicksCoords(),f=n.scale.getTicks(),p=t.get("axisLabel.showMinLabel"),g=t.get("axisLabel.showMaxLabel"),m=[],v=[],x=a.getLineStyle(),_=0;_1){var c;"string"==typeof o?c=ND[o]:"function"==typeof o&&(c=o),c&&t.setData(n.downSample(s.dim,1/h,c,OD))}}}}}("line"));var uT=mM.extend({type:"series.__base_bar__",getInitialData:function(t,e){return Hs(this.getSource(),this)},getMarkerPosition:function(t){var e=this.coordinateSystem;if(e){var i=e.dataToPoint(e.clampData(t)),n=this.getData(),o=n.getLayout("offset"),a=n.getLayout("size");return i[e.getBaseAxis().isHorizontal()?0:1]+=o+a/2,i}return[NaN,NaN]},defaultOption:{zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,itemStyle:{},emphasis:{}}});uT.extend({type:"series.bar",dependencies:["grid","polar"],brushSelector:"rect"});var hT=Lw([["fill","color"],["stroke","borderColor"],["lineWidth","borderWidth"],["stroke","barBorderColor"],["lineWidth","barBorderWidth"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]),cT={getBarItemStyle:function(t){var e=hT(this,t);if(this.getBorderLineDash){var i=this.getBorderLineDash();i&&(e.lineDash=i)}return e}},dT=["itemStyle","barBorderWidth"];a(wo.prototype,cT),xs({type:"bar",render:function(t,e,i){var n=t.get("coordinateSystem");return"cartesian2d"!==n&&"polar"!==n||this._render(t,e,i),this.group},dispose:B,_render:function(t,e,i){var n,o=this.group,a=t.getData(),r=this._data,s=t.coordinateSystem,l=s.getBaseAxis();"cartesian2d"===s.type?n=l.isHorizontal():"polar"===s.type&&(n="angle"===l.dim);var u=t.isAnimationEnabled()?t:null;a.diff(r).add(function(e){if(a.hasValue(e)){var i=a.getItemModel(e),r=pT[s.type](a,e,i),l=fT[s.type](a,e,i,r,n,u);a.setItemGraphicEl(e,l),o.add(l),zu(l,a,e,i,r,t,n,"polar"===s.type)}}).update(function(e,i){var l=r.getItemGraphicEl(i);if(a.hasValue(e)){var h=a.getItemModel(e),c=pT[s.type](a,e,h);l?fo(l,{shape:c},u,e):l=fT[s.type](a,e,h,c,n,u,!0),a.setItemGraphicEl(e,l),o.add(l),zu(l,a,e,h,c,t,n,"polar"===s.type)}else o.remove(l)}).remove(function(t){var e=r.getItemGraphicEl(t);"cartesian2d"===s.type?e&&Ou(t,u,e):e&&Eu(t,u,e)}).execute(),this._data=a},remove:function(t,e){var i=this.group,n=this._data;t.get("animation")?n&&n.eachItemGraphicEl(function(e){"sector"===e.type?Eu(e.dataIndex,t,e):Ou(e.dataIndex,t,e)}):i.removeAll()}});var fT={cartesian2d:function(t,e,i,n,o,r,s){var l=new jb({shape:a({},n)});if(r){var u=l.shape,h=o?"height":"width",c={};u[h]=0,c[h]=n[h],sS[s?"updateProps":"initProps"](l,{shape:c},r,e)}return l},polar:function(t,e,i,n,o,a,s){var l=n.startAngle0?1:-1,r=n.height>0?1:-1;return{x:n.x+a*o/2,y:n.y+r*o/2,width:n.width-a*o,height:n.height-r*o}},polar:function(t,e,i){var n=t.getItemLayout(e);return{cx:n.cx,cy:n.cy,r0:n.r0,r:n.r,startAngle:n.startAngle,endAngle:n.endAngle}}};ds(v(rl,"bar")),fs(function(t){t.eachSeriesByType("bar",function(t){t.getData().setVisual("legendSymbol","roundRect")})});var gT=function(t,e,i){e=y(e)&&{coordDimensions:e}||a({},e);var n=t.getSource(),o=CI(n,e),r=new DI(o,t);return r.initData(n,i),r},mT={updateSelectedMap:function(t){this._targetList=y(t)?t.slice():[],this._selectTargetMap=p(t||[],function(t,e){return t.set(e.name,e),t},z())},select:function(t,e){var i=null!=e?this._targetList[e]:this._selectTargetMap.get(t);"single"===this.get("selectedMode")&&this._selectTargetMap.each(function(t){t.selected=!1}),i&&(i.selected=!0)},unSelect:function(t,e){var i=null!=e?this._targetList[e]:this._selectTargetMap.get(t);i&&(i.selected=!1)},toggleSelected:function(t,e){var i=null!=e?this._targetList[e]:this._selectTargetMap.get(t);if(null!=i)return this[i.selected?"unSelect":"select"](t,e),i.selected},isSelected:function(t,e){var i=null!=e?this._targetList[e]:this._selectTargetMap.get(t);return i&&i.selected}},vT=ys({type:"series.pie",init:function(t){vT.superApply(this,"init",arguments),this.legendDataProvider=function(){return this.getRawData()},this.updateSelectedMap(this._createSelectableList()),this._defaultLabelLine(t)},mergeOption:function(t){vT.superCall(this,"mergeOption",t),this.updateSelectedMap(this._createSelectableList())},getInitialData:function(t,e){return gT(this,["value"])},_createSelectableList:function(){for(var t=this.getRawData(),e=t.mapDimension("value"),i=[],n=0,o=t.count();n0&&"scale"!==u){var d=o.getItemLayout(0),f=Math.max(i.getWidth(),i.getHeight())/2,p=m(r.removeClipPath,r);r.setClipPath(this._createClipPath(d.cx,d.cy,f,d.startAngle,d.clockwise,p,t))}this._data=o}},dispose:function(){},_createClipPath:function(t,e,i,n,o,a,r){var s=new Gb({shape:{cx:t,cy:e,r0:0,r:i,startAngle:n,endAngle:n,clockwise:o}});return po(s,{shape:{endAngle:n+(o?1:-1)*Math.PI*2}},r,a),s},containPoint:function(t,e){var i=e.getData().getItemLayout(0);if(i){var n=t[0]-i.cx,o=t[1]-i.cy,a=Math.sqrt(n*n+o*o);return a<=i.r&&a>=i.r0}}});var xT=function(t,e){d(e,function(e){e.update="updateView",hs(e,function(i,n){var o={};return n.eachComponent({mainType:"series",subType:t,query:i},function(t){t[e.method]&&t[e.method](i.name,i.dataIndex);var n=t.getData();n.each(function(e){var i=n.getName(e);o[i]=t.isSelected(i)||!1})}),{name:i.name,selected:o}})})},_T=function(t){return{getTargetSeries:function(e){var i={},n=z();return e.eachSeriesByType(t,function(t){t.__paletteScope=i,n.set(t.uid,t)}),n},reset:function(t,e){var i=t.getRawData(),n={},o=t.getData();o.each(function(t){var e=o.getRawIndex(t);n[e]=t}),i.each(function(e){var a=n[e],r=null!=a&&o.getItemVisual(a,"color",!0);if(r)i.setItemVisual(e,"color",r);else{var s=i.getItemModel(e).get("itemStyle.color")||t.getColorFromPalette(i.getName(e)||e+"",t.__paletteScope,i.count());i.setItemVisual(e,"color",s),null!=a&&o.setItemVisual(a,"color",s)}})}}},wT=function(t,e,i,n){var o,a,r=t.getData(),s=[],l=!1;r.each(function(i){var n,u,h,c,d=r.getItemLayout(i),f=r.getItemModel(i),p=f.getModel("label"),g=p.get("position")||f.get("emphasis.label.position"),m=f.getModel("labelLine"),v=m.get("length"),y=m.get("length2"),x=(d.startAngle+d.endAngle)/2,_=Math.cos(x),w=Math.sin(x);o=d.cx,a=d.cy;var b="inside"===g||"inner"===g;if("center"===g)n=d.cx,u=d.cy,c="center";else{var S=(b?(d.r+d.r0)/2*_:d.r*_)+o,M=(b?(d.r+d.r0)/2*w:d.r*w)+a;if(n=S+3*_,u=M+3*w,!b){var I=S+_*(v+e-d.r),D=M+w*(v+e-d.r),T=I+(_<0?-1:1)*y,A=D;n=T+(_<0?-5:5),u=A,h=[[S,M],[I,D],[T,A]]}c=b?"center":_>0?"left":"right"}var C=p.getFont(),L=p.get("rotate")?_<0?-x+Math.PI:-x:0,k=me(t.getFormattedLabel(i,"normal")||r.getName(i),C,c,"top");l=!!L,d.label={x:n,y:u,position:g,height:k.height,len:v,len2:y,linePoints:h,textAlign:c,verticalAlign:"middle",rotation:L,inside:b},b||s.push(d.label)}),!l&&t.get("avoidLabelOverlap")&&Wu(s,o,a,e,i,n)},bT=2*Math.PI,ST=Math.PI/180,MT=function(t){return{seriesType:t,reset:function(t,e){var i=e.findComponents({mainType:"legend"});if(i&&i.length){var n=t.getData();n.filterSelf(function(t){for(var e=n.getName(t),o=0;o=0;s--){var l=2*s,u=n[l]-a/2,h=n[l+1]-r/2;if(t>=u&&e>=h&&t<=u+a&&e<=h+r)return s}return-1}}),DT=Hu.prototype;DT.isPersistent=function(){return!this._incremental},DT.updateData=function(t){this.group.removeAll();var e=new IT({rectHover:!0,cursor:"default"});e.setShape({points:t.getLayout("symbolPoints")}),this._setCommon(e,t),this.group.add(e),this._incremental=null},DT.updateLayout=function(t){if(!this._incremental){var e=t.getLayout("symbolPoints");this.group.eachChild(function(t){if(null!=t.startIndex){var i=2*(t.endIndex-t.startIndex),n=4*t.startIndex*2;e=new Float32Array(e.buffer,n,i)}t.setShape("points",e)})}},DT.incrementalPrepareUpdate=function(t){this.group.removeAll(),this._clearIncremental(),t.count()>2e6?(this._incremental||(this._incremental=new On({silent:!0})),this.group.add(this._incremental)):this._incremental=null},DT.incrementalUpdate=function(t,e){var i;this._incremental?(i=new IT,this._incremental.addDisplayable(i,!0)):((i=new IT({rectHover:!0,cursor:"default",startIndex:t.start,endIndex:t.end})).incremental=!0,this.group.add(i)),i.setShape({points:e.getLayout("symbolPoints")}),this._setCommon(i,e,!!this._incremental)},DT._setCommon=function(t,e,i){var n=e.hostModel,o=e.getVisual("symbolSize");t.setShape("size",o instanceof Array?o:[o,o]),t.symbolProxy=ml(e.getVisual("symbol"),0,0,0,0),t.setColor=t.symbolProxy.setColor;var a=t.shape.size[0]<4;t.useStyle(n.getModel("itemStyle").getItemStyle(a?["color","shadowBlur","shadowColor"]:["color"]));var r=e.getVisual("color");r&&t.setColor(r),i||(t.seriesIndex=n.seriesIndex,t.on("mousemove",function(e){t.dataIndex=null;var i=t.findDataIndex(e.offsetX,e.offsetY);i>=0&&(t.dataIndex=i+(t.startIndex||0))}))},DT.remove=function(){this._clearIncremental(),this._incremental=null,this.group.removeAll()},DT._clearIncremental=function(){var t=this._incremental;t&&t.clearDisplaybles()},xs({type:"scatter",render:function(t,e,i){var n=t.getData();this._updateSymbolDraw(n,t).updateData(n),this._finished=!0},incrementalPrepareRender:function(t,e,i){var n=t.getData();this._updateSymbolDraw(n,t).incrementalPrepareUpdate(n),this._finished=!1},incrementalRender:function(t,e,i){this._symbolDraw.incrementalUpdate(t,e.getData()),this._finished=t.end===e.getData().count()},updateTransform:function(t,e,i){var n=t.getData();if(this.group.dirty(),!this._finished||n.count()>1e4||!this._symbolDraw.isPersistent())return{update:!0};var o=PD().reset(t);o.progress&&o.progress({start:0,end:n.count()},n),this._symbolDraw.updateLayout(n)},_updateSymbolDraw:function(t,e){var i=this._symbolDraw,n=e.pipelineContext.large;return i&&n===this._isLargeDraw||(i&&i.remove(),i=this._symbolDraw=n?new Hu:new Al,this._isLargeDraw=n,this.group.removeAll()),this.group.add(i.group),i},remove:function(t,e){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},dispose:function(){}}),fs(kD("scatter","circle")),ds(PD("scatter")),u(Zu,dD),Uu.prototype.getIndicatorAxes=function(){return this._indicatorAxes},Uu.prototype.dataToPoint=function(t,e){var i=this._indicatorAxes[e];return this.coordToPoint(i.dataToCoord(t),e)},Uu.prototype.coordToPoint=function(t,e){var i=this._indicatorAxes[e].angle;return[this.cx+t*Math.cos(i),this.cy-t*Math.sin(i)]},Uu.prototype.pointToData=function(t){var e=t[0]-this.cx,i=t[1]-this.cy,n=Math.sqrt(e*e+i*i);e/=n,i/=n;for(var o,a=Math.atan2(-i,e),r=1/0,s=-1,l=0;ln[0]&&isFinite(c)&&isFinite(n[0]))}else{r.getTicks().length-1>a&&(u=i(u));var d=Math.round((n[0]+n[1])/2/u)*u,f=Math.round(a/2);r.setExtent(Ao(d-f*u),Ao(d+(a-f)*u)),r.setInterval(u)}})},Uu.dimensions=[],Uu.create=function(t,e){var i=[];return t.eachComponent("radar",function(n){var o=new Uu(n,t,e);i.push(o),n.coordinateSystem=o}),t.eachSeriesByType("radar",function(t){"radar"===t.get("coordinateSystem")&&(t.coordinateSystem=i[t.get("radarIndex")||0])}),i},Ca.register("radar",Uu);var TT=BD.valueAxis,AT=(ms({type:"radar",optionUpdated:function(){var t=this.get("boundaryGap"),e=this.get("splitNumber"),o=this.get("scale"),s=this.get("axisLine"),l=this.get("axisTick"),u=this.get("axisLabel"),h=this.get("name"),c=this.get("name.show"),d=this.get("name.formatter"),p=this.get("nameGap"),g=this.get("triggerEvent"),m=f(this.get("indicator")||[],function(f){null!=f.max&&f.max>0&&!f.min?f.min=0:null!=f.min&&f.min<0&&!f.max&&(f.max=0);var m=h;if(null!=f.color&&(m=r({color:f.color},h)),f=n(i(f),{boundaryGap:t,splitNumber:e,scale:o,axisLine:s,axisTick:l,axisLabel:u,name:f.text,nameLocation:"end",nameGap:p,nameTextStyle:m,triggerEvent:g},!1),c||(f.name=""),"string"==typeof d){var v=f.name;f.name=d.replace("{value}",null!=v?v:"")}else"function"==typeof d&&(f.name=d(f.name,f));var y=a(new wo(f,null,this.ecModel),JI);return y.mainType="radar",y.componentIndex=this.componentIndex,y},this);this.getIndicatorModels=function(){return m}},defaultOption:{zlevel:0,z:0,center:["50%","50%"],radius:"75%",startAngle:90,name:{show:!0},boundaryGap:[0,0],splitNumber:5,nameGap:15,scale:!1,shape:"polygon",axisLine:n({lineStyle:{color:"#bbb"}},TT.axisLine),axisLabel:ju(TT.axisLabel,!1),axisTick:ju(TT.axisTick,!1),splitLine:ju(TT.splitLine,!0),splitArea:ju(TT.splitArea,!0),indicator:[]}}),["axisLine","axisTickLabel","axisName"]);vs({type:"radar",render:function(t,e,i){this.group.removeAll(),this._buildAxes(t),this._buildSplitLineAndArea(t)},_buildAxes:function(t){var e=t.coordinateSystem;d(f(e.getIndicatorAxes(),function(t){return new qD(t.model,{position:[e.cx,e.cy],rotation:t.angle,labelDirection:-1,tickDirection:-1,nameDirection:1})}),function(t){d(AT,t.add,t),this.group.add(t.getGroup())},this)},_buildSplitLineAndArea:function(t){function e(t,e,i){var n=i%e.length;return t[n]=t[n]||[],n}var i=t.coordinateSystem,n=i.getIndicatorAxes();if(n.length){var o=t.get("shape"),a=t.getModel("splitLine"),s=t.getModel("splitArea"),l=a.getModel("lineStyle"),u=s.getModel("areaStyle"),h=a.get("show"),c=s.get("show"),p=l.get("color"),g=u.get("color");p=y(p)?p:[p],g=y(g)?g:[g];var m=[],v=[];if("circle"===o)for(var x=n[0].getTicksCoords(),_=i.cx,w=i.cy,b=0;b"+f(i,function(i,n){var o=e.get(e.mapDimension(i.dim),t);return Zo(i.name+" : "+o)}).join("
")},defaultOption:{zlevel:0,z:2,coordinateSystem:"radar",legendHoverLink:!0,radarIndex:0,lineStyle:{width:2,type:"solid"},label:{position:"top"},symbol:"emptyCircle",symbolSize:4}});xs({type:"radar",render:function(t,e,n){function o(t,e){var i=t.getItemVisual(e,"symbol")||"circle",n=t.getItemVisual(e,"color");if("none"!==i){var o=Xu(t.getItemVisual(e,"symbolSize")),a=ml(i,-1,-1,2,2,n);return a.attr({style:{strokeNoScale:!0},z2:100,scale:[o[0]/2,o[1]/2]}),a}}function a(e,i,n,a,r,s){n.removeAll();for(var l=0;l"+Zo(n+" : "+i)},getTooltipPosition:function(t){if(null!=t){var e=this.getData().getName(t),i=this.coordinateSystem,n=i.getRegion(e);return n&&i.dataToPoint(n.center)}},setZoom:function(t){this.option.zoom=t},setCenter:function(t){this.option.center=t},defaultOption:{zlevel:0,z:2,coordinateSystem:"geo",map:"",left:"center",top:"center",aspectScale:.75,showLegendSymbol:!0,dataRangeHoverLink:!0,boundingCoords:null,center:null,zoom:1,scaleLimit:null,label:{show:!1,color:"#000"},itemStyle:{borderWidth:.5,borderColor:"#444",areaColor:"#eee"},emphasis:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{areaColor:"rgba(255,215,0,0.8)"}}}});h(GT,mT);var FT="\0_ec_interaction_mutex";hs({type:"takeGlobalCursor",event:"globalCursorTaken",update:"update"},function(){}),h(ah,$x);var WT={axisPointer:1,tooltip:1,brush:1};xh.prototype={constructor:xh,draw:function(t,e,i,n,o){var a="geo"===t.mainType,r=t.getData&&t.getData();a&&e.eachComponent({mainType:"series",subType:"map"},function(e){r||e.getHostGeoModel()!==t||(r=e.getData())});var s=t.coordinateSystem,l=this.group,u=s.scale,h={position:s.position,scale:u};!l.childAt(0)||o?l.attr(h):fo(l,h,t),l.removeAll();var c=["itemStyle"],f=["emphasis","itemStyle"],p=["label"],g=["emphasis","label"],m=z();d(s.regions,function(e){var i=m.get(e.name)||m.set(e.name,new L_),n=new Kb({shape:{paths:[]}});i.add(n);var o,s=(C=t.getRegionModel(e.name)||t).getModel(c),h=C.getModel(f),v=mh(s),y=mh(h),x=C.getModel(p),_=C.getModel(g);if(r){o=r.indexOfName(e.name);var w=r.getItemVisual(o,"color",!0);w&&(v.fill=w)}d(e.geometries,function(t){if("polygon"===t.type){n.shape.paths.push(new Zb({shape:{points:t.exterior}}));for(var e=0;e<(t.interiors?t.interiors.length:0);e++)n.shape.paths.push(new Zb({shape:{points:t.interiors[e]}}))}}),n.setStyle(v),n.style.strokeNoScale=!0,n.culling=!0;var b=x.get("show"),S=_.get("show"),M=r&&isNaN(r.get(r.mapDimension("value"),o)),I=r&&r.getItemLayout(o);if(a||M&&(b||S)||I&&I.showLabel){var D,T=a?e.name:o;(!r||o>=0)&&(D=t);var A=new zb({position:e.center.slice(),scale:[1/u[0],1/u[1]],z2:10,silent:!0});io(A.style,A.hoverStyle={},x,_,{labelFetcher:D,labelDataIndex:T,defaultText:e.name,useInsideStyle:!1},{textAlign:"center",textVerticalAlign:"middle"}),i.add(A)}if(r)r.setItemGraphicEl(o,i);else{var C=t.getRegionModel(e.name);n.eventData={componentType:"geo",geoIndex:t.componentIndex,name:e.name,region:C&&C.option||{}}}(i.__regions||(i.__regions=[])).push(e),eo(i,y,{hoverSilentOnTouch:!!t.get("selectedMode")}),l.add(i)}),this._updateController(t,e,i),vh(this,t,l,i,n),yh(t,l)},remove:function(){this.group.removeAll(),this._controller.dispose(),this._controllerHost={}},_updateController:function(t,e,i){function n(){var e={type:"geoRoam",componentType:l};return e[l+"Id"]=t.id,e}var o=t.coordinateSystem,r=this._controller,s=this._controllerHost;s.zoomLimit=t.get("scaleLimit"),s.zoom=o.getZoom(),r.enable(t.get("roam")||!1);var l=t.mainType;r.off("pan").on("pan",function(t,e){this._mouseDownFlag=!1,fh(s,t,e),i.dispatchAction(a(n(),{dx:t,dy:e}))},this),r.off("zoom").on("zoom",function(t,e,o){if(this._mouseDownFlag=!1,ph(s,t,e,o),i.dispatchAction(a(n(),{zoom:t,originX:e,originY:o})),this._updateGroup){var r=this.group,l=r.scale;r.traverse(function(t){"text"===t.type&&t.attr("scale",[1/l[0],1/l[1]])})}},this),r.setPointerChecker(function(e,n,a){return o.getViewRectAfterRoam().contain(n,a)&&!gh(e,i,t)})}},xs({type:"map",render:function(t,e,i,n){if(!n||"mapToggleSelect"!==n.type||n.from!==this.uid){var o=this.group;if(o.removeAll(),!t.getHostGeoModel()){if(n&&"geoRoam"===n.type&&"series"===n.componentType&&n.seriesId===t.id)(a=this._mapDraw)&&o.add(a.group);else if(t.needsDrawMap){var a=this._mapDraw||new xh(i,!0);o.add(a.group),a.draw(t,e,i,this,n),this._mapDraw=a}else this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null;t.get("showLegendSymbol")&&e.getComponent("legend")&&this._renderSymbols(t,e,i)}}},remove:function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null,this.group.removeAll()},dispose:function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null},_renderSymbols:function(t,e,i){var n=t.originalData,o=this.group;n.each(n.mapDimension("value"),function(e,i){if(!isNaN(e)){var a=n.getItemLayout(i);if(a&&a.point){var r=a.point,s=a.offset,l=new Rb({style:{fill:t.getData().getVisual("color")},shape:{cx:r[0]+9*s,cy:r[1],r:3},silent:!0,z2:s?8:10});if(!s){var u=t.mainSeries.getData(),h=n.getName(i),c=u.indexOfName(h),d=n.getItemModel(i),f=d.getModel("label"),p=d.getModel("emphasis.label"),g=u.getItemGraphicEl(c),m=T(t.getFormattedLabel(i,"normal"),h),v=T(t.getFormattedLabel(i,"emphasis"),m),y=function(){var t=no({},p,{text:p.get("show")?v:null},{isRectText:!0,useInsideStyle:!1},!0);l.style.extendFrom(t),l.__mapOriginalZ2=l.z2,l.z2+=1},x=function(){no(l.style,f,{text:f.get("show")?m:null,textPosition:f.getShallow("position")||"bottom"},{isRectText:!0,useInsideStyle:!1}),null!=l.__mapOriginalZ2&&(l.z2=l.__mapOriginalZ2,l.__mapOriginalZ2=null)};g.on("mouseover",y).on("mouseout",x).on("emphasis",y).on("normal",x),x()}o.add(l)}}})}}),hs({type:"geoRoam",event:"geoRoam",update:"updateTransform"},function(t,e){var i=t.componentType||"series";e.eachComponent({mainType:i,query:t},function(e){var n=e.coordinateSystem;if("geo"===n.type){var o=_h(n,t,e.get("scaleLimit"));e.setCenter&&e.setCenter(o.center),e.setZoom&&e.setZoom(o.zoom),"series"===i&&d(e.seriesGroup,function(t){t.setCenter(o.center),t.setZoom(o.zoom)})}})});ds(function(t){var e={};t.eachSeriesByType("map",function(i){var n=i.getMapType();if(!i.getHostGeoModel()&&!e[n]){var o={};d(i.seriesGroup,function(e){var i=e.coordinateSystem,n=e.originalData;e.get("showLegendSymbol")&&t.getComponent("legend")&&n.each(n.mapDimension("value"),function(t,e){var a=n.getName(e),r=i.getRegion(a);if(r&&!isNaN(t)){var s=o[a]||0,l=i.dataToPoint(r.center);o[a]=s+1,n.setItemLayout(e,{point:l,offset:s})}})});var a=i.getData();a.each(function(t){var e=a.getName(t),i=a.getItemLayout(t)||{};i.showLabel=!o[e],a.setItemLayout(t,i)}),e[n]=!0}})}),fs(function(t){t.eachSeriesByType("map",function(t){var e=t.get("color"),i=t.getModel("itemStyle"),n=i.get("areaColor"),o=i.get("color")||e[t.seriesIndex%e.length];t.getData().setVisual({areaColor:n,color:o})})}),us(qM.PROCESSOR.STATISTIC,function(t){var e={};t.eachSeriesByType("map",function(t){var i=t.getHostGeoModel(),n=i?"o"+i.id:"i"+t.getMapType();(e[n]=e[n]||[]).push(t)}),d(e,function(t,e){for(var i=wh(f(t,function(t){return t.getData()}),t[0].get("mapValueCalculation")),n=0;ne&&(e=n.height)}this.height=e+1},getNodeById:function(t){if(this.getId()===t)return this;for(var e=0,i=this.children,n=i.length;e=0&&this.hostTree.data.setItemLayout(this.dataIndex,t,e)},getLayout:function(){return this.hostTree.data.getItemLayout(this.dataIndex)},getModel:function(t){if(!(this.dataIndex<0)){var e,i=this.hostTree,n=i.data.getItemModel(this.dataIndex),o=this.getLevelModel();return o||0!==this.children.length&&(0===this.children.length||!1!==this.isExpand)||(e=this.getLeavesModel()),n.getModel(t,(o||e||i.hostModel).getModel(t))}},getLevelModel:function(){return(this.hostTree.levelModels||[])[this.depth]},getLeavesModel:function(){return this.hostTree.leavesModel},setVisual:function(t,e){this.dataIndex>=0&&this.hostTree.data.setItemVisual(this.dataIndex,t,e)},getVisual:function(t,e){return this.hostTree.data.getItemVisual(this.dataIndex,t,e)},getRawIndex:function(){return this.hostTree.data.getRawIndex(this.dataIndex)},getId:function(){return this.hostTree.data.getId(this.dataIndex)},isAncestorOf:function(t){for(var e=t.parentNode;e;){if(e===this)return!0;e=e.parentNode}return!1},isDescendantOf:function(t){return t!==this&&t.isAncestorOf(this)}},Lh.prototype={constructor:Lh,type:"tree",eachNode:function(t,e,i){this.root.eachNode(t,e,i)},getNodeByDataIndex:function(t){var e=this.data.getRawIndex(t);return this._nodes[e]},getNodeByName:function(t){return this.root.getNodeByName(t)},update:function(){for(var t=this.data,e=this._nodes,i=0,n=e.length;ia&&(a=t.depth)});var r=t.expandAndCollapse&&t.initialTreeDepth>=0?t.initialTreeDepth:a;return o.root.eachNode("preorder",function(t){var e=t.hostTree.data.getRawDataItem(t.dataIndex);t.isExpand=e&&null!=e.collapsed?!e.collapsed:t.depth<=r}),o.data},formatTooltip:function(t){for(var e=this.getData().tree,i=e.root.children[0],n=e.getNodeByDataIndex(t),o=n.getValue(),a=n.name;n&&n!==i;)a=n.parentNode.name+"."+a,n=n.parentNode;return Zo(a+(isNaN(o)||null==o?"":" : "+o))},defaultOption:{zlevel:0,z:2,left:"12%",top:"12%",right:"12%",bottom:"12%",layout:"orthogonal",orient:"horizontal",symbol:"emptyCircle",symbolSize:7,expandAndCollapse:!0,initialTreeDepth:2,lineStyle:{color:"#ccc",width:1.5,curveness:.5},itemStyle:{color:"lightsteelblue",borderColor:"#c23531",borderWidth:1.5},label:{show:!0,color:"#555"},leaves:{label:{show:!0}},animationEasing:"linear",animationDuration:700,animationDurationUpdate:1e3}}),xs({type:"tree",init:function(t,e){this._oldTree,this._mainGroup=new L_,this.group.add(this._mainGroup)},render:function(t,e,i,n){var o=t.getData(),a=t.layoutInfo,r=this._mainGroup,s=t.get("layout");"radial"===s?r.attr("position",[a.x+a.width/2,a.y+a.height/2]):r.attr("position",[a.x,a.y]);var l=this._data,u={expandAndCollapse:t.get("expandAndCollapse"),layout:s,orient:t.get("orient"),curvature:t.get("lineStyle.curveness"),symbolRotate:t.get("symbolRotate"),symbolOffset:t.get("symbolOffset"),hoverAnimation:t.get("hoverAnimation"),useNameLabel:!0,fadeIn:!0};o.diff(l).add(function(e){Uh(o,e)&&Xh(o,e,null,r,t,u)}).update(function(e,i){var n=l.getItemGraphicEl(i);Uh(o,e)?Xh(o,e,n,r,t,u):n&&Yh(o,e,n,r,t,u)}).remove(function(e){var i=l.getItemGraphicEl(e);Yh(o,e,i,r,t,u)}).execute(),!0===u.expandAndCollapse&&o.eachItemGraphicEl(function(e,n){e.off("click").on("click",function(){i.dispatchAction({type:"treeExpandAndCollapse",seriesId:t.id,dataIndex:n})})}),this._data=o},dispose:function(){},remove:function(){this._mainGroup.removeAll(),this._data=null}}),hs({type:"treeExpandAndCollapse",event:"treeExpandAndCollapse",update:"update"},function(t,e){e.eachComponent({mainType:"series",subType:"tree",query:t},function(e){var i=t.dataIndex,n=e.getData().tree.getNodeByDataIndex(i);n.isExpand=!n.isExpand})});var XT=function(t,e){var i=Rh(t,e);t.layoutInfo=i;var n=t.get("layout"),o=0,a=0,r=null;"radial"===n?(o=2*Math.PI,a=Math.min(i.height,i.width)/2,r=Eh(function(t,e){return(t.parentNode===e.parentNode?1:2)/t.depth})):(o=i.width,a=i.height,r=Eh());var s=t.getData().tree.root,l=s.children[0];Ph(s),$h(l,Nh,r),s.hierNode.modifier=-l.hierNode.prelim,Kh(l,Oh);var u=l,h=l,c=l;Kh(l,function(t){var e=t.getLayout().x;eh.getLayout().x&&(h=t),t.depth>c.depth&&(c=t)});var d=u===h?1:r(u,h)/2,f=d-u.getLayout().x,p=0,g=0,m=0,v=0;"radial"===n?(p=o/(h.getLayout().x+d+f),g=a/(c.depth-1||1),Kh(l,function(t){m=(t.getLayout().x+f)*p,v=(t.depth-1)*g;var e=zh(m,v);t.setLayout({x:e.x,y:e.y,rawX:m,rawY:v},!0)})):"horizontal"===t.get("orient")?(g=a/(h.getLayout().x+d+f),p=o/(c.depth-1||1),Kh(l,function(t){v=(t.getLayout().x+f)*g,m=(t.depth-1)*p,t.setLayout({x:m,y:v},!0)})):(p=o/(h.getLayout().x+d+f),g=a/(c.depth-1||1),Kh(l,function(t){m=(t.getLayout().x+f)*p,v=(t.depth-1)*g,t.setLayout({x:m,y:v},!0)}))};fs(kD("tree","circle")),ds(function(t,e){t.eachSeriesByType("tree",function(t){XT(t,e)})}),ds(function(t,e){t.eachSeriesByType("tree",function(t){XT(t,e)})}),mM.extend({type:"series.treemap",layoutMode:"box",dependencies:["grid","polar"],_viewRoot:null,defaultOption:{progressive:0,hoverLayerThreshold:1/0,left:"center",top:"middle",right:null,bottom:null,width:"80%",height:"80%",sort:!0,clipWindow:"origin",squareRatio:.5*(1+Math.sqrt(5)),leafDepth:null,drillDownIcon:"▶",zoomToNodeRatio:.1024,roam:!0,nodeClick:"zoomToNode",animation:!0,animationDurationUpdate:900,animationEasing:"quinticInOut",breadcrumb:{show:!0,height:22,left:"center",top:"bottom",emptyItemWidth:25,itemStyle:{color:"rgba(0,0,0,0.7)",borderColor:"rgba(255,255,255,0.7)",borderWidth:1,shadowColor:"rgba(150,150,150,1)",shadowBlur:3,shadowOffsetX:0,shadowOffsetY:0,textStyle:{color:"#fff"}},emphasis:{textStyle:{}}},label:{show:!0,distance:0,padding:5,position:"inside",color:"#fff",ellipsis:!0},upperLabel:{show:!1,position:[0,"50%"],height:20,color:"#fff",ellipsis:!0,verticalAlign:"middle"},itemStyle:{color:null,colorAlpha:null,colorSaturation:null,borderWidth:0,gapWidth:0,borderColor:"#fff",borderColorSaturation:null},emphasis:{upperLabel:{show:!0,position:[0,"50%"],color:"#fff",ellipsis:!0,verticalAlign:"middle"}},visualDimension:0,visualMin:null,visualMax:null,color:[],colorAlpha:null,colorSaturation:null,colorMappingBy:"index",visibleMin:10,childrenVisibleMin:null,levels:[]},getInitialData:function(t,e){var i={name:t.name,children:t.data};ic(i);var n=t.levels||[];n=t.levels=nc(n,e);var o={};return o.levels=n,Lh.createTree(i,this,o).data},optionUpdated:function(){this.resetViewRoot()},formatTooltip:function(t){var e=this.getData(),i=this.getRawValue(t),n=Wo(y(i)?i[0]:i);return Zo(e.getName(t)+": "+n)},getDataParams:function(t){var e=mM.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(t);return e.treePathInfo=ec(i,this),e},setLayoutInfo:function(t){this.layoutInfo=this.layoutInfo||{},a(this.layoutInfo,t)},mapIdToIndex:function(t){var e=this._idIndexMap;e||(e=this._idIndexMap=z(),this._idIndexMapCount=0);var i=e.get(t);return null==i&&e.set(t,i=this._idIndexMapCount++),i},getViewRoot:function(){return this._viewRoot},resetViewRoot:function(t){t?this._viewRoot=t:t=this._viewRoot;var e=this.getRawData().tree.root;t&&(t===e||e.contains(t))||(this._viewRoot=e)}});var YT=5;oc.prototype={constructor:oc,render:function(t,e,i,n){var o=t.getModel("breadcrumb"),a=this.group;if(a.removeAll(),o.get("show")&&i){var r=o.getModel("itemStyle"),s=r.getModel("textStyle"),l={pos:{left:o.get("left"),right:o.get("right"),top:o.get("top"),bottom:o.get("bottom")},box:{width:e.getWidth(),height:e.getHeight()},emptyItemWidth:o.get("emptyItemWidth"),totalWidth:0,renderList:[]};this._prepare(i,l,s),this._renderContent(t,l,r,s,n),ta(a,l.pos,l.box)}},_prepare:function(t,e,i){for(var n=t;n;n=n.parentNode){var o=n.getModel().get("name"),a=i.getTextRect(o),r=Math.max(a.width+16,e.emptyItemWidth);e.totalWidth+=r+8,e.renderList.push({node:n,text:o,width:r})}},_renderContent:function(t,e,i,n,o){for(var a=0,s=e.emptyItemWidth,l=t.get("breadcrumb.height"),u=Jo(e.pos,e.box),h=e.totalWidth,c=e.renderList,d=c.length-1;d>=0;d--){var f=c[d],p=f.node,g=f.width,m=f.text;h>u.width&&(h-=g-s,g=s,m=null);var y=new Zb({shape:{points:ac(a,0,g,l,d===c.length-1,0===d)},style:r(i.getItemStyle(),{lineJoin:"bevel",text:m,textFill:n.getTextColor(),textFont:n.getFont()}),z:10,onclick:v(o,p)});this.group.add(y),rc(y,t,p),a+=g+8}},remove:function(){this.group.removeAll()}};var qT=m,$T=L_,KT=jb,JT=d,QT=["label"],tA=["emphasis","label"],eA=["upperLabel"],iA=["emphasis","upperLabel"],nA=10,oA=1,aA=2,rA=Lw([["fill","color"],["stroke","strokeColor"],["lineWidth","strokeWidth"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]),sA=function(t){var e=rA(t);return e.stroke=e.fill=e.lineWidth=null,e};xs({type:"treemap",init:function(t,e){this._containerGroup,this._storage={nodeGroup:[],background:[],content:[]},this._oldTree,this._breadcrumb,this._controller,this._state="ready"},render:function(t,e,i,n){if(!(l(e.findComponents({mainType:"series",subType:"treemap",query:n}),t)<0)){this.seriesModel=t,this.api=i,this.ecModel=e;var o=Jh(n,["treemapZoomToNode","treemapRootToNode"],t),a=n&&n.type,r=t.layoutInfo,s=!this._oldTree,u=this._storage,h="treemapRootToNode"===a&&o&&u?{rootNodeGroup:u.nodeGroup[o.node.getRawIndex()],direction:n.direction}:null,c=this._giveContainerGroup(r),d=this._doRender(c,t,h);s||a&&"treemapZoomToNode"!==a&&"treemapRootToNode"!==a?d.renderFinally():this._doAnimation(c,d,t,h),this._resetController(i),this._renderBreadcrumb(t,i,o)}},_giveContainerGroup:function(t){var e=this._containerGroup;return e||(e=this._containerGroup=new $T,this._initEvents(e),this.group.add(e)),e.attr("position",[t.x,t.y]),e},_doRender:function(t,e,i){function n(t,e,i,o,a){function r(t){return t.getId()}function s(r,s){var l=null!=r?t[r]:null,u=null!=s?e[s]:null,c=h(l,u,i,a);c&&n(l&&l.viewChildren||[],u&&u.viewChildren||[],c,o,a+1)}o?(e=t,JT(t,function(t,e){!t.isRemoved()&&s(e,e)})):new bs(e,t,r,r).add(s).update(s).remove(v(s,null)).execute()}var o=e.getData().tree,a=this._oldTree,r={nodeGroup:[],background:[],content:[]},s={nodeGroup:[],background:[],content:[]},l=this._storage,u=[],h=v(lc,e,s,l,i,r,u);n(o.root?[o.root]:[],a&&a.root?[a.root]:[],t,o===a||!a,0);var c=function(t){var e={nodeGroup:[],background:[],content:[]};return t&&JT(t,function(t,i){var n=e[i];JT(t,function(t){t&&(n.push(t),t.__tmWillDelete=1)})}),e}(l);return this._oldTree=o,this._storage=s,{lastsForAnimation:r,willDeleteEls:c,renderFinally:function(){JT(c,function(t){JT(t,function(t){t.parent&&t.parent.remove(t)})}),JT(u,function(t){t.invisible=!0,t.dirty()})}}},_doAnimation:function(t,e,i,n){if(i.get("animation")){var o=i.get("animationDurationUpdate"),r=i.get("animationEasing"),s=sc();JT(e.willDeleteEls,function(t,e){JT(t,function(t,i){if(!t.invisible){var a,l=t.parent;if(n&&"drillDown"===n.direction)a=l===n.rootNodeGroup?{shape:{x:0,y:0,width:l.__tmNodeWidth,height:l.__tmNodeHeight},style:{opacity:0}}:{style:{opacity:0}};else{var u=0,h=0;l.__tmWillDelete||(u=l.__tmNodeWidth/2,h=l.__tmNodeHeight/2),a="nodeGroup"===e?{position:[u,h],style:{opacity:0}}:{shape:{x:u,y:h,width:0,height:0},style:{opacity:0}}}a&&s.add(t,a,o,r)}})}),JT(this._storage,function(t,i){JT(t,function(t,n){var l=e.lastsForAnimation[i][n],u={};l&&("nodeGroup"===i?l.old&&(u.position=t.position.slice(),t.attr("position",l.old)):(l.old&&(u.shape=a({},t.shape),t.setShape(l.old)),l.fadein?(t.setStyle("opacity",0),u.style={opacity:1}):1!==t.style.opacity&&(u.style={opacity:1})),s.add(t,u,o,r))})},this),this._state="animating",s.done(qT(function(){this._state="ready",e.renderFinally()},this)).start()}},_resetController:function(t){var e=this._controller;e||((e=this._controller=new ah(t.getZr())).enable(this.seriesModel.get("roam")),e.on("pan",qT(this._onPan,this)),e.on("zoom",qT(this._onZoom,this)));var i=new Kt(0,0,t.getWidth(),t.getHeight());e.setPointerChecker(function(t,e,n){return i.contain(e,n)})},_clearController:function(){var t=this._controller;t&&(t.dispose(),t=null)},_onPan:function(t,e){if("animating"!==this._state&&(Math.abs(t)>3||Math.abs(e)>3)){var i=this.seriesModel.getData().tree.root;if(!i)return;var n=i.getLayout();if(!n)return;this.api.dispatchAction({type:"treemapMove",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:n.x+t,y:n.y+e,width:n.width,height:n.height}})}},_onZoom:function(t,e,i){if("animating"!==this._state){var n=this.seriesModel.getData().tree.root;if(!n)return;var o=n.getLayout();if(!o)return;var a=new Kt(o.x,o.y,o.width,o.height),r=this.seriesModel.layoutInfo;e-=r.x,i-=r.y;var s=st();ct(s,s,[-e,-i]),ft(s,s,[t,t]),ct(s,s,[e,i]),a.applyTransform(s),this.api.dispatchAction({type:"treemapRender",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:a.x,y:a.y,width:a.width,height:a.height}})}},_initEvents:function(t){t.on("click",function(t){if("ready"===this._state){var e=this.seriesModel.get("nodeClick",!0);if(e){var i=this.findTarget(t.offsetX,t.offsetY);if(i){var n=i.node;if(n.getLayout().isLeafRoot)this._rootToNode(i);else if("zoomToNode"===e)this._zoomToNode(i);else if("link"===e){var o=n.hostTree.data.getItemModel(n.dataIndex),a=o.get("link",!0),r=o.get("target",!0)||"blank";a&&window.open(a,r)}}}}},this)},_renderBreadcrumb:function(t,e,i){i||(i=null!=t.get("leafDepth",!0)?{node:t.getViewRoot()}:this.findTarget(e.getWidth()/2,e.getHeight()/2))||(i={node:t.getData().tree.root}),(this._breadcrumb||(this._breadcrumb=new oc(this.group))).render(t,e,i.node,qT(function(e){"animating"!==this._state&&(tc(t.getViewRoot(),e)?this._rootToNode({node:e}):this._zoomToNode({node:e}))},this))},remove:function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage={nodeGroup:[],background:[],content:[]},this._state="ready",this._breadcrumb&&this._breadcrumb.remove()},dispose:function(){this._clearController()},_zoomToNode:function(t){this.api.dispatchAction({type:"treemapZoomToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:t.node})},_rootToNode:function(t){this.api.dispatchAction({type:"treemapRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:t.node})},findTarget:function(t,e){var i;return this.seriesModel.getViewRoot().eachNode({attr:"viewChildren",order:"preorder"},function(n){var o=this._storage.background[n.getRawIndex()];if(o){var a=o.transformCoordToLocal(t,e),r=o.shape;if(!(r.x<=a[0]&&a[0]<=r.x+r.width&&r.y<=a[1]&&a[1]<=r.y+r.height))return!1;i={node:n,offsetX:a[0],offsetY:a[1]}}},this),i}});for(var lA=["treemapZoomToNode","treemapRender","treemapMove"],uA=0;uA=0&&t.call(e,i[o],o)},CA.eachEdge=function(t,e){for(var i=this.edges,n=i.length,o=0;o=0&&i[o].node1.dataIndex>=0&&i[o].node2.dataIndex>=0&&t.call(e,i[o],o)},CA.breadthFirstTraverse=function(t,e,i,n){if(Wc.isInstance(e)||(e=this._nodesMap[Fc(e)]),e){for(var o="out"===i?"outEdges":"in"===i?"inEdges":"edges",a=0;a=0&&i.node2.dataIndex>=0});for(var o=0,a=n.length;o=0&&this[t][e].setItemVisual(this.dataIndex,i,n)},getVisual:function(i,n){return this[t][e].getItemVisual(this.dataIndex,i,n)},setLayout:function(i,n){this.dataIndex>=0&&this[t][e].setItemLayout(this.dataIndex,i,n)},getLayout:function(){return this[t][e].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[t][e].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[t][e].getRawIndex(this.dataIndex)}}};h(Wc,LA("hostGraph","data")),h(Hc,LA("hostGraph","edgeData")),AA.Node=Wc,AA.Edge=Hc,Fi(Wc),Fi(Hc);var kA=function(t,e,i,n,o){for(var a=new AA(n),r=0;r "+d)),u++)}var f,p=i.get("coordinateSystem");if("cartesian2d"===p||"polar"===p)f=Hs(t,i);else{var g=Ca.get(p),m=CI(t,{coordDimensions:(g&&"view"!==g.type?g.dimensions||[]:[]).concat(["value"])});(f=new DI(m,i)).initData(t)}var v=new DI(["value"],i);return v.initData(l,s),o&&o(f,v),bh({mainData:f,struct:a,structAttr:"graph",datas:{node:f,edge:v},datasAttr:{node:"data",edge:"edgeData"}}),a.update(),a},PA=ys({type:"series.graph",init:function(t){PA.superApply(this,"init",arguments),this.legendDataProvider=function(){return this._categoriesData},this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},mergeOption:function(t){PA.superApply(this,"mergeOption",arguments),this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},mergeDefaultAndTheme:function(t){PA.superApply(this,"mergeDefaultAndTheme",arguments),Mi(t,["edgeLabel"],["show"])},getInitialData:function(t,e){var i=t.edges||t.links||[],n=t.data||t.nodes||[],o=this;if(n&&i)return kA(n,i,this,!0,function(t,i){function n(t){return(t=this.parsePath(t))&&"label"===t[0]?r:this.parentModel}t.wrapMethod("getItemModel",function(t){var e=o._categoriesModels[t.getShallow("category")];return e&&(e.parentModel=t.parentModel,t.parentModel=e),t});var a=o.getModel("edgeLabel"),r=new wo({label:a.option},a.parentModel,e);i.wrapMethod("getItemModel",function(t){return t.customizeGetParent(n),t})}).data},getGraph:function(){return this.getData().graph},getEdgeData:function(){return this.getGraph().edgeData},getCategoriesData:function(){return this._categoriesData},formatTooltip:function(t,e,i){if("edge"===i){var n=this.getData(),o=this.getDataParams(t,i),a=n.graph.getEdgeByIndex(t),r=n.getName(a.node1.dataIndex),s=n.getName(a.node2.dataIndex),l=[];return null!=r&&l.push(r),null!=s&&l.push(s),l=Zo(l.join(" > ")),o.value&&(l+=" : "+Zo(o.value)),l}return PA.superApply(this,"formatTooltip",arguments)},_updateCategoriesData:function(){var t=f(this.option.categories||[],function(t){return null!=t.value?t:a({value:0},t)}),e=new DI(["value"],this);e.initData(t),this._categoriesData=e,this._categoriesModels=e.mapArray(function(t){return e.getItemModel(t,!0)})},setZoom:function(t){this.option.zoom=t},setCenter:function(t){this.option.center=t},isAnimationEnabled:function(){return PA.superCall(this,"isAnimationEnabled")&&!("force"===this.get("layout")&&this.get("force.layoutAnimation"))},defaultOption:{zlevel:0,z:2,coordinateSystem:"view",legendHoverLink:!0,hoverAnimation:!0,layout:null,focusNodeAdjacency:!1,circular:{rotateLabel:!1},force:{initLayout:null,repulsion:[0,50],gravity:.1,edgeLength:30,layoutAnimation:!0},left:"center",top:"center",symbol:"circle",symbolSize:10,edgeSymbol:["none","none"],edgeSymbolSize:10,edgeLabel:{position:"middle"},draggable:!1,roam:!1,center:null,zoom:1,nodeScaleRatio:.6,label:{show:!1,formatter:"{b}"},itemStyle:{},lineStyle:{color:"#aaa",width:1,curveness:0,opacity:.5},emphasis:{label:{show:!0}}}}),NA=Xb.prototype,OA=qb.prototype,EA=En({type:"ec-line",style:{stroke:"#000",fill:null},shape:{x1:0,y1:0,x2:0,y2:0,percent:1,cpx1:null,cpy1:null},buildPath:function(t,e){(Zc(e)?NA:OA).buildPath(t,e)},pointAt:function(t){return Zc(this.shape)?NA.pointAt.call(this,t):OA.pointAt.call(this,t)},tangentAt:function(t){var e=this.shape,i=Zc(e)?[e.x2-e.x1,e.y2-e.y1]:OA.tangentAt.call(this,t);return q(i,i)}}),zA=["fromSymbol","toSymbol"],RA=qc.prototype;RA.beforeUpdate=function(){var t=this,e=t.childOfName("fromSymbol"),i=t.childOfName("toSymbol"),n=t.childOfName("label");if(e||i||!n.ignore){for(var o=1,a=this.parent;a;)a.scale&&(o/=a.scale[0]),a=a.parent;var r=t.childOfName("line");if(this.__dirty||r.__dirty){var s=r.shape.percent,l=r.pointAt(0),u=r.pointAt(s),h=U([],u,l);if(q(h,h),e&&(e.attr("position",l),c=r.tangentAt(0),e.attr("rotation",Math.PI/2-Math.atan2(c[1],c[0])),e.attr("scale",[o*s,o*s])),i){i.attr("position",u);var c=r.tangentAt(1);i.attr("rotation",-Math.PI/2-Math.atan2(c[1],c[0])),i.attr("scale",[o*s,o*s])}if(!n.ignore){n.attr("position",u);var d,f,p,g=5*o;if("end"===n.__position)d=[h[0]*g+u[0],h[1]*g+u[1]],f=h[0]>.8?"left":h[0]<-.8?"right":"center",p=h[1]>.8?"top":h[1]<-.8?"bottom":"middle";else if("middle"===n.__position){var m=s/2,v=[(c=r.tangentAt(m))[1],-c[0]],y=r.pointAt(m);v[1]>0&&(v[0]=-v[0],v[1]=-v[1]),d=[y[0]+v[0]*g,y[1]+v[1]*g],f="center",p="bottom";var x=-Math.atan2(c[1],c[0]);u[0].8?"right":h[0]<-.8?"left":"center",p=h[1]>.8?"bottom":h[1]<-.8?"top":"middle";n.attr({style:{textVerticalAlign:n.__verticalAlign||p,textAlign:n.__textAlign||f},position:d,scale:[o,o]})}}}},RA._createLine=function(t,e,i){var n=t.hostModel,o=Xc(t.getItemLayout(e));o.shape.percent=0,po(o,{shape:{percent:1}},n,e),this.add(o);var a=new zb({name:"label"});this.add(a),d(zA,function(i){var n=jc(i,t,e);this.add(n),this[Uc(i)]=t.getItemVisual(e,i)},this),this._updateCommonStl(t,e,i)},RA.updateData=function(t,e,i){var n=t.hostModel,o=this.childOfName("line"),a=t.getItemLayout(e),r={shape:{}};Yc(r.shape,a),fo(o,r,n,e),d(zA,function(i){var n=t.getItemVisual(e,i),o=Uc(i);if(this[o]!==n){this.remove(this.childOfName(i));var a=jc(i,t,e);this.add(a)}this[o]=n},this),this._updateCommonStl(t,e,i)},RA._updateCommonStl=function(t,e,i){var n=t.hostModel,o=this.childOfName("line"),a=i&&i.lineStyle,s=i&&i.hoverLineStyle,l=i&&i.labelModel,u=i&&i.hoverLabelModel;if(!i||t.hasItemOption){var h=t.getItemModel(e);a=h.getModel("lineStyle").getLineStyle(),s=h.getModel("emphasis.lineStyle").getLineStyle(),l=h.getModel("label"),u=h.getModel("emphasis.label")}var c=t.getItemVisual(e,"color"),f=A(t.getItemVisual(e,"opacity"),a.opacity,1);o.useStyle(r({strokeNoScale:!0,fill:"none",stroke:c,opacity:f},a)),o.hoverStyle=s,d(zA,function(t){var e=this.childOfName(t);e&&(e.setColor(c),e.setStyle({opacity:f}))},this);var p,g,m,v=l.getShallow("show"),y=u.getShallow("show"),x=this.childOfName("label");if(v||y){if(p=c||"#000",null==(g=n.getFormattedLabel(e,"normal",t.dataType))){var _=n.getRawValue(e);g=null==_?t.getName(e):isFinite(_)?Ao(_):_}m=T(n.getFormattedLabel(e,"emphasis",t.dataType),g)}if(v){var w=no(x.style,l,{text:g},{autoColor:p});x.__textAlign=w.textAlign,x.__verticalAlign=w.textVerticalAlign,x.__position=l.get("position")||"middle"}else x.setStyle("text",null);x.hoverStyle=y?{text:m,textFill:u.getTextColor(!0),fontStyle:u.getShallow("fontStyle"),fontWeight:u.getShallow("fontWeight"),fontSize:u.getShallow("fontSize"),fontFamily:u.getShallow("fontFamily")}:{text:null},x.ignore=!v&&!y,eo(this)},RA.highlight=function(){this.trigger("emphasis")},RA.downplay=function(){this.trigger("normal")},RA.updateLayout=function(t,e){this.setLinePoints(t.getItemLayout(e))},RA.setLinePoints=function(t){var e=this.childOfName("line");Yc(e.shape,t),e.dirty()},u(qc,L_);var BA=$c.prototype;BA.isPersistent=function(){return!0},BA.updateData=function(t){var e=this,i=e.group,n=e._lineData;e._lineData=t,n||i.removeAll();var o=Qc(t);t.diff(n).add(function(i){Kc(e,t,i,o)}).update(function(i,a){Jc(e,n,t,a,i,o)}).remove(function(t){i.remove(n.getItemGraphicEl(t))}).execute()},BA.updateLayout=function(){var t=this._lineData;t.eachItemGraphicEl(function(e,i){e.updateLayout(t,i)},this)},BA.incrementalPrepareUpdate=function(t){this._seriesScope=Qc(t),this._lineData=null,this.group.removeAll()},BA.incrementalUpdate=function(t,e){for(var i=t.start;i=o/3?1:2),l=e.y-n(r)*a*(a>=o/3?1:2);r=e.angle-Math.PI/2,t.moveTo(s,l),t.lineTo(e.x+i(r)*a,e.y+n(r)*a),t.lineTo(e.x+i(e.angle)*o,e.y+n(e.angle)*o),t.lineTo(e.x-i(r)*a,e.y-n(r)*a),t.lineTo(s,l)}}),$A=2*Math.PI,KA=(pr.extend({type:"gauge",render:function(t,e,i){this.group.removeAll();var n=t.get("axisLine.lineStyle.color"),o=dd(t,i);this._renderMain(t,e,i,n,o)},dispose:function(){},_renderMain:function(t,e,i,n,o){for(var a=this.group,r=t.getModel("axisLine").getModel("lineStyle"),s=t.get("clockwise"),l=-t.get("startAngle")/180*Math.PI,u=-t.get("endAngle")/180*Math.PI,h=(u-l)%$A,c=l,d=r.get("width"),f=0;f=t&&(0===e?0:n[e-1][0]).4?"bottom":"middle",textAlign:T<-.4?"left":T>.4?"right":"center"},{autoColor:P}),silent:!0}))}if(g.get("show")&&D!==v){for(var N=0;N<=y;N++){var T=Math.cos(w),A=Math.sin(w),O=new Xb({shape:{x1:T*c+u,y1:A*c+h,x2:T*(c-_)+u,y2:A*(c-_)+h},silent:!0,style:I});"auto"===I.stroke&&O.setStyle({stroke:n((D+N/y)/v)}),l.add(O),w+=S}w-=S}else w+=b}},_renderPointer:function(t,e,i,n,o,a,r,s){var l=this.group,u=this._data;if(t.get("pointer.show")){var h=[+t.get("min"),+t.get("max")],c=[a,r],d=t.getData(),f=d.mapDimension("value");d.diff(u).add(function(e){var i=new qA({shape:{angle:a}});po(i,{shape:{angle:Do(d.get(f,e),h,c,!0)}},t),l.add(i),d.setItemGraphicEl(e,i)}).update(function(e,i){var n=u.getItemGraphicEl(i);fo(n,{shape:{angle:Do(d.get(f,e),h,c,!0)}},t),l.add(n),d.setItemGraphicEl(e,n)}).remove(function(t){var e=u.getItemGraphicEl(t);l.remove(e)}).execute(),d.eachItemGraphicEl(function(t,e){var i=d.getItemModel(e),a=i.getModel("pointer");t.setShape({x:o.cx,y:o.cy,width:To(a.get("width"),o.r),r:To(a.get("length"),o.r)}),t.useStyle(i.getModel("itemStyle").getItemStyle()),"auto"===t.style.fill&&t.setStyle("fill",n(Do(d.get(f,e),h,[0,1],!0))),eo(t,i.getModel("emphasis.itemStyle").getItemStyle())}),this._data=d}else u&&u.eachItemGraphicEl(function(t){l.remove(t)})},_renderTitle:function(t,e,i,n,o){var a=t.getData(),r=a.mapDimension("value"),s=t.getModel("title");if(s.get("show")){var l=s.get("offsetCenter"),u=o.cx+To(l[0],o.r),h=o.cy+To(l[1],o.r),c=+t.get("min"),d=+t.get("max"),f=n(Do(t.getData().get(r,0),[c,d],[0,1],!0));this.group.add(new zb({silent:!0,style:no({},s,{x:u,y:h,text:a.getName(0),textAlign:"center",textVerticalAlign:"middle"},{autoColor:f,forceRich:!0})}))}},_renderDetail:function(t,e,i,n,o){var a=t.getModel("detail"),r=+t.get("min"),s=+t.get("max");if(a.get("show")){var l=a.get("offsetCenter"),u=o.cx+To(l[0],o.r),h=o.cy+To(l[1],o.r),c=To(a.get("width"),o.r),d=To(a.get("height"),o.r),f=t.getData(),p=f.get(f.mapDimension("value"),0),g=n(Do(p,[r,s],[0,1],!0));this.group.add(new zb({silent:!0,style:no({},a,{x:u,y:h,text:fd(p,a.get("formatter")),textWidth:isNaN(c)?null:c,textHeight:isNaN(d)?null:d,textAlign:"center",textVerticalAlign:"middle"},{autoColor:g,forceRich:!0})}))}}}),ys({type:"series.funnel",init:function(t){KA.superApply(this,"init",arguments),this.legendDataProvider=function(){return this.getRawData()},this._defaultLabelLine(t)},getInitialData:function(t,e){return gT(this,["value"])},_defaultLabelLine:function(t){Mi(t,"labelLine",["show"]);var e=t.labelLine,i=t.emphasis.labelLine;e.show=e.show&&t.label.show,i.show=i.show&&t.emphasis.label.show},getDataParams:function(t){var e=this.getData(),i=KA.superCall(this,"getDataParams",t),n=e.mapDimension("value"),o=e.getSum(n);return i.percent=o?+(e.get(n,t)/o*100).toFixed(2):0,i.$vars.push("percent"),i},defaultOption:{zlevel:0,z:2,legendHoverLink:!0,left:80,top:60,right:80,bottom:60,minSize:"0%",maxSize:"100%",sort:"descending",gap:0,funnelAlign:"center",label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1,type:"solid"}},itemStyle:{borderColor:"#fff",borderWidth:1},emphasis:{label:{show:!0}}}})),JA=pd.prototype,QA=["itemStyle","opacity"];JA.updateData=function(t,e,i){var n=this.childAt(0),o=t.hostModel,a=t.getItemModel(e),s=t.getItemLayout(e),l=t.getItemModel(e).get(QA);l=null==l?1:l,n.useStyle({}),i?(n.setShape({points:s.points}),n.setStyle({opacity:0}),po(n,{style:{opacity:l}},o,e)):fo(n,{style:{opacity:l},shape:{points:s.points}},o,e);var u=a.getModel("itemStyle"),h=t.getItemVisual(e,"color");n.setStyle(r({lineJoin:"round",fill:h},u.getItemStyle(["opacity"]))),n.hoverStyle=u.getModel("emphasis").getItemStyle(),this._updateLabel(t,e),eo(this)},JA._updateLabel=function(t,e){var i=this.childAt(1),n=this.childAt(2),o=t.hostModel,a=t.getItemModel(e),r=t.getItemLayout(e).label,s=t.getItemVisual(e,"color");fo(i,{shape:{points:r.linePoints||r.linePoints}},o,e),fo(n,{style:{x:r.x,y:r.y}},o,e),n.attr({rotation:r.rotation,origin:[r.x,r.y],z2:10});var l=a.getModel("label"),u=a.getModel("emphasis.label"),h=a.getModel("labelLine"),c=a.getModel("emphasis.labelLine"),s=t.getItemVisual(e,"color");io(n.style,n.hoverStyle={},l,u,{labelFetcher:t.hostModel,labelDataIndex:e,defaultText:t.getName(e),autoColor:s,useInsideStyle:!!r.inside},{textAlign:r.textAlign,textVerticalAlign:r.verticalAlign}),n.ignore=n.normalIgnore=!l.get("show"),n.hoverIgnore=!u.get("show"),i.ignore=i.normalIgnore=!h.get("show"),i.hoverIgnore=!c.get("show"),i.setStyle({stroke:s}),i.setStyle(h.getModel("lineStyle").getLineStyle()),i.hoverStyle=c.getModel("lineStyle").getLineStyle()},u(pd,L_);pr.extend({type:"funnel",render:function(t,e,i){var n=t.getData(),o=this._data,a=this.group;n.diff(o).add(function(t){var e=new pd(n,t);n.setItemGraphicEl(t,e),a.add(e)}).update(function(t,e){var i=o.getItemGraphicEl(e);i.updateData(n,t),a.add(i),n.setItemGraphicEl(t,i)}).remove(function(t){var e=o.getItemGraphicEl(t);a.remove(e)}).execute(),this._data=n},remove:function(){this.group.removeAll(),this._data=null},dispose:function(){}});fs(_T("funnel")),ds(function(t,e,i){t.eachSeriesByType("funnel",function(t){var i=t.getData(),n=i.mapDimension("value"),o=t.get("sort"),a=gd(t,e),r=md(i,o),s=[To(t.get("minSize"),a.width),To(t.get("maxSize"),a.width)],l=i.getDataExtent(n),u=t.get("min"),h=t.get("max");null==u&&(u=Math.min(l[0],0)),null==h&&(h=l[1]);var c=t.get("funnelAlign"),d=t.get("gap"),f=(a.height-d*(i.count()-1))/i.count(),p=a.y,g=function(t,e){var o,r=Do(i.get(n,t)||0,[u,h],s,!0);switch(c){case"left":o=a.x;break;case"center":o=a.x+(a.width-r)/2;break;case"right":o=a.x+a.width-r}return[[o,e],[o+r,e]]};"ascending"===o&&(f=-f,d=-d,p+=a.height,r=r.reverse());for(var m=0;ma&&(e[1-n]=e[n]+h.sign*a),e},iC=d,nC=Math.min,oC=Math.max,aC=Math.floor,rC=Math.ceil,sC=Ao,lC=Math.PI;bd.prototype={type:"parallel",constructor:bd,_init:function(t,e,i){var n=t.dimensions,o=t.parallelAxisIndex;iC(n,function(t,i){var n=o[i],a=e.getComponent("parallelAxis",n),r=this._axesMap.set(t,new tC(t,cl(a),[0,0],a.get("type"),n)),s="category"===r.type;r.onBand=s&&a.get("boundaryGap"),r.inverse=a.get("inverse"),a.axis=r,r.model=a,r.coordinateSystem=a.coordinateSystem=this},this)},update:function(t,e){this._updateAxesFromSeries(this._model,t)},containPoint:function(t){var e=this._makeLayoutInfo(),i=e.axisBase,n=e.layoutBase,o=e.pixelDimIndex,a=t[1-o],r=t[o];return a>=i&&a<=i+e.axisLength&&r>=n&&r<=n+e.layoutLength},getModel:function(){return this._model},_updateAxesFromSeries:function(t,e){e.eachSeries(function(i){if(t.contains(i,e)){var n=i.getData();iC(this.dimensions,function(t){var e=this._axesMap.get(t);e.scale.unionExtentFromData(n,n.mapDimension(t)),hl(e.scale,e.model)},this)}},this)},resize:function(t,e){this._rect=Qo(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()}),this._layoutAxes()},getRect:function(){return this._rect},_makeLayoutInfo:function(){var t,e=this._model,i=this._rect,n=["x","y"],o=["width","height"],a=e.get("layout"),r="horizontal"===a?0:1,s=i[o[r]],l=[0,s],u=this.dimensions.length,h=Sd(e.get("axisExpandWidth"),l),c=Sd(e.get("axisExpandCount")||0,[0,u]),d=e.get("axisExpandable")&&u>3&&u>c&&c>1&&h>0&&s>0,f=e.get("axisExpandWindow");f?(t=Sd(f[1]-f[0],l),f[1]=f[0]+t):(t=Sd(h*(c-1),l),(f=[h*(e.get("axisExpandCenter")||aC(u/2))-t/2])[1]=f[0]+t);var p=(s-t)/(u-c);p<3&&(p=0);var g=[aC(sC(f[0]/h,1))+1,rC(sC(f[1]/h,1))-1],m=p/h*f[0];return{layout:a,pixelDimIndex:r,layoutBase:i[n[r]],layoutLength:s,axisBase:i[n[1-r]],axisLength:i[o[1-r]],axisExpandable:d,axisExpandWidth:h,axisCollapseWidth:p,axisExpandWindow:f,axisCount:u,winInnerIndices:g,axisExpandWindow0Pos:m}},_layoutAxes:function(){var t=this._rect,e=this._axesMap,i=this.dimensions,n=this._makeLayoutInfo(),o=n.layout;e.each(function(t){var e=[0,n.axisLength],i=t.inverse?1:0;t.setExtent(e[i],e[1-i])}),iC(i,function(i,a){var r=(n.axisExpandable?Id:Md)(a,n),s={horizontal:{x:r.position,y:n.axisLength},vertical:{x:0,y:r.position}},l={horizontal:lC/2,vertical:0},u=[s[o].x+t.x,s[o].y+t.y],h=l[o],c=st();dt(c,c,h),ct(c,c,u),this._axesLayout[i]={position:u,rotation:h,transform:c,axisNameAvailableWidth:r.axisNameAvailableWidth,axisLabelShow:r.axisLabelShow,nameTruncateMaxWidth:r.nameTruncateMaxWidth,tickDirection:1,labelDirection:1,labelInterval:e.get(i).getLabelInterval()}},this)},getAxis:function(t){return this._axesMap.get(t)},dataToPoint:function(t,e){return this.axisCoordToPoint(this._axesMap.get(e).dataToCoord(t),e)},eachActiveState:function(t,e,i){for(var n=this.dimensions,o=f(n,function(e){return t.mapDimension(e)}),a=this._axesMap,r=this.hasAxisBrushed(),s=0,l=t.count();so*(1-h[0])?(l="jump",r=s-o*(1-h[2])):(r=s-o*h[1])>=0&&(r=s-o*(1-h[1]))<=0&&(r=0),(r*=e.axisExpandWidth/u)?eC(r,n,a,"all"):l="none";else{o=n[1]-n[0];(n=[oC(0,a[1]*s/o-o/2)])[1]=nC(a[1],n[0]+o),n[0]=n[1]-o}return{axisExpandWindow:n,behavior:l}}},Ca.register("parallel",{create:function(t,e){var i=[];return t.eachComponent("parallel",function(n,o){var a=new bd(n,t,e);a.name="parallel_"+o,a.resize(n,e),n.coordinateSystem=a,a.model=n,i.push(a)}),t.eachSeries(function(e){if("parallel"===e.get("coordinateSystem")){var i=t.queryComponents({mainType:"parallel",index:e.get("parallelIndex"),id:e.get("parallelId")})[0];e.coordinateSystem=i.coordinateSystem}}),i}});var uC=kS.extend({type:"baseParallelAxis",axis:null,activeIntervals:[],getAreaSelectStyle:function(){return Lw([["fill","color"],["lineWidth","borderWidth"],["stroke","borderColor"],["width","width"],["opacity","opacity"]])(this.getModel("areaSelectStyle"))},setActiveIntervals:function(t){var e=this.activeIntervals=i(t);if(e)for(var n=e.length-1;n>=0;n--)Co(e[n])},getActiveState:function(t){var e=this.activeIntervals;if(!e.length)return"normal";if(null==t)return"inactive";for(var i=0,n=e.length;i5)return;var n=this._model.coordinateSystem.getSlidedAxisExpandWindow([t.offsetX,t.offsetY]);"none"!==n.behavior&&this._dispatchExpand({axisExpandWindow:n.axisExpandWindow})}this._mouseDownPoint=null},mousemove:function(t){if(!this._mouseDownPoint&&gf(this,"mousemove")){var e=this._model,i=e.coordinateSystem.getSlidedAxisExpandWindow([t.offsetX,t.offsetY]),n=i.behavior;"jump"===n&&this._throttledDispatchExpand.debounceNextCall(e.get("axisExpandDebounce")),this._throttledDispatchExpand("none"===n?null:{axisExpandWindow:i.axisExpandWindow,animation:"jump"===n&&null})}}};ls(function(t){yd(t),xd(t)}),mM.extend({type:"series.parallel",dependencies:["parallel"],visualColorAccessPath:"lineStyle.color",getInitialData:function(t,e){this.option.progressive&&(this.option.animation=!1);var i=this.getSource();return mf(i,this),Hs(i,this)},getRawIndicesByActiveState:function(t){var e=this.coordinateSystem,i=this.getData(),n=[];return e.eachActiveState(i,function(e,o){t===e&&n.push(i.getRawIndex(o))}),n},defaultOption:{zlevel:0,z:2,coordinateSystem:"parallel",parallelIndex:0,label:{show:!1},inactiveOpacity:.05,activeOpacity:1,lineStyle:{width:1,opacity:.45,type:"solid"},emphasis:{label:{show:!1}},progressive:!1,smooth:!1,animationEasing:"linear"}});pr.extend({type:"parallel",init:function(){this._dataGroup=new L_,this.group.add(this._dataGroup),this._data},render:function(t,e,i,n){this._renderForNormal(t,n)},dispose:function(){},_renderForNormal:function(t,e){var i=this._dataGroup,n=t.getData(),o=this._data,a=t.coordinateSystem,r=a.dimensions,s=t.option.smooth?.3:null;if(n.diff(o).add(function(t){_f(n,i,t,r,a)}).update(function(i,s){var l=o.getItemGraphicEl(s),u=xf(n,i,r,a);n.setItemGraphicEl(i,l),fo(l,{shape:{points:u}},e&&!1===e.animation?null:t,i)}).remove(function(t){var e=o.getItemGraphicEl(t);i.remove(e)}).execute(),wf(n,s),!this._data){var l=yf(a,t,function(){setTimeout(function(){i.removeClipPath()})});i.setClipPath(l)}this._data=n},remove:function(){this._dataGroup&&this._dataGroup.removeAll(),this._data=null}});var LC=["lineStyle","normal","opacity"];fs(function(t){t.eachSeriesByType("parallel",function(e){var i=e.getModel("itemStyle"),n=e.getModel("lineStyle"),o=t.get("color"),a=n.get("color")||i.get("color")||o[e.seriesIndex%o.length],r=e.get("inactiveOpacity"),s=e.get("activeOpacity"),l=e.getModel("lineStyle").getLineStyle(),u=e.coordinateSystem,h=e.getData(),c={normal:l.opacity,active:s,inactive:r};u.eachActiveState(h,function(t,e){var i=h.getItemModel(e),n=c[t];if("normal"===t){var o=i.get(LC,!0);null!=o&&(n=o)}h.setItemVisual(e,"opacity",n)}),h.setVisual("color",a)})});var kC=mM.extend({type:"series.sankey",layoutInfo:null,getInitialData:function(t){var e=t.edges||t.links,i=t.data||t.nodes;if(i&&e)return kA(i,e,this,!0).data},getGraph:function(){return this.getData().graph},getEdgeData:function(){return this.getGraph().edgeData},formatTooltip:function(t,e,i){if("edge"===i){var n=this.getDataParams(t,i),o=n.data,a=o.source+" -- "+o.target;return n.value&&(a+=" : "+n.value),Zo(a)}return kC.superCall(this,"formatTooltip",t,e)},defaultOption:{zlevel:0,z:2,coordinateSystem:"view",layout:null,left:"5%",top:"5%",right:"20%",bottom:"5%",nodeWidth:20,nodeGap:8,layoutIterations:32,label:{show:!0,position:"right",color:"#000",fontSize:12},itemStyle:{borderWidth:1,borderColor:"#333"},lineStyle:{color:"#314656",opacity:.2,curveness:.5},emphasis:{label:{show:!0},lineStyle:{opacity:.6}},animationEasing:"linear",animationDuration:1e3}}),PC=En({shape:{x1:0,y1:0,x2:0,y2:0,cpx1:0,cpy1:0,cpx2:0,cpy2:0,extent:0},buildPath:function(t,e){var i=e.extent/2;t.moveTo(e.x1,e.y1-i),t.bezierCurveTo(e.cpx1,e.cpy1-i,e.cpx2,e.cpy2-i,e.x2,e.y2-i),t.lineTo(e.x2,e.y2+i),t.bezierCurveTo(e.cpx2,e.cpy2+i,e.cpx1,e.cpy1+i,e.x1,e.y1+i),t.closePath()}});xs({type:"sankey",_model:null,render:function(t,e,i){var n=t.getGraph(),o=this.group,a=t.layoutInfo,r=t.getData(),s=t.getData("edge");this._model=t,o.removeAll(),o.attr("position",[a.x,a.y]),n.eachEdge(function(e){var i=new PC;i.dataIndex=e.dataIndex,i.seriesIndex=t.seriesIndex,i.dataType="edge";var n=e.getModel("lineStyle"),a=n.get("curveness"),r=e.node1.getLayout(),l=e.node2.getLayout(),u=e.getLayout();i.shape.extent=Math.max(1,u.dy);var h=r.x+r.dx,c=r.y+u.sy+u.dy/2,d=l.x,f=l.y+u.ty+u.dy/2,p=h*(1-a)+d*a,g=c,m=h*a+d*(1-a),v=f;switch(i.setShape({x1:h,y1:c,x2:d,y2:f,cpx1:p,cpy1:g,cpx2:m,cpy2:v}),i.setStyle(n.getItemStyle()),i.style.fill){case"source":i.style.fill=e.node1.getVisual("color");break;case"target":i.style.fill=e.node2.getVisual("color")}eo(i,e.getModel("emphasis.lineStyle").getItemStyle()),o.add(i),s.setItemGraphicEl(e.dataIndex,i)}),n.eachNode(function(e){var i=e.getLayout(),n=e.getModel(),a=n.getModel("label"),s=n.getModel("emphasis.label"),l=new jb({shape:{x:i.x,y:i.y,width:e.getLayout().dx,height:e.getLayout().dy},style:n.getModel("itemStyle").getItemStyle()}),u=e.getModel("emphasis.itemStyle").getItemStyle();io(l.style,u,a,s,{labelFetcher:t,labelDataIndex:e.dataIndex,defaultText:e.id,isRectText:!0}),l.setStyle("fill",e.getVisual("color")),eo(l,u),o.add(l),r.setItemGraphicEl(e.dataIndex,l),l.dataType="node"}),!this._data&&t.get("animation")&&o.setClipPath(Sf(o.getBoundingRect(),t,function(){o.removeClipPath()})),this._data=t.getData()},dispose:function(){}});ds(function(t,e,i){t.eachSeriesByType("sankey",function(t){var i=t.get("nodeWidth"),n=t.get("nodeGap"),o=If(t,e);t.layoutInfo=o;var a=o.width,r=o.height,s=t.getGraph(),l=s.nodes,u=s.edges;Tf(l),Df(l,u,i,n,a,r,0!==g(l,function(t){return 0===t.getLayout().value}).length?0:t.get("layoutIterations"))})}),fs(function(t,e){t.eachSeriesByType("sankey",function(t){var e=t.getGraph().nodes;e.sort(function(t,e){return t.getLayout().value-e.getLayout().value});var i=e[0].getLayout().value,n=e[e.length-1].getLayout().value;d(e,function(e){var o=new fA({type:"color",mappingMethod:"linear",dataExtent:[i,n],visual:t.get("color")}).mapValueToVisual(e.getLayout().value);e.setVisual("color",o);var a=e.getModel().get("itemStyle.color");null!=a&&e.setVisual("color",a)})})});var NC=In.extend({type:"whiskerInBox",shape:{},buildPath:function(t,e){for(var i in e)if(e.hasOwnProperty(i)&&0===i.indexOf("ends")){var n=e[i];t.moveTo(n[0][0],n[0][1]),t.lineTo(n[1][0],n[1][1])}}}),OC=jf.prototype;OC._createContent=function(t,e,i){var n=t.getItemLayout(e),o="horizontal"===n.chartLayout?1:0,a=0;this.add(new Zb({shape:{points:i?Xf(n.bodyEnds,o,n):n.bodyEnds},style:{strokeNoScale:!0},z2:100})),this.bodyIndex=a++;var r=f(n.whiskerEnds,function(t){return i?Xf(t,o,n):t});this.add(new NC({shape:Yf(r),style:{strokeNoScale:!0},z2:100})),this.whiskerIndex=a++},OC.updateData=function(t,e,i){var n=this._seriesModel=t.hostModel,o=t.getItemLayout(e),a=sS[i?"initProps":"updateProps"];a(this.childAt(this.bodyIndex),{shape:{points:o.bodyEnds}},n,e),a(this.childAt(this.whiskerIndex),{shape:Yf(o.whiskerEnds)},n,e),this.styleUpdater.call(null,this,t,e)},u(jf,L_);var EC=qf.prototype;EC.updateData=function(t){var e=this.group,i=this._data,n=this.styleUpdater;this._data||e.removeAll(),t.diff(i).add(function(i){if(t.hasValue(i)){var o=new jf(t,i,n,!0);t.setItemGraphicEl(i,o),e.add(o)}}).update(function(o,a){var r=i.getItemGraphicEl(a);t.hasValue(o)?(r?r.updateData(t,o):r=new jf(t,o,n),e.add(r),t.setItemGraphicEl(o,r)):e.remove(r)}).remove(function(t){var n=i.getItemGraphicEl(t);n&&e.remove(n)}).execute(),this._data=t},EC.incrementalPrepareUpdate=function(t,e,i){this.group.removeAll(),this._data=null},EC.incrementalUpdate=function(t,e,i,n){for(var o=e.getData(),a=t.start;a0?jC:XC),borderColor:e.get(n>0?ZC:UC)})})})}),ds(function(t){t.eachSeriesByType("candlestick",function(t){var e,i=t.coordinateSystem,n=t.getData(),o=ep(t,n),a=t.get("layout"),r="horizontal"===a?0:1,s=1-r,l=["x","y"],u=[];if(d(n.dimensions,function(t){var i=n.getDimensionInfo(t).coordDim;i===l[s]?u.push(t):i===l[r]&&(e=t)}),!(null==e||u.length<4)){var h=0;n.each([e].concat(u),function(){function t(t){var e=[];return e[r]=d,e[s]=t,isNaN(d)||isNaN(t)?[NaN,NaN]:i.dataToPoint(e)}function e(t,e){var i=t.slice(),n=t.slice();i[r]=Wn(i[r]+o/2,1,!1),n[r]=Wn(n[r]-o/2,1,!0),e?M.push(i,n):M.push(n,i)}function l(t){return t[r]=Wn(t[r],1),t}var c=arguments,d=c[0],f=c[u.length+1],p=c[1],g=c[2],m=c[3],v=c[4],y=Math.min(p,g),x=Math.max(p,g),_=t(y),w=t(x),b=t(m),S=[[l(t(v)),l(w)],[l(b),l(_)]],M=[];e(w,0),e(_,1);var I;I=p>g?-1:p0?n.getItemModel(h-1).get()[2]<=g?1:-1:1,n.setItemLayout(f,{chartLayout:a,sign:I,initBaseline:p>g?w[s]:_[s],bodyEnds:M,whiskerEnds:S,brushRect:function(){var e=t(Math.min(p,g,m,v)),i=t(Math.max(p,g,m,v));return e[r]-=o/2,i[r]-=o/2,{x:e[0],y:e[1],width:s?o:i[0]-e[0],height:s?i[1]-e[1]:o}}()}),++h})}})}),mM.extend({type:"series.effectScatter",dependencies:["grid","polar"],getInitialData:function(t,e){return Hs(this.getSource(),this)},brushSelector:"point",defaultOption:{coordinateSystem:"cartesian2d",zlevel:0,z:2,legendHoverLink:!0,effectType:"ripple",progressive:0,showEffectOn:"render",rippleEffect:{period:4,scale:2.5,brushType:"fill"},symbolSize:10}});var qC=op.prototype;qC.stopEffectAnimation=function(){this.childAt(1).removeAll()},qC.startEffectAnimation=function(t){for(var e=t.symbolType,i=t.color,n=this.childAt(1),o=0;o<3;o++){var a=ml(e,-1,-1,2,2,i);a.attr({style:{strokeNoScale:!0},z2:99,silent:!0,scale:[.5,.5]});var r=-o/3*t.period+t.effectOffset;a.animate("",!0).when(t.period,{scale:[t.rippleScale/2,t.rippleScale/2]}).delay(r).start(),a.animateStyle(!0).when(t.period,{opacity:0}).delay(r).start(),n.add(a)}np(n,t)},qC.updateEffectAnimation=function(t){for(var e=this._effectCfg,i=this.childAt(1),n=["symbolType","period","rippleScale"],o=0;o "))},preventIncremental:function(){return!!this.get("effect.show")},getProgressive:function(){var t=this.option.progressive;return null==t?this.option.large?1e4:this.get("progressive"):t},getProgressiveThreshold:function(){var t=this.option.progressiveThreshold;return null==t?this.option.large?2e4:this.get("progressiveThreshold"):t},defaultOption:{coordinateSystem:"geo",zlevel:0,z:2,legendHoverLink:!0,hoverAnimation:!0,xAxisIndex:0,yAxisIndex:0,symbol:["none","none"],symbolSize:[10,10],geoIndex:0,effect:{show:!1,period:4,constantSpeed:0,symbol:"circle",symbolSize:3,loop:!0,trailLength:.2},large:!1,largeThreshold:2e3,polyline:!1,label:{show:!1,position:"end"},lineStyle:{opacity:.5}}}),tL=rp.prototype;tL.createLine=function(t,e,i){return new qc(t,e,i)},tL._updateEffectSymbol=function(t,e){var i=t.getItemModel(e).getModel("effect"),n=i.get("symbolSize"),o=i.get("symbol");y(n)||(n=[n,n]);var a=i.get("color")||t.getItemVisual(e,"color"),r=this.childAt(1);this._symbolType!==o&&(this.remove(r),(r=ml(o,-.5,-.5,1,1,a)).z2=100,r.culling=!0,this.add(r)),r&&(r.setStyle("shadowColor",a),r.setStyle(i.getItemStyle(["color"])),r.attr("scale",n),r.setColor(a),r.attr("scale",n),this._symbolType=o,this._updateEffectAnimation(t,i,e))},tL._updateEffectAnimation=function(t,e,i){var n=this.childAt(1);if(n){var o=this,a=t.getItemLayout(i),r=1e3*e.get("period"),s=e.get("loop"),l=e.get("constantSpeed"),u=D(e.get("delay"),function(e){return e/t.count()*r/3}),h="function"==typeof u;if(n.ignore=!0,this.updateAnimationPoints(n,a),l>0&&(r=this.getLineLength(n)/l*1e3),r!==this._period||s!==this._loop){n.stopAnimation();var c=u;h&&(c=u(i)),n.__t>0&&(c=-r*n.__t),n.__t=0;var d=n.animate("",s).when(r,{__t:1}).delay(c).during(function(){o.updateSymbolPosition(n)});s||d.done(function(){o.remove(n)}),d.start()}this._period=r,this._loop=s}},tL.getLineLength=function(t){return jx(t.__p1,t.__cp1)+jx(t.__cp1,t.__p2)},tL.updateAnimationPoints=function(t,e){t.__p1=e[0],t.__p2=e[1],t.__cp1=e[2]||[(e[0][0]+e[1][0])/2,(e[0][1]+e[1][1])/2]},tL.updateData=function(t,e,i){this.childAt(0).updateData(t,e,i),this._updateEffectSymbol(t,e)},tL.updateSymbolPosition=function(t){var e=t.__p1,i=t.__p2,n=t.__cp1,o=t.__t,a=t.position,r=Qi,s=tn;a[0]=r(e[0],n[0],i[0],o),a[1]=r(e[1],n[1],i[1],o);var l=s(e[0],n[0],i[0],o),u=s(e[1],n[1],i[1],o);t.rotation=-Math.atan2(u,l)-Math.PI/2,t.ignore=!1},tL.updateLayout=function(t,e){this.childAt(0).updateLayout(t,e);var i=t.getItemModel(e).getModel("effect");this._updateEffectAnimation(t,i,e)},u(rp,L_);var eL=sp.prototype;eL._createPolyline=function(t,e,i){var n=t.getItemLayout(e),o=new Ub({shape:{points:n}});this.add(o),this._updateCommonStl(t,e,i)},eL.updateData=function(t,e,i){var n=t.hostModel;fo(this.childAt(0),{shape:{points:t.getItemLayout(e)}},n,e),this._updateCommonStl(t,e,i)},eL._updateCommonStl=function(t,e,i){var n=this.childAt(0),o=t.getItemModel(e),a=t.getItemVisual(e,"color"),s=i&&i.lineStyle,l=i&&i.hoverLineStyle;i&&!t.hasItemOption||(s=o.getModel("lineStyle").getLineStyle(),l=o.getModel("emphasis.lineStyle").getLineStyle()),n.useStyle(r({strokeNoScale:!0,fill:"none",stroke:a},s)),n.hoverStyle=l,eo(this)},eL.updateLayout=function(t,e){this.childAt(0).setShape("points",t.getItemLayout(e))},u(sp,L_);var iL=lp.prototype;iL.createLine=function(t,e,i){return new sp(t,e,i)},iL.updateAnimationPoints=function(t,e){this._points=e;for(var i=[0],n=0,o=1;o=0&&!(n[r]<=e);r--);r=Math.min(r,o-2)}else{for(var r=a;re);r++);r=Math.min(r-1,o-2)}J(t.position,i[r],i[r+1],(e-n[r])/(n[r+1]-n[r]));var s=i[r+1][0]-i[r][0],l=i[r+1][1]-i[r][1];t.rotation=-Math.atan2(l,s)-Math.PI/2,this._lastFrame=r,this._lastFramePercent=e,t.ignore=!1}},u(lp,rp);var nL=En({shape:{polyline:!1,curveness:0,segs:[]},buildPath:function(t,e){var i=e.segs,n=e.curveness;if(e.polyline)for(r=0;r0){t.moveTo(i[r++],i[r++]);for(var a=1;a0){var c=(s+u)/2-(l-h)*n,d=(l+h)/2-(u-s)*n;t.quadraticCurveTo(c,d,u,h)}else t.lineTo(u,h)}},findDataIndex:function(t,e){var i=this.shape,n=i.segs,o=i.curveness;if(i.polyline)for(var a=0,r=0;r0)for(var l=n[r++],u=n[r++],h=1;h0){if(fn(l,u,(l+c)/2-(u-d)*o,(u+d)/2-(c-l)*o,c,d))return a}else if(cn(l,u,c,d))return a;a++}return-1}}),oL=up.prototype;oL.isPersistent=function(){return!this._incremental},oL.updateData=function(t){this.group.removeAll();var e=new nL({rectHover:!0,cursor:"default"});e.setShape({segs:t.getLayout("linesPoints")}),this._setCommon(e,t),this.group.add(e),this._incremental=null},oL.incrementalPrepareUpdate=function(t){this.group.removeAll(),this._clearIncremental(),t.count()>5e5?(this._incremental||(this._incremental=new On({silent:!0})),this.group.add(this._incremental)):this._incremental=null},oL.incrementalUpdate=function(t,e){var i=new nL;i.setShape({segs:e.getLayout("linesPoints")}),this._setCommon(i,e,!!this._incremental),this._incremental?this._incremental.addDisplayable(i,!0):(i.rectHover=!0,i.cursor="default",i.__startIndex=t.start,this.group.add(i))},oL.remove=function(){this._clearIncremental(),this._incremental=null,this.group.removeAll()},oL._setCommon=function(t,e,i){var n=e.hostModel;t.setShape({polyline:n.get("polyline"),curveness:n.get("lineStyle.curveness")}),t.useStyle(n.getModel("lineStyle").getLineStyle()),t.style.strokeNoScale=!0;var o=e.getVisual("color");o&&t.setStyle("stroke",o),t.setStyle("fill"),i||(t.seriesIndex=n.seriesIndex,t.on("mousemove",function(e){t.dataIndex=null;var i=t.findDataIndex(e.offsetX,e.offsetY);i>0&&(t.dataIndex=i+t.__startIndex)}))},oL._clearIncremental=function(){var t=this._incremental;t&&t.clearDisplaybles()};var aL={seriesType:"lines",plan:xM(),reset:function(t){var e=t.coordinateSystem,i=t.get("polyline"),n=t.pipelineContext.large;return{progress:function(o,a){var r=[];if(n){var s,l=o.end-o.start;if(i){for(var u=0,h=o.start;h0){var I=a(v)?s:l;v>0&&(v=v*S+b),x[_++]=I[M],x[_++]=I[M+1],x[_++]=I[M+2],x[_++]=I[M+3]*v*256}else _+=4}return c.putImageData(y,0,0),h},_getBrush:function(){var t=this._brushCanvas||(this._brushCanvas=Vx()),e=this.pointSize+this.blurSize,i=2*e;t.width=i,t.height=i;var n=t.getContext("2d");return n.clearRect(0,0,i,i),n.shadowOffsetX=i,n.shadowBlur=this.blurSize,n.shadowColor="#000",n.beginPath(),n.arc(-e,e,this.pointSize,0,2*Math.PI,!0),n.closePath(),n.fill(),t},_getGradient:function(t,e,i){for(var n=this._gradientPixels,o=n[i]||(n[i]=new Uint8ClampedArray(1024)),a=[0,0,0,0],r=0,s=0;s<256;s++)e[i](s/255,!0,a),o[r++]=a[0],o[r++]=a[1],o[r++]=a[2],o[r++]=a[3];return o}},xs({type:"heatmap",render:function(t,e,i){var n;e.eachComponent("visualMap",function(e){e.eachTargetSeries(function(i){i===t&&(n=e)})}),this.group.removeAll(),this._incrementalDisplayable=null;var o=t.coordinateSystem;"cartesian2d"===o.type||"calendar"===o.type?this._renderOnCartesianAndCalendar(t,i,0,t.getData().count()):pp(o)&&this._renderOnGeo(o,t,n,i)},incrementalPrepareRender:function(t,e,i){this.group.removeAll()},incrementalRender:function(t,e,i,n){e.coordinateSystem&&this._renderOnCartesianAndCalendar(e,n,t.start,t.end,!0)},_renderOnCartesianAndCalendar:function(t,e,i,n,o){var r,s,l=t.coordinateSystem;if("cartesian2d"===l.type){var u=l.getAxis("x"),h=l.getAxis("y");r=u.getBandWidth(),s=h.getBandWidth()}for(var c=this.group,d=t.getData(),f=t.getModel("itemStyle").getItemStyle(["color"]),p=t.getModel("emphasis.itemStyle").getItemStyle(),g=t.getModel("label"),m=t.getModel("emphasis.label"),v=l.type,y="cartesian2d"===v?[d.mapDimension("x"),d.mapDimension("y"),d.mapDimension("value")]:[d.mapDimension("time"),d.mapDimension("value")],x=i;x=e.y&&t[1]<=e.y+e.height:i.contain(i.toLocalCoord(t[1]))&&t[0]>=e.y&&t[0]<=e.y+e.height},pointToData:function(t){var e=this.getAxis();return[e.coordToData(e.toLocalCoord(t["horizontal"===e.orient?0:1]))]},dataToPoint:function(t){var e=this.getAxis(),i=this.getRect(),n=[],o="horizontal"===e.orient?0:1;return t instanceof Array&&(t=t[0]),n[o]=e.toGlobalCoord(e.dataToCoord(+t)),n[1-o]=0===o?i.y+i.height/2:i.x+i.width/2,n}},Ca.register("single",{create:function(t,e){var i=[];return t.eachComponent("singleAxis",function(n,o){var a=new Bp(n,t,e);a.name="single_"+o,a.resize(n,e),n.coordinateSystem=a,i.push(a)}),t.eachSeries(function(e){if("singleAxis"===e.get("coordinateSystem")){var i=t.queryComponents({mainType:"singleAxis",index:e.get("singleAxisIndex"),id:e.get("singleAxisId")})[0];e.coordinateSystem=i&&i.coordinateSystem}}),i},dimensions:Bp.prototype.dimensions});var fL=qD.getInterval,pL=qD.ifIgnoreOnTick,gL=["axisLine","axisTickLabel","axisName"],mL=iT.extend({type:"singleAxis",axisPointerClass:"SingleAxisPointer",render:function(t,e,i,n){var o=this.group;o.removeAll();var a=Vp(t),r=new qD(t,a);d(gL,r.add,r),o.add(r.getGroup()),t.get("splitLine.show")&&this._splitLine(t,a.labelInterval),mL.superCall(this,"render",t,e,i,n)},_splitLine:function(t,e){var i=t.axis;if(!i.scale.isBlank()){var n=t.getModel("splitLine"),o=n.getModel("lineStyle"),a=o.get("width"),r=o.get("color"),s=fL(n,e);r=r instanceof Array?r:[r];for(var l=t.coordinateSystem.getRect(),u=i.isHorizontal(),h=[],c=0,d=i.getTicksCoords(),f=[],p=[],g=t.get("axisLabel.showMinLabel"),m=t.get("axisLabel.showMaxLabel"),v=0;v=0)&&i({type:"updateAxisPointer",currTrigger:t,x:e&&e.offsetX,y:e&&e.offsetY})})},remove:function(t,e){ig(e.getZr(),"axisPointer"),IL.superApply(this._model,"remove",arguments)},dispose:function(t,e){ig("axisPointer",e),IL.superApply(this._model,"dispose",arguments)}}),DL=Ni(),TL=i,AL=m;(ng.prototype={_group:null,_lastGraphicKey:null,_handle:null,_dragging:!1,_lastValue:null,_lastStatus:null,_payloadInfo:null,animationThreshold:15,render:function(t,e,i,n){var o=e.get("value"),a=e.get("status");if(this._axisModel=t,this._axisPointerModel=e,this._api=i,n||this._lastValue!==o||this._lastStatus!==a){this._lastValue=o,this._lastStatus=a;var r=this._group,s=this._handle;if(!a||"hide"===a)return r&&r.hide(),void(s&&s.hide());r&&r.show(),s&&s.show();var l={};this.makeElOption(l,o,t,e,i);var u=l.graphicKey;u!==this._lastGraphicKey&&this.clear(i),this._lastGraphicKey=u;var h=this._moveAnimation=this.determineAnimation(t,e);if(r){var c=v(og,e,h);this.updatePointerEl(r,l,c,e),this.updateLabelEl(r,l,c,e)}else r=this._group=new L_,this.createPointerEl(r,l,t,e),this.createLabelEl(r,l,t,e),i.getZr().add(r);lg(r,e,!0),this._renderHandle(o)}},remove:function(t){this.clear(t)},dispose:function(t){this.clear(t)},determineAnimation:function(t,e){var i=e.get("animation"),n=t.axis,o="category"===n.type,a=e.get("snap");if(!a&&!o)return!1;if("auto"===i||null==i){var r=this.animationThreshold;if(o&&n.getBandWidth()>r)return!0;if(a){var s=Iu(t).seriesDataCount,l=n.getExtent();return Math.abs(l[0]-l[1])/s>r}return!1}return!0===i},makeElOption:function(t,e,i,n,o){},createPointerEl:function(t,e,i,n){var o=e.pointer;if(o){var a=DL(t).pointerEl=new sS[o.type](TL(e.pointer));t.add(a)}},createLabelEl:function(t,e,i,n){if(e.label){var o=DL(t).labelEl=new jb(TL(e.label));t.add(o),rg(o,n)}},updatePointerEl:function(t,e,i){var n=DL(t).pointerEl;n&&(n.setStyle(e.pointer.style),i(n,{shape:e.pointer.shape}))},updateLabelEl:function(t,e,i,n){var o=DL(t).labelEl;o&&(o.setStyle(e.label.style),i(o,{shape:e.label.shape,position:e.label.position}),rg(o,n))},_renderHandle:function(t){if(!this._dragging&&this.updateHandleTransform){var e=this._axisPointerModel,i=this._api.getZr(),n=this._handle,o=e.getModel("handle"),a=e.get("status");if(!o.get("show")||!a||"hide"===a)return n&&i.remove(n),void(this._handle=null);var r;this._handle||(r=!0,n=this._handle=_o(o.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(t){rw(t.event)},onmousedown:AL(this._onHandleDragMove,this,0,0),drift:AL(this._onHandleDragMove,this),ondragend:AL(this._onHandleDragEnd,this)}),i.add(n)),lg(n,e,!1);var s=["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"];n.setStyle(o.getItemStyle(null,s));var l=o.get("size");y(l)||(l=[l,l]),n.attr("scale",[l[0]/2,l[1]/2]),_r(this,"_doDispatchAxisPointer",o.get("throttle")||0,"fixRate"),this._moveHandleToValue(t,r)}},_moveHandleToValue:function(t,e){og(this._axisPointerModel,!e&&this._moveAnimation,this._handle,sg(this.getHandleTransform(t,this._axisModel,this._axisPointerModel)))},_onHandleDragMove:function(t,e){var i=this._handle;if(i){this._dragging=!0;var n=this.updateHandleTransform(sg(i),[t,e],this._axisModel,this._axisPointerModel);this._payloadInfo=n,i.stopAnimation(),i.attr(sg(n)),DL(i).lastProp=null,this._doDispatchAxisPointer()}},_doDispatchAxisPointer:function(){if(this._handle){var t=this._payloadInfo,e=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:t.cursorPoint[0],y:t.cursorPoint[1],tooltipOption:t.tooltipOption,axesInfo:[{axisDim:e.axis.dim,axisIndex:e.componentIndex}]})}},_onHandleDragEnd:function(t){if(this._dragging=!1,this._handle){var e=this._axisPointerModel.get("value");this._moveHandleToValue(e),this._api.dispatchAction({type:"hideTip"})}},getHandleTransform:null,updateHandleTransform:null,clear:function(t){this._lastValue=null,this._lastStatus=null;var e=t.getZr(),i=this._group,n=this._handle;e&&i&&(this._lastGraphicKey=null,i&&e.remove(i),n&&e.remove(n),this._group=null,this._handle=null,this._payloadInfo=null)},doClear:function(){},buildLabel:function(t,e,i){return i=i||0,{x:t[i],y:t[1-i],width:e[i],height:e[1-i]}}}).constructor=ng,Gi(ng);var CL=ng.extend({makeElOption:function(t,e,i,n,o){var a=i.axis,r=a.grid,s=n.get("type"),l=yg(r,a).getOtherAxis(a).getGlobalExtent(),u=a.toGlobalCoord(a.dataToCoord(e,!0));if(s&&"none"!==s){var h=ug(n),c=LL[s](a,u,l,h);c.style=h,t.graphicKey=c.type,t.pointer=c}pg(e,t,ku(r.model,i),i,n,o)},getHandleTransform:function(t,e,i){var n=ku(e.axis.grid.model,e,{labelInside:!1});return n.labelMargin=i.get("handle.margin"),{position:fg(e.axis,t,n),rotation:n.rotation+(n.labelDirection<0?Math.PI:0)}},updateHandleTransform:function(t,e,i,n){var o=i.axis,a=o.grid,r=o.getGlobalExtent(!0),s=yg(a,o).getOtherAxis(o).getGlobalExtent(),l="x"===o.dim?0:1,u=t.position;u[l]+=e[l],u[l]=Math.min(r[1],u[l]),u[l]=Math.max(r[0],u[l]);var h=(s[1]+s[0])/2,c=[h,h];c[l]=u[l];var d=[{verticalAlign:"middle"},{align:"center"}];return{position:u,rotation:t.rotation,cursorPoint:c,tooltipOption:d[l]}}}),LL={line:function(t,e,i,n){var o=gg([e,i[0]],[e,i[1]],xg(t));return Gn({shape:o,style:n}),{type:"Line",shape:o}},shadow:function(t,e,i,n){var o=t.getBandWidth(),a=i[1]-i[0];return{type:"Rect",shape:mg([e-o/2,i[0]],[o,a],xg(t))}}};iT.registerAxisPointerClass("CartesianAxisPointer",CL),ls(function(t){if(t){(!t.axisPointer||0===t.axisPointer.length)&&(t.axisPointer={});var e=t.axisPointer.link;e&&!y(e)&&(t.axisPointer.link=[e])}}),us(qM.PROCESSOR.STATISTIC,function(t,e){t.getComponent("axisPointer").coordSysAxesInfo=yu(t,e)}),hs({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},function(t,e,i){var n=t.currTrigger,o=[t.x,t.y],a=t,r=t.dispatchAction||m(i.dispatchAction,i),s=e.getComponent("axisPointer").coordSysAxesInfo;if(s){qp(o)&&(o=xL({seriesIndex:a.seriesIndex,dataIndex:a.dataIndex},e).point);var l=qp(o),u=a.axesInfo,h=s.axesInfo,c="leave"===n||qp(o),d={},f={},p={list:[],map:{}},g={showPointer:wL(Wp,f),showTooltip:wL(Hp,p)};_L(s.coordSysMap,function(t,e){var i=l||t.containPoint(o);_L(s.coordSysAxesInfo[e],function(t,e){var n=t.axis,a=Xp(u,t);if(!c&&i&&(!u||a)){var r=a&&a.value;null!=r||l||(r=n.pointToData(o)),null!=r&&Gp(t,r,g,!1,d)}})});var v={};return _L(h,function(t,e){var i=t.linkGroup;i&&!f[e]&&_L(i.axesInfo,function(e,n){var o=f[n];if(e!==t&&o){var a=o.value;i.mapper&&(a=t.axis.scale.parse(i.mapper(a,Yp(e),Yp(t)))),v[t.key]=a}})}),_L(v,function(t,e){Gp(h[e],t,g,!0,d)}),Zp(f,h,d),Up(p,o,t,r),jp(h,0,i),d}});var kL=["x","y"],PL=["width","height"],NL=ng.extend({makeElOption:function(t,e,i,n,o){var a=i.axis,r=a.coordinateSystem,s=wg(r,1-_g(a)),l=r.dataToPoint(e)[0],u=n.get("type");if(u&&"none"!==u){var h=ug(n),c=OL[u](a,l,s,h);c.style=h,t.graphicKey=c.type,t.pointer=c}pg(e,t,Vp(i),i,n,o)},getHandleTransform:function(t,e,i){var n=Vp(e,{labelInside:!1});return n.labelMargin=i.get("handle.margin"),{position:fg(e.axis,t,n),rotation:n.rotation+(n.labelDirection<0?Math.PI:0)}},updateHandleTransform:function(t,e,i,n){var o=i.axis,a=o.coordinateSystem,r=_g(o),s=wg(a,r),l=t.position;l[r]+=e[r],l[r]=Math.min(s[1],l[r]),l[r]=Math.max(s[0],l[r]);var u=wg(a,1-r),h=(u[1]+u[0])/2,c=[h,h];return c[r]=l[r],{position:l,rotation:t.rotation,cursorPoint:c,tooltipOption:{verticalAlign:"middle"}}}}),OL={line:function(t,e,i,n){var o=gg([e,i[0]],[e,i[1]],_g(t));return Gn({shape:o,style:n}),{type:"Line",shape:o}},shadow:function(t,e,i,n){var o=t.getBandWidth(),a=i[1]-i[0];return{type:"Rect",shape:mg([e-o/2,i[0]],[o,a],_g(t))}}};iT.registerAxisPointerClass("SingleAxisPointer",NL),vs({type:"single"});var EL=mM.extend({type:"series.themeRiver",dependencies:["singleAxis"],nameMap:null,init:function(t){EL.superApply(this,"init",arguments),this.legendDataProvider=function(){return this.getRawData()}},fixData:function(t){for(var e=t.length,i=f(Mf().key(function(t){return t[2]}).entries(t),function(t){return{name:t.key,dataList:t.values}}),n=i.length,o=-1,a=-1,r=0;ro&&(o=s,a=r)}for(var l=0;lMath.PI/2?"right":"left"):x&&"center"!==x?"left"===x?(f=u.r0+y,p>Math.PI/2&&(x="right")):"right"===x&&(f=u.r-y,p>Math.PI/2&&(x="left")):(f=(u.r+u.r0)/2,x="center"),d.attr("style",{text:l,textAlign:x,textVerticalAlign:n("verticalAlign")||"middle",opacity:n("opacity")});var _=f*g+u.cx,w=f*m+u.cy;d.attr("position",[_,w]);var b=n("rotate"),S=0;"radial"===b?(S=-p)<-Math.PI/2&&(S+=Math.PI):"tangential"===b?(S=Math.PI/2-p)>Math.PI/2?S-=Math.PI:S<-Math.PI/2&&(S+=Math.PI):"number"==typeof b&&(S=b*Math.PI/180),d.attr("rotation",S)},VL._initEvents=function(t,e,i,n){t.off("mouseover").off("mouseout").off("emphasis").off("normal");var o=this,a=function(){o.onEmphasis(n)},r=function(){o.onNormal()};i.isAnimationEnabled()&&t.on("mouseover",a).on("mouseout",r).on("emphasis",a).on("normal",r).on("downplay",function(){o.onDownplay()}).on("highlight",function(){o.onHighlight()})},u(Dg,L_);pr.extend({type:"sunburst",init:function(){},render:function(t,e,i,n){function o(i,n){if(c||!i||i.getValue()||(i=null),i!==l&&n!==l)if(n&&n.piece)i?(n.piece.updateData(!1,i,"normal",t,e),s.setItemGraphicEl(i.dataIndex,n.piece)):a(n);else if(i){var o=new Dg(i,t,e);h.add(o),s.setItemGraphicEl(i.dataIndex,o)}}function a(t){t&&t.piece&&(h.remove(t.piece),t.piece=null)}var r=this;this.seriesModel=t,this.api=i,this.ecModel=e;var s=t.getData(),l=s.tree.root,u=t.getViewRoot(),h=this.group,c=t.get("renderLabelForZeroData"),d=[];u.eachNode(function(t){d.push(t)});var f=this._oldChildren||[];if(function(t,e){function i(t){return t.getId()}function n(i,n){o(null==i?null:t[i],null==n?null:e[n])}0===t.length&&0===e.length||new bs(e,t,i,i).add(n).update(n).remove(v(n,null)).execute()}(d,f),function(i,n){if(n.depth>0){i.piece?i.piece.updateData(!1,i,"normal",t,e):(i.piece=new Dg(i,t,e),h.add(i.piece)),n.piece._onclickEvent&&n.piece.off("click",n.piece._onclickEvent);var o=function(t){r._rootToNode(n.parentNode)};n.piece._onclickEvent=o,i.piece.on("click",o)}else i.piece&&(h.remove(i.piece),i.piece=null)}(l,u),n&&n.highlight&&n.highlight.piece){var p=t.getShallow("highlightPolicy");n.highlight.piece.onEmphasis(p)}else if(n&&n.unhighlight){var g=l.piece;!g&&l.children.length&&(g=l.children[0].piece),g&&g.onNormal()}this._initEvents(),this._oldChildren=d},dispose:function(){},_initEvents:function(){var t=this,e=function(e){var i=!1;t.seriesModel.getViewRoot().eachNode(function(n){if(!i&&n.piece&&n.piece.childAt(0)===e.target){var o=n.getModel().get("nodeClick");if("rootToNode"===o)t._rootToNode(n);else if("link"===o){var a=n.getModel(),r=a.get("link");if(r){var s=a.get("target",!0)||"_blank";window.open(r,s)}}i=!0}})};this.group._onclickEvent&&this.group.off("click",this.group._onclickEvent),this.group.on("click",e),this.group._onclickEvent=e},_rootToNode:function(t){t!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:"sunburstRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:t})},containPoint:function(t,e){var i=e.getData().getItemLayout(0);if(i){var n=t[0]-i.cx,o=t[1]-i.cy,a=Math.sqrt(n*n+o*o);return a<=i.r&&a>=i.r0}}});var GL="sunburstRootToNode";hs({type:GL,update:"updateView"},function(t,e){e.eachComponent({mainType:"series",subType:"sunburst",query:t},function(e,i){var n=Jh(t,[GL],e);if(n){var o=e.getViewRoot();o&&(t.direction=tc(o,n.node)?"rollUp":"drillDown"),e.resetViewRoot(n.node)}})});var FL="sunburstHighlight";hs({type:FL,update:"updateView"},function(t,e){e.eachComponent({mainType:"series",subType:"sunburst",query:t},function(e,i){var n=Jh(t,[FL],e);n&&(t.highlight=n.node)})});hs({type:"sunburstUnhighlight",update:"updateView"},function(t,e){e.eachComponent({mainType:"series",subType:"sunburst",query:t},function(e,i){t.unhighlight=!0})});var WL=Math.PI/180;fs(v(_T,"sunburst")),ds(v(function(t,e,i,n){e.eachSeriesByType(t,function(t){var e=t.get("center"),n=t.get("radius");y(n)||(n=[0,n]),y(e)||(e=[e,e]);var o=i.getWidth(),a=i.getHeight(),r=Math.min(o,a),s=To(e[0],o),l=To(e[1],a),u=To(n[0],r/2),h=To(n[1],r/2),c=-t.get("startAngle")*WL,f=t.get("minAngle")*WL,p=t.getData().tree.root,g=t.getViewRoot(),m=g.depth,v=t.get("sort");null!=v&&Lg(g,v);var x=0;d(g.children,function(t){!isNaN(t.getValue())&&x++});var _=g.getValue(),w=Math.PI/(_||x)*2,b=g.depth>0,S=g.height-(b?-1:1),M=(h-u)/(S||1),I=t.get("clockwise"),D=t.get("stillShowZeroSum"),T=I?1:-1,A=function(t,e){if(t){var i=e;if(t!==p){var n=t.getValue(),o=0===_&&D?w:n*w;on[1]&&n.reverse(),{coordSys:{type:"polar",cx:t.cx,cy:t.cy,r:n[1],r0:n[0]},api:{coord:m(function(n){var o=e.dataToRadius(n[0]),a=i.dataToAngle(n[1]),r=t.coordToPoint([o,a]);return r.push(o,a*Math.PI/180),r}),size:m(Eg,t)}}},calendar:function(t){var e=t.getRect(),i=t.getRangeInfo();return{coordSys:{type:"calendar",x:e.x,y:e.y,width:e.width,height:e.height,cellWidth:t.getCellWidth(),cellHeight:t.getCellHeight(),rangeInfo:{start:i.start,end:i.end,weeks:i.weeks,dayCount:i.allDay}},api:{coord:function(e,i){return t.dataToPoint(e,i)}}}}};ys({type:"series.custom",dependencies:["grid","polar","geo","singleAxis","calendar"],defaultOption:{coordinateSystem:"cartesian2d",zlevel:0,z:2,legendHoverLink:!0},getInitialData:function(t,e){return Hs(this.getSource(),this)}}),xs({type:"custom",_data:null,render:function(t,e,i){var n=this._data,o=t.getData(),a=this.group,r=Vg(t,o,e,i);this.group.removeAll(),o.diff(n).add(function(e){Fg(null,e,r(e),t,a,o)}).update(function(e,i){Fg(n.getItemGraphicEl(i),e,r(e),t,a,o)}).remove(function(t){var e=n.getItemGraphicEl(t);e&&a.remove(e)}).execute(),this._data=o},incrementalPrepareRender:function(t,e,i){this.group.removeAll(),this._data=null},incrementalRender:function(t,e,i,n){for(var o=e.getData(),a=Vg(e,o,i,n),r=t.start;r=0;l--)null==o[l]?o.splice(l,1):delete o[l].$action},_flatten:function(t,e,i){d(t,function(t){if(t){i&&(t.parentOption=i),e.push(t);var n=t.children;"group"===t.type&&n&&this._flatten(n,e,t),delete t.children}},this)},useElOptionsToUpdate:function(){var t=this._elOptionsToUpdate;return this._elOptionsToUpdate=null,t}});vs({type:"graphic",init:function(t,e){this._elMap=z(),this._lastGraphicModel},render:function(t,e,i){t!==this._lastGraphicModel&&this._clear(),this._lastGraphicModel=t,this._updateElements(t,i),this._relocate(t,i)},_updateElements:function(t,e){var i=t.useElOptionsToUpdate();if(i){var n=this._elMap,o=this.group;d(i,function(t){var e=t.$action,i=t.id,a=n.get(i),r=t.parentId,s=null!=r?n.get(r):o;if("text"===t.type){var l=t.style;t.hv&&t.hv[1]&&(l.textVerticalAlign=l.textBaseline=null),!l.hasOwnProperty("textFill")&&l.fill&&(l.textFill=l.fill),!l.hasOwnProperty("textStroke")&&l.stroke&&(l.textStroke=l.stroke)}var u=qg(t);e&&"merge"!==e?"replace"===e?(Yg(a,n),Xg(i,s,u,n)):"remove"===e&&Yg(a,n):a?a.attr(u):Xg(i,s,u,n);var h=n.get(i);h&&(h.__ecGraphicWidth=t.width,h.__ecGraphicHeight=t.height)})}},_relocate:function(t,e){for(var i=t.option.elements,n=this.group,o=this._elMap,a=i.length-1;a>=0;a--){var r=i[a],s=o.get(r.id);if(s){var l=s.parent;ta(s,r,l===n?{width:e.getWidth(),height:e.getHeight()}:{width:l.__ecGraphicWidth||0,height:l.__ecGraphicHeight||0},null,{hv:r.hv,boundingMode:r.bounding})}}},_clear:function(){var t=this._elMap;t.each(function(e){Yg(e,t)}),this._elMap=z()},dispose:function(){this._clear()}});var $L=ms({type:"legend.plain",dependencies:["series"],layoutMode:{type:"box",ignoreSize:!0},init:function(t,e,i){this.mergeDefaultAndTheme(t,i),t.selected=t.selected||{}},mergeOption:function(t){$L.superCall(this,"mergeOption",t)},optionUpdated:function(){this._updateData(this.ecModel);var t=this._data;if(t[0]&&"single"===this.get("selectedMode")){for(var e=!1,i=0;i=0},defaultOption:{zlevel:0,z:4,show:!0,orient:"horizontal",left:"center",top:0,align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,inactiveColor:"#ccc",textStyle:{color:"#333"},selectedMode:!0,tooltip:{show:!1}}});hs("legendToggleSelect","legendselectchanged",v(tm,"toggleSelected")),hs("legendSelect","legendselected",v(tm,"select")),hs("legendUnSelect","legendunselected",v(tm,"unSelect"));var KL=v,JL=d,QL=L_,tk=vs({type:"legend.plain",newlineDisabled:!1,init:function(){this.group.add(this._contentGroup=new QL),this._backgroundEl},getContentGroup:function(){return this._contentGroup},render:function(t,e,i){if(this.resetInner(),t.get("show",!0)){var n=t.get("align");n&&"auto"!==n||(n="right"===t.get("left")&&"vertical"===t.get("orient")?"right":"left"),this.renderInner(n,t,e,i);var o=t.getBoxLayoutParams(),a={width:i.getWidth(),height:i.getHeight()},s=t.get("padding"),l=Qo(o,a,s),u=this.layoutInner(t,n,l),h=Qo(r({width:u.width,height:u.height},o),a,s);this.group.attr("position",[h.x-u.x,h.y-u.y]),this.group.add(this._backgroundEl=im(u,t))}},resetInner:function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl)},renderInner:function(t,e,i,n){var o=this.getContentGroup(),a=z(),r=e.get("selectedMode");JL(e.getData(),function(s,l){var u=s.get("name");if(this.newlineDisabled||""!==u&&"\n"!==u){var h=i.getSeriesByName(u)[0];if(!a.get(u))if(h){var c=h.getData(),d=c.getVisual("color");"function"==typeof d&&(d=d(h.getDataParams(0)));var f=c.getVisual("legendSymbol")||"roundRect",p=c.getVisual("symbol");this._createItem(u,l,s,e,f,p,t,d,r).on("click",KL(nm,u,n)).on("mouseover",KL(om,h,null,n)).on("mouseout",KL(am,h,null,n)),a.set(u,!0)}else i.eachRawSeries(function(i){if(!a.get(u)&&i.legendDataProvider){var o=i.legendDataProvider(),h=o.indexOfName(u);if(h<0)return;var c=o.getItemVisual(h,"color");this._createItem(u,l,s,e,"roundRect",null,t,c,r).on("click",KL(nm,u,n)).on("mouseover",KL(om,i,u,n)).on("mouseout",KL(am,i,u,n)),a.set(u,!0)}},this)}else o.add(new QL({newline:!0}))},this)},_createItem:function(t,e,i,n,o,r,s,l,u){var h=n.get("itemWidth"),c=n.get("itemHeight"),d=n.get("inactiveColor"),f=n.isSelected(t),p=new QL,g=i.getModel("textStyle"),m=i.get("icon"),v=i.getModel("tooltip"),y=v.parentModel;if(o=m||o,p.add(ml(o,0,0,h,c,f?l:d,!0)),!m&&r&&(r!==o||"none"==r)){var x=.8*c;"none"===r&&(r="circle"),p.add(ml(r,(h-x)/2,(c-x)/2,x,x,f?l:d))}var _="left"===s?h+5:-5,w=s,b=n.get("formatter"),S=t;"string"==typeof b&&b?S=b.replace("{name}",null!=t?t:""):"function"==typeof b&&(S=b(t)),p.add(new zb({style:no({},g,{text:S,x:_,y:c/2,textFill:f?g.getTextColor():d,textAlign:w,textVerticalAlign:"middle"})}));var M=new jb({shape:p.getBoundingRect(),invisible:!0,tooltip:v.get("show")?a({content:t,formatter:y.get("formatter",!0)||function(){return t},formatterParams:{componentType:"legend",legendIndex:n.componentIndex,name:t,$vars:["name"]}},v.option):null});return p.add(M),p.eachChild(function(t){t.silent=!0}),M.silent=!u,this.getContentGroup().add(p),eo(p),p.__legendDataIndex=e,p},layoutInner:function(t,e,i){var n=this.getContentGroup();AS(t.get("orient"),n,t.get("itemGap"),i.width,i.height);var o=n.getBoundingRect();return n.attr("position",[-o.x,-o.y]),this.group.getBoundingRect()}});us(function(t){var e=t.findComponents({mainType:"legend"});e&&e.length&&t.filterSeries(function(t){for(var i=0;ii[s],f=[-h.x,-h.y];f[r]=n.position[r];var p=[0,0],g=[-c.x,-c.y],m=T(t.get("pageButtonGap",!0),t.get("itemGap",!0));d&&("end"===t.get("pageButtonPosition",!0)?g[r]+=i[s]-c[s]:p[r]+=c[s]+m),g[1-r]+=h[l]/2-c[l]/2,n.attr("position",f),o.attr("position",p),a.attr("position",g);var v=this.group.getBoundingRect();if((v={x:0,y:0})[s]=d?i[s]:h[s],v[l]=Math.max(h[l],c[l]),v[u]=Math.min(0,c[u]+g[1-r]),o.__rectSize=i[s],d){var y={x:0,y:0};y[s]=Math.max(i[s]-c[s]-m,0),y[l]=v[l],o.setClipPath(new jb({shape:y})),o.__rectSize=y[s]}else a.eachChild(function(t){t.attr({invisible:!0,silent:!0})});var x=this._getPageInfo(t);return null!=x.pageIndex&&fo(n,{position:x.contentPosition},!!d&&t),this._updatePageInfoView(t,x),v},_pageGo:function(t,e,i){var n=this._getPageInfo(e)[t];null!=n&&i.dispatchAction({type:"legendScroll",scrollDataIndex:n,legendId:e.id})},_updatePageInfoView:function(t,e){var i=this._controllerGroup;d(["pagePrev","pageNext"],function(n){var o=null!=e[n+"DataIndex"],a=i.childOfName(n);a&&(a.setStyle("fill",o?t.get("pageIconColor",!0):t.get("pageIconInactiveColor",!0)),a.cursor=o?"pointer":"default")});var n=i.childOfName("pageText"),o=t.get("pageFormatter"),a=e.pageIndex,r=null!=a?a+1:0,s=e.pageCount;n&&o&&n.setStyle("text",_(o)?o.replace("{current}",r).replace("{total}",s):o({current:r,total:s}))},_getPageInfo:function(t){function e(t){var e=t.getBoundingRect().clone();return e[f]+=t.position[h],e}var i,n,o,a,r=t.get("scrollDataIndex",!0),s=this.getContentGroup(),l=s.getBoundingRect(),u=this._containerGroup.__rectSize,h=t.getOrient().index,c=nk[h],d=nk[1-h],f=ok[h],p=s.position.slice();this._showController?s.eachChild(function(t){t.__legendDataIndex===r&&(a=t)}):a=s.childAt(0);var g=u?Math.ceil(l[c]/u):0;if(a){var m=a.getBoundingRect(),v=a.position[h]+m[f];p[h]=-v-l[f],i=Math.floor(g*(v+m[f]+u/2)/l[c]),i=l[c]&&g?Math.max(0,Math.min(g-1,i)):-1;var y={x:0,y:0};y[c]=u,y[d]=l[d],y[f]=-p[h]-l[f];var x,_=s.children();if(s.eachChild(function(t,i){var n=e(t);n.intersect(y)&&(null==x&&(x=i),o=t.__legendDataIndex),i===_.length-1&&n[f]+n[c]<=y[f]+y[c]&&(o=null)}),null!=x){var w=e(_[x]);if(y[f]=w[f]+w[c]-y[c],x<=0&&w[f]>=y[f])n=null;else{for(;x>0&&e(_[x-1]).intersect(y);)x--;n=_[x].__legendDataIndex}}}return{contentPosition:p,pageIndex:i,pageCount:g,pagePrevDataIndex:n,pageNextDataIndex:o}}});hs("legendScroll","legendscroll",function(t,e){var i=t.scrollDataIndex;null!=i&&e.eachComponent({mainType:"legend",subType:"scroll",query:t},function(t){t.setScrollDataIndex(i)})}),ms({type:"tooltip",dependencies:["axisPointer"],defaultOption:{zlevel:0,z:8,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",confine:!1,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"rgba(50,50,50,0.7)",borderColor:"#333",borderRadius:4,borderWidth:0,padding:5,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",textStyle:{}}},textStyle:{color:"#fff",fontSize:14}}});var rk=d,sk=Ho,lk=["","-webkit-","-moz-","-o-"];hm.prototype={constructor:hm,_enterable:!0,update:function(){var t=this._container,e=t.currentStyle||document.defaultView.getComputedStyle(t),i=t.style;"absolute"!==i.position&&"absolute"!==e.position&&(i.position="relative")},show:function(t){clearTimeout(this._hideTimeout);var e=this.el;e.style.cssText="position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;"+um(t)+";left:"+this._x+"px;top:"+this._y+"px;"+(t.get("extraCssText")||""),e.style.display=e.innerHTML?"block":"none",this._show=!0},setContent:function(t){this.el.innerHTML=null==t?"":t},setEnterable:function(t){this._enterable=t},getSize:function(){var t=this.el;return[t.clientWidth,t.clientHeight]},moveTo:function(t,e){var i,n=this._zr;n&&n.painter&&(i=n.painter.getViewportRootOffset())&&(t+=i.offsetLeft,e+=i.offsetTop);var o=this.el.style;o.left=t+"px",o.top=e+"px",this._x=t,this._y=e},hide:function(){this.el.style.display="none",this._show=!1},hideLater:function(t){!this._show||this._inContent&&this._enterable||(t?(this._hideDelay=t,this._show=!1,this._hideTimeout=setTimeout(m(this.hide,this),t)):this.hide())},isShow:function(){return this._show}};var uk=m,hk=d,ck=To,dk=new jb({shape:{x:-1,y:-1,width:2,height:2}});vs({type:"tooltip",init:function(t,e){if(!Ax.node){var i=new hm(e.getDom(),e);this._tooltipContent=i}},render:function(t,e,i){if(!Ax.node&&!Ax.wxa){this.group.removeAll(),this._tooltipModel=t,this._ecModel=e,this._api=i,this._lastDataByCoordSys=null,this._alwaysShowContent=t.get("alwaysShowContent");var n=this._tooltipContent;n.update(),n.setEnterable(t.get("enterable")),this._initGlobalListener(),this._keepShow()}},_initGlobalListener:function(){var t=this._tooltipModel.get("triggerOn");$p("itemTooltip",this._api,uk(function(e,i,n){"none"!==t&&(t.indexOf(e)>=0?this._tryShow(i,n):"leave"===e&&this._hide(n))},this))},_keepShow:function(){var t=this._tooltipModel,e=this._ecModel,i=this._api;if(null!=this._lastX&&null!=this._lastY&&"none"!==t.get("triggerOn")){var n=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){n.manuallyShowTip(t,e,i,{x:n._lastX,y:n._lastY})})}},manuallyShowTip:function(t,e,i,n){if(n.from!==this.uid&&!Ax.node){var o=dm(n,i);this._ticket="";var a=n.dataByCoordSys;if(n.tooltip&&null!=n.x&&null!=n.y){var r=dk;r.position=[n.x,n.y],r.update(),r.tooltip=n.tooltip,this._tryShow({offsetX:n.x,offsetY:n.y,target:r},o)}else if(a)this._tryShow({offsetX:n.x,offsetY:n.y,position:n.position,event:{},dataByCoordSys:n.dataByCoordSys,tooltipOption:n.tooltipOption},o);else if(null!=n.seriesIndex){if(this._manuallyAxisShowTip(t,e,i,n))return;var s=xL(n,e),l=s.point[0],u=s.point[1];null!=l&&null!=u&&this._tryShow({offsetX:l,offsetY:u,position:n.position,target:s.el,event:{}},o)}else null!=n.x&&null!=n.y&&(i.dispatchAction({type:"updateAxisPointer",x:n.x,y:n.y}),this._tryShow({offsetX:n.x,offsetY:n.y,position:n.position,target:i.getZr().findHover(n.x,n.y).target,event:{}},o))}},manuallyHideTip:function(t,e,i,n){var o=this._tooltipContent;!this._alwaysShowContent&&this._tooltipModel&&o.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=null,n.from!==this.uid&&this._hide(dm(n,i))},_manuallyAxisShowTip:function(t,e,i,n){var o=n.seriesIndex,a=n.dataIndex,r=e.getComponent("axisPointer").coordSysAxesInfo;if(null!=o&&null!=a&&null!=r){var s=e.getSeriesByIndex(o);if(s&&"axis"===(t=cm([s.getData().getItemModel(a),s,(s.coordinateSystem||{}).model,t])).get("trigger"))return i.dispatchAction({type:"updateAxisPointer",seriesIndex:o,dataIndex:a,position:n.position}),!0}},_tryShow:function(t,e){var i=t.target;if(this._tooltipModel){this._lastX=t.offsetX,this._lastY=t.offsetY;var n=t.dataByCoordSys;n&&n.length?this._showAxisTooltip(n,t):i&&null!=i.dataIndex?(this._lastDataByCoordSys=null,this._showSeriesItemTooltip(t,i,e)):i&&i.tooltip?(this._lastDataByCoordSys=null,this._showComponentItemTooltip(t,i,e)):(this._lastDataByCoordSys=null,this._hide(e))}},_showOrMove:function(t,e){var i=t.get("showDelay");e=m(e,this),clearTimeout(this._showTimout),i>0?this._showTimout=setTimeout(e,i):e()},_showAxisTooltip:function(t,e){var i=this._ecModel,n=this._tooltipModel,o=[e.offsetX,e.offsetY],a=[],r=[],s=cm([e.tooltipOption,n]);hk(t,function(t){hk(t.dataByAxis,function(t){var e=i.getComponent(t.axisDim+"Axis",t.axisIndex),n=t.value,o=[];if(e&&null!=n){var s=dg(n,e.axis,i,t.seriesDataIndices,t.valueLabelOpt);d(t.seriesDataIndices,function(a){var l=i.getSeriesByIndex(a.seriesIndex),u=a.dataIndexInside,h=l&&l.getDataParams(u);h.axisDim=t.axisDim,h.axisIndex=t.axisIndex,h.axisType=t.axisType,h.axisId=t.axisId,h.axisValue=pl(e.axis,n),h.axisValueLabel=s,h&&(r.push(h),o.push(l.formatTooltip(u,!0)))});var l=s;a.push((l?Zo(l)+"
":"")+o.join("
"))}})},this),a.reverse(),a=a.join("

");var l=e.position;this._showOrMove(s,function(){this._updateContentNotChangedOnAxis(t)?this._updatePosition(s,l,o[0],o[1],this._tooltipContent,r):this._showTooltipContent(s,a,r,Math.random(),o[0],o[1],l)})},_showSeriesItemTooltip:function(t,e,i){var n=this._ecModel,o=e.seriesIndex,a=n.getSeriesByIndex(o),r=e.dataModel||a,s=e.dataIndex,l=e.dataType,u=r.getData(),h=cm([u.getItemModel(s),r,a&&(a.coordinateSystem||{}).model,this._tooltipModel]),c=h.get("trigger");if(null==c||"item"===c){var d=r.getDataParams(s,l),f=r.formatTooltip(s,!1,l),p="item_"+r.name+"_"+s;this._showOrMove(h,function(){this._showTooltipContent(h,f,d,p,t.offsetX,t.offsetY,t.position,t.target)}),i({type:"showTip",dataIndexInside:s,dataIndex:u.getRawIndex(s),seriesIndex:o,from:this.uid})}},_showComponentItemTooltip:function(t,e,i){var n=e.tooltip;if("string"==typeof n){var o=n;n={content:o,formatter:o}}var a=new wo(n,this._tooltipModel,this._ecModel),r=a.get("content"),s=Math.random();this._showOrMove(a,function(){this._showTooltipContent(a,r,a.get("formatterParams")||{},s,t.offsetX,t.offsetY,t.position,e)}),i({type:"showTip",from:this.uid})},_showTooltipContent:function(t,e,i,n,o,a,r,s){if(this._ticket="",t.get("showContent")&&t.get("show")){var l=this._tooltipContent,u=t.get("formatter");r=r||t.get("position");var h=e;if(u&&"string"==typeof u)h=Uo(u,i,!0);else if("function"==typeof u){var c=uk(function(e,n){e===this._ticket&&(l.setContent(n),this._updatePosition(t,r,o,a,l,i,s))},this);this._ticket=n,h=u(i,n,c)}l.setContent(h),l.show(t),this._updatePosition(t,r,o,a,l,i,s)}},_updatePosition:function(t,e,i,n,o,a,r){var s=this._api.getWidth(),l=this._api.getHeight();e=e||t.get("position");var u=o.getSize(),h=t.get("align"),c=t.get("verticalAlign"),d=r&&r.getBoundingRect().clone();if(r&&d.applyTransform(r.transform),"function"==typeof e&&(e=e([i,n],a,o.el,d,{viewSize:[s,l],contentSize:u.slice()})),y(e))i=ck(e[0],s),n=ck(e[1],l);else if(w(e)){e.width=u[0],e.height=u[1];var f=Qo(e,{width:s,height:l});i=f.x,n=f.y,h=null,c=null}else"string"==typeof e&&r?(i=(p=mm(e,d,u))[0],n=p[1]):(i=(p=fm(i,n,o.el,s,l,h?null:20,c?null:20))[0],n=p[1]);if(h&&(i-=vm(h)?u[0]/2:"right"===h?u[0]:0),c&&(n-=vm(c)?u[1]/2:"bottom"===c?u[1]:0),t.get("confine")){var p=pm(i,n,o.el,s,l);i=p[0],n=p[1]}o.moveTo(i,n)},_updateContentNotChangedOnAxis:function(t){var e=this._lastDataByCoordSys,i=!!e&&e.length===t.length;return i&&hk(e,function(e,n){var o=e.dataByAxis||{},a=(t[n]||{}).dataByAxis||[];(i&=o.length===a.length)&&hk(o,function(t,e){var n=a[e]||{},o=t.seriesDataIndices||[],r=n.seriesDataIndices||[];(i&=t.value===n.value&&t.axisType===n.axisType&&t.axisId===n.axisId&&o.length===r.length)&&hk(o,function(t,e){var n=r[e];i&=t.seriesIndex===n.seriesIndex&&t.dataIndex===n.dataIndex})})}),this._lastDataByCoordSys=t,!!i},_hide:function(t){this._lastDataByCoordSys=null,t({type:"hideTip",from:this.uid})},dispose:function(t,e){Ax.node||(this._tooltipContent.hide(),ig("itemTooltip",e))}}),hs({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},function(){}),hs({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},function(){}),wm.prototype={constructor:wm,pointToData:function(t,e){return this.polar.pointToData(t,e)["radius"===this.dim?0:1]},dataToRadius:dD.prototype.dataToCoord,radiusToData:dD.prototype.coordToData},u(wm,dD),bm.prototype={constructor:bm,pointToData:function(t,e){return this.polar.pointToData(t,e)["radius"===this.dim?0:1]},dataToAngle:dD.prototype.dataToCoord,angleToData:dD.prototype.coordToData},u(bm,dD);var fk=function(t){this.name=t||"",this.cx=0,this.cy=0,this._radiusAxis=new wm,this._angleAxis=new bm,this._radiusAxis.polar=this._angleAxis.polar=this};fk.prototype={type:"polar",axisPointerEnabled:!0,constructor:fk,dimensions:["radius","angle"],model:null,containPoint:function(t){var e=this.pointToCoord(t);return this._radiusAxis.contain(e[0])&&this._angleAxis.contain(e[1])},containData:function(t){return this._radiusAxis.containData(t[0])&&this._angleAxis.containData(t[1])},getAxis:function(t){return this["_"+t+"Axis"]},getAxes:function(){return[this._radiusAxis,this._angleAxis]},getAxesByScale:function(t){var e=[],i=this._angleAxis,n=this._radiusAxis;return i.scale.type===t&&e.push(i),n.scale.type===t&&e.push(n),e},getAngleAxis:function(){return this._angleAxis},getRadiusAxis:function(){return this._radiusAxis},getOtherAxis:function(t){var e=this._angleAxis;return t===e?this._radiusAxis:e},getBaseAxis:function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAngleAxis()},getTooltipAxes:function(t){var e=null!=t&&"auto"!==t?this.getAxis(t):this.getBaseAxis();return{baseAxes:[e],otherAxes:[this.getOtherAxis(e)]}},dataToPoint:function(t,e){return this.coordToPoint([this._radiusAxis.dataToRadius(t[0],e),this._angleAxis.dataToAngle(t[1],e)])},pointToData:function(t,e){var i=this.pointToCoord(t);return[this._radiusAxis.radiusToData(i[0],e),this._angleAxis.angleToData(i[1],e)]},pointToCoord:function(t){var e=t[0]-this.cx,i=t[1]-this.cy,n=this.getAngleAxis(),o=n.getExtent(),a=Math.min(o[0],o[1]),r=Math.max(o[0],o[1]);n.inverse?a=r-360:r=a+360;var s=Math.sqrt(e*e+i*i);e/=s,i/=s;for(var l=Math.atan2(-i,e)/Math.PI*180,u=lr;)l+=360*u;return[s,l]},coordToPoint:function(t){var e=t[0],i=t[1]/180*Math.PI;return[Math.cos(i)*e+this.cx,-Math.sin(i)*e+this.cy]}};var pk=kS.extend({type:"polarAxis",axis:null,getCoordSysModel:function(){return this.ecModel.queryComponents({mainType:"polar",index:this.option.polarIndex,id:this.option.polarId})[0]}});n(pk.prototype,JI);var gk={angle:{startAngle:90,clockwise:!0,splitNumber:12,axisLabel:{rotate:!1}},radius:{splitNumber:5}};GD("angle",pk,Sm,gk.angle),GD("radius",pk,Sm,gk.radius),ms({type:"polar",dependencies:["polarAxis","angleAxis"],coordinateSystem:null,findAxisModel:function(t){var e;return this.ecModel.eachComponent(t,function(t){t.getCoordSysModel()===this&&(e=t)},this),e},defaultOption:{zlevel:0,z:0,center:["50%","50%"],radius:"80%"}});var mk={dimensions:fk.prototype.dimensions,create:function(t,e){var i=[];return t.eachComponent("polar",function(t,n){var o=new fk(n);o.update=Im;var a=o.getRadiusAxis(),r=o.getAngleAxis(),s=t.findAxisModel("radiusAxis"),l=t.findAxisModel("angleAxis");Dm(a,s),Dm(r,l),Mm(o,t,e),i.push(o),t.coordinateSystem=o,o.model=t}),t.eachSeries(function(e){if("polar"===e.get("coordinateSystem")){var i=t.queryComponents({mainType:"polar",index:e.get("polarIndex"),id:e.get("polarId")})[0];e.coordinateSystem=i.coordinateSystem}}),i}};Ca.register("polar",mk);var vk=["axisLine","axisLabel","axisTick","splitLine","splitArea"];iT.extend({type:"angleAxis",axisPointerClass:"PolarAxisPointer",render:function(t,e){if(this.group.removeAll(),t.get("show")){var i=t.axis,n=i.polar,o=n.getRadiusAxis().getExtent(),a=i.getTicksCoords();"category"!==i.type&&a.pop(),d(vk,function(e){!t.get(e+".show")||i.scale.isBlank()&&"axisLine"!==e||this["_"+e](t,n,a,o)},this)}},_axisLine:function(t,e,i,n){var o=t.getModel("axisLine.lineStyle"),a=new Rb({shape:{cx:e.cx,cy:e.cy,r:n[Am(e)]},style:o.getLineStyle(),z2:1,silent:!0});a.style.fill=null,this.group.add(a)},_axisTick:function(t,e,i,n){var o=t.getModel("axisTick"),a=(o.get("inside")?-1:1)*o.get("length"),s=n[Am(e)],l=f(i,function(t){return new Xb({shape:Tm(e,[s,s+a],t)})});this.group.add(rS(l,{style:r(o.getModel("lineStyle").getLineStyle(),{stroke:t.get("axisLine.lineStyle.color")})}))},_axisLabel:function(t,e,i,n){for(var o=t.axis,a=t.getCategories(),r=t.getModel("axisLabel"),s=t.getFormattedLabels(),l=r.get("margin"),u=o.getLabelsCoords(),h=0;hf?"left":"right",m=Math.abs(d[1]-p)/c<.3?"middle":d[1]>p?"top":"bottom";a&&a[h]&&a[h].textStyle&&(r=new wo(a[h].textStyle,r,r.ecModel));var v=new zb({silent:!0});this.group.add(v),no(v.style,r,{x:d[0],y:d[1],textFill:r.getTextColor()||t.get("axisLine.lineStyle.color"),text:s[h],textAlign:g,textVerticalAlign:m})}},_splitLine:function(t,e,i,n){var o=t.getModel("splitLine").getModel("lineStyle"),a=o.get("color"),s=0;a=a instanceof Array?a:[a];for(var l=[],u=0;u=0?"p":"n",T=w;_&&(a[l][I]||(a[l][I]={p:w,n:w}),T=a[l][I][D]);var A,C,L,k;if("radius"===d.dim){var P=d.dataToRadius(M)-w,N=s.dataToAngle(I);Math.abs(P)=0},Lk.findTargetInfo=function(t,e){for(var i=this._targetInfoList,n=jm(e,t),o=0;o=0||Dk(n,t.getAxis("y").model)>=0)&&a.push(t)}),e.push({panelId:"grid--"+t.id,gridModel:t,coordSysModel:t,coordSys:a[0],coordSyses:a,getPanelRect:Nk.grid,xAxisDeclared:r[t.id],yAxisDeclared:s[t.id]})}))},geo:function(t,e){Ik(t.geoModels,function(t){var i=t.coordinateSystem;e.push({panelId:"geo--"+t.id,geoModel:t,coordSysModel:t,coordSys:i,coordSyses:[i],getPanelRect:Nk.geo})})}},Pk=[function(t,e){var i=t.xAxisModel,n=t.yAxisModel,o=t.gridModel;return!o&&i&&(o=i.axis.grid.model),!o&&n&&(o=n.axis.grid.model),o&&o===e.gridModel},function(t,e){var i=t.geoModel;return i&&i===e.geoModel}],Nk={grid:function(){return this.coordSys.grid.getRect().clone()},geo:function(){var t=this.coordSys,e=t.getBoundingRect().clone();return e.applyTransform(go(t)),e}},Ok={lineX:Tk(Xm,0),lineY:Tk(Xm,1),rect:function(t,e,i){var n=e[Ak[t]]([i[0][0],i[1][0]]),o=e[Ak[t]]([i[0][1],i[1][1]]),a=[Um([n[0],o[0]]),Um([n[1],o[1]])];return{values:a,xyMinMax:a}},polygon:function(t,e,i){var n=[[1/0,-1/0],[1/0,-1/0]];return{values:f(i,function(i){var o=e[Ak[t]](i);return n[0][0]=Math.min(n[0][0],o[0]),n[1][0]=Math.min(n[1][0],o[1]),n[0][1]=Math.max(n[0][1],o[0]),n[1][1]=Math.max(n[1][1],o[1]),o}),xyMinMax:n}}},Ek={lineX:Tk(Ym,0),lineY:Tk(Ym,1),rect:function(t,e,i){return[[t[0][0]-i[0]*e[0][0],t[0][1]-i[0]*e[0][1]],[t[1][0]-i[1]*e[1][0],t[1][1]-i[1]*e[1][1]]]},polygon:function(t,e,i){return f(t,function(t,n){return[t[0]-i[0]*e[n][0],t[1]-i[1]*e[n][1]]})}},zk=["inBrush","outOfBrush"],Rk="__ecBrushSelect",Bk="__ecInBrushSelectEvent",Vk=qM.VISUAL.BRUSH;ds(Vk,function(t,e,i){t.eachComponent({mainType:"brush"},function(e){i&&"takeGlobalCursor"===i.type&&e.setBrushOption("brush"===i.key?i.brushOption:{brushType:!1}),(e.brushTargetManager=new Zm(e.option,t)).setInputRanges(e.areas,t)})}),fs(Vk,function(t,e,n){var o,a,s=[];t.eachComponent({mainType:"brush"},function(e,n){function l(t){return"all"===m||v[t]}function u(t){return!!t.length}function h(t,e){var i=t.coordinateSystem;w|=i.hasAxisBrushed(),l(e)&&i.eachActiveState(t.getData(),function(t,e){"active"===t&&(x[e]=1)})}function c(i,n,o){var a=tv(i);if(a&&!ev(e,n)&&(d(b,function(n){a[n.brushType]&&e.brushTargetManager.controlSeries(n,i,t)&&o.push(n),w|=u(o)}),l(n)&&u(o))){var r=i.getData();r.each(function(t){Qm(a,o,r,t)&&(x[t]=1)})}}var p={brushId:e.id,brushIndex:n,brushName:e.name,areas:i(e.areas),selected:[]};s.push(p);var g=e.option,m=g.brushLink,v=[],x=[],_=[],w=0;n||(o=g.throttleType,a=g.throttleDelay);var b=f(e.areas,function(t){return iv(r({boundingRect:Gk[t.brushType](t)},t))}),S=Om(e.option,zk,function(t){t.mappingMethod="fixed"});y(m)&&d(m,function(t){v[t]=1}),t.eachSeries(function(t,e){var i=_[e]=[];"parallel"===t.subType?h(t,e):c(t,e,i)}),t.eachSeries(function(t,e){var i={seriesId:t.id,seriesIndex:e,seriesName:t.name,dataIndex:[]};p.selected.push(i);var n=tv(t),o=_[e],a=t.getData(),r=l(e)?function(t){return x[t]?(i.dataIndex.push(a.getRawIndex(t)),"inBrush"):"outOfBrush"}:function(t){return Qm(n,o,a,t)?(i.dataIndex.push(a.getRawIndex(t)),"inBrush"):"outOfBrush"};(l(e)?w:u(o))&&zm(zk,S,a,r)})}),Km(e,o,a,s,n)});var Gk={lineX:B,lineY:B,rect:function(t){return nv(t.range)},polygon:function(t){for(var e,i=t.range,n=0,o=i.length;ne[0][1]&&(e[0][1]=a[0]),a[1]e[1][1]&&(e[1][1]=a[1])}return e&&nv(e)}},Fk=["#ddd"];ms({type:"brush",dependencies:["geo","grid","xAxis","yAxis","parallel","series"],defaultOption:{toolbox:null,brushLink:null,seriesIndex:"all",geoIndex:null,xAxisIndex:null,yAxisIndex:null,brushType:"rect",brushMode:"single",transformable:!0,brushStyle:{borderWidth:1,color:"rgba(120,140,180,0.3)",borderColor:"rgba(120,140,180,0.8)"},throttleType:"fixRate",throttleDelay:0,removeOnClick:!0,z:1e4},areas:[],brushType:null,brushOption:{},coordInfoList:[],optionUpdated:function(t,e){var i=this.option;!e&&Em(i,t,["inBrush","outOfBrush"]),i.inBrush=i.inBrush||{},i.outOfBrush=i.outOfBrush||{color:Fk}},setAreas:function(t){t&&(this.areas=f(t,function(t){return ov(this.option,t)},this))},setBrushOption:function(t){this.brushOption=ov(this.option,t),this.brushType=this.brushOption.brushType}});vs({type:"brush",init:function(t,e){this.ecModel=t,this.api=e,this.model,(this._brushController=new Dd(e.getZr())).on("brush",m(this._onBrush,this)).mount()},render:function(t){return this.model=t,av.apply(this,arguments)},updateTransform:av,updateView:av,dispose:function(){this._brushController.dispose()},_onBrush:function(t,e){var n=this.model.id;this.model.brushTargetManager.setOutputRanges(t,this.ecModel),(!e.isEnd||e.removeOnClick)&&this.api.dispatchAction({type:"brush",brushId:n,areas:i(t),$from:n})}}),hs({type:"brush",event:"brush"},function(t,e){e.eachComponent({mainType:"brush",query:t},function(e){e.setAreas(t.areas)})}),hs({type:"brushSelect",event:"brushSelected",update:"none"},function(){});var Wk={},Hk=AM.toolbox.brush;lv.defaultOption={show:!0,type:["rect","polygon","lineX","lineY","keep","clear"],icon:{rect:"M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13",polygon:"M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2",lineX:"M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4",lineY:"M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4",keep:"M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z",clear:"M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2"},title:i(Hk.title)};var Zk=lv.prototype;Zk.render=Zk.updateView=function(t,e,i){var n,o,a;e.eachComponent({mainType:"brush"},function(t){n=t.brushType,o=t.brushOption.brushMode||"single",a|=t.areas.length}),this._brushType=n,this._brushMode=o,d(t.get("type",!0),function(e){t.setIconStatus(e,("keep"===e?"multiple"===o:"clear"===e?a:e===n)?"emphasis":"normal")})},Zk.getIcons=function(){var t=this.model,e=t.get("icon",!0),i={};return d(t.get("type",!0),function(t){e[t]&&(i[t]=e[t])}),i},Zk.onclick=function(t,e,i){var n=this._brushType,o=this._brushMode;"clear"===i?(e.dispatchAction({type:"axisAreaSelect",intervals:[]}),e.dispatchAction({type:"brush",command:"clear",areas:[]})):e.dispatchAction({type:"takeGlobalCursor",key:"brush",brushOption:{brushType:"keep"===i?n:n!==i&&i,brushMode:"keep"===i?"multiple"===o?"single":"multiple":o}})},rv("brush",lv),ls(function(t,e){var i=t&&t.brush;if(y(i)||(i=i?[i]:[]),i.length){var n=[];d(i,function(t){var e=t.hasOwnProperty("toolbox")?t.toolbox:[];e instanceof Array&&(n=n.concat(e))});var o=t&&t.toolbox;y(o)&&(o=o[0]),o||(o={feature:{}},t.toolbox=[o]);var a=o.feature||(o.feature={}),r=a.brush||(a.brush={}),s=r.type||(r.type=[]);s.push.apply(s,n),Pm(s),e&&!s.length&&s.push.apply(s,bk)}});uv.prototype={constructor:uv,type:"calendar",dimensions:["time","value"],getDimensionsInfo:function(){return[{name:"time",type:"time"},"value"]},getRangeInfo:function(){return this._rangeInfo},getModel:function(){return this._model},getRect:function(){return this._rect},getCellWidth:function(){return this._sw},getCellHeight:function(){return this._sh},getOrient:function(){return this._orient},getFirstDayOfWeek:function(){return this._firstDayOfWeek},getDateInfo:function(t){var e=(t=zo(t)).getFullYear(),i=t.getMonth()+1;i=i<10?"0"+i:i;var n=t.getDate();n=n<10?"0"+n:n;var o=t.getDay();return o=Math.abs((o+7-this.getFirstDayOfWeek())%7),{y:e,m:i,d:n,day:o,time:t.getTime(),formatedDate:e+"-"+i+"-"+n,date:t}},getNextNDay:function(t,e){return 0===(e=e||0)?this.getDateInfo(t):((t=new Date(this.getDateInfo(t).time)).setDate(t.getDate()+e),this.getDateInfo(t))},update:function(t,e){function i(t,e){return null!=t[e]&&"auto"!==t[e]}this._firstDayOfWeek=+this._model.getModel("dayLabel").get("firstDay"),this._orient=this._model.get("orient"),this._lineWidth=this._model.getModel("itemStyle").getItemStyle().lineWidth||0,this._rangeInfo=this._getRangeInfo(this._initRangeOption());var n=this._rangeInfo.weeks||1,o=["width","height"],a=this._model.get("cellSize").slice(),r=this._model.getBoxLayoutParams(),s="horizontal"===this._orient?[n,7]:[7,n];d([0,1],function(t){i(a,t)&&(r[o[t]]=a[t]*s[t])});var l={width:e.getWidth(),height:e.getHeight()},u=this._rect=Qo(r,l);d([0,1],function(t){i(a,t)||(a[t]=u[o[t]]/s[t])}),this._sw=a[0],this._sh=a[1]},dataToPoint:function(t,e){y(t)&&(t=t[0]),null==e&&(e=!0);var i=this.getDateInfo(t),n=this._rangeInfo,o=i.formatedDate;if(e&&!(i.time>=n.start.time&&i.time<=n.end.time))return[NaN,NaN];var a=i.day,r=this._getRangeInfo([n.start.time,o]).nthWeek;return"vertical"===this._orient?[this._rect.x+a*this._sw+this._sw/2,this._rect.y+r*this._sh+this._sh/2]:[this._rect.x+r*this._sw+this._sw/2,this._rect.y+a*this._sh+this._sh/2]},pointToData:function(t){var e=this.pointToDate(t);return e&&e.time},dataToRect:function(t,e){var i=this.dataToPoint(t,e);return{contentShape:{x:i[0]-(this._sw-this._lineWidth)/2,y:i[1]-(this._sh-this._lineWidth)/2,width:this._sw-this._lineWidth,height:this._sh-this._lineWidth},center:i,tl:[i[0]-this._sw/2,i[1]-this._sh/2],tr:[i[0]+this._sw/2,i[1]-this._sh/2],br:[i[0]+this._sw/2,i[1]+this._sh/2],bl:[i[0]-this._sw/2,i[1]+this._sh/2]}},pointToDate:function(t){var e=Math.floor((t[0]-this._rect.x)/this._sw)+1,i=Math.floor((t[1]-this._rect.y)/this._sh)+1,n=this._rangeInfo.range;return"vertical"===this._orient?this._getDateByWeeksAndDay(i,e-1,n):this._getDateByWeeksAndDay(e,i-1,n)},convertToPixel:v(hv,"dataToPoint"),convertFromPixel:v(hv,"pointToData"),_initRangeOption:function(){var t=this._model.get("range"),e=t;if(y(e)&&1===e.length&&(e=e[0]),/^\d{4}$/.test(e)&&(t=[e+"-01-01",e+"-12-31"]),/^\d{4}[\/|-]\d{1,2}$/.test(e)){var i=this.getDateInfo(e),n=i.date;n.setMonth(n.getMonth()+1);var o=this.getNextNDay(n,-1);t=[i.formatedDate,o.formatedDate]}/^\d{4}[\/|-]\d{1,2}[\/|-]\d{1,2}$/.test(e)&&(t=[e,e]);var a=this._getRangeInfo(t);return a.start.time>a.end.time&&t.reverse(),t},_getRangeInfo:function(t){var e;(t=[this.getDateInfo(t[0]),this.getDateInfo(t[1])])[0].time>t[1].time&&(e=!0,t.reverse());var i=Math.floor(t[1].time/864e5)-Math.floor(t[0].time/864e5)+1,n=new Date(t[0].time),o=n.getDate(),a=t[1].date.getDate();if(n.setDate(o+i-1),n.getDate()!==a)for(var r=n.getTime()-t[1].time>0?1:-1;n.getDate()!==a&&(n.getTime()-t[1].time)*r>0;)i-=r,n.setDate(o+i-1);var s=Math.floor((i+t[0].day+6)/7),l=e?1-s:s-1;return e&&t.reverse(),{range:[t[0].formatedDate,t[1].formatedDate],start:t[0],end:t[1],allDay:i,weeks:s,nthWeek:l,fweek:t[0].day,lweek:t[1].day}},_getDateByWeeksAndDay:function(t,e,i){var n=this._getRangeInfo(i);if(t>n.weeks||0===t&&en.lweek)return!1;var o=7*(t-1)-n.fweek+e,a=new Date(n.start.time);return a.setDate(n.start.d+o),this.getDateInfo(a)}},uv.dimensions=uv.prototype.dimensions,uv.getDimensionsInfo=uv.prototype.getDimensionsInfo,uv.create=function(t,e){var i=[];return t.eachComponent("calendar",function(n){var o=new uv(n,t,e);i.push(o),n.coordinateSystem=o}),t.eachSeries(function(t){"calendar"===t.get("coordinateSystem")&&(t.coordinateSystem=i[t.get("calendarIndex")||0])}),i},Ca.register("calendar",uv);var Uk=kS.extend({type:"calendar",coordinateSystem:null,defaultOption:{zlevel:0,z:2,left:80,top:60,cellSize:20,orient:"horizontal",splitLine:{show:!0,lineStyle:{color:"#000",width:1,type:"solid"}},itemStyle:{color:"#fff",borderWidth:1,borderColor:"#ccc"},dayLabel:{show:!0,firstDay:0,position:"start",margin:"50%",nameMap:"en",color:"#000"},monthLabel:{show:!0,position:"start",margin:5,align:"center",nameMap:"en",formatter:null,color:"#000"},yearLabel:{show:!0,position:null,margin:30,formatter:null,color:"#ccc",fontFamily:"sans-serif",fontWeight:"bolder",fontSize:20}},init:function(t,e,i,n){var o=na(t);Uk.superApply(this,"init",arguments),cv(t,o)},mergeOption:function(t,e){Uk.superApply(this,"mergeOption",arguments),cv(this.option,t)}}),jk={EN:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],CN:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},Xk={EN:["S","M","T","W","T","F","S"],CN:["日","一","二","三","四","五","六"]};vs({type:"calendar",_tlpoints:null,_blpoints:null,_firstDayOfMonth:null,_firstDayPoints:null,render:function(t,e,i){var n=this.group;n.removeAll();var o=t.coordinateSystem,a=o.getRangeInfo(),r=o.getOrient();this._renderDayRect(t,a,n),this._renderLines(t,a,r,n),this._renderYearText(t,a,r,n),this._renderMonthText(t,r,n),this._renderWeekText(t,a,r,n)},_renderDayRect:function(t,e,i){for(var n=t.coordinateSystem,o=t.getModel("itemStyle").getItemStyle(),a=n.getCellWidth(),r=n.getCellHeight(),s=e.start.time;s<=e.end.time;s=n.getNextNDay(s,1).time){var l=n.dataToRect([s],!1).tl,u=new jb({shape:{x:l[0],y:l[1],width:a,height:r},cursor:"default",style:o});i.add(u)}},_renderLines:function(t,e,i,n){function o(e){a._firstDayOfMonth.push(r.getDateInfo(e)),a._firstDayPoints.push(r.dataToRect([e],!1).tl);var o=a._getLinePointsOfOneWeek(t,e,i);a._tlpoints.push(o[0]),a._blpoints.push(o[o.length-1]),l&&a._drawSplitline(o,s,n)}var a=this,r=t.coordinateSystem,s=t.getModel("splitLine.lineStyle").getLineStyle(),l=t.get("splitLine.show"),u=s.lineWidth;this._tlpoints=[],this._blpoints=[],this._firstDayOfMonth=[],this._firstDayPoints=[];for(var h=e.start,c=0;h.time<=e.end.time;c++){o(h.formatedDate),0===c&&(h=r.getDateInfo(e.start.y+"-"+e.start.m));var d=h.date;d.setMonth(d.getMonth()+1),h=r.getDateInfo(d)}o(r.getNextNDay(e.end.time,1).formatedDate),l&&this._drawSplitline(a._getEdgesPoints(a._tlpoints,u,i),s,n),l&&this._drawSplitline(a._getEdgesPoints(a._blpoints,u,i),s,n)},_getEdgesPoints:function(t,e,i){var n=[t[0].slice(),t[t.length-1].slice()],o="horizontal"===i?0:1;return n[0][o]=n[0][o]-e/2,n[1][o]=n[1][o]+e/2,n},_drawSplitline:function(t,e,i){var n=new Ub({z2:20,shape:{points:t},style:e});i.add(n)},_getLinePointsOfOneWeek:function(t,e,i){var n=t.coordinateSystem;e=n.getDateInfo(e);for(var o=[],a=0;a<7;a++){var r=n.getNextNDay(e.time,a),s=n.dataToRect([r.time],!1);o[2*r.day]=s.tl,o[2*r.day+1]=s["horizontal"===i?"bl":"tr"]}return o},_formatterLabel:function(t,e){return"string"==typeof t&&t?jo(t,e):"function"==typeof t?t(e):e.nameMap},_yearTextPositionControl:function(t,e,i,n,o){e=e.slice();var a=["center","bottom"];"bottom"===n?(e[1]+=o,a=["center","top"]):"left"===n?e[0]-=o:"right"===n?(e[0]+=o,a=["center","top"]):e[1]-=o;var r=0;return"left"!==n&&"right"!==n||(r=Math.PI/2),{rotation:r,position:e,style:{textAlign:a[0],textVerticalAlign:a[1]}}},_renderYearText:function(t,e,i,n){var o=t.getModel("yearLabel");if(o.get("show")){var a=o.get("margin"),r=o.get("position");r||(r="horizontal"!==i?"top":"left");var s=[this._tlpoints[this._tlpoints.length-1],this._blpoints[0]],l=(s[0][0]+s[1][0])/2,u=(s[0][1]+s[1][1])/2,h="horizontal"===i?0:1,c={top:[l,s[h][1]],bottom:[l,s[1-h][1]],left:[s[1-h][0],u],right:[s[h][0],u]},d=e.start.y;+e.end.y>+e.start.y&&(d=d+"-"+e.end.y);var f=o.get("formatter"),p={start:e.start.y,end:e.end.y,nameMap:d},g=this._formatterLabel(f,p),m=new zb({z2:30});no(m.style,o,{text:g}),m.attr(this._yearTextPositionControl(m,c[r],i,r,a)),n.add(m)}},_monthTextPositionControl:function(t,e,i,n,o){var a="left",r="top",s=t[0],l=t[1];return"horizontal"===i?(l+=o,e&&(a="center"),"start"===n&&(r="bottom")):(s+=o,e&&(r="middle"),"start"===n&&(a="right")),{x:s,y:l,textAlign:a,textVerticalAlign:r}},_renderMonthText:function(t,e,i){var n=t.getModel("monthLabel");if(n.get("show")){var o=n.get("nameMap"),r=n.get("margin"),s=n.get("position"),l=n.get("align"),u=[this._tlpoints,this._blpoints];_(o)&&(o=jk[o.toUpperCase()]||[]);var h="start"===s?0:1,c="horizontal"===e?0:1;r="start"===s?-r:r;for(var d="center"===l,f=0;f=r[0]&&t<=r[1]}if(t===this._dataZoomModel){var n=this._dimName,o=this.getTargetSeriesModels(),a=t.get("filterMode"),r=this._valueWindow;"none"!==a&&$k(o,function(t){var e=t.getData(),o=e.mapDimension(n,!0);"weakFilter"===a?e.filterSelf(function(t){for(var i,n,a,s=0;sr[1];if(u&&!h&&!c)return!0;u&&(a=!0),h&&(i=!0),c&&(n=!0)}return a&&i&&n}):$k(o,function(n){if("empty"===a)t.setData(e.map(n,function(t){return i(t)?t:NaN}));else{var o={};o[n]=r,e.selectRange(o)}}),$k(o,function(t){e.setApproximateExtent(r,t)})})}}};var Qk=d,tP=qk,eP=ms({type:"dataZoom",dependencies:["xAxis","yAxis","zAxis","radiusAxis","angleAxis","singleAxis","series"],defaultOption:{zlevel:0,z:4,orient:null,xAxisIndex:null,yAxisIndex:null,filterMode:"filter",throttle:null,start:0,end:100,startValue:null,endValue:null,minSpan:null,maxSpan:null,minValueSpan:null,maxValueSpan:null,rangeMode:null},init:function(t,e,i){this._dataIntervalByAxis={},this._dataInfo={},this._axisProxies={},this.textStyleModel,this._autoThrottle=!0,this._rangePropMode=["percent","percent"];var n=yv(t);this.mergeDefaultAndTheme(t,i),this.doInit(n)},mergeOption:function(t){var e=yv(t);n(this.option,t,!0),this.doInit(e)},doInit:function(t){var e=this.option;Ax.canvasSupported||(e.realtime=!1),this._setDefaultThrottle(t),xv(this,t),Qk([["start","startValue"],["end","endValue"]],function(t,i){"value"===this._rangePropMode[i]&&(e[t[0]]=null)},this),this.textStyleModel=this.getModel("textStyle"),this._resetTarget(),this._giveAxisProxies()},_giveAxisProxies:function(){var t=this._axisProxies;this.eachTargetAxis(function(e,i,n,o){var a=this.dependentModels[e.axis][i],r=a.__dzAxisProxy||(a.__dzAxisProxy=new Jk(e.name,i,this,o));t[e.name+"_"+i]=r},this)},_resetTarget:function(){var t=this.option,e=this._judgeAutoMode();tP(function(e){var i=e.axisIndex;t[i]=Si(t[i])},this),"axisIndex"===e?this._autoSetAxisIndex():"orient"===e&&this._autoSetOrient()},_judgeAutoMode:function(){var t=this.option,e=!1;tP(function(i){null!=t[i.axisIndex]&&(e=!0)},this);var i=t.orient;return null==i&&e?"orient":e?void 0:(null==i&&(t.orient="horizontal"),"axisIndex")},_autoSetAxisIndex:function(){var t=!0,e=this.get("orient",!0),i=this.option,n=this.dependentModels;if(t){var o="vertical"===e?"y":"x";n[o+"Axis"].length?(i[o+"AxisIndex"]=[0],t=!1):Qk(n.singleAxis,function(n){t&&n.get("orient",!0)===e&&(i.singleAxisIndex=[n.componentIndex],t=!1)})}t&&tP(function(e){if(t){var n=[],o=this.dependentModels[e.axis];if(o.length&&!n.length)for(var a=0,r=o.length;a0?100:20}},getFirstTargetAxisModel:function(){var t;return tP(function(e){if(null==t){var i=this.get(e.axisIndex);i.length&&(t=this.dependentModels[e.axis][i[0]])}},this),t},eachTargetAxis:function(t,e){var i=this.ecModel;tP(function(n){Qk(this.get(n.axisIndex),function(o){t.call(e,n,o,this,i)},this)},this)},getAxisProxy:function(t,e){return this._axisProxies[t+"_"+e]},getAxisModel:function(t,e){var i=this.getAxisProxy(t,e);return i&&i.getAxisModel()},setRawRange:function(t,e){var i=this.option;Qk([["start","startValue"],["end","endValue"]],function(e){null==t[e[0]]&&null==t[e[1]]||(i[e[0]]=t[e[0]],i[e[1]]=t[e[1]])},this),!e&&xv(this,t)},getPercentRange:function(){var t=this.findRepresentativeAxisProxy();if(t)return t.getDataPercentWindow()},getValueRange:function(t,e){if(null!=t||null!=e)return this.getAxisProxy(t,e).getDataValueWindow();var i=this.findRepresentativeAxisProxy();return i?i.getDataValueWindow():void 0},findRepresentativeAxisProxy:function(t){if(t)return t.__dzAxisProxy;var e=this._axisProxies;for(var i in e)if(e.hasOwnProperty(i)&&e[i].hostedBy(this))return e[i];for(var i in e)if(e.hasOwnProperty(i)&&!e[i].hostedBy(this))return e[i]},getRangePropMode:function(){return this._rangePropMode.slice()}}),iP=vM.extend({type:"dataZoom",render:function(t,e,i,n){this.dataZoomModel=t,this.ecModel=e,this.api=i},getTargetCoordInfo:function(){function t(t,e,i,n){for(var o,a=0;a0&&e%g)p+=f;else{var i=null==t||isNaN(t)||""===t,n=i?0:oP(t,a,u,!0);i&&!l&&e?(c.push([c[c.length-1][0],0]),d.push([d[d.length-1][0],0])):!i&&l&&(c.push([p,0]),d.push([p,0])),c.push([p,n]),d.push([p,n]),p+=f,l=i}});var m=this.dataZoomModel;this._displayables.barGroup.add(new Zb({shape:{points:c},style:r({fill:m.get("dataBackgroundColor")},m.getModel("dataBackground.areaStyle").getAreaStyle()),silent:!0,z2:-20})),this._displayables.barGroup.add(new Ub({shape:{points:d},style:m.getModel("dataBackground.lineStyle").getLineStyle(),silent:!0,z2:-19}))}}},_prepareDataShadowInfo:function(){var t=this.dataZoomModel,e=t.get("showDataShadow");if(!1!==e){var i,n=this.ecModel;return t.eachTargetAxis(function(o,a){d(t.getAxisProxy(o.name,a).getTargetSeriesModels(),function(t){if(!(i||!0!==e&&l(hP,t.get("type"))<0)){var r,s=n.getComponent(o.axis,a).axis,u=_v(o.name),h=t.coordinateSystem;null!=u&&h.getOtherAxis&&(r=h.getOtherAxis(s).inverse),u=t.getData().mapDimension(u),i={thisAxis:s,series:t,thisDim:o.name,otherDim:u,otherAxisInverse:r}}},this)},this),i}},_renderHandle:function(){var t=this._displayables,e=t.handles=[],i=t.handleLabels=[],n=this._displayables.barGroup,o=this._size,a=this.dataZoomModel;n.add(t.filler=new nP({draggable:!0,cursor:wv(this._orient),drift:rP(this._onDragMove,this,"all"),onmousemove:function(t){rw(t.event)},ondragstart:rP(this._showDataInfo,this,!0),ondragend:rP(this._onDragEnd,this),onmouseover:rP(this._showDataInfo,this,!0),onmouseout:rP(this._showDataInfo,this,!1),style:{fill:a.get("fillerColor"),textPosition:"inside"}})),n.add(new nP(Fn({silent:!0,shape:{x:0,y:0,width:o[0],height:o[1]},style:{stroke:a.get("dataBackgroundColor")||a.get("borderColor"),lineWidth:1,fill:"rgba(0,0,0,0)"}}))),sP([0,1],function(t){var o=_o(a.get("handleIcon"),{cursor:wv(this._orient),draggable:!0,drift:rP(this._onDragMove,this,t),onmousemove:function(t){rw(t.event)},ondragend:rP(this._onDragEnd,this),onmouseover:rP(this._showDataInfo,this,!0),onmouseout:rP(this._showDataInfo,this,!1)},{x:-1,y:0,width:2,height:2}),r=o.getBoundingRect();this._handleHeight=To(a.get("handleSize"),this._size[1]),this._handleWidth=r.width/r.height*this._handleHeight,o.setStyle(a.getModel("handleStyle").getItemStyle());var s=a.get("handleColor");null!=s&&(o.style.fill=s),n.add(e[t]=o);var l=a.textStyleModel;this.group.add(i[t]=new zb({silent:!0,invisible:!0,style:{x:0,y:0,text:"",textVerticalAlign:"middle",textAlign:"center",textFill:l.getTextColor(),textFont:l.getFont()},z2:10}))},this)},_resetInterval:function(){var t=this._range=this.dataZoomModel.getPercentRange(),e=this._getViewExtent();this._handleEnds=[oP(t[0],[0,100],e,!0),oP(t[1],[0,100],e,!0)]},_updateInterval:function(t,e){var i=this.dataZoomModel,n=this._handleEnds,o=this._getViewExtent(),a=i.findRepresentativeAxisProxy().getMinMaxSpan(),r=[0,100];eC(e,n,o,i.get("zoomLock")?"all":t,null!=a.minSpan?oP(a.minSpan,r,o,!0):null,null!=a.maxSpan?oP(a.maxSpan,r,o,!0):null),this._range=aP([oP(n[0],o,r,!0),oP(n[1],o,r,!0)])},_updateView:function(t){var e=this._displayables,i=this._handleEnds,n=aP(i.slice()),o=this._size;sP([0,1],function(t){var n=e.handles[t],a=this._handleHeight;n.attr({scale:[a/2,a/2],position:[i[t],o[1]/2-a/2]})},this),e.filler.setShape({x:n[0],y:0,width:n[1]-n[0],height:o[1]}),this._updateDataInfo(t)},_updateDataInfo:function(t){function e(t){var e=go(n.handles[t].parent,this.group),i=vo(0===t?"right":"left",e),s=this._handleWidth/2+uP,l=mo([c[t]+(0===t?-s:s),this._size[1]/2],e);o[t].setStyle({x:l[0],y:l[1],textVerticalAlign:a===lP?"middle":i,textAlign:a===lP?i:"center",text:r[t]})}var i=this.dataZoomModel,n=this._displayables,o=n.handleLabels,a=this._orient,r=["",""];if(i.get("showDetail")){var s=i.findRepresentativeAxisProxy();if(s){var l=s.getAxisModel().axis,u=this._range,h=t?s.calculateDataWindow({start:u[0],end:u[1]}).valueWindow:s.getDataValueWindow();r=[this._formatLabel(h[0],l),this._formatLabel(h[1],l)]}}var c=aP(this._handleEnds.slice());e.call(this,0),e.call(this,1)},_formatLabel:function(t,e){var i=this.dataZoomModel,n=i.get("labelFormatter"),o=i.get("labelPrecision");null!=o&&"auto"!==o||(o=e.getPixelPrecision());var a=null==t||isNaN(t)?"":"category"===e.type||"time"===e.type?e.scale.getLabel(Math.round(t)):t.toFixed(Math.min(o,20));return x(n)?n(t,a):_(n)?n.replace("{value}",a):a},_showDataInfo:function(t){t=this._dragging||t;var e=this._displayables.handleLabels;e[0].attr("invisible",!t),e[1].attr("invisible",!t)},_onDragMove:function(t,e,i){this._dragging=!0;var n=mo([e,i],this._displayables.barGroup.getLocalTransform(),!0);this._updateInterval(t,n[0]);var o=this.dataZoomModel.get("realtime");this._updateView(!o),o&&this._dispatchZoomAction()},_onDragEnd:function(){this._dragging=!1,this._showDataInfo(!1),!this.dataZoomModel.get("realtime")&&this._dispatchZoomAction()},_onClickPanelClick:function(t){var e=this._size,i=this._displayables.barGroup.transformCoordToLocal(t.offsetX,t.offsetY);if(!(i[0]<0||i[0]>e[0]||i[1]<0||i[1]>e[1])){var n=this._handleEnds,o=(n[0]+n[1])/2;this._updateInterval("all",i[0]-o),this._updateView(),this._dispatchZoomAction()}},_dispatchZoomAction:function(){var t=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,start:t[0],end:t[1]})},_findCoordRect:function(){var t;if(sP(this.getTargetCoordInfo(),function(e){if(!t&&e.length){var i=e[0].model.coordinateSystem;t=i.getRect&&i.getRect()}}),!t){var e=this.api.getWidth(),i=this.api.getHeight();t={x:.2*e,y:.2*i,width:.6*e,height:.6*i}}return t}});eP.extend({type:"dataZoom.inside",defaultOption:{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,preventDefaultMouseMove:!0}});var dP=v,fP="\0_ec_dataZoom_roams",pP=m,gP=iP.extend({type:"dataZoom.inside",init:function(t,e){this._range},render:function(t,e,i,n){gP.superApply(this,"render",arguments),Mv(n,t.id)&&(this._range=t.getPercentRange()),d(this.getTargetCoordInfo(),function(e,n){var o=f(e,function(t){return Iv(t.model)});d(e,function(e){var a=e.model,r=t.option;bv(i,{coordId:Iv(a),allCoordIds:o,containsPoint:function(t,e,i){return a.coordinateSystem.containPoint([e,i])},dataZoomId:t.id,throttleRate:t.get("throttle",!0),panGetRange:pP(this._onPan,this,e,n),zoomGetRange:pP(this._onZoom,this,e,n),zoomLock:r.zoomLock,disabled:r.disabled,roamControllerOpt:{zoomOnMouseWheel:r.zoomOnMouseWheel,moveOnMouseMove:r.moveOnMouseMove,preventDefaultMouseMove:r.preventDefaultMouseMove}})},this)},this)},dispose:function(){Sv(this.api,this.dataZoomModel.id),gP.superApply(this,"dispose",arguments),this._range=null},_onPan:function(t,e,i,n,o,a,r,s,l){var u=this._range.slice(),h=t.axisModels[0];if(h){var c=mP[e]([a,r],[s,l],h,i,t),d=c.signal*(u[1]-u[0])*c.pixel/c.pixelLength;return eC(d,u,[0,100],"all"),this._range=u}},_onZoom:function(t,e,i,n,o,a){var r=this._range.slice(),s=t.axisModels[0];if(s){var l=mP[e](null,[o,a],s,i,t),u=(l.signal>0?l.pixelStart+l.pixelLength-l.pixel:l.pixel-l.pixelStart)/l.pixelLength*(r[1]-r[0])+r[0];n=Math.max(1/n,0),r[0]=(r[0]-u)*n+u,r[1]=(r[1]-u)*n+u;var h=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();return eC(0,r,[0,100],0,h.minSpan,h.maxSpan),this._range=r}}}),mP={grid:function(t,e,i,n,o){var a=i.axis,r={},s=o.model.coordinateSystem.getRect();return t=t||[0,0],"x"===a.dim?(r.pixel=e[0]-t[0],r.pixelLength=s.width,r.pixelStart=s.x,r.signal=a.inverse?1:-1):(r.pixel=e[1]-t[1],r.pixelLength=s.height,r.pixelStart=s.y,r.signal=a.inverse?-1:1),r},polar:function(t,e,i,n,o){var a=i.axis,r={},s=o.model.coordinateSystem,l=s.getRadiusAxis().getExtent(),u=s.getAngleAxis().getExtent();return t=t?s.pointToCoord(t):[0,0],e=s.pointToCoord(e),"radiusAxis"===i.mainType?(r.pixel=e[0]-t[0],r.pixelLength=l[1]-l[0],r.pixelStart=l[0],r.signal=a.inverse?1:-1):(r.pixel=e[1]-t[1],r.pixelLength=u[1]-u[0],r.pixelStart=u[0],r.signal=a.inverse?-1:1),r},singleAxis:function(t,e,i,n,o){var a=i.axis,r=o.model.coordinateSystem.getRect(),s={};return t=t||[0,0],"horizontal"===a.orient?(s.pixel=e[0]-t[0],s.pixelLength=r.width,s.pixelStart=r.x,s.signal=a.inverse?1:-1):(s.pixel=e[1]-t[1],s.pixelLength=r.height,s.pixelStart=r.y,s.signal=a.inverse?-1:1),s}};us({getTargetSeries:function(t){var e=z();return t.eachComponent("dataZoom",function(t){t.eachTargetAxis(function(t,i,n){d(n.getAxisProxy(t.name,i).getTargetSeriesModels(),function(t){e.set(t.uid,t)})})}),e},isOverallFilter:!0,overallReset:function(t,e){t.eachComponent("dataZoom",function(t){t.eachTargetAxis(function(t,i,n){n.getAxisProxy(t.name,i).reset(n,e)}),t.eachTargetAxis(function(t,i,n){n.getAxisProxy(t.name,i).filterData(n,e)})}),t.eachComponent("dataZoom",function(t){var e=t.findRepresentativeAxisProxy(),i=e.getDataPercentWindow(),n=e.getDataValueWindow();t.setRawRange({start:i[0],end:i[1],startValue:n[0],endValue:n[1]},!0)})}}),hs("dataZoom",function(t,e){var i=fv(m(e.eachComponent,e,"dataZoom"),qk,function(t,e){return t.get(e.axisIndex)}),n=[];e.eachComponent({mainType:"dataZoom",query:t},function(t,e){n.push.apply(n,i(t).nodes)}),d(n,function(e,i){e.setRawRange({start:t.start,end:t.end,startValue:t.startValue,endValue:t.endValue})})});var vP=d,yP=function(t){var e=t&&t.visualMap;y(e)||(e=e?[e]:[]),vP(e,function(t){if(t){Ov(t,"splitList")&&!Ov(t,"pieces")&&(t.pieces=t.splitList,delete t.splitList);var e=t.pieces;e&&y(e)&&vP(e,function(t){w(t)&&(Ov(t,"start")&&!Ov(t,"min")&&(t.min=t.start),Ov(t,"end")&&!Ov(t,"max")&&(t.max=t.end))})}})};kS.registerSubTypeDefaulter("visualMap",function(t){return t.categories||(t.pieces?t.pieces.length>0:t.splitNumber>0)&&!t.calculable?"piecewise":"continuous"});var xP=qM.VISUAL.COMPONENT;fs(xP,{createOnAllSeries:!0,reset:function(t,e){var i=[];return e.eachComponent("visualMap",function(e){e.isTargetSeries(t)&&i.push(Rm(e.stateList,e.targetVisuals,m(e.getValueState,e),e.getDataDimension(t.getData())))}),i}}),fs(xP,{createOnAllSeries:!0,reset:function(t,e){var i=t.getData(),n=[];e.eachComponent("visualMap",function(e){if(e.isTargetSeries(t)){var o=e.getVisualMeta(m(Ev,null,t,e))||{stops:[],outerColors:[]},a=e.getDataDimension(i),r=i.getDimensionInfo(a);null!=r&&(o.dimension=r.index,n.push(o))}}),t.getData().setVisual("visualMeta",n)}});var _P={get:function(t,e,n){var o=i((wP[t]||{})[e]);return n&&y(o)?o[o.length-1]:o}},wP={color:{active:["#006edd","#e0ffff"],inactive:["rgba(0,0,0,0)"]},colorHue:{active:[0,360],inactive:[0,0]},colorSaturation:{active:[.3,1],inactive:[0,0]},colorLightness:{active:[.9,.5],inactive:[0,0]},colorAlpha:{active:[.3,1],inactive:[0,0]},opacity:{active:[.3,1],inactive:[0,0]},symbol:{active:["circle","roundRect","diamond"],inactive:["none"]},symbolSize:{active:[10,50],inactive:[0,0]}},bP=fA.mapVisual,SP=fA.eachVisual,MP=y,IP=d,DP=Co,TP=Do,AP=B,CP=ms({type:"visualMap",dependencies:["series"],stateList:["inRange","outOfRange"],replacableOptionKeys:["inRange","outOfRange","target","controller","color"],dataBound:[-1/0,1/0],layoutMode:{type:"box",ignoreSize:!0},defaultOption:{show:!0,zlevel:0,z:4,seriesIndex:"all",min:0,max:200,dimension:null,inRange:null,outOfRange:null,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:"vertical",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",contentColor:"#5793f3",inactiveColor:"#aaa",borderWidth:0,padding:5,textGap:10,precision:0,color:null,formatter:null,text:null,textStyle:{color:"#333"}},init:function(t,e,i){this._dataExtent,this.targetVisuals={},this.controllerVisuals={},this.textStyleModel,this.itemSize,this.mergeDefaultAndTheme(t,i)},optionUpdated:function(t,e){var i=this.option;Ax.canvasSupported||(i.realtime=!1),!e&&Em(i,t,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},resetVisual:function(t){var e=this.stateList;t=m(t,this),this.controllerVisuals=Om(this.option.controller,e,t),this.targetVisuals=Om(this.option.target,e,t)},getTargetSeriesIndices:function(){var t=this.option.seriesIndex,e=[];return null==t||"all"===t?this.ecModel.eachSeries(function(t,i){e.push(i)}):e=Si(t),e},eachTargetSeries:function(t,e){d(this.getTargetSeriesIndices(),function(i){t.call(e,this.ecModel.getSeriesByIndex(i))},this)},isTargetSeries:function(t){var e=!1;return this.eachTargetSeries(function(i){i===t&&(e=!0)}),e},formatValueText:function(t,e,i){function n(t){return t===l[0]?"min":t===l[1]?"max":(+t).toFixed(Math.min(s,20))}var o,a,r=this.option,s=r.precision,l=this.dataBound,u=r.formatter;return i=i||["<",">"],y(t)&&(t=t.slice(),o=!0),a=e?t:o?[n(t[0]),n(t[1])]:n(t),_(u)?u.replace("{value}",o?a[0]:a).replace("{value2}",o?a[1]:a):x(u)?o?u(t[0],t[1]):u(t):o?t[0]===l[0]?i[0]+" "+a[1]:t[1]===l[1]?i[1]+" "+a[0]:a[0]+" - "+a[1]:a},resetExtent:function(){var t=this.option,e=DP([t.min,t.max]);this._dataExtent=e},getDataDimension:function(t){var e=this.option.dimension,i=t.dimensions;if(null!=e||i.length){if(null!=e)return t.getDimension(e);for(var n=t.dimensions,o=n.length-1;o>=0;o--){var a=n[o];if(!t.getDimensionInfo(a).isCalculationCoord)return a}}},getExtent:function(){return this._dataExtent.slice()},completeVisualOption:function(){function t(t){MP(o.color)&&!t.inRange&&(t.inRange={color:o.color.slice().reverse()}),t.inRange=t.inRange||{color:e.get("gradientColor")},IP(this.stateList,function(e){var i=t[e];if(_(i)){var n=_P.get(i,"active",l);n?(t[e]={},t[e][i]=n):delete t[e]}},this)}var e=this.ecModel,o=this.option,a={inRange:o.inRange,outOfRange:o.outOfRange},r=o.target||(o.target={}),s=o.controller||(o.controller={});n(r,a),n(s,a);var l=this.isCategory();t.call(this,r),t.call(this,s),function(t,e,i){var n=t[e],o=t[i];n&&!o&&(o=t[i]={},IP(n,function(t,e){if(fA.isValidType(e)){var i=_P.get(e,"inactive",l);null!=i&&(o[e]=i,"color"!==e||o.hasOwnProperty("opacity")||o.hasOwnProperty("colorAlpha")||(o.opacity=[0,0]))}}))}.call(this,r,"inRange","outOfRange"),function(t){var e=(t.inRange||{}).symbol||(t.outOfRange||{}).symbol,n=(t.inRange||{}).symbolSize||(t.outOfRange||{}).symbolSize,o=this.get("inactiveColor");IP(this.stateList,function(a){var r=this.itemSize,s=t[a];s||(s=t[a]={color:l?o:[o]}),null==s.symbol&&(s.symbol=e&&i(e)||(l?"roundRect":["roundRect"])),null==s.symbolSize&&(s.symbolSize=n&&i(n)||(l?r[0]:[r[0],r[0]])),s.symbol=bP(s.symbol,function(t){return"none"===t||"square"===t?"roundRect":t});var u=s.symbolSize;if(null!=u){var h=-1/0;SP(u,function(t){t>h&&(h=t)}),s.symbolSize=bP(u,function(t){return TP(t,[0,h],[0,r[0]],!0)})}},this)}.call(this,s)},resetItemSize:function(){this.itemSize=[parseFloat(this.get("itemWidth")),parseFloat(this.get("itemHeight"))]},isCategory:function(){return!!this.option.categories},setSelected:AP,getValueState:AP,getVisualMeta:AP}),LP=[20,140],kP=CP.extend({type:"visualMap.continuous",defaultOption:{align:"auto",calculable:!1,range:null,realtime:!0,itemHeight:null,itemWidth:null,hoverLink:!0,hoverLinkDataSize:null,hoverLinkOnHandle:null},optionUpdated:function(t,e){kP.superApply(this,"optionUpdated",arguments),this.resetExtent(),this.resetVisual(function(t){t.mappingMethod="linear",t.dataExtent=this.getExtent()}),this._resetRange()},resetItemSize:function(){kP.superApply(this,"resetItemSize",arguments);var t=this.itemSize;"horizontal"===this._orient&&t.reverse(),(null==t[0]||isNaN(t[0]))&&(t[0]=LP[0]),(null==t[1]||isNaN(t[1]))&&(t[1]=LP[1])},_resetRange:function(){var t=this.getExtent(),e=this.option.range;!e||e.auto?(t.auto=1,this.option.range=t):y(e)&&(e[0]>e[1]&&e.reverse(),e[0]=Math.max(e[0],t[0]),e[1]=Math.min(e[1],t[1]))},completeVisualOption:function(){CP.prototype.completeVisualOption.apply(this,arguments),d(this.stateList,function(t){var e=this.option.controller[t].symbolSize;e&&e[0]!==e[1]&&(e[0]=0)},this)},setSelected:function(t){this.option.range=t.slice(),this._resetRange()},getSelected:function(){var t=this.getExtent(),e=Co((this.get("range")||[]).slice());return e[0]>t[1]&&(e[0]=t[1]),e[1]>t[1]&&(e[1]=t[1]),e[0]=i[1]||t<=e[1])?"inRange":"outOfRange"},findTargetDataIndices:function(t){var e=[];return this.eachTargetSeries(function(i){var n=[],o=i.getData();o.each(this.getDataDimension(o),function(e,i){t[0]<=e&&e<=t[1]&&n.push(i)},this),e.push({seriesId:i.id,dataIndex:n})},this),e},getVisualMeta:function(t){function e(e,i){o.push({value:e,color:t(e,i)})}for(var i=zv(0,0,this.getExtent()),n=zv(0,0,this.option.range.slice()),o=[],a=0,r=0,s=n.length,l=i.length;rt[1])break;i.push({color:this.getControllerVisual(a,"color",e),offset:o/100})}return i.push({color:this.getControllerVisual(t[1],"color",e),offset:1}),i},_createBarPoints:function(t,e){var i=this.visualMapModel.itemSize;return[[i[0]-e[0],t[0]],[i[0],t[0]],[i[0],t[1]],[i[0]-e[1],t[1]]]},_createBarGroup:function(t){var e=this._orient,i=this.visualMapModel.get("inverse");return new L_("horizontal"!==e||i?"horizontal"===e&&i?{scale:"bottom"===t?[-1,1]:[1,1],rotation:-Math.PI/2}:"vertical"!==e||i?{scale:"left"===t?[1,1]:[-1,1]}:{scale:"left"===t?[1,-1]:[-1,-1]}:{scale:"bottom"===t?[1,1]:[-1,1],rotation:Math.PI/2})},_updateHandle:function(t,e){if(this._useHandle){var i=this._shapes,n=this.visualMapModel,o=i.handleThumbs,a=i.handleLabels;OP([0,1],function(r){var s=o[r];s.setStyle("fill",e.handlesColor[r]),s.position[1]=t[r];var l=mo(i.handleLabelPoints[r],go(s,this.group));a[r].setStyle({x:l[0],y:l[1],text:n.formatValueText(this._dataInterval[r]),textVerticalAlign:"middle",textAlign:this._applyTransform("horizontal"===this._orient?0===r?"bottom":"top":"left",i.barGroup)})},this)}},_showIndicator:function(t,e,i,n){var o=this.visualMapModel,a=o.getExtent(),r=o.itemSize,s=[0,r[1]],l=NP(t,a,s,!0),u=this._shapes,h=u.indicator;if(h){h.position[1]=l,h.attr("invisible",!1),h.setShape("points",Fv(!!i,n,l,r[1]));var c={convertOpacityToAlpha:!0},d=this.getControllerVisual(t,"color",c);h.setStyle("fill",d);var f=mo(u.indicatorLabelPoint,go(h,this.group)),p=u.indicatorLabel;p.attr("invisible",!1);var g=this._applyTransform("left",u.barGroup),m=this._orient;p.setStyle({text:(i||"")+o.formatValueText(e),textVerticalAlign:"horizontal"===m?g:"middle",textAlign:"horizontal"===m?"center":g,x:f[0],y:f[1]})}},_enableHoverLinkToSeries:function(){var t=this;this._shapes.barGroup.on("mousemove",function(e){if(t._hovering=!0,!t._dragging){var i=t.visualMapModel.itemSize,n=t._applyTransform([e.offsetX,e.offsetY],t._shapes.barGroup,!0,!0);n[1]=EP(zP(0,n[1]),i[1]),t._doHoverLinkToSeries(n[1],0<=n[0]&&n[0]<=i[0])}}).on("mouseout",function(){t._hovering=!1,!t._dragging&&t._clearHoverLinkToSeries()})},_enableHoverLinkFromSeries:function(){var t=this.api.getZr();this.visualMapModel.option.hoverLink?(t.on("mouseover",this._hoverLinkFromSeriesMouseOver,this),t.on("mouseout",this._hideIndicator,this)):this._clearHoverLinkFromSeries()},_doHoverLinkToSeries:function(t,e){var i=this.visualMapModel,n=i.itemSize;if(i.option.hoverLink){var o=[0,n[1]],a=i.getExtent();t=EP(zP(o[0],t),o[1]);var r=Wv(i,a,o),s=[t-r,t+r],l=NP(t,o,a,!0),u=[NP(s[0],o,a,!0),NP(s[1],o,a,!0)];s[0]o[1]&&(u[1]=1/0),e&&(u[0]===-1/0?this._showIndicator(l,u[1],"< ",r):u[1]===1/0?this._showIndicator(l,u[0],"> ",r):this._showIndicator(l,l,"≈ ",r));var h=this._hoverLinkDataIndices,c=[];(e||Hv(i))&&(c=this._hoverLinkDataIndices=i.findTargetDataIndices(u));var d=ki(h,c);this._dispatchHighDown("downplay",Bv(d[0])),this._dispatchHighDown("highlight",Bv(d[1]))}},_hoverLinkFromSeriesMouseOver:function(t){var e=t.target,i=this.visualMapModel;if(e&&null!=e.dataIndex){var n=this.ecModel.getSeriesByIndex(e.seriesIndex);if(i.isTargetSeries(n)){var o=n.getData(e.dataType),a=o.get(i.getDataDimension(o),e.dataIndex,!0);isNaN(a)||this._showIndicator(a,a)}}},_hideIndicator:function(){var t=this._shapes;t.indicator&&t.indicator.attr("invisible",!0),t.indicatorLabel&&t.indicatorLabel.attr("invisible",!0)},_clearHoverLinkToSeries:function(){this._hideIndicator();var t=this._hoverLinkDataIndices;this._dispatchHighDown("downplay",Bv(t)),t.length=0},_clearHoverLinkFromSeries:function(){this._hideIndicator();var t=this.api.getZr();t.off("mouseover",this._hoverLinkFromSeriesMouseOver),t.off("mouseout",this._hideIndicator)},_applyTransform:function(t,e,i,n){var o=go(e,n?null:this.group);return sS[y(t)?"applyTransform":"transformDirection"](t,o,i)},_dispatchHighDown:function(t,e){e&&e.length&&this.api.dispatchAction({type:t,batch:e})},dispose:function(){this._clearHoverLinkFromSeries(),this._clearHoverLinkToSeries()},remove:function(){this._clearHoverLinkFromSeries(),this._clearHoverLinkToSeries()}});hs({type:"selectDataRange",event:"dataRangeSelected",update:"update"},function(t,e){e.eachComponent({mainType:"visualMap",query:t},function(e){e.setSelected(t.selected)})}),ls(yP);var GP=CP.extend({type:"visualMap.piecewise",defaultOption:{selected:null,minOpen:!1,maxOpen:!1,align:"auto",itemWidth:20,itemHeight:14,itemSymbol:"roundRect",pieceList:null,categories:null,splitNumber:5,selectedMode:"multiple",itemGap:10,hoverLink:!0,showLabel:null},optionUpdated:function(t,e){GP.superApply(this,"optionUpdated",arguments),this._pieceList=[],this.resetExtent();var n=this._mode=this._determineMode();FP[this._mode].call(this),this._resetSelected(t,e);var o=this.option.categories;this.resetVisual(function(t,e){"categories"===n?(t.mappingMethod="category",t.categories=i(o)):(t.dataExtent=this.getExtent(),t.mappingMethod="piecewise",t.pieceList=f(this._pieceList,function(t){var t=i(t);return"inRange"!==e&&(t.visual=null),t}))})},completeVisualOption:function(){function t(t,e,i){return t&&t[e]&&(w(t[e])?t[e].hasOwnProperty(i):t[e]===i)}var e=this.option,i={},n=fA.listVisualTypes(),o=this.isCategory();d(e.pieces,function(t){d(n,function(e){t.hasOwnProperty(e)&&(i[e]=1)})}),d(i,function(i,n){var a=0;d(this.stateList,function(i){a|=t(e,i,n)||t(e.target,i,n)},this),!a&&d(this.stateList,function(t){(e[t]||(e[t]={}))[n]=_P.get(n,"inRange"===t?"active":"inactive",o)})},this),CP.prototype.completeVisualOption.apply(this,arguments)},_resetSelected:function(t,e){var i=this.option,n=this._pieceList,o=(e?i:t).selected||{};if(i.selected=o,d(n,function(t,e){var i=this.getSelectedMapKey(t);o.hasOwnProperty(i)||(o[i]=!0)},this),"single"===i.selectedMode){var a=!1;d(n,function(t,e){var i=this.getSelectedMapKey(t);o[i]&&(a?o[i]=!1:a=!0)},this)}},getSelectedMapKey:function(t){return"categories"===this._mode?t.value+"":t.index+""},getPieceList:function(){return this._pieceList},_determineMode:function(){var t=this.option;return t.pieces&&t.pieces.length>0?"pieces":this.option.categories?"categories":"splitNumber"},setSelected:function(t){this.option.selected=i(t)},getValueState:function(t){var e=fA.findPieceIndex(t,this._pieceList);return null!=e&&this.option.selected[this.getSelectedMapKey(this._pieceList[e])]?"inRange":"outOfRange"},findTargetDataIndices:function(t){var e=[];return this.eachTargetSeries(function(i){var n=[],o=i.getData();o.each(this.getDataDimension(o),function(e,i){fA.findPieceIndex(e,this._pieceList)===t&&n.push(i)},this),e.push({seriesId:i.id,dataIndex:n})},this),e},getRepresentValue:function(t){var e;if(this.isCategory())e=t.value;else if(null!=t.value)e=t.value;else{var i=t.interval||[];e=i[0]===-1/0&&i[1]===1/0?0:(i[0]+i[1])/2}return e},getVisualMeta:function(t){function e(e,a){var r=o.getRepresentValue({interval:e});a||(a=o.getValueState(r));var s=t(r,a);e[0]===-1/0?n[0]=s:e[1]===1/0?n[1]=s:i.push({value:e[0],color:s},{value:e[1],color:s})}if(!this.isCategory()){var i=[],n=[],o=this,a=this._pieceList.slice();if(a.length){var r=a[0].interval[0];r!==-1/0&&a.unshift({interval:[-1/0,r]}),(r=a[a.length-1].interval[1])!==1/0&&a.push({interval:[r,1/0]})}else a.push({interval:[-1/0,1/0]});var s=-1/0;return d(a,function(t){var i=t.interval;i&&(i[0]>s&&e([s,i[0]],"outOfRange"),e(i.slice()),s=i[1])},this),{stops:i,outerColors:n}}}}),FP={splitNumber:function(){var t=this.option,e=this._pieceList,i=Math.min(t.precision,20),n=this.getExtent(),o=t.splitNumber;o=Math.max(parseInt(o,10),1),t.splitNumber=o;for(var a=(n[1]-n[0])/o;+a.toFixed(i)!==a&&i<5;)i++;t.precision=i,a=+a.toFixed(i);var r=0;t.minOpen&&e.push({index:r++,interval:[-1/0,n[0]],close:[0,0]});for(var s=n[0],l=r+o;r","≥"][e[0]]];t.text=t.text||this.formatValueText(null!=t.value?t.value:t.interval,!1,i)},this)}};PP.extend({type:"visualMap.piecewise",doRender:function(){var t=this.group;t.removeAll();var e=this.visualMapModel,i=e.get("textGap"),n=e.textStyleModel,o=n.getFont(),a=n.getTextColor(),r=this._getItemAlign(),s=e.itemSize,l=this._getViewData(),u=l.endsText,h=D(e.get("showLabel",!0),!u);u&&this._renderEndsText(t,u[0],s,h,r),d(l.viewPieceList,function(n){var l=n.piece,u=new L_;u.onclick=m(this._onItemClick,this,l),this._enableHoverLink(u,n.indexInModelPieceList);var c=e.getRepresentValue(l);if(this._createItemSymbol(u,c,[0,0,s[0],s[1]]),h){var d=this.visualMapModel.getValueState(c);u.add(new zb({style:{x:"right"===r?-i:s[0]+i,y:s[1]/2,text:l.text,textVerticalAlign:"middle",textAlign:r,textFont:o,textFill:a,opacity:"outOfRange"===d?.5:1}}))}t.add(u)},this),u&&this._renderEndsText(t,u[1],s,h,r),AS(e.get("orient"),t,e.get("itemGap")),this.renderBackground(t),this.positionGroup(t)},_enableHoverLink:function(t,e){function i(t){var i=this.visualMapModel;i.option.hoverLink&&this.api.dispatchAction({type:t,batch:Bv(i.findTargetDataIndices(e))})}t.on("mouseover",m(i,this,"highlight")).on("mouseout",m(i,this,"downplay"))},_getItemAlign:function(){var t=this.visualMapModel,e=t.option;if("vertical"===e.orient)return Rv(t,this.api,t.itemSize);var i=e.align;return i&&"auto"!==i||(i="left"),i},_renderEndsText:function(t,e,i,n,o){if(e){var a=new L_,r=this.visualMapModel.textStyleModel;a.add(new zb({style:{x:n?"right"===o?i[0]:0:i[0]/2,y:i[1]/2,textVerticalAlign:"middle",textAlign:n?o:"center",text:e,textFont:r.getFont(),textFill:r.getTextColor()}})),t.add(a)}},_getViewData:function(){var t=this.visualMapModel,e=f(t.getPieceList(),function(t,e){return{piece:t,indexInModelPieceList:e}}),i=t.get("text"),n=t.get("orient"),o=t.get("inverse");return("horizontal"===n?o:!o)?e.reverse():i&&(i=i.slice().reverse()),{viewPieceList:e,endsText:i}},_createItemSymbol:function(t,e,i){t.add(ml(this.getControllerVisual(e,"symbol"),i[0],i[1],i[2],i[3],this.getControllerVisual(e,"color")))},_onItemClick:function(t){var e=this.visualMapModel,n=e.option,o=i(n.selected),a=e.getSelectedMapKey(t);"single"===n.selectedMode?(o[a]=!0,d(o,function(t,e){o[e]=e===a})):o[a]=!o[a],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:o})}});ls(yP);var WP=Wo,HP=Zo,ZP=ms({type:"marker",dependencies:["series","grid","polar","geo"],init:function(t,e,i,n){this.mergeDefaultAndTheme(t,i),this.mergeOption(t,i,n.createdBySelf,!0)},isAnimationEnabled:function(){if(Ax.node)return!1;var t=this.__hostSeries;return this.getShallow("animation")&&t&&t.isAnimationEnabled()},mergeOption:function(t,e,i,n){var o=this.constructor,r=this.mainType+"Model";i||e.eachSeries(function(t){var i=t.get(this.mainType),s=t[r];i&&i.data?(s?s.mergeOption(i,e,!0):(n&&jv(i),d(i.data,function(t){t instanceof Array?(jv(t[0]),jv(t[1])):jv(t)}),a(s=new o(i,this,e),{mainType:this.mainType,seriesIndex:t.seriesIndex,name:t.name,createdBySelf:!0}),s.__hostSeries=t),t[r]=s):t[r]=null},this)},formatTooltip:function(t){var e=this.getData(),i=this.getRawValue(t),n=y(i)?f(i,WP).join(", "):WP(i),o=e.getName(t),a=HP(this.name);return(null!=i||o)&&(a+="
"),o&&(a+=HP(o),null!=i&&(a+=" : ")),null!=i&&(a+=HP(n)),a},getData:function(){return this._data},setData:function(t){this._data=t}});h(ZP,fM),ZP.extend({type:"markPoint",defaultOption:{zlevel:0,z:5,symbol:"pin",symbolSize:50,tooltip:{trigger:"item"},label:{show:!0,position:"inside"},itemStyle:{borderWidth:2},emphasis:{label:{show:!0}}}});var UP=l,jP=v,XP={min:jP(qv,"min"),max:jP(qv,"max"),average:jP(qv,"average")},YP=vs({type:"marker",init:function(){this.markerGroupMap=z()},render:function(t,e,i){var n=this.markerGroupMap;n.each(function(t){t.__keep=!1});var o=this.type+"Model";e.eachSeries(function(t){var n=t[o];n&&this.renderSeries(t,n,e,i)},this),n.each(function(t){!t.__keep&&this.group.remove(t.group)},this)},renderSeries:function(){}});YP.extend({type:"markPoint",updateTransform:function(t,e,i){e.eachSeries(function(t){var e=t.markPointModel;e&&(iy(e.getData(),t,i),this.markerGroupMap.get(t.id).updateLayout(e))},this)},renderSeries:function(t,e,i,n){var o=t.coordinateSystem,a=t.id,r=t.getData(),s=this.markerGroupMap,l=s.get(a)||s.set(a,new Al),u=ny(o,t,e);e.setData(u),iy(e.getData(),t,n),u.each(function(t){var i=u.getItemModel(t),n=i.getShallow("symbolSize");"function"==typeof n&&(n=n(e.getRawValue(t),e.getDataParams(t))),u.setItemVisual(t,{symbolSize:n,color:i.get("itemStyle.color")||r.getVisual("color"),symbol:i.getShallow("symbol")})}),l.updateData(u),this.group.add(l.group),u.eachItemGraphicEl(function(t){t.traverse(function(t){t.dataModel=e})}),l.__keep=!0,l.group.silent=e.get("silent")||t.get("silent")}}),ls(function(t){t.markPoint=t.markPoint||{}}),ZP.extend({type:"markLine",defaultOption:{zlevel:0,z:5,symbol:["circle","arrow"],symbolSize:[8,16],precision:2,tooltip:{trigger:"item"},label:{show:!0,position:"end"},lineStyle:{type:"dashed"},emphasis:{label:{show:!0},lineStyle:{width:3}},animationEasing:"linear"}});var qP=function(t,e,o,r){var s=t.getData(),l=r.type;if(!y(r)&&("min"===l||"max"===l||"average"===l||null!=r.xAxis||null!=r.yAxis)){var u,h;if(null!=r.yAxis||null!=r.xAxis)u=null!=r.yAxis?"y":"x",e.getAxis(u),h=D(r.yAxis,r.xAxis);else{var c=Kv(r,s,e,t);u=c.valueDataDim,c.valueAxis,h=ey(s,u,l)}var d="x"===u?0:1,f=1-d,p=i(r),g={};p.type=null,p.coord=[],g.coord=[],p.coord[f]=-1/0,g.coord[f]=1/0;var m=o.get("precision");m>=0&&"number"==typeof h&&(h=+h.toFixed(Math.min(m,20))),p.coord[d]=g.coord[d]=h,r=[p,g,{type:l,valueIndex:r.valueIndex,value:h}]}return r=[$v(t,r[0]),$v(t,r[1]),a({},r[2])],r[2].type=r[2].type||"",n(r[2],r[0]),n(r[2],r[1]),r};YP.extend({type:"markLine",updateTransform:function(t,e,i){e.eachSeries(function(t){var e=t.markLineModel;if(e){var n=e.getData(),o=e.__from,a=e.__to;o.each(function(e){sy(o,e,!0,t,i),sy(a,e,!1,t,i)}),n.each(function(t){n.setItemLayout(t,[o.getItemLayout(t),a.getItemLayout(t)])}),this.markerGroupMap.get(t.id).updateLayout()}},this)},renderSeries:function(t,e,i,n){function o(e,i,o){var a=e.getItemModel(i);sy(e,i,o,t,n),e.setItemVisual(i,{symbolSize:a.get("symbolSize")||g[o?0:1],symbol:a.get("symbol",!0)||p[o?0:1],color:a.get("itemStyle.color")||s.getVisual("color")})}var a=t.coordinateSystem,r=t.id,s=t.getData(),l=this.markerGroupMap,u=l.get(r)||l.set(r,new $c);this.group.add(u.group);var h=ly(a,t,e),c=h.from,d=h.to,f=h.line;e.__from=c,e.__to=d,e.setData(f);var p=e.get("symbol"),g=e.get("symbolSize");y(p)||(p=[p,p]),"number"==typeof g&&(g=[g,g]),h.from.each(function(t){o(c,t,!0),o(d,t,!1)}),f.each(function(t){var e=f.getItemModel(t).get("lineStyle.color");f.setItemVisual(t,{color:e||c.getItemVisual(t,"color")}),f.setItemLayout(t,[c.getItemLayout(t),d.getItemLayout(t)]),f.setItemVisual(t,{fromSymbolSize:c.getItemVisual(t,"symbolSize"),fromSymbol:c.getItemVisual(t,"symbol"),toSymbolSize:d.getItemVisual(t,"symbolSize"),toSymbol:d.getItemVisual(t,"symbol")})}),u.updateData(f),h.line.eachItemGraphicEl(function(t,i){t.traverse(function(t){t.dataModel=e})}),u.__keep=!0,u.group.silent=e.get("silent")||t.get("silent")}}),ls(function(t){t.markLine=t.markLine||{}}),ZP.extend({type:"markArea",defaultOption:{zlevel:0,z:1,tooltip:{trigger:"item"},animation:!1,label:{show:!0,position:"top"},itemStyle:{borderWidth:0},emphasis:{label:{show:!0,position:"top"}}}});var $P=function(t,e,i,n){var a=$v(t,n[0]),r=$v(t,n[1]),s=D,l=a.coord,u=r.coord;l[0]=s(l[0],-1/0),l[1]=s(l[1],-1/0),u[0]=s(u[0],1/0),u[1]=s(u[1],1/0);var h=o([{},a,r]);return h.coord=[a.coord,r.coord],h.x0=a.x,h.y0=a.y,h.x1=r.x,h.y1=r.y,h},KP=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]];YP.extend({type:"markArea",updateTransform:function(t,e,i){e.eachSeries(function(t){var e=t.markAreaModel;if(e){var n=e.getData();n.each(function(e){var o=f(KP,function(o){return dy(n,e,o,t,i)});n.setItemLayout(e,o),n.getItemGraphicEl(e).setShape("points",o)})}},this)},renderSeries:function(t,e,i,n){var o=t.coordinateSystem,a=t.name,s=t.getData(),l=this.markerGroupMap,u=l.get(a)||l.set(a,{group:new L_});this.group.add(u.group),u.__keep=!0;var h=fy(o,t,e);e.setData(h),h.each(function(e){h.setItemLayout(e,f(KP,function(i){return dy(h,e,i,t,n)})),h.setItemVisual(e,{color:s.getVisual("color")})}),h.diff(u.__data).add(function(t){var e=new Zb({shape:{points:h.getItemLayout(t)}});h.setItemGraphicEl(t,e),u.group.add(e)}).update(function(t,i){var n=u.__data.getItemGraphicEl(i);fo(n,{shape:{points:h.getItemLayout(t)}},e,t),u.group.add(n),h.setItemGraphicEl(t,n)}).remove(function(t){var e=u.__data.getItemGraphicEl(t);u.group.remove(e)}).execute(),h.eachItemGraphicEl(function(t,i){var n=h.getItemModel(i),o=n.getModel("label"),a=n.getModel("emphasis.label"),s=h.getItemVisual(i,"color");t.useStyle(r(n.getModel("itemStyle").getItemStyle(),{fill:zt(s,.4),stroke:s})),t.hoverStyle=n.getModel("emphasis.itemStyle").getItemStyle(),io(t.style,t.hoverStyle,o,a,{labelFetcher:e,labelDataIndex:i,defaultText:h.getName(i)||"",isRectText:!0,autoColor:s}),eo(t,{}),t.dataModel=e}),u.__data=h,u.group.silent=e.get("silent")||t.get("silent")}}),ls(function(t){t.markArea=t.markArea||{}});kS.registerSubTypeDefaulter("timeline",function(){return"slider"}),hs({type:"timelineChange",event:"timelineChanged",update:"prepareAndUpdate"},function(t,e){var i=e.getComponent("timeline");return i&&null!=t.currentIndex&&(i.setCurrentIndex(t.currentIndex),!i.get("loop",!0)&&i.isIndexMax()&&i.setPlayState(!1)),e.resetOption("timeline"),r({currentIndex:i.option.currentIndex},t)}),hs({type:"timelinePlayChange",event:"timelinePlayChanged",update:"update"},function(t,e){var i=e.getComponent("timeline");i&&null!=t.playState&&i.setPlayState(t.playState)});var JP=kS.extend({type:"timeline",layoutMode:"box",defaultOption:{zlevel:0,z:4,show:!0,axisType:"time",realtime:!0,left:"20%",top:null,right:"20%",bottom:0,width:null,height:40,padding:5,controlPosition:"left",autoPlay:!1,rewind:!1,loop:!0,playInterval:2e3,currentIndex:0,itemStyle:{},label:{color:"#000"},data:[]},init:function(t,e,i){this._data,this._names,this.mergeDefaultAndTheme(t,i),this._initData()},mergeOption:function(t){JP.superApply(this,"mergeOption",arguments),this._initData()},setCurrentIndex:function(t){null==t&&(t=this.option.currentIndex);var e=this._data.count();this.option.loop?t=(t%e+e)%e:(t>=e&&(t=e-1),t<0&&(t=0)),this.option.currentIndex=t},getCurrentIndex:function(){return this.option.currentIndex},isIndexMax:function(){return this.getCurrentIndex()>=this._data.count()-1},setPlayState:function(t){this.option.autoPlay=!!t},getPlayState:function(){return!!this.option.autoPlay},_initData:function(){var t=this.option,e=t.data||[],n=t.axisType,o=this._names=[];if("category"===n){var a=[];d(e,function(t,e){var n,r=Ii(t);w(t)?(n=i(t)).value=e:n=e,a.push(n),_(r)||null!=r&&!isNaN(r)||(r=""),o.push(r+"")}),e=a}var r={category:"ordinal",time:"time"}[n]||"number";(this._data=new DI([{name:"value",type:r}],this)).initData(e,o)},getData:function(){return this._data},getCategories:function(){if("category"===this.get("axisType"))return this._names.slice()}});h(JP.extend({type:"timeline.slider",defaultOption:{backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,orient:"horizontal",inverse:!1,tooltip:{trigger:"item"},symbol:"emptyCircle",symbolSize:10,lineStyle:{show:!0,width:2,color:"#304654"},label:{position:"auto",show:!0,interval:"auto",rotate:0,color:"#304654"},itemStyle:{color:"#304654",borderWidth:1},checkpointStyle:{symbol:"circle",symbolSize:13,color:"#c23531",borderWidth:5,borderColor:"rgba(194,53,49, 0.5)",animation:!0,animationDuration:300,animationEasing:"quinticInOut"},controlStyle:{show:!0,showPlayBtn:!0,showPrevBtn:!0,showNextBtn:!0,itemSize:22,itemGap:12,position:"left",playIcon:"path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z",stopIcon:"path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z",nextIcon:"path://M18.6,50.8l22.5-22.5c0.2-0.2,0.3-0.4,0.3-0.7c0-0.3-0.1-0.5-0.3-0.7L18.7,4.4c-0.1-0.1-0.2-0.3-0.2-0.5 c0-0.4,0.3-0.8,0.8-0.8c0.2,0,0.5,0.1,0.6,0.3l23.5,23.5l0,0c0.2,0.2,0.3,0.4,0.3,0.7c0,0.3-0.1,0.5-0.3,0.7l-0.1,0.1L19.7,52 c-0.1,0.1-0.3,0.2-0.5,0.2c-0.4,0-0.8-0.3-0.8-0.8C18.4,51.2,18.5,51,18.6,50.8z",prevIcon:"path://M43,52.8L20.4,30.3c-0.2-0.2-0.3-0.4-0.3-0.7c0-0.3,0.1-0.5,0.3-0.7L42.9,6.4c0.1-0.1,0.2-0.3,0.2-0.5 c0-0.4-0.3-0.8-0.8-0.8c-0.2,0-0.5,0.1-0.6,0.3L18.3,28.8l0,0c-0.2,0.2-0.3,0.4-0.3,0.7c0,0.3,0.1,0.5,0.3,0.7l0.1,0.1L41.9,54 c0.1,0.1,0.3,0.2,0.5,0.2c0.4,0,0.8-0.3,0.8-0.8C43.2,53.2,43.1,53,43,52.8z",color:"#304654",borderColor:"#304654",borderWidth:1},emphasis:{label:{show:!0,color:"#c23531"},itemStyle:{color:"#c23531"},controlStyle:{color:"#c23531",borderColor:"#c23531",borderWidth:2}},data:[]}}),fM);var QP=vM.extend({type:"timeline"}),tN=function(t,e,i,n){dD.call(this,t,e,i),this.type=n||"value",this._autoLabelInterval,this.model=null};tN.prototype={constructor:tN,getLabelInterval:function(){var t=this.model,e=t.getModel("label"),i=e.get("interval");return null!=i&&"auto"!=i?i:((i=this._autoLabelInterval)||(i=this._autoLabelInterval=dl(f(this.scale.getTicks(),this.dataToCoord,this),fl(this,e.get("formatter")),e.getFont(),"horizontal"===t.get("orient")?0:90,e.get("rotate"))),i)},isLabelIgnored:function(t){if("category"===this.type){var e=this.getLabelInterval();return"function"==typeof e&&!e(t,this.scale.getLabel(t))||t%(e+1)}}},u(tN,dD);var eN=m,iN=d,nN=Math.PI;QP.extend({type:"timeline.slider",init:function(t,e){this.api=e,this._axis,this._viewRect,this._timer,this._currentPointer,this._mainGroup,this._labelGroup},render:function(t,e,i,n){if(this.model=t,this.api=i,this.ecModel=e,this.group.removeAll(),t.get("show",!0)){var o=this._layout(t,i),a=this._createGroup("mainGroup"),r=this._createGroup("labelGroup"),s=this._axis=this._createAxis(o,t);t.formatTooltip=function(t){return Zo(s.scale.getLabel(t))},iN(["AxisLine","AxisTick","Control","CurrentPointer"],function(e){this["_render"+e](o,a,s,t)},this),this._renderAxisLabel(o,r,s,t),this._position(o,t)}this._doPlayStop()},remove:function(){this._clearTimer(),this.group.removeAll()},dispose:function(){this._clearTimer()},_layout:function(t,e){var i=t.get("label.position"),n=t.get("orient"),o=vy(t,e);null==i||"auto"===i?i="horizontal"===n?o.y+o.height/2=0||"+"===i?"left":"right"},r={horizontal:i>=0||"+"===i?"top":"bottom",vertical:"middle"},s={horizontal:0,vertical:nN/2},l="vertical"===n?o.height:o.width,u=t.getModel("controlStyle"),h=u.get("show",!0),c=h?u.get("itemSize"):0,d=h?u.get("itemGap"):0,f=c+d,p=t.get("label.rotate")||0;p=p*nN/180;var g,m,v,y,x=u.get("position",!0),_=h&&u.get("showPlayBtn",!0),w=h&&u.get("showPrevBtn",!0),b=h&&u.get("showNextBtn",!0),S=0,M=l;return"left"===x||"bottom"===x?(_&&(g=[0,0],S+=f),w&&(m=[S,0],S+=f),b&&(v=[M-c,0],M-=f)):(_&&(g=[M-c,0],M-=f),w&&(m=[0,0],S+=f),b&&(v=[M-c,0],M-=f)),y=[S,M],t.get("inverse")&&y.reverse(),{viewRect:o,mainLength:l,orient:n,rotation:s[n],labelRotation:p,labelPosOpt:i,labelAlign:t.get("label.align")||a[n],labelBaseline:t.get("label.verticalAlign")||t.get("label.baseline")||r[n],playPosition:g,prevBtnPosition:m,nextBtnPosition:v,axisExtent:y,controlSize:c,controlGap:d}},_position:function(t,e){function i(t){var e=t.position;t.origin=[c[0][0]-e[0],c[1][0]-e[1]]}function n(t){return[[t.x,t.x+t.width],[t.y,t.y+t.height]]}function o(t,e,i,n,o){t[n]+=i[n][o]-e[n][o]}var a=this._mainGroup,r=this._labelGroup,s=t.viewRect;if("vertical"===t.orient){var l=st(),u=s.x,h=s.y+s.height;ct(l,l,[-u,-h]),dt(l,l,-nN/2),ct(l,l,[u,h]),(s=s.clone()).applyTransform(l)}var c=n(s),d=n(a.getBoundingRect()),f=n(r.getBoundingRect()),p=a.position,g=r.position;g[0]=p[0]=c[0][0];var m=t.labelPosOpt;if(isNaN(m))o(p,d,c,1,v="+"===m?0:1),o(g,f,c,1,1-v);else{var v=m>=0?0:1;o(p,d,c,1,v),g[1]=p[1]+m}a.attr("position",p),r.attr("position",g),a.rotation=r.rotation=t.rotation,i(a),i(r)},_createAxis:function(t,e){var i=e.getData(),n=e.get("axisType"),o=cl(e,n),a=i.getDataExtent("value");o.setExtent(a[0],a[1]),this._customizeScale(o,i),o.niceTicks();var r=new tN("value",o,t.axisExtent,n);return r.model=e,r},_customizeScale:function(t,e){t.getTicks=function(){return e.mapArray(["value"],function(t){return t})},t.getTicksLabels=function(){return f(this.getTicks(),t.getLabel,t)}},_createGroup:function(t){var e=this["_"+t]=new L_;return this.group.add(e),e},_renderAxisLine:function(t,e,i,n){var o=i.getExtent();n.get("lineStyle.show")&&e.add(new Xb({shape:{x1:o[0],y1:0,x2:o[1],y2:0},style:a({lineCap:"round"},n.getModel("lineStyle").getLineStyle()),silent:!0,z2:1}))},_renderAxisTick:function(t,e,i,n){var o=n.getData(),a=i.scale.getTicks();iN(a,function(t,a){var r=i.dataToCoord(t),s=o.getItemModel(a),l=s.getModel("itemStyle"),u=s.getModel("emphasis.itemStyle"),h={position:[r,0],onclick:eN(this._changeTimeline,this,a)},c=xy(s,l,e,h);eo(c,u.getItemStyle()),s.get("tooltip")?(c.dataIndex=a,c.dataModel=n):c.dataIndex=c.dataModel=null},this)},_renderAxisLabel:function(t,e,i,n){var o=n.getModel("label");if(o.get("show")){var a=n.getData(),r=i.scale.getTicks(),s=fl(i,o.get("formatter")),l=i.getLabelInterval();iN(r,function(n,o){if(!i.isLabelIgnored(o,l)){var r=a.getItemModel(o),u=r.getModel("label"),h=r.getModel("emphasis.label"),c=i.dataToCoord(n),d=new zb({position:[c,0],rotation:t.labelRotation-t.rotation,onclick:eN(this._changeTimeline,this,o),silent:!1});no(d.style,u,{text:s[o],textAlign:t.labelAlign,textVerticalAlign:t.labelBaseline}),e.add(d),eo(d,no({},h))}},this)}},_renderControl:function(t,e,i,n){function o(t,i,o,h){if(t){var c=yy(n,i,u,{position:t,origin:[a/2,0],rotation:h?-r:0,rectHover:!0,style:s,onclick:o});e.add(c),eo(c,l)}}var a=t.controlSize,r=t.rotation,s=n.getModel("controlStyle").getItemStyle(),l=n.getModel("emphasis.controlStyle").getItemStyle(),u=[0,-a/2,a,a],h=n.getPlayState(),c=n.get("inverse",!0);o(t.nextBtnPosition,"controlStyle.nextIcon",eN(this._changeTimeline,this,c?"-":"+")),o(t.prevBtnPosition,"controlStyle.prevIcon",eN(this._changeTimeline,this,c?"+":"-")),o(t.playPosition,"controlStyle."+(h?"stopIcon":"playIcon"),eN(this._handlePlayClick,this,!h),!0)},_renderCurrentPointer:function(t,e,i,n){var o=n.getData(),a=n.getCurrentIndex(),r=o.getItemModel(a).getModel("checkpointStyle"),s=this,l={onCreate:function(t){t.draggable=!0,t.drift=eN(s._handlePointerDrag,s),t.ondragend=eN(s._handlePointerDragend,s),_y(t,a,i,n,!0)},onUpdate:function(t){_y(t,a,i,n)}};this._currentPointer=xy(r,r,this._mainGroup,{},this._currentPointer,l)},_handlePlayClick:function(t){this._clearTimer(),this.api.dispatchAction({type:"timelinePlayChange",playState:t,from:this.uid})},_handlePointerDrag:function(t,e,i){this._clearTimer(),this._pointerChangeTimeline([i.offsetX,i.offsetY])},_handlePointerDragend:function(t){this._pointerChangeTimeline([t.offsetX,t.offsetY],!0)},_pointerChangeTimeline:function(t,e){var i=this._toAxisCoord(t)[0],n=Co(this._axis.getExtent().slice());i>n[1]&&(i=n[1]),ii.getHeight()&&(n.textPosition="top",l=!0);var u=l?-5-o.height:s+8;a+o.width/2>i.getWidth()?(n.textPosition=["100%",u],n.textAlign="right"):a-o.width/2<0&&(n.textPosition=[0,u],n.textAlign="left")}})}},updateView:function(t,e,i,n){d(this._features,function(t){t.updateView&&t.updateView(t.model,e,i,n)})},remove:function(t,e){d(this._features,function(i){i.remove&&i.remove(t,e)}),this.group.removeAll()},dispose:function(t,e){d(this._features,function(i){i.dispose&&i.dispose(t,e)})}});var aN=AM.toolbox.saveAsImage;by.defaultOption={show:!0,icon:"M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",title:aN.title,type:"png",name:"",excludeComponents:["toolbox"],pixelRatio:1,lang:aN.lang.slice()},by.prototype.unusable=!Ax.canvasSupported,by.prototype.onclick=function(t,e){var i=this.model,n=i.get("name")||t.get("title.0.text")||"echarts",o=document.createElement("a"),a=i.get("type",!0)||"png";o.download=n+"."+a,o.target="_blank";var r=e.getConnectedDataURL({type:a,backgroundColor:i.get("backgroundColor",!0)||t.get("backgroundColor")||"#fff",excludeComponents:i.get("excludeComponents"),pixelRatio:i.get("pixelRatio")});if(o.href=r,"function"!=typeof MouseEvent||Ax.browser.ie||Ax.browser.edge)if(window.navigator.msSaveOrOpenBlob){for(var s=atob(r.split(",")[1]),l=s.length,u=new Uint8Array(l);l--;)u[l]=s.charCodeAt(l);var h=new Blob([u]);window.navigator.msSaveOrOpenBlob(h,n+"."+a)}else{var c=i.get("lang"),d='';window.open().document.write(d)}else{var f=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!1});o.dispatchEvent(f)}},rv("saveAsImage",by);var rN=AM.toolbox.magicType;Sy.defaultOption={show:!0,type:[],icon:{line:"M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",bar:"M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",stack:"M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z",tiled:"M2.3,2.2h22.8V25H2.3V2.2z M35,2.2h22.8V25H35V2.2zM2.3,35h22.8v22.8H2.3V35z M35,35h22.8v22.8H35V35z"},title:i(rN.title),option:{},seriesIndex:{}};var sN=Sy.prototype;sN.getIcons=function(){var t=this.model,e=t.get("icon"),i={};return d(t.get("type"),function(t){e[t]&&(i[t]=e[t])}),i};var lN={line:function(t,e,i,o){if("bar"===t)return n({id:e,type:"line",data:i.get("data"),stack:i.get("stack"),markPoint:i.get("markPoint"),markLine:i.get("markLine")},o.get("option.line")||{},!0)},bar:function(t,e,i,o){if("line"===t)return n({id:e,type:"bar",data:i.get("data"),stack:i.get("stack"),markPoint:i.get("markPoint"),markLine:i.get("markLine")},o.get("option.bar")||{},!0)},stack:function(t,e,i,o){if("line"===t||"bar"===t)return n({id:e,stack:"__ec_magicType_stack__"},o.get("option.stack")||{},!0)},tiled:function(t,e,i,o){if("line"===t||"bar"===t)return n({id:e,stack:""},o.get("option.tiled")||{},!0)}},uN=[["line","bar"],["stack","tiled"]];sN.onclick=function(t,e,i){var n=this.model,o=n.get("seriesIndex."+i);if(lN[i]){var a={series:[]};d(uN,function(t){l(t,i)>=0&&d(t,function(t){n.setIconStatus(t,"normal")})}),n.setIconStatus(i,"emphasis"),t.eachComponent({mainType:"series",query:null==o?null:{seriesIndex:o}},function(e){var o=e.subType,s=e.id,l=lN[i](o,s,e,n);l&&(r(l,e.option),a.series.push(l));var u=e.coordinateSystem;if(u&&"cartesian2d"===u.type&&("line"===i||"bar"===i)){var h=u.getAxesByScale("ordinal")[0];if(h){var c=h.dim+"Axis",d=t.queryComponents({mainType:c,index:e.get(name+"Index"),id:e.get(name+"Id")})[0].componentIndex;a[c]=a[c]||[];for(var f=0;f<=d;f++)a[c][d]=a[c][d]||{};a[c][d].boundaryGap="bar"===i}}}),e.dispatchAction({type:"changeMagicType",currentType:i,newOption:a})}},hs({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(t,e){e.mergeOption(t.newOption)}),rv("magicType",Sy);var hN=AM.toolbox.dataView,cN=new Array(60).join("-"),dN="\t",fN=new RegExp("["+dN+"]+","g");Ny.defaultOption={show:!0,readOnly:!1,optionToContent:null,contentToOption:null,icon:"M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28",title:i(hN.title),lang:i(hN.lang),backgroundColor:"#fff",textColor:"#000",textareaColor:"#fff",textareaBorderColor:"#333",buttonColor:"#c23531",buttonTextColor:"#fff"},Ny.prototype.onclick=function(t,e){function i(){n.removeChild(a),x._dom=null}var n=e.getDom(),o=this.model;this._dom&&n.removeChild(this._dom);var a=document.createElement("div");a.style.cssText="position:absolute;left:5px;top:5px;bottom:5px;right:5px;",a.style.backgroundColor=o.get("backgroundColor")||"#fff";var r=document.createElement("h4"),s=o.get("lang")||[];r.innerHTML=s[0]||o.get("title"),r.style.cssText="margin: 10px 20px;",r.style.color=o.get("textColor");var l=document.createElement("div"),u=document.createElement("textarea");l.style.cssText="display:block;width:100%;overflow:auto;";var h=o.get("optionToContent"),c=o.get("contentToOption"),d=Ty(t);if("function"==typeof h){var f=h(e.getOption());"string"==typeof f?l.innerHTML=f:M(f)&&l.appendChild(f)}else l.appendChild(u),u.readOnly=o.get("readOnly"),u.style.cssText="width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;",u.style.color=o.get("textColor"),u.style.borderColor=o.get("textareaBorderColor"),u.style.backgroundColor=o.get("textareaColor"),u.value=d.value;var p=d.meta,g=document.createElement("div");g.style.cssText="position:absolute;bottom:0;left:0;right:0;";var m="float:right;margin-right:20px;border:none;cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px",v=document.createElement("div"),y=document.createElement("div");m+=";background-color:"+o.get("buttonColor"),m+=";color:"+o.get("buttonTextColor");var x=this;ui(v,"click",i),ui(y,"click",function(){var t;try{t="function"==typeof c?c(l,e.getOption()):Py(u.value,p)}catch(t){throw i(),new Error("Data view format error "+t)}t&&e.dispatchAction({type:"changeDataView",newOption:t}),i()}),v.innerHTML=s[1],y.innerHTML=s[2],y.style.cssText=m,v.style.cssText=m,!o.get("readOnly")&&g.appendChild(y),g.appendChild(v),ui(u,"keydown",function(t){if(9===(t.keyCode||t.which)){var e=this.value,i=this.selectionStart,n=this.selectionEnd;this.value=e.substring(0,i)+dN+e.substring(n),this.selectionStart=this.selectionEnd=i+1,rw(t)}}),a.appendChild(r),a.appendChild(l),a.appendChild(g),l.style.height=n.clientHeight-80+"px",n.appendChild(a),this._dom=a},Ny.prototype.remove=function(t,e){this._dom&&e.getDom().removeChild(this._dom)},Ny.prototype.dispose=function(t,e){this.remove(t,e)},rv("dataView",Ny),hs({type:"changeDataView",event:"dataViewChanged",update:"prepareAndUpdate"},function(t,e){var i=[];d(t.newOption.series,function(t){var n=e.getSeriesByName(t.name)[0];if(n){var o=n.get("data");i.push({name:t.name,data:Oy(t.data,o)})}else i.push(a({type:"scatter"},t))}),e.mergeOption(r({series:i},t.newOption))});var pN=d,gN="\0_ec_hist_store";eP.extend({type:"dataZoom.select"}),iP.extend({type:"dataZoom.select"});var mN=AM.toolbox.dataZoom,vN=d,yN="\0_ec_\0toolbox-dataZoom_";Gy.defaultOption={show:!0,icon:{zoom:"M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1",back:"M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26"},title:i(mN.title)};var xN=Gy.prototype;xN.render=function(t,e,i,n){this.model=t,this.ecModel=e,this.api=i,Hy(t,e,this,n,i),Wy(t,e)},xN.onclick=function(t,e,i){_N[i].call(this)},xN.remove=function(t,e){this._brushController.unmount()},xN.dispose=function(t,e){this._brushController.dispose()};var _N={zoom:function(){var t=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:t})},back:function(){this._dispatchZoomAction(zy(this.ecModel))}};xN._onBrush=function(t,e){function i(t,e,i){var r=e.getAxis(t),s=r.model,l=n(t,s,a),u=l.findRepresentativeAxisProxy(s).getMinMaxSpan();null==u.minValueSpan&&null==u.maxValueSpan||(i=eC(0,i.slice(),r.scale.getExtent(),0,u.minValueSpan,u.maxValueSpan)),l&&(o[l.id]={dataZoomId:l.id,startValue:i[0],endValue:i[1]})}function n(t,e,i){var n;return i.eachComponent({mainType:"dataZoom",subType:"select"},function(i){i.getAxisModel(t,e.componentIndex)&&(n=i)}),n}if(e.isEnd&&t.length){var o={},a=this.ecModel;this._brushController.updateCovers([]),new Zm(Fy(this.model.option),a,{include:["grid"]}).matchOutputRanges(t,a,function(t,e,n){if("cartesian2d"===n.type){var o=t.brushType;"rect"===o?(i("x",n,e[0]),i("y",n,e[1])):i({lineX:"x",lineY:"y"}[o],n,e)}}),Ey(a,o),this._dispatchZoomAction(o)}},xN._dispatchZoomAction=function(t){var e=[];vN(t,function(t,n){e.push(i(t))}),e.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:e})},rv("dataZoom",Gy),ls(function(t){function e(t,e){if(e){var o=t+"Index",a=e[o];null==a||"all"==a||y(a)||(a=!1===a||"none"===a?[]:[a]),i(t,function(e,i){if(null==a||"all"==a||-1!==l(a,i)){var r={type:"select",$fromToolbox:!0,id:yN+t+i};r[o]=i,n.push(r)}})}}function i(e,i){var n=t[e];y(n)||(n=n?[n]:[]),vN(n,i)}if(t){var n=t.dataZoom||(t.dataZoom=[]);y(n)||(t.dataZoom=n=[n]);var o=t.toolbox;if(o&&(y(o)&&(o=o[0]),o&&o.feature)){var a=o.feature.dataZoom;e("xAxis",a),e("yAxis",a)}}});var wN=AM.toolbox.restore;Zy.defaultOption={show:!0,icon:"M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5",title:wN.title},Zy.prototype.onclick=function(t,e,i){Ry(t),e.dispatchAction({type:"restore",from:this.uid})},rv("restore",Zy),hs({type:"restore",event:"restore",update:"prepareAndUpdate"},function(t,e){e.resetOption("recreate")});var bN,SN="urn:schemas-microsoft-com:vml",MN="undefined"==typeof window?null:window,IN=!1,DN=MN&&MN.document;if(DN&&!Ax.canvasSupported)try{!DN.namespaces.zrvml&&DN.namespaces.add("zrvml",SN),bN=function(t){return DN.createElement("')}}catch(t){bN=function(t){return DN.createElement("<"+t+' xmlns="'+SN+'" class="zrvml">')}}var TN=db.CMD,AN=Math.round,CN=Math.sqrt,LN=Math.abs,kN=Math.cos,PN=Math.sin,NN=Math.max;if(!Ax.canvasSupported){var ON=21600,EN=ON/2,zN=function(t){t.style.cssText="position:absolute;left:0;top:0;width:1px;height:1px;",t.coordsize=ON+","+ON,t.coordorigin="0,0"},RN=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""")},BN=function(t,e,i){return"rgb("+[t,e,i].join(",")+")"},VN=function(t,e){e&&t&&e.parentNode!==t&&t.appendChild(e)},GN=function(t,e){e&&t&&e.parentNode===t&&t.removeChild(e)},FN=function(t,e,i){return 1e5*(parseFloat(t)||0)+1e3*(parseFloat(e)||0)+i},WN=function(t,e){return"string"==typeof t?t.lastIndexOf("%")>=0?parseFloat(t)/100*e:parseFloat(t):t},HN=function(t,e,i){var n=At(e);i=+i,isNaN(i)&&(i=1),n&&(t.color=BN(n[0],n[1],n[2]),t.opacity=i*n[3])},ZN=function(t){var e=At(t);return[BN(e[0],e[1],e[2]),e[3]]},UN=function(t,e,i){var n=e.fill;if(null!=n)if(n instanceof Jb){var o,a=0,r=[0,0],s=0,l=1,u=i.getBoundingRect(),h=u.width,c=u.height;if("linear"===n.type){o="gradient";var d=i.transform,f=[n.x*h,n.y*c],p=[n.x2*h,n.y2*c];d&&(Q(f,f,d),Q(p,p,d));var g=p[0]-f[0],m=p[1]-f[1];(a=180*Math.atan2(g,m)/Math.PI)<0&&(a+=360),a<1e-6&&(a=0)}else{o="gradientradial";var f=[n.x*h,n.y*c],d=i.transform,v=i.scale,y=h,x=c;r=[(f[0]-u.x)/y,(f[1]-u.y)/x],d&&Q(f,f,d),y/=v[0]*ON,x/=v[1]*ON;var _=NN(y,x);s=0/_,l=2*n.r/_-s}var w=n.colorStops.slice();w.sort(function(t,e){return t.offset-e.offset});for(var b=w.length,S=[],M=[],I=0;I=2){var A=S[0][0],C=S[1][0],L=S[0][1]*e.opacity,k=S[1][1]*e.opacity;t.type=o,t.method="none",t.focus="100%",t.angle=a,t.color=A,t.color2=C,t.colors=M.join(","),t.opacity=k,t.opacity2=L}"radial"===o&&(t.focusposition=r.join(","))}else HN(t,n,e.opacity)},jN=function(t,e){null!=e.lineDash&&(t.dashstyle=e.lineDash.join(" ")),null==e.stroke||e.stroke instanceof Jb||HN(t,e.stroke,e.opacity)},XN=function(t,e,i,n){var o="fill"==e,a=t.getElementsByTagName(e)[0];null!=i[e]&&"none"!==i[e]&&(o||!o&&i.lineWidth)?(t[o?"filled":"stroked"]="true",i[e]instanceof Jb&&GN(t,a),a||(a=Uy(e)),o?UN(a,i,n):jN(a,i),VN(t,a)):(t[o?"filled":"stroked"]="false",GN(t,a))},YN=[[],[],[]],qN=function(t,e){var i,n,o,a,r,s,l=TN.M,u=TN.C,h=TN.L,c=TN.A,d=TN.Q,f=[],p=t.data,g=t.len();for(a=0;a.01?N&&(O+=.0125):Math.abs(E-A)<1e-4?N&&OT?x-=.0125:x+=.0125:N&&EA?y+=.0125:y-=.0125),f.push(z,AN(((T-C)*M+b)*ON-EN),",",AN(((A-L)*I+S)*ON-EN),",",AN(((T+C)*M+b)*ON-EN),",",AN(((A+L)*I+S)*ON-EN),",",AN((O*M+b)*ON-EN),",",AN((E*I+S)*ON-EN),",",AN((y*M+b)*ON-EN),",",AN((x*I+S)*ON-EN)),r=y,s=x;break;case TN.R:var R=YN[0],B=YN[1];R[0]=p[a++],R[1]=p[a++],B[0]=R[0]+p[a++],B[1]=R[1]+p[a++],e&&(Q(R,R,e),Q(B,B,e)),R[0]=AN(R[0]*ON-EN),B[0]=AN(B[0]*ON-EN),R[1]=AN(R[1]*ON-EN),B[1]=AN(B[1]*ON-EN),f.push(" m ",R[0],",",R[1]," l ",B[0],",",R[1]," l ",B[0],",",B[1]," l ",R[0],",",B[1]);break;case TN.Z:f.push(" x ")}if(i>0){f.push(n);for(var V=0;V100&&(QN=0,JN={});var i,n=tO.style;try{n.font=t,i=n.fontFamily.split(",")[0]}catch(t){}e={style:n.fontStyle||"normal",variant:n.fontVariant||"normal",weight:n.fontWeight||"normal",size:0|parseFloat(n.fontSize||12),family:i||"Microsoft YaHei"},JN[t]=e,QN++}return e};!function(t,e){$_[t]=e}("measureText",function(t,e){var i=DN;KN||((KN=i.createElement("div")).style.cssText="position:absolute;top:-20000px;left:0;padding:0;margin:0;border:none;white-space:pre;",DN.body.appendChild(KN));try{KN.style.font=e}catch(t){}return KN.innerHTML="",KN.appendChild(i.createTextNode(t)),{width:KN.offsetWidth}});for(var iO=new Kt,nO=[tw,Ke,Je,In,zb],oO=0;oO=o&&u+1>=a){for(var h=[],c=0;c=o&&c+1>=a)return lx(0,s.components);l[i]=s}else l[i]=void 0}r++}();if(d)return d}},pushComponent:function(t,e,i){var n=t[t.length-1];n&&n.added===e&&n.removed===i?t[t.length-1]={count:n.count+1,added:e,removed:i}:t.push({count:1,added:e,removed:i})},extractCommon:function(t,e,i,n){for(var o=e.length,a=i.length,r=t.newPos,s=r-n,l=0;r+1=0;--n)if(e[n]===t)return!0;return!1}),i):null:i[0]},hx.prototype.update=function(t,e){if(t){var i=this.getDefs(!1);if(t[this._domName]&&i.contains(t[this._domName]))"function"==typeof e&&e(t);else{var n=this.add(t);n&&(t[this._domName]=n)}}},hx.prototype.addDom=function(t){this.getDefs(!0).appendChild(t)},hx.prototype.removeDom=function(t){var e=this.getDefs(!1);e&&t[this._domName]&&(e.removeChild(t[this._domName]),t[this._domName]=null)},hx.prototype.getDoms=function(){var t=this.getDefs(!1);if(!t)return[];var e=[];return d(this._tagNames,function(i){var n=t.getElementsByTagName(i);e=e.concat([].slice.call(n))}),e},hx.prototype.markAllUnused=function(){var t=this;d(this.getDoms(),function(e){e[t._markLabel]="0"})},hx.prototype.markUsed=function(t){t&&(t[this._markLabel]="1")},hx.prototype.removeUnused=function(){var t=this.getDefs(!1);if(t){var e=this;d(this.getDoms(),function(i){"1"!==i[e._markLabel]&&t.removeChild(i)})}},hx.prototype.getSvgProxy=function(t){return t instanceof In?vO:t instanceof Je?yO:t instanceof zb?xO:vO},hx.prototype.getTextSvgElement=function(t){return t.__textSvgEl},hx.prototype.getSvgElement=function(t){return t.__svgEl},u(cx,hx),cx.prototype.addWithoutUpdate=function(t,e){if(e&&e.style){var i=this;d(["fill","stroke"],function(n){if(e.style[n]&&("linear"===e.style[n].type||"radial"===e.style[n].type)){var o,a=e.style[n],r=i.getDefs(!0);a._dom?(o=a._dom,r.contains(a._dom)||i.addDom(o)):o=i.add(a),i.markUsed(e);var s=o.getAttribute("id");t.setAttribute(n,"url(#"+s+")")}})}},cx.prototype.add=function(t){var e;if("linear"===t.type)e=this.createElement("linearGradient");else{if("radial"!==t.type)return M_("Illegal gradient type."),null;e=this.createElement("radialGradient")}return t.id=t.id||this.nextId++,e.setAttribute("id","zr"+this._zrId+"-gradient-"+t.id),this.updateDom(t,e),this.addDom(e),e},cx.prototype.update=function(t){var e=this;hx.prototype.update.call(this,t,function(){var i=t.type,n=t._dom.tagName;"linear"===i&&"linearGradient"===n||"radial"===i&&"radialGradient"===n?e.updateDom(t,t._dom):(e.removeDom(t),e.add(t))})},cx.prototype.updateDom=function(t,e){if("linear"===t.type)e.setAttribute("x1",t.x),e.setAttribute("y1",t.y),e.setAttribute("x2",t.x2),e.setAttribute("y2",t.y2);else{if("radial"!==t.type)return void M_("Illegal gradient type.");e.setAttribute("cx",t.x),e.setAttribute("cy",t.y),e.setAttribute("r",t.r)}t.global?e.setAttribute("gradientUnits","userSpaceOnUse"):e.setAttribute("gradientUnits","objectBoundingBox"),e.innerHTML="";for(var i=t.colorStops,n=0,o=i.length;n0){var n,o,a=this.getDefs(!0),r=e[0],s=i?"_textDom":"_dom";r[s]?(o=r[s].getAttribute("id"),n=r[s],a.contains(n)||a.appendChild(n)):(o="zr"+this._zrId+"-clip-"+this.nextId,++this.nextId,(n=this.createElement("clipPath")).setAttribute("id",o),a.appendChild(n),r[s]=n);var l=this.getSvgProxy(r);if(r.transform&&r.parent.invTransform&&!i){var u=Array.prototype.slice.call(r.transform);ht(r.transform,r.parent.invTransform,r.transform),l.brush(r),r.transform=u}else l.brush(r);var h=this.getSvgElement(r);n.innerHTML="",n.appendChild(h.cloneNode()),t.setAttribute("clip-path","url(#"+o+")"),e.length>1&&this.updateDom(n,e.slice(1),i)}else t&&t.setAttribute("clip-path","none")},dx.prototype.markUsed=function(t){var e=this;t.__clipPaths&&t.__clipPaths.length>0&&d(t.__clipPaths,function(t){t._dom&&hx.prototype.markUsed.call(e,t._dom),t._textDom&&hx.prototype.markUsed.call(e,t._textDom)})},u(fx,hx),fx.prototype.addWithoutUpdate=function(t,e){if(e&&px(e.style)){var i,n=e.style;n._shadowDom?(i=n._shadowDom,this.getDefs(!0).contains(n._shadowDom)||this.addDom(i)):i=this.add(e),this.markUsed(e);var o=i.getAttribute("id");t.style.filter="url(#"+o+")"}},fx.prototype.add=function(t){var e=this.createElement("filter"),i=t.style;return i._shadowDomId=i._shadowDomId||this.nextId++,e.setAttribute("id","zr"+this._zrId+"-shadow-"+i._shadowDomId),this.updateDom(t,e),this.addDom(e),e},fx.prototype.update=function(t,e){var i=e.style;if(px(i)){var n=this;hx.prototype.update.call(this,e,function(t){n.updateDom(e,t._shadowDom)})}else this.remove(t,i)},fx.prototype.remove=function(t,e){null!=e._shadowDomId&&(this.removeDom(e),t.style.filter="")},fx.prototype.updateDom=function(t,e){var i=e.getElementsByTagName("feDropShadow");i=0===i.length?this.createElement("feDropShadow"):i[0];var n,o,a,r,s=t.style,l=t.scale?t.scale[0]||1:1,u=t.scale?t.scale[1]||1:1;if(s.shadowBlur||s.shadowOffsetX||s.shadowOffsetY)n=s.shadowOffsetX||0,o=s.shadowOffsetY||0,a=s.shadowBlur,r=s.shadowColor;else{if(!s.textShadowBlur)return void this.removeDom(e,s);n=s.textShadowOffsetX||0,o=s.textShadowOffsetY||0,a=s.textShadowBlur,r=s.textShadowColor}i.setAttribute("dx",n/l),i.setAttribute("dy",o/u),i.setAttribute("flood-color",r);var h=a/2/l+" "+a/2/u;i.setAttribute("stdDeviation",h),e.setAttribute("x","-100%"),e.setAttribute("y","-100%"),e.setAttribute("width",Math.ceil(a/2*200)+"%"),e.setAttribute("height",Math.ceil(a/2*200)+"%"),e.appendChild(i),s._shadowDom=e},fx.prototype.markUsed=function(t){var e=t.style;e&&e._shadowDom&&hx.prototype.markUsed.call(this,e._shadowDom)};var MO=function(t,e,i,n){this.root=t,this.storage=e,this._opts=i=a({},i||{});var o=$y("svg");o.setAttribute("xmlns","http://www.w3.org/2000/svg"),o.setAttribute("version","1.1"),o.setAttribute("baseProfile","full"),o.style.cssText="user-select:none;position:absolute;left:0;top:0;",this.gradientManager=new cx(n,o),this.clipPathManager=new dx(n,o),this.shadowManager=new fx(n,o);var r=document.createElement("div");r.style.cssText="overflow:hidden;position:relative",this._svgRoot=o,this._viewport=r,t.appendChild(r),r.appendChild(o),this.resize(i.width,i.height),this._visibleList=[]};MO.prototype={constructor:MO,getType:function(){return"svg"},getViewportRoot:function(){return this._viewport},getViewportRootOffset:function(){var t=this.getViewportRoot();if(t)return{offsetLeft:t.offsetLeft||0,offsetTop:t.offsetTop||0}},refresh:function(){var t=this.storage.getDisplayList(!0);this._paintList(t)},setBackgroundColor:function(t){this._viewport.style.background=t},_paintList:function(t){this.gradientManager.markAllUnused(),this.clipPathManager.markAllUnused(),this.shadowManager.markAllUnused();var e,i=this._svgRoot,n=this._visibleList,o=t.length,a=[];for(e=0;e=0;--n)if(e[n]===t)return!0;return!1}),i):null:i[0]},resize:function(t,e){var i=this._viewport;i.style.display="none";var n=this._opts;if(null!=t&&(n.width=t),null!=e&&(n.height=e),t=this._getSize(0),e=this._getSize(1),i.style.display="",this._width!==t||this._height!==e){this._width=t,this._height=e;var o=i.style;o.width=t+"px",o.height=e+"px";var a=this._svgRoot;a.setAttribute("width",t),a.setAttribute("height",e)}},getWidth:function(){return this._width},getHeight:function(){return this._height},_getSize:function(t){var e=this._opts,i=["width","height"][t],n=["clientWidth","clientHeight"][t],o=["paddingLeft","paddingTop"][t],a=["paddingRight","paddingBottom"][t];if(null!=e[i]&&"auto"!==e[i])return parseFloat(e[i]);var r=this.root,s=document.defaultView.getComputedStyle(r);return(r[n]||gx(s[i])||gx(r.style[i]))-(gx(s[o])||0)-(gx(s[a])||0)|0},dispose:function(){this.root.innerHTML="",this._svgRoot=this._viewport=this.storage=null},clear:function(){this._viewport&&this.root.removeChild(this._viewport)},pathToDataUrl:function(){return this.refresh(),"data:image/svg+xml;charset=UTF-8,"+this._svgRoot.outerHTML}},d(["getLayer","insertLayer","eachLayer","eachBuiltinLayer","eachOtherLayer","getLayers","modLayer","delLayer","clearLayer","toDataURL","pathToImage"],function(t){MO.prototype[t]=Mx(t)}),wi("svg",MO),t.version="4.0.4",t.dependencies=UM,t.PRIORITY=qM,t.init=function(t,e,i){var n=rs(t);if(n)return n;var o=new Vr(t,e,i);return o.id="ec_"+dI++,hI[o.id]=o,zi(t,pI,o.id),os(o),o},t.connect=function(t){if(y(t)){var e=t;t=null,FM(e,function(e){null!=e.group&&(t=e.group)}),t=t||"g_"+fI++,FM(e,function(e){e.group=t})}return cI[t]=!0,t},t.disConnect=as,t.disconnect=mI,t.dispose=function(t){"string"==typeof t?t=hI[t]:t instanceof Vr||(t=rs(t)),t instanceof Vr&&!t.isDisposed()&&t.dispose()},t.getInstanceByDom=rs,t.getInstanceById=function(t){return hI[t]},t.registerTheme=ss,t.registerPreprocessor=ls,t.registerProcessor=us,t.registerPostUpdate=function(t){rI.push(t)},t.registerAction=hs,t.registerCoordinateSystem=cs,t.getCoordinateSystemDimensions=function(t){var e=Ca.get(t);if(e)return e.getDimensionsInfo?e.getDimensionsInfo():e.dimensions.slice()},t.registerLayout=ds,t.registerVisual=fs,t.registerLoading=gs,t.extendComponentModel=ms,t.extendComponentView=vs,t.extendSeriesModel=ys,t.extendChartView=xs,t.setCanvasCreator=function(t){e("createCanvas",t)},t.registerMap=function(t,e,i){e.geoJson&&!e.features&&(i=e.specialAreas,e=e.geoJson),"string"==typeof e&&(e="undefined"!=typeof JSON&&JSON.parse?JSON.parse(e):new Function("return ("+e+");")()),gI[t]={geoJson:e,specialAreas:i}},t.getMap=_s,t.dataTool=vI,t.zrender=_w,t.graphic=sS,t.number=yS,t.format=MS,t.throttle=xr,t.helper=sD,t.matrix=e_,t.vector=Yx,t.color=y_,t.parseGeoJSON=uD,t.parseGeoJson=fD,t.util=pD,t.List=DI,t.Model=wo,t.Axis=dD,t.env=Ax}); +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.echarts={})}(this,function(t){"use strict";function e(t,e){"createCanvas"===t&&(Gx=null),Bx[t]=e}function i(t){if(null==t||"object"!=typeof t)return t;var e=t,n=kx.call(t);if("[object Array]"===n){if(!O(t)){e=[];for(var o=0,a=t.length;on_||t<-n_}function vt(t){this._target=t.target,this._life=t.life||1e3,this._delay=t.delay||0,this._initialized=!1,this.loop=null!=t.loop&&t.loop,this.gap=t.gap||0,this.easing=t.easing||"Linear",this.onframe=t.onframe,this.ondestroy=t.ondestroy,this.onrestart=t.onrestart,this._pausedTime=0,this._paused=!1}function yt(t){return(t=Math.round(t))<0?0:t>255?255:t}function xt(t){return(t=Math.round(t))<0?0:t>360?360:t}function _t(t){return t<0?0:t>1?1:t}function wt(t){return yt(t.length&&"%"===t.charAt(t.length-1)?parseFloat(t)/100*255:parseInt(t,10))}function bt(t){return _t(t.length&&"%"===t.charAt(t.length-1)?parseFloat(t)/100:parseFloat(t))}function St(t,e,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}function Mt(t,e,i){return t+(e-t)*i}function It(t,e,i,n,o){return t[0]=e,t[1]=i,t[2]=n,t[3]=o,t}function Dt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function Tt(t,e){g_&&Dt(g_,e),g_=p_.put(t,g_||e.slice())}function At(t,e){if(t){e=e||[];var i=p_.get(t);if(i)return Dt(e,i);var n=(t+="").replace(/ /g,"").toLowerCase();if(n in f_)return Dt(e,f_[n]),Tt(t,e),e;if("#"!==n.charAt(0)){var o=n.indexOf("("),a=n.indexOf(")");if(-1!==o&&a+1===n.length){var r=n.substr(0,o),s=n.substr(o+1,a-(o+1)).split(","),l=1;switch(r){case"rgba":if(4!==s.length)return void It(e,0,0,0,1);l=bt(s.pop());case"rgb":return 3!==s.length?void It(e,0,0,0,1):(It(e,wt(s[0]),wt(s[1]),wt(s[2]),l),Tt(t,e),e);case"hsla":return 4!==s.length?void It(e,0,0,0,1):(s[3]=bt(s[3]),Ct(s,e),Tt(t,e),e);case"hsl":return 3!==s.length?void It(e,0,0,0,1):(Ct(s,e),Tt(t,e),e);default:return}}It(e,0,0,0,1)}else{if(4===n.length)return(u=parseInt(n.substr(1),16))>=0&&u<=4095?(It(e,(3840&u)>>4|(3840&u)>>8,240&u|(240&u)>>4,15&u|(15&u)<<4,1),Tt(t,e),e):void It(e,0,0,0,1);if(7===n.length){var u=parseInt(n.substr(1),16);return u>=0&&u<=16777215?(It(e,(16711680&u)>>16,(65280&u)>>8,255&u,1),Tt(t,e),e):void It(e,0,0,0,1)}}}}function Ct(t,e){var i=(parseFloat(t[0])%360+360)%360/360,n=bt(t[1]),o=bt(t[2]),a=o<=.5?o*(n+1):o+n-o*n,r=2*o-a;return e=e||[],It(e,yt(255*St(r,a,i+1/3)),yt(255*St(r,a,i)),yt(255*St(r,a,i-1/3)),1),4===t.length&&(e[3]=t[3]),e}function Lt(t){if(t){var e,i,n=t[0]/255,o=t[1]/255,a=t[2]/255,r=Math.min(n,o,a),s=Math.max(n,o,a),l=s-r,u=(s+r)/2;if(0===l)e=0,i=0;else{i=u<.5?l/(s+r):l/(2-s-r);var h=((s-n)/6+l/2)/l,c=((s-o)/6+l/2)/l,d=((s-a)/6+l/2)/l;n===s?e=d-c:o===s?e=1/3+h-d:a===s&&(e=2/3+c-h),e<0&&(e+=1),e>1&&(e-=1)}var f=[360*e,i,u];return null!=t[3]&&f.push(t[3]),f}}function kt(t,e){var i=At(t);if(i){for(var n=0;n<3;n++)i[n]=e<0?i[n]*(1-e)|0:(255-i[n])*e+i[n]|0,i[n]>255?i[n]=255:t[n]<0&&(i[n]=0);return Rt(i,4===i.length?"rgba":"rgb")}}function Pt(t){var e=At(t);if(e)return((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1)}function Nt(t,e,i){if(e&&e.length&&t>=0&&t<=1){i=i||[];var n=t*(e.length-1),o=Math.floor(n),a=Math.ceil(n),r=e[o],s=e[a],l=n-o;return i[0]=yt(Mt(r[0],s[0],l)),i[1]=yt(Mt(r[1],s[1],l)),i[2]=yt(Mt(r[2],s[2],l)),i[3]=_t(Mt(r[3],s[3],l)),i}}function Ot(t,e,i){if(e&&e.length&&t>=0&&t<=1){var n=t*(e.length-1),o=Math.floor(n),a=Math.ceil(n),r=At(e[o]),s=At(e[a]),l=n-o,u=Rt([yt(Mt(r[0],s[0],l)),yt(Mt(r[1],s[1],l)),yt(Mt(r[2],s[2],l)),_t(Mt(r[3],s[3],l))],"rgba");return i?{color:u,leftIndex:o,rightIndex:a,value:n}:u}}function Et(t,e,i,n){if(t=At(t))return t=Lt(t),null!=e&&(t[0]=xt(e)),null!=i&&(t[1]=bt(i)),null!=n&&(t[2]=bt(n)),Rt(Ct(t),"rgba")}function zt(t,e){if((t=At(t))&&null!=e)return t[3]=_t(e),Rt(t,"rgba")}function Rt(t,e){if(t&&t.length){var i=t[0]+","+t[1]+","+t[2];return"rgba"!==e&&"hsva"!==e&&"hsla"!==e||(i+=","+t[3]),e+"("+i+")"}}function Bt(t,e){return t[e]}function Vt(t,e,i){t[e]=i}function Gt(t,e,i){return(e-t)*i+t}function Ft(t,e,i){return i>.5?e:t}function Wt(t,e,i,n,o){var a=t.length;if(1==o)for(s=0;so)t.length=o;else for(r=n;r=0&&!(m[i]<=e);i--);i=Math.min(i,u-2)}else{for(i=L;ie);i++);i=Math.min(i-1,u-2)}L=i,k=e;var n=m[i+1]-m[i];if(0!==n)if(I=(e-m[i])/n,l)if(T=v[i],D=v[0===i?i:i-1],A=v[i>u-2?u-1:i+1],C=v[i>u-3?u-1:i+2],d)Ut(D,T,A,C,I,I*I,I*I*I,r(t,o),g);else{if(f)a=Ut(D,T,A,C,I,I*I,I*I*I,P,1),a=Yt(P);else{if(p)return Ft(T,A,I);a=jt(D,T,A,C,I,I*I,I*I*I)}s(t,o,a)}else if(d)Wt(v[i],v[i+1],I,r(t,o),g);else{var a;if(f)Wt(v[i],v[i+1],I,P,1),a=Yt(P);else{if(p)return Ft(v[i],v[i+1],I);a=Gt(v[i],v[i+1],I)}s(t,o,a)}},ondestroy:i});return e&&"spline"!==e&&(N.easing=e),N}}}function Kt(t,e,i,n){i<0&&(t+=i,i=-i),n<0&&(e+=n,n=-n),this.x=t,this.y=e,this.width=i,this.height=n}function Jt(t){for(var e=0;t>=k_;)e|=1&t,t>>=1;return t+e}function Qt(t,e,i,n){var o=e+1;if(o===i)return 1;if(n(t[o++],t[e])<0){for(;o=0;)o++;return o-e}function te(t,e,i){for(i--;e>>1])<0?l=a:s=a+1;var u=n-s;switch(u){case 3:t[s+3]=t[s+2];case 2:t[s+2]=t[s+1];case 1:t[s+1]=t[s];break;default:for(;u>0;)t[s+u]=t[s+u-1],u--}t[s]=r}}function ie(t,e,i,n,o,a){var r=0,s=0,l=1;if(a(t,e[i+o])>0){for(s=n-o;l0;)r=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),r+=o,l+=o}else{for(s=o+1;ls&&(l=s);var u=r;r=o-l,l=o-u}for(r++;r>>1);a(t,e[i+h])>0?r=h+1:l=h}return l}function ne(t,e,i,n,o,a){var r=0,s=0,l=1;if(a(t,e[i+o])<0){for(s=o+1;ls&&(l=s);var u=r;r=o-l,l=o-u}else{for(s=n-o;l=0;)r=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),r+=o,l+=o}for(r++;r>>1);a(t,e[i+h])<0?l=h:r=h+1}return l}function oe(t,e){function i(i){var s=a[i],u=r[i],h=a[i+1],c=r[i+1];r[i]=u+c,i===l-3&&(a[i+1]=a[i+2],r[i+1]=r[i+2]),l--;var d=ne(t[h],t,s,u,0,e);s+=d,0!==(u-=d)&&0!==(c=ie(t[s+u-1],t,h,c,c-1,e))&&(u<=c?n(s,u,h,c):o(s,u,h,c))}function n(i,n,o,a){var r=0;for(r=0;r=P_||f>=P_);if(p)break;g<0&&(g=0),g+=2}if((s=g)<1&&(s=1),1===n){for(r=0;r=0;r--)t[f+r]=t[d+r];if(0===n){v=!0;break}}if(t[c--]=u[h--],1==--a){v=!0;break}if(0!=(m=a-ie(t[l],u,0,a,a-1,e))){for(a-=m,f=(c-=m)+1,d=(h-=m)+1,r=0;r=P_||m>=P_);if(v)break;p<0&&(p=0),p+=2}if((s=p)<1&&(s=1),1===a){for(f=(c-=n)+1,d=(l-=n)+1,r=n-1;r>=0;r--)t[f+r]=t[d+r];t[c]=u[h]}else{if(0===a)throw new Error;for(d=c-(a-1),r=0;r=0;r--)t[f+r]=t[d+r];t[c]=u[h]}else for(d=c-(a-1),r=0;r1;){var t=l-2;if(t>=1&&r[t-1]<=r[t]+r[t+1]||t>=2&&r[t-2]<=r[t]+r[t-1])r[t-1]r[t+1])break;i(t)}},this.forceMergeRuns=function(){for(;l>1;){var t=l-2;t>0&&r[t-1]s&&(l=s),ee(t,i,i+l,i+a,e),a=l}r.pushRun(i,a),r.mergeRuns(),o-=a,i+=a}while(0!==o);r.forceMergeRuns()}}function re(t,e){return t.zlevel===e.zlevel?t.z===e.z?t.z2-e.z2:t.z-e.z:t.zlevel-e.zlevel}function se(t,e,i){var n=null==e.x?0:e.x,o=null==e.x2?1:e.x2,a=null==e.y?0:e.y,r=null==e.y2?0:e.y2;return e.global||(n=n*i.width+i.x,o=o*i.width+i.x,a=a*i.height+i.y,r=r*i.height+i.y),n=isNaN(n)?0:n,o=isNaN(o)?1:o,a=isNaN(a)?0:a,r=isNaN(r)?0:r,t.createLinearGradient(n,a,o,r)}function le(t,e,i){var n=i.width,o=i.height,a=Math.min(n,o),r=null==e.x?.5:e.x,s=null==e.y?.5:e.y,l=null==e.r?.5:e.r;return e.global||(r=r*n+i.x,s=s*o+i.y,l*=a),t.createRadialGradient(r,s,0,r,s,l)}function ue(){return!1}function he(t,e,i){var n=Vx(),o=e.getWidth(),a=e.getHeight(),r=n.style;return r&&(r.position="absolute",r.left=0,r.top=0,r.width=o+"px",r.height=a+"px",n.setAttribute("data-zr-dom-id",t)),n.width=o*i,n.height=a*i,n}function ce(t){if("string"==typeof t){var e=Z_.get(t);return e&&e.image}return t}function de(t,e,i,n,o){if(t){if("string"==typeof t){if(e&&e.__zrImageSrc===t||!i)return e;var a=Z_.get(t),r={hostEl:i,cb:n,cbPayload:o};return a?!pe(e=a.image)&&a.pending.push(r):(!e&&(e=new Image),e.onload=fe,Z_.put(t,e.__cachedImgObj={image:e,pending:[r]}),e.src=e.__zrImageSrc=t),e}return t}return e}function fe(){var t=this.__cachedImgObj;this.onload=this.__cachedImgObj=null;for(var e=0;eX_&&(j_=0,U_={}),j_++,U_[i]=o,o}function me(t,e,i,n,o,a,r){return a?ye(t,e,i,n,o,a,r):ve(t,e,i,n,o,r)}function ve(t,e,i,n,o,a){var r=Ae(t,e,o,a),s=ge(t,e);o&&(s+=o[1]+o[3]);var l=r.outerHeight,u=new Kt(xe(0,s,i),_e(0,l,n),s,l);return u.lineHeight=r.lineHeight,u}function ye(t,e,i,n,o,a,r){var s=Ce(t,{rich:a,truncate:r,font:e,textAlign:i,textPadding:o}),l=s.outerWidth,u=s.outerHeight;return new Kt(xe(0,l,i),_e(0,u,n),l,u)}function xe(t,e,i){return"right"===i?t-=e:"center"===i&&(t-=e/2),t}function _e(t,e,i){return"middle"===i?t-=e/2:"bottom"===i&&(t-=e),t}function we(t,e,i){var n=e.x,o=e.y,a=e.height,r=e.width,s=a/2,l="left",u="top";switch(t){case"left":n-=i,o+=s,l="right",u="middle";break;case"right":n+=i+r,o+=s,u="middle";break;case"top":n+=r/2,o-=i,l="center",u="bottom";break;case"bottom":n+=r/2,o+=a+i,l="center";break;case"inside":n+=r/2,o+=s,l="center",u="middle";break;case"insideLeft":n+=i,o+=s,u="middle";break;case"insideRight":n+=r-i,o+=s,l="right",u="middle";break;case"insideTop":n+=r/2,o+=i,l="center";break;case"insideBottom":n+=r/2,o+=a-i,l="center",u="bottom";break;case"insideTopLeft":n+=i,o+=i;break;case"insideTopRight":n+=r-i,o+=i,l="right";break;case"insideBottomLeft":n+=i,o+=a-i,u="bottom";break;case"insideBottomRight":n+=r-i,o+=a-i,l="right",u="bottom"}return{x:n,y:o,textAlign:l,textVerticalAlign:u}}function be(t,e,i,n,o){if(!e)return"";var a=(t+"").split("\n");o=Se(e,i,n,o);for(var r=0,s=a.length;r=r;l++)s-=r;var u=ge(i);return u>s&&(i="",u=0),s=t-u,n.ellipsis=i,n.ellipsisWidth=u,n.contentWidth=s,n.containerWidth=t,n}function Me(t,e){var i=e.containerWidth,n=e.font,o=e.contentWidth;if(!i)return"";var a=ge(t,n);if(a<=i)return t;for(var r=0;;r++){if(a<=o||r>=e.maxIterations){t+=e.ellipsis;break}var s=0===r?Ie(t,o,e.ascCharWidth,e.cnCharWidth):a>0?Math.floor(t.length*o/a):0;a=ge(t=t.substr(0,s),n)}return""===t&&(t=e.placeholder),t}function Ie(t,e,i,n){for(var o=0,a=0,r=t.length;al)t="",a=[];else if(null!=u)for(var h=Se(u-(i?i[1]+i[3]:0),e,n.ellipsis,{minChar:n.minChar,placeholder:n.placeholder}),c=0,d=a.length;co&&Le(i,t.substring(o,a)),Le(i,n[2],n[1]),o=Y_.lastIndex}of)return{lines:[],width:0,height:0};k.textWidth=ge(k.text,_);var b=y.textWidth,S=null==b||"auto"===b;if("string"==typeof b&&"%"===b.charAt(b.length-1))k.percentWidth=b,u.push(k),b=0;else{if(S){b=k.textWidth;var M=y.textBackgroundColor,I=M&&M.image;I&&pe(I=ce(I))&&(b=Math.max(b,I.width*w/I.height))}var D=x?x[1]+x[3]:0;b+=D;var C=null!=d?d-m:null;null!=C&&Cl&&(i*=l/(c=i+n),n*=l/c),o+a>l&&(o*=l/(c=o+a),a*=l/c),n+o>u&&(n*=u/(c=n+o),o*=u/c),i+a>u&&(i*=u/(c=i+a),a*=u/c),t.moveTo(r+i,s),t.lineTo(r+l-n,s),0!==n&&t.arc(r+l-n,s+n,n,-Math.PI/2,0),t.lineTo(r+l,s+u-o),0!==o&&t.arc(r+l-o,s+u-o,o,0,Math.PI/2),t.lineTo(r+a,s+u),0!==a&&t.arc(r+a,s+u-a,a,Math.PI/2,Math.PI),t.lineTo(r,s+i),0!==i&&t.arc(r+i,s+i,i,Math.PI,1.5*Math.PI)}function Ne(t){return Oe(t),d(t.rich,Oe),t}function Oe(t){if(t){t.font=ke(t);var e=t.textAlign;"middle"===e&&(e="center"),t.textAlign=null==e||K_[e]?e:"left";var i=t.textVerticalAlign||t.textBaseline;"center"===i&&(i="middle"),t.textVerticalAlign=null==i||J_[i]?i:"top",t.textPadding&&(t.textPadding=L(t.textPadding))}}function Ee(t,e,i,n,o){n.rich?Re(t,e,i,n,o):ze(t,e,i,n,o)}function ze(t,e,i,n,o){var a=Ue(e,"font",n.font||q_),r=n.textPadding,s=t.__textCotentBlock;s&&!t.__dirty||(s=t.__textCotentBlock=Ae(i,a,r,n.truncate));var l=s.outerHeight,u=s.lines,h=s.lineHeight,c=Ze(l,n,o),d=c.baseX,f=c.baseY,p=c.textAlign,g=c.textVerticalAlign;Ve(e,n,o,d,f);var m=_e(f,l,g),v=d,y=m,x=Fe(n);if(x||r){var _=ge(i,a);r&&(_+=r[1]+r[3]);var w=xe(d,_,p);x&&We(t,e,n,w,m,_,l),r&&(v=qe(d,p,r),y+=r[0])}Ue(e,"textAlign",p||"left"),Ue(e,"textBaseline","middle"),Ue(e,"shadowBlur",n.textShadowBlur||0),Ue(e,"shadowColor",n.textShadowColor||"transparent"),Ue(e,"shadowOffsetX",n.textShadowOffsetX||0),Ue(e,"shadowOffsetY",n.textShadowOffsetY||0),y+=h/2;var b=n.textStrokeWidth,S=je(n.textStroke,b),M=Xe(n.textFill);S&&(Ue(e,"lineWidth",b),Ue(e,"strokeStyle",S)),M&&Ue(e,"fillStyle",M);for(var I=0;I=0&&"right"===(_=b[C]).textAlign;)Ge(t,e,_,n,M,v,A,"right"),I-=_.width,A-=_.width,C--;for(T+=(a-(T-m)-(y-A)-I)/2;D<=C;)Ge(t,e,_=b[D],n,M,v,T+_.width/2,"center"),T+=_.width,D++;v+=M}}function Ve(t,e,i,n,o){if(i&&e.textRotation){var a=e.textOrigin;"center"===a?(n=i.width/2+i.x,o=i.height/2+i.y):a&&(n=a[0]+i.x,o=a[1]+i.y),t.translate(n,o),t.rotate(-e.textRotation),t.translate(-n,-o)}}function Ge(t,e,i,n,o,a,r,s){var l=n.rich[i.styleName]||{},u=i.textVerticalAlign,h=a+o/2;"top"===u?h=a+i.height/2:"bottom"===u&&(h=a+o-i.height/2),!i.isLineHolder&&Fe(l)&&We(t,e,l,"right"===s?r-i.width:"center"===s?r-i.width/2:r,h-i.height/2,i.width,i.height);var c=i.textPadding;c&&(r=qe(r,s,c),h-=i.height/2-c[2]-i.textHeight/2),Ue(e,"shadowBlur",A(l.textShadowBlur,n.textShadowBlur,0)),Ue(e,"shadowColor",l.textShadowColor||n.textShadowColor||"transparent"),Ue(e,"shadowOffsetX",A(l.textShadowOffsetX,n.textShadowOffsetX,0)),Ue(e,"shadowOffsetY",A(l.textShadowOffsetY,n.textShadowOffsetY,0)),Ue(e,"textAlign",s),Ue(e,"textBaseline","middle"),Ue(e,"font",i.font||q_);var d=je(l.textStroke||n.textStroke,p),f=Xe(l.textFill||n.textFill),p=T(l.textStrokeWidth,n.textStrokeWidth);d&&(Ue(e,"lineWidth",p),Ue(e,"strokeStyle",d),e.strokeText(i.text,r,h)),f&&(Ue(e,"fillStyle",f),e.fillText(i.text,r,h))}function Fe(t){return t.textBackgroundColor||t.textBorderWidth&&t.textBorderColor}function We(t,e,i,n,o,a,r){var s=i.textBackgroundColor,l=i.textBorderWidth,u=i.textBorderColor,h=_(s);if(Ue(e,"shadowBlur",i.textBoxShadowBlur||0),Ue(e,"shadowColor",i.textBoxShadowColor||"transparent"),Ue(e,"shadowOffsetX",i.textBoxShadowOffsetX||0),Ue(e,"shadowOffsetY",i.textBoxShadowOffsetY||0),h||l&&u){e.beginPath();var c=i.textBorderRadius;c?Pe(e,{x:n,y:o,width:a,height:r,r:c}):e.rect(n,o,a,r),e.closePath()}if(h)Ue(e,"fillStyle",s),e.fill();else if(w(s)){var d=s.image;(d=de(d,null,t,He,s))&&pe(d)&&e.drawImage(d,n,o,a,r)}l&&u&&(Ue(e,"lineWidth",l),Ue(e,"strokeStyle",u),e.stroke())}function He(t,e){e.image=t}function Ze(t,e,i){var n=e.x||0,o=e.y||0,a=e.textAlign,r=e.textVerticalAlign;if(i){var s=e.textPosition;if(s instanceof Array)n=i.x+Ye(s[0],i.width),o=i.y+Ye(s[1],i.height);else{var l=we(s,i,e.textDistance);n=l.x,o=l.y,a=a||l.textAlign,r=r||l.textVerticalAlign}var u=e.textOffset;u&&(n+=u[0],o+=u[1])}return{baseX:n,baseY:o,textAlign:a,textVerticalAlign:r}}function Ue(t,e,i){return t[e]=E_(t,e,i),t[e]}function je(t,e){return null==t||e<=0||"transparent"===t||"none"===t?null:t.image||t.colorStops?"#000":t}function Xe(t){return null==t||"none"===t?null:t.image||t.colorStops?"#000":t}function Ye(t,e){return"string"==typeof t?t.lastIndexOf("%")>=0?parseFloat(t)/100*e:parseFloat(t):t}function qe(t,e,i){return"right"===e?t-i[1]:"center"===e?t+i[3]/2-i[1]/2:t+i[3]}function $e(t,e){return null!=t&&(t||e.textBackgroundColor||e.textBorderWidth&&e.textBorderColor||e.textPadding)}function Ke(t){t=t||{},D_.call(this,t);for(var e in t)t.hasOwnProperty(e)&&"style"!==e&&(this[e]=t[e]);this.style=new R_(t.style,this),this._rect=null,this.__clipPaths=[]}function Je(t){Ke.call(this,t)}function Qe(t){return parseInt(t,10)}function ti(t){return!!t&&(!!t.__builtin__||"function"==typeof t.resize&&"function"==typeof t.refresh)}function ei(t,e,i){return ew.copy(t.getBoundingRect()),t.transform&&ew.applyTransform(t.transform),iw.width=e,iw.height=i,!ew.intersect(iw)}function ii(t,e){if(t==e)return!1;if(!t||!e||t.length!==e.length)return!0;for(var i=0;i=0){var o="touchend"!=n?e.targetTouches[0]:e.changedTouches[0];o&&ri(t,o,e,i)}else ri(t,e,e,i),e.zrDelta=e.wheelDelta?e.wheelDelta/120:-(e.detail||0)/3;var a=e.button;return null==e.which&&void 0!==a&&aw.test(e.type)&&(e.which=1&a?1:2&a?3:4&a?2:0),e}function ui(t,e,i){ow?t.addEventListener(e,i):t.attachEvent("on"+e,i)}function hi(t,e,i){ow?t.removeEventListener(e,i):t.detachEvent("on"+e,i)}function ci(t){return t.which>1}function di(t){var e=t[1][0]-t[0][0],i=t[1][1]-t[0][1];return Math.sqrt(e*e+i*i)}function fi(t){return[(t[0][0]+t[1][0])/2,(t[0][1]+t[1][1])/2]}function pi(t){return"mousewheel"===t&&Ax.browser.firefox?"DOMMouseScroll":t}function gi(t,e,i){var n=t._gestureMgr;"start"===i&&n.clear();var o=n.recognize(e,t.handler.findHover(e.zrX,e.zrY,null).target,t.dom);if("end"===i&&n.clear(),o){var a=o.type;e.gestureEvent=a,t.handler.dispatchToElement({target:o.target},a,o.event)}}function mi(t){t._touching=!0,clearTimeout(t._touchTimer),t._touchTimer=setTimeout(function(){t._touching=!1},700)}function vi(t){var e=t.pointerType;return"pen"===e||"touch"===e}function yi(t){function e(t,e){return function(){if(!e._touching)return t.apply(e,arguments)}}d(cw,function(e){t._handlers[e]=m(pw[e],t)}),d(fw,function(e){t._handlers[e]=m(pw[e],t)}),d(hw,function(i){t._handlers[i]=e(pw[i],t)})}function xi(t){function e(e,i){d(e,function(e){ui(t,pi(e),i._handlers[e])},i)}$x.call(this),this.dom=t,this._touching=!1,this._touchTimer,this._gestureMgr=new lw,this._handlers={},yi(this),Ax.pointerEventsSupported?e(fw,this):(Ax.touchEventsSupported&&e(cw,this),e(hw,this))}function _i(t,e){var i=new xw(Dx(),t,e);return yw[i.id]=i,i}function wi(t,e){vw[t]=e}function bi(t){delete yw[t]}function Si(t){return t instanceof Array?t:null==t?[]:[t]}function Mi(t,e,i){if(t){t[e]=t[e]||{},t.emphasis=t.emphasis||{},t.emphasis[e]=t.emphasis[e]||{};for(var n=0,o=i.length;n=i.length&&i.push({option:t})}}),i}function Ai(t){var e=z();ww(t,function(t,i){var n=t.exist;n&&e.set(n.id,t)}),ww(t,function(t,i){var n=t.option;k(!n||null==n.id||!e.get(n.id)||e.get(n.id)===t,"id duplicates: "+(n&&n.id)),n&&null!=n.id&&e.set(n.id,t),!t.keyInfo&&(t.keyInfo={})}),ww(t,function(t,i){var n=t.exist,o=t.option,a=t.keyInfo;if(bw(o)){if(a.name=null!=o.name?o.name+"":n?n.name:Mw+i,n)a.id=n.id;else if(null!=o.id)a.id=o.id+"";else{var r=0;do{a.id="\0"+a.name+"\0"+r++}while(e.get(a.id))}e.set(a.id,t)}})}function Ci(t){var e=t.name;return!(!e||!e.indexOf(Mw))}function Li(t){return bw(t)&&t.id&&0===(t.id+"").indexOf("\0_ec_\0")}function ki(t,e){function i(t,e,i){for(var n=0,o=t.length;n-Rw&&tRw||t<-Rw}function Xi(t,e,i,n,o){var a=1-o;return a*a*(a*t+3*o*e)+o*o*(o*n+3*a*i)}function Yi(t,e,i,n,o){var a=1-o;return 3*(((e-t)*a+2*(i-e)*o)*a+(n-i)*o*o)}function qi(t,e,i,n,o,a){var r=n+3*(e-i)-t,s=3*(i-2*e+t),l=3*(e-t),u=t-o,h=s*s-3*r*l,c=s*l-9*r*u,d=l*l-3*s*u,f=0;if(Ui(h)&&Ui(c))Ui(s)?a[0]=0:(M=-l/s)>=0&&M<=1&&(a[f++]=M);else{var p=c*c-4*h*d;if(Ui(p)){var g=c/h,m=-g/2;(M=-s/r+g)>=0&&M<=1&&(a[f++]=M),m>=0&&m<=1&&(a[f++]=m)}else if(p>0){var v=zw(p),y=h*s+1.5*r*(-c+v),x=h*s+1.5*r*(-c-v);(M=(-s-((y=y<0?-Ew(-y,Gw):Ew(y,Gw))+(x=x<0?-Ew(-x,Gw):Ew(x,Gw))))/(3*r))>=0&&M<=1&&(a[f++]=M)}else{var _=(2*h*s-3*r*c)/(2*zw(h*h*h)),w=Math.acos(_)/3,b=zw(h),S=Math.cos(w),M=(-s-2*b*S)/(3*r),m=(-s+b*(S+Vw*Math.sin(w)))/(3*r),I=(-s+b*(S-Vw*Math.sin(w)))/(3*r);M>=0&&M<=1&&(a[f++]=M),m>=0&&m<=1&&(a[f++]=m),I>=0&&I<=1&&(a[f++]=I)}}return f}function $i(t,e,i,n,o){var a=6*i-12*e+6*t,r=9*e+3*n-3*t-9*i,s=3*e-3*t,l=0;if(Ui(r))ji(a)&&(c=-s/a)>=0&&c<=1&&(o[l++]=c);else{var u=a*a-4*r*s;if(Ui(u))o[0]=-a/(2*r);else if(u>0){var h=zw(u),c=(-a+h)/(2*r),d=(-a-h)/(2*r);c>=0&&c<=1&&(o[l++]=c),d>=0&&d<=1&&(o[l++]=d)}}return l}function Ki(t,e,i,n,o,a){var r=(e-t)*o+t,s=(i-e)*o+e,l=(n-i)*o+i,u=(s-r)*o+r,h=(l-s)*o+s,c=(h-u)*o+u;a[0]=t,a[1]=r,a[2]=u,a[3]=c,a[4]=c,a[5]=h,a[6]=l,a[7]=n}function Ji(t,e,i,n,o,a,r,s,l,u,h){var c,d,f,p,g,m=.005,v=1/0;Fw[0]=l,Fw[1]=u;for(var y=0;y<1;y+=.05)Ww[0]=Xi(t,i,o,r,y),Ww[1]=Xi(e,n,a,s,y),(p=Xx(Fw,Ww))=0&&p=0&&c<=1&&(o[l++]=c);else{var u=r*r-4*a*s;if(Ui(u))(c=-r/(2*a))>=0&&c<=1&&(o[l++]=c);else if(u>0){var h=zw(u),c=(-r+h)/(2*a),d=(-r-h)/(2*a);c>=0&&c<=1&&(o[l++]=c),d>=0&&d<=1&&(o[l++]=d)}}return l}function nn(t,e,i){var n=t+i-2*e;return 0===n?.5:(t-e)/n}function on(t,e,i,n,o){var a=(e-t)*n+t,r=(i-e)*n+e,s=(r-a)*n+a;o[0]=t,o[1]=a,o[2]=s,o[3]=s,o[4]=r,o[5]=i}function an(t,e,i,n,o,a,r,s,l){var u,h=.005,c=1/0;Fw[0]=r,Fw[1]=s;for(var d=0;d<1;d+=.05)Ww[0]=Qi(t,i,o,d),Ww[1]=Qi(e,n,a,d),(m=Xx(Fw,Ww))=0&&m1e-4)return s[0]=t-i,s[1]=e-n,l[0]=t+i,void(l[1]=e+n);if(qw[0]=Xw(o)*i+t,qw[1]=jw(o)*n+e,$w[0]=Xw(a)*i+t,$w[1]=jw(a)*n+e,u(s,qw,$w),h(l,qw,$w),(o%=Yw)<0&&(o+=Yw),(a%=Yw)<0&&(a+=Yw),o>a&&!r?a+=Yw:oo&&(Kw[0]=Xw(f)*i+t,Kw[1]=jw(f)*n+e,u(s,Kw,s),h(l,Kw,l))}function cn(t,e,i,n,o,a,r){if(0===o)return!1;var s=o,l=0,u=t;if(r>e+s&&r>n+s||rt+s&&a>i+s||ae+c&&h>n+c&&h>a+c&&h>s+c||ht+c&&u>i+c&&u>o+c&&u>r+c||ue+u&&l>n+u&&l>a+u||lt+u&&s>i+u&&s>o+u||si||h+uo&&(o+=pb);var d=Math.atan2(l,s);return d<0&&(d+=pb),d>=n&&d<=o||d+pb>=n&&d+pb<=o}function mn(t,e,i,n,o,a){if(a>e&&a>n||ao?r:0}function vn(t,e){return Math.abs(t-e)e&&u>n&&u>a&&u>s||u1&&yn(),c=Xi(e,n,a,s,xb[0]),p>1&&(d=Xi(e,n,a,s,xb[1]))),2==p?me&&s>n&&s>a||s=0&&u<=1){for(var h=0,c=Qi(e,n,a,u),d=0;di||s<-i)return 0;u=Math.sqrt(i*i-s*s);yb[0]=-u,yb[1]=u;var l=Math.abs(n-o);if(l<1e-4)return 0;if(l%mb<1e-4){n=0,o=mb;p=a?1:-1;return r>=yb[0]+t&&r<=yb[1]+t?p:0}if(a){var u=n;n=pn(o),o=pn(u)}else n=pn(n),o=pn(o);n>o&&(o+=mb);for(var h=0,c=0;c<2;c++){var d=yb[c];if(d+t>r){var f=Math.atan2(s,d),p=a?1:-1;f<0&&(f=mb+f),(f>=n&&f<=o||f+mb>=n&&f+mb<=o)&&(f>Math.PI/2&&f<1.5*Math.PI&&(p=-p),h+=p)}}return h}function bn(t,e,i,n,o){for(var a=0,r=0,s=0,l=0,u=0,h=0;h1&&(i||(a+=mn(r,s,l,u,n,o))),1==h&&(l=r=t[h],u=s=t[h+1]),c){case gb.M:r=l=t[h++],s=u=t[h++];break;case gb.L:if(i){if(cn(r,s,t[h],t[h+1],e,n,o))return!0}else a+=mn(r,s,t[h],t[h+1],n,o)||0;r=t[h++],s=t[h++];break;case gb.C:if(i){if(dn(r,s,t[h++],t[h++],t[h++],t[h++],t[h],t[h+1],e,n,o))return!0}else a+=xn(r,s,t[h++],t[h++],t[h++],t[h++],t[h],t[h+1],n,o)||0;r=t[h++],s=t[h++];break;case gb.Q:if(i){if(fn(r,s,t[h++],t[h++],t[h],t[h+1],e,n,o))return!0}else a+=_n(r,s,t[h++],t[h++],t[h],t[h+1],n,o)||0;r=t[h++],s=t[h++];break;case gb.A:var d=t[h++],f=t[h++],p=t[h++],g=t[h++],m=t[h++],v=t[h++],y=(t[h++],1-t[h++]),x=Math.cos(m)*p+d,_=Math.sin(m)*g+f;h>1?a+=mn(r,s,x,_,n,o):(l=x,u=_);var w=(n-d)*g/p+d;if(i){if(gn(d,f,g,m,m+v,y,e,w,o))return!0}else a+=wn(d,f,g,m,m+v,y,w,o);r=Math.cos(m+v)*p+d,s=Math.sin(m+v)*g+f;break;case gb.R:l=r=t[h++],u=s=t[h++];var x=l+t[h++],_=u+t[h++];if(i){if(cn(l,u,x,u,e,n,o)||cn(x,u,x,_,e,n,o)||cn(x,_,l,_,e,n,o)||cn(l,_,l,u,e,n,o))return!0}else a+=mn(x,u,x,_,n,o),a+=mn(l,_,l,u,n,o);break;case gb.Z:if(i){if(cn(r,s,l,u,e,n,o))return!0}else a+=mn(r,s,l,u,n,o);r=l,s=u}}return i||vn(s,u)||(a+=mn(r,s,l,u,n,o)||0),0!==a}function Sn(t,e,i){return bn(t,0,!1,e,i)}function Mn(t,e,i,n){return bn(t,e,!0,i,n)}function In(t){Ke.call(this,t),this.path=null}function Dn(t,e,i,n,o,a,r,s,l,u,h){var c=l*(Pb/180),d=kb(c)*(t-i)/2+Lb(c)*(e-n)/2,f=-1*Lb(c)*(t-i)/2+kb(c)*(e-n)/2,p=d*d/(r*r)+f*f/(s*s);p>1&&(r*=Cb(p),s*=Cb(p));var g=(o===a?-1:1)*Cb((r*r*(s*s)-r*r*(f*f)-s*s*(d*d))/(r*r*(f*f)+s*s*(d*d)))||0,m=g*r*f/s,v=g*-s*d/r,y=(t+i)/2+kb(c)*m-Lb(c)*v,x=(e+n)/2+Lb(c)*m+kb(c)*v,_=Eb([1,0],[(d-m)/r,(f-v)/s]),w=[(d-m)/r,(f-v)/s],b=[(-1*d-m)/r,(-1*f-v)/s],S=Eb(w,b);Ob(w,b)<=-1&&(S=Pb),Ob(w,b)>=1&&(S=0),0===a&&S>0&&(S-=2*Pb),1===a&&S<0&&(S+=2*Pb),h.addData(u,y,x,r,s,_,S,c,a)}function Tn(t){if(!t)return[];var e,i=t.replace(/-/g," -").replace(/ /g," ").replace(/ /g,",").replace(/,,/g,",");for(e=0;e0&&""===f[0]&&f.shift();for(var p=0;p=2){if(o&&"spline"!==o){var a=Hb(n,o,i,e.smoothConstraint);t.moveTo(n[0][0],n[0][1]);for(var r=n.length,s=0;s<(i?r:r-1);s++){var l=a[2*s],u=a[2*s+1],h=n[(s+1)%r];t.bezierCurveTo(l[0],l[1],u[0],u[1],h[0],h[1])}}else{"spline"===o&&(n=Wb(n,i)),t.moveTo(n[0][0],n[0][1]);for(var s=1,c=n.length;s=0)&&(n={textFill:null,textStroke:t.textStroke,textStrokeWidth:t.textStrokeWidth},t.textFill="#fff",null==t.textStroke&&(t.textStroke=i.autoColor,null==t.textStrokeWidth&&(t.textStrokeWidth=2))),n}function uo(t){var e=t.insideRollback;e&&(t.textFill=e.textFill,t.textStroke=e.textStroke,t.textStrokeWidth=e.textStrokeWidth)}function ho(t,e){var i=e||e.getModel("textStyle");return P([t.fontStyle||i&&i.getShallow("fontStyle")||"",t.fontWeight||i&&i.getShallow("fontWeight")||"",(t.fontSize||i&&i.getShallow("fontSize")||12)+"px",t.fontFamily||i&&i.getShallow("fontFamily")||"sans-serif"].join(" "))}function co(t,e,i,n,o,a){if("function"==typeof o&&(a=o,o=null),n&&n.isAnimationEnabled()){var r=t?"Update":"",s=n.getShallow("animationDuration"+r),l=n.getShallow("animationEasing"+r),u=n.getShallow("animationDelay"+r);"function"==typeof u&&(u=u(o,n.getAnimationDelayParams?n.getAnimationDelayParams(e,o):null)),"function"==typeof s&&(s=s(o)),s>0?e.animateTo(i,s,u||0,l,a,!!a):(e.stopAnimation(),e.attr(i),a&&a())}else e.stopAnimation(),e.attr(i),a&&a()}function fo(t,e,i,n,o){co(!0,t,e,i,n,o)}function po(t,e,i,n,o){co(!1,t,e,i,n,o)}function go(t,e){for(var i=lt([]);t&&t!==e;)ht(i,t.getLocalTransform(),i),t=t.parent;return i}function mo(t,e,i){return e&&!c(e)&&(e=o_.getLocalTransform(e)),i&&(e=pt([],e)),Q([],t,e)}function vo(t,e,i){var n=0===e[4]||0===e[5]||0===e[0]?1:Math.abs(2*e[4]/e[0]),o=0===e[4]||0===e[5]||0===e[2]?1:Math.abs(2*e[4]/e[2]),a=["left"===t?-n:"right"===t?n:0,"top"===t?-o:"bottom"===t?o:0];return a=mo(a,e,i),Math.abs(a[0])>Math.abs(a[1])?a[0]>0?"right":"left":a[1]>0?"bottom":"top"}function yo(t,e,i,n){function o(t){var e={position:F(t.position),rotation:t.rotation};return t.shape&&(e.shape=a({},t.shape)),e}if(t&&e){var r=function(t){var e={};return t.traverse(function(t){!t.isGroup&&t.anid&&(e[t.anid]=t)}),e}(t);e.traverse(function(t){if(!t.isGroup&&t.anid){var e=r[t.anid];if(e){var n=o(t);t.attr(o(e)),fo(t,n,i,t.dataIndex)}}})}}function xo(t,e){return f(t,function(t){var i=t[0];i=nS(i,e.x),i=oS(i,e.x+e.width);var n=t[1];return n=nS(n,e.y),n=oS(n,e.y+e.height),[i,n]})}function _o(t,e,i){var n=(e=a({rectHover:!0},e)).style={strokeNoScale:!0};if(i=i||{x:-1,y:-1,width:2,height:2},t)return 0===t.indexOf("image://")?(n.image=t.slice(8),r(n,i),new Je(e)):zn(t.replace("path://",""),e,i,"center")}function wo(t,e,i){this.parentModel=e,this.ecModel=i,this.option=t}function bo(t,e,i){for(var n=0;n0){if(t<=e[0])return i[0];if(t>=e[1])return i[1]}else{if(t>=e[0])return i[0];if(t<=e[1])return i[1]}else{if(t===e[0])return i[0];if(t===e[1])return i[1]}return(t-e[0])/o*a+i[0]}function To(t,e){switch(t){case"center":case"middle":t="50%";break;case"left":case"top":t="0%";break;case"right":case"bottom":t="100%"}return"string"==typeof t?Io(t).match(/%$/)?parseFloat(t)/100*e:parseFloat(t):null==t?NaN:+t}function Ao(t,e,i){return null==e&&(e=10),e=Math.min(Math.max(0,e),20),t=(+t).toFixed(e),i?t:+t}function Co(t){return t.sort(function(t,e){return t-e}),t}function Lo(t){if(t=+t,isNaN(t))return 0;for(var e=1,i=0;Math.round(t*e)/e!==t;)e*=10,i++;return i}function ko(t){var e=t.toString(),i=e.indexOf("e");if(i>0){var n=+e.slice(i+1);return n<0?-n:0}var o=e.indexOf(".");return o<0?0:e.length-1-o}function Po(t,e){var i=Math.log,n=Math.LN10,o=Math.floor(i(t[1]-t[0])/n),a=Math.round(i(Math.abs(e[1]-e[0]))/n),r=Math.min(Math.max(-o+a,0),20);return isFinite(r)?r:20}function No(t,e,i){if(!t[e])return 0;var n=p(t,function(t,e){return t+(isNaN(e)?0:e)},0);if(0===n)return 0;for(var o=Math.pow(10,i),a=f(t,function(t){return(isNaN(t)?0:t)/n*o*100}),r=100*o,s=f(a,function(t){return Math.floor(t)}),l=p(s,function(t,e){return t+e},0),u=f(a,function(t,e){return t-s[e]});lh&&(h=u[d],c=d);++s[c],u[c]=0,++l}return s[e]/o}function Oo(t){var e=2*Math.PI;return(t%e+e)%e}function Eo(t){return t>-gS&&t=-20?+t.toFixed(n<0?-n:0):t}function Go(t){function e(t,i,n){return t.interval[n]=0}function Wo(t){return isNaN(t)?"-":(t=(t+"").split("."))[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(t.length>1?"."+t[1]:"")}function Ho(t,e){return t=(t||"").toLowerCase().replace(/-(.)/g,function(t,e){return e.toUpperCase()}),e&&t&&(t=t.charAt(0).toUpperCase()+t.slice(1)),t}function Zo(t){return String(t).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function Uo(t,e,i){y(e)||(e=[e]);var n=e.length;if(!n)return"";for(var o=e[0].$vars||[],a=0;a':'':""}function Yo(t,e){return t+="","0000".substr(0,e-t.length)+t}function qo(t,e,i){"week"!==t&&"month"!==t&&"quarter"!==t&&"half-year"!==t&&"year"!==t||(t="MM-dd\nyyyy");var n=zo(e),o=i?"UTC":"",a=n["get"+o+"FullYear"](),r=n["get"+o+"Month"]()+1,s=n["get"+o+"Date"](),l=n["get"+o+"Hours"](),u=n["get"+o+"Minutes"](),h=n["get"+o+"Seconds"](),c=n["get"+o+"Milliseconds"]();return t=t.replace("MM",Yo(r,2)).replace("M",r).replace("yyyy",a).replace("yy",a%100).replace("dd",Yo(s,2)).replace("d",s).replace("hh",Yo(l,2)).replace("h",l).replace("mm",Yo(u,2)).replace("m",u).replace("ss",Yo(h,2)).replace("s",h).replace("SSS",Yo(c,3))}function $o(t){return t?t.charAt(0).toUpperCase()+t.substr(1):t}function Ko(t,e,i,n,o){var a=0,r=0;null==n&&(n=1/0),null==o&&(o=1/0);var s=0;e.eachChild(function(l,u){var h,c,d=l.position,f=l.getBoundingRect(),p=e.childAt(u+1),g=p&&p.getBoundingRect();if("horizontal"===t){var m=f.width+(g?-g.x+f.x:0);(h=a+m)>n||l.newline?(a=0,h=m,r+=s+i,s=f.height):s=Math.max(s,f.height)}else{var v=f.height+(g?-g.y+f.y:0);(c=r+v)>o||l.newline?(a+=s+i,r=0,c=v,s=f.width):s=Math.max(s,f.width)}l.newline||(d[0]=a,d[1]=r,"horizontal"===t?a=h+i:r=c+i)})}function Jo(t,e,i){var n=e.width,o=e.height,a=To(t.x,n),r=To(t.y,o),s=To(t.x2,n),l=To(t.y2,o);return(isNaN(a)||isNaN(parseFloat(t.x)))&&(a=0),(isNaN(s)||isNaN(parseFloat(t.x2)))&&(s=n),(isNaN(r)||isNaN(parseFloat(t.y)))&&(r=0),(isNaN(l)||isNaN(parseFloat(t.y2)))&&(l=o),i=xS(i||0),{width:Math.max(s-a-i[1]-i[3],0),height:Math.max(l-r-i[0]-i[2],0)}}function Qo(t,e,i){i=xS(i||0);var n=e.width,o=e.height,a=To(t.left,n),r=To(t.top,o),s=To(t.right,n),l=To(t.bottom,o),u=To(t.width,n),h=To(t.height,o),c=i[2]+i[0],d=i[1]+i[3],f=t.aspect;switch(isNaN(u)&&(u=n-s-d-a),isNaN(h)&&(h=o-l-c-r),null!=f&&(isNaN(u)&&isNaN(h)&&(f>n/o?u=.8*n:h=.8*o),isNaN(u)&&(u=f*h),isNaN(h)&&(h=u/f)),isNaN(a)&&(a=n-s-u-d),isNaN(r)&&(r=o-l-h-c),t.left||t.right){case"center":a=n/2-u/2-i[3];break;case"right":a=n-u-d}switch(t.top||t.bottom){case"middle":case"center":r=o/2-h/2-i[0];break;case"bottom":r=o-h-c}a=a||0,r=r||0,isNaN(u)&&(u=n-d-a-(s||0)),isNaN(h)&&(h=o-c-r-(l||0));var p=new Kt(a+i[3],r+i[0],u,h);return p.margin=i,p}function ta(t,e,i,n,o){var a=!o||!o.hv||o.hv[0],s=!o||!o.hv||o.hv[1],l=o&&o.boundingMode||"all";if(a||s){var u;if("raw"===l)u="group"===t.type?new Kt(0,0,+e.width||0,+e.height||0):t.getBoundingRect();else if(u=t.getBoundingRect(),t.needLocalTransform()){var h=t.getLocalTransform();(u=u.clone()).applyTransform(h)}e=Qo(r({width:u.width,height:u.height},e),i,n);var c=t.position,d=a?e.x-u.x:0,f=s?e.y-u.y:0;t.attr("position","raw"===l?[d,f]:[c[0]+d,c[1]+f])}}function ea(t,e){return null!=t[TS[e][0]]||null!=t[TS[e][1]]&&null!=t[TS[e][2]]}function ia(t,e,i){function n(i,n){var r={},l=0,u={},h=0;if(IS(i,function(e){u[e]=t[e]}),IS(i,function(t){o(e,t)&&(r[t]=u[t]=e[t]),a(r,t)&&l++,a(u,t)&&h++}),s[n])return a(e,i[1])?u[i[2]]=null:a(e,i[2])&&(u[i[1]]=null),u;if(2!==h&&l){if(l>=2)return r;for(var c=0;ce)return t[n];return t[i-1]}function ra(t){var e=t.get("coordinateSystem"),i={coordSysName:e,coordSysDims:[],axisMap:z(),categoryAxisMap:z()},n=zS[e];if(n)return n(t,i,i.axisMap,i.categoryAxisMap),i}function sa(t){return"category"===t.get("type")}function la(t){this.fromDataset=t.fromDataset,this.data=t.data||(t.sourceFormat===GS?{}:[]),this.sourceFormat=t.sourceFormat||FS,this.seriesLayoutBy=t.seriesLayoutBy||HS,this.dimensionsDefine=t.dimensionsDefine,this.encodeDefine=t.encodeDefine&&z(t.encodeDefine),this.startIndex=t.startIndex||0,this.dimensionsDetectCount=t.dimensionsDetectCount}function ua(t){var e=t.option.source,i=FS;if(S(e))i=WS;else if(y(e))for(var n=0,o=e.length;n=e:"max"===i?t<=e:t===e}function Oa(t,e){return t.join(",")===e.join(",")}function Ea(t,e){$S(e=e||{},function(e,i){if(null!=e){var n=t[i];if(kS.hasClass(i)){e=Si(e);var o=Ti(n=Si(n),e);t[i]=JS(o,function(t){return t.option&&t.exist?QS(t.exist,t.option,!0):t.exist||t.option})}else t[i]=QS(n,e,!0)}})}function za(t){var e=t&&t.itemStyle;if(e)for(var i=0,o=nM.length;i=0;p--){var g=t[p];if(s||(d=g.data.rawIndexOf(g.stackedByDimension,c)),d>=0){var m=g.data.getByRawIndex(g.stackResultDimension,d);if(h>=0&&m>0||h<=0&&m<0){h+=m,f=m;break}}}return n[0]=h,n[1]=f,n});r.hostModel.setData(l),e.data=l})}function Ya(t,e){la.isInstance(t)||(t=la.seriesDataToSource(t)),this._source=t;var i=this._data=t.data,n=t.sourceFormat;n===WS&&(this._offset=0,this._dimSize=e,this._data=i),a(this,uM[n===BS?n+"_"+t.seriesLayoutBy:n])}function qa(){return this._data.length}function $a(t){return this._data[t]}function Ka(t){for(var e=0;ee.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function cr(t,e){d(t.CHANGABLE_METHODS,function(i){t.wrapMethod(i,v(dr,e))})}function dr(t){var e=fr(t);e&&e.setOutputEnd(this.count())}function fr(t){var e=(t.ecModel||{}).scheduler,i=e&&e.getPipeline(t.uid);if(i){var n=i.currentTask;if(n){var o=n.agentStubMap;o&&(n=o.get(t.uid))}return n}}function pr(){this.group=new L_,this.uid=Mo("viewChart"),this.renderTask=nr({plan:vr,reset:yr}),this.renderTask.context={view:this}}function gr(t,e){if(t&&(t.trigger(e),"group"===t.type))for(var i=0;i=0?n():c=setTimeout(n,-a),u=o};return d.clear=function(){c&&(clearTimeout(c),c=null)},d.debounceNextCall=function(t){l=t},d}function _r(t,e,i,n){var o=t[e];if(o){var a=o[MM]||o,r=o[DM];if(o[IM]!==i||r!==n){if(null==i||!n)return t[e]=a;(o=t[e]=xr(a,i,"debounce"===n))[MM]=a,o[DM]=n,o[IM]=i}return o}}function wr(t,e){var i=t[e];i&&i[MM]&&(t[e]=i[MM])}function br(t,e,i,n){this.ecInstance=t,this.api=e,this.unfinished,this._dataProcessorHandlers=i.slice(),this._visualHandlers=n.slice(),this._stageTaskMap=z()}function Sr(t,e,i,n,o){function a(t,e){return t.setDirty&&(!t.dirtyMap||t.dirtyMap.get(e.__pipeline.id))}o=o||{};var r;d(e,function(e,s){if(!o.visualType||o.visualType===e.visualType){var l=t._stageTaskMap.get(e.uid),u=l.seriesTaskMap,h=l.overallTask;if(h){var c,d=h.agentStubMap;d.each(function(t){a(o,t)&&(t.dirty(),c=!0)}),c&&h.dirty(),PM(h,n);var f=t.getPerformArgs(h,o.block);d.each(function(t){t.perform(f)}),r|=h.perform(f)}else u&&u.each(function(s,l){a(o,s)&&s.dirty();var u=t.getPerformArgs(s,o.block);u.skip=!e.performRawSeries&&i.isSeriesFiltered(s.context.model),PM(s,n),r|=s.perform(u)})}}),t.unfinished|=r}function Mr(t,e,i,n,o){function a(i){var a=i.uid,s=r.get(a)||r.set(a,nr({plan:Lr,reset:kr,count:Nr}));s.context={model:i,ecModel:n,api:o,useClearVisual:e.isVisual&&!e.isLayout,plan:e.plan,reset:e.reset,scheduler:t},Or(t,i,s)}var r=i.seriesTaskMap||(i.seriesTaskMap=z()),s=e.seriesType,l=e.getTargetSeries;e.createOnAllSeries?n.eachRawSeries(a):s?n.eachRawSeriesByType(s,a):l&&l(n,o).each(a);var u=t._pipelineMap;r.each(function(t,e){u.get(e)||(t.dispose(),r.removeKey(e))})}function Ir(t,e,i,n,o){function a(e){var i=e.uid,n=s.get(i)||s.set(i,nr({reset:Tr,onDirty:Cr}));n.context={model:e,overallProgress:h,isOverallFilter:c},n.agent=r,n.__block=h,Or(t,e,n)}var r=i.overallTask=i.overallTask||nr({reset:Dr});r.context={ecModel:n,api:o,overallReset:e.overallReset,scheduler:t};var s=r.agentStubMap=r.agentStubMap||z(),l=e.seriesType,u=e.getTargetSeries,h=!0,c=e.isOverallFilter;l?n.eachRawSeriesByType(l,a):u?u(n,o).each(a):(h=!1,d(n.getSeries(),a));var f=t._pipelineMap;s.each(function(t,e){f.get(e)||(t.dispose(),s.removeKey(e))})}function Dr(t){t.overallReset(t.ecModel,t.api,t.payload)}function Tr(t,e){return t.overallProgress&&Ar}function Ar(){this.agent.dirty(),this.getDownstream().dirty()}function Cr(){this.agent&&this.agent.dirty()}function Lr(t){return t.plan&&t.plan(t.model,t.ecModel,t.api,t.payload)}function kr(t){if(t.useClearVisual&&t.data.clearAllVisual(),(t.resetDefines=Si(t.reset(t.model,t.ecModel,t.api,t.payload))).length)return Pr}function Pr(t,e){for(var i=e.data,n=e.resetDefines,o=0;oe.get("hoverLayerThreshold")&&!Ax.node&&i.traverse(function(t){t.isGroup||(t.useHoverLayer=!0)})}function es(t,e){var i=t.get("blendMode")||null;e.group.traverse(function(t){t.isGroup||t.style.blend!==i&&t.setStyle("blend",i),t.eachPendingDisplayable&&t.eachPendingDisplayable(function(t){t.setStyle("blend",i)})})}function is(t,e){var i=t.get("z"),n=t.get("zlevel");e.group.traverse(function(t){"group"!==t.type&&(null!=i&&(t.z=i),null!=n&&(t.zlevel=n))})}function ns(t){var e=t._coordSysMgr;return a(new Aa(t),{getCoordinateSystems:m(e.getCoordinateSystems,e),getComponentByElement:function(e){for(;e;){var i=e.__ecComponentInfo;if(null!=i)return t._model.getComponent(i.mainType,i.index);e=e.parent}}})}function os(t){function e(t,e){for(var n=0;n65535?SI:MI}function As(t){var e=t.constructor;return e===Array?t.slice():new e(t)}function Cs(t,e){d(II.concat(e.__wrappedMethods||[]),function(i){e.hasOwnProperty(i)&&(t[i]=e[i])}),t.__wrappedMethods=e.__wrappedMethods}function Ls(t){var e=t._invertedIndicesMap;d(e,function(i,n){var o=t._dimensionInfos[n].ordinalMeta;if(o){i=e[n]=new SI(o.categories.length);for(a=0;a=0?this._indices[t]:-1}function Ns(t,e){var i=t._idList[e];return null==i&&(i=t._getIdFromStore(e)),null==i&&(i=wI+e),i}function Os(t){return y(t)||(t=[t]),t}function Es(t,e){var i=t.dimensions,n=new DI(f(i,t.getDimensionInfo,t),t.hostModel);Cs(n,t);for(var o=n._storage={},r=t._storage,s=a({},t._rawExtent),u=0;u=0?(o[h]=zs(r[h]),s[h]=Rs()):o[h]=r[h])}return n}function zs(t){for(var e=new Array(t.length),i=0;in&&(r=o.interval=n);var s=o.intervalPrecision=Ks(r);return Qs(o.niceTickExtent=[NI(Math.ceil(t[0]/r)*r,s),NI(Math.floor(t[1]/r)*r,s)],t),o}function Ks(t){return ko(t)+2}function Js(t,e,i){t[e]=Math.max(Math.min(t[e],i[1]),i[0])}function Qs(t,e){!isFinite(t[0])&&(t[0]=e[0]),!isFinite(t[1])&&(t[1]=e[1]),Js(t,0,e),Js(t,1,e),t[0]>t[1]&&(t[0]=t[1])}function tl(t,e,i,n){var o=[];if(!t)return o;e[0]1e4)return[];return e[1]>(o.length?o[o.length-1]:i[1])&&o.push(e[1]),o}function el(t){return t.get("stack")||zI+t.seriesIndex}function il(t){return t.dim+t.index}function nl(t,e){var i=[],n=t.axis;if("category"===n.type){for(var o=n.getBandWidth(),a=0;a=0?"p":"n",b=m;p&&(a[r][_]||(a[r][_]={p:m,n:m}),b=a[r][_][w]);var S,M,I,D;if(g)S=b,M=(T=i.dataToPoint([x,_]))[1]+l,I=T[0]-m,D=u,Math.abs(I)0&&s>0&&!l&&(r=0),r<0&&s<0&&!u&&(s=0));var c=e.ecModel;if(c&&"time"===a){var d,f=[];if(c.eachSeriesByType("bar",function(t){t.coordinateSystem&&"cartesian2d"===t.coordinateSystem.type&&(f.push(t),d|=t.getBaseAxis()===e.axis)}),d){var p=ul(r,s,e,f);r=p.min,s=p.max}}return[r,s]}function ul(t,e,i,n){var o=i.axis.getExtent(),a=o[1]-o[0],r=ol(n)[i.axis.dim+i.axis.index];if(void 0===r)return{min:t,max:e};var s=1/0;d(r,function(t){s=Math.min(t.offset,s)});var l=-1/0;d(r,function(t){l=Math.max(t.offset+t.width,l)}),s=Math.abs(s),l=Math.abs(l);var u=s+l,h=e-t,c=h/(1-(s+l)/a)-h;return e+=c*(l/u),t-=c*(s/u),{min:t,max:e}}function hl(t,e){var i=ll(t,e),n=null!=e.getMin(),o=null!=e.getMax(),a=e.get("splitNumber");"log"===t.type&&(t.base=e.get("logBase"));var r=t.type;t.setExtent(i[0],i[1]),t.niceExtent({splitNumber:a,fixMin:n,fixMax:o,minInterval:"interval"===r||"time"===r?e.get("minInterval"):null,maxInterval:"interval"===r||"time"===r?e.get("maxInterval"):null});var s=e.get("interval");null!=s&&t.setInterval&&t.setInterval(s)}function cl(t,e){if(e=e||t.get("type"))switch(e){case"category":return new PI(t.getOrdinalMeta?t.getOrdinalMeta():t.getCategories(),[1/0,-1/0]);case"value":return new EI;default:return(js.getClass(e)||EI).create(t)}}function dl(t,e,i,n,o){var a,r=0,s=0,l=(n-o)/180*Math.PI,u=1;e.length>40&&(u=Math.floor(e.length/40));for(var h=0;h1?u:(r+1)*u-1}function fl(t,e){var i=t.scale,n=i.getTicksLabels(),o=i.getTicks();return"string"==typeof e?(e=function(t){return function(e){return t.replace("{value}",null!=e?e:"")}}(e),f(n,e)):"function"==typeof e?f(o,function(i,n){return e(pl(t,i),n)},this):n}function pl(t,e){return"category"===t.type?t.scale.getLabel(e):e}function gl(t,e){if("image"!==this.type){var i=this.style,n=this.shape;n&&"line"===n.symbolType?i.stroke=t:this.__isEmptyBrush?(i.stroke=t,i.fill=e||"#fff"):(i.fill&&(i.fill=t),i.stroke&&(i.stroke=t)),this.dirty(!1)}}function ml(t,e,i,n,o,a,r){var s=0===t.indexOf("empty");s&&(t=t.substr(5,1).toLowerCase()+t.substr(6));var l;return l=0===t.indexOf("image://")?Rn(t.slice(8),new Kt(e,i,n,o),r?"center":"cover"):0===t.indexOf("path://")?zn(t.slice(7),{},new Kt(e,i,n,o),r?"center":"cover"):new aD({shape:{symbolType:t,x:e,y:i,width:n,height:o}}),l.__isEmptyBrush=s,l.setColor=gl,l.setColor(a),l}function vl(t,e){return Math.abs(t-e)>1^-(1&s),l=l>>1^-(1&l),o=s+=o,a=l+=a,n.push([s/i,l/i])}return n}function bl(t,e){var i=(t[1]-t[0])/e/2;t[0]+=i,t[1]-=i}function Sl(t,e){var i=t.mapDimension("defaultedLabel",!0),n=i.length;if(1===n)return er(t,e,i[0]);if(n){for(var o=[],a=0;a0?i=n[0]:n[1]<0&&(i=n[1]),i}function Ol(t,e,i,n){var o=NaN;t.stacked&&(o=i.get(i.getCalculationInfo("stackedOverDimension"),n)),isNaN(o)&&(o=t.valueStart);var a=t.baseDataOffset,r=[];return r[a]=i.get(t.baseDim,n),r[1-a]=o,e.dataToPoint(r)}function El(t,e){var i=[];return e.diff(t).add(function(t){i.push({cmd:"+",idx:t})}).update(function(t,e){i.push({cmd:"=",idx:e,idx1:t})}).remove(function(t){i.push({cmd:"-",idx:t})}).execute(),i}function zl(t){return isNaN(t[0])||isNaN(t[1])}function Rl(t,e,i,n,o,a,r,s,l,u,h){return null==u?Bl(e,"x")?Vl(t,e,i,n,o,a,r,s,l,"x",h):Bl(e,"y")?Vl(t,e,i,n,o,a,r,s,l,"y",h):Gl.apply(this,arguments):"none"!==u&&Bl(e,u)?Vl.apply(this,arguments):Gl.apply(this,arguments)}function Bl(t,e){if(t.length<=1)return!0;for(var i="x"===e?0:1,n=t[0][i],o=0,a=1;a=0!=o>=0)return!1;isNaN(r)||0===r||(o=r,n=t[a][i])}return!0}function Vl(t,e,i,n,o,a,r,s,l,u,h){for(var c=0,d=i,f=0;f=o||d<0)break;if(zl(p)){if(h){d+=a;continue}break}if(d===i)t[a>0?"moveTo":"lineTo"](p[0],p[1]);else if(l>0){var g=e[c],m="y"===u?1:0,v=(p[m]-g[m])*l;ID(TD,g),TD[m]=g[m]+v,ID(AD,p),AD[m]=p[m]-v,t.bezierCurveTo(TD[0],TD[1],AD[0],AD[1],p[0],p[1])}else t.lineTo(p[0],p[1]);c=d,d+=a}return f}function Gl(t,e,i,n,o,a,r,s,l,u,h){for(var c=0,d=i,f=0;f=o||d<0)break;if(zl(p)){if(h){d+=a;continue}break}if(d===i)t[a>0?"moveTo":"lineTo"](p[0],p[1]),ID(TD,p);else if(l>0){var g=d+a,m=e[g];if(h)for(;m&&zl(e[g]);)m=e[g+=a];var v=.5,y=e[c];if(!(m=e[g])||zl(m))ID(AD,p);else{zl(m)&&!h&&(m=p),U(DD,m,y);var x,_;if("x"===u||"y"===u){var w="x"===u?0:1;x=Math.abs(p[w]-y[w]),_=Math.abs(p[w]-m[w])}else x=jx(p,y),_=jx(p,m);MD(AD,p,DD,-l*(1-(v=_/(_+x))))}bD(TD,TD,s),SD(TD,TD,r),bD(AD,AD,s),SD(AD,AD,r),t.bezierCurveTo(TD[0],TD[1],AD[0],AD[1],p[0],p[1]),MD(TD,p,DD,l*v)}else t.lineTo(p[0],p[1]);c=d,d+=a}return f}function Fl(t,e){var i=[1/0,1/0],n=[-1/0,-1/0];if(e)for(var o=0;on[0]&&(n[0]=a[0]),a[1]>n[1]&&(n[1]=a[1])}return{min:e?i:n,max:e?n:i}}function Wl(t,e){if(t.length===e.length){for(var i=0;ie[0]?1:-1;e[0]+=n*i,e[1]-=n*i}return e}function Ul(t,e,i){if(!i.valueDim)return[];for(var n=[],o=0,a=e.count();o=0;a--){var r=i[a].dimension,s=t.dimensions[r],l=t.getDimensionInfo(s);if("x"===(n=l&&l.coordDim)||"y"===n){o=i[a];break}}if(o){var u=e.getAxis(n),h=f(o.stops,function(t){return{coord:u.toGlobalCoord(u.dataToCoord(t.value)),color:t.color}}),c=h.length,p=o.outerColors.slice();c&&h[0].coord>h[c-1].coord&&(h.reverse(),p.reverse());var g=h[0].coord-10,m=h[c-1].coord+10,v=m-g;if(v<.001)return"transparent";d(h,function(t){t.offset=(t.coord-g)/v}),h.push({offset:c?h[c-1].offset:.5,color:p[1]||"transparent"}),h.unshift({offset:c?h[0].offset:.5,color:p[0]||"transparent"});var y=new Qb(0,0,0,0,h,!0);return y[n]=g,y[n+"2"]=m,y}}}function Kl(t){return this._axes[t]}function Jl(t){ED.call(this,t)}function Ql(t,e){return e.type||(e.data?"category":"value")}function tu(t,e,i){return t.getCoordSysModel()===e}function eu(t,e){var i=e*Math.PI/180,n=t.plain(),o=n.width,a=n.height,r=o*Math.cos(i)+a*Math.sin(i),s=o*Math.sin(i)+a*Math.cos(i);return new Kt(n.x,n.y,r,s)}function iu(t){var e,i=t.model,n=i.get("axisLabel.show")?i.getFormattedLabels():[],o=i.getModel("axisLabel"),a=1,r=n.length;r>40&&(a=Math.ceil(r/40));for(var s=0;sn[1],l="start"===e&&!s||"start"!==e&&s;return Eo(r-YD/2)?(a=l?"bottom":"top",o="center"):Eo(r-1.5*YD)?(a=l?"top":"bottom",o="center"):(a="middle",o=r<1.5*YD&&r>YD/2?l?"left":"right":l?"right":"left"),{rotation:r,textAlign:o,textVerticalAlign:a}}function cu(t){var e=t.get("tooltip");return t.get("silent")||!(t.get("triggerEvent")||e&&e.show)}function du(t,e,i){var n=t.get("axisLabel.showMinLabel"),o=t.get("axisLabel.showMaxLabel");e=e||[],i=i||[];var a=e[0],r=e[1],s=e[e.length-1],l=e[e.length-2],u=i[0],h=i[1],c=i[i.length-1],d=i[i.length-2];!1===n?(fu(a),fu(u)):pu(a,r)&&(n?(fu(r),fu(h)):(fu(a),fu(u))),!1===o?(fu(s),fu(c)):pu(l,s)&&(o?(fu(l),fu(d)):(fu(s),fu(c)))}function fu(t){t&&(t.ignore=!0)}function pu(t,e,i){var n=t&&t.getBoundingRect().clone(),o=e&&e.getBoundingRect().clone();if(n&&o){var a=lt([]);return dt(a,a,-t.rotation),n.applyTransform(ht([],a,t.getLocalTransform())),o.applyTransform(ht([],a,e.getLocalTransform())),n.intersect(o)}}function gu(t){return"middle"===t||"center"===t}function mu(t,e,i){var n=e.axis;if(e.get("axisTick.show")&&!n.scale.isBlank()){for(var o=e.getModel("axisTick"),a=o.getModel("lineStyle"),s=o.get("length"),l=QD(o,i.labelInterval),u=n.getTicksCoords(o.get("alignWithLabel")),h=n.scale.getTicks(),c=e.get("axisLabel.showMinLabel"),d=e.get("axisLabel.showMaxLabel"),f=[],p=[],g=t._transform,m=[],v=u.length,y=0;y=0||t===e}function Mu(t){var e=Iu(t);if(e){var i=e.axisPointerModel,n=e.axis.scale,o=i.option,a=i.get("status"),r=i.get("value");null!=r&&(r=n.parse(r));var s=Tu(i);null==a&&(o.status=s?"show":"hide");var l=n.getExtent().slice();l[0]>l[1]&&l.reverse(),(null==r||r>l[1])&&(r=l[1]),r0?"bottom":"top":o.width>0?"left":"right";l||Pu(t.style,d,n,u,a,i,p),eo(t,d)}function Ru(t,e){var i=t.get(dT)||0;return Math.min(i,Math.abs(e.width),Math.abs(e.height))}function Bu(t,e,i,n){var o=e.getData(),a=this.dataIndex,r=o.getName(a),s=e.get("selectedOffset");n.dispatchAction({type:"pieToggleSelect",from:t,name:r,seriesId:e.id}),o.each(function(t){Vu(o.getItemGraphicEl(t),o.getItemLayout(t),e.isSelected(o.getName(t)),s,i)})}function Vu(t,e,i,n,o){var a=(e.startAngle+e.endAngle)/2,r=Math.cos(a),s=Math.sin(a),l=i?n:0,u=[r*l,s*l];o?t.animate().when(200,{position:u}).start("bounceOut"):t.attr("position",u)}function Gu(t,e){function i(){a.ignore=a.hoverIgnore,r.ignore=r.hoverIgnore}function n(){a.ignore=a.normalIgnore,r.ignore=r.normalIgnore}L_.call(this);var o=new Gb({z2:2}),a=new Ub,r=new zb;this.add(o),this.add(a),this.add(r),this.updateData(t,e,!0),this.on("emphasis",i).on("normal",n).on("mouseover",i).on("mouseout",n)}function Fu(t,e,i,n,o,a,r){function s(e,i){for(var n=e;n>=0&&(t[n].y-=i,!(n>0&&t[n].y>t[n-1].y+t[n-1].height));n--);}function l(t,e,i,n,o,a){for(var r=e?Number.MAX_VALUE:0,s=0,l=t.length;s=r&&(d=r-10),!e&&d<=r&&(d=r+10),t[s].x=i+d*a,r=d}}t.sort(function(t,e){return t.y-e.y});for(var u,h=0,c=t.length,d=[],f=[],p=0;pe&&a+1t[a].y+t[a].height)return void s(a,n/2);s(i-1,n/2)}(p,c,-u),h=t[p].y+t[p].height;r-h<0&&s(c-1,h-r);for(p=0;p=i?f.push(t[p]):d.push(t[p]);l(d,!1,e,i,n,o),l(f,!0,e,i,n,o)}function Wu(t,e,i,n,o,a){for(var r=[],s=[],l=0;l1?(p.width=l,p.height=l/d):(p.height=l,p.width=l*d),p.y=s[1]-p.height/2,p.x=s[0]-p.width/2}else(a=t.getBoxLayoutParams()).aspect=d,p=Qo(a,{width:u,height:h});this.setViewRect(p.x,p.y,p.width,p.height),this.setCenter(t.get("center")),this.setZoom(t.get("zoom"))}function th(t,e){d(e.get("geoCoord"),function(e,i){t.addGeoCoord(i,e)})}function eh(t,e,i){oh(t)[e]=i}function ih(t,e,i){var n=oh(t);n[e]===i&&(n[e]=null)}function nh(t,e){return!!oh(t)[e]}function oh(t){return t[FT]||(t[FT]={})}function ah(t){this.pointerChecker,this._zr=t,this._opt={};var e=m,n=e(rh,this),o=e(sh,this),a=e(lh,this),s=e(uh,this),l=e(hh,this);$x.call(this),this.setPointerChecker=function(t){this.pointerChecker=t},this.enable=function(e,u){this.disable(),this._opt=r(i(u)||{},{zoomOnMouseWheel:!0,moveOnMouseMove:!0,preventDefaultMouseMove:!0}),null==e&&(e=!0),!0!==e&&"move"!==e&&"pan"!==e||(t.on("mousedown",n),t.on("mousemove",o),t.on("mouseup",a)),!0!==e&&"scale"!==e&&"zoom"!==e||(t.on("mousewheel",s),t.on("pinch",l))},this.disable=function(){t.off("mousedown",n),t.off("mousemove",o),t.off("mouseup",a),t.off("mousewheel",s),t.off("pinch",l)},this.dispose=this.disable,this.isDragging=function(){return this._dragging},this.isPinching=function(){return this._pinching}}function rh(t){if(!(ci(t)||t.target&&t.target.draggable)){var e=t.offsetX,i=t.offsetY;this.pointerChecker&&this.pointerChecker(t,e,i)&&(this._x=e,this._y=i,this._dragging=!0)}}function sh(t){if(!ci(t)&&dh(this,"moveOnMouseMove",t)&&this._dragging&&"pinch"!==t.gestureEvent&&!nh(this._zr,"globalPan")){var e=t.offsetX,i=t.offsetY,n=this._x,o=this._y,a=e-n,r=i-o;this._x=e,this._y=i,this._opt.preventDefaultMouseMove&&rw(t.event),this.trigger("pan",a,r,n,o,e,i)}}function lh(t){ci(t)||(this._dragging=!1)}function uh(t){if(dh(this,"zoomOnMouseWheel",t)&&0!==t.wheelDelta){var e=t.wheelDelta>0?1.1:1/1.1;ch.call(this,t,e,t.offsetX,t.offsetY)}}function hh(t){if(!nh(this._zr,"globalPan")){var e=t.pinchScale>1?1.1:1/1.1;ch.call(this,t,e,t.pinchX,t.pinchY)}}function ch(t,e,i,n){this.pointerChecker&&this.pointerChecker(t,i,n)&&(rw(t.event),this.trigger("zoom",e,i,n))}function dh(t,e,i){var n=t._opt[e];return n&&(!_(n)||i.event[n+"Key"])}function fh(t,e,i){var n=t.target,o=n.position;o[0]+=e,o[1]+=i,n.dirty()}function ph(t,e,i,n){var o=t.target,a=t.zoomLimit,r=o.position,s=o.scale,l=t.zoom=t.zoom||1;if(l*=e,a){var u=a.min||0,h=a.max||1/0;l=Math.max(Math.min(h,l),u)}var c=l/t.zoom;t.zoom=l,r[0]-=(i-r[0])*(c-1),r[1]-=(n-r[1])*(c-1),s[0]*=c,s[1]*=c,o.dirty()}function gh(t,e,i){var n=e.getComponentByElement(t.topTarget),o=n&&n.coordinateSystem;return n&&n!==i&&!WT[n.mainType]&&o&&o.model!==i}function mh(t,e){var i=t.getItemStyle(),n=t.get("areaColor");return null!=n&&(i.fill=n),i}function vh(t,e,i,n,o){i.off("click"),i.off("mousedown"),e.get("selectedMode")&&(i.on("mousedown",function(){t._mouseDownFlag=!0}),i.on("click",function(a){if(t._mouseDownFlag){t._mouseDownFlag=!1;for(var r=a.target;!r.__regions;)r=r.parent;if(r){var s={type:("geo"===e.mainType?"geo":"map")+"ToggleSelect",batch:f(r.__regions,function(t){return{name:t.name,from:o.uid}})};s[e.mainType+"Id"]=e.id,n.dispatchAction(s),yh(e,i)}}}))}function yh(t,e){e.eachChild(function(e){d(e.__regions,function(i){e.trigger(t.isSelected(i.name)?"emphasis":"normal")})})}function xh(t,e){var i=new L_;this._controller=new ah(t.getZr()),this._controllerHost={target:e?i:null},this.group=i,this._updateGroup=e,this._mouseDownFlag}function _h(t,e,i){var n=t.getZoom(),o=t.getCenter(),a=e.zoom,r=t.dataToPoint(o);if(null!=e.dx&&null!=e.dy){r[0]-=e.dx,r[1]-=e.dy;o=t.pointToData(r);t.setCenter(o)}if(null!=a){if(i){var s=i.min||0,l=i.max||1/0;a=Math.max(Math.min(n*a,l),s)/n}t.scale[0]*=a,t.scale[1]*=a;var u=t.position,h=(e.originX-u[0])*(a-1),c=(e.originY-u[1])*(a-1);u[0]-=h,u[1]-=c,t.updateTransform();o=t.pointToData(r);t.setCenter(o),t.setZoom(a*n)}return{center:t.getCenter(),zoom:t.getZoom()}}function wh(t,e){var i={};return d(t,function(t){t.each(t.mapDimension("value"),function(e,n){var o="ec-"+t.getName(n);i[o]=i[o]||[],isNaN(e)||i[o].push(e)})}),t[0].map(t[0].mapDimension("value"),function(n,o){for(var a="ec-"+t[0].getName(o),r=0,s=1/0,l=-1/0,u=i[a].length,h=0;h=0;o--){var a=i[o];a.hierNode={defaultAncestor:null,ancestor:a,prelim:0,modifier:0,change:0,shift:0,i:o,thread:null},n.push(a)}}function Nh(t,e){var i=t.isExpand?t.children:[],n=t.parentNode.children,o=t.hierNode.i?n[t.hierNode.i-1]:null;if(i.length){Bh(t);var a=(i[0].hierNode.prelim+i[i.length-1].hierNode.prelim)/2;o?(t.hierNode.prelim=o.hierNode.prelim+e(t,o),t.hierNode.modifier=t.hierNode.prelim-a):t.hierNode.prelim=a}else o&&(t.hierNode.prelim=o.hierNode.prelim+e(t,o));t.parentNode.hierNode.defaultAncestor=Vh(t,o,t.parentNode.hierNode.defaultAncestor||n[0],e)}function Oh(t){var e=t.hierNode.prelim+t.parentNode.hierNode.modifier;t.setLayout({x:e},!0),t.hierNode.modifier+=t.parentNode.hierNode.modifier}function Eh(t){return arguments.length?t:Zh}function zh(t,e){var i={};return t-=Math.PI/2,i.x=e*Math.cos(t),i.y=e*Math.sin(t),i}function Rh(t,e){return Qo(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function Bh(t){for(var e=t.children,i=e.length,n=0,o=0;--i>=0;){var a=e[i];a.hierNode.prelim+=n,a.hierNode.modifier+=n,o+=a.hierNode.change,n+=a.hierNode.shift+o}}function Vh(t,e,i,n){if(e){for(var o=t,a=t,r=a.parentNode.children[0],s=e,l=o.hierNode.modifier,u=a.hierNode.modifier,h=r.hierNode.modifier,c=s.hierNode.modifier;s=Gh(s),a=Fh(a),s&&a;){o=Gh(o),r=Fh(r),o.hierNode.ancestor=t;var d=s.hierNode.prelim+c-a.hierNode.prelim-u+n(s,a);d>0&&(Hh(Wh(s,t,i),t,d),u+=d,l+=d),c+=s.hierNode.modifier,u+=a.hierNode.modifier,l+=o.hierNode.modifier,h+=r.hierNode.modifier}s&&!Gh(o)&&(o.hierNode.thread=s,o.hierNode.modifier+=c-l),a&&!Fh(r)&&(r.hierNode.thread=a,r.hierNode.modifier+=u-h,i=t)}return i}function Gh(t){var e=t.children;return e.length&&t.isExpand?e[e.length-1]:t.hierNode.thread}function Fh(t){var e=t.children;return e.length&&t.isExpand?e[0]:t.hierNode.thread}function Wh(t,e,i){return t.hierNode.ancestor.parentNode===e.parentNode?t.hierNode.ancestor:i}function Hh(t,e,i){var n=i/(e.hierNode.i-t.hierNode.i);e.hierNode.change-=n,e.hierNode.shift+=i,e.hierNode.modifier+=i,e.hierNode.prelim+=i,t.hierNode.change+=n}function Zh(t,e){return t.parentNode===e.parentNode?1:2}function Uh(t,e){var i=t.getItemLayout(e);return i&&!isNaN(i.x)&&!isNaN(i.y)&&"none"!==t.getItemVisual(e,"symbol")}function jh(t,e,i){return i.itemModel=e,i.itemStyle=e.getModel("itemStyle").getItemStyle(),i.hoverItemStyle=e.getModel("emphasis.itemStyle").getItemStyle(),i.lineStyle=e.getModel("lineStyle").getLineStyle(),i.labelModel=e.getModel("label"),i.hoverLabelModel=e.getModel("emphasis.label"),!1===t.isExpand&&0!==t.children.length?i.symbolInnerColor=i.itemStyle.fill:i.symbolInnerColor="#fff",i}function Xh(t,e,i,n,o,a){var s=!i,l=t.tree.getNodeByDataIndex(e),a=jh(l,l.getModel(),a),u=t.tree.root,h=l.parentNode===u?l:l.parentNode||l,c=t.getItemGraphicEl(h.dataIndex),d=h.getLayout(),f=c?{x:c.position[0],y:c.position[1],rawX:c.__radialOldRawX,rawY:c.__radialOldRawY}:d,p=l.getLayout();s?(i=new Dl(t,e,a)).attr("position",[f.x,f.y]):i.updateData(t,e,a),i.__radialOldRawX=i.__radialRawX,i.__radialOldRawY=i.__radialRawY,i.__radialRawX=p.rawX,i.__radialRawY=p.rawY,n.add(i),t.setItemGraphicEl(e,i),fo(i,{position:[p.x,p.y]},o);var g=i.getSymbolPath();if("radial"===a.layout){var m,v,y=u.children[0],x=y.getLayout(),_=y.children.length;if(p.x===x.x&&!0===l.isExpand){var w={};w.x=(y.children[0].getLayout().x+y.children[_-1].getLayout().x)/2,w.y=(y.children[0].getLayout().y+y.children[_-1].getLayout().y)/2,(m=Math.atan2(w.y-x.y,w.x-x.x))<0&&(m=2*Math.PI+m),(v=w.xx.x)||(m-=Math.PI);var b=v?"left":"right";g.setStyle({textPosition:b,textRotation:-m,textOrigin:"center",verticalAlign:"middle"})}if(l.parentNode&&l.parentNode!==u){var S=i.__edge;S||(S=i.__edge=new qb({shape:qh(a,f,f),style:r({opacity:0},a.lineStyle)})),fo(S,{shape:qh(a,d,p),style:{opacity:1}},o),n.add(S)}}function Yh(t,e,i,n,o,a){for(var r,s=t.tree.getNodeByDataIndex(e),l=t.tree.root,a=jh(s,s.getModel(),a),u=s.parentNode===l?s:s.parentNode||s;null==(r=u.getLayout());)u=u.parentNode===l?u:u.parentNode||u;fo(i,{position:[r.x+1,r.y+1]},o,function(){n.remove(i),t.setItemGraphicEl(e,null)}),i.fadeOut(null,{keepLabel:!0});var h=i.__edge;h&&fo(h,{shape:qh(a,r,r),style:{opacity:0}},o,function(){n.remove(h)})}function qh(t,e,i){var n,o,a,r,s=t.orient;if("radial"===t.layout){var l=e.rawX,u=e.rawY,h=i.rawX,c=i.rawY,d=zh(l,u),f=zh(l,u+(c-u)*t.curvature),p=zh(h,c+(u-c)*t.curvature),g=zh(h,c);return{x1:d.x,y1:d.y,x2:g.x,y2:g.y,cpx1:f.x,cpy1:f.y,cpx2:p.x,cpy2:p.y}}var l=e.x,u=e.y,h=i.x,c=i.y;return"horizontal"===s&&(n=l+(h-l)*t.curvature,o=u,a=h+(l-h)*t.curvature,r=c),"vertical"===s&&(n=l,o=u+(c-u)*t.curvature,a=h,r=c+(u-c)*t.curvature),{x1:l,y1:u,x2:h,y2:c,cpx1:n,cpy1:o,cpx2:a,cpy2:r}}function $h(t,e,i){for(var n,o=[t],a=[];n=o.pop();)if(a.push(n),n.isExpand){var r=n.children;if(r.length)for(var s=0;s=0;a--)n.push(o[a])}}function Jh(t,e,i){if(t&&l(e,t.type)>=0){var n=i.getData().tree.root,o=t.targetNode;if(o&&n.contains(o))return{node:o};var a=t.targetNodeId;if(null!=a&&(o=n.getNodeById(a)))return{node:o}}}function Qh(t){for(var e=[];t;)(t=t.parentNode)&&e.push(t);return e.reverse()}function tc(t,e){return l(Qh(t),e)>=0}function ec(t,e){for(var i=[];t;){var n=t.dataIndex;i.push({name:t.name,dataIndex:n,value:e.getRawValue(n)}),t=t.parentNode}return i.reverse(),i}function ic(t){var e=0;d(t.children,function(t){ic(t);var i=t.value;y(i)&&(i=i[0]),e+=i});var i=t.value;y(i)&&(i=i[0]),(null==i||isNaN(i))&&(i=e),i<0&&(i=0),y(t.value)?t.value[0]=i:t.value=i}function nc(t,e){var i=e.get("color");if(i){var n;return d(t=t||[],function(t){var e=new wo(t),i=e.get("color");(e.get("itemStyle.color")||i&&"none"!==i)&&(n=!0)}),n||((t[0]||(t[0]={})).color=i.slice()),t}}function oc(t){this.group=new L_,t.add(this.group)}function ac(t,e,i,n,o,a){var r=[[o?t:t-YT,e],[t+i,e],[t+i,e+n],[o?t:t-YT,e+n]];return!a&&r.splice(2,0,[t+i+YT,e+n/2]),!o&&r.push([t,e+n/2]),r}function rc(t,e,i){t.eventData={componentType:"series",componentSubType:"treemap",seriesIndex:e.componentIndex,seriesName:e.name,seriesType:"treemap",selfType:"breadcrumb",nodeData:{dataIndex:i&&i.dataIndex,name:i&&i.name},treePathInfo:i&&ec(i,e)}}function sc(){var t,e=[],i={};return{add:function(t,n,o,a,r){return _(a)&&(r=a,a=0),!i[t.id]&&(i[t.id]=1,e.push({el:t,target:n,time:o,delay:a,easing:r}),!0)},done:function(e){return t=e,this},start:function(){for(var n=e.length,o=0,a=e.length;o=0;a--)null==i[a]&&(delete n[e[a]],e.pop())}function dc(t,e){var i=t.visual,n=[];w(i)?hA(i,function(t){n.push(t)}):null!=i&&n.push(i);var o={color:1,symbol:1};e||1!==n.length||o.hasOwnProperty(t.type)||(n[1]=n[0]),_c(t,n)}function fc(t){return{applyVisual:function(e,i,n){e=this.mapValueToVisual(e),n("color",t(i("color"),e))},_doMap:yc([0,1])}}function pc(t){var e=this.option.visual;return e[Math.round(Do(t,[0,1],[0,e.length-1],!0))]||{}}function gc(t){return function(e,i,n){n(t,this.mapValueToVisual(e))}}function mc(t){var e=this.option.visual;return e[this.option.loop&&t!==dA?t%e.length:t]}function vc(){return this.option.visual[0]}function yc(t){return{linear:function(e){return Do(e,t,this.option.visual,!0)},category:mc,piecewise:function(e,i){var n=xc.call(this,i);return null==n&&(n=Do(e,t,this.option.visual,!0)),n},fixed:vc}}function xc(t){var e=this.option,i=e.pieceList;if(e.hasSpecialVisual){var n=i[fA.findPieceIndex(t,i)];if(n&&n.visual)return n.visual[this.type]}}function _c(t,e){return t.visual=e,"color"===t.type&&(t.parsedVisual=f(e,function(t){return At(t)})),e}function wc(t,e,i){return t?e<=i:e=o.length||t===o[t.depth])&&bc(t,Cc(r,h,t,e,g,a),i,n,o,a)})}else l=Mc(h),t.setVisual("color",l)}}function Sc(t,e,i,n){var o=a({},e);return d(["color","colorAlpha","colorSaturation"],function(a){var r=t.get(a,!0);null==r&&i&&(r=i[a]),null==r&&(r=e[a]),null==r&&(r=n.get(a)),null!=r&&(o[a]=r)}),o}function Mc(t){var e=Dc(t,"color");if(e){var i=Dc(t,"colorAlpha"),n=Dc(t,"colorSaturation");return n&&(e=Et(e,null,null,n)),i&&(e=zt(e,i)),e}}function Ic(t,e){return null!=e?Et(e,null,null,t):null}function Dc(t,e){var i=t[e];if(null!=i&&"none"!==i)return i}function Tc(t,e,i,n,o,a){if(a&&a.length){var r=Ac(e,"color")||null!=o.color&&"none"!==o.color&&(Ac(e,"colorAlpha")||Ac(e,"colorSaturation"));if(r){var s=e.get("visualMin"),l=e.get("visualMax"),u=i.dataExtent.slice();null!=s&&su[1]&&(u[1]=l);var h=e.get("colorMappingBy"),c={type:r.name,dataExtent:u,visual:r.range};"color"!==c.type||"index"!==h&&"id"!==h?c.mappingMethod="linear":(c.mappingMethod="category",c.loop=!0);var d=new fA(c);return d.__drColorMappingBy=h,d}}}function Ac(t,e){var i=t.get(e);return mA(i)&&i.length?{name:e,range:i}:null}function Cc(t,e,i,n,o,r){var s=a({},e);if(o){var l=o.type,u="color"===l&&o.__drColorMappingBy,h="index"===u?n:"id"===u?r.mapIdToIndex(i.getId()):i.getValue(t.get("visualDimension"));s[l]=o.mapValueToVisual(h)}return s}function Lc(t,e,i,n){var o,a;if(!t.isRemoved()){var r=t.getLayout();o=r.width,a=r.height;var s=(f=t.getModel()).get(SA),l=f.get(MA)/2,u=Gc(f),h=Math.max(s,u),c=s-l,d=h-l,f=t.getModel();t.setLayout({borderWidth:s,upperHeight:h,upperLabelHeight:u},!0);var p=(o=xA(o-2*c,0))*(a=xA(a-c-d,0)),g=kc(t,f,p,e,i,n);if(g.length){var m={x:c,y:d,width:o,height:a},v=_A(o,a),y=1/0,x=[];x.area=0;for(var _=0,w=g.length;_=0;l--){var u=o["asc"===n?r-l-1:l].getValue();u/i*es[1]&&(s[1]=e)})}else s=[NaN,NaN];return{sum:n,dataExtent:s}}function Ec(t,e,i){for(var n,o=0,a=1/0,r=0,s=t.length;ro&&(o=n));var l=t.area*t.area,u=e*e*i;return l?xA(u*o/l,l/(u*a)):1/0}function zc(t,e,i,n,o){var a=e===i.width?0:1,r=1-a,s=["x","y"],l=["width","height"],u=i[s[a]],h=e?t.area/e:0;(o||h>i[l[r]])&&(h=i[l[r]]);for(var c=0,d=t.length;cmS&&(u=mS),a=s}u=0?n+=u:n-=u:p>=0?n-=u:n+=u}return n}function nd(t,e){return t.getVisual("opacity")||t.getModel().get(e)}function od(t,e,i){var n=t.getGraphicEl(),o=nd(t,e);null!=i&&(null==o&&(o=1),o*=i),n.downplay&&n.downplay(),n.traverse(function(t){"group"!==t.type&&t.setStyle("opacity",o)})}function ad(t,e){var i=nd(t,e),n=t.getGraphicEl();n.highlight&&n.highlight(),n.traverse(function(t){"group"!==t.type&&t.setStyle("opacity",i)})}function rd(t){return t instanceof Array||(t=[t,t]),t}function sd(t){var e=t.coordinateSystem;if(!e||"view"===e.type){var i=t.getGraph();i.eachNode(function(t){var e=t.getModel();t.setLayout([+e.get("x"),+e.get("y")])}),ld(i)}}function ld(t){t.eachEdge(function(t){var e=t.getModel().get("lineStyle.curveness")||0,i=F(t.node1.getLayout()),n=F(t.node2.getLayout()),o=[i,n];+e&&o.push([(i[0]+n[0])/2-(i[1]-n[1])*e,(i[1]+n[1])/2-(n[0]-i[0])*e]),t.setLayout(o)})}function ud(t){var e=t.coordinateSystem;if(!e||"view"===e.type){var i=e.getBoundingRect(),n=t.getData(),o=n.graph,a=0,r=n.getSum("value"),s=2*Math.PI/(r||n.count()),l=i.width/2+i.x,u=i.height/2+i.y,h=Math.min(i.width,i.height)/2;o.eachNode(function(t){var e=t.getValue("value");a+=s*(r?e:1)/2,t.setLayout([h*Math.cos(a)+l,h*Math.sin(a)+u]),a+=s*(r?e:1)/2}),n.setLayout({cx:l,cy:u}),o.eachEdge(function(t){var e,i=t.getModel().get("lineStyle.curveness")||0,n=F(t.node1.getLayout()),o=F(t.node2.getLayout()),a=(n[0]+o[0])/2,r=(n[1]+o[1])/2;+i&&(e=[l*(i*=3)+a*(1-i),u*i+r*(1-i)]),t.setLayout([n,o,e])})}}function hd(t,e,i){for(var n=i.rect,o=n.width,a=n.height,r=[n.x+o/2,n.y+a/2],s=null==i.gravity?.1:i.gravity,l=0;l0?-1:i<0?1:e?-1:1}}function wd(t,e){return Math.min(e[1],Math.max(e[0],t))}function bd(t,e,i){this._axesMap=z(),this._axesLayout={},this.dimensions=t.dimensions,this._rect,this._model=t,this._init(t,e,i)}function Sd(t,e){return nC(oC(t,e[0]),e[1])}function Md(t,e){var i=e.layoutLength/(e.axisCount-1);return{position:i*t,axisNameAvailableWidth:i,axisLabelShow:!0}}function Id(t,e){var i,n,o=e.layoutLength,a=e.axisExpandWidth,r=e.axisCount,s=e.axisCollapseWidth,l=e.winInnerIndices,u=s,h=!1;return tyC}function Gd(t){var e=t.length-1;return e<0&&(e=0),[t[0],t[e]]}function Fd(t,e,i,n){var o=new L_;return o.add(new jb({name:"main",style:Ud(i),silent:!0,draggable:!0,cursor:"move",drift:cC(t,e,o,"nswe"),ondragend:cC(Bd,e,{isEnd:!0})})),dC(n,function(i){o.add(new jb({name:i,style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:cC(t,e,o,i),ondragend:cC(Bd,e,{isEnd:!0})}))}),o}function Wd(t,e,i,n){var o=n.brushStyle.lineWidth||0,a=gC(o,xC),r=i[0][0],s=i[1][0],l=r-o/2,u=s-o/2,h=i[0][1],c=i[1][1],d=h-a+o/2,f=c-a+o/2,p=h-r,g=c-s,m=p+o,v=g+o;Zd(t,e,"main",r,s,p,g),n.transformable&&(Zd(t,e,"w",l,u,a,v),Zd(t,e,"e",d,u,a,v),Zd(t,e,"n",l,u,m,a),Zd(t,e,"s",l,f,m,a),Zd(t,e,"nw",l,u,a,a),Zd(t,e,"ne",d,u,a,a),Zd(t,e,"sw",l,f,a,a),Zd(t,e,"se",d,f,a,a))}function Hd(t,e){var i=e.__brushOption,n=i.transformable,o=e.childAt(0);o.useStyle(Ud(i)),o.attr({silent:!n,cursor:n?"move":"default"}),dC(["w","e","n","s","se","sw","ne","nw"],function(i){var o=e.childOfName(i),a=Yd(t,i);o&&o.attr({silent:!n,invisible:!n,cursor:n?bC[a]+"-resize":null})})}function Zd(t,e,i,n,o,a,r){var s=e.childOfName(i);s&&s.setShape(Qd(Jd(t,e,[[n,o],[n+a,o+r]])))}function Ud(t){return r({strokeNoScale:!0},t.brushStyle)}function jd(t,e,i,n){var o=[pC(t,i),pC(e,n)],a=[gC(t,i),gC(e,n)];return[[o[0],a[0]],[o[1],a[1]]]}function Xd(t){return go(t.group)}function Yd(t,e){if(e.length>1)return("e"===(n=[Yd(t,(e=e.split(""))[0]),Yd(t,e[1])])[0]||"w"===n[0])&&n.reverse(),n.join("");var i={left:"w",right:"e",top:"n",bottom:"s"},n=vo({w:"left",e:"right",n:"top",s:"bottom"}[e],Xd(t));return i[n]}function qd(t,e,i,n,o,a,r,s){var l=n.__brushOption,u=t(l.range),h=Kd(i,a,r);dC(o.split(""),function(t){var e=wC[t];u[e[0]][e[1]]+=h[e[0]]}),l.range=e(jd(u[0][0],u[1][0],u[0][1],u[1][1])),Nd(i,n),Bd(i,{isEnd:!1})}function $d(t,e,i,n,o){var a=e.__brushOption.range,r=Kd(t,i,n);dC(a,function(t){t[0]+=r[0],t[1]+=r[1]}),Nd(t,e),Bd(t,{isEnd:!1})}function Kd(t,e,i){var n=t.group,o=n.transformCoordToLocal(e,i),a=n.transformCoordToLocal(0,0);return[o[0]-a[0],o[1]-a[1]]}function Jd(t,e,n){var o=zd(t,e);return o&&!0!==o?o.clipPath(n,t._transform):i(n)}function Qd(t){var e=pC(t[0][0],t[1][0]),i=pC(t[0][1],t[1][1]);return{x:e,y:i,width:gC(t[0][0],t[1][0])-e,height:gC(t[0][1],t[1][1])-i}}function tf(t,e,i){if(t._brushType){var n=t._zr,o=t._covers,a=Ed(t,e,i);if(!t._dragging)for(var r=0;r=i.length)return e;for(var o=-1,a=e.length,r=i[n++],s={},l={};++o=i.length)return t;var a=[],r=n[o++];return d(t,function(t,i){a.push({key:i,values:e(t,o)})}),r?a.sort(function(t,e){return r(t.key,e.key)}):a}var i=[],n=[];return{key:function(t){return i.push(t),this},sortKeys:function(t){return n[i.length-1]=t,this},entries:function(i){return e(t(i,0),0)}}}function If(t,e){return Qo(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function Df(t,e,i,n,o,a,r){Af(t,i,o),kf(t,e,a,n,r),Bf(t)}function Tf(t){d(t,function(t){var e=Ff(t.outEdges,Uf),i=Ff(t.inEdges,Uf),n=Math.max(e,i);t.setLayout({value:n},!0)})}function Af(t,e,i){for(var n=t,o=null,a=0;n.length;){o=[];for(var r=0,s=n.length;r0;o--)Of(a,r*=.99),Nf(a,n,i),zf(a,r),Nf(a,n,i)}function Pf(t,e,i,n,o){var a=[];d(e,function(t){var e=t.length,i=0;d(t,function(t){i+=t.getLayout().value});var r=(n-(e-1)*o)/i;a.push(r)}),a.sort(function(t,e){return t-e});var r=a[0];d(e,function(t){d(t,function(t,e){t.setLayout({y:e},!0);var i=t.getLayout().value*r;t.setLayout({dy:i},!0)})}),d(i,function(t){var e=+t.getValue()*r;t.setLayout({dy:e},!0)})}function Nf(t,e,i){d(t,function(t){var n,o,a,r=0,s=t.length;for(t.sort(Hf),a=0;a0){l=n.getLayout().y+o;n.setLayout({y:l},!0)}r=n.getLayout().y+n.getLayout().dy+e}if((o=r-e-i)>0){var l=n.getLayout().y-o;for(n.setLayout({y:l},!0),r=n.getLayout().y,a=s-2;a>=0;--a)(o=(n=t[a]).getLayout().y+n.getLayout().dy+e-r)>0&&(l=n.getLayout().y-o,n.setLayout({y:l},!0)),r=n.getLayout().y}})}function Of(t,e){d(t.slice().reverse(),function(t){d(t,function(t){if(t.outEdges.length){var i=Ff(t.outEdges,Ef)/Ff(t.outEdges,Uf),n=t.getLayout().y+(i-Wf(t))*e;t.setLayout({y:n},!0)}})})}function Ef(t){return Wf(t.node2)*t.getValue()}function zf(t,e){d(t,function(t){d(t,function(t){if(t.inEdges.length){var i=Ff(t.inEdges,Rf)/Ff(t.inEdges,Uf),n=t.getLayout().y+(i-Wf(t))*e;t.setLayout({y:n},!0)}})})}function Rf(t){return Wf(t.node1)*t.getValue()}function Bf(t){d(t,function(t){t.outEdges.sort(Vf),t.inEdges.sort(Gf)}),d(t,function(t){var e=0,i=0;d(t.outEdges,function(t){t.setLayout({sy:e},!0),e+=t.getLayout().dy}),d(t.inEdges,function(t){t.setLayout({ty:i},!0),i+=t.getLayout().dy})})}function Vf(t,e){return t.node2.getLayout().y-e.node2.getLayout().y}function Gf(t,e){return t.node1.getLayout().y-e.node1.getLayout().y}function Ff(t,e){for(var i=0,n=t.length,o=-1;++oe?1:t===e?0:NaN}function Uf(t){return t.getValue()}function jf(t,e,i,n){L_.call(this),this.bodyIndex,this.whiskerIndex,this.styleUpdater=i,this._createContent(t,e,n),this.updateData(t,e,n),this._seriesModel}function Xf(t,e,i){return f(t,function(t){return t=t.slice(),t[e]=i.initBaseline,t})}function Yf(t){var e={};return d(t,function(t,i){e["ends"+i]=t}),e}function qf(t){this.group=new L_,this.styleUpdater=t}function $f(t,e,i){var n=e.getItemModel(i),o=n.getModel(BC),a=e.getItemVisual(i,"color"),r=o.getItemStyle(["borderColor"]),s=t.childAt(t.whiskerIndex);s.style.set(r),s.style.stroke=a,s.dirty();var l=t.childAt(t.bodyIndex);l.style.set(r),l.style.stroke=a,l.dirty(),eo(t,n.getModel(VC).getItemStyle())}function Kf(t){var e=[],i=[];return t.eachSeriesByType("boxplot",function(t){var n=t.getBaseAxis(),o=l(i,n);o<0&&(o=i.length,i[o]=n,e[o]={axis:n,seriesModels:[]}),e[o].seriesModels.push(t)}),e}function Jf(t){var e,i,n=t.axis,o=t.seriesModels,a=o.length,r=t.boxWidthList=[],s=t.boxOffsetList=[],l=[];if("category"===n.type)i=n.getBandWidth();else{var u=0;FC(o,function(t){u=Math.max(u,t.getData().count())}),e=n.getExtent(),Math.abs(e[1]-e[0])}FC(o,function(t){var e=t.get("boxWidth");y(e)||(e=[e,e]),l.push([To(e[0],i)||0,To(e[1],i)||0])});var h=.8*i-2,c=h/a*.3,d=(h-c*(a-1))/a,f=d/2-h/2;FC(o,function(t,e){s.push(f),f+=c+d,r.push(Math.min(Math.max(d,l[e][0]),l[e][1]))})}function Qf(t,e,i){var n,o=t.coordinateSystem,a=t.getData(),r=i/2,s=t.get("layout"),l="horizontal"===s?0:1,u=1-l,h=["x","y"],c=[];d(a.dimensions,function(t){var e=a.getDimensionInfo(t).coordDim;e===h[u]?c.push(t):e===h[l]&&(n=t)}),null==n||c.length<5||a.each([n].concat(c),function(){function t(t){var i=[];i[l]=d,i[u]=t;var n;return isNaN(d)||isNaN(t)?n=[NaN,NaN]:(n=o.dataToPoint(i))[l]+=e,n}function i(t,e){var i=t.slice(),n=t.slice();i[l]+=r,n[l]-=r,e?y.push(i,n):y.push(n,i)}function n(t){var e=[t.slice(),t.slice()];e[0][l]-=r,e[1][l]+=r,v.push(e)}var h=arguments,d=h[0],f=h[c.length+1],p=t(h[3]),g=t(h[1]),m=t(h[5]),v=[[g,t(h[2])],[m,t(h[4])]];n(g),n(m),n(p);var y=[];i(v[0][1],0),i(v[1][1],1),a.setItemLayout(f,{chartLayout:s,initBaseline:p[u],median:p,bodyEnds:y,whiskerEnds:v})})}function tp(t,e,i){var n=e.getItemModel(i),o=n.getModel(WC),a=e.getItemVisual(i,"color"),r=e.getItemVisual(i,"borderColor")||a,s=o.getItemStyle(["color","color0","borderColor","borderColor0"]),l=t.childAt(t.whiskerIndex);l.useStyle(s),l.style.stroke=r;var u=t.childAt(t.bodyIndex);u.useStyle(s),u.style.fill=a,u.style.stroke=r,eo(t,n.getModel(HC).getItemStyle())}function ep(t,e){var i,n=t.getBaseAxis(),o="category"===n.type?n.getBandWidth():(i=n.getExtent(),Math.abs(i[1]-i[0])/e.count()),a=To(YC(t.get("barMaxWidth"),o),o),r=To(YC(t.get("barMinWidth"),1),o),s=t.get("barWidth");return null!=s?To(s,o):Math.max(Math.min(o/2,a),r)}function ip(t){return y(t)||(t=[+t,+t]),t}function np(t,e){t.eachChild(function(t){t.attr({z:e.z,zlevel:e.zlevel,style:{stroke:"stroke"===e.brushType?e.color:null,fill:"fill"===e.brushType?e.color:null}})})}function op(t,e){L_.call(this);var i=new Dl(t,e),n=new L_;this.add(i),this.add(n),n.beforeUpdate=function(){this.attr(i.getScale())},this.updateData(t,e)}function ap(t){var e=t.data;e&&e[0]&&e[0][0]&&e[0][0].coord&&(t.data=f(e,function(t){var e={coords:[t[0].coord,t[1].coord]};return t[0].name&&(e.fromName=t[0].name),t[1].name&&(e.toName=t[1].name),o([e,t[0],t[1]])}))}function rp(t,e,i){L_.call(this),this.add(this.createLine(t,e,i)),this._updateEffectSymbol(t,e)}function sp(t,e,i){L_.call(this),this._createPolyline(t,e,i)}function lp(t,e,i){rp.call(this,t,e,i),this._lastFrame=0,this._lastFramePercent=0}function up(){this.group=new L_}function hp(t){return t instanceof Array||(t=[t,t]),t}function cp(){var t=Vx();this.canvas=t,this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={}}function dp(t,e,i){var n=t[1]-t[0],o=(e=f(e,function(e){return{interval:[(e.interval[0]-t[0])/n,(e.interval[1]-t[0])/n]}})).length,a=0;return function(t){for(n=a;n=0;n--){var r=e[n].interval;if(r[0]<=t&&t<=r[1]){a=n;break}}return n>=0&&n=e[0]&&t<=e[1]}}function pp(t){var e=t.dimensions;return"lng"===e[0]&&"lat"===e[1]}function gp(t,e,i,n){var o=t.getItemLayout(e),a=i.get("symbolRepeat"),r=i.get("symbolClip"),s=i.get("symbolPosition")||"start",l=(i.get("symbolRotate")||0)*Math.PI/180||0,u=i.get("symbolPatternSize")||2,h=i.isAnimationEnabled(),c={dataIndex:e,layout:o,itemModel:i,symbolType:t.getItemVisual(e,"symbol")||"circle",color:t.getItemVisual(e,"color"),symbolClip:r,symbolRepeat:a,symbolRepeatDirection:i.get("symbolRepeatDirection"),symbolPatternSize:u,rotation:l,animationModel:h?i:null,hoverAnimation:h&&i.get("hoverAnimation"),z2:i.getShallow("z",!0)||0};mp(i,a,o,n,c),yp(t,e,o,a,r,c.boundingLength,c.pxSign,u,n,c),xp(i,c.symbolScale,l,n,c);var d=c.symbolSize,f=i.get("symbolOffset");return y(f)&&(f=[To(f[0],d[0]),To(f[1],d[1])]),_p(i,d,o,a,r,f,s,c.valueLineWidth,c.boundingLength,c.repeatCutLength,n,c),c}function mp(t,e,i,n,o){var a,r=n.valueDim,s=t.get("symbolBoundingData"),l=n.coordSys.getOtherAxis(n.coordSys.getBaseAxis()),u=l.toGlobalCoord(l.dataToCoord(0)),h=1-+(i[r.wh]<=0);if(y(s)){var c=[vp(l,s[0])-u,vp(l,s[1])-u];c[1]0?1:a<0?-1:0}function vp(t,e){return t.toGlobalCoord(t.dataToCoord(t.scale.parse(e)))}function yp(t,e,i,n,o,a,r,s,l,u){var h=l.valueDim,c=l.categoryDim,d=Math.abs(i[c.wh]),f=t.getItemVisual(e,"symbolSize");y(f)?f=f.slice():(null==f&&(f="100%"),f=[f,f]),f[c.index]=To(f[c.index],d),f[h.index]=To(f[h.index],n?d:Math.abs(a)),u.symbolSize=f,(u.symbolScale=[f[0]/s,f[1]/s])[h.index]*=(l.isHorizontal?-1:1)*r}function xp(t,e,i,n,o){var a=t.get(uL)||0;a&&(cL.attr({scale:e.slice(),rotation:i}),cL.updateTransform(),a/=cL.getLineScale(),a*=e[n.valueDim.index]),o.valueLineWidth=a}function _p(t,e,i,n,o,r,s,l,u,h,c,d){var f=c.categoryDim,p=c.valueDim,g=d.pxSign,m=Math.max(e[p.index]+l,0),v=m;if(n){var y=Math.abs(u),x=D(t.get("symbolMargin"),"15%")+"",_=!1;x.lastIndexOf("!")===x.length-1&&(_=!0,x=x.slice(0,x.length-1)),x=To(x,e[p.index]);var w=Math.max(m+2*x,0),b=_?0:2*x,S=Fo(n),M=S?n:Rp((y+b)/w);w=m+2*(x=(y-M*m)/2/(_?M:M-1)),b=_?0:2*x,S||"fixed"===n||(M=h?Rp((Math.abs(h)+b)/w):0),v=M*w-b,d.repeatTimes=M,d.symbolMargin=x}var I=g*(v/2),T=d.pathPosition=[];T[f.index]=i[f.wh]/2,T[p.index]="start"===s?I:"end"===s?u-I:u/2,r&&(T[0]+=r[0],T[1]+=r[1]);var A=d.bundlePosition=[];A[f.index]=i[f.xy],A[p.index]=i[p.xy];var C=d.barRectShape=a({},i);C[p.wh]=g*Math.max(Math.abs(i[p.wh]),Math.abs(T[p.index]+I)),C[f.wh]=i[f.wh];var L=d.clipShape={};L[f.xy]=-i[f.xy],L[f.wh]=c.ecSize[f.wh],L[p.xy]=0,L[p.wh]=i[p.wh]}function wp(t){var e=t.symbolPatternSize,i=ml(t.symbolType,-e/2,-e/2,e,e,t.color);return i.attr({culling:!0}),"image"!==i.type&&i.setStyle({strokeNoScale:!0}),i}function bp(t,e,i,n){function o(t){var e=l.slice(),n=i.pxSign,o=t;return("start"===i.symbolRepeatDirection?n>0:n<0)&&(o=h-1-t),e[u.index]=d*(o-h/2+.5)+l[u.index],{position:e,scale:i.symbolScale.slice(),rotation:i.rotation}}var a=t.__pictorialBundle,r=i.symbolSize,s=i.valueLineWidth,l=i.pathPosition,u=e.valueDim,h=i.repeatTimes||0,c=0,d=r[e.valueDim.index]+s+2*i.symbolMargin;for(Op(t,function(t){t.__pictorialAnimationIndex=c,t.__pictorialRepeatTimes=h,c0)],d=t.__pictorialBarRect;Pu(d.style,h,a,n,e.seriesModel,o,c),eo(d,h)}function Rp(t){var e=Math.round(t);return Math.abs(t-e)<1e-4?e:Math.ceil(t)}function Bp(t,e,i){this.dimension="single",this.dimensions=["single"],this._axis=null,this._rect,this._init(t,e,i),this.model=t}function Vp(t,e){e=e||{};var i=t.coordinateSystem,n=t.axis,o={},a=n.position,r=n.orient,s=i.getRect(),l=[s.x,s.x+s.width,s.y,s.y+s.height],u={horizontal:{top:l[2],bottom:l[3]},vertical:{left:l[0],right:l[1]}};o.position=["vertical"===r?u.vertical[a]:l[0],"horizontal"===r?u.horizontal[a]:l[3]];var h={horizontal:0,vertical:1};o.rotation=Math.PI/2*h[r];var c={top:-1,bottom:1,right:1,left:-1};o.labelDirection=o.tickDirection=o.nameDirection=c[a],t.get("axisTick.inside")&&(o.tickDirection=-o.tickDirection),D(e.labelInside,t.get("axisLabel.inside"))&&(o.labelDirection=-o.labelDirection);var d=e.rotate;return null==d&&(d=t.get("axisLabel.rotate")),o.labelRotation="top"===a?-d:d,o.labelInterval=n.getLabelInterval(),o.z2=1,o}function Gp(t,e,i,n,o){var r=t.axis;if(!r.scale.isBlank()&&r.containData(e))if(t.involveSeries){var s=Fp(e,t),l=s.payloadBatch,u=s.snapToValue;l[0]&&null==o.seriesIndex&&a(o,l[0]),!n&&t.snap&&r.containData(u)&&null!=u&&(e=u),i.showPointer(t,e,l,o),i.showTooltip(t,s,u)}else i.showPointer(t,e)}function Fp(t,e){var i=e.axis,n=i.dim,o=t,a=[],r=Number.MAX_VALUE,s=-1;return _L(e.seriesModels,function(e,l){var u,h,c=e.getData().mapDimension(n,!0);if(e.getAxisTooltipData){var d=e.getAxisTooltipData(c,t,i);h=d.dataIndices,u=d.nestestValue}else{if(!(h=e.getData().indicesOfNearest(c[0],t,"category"===i.type?.5:null)).length)return;u=e.getData().get(c[0],h[0])}if(null!=u&&isFinite(u)){var f=t-u,p=Math.abs(f);p<=r&&((p=0&&s<0)&&(r=p,s=f,o=u,a.length=0),_L(h,function(t){a.push({seriesIndex:e.seriesIndex,dataIndexInside:t,dataIndex:e.getData().getRawIndex(t)})}))}}),{payloadBatch:a,snapToValue:o}}function Wp(t,e,i,n){t[e.key]={value:i,payloadBatch:n}}function Hp(t,e,i,n){var o=i.payloadBatch,a=e.axis,r=a.model,s=e.axisPointerModel;if(e.triggerTooltip&&o.length){var l=e.coordSys.model,u=Au(l),h=t.map[u];h||(h=t.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},t.list.push(h)),h.dataByAxis.push({axisDim:a.dim,axisIndex:r.componentIndex,axisType:r.type,axisId:r.id,value:n,valueLabelOpt:{precision:s.get("label.precision"),formatter:s.get("label.formatter")},seriesDataIndices:o.slice()})}}function Zp(t,e,i){var n=i.axesInfo=[];_L(e,function(e,i){var o=e.axisPointerModel.option,a=t[i];a?(!e.useHandle&&(o.status="show"),o.value=a.value,o.seriesDataIndices=(a.payloadBatch||[]).slice()):!e.useHandle&&(o.status="hide"),"show"===o.status&&n.push({axisDim:e.axis.dim,axisIndex:e.axis.model.componentIndex,value:o.value})})}function Up(t,e,i,n){if(!qp(e)&&t.list.length){var o=((t.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};n({type:"showTip",escapeConnect:!0,x:e[0],y:e[1],tooltipOption:i.tooltipOption,position:i.position,dataIndexInside:o.dataIndexInside,dataIndex:o.dataIndex,seriesIndex:o.seriesIndex,dataByCoordSys:t.list})}else n({type:"hideTip"})}function jp(t,e,i){var n=i.getZr(),o=bL(n).axisPointerLastHighlights||{},a=bL(n).axisPointerLastHighlights={};_L(t,function(t,e){var i=t.axisPointerModel.option;"show"===i.status&&_L(i.seriesDataIndices,function(t){var e=t.seriesIndex+" | "+t.dataIndex;a[e]=t})});var r=[],s=[];d(o,function(t,e){!a[e]&&s.push(t)}),d(a,function(t,e){!o[e]&&r.push(t)}),s.length&&i.dispatchAction({type:"downplay",escapeConnect:!0,batch:s}),r.length&&i.dispatchAction({type:"highlight",escapeConnect:!0,batch:r})}function Xp(t,e){for(var i=0;i<(t||[]).length;i++){var n=t[i];if(e.axis.dim===n.axisDim&&e.axis.model.componentIndex===n.axisIndex)return n}}function Yp(t){var e=t.axis.model,i={},n=i.axisDim=t.axis.dim;return i.axisIndex=i[n+"AxisIndex"]=e.componentIndex,i.axisName=i[n+"AxisName"]=e.name,i.axisId=i[n+"AxisId"]=e.id,i}function qp(t){return!t||null==t[0]||isNaN(t[0])||null==t[1]||isNaN(t[1])}function $p(t,e,i){if(!Ax.node){var n=e.getZr();SL(n).records||(SL(n).records={}),Kp(n,e),(SL(n).records[t]||(SL(n).records[t]={})).handler=i}}function Kp(t,e){function i(i,n){t.on(i,function(i){var o=eg(e);ML(SL(t).records,function(t){t&&n(t,i,o.dispatchAction)}),Jp(o.pendings,e)})}SL(t).initialized||(SL(t).initialized=!0,i("click",v(tg,"click")),i("mousemove",v(tg,"mousemove")),i("globalout",Qp))}function Jp(t,e){var i,n=t.showTip.length,o=t.hideTip.length;n?i=t.showTip[n-1]:o&&(i=t.hideTip[o-1]),i&&(i.dispatchAction=null,e.dispatchAction(i))}function Qp(t,e,i){t.handler("leave",null,i)}function tg(t,e,i,n){e.handler(t,i,n)}function eg(t){var e={showTip:[],hideTip:[]},i=function(n){var o=e[n.type];o?o.push(n):(n.dispatchAction=i,t.dispatchAction(n))};return{dispatchAction:i,pendings:e}}function ig(t,e){if(!Ax.node){var i=e.getZr();(SL(i).records||{})[t]&&(SL(i).records[t]=null)}}function ng(){}function og(t,e,i,n){ag(DL(i).lastProp,n)||(DL(i).lastProp=n,e?fo(i,n,t):(i.stopAnimation(),i.attr(n)))}function ag(t,e){if(w(t)&&w(e)){var i=!0;return d(e,function(e,n){i=i&&ag(t[n],e)}),!!i}return t===e}function rg(t,e){t[e.get("label.show")?"show":"hide"]()}function sg(t){return{position:t.position.slice(),rotation:t.rotation||0}}function lg(t,e,i){var n=e.get("z"),o=e.get("zlevel");t&&t.traverse(function(t){"group"!==t.type&&(null!=n&&(t.z=n),null!=o&&(t.zlevel=o),t.silent=i)})}function ug(t){var e,i=t.get("type"),n=t.getModel(i+"Style");return"line"===i?(e=n.getLineStyle()).fill=null:"shadow"===i&&((e=n.getAreaStyle()).stroke=null),e}function hg(t,e,i,n,o){var a=dg(i.get("value"),e.axis,e.ecModel,i.get("seriesDataIndices"),{precision:i.get("label.precision"),formatter:i.get("label.formatter")}),r=i.getModel("label"),s=xS(r.get("padding")||0),l=r.getFont(),u=me(a,l),h=o.position,c=u.width+s[1]+s[3],d=u.height+s[0]+s[2],f=o.align;"right"===f&&(h[0]-=c),"center"===f&&(h[0]-=c/2);var p=o.verticalAlign;"bottom"===p&&(h[1]-=d),"middle"===p&&(h[1]-=d/2),cg(h,c,d,n);var g=r.get("backgroundColor");g&&"auto"!==g||(g=e.get("axisLine.lineStyle.color")),t.label={shape:{x:0,y:0,width:c,height:d,r:r.get("borderRadius")},position:h.slice(),style:{text:a,textFont:l,textFill:r.getTextColor(),textPosition:"inside",fill:g,stroke:r.get("borderColor")||"transparent",lineWidth:r.get("borderWidth")||0,shadowBlur:r.get("shadowBlur"),shadowColor:r.get("shadowColor"),shadowOffsetX:r.get("shadowOffsetX"),shadowOffsetY:r.get("shadowOffsetY")},z2:10}}function cg(t,e,i,n){var o=n.getWidth(),a=n.getHeight();t[0]=Math.min(t[0]+e,o)-e,t[1]=Math.min(t[1]+i,a)-i,t[0]=Math.max(t[0],0),t[1]=Math.max(t[1],0)}function dg(t,e,i,n,o){var a=e.scale.getLabel(t,{precision:o.precision}),r=o.formatter;if(r){var s={value:pl(e,t),seriesData:[]};d(n,function(t){var e=i.getSeriesByIndex(t.seriesIndex),n=t.dataIndexInside,o=e&&e.getDataParams(n);o&&s.seriesData.push(o)}),_(r)?a=r.replace("{value}",a):x(r)&&(a=r(s))}return a}function fg(t,e,i){var n=st();return dt(n,n,i.rotation),ct(n,n,i.position),mo([t.dataToCoord(e),(i.labelOffset||0)+(i.labelDirection||1)*(i.labelMargin||0)],n)}function pg(t,e,i,n,o,a){var r=qD.innerTextLayout(i.rotation,0,i.labelDirection);i.labelMargin=o.get("label.margin"),hg(e,n,o,a,{position:fg(n.axis,t,i),align:r.textAlign,verticalAlign:r.textVerticalAlign})}function gg(t,e,i){return i=i||0,{x1:t[i],y1:t[1-i],x2:e[i],y2:e[1-i]}}function mg(t,e,i){return i=i||0,{x:t[i],y:t[1-i],width:e[i],height:e[1-i]}}function vg(t,e,i,n,o,a){return{cx:t,cy:e,r0:i,r:n,startAngle:o,endAngle:a,clockwise:!0}}function yg(t,e){var i={};return i[e.dim+"AxisIndex"]=e.index,t.getCartesian(i)}function xg(t){return"x"===t.dim?0:1}function _g(t){return t.isHorizontal()?0:1}function wg(t,e){var i=t.getRect();return[i[kL[e]],i[kL[e]]+i[PL[e]]]}function bg(t,e,i){var n=new jb({shape:{x:t.x-10,y:t.y-10,width:0,height:t.height+20}});return po(n,{shape:{width:t.width+20,height:t.height+20}},e,i),n}function Sg(t,e,i){if(t.count())for(var n,o=e.coordinateSystem,a=e.getLayerSeries(),r=t.mapDimension("single"),s=t.mapDimension("value"),l=f(a,function(e){return f(e.indices,function(e){var i=o.dataToPoint(t.get(r,e));return i[1]=t.get(s,e),i})}),u=Mg(l),h=u.y0,c=i/u.max,d=a.length,p=a[0].indices.length,g=0;ga&&(a=u),n.push(u)}for(var h=0;ha&&(a=d)}return r.y0=o,r.max=a,r}function Ig(t){var e=0;d(t.children,function(t){Ig(t);var i=t.value;y(i)&&(i=i[0]),e+=i});var i=t.value;y(i)&&(i=i[0]),(null==i||isNaN(i))&&(i=e),i<0&&(i=0),y(t.value)?t.value[0]=i:t.value=i}function Dg(t,e,i){function n(){r.ignore=r.hoverIgnore}function o(){r.ignore=r.normalIgnore}L_.call(this);var a=new Gb({z2:RL}),r=new zb({z2:BL,silent:t.getModel("label").get("silent")});this.add(a),this.add(r),this.updateData(!0,t,"normal",e,i),this.on("emphasis",n).on("normal",o).on("mouseover",n).on("mouseout",o)}function Tg(t,e,i){var n=t.getVisual("color"),o=t.getVisual("visualMeta");o&&0!==o.length||(n=null);var a=t.getModel("itemStyle").get("color");if(a)return a;if(n)return n;if(0===t.depth)return i.option.color[0];var r=i.option.color.length;return a=i.option.color[Ag(t)%r]}function Ag(t){for(var e=t;e.depth>1;)e=e.parentNode;return l(t.getAncestors()[0].children,e)}function Cg(t,e,i){return i!==zL.NONE&&(i===zL.SELF?t===e:i===zL.ANCESTOR?t===e||t.isAncestorOf(e):t===e||t.isDescendantOf(e))}function Lg(t,e){var i=t.children||[];t.children=kg(i,e),i.length&&d(t.children,function(t){Lg(t,e)})}function kg(t,e){if("function"==typeof e)return t.sort(e);var i="asc"===e;return t.sort(function(t,e){var n=(t.getValue()-e.getValue())*(i?1:-1);return 0===n?(t.dataIndex-e.dataIndex)*(i?-1:1):n})}function Pg(t,e){return e=e||[0,0],f(["x","y"],function(i,n){var o=this.getAxis(i),a=e[n],r=t[n]/2;return"category"===o.type?o.getBandWidth():Math.abs(o.dataToCoord(a-r)-o.dataToCoord(a+r))},this)}function Ng(t,e){return e=e||[0,0],f([0,1],function(i){var n=e[i],o=t[i]/2,a=[],r=[];return a[i]=n-o,r[i]=n+o,a[1-i]=r[1-i]=e[1-i],Math.abs(this.dataToPoint(a)[i]-this.dataToPoint(r)[i])},this)}function Og(t,e){var i=this.getAxis(),n=e instanceof Array?e[0]:e,o=(t instanceof Array?t[0]:t)/2;return"category"===i.type?i.getBandWidth():Math.abs(i.dataToCoord(n-o)-i.dataToCoord(n+o))}function Eg(t,e){return f(["Radius","Angle"],function(i,n){var o=this["get"+i+"Axis"](),a=e[n],r=t[n]/2,s="dataTo"+i,l="category"===o.type?o.getBandWidth():Math.abs(o[s](a-r)-o[s](a+r));return"Angle"===i&&(l=l*Math.PI/180),l},this)}function zg(t){var e,i=t.type;if("path"===i){var n=t.shape;(e=zn(n.pathData,null,{x:n.x||0,y:n.y||0,width:n.width||0,height:n.height||0},"center")).__customPathData=t.pathData}else"image"===i?(e=new Je({})).__customImagePath=t.style.image:"text"===i?(e=new zb({})).__customText=t.style.text:e=new(0,sS[i.charAt(0).toUpperCase()+i.slice(1)]);return e.__customGraphicType=i,e.name=t.name,e}function Rg(t,e,n,o,a,r){var s={},l=n.style||{};if(n.shape&&(s.shape=i(n.shape)),n.position&&(s.position=n.position.slice()),n.scale&&(s.scale=n.scale.slice()),n.origin&&(s.origin=n.origin.slice()),n.rotation&&(s.rotation=n.rotation),"image"===t.type&&n.style){u=s.style={};d(["x","y","width","height"],function(e){Bg(e,u,l,t.style,r)})}if("text"===t.type&&n.style){var u=s.style={};d(["x","y"],function(e){Bg(e,u,l,t.style,r)}),!l.hasOwnProperty("textFill")&&l.fill&&(l.textFill=l.fill),!l.hasOwnProperty("textStroke")&&l.stroke&&(l.textStroke=l.stroke)}if("group"!==t.type&&(t.useStyle(l),r)){t.style.opacity=0;var h=l.opacity;null==h&&(h=1),po(t,{style:{opacity:h}},o,e)}r?t.attr(s):fo(t,s,o,e),t.attr({z2:n.z2||0,silent:n.silent}),!1!==n.styleEmphasis&&eo(t,n.styleEmphasis)}function Bg(t,e,i,n,o){null==i[t]||o||(e[t]=i[t],i[t]=n[t])}function Vg(t,e,i,n){function o(t){null==t&&(t=h),v&&(c=e.getItemModel(t),d=c.getModel(UL),f=c.getModel(jL),p=e.getItemVisual(t,"color"),v=!1)}var s=t.get("renderItem"),l=t.coordinateSystem,u={};l&&(u=l.prepareCustoms?l.prepareCustoms():YL[l.type](l));var h,c,d,f,p,g=r({getWidth:n.getWidth,getHeight:n.getHeight,getZr:n.getZr,getDevicePixelRatio:n.getDevicePixelRatio,value:function(t,i){return null==i&&(i=h),e.get(e.getDimension(t||0),i)},style:function(i,n){null==n&&(n=h),o(n);var r=c.getModel(HL).getItemStyle();null!=p&&(r.fill=p);var s=e.getItemVisual(n,"opacity");return null!=s&&(r.opacity=s),no(r,d,null,{autoColor:p,isRectText:!0}),r.text=d.getShallow("show")?T(t.getFormattedLabel(n,"normal"),Sl(e,n)):null,i&&a(r,i),r},styleEmphasis:function(i,n){null==n&&(n=h),o(n);var r=c.getModel(ZL).getItemStyle();return no(r,f,null,{isRectText:!0},!0),r.text=f.getShallow("show")?A(t.getFormattedLabel(n,"emphasis"),t.getFormattedLabel(n,"normal"),Sl(e,n)):null,i&&a(r,i),r},visual:function(t,i){return null==i&&(i=h),e.getItemVisual(i,t)},barLayout:function(t){if(l.getBaseAxis)return nl(r({axis:l.getBaseAxis()},t),n)},currentSeriesIndices:function(){return i.getCurrentSeriesIndices()},font:function(t){return ho(t,i)}},u.api||{}),m={context:{},seriesId:t.id,seriesName:t.name,seriesIndex:t.seriesIndex,coordSys:u.coordSys,dataInsideLength:e.count(),encode:Gg(t.getData())},v=!0;return function(t){return h=t,v=!0,s&&s(r({dataIndexInside:t,dataIndex:e.getRawIndex(t)},m),g)||{}}}function Gg(t){var e={};return d(t.dimensions,function(i,n){var o=t.getDimensionInfo(i);if(!o.isExtraCoord){var a=o.coordDim;(e[a]=e[a]||[])[o.coordDimIndex]=n}}),e}function Fg(t,e,i,n,o,a){return(t=Wg(t,e,i,n,o,a))&&a.setItemGraphicEl(e,t),t}function Wg(t,e,i,n,o,a){var r=i.type;if(!t||r===t.__customGraphicType||"path"===r&&i.pathData===t.__customPathData||"image"===r&&i.style.image===t.__customImagePath||"text"===r&&i.style.text===t.__customText||(o.remove(t),t=null),null!=r){var s=!t;if(!t&&(t=zg(i)),Rg(t,e,i,n,a,s),"group"===r){var l=t.children()||[],u=i.children||[];if(i.diffChildrenByName)Hg({oldChildren:l,newChildren:u,dataIndex:e,animatableModel:n,group:t,data:a});else{for(var h=0;hn?t-=l+a:t+=a),null!=r&&(e+u+r>o?e-=u+r:e+=r),[t,e]}function pm(t,e,i,n,o){var a=gm(i),r=a.width,s=a.height;return t=Math.min(t+r,n)-r,e=Math.min(e+s,o)-s,t=Math.max(t,0),e=Math.max(e,0),[t,e]}function gm(t){var e=t.clientWidth,i=t.clientHeight;if(document.defaultView&&document.defaultView.getComputedStyle){var n=document.defaultView.getComputedStyle(t);n&&(e+=parseInt(n.paddingLeft,10)+parseInt(n.paddingRight,10)+parseInt(n.borderLeftWidth,10)+parseInt(n.borderRightWidth,10),i+=parseInt(n.paddingTop,10)+parseInt(n.paddingBottom,10)+parseInt(n.borderTopWidth,10)+parseInt(n.borderBottomWidth,10))}return{width:e,height:i}}function mm(t,e,i){var n=i[0],o=i[1],a=0,r=0,s=e.width,l=e.height;switch(t){case"inside":a=e.x+s/2-n/2,r=e.y+l/2-o/2;break;case"top":a=e.x+s/2-n/2,r=e.y-o-5;break;case"bottom":a=e.x+s/2-n/2,r=e.y+l+5;break;case"left":a=e.x-n-5,r=e.y+l/2-o/2;break;case"right":a=e.x+s+5,r=e.y+l/2-o/2}return[a,r]}function vm(t){return"center"===t||"middle"===t}function ym(t){return t.get("stack")||"__ec_stack_"+t.seriesIndex}function xm(t){return t.dim}function _m(t,e){var i={};d(t,function(t,e){var n=t.getData(),o=t.coordinateSystem.getBaseAxis(),a=o.getExtent(),r="category"===o.type?o.getBandWidth():Math.abs(a[1]-a[0])/n.count(),s=i[xm(o)]||{bandWidth:r,remainedWidth:r,autoWidthCount:0,categoryGap:"20%",gap:"30%",stacks:{}},l=s.stacks;i[xm(o)]=s;var u=ym(t);l[u]||s.autoWidthCount++,l[u]=l[u]||{width:0,maxWidth:0};var h=To(t.get("barWidth"),r),c=To(t.get("barMaxWidth"),r),d=t.get("barGap"),f=t.get("barCategoryGap");h&&!l[u].width&&(h=Math.min(s.remainedWidth,h),l[u].width=h,s.remainedWidth-=h),c&&(l[u].maxWidth=c),null!=d&&(s.gap=d),null!=f&&(s.categoryGap=f)});var n={};return d(i,function(t,e){n[e]={};var i=t.stacks,o=t.bandWidth,a=To(t.categoryGap,o),r=To(t.gap,1),s=t.remainedWidth,l=t.autoWidthCount,u=(s-a)/(l+(l-1)*r);u=Math.max(u,0),d(i,function(t,e){var i=t.maxWidth;i&&ie[0]&&(e=e.slice().reverse());var n=t.coordToPoint([e[0],i]),o=t.coordToPoint([e[1],i]);return{x1:n[0],y1:n[1],x2:o[0],y2:o[1]}}function Am(t){return t.getRadiusAxis().inverse?0:1}function Cm(t,e,i){return{position:[t.cx,t.cy],rotation:i/180*Math.PI,labelDirection:-1,tickDirection:-1,nameDirection:1,labelRotate:e.getModel("axisLabel").get("rotate"),z2:1}}function Lm(t,e,i,n,o){var a=e.axis,r=a.dataToCoord(t),s=n.getAngleAxis().getExtent()[0];s=s/180*Math.PI;var l,u,h,c=n.getRadiusAxis().getExtent();if("radius"===a.dim){var d=st();dt(d,d,s),ct(d,d,[n.cx,n.cy]),l=mo([r,-o],d);var f=e.getModel("axisLabel").get("rotate")||0,p=qD.innerTextLayout(s,f*Math.PI/180,-1);u=p.textAlign,h=p.textVerticalAlign}else{var g=c[1];l=n.coordToPoint([g+o,r]);var m=n.cx,v=n.cy;u=Math.abs(l[0]-m)/g<.3?"center":l[0]>m?"left":"right",h=Math.abs(l[1]-v)/g<.3?"middle":l[1]>v?"top":"bottom"}return{position:l,align:u,verticalAlign:h}}function km(t,e){e.update="updateView",hs(e,function(e,i){var n={};return i.eachComponent({mainType:"geo",query:e},function(i){i[t](e.name),d(i.coordinateSystem.regions,function(t){n[t.name]=i.isSelected(t.name)||!1})}),{selected:n,name:e.name}})}function Pm(t){var e={};d(t,function(t){e[t]=1}),t.length=0,d(e,function(e,i){t.push(i)})}function Nm(t){if(t)for(var e in t)if(t.hasOwnProperty(e))return!0}function Om(t,e,n){function o(){var t=function(){};return t.prototype.__hidden=t.prototype,new t}var a={};return Sk(e,function(e){var r=a[e]=o();Sk(t[e],function(t,o){if(fA.isValidType(o)){var a={type:o,visual:t};n&&n(a,e),r[o]=new fA(a),"opacity"===o&&((a=i(a)).type="colorAlpha",r.__hidden.__alphaForOpacity=new fA(a))}})}),a}function Em(t,e,n){var o;d(n,function(t){e.hasOwnProperty(t)&&Nm(e[t])&&(o=!0)}),o&&d(n,function(n){e.hasOwnProperty(n)&&Nm(e[n])?t[n]=i(e[n]):delete t[n]})}function zm(t,e,i,n,o,a){function r(t){return i.getItemVisual(h,t)}function s(t,e){i.setItemVisual(h,t,e)}function l(t,l){h=null==a?t:l;var c=i.getRawDataItem(h);if(!c||!1!==c.visualMap)for(var d=n.call(o,t),f=e[d],p=u[d],g=0,m=p.length;g1)return!1;var h=Hm(i-t,o-t,n-e,a-e)/l;return!(h<0||h>1)}function Wm(t){return t<=1e-6&&t>=-1e-6}function Hm(t,e,i,n){return t*n-e*i}function Zm(t,e,i){var n=this._targetInfoList=[],o={},a=jm(e,t);Ik(kk,function(t,e){(!i||!i.include||Dk(i.include,e)>=0)&&t(a,n,o)})}function Um(t){return t[0]>t[1]&&t.reverse(),t}function jm(t,e){return Oi(t,e,{includeMainTypes:Ck})}function Xm(t,e,i,n){var o=i.getAxis(["x","y"][t]),a=Um(f([0,1],function(t){return e?o.coordToData(o.toLocalCoord(n[t])):o.toGlobalCoord(o.dataToCoord(n[t]))})),r=[];return r[t]=a,r[1-t]=[NaN,NaN],{values:a,xyMinMax:r}}function Ym(t,e,i,n){return[e[0]-n[t]*i[0],e[1]-n[t]*i[1]]}function qm(t,e){var i=$m(t),n=$m(e),o=[i[0]/n[0],i[1]/n[1]];return isNaN(o[0])&&(o[0]=1),isNaN(o[1])&&(o[1]=1),o}function $m(t){return t?[t[0][1]-t[0][0],t[1][1]-t[1][0]]:[NaN,NaN]}function Km(t,e,i,n,o){if(o){var a=t.getZr();a[Bk]||(a[Rk]||(a[Rk]=Jm),_r(a,Rk,i,e)(t,n))}}function Jm(t,e){if(!t.isDisposed()){var i=t.getZr();i[Bk]=!0,t.dispatchAction({type:"brushSelect",batch:e}),i[Bk]=!1}}function Qm(t,e,i,n){for(var o=0,a=e.length;o=0}function fv(t,e,i){function n(t,e){return l(e.nodes,t)>=0}function o(t,n){var o=!1;return e(function(e){d(i(t,e)||[],function(t){n.records[e.name][t]&&(o=!0)})}),o}function a(t,n){n.nodes.push(t),e(function(e){d(i(t,e)||[],function(t){n.records[e.name][t]=!0})})}return function(i){var r={nodes:[],records:{}};if(e(function(t){r.records[t.name]={}}),!i)return r;a(i,r);var s;do{s=!1,t(function(t){!n(t,r)&&o(t,r)&&(a(t,r),s=!0)})}while(s);return r}}function pv(t,e,i){var n=[1/0,-1/0];return $k(i,function(t){var i=t.getData();i&&$k(i.mapDimension(e,!0),function(t){var e=i.getApproximateExtent(t);e[0]n[1]&&(n[1]=e[1])})}),n[1]0?0:NaN);var r=i.getMax(!0);return null!=r&&"dataMax"!==r&&"function"!=typeof r?e[1]=r:o&&(e[1]=a>0?a-1:NaN),i.get("scale",!0)||(e[0]>0&&(e[0]=0),e[1]<0&&(e[1]=0)),e}function mv(t,e){var i=t.getAxisModel(),n=t._percentWindow,o=t._valueWindow;if(n){var a=Po(o,[0,500]);a=Math.min(a,20);var r=e||0===n[0]&&100===n[1];i.setRange(r?null:+o[0].toFixed(a),r?null:+o[1].toFixed(a))}}function vv(t){var e=t._minMaxSpan={},i=t._dataZoomModel;$k(["min","max"],function(n){e[n+"Span"]=i.get(n+"Span");var o=i.get(n+"ValueSpan");if(null!=o&&(e[n+"ValueSpan"]=o,null!=(o=t.getAxisModel().axis.scale.parse(o)))){var a=t._dataExtent;e[n+"Span"]=Do(a[0]+o,a,[0,100],!0)}})}function yv(t){var e={};return Qk(["start","end","startValue","endValue","throttle"],function(i){t.hasOwnProperty(i)&&(e[i]=t[i])}),e}function xv(t,e){var i=t._rangePropMode,n=t.get("rangeMode");Qk([["start","startValue"],["end","endValue"]],function(t,o){var a=null!=e[t[0]],r=null!=e[t[1]];a&&!r?i[o]="percent":!a&&r?i[o]="value":n?i[o]=n[o]:a&&(i[o]="percent")})}function _v(t){return{x:"y",y:"x",radius:"angle",angle:"radius"}[t]}function wv(t){return"vertical"===t?"ns-resize":"ew-resize"}function bv(t,e){var i=Dv(t),n=e.dataZoomId,o=e.coordId;d(i,function(t,i){var a=t.dataZoomInfos;a[n]&&l(e.allCoordIds,o)<0&&(delete a[n],t.count--)}),Av(i);var a=i[o];a||((a=i[o]={coordId:o,dataZoomInfos:{},count:0}).controller=Tv(t,a),a.dispatchAction=v(Pv,t)),!a.dataZoomInfos[n]&&a.count++,a.dataZoomInfos[n]=e;var r=Nv(a.dataZoomInfos);a.controller.enable(r.controlType,r.opt),a.controller.setPointerChecker(e.containsPoint),_r(a,"dispatchAction",e.throttleRate,"fixRate")}function Sv(t,e){var i=Dv(t);d(i,function(t){t.controller.dispose();var i=t.dataZoomInfos;i[e]&&(delete i[e],t.count--)}),Av(i)}function Mv(t,e){if(t&&"dataZoom"===t.type&&t.batch)for(var i=0,n=t.batch.length;in["type_"+e]&&(e=o),a(i,t.roamControllerOpt)}),{controlType:e,opt:i}}function Ov(t,e){return t&&t.hasOwnProperty&&t.hasOwnProperty(e)}function Ev(t,e,i,n){for(var o=e.targetVisuals[n],a=fA.prepareVisualTypes(o),r={color:t.getData().getVisual("color")},s=0,l=a.length;s=0&&(r[a]=+r[a].toFixed(h)),r}function $v(t,e){var n=t.getData(),o=t.coordinateSystem;if(e&&!Yv(e)&&!y(e.coord)&&o){var a=o.dimensions,r=Kv(e,n,o,t);if((e=i(e)).type&&XP[e.type]&&r.baseAxis&&r.valueAxis){var s=UP(a,r.baseAxis.dim),l=UP(a,r.valueAxis.dim);e.coord=XP[e.type](n,r.baseDataDim,r.valueDataDim,s,l),e.value=e.coord[l]}else{for(var u=[null!=e.xAxis?e.xAxis:e.radiusAxis,null!=e.yAxis?e.yAxis:e.angleAxis],h=0;h<2;h++)XP[u[h]]&&(u[h]=ey(n,n.mapDimension(a[h]),u[h]));e.coord=u}}return e}function Kv(t,e,i,n){var o={};return null!=t.valueIndex||null!=t.valueDim?(o.valueDataDim=null!=t.valueIndex?e.getDimension(t.valueIndex):t.valueDim,o.valueAxis=i.getAxis(Jv(n,o.valueDataDim)),o.baseAxis=i.getOtherAxis(o.valueAxis),o.baseDataDim=e.mapDimension(o.baseAxis.dim)):(o.baseAxis=n.getBaseAxis(),o.valueAxis=i.getOtherAxis(o.baseAxis),o.baseDataDim=e.mapDimension(o.baseAxis.dim),o.valueDataDim=e.mapDimension(o.valueAxis.dim)),o}function Jv(t,e){var i=t.getData(),n=i.dimensions;e=i.getDimension(e);for(var o=0;o=0)return!0}function Ly(t){for(var e=t.split(/\n+/g),i=[],n=f(Ay(e.shift()).split(fN),function(t){return{name:t,data:[]}}),o=0;o=0&&!i[o][n];o--);if(o<0){var a=t.queryComponents({mainType:"dataZoom",subType:"select",id:n})[0];if(a){var r=a.getPercentRange();i[0][n]={dataZoomId:n,start:r[0],end:r[1]}}}}),i.push(e)}function zy(t){var e=Vy(t),i=e[e.length-1];e.length>1&&e.pop();var n={};return pN(i,function(t,i){for(var o=e.length-1;o>=0;o--)if(t=e[o][i]){n[i]=t;break}}),n}function Ry(t){t[gN]=null}function By(t){return Vy(t).length}function Vy(t){var e=t[gN];return e||(e=t[gN]=[{}]),e}function Gy(t,e,i){(this._brushController=new Dd(i.getZr())).on("brush",m(this._onBrush,this)).mount(),this._isZoomActive}function Fy(t){var e={};return d(["xAxisIndex","yAxisIndex"],function(i){e[i]=t[i],null==e[i]&&(e[i]="all"),(!1===e[i]||"none"===e[i])&&(e[i]=[])}),e}function Wy(t,e){t.setIconStatus("back",By(e)>1?"emphasis":"normal")}function Hy(t,e,i,n,o){var a=i._isZoomActive;n&&"takeGlobalCursor"===n.type&&(a="dataZoomSelect"===n.key&&n.dataZoomSelectActive),i._isZoomActive=a,t.setIconStatus("zoom",a?"emphasis":"normal");var r=new Zm(Fy(t.option),e,{include:["grid"]});i._brushController.setPanels(r.makePanelOpts(o,function(t){return t.xAxisDeclared&&!t.yAxisDeclared?"lineX":!t.xAxisDeclared&&t.yAxisDeclared?"lineY":"rect"})).enableBrush(!!a&&{brushType:"auto",brushStyle:{lineWidth:0,fill:"rgba(0,0,0,0.2)"}})}function Zy(t){this.model=t}function Uy(t){return bN(t)}function jy(){if(!IN&&DN){IN=!0;var t=DN.styleSheets;t.length<31?DN.createStyleSheet().addRule(".zrvml","behavior:url(#default#VML)"):t[0].addRule(".zrvml","behavior:url(#default#VML)")}}function Xy(t){return parseInt(t,10)}function Yy(t,e){jy(),this.root=t,this.storage=e;var i=document.createElement("div"),n=document.createElement("div");i.style.cssText="display:inline-block;overflow:hidden;position:relative;width:300px;height:150px;",n.style.cssText="position:absolute;left:0;top:0;",t.appendChild(i),this._vmlRoot=n,this._vmlViewport=i,this.resize();var o=e.delFromStorage,a=e.addToStorage;e.delFromStorage=function(t){o.call(e,t),t&&t.onRemove&&t.onRemove(n)},e.addToStorage=function(t){t.onAdd&&t.onAdd(n),a.call(e,t)},this._firstPaint=!0}function qy(t){return function(){M_('In IE8.0 VML mode painter not support method "'+t+'"')}}function $y(t){return document.createElementNS(rO,t)}function Ky(t){return hO(1e4*t)/1e4}function Jy(t){return t-mO}function Qy(t,e){var i=e?t.textFill:t.fill;return null!=i&&i!==uO}function tx(t,e){var i=e?t.textStroke:t.stroke;return null!=i&&i!==uO}function ex(t,e){e&&ix(t,"transform","matrix("+lO.call(e,",")+")")}function ix(t,e,i){(!i||"linear"!==i.type&&"radial"!==i.type)&&t.setAttribute(e,i)}function nx(t,e,i){t.setAttributeNS("http://www.w3.org/1999/xlink",e,i)}function ox(t,e,i){if(Qy(e,i)){var n=i?e.textFill:e.fill;n="transparent"===n?uO:n,"none"!==t.getAttribute("clip-path")&&n===uO&&(n="rgba(0, 0, 0, 0.002)"),ix(t,"fill",n),ix(t,"fill-opacity",e.opacity)}else ix(t,"fill",uO);if(tx(e,i)){var o=i?e.textStroke:e.stroke;ix(t,"stroke",o="transparent"===o?uO:o),ix(t,"stroke-width",(i?e.textStrokeWidth:e.lineWidth)/(!i&&e.strokeNoScale?e.host.getLineScale():1)),ix(t,"paint-order",i?"stroke":"fill"),ix(t,"stroke-opacity",e.opacity),e.lineDash?(ix(t,"stroke-dasharray",e.lineDash.join(",")),ix(t,"stroke-dashoffset",hO(e.lineDashOffset||0))):ix(t,"stroke-dasharray",""),e.lineCap&&ix(t,"stroke-linecap",e.lineCap),e.lineJoin&&ix(t,"stroke-linejoin",e.lineJoin),e.miterLimit&&ix(t,"stroke-miterlimit",e.miterLimit)}else ix(t,"stroke",uO)}function ax(t){for(var e=[],i=t.data,n=t.len(),o=0;o=pO||!Jy(g)&&(d>-fO&&d<0||d>fO)==!!p;var y=Ky(s+u*dO(c)),x=Ky(l+h*cO(c));m&&(d=p?pO-1e-4:1e-4-pO,v=!0,9===o&&e.push("M",y,x));var _=Ky(s+u*dO(c+d)),w=Ky(l+h*cO(c+d));e.push("A",Ky(u),Ky(h),hO(f*gO),+v,+p,_,w);break;case sO.Z:a="Z";break;case sO.R:var _=Ky(i[o++]),w=Ky(i[o++]),b=Ky(i[o++]),S=Ky(i[o++]);e.push("M",_,w,"L",_+b,w,"L",_+b,w+S,"L",_,w+S,"L",_,w)}a&&e.push(a);for(var M=0;M=11)}}(navigator.userAgent),Cx={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1,"[object CanvasPattern]":1,"[object Image]":1,"[object Canvas]":1},Lx={"[object Int8Array]":1,"[object Uint8Array]":1,"[object Uint8ClampedArray]":1,"[object Int16Array]":1,"[object Uint16Array]":1,"[object Int32Array]":1,"[object Uint32Array]":1,"[object Float32Array]":1,"[object Float64Array]":1},kx=Object.prototype.toString,Px=Array.prototype,Nx=Px.forEach,Ox=Px.filter,Ex=Px.slice,zx=Px.map,Rx=Px.reduce,Bx={},Vx=function(){return Bx.createCanvas()};Bx.createCanvas=function(){return document.createElement("canvas")};var Gx,Fx="__ec_primitive__";E.prototype={constructor:E,get:function(t){return this.hasOwnProperty(t)?this[t]:null},set:function(t,e){return this[t]=e},each:function(t,e){void 0!==e&&(t=m(t,e));for(var i in this)this.hasOwnProperty(i)&&t(this[i],i)},removeKey:function(t){delete this[t]}};var Wx=(Object.freeze||Object)({$override:e,clone:i,merge:n,mergeAll:o,extend:a,defaults:r,createCanvas:Vx,getContext:s,indexOf:l,inherits:u,mixin:h,isArrayLike:c,each:d,map:f,reduce:p,filter:g,find:function(t,e,i){if(t&&e)for(var n=0,o=t.length;n3&&(e=qx.call(e,1));for(var n=this._$handlers[t],o=n.length,a=0;a4&&(e=qx.call(e,1,e.length-1));for(var n=e[e.length-1],o=this._$handlers[t],a=o.length,r=0;r=0;a--){var r;if(n[a]!==i&&!n[a].ignore&&(r=rt(n[a],t,e))&&(!o.topTarget&&(o.topTarget=n[a]),r!==Kx)){o.target=n[a];break}}return o}},d(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(t){Qx.prototype[t]=function(e){var i=this.findHover(e.zrX,e.zrY),n=i.target;if("mousedown"===t)this._downEl=n,this._downPoint=[e.zrX,e.zrY],this._upEl=n;else if("mouseup"===t)this._upEl=n;else if("click"===t){if(this._downEl!==this._upEl||!this._downPoint||jx(this._downPoint,[e.zrX,e.zrY])>4)return;this._downPoint=null}this.dispatchToElement(i,t,e)}}),h(Qx,$x),h(Qx,it);var t_="undefined"==typeof Float32Array?Array:Float32Array,e_=(Object.freeze||Object)({create:st,identity:lt,copy:ut,mul:ht,translate:ct,rotate:dt,scale:ft,invert:pt,clone:gt}),i_=lt,n_=5e-5,o_=function(t){(t=t||{}).position||(this.position=[0,0]),null==t.rotation&&(this.rotation=0),t.scale||(this.scale=[1,1]),this.origin=this.origin||null},a_=o_.prototype;a_.transform=null,a_.needLocalTransform=function(){return mt(this.rotation)||mt(this.position[0])||mt(this.position[1])||mt(this.scale[0]-1)||mt(this.scale[1]-1)},a_.updateTransform=function(){var t=this.parent,e=t&&t.transform,i=this.needLocalTransform(),n=this.transform;i||e?(n=n||st(),i?this.getLocalTransform(n):i_(n),e&&(i?ht(n,t.transform,n):ut(n,t.transform)),this.transform=n,this.invTransform=this.invTransform||st(),pt(this.invTransform,n)):n&&i_(n)},a_.getLocalTransform=function(t){return o_.getLocalTransform(this,t)},a_.setTransform=function(t){var e=this.transform,i=t.dpr||1;e?t.setTransform(i*e[0],i*e[1],i*e[2],i*e[3],i*e[4],i*e[5]):t.setTransform(i,0,0,i,0,0)},a_.restoreTransform=function(t){var e=t.dpr||1;t.setTransform(e,0,0,e,0,0)};var r_=[];a_.decomposeTransform=function(){if(this.transform){var t=this.parent,e=this.transform;t&&t.transform&&(ht(r_,t.invTransform,e),e=r_);var i=e[0]*e[0]+e[1]*e[1],n=e[2]*e[2]+e[3]*e[3],o=this.position,a=this.scale;mt(i-1)&&(i=Math.sqrt(i)),mt(n-1)&&(n=Math.sqrt(n)),e[0]<0&&(i=-i),e[3]<0&&(n=-n),o[0]=e[4],o[1]=e[5],a[0]=i,a[1]=n,this.rotation=Math.atan2(-e[1]/n,e[0]/i)}},a_.getGlobalScale=function(){var t=this.transform;if(!t)return[1,1];var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]),i=Math.sqrt(t[2]*t[2]+t[3]*t[3]);return t[0]<0&&(e=-e),t[3]<0&&(i=-i),[e,i]},a_.transformCoordToLocal=function(t,e){var i=[t,e],n=this.invTransform;return n&&Q(i,i,n),i},a_.transformCoordToGlobal=function(t,e){var i=[t,e],n=this.transform;return n&&Q(i,i,n),i},o_.getLocalTransform=function(t,e){i_(e=e||[]);var i=t.origin,n=t.scale||[1,1],o=t.rotation||0,a=t.position||[0,0];return i&&(e[4]-=i[0],e[5]-=i[1]),ft(e,e,n),o&&dt(e,e,o),i&&(e[4]+=i[0],e[5]+=i[1]),e[4]+=a[0],e[5]+=a[1],e};var s_={linear:function(t){return t},quadraticIn:function(t){return t*t},quadraticOut:function(t){return t*(2-t)},quadraticInOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},cubicIn:function(t){return t*t*t},cubicOut:function(t){return--t*t*t+1},cubicInOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},quarticIn:function(t){return t*t*t*t},quarticOut:function(t){return 1- --t*t*t*t},quarticInOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},quinticIn:function(t){return t*t*t*t*t},quinticOut:function(t){return--t*t*t*t*t+1},quinticInOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},sinusoidalIn:function(t){return 1-Math.cos(t*Math.PI/2)},sinusoidalOut:function(t){return Math.sin(t*Math.PI/2)},sinusoidalInOut:function(t){return.5*(1-Math.cos(Math.PI*t))},exponentialIn:function(t){return 0===t?0:Math.pow(1024,t-1)},exponentialOut:function(t){return 1===t?1:1-Math.pow(2,-10*t)},exponentialInOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))},circularIn:function(t){return 1-Math.sqrt(1-t*t)},circularOut:function(t){return Math.sqrt(1- --t*t)},circularInOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},elasticIn:function(t){var e,i=.1;return 0===t?0:1===t?1:(!i||i<1?(i=1,e=.1):e=.4*Math.asin(1/i)/(2*Math.PI),-i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4))},elasticOut:function(t){var e,i=.1;return 0===t?0:1===t?1:(!i||i<1?(i=1,e=.1):e=.4*Math.asin(1/i)/(2*Math.PI),i*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/.4)+1)},elasticInOut:function(t){var e,i=.1;return 0===t?0:1===t?1:(!i||i<1?(i=1,e=.1):e=.4*Math.asin(1/i)/(2*Math.PI),(t*=2)<1?i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4)*-.5:i*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4)*.5+1)},backIn:function(t){var e=1.70158;return t*t*((e+1)*t-e)},backOut:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},backInOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)},bounceIn:function(t){return 1-s_.bounceOut(1-t)},bounceOut:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},bounceInOut:function(t){return t<.5?.5*s_.bounceIn(2*t):.5*s_.bounceOut(2*t-1)+.5}};vt.prototype={constructor:vt,step:function(t,e){if(this._initialized||(this._startTime=t+this._delay,this._initialized=!0),this._paused)this._pausedTime+=e;else{var i=(t-this._startTime-this._pausedTime)/this._life;if(!(i<0)){i=Math.min(i,1);var n=this.easing,o="string"==typeof n?s_[n]:n,a="function"==typeof o?o(i):i;return this.fire("frame",a),1==i?this.loop?(this.restart(t),"restart"):(this._needsRemove=!0,"destroy"):null}}},restart:function(t){var e=(t-this._startTime-this._pausedTime)%this._life;this._startTime=t-e+this.gap,this._pausedTime=0,this._needsRemove=!1},fire:function(t,e){this[t="on"+t]&&this[t](this._target,e)},pause:function(){this._paused=!0},resume:function(){this._paused=!1}};var l_=function(){this.head=null,this.tail=null,this._len=0},u_=l_.prototype;u_.insert=function(t){var e=new h_(t);return this.insertEntry(e),e},u_.insertEntry=function(t){this.head?(this.tail.next=t,t.prev=this.tail,t.next=null,this.tail=t):this.head=this.tail=t,this._len++},u_.remove=function(t){var e=t.prev,i=t.next;e?e.next=i:this.head=i,i?i.prev=e:this.tail=e,t.next=t.prev=null,this._len--},u_.len=function(){return this._len},u_.clear=function(){this.head=this.tail=null,this._len=0};var h_=function(t){this.value=t,this.next,this.prev},c_=function(t){this._list=new l_,this._map={},this._maxSize=t||10,this._lastRemovedEntry=null},d_=c_.prototype;d_.put=function(t,e){var i=this._list,n=this._map,o=null;if(null==n[t]){var a=i.len(),r=this._lastRemovedEntry;if(a>=this._maxSize&&a>0){var s=i.head;i.remove(s),delete n[s.key],o=s.value,this._lastRemovedEntry=s}r?r.value=e:r=new h_(e),r.key=t,i.insertEntry(r),n[t]=r}return o},d_.get=function(t){var e=this._map[t],i=this._list;if(null!=e)return e!==i.tail&&(i.remove(e),i.insertEntry(e)),e.value},d_.clear=function(){this._list.clear(),this._map={}};var f_={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]},p_=new c_(20),g_=null,m_=Nt,v_=Ot,y_=(Object.freeze||Object)({parse:At,lift:kt,toHex:Pt,fastLerp:Nt,fastMapToColor:m_,lerp:Ot,mapToColor:v_,modifyHSL:Et,modifyAlpha:zt,stringify:Rt}),x_=Array.prototype.slice,__=function(t,e,i,n){this._tracks={},this._target=t,this._loop=e||!1,this._getter=i||Bt,this._setter=n||Vt,this._clipCount=0,this._delay=0,this._doneList=[],this._onframeList=[],this._clipList=[]};__.prototype={when:function(t,e){var i=this._tracks;for(var n in e)if(e.hasOwnProperty(n)){if(!i[n]){i[n]=[];var o=this._getter(this._target,n);if(null==o)continue;0!==t&&i[n].push({time:0,value:Xt(o)})}i[n].push({time:t,value:e[n]})}return this},during:function(t){return this._onframeList.push(t),this},pause:function(){for(var t=0;t0&&this.animate(t,!1).when(null==n?500:n,a).delay(o||0),this}};var D_=function(t){o_.call(this,t),$x.call(this,t),I_.call(this,t),this.id=t.id||Dx()};D_.prototype={type:"element",name:"",__zr:null,ignore:!1,clipPath:null,isGroup:!1,drift:function(t,e){switch(this.draggable){case"horizontal":e=0;break;case"vertical":t=0}var i=this.transform;i||(i=this.transform=[1,0,0,1,0,0]),i[4]+=t,i[5]+=e,this.decomposeTransform(),this.dirty(!1)},beforeUpdate:function(){},afterUpdate:function(){},update:function(){this.updateTransform()},traverse:function(t,e){},attrKV:function(t,e){if("position"===t||"scale"===t||"origin"===t){if(e){var i=this[t];i||(i=this[t]=[]),i[0]=e[0],i[1]=e[1]}}else this[t]=e},hide:function(){this.ignore=!0,this.__zr&&this.__zr.refresh()},show:function(){this.ignore=!1,this.__zr&&this.__zr.refresh()},attr:function(t,e){if("string"==typeof t)this.attrKV(t,e);else if(w(t))for(var i in t)t.hasOwnProperty(i)&&this.attrKV(i,t[i]);return this.dirty(!1),this},setClipPath:function(t){var e=this.__zr;e&&t.addSelfToZr(e),this.clipPath&&this.clipPath!==t&&this.removeClipPath(),this.clipPath=t,t.__zr=e,t.__clipTarget=this,this.dirty(!1)},removeClipPath:function(){var t=this.clipPath;t&&(t.__zr&&t.removeSelfFromZr(t.__zr),t.__zr=null,t.__clipTarget=null,this.clipPath=null,this.dirty(!1))},addSelfToZr:function(t){this.__zr=t;var e=this.animators;if(e)for(var i=0;i=i.x&&t<=i.x+i.width&&e>=i.y&&e<=i.y+i.height},clone:function(){return new Kt(this.x,this.y,this.width,this.height)},copy:function(t){this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height},plain:function(){return{x:this.x,y:this.y,width:this.width,height:this.height}}},Kt.create=function(t){return new Kt(t.x,t.y,t.width,t.height)};var L_=function(t){t=t||{},D_.call(this,t);for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);this._children=[],this.__storage=null,this.__dirty=!0};L_.prototype={constructor:L_,isGroup:!0,type:"group",silent:!1,children:function(){return this._children.slice()},childAt:function(t){return this._children[t]},childOfName:function(t){for(var e=this._children,i=0;i=0&&(i.splice(n,0,t),this._doAdd(t))}return this},_doAdd:function(t){t.parent&&t.parent.remove(t),t.parent=this;var e=this.__storage,i=this.__zr;e&&e!==t.__storage&&(e.addToStorage(t),t instanceof L_&&t.addChildrenToStorage(e)),i&&i.refresh()},remove:function(t){var e=this.__zr,i=this.__storage,n=this._children,o=l(n,t);return o<0?this:(n.splice(o,1),t.parent=null,i&&(i.delFromStorage(t),t instanceof L_&&t.delChildrenFromStorage(i)),e&&e.refresh(),this)},removeAll:function(){var t,e,i=this._children,n=this.__storage;for(e=0;e=0&&(this.delFromStorage(t),this._roots.splice(o,1),t instanceof L_&&t.delChildrenFromStorage(this))}},addToStorage:function(t){return t&&(t.__storage=this,t.dirty(!1)),this},delFromStorage:function(t){return t&&(t.__storage=null),this},dispose:function(){this._renderList=this._roots=null},displayableSortFunc:re};var O_={shadowBlur:1,shadowOffsetX:1,shadowOffsetY:1,textShadowBlur:1,textShadowOffsetX:1,textShadowOffsetY:1,textBoxShadowBlur:1,textBoxShadowOffsetX:1,textBoxShadowOffsetY:1},E_=function(t,e,i){return O_.hasOwnProperty(e)?i*=t.dpr:i},z_=[["shadowBlur",0],["shadowOffsetX",0],["shadowOffsetY",0],["shadowColor","#000"],["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]],R_=function(t,e){this.extendFrom(t,!1),this.host=e};R_.prototype={constructor:R_,host:null,fill:"#000",stroke:null,opacity:1,lineDash:null,lineDashOffset:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,lineWidth:1,strokeNoScale:!1,text:null,font:null,textFont:null,fontStyle:null,fontWeight:null,fontSize:null,fontFamily:null,textTag:null,textFill:"#000",textStroke:null,textWidth:null,textHeight:null,textStrokeWidth:0,textLineHeight:null,textPosition:"inside",textRect:null,textOffset:null,textAlign:null,textVerticalAlign:null,textDistance:5,textShadowColor:"transparent",textShadowBlur:0,textShadowOffsetX:0,textShadowOffsetY:0,textBoxShadowColor:"transparent",textBoxShadowBlur:0,textBoxShadowOffsetX:0,textBoxShadowOffsetY:0,transformText:!1,textRotation:0,textOrigin:null,textBackgroundColor:null,textBorderColor:null,textBorderWidth:0,textBorderRadius:0,textPadding:null,rich:null,truncate:null,blend:null,bind:function(t,e,i){for(var n=this,o=i&&i.style,a=!o,r=0;r0},extendFrom:function(t,e){if(t)for(var i in t)!t.hasOwnProperty(i)||!0!==e&&(!1===e?this.hasOwnProperty(i):null==t[i])||(this[i]=t[i])},set:function(t,e){"string"==typeof t?this[t]=e:this.extendFrom(t,!0)},clone:function(){var t=new this.constructor;return t.extendFrom(this,!0),t},getGradient:function(t,e,i){for(var n=("radial"===e.type?le:se)(t,e,i),o=e.colorStops,a=0;a=0&&i.splice(n,1),t.__hoverMir=null},clearHover:function(t){for(var e=this._hoverElements,i=0;i15)break}s.__drawIndex=m,s.__drawIndex0&&t>n[0]){for(r=0;rt);r++);a=i[n[r]]}if(n.splice(r+1,0,t),i[t]=e,!e.virtual)if(a){var l=a.dom;l.nextSibling?s.insertBefore(e.dom,l.nextSibling):s.appendChild(e.dom)}else s.firstChild?s.insertBefore(e.dom,s.firstChild):s.appendChild(e.dom)}else M_("Layer of zlevel "+t+" is not valid")},eachLayer:function(t,e){var i,n,o=this._zlevelList;for(n=0;n0?.01:0),this._needsManuallyCompositing),a.__builtin__||M_("ZLevel "+s+" has been used by unkown layer "+a.id),a!==i&&(a.__used=!0,a.__startIndex!==o&&(a.__dirty=!0),a.__startIndex=o,a.incremental?a.__drawIndex=-1:a.__drawIndex=o,e(o),i=a),r.__dirty&&(a.__dirty=!0,a.incremental&&a.__drawIndex<0&&(a.__drawIndex=o))}e(o),this.eachBuiltinLayer(function(t,e){!t.__used&&t.getElementCount()>0&&(t.__dirty=!0,t.__startIndex=t.__endIndex=t.__drawIndex=0),t.__dirty&&t.__drawIndex<0&&(t.__drawIndex=t.__startIndex)})},clear:function(){return this.eachBuiltinLayer(this._clearLayer),this},_clearLayer:function(t){t.clear()},setBackgroundColor:function(t){this._backgroundColor=t},configLayer:function(t,e){if(e){var i=this._layerConfig;i[t]?n(i[t],e,!0):i[t]=e;for(var o=0;o=0&&this._clips.splice(e,1)},removeAnimator:function(t){for(var e=t.getClips(),i=0;i1&&n&&n.length>1){var a=di(n)/di(o);!isFinite(a)&&(a=1),e.pinchScale=a;var r=fi(n);return e.pinchX=r[0],e.pinchY=r[1],{type:"pinch",target:t[0].target,event:e}}}}},hw=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],cw=["touchstart","touchend","touchmove"],dw={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},fw=f(hw,function(t){var e=t.replace("mouse","pointer");return dw[e]?e:t}),pw={mousemove:function(t){t=li(this.dom,t),this.trigger("mousemove",t)},mouseout:function(t){var e=(t=li(this.dom,t)).toElement||t.relatedTarget;if(e!=this.dom)for(;e&&9!=e.nodeType;){if(e===this.dom)return;e=e.parentNode}this.trigger("mouseout",t)},touchstart:function(t){(t=li(this.dom,t)).zrByTouch=!0,this._lastTouchMoment=new Date,gi(this,t,"start"),pw.mousemove.call(this,t),pw.mousedown.call(this,t),mi(this)},touchmove:function(t){(t=li(this.dom,t)).zrByTouch=!0,gi(this,t,"change"),pw.mousemove.call(this,t),mi(this)},touchend:function(t){(t=li(this.dom,t)).zrByTouch=!0,gi(this,t,"end"),pw.mouseup.call(this,t),+new Date-this._lastTouchMoment<300&&pw.click.call(this,t),mi(this)},pointerdown:function(t){pw.mousedown.call(this,t)},pointermove:function(t){vi(t)||pw.mousemove.call(this,t)},pointerup:function(t){pw.mouseup.call(this,t)},pointerout:function(t){vi(t)||pw.mouseout.call(this,t)}};d(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(t){pw[t]=function(e){e=li(this.dom,e),this.trigger(t,e)}});var gw=xi.prototype;gw.dispose=function(){for(var t=hw.concat(cw),e=0;e=0||n&&l(n,r)<0)){var s=e.getShallow(r);null!=s&&(o[t[a][0]]=s)}}return o}},kw=Lw([["lineWidth","width"],["stroke","color"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]),Pw={getLineStyle:function(t){var e=kw(this,t),i=this.getLineDash(e.lineWidth);return i&&(e.lineDash=i),e},getLineDash:function(t){null==t&&(t=1);var e=this.get("type"),i=Math.max(t,2),n=4*t;return"solid"===e||null==e?null:"dashed"===e?[n,n]:[i,i]}},Nw=Lw([["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]]),Ow={getAreaStyle:function(t,e){return Nw(this,t,e)}},Ew=Math.pow,zw=Math.sqrt,Rw=1e-8,Bw=1e-4,Vw=zw(3),Gw=1/3,Fw=V(),Ww=V(),Hw=V(),Zw=Math.min,Uw=Math.max,jw=Math.sin,Xw=Math.cos,Yw=2*Math.PI,qw=V(),$w=V(),Kw=V(),Jw=[],Qw=[],tb={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},eb=[],ib=[],nb=[],ob=[],ab=Math.min,rb=Math.max,sb=Math.cos,lb=Math.sin,ub=Math.sqrt,hb=Math.abs,cb="undefined"!=typeof Float32Array,db=function(t){this._saveData=!t,this._saveData&&(this.data=[]),this._ctx=null};db.prototype={constructor:db,_xi:0,_yi:0,_x0:0,_y0:0,_ux:0,_uy:0,_len:0,_lineDash:null,_dashOffset:0,_dashIdx:0,_dashSum:0,setScale:function(t,e){this._ux=hb(1/b_/t)||0,this._uy=hb(1/b_/e)||0},getContext:function(){return this._ctx},beginPath:function(t){return this._ctx=t,t&&t.beginPath(),t&&(this.dpr=t.dpr),this._saveData&&(this._len=0),this._lineDash&&(this._lineDash=null,this._dashOffset=0),this},moveTo:function(t,e){return this.addData(tb.M,t,e),this._ctx&&this._ctx.moveTo(t,e),this._x0=t,this._y0=e,this._xi=t,this._yi=e,this},lineTo:function(t,e){var i=hb(t-this._xi)>this._ux||hb(e-this._yi)>this._uy||this._len<5;return this.addData(tb.L,t,e),this._ctx&&i&&(this._needsDash()?this._dashedLineTo(t,e):this._ctx.lineTo(t,e)),i&&(this._xi=t,this._yi=e),this},bezierCurveTo:function(t,e,i,n,o,a){return this.addData(tb.C,t,e,i,n,o,a),this._ctx&&(this._needsDash()?this._dashedBezierTo(t,e,i,n,o,a):this._ctx.bezierCurveTo(t,e,i,n,o,a)),this._xi=o,this._yi=a,this},quadraticCurveTo:function(t,e,i,n){return this.addData(tb.Q,t,e,i,n),this._ctx&&(this._needsDash()?this._dashedQuadraticTo(t,e,i,n):this._ctx.quadraticCurveTo(t,e,i,n)),this._xi=i,this._yi=n,this},arc:function(t,e,i,n,o,a){return this.addData(tb.A,t,e,i,i,n,o-n,0,a?0:1),this._ctx&&this._ctx.arc(t,e,i,n,o,a),this._xi=sb(o)*i+t,this._yi=lb(o)*i+t,this},arcTo:function(t,e,i,n,o){return this._ctx&&this._ctx.arcTo(t,e,i,n,o),this},rect:function(t,e,i,n){return this._ctx&&this._ctx.rect(t,e,i,n),this.addData(tb.R,t,e,i,n),this},closePath:function(){this.addData(tb.Z);var t=this._ctx,e=this._x0,i=this._y0;return t&&(this._needsDash()&&this._dashedLineTo(e,i),t.closePath()),this._xi=e,this._yi=i,this},fill:function(t){t&&t.fill(),this.toStatic()},stroke:function(t){t&&t.stroke(),this.toStatic()},setLineDash:function(t){if(t instanceof Array){this._lineDash=t,this._dashIdx=0;for(var e=0,i=0;ie.length&&(this._expandData(),e=this.data);for(var i=0;i0&&f<=t||h<0&&f>=t||0==h&&(c>0&&p<=e||c<0&&p>=e);)f+=h*(i=r[n=this._dashIdx]),p+=c*i,this._dashIdx=(n+1)%g,h>0&&fl||c>0&&pu||s[n%2?"moveTo":"lineTo"](h>=0?ab(f,t):rb(f,t),c>=0?ab(p,e):rb(p,e));h=f-t,c=p-e,this._dashOffset=-ub(h*h+c*c)},_dashedBezierTo:function(t,e,i,n,o,a){var r,s,l,u,h,c=this._dashSum,d=this._dashOffset,f=this._lineDash,p=this._ctx,g=this._xi,m=this._yi,v=Xi,y=0,x=this._dashIdx,_=f.length,w=0;for(d<0&&(d=c+d),d%=c,r=0;r<1;r+=.1)s=v(g,t,i,o,r+.1)-v(g,t,i,o,r),l=v(m,e,n,a,r+.1)-v(m,e,n,a,r),y+=ub(s*s+l*l);for(;x<_&&!((w+=f[x])>d);x++);for(r=(w-d)/y;r<=1;)u=v(g,t,i,o,r),h=v(m,e,n,a,r),x%2?p.moveTo(u,h):p.lineTo(u,h),r+=f[x]/y,x=(x+1)%_;x%2!=0&&p.lineTo(o,a),s=o-u,l=a-h,this._dashOffset=-ub(s*s+l*l)},_dashedQuadraticTo:function(t,e,i,n){var o=i,a=n;i=(i+2*t)/3,n=(n+2*e)/3,t=(this._xi+2*t)/3,e=(this._yi+2*e)/3,this._dashedBezierTo(t,e,i,n,o,a)},toStatic:function(){var t=this.data;t instanceof Array&&(t.length=this._len,cb&&(this.data=new Float32Array(t)))},getBoundingRect:function(){eb[0]=eb[1]=nb[0]=nb[1]=Number.MAX_VALUE,ib[0]=ib[1]=ob[0]=ob[1]=-Number.MAX_VALUE;for(var t=this.data,e=0,i=0,n=0,o=0,a=0;al||hb(r-o)>u||c===h-1)&&(t.lineTo(a,r),n=a,o=r);break;case tb.C:t.bezierCurveTo(s[c++],s[c++],s[c++],s[c++],s[c++],s[c++]),n=s[c-2],o=s[c-1];break;case tb.Q:t.quadraticCurveTo(s[c++],s[c++],s[c++],s[c++]),n=s[c-2],o=s[c-1];break;case tb.A:var f=s[c++],p=s[c++],g=s[c++],m=s[c++],v=s[c++],y=s[c++],x=s[c++],_=s[c++],w=g>m?g:m,b=g>m?1:g/m,S=g>m?m/g:1,M=v+y;Math.abs(g-m)>.001?(t.translate(f,p),t.rotate(x),t.scale(b,S),t.arc(0,0,w,v,M,1-_),t.scale(1/b,1/S),t.rotate(-x),t.translate(-f,-p)):t.arc(f,p,w,v,M,1-_),1==c&&(e=sb(v)*g+f,i=lb(v)*m+p),n=sb(M)*g+f,o=lb(M)*m+p;break;case tb.R:e=n=s[c],i=o=s[c+1],t.rect(s[c++],s[c++],s[c++],s[c++]);break;case tb.Z:t.closePath(),n=e,o=i}}}},db.CMD=tb;var fb=2*Math.PI,pb=2*Math.PI,gb=db.CMD,mb=2*Math.PI,vb=1e-4,yb=[-1,-1,-1],xb=[-1,-1],_b=F_.prototype.getCanvasPattern,wb=Math.abs,bb=new db(!0);In.prototype={constructor:In,type:"path",__dirtyPath:!0,strokeContainThreshold:5,brush:function(t,e){var i=this.style,n=this.path||bb,o=i.hasStroke(),a=i.hasFill(),r=i.fill,s=i.stroke,l=a&&!!r.colorStops,u=o&&!!s.colorStops,h=a&&!!r.image,c=o&&!!s.image;if(i.bind(t,this,e),this.setTransform(t),this.__dirty){var d;l&&(d=d||this.getBoundingRect(),this._fillGradient=i.getGradient(t,r,d)),u&&(d=d||this.getBoundingRect(),this._strokeGradient=i.getGradient(t,s,d))}l?t.fillStyle=this._fillGradient:h&&(t.fillStyle=_b.call(r,t)),u?t.strokeStyle=this._strokeGradient:c&&(t.strokeStyle=_b.call(s,t));var f=i.lineDash,p=i.lineDashOffset,g=!!t.setLineDash,m=this.getGlobalScale();n.setScale(m[0],m[1]),this.__dirtyPath||f&&!g&&o?(n.beginPath(t),f&&!g&&(n.setLineDash(f),n.setLineDashOffset(p)),this.buildPath(n,this.shape,!1),this.path&&(this.__dirtyPath=!1)):(t.beginPath(),this.path.rebuildPath(t)),a&&n.fill(t),f&&g&&(t.setLineDash(f),t.lineDashOffset=p),o&&n.stroke(t),f&&g&&t.setLineDash([]),null!=i.text&&(this.restoreTransform(t),this.drawRectText(t,this.getBoundingRect()))},buildPath:function(t,e,i){},createPathProxy:function(){this.path=new db},getBoundingRect:function(){var t=this._rect,e=this.style,i=!t;if(i){var n=this.path;n||(n=this.path=new db),this.__dirtyPath&&(n.beginPath(),this.buildPath(n,this.shape,!1)),t=n.getBoundingRect()}if(this._rect=t,e.hasStroke()){var o=this._rectWithStroke||(this._rectWithStroke=t.clone());if(this.__dirty||i){o.copy(t);var a=e.lineWidth,r=e.strokeNoScale?this.getLineScale():1;e.hasFill()||(a=Math.max(a,this.strokeContainThreshold||4)),r>1e-10&&(o.width+=a/r,o.height+=a/r,o.x-=a/r/2,o.y-=a/r/2)}return o}return t},contain:function(t,e){var i=this.transformCoordToLocal(t,e),n=this.getBoundingRect(),o=this.style;if(t=i[0],e=i[1],n.contain(t,e)){var a=this.path.data;if(o.hasStroke()){var r=o.lineWidth,s=o.strokeNoScale?this.getLineScale():1;if(s>1e-10&&(o.hasFill()||(r=Math.max(r,this.strokeContainThreshold)),Mn(a,r/s,t,e)))return!0}if(o.hasFill())return Sn(a,t,e)}return!1},dirty:function(t){null==t&&(t=!0),t&&(this.__dirtyPath=t,this._rect=null),this.__dirty=!0,this.__zr&&this.__zr.refresh(),this.__clipTarget&&this.__clipTarget.dirty()},animateShape:function(t){return this.animate("shape",t)},attrKV:function(t,e){"shape"===t?(this.setShape(e),this.__dirtyPath=!0,this._rect=null):Ke.prototype.attrKV.call(this,t,e)},setShape:function(t,e){var i=this.shape;if(i){if(w(t))for(var n in t)t.hasOwnProperty(n)&&(i[n]=t[n]);else i[t]=e;this.dirty(!0)}return this},getLineScale:function(){var t=this.transform;return t&&wb(t[0]-1)>1e-10&&wb(t[3]-1)>1e-10?Math.sqrt(wb(t[0]*t[3]-t[2]*t[1])):1}},In.extend=function(t){var e=function(e){In.call(this,e),t.style&&this.style.extendFrom(t.style,!1);var i=t.shape;if(i){this.shape=this.shape||{};var n=this.shape;for(var o in i)!n.hasOwnProperty(o)&&i.hasOwnProperty(o)&&(n[o]=i[o])}t.init&&t.init.call(this,e)};u(e,In);for(var i in t)"style"!==i&&"shape"!==i&&(e.prototype[i]=t[i]);return e},u(In,Ke);var Sb=db.CMD,Mb=[[],[],[]],Ib=Math.sqrt,Db=Math.atan2,Tb=function(t,e){var i,n,o,a,r,s,l=t.data,u=Sb.M,h=Sb.C,c=Sb.L,d=Sb.R,f=Sb.A,p=Sb.Q;for(o=0,a=0;o=11?function(){var e,i=this.__clipPaths,n=this.style;if(i)for(var o=0;oi-2?i-1:c+1],u=t[c>i-3?i-1:c+2]);var p=d*d,g=d*p;n.push([kn(s[0],f[0],l[0],u[0],d,p,g),kn(s[1],f[1],l[1],u[1],d,p,g)])}return n},Hb=function(t,e,i,n){var o,a,r,s,l=[],u=[],h=[],c=[];if(n){r=[1/0,1/0],s=[-1/0,-1/0];for(var d=0,f=t.length;d=i&&a>=o)return{x:i,y:o,width:n-i,height:a-o}},createIcon:_o,Group:L_,Image:Je,Text:zb,Circle:Rb,Sector:Gb,Ring:Fb,Polygon:Zb,Polyline:Ub,Rect:jb,Line:Xb,BezierCurve:qb,Arc:$b,IncrementalDisplayable:On,CompoundPath:Kb,LinearGradient:Qb,RadialGradient:tS,BoundingRect:Kt}),lS=["textStyle","color"],uS={getTextColor:function(t){var e=this.ecModel;return this.getShallow("color")||(!t&&e?e.get(lS):null)},getFont:function(){return ho({fontStyle:this.getShallow("fontStyle"),fontWeight:this.getShallow("fontWeight"),fontSize:this.getShallow("fontSize"),fontFamily:this.getShallow("fontFamily")},this.ecModel)},getTextRect:function(t){return me(t,this.getFont(),this.getShallow("align"),this.getShallow("verticalAlign")||this.getShallow("baseline"),this.getShallow("padding"),this.getShallow("rich"),this.getShallow("truncateText"))}},hS=Lw([["fill","color"],["stroke","borderColor"],["lineWidth","borderWidth"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["textPosition"],["textAlign"]]),cS={getItemStyle:function(t,e){var i=hS(this,t,e),n=this.getBorderLineDash();return n&&(i.lineDash=n),i},getBorderLineDash:function(){var t=this.get("borderType");return"solid"===t||null==t?null:"dashed"===t?[5,5]:[1,1]}},dS=h,fS=Ni();wo.prototype={constructor:wo,init:null,mergeOption:function(t){n(this.option,t,!0)},get:function(t,e){return null==t?this.option:bo(this.option,this.parsePath(t),!e&&So(this,t))},getShallow:function(t,e){var i=this.option,n=null==i?i:i[t],o=!e&&So(this,t);return null==n&&o&&(n=o.getShallow(t)),n},getModel:function(t,e){var i,n=null==t?this.option:bo(this.option,t=this.parsePath(t));return e=e||(i=So(this,t))&&i.getModel(t),new wo(n,e,this.ecModel)},isEmpty:function(){return null==this.option},restoreData:function(){},clone:function(){return new(0,this.constructor)(i(this.option))},setReadOnly:function(t){},parsePath:function(t){return"string"==typeof t&&(t=t.split(".")),t},customizeGetParent:function(t){fS(this).getParent=t},isAnimationEnabled:function(){if(!Ax.node){if(null!=this.option.animation)return!!this.option.animation;if(this.parentModel)return this.parentModel.isAnimationEnabled()}}},Gi(wo),Fi(wo),dS(wo,Pw),dS(wo,Ow),dS(wo,uS),dS(wo,cS);var pS=0,gS=1e-4,mS=9007199254740991,vS=/^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d\d)(?::(\d\d)(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/,yS=(Object.freeze||Object)({linearMap:Do,parsePercent:To,round:Ao,asc:Co,getPrecision:Lo,getPrecisionSafe:ko,getPixelPrecision:Po,getPercentWithPrecision:No,MAX_SAFE_INTEGER:mS,remRadian:Oo,isRadianAroundZero:Eo,parseDate:zo,quantity:Ro,nice:Vo,reformIntervals:Go,isNumeric:Fo}),xS=L,_S=["a","b","c","d","e","f","g"],wS=function(t,e){return"{"+t+(null==e?"":e)+"}"},bS=be,SS=me,MS=(Object.freeze||Object)({addCommas:Wo,toCamelCase:Ho,normalizeCssArray:xS,encodeHTML:Zo,formatTpl:Uo,formatTplSimple:jo,getTooltipMarker:Xo,formatTime:qo,capitalFirst:$o,truncateText:bS,getTextRect:SS}),IS=d,DS=["left","right","top","bottom","width","height"],TS=[["width","left","right"],["height","top","bottom"]],AS=Ko,CS=(v(Ko,"vertical"),v(Ko,"horizontal"),{getBoxLayoutParams:function(){return{left:this.get("left"),top:this.get("top"),right:this.get("right"),bottom:this.get("bottom"),width:this.get("width"),height:this.get("height")}}}),LS=Ni(),kS=wo.extend({type:"component",id:"",name:"",mainType:"",subType:"",componentIndex:0,defaultOption:null,ecModel:null,dependentModels:[],uid:null,layoutMode:null,$constructor:function(t,e,i,n){wo.call(this,t,e,i,n),this.uid=Mo("ec_cpt_model")},init:function(t,e,i,n){this.mergeDefaultAndTheme(t,i)},mergeDefaultAndTheme:function(t,e){var i=this.layoutMode,o=i?na(t):{};n(t,e.getTheme().get(this.mainType)),n(t,this.getDefaultOption()),i&&ia(t,o,i)},mergeOption:function(t,e){n(this.option,t,!0);var i=this.layoutMode;i&&ia(this.option,t,i)},optionUpdated:function(t,e){},getDefaultOption:function(){var t=LS(this);if(!t.defaultOption){for(var e=[],i=this.constructor;i;){var o=i.prototype.defaultOption;o&&e.push(o),i=i.superClass}for(var a={},r=e.length-1;r>=0;r--)a=n(a,e[r],!0);t.defaultOption=a}return t.defaultOption},getReferringComponents:function(t){return this.ecModel.queryComponents({mainType:t,index:this.get(t+"Index",!0),id:this.get(t+"Id",!0)})}});Zi(kS,{registerWhenExtend:!0}),function(t){var e={};t.registerSubTypeDefaulter=function(t,i){t=Bi(t),e[t.main]=i},t.determineSubType=function(i,n){var o=n.type;if(!o){var a=Bi(i).main;t.hasSubTypes(i)&&e[a]&&(o=e[a](n))}return o}}(kS),function(t,e){function i(t){var i={},a=[];return d(t,function(r){var s=n(i,r),u=o(s.originalDeps=e(r),t);s.entryCount=u.length,0===s.entryCount&&a.push(r),d(u,function(t){l(s.predecessor,t)<0&&s.predecessor.push(t);var e=n(i,t);l(e.successor,t)<0&&e.successor.push(r)})}),{graph:i,noEntryList:a}}function n(t,e){return t[e]||(t[e]={predecessor:[],successor:[]}),t[e]}function o(t,e){var i=[];return d(t,function(t){l(e,t)>=0&&i.push(t)}),i}t.topologicalTravel=function(t,e,n,o){function a(t){s[t].entryCount--,0===s[t].entryCount&&l.push(t)}if(t.length){var r=i(e),s=r.graph,l=r.noEntryList,u={};for(d(t,function(t){u[t]=!0});l.length;){var h=l.pop(),c=s[h],f=!!u[h];f&&(n.call(o,h,c.originalDeps.slice()),delete u[h]),d(c.successor,f?function(t){u[t]=!0,a(t)}:a)}d(u,function(){throw new Error("Circle dependency may exists")})}}}(kS,function(t){var e=[];return d(kS.getClassesByMainType(t),function(t){e=e.concat(t.prototype.dependencies||[])}),e=f(e,function(t){return Bi(t).main}),"dataset"!==t&&l(e,"dataset")<=0&&e.unshift("dataset"),e}),h(kS,CS);var PS="";"undefined"!=typeof navigator&&(PS=navigator.platform||"");var NS={color:["#c23531","#2f4554","#61a0a8","#d48265","#91c7ae","#749f83","#ca8622","#bda29a","#6e7074","#546570","#c4ccd3"],gradientColor:["#f6efa6","#d88273","#bf444c"],textStyle:{fontFamily:PS.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,animation:"auto",animationDuration:1e3,animationDurationUpdate:300,animationEasing:"exponentialOut",animationEasingUpdate:"cubicOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1},OS=Ni(),ES={clearColorPalette:function(){OS(this).colorIdx=0,OS(this).colorNameMap={}},getColorFromPalette:function(t,e,i){var n=OS(e=e||this),o=n.colorIdx||0,a=n.colorNameMap=n.colorNameMap||{};if(a.hasOwnProperty(t))return a[t];var r=Si(this.get("color",!0)),s=this.get("colorLayer",!0),l=null!=i&&s?aa(s,i):r;if((l=l||r)&&l.length){var u=l[o];return t&&(a[t]=u),n.colorIdx=(o+1)%l.length,u}}},zS={cartesian2d:function(t,e,i,n){var o=t.getReferringComponents("xAxis")[0],a=t.getReferringComponents("yAxis")[0];e.coordSysDims=["x","y"],i.set("x",o),i.set("y",a),sa(o)&&(n.set("x",o),e.firstCategoryDimIndex=0),sa(a)&&(n.set("y",a),e.firstCategoryDimIndex=1)},singleAxis:function(t,e,i,n){var o=t.getReferringComponents("singleAxis")[0];e.coordSysDims=["single"],i.set("single",o),sa(o)&&(n.set("single",o),e.firstCategoryDimIndex=0)},polar:function(t,e,i,n){var o=t.getReferringComponents("polar")[0],a=o.findAxisModel("radiusAxis"),r=o.findAxisModel("angleAxis");e.coordSysDims=["radius","angle"],i.set("radius",a),i.set("angle",r),sa(a)&&(n.set("radius",a),e.firstCategoryDimIndex=0),sa(r)&&(n.set("angle",r),e.firstCategoryDimIndex=1)},geo:function(t,e,i,n){e.coordSysDims=["lng","lat"]},parallel:function(t,e,i,n){var o=t.ecModel,a=o.getComponent("parallel",t.get("parallelIndex")),r=e.coordSysDims=a.dimensions.slice();d(a.parallelAxisIndex,function(t,a){var s=o.getComponent("parallelAxis",t),l=r[a];i.set(l,s),sa(s)&&null==e.firstCategoryDimIndex&&(n.set(l,s),e.firstCategoryDimIndex=a)})}},RS="original",BS="arrayRows",VS="objectRows",GS="keyedColumns",FS="unknown",WS="typedArray",HS="column",ZS="row";la.seriesDataToSource=function(t){return new la({data:t,sourceFormat:S(t)?WS:RS,fromDataset:!1})},Fi(la);var US=Ni(),jS="\0_ec_inner",XS=wo.extend({constructor:XS,init:function(t,e,i,n){i=i||{},this.option=null,this._theme=new wo(i),this._optionManager=n},setOption:function(t,e){k(!(jS in t),"please use chart.getOption()"),this._optionManager.setOption(t,e),this.resetOption(null)},resetOption:function(t){var e=!1,i=this._optionManager;if(!t||"recreate"===t){var n=i.mountOption("recreate"===t);this.option&&"recreate"!==t?(this.restoreData(),this.mergeOption(n)):Sa.call(this,n),e=!0}if("timeline"!==t&&"media"!==t||this.restoreData(),!t||"recreate"===t||"timeline"===t){var o=i.getTimelineOption(this);o&&(this.mergeOption(o),e=!0)}if(!t||"recreate"===t||"media"===t){var a=i.getMediaOption(this,this._api);a.length&&d(a,function(t){this.mergeOption(t,e=!0)},this)}return e},mergeOption:function(t){var e=this.option,o=this._componentsMap,r=[];ca(this),d(t,function(t,o){null!=t&&(kS.hasClass(o)?o&&r.push(o):e[o]=null==e[o]?i(t):n(e[o],t,!0))}),kS.topologicalTravel(r,kS.getAllClassMainTypes(),function(i,n){var r=Si(t[i]),s=Ti(o.get(i),r);Ai(s),d(s,function(t,e){var n=t.option;w(n)&&(t.keyInfo.mainType=i,t.keyInfo.subType=Ia(i,n,t.exist))});var l=Ma(o,n);e[i]=[],o.set(i,[]),d(s,function(t,n){var r=t.exist,s=t.option;if(k(w(s)||r,"Empty bootstrap definition"),s){var u=kS.getClass(i,t.keyInfo.subType,!0);if(r&&r instanceof u)r.name=t.keyInfo.name,r.mergeOption(s,this),r.optionUpdated(s,!1);else{var h=a({dependentModels:l,componentIndex:n},t.keyInfo);a(r=new u(s,this,this,h),h),r.init(s,this,this,h),r.optionUpdated(null,!0)}}else r.mergeOption({},this),r.optionUpdated({},!1);o.get(i)[n]=r,e[i][n]=r.option},this),"series"===i&&Da(this,o.get("series"))},this),this._seriesIndicesMap=z(this._seriesIndices=this._seriesIndices||[])},getOption:function(){var t=i(this.option);return d(t,function(e,i){if(kS.hasClass(i)){for(var n=(e=Si(e)).length-1;n>=0;n--)Li(e[n])&&e.splice(n,1);t[i]=e}}),delete t[jS],t},getTheme:function(){return this._theme},getComponent:function(t,e){var i=this._componentsMap.get(t);if(i)return i[e||0]},queryComponents:function(t){var e=t.mainType;if(!e)return[];var i=t.index,n=t.id,o=t.name,a=this._componentsMap.get(e);if(!a||!a.length)return[];var r;if(null!=i)y(i)||(i=[i]),r=g(f(i,function(t){return a[t]}),function(t){return!!t});else if(null!=n){var s=y(n);r=g(a,function(t){return s&&l(n,t.id)>=0||!s&&t.id===n})}else if(null!=o){var u=y(o);r=g(a,function(t){return u&&l(o,t.name)>=0||!u&&t.name===o})}else r=a.slice();return Ta(r,t)},findComponents:function(t){var e=t.query,i=t.mainType,n=function(t){var e=i+"Index",n=i+"Id",o=i+"Name";return!t||null==t[e]&&null==t[n]&&null==t[o]?null:{mainType:i,index:t[e],id:t[n],name:t[o]}}(e);return function(e){return t.filter?g(e,t.filter):e}(Ta(n?this.queryComponents(n):this._componentsMap.get(i),t))},eachComponent:function(t,e,i){var n=this._componentsMap;"function"==typeof t?(i=e,e=t,n.each(function(t,n){d(t,function(t,o){e.call(i,n,t,o)})})):_(t)?d(n.get(t),e,i):w(t)&&d(this.findComponents(t),e,i)},getSeriesByName:function(t){return g(this._componentsMap.get("series"),function(e){return e.name===t})},getSeriesByIndex:function(t){return this._componentsMap.get("series")[t]},getSeriesByType:function(t){return g(this._componentsMap.get("series"),function(e){return e.subType===t})},getSeries:function(){return this._componentsMap.get("series").slice()},getSeriesCount:function(){return this._componentsMap.get("series").length},eachSeries:function(t,e){d(this._seriesIndices,function(i){var n=this._componentsMap.get("series")[i];t.call(e,n,i)},this)},eachRawSeries:function(t,e){d(this._componentsMap.get("series"),t,e)},eachSeriesByType:function(t,e,i){d(this._seriesIndices,function(n){var o=this._componentsMap.get("series")[n];o.subType===t&&e.call(i,o,n)},this)},eachRawSeriesByType:function(t,e,i){return d(this.getSeriesByType(t),e,i)},isSeriesFiltered:function(t){return null==this._seriesIndicesMap.get(t.componentIndex)},getCurrentSeriesIndices:function(){return(this._seriesIndices||[]).slice()},filterSeries:function(t,e){Da(this,g(this._componentsMap.get("series"),t,e))},restoreData:function(t){var e=this._componentsMap;Da(this,e.get("series"));var i=[];e.each(function(t,e){i.push(e)}),kS.topologicalTravel(i,kS.getAllClassMainTypes(),function(i,n){d(e.get(i),function(e){("series"!==i||!wa(e,t))&&e.restoreData()})})}});h(XS,ES);var YS=["getDom","getZr","getWidth","getHeight","getDevicePixelRatio","dispatchAction","isDisposed","on","off","getDataURL","getConnectedDataURL","getModel","getOption","getViewOfComponentModel","getViewOfSeriesModel"],qS={};Ca.prototype={constructor:Ca,create:function(t,e){var i=[];d(qS,function(n,o){var a=n.create(t,e);i=i.concat(a||[])}),this._coordinateSystems=i},update:function(t,e){d(this._coordinateSystems,function(i){i.update&&i.update(t,e)})},getCoordinateSystems:function(){return this._coordinateSystems.slice()}},Ca.register=function(t,e){qS[t]=e},Ca.get=function(t){return qS[t]};var $S=d,KS=i,JS=f,QS=n,tM=/^(min|max)?(.+)$/;La.prototype={constructor:La,setOption:function(t,e){t&&d(Si(t.series),function(t){t&&t.data&&S(t.data)&&N(t.data)}),t=KS(t,!0);var i=this._optionBackup,n=ka.call(this,t,e,!i);this._newBaseOption=n.baseOption,i?(Ea(i.baseOption,n.baseOption),n.timelineOptions.length&&(i.timelineOptions=n.timelineOptions),n.mediaList.length&&(i.mediaList=n.mediaList),n.mediaDefault&&(i.mediaDefault=n.mediaDefault)):this._optionBackup=n},mountOption:function(t){var e=this._optionBackup;return this._timelineOptions=JS(e.timelineOptions,KS),this._mediaList=JS(e.mediaList,KS),this._mediaDefault=KS(e.mediaDefault),this._currentMediaIndices=[],KS(t?e.baseOption:this._newBaseOption)},getTimelineOption:function(t){var e,i=this._timelineOptions;if(i.length){var n=t.getComponent("timeline");n&&(e=KS(i[n.getCurrentIndex()],!0))}return e},getMediaOption:function(t){var e=this._api.getWidth(),i=this._api.getHeight(),n=this._mediaList,o=this._mediaDefault,a=[],r=[];if(!n.length&&!o)return r;for(var s=0,l=n.length;s1||l&&!r?function(i){function n(t,i){var n=o.getDimensionInfo(i);if(n&&!1!==n.otherDims.tooltip){var a=n.type,l=Xo({color:u,type:"subItem"}),h=(r?l+Zo(n.displayName||"-")+": ":"")+Zo("ordinal"===a?t+"":"time"===a?e?"":qo("yyyy/MM/dd hh:mm:ss",t):Wo(t));h&&s.push(h)}}var r=p(i,function(t,e,i){var n=o.getDimensionInfo(i);return t|=n&&!1!==n.tooltip&&null!=n.displayName},0),s=[];return a.length?d(a,function(e){n(er(o,t,e),e)}):d(i,n),(r?"
":"")+s.join(r?"
":", ")}(s):n(r?er(o,t,a[0]):l?s[0]:s),c=Xo(u),f=o.getName(t),g=this.name;return Ci(this)||(g=""),g=g?Zo(g)+(e?": ":"
"):"",e?c+g+h:g+c+(f?Zo(f)+": "+h:h)},isAnimationEnabled:function(){if(Ax.node)return!1;var t=this.getShallow("animation");return t&&this.getData().count()>this.getShallow("animationThreshold")&&(t=!1),t},restoreData:function(){this.dataTask.dirty()},getColorFromPalette:function(t,e,i){var n=this.ecModel,o=ES.getColorFromPalette.call(this,t,e,i);return o||(o=n.getColorFromPalette(t,e,i)),o},coordDimToDataDim:function(t){return this.getRawData().mapDimension(t,!0)},getProgressive:function(){return this.get("progressive")},getProgressiveThreshold:function(){return this.get("progressiveThreshold")},getAxisTooltipData:null,getTooltipPosition:null,pipeTask:null,preventIncremental:null,pipelineContext:null});h(mM,fM),h(mM,ES);var vM=function(){this.group=new L_,this.uid=Mo("viewComponent")};vM.prototype={constructor:vM,init:function(t,e){},render:function(t,e,i,n){},dispose:function(){}};var yM=vM.prototype;yM.updateView=yM.updateLayout=yM.updateVisual=function(t,e,i,n){},Gi(vM),Zi(vM,{registerWhenExtend:!0});var xM=function(){var t=Ni();return function(e){var i=t(e),n=e.pipelineContext,o=i.large,a=i.canProgressiveRender,r=i.large=n.large,s=i.canProgressiveRender=n.canProgressiveRender;return!!(o^r||a^s)&&"reset"}},_M=Ni(),wM=xM();pr.prototype={type:"chart",init:function(t,e){},render:function(t,e,i,n){},highlight:function(t,e,i,n){mr(t.getData(),n,"emphasis")},downplay:function(t,e,i,n){mr(t.getData(),n,"normal")},remove:function(t,e){this.group.removeAll()},dispose:function(){},incrementalPrepareRender:null,incrementalRender:null,updateTransform:null};var bM=pr.prototype;bM.updateView=bM.updateLayout=bM.updateVisual=function(t,e,i,n){this.render(t,e,i,n)},Gi(pr),Zi(pr,{registerWhenExtend:!0}),pr.markUpdateMethod=function(t,e){_M(t).updateMethod=e};var SM={incrementalPrepareRender:{progress:function(t,e){e.view.incrementalRender(t,e.model,e.ecModel,e.api,e.payload)}},render:{forceFirstProgress:!0,progress:function(t,e){e.view.render(e.model,e.ecModel,e.api,e.payload)}}},MM="\0__throttleOriginMethod",IM="\0__throttleRate",DM="\0__throttleType",TM={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var i=t.getData(),n=(t.visualColorAccessPath||"itemStyle.color").split("."),o=t.get(n)||t.getColorFromPalette(t.name,null,e.getSeriesCount());if(i.setVisual("color",o),!e.isSeriesFiltered(t)){"function"!=typeof o||o instanceof Jb||i.each(function(e){i.setItemVisual(e,"color",o(t.getDataParams(e)))});return{dataEach:i.hasItemOption?function(t,e){var i=t.getItemModel(e).get(n,!0);null!=i&&t.setItemVisual(e,"color",i)}:null}}}},AM={toolbox:{brush:{title:{rect:"Box Select",polygon:"Lasso Select",lineX:"Horizontally Select",lineY:"Vertically Select",keep:"Keep Selections",clear:"Clear Selections"}},dataView:{title:"Data View",lang:["Data View","Close","Refresh"]},dataZoom:{title:{zoom:"Zoom",back:"Zoom Reset"}},magicType:{title:{line:"Switch to Line Chart",bar:"Switch to Bar Chart",stack:"Stack",tiled:"Tile"}},restore:{title:"Restore"},saveAsImage:{title:"Save as Image",lang:["Right Click to Save Image"]}}},CM=function(t,e){function i(t,e){if("string"!=typeof t)return t;var i=t;return d(e,function(t,e){i=i.replace(new RegExp("\\{\\s*"+e+"\\s*\\}","g"),t)}),i}function n(t){var e=a.get(t);if(null==e){for(var i=t.split("."),n=AM.aria,o=0;o1?"series.multiple.prefix":"series.single.prefix"),{seriesCount:r}),e.eachSeries(function(t,e){if(e1?"multiple":"single")+".";a=i(a=n(s?u+"withName":u+"withoutName"),{seriesId:t.seriesIndex,seriesName:t.get("name"),seriesType:o(t.subType)});var c=t.getData();window.data=c,c.count()>l?a+=i(n("data.partialData"),{displayCnt:l}):a+=n("data.allData");for(var d=[],p=0;pi.bockIndex?i.step:null}}},kM.getPipeline=function(t){return this._pipelineMap.get(t)},kM.updateStreamModes=function(t,e){var i=this._pipelineMap.get(t.uid),n=t.getData().count(),o=i.progressiveEnabled&&e.incrementalPrepareRender&&n>=i.threshold,a=t.get("large")&&n>=t.get("largeThreshold");t.pipelineContext=i.context={canProgressiveRender:o,large:a}},kM.restorePipelines=function(t){var e=this,i=e._pipelineMap=z();t.eachSeries(function(t){var n=t.getProgressive(),o=t.uid;i.set(o,{id:o,head:null,tail:null,threshold:t.getProgressiveThreshold(),progressiveEnabled:n&&!(t.preventIncremental&&t.preventIncremental()),bockIndex:-1,step:n||700,count:0}),Or(e,t,t.dataTask)})},kM.prepareStageTasks=function(){var t=this._stageTaskMap,e=this.ecInstance.getModel(),i=this.api;d([this._dataProcessorHandlers,this._visualHandlers],function(n){d(n,function(n){var o=t.get(n.uid)||t.set(n.uid,[]);n.reset&&Mr(this,n,o,e,i),n.overallReset&&Ir(this,n,o,e,i)},this)},this)},kM.prepareView=function(t,e,i,n){var o=t.renderTask,a=o.context;a.model=e,a.ecModel=i,a.api=n,o.__block=!t.incrementalPrepareRender,Or(this,e,o)},kM.performDataProcessorTasks=function(t,e){Sr(this,this._dataProcessorHandlers,t,e,{block:!0})},kM.performVisualTasks=function(t,e,i){Sr(this,this._visualHandlers,t,e,i)},kM.performSeriesTasks=function(t){var e;t.eachSeries(function(t){e|=t.dataTask.perform()}),this.unfinished|=e},kM.plan=function(){this._pipelineMap.each(function(t){var e=t.tail;do{if(e.__block){t.bockIndex=e.__idxInPipeline;break}e=e.getUpstream()}while(e)})};var PM=kM.updatePayload=function(t,e){"remain"!==e&&(t.context.payload=e)};br.wrapStageHandler=function(t,e){return x(t)&&(t={overallReset:t,seriesType:Er(t)}),t.uid=Mo("stageHandler"),e&&(t.visualType=e),t};var NM,OM={},EM={};zr(OM,XS),zr(EM,Aa),OM.eachSeriesByType=OM.eachRawSeriesByType=function(t){NM=t},OM.eachComponent=function(t){"series"===t.mainType&&t.subType&&(NM=t.subType)};var zM=["#37A2DA","#32C5E9","#67E0E3","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#E062AE","#E690D1","#e7bcf3","#9d96f5","#8378EA","#96BFFF"],RM={color:zM,colorLayer:[["#37A2DA","#ffd85c","#fd7b5f"],["#37A2DA","#67E0E3","#FFDB5C","#ff9f7f","#E062AE","#9d96f5"],["#37A2DA","#32C5E9","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#e7bcf3","#8378EA","#96BFFF"],zM]},BM=["#dd6b66","#759aa0","#e69d87","#8dc1a9","#ea7e53","#eedd78","#73a373","#73b9bc","#7289ab","#91ca8c","#f49f42"],VM={color:BM,backgroundColor:"#333",tooltip:{axisPointer:{lineStyle:{color:"#eee"},crossStyle:{color:"#eee"}}},legend:{textStyle:{color:"#eee"}},textStyle:{color:"#eee"},title:{textStyle:{color:"#eee"}},toolbox:{iconStyle:{normal:{borderColor:"#eee"}}},dataZoom:{textStyle:{color:"#eee"}},visualMap:{textStyle:{color:"#eee"}},timeline:{lineStyle:{color:"#eee"},itemStyle:{normal:{color:BM[1]}},label:{normal:{textStyle:{color:"#eee"}}},controlStyle:{normal:{color:"#eee",borderColor:"#eee"}}},timeAxis:{axisLine:{lineStyle:{color:"#eee"}},axisTick:{lineStyle:{color:"#eee"}},axisLabel:{textStyle:{color:"#eee"}},splitLine:{lineStyle:{type:"dashed",color:"#aaa"}},splitArea:{areaStyle:{color:"#eee"}}},logAxis:{axisLine:{lineStyle:{color:"#eee"}},axisTick:{lineStyle:{color:"#eee"}},axisLabel:{textStyle:{color:"#eee"}},splitLine:{lineStyle:{type:"dashed",color:"#aaa"}},splitArea:{areaStyle:{color:"#eee"}}},valueAxis:{axisLine:{lineStyle:{color:"#eee"}},axisTick:{lineStyle:{color:"#eee"}},axisLabel:{textStyle:{color:"#eee"}},splitLine:{lineStyle:{type:"dashed",color:"#aaa"}},splitArea:{areaStyle:{color:"#eee"}}},categoryAxis:{axisLine:{lineStyle:{color:"#eee"}},axisTick:{lineStyle:{color:"#eee"}},axisLabel:{textStyle:{color:"#eee"}},splitLine:{lineStyle:{type:"dashed",color:"#aaa"}},splitArea:{areaStyle:{color:"#eee"}}},line:{symbol:"circle"},graph:{color:BM},gauge:{title:{textStyle:{color:"#eee"}}},candlestick:{itemStyle:{normal:{color:"#FD1050",color0:"#0CF49B",borderColor:"#FD1050",borderColor0:"#0CF49B"}}}};VM.categoryAxis.splitLine.show=!1;var GM=k,FM=d,WM=x,HM=w,ZM=kS.parseClassType,UM={zrender:"4.0.3"},jM=1e3,XM=1e3,YM=3e3,qM={PROCESSOR:{FILTER:jM,STATISTIC:5e3},VISUAL:{LAYOUT:XM,GLOBAL:2e3,CHART:YM,COMPONENT:4e3,BRUSH:5e3}},$M="__flagInMainProcess",KM="__optionUpdated",JM=/^[a-zA-Z0-9_]+$/;Br.prototype.on=Rr("on"),Br.prototype.off=Rr("off"),Br.prototype.one=Rr("one"),h(Br,$x);var QM=Vr.prototype;QM._onframe=function(){if(!this._disposed){var t=this._scheduler;if(this[KM]){var e=this[KM].silent;this[$M]=!0,Fr(this),tI.update.call(this),this[$M]=!1,this[KM]=!1,Ur.call(this,e),jr.call(this,e)}else if(t.unfinished){var i=1,n=this._model;this._api;t.unfinished=!1;do{var o=+new Date;t.performSeriesTasks(n),t.performDataProcessorTasks(n),Hr(this,n),t.performVisualTasks(n),Jr(this,this._model,0,"remain"),i-=+new Date-o}while(i>0&&t.unfinished);t.unfinished||this._zr.flush()}}},QM.getDom=function(){return this._dom},QM.getZr=function(){return this._zr},QM.setOption=function(t,e,i){var n;if(HM(e)&&(i=e.lazyUpdate,n=e.silent,e=e.notMerge),this[$M]=!0,!this._model||e){var o=new La(this._api),a=this._theme,r=this._model=new XS(null,null,a,o);r.scheduler=this._scheduler,r.init(null,null,a,o)}this._model.setOption(t,aI),i?(this[KM]={silent:n},this[$M]=!1):(Fr(this),tI.update.call(this),this._zr.flush(),this[KM]=!1,this[$M]=!1,Ur.call(this,n),jr.call(this,n))},QM.setTheme=function(){console.log("ECharts#setTheme() is DEPRECATED in ECharts 3.0")},QM.getModel=function(){return this._model},QM.getOption=function(){return this._model&&this._model.getOption()},QM.getWidth=function(){return this._zr.getWidth()},QM.getHeight=function(){return this._zr.getHeight()},QM.getDevicePixelRatio=function(){return this._zr.painter.dpr||window.devicePixelRatio||1},QM.getRenderedCanvas=function(t){if(Ax.canvasSupported)return(t=t||{}).pixelRatio=t.pixelRatio||1,t.backgroundColor=t.backgroundColor||this._model.get("backgroundColor"),this._zr.painter.getRenderedCanvas(t)},QM.getSvgDataUrl=function(){if(Ax.svgSupported){var t=this._zr;return d(t.storage.getDisplayList(),function(t){t.stopAnimation(!0)}),t.painter.pathToDataUrl()}},QM.getDataURL=function(t){var e=(t=t||{}).excludeComponents,i=this._model,n=[],o=this;FM(e,function(t){i.eachComponent({mainType:t},function(t){var e=o._componentsMap[t.__viewId];e.group.ignore||(n.push(e),e.group.ignore=!0)})});var a="svg"===this._zr.painter.getType()?this.getSvgDataUrl():this.getRenderedCanvas(t).toDataURL("image/"+(t&&t.type||"png"));return FM(n,function(t){t.group.ignore=!1}),a},QM.getConnectedDataURL=function(t){if(Ax.canvasSupported){var e=this.group,n=Math.min,o=Math.max;if(cI[e]){var a=1/0,r=1/0,s=-1/0,l=-1/0,u=[],h=t&&t.pixelRatio||1;d(hI,function(h,c){if(h.group===e){var d=h.getRenderedCanvas(i(t)),f=h.getDom().getBoundingClientRect();a=n(f.left,a),r=n(f.top,r),s=o(f.right,s),l=o(f.bottom,l),u.push({dom:d,left:f.left,top:f.top})}});var c=(s*=h)-(a*=h),f=(l*=h)-(r*=h),p=Vx();p.width=c,p.height=f;var g=_i(p);return FM(u,function(t){var e=new Je({style:{x:t.left*h-a,y:t.top*h-r,image:t.dom}});g.add(e)}),g.refreshImmediately(),p.toDataURL("image/"+(t&&t.type||"png"))}return this.getDataURL(t)}},QM.convertToPixel=v(Gr,"convertToPixel"),QM.convertFromPixel=v(Gr,"convertFromPixel"),QM.containPixel=function(t,e){var i;return t=Oi(this._model,t),d(t,function(t,n){n.indexOf("Models")>=0&&d(t,function(t){var o=t.coordinateSystem;if(o&&o.containPoint)i|=!!o.containPoint(e);else if("seriesModels"===n){var a=this._chartsMap[t.__viewId];a&&a.containPoint&&(i|=a.containPoint(e,t))}},this)},this),!!i},QM.getVisual=function(t,e){var i=(t=Oi(this._model,t,{defaultMainType:"series"})).seriesModel.getData(),n=t.hasOwnProperty("dataIndexInside")?t.dataIndexInside:t.hasOwnProperty("dataIndex")?i.indexOfRawIndex(t.dataIndex):null;return null!=n?i.getItemVisual(n,e):i.getVisual(e)},QM.getViewOfComponentModel=function(t){return this._componentsMap[t.__viewId]},QM.getViewOfSeriesModel=function(t){return this._chartsMap[t.__viewId]};var tI={prepareAndUpdate:function(t){Fr(this),tI.update.call(this,t)},update:function(t){var e=this._model,i=this._api,n=this._zr,o=this._coordSysMgr,a=this._scheduler;if(e){e.restoreData(t),a.performSeriesTasks(e),o.create(e,i),a.performDataProcessorTasks(e,t),Hr(this,e),o.update(e,i),qr(e),a.performVisualTasks(e,t),$r(this,e,i,t);var r=e.get("backgroundColor")||"transparent";if(Ax.canvasSupported)n.setBackgroundColor(r);else{var s=At(r);r=Rt(s,"rgb"),0===s[3]&&(r="transparent")}Qr(e,i)}},updateTransform:function(t){var e=this._model,i=this,n=this._api;if(e){var o=[];e.eachComponent(function(a,r){var s=i.getViewOfComponentModel(r);if(s&&s.__alive)if(s.updateTransform){var l=s.updateTransform(r,e,n,t);l&&l.update&&o.push(s)}else o.push(s)});var a=z();e.eachSeries(function(o){var r=i._chartsMap[o.__viewId];if(r.updateTransform){var s=r.updateTransform(o,e,n,t);s&&s.update&&a.set(o.uid,1)}else a.set(o.uid,1)}),qr(e),this._scheduler.performVisualTasks(e,t,{setDirty:!0,dirtyMap:a}),Jr(i,e,0,t,a),Qr(e,this._api)}},updateView:function(t){var e=this._model;e&&(pr.markUpdateMethod(t,"updateView"),qr(e),this._scheduler.performVisualTasks(e,t,{setDirty:!0}),$r(this,this._model,this._api,t),Qr(e,this._api))},updateVisual:function(t){tI.update.call(this,t)},updateLayout:function(t){tI.update.call(this,t)}};QM.resize=function(t){this._zr.resize(t);var e=this._model;if(this._loadingFX&&this._loadingFX.resize(),e){var i=e.resetOption("media"),n=t&&t.silent;this[$M]=!0,i&&Fr(this),tI.update.call(this),this[$M]=!1,Ur.call(this,n),jr.call(this,n)}},QM.showLoading=function(t,e){if(HM(t)&&(e=t,t=""),t=t||"default",this.hideLoading(),uI[t]){var i=uI[t](this._api,e),n=this._zr;this._loadingFX=i,n.add(i)}},QM.hideLoading=function(){this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null},QM.makeActionFromEvent=function(t){var e=a({},t);return e.type=nI[t.type],e},QM.dispatchAction=function(t,e){HM(e)||(e={silent:!!e}),iI[t.type]&&this._model&&(this[$M]?this._pendingActions.push(t):(Zr.call(this,t,e.silent),e.flush?this._zr.flush(!0):!1!==e.flush&&Ax.browser.weChat&&this._throttledZrFlush(),Ur.call(this,e.silent),jr.call(this,e.silent)))},QM.appendData=function(t){var e=t.seriesIndex;this.getModel().getSeriesByIndex(e).appendData(t),this._scheduler.unfinished=!0},QM.on=Rr("on"),QM.off=Rr("off"),QM.one=Rr("one");var eI=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","globalout","contextmenu"];QM._initEvents=function(){FM(eI,function(t){this._zr.on(t,function(e){var i,n=this.getModel(),o=e.target;if("globalout"===t)i={};else if(o&&null!=o.dataIndex){var r=o.dataModel||n.getSeriesByIndex(o.seriesIndex);i=r&&r.getDataParams(o.dataIndex,o.dataType)||{}}else o&&o.eventData&&(i=a({},o.eventData));i&&(i.event=e,i.type=t,this.trigger(t,i))},this)},this),FM(nI,function(t,e){this._messageCenter.on(e,function(t){this.trigger(e,t)},this)},this)},QM.isDisposed=function(){return this._disposed},QM.clear=function(){this.setOption({series:[]},!0)},QM.dispose=function(){if(!this._disposed){this._disposed=!0,zi(this.getDom(),pI,"");var t=this._api,e=this._model;FM(this._componentsViews,function(i){i.dispose(e,t)}),FM(this._chartsViews,function(i){i.dispose(e,t)}),this._zr.dispose(),delete hI[this.id]}},h(Vr,$x);var iI={},nI={},oI=[],aI=[],rI=[],sI=[],lI={},uI={},hI={},cI={},dI=new Date-0,fI=new Date-0,pI="_echarts_instance_",gI={},mI=as;fs(2e3,TM),ls(sM),us(5e3,function(t){var e=z();t.eachSeries(function(t){var i=t.get("stack");if(i){var n=e.get(i)||e.set(i,[]),o=t.getData(),a={stackResultDimension:o.getCalculationInfo("stackResultDimension"),stackedOverDimension:o.getCalculationInfo("stackedOverDimension"),stackedDimension:o.getCalculationInfo("stackedDimension"),stackedByDimension:o.getCalculationInfo("stackedByDimension"),isStackedByIndex:o.getCalculationInfo("isStackedByIndex"),data:o,seriesModel:t};if(!a.stackedDimension||!a.isStackedByIndex&&!a.stackedByDimension)return;n.length&&o.setCalculationInfo("stackedOnSeries",n[n.length-1].seriesModel),n.push(a)}}),e.each(Xa)}),gs("default",function(t,e){r(e=e||{},{text:"loading",color:"#c23531",textColor:"#000",maskColor:"rgba(255, 255, 255, 0.8)",zlevel:0});var i=new jb({style:{fill:e.maskColor},zlevel:e.zlevel,z:1e4}),n=new $b({shape:{startAngle:-LM/2,endAngle:-LM/2+.1,r:10},style:{stroke:e.color,lineCap:"round",lineWidth:5},zlevel:e.zlevel,z:10001}),o=new jb({style:{fill:"none",text:e.text,textPosition:"right",textDistance:10,textFill:e.textColor},zlevel:e.zlevel,z:10001});n.animateShape(!0).when(1e3,{endAngle:3*LM/2}).start("circularInOut"),n.animateShape(!0).when(1e3,{startAngle:3*LM/2}).delay(300).start("circularInOut");var a=new L_;return a.add(n),a.add(o),a.add(i),a.resize=function(){var e=t.getWidth()/2,a=t.getHeight()/2;n.setShape({cx:e,cy:a});var r=n.shape.r;o.setShape({x:e-r,y:a-r,width:2*r,height:2*r}),i.setShape({x:0,y:0,width:t.getWidth(),height:t.getHeight()})},a.resize(),a}),hs({type:"highlight",event:"highlight",update:"highlight"},B),hs({type:"downplay",event:"downplay",update:"downplay"},B),ss("light",RM),ss("dark",VM);var vI={};bs.prototype={constructor:bs,add:function(t){return this._add=t,this},update:function(t){return this._update=t,this},remove:function(t){return this._remove=t,this},execute:function(){var t=this._old,e=this._new,i={},n=[],o=[];for(Ss(t,{},n,"_oldKeyGetter",this),Ss(e,i,o,"_newKeyGetter",this),a=0;a=e)){for(var i,n=this._chunkSize,o=this._rawData,a=this._storage,r=this.dimensions,s=this._dimensionInfos,l=this._nameList,u=this._idList,h=this._rawExtent,c=this._nameRepeatCount={},d=this._chunkCount,f=d-1,p=0;ph[I][1]&&(h[I][1]=T)}if(!o.pure){var A=l[_];w&&!A&&(null!=i?A=this._getNameFromStore(_):null!=w.name&&(l[_]=A=w.name));var C=null==w?null:w.id;null==C&&null!=A&&(c[A]=c[A]||0,C=A,c[A]>0&&(C+="__ec__"+c[A]),c[A]++),null!=C&&(u[_]=C)}}!o.persistent&&o.clean&&o.clean(),this._rawCount=this._count=e,this._extent={},Ls(this)}},TI._getNameFromStore=function(t){var e=this._nameDimIdx;if(null!=e){var i=this._chunkSize,n=Math.floor(t/i),o=t%i,a=this.dimensions[e],r=this._dimensionInfos[a].ordinalMeta;if(r)return r.categories[t];var s=this._storage[a][n];return s&&s[o]}},TI._getIdFromStore=function(t){var e=this._idDimIdx;if(null!=e){var i=this._chunkSize,n=Math.floor(t/i),o=t%i,a=this.dimensions[e],r=this._dimensionInfos[a].ordinalMeta;if(r)return r.categories[t];var s=this._storage[a][n];return s&&s[o]}},TI.count=function(){return this._count},TI.getIndices=function(){if(this._indices)return new(t=this._indices.constructor)(this._indices.buffer,0,this._count);for(var t=Ts(this),e=new t(this.count()),i=0;i=0&&e=0&&ea&&(a=s)}return i=[o,a],this._extent[t]=i,i},TI.getApproximateExtent=function(t){return t=this.getDimension(t),this._approximateExtent[t]||this.getDataExtent(t)},TI.setApproximateExtent=function(t,e){e=this.getDimension(e),this._approximateExtent[e]=t.slice()},TI.getCalculationInfo=function(t){return this._calculationInfo[t]},TI.setCalculationInfo=function(t,e){xI(t)?a(this._calculationInfo,t):this._calculationInfo[t]=e},TI.getSum=function(t){var e=0;if(this._storage[t])for(var i=0,n=this.count();i=this._rawCount||t<0)return-1;var e=this._indices,i=e[t];if(null!=i&&it))return a;o=a-1}}return-1},TI.indicesOfNearest=function(t,e,i){var n=[];if(!this._storage[t])return n;null==i&&(i=1/0);for(var o=Number.MAX_VALUE,a=-1,r=0,s=this.count();r=0&&a<0)&&(o=u,a=l,n.length=0),n.push(r))}return n},TI.getRawIndex=ks,TI.getRawDataItem=function(t){if(this._rawData.persistent)return this._rawData.getItem(this.getRawIndex(t));for(var e=[],i=0;i=l&&w<=u&&(a[r++]=c),c++;h=!0}else if(2===n){for(var d=this._storage[s],v=this._storage[e[1]],y=t[e[1]][0],x=t[e[1]][1],f=0;f=l&&w<=u&&b>=y&&b<=x&&(a[r++]=c),c++}h=!0}}if(!h)if(1===n)for(m=0;m=l&&w<=u&&(a[r++]=M)}else for(m=0;mt[I][1])&&(S=!1)}S&&(a[r++]=this.getRawIndex(m))}return rb[1]&&(b[1]=w)}}}return o},TI.downSample=function(t,e,i,n){for(var o=Es(this,[t]),a=o._storage,r=[],s=Math.floor(1/e),l=a[t],u=this.count(),h=this._chunkSize,c=o._rawExtent[t],d=new(Ts(this))(u),f=0,p=0;pu-p&&(s=u-p,r.length=s);for(var g=0;gc[1]&&(c[1]=x),d[f++]=_}return o._count=f,o._indices=d,o.getRawIndex=Ps,o},TI.getItemModel=function(t){var e=this.hostModel;return new wo(this.getRawDataItem(t),e,e&&e.ecModel)},TI.diff=function(t){var e=this;return new bs(t?t.getIndices():[],this.getIndices(),function(e){return Ns(t,e)},function(t){return Ns(e,t)})},TI.getVisual=function(t){var e=this._visual;return e&&e[t]},TI.setVisual=function(t,e){if(xI(t))for(var i in t)t.hasOwnProperty(i)&&this.setVisual(i,t[i]);else this._visual=this._visual||{},this._visual[t]=e},TI.setLayout=function(t,e){if(xI(t))for(var i in t)t.hasOwnProperty(i)&&this.setLayout(i,t[i]);else this._layout[t]=e},TI.getLayout=function(t){return this._layout[t]},TI.getItemLayout=function(t){return this._itemLayouts[t]},TI.setItemLayout=function(t,e,i){this._itemLayouts[t]=i?a(this._itemLayouts[t]||{},e):e},TI.clearItemLayouts=function(){this._itemLayouts.length=0},TI.getItemVisual=function(t,e,i){var n=this._itemVisuals[t],o=n&&n[e];return null!=o||i?o:this.getVisual(e)},TI.setItemVisual=function(t,e,i){var n=this._itemVisuals[t]||{},o=this.hasItemVisual;if(this._itemVisuals[t]=n,xI(e))for(var a in e)e.hasOwnProperty(a)&&(n[a]=e[a],o[a]=!0);else n[e]=i,o[e]=!0},TI.clearAllVisual=function(){this._visual={},this._itemVisuals=[],this.hasItemVisual={}};var AI=function(t){t.seriesIndex=this.seriesIndex,t.dataIndex=this.dataIndex,t.dataType=this.dataType};TI.setItemGraphicEl=function(t,e){var i=this.hostModel;e&&(e.dataIndex=t,e.dataType=this.dataType,e.seriesIndex=i&&i.seriesIndex,"group"===e.type&&e.traverse(AI,e)),this._graphicEls[t]=e},TI.getItemGraphicEl=function(t){return this._graphicEls[t]},TI.eachItemGraphicEl=function(t,e){d(this._graphicEls,function(i,n){i&&t&&t.call(e,i,n)})},TI.cloneShallow=function(t){if(!t){var e=f(this.dimensions,this.getDimensionInfo,this);t=new DI(e,this.hostModel)}if(t._storage=this._storage,Cs(t,this),this._indices){var n=this._indices.constructor;t._indices=new n(this._indices)}else t._indices=null;return t.getRawIndex=t._indices?Ps:ks,t._extent=i(this._extent),t._approximateExtent=i(this._approximateExtent),t},TI.wrapMethod=function(t,e){var i=this[t];"function"==typeof i&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(t),this[t]=function(){var t=i.apply(this,arguments);return e.apply(this,[t].concat(C(arguments)))})},TI.TRANSFERABLE_METHODS=["cloneShallow","downSample","map"],TI.CHANGABLE_METHODS=["filterSelf","selectRange"];var CI=function(t,e){return e=e||{},Bs(e.coordDimensions||[],t,{dimsDef:e.dimensionsDefine||t.dimensionsDefine,encodeDef:e.encodeDefine||t.encodeDefine,dimCount:e.dimensionsCount,generateCoord:e.generateCoord,generateCoordCount:e.generateCoordCount})};js.prototype.parse=function(t){return t},js.prototype.getSetting=function(t){return this._setting[t]},js.prototype.contain=function(t){var e=this._extent;return t>=e[0]&&t<=e[1]},js.prototype.normalize=function(t){var e=this._extent;return e[1]===e[0]?.5:(t-e[0])/(e[1]-e[0])},js.prototype.scale=function(t){var e=this._extent;return t*(e[1]-e[0])+e[0]},js.prototype.unionExtent=function(t){var e=this._extent;t[0]e[1]&&(e[1]=t[1])},js.prototype.unionExtentFromData=function(t,e){this.unionExtent(t.getApproximateExtent(e))},js.prototype.getExtent=function(){return this._extent.slice()},js.prototype.setExtent=function(t,e){var i=this._extent;isNaN(t)||(i[0]=t),isNaN(e)||(i[1]=e)},js.prototype.getTicksLabels=function(){for(var t=[],e=this.getTicks(),i=0;ie[1]&&(e[1]=t[1]),EI.prototype.setExtent.call(this,e[0],e[1])},getInterval:function(){return this._interval},setInterval:function(t){this._interval=t,this._niceExtent=this._extent.slice(),this._intervalPrecision=Ks(t)},getTicks:function(){return tl(this._interval,this._extent,this._niceExtent,this._intervalPrecision)},getTicksLabels:function(){for(var t=[],e=this.getTicks(),i=0;i>>1;t[o][1]i&&(a=i);var r=WI.length,s=GI(WI,a,0,r),l=WI[Math.min(s,r-1)],u=l[1];"year"===l[0]&&(u*=Vo(o/u/t,!0));var h=this.getSetting("useUTC")?0:60*new Date(+n[0]||+n[1]).getTimezoneOffset()*1e3,c=[Math.round(BI((n[0]-h)/u)*u+h),Math.round(VI((n[1]-h)/u)*u+h)];Qs(c,n),this._stepLvl=l,this._interval=u,this._niceExtent=c},parse:function(t){return+zo(t)}});d(["contain","normalize"],function(t){FI.prototype[t]=function(e){return RI[t].call(this,this.parse(e))}});var WI=[["hh:mm:ss",1e3],["hh:mm:ss",5e3],["hh:mm:ss",1e4],["hh:mm:ss",15e3],["hh:mm:ss",3e4],["hh:mm\nMM-dd",6e4],["hh:mm\nMM-dd",3e5],["hh:mm\nMM-dd",6e5],["hh:mm\nMM-dd",9e5],["hh:mm\nMM-dd",18e5],["hh:mm\nMM-dd",36e5],["hh:mm\nMM-dd",72e5],["hh:mm\nMM-dd",216e5],["hh:mm\nMM-dd",432e5],["MM-dd\nyyyy",864e5],["MM-dd\nyyyy",1728e5],["MM-dd\nyyyy",2592e5],["MM-dd\nyyyy",3456e5],["MM-dd\nyyyy",432e6],["MM-dd\nyyyy",5184e5],["week",6048e5],["MM-dd\nyyyy",864e6],["week",12096e5],["week",18144e5],["month",26784e5],["week",36288e5],["month",53568e5],["week",36288e5],["quarter",8208e6],["month",107136e5],["month",13392e6],["half-year",16416e6],["month",214272e5],["month",26784e6],["year",32832e6]];FI.create=function(t){return new FI({useUTC:t.ecModel.get("useUTC")})};var HI=js.prototype,ZI=EI.prototype,UI=ko,jI=Ao,XI=Math.floor,YI=Math.ceil,qI=Math.pow,$I=Math.log,KI=js.extend({type:"log",base:10,$constructor:function(){js.apply(this,arguments),this._originalScale=new EI},getTicks:function(){var t=this._originalScale,e=this._extent,i=t.getExtent();return f(ZI.getTicks.call(this),function(n){var o=Ao(qI(this.base,n));return o=n===e[0]&&t.__fixMin?sl(o,i[0]):o,o=n===e[1]&&t.__fixMax?sl(o,i[1]):o},this)},getLabel:ZI.getLabel,scale:function(t){return t=HI.scale.call(this,t),qI(this.base,t)},setExtent:function(t,e){var i=this.base;t=$I(t)/$I(i),e=$I(e)/$I(i),ZI.setExtent.call(this,t,e)},getExtent:function(){var t=this.base,e=HI.getExtent.call(this);e[0]=qI(t,e[0]),e[1]=qI(t,e[1]);var i=this._originalScale,n=i.getExtent();return i.__fixMin&&(e[0]=sl(e[0],n[0])),i.__fixMax&&(e[1]=sl(e[1],n[1])),e},unionExtent:function(t){this._originalScale.unionExtent(t);var e=this.base;t[0]=$I(t[0])/$I(e),t[1]=$I(t[1])/$I(e),HI.unionExtent.call(this,t)},unionExtentFromData:function(t,e){this.unionExtent(t.getApproximateExtent(e))},niceTicks:function(t){t=t||10;var e=this._extent,i=e[1]-e[0];if(!(i===1/0||i<=0)){var n=Ro(i);for(t/i*n<=.5&&(n*=10);!isNaN(n)&&Math.abs(n)<1&&Math.abs(n)>0;)n*=10;var o=[Ao(YI(e[0]/n)*n),Ao(XI(e[1]/n)*n)];this._interval=n,this._niceExtent=o}},niceExtent:function(t){ZI.niceExtent.call(this,t);var e=this._originalScale;e.__fixMin=t.fixMin,e.__fixMax=t.fixMax}});d(["contain","normalize"],function(t){KI.prototype[t]=function(e){return e=$I(e)/$I(this.base),HI[t].call(this,e)}}),KI.create=function(){return new KI};var JI={getFormattedLabels:function(){return fl(this.axis,this.get("axisLabel.formatter"))},getMin:function(t){var e=this.option,i=t||null==e.rangeStart?e.min:e.rangeStart;return this.axis&&null!=i&&"dataMin"!==i&&"function"!=typeof i&&!I(i)&&(i=this.axis.scale.parse(i)),i},getMax:function(t){var e=this.option,i=t||null==e.rangeEnd?e.max:e.rangeEnd;return this.axis&&null!=i&&"dataMax"!==i&&"function"!=typeof i&&!I(i)&&(i=this.axis.scale.parse(i)),i},getNeedCrossZero:function(){var t=this.option;return null==t.rangeStart&&null==t.rangeEnd&&!t.scale},getCoordSysModel:B,setRange:function(t,e){this.option.rangeStart=t,this.option.rangeEnd=e},resetRange:function(){this.option.rangeStart=this.option.rangeEnd=null}},QI=En({type:"triangle",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(t,e){var i=e.cx,n=e.cy,o=e.width/2,a=e.height/2;t.moveTo(i,n-a),t.lineTo(i+o,n+a),t.lineTo(i-o,n+a),t.closePath()}}),tD=En({type:"diamond",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(t,e){var i=e.cx,n=e.cy,o=e.width/2,a=e.height/2;t.moveTo(i,n-a),t.lineTo(i+o,n),t.lineTo(i,n+a),t.lineTo(i-o,n),t.closePath()}}),eD=En({type:"pin",shape:{x:0,y:0,width:0,height:0},buildPath:function(t,e){var i=e.x,n=e.y,o=e.width/5*3,a=Math.max(o,e.height),r=o/2,s=r*r/(a-r),l=n-a+r+s,u=Math.asin(s/r),h=Math.cos(u)*r,c=Math.sin(u),d=Math.cos(u),f=.6*r,p=.7*r;t.moveTo(i-h,l+s),t.arc(i,l,r,Math.PI-u,2*Math.PI+u),t.bezierCurveTo(i+h-c*f,l+s+d*f,i,n-p,i,n),t.bezierCurveTo(i,n-p,i-h+c*f,l+s+d*f,i-h,l+s),t.closePath()}}),iD=En({type:"arrow",shape:{x:0,y:0,width:0,height:0},buildPath:function(t,e){var i=e.height,n=e.width,o=e.x,a=e.y,r=n/3*2;t.moveTo(o,a),t.lineTo(o+r,a+i),t.lineTo(o,a+i/4*3),t.lineTo(o-r,a+i),t.lineTo(o,a),t.closePath()}}),nD={line:function(t,e,i,n,o){o.x1=t,o.y1=e+n/2,o.x2=t+i,o.y2=e+n/2},rect:function(t,e,i,n,o){o.x=t,o.y=e,o.width=i,o.height=n},roundRect:function(t,e,i,n,o){o.x=t,o.y=e,o.width=i,o.height=n,o.r=Math.min(i,n)/4},square:function(t,e,i,n,o){var a=Math.min(i,n);o.x=t,o.y=e,o.width=a,o.height=a},circle:function(t,e,i,n,o){o.cx=t+i/2,o.cy=e+n/2,o.r=Math.min(i,n)/2},diamond:function(t,e,i,n,o){o.cx=t+i/2,o.cy=e+n/2,o.width=i,o.height=n},pin:function(t,e,i,n,o){o.x=t+i/2,o.y=e+n/2,o.width=i,o.height=n},arrow:function(t,e,i,n,o){o.x=t+i/2,o.y=e+n/2,o.width=i,o.height=n},triangle:function(t,e,i,n,o){o.cx=t+i/2,o.cy=e+n/2,o.width=i,o.height=n}},oD={};d({line:Xb,rect:jb,roundRect:jb,square:jb,circle:Rb,diamond:tD,pin:eD,arrow:iD,triangle:QI},function(t,e){oD[e]=new t});var aD=En({type:"symbol",shape:{symbolType:"",x:0,y:0,width:0,height:0},beforeBrush:function(){var t=this.style;"pin"===this.shape.symbolType&&"inside"===t.textPosition&&(t.textPosition=["50%","40%"],t.textAlign="center",t.textVerticalAlign="middle")},buildPath:function(t,e,i){var n=e.symbolType,o=oD[n];"none"!==e.symbolType&&(o||(o=oD[n="rect"]),nD[n](e.x,e.y,e.width,e.height,o.shape),o.buildPath(t,o.shape,i))}}),rD={isDimensionStacked:Ws,enableDataStack:Fs},sD=(Object.freeze||Object)({createList:function(t){return Hs(t.getSource(),t)},getLayoutRect:Qo,dataStack:rD,createScale:function(t,e){var i=e;wo.isInstance(e)||h(i=new wo(e),JI);var n=cl(i);return n.setExtent(t[0],t[1]),hl(n,i),n},mixinAxisModelCommonMethods:function(t){h(t,JI)},completeDimensions:Bs,createDimensions:CI,createSymbol:ml}),lD=1e-8;xl.prototype={constructor:xl,properties:null,getBoundingRect:function(){var t=this._rect;if(t)return t;for(var e=Number.MAX_VALUE,i=[e,e],n=[-e,-e],o=[],a=[],r=this.geometries,s=0;s0}),function(t){var e=t.properties,i=t.geometry,n=i.coordinates,o=[];"Polygon"===i.type&&o.push({type:"polygon",exterior:n[0],interiors:n.slice(1)}),"MultiPolygon"===i.type&&d(n,function(t){t[0]&&o.push({type:"polygon",exterior:t[0],interiors:t.slice(1)})});var a=new xl(e.name,o,e.cp);return a.properties=e,a})},hD=Do,cD=[0,1],dD=function(t,e,i){this.dim=t,this.scale=e,this._extent=i||[0,0],this.inverse=!1,this.onBand=!1,this._labelInterval};dD.prototype={constructor:dD,contain:function(t){var e=this._extent,i=Math.min(e[0],e[1]),n=Math.max(e[0],e[1]);return t>=i&&t<=n},containData:function(t){return this.contain(this.dataToCoord(t))},getExtent:function(){return this._extent.slice()},getPixelPrecision:function(t){return Po(t||this.scale.getExtent(),this._extent)},setExtent:function(t,e){var i=this._extent;i[0]=t,i[1]=e},dataToCoord:function(t,e){var i=this._extent,n=this.scale;return t=n.normalize(t),this.onBand&&"ordinal"===n.type&&bl(i=i.slice(),n.count()),hD(t,cD,i,e)},coordToData:function(t,e){var i=this._extent,n=this.scale;this.onBand&&"ordinal"===n.type&&bl(i=i.slice(),n.count());var o=hD(t,i,cD,e);return this.scale.scale(o)},pointToData:function(t,e){},getTicksCoords:function(t){if(this.onBand&&!t){for(var e=this.getBands(),i=[],n=0;n0&&zl(i[o-1]);o--);for(;n0&&zl(i[a-1]);a--);for(;o=0){var r=o.getItemGraphicEl(a);if(!r){var s=o.getItemLayout(a);if(!s)return;(r=new Dl(o,a)).position=s,r.setZ(t.get("zlevel"),t.get("z")),r.ignore=isNaN(s[0])||isNaN(s[1]),r.__temp=!0,o.setItemGraphicEl(a,r),r.stopSymbolAnimation(!0),this.group.add(r)}r.highlight()}else pr.prototype.highlight.call(this,t,e,i,n)},downplay:function(t,e,i,n){var o=t.getData(),a=Pi(o,n);if(null!=a&&a>=0){var r=o.getItemGraphicEl(a);r&&(r.__temp?(o.setItemGraphicEl(a,null),this.group.remove(r)):r.downplay())}else pr.prototype.downplay.call(this,t,e,i,n)},_newPolyline:function(t){var e=this._polyline;return e&&this._lineGroup.remove(e),e=new CD({shape:{points:t},silent:!0,z2:10}),this._lineGroup.add(e),this._polyline=e,e},_newPolygon:function(t,e){var i=this._polygon;return i&&this._lineGroup.remove(i),i=new LD({shape:{points:t,stackedOnPoints:e},silent:!0}),this._lineGroup.add(i),this._polygon=i,i},_getSymbolIgnoreFunc:function(t,e){var i=e.getAxesByScale("ordinal")[0];if(i&&i.isLabelIgnored)return m(i.isLabelIgnored,i)},_updateAnimation:function(t,e,i,n,o,a){var r=this._polyline,s=this._polygon,l=t.hostModel,u=wD(this._data,t,this._stackedOnPoints,e,this._coordSys,i,this._valueOrigin,a),h=u.current,c=u.stackedOnCurrent,d=u.next,f=u.stackedOnNext;o&&(h=ql(u.current,i,o),c=ql(u.stackedOnCurrent,i,o),d=ql(u.next,i,o),f=ql(u.stackedOnNext,i,o)),r.shape.__points=u.current,r.shape.points=h,fo(r,{shape:{points:d}},l),s&&(s.setShape({points:h,stackedOnPoints:c}),fo(s,{shape:{points:d,stackedOnPoints:f}},l));for(var p=[],g=u.status,m=0;me&&(e=t[i]);return e},min:function(t){for(var e=1/0,i=0;ie[1]&&e.reverse(),e},getOtherAxis:function(){this.grid.getOtherAxis()},isLabelIgnored:function(t){if("category"===this.type){var e=this.getLabelInterval();return"function"==typeof e&&!e(t,this.scale.getLabel(t))||t%(e+1)}},pointToData:function(t,e){return this.coordToData(this.toLocalCoord(t["x"===this.dim?0:1]),e)},toLocalCoord:null,toGlobalCoord:null},u(zD,dD);var RD={show:!0,zlevel:0,z:0,inverse:!1,name:"",nameLocation:"end",nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:!0,onZeroAxisIndex:null,lineStyle:{color:"#333",width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15]},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}}},BD={};BD.categoryAxis=n({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},RD),BD.valueAxis=n({boundaryGap:[0,0],splitNumber:5},RD),BD.timeAxis=r({scale:!0,min:"dataMin",max:"dataMax"},BD.valueAxis),BD.logAxis=r({scale:!0,logBase:10},BD.valueAxis);var VD=["value","category","time","log"],GD=function(t,e,i,a){d(VD,function(r){e.extend({type:t+"Axis."+r,mergeDefaultAndTheme:function(e,o){var a=this.layoutMode,s=a?na(e):{};n(e,o.getTheme().get(r+"Axis")),n(e,this.getDefaultOption()),e.type=i(t,e),a&&ia(e,s,a)},optionUpdated:function(){"category"===this.option.type&&(this.__ordinalMeta=Xs.createByAxisModel(this))},getCategories:function(){if("category"===this.option.type)return this.__ordinalMeta.categories},getOrdinalMeta:function(){return this.__ordinalMeta},defaultOption:o([{},BD[r+"Axis"],a],!0)})}),kS.registerSubTypeDefaulter(t+"Axis",v(i,t))},FD=kS.extend({type:"cartesian2dAxis",axis:null,init:function(){FD.superApply(this,"init",arguments),this.resetRange()},mergeOption:function(){FD.superApply(this,"mergeOption",arguments),this.resetRange()},restoreData:function(){FD.superApply(this,"restoreData",arguments),this.resetRange()},getCoordSysModel:function(){return this.ecModel.queryComponents({mainType:"grid",index:this.option.gridIndex,id:this.option.gridId})[0]}});n(FD.prototype,JI);var WD={offset:0};GD("x",FD,Ql,WD),GD("y",FD,Ql,WD),kS.extend({type:"grid",dependencies:["xAxis","yAxis"],layoutMode:"box",coordinateSystem:null,defaultOption:{show:!1,zlevel:0,z:0,left:"10%",top:60,right:"10%",bottom:60,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"}});var HD=d,ZD=function(t){var e=t.scale.getExtent(),i=e[0],n=e[1];return!(i>0&&n>0||i<0&&n<0)},UD=hl,jD=nu.prototype;jD.type="grid",jD.axisPointerEnabled=!0,jD.getRect=function(){return this._rect},jD.update=function(t,e){var i=this._axesMap;this._updateScale(t,this.model),HD(i.x,function(t){UD(t.scale,t.model)}),HD(i.y,function(t){UD(t.scale,t.model)}),HD(i.x,function(t){ou(i,"y",t)}),HD(i.y,function(t){ou(i,"x",t)}),this.resize(this.model,e)},jD.resize=function(t,e,i){function n(){HD(a,function(t){var e=t.isHorizontal(),i=e?[0,o.width]:[0,o.height],n=t.inverse?1:0;t.setExtent(i[n],i[1-n]),ru(t,e?o.x:o.y)})}var o=Qo(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()});this._rect=o;var a=this._axesList;n(),!i&&t.get("containLabel")&&(HD(a,function(t){if(!t.model.get("axisLabel.inside")){var e=iu(t);if(e){var i=t.isHorizontal()?"height":"width",n=t.model.get("axisLabel.margin");o[i]-=e[i]+n,"top"===t.position?o.y+=e.height+n:"left"===t.position&&(o.x+=e.width+n)}}}),n())},jD.getAxis=function(t,e){var i=this._axesMap[t];if(null!=i){if(null==e)for(var n in i)if(i.hasOwnProperty(n))return i[n];return i[e]}},jD.getAxes=function(){return this._axesList.slice()},jD.getCartesian=function(t,e){if(null!=t&&null!=e){var i="x"+t+"y"+e;return this._coordsMap[i]}w(t)&&(e=t.yAxisIndex,t=t.xAxisIndex);for(var n=0,o=this._coordsList;nu[1]?-1:1,c=["start"===o?u[0]-h*l:"end"===o?u[1]+h*l:(u[0]+u[1])/2,gu(o)?t.labelOffset+r*l:0],d=e.get("nameRotate");null!=d&&(d=d*YD/180);var f;gu(o)?n=KD(t.rotation,null!=d?d:t.rotation,r):(n=hu(t,o,d||0,u),null!=(f=t.axisNameAvailableWidth)&&(f=Math.abs(f/Math.sin(n.rotation)),!isFinite(f)&&(f=null)));var p=s.getFont(),g=e.get("nameTruncate",!0)||{},m=g.ellipsis,v=D(t.nameTruncateMaxWidth,g.maxWidth,f),y=null!=m&&null!=v?bS(i,v,p,m,{minChar:2,placeholder:g.placeholder}):i,x=e.get("tooltip",!0),_=e.mainType,w={componentType:_,name:i,$vars:["name"]};w[_+"Index"]=e.componentIndex;var b=new zb({anid:"name",__fullText:i,__truncatedText:y,position:c,rotation:n.rotation,silent:cu(e),z2:1,tooltip:x&&x.show?a({content:i,formatter:function(){return i},formatterParams:w},x):null});no(b.style,s,{text:y,textFont:p,textFill:s.getTextColor()||e.get("axisLine.lineStyle.color"),textAlign:n.textAlign,textVerticalAlign:n.textVerticalAlign}),e.get("triggerEvent")&&(b.eventData=uu(e),b.eventData.targetType="axisName",b.eventData.name=i),this._dumbGroup.add(b),b.updateTransform(),this.group.add(b),b.decomposeTransform()}}},KD=qD.innerTextLayout=function(t,e,i){var n,o,a=Oo(e-t);return Eo(a)?(o=i>0?"top":"bottom",n="center"):Eo(a-YD)?(o=i>0?"bottom":"top",n="center"):(o="middle",n=a>0&&a0?"right":"left":i>0?"left":"right"),{rotation:a,textAlign:n,textVerticalAlign:o}},JD=qD.ifIgnoreOnTick=function(t,e,i,n,o,a){if(0===e&&o||e===n-1&&a)return!1;var r,s=t.scale;return"ordinal"===s.type&&("function"==typeof i?(r=s.getTicks()[e],!i(r,s.getLabel(r))):e%(i+1))},QD=qD.getInterval=function(t,e){var i=t.get("interval");return null!=i&&"auto"!=i||(i=e),i},tT=d,eT=v,iT=vs({type:"axis",_axisPointer:null,axisPointerClass:null,render:function(t,e,i,n){this.axisPointerClass&&Mu(t),iT.superApply(this,"render",arguments),Cu(this,t,0,i,0,!0)},updateAxisPointer:function(t,e,i,n,o){Cu(this,t,0,i,0,!1)},remove:function(t,e){var i=this._axisPointer;i&&i.remove(e),iT.superApply(this,"remove",arguments)},dispose:function(t,e){Lu(this,e),iT.superApply(this,"dispose",arguments)}}),nT=[];iT.registerAxisPointerClass=function(t,e){nT[t]=e},iT.getAxisPointerClass=function(t){return t&&nT[t]};var oT=qD.ifIgnoreOnTick,aT=qD.getInterval,rT=["axisLine","axisTickLabel","axisName"],sT=["splitArea","splitLine"],lT=iT.extend({type:"cartesianAxis",axisPointerClass:"CartesianAxisPointer",render:function(t,e,i,n){this.group.removeAll();var o=this._axisGroup;if(this._axisGroup=new L_,this.group.add(this._axisGroup),t.get("show")){var a=t.getCoordSysModel(),r=ku(a,t),s=new qD(t,r);d(rT,s.add,s),this._axisGroup.add(s.getGroup()),d(sT,function(e){t.get(e+".show")&&this["_"+e](t,a,r.labelInterval)},this),yo(o,this._axisGroup,t),lT.superCall(this,"render",t,e,i,n)}},_splitLine:function(t,e,i){var n=t.axis;if(!n.scale.isBlank()){var o=t.getModel("splitLine"),a=o.getModel("lineStyle"),s=a.get("color"),l=aT(o,i);s=y(s)?s:[s];for(var u=e.coordinateSystem.getRect(),h=n.isHorizontal(),c=0,d=n.getTicksCoords(),f=n.scale.getTicks(),p=t.get("axisLabel.showMinLabel"),g=t.get("axisLabel.showMaxLabel"),m=[],v=[],x=a.getLineStyle(),_=0;_1){var c;"string"==typeof o?c=ND[o]:"function"==typeof o&&(c=o),c&&t.setData(n.downSample(s.dim,1/h,c,OD))}}}}}("line"));var uT=mM.extend({type:"series.__base_bar__",getInitialData:function(t,e){return Hs(this.getSource(),this)},getMarkerPosition:function(t){var e=this.coordinateSystem;if(e){var i=e.dataToPoint(e.clampData(t)),n=this.getData(),o=n.getLayout("offset"),a=n.getLayout("size");return i[e.getBaseAxis().isHorizontal()?0:1]+=o+a/2,i}return[NaN,NaN]},defaultOption:{zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,itemStyle:{},emphasis:{}}});uT.extend({type:"series.bar",dependencies:["grid","polar"],brushSelector:"rect"});var hT=Lw([["fill","color"],["stroke","borderColor"],["lineWidth","borderWidth"],["stroke","barBorderColor"],["lineWidth","barBorderWidth"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]),cT={getBarItemStyle:function(t){var e=hT(this,t);if(this.getBorderLineDash){var i=this.getBorderLineDash();i&&(e.lineDash=i)}return e}},dT=["itemStyle","barBorderWidth"];a(wo.prototype,cT),xs({type:"bar",render:function(t,e,i){var n=t.get("coordinateSystem");return"cartesian2d"!==n&&"polar"!==n||this._render(t,e,i),this.group},dispose:B,_render:function(t,e,i){var n,o=this.group,a=t.getData(),r=this._data,s=t.coordinateSystem,l=s.getBaseAxis();"cartesian2d"===s.type?n=l.isHorizontal():"polar"===s.type&&(n="angle"===l.dim);var u=t.isAnimationEnabled()?t:null;a.diff(r).add(function(e){if(a.hasValue(e)){var i=a.getItemModel(e),r=pT[s.type](a,e,i),l=fT[s.type](a,e,i,r,n,u);a.setItemGraphicEl(e,l),o.add(l),zu(l,a,e,i,r,t,n,"polar"===s.type)}}).update(function(e,i){var l=r.getItemGraphicEl(i);if(a.hasValue(e)){var h=a.getItemModel(e),c=pT[s.type](a,e,h);l?fo(l,{shape:c},u,e):l=fT[s.type](a,e,h,c,n,u,!0),a.setItemGraphicEl(e,l),o.add(l),zu(l,a,e,h,c,t,n,"polar"===s.type)}else o.remove(l)}).remove(function(t){var e=r.getItemGraphicEl(t);"cartesian2d"===s.type?e&&Ou(t,u,e):e&&Eu(t,u,e)}).execute(),this._data=a},remove:function(t,e){var i=this.group,n=this._data;t.get("animation")?n&&n.eachItemGraphicEl(function(e){"sector"===e.type?Eu(e.dataIndex,t,e):Ou(e.dataIndex,t,e)}):i.removeAll()}});var fT={cartesian2d:function(t,e,i,n,o,r,s){var l=new jb({shape:a({},n)});if(r){var u=l.shape,h=o?"height":"width",c={};u[h]=0,c[h]=n[h],sS[s?"updateProps":"initProps"](l,{shape:c},r,e)}return l},polar:function(t,e,i,n,o,a,s){var l=n.startAngle0?1:-1,r=n.height>0?1:-1;return{x:n.x+a*o/2,y:n.y+r*o/2,width:n.width-a*o,height:n.height-r*o}},polar:function(t,e,i){var n=t.getItemLayout(e);return{cx:n.cx,cy:n.cy,r0:n.r0,r:n.r,startAngle:n.startAngle,endAngle:n.endAngle}}};ds(v(rl,"bar")),fs(function(t){t.eachSeriesByType("bar",function(t){t.getData().setVisual("legendSymbol","roundRect")})});var gT=function(t,e,i){e=y(e)&&{coordDimensions:e}||a({},e);var n=t.getSource(),o=CI(n,e),r=new DI(o,t);return r.initData(n,i),r},mT={updateSelectedMap:function(t){this._targetList=y(t)?t.slice():[],this._selectTargetMap=p(t||[],function(t,e){return t.set(e.name,e),t},z())},select:function(t,e){var i=null!=e?this._targetList[e]:this._selectTargetMap.get(t);"single"===this.get("selectedMode")&&this._selectTargetMap.each(function(t){t.selected=!1}),i&&(i.selected=!0)},unSelect:function(t,e){var i=null!=e?this._targetList[e]:this._selectTargetMap.get(t);i&&(i.selected=!1)},toggleSelected:function(t,e){var i=null!=e?this._targetList[e]:this._selectTargetMap.get(t);if(null!=i)return this[i.selected?"unSelect":"select"](t,e),i.selected},isSelected:function(t,e){var i=null!=e?this._targetList[e]:this._selectTargetMap.get(t);return i&&i.selected}},vT=ys({type:"series.pie",init:function(t){vT.superApply(this,"init",arguments),this.legendDataProvider=function(){return this.getRawData()},this.updateSelectedMap(this._createSelectableList()),this._defaultLabelLine(t)},mergeOption:function(t){vT.superCall(this,"mergeOption",t),this.updateSelectedMap(this._createSelectableList())},getInitialData:function(t,e){return gT(this,["value"])},_createSelectableList:function(){for(var t=this.getRawData(),e=t.mapDimension("value"),i=[],n=0,o=t.count();n0&&"scale"!==u){var d=o.getItemLayout(0),f=Math.max(i.getWidth(),i.getHeight())/2,p=m(r.removeClipPath,r);r.setClipPath(this._createClipPath(d.cx,d.cy,f,d.startAngle,d.clockwise,p,t))}this._data=o}},dispose:function(){},_createClipPath:function(t,e,i,n,o,a,r){var s=new Gb({shape:{cx:t,cy:e,r0:0,r:i,startAngle:n,endAngle:n,clockwise:o}});return po(s,{shape:{endAngle:n+(o?1:-1)*Math.PI*2}},r,a),s},containPoint:function(t,e){var i=e.getData().getItemLayout(0);if(i){var n=t[0]-i.cx,o=t[1]-i.cy,a=Math.sqrt(n*n+o*o);return a<=i.r&&a>=i.r0}}});var xT=function(t,e){d(e,function(e){e.update="updateView",hs(e,function(i,n){var o={};return n.eachComponent({mainType:"series",subType:t,query:i},function(t){t[e.method]&&t[e.method](i.name,i.dataIndex);var n=t.getData();n.each(function(e){var i=n.getName(e);o[i]=t.isSelected(i)||!1})}),{name:i.name,selected:o}})})},_T=function(t){return{getTargetSeries:function(e){var i={},n=z();return e.eachSeriesByType(t,function(t){t.__paletteScope=i,n.set(t.uid,t)}),n},reset:function(t,e){var i=t.getRawData(),n={},o=t.getData();o.each(function(t){var e=o.getRawIndex(t);n[e]=t}),i.each(function(e){var a=n[e],r=null!=a&&o.getItemVisual(a,"color",!0);if(r)i.setItemVisual(e,"color",r);else{var s=i.getItemModel(e).get("itemStyle.color")||t.getColorFromPalette(i.getName(e)||e+"",t.__paletteScope,i.count());i.setItemVisual(e,"color",s),null!=a&&o.setItemVisual(a,"color",s)}})}}},wT=function(t,e,i,n){var o,a,r=t.getData(),s=[],l=!1;r.each(function(i){var n,u,h,c,d=r.getItemLayout(i),f=r.getItemModel(i),p=f.getModel("label"),g=p.get("position")||f.get("emphasis.label.position"),m=f.getModel("labelLine"),v=m.get("length"),y=m.get("length2"),x=(d.startAngle+d.endAngle)/2,_=Math.cos(x),w=Math.sin(x);o=d.cx,a=d.cy;var b="inside"===g||"inner"===g;if("center"===g)n=d.cx,u=d.cy,c="center";else{var S=(b?(d.r+d.r0)/2*_:d.r*_)+o,M=(b?(d.r+d.r0)/2*w:d.r*w)+a;if(n=S+3*_,u=M+3*w,!b){var I=S+_*(v+e-d.r),D=M+w*(v+e-d.r),T=I+(_<0?-1:1)*y,A=D;n=T+(_<0?-5:5),u=A,h=[[S,M],[I,D],[T,A]]}c=b?"center":_>0?"left":"right"}var C=p.getFont(),L=p.get("rotate")?_<0?-x+Math.PI:-x:0,k=me(t.getFormattedLabel(i,"normal")||r.getName(i),C,c,"top");l=!!L,d.label={x:n,y:u,position:g,height:k.height,len:v,len2:y,linePoints:h,textAlign:c,verticalAlign:"middle",rotation:L,inside:b},b||s.push(d.label)}),!l&&t.get("avoidLabelOverlap")&&Wu(s,o,a,e,i,n)},bT=2*Math.PI,ST=Math.PI/180,MT=function(t){return{seriesType:t,reset:function(t,e){var i=e.findComponents({mainType:"legend"});if(i&&i.length){var n=t.getData();n.filterSelf(function(t){for(var e=n.getName(t),o=0;o=0;s--){var l=2*s,u=n[l]-a/2,h=n[l+1]-r/2;if(t>=u&&e>=h&&t<=u+a&&e<=h+r)return s}return-1}}),DT=Hu.prototype;DT.isPersistent=function(){return!this._incremental},DT.updateData=function(t){this.group.removeAll();var e=new IT({rectHover:!0,cursor:"default"});e.setShape({points:t.getLayout("symbolPoints")}),this._setCommon(e,t),this.group.add(e),this._incremental=null},DT.updateLayout=function(t){if(!this._incremental){var e=t.getLayout("symbolPoints");this.group.eachChild(function(t){if(null!=t.startIndex){var i=2*(t.endIndex-t.startIndex),n=4*t.startIndex*2;e=new Float32Array(e.buffer,n,i)}t.setShape("points",e)})}},DT.incrementalPrepareUpdate=function(t){this.group.removeAll(),this._clearIncremental(),t.count()>2e6?(this._incremental||(this._incremental=new On({silent:!0})),this.group.add(this._incremental)):this._incremental=null},DT.incrementalUpdate=function(t,e){var i;this._incremental?(i=new IT,this._incremental.addDisplayable(i,!0)):((i=new IT({rectHover:!0,cursor:"default",startIndex:t.start,endIndex:t.end})).incremental=!0,this.group.add(i)),i.setShape({points:e.getLayout("symbolPoints")}),this._setCommon(i,e,!!this._incremental)},DT._setCommon=function(t,e,i){var n=e.hostModel,o=e.getVisual("symbolSize");t.setShape("size",o instanceof Array?o:[o,o]),t.symbolProxy=ml(e.getVisual("symbol"),0,0,0,0),t.setColor=t.symbolProxy.setColor;var a=t.shape.size[0]<4;t.useStyle(n.getModel("itemStyle").getItemStyle(a?["color","shadowBlur","shadowColor"]:["color"]));var r=e.getVisual("color");r&&t.setColor(r),i||(t.seriesIndex=n.seriesIndex,t.on("mousemove",function(e){t.dataIndex=null;var i=t.findDataIndex(e.offsetX,e.offsetY);i>=0&&(t.dataIndex=i+(t.startIndex||0))}))},DT.remove=function(){this._clearIncremental(),this._incremental=null,this.group.removeAll()},DT._clearIncremental=function(){var t=this._incremental;t&&t.clearDisplaybles()},xs({type:"scatter",render:function(t,e,i){var n=t.getData();this._updateSymbolDraw(n,t).updateData(n),this._finished=!0},incrementalPrepareRender:function(t,e,i){var n=t.getData();this._updateSymbolDraw(n,t).incrementalPrepareUpdate(n),this._finished=!1},incrementalRender:function(t,e,i){this._symbolDraw.incrementalUpdate(t,e.getData()),this._finished=t.end===e.getData().count()},updateTransform:function(t,e,i){var n=t.getData();if(this.group.dirty(),!this._finished||n.count()>1e4||!this._symbolDraw.isPersistent())return{update:!0};var o=PD().reset(t);o.progress&&o.progress({start:0,end:n.count()},n),this._symbolDraw.updateLayout(n)},_updateSymbolDraw:function(t,e){var i=this._symbolDraw,n=e.pipelineContext.large;return i&&n===this._isLargeDraw||(i&&i.remove(),i=this._symbolDraw=n?new Hu:new Al,this._isLargeDraw=n,this.group.removeAll()),this.group.add(i.group),i},remove:function(t,e){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},dispose:function(){}}),fs(kD("scatter","circle")),ds(PD("scatter")),u(Zu,dD),Uu.prototype.getIndicatorAxes=function(){return this._indicatorAxes},Uu.prototype.dataToPoint=function(t,e){var i=this._indicatorAxes[e];return this.coordToPoint(i.dataToCoord(t),e)},Uu.prototype.coordToPoint=function(t,e){var i=this._indicatorAxes[e].angle;return[this.cx+t*Math.cos(i),this.cy-t*Math.sin(i)]},Uu.prototype.pointToData=function(t){var e=t[0]-this.cx,i=t[1]-this.cy,n=Math.sqrt(e*e+i*i);e/=n,i/=n;for(var o,a=Math.atan2(-i,e),r=1/0,s=-1,l=0;ln[0]&&isFinite(c)&&isFinite(n[0]))}else{r.getTicks().length-1>a&&(u=i(u));var d=Math.round((n[0]+n[1])/2/u)*u,f=Math.round(a/2);r.setExtent(Ao(d-f*u),Ao(d+(a-f)*u)),r.setInterval(u)}})},Uu.dimensions=[],Uu.create=function(t,e){var i=[];return t.eachComponent("radar",function(n){var o=new Uu(n,t,e);i.push(o),n.coordinateSystem=o}),t.eachSeriesByType("radar",function(t){"radar"===t.get("coordinateSystem")&&(t.coordinateSystem=i[t.get("radarIndex")||0])}),i},Ca.register("radar",Uu);var TT=BD.valueAxis,AT=(ms({type:"radar",optionUpdated:function(){var t=this.get("boundaryGap"),e=this.get("splitNumber"),o=this.get("scale"),s=this.get("axisLine"),l=this.get("axisTick"),u=this.get("axisLabel"),h=this.get("name"),c=this.get("name.show"),d=this.get("name.formatter"),p=this.get("nameGap"),g=this.get("triggerEvent"),m=f(this.get("indicator")||[],function(f){null!=f.max&&f.max>0&&!f.min?f.min=0:null!=f.min&&f.min<0&&!f.max&&(f.max=0);var m=h;if(null!=f.color&&(m=r({color:f.color},h)),f=n(i(f),{boundaryGap:t,splitNumber:e,scale:o,axisLine:s,axisTick:l,axisLabel:u,name:f.text,nameLocation:"end",nameGap:p,nameTextStyle:m,triggerEvent:g},!1),c||(f.name=""),"string"==typeof d){var v=f.name;f.name=d.replace("{value}",null!=v?v:"")}else"function"==typeof d&&(f.name=d(f.name,f));var y=a(new wo(f,null,this.ecModel),JI);return y.mainType="radar",y.componentIndex=this.componentIndex,y},this);this.getIndicatorModels=function(){return m}},defaultOption:{zlevel:0,z:0,center:["50%","50%"],radius:"75%",startAngle:90,name:{show:!0},boundaryGap:[0,0],splitNumber:5,nameGap:15,scale:!1,shape:"polygon",axisLine:n({lineStyle:{color:"#bbb"}},TT.axisLine),axisLabel:ju(TT.axisLabel,!1),axisTick:ju(TT.axisTick,!1),splitLine:ju(TT.splitLine,!0),splitArea:ju(TT.splitArea,!0),indicator:[]}}),["axisLine","axisTickLabel","axisName"]);vs({type:"radar",render:function(t,e,i){this.group.removeAll(),this._buildAxes(t),this._buildSplitLineAndArea(t)},_buildAxes:function(t){var e=t.coordinateSystem;d(f(e.getIndicatorAxes(),function(t){return new qD(t.model,{position:[e.cx,e.cy],rotation:t.angle,labelDirection:-1,tickDirection:-1,nameDirection:1})}),function(t){d(AT,t.add,t),this.group.add(t.getGroup())},this)},_buildSplitLineAndArea:function(t){function e(t,e,i){var n=i%e.length;return t[n]=t[n]||[],n}var i=t.coordinateSystem,n=i.getIndicatorAxes();if(n.length){var o=t.get("shape"),a=t.getModel("splitLine"),s=t.getModel("splitArea"),l=a.getModel("lineStyle"),u=s.getModel("areaStyle"),h=a.get("show"),c=s.get("show"),p=l.get("color"),g=u.get("color");p=y(p)?p:[p],g=y(g)?g:[g];var m=[],v=[];if("circle"===o)for(var x=n[0].getTicksCoords(),_=i.cx,w=i.cy,b=0;b"+f(i,function(i,n){var o=e.get(e.mapDimension(i.dim),t);return Zo(i.name+" : "+o)}).join("
")},defaultOption:{zlevel:0,z:2,coordinateSystem:"radar",legendHoverLink:!0,radarIndex:0,lineStyle:{width:2,type:"solid"},label:{position:"top"},symbol:"emptyCircle",symbolSize:4}});xs({type:"radar",render:function(t,e,n){function o(t,e){var i=t.getItemVisual(e,"symbol")||"circle",n=t.getItemVisual(e,"color");if("none"!==i){var o=Xu(t.getItemVisual(e,"symbolSize")),a=ml(i,-1,-1,2,2,n);return a.attr({style:{strokeNoScale:!0},z2:100,scale:[o[0]/2,o[1]/2]}),a}}function a(e,i,n,a,r,s){n.removeAll();for(var l=0;l"+Zo(n+" : "+i)},getTooltipPosition:function(t){if(null!=t){var e=this.getData().getName(t),i=this.coordinateSystem,n=i.getRegion(e);return n&&i.dataToPoint(n.center)}},setZoom:function(t){this.option.zoom=t},setCenter:function(t){this.option.center=t},defaultOption:{zlevel:0,z:2,coordinateSystem:"geo",map:"",left:"center",top:"center",aspectScale:.75,showLegendSymbol:!0,dataRangeHoverLink:!0,boundingCoords:null,center:null,zoom:1,scaleLimit:null,label:{show:!1,color:"#000"},itemStyle:{borderWidth:.5,borderColor:"#444",areaColor:"#eee"},emphasis:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{areaColor:"rgba(255,215,0,0.8)"}}}});h(GT,mT);var FT="\0_ec_interaction_mutex";hs({type:"takeGlobalCursor",event:"globalCursorTaken",update:"update"},function(){}),h(ah,$x);var WT={axisPointer:1,tooltip:1,brush:1};xh.prototype={constructor:xh,draw:function(t,e,i,n,o){var a="geo"===t.mainType,r=t.getData&&t.getData();a&&e.eachComponent({mainType:"series",subType:"map"},function(e){r||e.getHostGeoModel()!==t||(r=e.getData())});var s=t.coordinateSystem,l=this.group,u=s.scale,h={position:s.position,scale:u};!l.childAt(0)||o?l.attr(h):fo(l,h,t),l.removeAll();var c=["itemStyle"],f=["emphasis","itemStyle"],p=["label"],g=["emphasis","label"],m=z();d(s.regions,function(e){var i=m.get(e.name)||m.set(e.name,new L_),n=new Kb({shape:{paths:[]}});i.add(n);var o,s=(C=t.getRegionModel(e.name)||t).getModel(c),h=C.getModel(f),v=mh(s),y=mh(h),x=C.getModel(p),_=C.getModel(g);if(r){o=r.indexOfName(e.name);var w=r.getItemVisual(o,"color",!0);w&&(v.fill=w)}d(e.geometries,function(t){if("polygon"===t.type){n.shape.paths.push(new Zb({shape:{points:t.exterior}}));for(var e=0;e<(t.interiors?t.interiors.length:0);e++)n.shape.paths.push(new Zb({shape:{points:t.interiors[e]}}))}}),n.setStyle(v),n.style.strokeNoScale=!0,n.culling=!0;var b=x.get("show"),S=_.get("show"),M=r&&isNaN(r.get(r.mapDimension("value"),o)),I=r&&r.getItemLayout(o);if(a||M&&(b||S)||I&&I.showLabel){var D,T=a?e.name:o;(!r||o>=0)&&(D=t);var A=new zb({position:e.center.slice(),scale:[1/u[0],1/u[1]],z2:10,silent:!0});io(A.style,A.hoverStyle={},x,_,{labelFetcher:D,labelDataIndex:T,defaultText:e.name,useInsideStyle:!1},{textAlign:"center",textVerticalAlign:"middle"}),i.add(A)}if(r)r.setItemGraphicEl(o,i);else{var C=t.getRegionModel(e.name);n.eventData={componentType:"geo",geoIndex:t.componentIndex,name:e.name,region:C&&C.option||{}}}(i.__regions||(i.__regions=[])).push(e),eo(i,y,{hoverSilentOnTouch:!!t.get("selectedMode")}),l.add(i)}),this._updateController(t,e,i),vh(this,t,l,i,n),yh(t,l)},remove:function(){this.group.removeAll(),this._controller.dispose(),this._controllerHost={}},_updateController:function(t,e,i){function n(){var e={type:"geoRoam",componentType:l};return e[l+"Id"]=t.id,e}var o=t.coordinateSystem,r=this._controller,s=this._controllerHost;s.zoomLimit=t.get("scaleLimit"),s.zoom=o.getZoom(),r.enable(t.get("roam")||!1);var l=t.mainType;r.off("pan").on("pan",function(t,e){this._mouseDownFlag=!1,fh(s,t,e),i.dispatchAction(a(n(),{dx:t,dy:e}))},this),r.off("zoom").on("zoom",function(t,e,o){if(this._mouseDownFlag=!1,ph(s,t,e,o),i.dispatchAction(a(n(),{zoom:t,originX:e,originY:o})),this._updateGroup){var r=this.group,l=r.scale;r.traverse(function(t){"text"===t.type&&t.attr("scale",[1/l[0],1/l[1]])})}},this),r.setPointerChecker(function(e,n,a){return o.getViewRectAfterRoam().contain(n,a)&&!gh(e,i,t)})}},xs({type:"map",render:function(t,e,i,n){if(!n||"mapToggleSelect"!==n.type||n.from!==this.uid){var o=this.group;if(o.removeAll(),!t.getHostGeoModel()){if(n&&"geoRoam"===n.type&&"series"===n.componentType&&n.seriesId===t.id)(a=this._mapDraw)&&o.add(a.group);else if(t.needsDrawMap){var a=this._mapDraw||new xh(i,!0);o.add(a.group),a.draw(t,e,i,this,n),this._mapDraw=a}else this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null;t.get("showLegendSymbol")&&e.getComponent("legend")&&this._renderSymbols(t,e,i)}}},remove:function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null,this.group.removeAll()},dispose:function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null},_renderSymbols:function(t,e,i){var n=t.originalData,o=this.group;n.each(n.mapDimension("value"),function(e,i){if(!isNaN(e)){var a=n.getItemLayout(i);if(a&&a.point){var r=a.point,s=a.offset,l=new Rb({style:{fill:t.getData().getVisual("color")},shape:{cx:r[0]+9*s,cy:r[1],r:3},silent:!0,z2:s?8:10});if(!s){var u=t.mainSeries.getData(),h=n.getName(i),c=u.indexOfName(h),d=n.getItemModel(i),f=d.getModel("label"),p=d.getModel("emphasis.label"),g=u.getItemGraphicEl(c),m=T(t.getFormattedLabel(i,"normal"),h),v=T(t.getFormattedLabel(i,"emphasis"),m),y=function(){var t=no({},p,{text:p.get("show")?v:null},{isRectText:!0,useInsideStyle:!1},!0);l.style.extendFrom(t),l.__mapOriginalZ2=l.z2,l.z2+=1},x=function(){no(l.style,f,{text:f.get("show")?m:null,textPosition:f.getShallow("position")||"bottom"},{isRectText:!0,useInsideStyle:!1}),null!=l.__mapOriginalZ2&&(l.z2=l.__mapOriginalZ2,l.__mapOriginalZ2=null)};g.on("mouseover",y).on("mouseout",x).on("emphasis",y).on("normal",x),x()}o.add(l)}}})}}),hs({type:"geoRoam",event:"geoRoam",update:"updateTransform"},function(t,e){var i=t.componentType||"series";e.eachComponent({mainType:i,query:t},function(e){var n=e.coordinateSystem;if("geo"===n.type){var o=_h(n,t,e.get("scaleLimit"));e.setCenter&&e.setCenter(o.center),e.setZoom&&e.setZoom(o.zoom),"series"===i&&d(e.seriesGroup,function(t){t.setCenter(o.center),t.setZoom(o.zoom)})}})});ds(function(t){var e={};t.eachSeriesByType("map",function(i){var n=i.getMapType();if(!i.getHostGeoModel()&&!e[n]){var o={};d(i.seriesGroup,function(e){var i=e.coordinateSystem,n=e.originalData;e.get("showLegendSymbol")&&t.getComponent("legend")&&n.each(n.mapDimension("value"),function(t,e){var a=n.getName(e),r=i.getRegion(a);if(r&&!isNaN(t)){var s=o[a]||0,l=i.dataToPoint(r.center);o[a]=s+1,n.setItemLayout(e,{point:l,offset:s})}})});var a=i.getData();a.each(function(t){var e=a.getName(t),i=a.getItemLayout(t)||{};i.showLabel=!o[e],a.setItemLayout(t,i)}),e[n]=!0}})}),fs(function(t){t.eachSeriesByType("map",function(t){var e=t.get("color"),i=t.getModel("itemStyle"),n=i.get("areaColor"),o=i.get("color")||e[t.seriesIndex%e.length];t.getData().setVisual({areaColor:n,color:o})})}),us(qM.PROCESSOR.STATISTIC,function(t){var e={};t.eachSeriesByType("map",function(t){var i=t.getHostGeoModel(),n=i?"o"+i.id:"i"+t.getMapType();(e[n]=e[n]||[]).push(t)}),d(e,function(t,e){for(var i=wh(f(t,function(t){return t.getData()}),t[0].get("mapValueCalculation")),n=0;ne&&(e=n.height)}this.height=e+1},getNodeById:function(t){if(this.getId()===t)return this;for(var e=0,i=this.children,n=i.length;e=0&&this.hostTree.data.setItemLayout(this.dataIndex,t,e)},getLayout:function(){return this.hostTree.data.getItemLayout(this.dataIndex)},getModel:function(t){if(!(this.dataIndex<0)){var e,i=this.hostTree,n=i.data.getItemModel(this.dataIndex),o=this.getLevelModel();return o||0!==this.children.length&&(0===this.children.length||!1!==this.isExpand)||(e=this.getLeavesModel()),n.getModel(t,(o||e||i.hostModel).getModel(t))}},getLevelModel:function(){return(this.hostTree.levelModels||[])[this.depth]},getLeavesModel:function(){return this.hostTree.leavesModel},setVisual:function(t,e){this.dataIndex>=0&&this.hostTree.data.setItemVisual(this.dataIndex,t,e)},getVisual:function(t,e){return this.hostTree.data.getItemVisual(this.dataIndex,t,e)},getRawIndex:function(){return this.hostTree.data.getRawIndex(this.dataIndex)},getId:function(){return this.hostTree.data.getId(this.dataIndex)},isAncestorOf:function(t){for(var e=t.parentNode;e;){if(e===this)return!0;e=e.parentNode}return!1},isDescendantOf:function(t){return t!==this&&t.isAncestorOf(this)}},Lh.prototype={constructor:Lh,type:"tree",eachNode:function(t,e,i){this.root.eachNode(t,e,i)},getNodeByDataIndex:function(t){var e=this.data.getRawIndex(t);return this._nodes[e]},getNodeByName:function(t){return this.root.getNodeByName(t)},update:function(){for(var t=this.data,e=this._nodes,i=0,n=e.length;ia&&(a=t.depth)});var r=t.expandAndCollapse&&t.initialTreeDepth>=0?t.initialTreeDepth:a;return o.root.eachNode("preorder",function(t){var e=t.hostTree.data.getRawDataItem(t.dataIndex);t.isExpand=e&&null!=e.collapsed?!e.collapsed:t.depth<=r}),o.data},formatTooltip:function(t){for(var e=this.getData().tree,i=e.root.children[0],n=e.getNodeByDataIndex(t),o=n.getValue(),a=n.name;n&&n!==i;)a=n.parentNode.name+"."+a,n=n.parentNode;return Zo(a+(isNaN(o)||null==o?"":" : "+o))},defaultOption:{zlevel:0,z:2,left:"12%",top:"12%",right:"12%",bottom:"12%",layout:"orthogonal",orient:"horizontal",symbol:"emptyCircle",symbolSize:7,expandAndCollapse:!0,initialTreeDepth:2,lineStyle:{color:"#ccc",width:1.5,curveness:.5},itemStyle:{color:"lightsteelblue",borderColor:"#c23531",borderWidth:1.5},label:{show:!0,color:"#555"},leaves:{label:{show:!0}},animationEasing:"linear",animationDuration:700,animationDurationUpdate:1e3}}),xs({type:"tree",init:function(t,e){this._oldTree,this._mainGroup=new L_,this.group.add(this._mainGroup)},render:function(t,e,i,n){var o=t.getData(),a=t.layoutInfo,r=this._mainGroup,s=t.get("layout");"radial"===s?r.attr("position",[a.x+a.width/2,a.y+a.height/2]):r.attr("position",[a.x,a.y]);var l=this._data,u={expandAndCollapse:t.get("expandAndCollapse"),layout:s,orient:t.get("orient"),curvature:t.get("lineStyle.curveness"),symbolRotate:t.get("symbolRotate"),symbolOffset:t.get("symbolOffset"),hoverAnimation:t.get("hoverAnimation"),useNameLabel:!0,fadeIn:!0};o.diff(l).add(function(e){Uh(o,e)&&Xh(o,e,null,r,t,u)}).update(function(e,i){var n=l.getItemGraphicEl(i);Uh(o,e)?Xh(o,e,n,r,t,u):n&&Yh(o,e,n,r,t,u)}).remove(function(e){var i=l.getItemGraphicEl(e);Yh(o,e,i,r,t,u)}).execute(),!0===u.expandAndCollapse&&o.eachItemGraphicEl(function(e,n){e.off("click").on("click",function(){i.dispatchAction({type:"treeExpandAndCollapse",seriesId:t.id,dataIndex:n})})}),this._data=o},dispose:function(){},remove:function(){this._mainGroup.removeAll(),this._data=null}}),hs({type:"treeExpandAndCollapse",event:"treeExpandAndCollapse",update:"update"},function(t,e){e.eachComponent({mainType:"series",subType:"tree",query:t},function(e){var i=t.dataIndex,n=e.getData().tree.getNodeByDataIndex(i);n.isExpand=!n.isExpand})});var XT=function(t,e){var i=Rh(t,e);t.layoutInfo=i;var n=t.get("layout"),o=0,a=0,r=null;"radial"===n?(o=2*Math.PI,a=Math.min(i.height,i.width)/2,r=Eh(function(t,e){return(t.parentNode===e.parentNode?1:2)/t.depth})):(o=i.width,a=i.height,r=Eh());var s=t.getData().tree.root,l=s.children[0];Ph(s),$h(l,Nh,r),s.hierNode.modifier=-l.hierNode.prelim,Kh(l,Oh);var u=l,h=l,c=l;Kh(l,function(t){var e=t.getLayout().x;eh.getLayout().x&&(h=t),t.depth>c.depth&&(c=t)});var d=u===h?1:r(u,h)/2,f=d-u.getLayout().x,p=0,g=0,m=0,v=0;"radial"===n?(p=o/(h.getLayout().x+d+f),g=a/(c.depth-1||1),Kh(l,function(t){m=(t.getLayout().x+f)*p,v=(t.depth-1)*g;var e=zh(m,v);t.setLayout({x:e.x,y:e.y,rawX:m,rawY:v},!0)})):"horizontal"===t.get("orient")?(g=a/(h.getLayout().x+d+f),p=o/(c.depth-1||1),Kh(l,function(t){v=(t.getLayout().x+f)*g,m=(t.depth-1)*p,t.setLayout({x:m,y:v},!0)})):(p=o/(h.getLayout().x+d+f),g=a/(c.depth-1||1),Kh(l,function(t){m=(t.getLayout().x+f)*p,v=(t.depth-1)*g,t.setLayout({x:m,y:v},!0)}))};fs(kD("tree","circle")),ds(function(t,e){t.eachSeriesByType("tree",function(t){XT(t,e)})}),ds(function(t,e){t.eachSeriesByType("tree",function(t){XT(t,e)})}),mM.extend({type:"series.treemap",layoutMode:"box",dependencies:["grid","polar"],_viewRoot:null,defaultOption:{progressive:0,hoverLayerThreshold:1/0,left:"center",top:"middle",right:null,bottom:null,width:"80%",height:"80%",sort:!0,clipWindow:"origin",squareRatio:.5*(1+Math.sqrt(5)),leafDepth:null,drillDownIcon:"▶",zoomToNodeRatio:.1024,roam:!0,nodeClick:"zoomToNode",animation:!0,animationDurationUpdate:900,animationEasing:"quinticInOut",breadcrumb:{show:!0,height:22,left:"center",top:"bottom",emptyItemWidth:25,itemStyle:{color:"rgba(0,0,0,0.7)",borderColor:"rgba(255,255,255,0.7)",borderWidth:1,shadowColor:"rgba(150,150,150,1)",shadowBlur:3,shadowOffsetX:0,shadowOffsetY:0,textStyle:{color:"#fff"}},emphasis:{textStyle:{}}},label:{show:!0,distance:0,padding:5,position:"inside",color:"#fff",ellipsis:!0},upperLabel:{show:!1,position:[0,"50%"],height:20,color:"#fff",ellipsis:!0,verticalAlign:"middle"},itemStyle:{color:null,colorAlpha:null,colorSaturation:null,borderWidth:0,gapWidth:0,borderColor:"#fff",borderColorSaturation:null},emphasis:{upperLabel:{show:!0,position:[0,"50%"],color:"#fff",ellipsis:!0,verticalAlign:"middle"}},visualDimension:0,visualMin:null,visualMax:null,color:[],colorAlpha:null,colorSaturation:null,colorMappingBy:"index",visibleMin:10,childrenVisibleMin:null,levels:[]},getInitialData:function(t,e){var i={name:t.name,children:t.data};ic(i);var n=t.levels||[];n=t.levels=nc(n,e);var o={};return o.levels=n,Lh.createTree(i,this,o).data},optionUpdated:function(){this.resetViewRoot()},formatTooltip:function(t){var e=this.getData(),i=this.getRawValue(t),n=Wo(y(i)?i[0]:i);return Zo(e.getName(t)+": "+n)},getDataParams:function(t){var e=mM.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(t);return e.treePathInfo=ec(i,this),e},setLayoutInfo:function(t){this.layoutInfo=this.layoutInfo||{},a(this.layoutInfo,t)},mapIdToIndex:function(t){var e=this._idIndexMap;e||(e=this._idIndexMap=z(),this._idIndexMapCount=0);var i=e.get(t);return null==i&&e.set(t,i=this._idIndexMapCount++),i},getViewRoot:function(){return this._viewRoot},resetViewRoot:function(t){t?this._viewRoot=t:t=this._viewRoot;var e=this.getRawData().tree.root;t&&(t===e||e.contains(t))||(this._viewRoot=e)}});var YT=5;oc.prototype={constructor:oc,render:function(t,e,i,n){var o=t.getModel("breadcrumb"),a=this.group;if(a.removeAll(),o.get("show")&&i){var r=o.getModel("itemStyle"),s=r.getModel("textStyle"),l={pos:{left:o.get("left"),right:o.get("right"),top:o.get("top"),bottom:o.get("bottom")},box:{width:e.getWidth(),height:e.getHeight()},emptyItemWidth:o.get("emptyItemWidth"),totalWidth:0,renderList:[]};this._prepare(i,l,s),this._renderContent(t,l,r,s,n),ta(a,l.pos,l.box)}},_prepare:function(t,e,i){for(var n=t;n;n=n.parentNode){var o=n.getModel().get("name"),a=i.getTextRect(o),r=Math.max(a.width+16,e.emptyItemWidth);e.totalWidth+=r+8,e.renderList.push({node:n,text:o,width:r})}},_renderContent:function(t,e,i,n,o){for(var a=0,s=e.emptyItemWidth,l=t.get("breadcrumb.height"),u=Jo(e.pos,e.box),h=e.totalWidth,c=e.renderList,d=c.length-1;d>=0;d--){var f=c[d],p=f.node,g=f.width,m=f.text;h>u.width&&(h-=g-s,g=s,m=null);var y=new Zb({shape:{points:ac(a,0,g,l,d===c.length-1,0===d)},style:r(i.getItemStyle(),{lineJoin:"bevel",text:m,textFill:n.getTextColor(),textFont:n.getFont()}),z:10,onclick:v(o,p)});this.group.add(y),rc(y,t,p),a+=g+8}},remove:function(){this.group.removeAll()}};var qT=m,$T=L_,KT=jb,JT=d,QT=["label"],tA=["emphasis","label"],eA=["upperLabel"],iA=["emphasis","upperLabel"],nA=10,oA=1,aA=2,rA=Lw([["fill","color"],["stroke","strokeColor"],["lineWidth","strokeWidth"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]),sA=function(t){var e=rA(t);return e.stroke=e.fill=e.lineWidth=null,e};xs({type:"treemap",init:function(t,e){this._containerGroup,this._storage={nodeGroup:[],background:[],content:[]},this._oldTree,this._breadcrumb,this._controller,this._state="ready"},render:function(t,e,i,n){if(!(l(e.findComponents({mainType:"series",subType:"treemap",query:n}),t)<0)){this.seriesModel=t,this.api=i,this.ecModel=e;var o=Jh(n,["treemapZoomToNode","treemapRootToNode"],t),a=n&&n.type,r=t.layoutInfo,s=!this._oldTree,u=this._storage,h="treemapRootToNode"===a&&o&&u?{rootNodeGroup:u.nodeGroup[o.node.getRawIndex()],direction:n.direction}:null,c=this._giveContainerGroup(r),d=this._doRender(c,t,h);s||a&&"treemapZoomToNode"!==a&&"treemapRootToNode"!==a?d.renderFinally():this._doAnimation(c,d,t,h),this._resetController(i),this._renderBreadcrumb(t,i,o)}},_giveContainerGroup:function(t){var e=this._containerGroup;return e||(e=this._containerGroup=new $T,this._initEvents(e),this.group.add(e)),e.attr("position",[t.x,t.y]),e},_doRender:function(t,e,i){function n(t,e,i,o,a){function r(t){return t.getId()}function s(r,s){var l=null!=r?t[r]:null,u=null!=s?e[s]:null,c=h(l,u,i,a);c&&n(l&&l.viewChildren||[],u&&u.viewChildren||[],c,o,a+1)}o?(e=t,JT(t,function(t,e){!t.isRemoved()&&s(e,e)})):new bs(e,t,r,r).add(s).update(s).remove(v(s,null)).execute()}var o=e.getData().tree,a=this._oldTree,r={nodeGroup:[],background:[],content:[]},s={nodeGroup:[],background:[],content:[]},l=this._storage,u=[],h=v(lc,e,s,l,i,r,u);n(o.root?[o.root]:[],a&&a.root?[a.root]:[],t,o===a||!a,0);var c=function(t){var e={nodeGroup:[],background:[],content:[]};return t&&JT(t,function(t,i){var n=e[i];JT(t,function(t){t&&(n.push(t),t.__tmWillDelete=1)})}),e}(l);return this._oldTree=o,this._storage=s,{lastsForAnimation:r,willDeleteEls:c,renderFinally:function(){JT(c,function(t){JT(t,function(t){t.parent&&t.parent.remove(t)})}),JT(u,function(t){t.invisible=!0,t.dirty()})}}},_doAnimation:function(t,e,i,n){if(i.get("animation")){var o=i.get("animationDurationUpdate"),r=i.get("animationEasing"),s=sc();JT(e.willDeleteEls,function(t,e){JT(t,function(t,i){if(!t.invisible){var a,l=t.parent;if(n&&"drillDown"===n.direction)a=l===n.rootNodeGroup?{shape:{x:0,y:0,width:l.__tmNodeWidth,height:l.__tmNodeHeight},style:{opacity:0}}:{style:{opacity:0}};else{var u=0,h=0;l.__tmWillDelete||(u=l.__tmNodeWidth/2,h=l.__tmNodeHeight/2),a="nodeGroup"===e?{position:[u,h],style:{opacity:0}}:{shape:{x:u,y:h,width:0,height:0},style:{opacity:0}}}a&&s.add(t,a,o,r)}})}),JT(this._storage,function(t,i){JT(t,function(t,n){var l=e.lastsForAnimation[i][n],u={};l&&("nodeGroup"===i?l.old&&(u.position=t.position.slice(),t.attr("position",l.old)):(l.old&&(u.shape=a({},t.shape),t.setShape(l.old)),l.fadein?(t.setStyle("opacity",0),u.style={opacity:1}):1!==t.style.opacity&&(u.style={opacity:1})),s.add(t,u,o,r))})},this),this._state="animating",s.done(qT(function(){this._state="ready",e.renderFinally()},this)).start()}},_resetController:function(t){var e=this._controller;e||((e=this._controller=new ah(t.getZr())).enable(this.seriesModel.get("roam")),e.on("pan",qT(this._onPan,this)),e.on("zoom",qT(this._onZoom,this)));var i=new Kt(0,0,t.getWidth(),t.getHeight());e.setPointerChecker(function(t,e,n){return i.contain(e,n)})},_clearController:function(){var t=this._controller;t&&(t.dispose(),t=null)},_onPan:function(t,e){if("animating"!==this._state&&(Math.abs(t)>3||Math.abs(e)>3)){var i=this.seriesModel.getData().tree.root;if(!i)return;var n=i.getLayout();if(!n)return;this.api.dispatchAction({type:"treemapMove",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:n.x+t,y:n.y+e,width:n.width,height:n.height}})}},_onZoom:function(t,e,i){if("animating"!==this._state){var n=this.seriesModel.getData().tree.root;if(!n)return;var o=n.getLayout();if(!o)return;var a=new Kt(o.x,o.y,o.width,o.height),r=this.seriesModel.layoutInfo;e-=r.x,i-=r.y;var s=st();ct(s,s,[-e,-i]),ft(s,s,[t,t]),ct(s,s,[e,i]),a.applyTransform(s),this.api.dispatchAction({type:"treemapRender",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:a.x,y:a.y,width:a.width,height:a.height}})}},_initEvents:function(t){t.on("click",function(t){if("ready"===this._state){var e=this.seriesModel.get("nodeClick",!0);if(e){var i=this.findTarget(t.offsetX,t.offsetY);if(i){var n=i.node;if(n.getLayout().isLeafRoot)this._rootToNode(i);else if("zoomToNode"===e)this._zoomToNode(i);else if("link"===e){var o=n.hostTree.data.getItemModel(n.dataIndex),a=o.get("link",!0),r=o.get("target",!0)||"blank";a&&window.open(a,r)}}}}},this)},_renderBreadcrumb:function(t,e,i){i||(i=null!=t.get("leafDepth",!0)?{node:t.getViewRoot()}:this.findTarget(e.getWidth()/2,e.getHeight()/2))||(i={node:t.getData().tree.root}),(this._breadcrumb||(this._breadcrumb=new oc(this.group))).render(t,e,i.node,qT(function(e){"animating"!==this._state&&(tc(t.getViewRoot(),e)?this._rootToNode({node:e}):this._zoomToNode({node:e}))},this))},remove:function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage={nodeGroup:[],background:[],content:[]},this._state="ready",this._breadcrumb&&this._breadcrumb.remove()},dispose:function(){this._clearController()},_zoomToNode:function(t){this.api.dispatchAction({type:"treemapZoomToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:t.node})},_rootToNode:function(t){this.api.dispatchAction({type:"treemapRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:t.node})},findTarget:function(t,e){var i;return this.seriesModel.getViewRoot().eachNode({attr:"viewChildren",order:"preorder"},function(n){var o=this._storage.background[n.getRawIndex()];if(o){var a=o.transformCoordToLocal(t,e),r=o.shape;if(!(r.x<=a[0]&&a[0]<=r.x+r.width&&r.y<=a[1]&&a[1]<=r.y+r.height))return!1;i={node:n,offsetX:a[0],offsetY:a[1]}}},this),i}});for(var lA=["treemapZoomToNode","treemapRender","treemapMove"],uA=0;uA=0&&t.call(e,i[o],o)},CA.eachEdge=function(t,e){for(var i=this.edges,n=i.length,o=0;o=0&&i[o].node1.dataIndex>=0&&i[o].node2.dataIndex>=0&&t.call(e,i[o],o)},CA.breadthFirstTraverse=function(t,e,i,n){if(Wc.isInstance(e)||(e=this._nodesMap[Fc(e)]),e){for(var o="out"===i?"outEdges":"in"===i?"inEdges":"edges",a=0;a=0&&i.node2.dataIndex>=0});for(var o=0,a=n.length;o=0&&this[t][e].setItemVisual(this.dataIndex,i,n)},getVisual:function(i,n){return this[t][e].getItemVisual(this.dataIndex,i,n)},setLayout:function(i,n){this.dataIndex>=0&&this[t][e].setItemLayout(this.dataIndex,i,n)},getLayout:function(){return this[t][e].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[t][e].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[t][e].getRawIndex(this.dataIndex)}}};h(Wc,LA("hostGraph","data")),h(Hc,LA("hostGraph","edgeData")),AA.Node=Wc,AA.Edge=Hc,Fi(Wc),Fi(Hc);var kA=function(t,e,i,n,o){for(var a=new AA(n),r=0;r "+d)),u++)}var f,p=i.get("coordinateSystem");if("cartesian2d"===p||"polar"===p)f=Hs(t,i);else{var g=Ca.get(p),m=CI(t,{coordDimensions:(g&&"view"!==g.type?g.dimensions||[]:[]).concat(["value"])});(f=new DI(m,i)).initData(t)}var v=new DI(["value"],i);return v.initData(l,s),o&&o(f,v),bh({mainData:f,struct:a,structAttr:"graph",datas:{node:f,edge:v},datasAttr:{node:"data",edge:"edgeData"}}),a.update(),a},PA=ys({type:"series.graph",init:function(t){PA.superApply(this,"init",arguments),this.legendDataProvider=function(){return this._categoriesData},this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},mergeOption:function(t){PA.superApply(this,"mergeOption",arguments),this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},mergeDefaultAndTheme:function(t){PA.superApply(this,"mergeDefaultAndTheme",arguments),Mi(t,["edgeLabel"],["show"])},getInitialData:function(t,e){var i=t.edges||t.links||[],n=t.data||t.nodes||[],o=this;if(n&&i)return kA(n,i,this,!0,function(t,i){function n(t){return(t=this.parsePath(t))&&"label"===t[0]?r:this.parentModel}t.wrapMethod("getItemModel",function(t){var e=o._categoriesModels[t.getShallow("category")];return e&&(e.parentModel=t.parentModel,t.parentModel=e),t});var a=o.getModel("edgeLabel"),r=new wo({label:a.option},a.parentModel,e);i.wrapMethod("getItemModel",function(t){return t.customizeGetParent(n),t})}).data},getGraph:function(){return this.getData().graph},getEdgeData:function(){return this.getGraph().edgeData},getCategoriesData:function(){return this._categoriesData},formatTooltip:function(t,e,i){if("edge"===i){var n=this.getData(),o=this.getDataParams(t,i),a=n.graph.getEdgeByIndex(t),r=n.getName(a.node1.dataIndex),s=n.getName(a.node2.dataIndex),l=[];return null!=r&&l.push(r),null!=s&&l.push(s),l=Zo(l.join(" > ")),o.value&&(l+=" : "+Zo(o.value)),l}return PA.superApply(this,"formatTooltip",arguments)},_updateCategoriesData:function(){var t=f(this.option.categories||[],function(t){return null!=t.value?t:a({value:0},t)}),e=new DI(["value"],this);e.initData(t),this._categoriesData=e,this._categoriesModels=e.mapArray(function(t){return e.getItemModel(t,!0)})},setZoom:function(t){this.option.zoom=t},setCenter:function(t){this.option.center=t},isAnimationEnabled:function(){return PA.superCall(this,"isAnimationEnabled")&&!("force"===this.get("layout")&&this.get("force.layoutAnimation"))},defaultOption:{zlevel:0,z:2,coordinateSystem:"view",legendHoverLink:!0,hoverAnimation:!0,layout:null,focusNodeAdjacency:!1,circular:{rotateLabel:!1},force:{initLayout:null,repulsion:[0,50],gravity:.1,edgeLength:30,layoutAnimation:!0},left:"center",top:"center",symbol:"circle",symbolSize:10,edgeSymbol:["none","none"],edgeSymbolSize:10,edgeLabel:{position:"middle"},draggable:!1,roam:!1,center:null,zoom:1,nodeScaleRatio:.6,label:{show:!1,formatter:"{b}"},itemStyle:{},lineStyle:{color:"#aaa",width:1,curveness:0,opacity:.5},emphasis:{label:{show:!0}}}}),NA=Xb.prototype,OA=qb.prototype,EA=En({type:"ec-line",style:{stroke:"#000",fill:null},shape:{x1:0,y1:0,x2:0,y2:0,percent:1,cpx1:null,cpy1:null},buildPath:function(t,e){(Zc(e)?NA:OA).buildPath(t,e)},pointAt:function(t){return Zc(this.shape)?NA.pointAt.call(this,t):OA.pointAt.call(this,t)},tangentAt:function(t){var e=this.shape,i=Zc(e)?[e.x2-e.x1,e.y2-e.y1]:OA.tangentAt.call(this,t);return q(i,i)}}),zA=["fromSymbol","toSymbol"],RA=qc.prototype;RA.beforeUpdate=function(){var t=this,e=t.childOfName("fromSymbol"),i=t.childOfName("toSymbol"),n=t.childOfName("label");if(e||i||!n.ignore){for(var o=1,a=this.parent;a;)a.scale&&(o/=a.scale[0]),a=a.parent;var r=t.childOfName("line");if(this.__dirty||r.__dirty){var s=r.shape.percent,l=r.pointAt(0),u=r.pointAt(s),h=U([],u,l);if(q(h,h),e&&(e.attr("position",l),c=r.tangentAt(0),e.attr("rotation",Math.PI/2-Math.atan2(c[1],c[0])),e.attr("scale",[o*s,o*s])),i){i.attr("position",u);var c=r.tangentAt(1);i.attr("rotation",-Math.PI/2-Math.atan2(c[1],c[0])),i.attr("scale",[o*s,o*s])}if(!n.ignore){n.attr("position",u);var d,f,p,g=5*o;if("end"===n.__position)d=[h[0]*g+u[0],h[1]*g+u[1]],f=h[0]>.8?"left":h[0]<-.8?"right":"center",p=h[1]>.8?"top":h[1]<-.8?"bottom":"middle";else if("middle"===n.__position){var m=s/2,v=[(c=r.tangentAt(m))[1],-c[0]],y=r.pointAt(m);v[1]>0&&(v[0]=-v[0],v[1]=-v[1]),d=[y[0]+v[0]*g,y[1]+v[1]*g],f="center",p="bottom";var x=-Math.atan2(c[1],c[0]);u[0].8?"right":h[0]<-.8?"left":"center",p=h[1]>.8?"bottom":h[1]<-.8?"top":"middle";n.attr({style:{textVerticalAlign:n.__verticalAlign||p,textAlign:n.__textAlign||f},position:d,scale:[o,o]})}}}},RA._createLine=function(t,e,i){var n=t.hostModel,o=Xc(t.getItemLayout(e));o.shape.percent=0,po(o,{shape:{percent:1}},n,e),this.add(o);var a=new zb({name:"label"});this.add(a),d(zA,function(i){var n=jc(i,t,e);this.add(n),this[Uc(i)]=t.getItemVisual(e,i)},this),this._updateCommonStl(t,e,i)},RA.updateData=function(t,e,i){var n=t.hostModel,o=this.childOfName("line"),a=t.getItemLayout(e),r={shape:{}};Yc(r.shape,a),fo(o,r,n,e),d(zA,function(i){var n=t.getItemVisual(e,i),o=Uc(i);if(this[o]!==n){this.remove(this.childOfName(i));var a=jc(i,t,e);this.add(a)}this[o]=n},this),this._updateCommonStl(t,e,i)},RA._updateCommonStl=function(t,e,i){var n=t.hostModel,o=this.childOfName("line"),a=i&&i.lineStyle,s=i&&i.hoverLineStyle,l=i&&i.labelModel,u=i&&i.hoverLabelModel;if(!i||t.hasItemOption){var h=t.getItemModel(e);a=h.getModel("lineStyle").getLineStyle(),s=h.getModel("emphasis.lineStyle").getLineStyle(),l=h.getModel("label"),u=h.getModel("emphasis.label")}var c=t.getItemVisual(e,"color"),f=A(t.getItemVisual(e,"opacity"),a.opacity,1);o.useStyle(r({strokeNoScale:!0,fill:"none",stroke:c,opacity:f},a)),o.hoverStyle=s,d(zA,function(t){var e=this.childOfName(t);e&&(e.setColor(c),e.setStyle({opacity:f}))},this);var p,g,m,v=l.getShallow("show"),y=u.getShallow("show"),x=this.childOfName("label");if(v||y){if(p=c||"#000",null==(g=n.getFormattedLabel(e,"normal",t.dataType))){var _=n.getRawValue(e);g=null==_?t.getName(e):isFinite(_)?Ao(_):_}m=T(n.getFormattedLabel(e,"emphasis",t.dataType),g)}if(v){var w=no(x.style,l,{text:g},{autoColor:p});x.__textAlign=w.textAlign,x.__verticalAlign=w.textVerticalAlign,x.__position=l.get("position")||"middle"}else x.setStyle("text",null);x.hoverStyle=y?{text:m,textFill:u.getTextColor(!0),fontStyle:u.getShallow("fontStyle"),fontWeight:u.getShallow("fontWeight"),fontSize:u.getShallow("fontSize"),fontFamily:u.getShallow("fontFamily")}:{text:null},x.ignore=!v&&!y,eo(this)},RA.highlight=function(){this.trigger("emphasis")},RA.downplay=function(){this.trigger("normal")},RA.updateLayout=function(t,e){this.setLinePoints(t.getItemLayout(e))},RA.setLinePoints=function(t){var e=this.childOfName("line");Yc(e.shape,t),e.dirty()},u(qc,L_);var BA=$c.prototype;BA.isPersistent=function(){return!0},BA.updateData=function(t){var e=this,i=e.group,n=e._lineData;e._lineData=t,n||i.removeAll();var o=Qc(t);t.diff(n).add(function(i){Kc(e,t,i,o)}).update(function(i,a){Jc(e,n,t,a,i,o)}).remove(function(t){i.remove(n.getItemGraphicEl(t))}).execute()},BA.updateLayout=function(){var t=this._lineData;t.eachItemGraphicEl(function(e,i){e.updateLayout(t,i)},this)},BA.incrementalPrepareUpdate=function(t){this._seriesScope=Qc(t),this._lineData=null,this.group.removeAll()},BA.incrementalUpdate=function(t,e){for(var i=t.start;i=o/3?1:2),l=e.y-n(r)*a*(a>=o/3?1:2);r=e.angle-Math.PI/2,t.moveTo(s,l),t.lineTo(e.x+i(r)*a,e.y+n(r)*a),t.lineTo(e.x+i(e.angle)*o,e.y+n(e.angle)*o),t.lineTo(e.x-i(r)*a,e.y-n(r)*a),t.lineTo(s,l)}}),$A=2*Math.PI,KA=(pr.extend({type:"gauge",render:function(t,e,i){this.group.removeAll();var n=t.get("axisLine.lineStyle.color"),o=dd(t,i);this._renderMain(t,e,i,n,o)},dispose:function(){},_renderMain:function(t,e,i,n,o){for(var a=this.group,r=t.getModel("axisLine").getModel("lineStyle"),s=t.get("clockwise"),l=-t.get("startAngle")/180*Math.PI,u=-t.get("endAngle")/180*Math.PI,h=(u-l)%$A,c=l,d=r.get("width"),f=0;f=t&&(0===e?0:n[e-1][0]).4?"bottom":"middle",textAlign:T<-.4?"left":T>.4?"right":"center"},{autoColor:P}),silent:!0}))}if(g.get("show")&&D!==v){for(var N=0;N<=y;N++){var T=Math.cos(w),A=Math.sin(w),O=new Xb({shape:{x1:T*c+u,y1:A*c+h,x2:T*(c-_)+u,y2:A*(c-_)+h},silent:!0,style:I});"auto"===I.stroke&&O.setStyle({stroke:n((D+N/y)/v)}),l.add(O),w+=S}w-=S}else w+=b}},_renderPointer:function(t,e,i,n,o,a,r,s){var l=this.group,u=this._data;if(t.get("pointer.show")){var h=[+t.get("min"),+t.get("max")],c=[a,r],d=t.getData(),f=d.mapDimension("value");d.diff(u).add(function(e){var i=new qA({shape:{angle:a}});po(i,{shape:{angle:Do(d.get(f,e),h,c,!0)}},t),l.add(i),d.setItemGraphicEl(e,i)}).update(function(e,i){var n=u.getItemGraphicEl(i);fo(n,{shape:{angle:Do(d.get(f,e),h,c,!0)}},t),l.add(n),d.setItemGraphicEl(e,n)}).remove(function(t){var e=u.getItemGraphicEl(t);l.remove(e)}).execute(),d.eachItemGraphicEl(function(t,e){var i=d.getItemModel(e),a=i.getModel("pointer");t.setShape({x:o.cx,y:o.cy,width:To(a.get("width"),o.r),r:To(a.get("length"),o.r)}),t.useStyle(i.getModel("itemStyle").getItemStyle()),"auto"===t.style.fill&&t.setStyle("fill",n(Do(d.get(f,e),h,[0,1],!0))),eo(t,i.getModel("emphasis.itemStyle").getItemStyle())}),this._data=d}else u&&u.eachItemGraphicEl(function(t){l.remove(t)})},_renderTitle:function(t,e,i,n,o){var a=t.getData(),r=a.mapDimension("value"),s=t.getModel("title");if(s.get("show")){var l=s.get("offsetCenter"),u=o.cx+To(l[0],o.r),h=o.cy+To(l[1],o.r),c=+t.get("min"),d=+t.get("max"),f=n(Do(t.getData().get(r,0),[c,d],[0,1],!0));this.group.add(new zb({silent:!0,style:no({},s,{x:u,y:h,text:a.getName(0),textAlign:"center",textVerticalAlign:"middle"},{autoColor:f,forceRich:!0})}))}},_renderDetail:function(t,e,i,n,o){var a=t.getModel("detail"),r=+t.get("min"),s=+t.get("max");if(a.get("show")){var l=a.get("offsetCenter"),u=o.cx+To(l[0],o.r),h=o.cy+To(l[1],o.r),c=To(a.get("width"),o.r),d=To(a.get("height"),o.r),f=t.getData(),p=f.get(f.mapDimension("value"),0),g=n(Do(p,[r,s],[0,1],!0));this.group.add(new zb({silent:!0,style:no({},a,{x:u,y:h,text:fd(p,a.get("formatter")),textWidth:isNaN(c)?null:c,textHeight:isNaN(d)?null:d,textAlign:"center",textVerticalAlign:"middle"},{autoColor:g,forceRich:!0})}))}}}),ys({type:"series.funnel",init:function(t){KA.superApply(this,"init",arguments),this.legendDataProvider=function(){return this.getRawData()},this._defaultLabelLine(t)},getInitialData:function(t,e){return gT(this,["value"])},_defaultLabelLine:function(t){Mi(t,"labelLine",["show"]);var e=t.labelLine,i=t.emphasis.labelLine;e.show=e.show&&t.label.show,i.show=i.show&&t.emphasis.label.show},getDataParams:function(t){var e=this.getData(),i=KA.superCall(this,"getDataParams",t),n=e.mapDimension("value"),o=e.getSum(n);return i.percent=o?+(e.get(n,t)/o*100).toFixed(2):0,i.$vars.push("percent"),i},defaultOption:{zlevel:0,z:2,legendHoverLink:!0,left:80,top:60,right:80,bottom:60,minSize:"0%",maxSize:"100%",sort:"descending",gap:0,funnelAlign:"center",label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1,type:"solid"}},itemStyle:{borderColor:"#fff",borderWidth:1},emphasis:{label:{show:!0}}}})),JA=pd.prototype,QA=["itemStyle","opacity"];JA.updateData=function(t,e,i){var n=this.childAt(0),o=t.hostModel,a=t.getItemModel(e),s=t.getItemLayout(e),l=t.getItemModel(e).get(QA);l=null==l?1:l,n.useStyle({}),i?(n.setShape({points:s.points}),n.setStyle({opacity:0}),po(n,{style:{opacity:l}},o,e)):fo(n,{style:{opacity:l},shape:{points:s.points}},o,e);var u=a.getModel("itemStyle"),h=t.getItemVisual(e,"color");n.setStyle(r({lineJoin:"round",fill:h},u.getItemStyle(["opacity"]))),n.hoverStyle=u.getModel("emphasis").getItemStyle(),this._updateLabel(t,e),eo(this)},JA._updateLabel=function(t,e){var i=this.childAt(1),n=this.childAt(2),o=t.hostModel,a=t.getItemModel(e),r=t.getItemLayout(e).label,s=t.getItemVisual(e,"color");fo(i,{shape:{points:r.linePoints||r.linePoints}},o,e),fo(n,{style:{x:r.x,y:r.y}},o,e),n.attr({rotation:r.rotation,origin:[r.x,r.y],z2:10});var l=a.getModel("label"),u=a.getModel("emphasis.label"),h=a.getModel("labelLine"),c=a.getModel("emphasis.labelLine"),s=t.getItemVisual(e,"color");io(n.style,n.hoverStyle={},l,u,{labelFetcher:t.hostModel,labelDataIndex:e,defaultText:t.getName(e),autoColor:s,useInsideStyle:!!r.inside},{textAlign:r.textAlign,textVerticalAlign:r.verticalAlign}),n.ignore=n.normalIgnore=!l.get("show"),n.hoverIgnore=!u.get("show"),i.ignore=i.normalIgnore=!h.get("show"),i.hoverIgnore=!c.get("show"),i.setStyle({stroke:s}),i.setStyle(h.getModel("lineStyle").getLineStyle()),i.hoverStyle=c.getModel("lineStyle").getLineStyle()},u(pd,L_);pr.extend({type:"funnel",render:function(t,e,i){var n=t.getData(),o=this._data,a=this.group;n.diff(o).add(function(t){var e=new pd(n,t);n.setItemGraphicEl(t,e),a.add(e)}).update(function(t,e){var i=o.getItemGraphicEl(e);i.updateData(n,t),a.add(i),n.setItemGraphicEl(t,i)}).remove(function(t){var e=o.getItemGraphicEl(t);a.remove(e)}).execute(),this._data=n},remove:function(){this.group.removeAll(),this._data=null},dispose:function(){}});fs(_T("funnel")),ds(function(t,e,i){t.eachSeriesByType("funnel",function(t){var i=t.getData(),n=i.mapDimension("value"),o=t.get("sort"),a=gd(t,e),r=md(i,o),s=[To(t.get("minSize"),a.width),To(t.get("maxSize"),a.width)],l=i.getDataExtent(n),u=t.get("min"),h=t.get("max");null==u&&(u=Math.min(l[0],0)),null==h&&(h=l[1]);var c=t.get("funnelAlign"),d=t.get("gap"),f=(a.height-d*(i.count()-1))/i.count(),p=a.y,g=function(t,e){var o,r=Do(i.get(n,t)||0,[u,h],s,!0);switch(c){case"left":o=a.x;break;case"center":o=a.x+(a.width-r)/2;break;case"right":o=a.x+a.width-r}return[[o,e],[o+r,e]]};"ascending"===o&&(f=-f,d=-d,p+=a.height,r=r.reverse());for(var m=0;ma&&(e[1-n]=e[n]+h.sign*a),e},iC=d,nC=Math.min,oC=Math.max,aC=Math.floor,rC=Math.ceil,sC=Ao,lC=Math.PI;bd.prototype={type:"parallel",constructor:bd,_init:function(t,e,i){var n=t.dimensions,o=t.parallelAxisIndex;iC(n,function(t,i){var n=o[i],a=e.getComponent("parallelAxis",n),r=this._axesMap.set(t,new tC(t,cl(a),[0,0],a.get("type"),n)),s="category"===r.type;r.onBand=s&&a.get("boundaryGap"),r.inverse=a.get("inverse"),a.axis=r,r.model=a,r.coordinateSystem=a.coordinateSystem=this},this)},update:function(t,e){this._updateAxesFromSeries(this._model,t)},containPoint:function(t){var e=this._makeLayoutInfo(),i=e.axisBase,n=e.layoutBase,o=e.pixelDimIndex,a=t[1-o],r=t[o];return a>=i&&a<=i+e.axisLength&&r>=n&&r<=n+e.layoutLength},getModel:function(){return this._model},_updateAxesFromSeries:function(t,e){e.eachSeries(function(i){if(t.contains(i,e)){var n=i.getData();iC(this.dimensions,function(t){var e=this._axesMap.get(t);e.scale.unionExtentFromData(n,n.mapDimension(t)),hl(e.scale,e.model)},this)}},this)},resize:function(t,e){this._rect=Qo(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()}),this._layoutAxes()},getRect:function(){return this._rect},_makeLayoutInfo:function(){var t,e=this._model,i=this._rect,n=["x","y"],o=["width","height"],a=e.get("layout"),r="horizontal"===a?0:1,s=i[o[r]],l=[0,s],u=this.dimensions.length,h=Sd(e.get("axisExpandWidth"),l),c=Sd(e.get("axisExpandCount")||0,[0,u]),d=e.get("axisExpandable")&&u>3&&u>c&&c>1&&h>0&&s>0,f=e.get("axisExpandWindow");f?(t=Sd(f[1]-f[0],l),f[1]=f[0]+t):(t=Sd(h*(c-1),l),(f=[h*(e.get("axisExpandCenter")||aC(u/2))-t/2])[1]=f[0]+t);var p=(s-t)/(u-c);p<3&&(p=0);var g=[aC(sC(f[0]/h,1))+1,rC(sC(f[1]/h,1))-1],m=p/h*f[0];return{layout:a,pixelDimIndex:r,layoutBase:i[n[r]],layoutLength:s,axisBase:i[n[1-r]],axisLength:i[o[1-r]],axisExpandable:d,axisExpandWidth:h,axisCollapseWidth:p,axisExpandWindow:f,axisCount:u,winInnerIndices:g,axisExpandWindow0Pos:m}},_layoutAxes:function(){var t=this._rect,e=this._axesMap,i=this.dimensions,n=this._makeLayoutInfo(),o=n.layout;e.each(function(t){var e=[0,n.axisLength],i=t.inverse?1:0;t.setExtent(e[i],e[1-i])}),iC(i,function(i,a){var r=(n.axisExpandable?Id:Md)(a,n),s={horizontal:{x:r.position,y:n.axisLength},vertical:{x:0,y:r.position}},l={horizontal:lC/2,vertical:0},u=[s[o].x+t.x,s[o].y+t.y],h=l[o],c=st();dt(c,c,h),ct(c,c,u),this._axesLayout[i]={position:u,rotation:h,transform:c,axisNameAvailableWidth:r.axisNameAvailableWidth,axisLabelShow:r.axisLabelShow,nameTruncateMaxWidth:r.nameTruncateMaxWidth,tickDirection:1,labelDirection:1,labelInterval:e.get(i).getLabelInterval()}},this)},getAxis:function(t){return this._axesMap.get(t)},dataToPoint:function(t,e){return this.axisCoordToPoint(this._axesMap.get(e).dataToCoord(t),e)},eachActiveState:function(t,e,i){for(var n=this.dimensions,o=f(n,function(e){return t.mapDimension(e)}),a=this._axesMap,r=this.hasAxisBrushed(),s=0,l=t.count();so*(1-h[0])?(l="jump",r=s-o*(1-h[2])):(r=s-o*h[1])>=0&&(r=s-o*(1-h[1]))<=0&&(r=0),(r*=e.axisExpandWidth/u)?eC(r,n,a,"all"):l="none";else{o=n[1]-n[0];(n=[oC(0,a[1]*s/o-o/2)])[1]=nC(a[1],n[0]+o),n[0]=n[1]-o}return{axisExpandWindow:n,behavior:l}}},Ca.register("parallel",{create:function(t,e){var i=[];return t.eachComponent("parallel",function(n,o){var a=new bd(n,t,e);a.name="parallel_"+o,a.resize(n,e),n.coordinateSystem=a,a.model=n,i.push(a)}),t.eachSeries(function(e){if("parallel"===e.get("coordinateSystem")){var i=t.queryComponents({mainType:"parallel",index:e.get("parallelIndex"),id:e.get("parallelId")})[0];e.coordinateSystem=i.coordinateSystem}}),i}});var uC=kS.extend({type:"baseParallelAxis",axis:null,activeIntervals:[],getAreaSelectStyle:function(){return Lw([["fill","color"],["lineWidth","borderWidth"],["stroke","borderColor"],["width","width"],["opacity","opacity"]])(this.getModel("areaSelectStyle"))},setActiveIntervals:function(t){var e=this.activeIntervals=i(t);if(e)for(var n=e.length-1;n>=0;n--)Co(e[n])},getActiveState:function(t){var e=this.activeIntervals;if(!e.length)return"normal";if(null==t)return"inactive";for(var i=0,n=e.length;i5)return;var n=this._model.coordinateSystem.getSlidedAxisExpandWindow([t.offsetX,t.offsetY]);"none"!==n.behavior&&this._dispatchExpand({axisExpandWindow:n.axisExpandWindow})}this._mouseDownPoint=null},mousemove:function(t){if(!this._mouseDownPoint&&gf(this,"mousemove")){var e=this._model,i=e.coordinateSystem.getSlidedAxisExpandWindow([t.offsetX,t.offsetY]),n=i.behavior;"jump"===n&&this._throttledDispatchExpand.debounceNextCall(e.get("axisExpandDebounce")),this._throttledDispatchExpand("none"===n?null:{axisExpandWindow:i.axisExpandWindow,animation:"jump"===n&&null})}}};ls(function(t){yd(t),xd(t)}),mM.extend({type:"series.parallel",dependencies:["parallel"],visualColorAccessPath:"lineStyle.color",getInitialData:function(t,e){this.option.progressive&&(this.option.animation=!1);var i=this.getSource();return mf(i,this),Hs(i,this)},getRawIndicesByActiveState:function(t){var e=this.coordinateSystem,i=this.getData(),n=[];return e.eachActiveState(i,function(e,o){t===e&&n.push(i.getRawIndex(o))}),n},defaultOption:{zlevel:0,z:2,coordinateSystem:"parallel",parallelIndex:0,label:{show:!1},inactiveOpacity:.05,activeOpacity:1,lineStyle:{width:1,opacity:.45,type:"solid"},emphasis:{label:{show:!1}},progressive:!1,smooth:!1,animationEasing:"linear"}});pr.extend({type:"parallel",init:function(){this._dataGroup=new L_,this.group.add(this._dataGroup),this._data},render:function(t,e,i,n){this._renderForNormal(t,n)},dispose:function(){},_renderForNormal:function(t,e){var i=this._dataGroup,n=t.getData(),o=this._data,a=t.coordinateSystem,r=a.dimensions,s=t.option.smooth?.3:null;if(n.diff(o).add(function(t){_f(n,i,t,r,a)}).update(function(i,s){var l=o.getItemGraphicEl(s),u=xf(n,i,r,a);n.setItemGraphicEl(i,l),fo(l,{shape:{points:u}},e&&!1===e.animation?null:t,i)}).remove(function(t){var e=o.getItemGraphicEl(t);i.remove(e)}).execute(),wf(n,s),!this._data){var l=yf(a,t,function(){setTimeout(function(){i.removeClipPath()})});i.setClipPath(l)}this._data=n},remove:function(){this._dataGroup&&this._dataGroup.removeAll(),this._data=null}});var LC=["lineStyle","normal","opacity"];fs(function(t){t.eachSeriesByType("parallel",function(e){var i=e.getModel("itemStyle"),n=e.getModel("lineStyle"),o=t.get("color"),a=n.get("color")||i.get("color")||o[e.seriesIndex%o.length],r=e.get("inactiveOpacity"),s=e.get("activeOpacity"),l=e.getModel("lineStyle").getLineStyle(),u=e.coordinateSystem,h=e.getData(),c={normal:l.opacity,active:s,inactive:r};u.eachActiveState(h,function(t,e){var i=h.getItemModel(e),n=c[t];if("normal"===t){var o=i.get(LC,!0);null!=o&&(n=o)}h.setItemVisual(e,"opacity",n)}),h.setVisual("color",a)})});var kC=mM.extend({type:"series.sankey",layoutInfo:null,getInitialData:function(t){var e=t.edges||t.links,i=t.data||t.nodes;if(i&&e)return kA(i,e,this,!0).data},getGraph:function(){return this.getData().graph},getEdgeData:function(){return this.getGraph().edgeData},formatTooltip:function(t,e,i){if("edge"===i){var n=this.getDataParams(t,i),o=n.data,a=o.source+" -- "+o.target;return n.value&&(a+=" : "+n.value),Zo(a)}return kC.superCall(this,"formatTooltip",t,e)},defaultOption:{zlevel:0,z:2,coordinateSystem:"view",layout:null,left:"5%",top:"5%",right:"20%",bottom:"5%",nodeWidth:20,nodeGap:8,layoutIterations:32,label:{show:!0,position:"right",color:"#000",fontSize:12},itemStyle:{borderWidth:1,borderColor:"#333"},lineStyle:{color:"#314656",opacity:.2,curveness:.5},emphasis:{label:{show:!0},lineStyle:{opacity:.6}},animationEasing:"linear",animationDuration:1e3}}),PC=En({shape:{x1:0,y1:0,x2:0,y2:0,cpx1:0,cpy1:0,cpx2:0,cpy2:0,extent:0},buildPath:function(t,e){var i=e.extent/2;t.moveTo(e.x1,e.y1-i),t.bezierCurveTo(e.cpx1,e.cpy1-i,e.cpx2,e.cpy2-i,e.x2,e.y2-i),t.lineTo(e.x2,e.y2+i),t.bezierCurveTo(e.cpx2,e.cpy2+i,e.cpx1,e.cpy1+i,e.x1,e.y1+i),t.closePath()}});xs({type:"sankey",_model:null,render:function(t,e,i){var n=t.getGraph(),o=this.group,a=t.layoutInfo,r=t.getData(),s=t.getData("edge");this._model=t,o.removeAll(),o.attr("position",[a.x,a.y]),n.eachEdge(function(e){var i=new PC;i.dataIndex=e.dataIndex,i.seriesIndex=t.seriesIndex,i.dataType="edge";var n=e.getModel("lineStyle"),a=n.get("curveness"),r=e.node1.getLayout(),l=e.node2.getLayout(),u=e.getLayout();i.shape.extent=Math.max(1,u.dy);var h=r.x+r.dx,c=r.y+u.sy+u.dy/2,d=l.x,f=l.y+u.ty+u.dy/2,p=h*(1-a)+d*a,g=c,m=h*a+d*(1-a),v=f;switch(i.setShape({x1:h,y1:c,x2:d,y2:f,cpx1:p,cpy1:g,cpx2:m,cpy2:v}),i.setStyle(n.getItemStyle()),i.style.fill){case"source":i.style.fill=e.node1.getVisual("color");break;case"target":i.style.fill=e.node2.getVisual("color")}eo(i,e.getModel("emphasis.lineStyle").getItemStyle()),o.add(i),s.setItemGraphicEl(e.dataIndex,i)}),n.eachNode(function(e){var i=e.getLayout(),n=e.getModel(),a=n.getModel("label"),s=n.getModel("emphasis.label"),l=new jb({shape:{x:i.x,y:i.y,width:e.getLayout().dx,height:e.getLayout().dy},style:n.getModel("itemStyle").getItemStyle()}),u=e.getModel("emphasis.itemStyle").getItemStyle();io(l.style,u,a,s,{labelFetcher:t,labelDataIndex:e.dataIndex,defaultText:e.id,isRectText:!0}),l.setStyle("fill",e.getVisual("color")),eo(l,u),o.add(l),r.setItemGraphicEl(e.dataIndex,l),l.dataType="node"}),!this._data&&t.get("animation")&&o.setClipPath(Sf(o.getBoundingRect(),t,function(){o.removeClipPath()})),this._data=t.getData()},dispose:function(){}});ds(function(t,e,i){t.eachSeriesByType("sankey",function(t){var i=t.get("nodeWidth"),n=t.get("nodeGap"),o=If(t,e);t.layoutInfo=o;var a=o.width,r=o.height,s=t.getGraph(),l=s.nodes,u=s.edges;Tf(l),Df(l,u,i,n,a,r,0!==g(l,function(t){return 0===t.getLayout().value}).length?0:t.get("layoutIterations"))})}),fs(function(t,e){t.eachSeriesByType("sankey",function(t){var e=t.getGraph().nodes;e.sort(function(t,e){return t.getLayout().value-e.getLayout().value});var i=e[0].getLayout().value,n=e[e.length-1].getLayout().value;d(e,function(e){var o=new fA({type:"color",mappingMethod:"linear",dataExtent:[i,n],visual:t.get("color")}).mapValueToVisual(e.getLayout().value);e.setVisual("color",o);var a=e.getModel().get("itemStyle.color");null!=a&&e.setVisual("color",a)})})});var NC=In.extend({type:"whiskerInBox",shape:{},buildPath:function(t,e){for(var i in e)if(e.hasOwnProperty(i)&&0===i.indexOf("ends")){var n=e[i];t.moveTo(n[0][0],n[0][1]),t.lineTo(n[1][0],n[1][1])}}}),OC=jf.prototype;OC._createContent=function(t,e,i){var n=t.getItemLayout(e),o="horizontal"===n.chartLayout?1:0,a=0;this.add(new Zb({shape:{points:i?Xf(n.bodyEnds,o,n):n.bodyEnds},style:{strokeNoScale:!0},z2:100})),this.bodyIndex=a++;var r=f(n.whiskerEnds,function(t){return i?Xf(t,o,n):t});this.add(new NC({shape:Yf(r),style:{strokeNoScale:!0},z2:100})),this.whiskerIndex=a++},OC.updateData=function(t,e,i){var n=this._seriesModel=t.hostModel,o=t.getItemLayout(e),a=sS[i?"initProps":"updateProps"];a(this.childAt(this.bodyIndex),{shape:{points:o.bodyEnds}},n,e),a(this.childAt(this.whiskerIndex),{shape:Yf(o.whiskerEnds)},n,e),this.styleUpdater.call(null,this,t,e)},u(jf,L_);var EC=qf.prototype;EC.updateData=function(t){var e=this.group,i=this._data,n=this.styleUpdater;this._data||e.removeAll(),t.diff(i).add(function(i){if(t.hasValue(i)){var o=new jf(t,i,n,!0);t.setItemGraphicEl(i,o),e.add(o)}}).update(function(o,a){var r=i.getItemGraphicEl(a);t.hasValue(o)?(r?r.updateData(t,o):r=new jf(t,o,n),e.add(r),t.setItemGraphicEl(o,r)):e.remove(r)}).remove(function(t){var n=i.getItemGraphicEl(t);n&&e.remove(n)}).execute(),this._data=t},EC.incrementalPrepareUpdate=function(t,e,i){this.group.removeAll(),this._data=null},EC.incrementalUpdate=function(t,e,i,n){for(var o=e.getData(),a=t.start;a0?jC:XC),borderColor:e.get(n>0?ZC:UC)})})})}),ds(function(t){t.eachSeriesByType("candlestick",function(t){var e,i=t.coordinateSystem,n=t.getData(),o=ep(t,n),a=t.get("layout"),r="horizontal"===a?0:1,s=1-r,l=["x","y"],u=[];if(d(n.dimensions,function(t){var i=n.getDimensionInfo(t).coordDim;i===l[s]?u.push(t):i===l[r]&&(e=t)}),!(null==e||u.length<4)){var h=0;n.each([e].concat(u),function(){function t(t){var e=[];return e[r]=d,e[s]=t,isNaN(d)||isNaN(t)?[NaN,NaN]:i.dataToPoint(e)}function e(t,e){var i=t.slice(),n=t.slice();i[r]=Wn(i[r]+o/2,1,!1),n[r]=Wn(n[r]-o/2,1,!0),e?M.push(i,n):M.push(n,i)}function l(t){return t[r]=Wn(t[r],1),t}var c=arguments,d=c[0],f=c[u.length+1],p=c[1],g=c[2],m=c[3],v=c[4],y=Math.min(p,g),x=Math.max(p,g),_=t(y),w=t(x),b=t(m),S=[[l(t(v)),l(w)],[l(b),l(_)]],M=[];e(w,0),e(_,1);var I;I=p>g?-1:p0?n.getItemModel(h-1).get()[2]<=g?1:-1:1,n.setItemLayout(f,{chartLayout:a,sign:I,initBaseline:p>g?w[s]:_[s],bodyEnds:M,whiskerEnds:S,brushRect:function(){var e=t(Math.min(p,g,m,v)),i=t(Math.max(p,g,m,v));return e[r]-=o/2,i[r]-=o/2,{x:e[0],y:e[1],width:s?o:i[0]-e[0],height:s?i[1]-e[1]:o}}()}),++h})}})}),mM.extend({type:"series.effectScatter",dependencies:["grid","polar"],getInitialData:function(t,e){return Hs(this.getSource(),this)},brushSelector:"point",defaultOption:{coordinateSystem:"cartesian2d",zlevel:0,z:2,legendHoverLink:!0,effectType:"ripple",progressive:0,showEffectOn:"render",rippleEffect:{period:4,scale:2.5,brushType:"fill"},symbolSize:10}});var qC=op.prototype;qC.stopEffectAnimation=function(){this.childAt(1).removeAll()},qC.startEffectAnimation=function(t){for(var e=t.symbolType,i=t.color,n=this.childAt(1),o=0;o<3;o++){var a=ml(e,-1,-1,2,2,i);a.attr({style:{strokeNoScale:!0},z2:99,silent:!0,scale:[.5,.5]});var r=-o/3*t.period+t.effectOffset;a.animate("",!0).when(t.period,{scale:[t.rippleScale/2,t.rippleScale/2]}).delay(r).start(),a.animateStyle(!0).when(t.period,{opacity:0}).delay(r).start(),n.add(a)}np(n,t)},qC.updateEffectAnimation=function(t){for(var e=this._effectCfg,i=this.childAt(1),n=["symbolType","period","rippleScale"],o=0;o "))},preventIncremental:function(){return!!this.get("effect.show")},getProgressive:function(){var t=this.option.progressive;return null==t?this.option.large?1e4:this.get("progressive"):t},getProgressiveThreshold:function(){var t=this.option.progressiveThreshold;return null==t?this.option.large?2e4:this.get("progressiveThreshold"):t},defaultOption:{coordinateSystem:"geo",zlevel:0,z:2,legendHoverLink:!0,hoverAnimation:!0,xAxisIndex:0,yAxisIndex:0,symbol:["none","none"],symbolSize:[10,10],geoIndex:0,effect:{show:!1,period:4,constantSpeed:0,symbol:"circle",symbolSize:3,loop:!0,trailLength:.2},large:!1,largeThreshold:2e3,polyline:!1,label:{show:!1,position:"end"},lineStyle:{opacity:.5}}}),tL=rp.prototype;tL.createLine=function(t,e,i){return new qc(t,e,i)},tL._updateEffectSymbol=function(t,e){var i=t.getItemModel(e).getModel("effect"),n=i.get("symbolSize"),o=i.get("symbol");y(n)||(n=[n,n]);var a=i.get("color")||t.getItemVisual(e,"color"),r=this.childAt(1);this._symbolType!==o&&(this.remove(r),(r=ml(o,-.5,-.5,1,1,a)).z2=100,r.culling=!0,this.add(r)),r&&(r.setStyle("shadowColor",a),r.setStyle(i.getItemStyle(["color"])),r.attr("scale",n),r.setColor(a),r.attr("scale",n),this._symbolType=o,this._updateEffectAnimation(t,i,e))},tL._updateEffectAnimation=function(t,e,i){var n=this.childAt(1);if(n){var o=this,a=t.getItemLayout(i),r=1e3*e.get("period"),s=e.get("loop"),l=e.get("constantSpeed"),u=D(e.get("delay"),function(e){return e/t.count()*r/3}),h="function"==typeof u;if(n.ignore=!0,this.updateAnimationPoints(n,a),l>0&&(r=this.getLineLength(n)/l*1e3),r!==this._period||s!==this._loop){n.stopAnimation();var c=u;h&&(c=u(i)),n.__t>0&&(c=-r*n.__t),n.__t=0;var d=n.animate("",s).when(r,{__t:1}).delay(c).during(function(){o.updateSymbolPosition(n)});s||d.done(function(){o.remove(n)}),d.start()}this._period=r,this._loop=s}},tL.getLineLength=function(t){return jx(t.__p1,t.__cp1)+jx(t.__cp1,t.__p2)},tL.updateAnimationPoints=function(t,e){t.__p1=e[0],t.__p2=e[1],t.__cp1=e[2]||[(e[0][0]+e[1][0])/2,(e[0][1]+e[1][1])/2]},tL.updateData=function(t,e,i){this.childAt(0).updateData(t,e,i),this._updateEffectSymbol(t,e)},tL.updateSymbolPosition=function(t){var e=t.__p1,i=t.__p2,n=t.__cp1,o=t.__t,a=t.position,r=Qi,s=tn;a[0]=r(e[0],n[0],i[0],o),a[1]=r(e[1],n[1],i[1],o);var l=s(e[0],n[0],i[0],o),u=s(e[1],n[1],i[1],o);t.rotation=-Math.atan2(u,l)-Math.PI/2,t.ignore=!1},tL.updateLayout=function(t,e){this.childAt(0).updateLayout(t,e);var i=t.getItemModel(e).getModel("effect");this._updateEffectAnimation(t,i,e)},u(rp,L_);var eL=sp.prototype;eL._createPolyline=function(t,e,i){var n=t.getItemLayout(e),o=new Ub({shape:{points:n}});this.add(o),this._updateCommonStl(t,e,i)},eL.updateData=function(t,e,i){var n=t.hostModel;fo(this.childAt(0),{shape:{points:t.getItemLayout(e)}},n,e),this._updateCommonStl(t,e,i)},eL._updateCommonStl=function(t,e,i){var n=this.childAt(0),o=t.getItemModel(e),a=t.getItemVisual(e,"color"),s=i&&i.lineStyle,l=i&&i.hoverLineStyle;i&&!t.hasItemOption||(s=o.getModel("lineStyle").getLineStyle(),l=o.getModel("emphasis.lineStyle").getLineStyle()),n.useStyle(r({strokeNoScale:!0,fill:"none",stroke:a},s)),n.hoverStyle=l,eo(this)},eL.updateLayout=function(t,e){this.childAt(0).setShape("points",t.getItemLayout(e))},u(sp,L_);var iL=lp.prototype;iL.createLine=function(t,e,i){return new sp(t,e,i)},iL.updateAnimationPoints=function(t,e){this._points=e;for(var i=[0],n=0,o=1;o=0&&!(n[r]<=e);r--);r=Math.min(r,o-2)}else{for(var r=a;re);r++);r=Math.min(r-1,o-2)}J(t.position,i[r],i[r+1],(e-n[r])/(n[r+1]-n[r]));var s=i[r+1][0]-i[r][0],l=i[r+1][1]-i[r][1];t.rotation=-Math.atan2(l,s)-Math.PI/2,this._lastFrame=r,this._lastFramePercent=e,t.ignore=!1}},u(lp,rp);var nL=En({shape:{polyline:!1,curveness:0,segs:[]},buildPath:function(t,e){var i=e.segs,n=e.curveness;if(e.polyline)for(r=0;r0){t.moveTo(i[r++],i[r++]);for(var a=1;a0){var c=(s+u)/2-(l-h)*n,d=(l+h)/2-(u-s)*n;t.quadraticCurveTo(c,d,u,h)}else t.lineTo(u,h)}},findDataIndex:function(t,e){var i=this.shape,n=i.segs,o=i.curveness;if(i.polyline)for(var a=0,r=0;r0)for(var l=n[r++],u=n[r++],h=1;h0){if(fn(l,u,(l+c)/2-(u-d)*o,(u+d)/2-(c-l)*o,c,d))return a}else if(cn(l,u,c,d))return a;a++}return-1}}),oL=up.prototype;oL.isPersistent=function(){return!this._incremental},oL.updateData=function(t){this.group.removeAll();var e=new nL({rectHover:!0,cursor:"default"});e.setShape({segs:t.getLayout("linesPoints")}),this._setCommon(e,t),this.group.add(e),this._incremental=null},oL.incrementalPrepareUpdate=function(t){this.group.removeAll(),this._clearIncremental(),t.count()>5e5?(this._incremental||(this._incremental=new On({silent:!0})),this.group.add(this._incremental)):this._incremental=null},oL.incrementalUpdate=function(t,e){var i=new nL;i.setShape({segs:e.getLayout("linesPoints")}),this._setCommon(i,e,!!this._incremental),this._incremental?this._incremental.addDisplayable(i,!0):(i.rectHover=!0,i.cursor="default",i.__startIndex=t.start,this.group.add(i))},oL.remove=function(){this._clearIncremental(),this._incremental=null,this.group.removeAll()},oL._setCommon=function(t,e,i){var n=e.hostModel;t.setShape({polyline:n.get("polyline"),curveness:n.get("lineStyle.curveness")}),t.useStyle(n.getModel("lineStyle").getLineStyle()),t.style.strokeNoScale=!0;var o=e.getVisual("color");o&&t.setStyle("stroke",o),t.setStyle("fill"),i||(t.seriesIndex=n.seriesIndex,t.on("mousemove",function(e){t.dataIndex=null;var i=t.findDataIndex(e.offsetX,e.offsetY);i>0&&(t.dataIndex=i+t.__startIndex)}))},oL._clearIncremental=function(){var t=this._incremental;t&&t.clearDisplaybles()};var aL={seriesType:"lines",plan:xM(),reset:function(t){var e=t.coordinateSystem,i=t.get("polyline"),n=t.pipelineContext.large;return{progress:function(o,a){var r=[];if(n){var s,l=o.end-o.start;if(i){for(var u=0,h=o.start;h0){var I=a(v)?s:l;v>0&&(v=v*S+b),x[_++]=I[M],x[_++]=I[M+1],x[_++]=I[M+2],x[_++]=I[M+3]*v*256}else _+=4}return c.putImageData(y,0,0),h},_getBrush:function(){var t=this._brushCanvas||(this._brushCanvas=Vx()),e=this.pointSize+this.blurSize,i=2*e;t.width=i,t.height=i;var n=t.getContext("2d");return n.clearRect(0,0,i,i),n.shadowOffsetX=i,n.shadowBlur=this.blurSize,n.shadowColor="#000",n.beginPath(),n.arc(-e,e,this.pointSize,0,2*Math.PI,!0),n.closePath(),n.fill(),t},_getGradient:function(t,e,i){for(var n=this._gradientPixels,o=n[i]||(n[i]=new Uint8ClampedArray(1024)),a=[0,0,0,0],r=0,s=0;s<256;s++)e[i](s/255,!0,a),o[r++]=a[0],o[r++]=a[1],o[r++]=a[2],o[r++]=a[3];return o}},xs({type:"heatmap",render:function(t,e,i){var n;e.eachComponent("visualMap",function(e){e.eachTargetSeries(function(i){i===t&&(n=e)})}),this.group.removeAll(),this._incrementalDisplayable=null;var o=t.coordinateSystem;"cartesian2d"===o.type||"calendar"===o.type?this._renderOnCartesianAndCalendar(t,i,0,t.getData().count()):pp(o)&&this._renderOnGeo(o,t,n,i)},incrementalPrepareRender:function(t,e,i){this.group.removeAll()},incrementalRender:function(t,e,i,n){e.coordinateSystem&&this._renderOnCartesianAndCalendar(e,n,t.start,t.end,!0)},_renderOnCartesianAndCalendar:function(t,e,i,n,o){var r,s,l=t.coordinateSystem;if("cartesian2d"===l.type){var u=l.getAxis("x"),h=l.getAxis("y");r=u.getBandWidth(),s=h.getBandWidth()}for(var c=this.group,d=t.getData(),f=t.getModel("itemStyle").getItemStyle(["color"]),p=t.getModel("emphasis.itemStyle").getItemStyle(),g=t.getModel("label"),m=t.getModel("emphasis.label"),v=l.type,y="cartesian2d"===v?[d.mapDimension("x"),d.mapDimension("y"),d.mapDimension("value")]:[d.mapDimension("time"),d.mapDimension("value")],x=i;x=e.y&&t[1]<=e.y+e.height:i.contain(i.toLocalCoord(t[1]))&&t[0]>=e.y&&t[0]<=e.y+e.height},pointToData:function(t){var e=this.getAxis();return[e.coordToData(e.toLocalCoord(t["horizontal"===e.orient?0:1]))]},dataToPoint:function(t){var e=this.getAxis(),i=this.getRect(),n=[],o="horizontal"===e.orient?0:1;return t instanceof Array&&(t=t[0]),n[o]=e.toGlobalCoord(e.dataToCoord(+t)),n[1-o]=0===o?i.y+i.height/2:i.x+i.width/2,n}},Ca.register("single",{create:function(t,e){var i=[];return t.eachComponent("singleAxis",function(n,o){var a=new Bp(n,t,e);a.name="single_"+o,a.resize(n,e),n.coordinateSystem=a,i.push(a)}),t.eachSeries(function(e){if("singleAxis"===e.get("coordinateSystem")){var i=t.queryComponents({mainType:"singleAxis",index:e.get("singleAxisIndex"),id:e.get("singleAxisId")})[0];e.coordinateSystem=i&&i.coordinateSystem}}),i},dimensions:Bp.prototype.dimensions});var fL=qD.getInterval,pL=qD.ifIgnoreOnTick,gL=["axisLine","axisTickLabel","axisName"],mL=iT.extend({type:"singleAxis",axisPointerClass:"SingleAxisPointer",render:function(t,e,i,n){var o=this.group;o.removeAll();var a=Vp(t),r=new qD(t,a);d(gL,r.add,r),o.add(r.getGroup()),t.get("splitLine.show")&&this._splitLine(t,a.labelInterval),mL.superCall(this,"render",t,e,i,n)},_splitLine:function(t,e){var i=t.axis;if(!i.scale.isBlank()){var n=t.getModel("splitLine"),o=n.getModel("lineStyle"),a=o.get("width"),r=o.get("color"),s=fL(n,e);r=r instanceof Array?r:[r];for(var l=t.coordinateSystem.getRect(),u=i.isHorizontal(),h=[],c=0,d=i.getTicksCoords(),f=[],p=[],g=t.get("axisLabel.showMinLabel"),m=t.get("axisLabel.showMaxLabel"),v=0;v=0)&&i({type:"updateAxisPointer",currTrigger:t,x:e&&e.offsetX,y:e&&e.offsetY})})},remove:function(t,e){ig(e.getZr(),"axisPointer"),IL.superApply(this._model,"remove",arguments)},dispose:function(t,e){ig("axisPointer",e),IL.superApply(this._model,"dispose",arguments)}}),DL=Ni(),TL=i,AL=m;(ng.prototype={_group:null,_lastGraphicKey:null,_handle:null,_dragging:!1,_lastValue:null,_lastStatus:null,_payloadInfo:null,animationThreshold:15,render:function(t,e,i,n){var o=e.get("value"),a=e.get("status");if(this._axisModel=t,this._axisPointerModel=e,this._api=i,n||this._lastValue!==o||this._lastStatus!==a){this._lastValue=o,this._lastStatus=a;var r=this._group,s=this._handle;if(!a||"hide"===a)return r&&r.hide(),void(s&&s.hide());r&&r.show(),s&&s.show();var l={};this.makeElOption(l,o,t,e,i);var u=l.graphicKey;u!==this._lastGraphicKey&&this.clear(i),this._lastGraphicKey=u;var h=this._moveAnimation=this.determineAnimation(t,e);if(r){var c=v(og,e,h);this.updatePointerEl(r,l,c,e),this.updateLabelEl(r,l,c,e)}else r=this._group=new L_,this.createPointerEl(r,l,t,e),this.createLabelEl(r,l,t,e),i.getZr().add(r);lg(r,e,!0),this._renderHandle(o)}},remove:function(t){this.clear(t)},dispose:function(t){this.clear(t)},determineAnimation:function(t,e){var i=e.get("animation"),n=t.axis,o="category"===n.type,a=e.get("snap");if(!a&&!o)return!1;if("auto"===i||null==i){var r=this.animationThreshold;if(o&&n.getBandWidth()>r)return!0;if(a){var s=Iu(t).seriesDataCount,l=n.getExtent();return Math.abs(l[0]-l[1])/s>r}return!1}return!0===i},makeElOption:function(t,e,i,n,o){},createPointerEl:function(t,e,i,n){var o=e.pointer;if(o){var a=DL(t).pointerEl=new sS[o.type](TL(e.pointer));t.add(a)}},createLabelEl:function(t,e,i,n){if(e.label){var o=DL(t).labelEl=new jb(TL(e.label));t.add(o),rg(o,n)}},updatePointerEl:function(t,e,i){var n=DL(t).pointerEl;n&&(n.setStyle(e.pointer.style),i(n,{shape:e.pointer.shape}))},updateLabelEl:function(t,e,i,n){var o=DL(t).labelEl;o&&(o.setStyle(e.label.style),i(o,{shape:e.label.shape,position:e.label.position}),rg(o,n))},_renderHandle:function(t){if(!this._dragging&&this.updateHandleTransform){var e=this._axisPointerModel,i=this._api.getZr(),n=this._handle,o=e.getModel("handle"),a=e.get("status");if(!o.get("show")||!a||"hide"===a)return n&&i.remove(n),void(this._handle=null);var r;this._handle||(r=!0,n=this._handle=_o(o.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(t){rw(t.event)},onmousedown:AL(this._onHandleDragMove,this,0,0),drift:AL(this._onHandleDragMove,this),ondragend:AL(this._onHandleDragEnd,this)}),i.add(n)),lg(n,e,!1);var s=["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"];n.setStyle(o.getItemStyle(null,s));var l=o.get("size");y(l)||(l=[l,l]),n.attr("scale",[l[0]/2,l[1]/2]),_r(this,"_doDispatchAxisPointer",o.get("throttle")||0,"fixRate"),this._moveHandleToValue(t,r)}},_moveHandleToValue:function(t,e){og(this._axisPointerModel,!e&&this._moveAnimation,this._handle,sg(this.getHandleTransform(t,this._axisModel,this._axisPointerModel)))},_onHandleDragMove:function(t,e){var i=this._handle;if(i){this._dragging=!0;var n=this.updateHandleTransform(sg(i),[t,e],this._axisModel,this._axisPointerModel);this._payloadInfo=n,i.stopAnimation(),i.attr(sg(n)),DL(i).lastProp=null,this._doDispatchAxisPointer()}},_doDispatchAxisPointer:function(){if(this._handle){var t=this._payloadInfo,e=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:t.cursorPoint[0],y:t.cursorPoint[1],tooltipOption:t.tooltipOption,axesInfo:[{axisDim:e.axis.dim,axisIndex:e.componentIndex}]})}},_onHandleDragEnd:function(t){if(this._dragging=!1,this._handle){var e=this._axisPointerModel.get("value");this._moveHandleToValue(e),this._api.dispatchAction({type:"hideTip"})}},getHandleTransform:null,updateHandleTransform:null,clear:function(t){this._lastValue=null,this._lastStatus=null;var e=t.getZr(),i=this._group,n=this._handle;e&&i&&(this._lastGraphicKey=null,i&&e.remove(i),n&&e.remove(n),this._group=null,this._handle=null,this._payloadInfo=null)},doClear:function(){},buildLabel:function(t,e,i){return i=i||0,{x:t[i],y:t[1-i],width:e[i],height:e[1-i]}}}).constructor=ng,Gi(ng);var CL=ng.extend({makeElOption:function(t,e,i,n,o){var a=i.axis,r=a.grid,s=n.get("type"),l=yg(r,a).getOtherAxis(a).getGlobalExtent(),u=a.toGlobalCoord(a.dataToCoord(e,!0));if(s&&"none"!==s){var h=ug(n),c=LL[s](a,u,l,h);c.style=h,t.graphicKey=c.type,t.pointer=c}pg(e,t,ku(r.model,i),i,n,o)},getHandleTransform:function(t,e,i){var n=ku(e.axis.grid.model,e,{labelInside:!1});return n.labelMargin=i.get("handle.margin"),{position:fg(e.axis,t,n),rotation:n.rotation+(n.labelDirection<0?Math.PI:0)}},updateHandleTransform:function(t,e,i,n){var o=i.axis,a=o.grid,r=o.getGlobalExtent(!0),s=yg(a,o).getOtherAxis(o).getGlobalExtent(),l="x"===o.dim?0:1,u=t.position;u[l]+=e[l],u[l]=Math.min(r[1],u[l]),u[l]=Math.max(r[0],u[l]);var h=(s[1]+s[0])/2,c=[h,h];c[l]=u[l];var d=[{verticalAlign:"middle"},{align:"center"}];return{position:u,rotation:t.rotation,cursorPoint:c,tooltipOption:d[l]}}}),LL={line:function(t,e,i,n){var o=gg([e,i[0]],[e,i[1]],xg(t));return Gn({shape:o,style:n}),{type:"Line",shape:o}},shadow:function(t,e,i,n){var o=t.getBandWidth(),a=i[1]-i[0];return{type:"Rect",shape:mg([e-o/2,i[0]],[o,a],xg(t))}}};iT.registerAxisPointerClass("CartesianAxisPointer",CL),ls(function(t){if(t){(!t.axisPointer||0===t.axisPointer.length)&&(t.axisPointer={});var e=t.axisPointer.link;e&&!y(e)&&(t.axisPointer.link=[e])}}),us(qM.PROCESSOR.STATISTIC,function(t,e){t.getComponent("axisPointer").coordSysAxesInfo=yu(t,e)}),hs({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},function(t,e,i){var n=t.currTrigger,o=[t.x,t.y],a=t,r=t.dispatchAction||m(i.dispatchAction,i),s=e.getComponent("axisPointer").coordSysAxesInfo;if(s){qp(o)&&(o=xL({seriesIndex:a.seriesIndex,dataIndex:a.dataIndex},e).point);var l=qp(o),u=a.axesInfo,h=s.axesInfo,c="leave"===n||qp(o),d={},f={},p={list:[],map:{}},g={showPointer:wL(Wp,f),showTooltip:wL(Hp,p)};_L(s.coordSysMap,function(t,e){var i=l||t.containPoint(o);_L(s.coordSysAxesInfo[e],function(t,e){var n=t.axis,a=Xp(u,t);if(!c&&i&&(!u||a)){var r=a&&a.value;null!=r||l||(r=n.pointToData(o)),null!=r&&Gp(t,r,g,!1,d)}})});var v={};return _L(h,function(t,e){var i=t.linkGroup;i&&!f[e]&&_L(i.axesInfo,function(e,n){var o=f[n];if(e!==t&&o){var a=o.value;i.mapper&&(a=t.axis.scale.parse(i.mapper(a,Yp(e),Yp(t)))),v[t.key]=a}})}),_L(v,function(t,e){Gp(h[e],t,g,!0,d)}),Zp(f,h,d),Up(p,o,t,r),jp(h,0,i),d}});var kL=["x","y"],PL=["width","height"],NL=ng.extend({makeElOption:function(t,e,i,n,o){var a=i.axis,r=a.coordinateSystem,s=wg(r,1-_g(a)),l=r.dataToPoint(e)[0],u=n.get("type");if(u&&"none"!==u){var h=ug(n),c=OL[u](a,l,s,h);c.style=h,t.graphicKey=c.type,t.pointer=c}pg(e,t,Vp(i),i,n,o)},getHandleTransform:function(t,e,i){var n=Vp(e,{labelInside:!1});return n.labelMargin=i.get("handle.margin"),{position:fg(e.axis,t,n),rotation:n.rotation+(n.labelDirection<0?Math.PI:0)}},updateHandleTransform:function(t,e,i,n){var o=i.axis,a=o.coordinateSystem,r=_g(o),s=wg(a,r),l=t.position;l[r]+=e[r],l[r]=Math.min(s[1],l[r]),l[r]=Math.max(s[0],l[r]);var u=wg(a,1-r),h=(u[1]+u[0])/2,c=[h,h];return c[r]=l[r],{position:l,rotation:t.rotation,cursorPoint:c,tooltipOption:{verticalAlign:"middle"}}}}),OL={line:function(t,e,i,n){var o=gg([e,i[0]],[e,i[1]],_g(t));return Gn({shape:o,style:n}),{type:"Line",shape:o}},shadow:function(t,e,i,n){var o=t.getBandWidth(),a=i[1]-i[0];return{type:"Rect",shape:mg([e-o/2,i[0]],[o,a],_g(t))}}};iT.registerAxisPointerClass("SingleAxisPointer",NL),vs({type:"single"});var EL=mM.extend({type:"series.themeRiver",dependencies:["singleAxis"],nameMap:null,init:function(t){EL.superApply(this,"init",arguments),this.legendDataProvider=function(){return this.getRawData()}},fixData:function(t){for(var e=t.length,i=f(Mf().key(function(t){return t[2]}).entries(t),function(t){return{name:t.key,dataList:t.values}}),n=i.length,o=-1,a=-1,r=0;ro&&(o=s,a=r)}for(var l=0;lMath.PI/2?"right":"left"):x&&"center"!==x?"left"===x?(f=u.r0+y,p>Math.PI/2&&(x="right")):"right"===x&&(f=u.r-y,p>Math.PI/2&&(x="left")):(f=(u.r+u.r0)/2,x="center"),d.attr("style",{text:l,textAlign:x,textVerticalAlign:n("verticalAlign")||"middle",opacity:n("opacity")});var _=f*g+u.cx,w=f*m+u.cy;d.attr("position",[_,w]);var b=n("rotate"),S=0;"radial"===b?(S=-p)<-Math.PI/2&&(S+=Math.PI):"tangential"===b?(S=Math.PI/2-p)>Math.PI/2?S-=Math.PI:S<-Math.PI/2&&(S+=Math.PI):"number"==typeof b&&(S=b*Math.PI/180),d.attr("rotation",S)},VL._initEvents=function(t,e,i,n){t.off("mouseover").off("mouseout").off("emphasis").off("normal");var o=this,a=function(){o.onEmphasis(n)},r=function(){o.onNormal()};i.isAnimationEnabled()&&t.on("mouseover",a).on("mouseout",r).on("emphasis",a).on("normal",r).on("downplay",function(){o.onDownplay()}).on("highlight",function(){o.onHighlight()})},u(Dg,L_);pr.extend({type:"sunburst",init:function(){},render:function(t,e,i,n){function o(i,n){if(c||!i||i.getValue()||(i=null),i!==l&&n!==l)if(n&&n.piece)i?(n.piece.updateData(!1,i,"normal",t,e),s.setItemGraphicEl(i.dataIndex,n.piece)):a(n);else if(i){var o=new Dg(i,t,e);h.add(o),s.setItemGraphicEl(i.dataIndex,o)}}function a(t){t&&t.piece&&(h.remove(t.piece),t.piece=null)}var r=this;this.seriesModel=t,this.api=i,this.ecModel=e;var s=t.getData(),l=s.tree.root,u=t.getViewRoot(),h=this.group,c=t.get("renderLabelForZeroData"),d=[];u.eachNode(function(t){d.push(t)});var f=this._oldChildren||[];if(function(t,e){function i(t){return t.getId()}function n(i,n){o(null==i?null:t[i],null==n?null:e[n])}0===t.length&&0===e.length||new bs(e,t,i,i).add(n).update(n).remove(v(n,null)).execute()}(d,f),function(i,n){if(n.depth>0){i.piece?i.piece.updateData(!1,i,"normal",t,e):(i.piece=new Dg(i,t,e),h.add(i.piece)),n.piece._onclickEvent&&n.piece.off("click",n.piece._onclickEvent);var o=function(t){r._rootToNode(n.parentNode)};n.piece._onclickEvent=o,i.piece.on("click",o)}else i.piece&&(h.remove(i.piece),i.piece=null)}(l,u),n&&n.highlight&&n.highlight.piece){var p=t.getShallow("highlightPolicy");n.highlight.piece.onEmphasis(p)}else if(n&&n.unhighlight){var g=l.piece;!g&&l.children.length&&(g=l.children[0].piece),g&&g.onNormal()}this._initEvents(),this._oldChildren=d},dispose:function(){},_initEvents:function(){var t=this,e=function(e){var i=!1;t.seriesModel.getViewRoot().eachNode(function(n){if(!i&&n.piece&&n.piece.childAt(0)===e.target){var o=n.getModel().get("nodeClick");if("rootToNode"===o)t._rootToNode(n);else if("link"===o){var a=n.getModel(),r=a.get("link");if(r){var s=a.get("target",!0)||"_blank";window.open(r,s)}}i=!0}})};this.group._onclickEvent&&this.group.off("click",this.group._onclickEvent),this.group.on("click",e),this.group._onclickEvent=e},_rootToNode:function(t){t!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:"sunburstRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:t})},containPoint:function(t,e){var i=e.getData().getItemLayout(0);if(i){var n=t[0]-i.cx,o=t[1]-i.cy,a=Math.sqrt(n*n+o*o);return a<=i.r&&a>=i.r0}}});var GL="sunburstRootToNode";hs({type:GL,update:"updateView"},function(t,e){e.eachComponent({mainType:"series",subType:"sunburst",query:t},function(e,i){var n=Jh(t,[GL],e);if(n){var o=e.getViewRoot();o&&(t.direction=tc(o,n.node)?"rollUp":"drillDown"),e.resetViewRoot(n.node)}})});var FL="sunburstHighlight";hs({type:FL,update:"updateView"},function(t,e){e.eachComponent({mainType:"series",subType:"sunburst",query:t},function(e,i){var n=Jh(t,[FL],e);n&&(t.highlight=n.node)})});hs({type:"sunburstUnhighlight",update:"updateView"},function(t,e){e.eachComponent({mainType:"series",subType:"sunburst",query:t},function(e,i){t.unhighlight=!0})});var WL=Math.PI/180;fs(v(_T,"sunburst")),ds(v(function(t,e,i,n){e.eachSeriesByType(t,function(t){var e=t.get("center"),n=t.get("radius");y(n)||(n=[0,n]),y(e)||(e=[e,e]);var o=i.getWidth(),a=i.getHeight(),r=Math.min(o,a),s=To(e[0],o),l=To(e[1],a),u=To(n[0],r/2),h=To(n[1],r/2),c=-t.get("startAngle")*WL,f=t.get("minAngle")*WL,p=t.getData().tree.root,g=t.getViewRoot(),m=g.depth,v=t.get("sort");null!=v&&Lg(g,v);var x=0;d(g.children,function(t){!isNaN(t.getValue())&&x++});var _=g.getValue(),w=Math.PI/(_||x)*2,b=g.depth>0,S=g.height-(b?-1:1),M=(h-u)/(S||1),I=t.get("clockwise"),D=t.get("stillShowZeroSum"),T=I?1:-1,A=function(t,e){if(t){var i=e;if(t!==p){var n=t.getValue(),o=0===_&&D?w:n*w;on[1]&&n.reverse(),{coordSys:{type:"polar",cx:t.cx,cy:t.cy,r:n[1],r0:n[0]},api:{coord:m(function(n){var o=e.dataToRadius(n[0]),a=i.dataToAngle(n[1]),r=t.coordToPoint([o,a]);return r.push(o,a*Math.PI/180),r}),size:m(Eg,t)}}},calendar:function(t){var e=t.getRect(),i=t.getRangeInfo();return{coordSys:{type:"calendar",x:e.x,y:e.y,width:e.width,height:e.height,cellWidth:t.getCellWidth(),cellHeight:t.getCellHeight(),rangeInfo:{start:i.start,end:i.end,weeks:i.weeks,dayCount:i.allDay}},api:{coord:function(e,i){return t.dataToPoint(e,i)}}}}};ys({type:"series.custom",dependencies:["grid","polar","geo","singleAxis","calendar"],defaultOption:{coordinateSystem:"cartesian2d",zlevel:0,z:2,legendHoverLink:!0},getInitialData:function(t,e){return Hs(this.getSource(),this)}}),xs({type:"custom",_data:null,render:function(t,e,i){var n=this._data,o=t.getData(),a=this.group,r=Vg(t,o,e,i);this.group.removeAll(),o.diff(n).add(function(e){Fg(null,e,r(e),t,a,o)}).update(function(e,i){Fg(n.getItemGraphicEl(i),e,r(e),t,a,o)}).remove(function(t){var e=n.getItemGraphicEl(t);e&&a.remove(e)}).execute(),this._data=o},incrementalPrepareRender:function(t,e,i){this.group.removeAll(),this._data=null},incrementalRender:function(t,e,i,n){for(var o=e.getData(),a=Vg(e,o,i,n),r=t.start;r=0;l--)null==o[l]?o.splice(l,1):delete o[l].$action},_flatten:function(t,e,i){d(t,function(t){if(t){i&&(t.parentOption=i),e.push(t);var n=t.children;"group"===t.type&&n&&this._flatten(n,e,t),delete t.children}},this)},useElOptionsToUpdate:function(){var t=this._elOptionsToUpdate;return this._elOptionsToUpdate=null,t}});vs({type:"graphic",init:function(t,e){this._elMap=z(),this._lastGraphicModel},render:function(t,e,i){t!==this._lastGraphicModel&&this._clear(),this._lastGraphicModel=t,this._updateElements(t,i),this._relocate(t,i)},_updateElements:function(t,e){var i=t.useElOptionsToUpdate();if(i){var n=this._elMap,o=this.group;d(i,function(t){var e=t.$action,i=t.id,a=n.get(i),r=t.parentId,s=null!=r?n.get(r):o;if("text"===t.type){var l=t.style;t.hv&&t.hv[1]&&(l.textVerticalAlign=l.textBaseline=null),!l.hasOwnProperty("textFill")&&l.fill&&(l.textFill=l.fill),!l.hasOwnProperty("textStroke")&&l.stroke&&(l.textStroke=l.stroke)}var u=qg(t);e&&"merge"!==e?"replace"===e?(Yg(a,n),Xg(i,s,u,n)):"remove"===e&&Yg(a,n):a?a.attr(u):Xg(i,s,u,n);var h=n.get(i);h&&(h.__ecGraphicWidth=t.width,h.__ecGraphicHeight=t.height)})}},_relocate:function(t,e){for(var i=t.option.elements,n=this.group,o=this._elMap,a=i.length-1;a>=0;a--){var r=i[a],s=o.get(r.id);if(s){var l=s.parent;ta(s,r,l===n?{width:e.getWidth(),height:e.getHeight()}:{width:l.__ecGraphicWidth||0,height:l.__ecGraphicHeight||0},null,{hv:r.hv,boundingMode:r.bounding})}}},_clear:function(){var t=this._elMap;t.each(function(e){Yg(e,t)}),this._elMap=z()},dispose:function(){this._clear()}});var $L=ms({type:"legend.plain",dependencies:["series"],layoutMode:{type:"box",ignoreSize:!0},init:function(t,e,i){this.mergeDefaultAndTheme(t,i),t.selected=t.selected||{}},mergeOption:function(t){$L.superCall(this,"mergeOption",t)},optionUpdated:function(){this._updateData(this.ecModel);var t=this._data;if(t[0]&&"single"===this.get("selectedMode")){for(var e=!1,i=0;i=0},defaultOption:{zlevel:0,z:4,show:!0,orient:"horizontal",left:"center",top:0,align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,inactiveColor:"#ccc",textStyle:{color:"#333"},selectedMode:!0,tooltip:{show:!1}}});hs("legendToggleSelect","legendselectchanged",v(tm,"toggleSelected")),hs("legendSelect","legendselected",v(tm,"select")),hs("legendUnSelect","legendunselected",v(tm,"unSelect"));var KL=v,JL=d,QL=L_,tk=vs({type:"legend.plain",newlineDisabled:!1,init:function(){this.group.add(this._contentGroup=new QL),this._backgroundEl},getContentGroup:function(){return this._contentGroup},render:function(t,e,i){if(this.resetInner(),t.get("show",!0)){var n=t.get("align");n&&"auto"!==n||(n="right"===t.get("left")&&"vertical"===t.get("orient")?"right":"left"),this.renderInner(n,t,e,i);var o=t.getBoxLayoutParams(),a={width:i.getWidth(),height:i.getHeight()},s=t.get("padding"),l=Qo(o,a,s),u=this.layoutInner(t,n,l),h=Qo(r({width:u.width,height:u.height},o),a,s);this.group.attr("position",[h.x-u.x,h.y-u.y]),this.group.add(this._backgroundEl=im(u,t))}},resetInner:function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl)},renderInner:function(t,e,i,n){var o=this.getContentGroup(),a=z(),r=e.get("selectedMode");JL(e.getData(),function(s,l){var u=s.get("name");if(this.newlineDisabled||""!==u&&"\n"!==u){var h=i.getSeriesByName(u)[0];if(!a.get(u))if(h){var c=h.getData(),d=c.getVisual("color");"function"==typeof d&&(d=d(h.getDataParams(0)));var f=c.getVisual("legendSymbol")||"roundRect",p=c.getVisual("symbol");this._createItem(u,l,s,e,f,p,t,d,r).on("click",KL(nm,u,n)).on("mouseover",KL(om,h,null,n)).on("mouseout",KL(am,h,null,n)),a.set(u,!0)}else i.eachRawSeries(function(i){if(!a.get(u)&&i.legendDataProvider){var o=i.legendDataProvider(),h=o.indexOfName(u);if(h<0)return;var c=o.getItemVisual(h,"color");this._createItem(u,l,s,e,"roundRect",null,t,c,r).on("click",KL(nm,u,n)).on("mouseover",KL(om,i,u,n)).on("mouseout",KL(am,i,u,n)),a.set(u,!0)}},this)}else o.add(new QL({newline:!0}))},this)},_createItem:function(t,e,i,n,o,r,s,l,u){var h=n.get("itemWidth"),c=n.get("itemHeight"),d=n.get("inactiveColor"),f=n.isSelected(t),p=new QL,g=i.getModel("textStyle"),m=i.get("icon"),v=i.getModel("tooltip"),y=v.parentModel;if(o=m||o,p.add(ml(o,0,0,h,c,f?l:d,!0)),!m&&r&&(r!==o||"none"==r)){var x=.8*c;"none"===r&&(r="circle"),p.add(ml(r,(h-x)/2,(c-x)/2,x,x,f?l:d))}var _="left"===s?h+5:-5,w=s,b=n.get("formatter"),S=t;"string"==typeof b&&b?S=b.replace("{name}",null!=t?t:""):"function"==typeof b&&(S=b(t)),p.add(new zb({style:no({},g,{text:S,x:_,y:c/2,textFill:f?g.getTextColor():d,textAlign:w,textVerticalAlign:"middle"})}));var M=new jb({shape:p.getBoundingRect(),invisible:!0,tooltip:v.get("show")?a({content:t,formatter:y.get("formatter",!0)||function(){return t},formatterParams:{componentType:"legend",legendIndex:n.componentIndex,name:t,$vars:["name"]}},v.option):null});return p.add(M),p.eachChild(function(t){t.silent=!0}),M.silent=!u,this.getContentGroup().add(p),eo(p),p.__legendDataIndex=e,p},layoutInner:function(t,e,i){var n=this.getContentGroup();AS(t.get("orient"),n,t.get("itemGap"),i.width,i.height);var o=n.getBoundingRect();return n.attr("position",[-o.x,-o.y]),this.group.getBoundingRect()}});us(function(t){var e=t.findComponents({mainType:"legend"});e&&e.length&&t.filterSeries(function(t){for(var i=0;ii[s],f=[-h.x,-h.y];f[r]=n.position[r];var p=[0,0],g=[-c.x,-c.y],m=T(t.get("pageButtonGap",!0),t.get("itemGap",!0));d&&("end"===t.get("pageButtonPosition",!0)?g[r]+=i[s]-c[s]:p[r]+=c[s]+m),g[1-r]+=h[l]/2-c[l]/2,n.attr("position",f),o.attr("position",p),a.attr("position",g);var v=this.group.getBoundingRect();if((v={x:0,y:0})[s]=d?i[s]:h[s],v[l]=Math.max(h[l],c[l]),v[u]=Math.min(0,c[u]+g[1-r]),o.__rectSize=i[s],d){var y={x:0,y:0};y[s]=Math.max(i[s]-c[s]-m,0),y[l]=v[l],o.setClipPath(new jb({shape:y})),o.__rectSize=y[s]}else a.eachChild(function(t){t.attr({invisible:!0,silent:!0})});var x=this._getPageInfo(t);return null!=x.pageIndex&&fo(n,{position:x.contentPosition},!!d&&t),this._updatePageInfoView(t,x),v},_pageGo:function(t,e,i){var n=this._getPageInfo(e)[t];null!=n&&i.dispatchAction({type:"legendScroll",scrollDataIndex:n,legendId:e.id})},_updatePageInfoView:function(t,e){var i=this._controllerGroup;d(["pagePrev","pageNext"],function(n){var o=null!=e[n+"DataIndex"],a=i.childOfName(n);a&&(a.setStyle("fill",o?t.get("pageIconColor",!0):t.get("pageIconInactiveColor",!0)),a.cursor=o?"pointer":"default")});var n=i.childOfName("pageText"),o=t.get("pageFormatter"),a=e.pageIndex,r=null!=a?a+1:0,s=e.pageCount;n&&o&&n.setStyle("text",_(o)?o.replace("{current}",r).replace("{total}",s):o({current:r,total:s}))},_getPageInfo:function(t){function e(t){var e=t.getBoundingRect().clone();return e[f]+=t.position[h],e}var i,n,o,a,r=t.get("scrollDataIndex",!0),s=this.getContentGroup(),l=s.getBoundingRect(),u=this._containerGroup.__rectSize,h=t.getOrient().index,c=nk[h],d=nk[1-h],f=ok[h],p=s.position.slice();this._showController?s.eachChild(function(t){t.__legendDataIndex===r&&(a=t)}):a=s.childAt(0);var g=u?Math.ceil(l[c]/u):0;if(a){var m=a.getBoundingRect(),v=a.position[h]+m[f];p[h]=-v-l[f],i=Math.floor(g*(v+m[f]+u/2)/l[c]),i=l[c]&&g?Math.max(0,Math.min(g-1,i)):-1;var y={x:0,y:0};y[c]=u,y[d]=l[d],y[f]=-p[h]-l[f];var x,_=s.children();if(s.eachChild(function(t,i){var n=e(t);n.intersect(y)&&(null==x&&(x=i),o=t.__legendDataIndex),i===_.length-1&&n[f]+n[c]<=y[f]+y[c]&&(o=null)}),null!=x){var w=e(_[x]);if(y[f]=w[f]+w[c]-y[c],x<=0&&w[f]>=y[f])n=null;else{for(;x>0&&e(_[x-1]).intersect(y);)x--;n=_[x].__legendDataIndex}}}return{contentPosition:p,pageIndex:i,pageCount:g,pagePrevDataIndex:n,pageNextDataIndex:o}}});hs("legendScroll","legendscroll",function(t,e){var i=t.scrollDataIndex;null!=i&&e.eachComponent({mainType:"legend",subType:"scroll",query:t},function(t){t.setScrollDataIndex(i)})}),ms({type:"tooltip",dependencies:["axisPointer"],defaultOption:{zlevel:0,z:8,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",confine:!1,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"rgba(50,50,50,0.7)",borderColor:"#333",borderRadius:4,borderWidth:0,padding:5,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",textStyle:{}}},textStyle:{color:"#fff",fontSize:14}}});var rk=d,sk=Ho,lk=["","-webkit-","-moz-","-o-"];hm.prototype={constructor:hm,_enterable:!0,update:function(){var t=this._container,e=t.currentStyle||document.defaultView.getComputedStyle(t),i=t.style;"absolute"!==i.position&&"absolute"!==e.position&&(i.position="relative")},show:function(t){clearTimeout(this._hideTimeout);var e=this.el;e.style.cssText="position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;"+um(t)+";left:"+this._x+"px;top:"+this._y+"px;"+(t.get("extraCssText")||""),e.style.display=e.innerHTML?"block":"none",this._show=!0},setContent:function(t){this.el.innerHTML=null==t?"":t},setEnterable:function(t){this._enterable=t},getSize:function(){var t=this.el;return[t.clientWidth,t.clientHeight]},moveTo:function(t,e){var i,n=this._zr;n&&n.painter&&(i=n.painter.getViewportRootOffset())&&(t+=i.offsetLeft,e+=i.offsetTop);var o=this.el.style;o.left=t+"px",o.top=e+"px",this._x=t,this._y=e},hide:function(){this.el.style.display="none",this._show=!1},hideLater:function(t){!this._show||this._inContent&&this._enterable||(t?(this._hideDelay=t,this._show=!1,this._hideTimeout=setTimeout(m(this.hide,this),t)):this.hide())},isShow:function(){return this._show}};var uk=m,hk=d,ck=To,dk=new jb({shape:{x:-1,y:-1,width:2,height:2}});vs({type:"tooltip",init:function(t,e){if(!Ax.node){var i=new hm(e.getDom(),e);this._tooltipContent=i}},render:function(t,e,i){if(!Ax.node&&!Ax.wxa){this.group.removeAll(),this._tooltipModel=t,this._ecModel=e,this._api=i,this._lastDataByCoordSys=null,this._alwaysShowContent=t.get("alwaysShowContent");var n=this._tooltipContent;n.update(),n.setEnterable(t.get("enterable")),this._initGlobalListener(),this._keepShow()}},_initGlobalListener:function(){var t=this._tooltipModel.get("triggerOn");$p("itemTooltip",this._api,uk(function(e,i,n){"none"!==t&&(t.indexOf(e)>=0?this._tryShow(i,n):"leave"===e&&this._hide(n))},this))},_keepShow:function(){var t=this._tooltipModel,e=this._ecModel,i=this._api;if(null!=this._lastX&&null!=this._lastY&&"none"!==t.get("triggerOn")){var n=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){n.manuallyShowTip(t,e,i,{x:n._lastX,y:n._lastY})})}},manuallyShowTip:function(t,e,i,n){if(n.from!==this.uid&&!Ax.node){var o=dm(n,i);this._ticket="";var a=n.dataByCoordSys;if(n.tooltip&&null!=n.x&&null!=n.y){var r=dk;r.position=[n.x,n.y],r.update(),r.tooltip=n.tooltip,this._tryShow({offsetX:n.x,offsetY:n.y,target:r},o)}else if(a)this._tryShow({offsetX:n.x,offsetY:n.y,position:n.position,event:{},dataByCoordSys:n.dataByCoordSys,tooltipOption:n.tooltipOption},o);else if(null!=n.seriesIndex){if(this._manuallyAxisShowTip(t,e,i,n))return;var s=xL(n,e),l=s.point[0],u=s.point[1];null!=l&&null!=u&&this._tryShow({offsetX:l,offsetY:u,position:n.position,target:s.el,event:{}},o)}else null!=n.x&&null!=n.y&&(i.dispatchAction({type:"updateAxisPointer",x:n.x,y:n.y}),this._tryShow({offsetX:n.x,offsetY:n.y,position:n.position,target:i.getZr().findHover(n.x,n.y).target,event:{}},o))}},manuallyHideTip:function(t,e,i,n){var o=this._tooltipContent;!this._alwaysShowContent&&this._tooltipModel&&o.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=null,n.from!==this.uid&&this._hide(dm(n,i))},_manuallyAxisShowTip:function(t,e,i,n){var o=n.seriesIndex,a=n.dataIndex,r=e.getComponent("axisPointer").coordSysAxesInfo;if(null!=o&&null!=a&&null!=r){var s=e.getSeriesByIndex(o);if(s&&"axis"===(t=cm([s.getData().getItemModel(a),s,(s.coordinateSystem||{}).model,t])).get("trigger"))return i.dispatchAction({type:"updateAxisPointer",seriesIndex:o,dataIndex:a,position:n.position}),!0}},_tryShow:function(t,e){var i=t.target;if(this._tooltipModel){this._lastX=t.offsetX,this._lastY=t.offsetY;var n=t.dataByCoordSys;n&&n.length?this._showAxisTooltip(n,t):i&&null!=i.dataIndex?(this._lastDataByCoordSys=null,this._showSeriesItemTooltip(t,i,e)):i&&i.tooltip?(this._lastDataByCoordSys=null,this._showComponentItemTooltip(t,i,e)):(this._lastDataByCoordSys=null,this._hide(e))}},_showOrMove:function(t,e){var i=t.get("showDelay");e=m(e,this),clearTimeout(this._showTimout),i>0?this._showTimout=setTimeout(e,i):e()},_showAxisTooltip:function(t,e){var i=this._ecModel,n=this._tooltipModel,o=[e.offsetX,e.offsetY],a=[],r=[],s=cm([e.tooltipOption,n]);hk(t,function(t){hk(t.dataByAxis,function(t){var e=i.getComponent(t.axisDim+"Axis",t.axisIndex),n=t.value,o=[];if(e&&null!=n){var s=dg(n,e.axis,i,t.seriesDataIndices,t.valueLabelOpt);d(t.seriesDataIndices,function(a){var l=i.getSeriesByIndex(a.seriesIndex),u=a.dataIndexInside,h=l&&l.getDataParams(u);h.axisDim=t.axisDim,h.axisIndex=t.axisIndex,h.axisType=t.axisType,h.axisId=t.axisId,h.axisValue=pl(e.axis,n),h.axisValueLabel=s,h&&(r.push(h),o.push(l.formatTooltip(u,!0)))});var l=s;a.push((l?Zo(l)+"
":"")+o.join("
"))}})},this),a.reverse(),a=a.join("

");var l=e.position;this._showOrMove(s,function(){this._updateContentNotChangedOnAxis(t)?this._updatePosition(s,l,o[0],o[1],this._tooltipContent,r):this._showTooltipContent(s,a,r,Math.random(),o[0],o[1],l)})},_showSeriesItemTooltip:function(t,e,i){var n=this._ecModel,o=e.seriesIndex,a=n.getSeriesByIndex(o),r=e.dataModel||a,s=e.dataIndex,l=e.dataType,u=r.getData(),h=cm([u.getItemModel(s),r,a&&(a.coordinateSystem||{}).model,this._tooltipModel]),c=h.get("trigger");if(null==c||"item"===c){var d=r.getDataParams(s,l),f=r.formatTooltip(s,!1,l),p="item_"+r.name+"_"+s;this._showOrMove(h,function(){this._showTooltipContent(h,f,d,p,t.offsetX,t.offsetY,t.position,t.target)}),i({type:"showTip",dataIndexInside:s,dataIndex:u.getRawIndex(s),seriesIndex:o,from:this.uid})}},_showComponentItemTooltip:function(t,e,i){var n=e.tooltip;if("string"==typeof n){var o=n;n={content:o,formatter:o}}var a=new wo(n,this._tooltipModel,this._ecModel),r=a.get("content"),s=Math.random();this._showOrMove(a,function(){this._showTooltipContent(a,r,a.get("formatterParams")||{},s,t.offsetX,t.offsetY,t.position,e)}),i({type:"showTip",from:this.uid})},_showTooltipContent:function(t,e,i,n,o,a,r,s){if(this._ticket="",t.get("showContent")&&t.get("show")){var l=this._tooltipContent,u=t.get("formatter");r=r||t.get("position");var h=e;if(u&&"string"==typeof u)h=Uo(u,i,!0);else if("function"==typeof u){var c=uk(function(e,n){e===this._ticket&&(l.setContent(n),this._updatePosition(t,r,o,a,l,i,s))},this);this._ticket=n,h=u(i,n,c)}l.setContent(h),l.show(t),this._updatePosition(t,r,o,a,l,i,s)}},_updatePosition:function(t,e,i,n,o,a,r){var s=this._api.getWidth(),l=this._api.getHeight();e=e||t.get("position");var u=o.getSize(),h=t.get("align"),c=t.get("verticalAlign"),d=r&&r.getBoundingRect().clone();if(r&&d.applyTransform(r.transform),"function"==typeof e&&(e=e([i,n],a,o.el,d,{viewSize:[s,l],contentSize:u.slice()})),y(e))i=ck(e[0],s),n=ck(e[1],l);else if(w(e)){e.width=u[0],e.height=u[1];var f=Qo(e,{width:s,height:l});i=f.x,n=f.y,h=null,c=null}else"string"==typeof e&&r?(i=(p=mm(e,d,u))[0],n=p[1]):(i=(p=fm(i,n,o.el,s,l,h?null:20,c?null:20))[0],n=p[1]);if(h&&(i-=vm(h)?u[0]/2:"right"===h?u[0]:0),c&&(n-=vm(c)?u[1]/2:"bottom"===c?u[1]:0),t.get("confine")){var p=pm(i,n,o.el,s,l);i=p[0],n=p[1]}o.moveTo(i,n)},_updateContentNotChangedOnAxis:function(t){var e=this._lastDataByCoordSys,i=!!e&&e.length===t.length;return i&&hk(e,function(e,n){var o=e.dataByAxis||{},a=(t[n]||{}).dataByAxis||[];(i&=o.length===a.length)&&hk(o,function(t,e){var n=a[e]||{},o=t.seriesDataIndices||[],r=n.seriesDataIndices||[];(i&=t.value===n.value&&t.axisType===n.axisType&&t.axisId===n.axisId&&o.length===r.length)&&hk(o,function(t,e){var n=r[e];i&=t.seriesIndex===n.seriesIndex&&t.dataIndex===n.dataIndex})})}),this._lastDataByCoordSys=t,!!i},_hide:function(t){this._lastDataByCoordSys=null,t({type:"hideTip",from:this.uid})},dispose:function(t,e){Ax.node||(this._tooltipContent.hide(),ig("itemTooltip",e))}}),hs({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},function(){}),hs({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},function(){}),wm.prototype={constructor:wm,pointToData:function(t,e){return this.polar.pointToData(t,e)["radius"===this.dim?0:1]},dataToRadius:dD.prototype.dataToCoord,radiusToData:dD.prototype.coordToData},u(wm,dD),bm.prototype={constructor:bm,pointToData:function(t,e){return this.polar.pointToData(t,e)["radius"===this.dim?0:1]},dataToAngle:dD.prototype.dataToCoord,angleToData:dD.prototype.coordToData},u(bm,dD);var fk=function(t){this.name=t||"",this.cx=0,this.cy=0,this._radiusAxis=new wm,this._angleAxis=new bm,this._radiusAxis.polar=this._angleAxis.polar=this};fk.prototype={type:"polar",axisPointerEnabled:!0,constructor:fk,dimensions:["radius","angle"],model:null,containPoint:function(t){var e=this.pointToCoord(t);return this._radiusAxis.contain(e[0])&&this._angleAxis.contain(e[1])},containData:function(t){return this._radiusAxis.containData(t[0])&&this._angleAxis.containData(t[1])},getAxis:function(t){return this["_"+t+"Axis"]},getAxes:function(){return[this._radiusAxis,this._angleAxis]},getAxesByScale:function(t){var e=[],i=this._angleAxis,n=this._radiusAxis;return i.scale.type===t&&e.push(i),n.scale.type===t&&e.push(n),e},getAngleAxis:function(){return this._angleAxis},getRadiusAxis:function(){return this._radiusAxis},getOtherAxis:function(t){var e=this._angleAxis;return t===e?this._radiusAxis:e},getBaseAxis:function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAngleAxis()},getTooltipAxes:function(t){var e=null!=t&&"auto"!==t?this.getAxis(t):this.getBaseAxis();return{baseAxes:[e],otherAxes:[this.getOtherAxis(e)]}},dataToPoint:function(t,e){return this.coordToPoint([this._radiusAxis.dataToRadius(t[0],e),this._angleAxis.dataToAngle(t[1],e)])},pointToData:function(t,e){var i=this.pointToCoord(t);return[this._radiusAxis.radiusToData(i[0],e),this._angleAxis.angleToData(i[1],e)]},pointToCoord:function(t){var e=t[0]-this.cx,i=t[1]-this.cy,n=this.getAngleAxis(),o=n.getExtent(),a=Math.min(o[0],o[1]),r=Math.max(o[0],o[1]);n.inverse?a=r-360:r=a+360;var s=Math.sqrt(e*e+i*i);e/=s,i/=s;for(var l=Math.atan2(-i,e)/Math.PI*180,u=lr;)l+=360*u;return[s,l]},coordToPoint:function(t){var e=t[0],i=t[1]/180*Math.PI;return[Math.cos(i)*e+this.cx,-Math.sin(i)*e+this.cy]}};var pk=kS.extend({type:"polarAxis",axis:null,getCoordSysModel:function(){return this.ecModel.queryComponents({mainType:"polar",index:this.option.polarIndex,id:this.option.polarId})[0]}});n(pk.prototype,JI);var gk={angle:{startAngle:90,clockwise:!0,splitNumber:12,axisLabel:{rotate:!1}},radius:{splitNumber:5}};GD("angle",pk,Sm,gk.angle),GD("radius",pk,Sm,gk.radius),ms({type:"polar",dependencies:["polarAxis","angleAxis"],coordinateSystem:null,findAxisModel:function(t){var e;return this.ecModel.eachComponent(t,function(t){t.getCoordSysModel()===this&&(e=t)},this),e},defaultOption:{zlevel:0,z:0,center:["50%","50%"],radius:"80%"}});var mk={dimensions:fk.prototype.dimensions,create:function(t,e){var i=[];return t.eachComponent("polar",function(t,n){var o=new fk(n);o.update=Im;var a=o.getRadiusAxis(),r=o.getAngleAxis(),s=t.findAxisModel("radiusAxis"),l=t.findAxisModel("angleAxis");Dm(a,s),Dm(r,l),Mm(o,t,e),i.push(o),t.coordinateSystem=o,o.model=t}),t.eachSeries(function(e){if("polar"===e.get("coordinateSystem")){var i=t.queryComponents({mainType:"polar",index:e.get("polarIndex"),id:e.get("polarId")})[0];e.coordinateSystem=i.coordinateSystem}}),i}};Ca.register("polar",mk);var vk=["axisLine","axisLabel","axisTick","splitLine","splitArea"];iT.extend({type:"angleAxis",axisPointerClass:"PolarAxisPointer",render:function(t,e){if(this.group.removeAll(),t.get("show")){var i=t.axis,n=i.polar,o=n.getRadiusAxis().getExtent(),a=i.getTicksCoords();"category"!==i.type&&a.pop(),d(vk,function(e){!t.get(e+".show")||i.scale.isBlank()&&"axisLine"!==e||this["_"+e](t,n,a,o)},this)}},_axisLine:function(t,e,i,n){var o=t.getModel("axisLine.lineStyle"),a=new Rb({shape:{cx:e.cx,cy:e.cy,r:n[Am(e)]},style:o.getLineStyle(),z2:1,silent:!0});a.style.fill=null,this.group.add(a)},_axisTick:function(t,e,i,n){var o=t.getModel("axisTick"),a=(o.get("inside")?-1:1)*o.get("length"),s=n[Am(e)],l=f(i,function(t){return new Xb({shape:Tm(e,[s,s+a],t)})});this.group.add(rS(l,{style:r(o.getModel("lineStyle").getLineStyle(),{stroke:t.get("axisLine.lineStyle.color")})}))},_axisLabel:function(t,e,i,n){for(var o=t.axis,a=t.getCategories(),r=t.getModel("axisLabel"),s=t.getFormattedLabels(),l=r.get("margin"),u=o.getLabelsCoords(),h=0;hf?"left":"right",m=Math.abs(d[1]-p)/c<.3?"middle":d[1]>p?"top":"bottom";a&&a[h]&&a[h].textStyle&&(r=new wo(a[h].textStyle,r,r.ecModel));var v=new zb({silent:!0});this.group.add(v),no(v.style,r,{x:d[0],y:d[1],textFill:r.getTextColor()||t.get("axisLine.lineStyle.color"),text:s[h],textAlign:g,textVerticalAlign:m})}},_splitLine:function(t,e,i,n){var o=t.getModel("splitLine").getModel("lineStyle"),a=o.get("color"),s=0;a=a instanceof Array?a:[a];for(var l=[],u=0;u=0?"p":"n",T=w;_&&(a[l][I]||(a[l][I]={p:w,n:w}),T=a[l][I][D]);var A,C,L,k;if("radius"===d.dim){var P=d.dataToRadius(M)-w,N=s.dataToAngle(I);Math.abs(P)=0},Lk.findTargetInfo=function(t,e){for(var i=this._targetInfoList,n=jm(e,t),o=0;o=0||Dk(n,t.getAxis("y").model)>=0)&&a.push(t)}),e.push({panelId:"grid--"+t.id,gridModel:t,coordSysModel:t,coordSys:a[0],coordSyses:a,getPanelRect:Nk.grid,xAxisDeclared:r[t.id],yAxisDeclared:s[t.id]})}))},geo:function(t,e){Ik(t.geoModels,function(t){var i=t.coordinateSystem;e.push({panelId:"geo--"+t.id,geoModel:t,coordSysModel:t,coordSys:i,coordSyses:[i],getPanelRect:Nk.geo})})}},Pk=[function(t,e){var i=t.xAxisModel,n=t.yAxisModel,o=t.gridModel;return!o&&i&&(o=i.axis.grid.model),!o&&n&&(o=n.axis.grid.model),o&&o===e.gridModel},function(t,e){var i=t.geoModel;return i&&i===e.geoModel}],Nk={grid:function(){return this.coordSys.grid.getRect().clone()},geo:function(){var t=this.coordSys,e=t.getBoundingRect().clone();return e.applyTransform(go(t)),e}},Ok={lineX:Tk(Xm,0),lineY:Tk(Xm,1),rect:function(t,e,i){var n=e[Ak[t]]([i[0][0],i[1][0]]),o=e[Ak[t]]([i[0][1],i[1][1]]),a=[Um([n[0],o[0]]),Um([n[1],o[1]])];return{values:a,xyMinMax:a}},polygon:function(t,e,i){var n=[[1/0,-1/0],[1/0,-1/0]];return{values:f(i,function(i){var o=e[Ak[t]](i);return n[0][0]=Math.min(n[0][0],o[0]),n[1][0]=Math.min(n[1][0],o[1]),n[0][1]=Math.max(n[0][1],o[0]),n[1][1]=Math.max(n[1][1],o[1]),o}),xyMinMax:n}}},Ek={lineX:Tk(Ym,0),lineY:Tk(Ym,1),rect:function(t,e,i){return[[t[0][0]-i[0]*e[0][0],t[0][1]-i[0]*e[0][1]],[t[1][0]-i[1]*e[1][0],t[1][1]-i[1]*e[1][1]]]},polygon:function(t,e,i){return f(t,function(t,n){return[t[0]-i[0]*e[n][0],t[1]-i[1]*e[n][1]]})}},zk=["inBrush","outOfBrush"],Rk="__ecBrushSelect",Bk="__ecInBrushSelectEvent",Vk=qM.VISUAL.BRUSH;ds(Vk,function(t,e,i){t.eachComponent({mainType:"brush"},function(e){i&&"takeGlobalCursor"===i.type&&e.setBrushOption("brush"===i.key?i.brushOption:{brushType:!1}),(e.brushTargetManager=new Zm(e.option,t)).setInputRanges(e.areas,t)})}),fs(Vk,function(t,e,n){var o,a,s=[];t.eachComponent({mainType:"brush"},function(e,n){function l(t){return"all"===m||v[t]}function u(t){return!!t.length}function h(t,e){var i=t.coordinateSystem;w|=i.hasAxisBrushed(),l(e)&&i.eachActiveState(t.getData(),function(t,e){"active"===t&&(x[e]=1)})}function c(i,n,o){var a=tv(i);if(a&&!ev(e,n)&&(d(b,function(n){a[n.brushType]&&e.brushTargetManager.controlSeries(n,i,t)&&o.push(n),w|=u(o)}),l(n)&&u(o))){var r=i.getData();r.each(function(t){Qm(a,o,r,t)&&(x[t]=1)})}}var p={brushId:e.id,brushIndex:n,brushName:e.name,areas:i(e.areas),selected:[]};s.push(p);var g=e.option,m=g.brushLink,v=[],x=[],_=[],w=0;n||(o=g.throttleType,a=g.throttleDelay);var b=f(e.areas,function(t){return iv(r({boundingRect:Gk[t.brushType](t)},t))}),S=Om(e.option,zk,function(t){t.mappingMethod="fixed"});y(m)&&d(m,function(t){v[t]=1}),t.eachSeries(function(t,e){var i=_[e]=[];"parallel"===t.subType?h(t,e):c(t,e,i)}),t.eachSeries(function(t,e){var i={seriesId:t.id,seriesIndex:e,seriesName:t.name,dataIndex:[]};p.selected.push(i);var n=tv(t),o=_[e],a=t.getData(),r=l(e)?function(t){return x[t]?(i.dataIndex.push(a.getRawIndex(t)),"inBrush"):"outOfBrush"}:function(t){return Qm(n,o,a,t)?(i.dataIndex.push(a.getRawIndex(t)),"inBrush"):"outOfBrush"};(l(e)?w:u(o))&&zm(zk,S,a,r)})}),Km(e,o,a,s,n)});var Gk={lineX:B,lineY:B,rect:function(t){return nv(t.range)},polygon:function(t){for(var e,i=t.range,n=0,o=i.length;ne[0][1]&&(e[0][1]=a[0]),a[1]e[1][1]&&(e[1][1]=a[1])}return e&&nv(e)}},Fk=["#ddd"];ms({type:"brush",dependencies:["geo","grid","xAxis","yAxis","parallel","series"],defaultOption:{toolbox:null,brushLink:null,seriesIndex:"all",geoIndex:null,xAxisIndex:null,yAxisIndex:null,brushType:"rect",brushMode:"single",transformable:!0,brushStyle:{borderWidth:1,color:"rgba(120,140,180,0.3)",borderColor:"rgba(120,140,180,0.8)"},throttleType:"fixRate",throttleDelay:0,removeOnClick:!0,z:1e4},areas:[],brushType:null,brushOption:{},coordInfoList:[],optionUpdated:function(t,e){var i=this.option;!e&&Em(i,t,["inBrush","outOfBrush"]),i.inBrush=i.inBrush||{},i.outOfBrush=i.outOfBrush||{color:Fk}},setAreas:function(t){t&&(this.areas=f(t,function(t){return ov(this.option,t)},this))},setBrushOption:function(t){this.brushOption=ov(this.option,t),this.brushType=this.brushOption.brushType}});vs({type:"brush",init:function(t,e){this.ecModel=t,this.api=e,this.model,(this._brushController=new Dd(e.getZr())).on("brush",m(this._onBrush,this)).mount()},render:function(t){return this.model=t,av.apply(this,arguments)},updateTransform:av,updateView:av,dispose:function(){this._brushController.dispose()},_onBrush:function(t,e){var n=this.model.id;this.model.brushTargetManager.setOutputRanges(t,this.ecModel),(!e.isEnd||e.removeOnClick)&&this.api.dispatchAction({type:"brush",brushId:n,areas:i(t),$from:n})}}),hs({type:"brush",event:"brush"},function(t,e){e.eachComponent({mainType:"brush",query:t},function(e){e.setAreas(t.areas)})}),hs({type:"brushSelect",event:"brushSelected",update:"none"},function(){});var Wk={},Hk=AM.toolbox.brush;lv.defaultOption={show:!0,type:["rect","polygon","lineX","lineY","keep","clear"],icon:{rect:"M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13",polygon:"M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2",lineX:"M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4",lineY:"M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4",keep:"M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z",clear:"M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2"},title:i(Hk.title)};var Zk=lv.prototype;Zk.render=Zk.updateView=function(t,e,i){var n,o,a;e.eachComponent({mainType:"brush"},function(t){n=t.brushType,o=t.brushOption.brushMode||"single",a|=t.areas.length}),this._brushType=n,this._brushMode=o,d(t.get("type",!0),function(e){t.setIconStatus(e,("keep"===e?"multiple"===o:"clear"===e?a:e===n)?"emphasis":"normal")})},Zk.getIcons=function(){var t=this.model,e=t.get("icon",!0),i={};return d(t.get("type",!0),function(t){e[t]&&(i[t]=e[t])}),i},Zk.onclick=function(t,e,i){var n=this._brushType,o=this._brushMode;"clear"===i?(e.dispatchAction({type:"axisAreaSelect",intervals:[]}),e.dispatchAction({type:"brush",command:"clear",areas:[]})):e.dispatchAction({type:"takeGlobalCursor",key:"brush",brushOption:{brushType:"keep"===i?n:n!==i&&i,brushMode:"keep"===i?"multiple"===o?"single":"multiple":o}})},rv("brush",lv),ls(function(t,e){var i=t&&t.brush;if(y(i)||(i=i?[i]:[]),i.length){var n=[];d(i,function(t){var e=t.hasOwnProperty("toolbox")?t.toolbox:[];e instanceof Array&&(n=n.concat(e))});var o=t&&t.toolbox;y(o)&&(o=o[0]),o||(o={feature:{}},t.toolbox=[o]);var a=o.feature||(o.feature={}),r=a.brush||(a.brush={}),s=r.type||(r.type=[]);s.push.apply(s,n),Pm(s),e&&!s.length&&s.push.apply(s,bk)}});uv.prototype={constructor:uv,type:"calendar",dimensions:["time","value"],getDimensionsInfo:function(){return[{name:"time",type:"time"},"value"]},getRangeInfo:function(){return this._rangeInfo},getModel:function(){return this._model},getRect:function(){return this._rect},getCellWidth:function(){return this._sw},getCellHeight:function(){return this._sh},getOrient:function(){return this._orient},getFirstDayOfWeek:function(){return this._firstDayOfWeek},getDateInfo:function(t){var e=(t=zo(t)).getFullYear(),i=t.getMonth()+1;i=i<10?"0"+i:i;var n=t.getDate();n=n<10?"0"+n:n;var o=t.getDay();return o=Math.abs((o+7-this.getFirstDayOfWeek())%7),{y:e,m:i,d:n,day:o,time:t.getTime(),formatedDate:e+"-"+i+"-"+n,date:t}},getNextNDay:function(t,e){return 0===(e=e||0)?this.getDateInfo(t):((t=new Date(this.getDateInfo(t).time)).setDate(t.getDate()+e),this.getDateInfo(t))},update:function(t,e){function i(t,e){return null!=t[e]&&"auto"!==t[e]}this._firstDayOfWeek=+this._model.getModel("dayLabel").get("firstDay"),this._orient=this._model.get("orient"),this._lineWidth=this._model.getModel("itemStyle").getItemStyle().lineWidth||0,this._rangeInfo=this._getRangeInfo(this._initRangeOption());var n=this._rangeInfo.weeks||1,o=["width","height"],a=this._model.get("cellSize").slice(),r=this._model.getBoxLayoutParams(),s="horizontal"===this._orient?[n,7]:[7,n];d([0,1],function(t){i(a,t)&&(r[o[t]]=a[t]*s[t])});var l={width:e.getWidth(),height:e.getHeight()},u=this._rect=Qo(r,l);d([0,1],function(t){i(a,t)||(a[t]=u[o[t]]/s[t])}),this._sw=a[0],this._sh=a[1]},dataToPoint:function(t,e){y(t)&&(t=t[0]),null==e&&(e=!0);var i=this.getDateInfo(t),n=this._rangeInfo,o=i.formatedDate;if(e&&!(i.time>=n.start.time&&i.time<=n.end.time))return[NaN,NaN];var a=i.day,r=this._getRangeInfo([n.start.time,o]).nthWeek;return"vertical"===this._orient?[this._rect.x+a*this._sw+this._sw/2,this._rect.y+r*this._sh+this._sh/2]:[this._rect.x+r*this._sw+this._sw/2,this._rect.y+a*this._sh+this._sh/2]},pointToData:function(t){var e=this.pointToDate(t);return e&&e.time},dataToRect:function(t,e){var i=this.dataToPoint(t,e);return{contentShape:{x:i[0]-(this._sw-this._lineWidth)/2,y:i[1]-(this._sh-this._lineWidth)/2,width:this._sw-this._lineWidth,height:this._sh-this._lineWidth},center:i,tl:[i[0]-this._sw/2,i[1]-this._sh/2],tr:[i[0]+this._sw/2,i[1]-this._sh/2],br:[i[0]+this._sw/2,i[1]+this._sh/2],bl:[i[0]-this._sw/2,i[1]+this._sh/2]}},pointToDate:function(t){var e=Math.floor((t[0]-this._rect.x)/this._sw)+1,i=Math.floor((t[1]-this._rect.y)/this._sh)+1,n=this._rangeInfo.range;return"vertical"===this._orient?this._getDateByWeeksAndDay(i,e-1,n):this._getDateByWeeksAndDay(e,i-1,n)},convertToPixel:v(hv,"dataToPoint"),convertFromPixel:v(hv,"pointToData"),_initRangeOption:function(){var t=this._model.get("range"),e=t;if(y(e)&&1===e.length&&(e=e[0]),/^\d{4}$/.test(e)&&(t=[e+"-01-01",e+"-12-31"]),/^\d{4}[\/|-]\d{1,2}$/.test(e)){var i=this.getDateInfo(e),n=i.date;n.setMonth(n.getMonth()+1);var o=this.getNextNDay(n,-1);t=[i.formatedDate,o.formatedDate]}/^\d{4}[\/|-]\d{1,2}[\/|-]\d{1,2}$/.test(e)&&(t=[e,e]);var a=this._getRangeInfo(t);return a.start.time>a.end.time&&t.reverse(),t},_getRangeInfo:function(t){var e;(t=[this.getDateInfo(t[0]),this.getDateInfo(t[1])])[0].time>t[1].time&&(e=!0,t.reverse());var i=Math.floor(t[1].time/864e5)-Math.floor(t[0].time/864e5)+1,n=new Date(t[0].time),o=n.getDate(),a=t[1].date.getDate();if(n.setDate(o+i-1),n.getDate()!==a)for(var r=n.getTime()-t[1].time>0?1:-1;n.getDate()!==a&&(n.getTime()-t[1].time)*r>0;)i-=r,n.setDate(o+i-1);var s=Math.floor((i+t[0].day+6)/7),l=e?1-s:s-1;return e&&t.reverse(),{range:[t[0].formatedDate,t[1].formatedDate],start:t[0],end:t[1],allDay:i,weeks:s,nthWeek:l,fweek:t[0].day,lweek:t[1].day}},_getDateByWeeksAndDay:function(t,e,i){var n=this._getRangeInfo(i);if(t>n.weeks||0===t&&en.lweek)return!1;var o=7*(t-1)-n.fweek+e,a=new Date(n.start.time);return a.setDate(n.start.d+o),this.getDateInfo(a)}},uv.dimensions=uv.prototype.dimensions,uv.getDimensionsInfo=uv.prototype.getDimensionsInfo,uv.create=function(t,e){var i=[];return t.eachComponent("calendar",function(n){var o=new uv(n,t,e);i.push(o),n.coordinateSystem=o}),t.eachSeries(function(t){"calendar"===t.get("coordinateSystem")&&(t.coordinateSystem=i[t.get("calendarIndex")||0])}),i},Ca.register("calendar",uv);var Uk=kS.extend({type:"calendar",coordinateSystem:null,defaultOption:{zlevel:0,z:2,left:80,top:60,cellSize:20,orient:"horizontal",splitLine:{show:!0,lineStyle:{color:"#000",width:1,type:"solid"}},itemStyle:{color:"#fff",borderWidth:1,borderColor:"#ccc"},dayLabel:{show:!0,firstDay:0,position:"start",margin:"50%",nameMap:"en",color:"#000"},monthLabel:{show:!0,position:"start",margin:5,align:"center",nameMap:"en",formatter:null,color:"#000"},yearLabel:{show:!0,position:null,margin:30,formatter:null,color:"#ccc",fontFamily:"sans-serif",fontWeight:"bolder",fontSize:20}},init:function(t,e,i,n){var o=na(t);Uk.superApply(this,"init",arguments),cv(t,o)},mergeOption:function(t,e){Uk.superApply(this,"mergeOption",arguments),cv(this.option,t)}}),jk={EN:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],CN:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},Xk={EN:["S","M","T","W","T","F","S"],CN:["日","一","二","三","四","五","六"]};vs({type:"calendar",_tlpoints:null,_blpoints:null,_firstDayOfMonth:null,_firstDayPoints:null,render:function(t,e,i){var n=this.group;n.removeAll();var o=t.coordinateSystem,a=o.getRangeInfo(),r=o.getOrient();this._renderDayRect(t,a,n),this._renderLines(t,a,r,n),this._renderYearText(t,a,r,n),this._renderMonthText(t,r,n),this._renderWeekText(t,a,r,n)},_renderDayRect:function(t,e,i){for(var n=t.coordinateSystem,o=t.getModel("itemStyle").getItemStyle(),a=n.getCellWidth(),r=n.getCellHeight(),s=e.start.time;s<=e.end.time;s=n.getNextNDay(s,1).time){var l=n.dataToRect([s],!1).tl,u=new jb({shape:{x:l[0],y:l[1],width:a,height:r},cursor:"default",style:o});i.add(u)}},_renderLines:function(t,e,i,n){function o(e){a._firstDayOfMonth.push(r.getDateInfo(e)),a._firstDayPoints.push(r.dataToRect([e],!1).tl);var o=a._getLinePointsOfOneWeek(t,e,i);a._tlpoints.push(o[0]),a._blpoints.push(o[o.length-1]),l&&a._drawSplitline(o,s,n)}var a=this,r=t.coordinateSystem,s=t.getModel("splitLine.lineStyle").getLineStyle(),l=t.get("splitLine.show"),u=s.lineWidth;this._tlpoints=[],this._blpoints=[],this._firstDayOfMonth=[],this._firstDayPoints=[];for(var h=e.start,c=0;h.time<=e.end.time;c++){o(h.formatedDate),0===c&&(h=r.getDateInfo(e.start.y+"-"+e.start.m));var d=h.date;d.setMonth(d.getMonth()+1),h=r.getDateInfo(d)}o(r.getNextNDay(e.end.time,1).formatedDate),l&&this._drawSplitline(a._getEdgesPoints(a._tlpoints,u,i),s,n),l&&this._drawSplitline(a._getEdgesPoints(a._blpoints,u,i),s,n)},_getEdgesPoints:function(t,e,i){var n=[t[0].slice(),t[t.length-1].slice()],o="horizontal"===i?0:1;return n[0][o]=n[0][o]-e/2,n[1][o]=n[1][o]+e/2,n},_drawSplitline:function(t,e,i){var n=new Ub({z2:20,shape:{points:t},style:e});i.add(n)},_getLinePointsOfOneWeek:function(t,e,i){var n=t.coordinateSystem;e=n.getDateInfo(e);for(var o=[],a=0;a<7;a++){var r=n.getNextNDay(e.time,a),s=n.dataToRect([r.time],!1);o[2*r.day]=s.tl,o[2*r.day+1]=s["horizontal"===i?"bl":"tr"]}return o},_formatterLabel:function(t,e){return"string"==typeof t&&t?jo(t,e):"function"==typeof t?t(e):e.nameMap},_yearTextPositionControl:function(t,e,i,n,o){e=e.slice();var a=["center","bottom"];"bottom"===n?(e[1]+=o,a=["center","top"]):"left"===n?e[0]-=o:"right"===n?(e[0]+=o,a=["center","top"]):e[1]-=o;var r=0;return"left"!==n&&"right"!==n||(r=Math.PI/2),{rotation:r,position:e,style:{textAlign:a[0],textVerticalAlign:a[1]}}},_renderYearText:function(t,e,i,n){var o=t.getModel("yearLabel");if(o.get("show")){var a=o.get("margin"),r=o.get("position");r||(r="horizontal"!==i?"top":"left");var s=[this._tlpoints[this._tlpoints.length-1],this._blpoints[0]],l=(s[0][0]+s[1][0])/2,u=(s[0][1]+s[1][1])/2,h="horizontal"===i?0:1,c={top:[l,s[h][1]],bottom:[l,s[1-h][1]],left:[s[1-h][0],u],right:[s[h][0],u]},d=e.start.y;+e.end.y>+e.start.y&&(d=d+"-"+e.end.y);var f=o.get("formatter"),p={start:e.start.y,end:e.end.y,nameMap:d},g=this._formatterLabel(f,p),m=new zb({z2:30});no(m.style,o,{text:g}),m.attr(this._yearTextPositionControl(m,c[r],i,r,a)),n.add(m)}},_monthTextPositionControl:function(t,e,i,n,o){var a="left",r="top",s=t[0],l=t[1];return"horizontal"===i?(l+=o,e&&(a="center"),"start"===n&&(r="bottom")):(s+=o,e&&(r="middle"),"start"===n&&(a="right")),{x:s,y:l,textAlign:a,textVerticalAlign:r}},_renderMonthText:function(t,e,i){var n=t.getModel("monthLabel");if(n.get("show")){var o=n.get("nameMap"),r=n.get("margin"),s=n.get("position"),l=n.get("align"),u=[this._tlpoints,this._blpoints];_(o)&&(o=jk[o.toUpperCase()]||[]);var h="start"===s?0:1,c="horizontal"===e?0:1;r="start"===s?-r:r;for(var d="center"===l,f=0;f=r[0]&&t<=r[1]}if(t===this._dataZoomModel){var n=this._dimName,o=this.getTargetSeriesModels(),a=t.get("filterMode"),r=this._valueWindow;"none"!==a&&$k(o,function(t){var e=t.getData(),o=e.mapDimension(n,!0);"weakFilter"===a?e.filterSelf(function(t){for(var i,n,a,s=0;sr[1];if(u&&!h&&!c)return!0;u&&(a=!0),h&&(i=!0),c&&(n=!0)}return a&&i&&n}):$k(o,function(n){if("empty"===a)t.setData(e.map(n,function(t){return i(t)?t:NaN}));else{var o={};o[n]=r,e.selectRange(o)}}),$k(o,function(t){e.setApproximateExtent(r,t)})})}}};var Qk=d,tP=qk,eP=ms({type:"dataZoom",dependencies:["xAxis","yAxis","zAxis","radiusAxis","angleAxis","singleAxis","series"],defaultOption:{zlevel:0,z:4,orient:null,xAxisIndex:null,yAxisIndex:null,filterMode:"filter",throttle:null,start:0,end:100,startValue:null,endValue:null,minSpan:null,maxSpan:null,minValueSpan:null,maxValueSpan:null,rangeMode:null},init:function(t,e,i){this._dataIntervalByAxis={},this._dataInfo={},this._axisProxies={},this.textStyleModel,this._autoThrottle=!0,this._rangePropMode=["percent","percent"];var n=yv(t);this.mergeDefaultAndTheme(t,i),this.doInit(n)},mergeOption:function(t){var e=yv(t);n(this.option,t,!0),this.doInit(e)},doInit:function(t){var e=this.option;Ax.canvasSupported||(e.realtime=!1),this._setDefaultThrottle(t),xv(this,t),Qk([["start","startValue"],["end","endValue"]],function(t,i){"value"===this._rangePropMode[i]&&(e[t[0]]=null)},this),this.textStyleModel=this.getModel("textStyle"),this._resetTarget(),this._giveAxisProxies()},_giveAxisProxies:function(){var t=this._axisProxies;this.eachTargetAxis(function(e,i,n,o){var a=this.dependentModels[e.axis][i],r=a.__dzAxisProxy||(a.__dzAxisProxy=new Jk(e.name,i,this,o));t[e.name+"_"+i]=r},this)},_resetTarget:function(){var t=this.option,e=this._judgeAutoMode();tP(function(e){var i=e.axisIndex;t[i]=Si(t[i])},this),"axisIndex"===e?this._autoSetAxisIndex():"orient"===e&&this._autoSetOrient()},_judgeAutoMode:function(){var t=this.option,e=!1;tP(function(i){null!=t[i.axisIndex]&&(e=!0)},this);var i=t.orient;return null==i&&e?"orient":e?void 0:(null==i&&(t.orient="horizontal"),"axisIndex")},_autoSetAxisIndex:function(){var t=!0,e=this.get("orient",!0),i=this.option,n=this.dependentModels;if(t){var o="vertical"===e?"y":"x";n[o+"Axis"].length?(i[o+"AxisIndex"]=[0],t=!1):Qk(n.singleAxis,function(n){t&&n.get("orient",!0)===e&&(i.singleAxisIndex=[n.componentIndex],t=!1)})}t&&tP(function(e){if(t){var n=[],o=this.dependentModels[e.axis];if(o.length&&!n.length)for(var a=0,r=o.length;a0?100:20}},getFirstTargetAxisModel:function(){var t;return tP(function(e){if(null==t){var i=this.get(e.axisIndex);i.length&&(t=this.dependentModels[e.axis][i[0]])}},this),t},eachTargetAxis:function(t,e){var i=this.ecModel;tP(function(n){Qk(this.get(n.axisIndex),function(o){t.call(e,n,o,this,i)},this)},this)},getAxisProxy:function(t,e){return this._axisProxies[t+"_"+e]},getAxisModel:function(t,e){var i=this.getAxisProxy(t,e);return i&&i.getAxisModel()},setRawRange:function(t,e){var i=this.option;Qk([["start","startValue"],["end","endValue"]],function(e){null==t[e[0]]&&null==t[e[1]]||(i[e[0]]=t[e[0]],i[e[1]]=t[e[1]])},this),!e&&xv(this,t)},getPercentRange:function(){var t=this.findRepresentativeAxisProxy();if(t)return t.getDataPercentWindow()},getValueRange:function(t,e){if(null!=t||null!=e)return this.getAxisProxy(t,e).getDataValueWindow();var i=this.findRepresentativeAxisProxy();return i?i.getDataValueWindow():void 0},findRepresentativeAxisProxy:function(t){if(t)return t.__dzAxisProxy;var e=this._axisProxies;for(var i in e)if(e.hasOwnProperty(i)&&e[i].hostedBy(this))return e[i];for(var i in e)if(e.hasOwnProperty(i)&&!e[i].hostedBy(this))return e[i]},getRangePropMode:function(){return this._rangePropMode.slice()}}),iP=vM.extend({type:"dataZoom",render:function(t,e,i,n){this.dataZoomModel=t,this.ecModel=e,this.api=i},getTargetCoordInfo:function(){function t(t,e,i,n){for(var o,a=0;a0&&e%g)p+=f;else{var i=null==t||isNaN(t)||""===t,n=i?0:oP(t,a,u,!0);i&&!l&&e?(c.push([c[c.length-1][0],0]),d.push([d[d.length-1][0],0])):!i&&l&&(c.push([p,0]),d.push([p,0])),c.push([p,n]),d.push([p,n]),p+=f,l=i}});var m=this.dataZoomModel;this._displayables.barGroup.add(new Zb({shape:{points:c},style:r({fill:m.get("dataBackgroundColor")},m.getModel("dataBackground.areaStyle").getAreaStyle()),silent:!0,z2:-20})),this._displayables.barGroup.add(new Ub({shape:{points:d},style:m.getModel("dataBackground.lineStyle").getLineStyle(),silent:!0,z2:-19}))}}},_prepareDataShadowInfo:function(){var t=this.dataZoomModel,e=t.get("showDataShadow");if(!1!==e){var i,n=this.ecModel;return t.eachTargetAxis(function(o,a){d(t.getAxisProxy(o.name,a).getTargetSeriesModels(),function(t){if(!(i||!0!==e&&l(hP,t.get("type"))<0)){var r,s=n.getComponent(o.axis,a).axis,u=_v(o.name),h=t.coordinateSystem;null!=u&&h.getOtherAxis&&(r=h.getOtherAxis(s).inverse),u=t.getData().mapDimension(u),i={thisAxis:s,series:t,thisDim:o.name,otherDim:u,otherAxisInverse:r}}},this)},this),i}},_renderHandle:function(){var t=this._displayables,e=t.handles=[],i=t.handleLabels=[],n=this._displayables.barGroup,o=this._size,a=this.dataZoomModel;n.add(t.filler=new nP({draggable:!0,cursor:wv(this._orient),drift:rP(this._onDragMove,this,"all"),onmousemove:function(t){rw(t.event)},ondragstart:rP(this._showDataInfo,this,!0),ondragend:rP(this._onDragEnd,this),onmouseover:rP(this._showDataInfo,this,!0),onmouseout:rP(this._showDataInfo,this,!1),style:{fill:a.get("fillerColor"),textPosition:"inside"}})),n.add(new nP(Fn({silent:!0,shape:{x:0,y:0,width:o[0],height:o[1]},style:{stroke:a.get("dataBackgroundColor")||a.get("borderColor"),lineWidth:1,fill:"rgba(0,0,0,0)"}}))),sP([0,1],function(t){var o=_o(a.get("handleIcon"),{cursor:wv(this._orient),draggable:!0,drift:rP(this._onDragMove,this,t),onmousemove:function(t){rw(t.event)},ondragend:rP(this._onDragEnd,this),onmouseover:rP(this._showDataInfo,this,!0),onmouseout:rP(this._showDataInfo,this,!1)},{x:-1,y:0,width:2,height:2}),r=o.getBoundingRect();this._handleHeight=To(a.get("handleSize"),this._size[1]),this._handleWidth=r.width/r.height*this._handleHeight,o.setStyle(a.getModel("handleStyle").getItemStyle());var s=a.get("handleColor");null!=s&&(o.style.fill=s),n.add(e[t]=o);var l=a.textStyleModel;this.group.add(i[t]=new zb({silent:!0,invisible:!0,style:{x:0,y:0,text:"",textVerticalAlign:"middle",textAlign:"center",textFill:l.getTextColor(),textFont:l.getFont()},z2:10}))},this)},_resetInterval:function(){var t=this._range=this.dataZoomModel.getPercentRange(),e=this._getViewExtent();this._handleEnds=[oP(t[0],[0,100],e,!0),oP(t[1],[0,100],e,!0)]},_updateInterval:function(t,e){var i=this.dataZoomModel,n=this._handleEnds,o=this._getViewExtent(),a=i.findRepresentativeAxisProxy().getMinMaxSpan(),r=[0,100];eC(e,n,o,i.get("zoomLock")?"all":t,null!=a.minSpan?oP(a.minSpan,r,o,!0):null,null!=a.maxSpan?oP(a.maxSpan,r,o,!0):null),this._range=aP([oP(n[0],o,r,!0),oP(n[1],o,r,!0)])},_updateView:function(t){var e=this._displayables,i=this._handleEnds,n=aP(i.slice()),o=this._size;sP([0,1],function(t){var n=e.handles[t],a=this._handleHeight;n.attr({scale:[a/2,a/2],position:[i[t],o[1]/2-a/2]})},this),e.filler.setShape({x:n[0],y:0,width:n[1]-n[0],height:o[1]}),this._updateDataInfo(t)},_updateDataInfo:function(t){function e(t){var e=go(n.handles[t].parent,this.group),i=vo(0===t?"right":"left",e),s=this._handleWidth/2+uP,l=mo([c[t]+(0===t?-s:s),this._size[1]/2],e);o[t].setStyle({x:l[0],y:l[1],textVerticalAlign:a===lP?"middle":i,textAlign:a===lP?i:"center",text:r[t]})}var i=this.dataZoomModel,n=this._displayables,o=n.handleLabels,a=this._orient,r=["",""];if(i.get("showDetail")){var s=i.findRepresentativeAxisProxy();if(s){var l=s.getAxisModel().axis,u=this._range,h=t?s.calculateDataWindow({start:u[0],end:u[1]}).valueWindow:s.getDataValueWindow();r=[this._formatLabel(h[0],l),this._formatLabel(h[1],l)]}}var c=aP(this._handleEnds.slice());e.call(this,0),e.call(this,1)},_formatLabel:function(t,e){var i=this.dataZoomModel,n=i.get("labelFormatter"),o=i.get("labelPrecision");null!=o&&"auto"!==o||(o=e.getPixelPrecision());var a=null==t||isNaN(t)?"":"category"===e.type||"time"===e.type?e.scale.getLabel(Math.round(t)):t.toFixed(Math.min(o,20));return x(n)?n(t,a):_(n)?n.replace("{value}",a):a},_showDataInfo:function(t){t=this._dragging||t;var e=this._displayables.handleLabels;e[0].attr("invisible",!t),e[1].attr("invisible",!t)},_onDragMove:function(t,e,i){this._dragging=!0;var n=mo([e,i],this._displayables.barGroup.getLocalTransform(),!0);this._updateInterval(t,n[0]);var o=this.dataZoomModel.get("realtime");this._updateView(!o),o&&this._dispatchZoomAction()},_onDragEnd:function(){this._dragging=!1,this._showDataInfo(!1),!this.dataZoomModel.get("realtime")&&this._dispatchZoomAction()},_onClickPanelClick:function(t){var e=this._size,i=this._displayables.barGroup.transformCoordToLocal(t.offsetX,t.offsetY);if(!(i[0]<0||i[0]>e[0]||i[1]<0||i[1]>e[1])){var n=this._handleEnds,o=(n[0]+n[1])/2;this._updateInterval("all",i[0]-o),this._updateView(),this._dispatchZoomAction()}},_dispatchZoomAction:function(){var t=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,start:t[0],end:t[1]})},_findCoordRect:function(){var t;if(sP(this.getTargetCoordInfo(),function(e){if(!t&&e.length){var i=e[0].model.coordinateSystem;t=i.getRect&&i.getRect()}}),!t){var e=this.api.getWidth(),i=this.api.getHeight();t={x:.2*e,y:.2*i,width:.6*e,height:.6*i}}return t}});eP.extend({type:"dataZoom.inside",defaultOption:{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,preventDefaultMouseMove:!0}});var dP=v,fP="\0_ec_dataZoom_roams",pP=m,gP=iP.extend({type:"dataZoom.inside",init:function(t,e){this._range},render:function(t,e,i,n){gP.superApply(this,"render",arguments),Mv(n,t.id)&&(this._range=t.getPercentRange()),d(this.getTargetCoordInfo(),function(e,n){var o=f(e,function(t){return Iv(t.model)});d(e,function(e){var a=e.model,r=t.option;bv(i,{coordId:Iv(a),allCoordIds:o,containsPoint:function(t,e,i){return a.coordinateSystem.containPoint([e,i])},dataZoomId:t.id,throttleRate:t.get("throttle",!0),panGetRange:pP(this._onPan,this,e,n),zoomGetRange:pP(this._onZoom,this,e,n),zoomLock:r.zoomLock,disabled:r.disabled,roamControllerOpt:{zoomOnMouseWheel:r.zoomOnMouseWheel,moveOnMouseMove:r.moveOnMouseMove,preventDefaultMouseMove:r.preventDefaultMouseMove}})},this)},this)},dispose:function(){Sv(this.api,this.dataZoomModel.id),gP.superApply(this,"dispose",arguments),this._range=null},_onPan:function(t,e,i,n,o,a,r,s,l){var u=this._range.slice(),h=t.axisModels[0];if(h){var c=mP[e]([a,r],[s,l],h,i,t),d=c.signal*(u[1]-u[0])*c.pixel/c.pixelLength;return eC(d,u,[0,100],"all"),this._range=u}},_onZoom:function(t,e,i,n,o,a){var r=this._range.slice(),s=t.axisModels[0];if(s){var l=mP[e](null,[o,a],s,i,t),u=(l.signal>0?l.pixelStart+l.pixelLength-l.pixel:l.pixel-l.pixelStart)/l.pixelLength*(r[1]-r[0])+r[0];n=Math.max(1/n,0),r[0]=(r[0]-u)*n+u,r[1]=(r[1]-u)*n+u;var h=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();return eC(0,r,[0,100],0,h.minSpan,h.maxSpan),this._range=r}}}),mP={grid:function(t,e,i,n,o){var a=i.axis,r={},s=o.model.coordinateSystem.getRect();return t=t||[0,0],"x"===a.dim?(r.pixel=e[0]-t[0],r.pixelLength=s.width,r.pixelStart=s.x,r.signal=a.inverse?1:-1):(r.pixel=e[1]-t[1],r.pixelLength=s.height,r.pixelStart=s.y,r.signal=a.inverse?-1:1),r},polar:function(t,e,i,n,o){var a=i.axis,r={},s=o.model.coordinateSystem,l=s.getRadiusAxis().getExtent(),u=s.getAngleAxis().getExtent();return t=t?s.pointToCoord(t):[0,0],e=s.pointToCoord(e),"radiusAxis"===i.mainType?(r.pixel=e[0]-t[0],r.pixelLength=l[1]-l[0],r.pixelStart=l[0],r.signal=a.inverse?1:-1):(r.pixel=e[1]-t[1],r.pixelLength=u[1]-u[0],r.pixelStart=u[0],r.signal=a.inverse?-1:1),r},singleAxis:function(t,e,i,n,o){var a=i.axis,r=o.model.coordinateSystem.getRect(),s={};return t=t||[0,0],"horizontal"===a.orient?(s.pixel=e[0]-t[0],s.pixelLength=r.width,s.pixelStart=r.x,s.signal=a.inverse?1:-1):(s.pixel=e[1]-t[1],s.pixelLength=r.height,s.pixelStart=r.y,s.signal=a.inverse?-1:1),s}};us({getTargetSeries:function(t){var e=z();return t.eachComponent("dataZoom",function(t){t.eachTargetAxis(function(t,i,n){d(n.getAxisProxy(t.name,i).getTargetSeriesModels(),function(t){e.set(t.uid,t)})})}),e},isOverallFilter:!0,overallReset:function(t,e){t.eachComponent("dataZoom",function(t){t.eachTargetAxis(function(t,i,n){n.getAxisProxy(t.name,i).reset(n,e)}),t.eachTargetAxis(function(t,i,n){n.getAxisProxy(t.name,i).filterData(n,e)})}),t.eachComponent("dataZoom",function(t){var e=t.findRepresentativeAxisProxy(),i=e.getDataPercentWindow(),n=e.getDataValueWindow();t.setRawRange({start:i[0],end:i[1],startValue:n[0],endValue:n[1]},!0)})}}),hs("dataZoom",function(t,e){var i=fv(m(e.eachComponent,e,"dataZoom"),qk,function(t,e){return t.get(e.axisIndex)}),n=[];e.eachComponent({mainType:"dataZoom",query:t},function(t,e){n.push.apply(n,i(t).nodes)}),d(n,function(e,i){e.setRawRange({start:t.start,end:t.end,startValue:t.startValue,endValue:t.endValue})})});var vP=d,yP=function(t){var e=t&&t.visualMap;y(e)||(e=e?[e]:[]),vP(e,function(t){if(t){Ov(t,"splitList")&&!Ov(t,"pieces")&&(t.pieces=t.splitList,delete t.splitList);var e=t.pieces;e&&y(e)&&vP(e,function(t){w(t)&&(Ov(t,"start")&&!Ov(t,"min")&&(t.min=t.start),Ov(t,"end")&&!Ov(t,"max")&&(t.max=t.end))})}})};kS.registerSubTypeDefaulter("visualMap",function(t){return t.categories||(t.pieces?t.pieces.length>0:t.splitNumber>0)&&!t.calculable?"piecewise":"continuous"});var xP=qM.VISUAL.COMPONENT;fs(xP,{createOnAllSeries:!0,reset:function(t,e){var i=[];return e.eachComponent("visualMap",function(e){e.isTargetSeries(t)&&i.push(Rm(e.stateList,e.targetVisuals,m(e.getValueState,e),e.getDataDimension(t.getData())))}),i}}),fs(xP,{createOnAllSeries:!0,reset:function(t,e){var i=t.getData(),n=[];e.eachComponent("visualMap",function(e){if(e.isTargetSeries(t)){var o=e.getVisualMeta(m(Ev,null,t,e))||{stops:[],outerColors:[]},a=e.getDataDimension(i),r=i.getDimensionInfo(a);null!=r&&(o.dimension=r.index,n.push(o))}}),t.getData().setVisual("visualMeta",n)}});var _P={get:function(t,e,n){var o=i((wP[t]||{})[e]);return n&&y(o)?o[o.length-1]:o}},wP={color:{active:["#006edd","#e0ffff"],inactive:["rgba(0,0,0,0)"]},colorHue:{active:[0,360],inactive:[0,0]},colorSaturation:{active:[.3,1],inactive:[0,0]},colorLightness:{active:[.9,.5],inactive:[0,0]},colorAlpha:{active:[.3,1],inactive:[0,0]},opacity:{active:[.3,1],inactive:[0,0]},symbol:{active:["circle","roundRect","diamond"],inactive:["none"]},symbolSize:{active:[10,50],inactive:[0,0]}},bP=fA.mapVisual,SP=fA.eachVisual,MP=y,IP=d,DP=Co,TP=Do,AP=B,CP=ms({type:"visualMap",dependencies:["series"],stateList:["inRange","outOfRange"],replacableOptionKeys:["inRange","outOfRange","target","controller","color"],dataBound:[-1/0,1/0],layoutMode:{type:"box",ignoreSize:!0},defaultOption:{show:!0,zlevel:0,z:4,seriesIndex:"all",min:0,max:200,dimension:null,inRange:null,outOfRange:null,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:"vertical",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",contentColor:"#5793f3",inactiveColor:"#aaa",borderWidth:0,padding:5,textGap:10,precision:0,color:null,formatter:null,text:null,textStyle:{color:"#333"}},init:function(t,e,i){this._dataExtent,this.targetVisuals={},this.controllerVisuals={},this.textStyleModel,this.itemSize,this.mergeDefaultAndTheme(t,i)},optionUpdated:function(t,e){var i=this.option;Ax.canvasSupported||(i.realtime=!1),!e&&Em(i,t,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},resetVisual:function(t){var e=this.stateList;t=m(t,this),this.controllerVisuals=Om(this.option.controller,e,t),this.targetVisuals=Om(this.option.target,e,t)},getTargetSeriesIndices:function(){var t=this.option.seriesIndex,e=[];return null==t||"all"===t?this.ecModel.eachSeries(function(t,i){e.push(i)}):e=Si(t),e},eachTargetSeries:function(t,e){d(this.getTargetSeriesIndices(),function(i){t.call(e,this.ecModel.getSeriesByIndex(i))},this)},isTargetSeries:function(t){var e=!1;return this.eachTargetSeries(function(i){i===t&&(e=!0)}),e},formatValueText:function(t,e,i){function n(t){return t===l[0]?"min":t===l[1]?"max":(+t).toFixed(Math.min(s,20))}var o,a,r=this.option,s=r.precision,l=this.dataBound,u=r.formatter;return i=i||["<",">"],y(t)&&(t=t.slice(),o=!0),a=e?t:o?[n(t[0]),n(t[1])]:n(t),_(u)?u.replace("{value}",o?a[0]:a).replace("{value2}",o?a[1]:a):x(u)?o?u(t[0],t[1]):u(t):o?t[0]===l[0]?i[0]+" "+a[1]:t[1]===l[1]?i[1]+" "+a[0]:a[0]+" - "+a[1]:a},resetExtent:function(){var t=this.option,e=DP([t.min,t.max]);this._dataExtent=e},getDataDimension:function(t){var e=this.option.dimension,i=t.dimensions;if(null!=e||i.length){if(null!=e)return t.getDimension(e);for(var n=t.dimensions,o=n.length-1;o>=0;o--){var a=n[o];if(!t.getDimensionInfo(a).isCalculationCoord)return a}}},getExtent:function(){return this._dataExtent.slice()},completeVisualOption:function(){function t(t){MP(o.color)&&!t.inRange&&(t.inRange={color:o.color.slice().reverse()}),t.inRange=t.inRange||{color:e.get("gradientColor")},IP(this.stateList,function(e){var i=t[e];if(_(i)){var n=_P.get(i,"active",l);n?(t[e]={},t[e][i]=n):delete t[e]}},this)}var e=this.ecModel,o=this.option,a={inRange:o.inRange,outOfRange:o.outOfRange},r=o.target||(o.target={}),s=o.controller||(o.controller={});n(r,a),n(s,a);var l=this.isCategory();t.call(this,r),t.call(this,s),function(t,e,i){var n=t[e],o=t[i];n&&!o&&(o=t[i]={},IP(n,function(t,e){if(fA.isValidType(e)){var i=_P.get(e,"inactive",l);null!=i&&(o[e]=i,"color"!==e||o.hasOwnProperty("opacity")||o.hasOwnProperty("colorAlpha")||(o.opacity=[0,0]))}}))}.call(this,r,"inRange","outOfRange"),function(t){var e=(t.inRange||{}).symbol||(t.outOfRange||{}).symbol,n=(t.inRange||{}).symbolSize||(t.outOfRange||{}).symbolSize,o=this.get("inactiveColor");IP(this.stateList,function(a){var r=this.itemSize,s=t[a];s||(s=t[a]={color:l?o:[o]}),null==s.symbol&&(s.symbol=e&&i(e)||(l?"roundRect":["roundRect"])),null==s.symbolSize&&(s.symbolSize=n&&i(n)||(l?r[0]:[r[0],r[0]])),s.symbol=bP(s.symbol,function(t){return"none"===t||"square"===t?"roundRect":t});var u=s.symbolSize;if(null!=u){var h=-1/0;SP(u,function(t){t>h&&(h=t)}),s.symbolSize=bP(u,function(t){return TP(t,[0,h],[0,r[0]],!0)})}},this)}.call(this,s)},resetItemSize:function(){this.itemSize=[parseFloat(this.get("itemWidth")),parseFloat(this.get("itemHeight"))]},isCategory:function(){return!!this.option.categories},setSelected:AP,getValueState:AP,getVisualMeta:AP}),LP=[20,140],kP=CP.extend({type:"visualMap.continuous",defaultOption:{align:"auto",calculable:!1,range:null,realtime:!0,itemHeight:null,itemWidth:null,hoverLink:!0,hoverLinkDataSize:null,hoverLinkOnHandle:null},optionUpdated:function(t,e){kP.superApply(this,"optionUpdated",arguments),this.resetExtent(),this.resetVisual(function(t){t.mappingMethod="linear",t.dataExtent=this.getExtent()}),this._resetRange()},resetItemSize:function(){kP.superApply(this,"resetItemSize",arguments);var t=this.itemSize;"horizontal"===this._orient&&t.reverse(),(null==t[0]||isNaN(t[0]))&&(t[0]=LP[0]),(null==t[1]||isNaN(t[1]))&&(t[1]=LP[1])},_resetRange:function(){var t=this.getExtent(),e=this.option.range;!e||e.auto?(t.auto=1,this.option.range=t):y(e)&&(e[0]>e[1]&&e.reverse(),e[0]=Math.max(e[0],t[0]),e[1]=Math.min(e[1],t[1]))},completeVisualOption:function(){CP.prototype.completeVisualOption.apply(this,arguments),d(this.stateList,function(t){var e=this.option.controller[t].symbolSize;e&&e[0]!==e[1]&&(e[0]=0)},this)},setSelected:function(t){this.option.range=t.slice(),this._resetRange()},getSelected:function(){var t=this.getExtent(),e=Co((this.get("range")||[]).slice());return e[0]>t[1]&&(e[0]=t[1]),e[1]>t[1]&&(e[1]=t[1]),e[0]=i[1]||t<=e[1])?"inRange":"outOfRange"},findTargetDataIndices:function(t){var e=[];return this.eachTargetSeries(function(i){var n=[],o=i.getData();o.each(this.getDataDimension(o),function(e,i){t[0]<=e&&e<=t[1]&&n.push(i)},this),e.push({seriesId:i.id,dataIndex:n})},this),e},getVisualMeta:function(t){function e(e,i){o.push({value:e,color:t(e,i)})}for(var i=zv(0,0,this.getExtent()),n=zv(0,0,this.option.range.slice()),o=[],a=0,r=0,s=n.length,l=i.length;rt[1])break;i.push({color:this.getControllerVisual(a,"color",e),offset:o/100})}return i.push({color:this.getControllerVisual(t[1],"color",e),offset:1}),i},_createBarPoints:function(t,e){var i=this.visualMapModel.itemSize;return[[i[0]-e[0],t[0]],[i[0],t[0]],[i[0],t[1]],[i[0]-e[1],t[1]]]},_createBarGroup:function(t){var e=this._orient,i=this.visualMapModel.get("inverse");return new L_("horizontal"!==e||i?"horizontal"===e&&i?{scale:"bottom"===t?[-1,1]:[1,1],rotation:-Math.PI/2}:"vertical"!==e||i?{scale:"left"===t?[1,1]:[-1,1]}:{scale:"left"===t?[1,-1]:[-1,-1]}:{scale:"bottom"===t?[1,1]:[-1,1],rotation:Math.PI/2})},_updateHandle:function(t,e){if(this._useHandle){var i=this._shapes,n=this.visualMapModel,o=i.handleThumbs,a=i.handleLabels;OP([0,1],function(r){var s=o[r];s.setStyle("fill",e.handlesColor[r]),s.position[1]=t[r];var l=mo(i.handleLabelPoints[r],go(s,this.group));a[r].setStyle({x:l[0],y:l[1],text:n.formatValueText(this._dataInterval[r]),textVerticalAlign:"middle",textAlign:this._applyTransform("horizontal"===this._orient?0===r?"bottom":"top":"left",i.barGroup)})},this)}},_showIndicator:function(t,e,i,n){var o=this.visualMapModel,a=o.getExtent(),r=o.itemSize,s=[0,r[1]],l=NP(t,a,s,!0),u=this._shapes,h=u.indicator;if(h){h.position[1]=l,h.attr("invisible",!1),h.setShape("points",Fv(!!i,n,l,r[1]));var c={convertOpacityToAlpha:!0},d=this.getControllerVisual(t,"color",c);h.setStyle("fill",d);var f=mo(u.indicatorLabelPoint,go(h,this.group)),p=u.indicatorLabel;p.attr("invisible",!1);var g=this._applyTransform("left",u.barGroup),m=this._orient;p.setStyle({text:(i||"")+o.formatValueText(e),textVerticalAlign:"horizontal"===m?g:"middle",textAlign:"horizontal"===m?"center":g,x:f[0],y:f[1]})}},_enableHoverLinkToSeries:function(){var t=this;this._shapes.barGroup.on("mousemove",function(e){if(t._hovering=!0,!t._dragging){var i=t.visualMapModel.itemSize,n=t._applyTransform([e.offsetX,e.offsetY],t._shapes.barGroup,!0,!0);n[1]=EP(zP(0,n[1]),i[1]),t._doHoverLinkToSeries(n[1],0<=n[0]&&n[0]<=i[0])}}).on("mouseout",function(){t._hovering=!1,!t._dragging&&t._clearHoverLinkToSeries()})},_enableHoverLinkFromSeries:function(){var t=this.api.getZr();this.visualMapModel.option.hoverLink?(t.on("mouseover",this._hoverLinkFromSeriesMouseOver,this),t.on("mouseout",this._hideIndicator,this)):this._clearHoverLinkFromSeries()},_doHoverLinkToSeries:function(t,e){var i=this.visualMapModel,n=i.itemSize;if(i.option.hoverLink){var o=[0,n[1]],a=i.getExtent();t=EP(zP(o[0],t),o[1]);var r=Wv(i,a,o),s=[t-r,t+r],l=NP(t,o,a,!0),u=[NP(s[0],o,a,!0),NP(s[1],o,a,!0)];s[0]o[1]&&(u[1]=1/0),e&&(u[0]===-1/0?this._showIndicator(l,u[1],"< ",r):u[1]===1/0?this._showIndicator(l,u[0],"> ",r):this._showIndicator(l,l,"≈ ",r));var h=this._hoverLinkDataIndices,c=[];(e||Hv(i))&&(c=this._hoverLinkDataIndices=i.findTargetDataIndices(u));var d=ki(h,c);this._dispatchHighDown("downplay",Bv(d[0])),this._dispatchHighDown("highlight",Bv(d[1]))}},_hoverLinkFromSeriesMouseOver:function(t){var e=t.target,i=this.visualMapModel;if(e&&null!=e.dataIndex){var n=this.ecModel.getSeriesByIndex(e.seriesIndex);if(i.isTargetSeries(n)){var o=n.getData(e.dataType),a=o.get(i.getDataDimension(o),e.dataIndex,!0);isNaN(a)||this._showIndicator(a,a)}}},_hideIndicator:function(){var t=this._shapes;t.indicator&&t.indicator.attr("invisible",!0),t.indicatorLabel&&t.indicatorLabel.attr("invisible",!0)},_clearHoverLinkToSeries:function(){this._hideIndicator();var t=this._hoverLinkDataIndices;this._dispatchHighDown("downplay",Bv(t)),t.length=0},_clearHoverLinkFromSeries:function(){this._hideIndicator();var t=this.api.getZr();t.off("mouseover",this._hoverLinkFromSeriesMouseOver),t.off("mouseout",this._hideIndicator)},_applyTransform:function(t,e,i,n){var o=go(e,n?null:this.group);return sS[y(t)?"applyTransform":"transformDirection"](t,o,i)},_dispatchHighDown:function(t,e){e&&e.length&&this.api.dispatchAction({type:t,batch:e})},dispose:function(){this._clearHoverLinkFromSeries(),this._clearHoverLinkToSeries()},remove:function(){this._clearHoverLinkFromSeries(),this._clearHoverLinkToSeries()}});hs({type:"selectDataRange",event:"dataRangeSelected",update:"update"},function(t,e){e.eachComponent({mainType:"visualMap",query:t},function(e){e.setSelected(t.selected)})}),ls(yP);var GP=CP.extend({type:"visualMap.piecewise",defaultOption:{selected:null,minOpen:!1,maxOpen:!1,align:"auto",itemWidth:20,itemHeight:14,itemSymbol:"roundRect",pieceList:null,categories:null,splitNumber:5,selectedMode:"multiple",itemGap:10,hoverLink:!0,showLabel:null},optionUpdated:function(t,e){GP.superApply(this,"optionUpdated",arguments),this._pieceList=[],this.resetExtent();var n=this._mode=this._determineMode();FP[this._mode].call(this),this._resetSelected(t,e);var o=this.option.categories;this.resetVisual(function(t,e){"categories"===n?(t.mappingMethod="category",t.categories=i(o)):(t.dataExtent=this.getExtent(),t.mappingMethod="piecewise",t.pieceList=f(this._pieceList,function(t){var t=i(t);return"inRange"!==e&&(t.visual=null),t}))})},completeVisualOption:function(){function t(t,e,i){return t&&t[e]&&(w(t[e])?t[e].hasOwnProperty(i):t[e]===i)}var e=this.option,i={},n=fA.listVisualTypes(),o=this.isCategory();d(e.pieces,function(t){d(n,function(e){t.hasOwnProperty(e)&&(i[e]=1)})}),d(i,function(i,n){var a=0;d(this.stateList,function(i){a|=t(e,i,n)||t(e.target,i,n)},this),!a&&d(this.stateList,function(t){(e[t]||(e[t]={}))[n]=_P.get(n,"inRange"===t?"active":"inactive",o)})},this),CP.prototype.completeVisualOption.apply(this,arguments)},_resetSelected:function(t,e){var i=this.option,n=this._pieceList,o=(e?i:t).selected||{};if(i.selected=o,d(n,function(t,e){var i=this.getSelectedMapKey(t);o.hasOwnProperty(i)||(o[i]=!0)},this),"single"===i.selectedMode){var a=!1;d(n,function(t,e){var i=this.getSelectedMapKey(t);o[i]&&(a?o[i]=!1:a=!0)},this)}},getSelectedMapKey:function(t){return"categories"===this._mode?t.value+"":t.index+""},getPieceList:function(){return this._pieceList},_determineMode:function(){var t=this.option;return t.pieces&&t.pieces.length>0?"pieces":this.option.categories?"categories":"splitNumber"},setSelected:function(t){this.option.selected=i(t)},getValueState:function(t){var e=fA.findPieceIndex(t,this._pieceList);return null!=e&&this.option.selected[this.getSelectedMapKey(this._pieceList[e])]?"inRange":"outOfRange"},findTargetDataIndices:function(t){var e=[];return this.eachTargetSeries(function(i){var n=[],o=i.getData();o.each(this.getDataDimension(o),function(e,i){fA.findPieceIndex(e,this._pieceList)===t&&n.push(i)},this),e.push({seriesId:i.id,dataIndex:n})},this),e},getRepresentValue:function(t){var e;if(this.isCategory())e=t.value;else if(null!=t.value)e=t.value;else{var i=t.interval||[];e=i[0]===-1/0&&i[1]===1/0?0:(i[0]+i[1])/2}return e},getVisualMeta:function(t){function e(e,a){var r=o.getRepresentValue({interval:e});a||(a=o.getValueState(r));var s=t(r,a);e[0]===-1/0?n[0]=s:e[1]===1/0?n[1]=s:i.push({value:e[0],color:s},{value:e[1],color:s})}if(!this.isCategory()){var i=[],n=[],o=this,a=this._pieceList.slice();if(a.length){var r=a[0].interval[0];r!==-1/0&&a.unshift({interval:[-1/0,r]}),(r=a[a.length-1].interval[1])!==1/0&&a.push({interval:[r,1/0]})}else a.push({interval:[-1/0,1/0]});var s=-1/0;return d(a,function(t){var i=t.interval;i&&(i[0]>s&&e([s,i[0]],"outOfRange"),e(i.slice()),s=i[1])},this),{stops:i,outerColors:n}}}}),FP={splitNumber:function(){var t=this.option,e=this._pieceList,i=Math.min(t.precision,20),n=this.getExtent(),o=t.splitNumber;o=Math.max(parseInt(o,10),1),t.splitNumber=o;for(var a=(n[1]-n[0])/o;+a.toFixed(i)!==a&&i<5;)i++;t.precision=i,a=+a.toFixed(i);var r=0;t.minOpen&&e.push({index:r++,interval:[-1/0,n[0]],close:[0,0]});for(var s=n[0],l=r+o;r","≥"][e[0]]];t.text=t.text||this.formatValueText(null!=t.value?t.value:t.interval,!1,i)},this)}};PP.extend({type:"visualMap.piecewise",doRender:function(){var t=this.group;t.removeAll();var e=this.visualMapModel,i=e.get("textGap"),n=e.textStyleModel,o=n.getFont(),a=n.getTextColor(),r=this._getItemAlign(),s=e.itemSize,l=this._getViewData(),u=l.endsText,h=D(e.get("showLabel",!0),!u);u&&this._renderEndsText(t,u[0],s,h,r),d(l.viewPieceList,function(n){var l=n.piece,u=new L_;u.onclick=m(this._onItemClick,this,l),this._enableHoverLink(u,n.indexInModelPieceList);var c=e.getRepresentValue(l);if(this._createItemSymbol(u,c,[0,0,s[0],s[1]]),h){var d=this.visualMapModel.getValueState(c);u.add(new zb({style:{x:"right"===r?-i:s[0]+i,y:s[1]/2,text:l.text,textVerticalAlign:"middle",textAlign:r,textFont:o,textFill:a,opacity:"outOfRange"===d?.5:1}}))}t.add(u)},this),u&&this._renderEndsText(t,u[1],s,h,r),AS(e.get("orient"),t,e.get("itemGap")),this.renderBackground(t),this.positionGroup(t)},_enableHoverLink:function(t,e){function i(t){var i=this.visualMapModel;i.option.hoverLink&&this.api.dispatchAction({type:t,batch:Bv(i.findTargetDataIndices(e))})}t.on("mouseover",m(i,this,"highlight")).on("mouseout",m(i,this,"downplay"))},_getItemAlign:function(){var t=this.visualMapModel,e=t.option;if("vertical"===e.orient)return Rv(t,this.api,t.itemSize);var i=e.align;return i&&"auto"!==i||(i="left"),i},_renderEndsText:function(t,e,i,n,o){if(e){var a=new L_,r=this.visualMapModel.textStyleModel;a.add(new zb({style:{x:n?"right"===o?i[0]:0:i[0]/2,y:i[1]/2,textVerticalAlign:"middle",textAlign:n?o:"center",text:e,textFont:r.getFont(),textFill:r.getTextColor()}})),t.add(a)}},_getViewData:function(){var t=this.visualMapModel,e=f(t.getPieceList(),function(t,e){return{piece:t,indexInModelPieceList:e}}),i=t.get("text"),n=t.get("orient"),o=t.get("inverse");return("horizontal"===n?o:!o)?e.reverse():i&&(i=i.slice().reverse()),{viewPieceList:e,endsText:i}},_createItemSymbol:function(t,e,i){t.add(ml(this.getControllerVisual(e,"symbol"),i[0],i[1],i[2],i[3],this.getControllerVisual(e,"color")))},_onItemClick:function(t){var e=this.visualMapModel,n=e.option,o=i(n.selected),a=e.getSelectedMapKey(t);"single"===n.selectedMode?(o[a]=!0,d(o,function(t,e){o[e]=e===a})):o[a]=!o[a],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:o})}});ls(yP);var WP=Wo,HP=Zo,ZP=ms({type:"marker",dependencies:["series","grid","polar","geo"],init:function(t,e,i,n){this.mergeDefaultAndTheme(t,i),this.mergeOption(t,i,n.createdBySelf,!0)},isAnimationEnabled:function(){if(Ax.node)return!1;var t=this.__hostSeries;return this.getShallow("animation")&&t&&t.isAnimationEnabled()},mergeOption:function(t,e,i,n){var o=this.constructor,r=this.mainType+"Model";i||e.eachSeries(function(t){var i=t.get(this.mainType),s=t[r];i&&i.data?(s?s.mergeOption(i,e,!0):(n&&jv(i),d(i.data,function(t){t instanceof Array?(jv(t[0]),jv(t[1])):jv(t)}),a(s=new o(i,this,e),{mainType:this.mainType,seriesIndex:t.seriesIndex,name:t.name,createdBySelf:!0}),s.__hostSeries=t),t[r]=s):t[r]=null},this)},formatTooltip:function(t){var e=this.getData(),i=this.getRawValue(t),n=y(i)?f(i,WP).join(", "):WP(i),o=e.getName(t),a=HP(this.name);return(null!=i||o)&&(a+="
"),o&&(a+=HP(o),null!=i&&(a+=" : ")),null!=i&&(a+=HP(n)),a},getData:function(){return this._data},setData:function(t){this._data=t}});h(ZP,fM),ZP.extend({type:"markPoint",defaultOption:{zlevel:0,z:5,symbol:"pin",symbolSize:50,tooltip:{trigger:"item"},label:{show:!0,position:"inside"},itemStyle:{borderWidth:2},emphasis:{label:{show:!0}}}});var UP=l,jP=v,XP={min:jP(qv,"min"),max:jP(qv,"max"),average:jP(qv,"average")},YP=vs({type:"marker",init:function(){this.markerGroupMap=z()},render:function(t,e,i){var n=this.markerGroupMap;n.each(function(t){t.__keep=!1});var o=this.type+"Model";e.eachSeries(function(t){var n=t[o];n&&this.renderSeries(t,n,e,i)},this),n.each(function(t){!t.__keep&&this.group.remove(t.group)},this)},renderSeries:function(){}});YP.extend({type:"markPoint",updateTransform:function(t,e,i){e.eachSeries(function(t){var e=t.markPointModel;e&&(iy(e.getData(),t,i),this.markerGroupMap.get(t.id).updateLayout(e))},this)},renderSeries:function(t,e,i,n){var o=t.coordinateSystem,a=t.id,r=t.getData(),s=this.markerGroupMap,l=s.get(a)||s.set(a,new Al),u=ny(o,t,e);e.setData(u),iy(e.getData(),t,n),u.each(function(t){var i=u.getItemModel(t),n=i.getShallow("symbolSize");"function"==typeof n&&(n=n(e.getRawValue(t),e.getDataParams(t))),u.setItemVisual(t,{symbolSize:n,color:i.get("itemStyle.color")||r.getVisual("color"),symbol:i.getShallow("symbol")})}),l.updateData(u),this.group.add(l.group),u.eachItemGraphicEl(function(t){t.traverse(function(t){t.dataModel=e})}),l.__keep=!0,l.group.silent=e.get("silent")||t.get("silent")}}),ls(function(t){t.markPoint=t.markPoint||{}}),ZP.extend({type:"markLine",defaultOption:{zlevel:0,z:5,symbol:["circle","arrow"],symbolSize:[8,16],precision:2,tooltip:{trigger:"item"},label:{show:!0,position:"end"},lineStyle:{type:"dashed"},emphasis:{label:{show:!0},lineStyle:{width:3}},animationEasing:"linear"}});var qP=function(t,e,o,r){var s=t.getData(),l=r.type;if(!y(r)&&("min"===l||"max"===l||"average"===l||null!=r.xAxis||null!=r.yAxis)){var u,h;if(null!=r.yAxis||null!=r.xAxis)u=null!=r.yAxis?"y":"x",e.getAxis(u),h=D(r.yAxis,r.xAxis);else{var c=Kv(r,s,e,t);u=c.valueDataDim,c.valueAxis,h=ey(s,u,l)}var d="x"===u?0:1,f=1-d,p=i(r),g={};p.type=null,p.coord=[],g.coord=[],p.coord[f]=-1/0,g.coord[f]=1/0;var m=o.get("precision");m>=0&&"number"==typeof h&&(h=+h.toFixed(Math.min(m,20))),p.coord[d]=g.coord[d]=h,r=[p,g,{type:l,valueIndex:r.valueIndex,value:h}]}return r=[$v(t,r[0]),$v(t,r[1]),a({},r[2])],r[2].type=r[2].type||"",n(r[2],r[0]),n(r[2],r[1]),r};YP.extend({type:"markLine",updateTransform:function(t,e,i){e.eachSeries(function(t){var e=t.markLineModel;if(e){var n=e.getData(),o=e.__from,a=e.__to;o.each(function(e){sy(o,e,!0,t,i),sy(a,e,!1,t,i)}),n.each(function(t){n.setItemLayout(t,[o.getItemLayout(t),a.getItemLayout(t)])}),this.markerGroupMap.get(t.id).updateLayout()}},this)},renderSeries:function(t,e,i,n){function o(e,i,o){var a=e.getItemModel(i);sy(e,i,o,t,n),e.setItemVisual(i,{symbolSize:a.get("symbolSize")||g[o?0:1],symbol:a.get("symbol",!0)||p[o?0:1],color:a.get("itemStyle.color")||s.getVisual("color")})}var a=t.coordinateSystem,r=t.id,s=t.getData(),l=this.markerGroupMap,u=l.get(r)||l.set(r,new $c);this.group.add(u.group);var h=ly(a,t,e),c=h.from,d=h.to,f=h.line;e.__from=c,e.__to=d,e.setData(f);var p=e.get("symbol"),g=e.get("symbolSize");y(p)||(p=[p,p]),"number"==typeof g&&(g=[g,g]),h.from.each(function(t){o(c,t,!0),o(d,t,!1)}),f.each(function(t){var e=f.getItemModel(t).get("lineStyle.color");f.setItemVisual(t,{color:e||c.getItemVisual(t,"color")}),f.setItemLayout(t,[c.getItemLayout(t),d.getItemLayout(t)]),f.setItemVisual(t,{fromSymbolSize:c.getItemVisual(t,"symbolSize"),fromSymbol:c.getItemVisual(t,"symbol"),toSymbolSize:d.getItemVisual(t,"symbolSize"),toSymbol:d.getItemVisual(t,"symbol")})}),u.updateData(f),h.line.eachItemGraphicEl(function(t,i){t.traverse(function(t){t.dataModel=e})}),u.__keep=!0,u.group.silent=e.get("silent")||t.get("silent")}}),ls(function(t){t.markLine=t.markLine||{}}),ZP.extend({type:"markArea",defaultOption:{zlevel:0,z:1,tooltip:{trigger:"item"},animation:!1,label:{show:!0,position:"top"},itemStyle:{borderWidth:0},emphasis:{label:{show:!0,position:"top"}}}});var $P=function(t,e,i,n){var a=$v(t,n[0]),r=$v(t,n[1]),s=D,l=a.coord,u=r.coord;l[0]=s(l[0],-1/0),l[1]=s(l[1],-1/0),u[0]=s(u[0],1/0),u[1]=s(u[1],1/0);var h=o([{},a,r]);return h.coord=[a.coord,r.coord],h.x0=a.x,h.y0=a.y,h.x1=r.x,h.y1=r.y,h},KP=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]];YP.extend({type:"markArea",updateTransform:function(t,e,i){e.eachSeries(function(t){var e=t.markAreaModel;if(e){var n=e.getData();n.each(function(e){var o=f(KP,function(o){return dy(n,e,o,t,i)});n.setItemLayout(e,o),n.getItemGraphicEl(e).setShape("points",o)})}},this)},renderSeries:function(t,e,i,n){var o=t.coordinateSystem,a=t.name,s=t.getData(),l=this.markerGroupMap,u=l.get(a)||l.set(a,{group:new L_});this.group.add(u.group),u.__keep=!0;var h=fy(o,t,e);e.setData(h),h.each(function(e){h.setItemLayout(e,f(KP,function(i){return dy(h,e,i,t,n)})),h.setItemVisual(e,{color:s.getVisual("color")})}),h.diff(u.__data).add(function(t){var e=new Zb({shape:{points:h.getItemLayout(t)}});h.setItemGraphicEl(t,e),u.group.add(e)}).update(function(t,i){var n=u.__data.getItemGraphicEl(i);fo(n,{shape:{points:h.getItemLayout(t)}},e,t),u.group.add(n),h.setItemGraphicEl(t,n)}).remove(function(t){var e=u.__data.getItemGraphicEl(t);u.group.remove(e)}).execute(),h.eachItemGraphicEl(function(t,i){var n=h.getItemModel(i),o=n.getModel("label"),a=n.getModel("emphasis.label"),s=h.getItemVisual(i,"color");t.useStyle(r(n.getModel("itemStyle").getItemStyle(),{fill:zt(s,.4),stroke:s})),t.hoverStyle=n.getModel("emphasis.itemStyle").getItemStyle(),io(t.style,t.hoverStyle,o,a,{labelFetcher:e,labelDataIndex:i,defaultText:h.getName(i)||"",isRectText:!0,autoColor:s}),eo(t,{}),t.dataModel=e}),u.__data=h,u.group.silent=e.get("silent")||t.get("silent")}}),ls(function(t){t.markArea=t.markArea||{}});kS.registerSubTypeDefaulter("timeline",function(){return"slider"}),hs({type:"timelineChange",event:"timelineChanged",update:"prepareAndUpdate"},function(t,e){var i=e.getComponent("timeline");return i&&null!=t.currentIndex&&(i.setCurrentIndex(t.currentIndex),!i.get("loop",!0)&&i.isIndexMax()&&i.setPlayState(!1)),e.resetOption("timeline"),r({currentIndex:i.option.currentIndex},t)}),hs({type:"timelinePlayChange",event:"timelinePlayChanged",update:"update"},function(t,e){var i=e.getComponent("timeline");i&&null!=t.playState&&i.setPlayState(t.playState)});var JP=kS.extend({type:"timeline",layoutMode:"box",defaultOption:{zlevel:0,z:4,show:!0,axisType:"time",realtime:!0,left:"20%",top:null,right:"20%",bottom:0,width:null,height:40,padding:5,controlPosition:"left",autoPlay:!1,rewind:!1,loop:!0,playInterval:2e3,currentIndex:0,itemStyle:{},label:{color:"#000"},data:[]},init:function(t,e,i){this._data,this._names,this.mergeDefaultAndTheme(t,i),this._initData()},mergeOption:function(t){JP.superApply(this,"mergeOption",arguments),this._initData()},setCurrentIndex:function(t){null==t&&(t=this.option.currentIndex);var e=this._data.count();this.option.loop?t=(t%e+e)%e:(t>=e&&(t=e-1),t<0&&(t=0)),this.option.currentIndex=t},getCurrentIndex:function(){return this.option.currentIndex},isIndexMax:function(){return this.getCurrentIndex()>=this._data.count()-1},setPlayState:function(t){this.option.autoPlay=!!t},getPlayState:function(){return!!this.option.autoPlay},_initData:function(){var t=this.option,e=t.data||[],n=t.axisType,o=this._names=[];if("category"===n){var a=[];d(e,function(t,e){var n,r=Ii(t);w(t)?(n=i(t)).value=e:n=e,a.push(n),_(r)||null!=r&&!isNaN(r)||(r=""),o.push(r+"")}),e=a}var r={category:"ordinal",time:"time"}[n]||"number";(this._data=new DI([{name:"value",type:r}],this)).initData(e,o)},getData:function(){return this._data},getCategories:function(){if("category"===this.get("axisType"))return this._names.slice()}});h(JP.extend({type:"timeline.slider",defaultOption:{backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,orient:"horizontal",inverse:!1,tooltip:{trigger:"item"},symbol:"emptyCircle",symbolSize:10,lineStyle:{show:!0,width:2,color:"#304654"},label:{position:"auto",show:!0,interval:"auto",rotate:0,color:"#304654"},itemStyle:{color:"#304654",borderWidth:1},checkpointStyle:{symbol:"circle",symbolSize:13,color:"#c23531",borderWidth:5,borderColor:"rgba(194,53,49, 0.5)",animation:!0,animationDuration:300,animationEasing:"quinticInOut"},controlStyle:{show:!0,showPlayBtn:!0,showPrevBtn:!0,showNextBtn:!0,itemSize:22,itemGap:12,position:"left",playIcon:"path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z",stopIcon:"path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z",nextIcon:"path://M18.6,50.8l22.5-22.5c0.2-0.2,0.3-0.4,0.3-0.7c0-0.3-0.1-0.5-0.3-0.7L18.7,4.4c-0.1-0.1-0.2-0.3-0.2-0.5 c0-0.4,0.3-0.8,0.8-0.8c0.2,0,0.5,0.1,0.6,0.3l23.5,23.5l0,0c0.2,0.2,0.3,0.4,0.3,0.7c0,0.3-0.1,0.5-0.3,0.7l-0.1,0.1L19.7,52 c-0.1,0.1-0.3,0.2-0.5,0.2c-0.4,0-0.8-0.3-0.8-0.8C18.4,51.2,18.5,51,18.6,50.8z",prevIcon:"path://M43,52.8L20.4,30.3c-0.2-0.2-0.3-0.4-0.3-0.7c0-0.3,0.1-0.5,0.3-0.7L42.9,6.4c0.1-0.1,0.2-0.3,0.2-0.5 c0-0.4-0.3-0.8-0.8-0.8c-0.2,0-0.5,0.1-0.6,0.3L18.3,28.8l0,0c-0.2,0.2-0.3,0.4-0.3,0.7c0,0.3,0.1,0.5,0.3,0.7l0.1,0.1L41.9,54 c0.1,0.1,0.3,0.2,0.5,0.2c0.4,0,0.8-0.3,0.8-0.8C43.2,53.2,43.1,53,43,52.8z",color:"#304654",borderColor:"#304654",borderWidth:1},emphasis:{label:{show:!0,color:"#c23531"},itemStyle:{color:"#c23531"},controlStyle:{color:"#c23531",borderColor:"#c23531",borderWidth:2}},data:[]}}),fM);var QP=vM.extend({type:"timeline"}),tN=function(t,e,i,n){dD.call(this,t,e,i),this.type=n||"value",this._autoLabelInterval,this.model=null};tN.prototype={constructor:tN,getLabelInterval:function(){var t=this.model,e=t.getModel("label"),i=e.get("interval");return null!=i&&"auto"!=i?i:((i=this._autoLabelInterval)||(i=this._autoLabelInterval=dl(f(this.scale.getTicks(),this.dataToCoord,this),fl(this,e.get("formatter")),e.getFont(),"horizontal"===t.get("orient")?0:90,e.get("rotate"))),i)},isLabelIgnored:function(t){if("category"===this.type){var e=this.getLabelInterval();return"function"==typeof e&&!e(t,this.scale.getLabel(t))||t%(e+1)}}},u(tN,dD);var eN=m,iN=d,nN=Math.PI;QP.extend({type:"timeline.slider",init:function(t,e){this.api=e,this._axis,this._viewRect,this._timer,this._currentPointer,this._mainGroup,this._labelGroup},render:function(t,e,i,n){if(this.model=t,this.api=i,this.ecModel=e,this.group.removeAll(),t.get("show",!0)){var o=this._layout(t,i),a=this._createGroup("mainGroup"),r=this._createGroup("labelGroup"),s=this._axis=this._createAxis(o,t);t.formatTooltip=function(t){return Zo(s.scale.getLabel(t))},iN(["AxisLine","AxisTick","Control","CurrentPointer"],function(e){this["_render"+e](o,a,s,t)},this),this._renderAxisLabel(o,r,s,t),this._position(o,t)}this._doPlayStop()},remove:function(){this._clearTimer(),this.group.removeAll()},dispose:function(){this._clearTimer()},_layout:function(t,e){var i=t.get("label.position"),n=t.get("orient"),o=vy(t,e);null==i||"auto"===i?i="horizontal"===n?o.y+o.height/2=0||"+"===i?"left":"right"},r={horizontal:i>=0||"+"===i?"top":"bottom",vertical:"middle"},s={horizontal:0,vertical:nN/2},l="vertical"===n?o.height:o.width,u=t.getModel("controlStyle"),h=u.get("show",!0),c=h?u.get("itemSize"):0,d=h?u.get("itemGap"):0,f=c+d,p=t.get("label.rotate")||0;p=p*nN/180;var g,m,v,y,x=u.get("position",!0),_=h&&u.get("showPlayBtn",!0),w=h&&u.get("showPrevBtn",!0),b=h&&u.get("showNextBtn",!0),S=0,M=l;return"left"===x||"bottom"===x?(_&&(g=[0,0],S+=f),w&&(m=[S,0],S+=f),b&&(v=[M-c,0],M-=f)):(_&&(g=[M-c,0],M-=f),w&&(m=[0,0],S+=f),b&&(v=[M-c,0],M-=f)),y=[S,M],t.get("inverse")&&y.reverse(),{viewRect:o,mainLength:l,orient:n,rotation:s[n],labelRotation:p,labelPosOpt:i,labelAlign:t.get("label.align")||a[n],labelBaseline:t.get("label.verticalAlign")||t.get("label.baseline")||r[n],playPosition:g,prevBtnPosition:m,nextBtnPosition:v,axisExtent:y,controlSize:c,controlGap:d}},_position:function(t,e){function i(t){var e=t.position;t.origin=[c[0][0]-e[0],c[1][0]-e[1]]}function n(t){return[[t.x,t.x+t.width],[t.y,t.y+t.height]]}function o(t,e,i,n,o){t[n]+=i[n][o]-e[n][o]}var a=this._mainGroup,r=this._labelGroup,s=t.viewRect;if("vertical"===t.orient){var l=st(),u=s.x,h=s.y+s.height;ct(l,l,[-u,-h]),dt(l,l,-nN/2),ct(l,l,[u,h]),(s=s.clone()).applyTransform(l)}var c=n(s),d=n(a.getBoundingRect()),f=n(r.getBoundingRect()),p=a.position,g=r.position;g[0]=p[0]=c[0][0];var m=t.labelPosOpt;if(isNaN(m))o(p,d,c,1,v="+"===m?0:1),o(g,f,c,1,1-v);else{var v=m>=0?0:1;o(p,d,c,1,v),g[1]=p[1]+m}a.attr("position",p),r.attr("position",g),a.rotation=r.rotation=t.rotation,i(a),i(r)},_createAxis:function(t,e){var i=e.getData(),n=e.get("axisType"),o=cl(e,n),a=i.getDataExtent("value");o.setExtent(a[0],a[1]),this._customizeScale(o,i),o.niceTicks();var r=new tN("value",o,t.axisExtent,n);return r.model=e,r},_customizeScale:function(t,e){t.getTicks=function(){return e.mapArray(["value"],function(t){return t})},t.getTicksLabels=function(){return f(this.getTicks(),t.getLabel,t)}},_createGroup:function(t){var e=this["_"+t]=new L_;return this.group.add(e),e},_renderAxisLine:function(t,e,i,n){var o=i.getExtent();n.get("lineStyle.show")&&e.add(new Xb({shape:{x1:o[0],y1:0,x2:o[1],y2:0},style:a({lineCap:"round"},n.getModel("lineStyle").getLineStyle()),silent:!0,z2:1}))},_renderAxisTick:function(t,e,i,n){var o=n.getData(),a=i.scale.getTicks();iN(a,function(t,a){var r=i.dataToCoord(t),s=o.getItemModel(a),l=s.getModel("itemStyle"),u=s.getModel("emphasis.itemStyle"),h={position:[r,0],onclick:eN(this._changeTimeline,this,a)},c=xy(s,l,e,h);eo(c,u.getItemStyle()),s.get("tooltip")?(c.dataIndex=a,c.dataModel=n):c.dataIndex=c.dataModel=null},this)},_renderAxisLabel:function(t,e,i,n){var o=n.getModel("label");if(o.get("show")){var a=n.getData(),r=i.scale.getTicks(),s=fl(i,o.get("formatter")),l=i.getLabelInterval();iN(r,function(n,o){if(!i.isLabelIgnored(o,l)){var r=a.getItemModel(o),u=r.getModel("label"),h=r.getModel("emphasis.label"),c=i.dataToCoord(n),d=new zb({position:[c,0],rotation:t.labelRotation-t.rotation,onclick:eN(this._changeTimeline,this,o),silent:!1});no(d.style,u,{text:s[o],textAlign:t.labelAlign,textVerticalAlign:t.labelBaseline}),e.add(d),eo(d,no({},h))}},this)}},_renderControl:function(t,e,i,n){function o(t,i,o,h){if(t){var c=yy(n,i,u,{position:t,origin:[a/2,0],rotation:h?-r:0,rectHover:!0,style:s,onclick:o});e.add(c),eo(c,l)}}var a=t.controlSize,r=t.rotation,s=n.getModel("controlStyle").getItemStyle(),l=n.getModel("emphasis.controlStyle").getItemStyle(),u=[0,-a/2,a,a],h=n.getPlayState(),c=n.get("inverse",!0);o(t.nextBtnPosition,"controlStyle.nextIcon",eN(this._changeTimeline,this,c?"-":"+")),o(t.prevBtnPosition,"controlStyle.prevIcon",eN(this._changeTimeline,this,c?"+":"-")),o(t.playPosition,"controlStyle."+(h?"stopIcon":"playIcon"),eN(this._handlePlayClick,this,!h),!0)},_renderCurrentPointer:function(t,e,i,n){var o=n.getData(),a=n.getCurrentIndex(),r=o.getItemModel(a).getModel("checkpointStyle"),s=this,l={onCreate:function(t){t.draggable=!0,t.drift=eN(s._handlePointerDrag,s),t.ondragend=eN(s._handlePointerDragend,s),_y(t,a,i,n,!0)},onUpdate:function(t){_y(t,a,i,n)}};this._currentPointer=xy(r,r,this._mainGroup,{},this._currentPointer,l)},_handlePlayClick:function(t){this._clearTimer(),this.api.dispatchAction({type:"timelinePlayChange",playState:t,from:this.uid})},_handlePointerDrag:function(t,e,i){this._clearTimer(),this._pointerChangeTimeline([i.offsetX,i.offsetY])},_handlePointerDragend:function(t){this._pointerChangeTimeline([t.offsetX,t.offsetY],!0)},_pointerChangeTimeline:function(t,e){var i=this._toAxisCoord(t)[0],n=Co(this._axis.getExtent().slice());i>n[1]&&(i=n[1]),ii.getHeight()&&(n.textPosition="top",l=!0);var u=l?-5-o.height:s+8;a+o.width/2>i.getWidth()?(n.textPosition=["100%",u],n.textAlign="right"):a-o.width/2<0&&(n.textPosition=[0,u],n.textAlign="left")}})}},updateView:function(t,e,i,n){d(this._features,function(t){t.updateView&&t.updateView(t.model,e,i,n)})},remove:function(t,e){d(this._features,function(i){i.remove&&i.remove(t,e)}),this.group.removeAll()},dispose:function(t,e){d(this._features,function(i){i.dispose&&i.dispose(t,e)})}});var aN=AM.toolbox.saveAsImage;by.defaultOption={show:!0,icon:"M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",title:aN.title,type:"png",name:"",excludeComponents:["toolbox"],pixelRatio:1,lang:aN.lang.slice()},by.prototype.unusable=!Ax.canvasSupported,by.prototype.onclick=function(t,e){var i=this.model,n=i.get("name")||t.get("title.0.text")||"echarts",o=document.createElement("a"),a=i.get("type",!0)||"png";o.download=n+"."+a,o.target="_blank";var r=e.getConnectedDataURL({type:a,backgroundColor:i.get("backgroundColor",!0)||t.get("backgroundColor")||"#fff",excludeComponents:i.get("excludeComponents"),pixelRatio:i.get("pixelRatio")});if(o.href=r,"function"!=typeof MouseEvent||Ax.browser.ie||Ax.browser.edge)if(window.navigator.msSaveOrOpenBlob){for(var s=atob(r.split(",")[1]),l=s.length,u=new Uint8Array(l);l--;)u[l]=s.charCodeAt(l);var h=new Blob([u]);window.navigator.msSaveOrOpenBlob(h,n+"."+a)}else{var c=i.get("lang"),d='';window.open().document.write(d)}else{var f=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!1});o.dispatchEvent(f)}},rv("saveAsImage",by);var rN=AM.toolbox.magicType;Sy.defaultOption={show:!0,type:[],icon:{line:"M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",bar:"M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",stack:"M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z",tiled:"M2.3,2.2h22.8V25H2.3V2.2z M35,2.2h22.8V25H35V2.2zM2.3,35h22.8v22.8H2.3V35z M35,35h22.8v22.8H35V35z"},title:i(rN.title),option:{},seriesIndex:{}};var sN=Sy.prototype;sN.getIcons=function(){var t=this.model,e=t.get("icon"),i={};return d(t.get("type"),function(t){e[t]&&(i[t]=e[t])}),i};var lN={line:function(t,e,i,o){if("bar"===t)return n({id:e,type:"line",data:i.get("data"),stack:i.get("stack"),markPoint:i.get("markPoint"),markLine:i.get("markLine")},o.get("option.line")||{},!0)},bar:function(t,e,i,o){if("line"===t)return n({id:e,type:"bar",data:i.get("data"),stack:i.get("stack"),markPoint:i.get("markPoint"),markLine:i.get("markLine")},o.get("option.bar")||{},!0)},stack:function(t,e,i,o){if("line"===t||"bar"===t)return n({id:e,stack:"__ec_magicType_stack__"},o.get("option.stack")||{},!0)},tiled:function(t,e,i,o){if("line"===t||"bar"===t)return n({id:e,stack:""},o.get("option.tiled")||{},!0)}},uN=[["line","bar"],["stack","tiled"]];sN.onclick=function(t,e,i){var n=this.model,o=n.get("seriesIndex."+i);if(lN[i]){var a={series:[]};d(uN,function(t){l(t,i)>=0&&d(t,function(t){n.setIconStatus(t,"normal")})}),n.setIconStatus(i,"emphasis"),t.eachComponent({mainType:"series",query:null==o?null:{seriesIndex:o}},function(e){var o=e.subType,s=e.id,l=lN[i](o,s,e,n);l&&(r(l,e.option),a.series.push(l));var u=e.coordinateSystem;if(u&&"cartesian2d"===u.type&&("line"===i||"bar"===i)){var h=u.getAxesByScale("ordinal")[0];if(h){var c=h.dim+"Axis",d=t.queryComponents({mainType:c,index:e.get(name+"Index"),id:e.get(name+"Id")})[0].componentIndex;a[c]=a[c]||[];for(var f=0;f<=d;f++)a[c][d]=a[c][d]||{};a[c][d].boundaryGap="bar"===i}}}),e.dispatchAction({type:"changeMagicType",currentType:i,newOption:a})}},hs({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(t,e){e.mergeOption(t.newOption)}),rv("magicType",Sy);var hN=AM.toolbox.dataView,cN=new Array(60).join("-"),dN="\t",fN=new RegExp("["+dN+"]+","g");Ny.defaultOption={show:!0,readOnly:!1,optionToContent:null,contentToOption:null,icon:"M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28",title:i(hN.title),lang:i(hN.lang),backgroundColor:"#fff",textColor:"#000",textareaColor:"#fff",textareaBorderColor:"#333",buttonColor:"#c23531",buttonTextColor:"#fff"},Ny.prototype.onclick=function(t,e){function i(){n.removeChild(a),x._dom=null}var n=e.getDom(),o=this.model;this._dom&&n.removeChild(this._dom);var a=document.createElement("div");a.style.cssText="position:absolute;left:5px;top:5px;bottom:5px;right:5px;",a.style.backgroundColor=o.get("backgroundColor")||"#fff";var r=document.createElement("h4"),s=o.get("lang")||[];r.innerHTML=s[0]||o.get("title"),r.style.cssText="margin: 10px 20px;",r.style.color=o.get("textColor");var l=document.createElement("div"),u=document.createElement("textarea");l.style.cssText="display:block;width:100%;overflow:auto;";var h=o.get("optionToContent"),c=o.get("contentToOption"),d=Ty(t);if("function"==typeof h){var f=h(e.getOption());"string"==typeof f?l.innerHTML=f:M(f)&&l.appendChild(f)}else l.appendChild(u),u.readOnly=o.get("readOnly"),u.style.cssText="width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;",u.style.color=o.get("textColor"),u.style.borderColor=o.get("textareaBorderColor"),u.style.backgroundColor=o.get("textareaColor"),u.value=d.value;var p=d.meta,g=document.createElement("div");g.style.cssText="position:absolute;bottom:0;left:0;right:0;";var m="float:right;margin-right:20px;border:none;cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px",v=document.createElement("div"),y=document.createElement("div");m+=";background-color:"+o.get("buttonColor"),m+=";color:"+o.get("buttonTextColor");var x=this;ui(v,"click",i),ui(y,"click",function(){var t;try{t="function"==typeof c?c(l,e.getOption()):Py(u.value,p)}catch(t){throw i(),new Error("Data view format error "+t)}t&&e.dispatchAction({type:"changeDataView",newOption:t}),i()}),v.innerHTML=s[1],y.innerHTML=s[2],y.style.cssText=m,v.style.cssText=m,!o.get("readOnly")&&g.appendChild(y),g.appendChild(v),ui(u,"keydown",function(t){if(9===(t.keyCode||t.which)){var e=this.value,i=this.selectionStart,n=this.selectionEnd;this.value=e.substring(0,i)+dN+e.substring(n),this.selectionStart=this.selectionEnd=i+1,rw(t)}}),a.appendChild(r),a.appendChild(l),a.appendChild(g),l.style.height=n.clientHeight-80+"px",n.appendChild(a),this._dom=a},Ny.prototype.remove=function(t,e){this._dom&&e.getDom().removeChild(this._dom)},Ny.prototype.dispose=function(t,e){this.remove(t,e)},rv("dataView",Ny),hs({type:"changeDataView",event:"dataViewChanged",update:"prepareAndUpdate"},function(t,e){var i=[];d(t.newOption.series,function(t){var n=e.getSeriesByName(t.name)[0];if(n){var o=n.get("data");i.push({name:t.name,data:Oy(t.data,o)})}else i.push(a({type:"scatter"},t))}),e.mergeOption(r({series:i},t.newOption))});var pN=d,gN="\0_ec_hist_store";eP.extend({type:"dataZoom.select"}),iP.extend({type:"dataZoom.select"});var mN=AM.toolbox.dataZoom,vN=d,yN="\0_ec_\0toolbox-dataZoom_";Gy.defaultOption={show:!0,icon:{zoom:"M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1",back:"M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26"},title:i(mN.title)};var xN=Gy.prototype;xN.render=function(t,e,i,n){this.model=t,this.ecModel=e,this.api=i,Hy(t,e,this,n,i),Wy(t,e)},xN.onclick=function(t,e,i){_N[i].call(this)},xN.remove=function(t,e){this._brushController.unmount()},xN.dispose=function(t,e){this._brushController.dispose()};var _N={zoom:function(){var t=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:t})},back:function(){this._dispatchZoomAction(zy(this.ecModel))}};xN._onBrush=function(t,e){function i(t,e,i){var r=e.getAxis(t),s=r.model,l=n(t,s,a),u=l.findRepresentativeAxisProxy(s).getMinMaxSpan();null==u.minValueSpan&&null==u.maxValueSpan||(i=eC(0,i.slice(),r.scale.getExtent(),0,u.minValueSpan,u.maxValueSpan)),l&&(o[l.id]={dataZoomId:l.id,startValue:i[0],endValue:i[1]})}function n(t,e,i){var n;return i.eachComponent({mainType:"dataZoom",subType:"select"},function(i){i.getAxisModel(t,e.componentIndex)&&(n=i)}),n}if(e.isEnd&&t.length){var o={},a=this.ecModel;this._brushController.updateCovers([]),new Zm(Fy(this.model.option),a,{include:["grid"]}).matchOutputRanges(t,a,function(t,e,n){if("cartesian2d"===n.type){var o=t.brushType;"rect"===o?(i("x",n,e[0]),i("y",n,e[1])):i({lineX:"x",lineY:"y"}[o],n,e)}}),Ey(a,o),this._dispatchZoomAction(o)}},xN._dispatchZoomAction=function(t){var e=[];vN(t,function(t,n){e.push(i(t))}),e.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:e})},rv("dataZoom",Gy),ls(function(t){function e(t,e){if(e){var o=t+"Index",a=e[o];null==a||"all"==a||y(a)||(a=!1===a||"none"===a?[]:[a]),i(t,function(e,i){if(null==a||"all"==a||-1!==l(a,i)){var r={type:"select",$fromToolbox:!0,id:yN+t+i};r[o]=i,n.push(r)}})}}function i(e,i){var n=t[e];y(n)||(n=n?[n]:[]),vN(n,i)}if(t){var n=t.dataZoom||(t.dataZoom=[]);y(n)||(t.dataZoom=n=[n]);var o=t.toolbox;if(o&&(y(o)&&(o=o[0]),o&&o.feature)){var a=o.feature.dataZoom;e("xAxis",a),e("yAxis",a)}}});var wN=AM.toolbox.restore;Zy.defaultOption={show:!0,icon:"M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5",title:wN.title},Zy.prototype.onclick=function(t,e,i){Ry(t),e.dispatchAction({type:"restore",from:this.uid})},rv("restore",Zy),hs({type:"restore",event:"restore",update:"prepareAndUpdate"},function(t,e){e.resetOption("recreate")});var bN,SN="urn:schemas-microsoft-com:vml",MN="undefined"==typeof window?null:window,IN=!1,DN=MN&&MN.document;if(DN&&!Ax.canvasSupported)try{!DN.namespaces.zrvml&&DN.namespaces.add("zrvml",SN),bN=function(t){return DN.createElement("')}}catch(t){bN=function(t){return DN.createElement("<"+t+' xmlns="'+SN+'" class="zrvml">')}}var TN=db.CMD,AN=Math.round,CN=Math.sqrt,LN=Math.abs,kN=Math.cos,PN=Math.sin,NN=Math.max;if(!Ax.canvasSupported){var ON=21600,EN=ON/2,zN=function(t){t.style.cssText="position:absolute;left:0;top:0;width:1px;height:1px;",t.coordsize=ON+","+ON,t.coordorigin="0,0"},RN=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""")},BN=function(t,e,i){return"rgb("+[t,e,i].join(",")+")"},VN=function(t,e){e&&t&&e.parentNode!==t&&t.appendChild(e)},GN=function(t,e){e&&t&&e.parentNode===t&&t.removeChild(e)},FN=function(t,e,i){return 1e5*(parseFloat(t)||0)+1e3*(parseFloat(e)||0)+i},WN=function(t,e){return"string"==typeof t?t.lastIndexOf("%")>=0?parseFloat(t)/100*e:parseFloat(t):t},HN=function(t,e,i){var n=At(e);i=+i,isNaN(i)&&(i=1),n&&(t.color=BN(n[0],n[1],n[2]),t.opacity=i*n[3])},ZN=function(t){var e=At(t);return[BN(e[0],e[1],e[2]),e[3]]},UN=function(t,e,i){var n=e.fill;if(null!=n)if(n instanceof Jb){var o,a=0,r=[0,0],s=0,l=1,u=i.getBoundingRect(),h=u.width,c=u.height;if("linear"===n.type){o="gradient";var d=i.transform,f=[n.x*h,n.y*c],p=[n.x2*h,n.y2*c];d&&(Q(f,f,d),Q(p,p,d));var g=p[0]-f[0],m=p[1]-f[1];(a=180*Math.atan2(g,m)/Math.PI)<0&&(a+=360),a<1e-6&&(a=0)}else{o="gradientradial";var f=[n.x*h,n.y*c],d=i.transform,v=i.scale,y=h,x=c;r=[(f[0]-u.x)/y,(f[1]-u.y)/x],d&&Q(f,f,d),y/=v[0]*ON,x/=v[1]*ON;var _=NN(y,x);s=0/_,l=2*n.r/_-s}var w=n.colorStops.slice();w.sort(function(t,e){return t.offset-e.offset});for(var b=w.length,S=[],M=[],I=0;I=2){var A=S[0][0],C=S[1][0],L=S[0][1]*e.opacity,k=S[1][1]*e.opacity;t.type=o,t.method="none",t.focus="100%",t.angle=a,t.color=A,t.color2=C,t.colors=M.join(","),t.opacity=k,t.opacity2=L}"radial"===o&&(t.focusposition=r.join(","))}else HN(t,n,e.opacity)},jN=function(t,e){null!=e.lineDash&&(t.dashstyle=e.lineDash.join(" ")),null==e.stroke||e.stroke instanceof Jb||HN(t,e.stroke,e.opacity)},XN=function(t,e,i,n){var o="fill"==e,a=t.getElementsByTagName(e)[0];null!=i[e]&&"none"!==i[e]&&(o||!o&&i.lineWidth)?(t[o?"filled":"stroked"]="true",i[e]instanceof Jb&&GN(t,a),a||(a=Uy(e)),o?UN(a,i,n):jN(a,i),VN(t,a)):(t[o?"filled":"stroked"]="false",GN(t,a))},YN=[[],[],[]],qN=function(t,e){var i,n,o,a,r,s,l=TN.M,u=TN.C,h=TN.L,c=TN.A,d=TN.Q,f=[],p=t.data,g=t.len();for(a=0;a.01?N&&(O+=.0125):Math.abs(E-A)<1e-4?N&&OT?x-=.0125:x+=.0125:N&&EA?y+=.0125:y-=.0125),f.push(z,AN(((T-C)*M+b)*ON-EN),",",AN(((A-L)*I+S)*ON-EN),",",AN(((T+C)*M+b)*ON-EN),",",AN(((A+L)*I+S)*ON-EN),",",AN((O*M+b)*ON-EN),",",AN((E*I+S)*ON-EN),",",AN((y*M+b)*ON-EN),",",AN((x*I+S)*ON-EN)),r=y,s=x;break;case TN.R:var R=YN[0],B=YN[1];R[0]=p[a++],R[1]=p[a++],B[0]=R[0]+p[a++],B[1]=R[1]+p[a++],e&&(Q(R,R,e),Q(B,B,e)),R[0]=AN(R[0]*ON-EN),B[0]=AN(B[0]*ON-EN),R[1]=AN(R[1]*ON-EN),B[1]=AN(B[1]*ON-EN),f.push(" m ",R[0],",",R[1]," l ",B[0],",",R[1]," l ",B[0],",",B[1]," l ",R[0],",",B[1]);break;case TN.Z:f.push(" x ")}if(i>0){f.push(n);for(var V=0;V100&&(QN=0,JN={});var i,n=tO.style;try{n.font=t,i=n.fontFamily.split(",")[0]}catch(t){}e={style:n.fontStyle||"normal",variant:n.fontVariant||"normal",weight:n.fontWeight||"normal",size:0|parseFloat(n.fontSize||12),family:i||"Microsoft YaHei"},JN[t]=e,QN++}return e};!function(t,e){$_[t]=e}("measureText",function(t,e){var i=DN;KN||((KN=i.createElement("div")).style.cssText="position:absolute;top:-20000px;left:0;padding:0;margin:0;border:none;white-space:pre;",DN.body.appendChild(KN));try{KN.style.font=e}catch(t){}return KN.innerHTML="",KN.appendChild(i.createTextNode(t)),{width:KN.offsetWidth}});for(var iO=new Kt,nO=[tw,Ke,Je,In,zb],oO=0;oO=o&&u+1>=a){for(var h=[],c=0;c=o&&c+1>=a)return lx(0,s.components);l[i]=s}else l[i]=void 0}r++}();if(d)return d}},pushComponent:function(t,e,i){var n=t[t.length-1];n&&n.added===e&&n.removed===i?t[t.length-1]={count:n.count+1,added:e,removed:i}:t.push({count:1,added:e,removed:i})},extractCommon:function(t,e,i,n){for(var o=e.length,a=i.length,r=t.newPos,s=r-n,l=0;r+1=0;--n)if(e[n]===t)return!0;return!1}),i):null:i[0]},hx.prototype.update=function(t,e){if(t){var i=this.getDefs(!1);if(t[this._domName]&&i.contains(t[this._domName]))"function"==typeof e&&e(t);else{var n=this.add(t);n&&(t[this._domName]=n)}}},hx.prototype.addDom=function(t){this.getDefs(!0).appendChild(t)},hx.prototype.removeDom=function(t){var e=this.getDefs(!1);e&&t[this._domName]&&(e.removeChild(t[this._domName]),t[this._domName]=null)},hx.prototype.getDoms=function(){var t=this.getDefs(!1);if(!t)return[];var e=[];return d(this._tagNames,function(i){var n=t.getElementsByTagName(i);e=e.concat([].slice.call(n))}),e},hx.prototype.markAllUnused=function(){var t=this;d(this.getDoms(),function(e){e[t._markLabel]="0"})},hx.prototype.markUsed=function(t){t&&(t[this._markLabel]="1")},hx.prototype.removeUnused=function(){var t=this.getDefs(!1);if(t){var e=this;d(this.getDoms(),function(i){"1"!==i[e._markLabel]&&t.removeChild(i)})}},hx.prototype.getSvgProxy=function(t){return t instanceof In?vO:t instanceof Je?yO:t instanceof zb?xO:vO},hx.prototype.getTextSvgElement=function(t){return t.__textSvgEl},hx.prototype.getSvgElement=function(t){return t.__svgEl},u(cx,hx),cx.prototype.addWithoutUpdate=function(t,e){if(e&&e.style){var i=this;d(["fill","stroke"],function(n){if(e.style[n]&&("linear"===e.style[n].type||"radial"===e.style[n].type)){var o,a=e.style[n],r=i.getDefs(!0);a._dom?(o=a._dom,r.contains(a._dom)||i.addDom(o)):o=i.add(a),i.markUsed(e);var s=o.getAttribute("id");t.setAttribute(n,"url(#"+s+")")}})}},cx.prototype.add=function(t){var e;if("linear"===t.type)e=this.createElement("linearGradient");else{if("radial"!==t.type)return M_("Illegal gradient type."),null;e=this.createElement("radialGradient")}return t.id=t.id||this.nextId++,e.setAttribute("id","zr"+this._zrId+"-gradient-"+t.id),this.updateDom(t,e),this.addDom(e),e},cx.prototype.update=function(t){var e=this;hx.prototype.update.call(this,t,function(){var i=t.type,n=t._dom.tagName;"linear"===i&&"linearGradient"===n||"radial"===i&&"radialGradient"===n?e.updateDom(t,t._dom):(e.removeDom(t),e.add(t))})},cx.prototype.updateDom=function(t,e){if("linear"===t.type)e.setAttribute("x1",t.x),e.setAttribute("y1",t.y),e.setAttribute("x2",t.x2),e.setAttribute("y2",t.y2);else{if("radial"!==t.type)return void M_("Illegal gradient type.");e.setAttribute("cx",t.x),e.setAttribute("cy",t.y),e.setAttribute("r",t.r)}t.global?e.setAttribute("gradientUnits","userSpaceOnUse"):e.setAttribute("gradientUnits","objectBoundingBox"),e.innerHTML="";for(var i=t.colorStops,n=0,o=i.length;n0){var n,o,a=this.getDefs(!0),r=e[0],s=i?"_textDom":"_dom";r[s]?(o=r[s].getAttribute("id"),n=r[s],a.contains(n)||a.appendChild(n)):(o="zr"+this._zrId+"-clip-"+this.nextId,++this.nextId,(n=this.createElement("clipPath")).setAttribute("id",o),a.appendChild(n),r[s]=n);var l=this.getSvgProxy(r);if(r.transform&&r.parent.invTransform&&!i){var u=Array.prototype.slice.call(r.transform);ht(r.transform,r.parent.invTransform,r.transform),l.brush(r),r.transform=u}else l.brush(r);var h=this.getSvgElement(r);n.innerHTML="",n.appendChild(h.cloneNode()),t.setAttribute("clip-path","url(#"+o+")"),e.length>1&&this.updateDom(n,e.slice(1),i)}else t&&t.setAttribute("clip-path","none")},dx.prototype.markUsed=function(t){var e=this;t.__clipPaths&&t.__clipPaths.length>0&&d(t.__clipPaths,function(t){t._dom&&hx.prototype.markUsed.call(e,t._dom),t._textDom&&hx.prototype.markUsed.call(e,t._textDom)})},u(fx,hx),fx.prototype.addWithoutUpdate=function(t,e){if(e&&px(e.style)){var i,n=e.style;n._shadowDom?(i=n._shadowDom,this.getDefs(!0).contains(n._shadowDom)||this.addDom(i)):i=this.add(e),this.markUsed(e);var o=i.getAttribute("id");t.style.filter="url(#"+o+")"}},fx.prototype.add=function(t){var e=this.createElement("filter"),i=t.style;return i._shadowDomId=i._shadowDomId||this.nextId++,e.setAttribute("id","zr"+this._zrId+"-shadow-"+i._shadowDomId),this.updateDom(t,e),this.addDom(e),e},fx.prototype.update=function(t,e){var i=e.style;if(px(i)){var n=this;hx.prototype.update.call(this,e,function(t){n.updateDom(e,t._shadowDom)})}else this.remove(t,i)},fx.prototype.remove=function(t,e){null!=e._shadowDomId&&(this.removeDom(e),t.style.filter="")},fx.prototype.updateDom=function(t,e){var i=e.getElementsByTagName("feDropShadow");i=0===i.length?this.createElement("feDropShadow"):i[0];var n,o,a,r,s=t.style,l=t.scale?t.scale[0]||1:1,u=t.scale?t.scale[1]||1:1;if(s.shadowBlur||s.shadowOffsetX||s.shadowOffsetY)n=s.shadowOffsetX||0,o=s.shadowOffsetY||0,a=s.shadowBlur,r=s.shadowColor;else{if(!s.textShadowBlur)return void this.removeDom(e,s);n=s.textShadowOffsetX||0,o=s.textShadowOffsetY||0,a=s.textShadowBlur,r=s.textShadowColor}i.setAttribute("dx",n/l),i.setAttribute("dy",o/u),i.setAttribute("flood-color",r);var h=a/2/l+" "+a/2/u;i.setAttribute("stdDeviation",h),e.setAttribute("x","-100%"),e.setAttribute("y","-100%"),e.setAttribute("width",Math.ceil(a/2*200)+"%"),e.setAttribute("height",Math.ceil(a/2*200)+"%"),e.appendChild(i),s._shadowDom=e},fx.prototype.markUsed=function(t){var e=t.style;e&&e._shadowDom&&hx.prototype.markUsed.call(this,e._shadowDom)};var MO=function(t,e,i,n){this.root=t,this.storage=e,this._opts=i=a({},i||{});var o=$y("svg");o.setAttribute("xmlns","http://www.w3.org/2000/svg"),o.setAttribute("version","1.1"),o.setAttribute("baseProfile","full"),o.style.cssText="user-select:none;position:absolute;left:0;top:0;",this.gradientManager=new cx(n,o),this.clipPathManager=new dx(n,o),this.shadowManager=new fx(n,o);var r=document.createElement("div");r.style.cssText="overflow:hidden;position:relative",this._svgRoot=o,this._viewport=r,t.appendChild(r),r.appendChild(o),this.resize(i.width,i.height),this._visibleList=[]};MO.prototype={constructor:MO,getType:function(){return"svg"},getViewportRoot:function(){return this._viewport},getViewportRootOffset:function(){var t=this.getViewportRoot();if(t)return{offsetLeft:t.offsetLeft||0,offsetTop:t.offsetTop||0}},refresh:function(){var t=this.storage.getDisplayList(!0);this._paintList(t)},setBackgroundColor:function(t){this._viewport.style.background=t},_paintList:function(t){this.gradientManager.markAllUnused(),this.clipPathManager.markAllUnused(),this.shadowManager.markAllUnused();var e,i=this._svgRoot,n=this._visibleList,o=t.length,a=[];for(e=0;e=0;--n)if(e[n]===t)return!0;return!1}),i):null:i[0]},resize:function(t,e){var i=this._viewport;i.style.display="none";var n=this._opts;if(null!=t&&(n.width=t),null!=e&&(n.height=e),t=this._getSize(0),e=this._getSize(1),i.style.display="",this._width!==t||this._height!==e){this._width=t,this._height=e;var o=i.style;o.width=t+"px",o.height=e+"px";var a=this._svgRoot;a.setAttribute("width",t),a.setAttribute("height",e)}},getWidth:function(){return this._width},getHeight:function(){return this._height},_getSize:function(t){var e=this._opts,i=["width","height"][t],n=["clientWidth","clientHeight"][t],o=["paddingLeft","paddingTop"][t],a=["paddingRight","paddingBottom"][t];if(null!=e[i]&&"auto"!==e[i])return parseFloat(e[i]);var r=this.root,s=document.defaultView.getComputedStyle(r);return(r[n]||gx(s[i])||gx(r.style[i]))-(gx(s[o])||0)-(gx(s[a])||0)|0},dispose:function(){this.root.innerHTML="",this._svgRoot=this._viewport=this.storage=null},clear:function(){this._viewport&&this.root.removeChild(this._viewport)},pathToDataUrl:function(){return this.refresh(),"data:image/svg+xml;charset=UTF-8,"+this._svgRoot.outerHTML}},d(["getLayer","insertLayer","eachLayer","eachBuiltinLayer","eachOtherLayer","getLayers","modLayer","delLayer","clearLayer","toDataURL","pathToImage"],function(t){MO.prototype[t]=Mx(t)}),wi("svg",MO),t.version="4.0.4",t.dependencies=UM,t.PRIORITY=qM,t.init=function(t,e,i){var n=rs(t);if(n)return n;var o=new Vr(t,e,i);return o.id="ec_"+dI++,hI[o.id]=o,zi(t,pI,o.id),os(o),o},t.connect=function(t){if(y(t)){var e=t;t=null,FM(e,function(e){null!=e.group&&(t=e.group)}),t=t||"g_"+fI++,FM(e,function(e){e.group=t})}return cI[t]=!0,t},t.disConnect=as,t.disconnect=mI,t.dispose=function(t){"string"==typeof t?t=hI[t]:t instanceof Vr||(t=rs(t)),t instanceof Vr&&!t.isDisposed()&&t.dispose()},t.getInstanceByDom=rs,t.getInstanceById=function(t){return hI[t]},t.registerTheme=ss,t.registerPreprocessor=ls,t.registerProcessor=us,t.registerPostUpdate=function(t){rI.push(t)},t.registerAction=hs,t.registerCoordinateSystem=cs,t.getCoordinateSystemDimensions=function(t){var e=Ca.get(t);if(e)return e.getDimensionsInfo?e.getDimensionsInfo():e.dimensions.slice()},t.registerLayout=ds,t.registerVisual=fs,t.registerLoading=gs,t.extendComponentModel=ms,t.extendComponentView=vs,t.extendSeriesModel=ys,t.extendChartView=xs,t.setCanvasCreator=function(t){e("createCanvas",t)},t.registerMap=function(t,e,i){e.geoJson&&!e.features&&(i=e.specialAreas,e=e.geoJson),"string"==typeof e&&(e="undefined"!=typeof JSON&&JSON.parse?JSON.parse(e):new Function("return ("+e+");")()),gI[t]={geoJson:e,specialAreas:i}},t.getMap=_s,t.dataTool=vI,t.zrender=_w,t.graphic=sS,t.number=yS,t.format=MS,t.throttle=xr,t.helper=sD,t.matrix=e_,t.vector=Yx,t.color=y_,t.parseGeoJSON=uD,t.parseGeoJson=fD,t.util=pD,t.List=DI,t.Model=wo,t.Axis=dD,t.env=Ax}); diff --git a/cmd/ui/dist/fonts/KFOlCnqEu92Fr1MmEU9fABc4AMP6lbBP.woff2 b/app/dubbo-ui/dist/fonts/KFOlCnqEu92Fr1MmEU9fABc4AMP6lbBP.woff2 similarity index 100% rename from cmd/ui/dist/fonts/KFOlCnqEu92Fr1MmEU9fABc4AMP6lbBP.woff2 rename to app/dubbo-ui/dist/fonts/KFOlCnqEu92Fr1MmEU9fABc4AMP6lbBP.woff2 diff --git a/cmd/ui/dist/fonts/KFOlCnqEu92Fr1MmEU9fBBc4AMP6lQ.woff2 b/app/dubbo-ui/dist/fonts/KFOlCnqEu92Fr1MmEU9fBBc4AMP6lQ.woff2 similarity index 100% rename from cmd/ui/dist/fonts/KFOlCnqEu92Fr1MmEU9fBBc4AMP6lQ.woff2 rename to app/dubbo-ui/dist/fonts/KFOlCnqEu92Fr1MmEU9fBBc4AMP6lQ.woff2 diff --git a/cmd/ui/dist/fonts/KFOlCnqEu92Fr1MmEU9fBxc4AMP6lbBP.woff2 b/app/dubbo-ui/dist/fonts/KFOlCnqEu92Fr1MmEU9fBxc4AMP6lbBP.woff2 similarity index 100% rename from cmd/ui/dist/fonts/KFOlCnqEu92Fr1MmEU9fBxc4AMP6lbBP.woff2 rename to app/dubbo-ui/dist/fonts/KFOlCnqEu92Fr1MmEU9fBxc4AMP6lbBP.woff2 diff --git a/cmd/ui/dist/fonts/KFOlCnqEu92Fr1MmEU9fCBc4AMP6lbBP.woff2 b/app/dubbo-ui/dist/fonts/KFOlCnqEu92Fr1MmEU9fCBc4AMP6lbBP.woff2 similarity index 100% rename from cmd/ui/dist/fonts/KFOlCnqEu92Fr1MmEU9fCBc4AMP6lbBP.woff2 rename to app/dubbo-ui/dist/fonts/KFOlCnqEu92Fr1MmEU9fCBc4AMP6lbBP.woff2 diff --git a/cmd/ui/dist/fonts/KFOlCnqEu92Fr1MmEU9fCRc4AMP6lbBP.woff2 b/app/dubbo-ui/dist/fonts/KFOlCnqEu92Fr1MmEU9fCRc4AMP6lbBP.woff2 similarity index 100% rename from cmd/ui/dist/fonts/KFOlCnqEu92Fr1MmEU9fCRc4AMP6lbBP.woff2 rename to app/dubbo-ui/dist/fonts/KFOlCnqEu92Fr1MmEU9fCRc4AMP6lbBP.woff2 diff --git a/cmd/ui/dist/fonts/KFOlCnqEu92Fr1MmEU9fChc4AMP6lbBP.woff2 b/app/dubbo-ui/dist/fonts/KFOlCnqEu92Fr1MmEU9fChc4AMP6lbBP.woff2 similarity index 100% rename from cmd/ui/dist/fonts/KFOlCnqEu92Fr1MmEU9fChc4AMP6lbBP.woff2 rename to app/dubbo-ui/dist/fonts/KFOlCnqEu92Fr1MmEU9fChc4AMP6lbBP.woff2 diff --git a/cmd/ui/dist/fonts/KFOlCnqEu92Fr1MmEU9fCxc4AMP6lbBP.woff2 b/app/dubbo-ui/dist/fonts/KFOlCnqEu92Fr1MmEU9fCxc4AMP6lbBP.woff2 similarity index 100% rename from cmd/ui/dist/fonts/KFOlCnqEu92Fr1MmEU9fCxc4AMP6lbBP.woff2 rename to app/dubbo-ui/dist/fonts/KFOlCnqEu92Fr1MmEU9fCxc4AMP6lbBP.woff2 diff --git a/cmd/ui/dist/fonts/KFOlCnqEu92Fr1MmSU5fABc4AMP6lbBP.woff2 b/app/dubbo-ui/dist/fonts/KFOlCnqEu92Fr1MmSU5fABc4AMP6lbBP.woff2 similarity index 100% rename from cmd/ui/dist/fonts/KFOlCnqEu92Fr1MmSU5fABc4AMP6lbBP.woff2 rename to app/dubbo-ui/dist/fonts/KFOlCnqEu92Fr1MmSU5fABc4AMP6lbBP.woff2 diff --git a/cmd/ui/dist/fonts/KFOlCnqEu92Fr1MmSU5fBBc4AMP6lQ.woff2 b/app/dubbo-ui/dist/fonts/KFOlCnqEu92Fr1MmSU5fBBc4AMP6lQ.woff2 similarity index 100% rename from cmd/ui/dist/fonts/KFOlCnqEu92Fr1MmSU5fBBc4AMP6lQ.woff2 rename to app/dubbo-ui/dist/fonts/KFOlCnqEu92Fr1MmSU5fBBc4AMP6lQ.woff2 diff --git a/cmd/ui/dist/fonts/KFOlCnqEu92Fr1MmSU5fBxc4AMP6lbBP.woff2 b/app/dubbo-ui/dist/fonts/KFOlCnqEu92Fr1MmSU5fBxc4AMP6lbBP.woff2 similarity index 100% rename from cmd/ui/dist/fonts/KFOlCnqEu92Fr1MmSU5fBxc4AMP6lbBP.woff2 rename to app/dubbo-ui/dist/fonts/KFOlCnqEu92Fr1MmSU5fBxc4AMP6lbBP.woff2 diff --git a/cmd/ui/dist/fonts/KFOlCnqEu92Fr1MmSU5fCBc4AMP6lbBP.woff2 b/app/dubbo-ui/dist/fonts/KFOlCnqEu92Fr1MmSU5fCBc4AMP6lbBP.woff2 similarity index 100% rename from cmd/ui/dist/fonts/KFOlCnqEu92Fr1MmSU5fCBc4AMP6lbBP.woff2 rename to app/dubbo-ui/dist/fonts/KFOlCnqEu92Fr1MmSU5fCBc4AMP6lbBP.woff2 diff --git a/cmd/ui/dist/fonts/KFOlCnqEu92Fr1MmSU5fCRc4AMP6lbBP.woff2 b/app/dubbo-ui/dist/fonts/KFOlCnqEu92Fr1MmSU5fCRc4AMP6lbBP.woff2 similarity index 100% rename from cmd/ui/dist/fonts/KFOlCnqEu92Fr1MmSU5fCRc4AMP6lbBP.woff2 rename to app/dubbo-ui/dist/fonts/KFOlCnqEu92Fr1MmSU5fCRc4AMP6lbBP.woff2 diff --git a/cmd/ui/dist/fonts/KFOlCnqEu92Fr1MmSU5fChc4AMP6lbBP.woff2 b/app/dubbo-ui/dist/fonts/KFOlCnqEu92Fr1MmSU5fChc4AMP6lbBP.woff2 similarity index 100% rename from cmd/ui/dist/fonts/KFOlCnqEu92Fr1MmSU5fChc4AMP6lbBP.woff2 rename to app/dubbo-ui/dist/fonts/KFOlCnqEu92Fr1MmSU5fChc4AMP6lbBP.woff2 diff --git a/cmd/ui/dist/fonts/KFOlCnqEu92Fr1MmSU5fCxc4AMP6lbBP.woff2 b/app/dubbo-ui/dist/fonts/KFOlCnqEu92Fr1MmSU5fCxc4AMP6lbBP.woff2 similarity index 100% rename from cmd/ui/dist/fonts/KFOlCnqEu92Fr1MmSU5fCxc4AMP6lbBP.woff2 rename to app/dubbo-ui/dist/fonts/KFOlCnqEu92Fr1MmSU5fCxc4AMP6lbBP.woff2 diff --git a/cmd/ui/dist/fonts/KFOlCnqEu92Fr1MmWUlfABc4AMP6lbBP.woff2 b/app/dubbo-ui/dist/fonts/KFOlCnqEu92Fr1MmWUlfABc4AMP6lbBP.woff2 similarity index 100% rename from cmd/ui/dist/fonts/KFOlCnqEu92Fr1MmWUlfABc4AMP6lbBP.woff2 rename to app/dubbo-ui/dist/fonts/KFOlCnqEu92Fr1MmWUlfABc4AMP6lbBP.woff2 diff --git a/cmd/ui/dist/fonts/KFOlCnqEu92Fr1MmWUlfBBc4AMP6lQ.woff2 b/app/dubbo-ui/dist/fonts/KFOlCnqEu92Fr1MmWUlfBBc4AMP6lQ.woff2 similarity index 100% rename from cmd/ui/dist/fonts/KFOlCnqEu92Fr1MmWUlfBBc4AMP6lQ.woff2 rename to app/dubbo-ui/dist/fonts/KFOlCnqEu92Fr1MmWUlfBBc4AMP6lQ.woff2 diff --git a/cmd/ui/dist/fonts/KFOlCnqEu92Fr1MmWUlfBxc4AMP6lbBP.woff2 b/app/dubbo-ui/dist/fonts/KFOlCnqEu92Fr1MmWUlfBxc4AMP6lbBP.woff2 similarity index 100% rename from cmd/ui/dist/fonts/KFOlCnqEu92Fr1MmWUlfBxc4AMP6lbBP.woff2 rename to app/dubbo-ui/dist/fonts/KFOlCnqEu92Fr1MmWUlfBxc4AMP6lbBP.woff2 diff --git a/cmd/ui/dist/fonts/KFOlCnqEu92Fr1MmWUlfCBc4AMP6lbBP.woff2 b/app/dubbo-ui/dist/fonts/KFOlCnqEu92Fr1MmWUlfCBc4AMP6lbBP.woff2 similarity index 100% rename from cmd/ui/dist/fonts/KFOlCnqEu92Fr1MmWUlfCBc4AMP6lbBP.woff2 rename to app/dubbo-ui/dist/fonts/KFOlCnqEu92Fr1MmWUlfCBc4AMP6lbBP.woff2 diff --git a/cmd/ui/dist/fonts/KFOlCnqEu92Fr1MmWUlfCRc4AMP6lbBP.woff2 b/app/dubbo-ui/dist/fonts/KFOlCnqEu92Fr1MmWUlfCRc4AMP6lbBP.woff2 similarity index 100% rename from cmd/ui/dist/fonts/KFOlCnqEu92Fr1MmWUlfCRc4AMP6lbBP.woff2 rename to app/dubbo-ui/dist/fonts/KFOlCnqEu92Fr1MmWUlfCRc4AMP6lbBP.woff2 diff --git a/cmd/ui/dist/fonts/KFOlCnqEu92Fr1MmWUlfChc4AMP6lbBP.woff2 b/app/dubbo-ui/dist/fonts/KFOlCnqEu92Fr1MmWUlfChc4AMP6lbBP.woff2 similarity index 100% rename from cmd/ui/dist/fonts/KFOlCnqEu92Fr1MmWUlfChc4AMP6lbBP.woff2 rename to app/dubbo-ui/dist/fonts/KFOlCnqEu92Fr1MmWUlfChc4AMP6lbBP.woff2 diff --git a/cmd/ui/dist/fonts/KFOlCnqEu92Fr1MmWUlfCxc4AMP6lbBP.woff2 b/app/dubbo-ui/dist/fonts/KFOlCnqEu92Fr1MmWUlfCxc4AMP6lbBP.woff2 similarity index 100% rename from cmd/ui/dist/fonts/KFOlCnqEu92Fr1MmWUlfCxc4AMP6lbBP.woff2 rename to app/dubbo-ui/dist/fonts/KFOlCnqEu92Fr1MmWUlfCxc4AMP6lbBP.woff2 diff --git a/cmd/ui/dist/fonts/KFOmCnqEu92Fr1Mu4WxKKTU1Kvnz.woff2 b/app/dubbo-ui/dist/fonts/KFOmCnqEu92Fr1Mu4WxKKTU1Kvnz.woff2 similarity index 100% rename from cmd/ui/dist/fonts/KFOmCnqEu92Fr1Mu4WxKKTU1Kvnz.woff2 rename to app/dubbo-ui/dist/fonts/KFOmCnqEu92Fr1Mu4WxKKTU1Kvnz.woff2 diff --git a/cmd/ui/dist/fonts/KFOmCnqEu92Fr1Mu4mxKKTU1Kg.woff2 b/app/dubbo-ui/dist/fonts/KFOmCnqEu92Fr1Mu4mxKKTU1Kg.woff2 similarity index 100% rename from cmd/ui/dist/fonts/KFOmCnqEu92Fr1Mu4mxKKTU1Kg.woff2 rename to app/dubbo-ui/dist/fonts/KFOmCnqEu92Fr1Mu4mxKKTU1Kg.woff2 diff --git a/cmd/ui/dist/fonts/KFOmCnqEu92Fr1Mu5mxKKTU1Kvnz.woff2 b/app/dubbo-ui/dist/fonts/KFOmCnqEu92Fr1Mu5mxKKTU1Kvnz.woff2 similarity index 100% rename from cmd/ui/dist/fonts/KFOmCnqEu92Fr1Mu5mxKKTU1Kvnz.woff2 rename to app/dubbo-ui/dist/fonts/KFOmCnqEu92Fr1Mu5mxKKTU1Kvnz.woff2 diff --git a/cmd/ui/dist/fonts/KFOmCnqEu92Fr1Mu72xKKTU1Kvnz.woff2 b/app/dubbo-ui/dist/fonts/KFOmCnqEu92Fr1Mu72xKKTU1Kvnz.woff2 similarity index 100% rename from cmd/ui/dist/fonts/KFOmCnqEu92Fr1Mu72xKKTU1Kvnz.woff2 rename to app/dubbo-ui/dist/fonts/KFOmCnqEu92Fr1Mu72xKKTU1Kvnz.woff2 diff --git a/cmd/ui/dist/fonts/KFOmCnqEu92Fr1Mu7GxKKTU1Kvnz.woff2 b/app/dubbo-ui/dist/fonts/KFOmCnqEu92Fr1Mu7GxKKTU1Kvnz.woff2 similarity index 100% rename from cmd/ui/dist/fonts/KFOmCnqEu92Fr1Mu7GxKKTU1Kvnz.woff2 rename to app/dubbo-ui/dist/fonts/KFOmCnqEu92Fr1Mu7GxKKTU1Kvnz.woff2 diff --git a/cmd/ui/dist/fonts/KFOmCnqEu92Fr1Mu7WxKKTU1Kvnz.woff2 b/app/dubbo-ui/dist/fonts/KFOmCnqEu92Fr1Mu7WxKKTU1Kvnz.woff2 similarity index 100% rename from cmd/ui/dist/fonts/KFOmCnqEu92Fr1Mu7WxKKTU1Kvnz.woff2 rename to app/dubbo-ui/dist/fonts/KFOmCnqEu92Fr1Mu7WxKKTU1Kvnz.woff2 diff --git a/cmd/ui/dist/fonts/KFOmCnqEu92Fr1Mu7mxKKTU1Kvnz.woff2 b/app/dubbo-ui/dist/fonts/KFOmCnqEu92Fr1Mu7mxKKTU1Kvnz.woff2 similarity index 100% rename from cmd/ui/dist/fonts/KFOmCnqEu92Fr1Mu7mxKKTU1Kvnz.woff2 rename to app/dubbo-ui/dist/fonts/KFOmCnqEu92Fr1Mu7mxKKTU1Kvnz.woff2 diff --git a/cmd/ui/dist/fonts/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.woff2 b/app/dubbo-ui/dist/fonts/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.woff2 similarity index 100% rename from cmd/ui/dist/fonts/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.woff2 rename to app/dubbo-ui/dist/fonts/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.woff2 diff --git a/cmd/ui/dist/index.html b/app/dubbo-ui/dist/index.html similarity index 100% rename from cmd/ui/dist/index.html rename to app/dubbo-ui/dist/index.html diff --git a/cmd/ui/dist/static/css/app.4de6ac6b.css b/app/dubbo-ui/dist/static/css/app.4de6ac6b.css similarity index 100% rename from cmd/ui/dist/static/css/app.4de6ac6b.css rename to app/dubbo-ui/dist/static/css/app.4de6ac6b.css diff --git a/cmd/ui/dist/static/css/chunk-vendors.52f99f04.css b/app/dubbo-ui/dist/static/css/chunk-vendors.52f99f04.css similarity index 100% rename from cmd/ui/dist/static/css/chunk-vendors.52f99f04.css rename to app/dubbo-ui/dist/static/css/chunk-vendors.52f99f04.css diff --git a/cmd/ui/dist/static/img/jsoneditor-icons.2b9b4872.svg b/app/dubbo-ui/dist/static/img/jsoneditor-icons.2b9b4872.svg similarity index 100% rename from cmd/ui/dist/static/img/jsoneditor-icons.2b9b4872.svg rename to app/dubbo-ui/dist/static/img/jsoneditor-icons.2b9b4872.svg diff --git a/cmd/ui/dist/static/img/logo.5ba69830.png b/app/dubbo-ui/dist/static/img/logo.5ba69830.png similarity index 100% rename from cmd/ui/dist/static/img/logo.5ba69830.png rename to app/dubbo-ui/dist/static/img/logo.5ba69830.png diff --git a/cmd/ui/dist/static/img/max_btn.bdc6b5b1.svg b/app/dubbo-ui/dist/static/img/max_btn.bdc6b5b1.svg similarity index 100% rename from cmd/ui/dist/static/img/max_btn.bdc6b5b1.svg rename to app/dubbo-ui/dist/static/img/max_btn.bdc6b5b1.svg diff --git a/cmd/ui/dist/static/js/app.29227e12.js b/app/dubbo-ui/dist/static/js/app.29227e12.js similarity index 98% rename from cmd/ui/dist/static/js/app.29227e12.js rename to app/dubbo-ui/dist/static/js/app.29227e12.js index d43a784e9..a53402425 100644 --- a/cmd/ui/dist/static/js/app.29227e12.js +++ b/app/dubbo-ui/dist/static/js/app.29227e12.js @@ -1,2 +1,2 @@ -(function(e){function t(t){for(var a,o,l=t[0],n=t[1],c=t[2],u=0,p=[];u{e&&e.length>=4?(this.searchLoading=!0,0===this.selected?this.typeAhead=this.$store.getters.getServiceItems(e):2===this.selected&&(this.typeAhead=this.$store.getters.getAppItems(e)),this.searchLoading=!1,this.timerID=null):this.typeAhead=[]},500)},getHref:function(e,t,s,a){let i="service="+e+"&app="+t;return null!==s&&(i=i+"&group="+s),null!=a&&(i=i+"&version="+a),"#/serviceDetail?"+i},governanceHref:function(e,t,s,a,i){const r="#/governance/"+e;let o=t;return"tagRule"===e&&(o=s),null!==a&&(o=o+"&serviceGroup="+a),null!==i&&(o=o+"&serviceVersion="+i),"tagRule"===e?r+"?application="+o:r+"?service="+o},submit(){if(this.filter=document.querySelector("#serviceSearch").value.trim(),!this.filter)return!1;{const e=this.items[this.selected].value;this.search(this.filter,e,!0)}},search:function(e,t,s){const a=this.pagination.page-1,i=-1===this.pagination.rowsPerPage?this.totalItems:this.pagination.rowsPerPage;this.loadingServices=!0,this.$axios.get("/service",{params:{pattern:t,filter:e,page:a,size:i}}).then(a=>{this.resultPage=a.data,this.totalItems=1,s&&this.$router.push({path:"service",query:{filter:e,pattern:t}})}).finally(()=>{this.loadingServices=!1})},toTestService(e){const t="#/test";let s="?service="+e.service;return e.group&&(s=s+"&group="+e.group),e.version&&(s=s+"&version="+e.version),t+s}},mounted:function(){this.setHeaders(),this.$store.dispatch("loadServiceItems"),this.$store.dispatch("loadAppItems");const e=this.$route.query;let t=null,s=null;Object.keys(e).forEach((function(a){"filter"===a&&(t=e[a]),"pattern"===a&&(s=e[a])})),null!=t&&null!=s?(this.filter=t,"service"===s?this.selected=0:"application"===s?this.selected=2:"ip"===s&&(this.selected=1),this.search(t,s,!1)):(this.filter="*",this.selected=0,s="service",this.search(this.filter,s,!0))}},m=v,f=(s("ef61"),Object(n["a"])(m,p,h,!1,null,"3626ac83",null)),g=f.exports,x=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("v-container",{attrs:{"grid-list-xl":"",fluid:""}},[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{sm12:""}},[s("h3",[e._v(e._s(e.$t("basicInfo")))])]),s("v-flex",{attrs:{lg12:""}},[s("v-data-table",{staticClass:"elevation-1",attrs:{items:e.basic,"hide-actions":"","hide-headers":""},scopedSlots:e._u([{key:"items",fn:function(t){return[s("td",[e._v(e._s(e.$t(t.item.name))+" ")]),s("td",[e._v(e._s(t.item.value))])]}}])})],1),s("v-flex",{attrs:{sm12:""}},[s("h3",[e._v(e._s(e.$t("serviceInfo")))])]),s("v-flex",{attrs:{lg12:""}},[s("v-tabs",{staticClass:"elevation-1"},[s("v-tab",[e._v(" "+e._s(e.$t("providers"))+" ")]),s("v-tab",[e._v(" "+e._s(e.$t("consumers"))+" ")]),s("v-tab-item",[s("v-data-table",{staticClass:"elevation-1",attrs:{headers:e.detailHeaders.providers,items:e.providerDetails},scopedSlots:e._u([{key:"items",fn:function(t){return[s("td",[e._v(e._s(e.getIp(t.item.address)))]),s("td",[e._v(e._s(e.getPort(t.item.address)))]),s("td",[e._v(e._s(t.item.registrySource))]),s("td",[e._v(e._s(t.item.timeout))]),s("td",[e._v(e._s(t.item.serialization))]),s("td",[e._v(e._s(t.item.weight))]),s("td",[s("v-tooltip",{attrs:{top:""}},[s("v-btn",{staticClass:"tiny",attrs:{slot:"activator",color:"primary"},on:{mouseover:function(s){return e.setHoverHint(t.item)},mouseout:function(s){return e.setoutHint(t.item)},click:function(s){return e.toCopyText(t.item.url)}},slot:"activator"},[e._v(" "+e._s(e.$t(t.item.hint))+" ")]),s("span",[e._v(e._s(t.item.url))])],1)],1)]}}])})],1),s("v-tab-item",[s("v-data-table",{staticClass:"elevation-1",attrs:{headers:e.detailHeaders.consumers,items:e.consumerDetails},scopedSlots:e._u([{key:"items",fn:function(t){return[s("td",[e._v(e._s(e.getIp(t.item.address)))]),s("td",[e._v(e._s(t.item.application))])]}}])})],1)],1)],1),s("v-flex",{attrs:{sm12:""}},[s("h3",[e._v(e._s(e.$t("metaData")))])]),s("v-flex",{attrs:{lg12:""}},[s("v-data-table",{staticClass:"elevation-1",attrs:{headers:e.metaHeaders,items:e.methodMetaData},scopedSlots:e._u([{key:"items",fn:function(t){return[s("td",[e._v(e._s(t.item.name))]),s("td",e._l(t.item.parameterTypes,(function(t,a){return s("v-chip",{key:t.id,attrs:{label:""}},[e._v(e._s(t))])})),1),s("td",[s("v-chip",{attrs:{label:""}},[e._v(e._s(t.item.returnType))])],1)]}}])},[s("template",{slot:"no-data"},[s("v-alert",{attrs:{value:!0,color:"warning",icon:"warning"}},[e._v(" "+e._s(e.$t("noMetadataHint"))+" "),s("a",{attrs:{href:e.$t("configAddress"),target:"_blank"}},[e._v(e._s(e.$t("here")))])])],1)],2)],1)],1)],1)},b=[],y={data:()=>({metaHeaders:[],detailHeaders:{},providerDetails:[],consumerDetails:[],methodMetaData:[],basic:[]}),methods:{setmetaHeaders:function(){this.metaHeaders=[{text:this.$t("methodName"),value:"method",sortable:!1},{text:this.$t("parameterList"),value:"parameter",sortable:!1},{text:this.$t("returnType"),value:"returnType",sortable:!1}]},setHoverHint:function(e){this.$set(e,"hint","copy")},setoutHint:function(e){this.$set(e,"hint","url")},setdetailHeaders:function(){this.detailHeaders={providers:[{text:this.$t("ip"),value:"ip"},{text:this.$t("port"),value:"port"},{text:this.$t("registrySource"),value:"registrySource"},{text:this.$t("timeout"),value:"timeout"},{text:this.$t("serialization"),value:"serialization"},{text:this.$t("weight"),value:"weight"},{text:this.$t("operation"),value:"operate"}],consumers:[{text:this.$t("ip"),value:"ip"},{text:this.$t("appName"),value:"appName"}]}},detail:function(e){this.$axios.get("/service/"+e).then(e=>{this.providerDetails=e.data.providers;const t=this.$t("instanceRegistry"),s=this.$t("interfaceRegistry"),a=this.$t("allRegistry");for(let i=0;i=2?e.split(":")[1]:null},toCopyText(e){this.$copyText(e).then(()=>{this.$notify.success(this.$t("copySuccessfully"))},()=>{})}},computed:{area(){return this.$i18n.locale}},watch:{area(){this.setdetailHeaders(),this.setmetaHeaders()}},mounted:function(){this.setmetaHeaders(),this.setdetailHeaders();const e=this.$route.query,t={service:"",app:"",group:"",version:""};var s=this;Object.keys(e).forEach((function(s){s in t&&(t[s]=e[s])}));let a=t.service;""!==t.group&&(a=t.group+"*"+a),""!==t.version&&(a=a+":"+t.version),""!==a&&(this.detail(a),Object.keys(t).forEach((function(e){const a={};a.value=t[e],a.name=e,s.basic.push(a)})))}},_=y,k=(s("77b6"),Object(n["a"])(_,x,b,!1,null,"32f6dafc",null)),w=k.exports,$=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("v-container",{attrs:{"grid-list-xl":"",fluid:""}},[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{lg12:""}},[s("breadcrumb",{attrs:{title:"testMethod",items:e.breads}})],1),s("v-flex",{staticClass:"test-form",attrs:{lg12:"",xl6:""}},[s("v-card",[s("v-card-title",{staticClass:"headline"},[e._v(e._s(e.$t("testMethod")+": "+e.method.signature))]),s("v-card-text",[s("json-editor",{attrs:{id:"test"},model:{value:e.method.json,callback:function(t){e.$set(e.method,"json",t)},expression:"method.json"}})],1),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{id:"execute","mt-0":"",color:"primary"},on:{click:function(t){return e.executeMethod()}}},[e._v(e._s(e.$t("execute")))])],1)],1)],1),s("v-flex",{staticClass:"test-result",attrs:{lg12:"",xl6:""}},[s("v-card",[s("v-card-title",{staticClass:"headline"},[e._v(e._s(e.$t("result"))+" "),!0===e.success?s("span",{staticClass:"green--text"},[e._v(e._s(e.$t("success")))]):e._e(),!1===e.success?s("span",{staticClass:"red--text"},[e._v(e._s(e.$t("fail")))]):e._e()]),s("v-card-text",[s("json-editor",{staticClass:"it-test-method-result-container",attrs:{name:"Result",readonly:""},model:{value:e.result,callback:function(t){e.result=t},expression:"result"}})],1)],1)],1)],1)],1)},I=[],D=(s("ddb0"),function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"jsoneditor-vue-container"})}),S=[],C=s("b2cd"),A=s.n(C),R=(s("f241"),{name:"json-editor",props:{value:null,mode:{type:String,default:"tree"},modes:{type:Array,default:()=>["tree","code"]},templates:Array,name:{type:String,default:"Parameters"},readonly:{type:Boolean,default:!1}},data(){return{$jsoneditor:null}},watch:{value(e,t){e!==t&&this.$jsoneditor&&this.$jsoneditor.update(e||{})}},mounted(){const e={name:this.name,navigationBar:!1,search:!1,mode:this.mode,modes:this.modes,onEditable:e=>!this.readonly,onChange:()=>{if(this.$jsoneditor){const e=this.$jsoneditor.get();this.$emit("input",e)}},templates:this.templates};this.$jsoneditor=new A.a(this.$el,e),this.$jsoneditor.set(this.value||{}),this.$jsoneditor.expandAll()},beforeDestroy(){this.$jsoneditor&&(this.$jsoneditor.destroy(),this.$jsoneditor=null)}}),E=R,T=(s("e1a5"),Object(n["a"])(E,D,S,!1,null,"c645be38",null)),L=T.exports,V=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("h2",[e._v(e._s(e.$t(e.title)))]),s("v-breadcrumbs",{attrs:{items:e.items},scopedSlots:e._u([{key:"item",fn:function(t){return[t.item.strong?e._e():s("span",[e._v(e._s(e.$t(t.item.text)))]),t.item.strong?s("strong",[e._v(" "+e._s(e.$t(t.item.text))+" "),s("span",{staticClass:"green--text"},[e._v(e._s(t.item.strong))])]):e._e()]}}])})],1)},H=[],G={name:"Breadcrumb",props:{title:{type:String,default:""},items:{type:Array,default:[]}},data:()=>({})},O=G,B=Object(n["a"])(O,V,H,!1,null,"37deb543",null),N=B.exports,M=s("0f5c"),j=s.n(M);s("5319");const P=(e=[])=>e[Math.floor(Math.random()*e.length)],q=e=>(e||"").replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),Q=()=>{const e=window.document,t=e.documentElement,s=t.requestFullscreen||t.mozRequestFullScreen||t.webkitRequestFullScreen||t.msRequestFullscreen,a=e.exitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen||e.msExitFullscreen;e.fullscreenElement||e.mozFullScreenElement||e.webkitFullscreenElement||e.msFullscreenElement?a.call(e):s.call(t)},F=e=>{const t={};for(const s in e)if(e.hasOwnProperty(s))if("object"===typeof e[s]&&null!==e[s]){const a=F(e[s]);for(const e in a)a.hasOwnProperty(e)&&(t[s+"."+e]=a[e])}else t[s]=e[s];return t};var W={randomElement:P,toggleFullScreen:Q,kebab:q,flattenObject:F},U={name:"TestMethod",components:{JsonEditor:L,Breadcrumb:N},data(){return{success:null,breads:[{text:"serviceSearch",href:"test"},{text:"serviceTest",href:"",strong:this.$route.query.service}],service:this.$route.query.service,application:this.$route.query.application,method:{name:null,signature:this.$route.query.method,parameterTypes:[],json:[],jsonTypes:[]},result:null}},methods:{executeMethod(){this.convertType(this.method.json,this.method.jsonTypes);const e={service:this.service,method:this.method.name,parameterTypes:this.method.parameterTypes,params:this.method.json};this.$axios.post("/test",e).then(e=>{e&&200===e.status&&(this.success=!0,this.result=e.data)}).catch(e=>{this.success=!1,this.result=e.response.data})},convertType(e,t){const s=W.flattenObject(e),a=W.flattenObject(t);Object.keys(s).forEach(t=>{"string"===typeof a[t]&&"string"!==typeof s[t]&&j()(e,t,String(s[t]))})}},mounted(){const e=this.$route.query,t=e.method;if(t){const[e,s]=t.split("~");this.method.name=e,this.method.parameterTypes=s?s.split(";"):[]}const s="/test/method?application="+this.application+"&service="+this.service+"&method="+t;this.$axios.get(encodeURI(s)).then(e=>{this.method.json=e.data.parameterTypes,this.method.jsonTypes=e.data.parameterTypes})}},J=U,z=Object(n["a"])(J,$,I,!1,null,"16526831",null),Y=z.exports,Z=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("v-container",{attrs:{"grid-list-xl":"",fluid:""}},[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{lg12:""}},[s("breadcrumb",{attrs:{title:"routingRule",items:e.breads}}),s("v-flex",{attrs:{lg12:""}},[s("a",{attrs:{href:"https://cn.dubbo.apache.org/zh-cn/overview/core-features/traffic/condition-rule/"}},[e._v("条件路由规则")])])],1),s("v-flex",{attrs:{lg12:""}},[s("v-card",{attrs:{flat:"",color:"transparent"}},[s("v-card-text",[s("v-form",[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",[s("v-combobox",{attrs:{id:"serviceSearch",loading:e.searchLoading,items:e.typeAhead,"search-input":e.input,flat:"","append-icon":"","hide-no-data":"",suffix:e.queryBy,label:e.$t("searchRoutingRule")},on:{"update:searchInput":function(t){e.input=t},"update:search-input":function(t){e.input=t},keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.submit(t)},input:function(t){return e.split(t)}},model:{value:e.filter,callback:function(t){e.filter=t},expression:"filter"}})],1),s("v-menu",{staticClass:"hidden-xs-only"},[s("v-btn",{attrs:{slot:"activator",large:"",icon:""},slot:"activator"},[s("v-icon",[e._v("unfold_more")])],1),s("v-list",e._l(e.items,(function(t,a){return s("v-list-tile",{key:a,on:{click:function(t){e.selected=a}}},[s("v-list-tile-title",[e._v(e._s(e.$t(t.title)))])],1)})),1)],1),s("v-flex",{directives:[{name:"show",rawName:"v-show",value:0===e.selected,expression:"selected === 0"}],attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{directives:[{name:"show",rawName:"v-show",value:0===e.selected,expression:"selected === 0"}],attrs:{label:"Version",hint:e.$t("dataIdVersionHint")},model:{value:e.serviceVersion4Search,callback:function(t){e.serviceVersion4Search=t},expression:"serviceVersion4Search"}})],1),s("v-flex",{directives:[{name:"show",rawName:"v-show",value:0===e.selected,expression:"selected === 0"}],attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Group",hint:e.$t("dataIdGroupHint")},model:{value:e.serviceGroup4Search,callback:function(t){e.serviceGroup4Search=t},expression:"serviceGroup4Search"}})],1),s("v-btn",{attrs:{color:"primary",large:""},on:{click:e.submit}},[e._v(e._s(e.$t("search")))])],1)],1)],1)],1)],1)],1),s("v-flex",{attrs:{lg12:""}},[s("v-card",[s("v-toolbar",{staticClass:"elevation-0",attrs:{flat:"",color:"transparent"}},[s("v-toolbar-title",[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("searchResult")))])]),s("v-spacer"),s("v-btn",{staticClass:"mb-2",attrs:{outline:"",color:"primary"},on:{click:function(t){return t.stopPropagation(),e.openDialog(t)}}},[e._v(e._s(e.$t("create")))])],1),s("v-card-text",{directives:[{name:"show",rawName:"v-show",value:0===e.selected,expression:"selected === 0"}],staticClass:"pa-0"},[s("v-data-table",{staticClass:"elevation-0",attrs:{headers:e.serviceHeaders,items:e.serviceRoutingRules,"hide-actions":""},scopedSlots:e._u([{key:"items",fn:function(t){return[s("td",{staticClass:"text-xs-left"},[e._v(e._s(t.item.service))]),s("td",{staticClass:"text-xs-left"},[e._v(e._s(t.item.serviceGroup))]),s("td",{staticClass:"text-xs-left"},[e._v(e._s(t.item.serviceVersion))]),s("td",{staticClass:"text-xs-left"},[e._v(e._s(t.item.enabled))]),s("td",{staticClass:"text-xs-center px-0"},e._l(e.operations,(function(a){return s("v-tooltip",{key:a.id,attrs:{bottom:""}},[s("v-icon",{staticClass:"mr-2",attrs:{slot:"activator",small:""},on:{click:function(s){e.itemOperation(a.icon(t.item),t.item)}},slot:"activator"},[e._v(" "+e._s(a.icon(t.item))+" ")]),s("span",[e._v(e._s(e.$t(a.tooltip(t.item))))])],1)})),1)]}}])})],1),s("v-card-text",{directives:[{name:"show",rawName:"v-show",value:1===e.selected,expression:"selected === 1"}],staticClass:"pa-0"},[s("v-data-table",{staticClass:"elevation-0",attrs:{headers:e.appHeaders,items:e.appRoutingRules,"hide-actions":""},scopedSlots:e._u([{key:"items",fn:function(t){return[s("td",{staticClass:"text-xs-left"},[e._v(e._s(t.item.application))]),s("td",{staticClass:"text-xs-left"},[e._v(e._s(t.item.enabled))]),s("td",{staticClass:"text-xs-center px-0"},e._l(e.operations,(function(a){return s("v-tooltip",{key:a.id,attrs:{bottom:""}},[s("v-icon",{staticClass:"mr-2",attrs:{slot:"activator",small:""},on:{click:function(s){e.itemOperation(a.icon(t.item),t.item)}},slot:"activator"},[e._v(" "+e._s(a.icon(t.item))+" ")]),s("span",[e._v(e._s(e.$t(a.tooltip(t.item))))])],1)})),1)]}}])})],1)],1)],1),s("v-dialog",{attrs:{width:"800px",persistent:""},model:{value:e.dialog,callback:function(t){e.dialog=t},expression:"dialog"}},[s("v-card",[s("v-card-title",{staticClass:"justify-center"},[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("createNewRoutingRule")))])]),s("v-card-text",[s("v-layout",{attrs:{wrap:""}},[s("v-flex",{attrs:{xs24:"",sm12:"",md8:""}},[s("v-text-field",{attrs:{label:"Service class",hint:e.$t("dataIdClassHint")},model:{value:e.service,callback:function(t){e.service=t},expression:"service"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Version",hint:e.$t("dataIdVersionHint")},model:{value:e.serviceVersion,callback:function(t){e.serviceVersion=t},expression:"serviceVersion"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Group",hint:e.$t("dataIdGroupHint")},model:{value:e.serviceGroup,callback:function(t){e.serviceGroup=t},expression:"serviceGroup"}})],1)],1),s("v-text-field",{attrs:{label:"Application Name",hint:"Application name the service belongs to"},model:{value:e.application,callback:function(t){e.application=t},expression:"application"}}),s("v-subheader",{staticClass:"pa-0 mt-3"},[e._v(e._s(e.$t("ruleContent")))]),s("ace-editor",{attrs:{readonly:e.readonly},model:{value:e.ruleText,callback:function(t){e.ruleText=t},expression:"ruleText"}})],1),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{flat:""},nativeOn:{click:function(t){return e.closeDialog(t)}}},[e._v(e._s(e.$t("close")))]),s("v-btn",{attrs:{depressed:"",color:"primary"},nativeOn:{click:function(t){return e.saveItem(t)}}},[e._v(e._s(e.$t("save")))])],1)],1)],1),s("v-dialog",{attrs:{persistent:"","max-width":"500px"},model:{value:e.warn,callback:function(t){e.warn=t},expression:"warn"}},[s("v-card",[s("v-card-title",{staticClass:"headline"},[e._v(e._s(e.$t(this.warnTitle)))]),s("v-card-text",[e._v(e._s(this.warnText))]),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{flat:""},nativeOn:{click:function(t){return e.closeWarn(t)}}},[e._v(e._s(e.$t("cancel")))]),s("v-btn",{attrs:{depressed:"",color:"primary"},nativeOn:{click:function(t){return e.deleteItem(e.warnStatus)}}},[e._v(e._s(e.$t("confirm")))])],1)],1)],1)],1)},X=[],K=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{style:{height:e.height,width:e.width}})},ee=[],te=s("061c"),se=s.n(te),ae={name:"ace-editor",props:{value:String,width:{type:String,default:"100%"},height:{type:String,default:"300px"},lang:{type:String,default:"yaml"},theme:{type:String,default:"monokai"},readonly:{type:Boolean,default:!1},fontsize:{type:Number,default:14},tabsize:{type:Number,default:2},overrideValueHistory:{type:Boolean,default:!0}},data(){return{$ace:null,_content:""}},watch:{value(e,t){e!==t&&this._content!==e&&(this._content=e,this.overrideValueHistory?this.$ace.getSession().setValue(e):this.$ace.setValue(e,1))},lang(e,t){e!==t&&e&&(s("c1d1")("./"+e),this.$ace.getSession().setMode("ace/mode/"+e))},theme(e,t){e!==t&&e&&(s("07ed")("./"+e),this.$ace.setTheme("ace/theme/"+e))},readonly(e,t){e!==t&&this.$ace.setReadOnly(e)},fontsize(e,t){e!==t&&this.$ace.setFontSize(e)}},mounted(){this.$ace=se.a.edit(this.$el),this.$ace.$blockScrolling=1/0;const{lang:e,theme:t,readonly:a,fontsize:i,tabsize:r,overrideValueHistory:o}=this;this.$emit("init",this.$ace);const l=this.$ace.getSession();s("c1d1")("./"+e),l.setMode("ace/mode/"+e),l.setTabSize(r),l.setUseSoftTabs(!0),l.setUseWrapMode(!0),o?l.setValue(this.value):this.$ace.setValue(this.value,1),s("07ed")("./"+t),this.$ace.setTheme("ace/theme/"+t),this.$ace.setReadOnly(a),this.$ace.setFontSize(i),this.$ace.setShowPrintMargin(!1),this.$ace.on("change",()=>{var e=this.$ace.getValue();this.$emit("input",e),this._content=e})}},ie=ae,re=Object(n["a"])(ie,K,ee,!1,null,null,null),oe=re.exports,le=s("651e"),ne=s.n(le);const ce=[{id:0,icon:function(e){return"visibility"},tooltip:function(e){return"View"}},{id:1,icon:function(e){return"edit"},tooltip:function(e){return"Edit"}},{id:2,icon:function(e){return e.enabled?"block":"check_circle_outline"},tooltip:function(e){return!0===e.enabled?"Disable":"Enable"}},{id:3,icon:function(e){return"delete"},tooltip:function(e){return"Delete"}}];var de=ce,ue={components:{Breadcrumb:N,AceEditor:oe},data:()=>({items:[{id:0,title:"serviceName",value:"service"},{id:1,title:"app",value:"application"}],breads:[{text:"serviceGovernance",href:""},{text:"routingRule",href:""}],selected:0,dropdown_font:["Service","App","IP"],ruleKeys:["enabled","force","runtime","group","version","rule"],pattern:"Service",filter:"",serviceVersion4Search:"",serviceGroup4Search:"",dialog:!1,warn:!1,updateId:"",application:"",service:"",serviceVersion:"",serviceGroup:"",warnTitle:"",warnText:"",warnStatus:{},height:0,searchLoading:!1,typeAhead:[],input:null,timerID:null,operations:de,serviceRoutingRules:[],appRoutingRules:[],template:"configVersion: 'v3.0'\nenabled: true\nruntime: false\nforce: true\nConfigVersion:\nconditions:\n - '=> host != 172.22.3.91'\n",ruleText:"",readonly:!1,appHeaders:[],serviceHeaders:[]}),methods:{setAppHeaders:function(){this.appHeaders=[{text:this.$t("appName"),value:"application",align:"left"},{text:this.$t("enabled"),value:"enabled",sortable:!1},{text:this.$t("operation"),value:"operation",sortable:!1,width:"115px"}]},setServiceHeaders:function(){this.serviceHeaders=[{text:this.$t("serviceName"),value:"service",align:"left"},{text:this.$t("group"),value:"group",align:"left"},{text:this.$t("version"),value:"group",align:"left"},{text:this.$t("enabled"),value:"enabled",sortable:!1},{text:this.$t("operation"),value:"operation",sortable:!1,width:"115px"}]},querySelections(e){this.timerID&&clearTimeout(this.timerID)},submit:function(){this.filter=document.querySelector("#serviceSearch").value.trim(),this.search(!0)},split:function(e){if(0===this.selected){const t=e.split("/"),s=e.split(":");console.log(t),console.log(s),t.length>1?this.serviceGroup4Search=t[0]:this.serviceGroup4Search="",s.length>1?this.serviceVersion4Search=s[1]:this.serviceVersion4Search="";const a=s[0].split("/");1===a.length?this.filter=a[0]:this.filter=a[1]}},search:function(e){if(!this.filter)return void this.$notify.error("Either service or application is needed");const t=this.items[this.selected].value,s="/rules/route/condition/?"+t+"="+this.filter+"&serviceVersion="+this.serviceVersion4Search+"&serviceGroup="+this.serviceGroup4Search;this.$axios.get(s).then(t=>{0===this.selected?this.serviceRoutingRules=t.data.data:this.appRoutingRules=t.data.data,e&&(0===this.selected?this.$router.push({path:"routingRule",query:{service:this.filter,serviceVersion:this.serviceVersion4Search,serviceGroup:this.serviceGroup4Search}}):1===this.selected&&this.$router.push({path:"routingRule",query:{application:this.filter}}))})},closeDialog:function(){this.ruleText=this.template,this.updateId="",this.service="",this.serviceVersion="",this.serviceGroup="",this.application="",this.dialog=!1,this.readonly=!1},openDialog:function(){this.dialog=!0},openWarn:function(e,t){this.warnTitle=e,this.warnText=t,this.warn=!0},closeWarn:function(){this.warnTitle="",this.warnText="",this.warn=!1},saveItem:function(){const e=ne.a.safeLoad(this.ruleText);if(!this.service&&!this.application)return void this.$notify.error("Either service or application is needed");if(this.service&&this.application)return void this.$notify.error("You can not set both service ID and application name");const t=this;e.service=this.service;const s=null==this.serviceVersion?"":this.serviceVersion,a=null==this.serviceGroup?"":this.serviceGroup;e.application=this.application,e.serviceVersion=s,e.serviceGroup=a,""!==this.updateId?"close"===this.updateId?this.closeDialog():(e.id=this.updateId,this.$axios.put("/rules/route/condition/"+e.id,e).then(e=>{200===e.status&&(t.service?(t.selected=0,t.search(t.service,!0),t.filter=t.service):(t.selected=1,t.search(t.application,!0),t.filter=t.application),this.closeDialog(),this.$notify.success("Update success"))})):this.$axios.post("/rules/route/condition/",e).then(e=>{console.log(e),200===e.status&&(t.service?(t.selected=0,t.search(t.service,!0),t.filter=t.service):(t.selected=1,t.search(t.application,!0),t.filter=t.application),this.closeDialog(),this.$notify.success("Create success"))}).catch(e=>{console.log(e)}),document.querySelector("#serviceSearch").value=this.service,this.submit()},itemOperation:function(e,t){const s=t.id,a=null==t.serviceVersion?"":t.serviceVersion,i=null==t.serviceGroup?"":t.serviceGroup,r=null==t.scope?"":t.scope;switch(e){case"visibility":this.$axios.get("/rules/route/condition/"+s).then(e=>{const t=e.data;this.serviceVersion=t.serviceVersion,this.serviceGroup=t.serviceGroup,this.scope=t.scope,delete t.serviceVersion,delete t.serviceGroup,delete t.scope,this.handleBalance(t,!0),this.updateId="close"});break;case"edit":this.$axios.get("/rules/route/condition/"+s).then(e=>{const t=e.data;this.serviceVersion=t.serviceVersion,this.serviceGroup=t.serviceGroup,this.scope=t.scope,delete t.serviceVersion,delete t.serviceGroup,delete t.scope,this.handleBalance(t,!1),this.updateId=s});break;case"block":this.openWarn(" Are you sure to block Routing Rule","service: "+s),this.warnStatus.operation="disable",this.warnStatus.id=s,this.warnStatus.serviceVersion=a,this.warnStatus.serviceGroup=i,this.warnStatus.scope=r;break;case"check_circle_outline":this.openWarn(" Are you sure to enable Routing Rule","service: "+s),this.warnStatus.operation="enable",this.warnStatus.id=s,this.warnStatus.serviceVersion=a,this.warnStatus.serviceGroup=i,this.warnStatus.scope=r;break;case"delete":this.openWarn("warnDeleteRouteRule","service: "+s),this.warnStatus.operation="delete",this.warnStatus.id=s,this.warnStatus.serviceVersion=a,this.warnStatus.serviceGroup=i,this.warnStatus.scope=r}},handleBalance:function(e,t){this.service=e.service,this.application=e.application,delete e.service,delete e.id,delete e.app,delete e.group,delete e.application,delete e.priority,this.ruleText=ne.a.safeDump(e),this.readonly=t,this.dialog=!0},setHeight:function(){this.height=.5*window.innerHeight},deleteItem:function(e){const t=e.id,s=e.operation,a=e.serviceVersion,i=e.serviceGroup,r=e.scope;"delete"===s?this.$axios.delete("/rules/route/condition/"+t+"?serviceVersion="+a+"&serviceGroup="+i+"&scope="+r).then(e=>{200===e.status&&(this.warn=!1,this.search(this.filter,!1),this.$notify.success("Delete success"))}):"disable"===s?this.$axios.put("/rules/route/condition/disable/"+t+"?serviceVersion="+a+"&serviceGroup="+i+"&scope="+r).then(e=>{200===e.status&&(this.warn=!1,this.search(this.filter,!1),this.$notify.success("Disable success"))}):"enable"===s&&this.$axios.put("/rules/route/condition/enable/"+t+"?serviceVersion="+a+"&serviceGroup="+i+"&scope="+r).then(e=>{200===e.status&&(this.warn=!1,this.search(this.filter,!1),this.$notify.success("Enable success"))})}},created(){this.setHeight(),this.ruleText=this.template},computed:{queryBy(){return this.$t("by")+this.$t(this.items[this.selected].title)},area(){return this.$i18n.locale}},watch:{input(e){this.querySelections(e)},area(){this.setAppHeaders(),this.setServiceHeaders()}},mounted:function(){this.setAppHeaders(),this.setServiceHeaders(),this.$store.dispatch("loadServiceItems"),this.$store.dispatch("loadConsumerItems"),this.ruleText=this.template;const e=this.$route.query;let t=null,s=null,a=null;const i=this;Object.keys(e).forEach((function(r){"service"===r&&(t=e[r],e.serviceVersion&&(s=e.serviceVersion),e.serviceGroup&&(a=e.serviceGroup),i.selected=0),"application"===r&&(t=e[r],i.selected=1)})),null!=s&&(this.serviceVersion4Search=e.serviceVersion),null!=a&&(this.serviceGroup4Search=e.serviceGroup),null!==t&&(this.filter=t,this.search(!1))}},pe=ue,he=Object(n["a"])(pe,Z,X,!1,null,null,null),ve=he.exports,me=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("v-container",{attrs:{"grid-list-xl":"",fluid:""}},[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{lg12:""}},[s("breadcrumb",{attrs:{title:"tagRule",items:e.breads}})],1),s("v-flex",{attrs:{lg12:""}},[s("a",{attrs:{href:"https://cn.dubbo.apache.org/zh-cn/overview/core-features/traffic/tag-rule/"}},[e._v("标签路由规则")])])],1),s("v-flex",{attrs:{lg12:""}},[s("v-card",{attrs:{flat:"",color:"transparent"}},[s("v-card-text",[s("v-form",[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-combobox",{attrs:{id:"serviceSearch",loading:e.searchLoading,items:e.typeAhead,"search-input":e.input,flat:"","append-icon":"","hide-no-data":"",label:e.$t("searchTagRule")},on:{"update:searchInput":function(t){e.input=t},"update:search-input":function(t){e.input=t},keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.submit(t)}},model:{value:e.filter,callback:function(t){e.filter=t},expression:"filter"}}),s("v-btn",{attrs:{color:"primary",large:""},on:{click:e.submit}},[e._v(e._s(e.$t("search")))])],1)],1)],1)],1)],1),s("v-flex",{attrs:{lg12:""}},[s("v-card",[s("v-toolbar",{staticClass:"elevation-0",attrs:{flat:"",color:"transparent"}},[s("v-toolbar-title",[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("searchResult")))])]),s("v-spacer"),s("v-btn",{staticClass:"mb-2",attrs:{outline:"",color:"primary"},on:{click:function(t){return t.stopPropagation(),e.openDialog(t)}}},[e._v(e._s(e.$t("create")))])],1),s("v-card-text",{staticClass:"pa-0"},[s("v-data-table",{staticClass:"elevation-0",attrs:{headers:e.headers,items:e.tagRoutingRules,"hide-actions":""},scopedSlots:e._u([{key:"items",fn:function(t){return[s("td",{staticClass:"text-xs-left"},[e._v(e._s(t.item.application))]),s("td",{staticClass:"text-xs-left"},[e._v(e._s(t.item.enabled))]),s("td",{staticClass:"text-xs-center px-0"},e._l(e.operations,(function(a){return s("v-tooltip",{key:a.id,attrs:{bottom:""}},[s("v-icon",{staticClass:"mr-2",attrs:{slot:"activator",small:""},on:{click:function(s){e.itemOperation(a.icon(t.item),t.item)}},slot:"activator"},[e._v(" "+e._s(a.icon(t.item))+" ")]),s("span",[e._v(e._s(e.$t(a.tooltip(t.item))))])],1)})),1)]}}])})],1)],1)],1),s("v-dialog",{attrs:{width:"800px",persistent:""},model:{value:e.dialog,callback:function(t){e.dialog=t},expression:"dialog"}},[s("v-card",[s("v-card-title",{staticClass:"justify-center"},[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("createNewTagRule")))])]),s("v-card-text",[s("v-text-field",{attrs:{label:e.$t("appName"),hint:e.$t("appNameHint")},model:{value:e.application,callback:function(t){e.application=t},expression:"application"}}),s("v-subheader",{staticClass:"pa-0 mt-3"},[e._v(e._s(e.$t("ruleContent")))]),s("ace-editor",{attrs:{readonly:e.readonly},model:{value:e.ruleText,callback:function(t){e.ruleText=t},expression:"ruleText"}})],1),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{flat:""},nativeOn:{click:function(t){return e.closeDialog(t)}}},[e._v(e._s(e.$t("close")))]),s("v-btn",{attrs:{depressed:"",color:"primary"},nativeOn:{click:function(t){return e.saveItem(t)}}},[e._v(e._s(e.$t("save")))])],1)],1)],1),s("v-dialog",{attrs:{persistent:"","max-width":"500px"},model:{value:e.warn.display,callback:function(t){e.$set(e.warn,"display",t)},expression:"warn.display"}},[s("v-card",[s("v-card-title",{staticClass:"headline"},[e._v(e._s(e.$t(this.warn.title)))]),s("v-card-text",[e._v(e._s(this.warn.text))]),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{flat:""},nativeOn:{click:function(t){return e.closeWarn(t)}}},[e._v("CANCLE")]),s("v-btn",{attrs:{depressed:"",color:"primary"},nativeOn:{click:function(t){return e.deleteItem(e.warn.status)}}},[e._v(e._s(e.$t("confirm")))])],1)],1)],1)],1)},fe=[],ge={components:{Breadcrumb:N,AceEditor:oe},data:()=>({dropdown_font:["Service","App","IP"],ruleKeys:["enabled","force","dynamic","runtime","group","version","rule"],pattern:"Service",filter:"",dialog:!1,updateId:"",application:"",searchLoading:!1,typeAhead:[],input:null,timerID:null,warn:{display:!1,title:"",text:"",status:{}},breads:[{text:"serviceGovernance",href:""},{text:"tagRule",href:""}],height:0,operations:de,tagRoutingRules:[],template:"configVersion: 'v3.0'\nforce: false\nenabled: true\nruntime: false\ntags:\n - name: gray\n match:\n - key: env\n value:\n exact: gray",ruleText:"",readonly:!1,headers:[]}),methods:{setHeaders:function(){this.headers=[{text:this.$t("appName"),value:"application",align:"left"},{text:this.$t("enabled"),value:"enabled",sortable:!1},{text:this.$t("operation"),value:"operation",sortable:!1,width:"115px"}]},querySelections(e){this.timerID&&clearTimeout(this.timerID),this.timerID=setTimeout(()=>{e&&e.length>=4?(this.searchLoading=!0,this.typeAhead=this.$store.getters.getAppItems(e),this.searchLoading=!1,this.timerID=null):this.typeAhead=[]},500)},submit:function(){this.filter?(this.filter=this.filter.trim(),this.search(!0)):this.$notify.error("application is needed")},search:function(e){const t="/rules/route/tag/?application="+this.filter;this.$axios.get(t).then(t=>{this.tagRoutingRules=t.data,e&&this.$router.push({path:"tagRule",query:{application:this.filter}})})},closeDialog:function(){this.ruleText=this.template,this.updateId="",this.application="",this.dialog=!1,this.readonly=!1},openDialog:function(){this.dialog=!0},openWarn:function(e,t){this.warn.title=e,this.warn.text=t,this.warn.display=!0},closeWarn:function(){this.warn.title="",this.warn.text="",this.warn.display=!1},saveItem:function(){const e=ne.a.safeLoad(this.ruleText);if(!this.application)return void this.$notify.error("application is required");e.application=this.application;const t=this;this.updateId?"close"===this.updateId?this.closeDialog():(e.id=this.updateId,this.$axios.put("/rules/route/tag/"+e.id,e).then(e=>{200===e.status&&(t.search(t.application,!0),t.closeDialog(),t.$notify.success("Update success"))})):this.$axios.post("/rules/route/tag/",e).then(e=>{201===e.status&&(t.search(t.application,!0),t.filter=t.application,t.closeDialog(),t.$notify.success("Create success"))}).catch(e=>{console.log(e)})},itemOperation:function(e,t){const s=t.application;switch(e){case"visibility":this.$axios.get("/rules/route/tag/"+s).then(e=>{const t=e.data;this.handleBalance(t,!0),this.updateId="close"});break;case"edit":this.$axios.get("/rules/route/tag/"+s).then(e=>{const t=e.data;this.handleBalance(t,!1),this.updateId=s});break;case"block":this.openWarn(" Are you sure to block Tag Rule","application: "+t.application),this.warn.status.operation="disable",this.warn.status.id=s;break;case"check_circle_outline":this.openWarn(" Are you sure to enable Tag Rule","application: "+t.application),this.warn.status.operation="enable",this.warn.status.id=s;break;case"delete":this.openWarn("warnDeleteTagRule","application: "+t.application),this.warn.status.operation="delete",this.warn.status.id=s}},handleBalance:function(e,t){this.application=e.application,delete e.id,delete e.app,delete e.group,delete e.application,delete e.service,delete e.priority,delete e.serviceVersion,delete e.serviceGroup,this.ruleText=ne.a.safeDump(e),this.readonly=t,this.dialog=!0},setHeight:function(){this.height=.5*window.innerHeight},deleteItem:function(e){const t=e.id,s=e.operation;"delete"===s?this.$axios.delete("/rules/route/tag/"+t).then(e=>{200===e.status&&(this.warn.display=!1,this.search(this.filter,!1),this.$notify.success("Delete success"))}):"disable"===s?this.$axios.put("/rules/route/tag/disable/"+t).then(e=>{200===e.status&&(this.warn.display=!1,this.search(this.filter,!1),this.$notify.success("Disable success"))}):"enable"===s&&this.$axios.put("/rules/route/tag/enable/"+t).then(e=>{200===e.status&&(this.warn.display=!1,this.search(this.filter,!1),this.$notify.success("Enable success"))})}},created(){this.setHeight()},computed:{area(){return this.$i18n.locale}},watch:{input(e){this.querySelections(e)},area(){this.setHeaders()}},mounted:function(){this.setHeaders(),this.$store.dispatch("loadAppItems"),this.ruleText=this.template;const e=this.$route.query;let t=null;Object.keys(e).forEach((function(s){"application"===s&&(t=e[s])})),null!==t&&(this.filter=t,this.search(!1))}},xe=ge,be=Object(n["a"])(xe,me,fe,!1,null,null,null),ye=be.exports,_e=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("v-container",{attrs:{"grid-list-xl":"",fluid:""}},[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{lg12:""}},[s("breadcrumb",{attrs:{title:"meshRule",items:e.breads}})],1)],1),s("v-flex",{attrs:{lg12:""}},[s("v-card",{attrs:{flat:"",color:"transparent"}},[s("v-card-text",[s("v-form",[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-combobox",{attrs:{id:"serviceSearch",loading:e.searchLoading,items:e.typeAhead,"search-input":e.input,flat:"","append-icon":"","hide-no-data":"",label:e.$t("searchMeshRule")},on:{"update:searchInput":function(t){e.input=t},"update:search-input":function(t){e.input=t},keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.submit(t)}},model:{value:e.filter,callback:function(t){e.filter=t},expression:"filter"}}),s("v-btn",{attrs:{color:"primary",large:""},on:{click:e.submit}},[e._v(e._s(e.$t("search")))])],1)],1)],1)],1)],1),s("v-flex",{attrs:{lg12:""}},[s("v-card",[s("v-toolbar",{staticClass:"elevation-0",attrs:{flat:"",color:"transparent"}},[s("v-toolbar-title",[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("searchResult")))])]),s("v-spacer"),s("v-btn",{staticClass:"mb-2",attrs:{outline:"",color:"primary"},on:{click:function(t){return t.stopPropagation(),e.openDialog(t)}}},[e._v(e._s(e.$t("create")))])],1),s("v-card-text",{staticClass:"pa-0"},[s("v-data-table",{staticClass:"elevation-0",attrs:{headers:e.headers,items:e.meshRoutingRules,"hide-actions":""},scopedSlots:e._u([{key:"items",fn:function(t){return[s("td",{staticClass:"text-xs-left"},[e._v(e._s(t.item.application))]),s("td",{staticClass:"text-xs-center px-0"},[s("v-tooltip",{attrs:{bottom:""}},[s("v-icon",{staticClass:"mr-2",attrs:{slot:"activator",small:"",color:"blue"},on:{click:function(s){return e.itemOperation("visibility",t.item)}},slot:"activator"},[e._v("visibility ")]),s("span",[e._v(e._s(e.$t("view")))])],1),s("v-tooltip",{attrs:{bottom:""}},[s("v-icon",{staticClass:"mr-2",attrs:{slot:"activator",small:"",color:"blue"},on:{click:function(s){return e.itemOperation("edit",t.item)}},slot:"activator"},[e._v("edit ")]),s("span",[e._v("Edit")])],1),s("v-tooltip",{attrs:{bottom:""}},[s("v-icon",{staticClass:"mr-2",attrs:{slot:"activator",small:"",color:"red"},on:{click:function(s){return e.itemOperation("delete",t.item)}},slot:"activator"},[e._v("delete ")]),s("span",[e._v("Delete")])],1)],1)]}}])})],1)],1)],1),s("v-dialog",{attrs:{width:"800px",persistent:""},model:{value:e.dialog,callback:function(t){e.dialog=t},expression:"dialog"}},[s("v-card",[s("v-card-title",{staticClass:"justify-center"},[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("createNewMeshRule")))])]),s("v-card-text",[s("v-text-field",{attrs:{label:e.$t("appName"),hint:e.$t("appNameHint")},model:{value:e.application,callback:function(t){e.application=t},expression:"application"}}),s("v-subheader",{staticClass:"pa-0 mt-3"},[e._v(e._s(e.$t("ruleContent")))]),s("ace-editor",{attrs:{readonly:e.readonly},model:{value:e.ruleText,callback:function(t){e.ruleText=t},expression:"ruleText"}})],1),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{flat:""},nativeOn:{click:function(t){return e.closeDialog(t)}}},[e._v(e._s(e.$t("close")))]),s("v-btn",{attrs:{depressed:"",color:"primary"},nativeOn:{click:function(t){return e.saveItem(t)}}},[e._v(e._s(e.$t("save")))])],1)],1)],1),s("v-dialog",{attrs:{persistent:"","max-width":"500px"},model:{value:e.warn.display,callback:function(t){e.$set(e.warn,"display",t)},expression:"warn.display"}},[s("v-card",[s("v-card-title",{staticClass:"headline"},[e._v(e._s(e.$t(this.warn.title)))]),s("v-card-text",[e._v(e._s(this.warn.text))]),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{flat:""},nativeOn:{click:function(t){return e.closeWarn(t)}}},[e._v("CANCLE")]),s("v-btn",{attrs:{depressed:"",color:"primary"},nativeOn:{click:function(t){return e.deleteItem(e.warn.status)}}},[e._v(e._s(e.$t("confirm")))])],1)],1)],1)],1)},ke=[],we={components:{Breadcrumb:N},data:()=>({dropdown_font:["Service","App","IP"],ruleKeys:["enabled","force","dynamic","runtime","group","version","rule"],pattern:"Service",filter:"",dialog:!1,updateId:"",application:"",searchLoading:!1,typeAhead:[],input:null,timerID:null,warn:{display:!1,title:"",text:"",status:{}},breads:[{text:"serviceGovernance",href:""},{text:"meshRule",href:""}],height:0,operations:de,meshRoutingRules:[],template:"apiVersion: service.dubbo.apache.org/v1alpha1\nkind: DestinationRule\nmetadata: { name: demo-route }\nspec:\n host: demo\n subsets:\n - labels: { env-sign: xxx, tag1: hello }\n name: isolation\n - labels: { env-sign: yyy }\n name: testing-trunk\n - labels: { env-sign: zzz }\n name: testing\n trafficPolicy:\n loadBalancer: { simple: ROUND_ROBIN }\n\n---\n\napiVersion: service.dubbo.apache.org/v1alpha1\nkind: VirtualService\nmetadata: {name: demo-route}\nspec:\n dubbo:\n - routedetail:\n - match:\n - sourceLabels: {trafficLabel: xxx}\n name: xxx-project\n route:\n - destination: {host: demo, subset: isolation}\n - match:\n - sourceLabels: {trafficLabel: testing-trunk}\n name: testing-trunk\n route:\n - destination: {host: demo, subset: testing-trunk}\n - name: testing\n route:\n - destination: {host: demo, subset: testing}\n services:\n - {regex: ccc}\n hosts: [demo]",ruleText:"",readonly:!1,headers:[]}),methods:{setHeaders:function(){this.headers=[{text:this.$t("appName"),value:"application",align:"left"},{text:this.$t("operation"),value:"operation",sortable:!1,width:"115px"}]},querySelections(e){this.timerID&&clearTimeout(this.timerID),this.timerID=setTimeout(()=>{e&&e.length>=4?(this.searchLoading=!0,this.typeAhead=this.$store.getters.getAppItems(e),this.searchLoading=!1,this.timerID=null):this.typeAhead=[]},500)},submit:function(){this.filter?(this.filter=this.filter.trim(),this.search(!0)):this.$notify.error("application is needed")},search:function(e){const t="/rules/route/mesh/?application="+this.filter;this.$axios.get(t).then(t=>{this.meshRoutingRules=t.data,e&&this.$router.push({path:"meshRule",query:{application:this.filter}})})},closeDialog:function(){this.ruleText=this.template,this.updateId="",this.application="",this.dialog=!1,this.readonly=!1},openDialog:function(){this.dialog=!0},openWarn:function(e,t){this.warn.title=e,this.warn.text=t,this.warn.display=!0},closeWarn:function(){this.warn.title="",this.warn.text="",this.warn.display=!1},saveItem:function(){const e={};if(e.meshRule=this.ruleText,!this.application)return void this.$notify.error("application is required");e.application=this.application;const t=this;this.updateId?"close"===this.updateId?this.closeDialog():(e.id=this.updateId,this.$axios.put("/rules/route/mesh/"+e.id,e).then(e=>{200===e.status&&(t.search(t.application,!0),t.closeDialog(),t.$notify.success("Update success"))})):this.$axios.post("/rules/route/mesh/",e).then(e=>{201===e.status&&(t.search(t.application,!0),t.filter=t.application,t.closeDialog(),t.$notify.success("Create success"))}).catch(e=>{console.log(e)})},itemOperation:function(e,t){const s=t.application;switch(e){case"visibility":this.$axios.get("/rules/route/mesh/"+s).then(e=>{const t=e.data;this.handleBalance(t,!0),this.updateId="close"});break;case"edit":this.$axios.get("/rules/route/mesh/"+s).then(e=>{const t=e.data;this.handleBalance(t,!1),this.updateId=s});break;case"delete":this.openWarn("warnDeleteMeshRule","application: "+t.application),this.warn.status.operation="delete",this.warn.status.id=s}},handleBalance:function(e,t){this.application=e.application,delete e.id,delete e.application,this.ruleText=e.meshRule,this.readonly=t,this.dialog=!0},setHeight:function(){this.height=.5*window.innerHeight},deleteItem:function(e){const t=e.id,s=e.operation;"delete"===s&&this.$axios.delete("/rules/route/mesh/"+t).then(e=>{200===e.status&&(this.warn.display=!1,this.search(this.filter,!1),this.$notify.success("Delete success"))})}},created(){this.setHeight()},computed:{area(){return this.$i18n.locale}},watch:{input(e){this.querySelections(e)},area(){this.setHeaders()}},mounted:function(){this.setHeaders(),this.$store.dispatch("loadInstanceAppItems"),this.ruleText=this.template;const e=this.$route.query;let t=null;Object.keys(e).forEach((function(s){"application"===s&&(t=e[s])})),null!==t&&(this.filter=t,this.search(!1))}},$e=we,Ie=Object(n["a"])($e,_e,ke,!1,null,null,null),De=Ie.exports,Se=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("v-container",{attrs:{"grid-list-xl":"",fluid:""}},[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{lg12:""}},[s("breadcrumb",{attrs:{title:"accessControl",items:e.breads}})],1),s("v-flex",{attrs:{lg12:""}},[s("v-card",{attrs:{flat:"",color:"transparent"}},[s("v-card-text",[s("v-form",[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",[s("v-combobox",{attrs:{id:"serviceSearch",loading:e.searchLoading,items:e.typeAhead,"search-input":e.input,flat:"","append-icon":"","hide-no-data":"",suffix:e.queryBy,label:e.$t("searchAccessRule")},on:{"update:searchInput":function(t){e.input=t},"update:search-input":function(t){e.input=t},keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.submit(t)},input:function(t){return e.split(t)}},model:{value:e.filter,callback:function(t){e.filter=t},expression:"filter"}})],1),s("v-menu",{staticClass:"hidden-xs-only"},[s("v-btn",{attrs:{slot:"activator",large:"",icon:""},slot:"activator"},[s("v-icon",[e._v("unfold_more")])],1),s("v-list",e._l(e.items,(function(t,a){return s("v-list-tile",{key:a,on:{click:function(t){e.selected=a}}},[s("v-list-tile-title",[e._v(e._s(e.$t(t.title)))])],1)})),1)],1),s("v-flex",{directives:[{name:"show",rawName:"v-show",value:0===e.selected,expression:"selected === 0"}],attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Version",hint:e.$t("dataIdVersionHint")},model:{value:e.serviceVersion4Search,callback:function(t){e.serviceVersion4Search=t},expression:"serviceVersion4Search"}})],1),s("v-flex",{directives:[{name:"show",rawName:"v-show",value:0===e.selected,expression:"selected === 0"}],attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{directives:[{name:"show",rawName:"v-show",value:0===e.selected,expression:"selected === 0"}],attrs:{label:"Group",hint:e.$t("dataIdGroupHint")},model:{value:e.serviceGroup4Search,callback:function(t){e.serviceGroup4Search=t},expression:"serviceGroup4Search"}})],1),s("v-btn",{attrs:{color:"primary",large:""},on:{click:e.submit}},[e._v(e._s(e.$t("search")))])],1)],1)],1)],1)],1)],1),s("v-flex",{attrs:{lg12:""}},[s("v-card",[s("v-toolbar",{staticClass:"elevation-0",attrs:{flat:"",color:"transparent"}},[s("v-toolbar-title",[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("searchResult")))])]),s("v-spacer"),s("v-btn",{staticClass:"mb-2",attrs:{outline:"",color:"primary"},on:{click:function(t){return t.stopPropagation(),e.toCreate(t)}}},[e._v(e._s(e.$t("create")))])],1),s("v-card-text",{directives:[{name:"show",rawName:"v-show",value:0===e.selected,expression:"selected === 0"}],staticClass:"pa-0"},[s("v-data-table",{staticClass:"elevation-0",attrs:{headers:e.serviceHeaders,items:e.accesses,loading:e.loading,"hide-actions":""},scopedSlots:e._u([{key:"items",fn:function(t){return[s("td",{staticClass:"text-xs-left"},[e._v(e._s(t.item.service))]),s("td",{staticClass:"text-xs-center px-0"},[s("v-tooltip",{attrs:{bottom:""}},[s("v-icon",{staticClass:"mr-2",attrs:{slot:"activator",small:"",color:"blue"},on:{click:function(s){return e.toEdit(t.item,!0)}},slot:"activator"},[e._v("visibility")]),s("span",[e._v(e._s(e.$t("view")))])],1),s("v-tooltip",{attrs:{bottom:""}},[s("v-icon",{staticClass:"mr-2",attrs:{slot:"activator",small:"",color:"blue"},on:{click:function(s){return e.toEdit(t.item,!1)}},slot:"activator"},[e._v("edit")]),s("span",[e._v(e._s(e.$t("edit")))])],1),s("v-tooltip",{attrs:{bottom:""}},[s("v-icon",{staticClass:"mr-2",attrs:{slot:"activator",small:"",color:"red"},on:{click:function(s){return e.toDelete(t.item)}},slot:"activator"},[e._v("delete")]),s("span",[e._v(e._s(e.$t("delete")))])],1)],1)]}}])})],1),s("v-card-text",{directives:[{name:"show",rawName:"v-show",value:1===e.selected,expression:"selected === 1"}],staticClass:"pa-0"},[s("v-data-table",{staticClass:"elevation-0",attrs:{headers:e.appHeaders,items:e.accesses,loading:e.loading,"hide-actions":""},scopedSlots:e._u([{key:"items",fn:function(t){return[s("td",{staticClass:"text-xs-left"},[e._v(e._s(t.item.application))]),s("td",{staticClass:"text-xs-center px-0"},[s("v-tooltip",{attrs:{bottom:""}},[s("v-icon",{staticClass:"mr-2",attrs:{slot:"activator",small:"",color:"blue"},on:{click:function(s){return e.toEdit(t.item,!0)}},slot:"activator"},[e._v("visibility")]),s("span",[e._v(e._s(e.$t("view")))])],1),s("v-tooltip",{attrs:{bottom:""}},[s("v-icon",{staticClass:"mr-2",attrs:{slot:"activator",small:"",color:"blue"},on:{click:function(s){return e.toEdit(t.item,!1)}},slot:"activator"},[e._v("edit")]),s("span",[e._v("Edit")])],1),s("v-tooltip",{attrs:{bottom:""}},[s("v-icon",{staticClass:"mr-2",attrs:{slot:"activator",small:"",color:"red"},on:{click:function(s){return e.toDelete(t.item)}},slot:"activator"},[e._v("delete")]),s("span",[e._v("Delete")])],1)],1)]}}])})],1)],1)],1),s("v-dialog",{attrs:{width:"800px",persistent:""},model:{value:e.modal.enable,callback:function(t){e.$set(e.modal,"enable",t)},expression:"modal.enable"}},[s("v-card",[s("v-card-title",{staticClass:"justify-center"},[s("span",{staticClass:"headline"},[e._v(e._s(e.modal.title)+" Access Control")])]),s("v-card-text",[s("v-form",{ref:"modalForm"},[s("v-layout",{attrs:{wrap:""}},[s("v-flex",{attrs:{xs24:"",sm12:"",md8:""}},[s("v-text-field",{attrs:{label:"Service class",hint:e.$t("dataIdClassHint")},model:{value:e.modal.service,callback:function(t){e.$set(e.modal,"service",t)},expression:"modal.service"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Version",hint:e.$t("dataIdVersionHint")},model:{value:e.modal.serviceVersion,callback:function(t){e.$set(e.modal,"serviceVersion",t)},expression:"modal.serviceVersion"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Group",hint:e.$t("dataIdGroupHint")},model:{value:e.modal.serviceGroup,callback:function(t){e.$set(e.modal,"serviceGroup",t)},expression:"modal.serviceGroup"}})],1)],1),s("v-text-field",{attrs:{label:e.$t("appName"),hint:e.$t("appNameHint"),readonly:e.modal.readonly},model:{value:e.modal.application,callback:function(t){e.$set(e.modal,"application",t)},expression:"modal.application"}}),s("v-layout",{attrs:{row:"","justify-space-between":""}},[s("v-flex",[s("v-text-field",{attrs:{readonly:e.modal.readonly,label:e.$t("whiteList"),hint:e.$t("whiteListHint")},model:{value:e.modal.whiteList,callback:function(t){e.$set(e.modal,"whiteList",t)},expression:"modal.whiteList"}})],1),s("v-spacer"),s("v-flex",[s("v-text-field",{attrs:{label:e.$t("blackList"),hint:e.$t("blackListHint"),readonly:e.modal.readonly},model:{value:e.modal.blackList,callback:function(t){e.$set(e.modal,"blackList",t)},expression:"modal.blackList"}})],1)],1)],1)],1),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{color:"darken-1",flat:""},on:{click:function(t){return e.closeModal()}}},[e._v(e._s(e.$t("close")))]),s("v-btn",{attrs:{color:"primary",depressed:""},on:{click:e.modal.click}},[e._v(e._s(e.modal.saveBtn))])],1)],1)],1),s("v-dialog",{attrs:{persistent:"","max-width":"500px"},model:{value:e.confirm.enable,callback:function(t){e.$set(e.confirm,"enable",t)},expression:"confirm.enable"}},[s("v-card",[s("v-card-title",{staticClass:"headline"},[e._v(e._s(this.confirm.title))]),s("v-card-text",[e._v(e._s(this.confirm.text))]),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{color:"darken-1",flat:""},on:{click:function(t){e.confirm.enable=!1}}},[e._v(e._s(e.$t("disagree")))]),s("v-btn",{attrs:{color:"primary",depressed:""},on:{click:function(t){return e.deleteItem(e.confirm.id)}}},[e._v(e._s(e.$t("agree")))])],1)],1)],1)],1)},Ce=[],Ae={name:"AccessControl",data:()=>({items:[{id:0,title:"serviceName",value:"service"},{id:1,title:"app",value:"application"}],breads:[{text:"serviceGovernance",href:""},{text:"accessControl",href:""}],selected:0,filter:null,loading:!1,serviceHeaders:[],appHeaders:[],accesses:[],searchLoading:!1,typeAhead:[],input:null,timerID:null,serviceVersion4Search:"",serviceGroup4Search:"",modal:{enable:!1,readonly:!1,title:"Create New",saveBtn:"Create",click:()=>{},id:null,service:null,serviceVersion:"",serviceGroup:"",application:null,content:"",blackList:"",whiteList:"",template:"blacklist:\n - 1.1.1.1\n - 2.2.2.2\nwhitelist:\n - 3.3.3.3\n - 4.4.*\n"},services:[],confirm:{enable:!1,title:"",text:"",id:null},snackbar:{enable:!1,text:""}}),methods:{setAppHeaders(){this.appHeaders=[{text:this.$t("appName"),value:"application",align:"left"},{text:this.$t("operation"),value:"operation",sortable:!1,width:"115px"}]},setServiceHeaders(){this.serviceHeaders=[{text:this.$t("serviceName"),value:"service",align:"left"},{text:this.$t("operation"),value:"operation",sortable:!1,width:"115px"}]},querySelections(e){this.timerID&&clearTimeout(this.timerID),this.timerID=setTimeout(()=>{e&&e.length>=4?(this.searchLoading=!0,0===this.selected?this.typeAhead=this.$store.getters.getServiceItems(e):1===this.selected&&(this.typeAhead=this.$store.getters.getConsumerItems(e)),this.searchLoading=!1,this.timerID=null):this.typeAhead=[]},500)},submit:function(){this.filter=document.querySelector("#serviceSearch").value.trim(),this.search(!0)},split:function(e){if(0===this.selected){const t=e.split("/"),s=e.split(":");t.length>1?this.serviceGroup4Search=t[0]:this.serviceGroup4Search="",s.length>1?this.serviceVersion4Search=s[1]:this.serviceVersion4Search="";const a=s[0].split("/");1===a.length?this.filter=a[0]:this.filter=a[1]}},search(e){if(!this.filter)return void this.$notify.error("Either service or application is needed");const t=this.items[this.selected].value;this.loading=!0,e&&(0===this.selected?this.$router.push({path:"access",query:{service:this.filter,serviceVersion:this.serviceVersion4Search,serviceGroup:this.serviceGroup4Search}}):1===this.selected&&this.$router.push({path:"access",query:{application:this.filter}}));const s="/rules/access/?"+t+"="+this.filter+"&serviceVersion="+this.serviceVersion4Search+"&serviceGroup="+this.serviceGroup4Search;this.$axios.get(s).then(e=>{this.accesses=e.data,this.loading=!1}).catch(e=>{this.showSnackbar("error",e.response.data.message),this.loading=!1})},closeModal(){this.modal.enable=!1,this.modal.id=null,this.$refs.modalForm.reset()},toCreate(){Object.assign(this.modal,{enable:!0,title:"Create New",saveBtn:"Create",readonly:!1,content:this.modal.template,click:this.createItem})},createItem(){if(this.filter="",!this.modal.service&&!this.modal.application)return void this.$notify.error("Either service or application is needed");if(this.modal.service&&this.modal.application)return void this.$notify.error("You can not set both service ID and application name");const e=this;let t=[],s=[];this.modal.blackList&&(t=this.modal.blackList.split(",")),this.modal.whiteList&&(s=this.modal.whiteList.split(",")),this.$axios.post("/rules/access",{service:this.modal.service,serviceVersion:this.modal.serviceVersion,serviceGroup:this.modal.serviceGroup,application:this.modal.application,whitelist:s,blacklist:t}).then(t=>{201===t.status&&(e.modal.service?(e.selected=0,e.filter=e.modal.service):(e.selected=1,e.filter=e.modal.application),this.search(),this.closeModal()),this.showSnackbar("success","Create success")}).catch(e=>this.showSnackbar("error",e.response.data.message))},toEdit(e,t){Object.assign(this.modal,{enable:!0,readonly:t,title:"Edit",saveBtn:"Update",click:this.editItem,id:e.id,service:e.service,serviceVersion:e.serviceVersion,serviceGroup:e.serviceGroup,application:e.application,whiteList:e.whitelist,blackList:e.blacklist})},editItem(){let e=[];this.modal.blackList&&(e=this.modal.blackList.split(","));let t=[];this.modal.whiteList&&(t=this.modal.whiteList.split(","));const s=this;this.$axios.put("/rules/access/"+this.modal.id,{whitelist:t,blacklist:e,application:this.modal.application,service:this.modal.service,serviceVersion:this.modal.serviceVersion,serviceGroup:this.modal.serviceGroup}).then(e=>{200===e.status&&(s.modal.service?(s.selected=0,s.filter=s.modal.service):(s.selected=1,s.filter=s.modal.application),s.closeModal(),s.search()),this.showSnackbar("success","Update success")}).catch(e=>this.showSnackbar("error",e.response.data.message))},toDelete(e){Object.assign(this.confirm,{enable:!0,title:"warnDeleteAccessControl",text:"Id: "+e.id,id:e.id})},deleteItem(e){this.$axios.delete("/rules/access/"+e).then(e=>{this.showSnackbar("success","Delete success"),this.search(this.filter)}).catch(e=>this.showSnackbar("error",e.response.data.message))},showSnackbar(e,t){this.$notify(t,e),this.confirm.enable=!1}},computed:{queryBy(){return this.$t("by")+this.$t(this.items[this.selected].title)},area(){return this.$i18n.locale}},watch:{input(e){this.querySelections(e)},area(){this.setAppHeaders(),this.setServiceHeaders()}},mounted(){this.setAppHeaders(),this.setServiceHeaders(),this.$store.dispatch("loadServiceItems"),this.$store.dispatch("loadConsumerItems");const e=this.$route.query;let t=null,s=null;"service"in e&&(this.filter=e.service,e.serviceVersion&&(t=e.serviceVersion),e.serviceGroup&&(s=e.serviceGroup),this.selected=0),"application"in e&&(this.filter=e.application,this.selected=1),null!=t&&(this.serviceVersion4Search=e.serviceVersion),null!=s&&(this.serviceGroup4Search=e.serviceGroup),null!==this.filter&&this.search()},components:{Breadcrumb:N}},Re=Ae,Ee=Object(n["a"])(Re,Se,Ce,!1,null,null,null),Te=Ee.exports,Le=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("v-container",{attrs:{"grid-list-xl":"",fluid:""}},[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{lg12:""}},[s("breadcrumb",{attrs:{title:"loadBalance",items:e.breads}})],1),s("v-flex",{attrs:{lg12:""}},[s("v-card",{attrs:{flat:"",color:"transparent"}},[s("v-card-text",[s("v-form",[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",[s("v-combobox",{attrs:{id:"serviceSearch",loading:e.searchLoading,items:e.typeAhead,"search-input":e.input,flat:"","append-icon":"","hide-no-data":"",suffix:e.queryBy,label:e.$t("searchBalanceRule")},on:{"update:searchInput":function(t){e.input=t},"update:search-input":function(t){e.input=t},keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.submit(t)},input:function(t){return e.split(t)}},model:{value:e.filter,callback:function(t){e.filter=t},expression:"filter"}})],1),s("v-menu",{staticClass:"hidden-xs-only"},[s("v-btn",{attrs:{slot:"activator",large:"",icon:""},slot:"activator"},[s("v-icon",[e._v("unfold_more")])],1),s("v-list",e._l(e.items,(function(t,a){return s("v-list-tile",{key:a,on:{click:function(t){e.selected=a}}},[s("v-list-tile-title",[e._v(e._s(e.$t(t.title)))])],1)})),1)],1),s("v-flex",{directives:[{name:"show",rawName:"v-show",value:0===e.selected,expression:"selected === 0"}],attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{directives:[{name:"show",rawName:"v-show",value:0===e.selected,expression:"selected === 0"}],attrs:{label:"Version",hint:e.$t("dataIdVersionHint")},model:{value:e.serviceVersion4Search,callback:function(t){e.serviceVersion4Search=t},expression:"serviceVersion4Search"}})],1),s("v-flex",{directives:[{name:"show",rawName:"v-show",value:0===e.selected,expression:"selected === 0"}],attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{directives:[{name:"show",rawName:"v-show",value:0===e.selected,expression:"selected === 0"}],attrs:{label:"Group",hint:e.$t("dataIdGroupHint")},model:{value:e.serviceGroup4Search,callback:function(t){e.serviceGroup4Search=t},expression:"serviceGroup4Search"}})],1),s("v-btn",{attrs:{color:"primary",large:""},on:{click:e.submit}},[e._v(e._s(e.$t("search")))])],1)],1)],1)],1)],1)],1),s("v-flex",{attrs:{lg12:""}},[s("v-card",[s("v-toolbar",{staticClass:"elevation-0",attrs:{flat:"",color:"transparent"}},[s("v-toolbar-title",[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("searchResult")))])]),s("v-spacer"),s("v-btn",{staticClass:"mb-2",attrs:{outline:"",color:"primary"},on:{click:function(t){return t.stopPropagation(),e.openDialog(t)}}},[e._v(e._s(e.$t("create")))])],1),s("v-card-text",{directives:[{name:"show",rawName:"v-show",value:0===e.selected,expression:"selected === 0"}],staticClass:"pa-0"},[s("v-data-table",{staticClass:"elevation-0",attrs:{headers:e.serviceHeaders,items:e.loadBalances,"hide-actions":""},scopedSlots:e._u([{key:"items",fn:function(t){return[s("td",{staticClass:"text-xs-left"},[e._v(e._s(t.item.service))]),s("td",{staticClass:"text-xs-left"},[e._v(e._s(t.item.methodName))]),s("td",{staticClass:"text-xs-center px-0"},e._l(e.operations,(function(a){return s("v-tooltip",{key:a.id,attrs:{bottom:""}},[s("v-icon",{staticClass:"mr-2",attrs:{slot:"activator",small:""},on:{click:function(s){return e.itemOperation(a.icon,t.item)}},slot:"activator"},[e._v(" "+e._s(a.icon)+" ")]),s("span",[e._v(e._s(e.$t(a.tooltip)))])],1)})),1)]}}])})],1),s("v-card-text",{directives:[{name:"show",rawName:"v-show",value:1===e.selected,expression:"selected === 1"}],staticClass:"pa-0"},[s("v-data-table",{staticClass:"elevation-0",attrs:{headers:e.appHeaders,items:e.loadBalances,"hide-actions":""},scopedSlots:e._u([{key:"items",fn:function(t){return[s("td",{staticClass:"text-xs-left"},[e._v(e._s(t.item.application))]),s("td",{staticClass:"text-xs-left"},[e._v(e._s(t.item.methodName))]),s("td",{staticClass:"text-xs-center px-0"},e._l(e.operations,(function(a){return s("v-tooltip",{key:a.id,attrs:{bottom:""}},[s("v-icon",{staticClass:"mr-2",attrs:{slot:"activator",small:""},on:{click:function(s){return e.itemOperation(a.icon,t.item)}},slot:"activator"},[e._v(" "+e._s(a.icon)+" ")]),s("span",[e._v(e._s(e.$t(a.tooltip)))])],1)})),1)]}}])})],1)],1)],1),s("v-dialog",{attrs:{width:"800px",persistent:""},model:{value:e.dialog,callback:function(t){e.dialog=t},expression:"dialog"}},[s("v-card",[s("v-card-title",{staticClass:"justify-center"},[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("createNewLoadBalanceRule")))])]),s("v-card-text",[s("v-layout",{attrs:{wrap:""}},[s("v-flex",{attrs:{xs24:"",sm12:"",md8:""}},[s("v-text-field",{attrs:{label:"Service class",hint:e.$t("dataIdClassHint")},model:{value:e.service,callback:function(t){e.service=t},expression:"service"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Version",hint:e.$t("dataIdVersionHint")},model:{value:e.serviceVersion,callback:function(t){e.serviceVersion=t},expression:"serviceVersion"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Group",hint:e.$t("dataIdGroupHint")},model:{value:e.serviceGroup,callback:function(t){e.serviceGroup=t},expression:"serviceGroup"}})],1)],1),s("v-text-field",{attrs:{label:e.$t("appName"),hint:e.$t("appNameHint"),readonly:e.readonly},model:{value:e.application,callback:function(t){e.application=t},expression:"application"}}),s("v-layout",{attrs:{row:"","justify-space-between":""}},[s("v-flex",[s("v-text-field",{attrs:{label:e.$t("method"),hint:e.$t("methodHint"),readonly:e.readonly},model:{value:e.rule.method,callback:function(t){e.$set(e.rule,"method",t)},expression:"rule.method"}})],1),s("v-spacer"),s("v-flex",[s("v-select",{attrs:{items:e.rule.strategyKey,label:e.$t("strategy"),readonly:e.readonly},model:{value:e.rule.strategy,callback:function(t){e.$set(e.rule,"strategy",t)},expression:"rule.strategy"}})],1)],1)],1),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{color:"darken-1",flat:""},nativeOn:{click:function(t){return e.closeDialog(t)}}},[e._v(e._s(e.$t("close")))]),s("v-btn",{attrs:{color:"primary darken-1",depressed:""},nativeOn:{click:function(t){return e.saveItem(t)}}},[e._v(e._s(e.$t("save")))])],1)],1)],1),s("v-dialog",{attrs:{persistent:"","max-width":"500px"},model:{value:e.warn,callback:function(t){e.warn=t},expression:"warn"}},[s("v-card",[s("v-card-title",{staticClass:"headline"},[e._v(e._s(e.$t(this.warnTitle)))]),s("v-card-text",[e._v(e._s(this.warnText))]),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{color:"darken-1",flat:""},nativeOn:{click:function(t){return e.closeWarn(t)}}},[e._v(e._s(e.$t("cancel")))]),s("v-btn",{attrs:{color:"primary darken-1",depressed:""},nativeOn:{click:function(t){return e.deleteItem(e.warnStatus.id)}}},[e._v(e._s(e.$t("confirm")))])],1)],1)],1)],1)},Ve=[],He={components:{Breadcrumb:N},data:()=>({items:[{id:0,title:"serviceName",value:"service"},{id:1,title:"app",value:"application"}],breads:[{text:"serviceGovernance",href:""},{text:"loadBalance",href:""}],selected:0,dropdown_font:["Service","App","IP"],ruleKeys:["method","strategy"],pattern:"Service",filter:"",updateId:"",dialog:!1,warn:!1,application:"",service:"",serviceVersion4Search:"",serviceGroup4Search:"",serviceVersion:"",serviceGroup:"",warnTitle:"",warnText:"",warnStatus:{},height:0,searchLoading:!1,typeAhead:[],input:null,timerID:null,operations:[{id:0,icon:"visibility",tooltip:"view"},{id:1,icon:"edit",tooltip:"edit"},{id:3,icon:"delete",tooltip:"delete"}],loadBalances:[],template:"methodName: * # * for all methods\nstrategy: # leastactive, random, roundrobin",rule:{method:"",strategy:"",strategyKey:[{text:"Least Active",value:"leastactive"},{text:"Random",value:"random"},{text:"Round Robin",value:"roundrobin"}]},ruleText:"",readonly:!1,serviceHeaders:[],appHeaders:[]}),methods:{setServiceHeaders:function(){this.serviceHeaders=[{text:this.$t("serviceName"),value:"service",align:"left"},{text:this.$t("method"),value:"method",align:"left"},{text:this.$t("operation"),value:"operation",sortable:!1,width:"115px"}]},setAppHeaders:function(){this.appHeaders=[{text:this.$t("appName"),value:"application",align:"left"},{text:this.$t("method"),value:"method",align:"left"},{text:this.$t("operation"),value:"operation",sortable:!1,width:"115px"}]},querySelections(e){this.timerID&&clearTimeout(this.timerID),this.timerID=setTimeout(()=>{e&&e.length>=4?(this.searchLoading=!0,0===this.selected?this.typeAhead=this.$store.getters.getServiceItems(e):1===this.selected&&(this.typeAhead=this.$store.getters.getAppItems(e)),this.searchLoading=!1,this.timerID=null):this.typeAhead=[]},500)},submit:function(){this.filter=document.querySelector("#serviceSearch").value.trim(),this.search(!0)},split:function(e){if(0===this.selected){const t=e.split("/"),s=e.split(":");t.length>1?this.serviceGroup4Search=t[0]:this.serviceGroup4Search="",s.length>1?this.serviceVersion4Search=s[1]:this.serviceVersion4Search="";const a=s[0].split("/");1===a.length?this.filter=a[0]:this.filter=a[1]}},search:function(e){if(!this.filter)return void this.$notify.error("Either service or application is needed");const t=this.items[this.selected].value,s="/rules/balancing/?"+t+"="+this.filter+"&serviceVersion="+this.serviceVersion4Search+"&serviceGroup="+this.serviceGroup4Search;this.$axios.get(s).then(t=>{this.loadBalances=t.data,e&&(0===this.selected?this.$router.push({path:"loadbalance",query:{service:this.filter}}):1===this.selected&&this.$router.push({path:"loadbalance",query:{application:this.filter}}))})},closeDialog:function(){this.ruleText=this.template,this.service="",this.dialog=!1,this.updateId="",this.readonly=!1},openDialog:function(){this.dialog=!0},openWarn:function(e,t){this.warnTitle=e,this.warnText=t,this.warn=!0},closeWarn:function(){this.warnTitle="",this.warnText="",this.warn=!1},saveItem:function(){this.ruleText=this.verifyRuleText(this.ruleText);const e={};if(!this.service&&!this.application)return void this.$notify.error("Either service or application is needed");if(this.service&&this.application)return void this.$notify.error("You can not set both service ID and application name");const t=this;e.service=this.service,e.serviceVersion=this.serviceVersion,e.serviceGroup=this.serviceGroup,e.application=this.application,e.methodName=this.rule.method,e.strategy=this.rule.strategy,this.updateId?"close"===this.updateId?this.closeDialog():(e.id=this.updateId,this.$axios.put("/rules/balancing/"+e.id,e).then(e=>{200===e.status&&(t.service?(t.selected=0,t.filter=t.service,t.search(!0)):(t.selected=1,t.filter=t.application,t.search(!0)),this.closeDialog(),this.$notify.success("Update success"))})):this.$axios.post("/rules/balancing",e).then(e=>{201===e.status&&(t.service?(t.selected=0,t.filter=t.service,t.search(!0)):(t.selected=1,t.filter=t.application,t.search(!0)),this.closeDialog(),this.$notify.success("Create success"))})},itemOperation:function(e,t){const s=t.id;switch(e){case"visibility":this.$axios.get("/rules/balancing/"+s).then(e=>{const t=e.data;this.handleBalance(t,!0),this.updateId="close"});break;case"edit":this.$axios.get("/rules/balancing/"+s).then(e=>{const t=e.data;this.handleBalance(t,!1),this.updateId=s});break;case"delete":this.openWarn("warnDeleteBalancing","service: "+s),this.warnStatus.operation="delete",this.warnStatus.id=s}},handleBalance:function(e,t){this.service=e.service,this.application=e.application,this.serviceVersion=e.serviceVersion,this.serviceGroup=e.serviceGroup,this.rule.method=e.methodName,this.rule.strategy=e.strategy,this.readonly=t,this.dialog=!0},setHeight:function(){this.height=.5*window.innerHeight},deleteItem:function(e){this.$axios.delete("/rules/balancing/"+e).then(e=>{200===e.status&&(this.warn=!1,this.search(!1),this.$notify.success("Delete success"))})},verifyRuleText:function(e){const t=e.split("\n");for(let a=0;a({items:[{id:0,title:"serviceName",value:"service"},{id:1,title:"app",value:"application"}],breads:[{text:"serviceGovernance",href:""},{text:"weightAdjust",href:""}],selected:0,dropdown_font:["Service","App","IP"],ruleKeys:["weight","address"],pattern:"Service",filter:"",dialog:!1,warn:!1,application:"",updateId:"",service:"",warnTitle:"",warnText:"",warnStatus:{},height:0,searchLoading:!1,typeAhead:[],input:null,timerID:null,serviceVersion4Search:"",serviceGroup4Search:"",serviceVersion:"",serviceGroup:"",operations:[{id:0,icon:"visibility",tooltip:"view"},{id:1,icon:"edit",tooltip:"edit"},{id:3,icon:"delete",tooltip:"delete"}],weights:[],template:"weight: 100 # 100 for default\naddresses: # addresses's ip\n - 192.168.0.1\n - 192.168.0.2",ruleText:"",rule:{weight:100,address:""},readonly:!1,serviceHeaders:[],appHeaders:[]}),methods:{setServiceHeaders:function(){this.serviceHeaders=[{text:this.$t("serviceName"),value:"service",align:"left"},{text:this.$t("weight"),value:"weight",align:"left"},{text:this.$t("operation"),value:"operation",sortable:!1,width:"115px"}]},querySelections(e){this.timerID&&clearTimeout(this.timerID),this.timerID=setTimeout(()=>{e&&e.length>=4?(this.searchLoading=!0,0===this.selected?this.typeAhead=this.$store.getters.getServiceItems(e):1===this.selected&&(this.typeAhead=this.$store.getters.getAppItems(e)),this.searchLoading=!1,this.timerID=null):this.typeAhead=[]},500)},setAppHeaders:function(){this.appHeaders=[{text:this.$t("appName"),value:"application",align:"left"},{text:this.$t("weight"),value:"weight",align:"left"},{text:this.$t("operation"),value:"operation",sortable:!1,width:"115px"}]},submit:function(){this.filter=document.querySelector("#serviceSearch").value.trim(),this.search(!0)},split:function(e){if(0===this.selected){const t=e.split("/"),s=e.split(":");t.length>1?this.serviceGroup4Search=t[0]:this.serviceGroup4Search="",s.length>1?this.serviceVersion4Search=s[1]:this.serviceVersion4Search="";const a=s[0].split("/");1===a.length?this.filter=a[0]:this.filter=a[1]}},search:function(e){if(!this.filter)return void this.$notify.error("Either service or application is needed");const t=this.items[this.selected].value,s="/rules/weight/?"+t+"="+this.filter+"&serviceVersion="+this.serviceVersion4Search+"&serviceGroup="+this.serviceGroup4Search;this.$axios.get(s).then(t=>{this.weights=t.data,e&&(0===this.selected?this.$router.push({path:"weight",query:{service:this.filter}}):1===this.selected&&this.$router.push({path:"weight",query:{application:this.filter}}))})},closeDialog:function(){this.ruleText=this.template,this.rule.address="",this.rule.weight=100,this.service="",this.dialog=!1,this.readonly=!1},openDialog:function(){this.updateId="",this.dialog=!0},openWarn:function(e,t){this.warnTitle=e,this.warnText=t,this.warn=!0},closeWarn:function(){this.warnTitle="",this.warnText="",this.warn=!1},saveItem:function(){const e={};if(!this.service&&!this.application)return void this.$notify.error("Either service or application is needed");if(this.service&&this.application)return void this.$notify.error("You can not set both service ID and application name");e.service=this.service,e.serviceVersion=this.serviceVersion,e.serviceGroup=this.serviceGroup,e.application=this.application,e.weight=this.rule.weight,e.addresses=this.rule.address.split(",");const t=this;this.updateId?"close"===this.updateId?this.closeDialog():(e.id=this.updateId,this.$axios.put("/rules/weight/"+e.id,e).then(e=>{200===e.status&&(t.service?(t.selected=0,t.search(t.service,!0),t.filter=t.service):(t.selected=1,t.search(t.application,!0),t.filter=t.application),this.closeDialog(),this.$notify.success("Update success"))})):this.$axios.post("/rules/weight",e).then(e=>{201===e.status&&(this.service?(t.selected=0,t.search(t.service,!0),t.filter=t.service):(t.selected=1,t.search(t.application,!0),t.filter=t.application),t.closeDialog(),t.$notify.success("Create success"))})},itemOperation:function(e,t){const s=t.id;switch(e){case"visibility":this.$axios.get("/rules/weight/"+s).then(e=>{const t=e.data;this.handleWeight(t,!0),this.updateId="close"});break;case"edit":this.$axios.get("/rules/weight/"+s).then(e=>{const t=e.data;this.handleWeight(t,!1),this.updateId=s});break;case"delete":this.openWarn("warnDeleteWeightAdjust","service: "+s),this.warnStatus.operation="delete",this.warnStatus.id=s}},handleWeight:function(e,t){this.service=e.service,this.serviceVersion=e.serviceVersion,this.serviceGroup=e.serviceGroup,this.application=e.application,this.rule.weight=e.weight,this.rule.address=e.addresses.join(","),this.readonly=t,this.dialog=!0},setHeight:function(){this.height=.5*window.innerHeight},deleteItem:function(e){this.$axios.delete("/rules/weight/"+e.id).then(e=>{200===e.status&&(this.warn=!1,this.search(this.filter,!1),this.$notify.success("Delete success"))})}},created(){this.setHeight()},computed:{queryBy(){return this.$t("by")+this.$t(this.items[this.selected].title)},area(){return this.$i18n.locale}},watch:{area(){this.setAppHeaders(),this.setServiceHeaders()},input(e){this.querySelections(e)}},mounted:function(){this.setAppHeaders(),this.setServiceHeaders(),this.$store.dispatch("loadServiceItems"),this.$store.dispatch("loadAppItems"),this.ruleText=this.template;const e=this.$route.query;let t=null,s=null,a=null;const i=this;Object.keys(e).forEach((function(r){"service"===r&&(a=e[r],e.serviceVersion&&(t=e.serviceVersion),e.serviceGroup&&(s=e.serviceGroup),i.selected=0),"application"===r&&(a=e[r],i.selected=1)})),null!=t&&(this.serviceVersion4Search=e.serviceVersion),null!=s&&(this.serviceGroup4Search=e.serviceGroup),null!==a&&(this.filter=a,this.search(!1))}},Pe=je,qe=Object(n["a"])(Pe,Ne,Me,!1,null,"bc3e304e",null),Qe=qe.exports,Fe=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("v-container",{attrs:{"grid-list-xl":"",fluid:""}},[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{lg12:""}},[s("breadcrumb",{attrs:{title:"dynamicConfig",items:e.breads}}),s("v-flex",{attrs:{lg12:""}},[s("a",{attrs:{href:"https://cn.dubbo.apache.org/zh-cn/overview/core-features/traffic/configuration-rule/"}},[e._v("动态配置规则")])])],1),s("v-flex",{attrs:{lg12:""}},[s("v-card",{attrs:{flat:"",color:"transparent"}},[s("v-card-text",[s("v-form",[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",[s("v-combobox",{attrs:{id:"serviceSearch",loading:e.searchLoading,items:e.typeAhead,"search-input":e.input,flat:"","append-icon":"","hide-no-data":"",suffix:e.queryBy,label:e.$t("searchDynamicConfig")},on:{"update:searchInput":function(t){e.input=t},"update:search-input":function(t){e.input=t},keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.submit(t)},input:function(t){return e.split(t)}},model:{value:e.filter,callback:function(t){e.filter=t},expression:"filter"}})],1),s("v-menu",{staticClass:"hidden-xs-only"},[s("v-btn",{attrs:{slot:"activator",large:"",icon:""},slot:"activator"},[s("v-icon",[e._v("unfold_more")])],1),s("v-list",e._l(e.items,(function(t,a){return s("v-list-tile",{key:a,on:{click:function(t){e.selected=a}}},[s("v-list-tile-title",[e._v(e._s(e.$t(t.service)))])],1)})),1)],1),s("v-flex",{directives:[{name:"show",rawName:"v-show",value:0===e.selected,expression:"selected === 0"}],attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Version",hint:e.$t("dataIdVersionHint")},model:{value:e.serviceVersion4Search,callback:function(t){e.serviceVersion4Search=t},expression:"serviceVersion4Search"}})],1),s("v-flex",{directives:[{name:"show",rawName:"v-show",value:0===e.selected,expression:"selected === 0"}],attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Group",hint:e.$t("dataIdGroupHint")},model:{value:e.serviceGroup4Search,callback:function(t){e.serviceGroup4Search=t},expression:"serviceGroup4Search"}})],1),s("v-btn",{attrs:{color:"primary",large:""},on:{click:e.submit}},[e._v(e._s(e.$t("search")))])],1)],1)],1)],1)],1)],1),s("v-flex",{attrs:{lg12:""}},[s("v-card",[s("v-toolbar",{staticClass:"elevation-0",attrs:{flat:"",color:"transparent"}},[s("v-toolbar-title",[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("searchResult")))])]),s("v-spacer"),s("v-btn",{staticClass:"mb-2",attrs:{outline:"",color:"primary"},on:{click:function(t){return t.stopPropagation(),e.openDialog(t)}}},[e._v(e._s(e.$t("create")))])],1),s("v-card-text",{directives:[{name:"show",rawName:"v-show",value:0===e.selected,expression:"selected === 0"}],staticClass:"pa-0"},[s("v-data-table",{staticClass:"elevation-0",attrs:{headers:e.serviceHeaders,items:e.serviceConfigs,"hide-actions":""},scopedSlots:e._u([{key:"items",fn:function(t){return[s("td",{staticClass:"text-xs-left"},[e._v(e._s(t.item.service))]),s("td",{staticClass:"text-xs-center px-0"},e._l(e.operations,(function(a){return s("v-tooltip",{key:a.id,attrs:{bottom:""}},[s("v-icon",{staticClass:"mr-2",attrs:{slot:"activator",small:""},on:{click:function(s){e.itemOperation(a.icon(t.item),t.item)}},slot:"activator"},[e._v(" "+e._s(a.icon(t.item))+" ")]),s("span",[e._v(e._s(e.$t(a.tooltip(t.item))))])],1)})),1)]}}])})],1),s("v-card-text",{directives:[{name:"show",rawName:"v-show",value:1===e.selected,expression:"selected === 1"}],staticClass:"pa-0"},[s("v-data-table",{staticClass:"elevation-0",attrs:{headers:e.appHeaders,items:e.appConfigs,"hide-actions":""},scopedSlots:e._u([{key:"items",fn:function(t){return[s("td",{staticClass:"text-xs-left"},[e._v(e._s(t.item.application))]),s("td",{staticClass:"text-xs-center px-0"},e._l(e.operations,(function(a){return s("v-tooltip",{key:a.id,attrs:{bottom:""}},[s("v-icon",{staticClass:"mr-2",attrs:{slot:"activator",small:""},on:{click:function(s){e.itemOperation(a.icon(t.item),t.item)}},slot:"activator"},[e._v(" "+e._s(a.icon(t.item))+" ")]),s("span",[e._v(e._s(e.$t(a.tooltip(t.item))))])],1)})),1)]}}])})],1)],1)],1),s("v-dialog",{attrs:{width:"800px",persistent:""},model:{value:e.dialog,callback:function(t){e.dialog=t},expression:"dialog"}},[s("v-card",[s("v-card-title",{staticClass:"justify-center"},[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("createNewDynamicConfigRule")))])]),s("v-card-text",[s("v-layout",{attrs:{wrap:""}},[s("v-flex",{attrs:{xs24:"",sm12:"",md8:""}},[s("v-text-field",{attrs:{label:"Service class",hint:e.$t("dataIdClassHint")},model:{value:e.service,callback:function(t){e.service=t},expression:"service"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Version",hint:e.$t("dataIdVersionHint")},model:{value:e.serviceVersion,callback:function(t){e.serviceVersion=t},expression:"serviceVersion"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Group",hint:e.$t("dataIdGroupHint")},model:{value:e.serviceGroup,callback:function(t){e.serviceGroup=t},expression:"serviceGroup"}})],1)],1),s("v-text-field",{attrs:{label:"Application Name",hint:"Application name the service belongs to"},model:{value:e.application,callback:function(t){e.application=t},expression:"application"}}),s("v-subheader",{staticClass:"pa-0 mt-3"},[e._v(e._s(e.$t("ruleContent")))]),s("ace-editor",{attrs:{readonly:e.readonly},model:{value:e.ruleText,callback:function(t){e.ruleText=t},expression:"ruleText"}})],1),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{color:"darken-1",flat:""},nativeOn:{click:function(t){return e.closeDialog(t)}}},[e._v(e._s(e.$t("close")))]),s("v-btn",{attrs:{color:"primary darken-1",depressed:""},nativeOn:{click:function(t){return e.saveItem(t)}}},[e._v(e._s(e.$t("save")))])],1)],1)],1),s("v-dialog",{attrs:{persistent:"","max-width":"500px"},model:{value:e.warn,callback:function(t){e.warn=t},expression:"warn"}},[s("v-card",[s("v-card-title",{staticClass:"headline"},[e._v(e._s(e.$t(this.warnTitle)))]),s("v-card-text",[e._v(e._s(this.warnText))]),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{color:"darken-1",flat:""},nativeOn:{click:function(t){return e.closeWarn(t)}}},[e._v(e._s(e.$t("cancel")))]),s("v-btn",{attrs:{color:"primary darken-1",depressed:""},nativeOn:{click:function(t){return e.deleteItem(e.warnStatus)}}},[e._v(e._s(e.$t("confirm")))])],1)],1)],1)],1)},We=[],Ue={components:{AceEditor:oe,Breadcrumb:N},data:()=>({items:[{id:0,title:"serviceName",value:"service"},{id:1,title:"app",value:"application"}],breads:[{text:"serviceGovernance",href:""},{text:"dynamicConfig",href:""}],selected:0,dropdown_font:["Service","App","IP"],pattern:"Service",filter:"",dialog:!1,warn:!1,application:"",updateId:"",service:"",serviceVersion:"",serviceGroup:"",serviceVersion4Search:"",serviceGroup4Search:"",warnTitle:"",warnText:"",warnStatus:{},height:0,operations:de,searchLoading:!1,typeAhead:[],input:null,timerID:null,serviceConfigs:[],appConfigs:[],template:"configVersion: 'v3.0'\nenabled: true\nconfigs: \n - side: consumer\n parameters:\n retries: '4'",ruleText:"",readonly:!1,serviceHeaders:[],appHeaders:[]}),methods:{setAppHeaders:function(){this.appHeaders=[{text:this.$t("appName"),value:"application",align:"left"},{text:this.$t("operation"),value:"operation",sortable:!1,width:"115px"}]},setServiceHeaders:function(){this.serviceHeaders=[{text:this.$t("serviceName"),value:"service",align:"left"},{text:this.$t("operation"),value:"operation",sortable:!1,width:"115px"}]},querySelections(e){this.timerID&&clearTimeout(this.timerID),this.timerID=setTimeout(()=>{e&&e.length>=4?(this.searchLoading=!0,0===this.selected?this.typeAhead=this.$store.getters.getServiceItems(e):1===this.selected&&(this.typeAhead=this.$store.getters.getAppItems(e)),this.searchLoading=!1,this.timerID=null):this.typeAhead=[]},500)},submit:function(){this.filter=document.querySelector("#serviceSearch").value.trim(),this.search(!0)},split:function(e){if(0===this.selected){const t=e.split("/"),s=e.split(":");t.length>1?this.serviceGroup4Search=t[0]:this.serviceGroup4Search="",s.length>1?this.serviceVersion4Search=s[1]:this.serviceVersion4Search="";const a=s[0].split("/");1===a.length?this.filter=a[0]:this.filter=a[1]}},search:function(e){if(!this.filter)return void this.$notify.error("Either service or application is needed");const t=this.items[this.selected].value,s="/rules/override/?"+t+"="+this.filter+"&serviceVersion="+this.serviceVersion4Search+"&serviceGroup="+this.serviceGroup4Search;this.$axios.get(s).then(t=>{0===this.selected?this.serviceConfigs=t.data:this.appConfigs=t.data,e&&(0===this.selected?this.$router.push({path:"config",query:{service:this.filter,serviceVersion:this.serviceVersion4Search,serviceGroup:this.serviceGroup4Search}}):1===this.selected&&this.$router.push({path:"config",query:{application:this.filter}}))})},closeDialog:function(){this.ruleText=this.template,this.service="",this.dialog=!1,this.updateId="",this.readonly=!1},openDialog:function(){this.dialog=!0},openWarn:function(e,t){this.warnTitle=e,this.warnText=t,this.warn=!0},closeWarn:function(){this.warnTitle="",this.warnText="",this.warn=!1},saveItem:function(){const e=ne.a.safeLoad(this.ruleText);if(!this.service&&!this.application)return void this.$notify.error("Either service or application is needed");if(this.service&&this.application)return void this.$notify.error("You can not set both service ID and application name");e.service=this.service,e.application=this.application,e.serviceVersion=this.serviceVersion,e.serviceGroup=this.serviceGroup;const t=this;this.updateId?"close"===this.updateId?this.closeDialog():this.$axios.put("/rules/override/"+this.updateId,e).then(e=>{200===e.status&&(t.service?(t.selected=0,t.search(this.service,!0),t.filter=t.service):(t.selected=1,t.search(t.application,!0),t.filter=t.application),this.$notify.success("Update success"),this.closeDialog())}):this.$axios.post("/rules/override",e).then(e=>{201===e.status&&(this.service?(t.selected=0,t.search(t.service,!0),t.filter=t.service):(t.selected=1,t.search(t.application,!0),t.filter=t.application),this.$notify.success("Create success"),this.closeDialog())})},itemOperation:function(e,t){const s=t.id;switch(e){case"visibility":this.$axios.get("/rules/override/"+s).then(e=>{const t=e.data;this.handleConfig(t,!0),this.updateId="close"});break;case"edit":this.$axios.get("/rules/override/"+s).then(e=>{const t=e.data;this.handleConfig(t,!1),this.updateId=s});break;case"block":this.openWarn(" Are you sure to block Dynamic Config","service: "+t.service),this.warnStatus.operation="disable",this.warnStatus.id=s;break;case"check_circle_outline":this.openWarn(" Are you sure to enable Dynamic Config","service: "+t.service),this.warnStatus.operation="enable",this.warnStatus.id=s;break;case"delete":this.openWarn("warnDeleteDynamicConfig","service: "+t.service),this.warnStatus.operation="delete",this.warnStatus.id=s}},handleConfig:function(e,t){this.service=e.service,this.serviceVersion=e.serviceVersion,this.serviceGroup=e.serviceGroup,this.application=e.application,delete e.service,delete e.serviceVersion,delete e.serviceGroup,delete e.application,delete e.id;for(let s=0;s{e[t]&&"object"===typeof e[t]?this.removeEmpty(e[t]):null==e[t]&&delete e[t]})},deleteItem:function(e){const t=e.id,s=e.operation;"delete"===s?this.$axios.delete("/rules/override/"+t).then(e=>{200===e.status&&(this.warn=!1,this.search(this.filter,!1),this.$notify.success("Delete success"))}):"disable"===s?this.$axios.put("/rules/override/disable/"+t).then(e=>{200===e.status&&(this.warn=!1,this.search(this.filter,!1),this.$notify.success("Disable success"))}):"enable"===s&&this.$axios.put("/rules/override/enable/"+t).then(e=>{200===e.status&&(this.warn=!1,this.search(this.filter,!1),this.$notify.success("Enable success"))})}},created(){this.setHeight()},computed:{queryBy(){return this.$t("by")+this.$t(this.items[this.selected].title)},area(){return this.$i18n.locale}},watch:{input(e){this.querySelections(e)},area(){this.setAppHeaders(),this.setServiceHeaders()}},mounted:function(){this.setAppHeaders(),this.setServiceHeaders(),this.$store.dispatch("loadServiceItems"),this.$store.dispatch("loadAppItems"),this.ruleText=this.template;const e=this.$route.query;let t=null,s=null,a=null;const i=this;Object.keys(e).forEach((function(r){"service"===r&&(t=e[r],e.serviceVersion&&(s=e.serviceVersion),e.serviceGroup&&(a=e.serviceGroup),i.selected=0),"application"===r&&(t=e[r],i.selected=1)})),null!=s&&(this.serviceVersion4Search=e.serviceVersion),null!=a&&(this.serviceGroup4Search=e.serviceGroup),null!==t&&(this.filter=t,this.search(!1))}},Je=Ue,ze=Object(n["a"])(Je,Fe,We,!1,null,null,null),Ye=ze.exports,Ze=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("v-container",{attrs:{"grid-list-xl":"",fluid:""}},[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{lg12:""}},[s("breadcrumb",{attrs:{title:"serviceTest",items:e.breads}})],1),s("v-flex",{attrs:{lg12:""}},[s("v-card",{attrs:{flat:"",color:"transparent"}},[s("v-card-text",[s("v-form",[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-combobox",{attrs:{id:"serviceTestSearch",loading:e.searchLoading,items:e.typeAhead,"search-input":e.input,flat:"","append-icon":"","hide-no-data":"",hint:e.$t("testModule.searchServiceHint"),label:e.$t("placeholders.searchService")},on:{"update:searchInput":function(t){e.input=t},"update:search-input":function(t){e.input=t},keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.submit(t)}},model:{value:e.filter,callback:function(t){e.filter=t},expression:"filter"}}),s("v-btn",{attrs:{color:"primary",large:""},on:{click:e.submit}},[e._v(e._s(e.$t("search")))])],1)],1)],1)],1)],1),s("v-flex",{attrs:{xs12:""}},[s("v-card",[s("v-toolbar",{staticClass:"elevation-0",attrs:{flat:"",color:"transparent"}},[s("v-toolbar-title",[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("methods")))])]),s("v-spacer")],1),s("v-card-text",{staticClass:"pa-0"},[s("v-data-table",{staticClass:"elevation-1",attrs:{headers:e.headers,items:e.methods,"hide-actions":""},scopedSlots:e._u([{key:"items",fn:function(t){return[s("td",[e._v(e._s(t.item.name))]),s("td",e._l(t.item.parameterTypes,(function(t,a){return s("v-chip",{key:a,attrs:{xs:"",label:""}},[e._v(e._s(t))])})),1),s("td",[s("v-chip",{attrs:{label:""}},[e._v(e._s(t.item.returnType))])],1),s("td",{staticClass:"text-xs-right"},[s("v-tooltip",{attrs:{bottom:""}},[s("v-btn",{attrs:{slot:"activator",fab:"",dark:"",small:"",color:"blue",href:e.getHref(t.item.application,t.item.service,t.item.signature)},slot:"activator"},[s("v-icon",[e._v("edit")])],1),s("span",[e._v(e._s(e.$t("test")))])],1)],1)]}}])})],1)],1)],1)],1)],1)},Xe=[],Ke={name:"ServiceTest",components:{Breadcrumb:N},data(){return{typeAhead:[],input:null,searchLoading:!1,timerID:null,filter:"",breads:[{text:"serviceSearch",href:"/test"}],headers:[],service:null,methods:[],services:[],loading:!1}},methods:{querySelections(e){this.timerID&&clearTimeout(this.timerID),this.timerID=setTimeout(()=>{e&&e.length>=4?(this.searchLoading=!0,this.typeAhead=this.$store.getters.getServiceItems(e),this.searchLoading=!1,this.timerID=null):this.typeAhead=[]},500)},submit(){if(this.filter=document.querySelector("#serviceTestSearch").value.trim(),!this.filter)return this.$notify.error("service is needed"),!1;{const e=this.filter.replace("/","*");this.search(e)}},setHeaders:function(){this.headers=[{text:this.$t("methodName"),value:"method",sortable:!1},{text:this.$t("parameterList"),value:"parameter",sortable:!1},{text:this.$t("returnType"),value:"returnType",sortable:!1},{text:"",value:"operation",sortable:!1}]},search(e){e&&this.$axios.get("/service/"+e).then(e=>{if(this.service=e.data,this.methods=[],this.service.metadata){const t=this.service.metadata.methods;for(let s=0;s{this.showSnackbar("error",e.response.data.message)})},searchServices(){let e=this.filter||"";e.startsWith("*")||(e="*"+e),e.endsWith("*")||(e+="*");const t="service";this.loading=!0,this.$axios.get("/service",{params:{pattern:t,filter:e}}).then(e=>{this.services=e.data}).finally(()=>{this.loading=!1})},getHref(e,t,s){return`/#/testMethod?application=${e}&service=${t}&method=${s}`}},computed:{area(){return this.$i18n.locale}},watch:{input(e){this.querySelections(e)},area(){this.setHeaders()}},mounted(){this.$store.dispatch("loadServiceItems");const e=this.$route.query;this.filter=e.service||"","group"in e&&(this.filter=e.group+"/"+this.filter),"version"in e&&(this.filter=this.filter+":"+e.version),this.filter&&this.search(this.filter.replace("/","*")),this.setHeaders()}},et=Ke,tt=(s("c5e5"),Object(n["a"])(et,Ze,Xe,!1,null,null,null)),st=tt.exports,at=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("v-container",{directives:[{name:"scroll",rawName:"v-scroll:#scroll-target",value:e.onScroll,expression:"onScroll",arg:"#scroll-target"}],attrs:{"grid-list-xl":"",fluid:""}},[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{lg12:""}},[s("breadcrumb",{attrs:{title:"apiDocs",items:e.breads}})],1),s("v-flex",{attrs:{lg12:""}},[s("v-card",{attrs:{flat:"",color:"transparent"}},[s("v-card-text",[s("v-form",[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-text-field",{attrs:{id:"dubboProviderIP",label:e.$t("apiDocsRes.dubboProviderIP"),rules:e.rules,placeholder:"127.0.0.1",value:"127.0.0.1",outline:""}}),s("v-text-field",{staticStyle:{marginLeft:"10px"},attrs:{id:"dubboProviderPort",label:e.$t("apiDocsRes.dubboProviderPort"),rules:e.rules,placeholder:"20880",value:"20881",outline:""}}),s("v-btn",{attrs:{color:"primary",large:""},on:{click:e.submit}},[e._v(e._s(e.$t("apiDocsRes.loadApiList")))])],1)],1)],1)],1)],1)],1),s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{class:{sticky_top:e.isApiListDivFixed,menu_panel_class:e.isBigScreen},attrs:{lg3:""}},[s("v-card",{staticClass:"mx-auto",attrs:{id:"apiListDiv"}},[s("v-toolbar",[s("v-toolbar-side-icon"),s("v-toolbar-title",[e._v(e._s(e.$t("apiDocsRes.apiListText")))]),s("v-spacer")],1),s("v-list",{class:e.isBigScreen?"menu_panel_content":""},e._l(e.apiModules,(function(t){return s("v-list-group",{key:t.title,attrs:{"no-action":""},scopedSlots:e._u([{key:"activator",fn:function(){return[s("v-list-tile",[s("v-list-tile-content",[s("v-list-tile-title",[e._v(e._s(t.title))])],1)],1)]},proxy:!0}],null,!0)},e._l(t.apis,(function(t){return s("v-list-tile",{key:t.title,staticClass:"apiListListTile",on:{click:function(s){return e.showApiForm(t.formInfo,s)}}},[s("v-list-tile-content",[s("v-list-tile-title",[e._v(e._s(t.title))])],1)],1)})),1)})),1)],1)],1),s("v-flex",{class:e.isBigScreen?"apidocs_content":"",attrs:{lg9:""}},[s("v-card",{ref:"apiFormDiv",attrs:{id:"apiFormDiv"}},[s("apiForm",{attrs:{formInfo:e.formInfo}})],1)],1)],1)],1)},it=[],rt=function(){var e=this,t=e.$createElement,s=e._self._c||t;return e.showForm?s("div",[s("div",{staticStyle:{"padding-left":"10px","padding-right":"10px"}},[s("div",[s("v-timeline",{attrs:{"align-top":"",dense:""}},[s("v-timeline-item",{attrs:{color:"cyan",small:""}},[s("div",[s("div",{staticClass:"font-weight-normal"},[s("strong",[e._v(e._s(e.$t("apiDocsRes.apiForm.apiNameShowLabel")))])]),s("div",[e._v(e._s(this.apiInfoData.apiDocName))])])]),s("v-timeline-item",{attrs:{color:"cyan",small:""}},[s("div",[s("div",{staticClass:"font-weight-normal"},[s("strong",[e._v(e._s(e.$t("apiDocsRes.apiForm.apiPathShowLabel")))])]),s("div",[e._v(e._s(this.apiInfoData.apiModelClass)+"#"+e._s(this.apiInfoData.apiName))])])]),s("v-timeline-item",{attrs:{color:"cyan",small:""}},[s("div",[s("div",{staticClass:"font-weight-normal"},[s("strong",[e._v(e._s(e.$t("apiDocsRes.apiForm.apiMethodParamInfoLabel")))])]),s("div",[e._v(e._s(this.apiInfoData.methodParamInfo||e.$t("apiDocsRes.apiForm.none")))])])]),s("v-timeline-item",{attrs:{color:"cyan",small:""}},[s("div",[s("div",{staticClass:"font-weight-normal"},[s("strong",[e._v(e._s(e.$t("apiDocsRes.apiForm.apiRespDecShowLabel")))])]),s("div",[e._v(" "+e._s(this.apiInfoData.apiRespDec||e.$t("apiDocsRes.apiForm.none"))+" ")])])]),s("v-timeline-item",{attrs:{color:"cyan",small:""}},[s("div",[s("div",{staticClass:"font-weight-normal"},[s("strong",[e._v(e._s(e.$t("apiDocsRes.apiForm.apiVersionShowLabel")))])]),s("div",[e._v(" "+e._s(this.apiInfoData.apiVersion||e.$t("apiDocsRes.apiForm.none"))+" ")])])]),s("v-timeline-item",{attrs:{color:"cyan",small:""}},[s("div",[s("div",{staticClass:"font-weight-normal"},[s("strong",[e._v(e._s(e.$t("apiDocsRes.apiForm.apiGroupShowLabel")))])]),s("div",[e._v(" "+e._s(this.apiInfoData.apiGroup||e.$t("apiDocsRes.apiForm.none"))+" ")])])]),s("v-timeline-item",{attrs:{color:"cyan",small:""}},[s("div",[s("div",{staticClass:"font-weight-normal"},[s("strong",[e._v(e._s(e.$t("apiDocsRes.apiForm.apiDescriptionShowLabel")))])]),s("div",[e._v(" "+e._s(this.apiInfoData.description||e.$t("apiDocsRes.apiForm.none"))+" ")])])])],1),s("v-form",{ref:"form"},[s("v-select",{attrs:{items:e.formItemAsyncSelectItems,label:e.$t("apiDocsRes.apiForm.isAsyncFormLabel"),outline:"",readonly:""},model:{value:e.formItemAsync,callback:function(t){e.formItemAsync=t},expression:"formItemAsync"}}),s("v-text-field",{attrs:{label:e.$t("apiDocsRes.apiForm.apiModuleFormLabel"),outline:"",readonly:""},model:{value:e.formItemInterfaceClassName,callback:function(t){e.formItemInterfaceClassName=t},expression:"formItemInterfaceClassName"}}),s("v-text-field",{attrs:{label:e.$t("apiDocsRes.apiForm.apiFunctionNameFormLabel"),outline:"",readonly:""},model:{value:e.formItemMethodName,callback:function(t){e.formItemMethodName=t},expression:"formItemMethodName"}}),s("v-text-field",{attrs:{label:e.$t("apiDocsRes.apiForm.registryCenterUrlFormLabel"),placeholder:"nacos://127.0.0.1:8848",outline:""},model:{value:e.formItemRegistryCenterUrl,callback:function(t){e.formItemRegistryCenterUrl=t},expression:"formItemRegistryCenterUrl"}}),e._l(this.publicFormsArray,(function(t){return s("div",{key:t.get("name"),staticStyle:{marginTop:"20px"}},[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{lg4:""}},[s("v-card",{staticStyle:{height:"300px",overflowY:"auto",overflowX:"hidden"}},[s("v-card-text",[s("v-timeline",{attrs:{"align-top":"",dense:""}},[s("v-timeline-item",{attrs:{color:"deep-purple lighten-1",small:""}},[s("div",[s("div",{staticClass:"font-weight-normal"},[s("strong",[e._v(e._s(e.$t("apiDocsRes.apiForm.paramNameLabel")))])]),s("div",{staticStyle:{wordBreak:"break-word"}},[e._v(e._s(t.get("name")))])])]),s("v-timeline-item",{attrs:{color:"deep-purple lighten-1",small:""}},[s("div",[s("div",{staticClass:"font-weight-normal"},[s("strong",[e._v(e._s(e.$t("apiDocsRes.apiForm.paramPathLabel")))])]),s("div",{staticStyle:{wordBreak:"break-word"}},[e._v("["+e._s(t.get("paramIndex"))+"]"+e._s(t.get("paramType"))+"#"+e._s(t.get("name")))])])]),s("v-timeline-item",{attrs:{color:"deep-purple lighten-1",small:""}},[s("div",[s("div",{staticClass:"font-weight-normal"},[s("strong",[e._v(e._s(e.$t("apiDocsRes.apiForm.paramDescriptionLabel")))])]),s("div",{staticStyle:{wordBreak:"break-word"}},[e._v(e._s(t.get("description")||e.$t("apiDocsRes.apiForm.none")))])])])],1)],1)],1)],1),s("v-flex",{attrs:{lg8:""}},[s("apiFormItem",{attrs:{formItemInfo:t,formValues:e.formValues}})],1)],1)],1)})),s("div",{staticStyle:{marginTop:"20px"}},[s("v-btn",{attrs:{block:"",elevation:"2","x-large":"",color:"info"},on:{click:function(t){return e.doTestApi()}}},[e._v(e._s(e.$t("apiDocsRes.apiForm.doTestBtn")))])],1)],2)],1),s("div",[s("v-system-bar",{staticStyle:{marginTop:"30px"},attrs:{window:"",dark:""}},[s("span",[e._v(e._s(e.$t("apiDocsRes.apiForm.responseLabel")))])]),s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{lg6:""}},[s("div",[s("v-system-bar",{attrs:{window:"",dark:"",color:"primary"}},[s("span",[e._v(e._s(e.$t("apiDocsRes.apiForm.responseExampleLabel")))])])],1),s("div",{staticStyle:{marginTop:"10px"}},[s("jsonViewer",{attrs:{value:e.getJsonOrString(this.apiInfoData.response),copyable:"",boxed:"",sort:""}})],1)]),s("v-flex",{attrs:{lg6:""}},[s("div",[s("v-system-bar",{attrs:{window:"",dark:"",color:"teal"}},[s("span",[e._v(e._s(e.$t("apiDocsRes.apiForm.apiResponseLabel")))])])],1),s("div",{staticStyle:{marginTop:"10px"}},[s("jsonViewer",{attrs:{value:e.responseData,copyable:"",boxed:"",sort:""}})],1)])],1)],1)])]):e._e()},ot=[],lt=s("349e"),nt=s.n(lt),ct=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[e.formItemInfo.get("required")?s("span",{staticStyle:{color:"red"}},[e._v("*")]):e._e(),"TEXT"===e.formItemInfo.get("htmlType")||"TEXT_BYTE"===e.formItemInfo.get("htmlType")||"TEXT_CHAR"===e.formItemInfo.get("htmlType")||"NUMBER_INTEGER"===e.formItemInfo.get("htmlType")||"NUMBER_DECIMAL"===e.formItemInfo.get("htmlType")?s("v-text-field",{ref:e.buildItemId(),attrs:{id:e.buildItemId(),name:e.buildItemId(),label:e.formItemInfo.get("docName"),placeholder:e.formItemInfo.get("example"),value:e.buildDefaultValue(),required:e.formItemInfo.get("required"),rules:[e.requiredCheck],outline:""},on:{change:function(t){return e.itemChange(t)}}}):"SELECT"===e.formItemInfo.get("htmlType")?s("v-select",{ref:e.buildItemId(),attrs:{id:e.buildItemId(),name:e.buildItemId(),label:e.formItemInfo.get("docName"),items:e.buildSelectItem(),"item-text":"label","item-value":"value",value:e.buildSelectDefaultValue(),required:e.formItemInfo.get("required"),rules:[e.requiredCheck],outline:""},on:{change:function(t){return e.itemChange(t)}}}):"TEXT_AREA"===e.formItemInfo.get("htmlType")?s("json-editor2",{ref:e.buildItemId(),staticStyle:{height:"300px"},attrs:{id:e.buildItemId(),name:e.buildItemId(),label:e.formItemInfo.get("docName"),json:e.buildJsonDefaultValue(),required:e.formItemInfo.get("required"),rules:[e.requiredCheck],onChange:e.itemChange,options:{modes:["code","tree"]},outline:""}}):"DATE_SELECTOR"===e.formItemInfo.get("htmlType")||"DATETIME_SELECTOR"===e.formItemInfo.get("htmlType")?s("v-text-field",{ref:e.buildItemId(),attrs:{id:e.buildItemId(),name:e.buildItemId(),label:e.formItemInfo.get("docName"),placeholder:e.formItemInfo.get("example"),value:e.buildDefaultValue(),required:e.formItemInfo.get("required"),rules:[e.requiredCheck],outline:""},on:{change:function(t){return e.itemChange(t)}}}):s("span",[e._v(e._s(e.$t("apiDocsRes.apiForm.unsupportedHtmlTypeTip")))])],1)},dt=[],ut=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{ref:"jsoneditor"})},pt=[],ht=(s("6014"),s("2ef0")),vt=s.n(ht),mt={name:"json-editor2",data(){return{editor:null,maxed:!1,jsoneditorModes:null}},props:{json:{required:!0},options:{type:Object,default:()=>({})},onChange:{type:Function}},watch:{json:{handler(e){this.editor&&this.editor.set(e)},deep:!0}},methods:{_onChange(e){this.onChange&&this.editor&&this.onChange(this.editor.get())},_onModeChange(e,t){const s=this.$refs.jsoneditor;s.getElementsByClassName("jsoneditor-modes")&&s.getElementsByClassName("jsoneditor-modes")[0]&&(this.jsoneditorModes=s.getElementsByClassName("jsoneditor-modes")[0]),"code"===e&&this.addMaxBtn()},addMaxBtn(){const e=this.$refs.jsoneditor;var t=e.getElementsByClassName("jsoneditor-menu")[0],s=document.createElement("button");s.type="button",s.classList.add("jsoneditor-max-btn"),s.jsoneditor={},s.jsoneditor.maxed=this.maxed,s.jsoneditor.editor=this.$refs.jsoneditor;var a=this;s.onclick=function(){this.jsoneditor.maxed?(e.getElementsByClassName("jsoneditor-modes")[0]||s.before(a.jsoneditorModes),this.jsoneditor.editor.classList.remove("jsoneditor-max"),this.jsoneditor.maxed=!1):(e.getElementsByClassName("jsoneditor-modes")&&e.getElementsByClassName("jsoneditor-modes")[0]&&e.getElementsByClassName("jsoneditor-modes")[0].remove(),this.jsoneditor.editor.classList.add("jsoneditor-max"),this.jsoneditor.maxed=!0)},t.appendChild(s)}},mounted(){const e=this.$refs.jsoneditor,t=vt.a.extend({onChange:this._onChange,onModeChange:this._onModeChange},this.options);this.editor=new A.a(e,t),this.editor.set(this.json),e.getElementsByClassName("jsoneditor-modes")&&e.getElementsByClassName("jsoneditor-modes")[0]&&(this.jsoneditorModes=e.getElementsByClassName("jsoneditor-modes")[0])},beforeDestroy(){this.editor&&(this.editor.destroy(),this.editor=null)}},ft=mt,gt=(s("8b76"),Object(n["a"])(ft,ut,pt,!1,null,null,null)),xt=gt.exports,bt={name:"ApiFormItem",components:{JsonEditor2:xt},props:{formItemInfo:{type:Map,default:function(){return new Map}},formValues:{type:Map,default:function(){return new Map}}},data:()=>({isSelectDefaultBuiled:!1,selectDefaultValue:""}),watch:{},methods:{buildItemId(){let e=this.formItemInfo.get("paramType")+"@@"+this.formItemInfo.get("paramIndex")+"@@"+this.formItemInfo.get("javaType")+"@@"+this.formItemInfo.get("name")+"@@"+this.formItemInfo.get("htmlType");return this.formItemInfo.get("methodParam")&&(e=e+"@@"+this.formItemInfo.get("methodParam")),e},requiredCheck(e){return!this.formItemInfo.get("required")||(!!e||this.$t("apiDocsRes.apiForm.requireItemTip"))},buildSelectItem(){var e=this.formItemInfo.get("allowableValues");const t=[];var s={label:"",value:""};t.push(s);for(var a=0;a({showForm:!1,formItemAsyncSelectItems:[!0,!1],formItemAsync:!1,formItemInterfaceClassName:"",formItemMethodName:"",formItemRegistryCenterUrl:"",apiInfoData:{},publicFormsArray:[],responseData:"",formValues:new Map}),watch:{formInfo:"changeFormInfo"},methods:{getJsonOrString(e){if(!e)return"";try{return JSON.parse(e)}catch(t){return e}},changeFormInfo(e){this.publicFormsArray=[],this.formValues=new Map,this.responseData="",this.$axios.get("/docs/apiParamsResp",{params:{dubboIp:e.dubboIp,dubboPort:e.dubboPort,apiName:e.moduleClassName+"."+e.apiName+e.paramsDesc}}).then(e=>{if(e&&e.data&&""!==e.data){this.apiInfoData=JSON.parse(e.data),this.formItemAsync=this.apiInfoData.async,this.formItemInterfaceClassName=this.apiInfoData.apiModelClass,this.formItemMethodName=this.apiInfoData.apiName;var t=this.apiInfoData.params;const n=[];for(var s=0;s{console.log("error",e.message)}),this.showForm=!0},doTestApi(){if(!this.$refs.form.validate())return!1;var e=new Map;this.formValues.forEach((t,s)=>{var a=s.split("@@"),i=a[0]+"@@"+a[1];a[5]&&(i=i+"@@"+a[5]);var r=e.get(i);r||(r=new Array,e.set(i,r));var o={};o.key=s,o.value=t,r.push(o)});var t=[];e.forEach((e,s)=>{var a={};if(t[s.split("@@")[1]]=a,a.paramType=s.split("@@")[0],s.split("@@")[2])a.paramValue=e[0].value;else{var i={};a.paramValue=i,e.forEach(e=>{var t=e.key.split("@@"),s=t[3];"TEXT_AREA"===t[4]?""!==e.value&&(i[s]=e.value):i[s]=e.value})}}),""===this.formItemRegistryCenterUrl&&(this.formItemRegistryCenterUrl="dubbo://"+this.formInfo.dubboIp+":"+this.formInfo.dubboPort),this.$axios({url:"/docs/requestDubbo",method:"post",params:{async:this.formItemAsync,interfaceClassName:this.formItemInterfaceClassName,methodName:this.formItemMethodName,registryCenterUrl:this.formItemRegistryCenterUrl,version:this.apiInfoData.apiVersion||"",group:this.apiInfoData.apiGroup||""},headers:{"Content-Type":"application/json; charset=UTF-8"},data:JSON.stringify(t)}).catch(e=>{console.log(e)}).then(e=>{this.responseData=e.data})}},mounted(){}},$t=wt,It=Object(n["a"])($t,rt,ot,!1,null,"15da7d38",null),Dt=It.exports,St={name:"ApiDocs",components:{Breadcrumb:N,ApiForm:Dt},computed:{isBigScreen:function(){const e=this;var t=!1;return e.$vuetify.breakpoint&&(t=e.$vuetify.breakpoint.md||e.$vuetify.breakpoint.lg||e.$vuetify.breakpoint.xl),t}},created(){const e=this;console.debug(e.$vuetify.breakpoint.md)},data:()=>({breads:[{text:"apiDocs",href:"/apiDocs"}],rules:[e=>!!e||"Required."],apiModules:[],formInfo:{},isApiListDivFixed:!1}),methods:{submit(){const e=document.querySelector("#dubboProviderIP").value.trim(),t=document.querySelector("#dubboProviderPort").value.trim();this.$axios.get("/docs/apiModuleList",{params:{dubboIp:e,dubboPort:t}}).then(s=>{const a=[];if(s&&s.data&&""!==s.data){const i=JSON.parse(s.data);i.sort((e,t)=>e.moduleDocName>t.moduleDocName);for(let s=0;se.apiName>t.apiName);const o={title:r.moduleDocName,apis:[]},l=r.moduleApiList;for(let s=0;s{console.log("error",e.message)})},showApiForm(e,t){this.formInfo=e;const s=document.getElementsByClassName("apiListListTile");for(var a=0;a=t&&(this.isApiListDivFixed=!0,document.getElementById("apiListDiv").classList.add("apiListDiv-fixed"),document.getElementById("apiListDiv").style.top="75px",document.getElementById("apiListDiv").style.width=s+"px"),this.isApiListDivFixed&&e<=t&&(this.isApiListDivFixed=!1,document.getElementById("apiListDiv").classList.remove("apiListDiv-fixed"),document.getElementById("apiListDiv").style.top="0px")},onScroll(){const e=this;var t=document.documentElement.scrollTop||document.body.scrollTop,s=document.getElementById("apiFormDiv").offsetTop;t>=s&&e.isBigScreen?e.isApiListDivFixed=!0:e.isApiListDivFixed=!1}},mounted(){window.addEventListener("scroll",this.onScroll)}},Ct=St,At=(s("1ca8"),Object(n["a"])(Ct,at,it,!1,null,"e656f73a",null)),Rt=At.exports,Et=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("v-container",{attrs:{"grid-list-xl":"",fluid:""}},[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{lg12:""}},[s("breadcrumb",{attrs:{title:"serviceMock",items:e.breads}})],1),s("v-flex",{attrs:{lg12:""}},[s("v-card",{attrs:{flat:"",color:"transparent"}},[s("v-card-text",[s("v-form",[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-combobox",{attrs:{id:"mockRule",loading:e.searchLoading,"search-input":e.input,flat:"","append-icon":"","hide-no-data":"",hint:e.$t("testModule.searchServiceHint"),label:e.$t("placeholders.searchService")},on:{"update:searchInput":[function(t){e.input=t},e.updateFilter],"update:search-input":function(t){e.input=t},keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.submitSearch(t)}},model:{value:e.filter,callback:function(t){e.filter=t},expression:"filter"}}),s("v-btn",{attrs:{color:"primary",large:""},on:{click:e.submitSearch}},[e._v(e._s(e.$t("search")))])],1)],1)],1)],1)],1),s("v-flex",{attrs:{xs12:""}},[s("v-card",[s("v-toolbar",{staticClass:"elevation-0",attrs:{flat:"",color:"transparent"}},[s("v-toolbar-title",[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("ruleList")))])]),s("v-spacer"),s("v-btn",{staticClass:"mb-2",attrs:{outline:"",color:"primary"},on:{click:function(t){return t.stopPropagation(),e.openDialog(t)}}},[e._v(e._s(e.$t("create")))])],1),s("v-card-text",{staticClass:"pa-0"},[s("v-data-table",{staticClass:"elevation-1",attrs:{headers:e.headers,items:e.mockRules,pagination:e.pagination,"total-items":e.totalItems,loading:e.loadingRules},on:{"update:pagination":function(t){e.pagination=t}},scopedSlots:e._u([{key:"items",fn:function(t){return[s("td",[e._v(e._s(t.item.serviceName))]),s("td",[s("v-chip",{attrs:{label:""}},[e._v(e._s(t.item.methodName))])],1),s("td",[e._v(e._s(t.item.rule)+" ")]),s("td",[s("v-switch",{attrs:{inset:""},on:{change:function(s){return e.enableOrDisableMockRule(t.item)}},model:{value:t.item.enable,callback:function(s){e.$set(t.item,"enable",s)},expression:"props.item.enable"}})],1),s("td",[s("v-btn",{staticClass:"tiny",attrs:{color:"primary"},on:{click:function(s){return e.editMockRule(t.item)}}},[e._v(" "+e._s(e.$t("edit"))+" ")]),s("v-btn",{staticClass:"tiny",attrs:{color:"error"},on:{click:function(s){return e.openDeleteDialog(t.item)}}},[e._v(" "+e._s(e.$t("delete"))+" ")])],1)]}}])})],1)],1)],1)],1),s("v-dialog",{attrs:{width:"800px",persistent:""},model:{value:e.dialog,callback:function(t){e.dialog=t},expression:"dialog"}},[s("v-card",[s("v-card-title",{staticClass:"justify-center"},[s("span",{staticClass:"headline"},[e._v(e._s(1===e.dialogType?e.$t("createMockRule"):e.$t("editMockRule")))])]),s("v-card-text",[s("v-text-field",{attrs:{label:e.$t("serviceName"),hint:e.$t("dataIdClassHint")},model:{value:e.mockRule.serviceName,callback:function(t){e.$set(e.mockRule,"serviceName",t)},expression:"mockRule.serviceName"}}),s("v-text-field",{attrs:{label:e.$t("methodName"),hint:e.$t("methodNameHint")},model:{value:e.mockRule.methodName,callback:function(t){e.$set(e.mockRule,"methodName",t)},expression:"mockRule.methodName"}}),s("v-subheader",{staticClass:"pa-0 mt-3"},[e._v(e._s(e.$t("ruleContent")))]),s("ace-editor",{model:{value:e.mockRule.rule,callback:function(t){e.$set(e.mockRule,"rule",t)},expression:"mockRule.rule"}})],1),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{flat:""},nativeOn:{click:function(t){return e.closeDialog(t)}}},[e._v(e._s(e.$t("close")))]),s("v-btn",{attrs:{depressed:"",color:"primary"},nativeOn:{click:function(t){return e.saveOrUpdateMockRule(t)}}},[e._v(e._s(e.$t("save")))])],1)],1)],1),s("v-dialog",{attrs:{persistent:"","max-width":"500px"},model:{value:e.warnDialog,callback:function(t){e.warnDialog=t},expression:"warnDialog"}},[s("v-card",[s("v-card-title",{staticClass:"headline"},[e._v(e._s(e.$t("deleteRuleTitle")))]),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{color:"darken-1",flat:""},nativeOn:{click:function(t){return e.closeDeleteDialog(t)}}},[e._v(e._s(e.$t("cancel")))]),s("v-btn",{attrs:{color:"primary darken-1",depressed:""},nativeOn:{click:function(t){return e.deleteMockRule(t)}}},[e._v(e._s(e.$t("confirm")))])],1)],1)],1)],1)},Tt=[],Lt={name:"ServiceMock",components:{Breadcrumb:N,AceEditor:oe},data(){return{headers:[],mockRules:[],breads:[{text:"mockRule",href:"/mock"}],pagination:{page:1,rowsPerPage:10},loadingRules:!1,searchLoading:!1,filter:null,totalItems:0,dialog:!1,mockRule:{serviceName:"",methodName:"",rule:"",enable:!0},dialogType:1,warnDialog:!1,deleteRule:null}},methods:{setHeaders(){this.headers=[{text:this.$t("serviceName"),value:"serviceName",sortable:!1},{text:this.$t("methodName"),value:"methodName",sortable:!1},{text:this.$t("mockData"),value:"rule",sortable:!1},{text:this.$t("enabled"),value:"enable",sortable:!1},{text:this.$t("operation"),value:"operation",sortable:!1}]},listMockRules(e){const t=this.pagination.page-1,s=-1===this.pagination.rowsPerPage?this.totalItems:this.pagination.rowsPerPage;this.loadingRules=!0,this.$axios.get("/mock/rule/list",{params:{page:t,size:s,filter:e}}).then(e=>{this.mockRules=e.data.content,this.totalItems=e.data.totalElements}).catch(e=>{this.showSnackbar("error",e.response.data.message)}).finally(this.loadingRules=!1)},submitSearch(){this.listMockRules(this.filter)},openDialog(){this.dialog=!0},closeDialog(){this.dialog=!1,this.dialogType=1,this.mockRule={serviceName:"",methodName:"",rule:"",enable:!0}},saveOrUpdateMockRule(){this.$axios.post("/mock/rule",this.mockRule).then(e=>{this.$notify(this.$t("saveRuleSuccess"),"success"),this.closeDialog(),this.listMockRules()}).catch(e=>this.showSnackbar("error",e.response.data.message))},deleteMockRule(){const e=this.deleteRule.id;this.$axios.delete("/mock/rule",{data:{id:e}}).then(e=>{this.$notify(this.$t("deleteRuleSuccess"),"success"),this.closeDeleteDialog(),this.listMockRules(this.filter)}).catch(e=>this.$notify(e.response.data.message,"error"))},editMockRule(e){this.mockRule=e,this.openDialog(),this.dialogType=2},enableOrDisableMockRule(e){this.$axios.post("/mock/rule",e).then(t=>this.$notify(e.enable?this.$t("enableRuleSuccess"):this.$t("disableRuleSuccess"),"success")).catch(e=>this.$notify(e.data.response.message,"error"))},updateFilter(){this.filter=document.querySelector("#mockRule").value.trim()},closeDeleteDialog(){this.warnDialog=!1,this.deleteRule=null},openDeleteDialog(e){this.warnDialog=!0,this.deleteRule=e}},mounted(){this.setHeaders(),this.listMockRules(this.filter)},computed:{area(){return this.$i18n.locale}},watch:{input(e){this.querySelections(e)},area(){this.setHeaders()},pagination:{handler(e,t){if(e.page===t.page&&e.rowsPerPage===t.rowsPerPage)return;const s=this.filter;this.listMockRules(s)},deep:!0}}},Vt=Lt,Ht=(s("fb52"),Object(n["a"])(Vt,Et,Tt,!1,null,"bcd8a582",null)),Gt=Ht.exports,Ot=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("v-container",{attrs:{"grid-list-xl":"",fluid:""}},[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",[s("iframe",{attrs:{src:"http://localhost:8081/dashboard-solo/new?utm_source=grafana_gettingstarted&orgId=1&from=1684139950126&to=1684161550126&panelId=1",width:"1350",height:"700",frameborder:"0"}})])],1)],1)},Bt=[],Nt={name:"ServiceMetrics"},Mt=Nt,jt=(s("a237"),Object(n["a"])(Mt,Ot,Bt,!1,null,"139d77c8",null)),Pt=jt.exports,qt=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("v-container",{attrs:{"grid-list-xl":"",fluid:""}},[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{lg12:""}},[s("breadcrumb",{attrs:{title:"serviceRelation",items:e.breads}})],1)],1),s("v-flex",{attrs:{lg12:""}},[s("v-card",[s("div",{staticStyle:{width:"100%",height:"500%"},attrs:{id:"chartContent"}})])],1)],1)},Qt=[],Ft={components:{Breadcrumb:N},data:()=>({success:null,breads:[{text:"serviceMetrics",href:""},{text:"serviceRelation",href:""}],responseData:null}),methods:{initData:function(){this.chartContent=echarts.init(document.getElementById("chartContent")),this.chartContent.showLoading(),this.$axios.get("/metrics/relation").then(e=>{e&&200===e.status&&(this.success=!0,this.responseData=e.data,this.responseData.type="force",this.initChart(this.responseData))}).catch(e=>{this.success=!1,this.responseData=e.response.data})},initChart:function(e){this.chartContent.hideLoading();const t={legend:{top:"bottom",data:e.categories.map(e=>e.name)},series:[{type:"graph",layout:"force",animation:!1,label:{normal:{show:!0,position:"right"}},draggable:!0,data:e.nodes.map((function(e,t){return e.id=t,e})),categories:this.responseData.categories,force:{edgeLength:100,repulsion:10},edges:e.links,edgeSymbol:["","arrow"],edgeSymbolSize:7}]};this.chartContent.setOption(t)}},mounted:function(){this.initData()}},Wt=Ft,Ut=Object(n["a"])(Wt,qt,Qt,!1,null,null,null),Jt=Ut.exports,zt=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("v-container",{attrs:{"grid-list-xl":"",fluid:""}},[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{xs12:""}},[s("search",{attrs:{id:"serviceSearch",submit:e.submit,label:e.$t("searchDubboConfig"),hint:e.$t("configNameHint")},model:{value:e.filter,callback:function(t){e.filter=t},expression:"filter"}})],1)],1),s("v-flex",{attrs:{lg12:""}},[s("v-card",[s("v-toolbar",{staticClass:"elevation-0",attrs:{flat:"",color:"transparent"}},[s("v-toolbar-title",[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("searchResult")))])]),s("v-spacer"),s("v-btn",{staticClass:"mb-2",attrs:{outline:"",color:"primary"},on:{click:function(t){return t.stopPropagation(),e.openDialog(t)}}},[e._v(e._s(e.$t("create")))])],1),s("v-card-text",{staticClass:"pa-0"},[s("v-data-table",{staticClass:"elevation-0",attrs:{headers:e.headers,items:e.dubboConfig,"hide-actions":""},scopedSlots:e._u([{key:"items",fn:function(t){return[s("td",{staticClass:"text-xs-left"},[s("v-tooltip",{attrs:{bottom:""}},[s("span",{attrs:{slot:"activator"},slot:"activator"},[e._v(" "+e._s(t.item.key)+" ")]),s("span",[e._v(e._s(t.item.path))])])],1),s("td",{staticClass:"text-xs-left"},[s("v-chip",{attrs:{color:e.getColor(t.item.scope),"text-color":"white"}},[e._v(" "+e._s(t.item.scope)+" ")])],1),s("td",{staticClass:"text-xs-center px-0"},e._l(e.operations,(function(a){return s("v-tooltip",{key:a.id,attrs:{bottom:""}},[s("v-icon",{staticClass:"mr-2",attrs:{slot:"activator",small:""},on:{click:function(s){return e.itemOperation(a.icon,t.item)}},slot:"activator"},[e._v(" "+e._s(a.icon)+" ")]),s("span",[e._v(e._s(e.$t(a.tooltip)))])],1)})),1)]}}])})],1)],1)],1),s("v-dialog",{attrs:{width:"800px",persistent:""},model:{value:e.dialog,callback:function(t){e.dialog=t},expression:"dialog"}},[s("v-card",[s("v-card-title",{staticClass:"justify-center"},[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("createNewDubboConfig")))])]),s("v-card-text",[s("v-text-field",{attrs:{label:e.$t("appName"),hint:e.$t("configNameHint")},model:{value:e.key,callback:function(t){e.key=t},expression:"key"}}),s("v-subheader",{staticClass:"pa-0 mt-3"},[e._v(e._s(e.$t("configContent")))]),s("ace-editor",{attrs:{lang:"properties",readonly:e.readonly},model:{value:e.rule,callback:function(t){e.rule=t},expression:"rule"}})],1),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{flat:""},nativeOn:{click:function(t){return e.closeDialog(t)}}},[e._v(e._s(e.$t("close")))]),s("v-btn",{attrs:{depressed:"",color:"primary"},nativeOn:{click:function(t){return e.saveItem(t)}}},[e._v(e._s(e.$t("save")))])],1)],1)],1),s("v-dialog",{attrs:{persistent:"","max-width":"500px"},model:{value:e.warn.display,callback:function(t){e.$set(e.warn,"display",t)},expression:"warn.display"}},[s("v-card",[s("v-card-title",{staticClass:"headline"},[e._v(e._s(e.$t(this.warn.title)+this.warnStatus.id))]),s("v-card-text",[e._v(e._s(this.warn.text))]),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{flat:""},nativeOn:{click:function(t){return e.closeWarn(t)}}},[e._v(e._s(e.$t("cancel")))]),s("v-btn",{attrs:{depressed:"",color:"primary"},nativeOn:{click:function(t){return e.deleteItem(e.warnStatus)}}},[e._v(e._s(e.$t("confirm")))])],1)],1)],1)],1)},Yt=[],Zt=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("v-card",{attrs:{flat:"",color:"transparent"}},[s("v-card-text",[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-text-field",{attrs:{label:e.label,clearable:"",hint:e.hint,value:e.value},on:{input:function(t){return e.$emit("input",t)},keydown:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.submit(t)}}}),s("v-btn",{attrs:{color:"primary",large:""},on:{click:e.submit}},[e._v(e._s(e.$t("search")))])],1)],1)],1)},Xt=[],Kt={name:"search",props:{value:String,submit:{type:Function,default:null},label:{type:String,default:""},hint:{type:String,default:""}},data:()=>({}),methods:{}},es=Kt,ts=Object(n["a"])(es,Zt,Xt,!1,null,null,null),ss=ts.exports,as={name:"Management",components:{AceEditor:oe,Search:ss},data:()=>({configCenter:"",rule:"",updateId:"",key:"",filter:"",readonly:!1,dialog:!1,operations:[{id:0,icon:"visibility",tooltip:"view"},{id:1,icon:"edit",tooltip:"edit"},{id:3,icon:"delete",tooltip:"delete"}],warn:{display:!1,title:"",text:"",status:{}},warnStatus:{},dubboConfig:[],headers:[]}),methods:{setHeaders(){this.headers=[{text:this.$t("name"),value:"name",align:"left"},{text:this.$t("scope"),value:"scope",sortable:!1},{text:this.$t("operation"),value:"operation",sortable:!1,width:"115px"}]},itemOperation(e,t){switch(e){case"visibility":this.dialog=!0,this.rule=t.config,this.key=t.key,this.readonly=!0,this.updateId="close";break;case"edit":this.dialog=!0,this.rule=t.config,this.key=t.key,this.updateId=t.key,this.readonly=!1;break;case"delete":this.openWarn("warnDeleteConfig"),this.warnStatus.id=t.key}},deleteItem:function(e){this.$axios.delete("/manage/config/"+e.id).then(e=>{200===e.status&&(this.warn.display=!1,this.search(this.filter),this.$notify.success("Delete success"))})},closeDialog:function(){this.rule="",this.key="",this.dialog=!1,this.readonly=!1},openDialog:function(){this.dialog=!0},openWarn:function(e,t){this.warn.title=e,this.warn.text=t,this.warn.display=!0},closeWarn:function(){this.warn.title="",this.warn.text="",this.warn.display=!1},saveItem:function(){const e={};if(!this.key)return void this.$notify.error("Config key is needed");e.key=this.key,e.config=this.rule;const t=this;this.updateId?"close"===this.updateId?this.closeDialog():this.$axios.put("/manage/config/"+this.updateId,e).then(e=>{200===e.status&&(t.search(t.key),t.filter=t.key,this.closeDialog(),this.$notify.success("Update success"))}):this.$axios.post("/manage/config/",e).then(e=>{201===e.status&&(t.search(t.key),t.filter=t.key,t.closeDialog(),t.$notify.success("Create success"))})},getColor(e){return"global"===e?"red":"application"===e?"green":"service"===e?"blue":void 0},submit(){this.filter?(this.filter=this.filter.trim(),this.search()):this.$notify.error("application is needed")},search(){this.$axios.get("/manage/config/"+this.filter).then(e=>{200===e.status&&(this.dubboConfig=e.data,this.$router.push({path:"management",query:{key:this.filter}}))})}},mounted(){this.setHeaders();const e=this.$route.query;let t=null;Object.keys(e).forEach((function(s){"key"===s&&(t=e[s])})),this.filter=null!==t?t:"global",this.search()}},is=as,rs=Object(n["a"])(is,zt,Yt,!1,null,"3786212b",null),os=rs.exports,ls=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("v-container",{attrs:{"grid-list-xl":"",fluid:""}},[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{lg12:""}},[s("Breadcrumb",{attrs:{title:"trafficAccesslog",items:e.breads}})],1),s("v-flex",{attrs:{lg12:""}},[s("v-card",{attrs:{flat:"",color:"transparent"}},[s("v-card-text",[s("v-form",[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-combobox",{attrs:{loading:e.searchLoading,items:e.typeAhead,"search-input":e.application,flat:"","append-icon":"","hide-no-data":"",label:"请输入application",hint:"请输入application"},on:{"update:searchInput":function(t){e.application=t},"update:search-input":function(t){e.application=t}}}),s("v-btn",{attrs:{color:"primary",large:""},on:{click:e.submit}},[e._v("搜索")]),s("v-btn",{attrs:{color:"primary",large:""},on:{click:e.create}},[e._v("新建")])],1)],1)],1)],1)],1),s("v-flex",{attrs:{xs12:""}},[s("v-card",[s("v-toolbar",{staticClass:"elevation-0",attrs:{flat:"",color:"transparent"}},[s("v-toolbar-title",[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("trafficAccesslog")))])]),s("v-spacer")],1),s("v-data-table",{staticClass:"elevation-1",attrs:{headers:e.headers,items:e.tableData,"hide-actions":""},scopedSlots:e._u([{key:"items",fn:function(t){return[s("td",[e._v(e._s(t.item.application))]),s("td",[e._v(e._s(t.item.accesslog))]),s("td",{staticClass:"text-xs-center px-0",attrs:{nowrap:""}},[s("v-btn",{staticClass:"tiny",attrs:{color:"success"},on:{click:function(s){return e.update(t.item)}}},[e._v(" 修改 ")]),s("v-btn",{staticClass:"tiny",attrs:{outline:""},on:{click:function(s){return e.deleteItem(t.item)}}},[e._v(" 删除 ")])],1)]}}])})],1)],1),s("v-dialog",{attrs:{width:"800px",persistent:""},model:{value:e.dialog,callback:function(t){e.dialog=t},expression:"dialog"}},[s("v-card",[s("v-card-title",{staticClass:"justify-center"},[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("createAccesslogRule")))])]),s("v-card-text",[s("v-layout",{attrs:{wrap:""}},[s("v-flex",{attrs:{xs6:"",sm3:"",md5:""}},[s("v-text-field",{attrs:{label:"Application Name",hint:"请输入Application Name"},model:{value:e.createApplication,callback:function(t){e.createApplication=t},expression:"createApplication"}})],1)],1),s("v-flex",{attrs:{xs6:"",sm3:"",md5:""}},[s("v-text-field",{attrs:{label:"开启 Accesslog(这里应该是一个开关按钮,用户点击打开或关闭)",hint:""},model:{value:e.createAccesslog,callback:function(t){e.createAccesslog=t},expression:"createAccesslog"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md5:""}},[s("v-text-field",{attrs:{label:"日志文件存储路径(此输入框默认隐藏,用户点击显示出来)",hint:"输入 accesslog 存储的目标文件绝对路径(如/home/user1/access.log)"},model:{value:e.createAccesslog,callback:function(t){e.createAccesslog=t},expression:"createAccesslog"}})],1)],1),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{flat:""},nativeOn:{click:function(t){return e.closeDialog(t)}}},[e._v(e._s(e.$t("close")))]),s("v-btn",{attrs:{depressed:"",color:"primary"},nativeOn:{click:function(t){return e.save(t)}}},[e._v(e._s(e.$t("save")))])],1)],1)],1),s("v-dialog",{attrs:{width:"800px",persistent:""},model:{value:e.updateDialog,callback:function(t){e.updateDialog=t},expression:"updateDialog"}},[s("v-card",[s("v-card-title",{staticClass:"justify-center"},[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("createAccesslogRule")))])]),s("v-card-text",[s("v-layout",{attrs:{wrap:""}},[s("v-flex",{attrs:{xs6:"",sm3:"",md5:""}},[s("v-text-field",{attrs:{label:"Application Name",hint:"请输入Application Name"},model:{value:e.updateApplication,callback:function(t){e.updateApplication=t},expression:"updateApplication"}})],1)],1),s("v-flex",{attrs:{xs6:"",sm3:"",md5:""}},[s("v-text-field",{attrs:{label:"开启 Accesslog(这里应该是一个开关按钮,用户点击打开或关闭)",hint:""},model:{value:e.updateAccesslog,callback:function(t){e.updateAccesslog=t},expression:"updateAccesslog"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md5:""}},[s("v-text-field",{attrs:{label:"日志文件存储路径(此输入框默认隐藏,用户点击后显示出来)",hint:"输入 accesslog 存储的目标文件绝对路径(如/home/user1/access.log)"},model:{value:e.updateAccesslog,callback:function(t){e.updateAccesslog=t},expression:"updateAccesslog"}})],1)],1),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{flat:""},nativeOn:{click:function(t){return e.closeUpdateDialog(t)}}},[e._v(e._s(e.$t("close")))]),s("v-btn",{attrs:{depressed:"",color:"primary"},nativeOn:{click:function(t){return e.saveUpdate(t)}}},[e._v(e._s(e.$t("save")))])],1)],1)],1),s("v-dialog",{attrs:{persistent:"","max-width":"290"},model:{value:e.deleteDialog,callback:function(t){e.deleteDialog=t},expression:"deleteDialog"}},[s("v-card",[s("v-card-title",{staticClass:"text-h5"},[e._v(" 您确认删除这条数据嘛? ")]),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{color:"green darken-1",text:""},on:{click:function(t){e.deleteDialog=!1}}},[e._v(" 取消 ")]),s("v-btn",{attrs:{color:"green darken-1",text:""},on:{click:e.confirmDelete}},[e._v(" 确定 ")])],1)],1)],1)],1)],1)},ns=[],cs={name:"Accesslog",components:{Breadcrumb:N},data:()=>({breads:[{text:"trafficManagement",href:""},{text:"trafficAccesslog",href:""}],typeAhead:[],input:null,searchLoading:!1,timerID:null,application:"",accesslog:"",deleteDialog:!1,createApplication:"",createAccesslog:"",deleteApplication:"",deleteAccesslog:"",dialog:!1,headers:[],service:null,tableData:[],services:[],loading:!1,updateDialog:!1,updateApplication:"",updateAccesslog:""}),methods:{submit(){if(!this.accesslog||!this.application)return this.$notify.error("service is needed"),!1;this.search()},search(){this.$axios.get("/traffic/accesslog",{params:{application:this.application,accesslog:this.accesslog}}).then(e=>{console.log(e),this.tableData=[],e.data.forEach(e=>{this.tableData.push(e)}),console.log(this.tableData)})},saveUpdate(){console.log(this.updateAccesslog),this.updateDialog=!1,this.$axios.put("/traffic/accesslog",{application:this.updateApplication,accesslog:this.updateAccesslog}).then(e=>{e&&alert("操作成功")})},setHeaders:function(){this.headers=[{text:"服务",value:"application"},{text:"accesslog",value:"accesslog"},{text:"操作",value:""}]},closeUpdateDialog(){this.updateDialog=!1},create(){this.dialog=!0},confirmDelete(){console.log(this.deleteAccesslog),this.$axios.delete("/traffic/accesslog",{application:this.deleteApplication,accesslog:this.deleteAccesslog}).then(e=>{e&&alert("操作成功")}),this.deleteAccesslog=!1},deleteItem(e){this.deleteDialog=!0,this.deleteAccesslog=e.accesslog,this.deleteApplication=e.application},update(e){console.log(e),this.updateApplication=e.application,this.updateAccesslog=e.accesslog,this.updateDialog=!0,console.log(this.updateApplication),console.log(this.updateAccesslog)},save(){this.$axios.post("/traffic/accesslog",{application:this.createApplication,accesslog:this.createAccesslog}).then(e=>{e&&alert("操作成功")})},closeDialog(){this.dialog=!1}},watch:{area(){this.setHeaders()}},mounted(){this.setHeaders()}},ds=cs,us=Object(n["a"])(ds,ls,ns,!1,null,null,null),ps=us.exports,hs=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("v-container",{attrs:{"grid-list-xl":"",fluid:""}},[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{lg12:""}},[s("Breadcrumb",{attrs:{title:"trafficArguments",items:e.breads}})],1),s("v-flex",{attrs:{lg12:""}},[s("v-card",{attrs:{flat:"",color:"transparent"}},[s("v-card-text",[s("v-form",[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-text-field",{attrs:{flat:"",label:"请输入服务名"},model:{value:e.service,callback:function(t){e.service=t},expression:"service"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Version",hint:e.$t("dataIdVersionHint")},model:{value:e.group,callback:function(t){e.group=t},expression:"group"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Group",hint:e.$t("dataIdGroupHint")},model:{value:e.version,callback:function(t){e.version=t},expression:"version"}})],1),s("v-btn",{attrs:{color:"primary",large:""},on:{click:e.submit}},[e._v(e._s(e.$t("search")))]),s("v-btn",{attrs:{color:"primary",large:""},on:{click:e.create}},[e._v("新建")])],1)],1)],1)],1)],1),s("v-flex",{attrs:{xs12:""}},[s("v-card",[s("v-toolbar",{staticClass:"elevation-0",attrs:{flat:"",color:"transparent"}},[s("v-toolbar-title",[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("trafficArguments")))])]),s("v-spacer")],1),s("v-data-table",{staticClass:"elevation-1",attrs:{headers:e.headers,items:e.tableData,"hide-actions":""},scopedSlots:e._u([{key:"items",fn:function(t){return[s("td",[e._v(e._s(t.item.service))]),s("td",[e._v(e._s(t.item.rule))]),s("td",[e._v(e._s(t.item.group))]),s("td",[e._v(e._s(t.item.version))]),s("td",{staticClass:"text-xs-center px-0",attrs:{nowrap:""}},[s("v-btn",{staticClass:"tiny",attrs:{color:"success"},on:{click:function(s){return e.update(t.item)}}},[e._v(" 修改 ")]),s("v-btn",{staticClass:"tiny",attrs:{outline:""},on:{click:function(s){return e.deleteItem(t.item)}}},[e._v(" 删除 ")])],1)]}}])})],1)],1),s("v-dialog",{attrs:{width:"800px",persistent:""},model:{value:e.dialog,callback:function(t){e.dialog=t},expression:"dialog"}},[s("v-card",[s("v-card-title",{staticClass:"justify-center"},[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("createArgumentRule")))])]),s("v-card-text",[s("v-layout",{attrs:{wrap:""}},[s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-text-field",{attrs:{label:"服务名",hint:"请输入服务名"},model:{value:e.createService,callback:function(t){e.createService=t},expression:"createService"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Group",hint:"请输入Group"},model:{value:e.createGroup,callback:function(t){e.createGroup=t},expression:"createGroup"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Version",hint:"请输入Version"},model:{value:e.createVersion,callback:function(t){e.createVersion=t},expression:"createVersion"}})],1)],1),s("v-layout",{attrs:{wrap:""}},[s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"方法名",hint:"请输入方法名"},model:{value:e.createRule,callback:function(t){e.createRule=t},expression:"createRule"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"参数索引",hint:"如第一个参数,请输入0",type:"number"},model:{value:e.createRule,callback:function(t){e.createRule=t},expression:"createRule"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"参数匹配条件",hint:"请输入参数匹配条件"},model:{value:e.createRule,callback:function(t){e.createRule=t},expression:"createRule"}})],1)],1)],1),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{flat:""},nativeOn:{click:function(t){return e.closeDialog(t)}}},[e._v(e._s(e.$t("close")))]),s("v-btn",{attrs:{depressed:"",color:"primary"},nativeOn:{click:function(t){return e.save(t)}}},[e._v(e._s(e.$t("save")))])],1)],1)],1),s("v-dialog",{attrs:{width:"800px",persistent:""},model:{value:e.updateDialog,callback:function(t){e.updateDialog=t},expression:"updateDialog"}},[s("v-card",[s("v-card-title",{staticClass:"justify-center"},[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("createArgumentRule")))])]),s("v-card-text",[s("v-layout",{attrs:{wrap:""}},[s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-text-field",{attrs:{label:"服务名",hint:"请输入服务名"},model:{value:e.updateService,callback:function(t){e.updateService=t},expression:"updateService"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Group",hint:"请输入Group"},model:{value:e.updateGroup,callback:function(t){e.updateGroup=t},expression:"updateGroup"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Version",hint:"请输入Version"},model:{value:e.updateVersion,callback:function(t){e.updateVersion=t},expression:"updateVersion"}})],1)],1),s("v-layout",{attrs:{wrap:""}},[s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"方法名",hint:"请输入方法名"},model:{value:e.createRule,callback:function(t){e.createRule=t},expression:"createRule"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"参数索引",hint:"如第一个参数,请输入0",type:"number"},model:{value:e.createRule,callback:function(t){e.createRule=t},expression:"createRule"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"参数匹配条件",hint:"请输入参数匹配条件"},model:{value:e.createRule,callback:function(t){e.createRule=t},expression:"createRule"}})],1)],1)],1),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{flat:""},nativeOn:{click:function(t){return e.closeUpdateDialog(t)}}},[e._v(e._s(e.$t("close")))]),s("v-btn",{attrs:{depressed:"",color:"primary"},nativeOn:{click:function(t){return e.saveUpdate(t)}}},[e._v(e._s(e.$t("save")))])],1)],1)],1),s("v-dialog",{attrs:{persistent:"","max-width":"290"},model:{value:e.deleteDialog,callback:function(t){e.deleteDialog=t},expression:"deleteDialog"}},[s("v-card",[s("v-card-title",{staticClass:"text-h5"},[e._v(" 您确认删除这条数据嘛? ")]),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{color:"green darken-1",text:""},on:{click:function(t){e.deleteDialog=!1}}},[e._v(" 取消 ")]),s("v-btn",{attrs:{color:"green darken-1",text:""},on:{click:e.confirmDelete}},[e._v(" 确定 ")])],1)],1)],1)],1)],1)},vs=[],ms={name:"Arguments",components:{Breadcrumb:N},data:()=>({breads:[{text:"trafficManagement",href:""},{text:"trafficArguments",href:""}],typeAhead:[],input:null,searchLoading:!1,timerID:null,service:"",rule:"",group:"",version:"",createGroup:"",createVersion:"",updateService:"",updateRule:"",updateGroup:"",updateVersion:"",deleteDialog:!1,createService:"",createRule:"",deleteService:"",deleteRule:"",deleteVersion:"",deleteGroup:"",dialog:!1,headers:[],tableData:[],services:[],loading:!1,updateDialog:!1}),methods:{submit(){if(!this.service||!this.rule)return this.$notify.error("service is needed"),!1;this.search()},search(){this.$axios.get("/traffic/argument",{params:{service:this.service,rule:this.rule,group:this.group,version:this.version}}).then(e=>{this.tableData=[],e.data.forEach(e=>{this.tableData.push(e)}),console.log(this.tableData)})},saveUpdate(){this.updateDialog=!1,this.$axios.put("/traffic/argument",{service:this.updateService,rule:this.updateRule,group:this.updateGroup,version:this.updateVersion}).then(e=>{e&&alert("操作成功")})},setHeaders:function(){this.headers=[{text:"应用",value:"service"},{text:"应用规则",value:"rule"},{text:"Group",value:"group"},{text:"Version",value:"version"},{text:"操作",value:""}]},closeUpdateDialog(){this.updateDialog=!1},create(){this.dialog=!0},confirmDelete(){console.log(this.deleteArguments),this.$axios.delete("/traffic/argument",{service:this.deleteService,rule:this.deleteRule,group:this.deleteGroup,version:this.deleteVersion}).then(e=>{e&&alert("操作成功")}),this.deleteArguments=!1},deleteItem(e){this.deleteDialog=!0,this.deleteService=e.service,this.deleteRule=e.rule,this.deleteGroup=e.group,this.deleteVersion=e.version},update(e){this.updateService=e.service,this.updateRule=e.rule,this.updateGroup=e.group,this.updateVersion=e.version,this.updateDialog=!0},save(){this.$axios.post("/traffic/argument",{service:this.createService,rule:this.createRule,group:this.createGroup,version:this.createVersion}).then(e=>{e&&alert("操作成功")}),this.dialog=!1},closeDialog(){this.dialog=!1}},watch:{area(){this.setHeaders()}},mounted(){this.setHeaders()}},fs=ms,gs=Object(n["a"])(fs,hs,vs,!1,null,null,null),xs=gs.exports,bs=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("v-container",{attrs:{"grid-list-xl":"",fluid:""}},[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{lg12:""}},[s("Breadcrumb",{attrs:{title:"trafficGray",items:e.breads}})],1),s("v-flex",{attrs:{lg12:""}},[s("v-card",{attrs:{flat:"",color:"transparent"}},[s("v-card-text",[s("v-form",[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{xs6:"",sm3:"",md9:""}},[s("v-text-field",{attrs:{flat:"",label:"请输入应用名"},model:{value:e.service,callback:function(t){e.service=t},expression:"service"}})],1),s("v-btn",{attrs:{color:"primary",large:""},on:{click:e.submit}},[e._v(e._s(e.$t("search")))]),s("v-btn",{attrs:{color:"primary",large:""},on:{click:e.create}},[e._v("新建")])],1)],1)],1)],1)],1),s("v-flex",{attrs:{xs12:""}},[s("v-card",[s("v-toolbar",{staticClass:"elevation-0",attrs:{flat:"",color:"transparent"}},[s("v-toolbar-title",[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("trafficGray")))])]),s("v-spacer")],1),s("v-data-table",{staticClass:"elevation-1",attrs:{headers:e.headers,items:e.tableData,"hide-actions":""},scopedSlots:e._u([{key:"items",fn:function(t){return[s("td",[e._v(e._s(t.item.service))]),s("td",[e._v(e._s(t.item.mock))]),s("td",[e._v(e._s(t.item.group))]),s("td",[e._v(e._s(t.item.version))]),s("td",{staticClass:"text-xs-center px-0",attrs:{nowrap:""}},[s("v-btn",{staticClass:"tiny",attrs:{color:"success"},on:{click:function(s){return e.Check(t.item)}}},[e._v(" 查看 ")]),s("v-btn",{staticClass:"tiny",attrs:{color:"success"},on:{click:function(s){return e.update(t.item)}}},[e._v(" 修改 ")]),s("v-btn",{staticClass:"tiny",attrs:{outline:""},on:{click:function(s){return e.deleteItem(t.item)}}},[e._v(" 删除 ")])],1)]}}])})],1)],1),s("v-dialog",{attrs:{width:"800px",persistent:""},model:{value:e.dialog,callback:function(t){e.dialog=t},expression:"dialog"}},[s("v-card",[s("v-card-title",{staticClass:"justify-center"},[s("span",{staticClass:"headline"},[e._v("新增GAY")])]),e._l(e.createGay.tags,(function(t,a){return s("v-card-text",{key:a},[s("v-flex",[s("v-text-field",{attrs:{label:"名称",hint:"请输入名称"},model:{value:t.name,callback:function(s){e.$set(t,"name",s)},expression:"modal.name"}})],1),e._l(t.match,(function(t,i){return s("v-layout",{key:i,attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-text-field",{attrs:{label:"key",hint:"请输入key"},model:{value:t.key,callback:function(s){e.$set(t,"key",s)},expression:"item.key"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-select",{staticStyle:{"margin-left":"20px"},attrs:{items:e.items,label:"Outlined style",outlined:""},on:{change:e.updateValue},model:{value:e.selectedOption[i],callback:function(t){e.$set(e.selectedOption,i,t)},expression:"selectedOption[idx]"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md:""}},[s("v-text-field",{staticStyle:{"margin-left":"20px"},attrs:{label:"value",hint:"请输入匹配的值"},model:{value:t.value[e.selectedOption[i]],callback:function(s){e.$set(t.value,e.selectedOption[i],s)},expression:"item.value[selectedOption[idx]]"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-btn",{staticClass:"tiny",staticStyle:{"margin-left":"20px"},attrs:{color:"success",outline:""},on:{click:function(t){return e.addItem(a)}}},[e._v(" 新增一条 ")])],1)],1)}))],2)})),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{flat:""},nativeOn:{click:function(t){return e.closeDialog(t)}}},[e._v(e._s(e.$t("close")))]),s("v-btn",{attrs:{depressed:"",color:"primary"},nativeOn:{click:function(t){return e.save(t)}}},[e._v(e._s(e.$t("save")))])],1)],2)],1),s("v-dialog",{attrs:{width:"800px",persistent:""},model:{value:e.updateDialog,callback:function(t){e.updateDialog=t},expression:"updateDialog"}},[s("v-card",[s("v-card-title",{staticClass:"justify-center"},[s("span",{staticClass:"headline"},[e._v("修改GAY")])]),e._l(e.gay.tags,(function(t,a){return s("v-card-text",{key:a},[s("v-flex",[s("v-text-field",{attrs:{label:"名称",hint:"请输入名称"},model:{value:t.name,callback:function(s){e.$set(t,"name",s)},expression:"modal.name"}})],1),e._l(t.match,(function(t,i){return s("v-layout",{key:i,attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-text-field",{attrs:{label:"key",hint:"请输入key"},model:{value:t.key,callback:function(s){e.$set(t,"key",s)},expression:"item.key"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-select",{staticStyle:{"margin-left":"20px"},attrs:{items:e.items,label:"Outlined style",outlined:""},on:{change:e.updateValue},model:{value:e.selectedOption[i],callback:function(t){e.$set(e.selectedOption,i,t)},expression:"selectedOption[idx]"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md:""}},[s("v-text-field",{staticStyle:{"margin-left":"20px"},attrs:{label:"value",hint:"请输入匹配的值"},model:{value:t.value[e.selectedOption[i]],callback:function(s){e.$set(t.value,e.selectedOption[i],s)},expression:"item.value[selectedOption[idx]]"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-btn",{staticClass:"tiny",staticStyle:{"margin-left":"20px"},attrs:{color:"success",outline:""},on:{click:function(t){return e.addItem(a)}}},[e._v(" 新增一条 ")])],1)],1)}))],2)})),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{flat:""},nativeOn:{click:function(t){return e.closeUpdateDialog(t)}}},[e._v(e._s(e.$t("close")))]),s("v-btn",{attrs:{depressed:"",color:"primary"},nativeOn:{click:function(t){return e.saveUpdate(t)}}},[e._v(e._s(e.$t("save")))])],1)],2)],1),s("v-dialog",{attrs:{persistent:"","max-width":"290"},model:{value:e.deleteDialog,callback:function(t){e.deleteDialog=t},expression:"deleteDialog"}},[s("v-card",[s("v-card-title",{staticClass:"text-h5"},[e._v(" 您确认删除这条数据嘛? ")]),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{color:"green darken-1",text:""},on:{click:function(t){e.deleteDialog=!1}}},[e._v(" 取消 ")]),s("v-btn",{attrs:{color:"green darken-1",text:""},on:{click:e.confirmDelete}},[e._v(" 确定 ")])],1)],1)],1)],1)],1)},ys=[],_s={name:"Gray",components:{Breadcrumb:N},data:()=>({breads:[{text:"trafficManagement",href:""},{text:"trafficGray",href:""}],typeAhead:[],input:null,searchLoading:!1,timerID:null,service:"",gay:"",mock:"",group:"",version:"",createGroup:"",createVersion:"",updateService:"",updateMock:"",updateGroup:"",updateVersion:"",deleteDialog:!1,createService:"",createMock:"",deleteService:"",deleteMock:"",deleteVersion:"",deleteGroup:"",dialog:!1,selectedOption:[],headers:[],items:["empty","exact","noempty","prefix","regex","wildcard"],tableData:[],services:[],loading:!1,updateDialog:!1,createGay:{application:"244",tags:[{name:"233",match:[{key:"string",value:{empty:"",exact:"",noempty:"",prefix:"",regex:"",wildcard:""}}]}]}}),methods:{updateValue(){console.log(this.selectedOption)},submit(){if(!this.service)return this.$notify.error("service is needed"),!1;this.search()},addItem(e){const t={key:"string",value:{empty:"",exact:"",noempty:"",prefix:"",regex:"",wildcard:""}},s=parseInt(e);this.createGay.tags[s].match.push(t)},search(){this.$axios.get("/traffic/gray",{params:{application:this.service}}).then(e=>{this.tableData=[],e.data.forEach(e=>{this.tableData.push(e)}),console.log(this.tableData)})},saveUpdate(){this.updateDialog=!1,this.$axios.put("/traffic/gray",this.gay).then(e=>{e&&alert("操作成功")}),this.dialog=!1},setHeaders:function(){this.headers=[{text:"应用名",value:"service"},{text:"灰度环境",value:"mock"},{text:"操作",value:"version"}]},closeUpdateDialog(){this.updateDialog=!1},create(){this.dialog=!0},confirmDelete(){console.log(this.deleteArguments),this.$axios.delete("/traffic/mock",{service:this.deleteService,mock:this.deleteMock,group:this.deleteGroup,version:this.deleteVersion}).then(e=>{e&&alert("操作成功")}),this.deleteArguments=!1},deleteItem(e){this.deleteDialog=!0,this.deleteService=e.service,this.deleteMock=e.mock,this.deleteGroup=e.group,this.deleteVersion=e.version},update(e){this.updateService=e.service,this.updateMock=e.mock,this.updateGroup=e.group,this.updateVersion=e.version,this.updateDialog=!0},save(){this.$axios.post("/traffic/gray",this.createGay).then(e=>{e&&alert("操作成功")}),this.dialog=!1},closeDialog(){this.dialog=!1}},watch:{area(){this.setHeaders()}},mounted(){this.setHeaders()}},ks=_s,ws=Object(n["a"])(ks,bs,ys,!1,null,null,null),$s=ws.exports,Is=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("v-container",{attrs:{"grid-list-xl":"",fluid:""}},[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{lg12:""}},[s("Breadcrumb",{attrs:{title:"trafficMock",items:e.breads}})],1),s("v-flex",{attrs:{lg12:""}},[s("v-card",{attrs:{flat:"",color:"transparent"}},[s("v-card-text",[s("v-form",[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-text-field",{attrs:{flat:"",label:"请输入服务名"},model:{value:e.service,callback:function(t){e.service=t},expression:"service"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Version",hint:e.$t("dataIdVersionHint")},model:{value:e.group,callback:function(t){e.group=t},expression:"group"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Group",hint:e.$t("dataIdGroupHint")},model:{value:e.version,callback:function(t){e.version=t},expression:"version"}})],1),s("v-btn",{attrs:{color:"primary",large:""},on:{click:e.submit}},[e._v(e._s(e.$t("search")))]),s("v-btn",{attrs:{color:"primary",large:""},on:{click:e.create}},[e._v("新建")])],1)],1)],1)],1)],1),s("v-flex",{attrs:{xs12:""}},[s("v-card",[s("v-toolbar",{staticClass:"elevation-0",attrs:{flat:"",color:"transparent"}},[s("v-toolbar-title",[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("trafficMock")))])]),s("v-spacer")],1),s("v-data-table",{staticClass:"elevation-1",attrs:{headers:e.headers,items:e.tableData,"hide-actions":""},scopedSlots:e._u([{key:"items",fn:function(t){return[s("td",[e._v(e._s(t.item.service))]),s("td",[e._v(e._s(t.item.mock))]),s("td",[e._v(e._s(t.item.group))]),s("td",[e._v(e._s(t.item.version))]),s("td",{staticClass:"text-xs-center px-0",attrs:{nowrap:""}},[s("v-btn",{staticClass:"tiny",attrs:{color:"success"},on:{click:function(s){return e.update(t.item)}}},[e._v(" 修改 ")]),s("v-btn",{staticClass:"tiny",attrs:{outline:""},on:{click:function(s){return e.deleteItem(t.item)}}},[e._v(" 删除 ")])],1)]}}])})],1)],1),s("v-dialog",{attrs:{width:"800px",persistent:""},model:{value:e.dialog,callback:function(t){e.dialog=t},expression:"dialog"}},[s("v-card",[s("v-card-title",{staticClass:"justify-center"},[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("createMockCircuitRule")))])]),s("v-card-text",[s("v-layout",{attrs:{wrap:""}},[s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-text-field",{attrs:{label:"服务名",hint:"请输入服务名"},model:{value:e.createService,callback:function(t){e.createService=t},expression:"createService"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Group",hint:"{{$t('groupInputPrompt')}}"},model:{value:e.createGroup,callback:function(t){e.createGroup=t},expression:"createGroup"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Version",hint:"{{$t('versionInputPrompt')}}"},model:{value:e.createVersion,callback:function(t){e.createVersion=t},expression:"createVersion"}})],1)],1),s("v-layout",{attrs:{wrap:""}},[s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-text-field",{attrs:{label:"这里应该是个下拉框,有两个选项:当调用失败时返回、强制返回",hint:""},model:{value:e.updateMock,callback:function(t){e.updateMock=t},expression:"updateMock"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-text-field",{attrs:{label:"请输入具体返回值(如 json 结构体或字符串,具体取决于方法签名的返回值)",hint:"请点击链接查看如何配置 mock 值。"},model:{value:e.updateMock,callback:function(t){e.updateMock=t},expression:"updateMock"}})],1)],1)],1),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{flat:""},nativeOn:{click:function(t){return e.closeDialog(t)}}},[e._v(e._s(e.$t("close")))]),s("v-btn",{attrs:{depressed:"",color:"primary"},nativeOn:{click:function(t){return e.save(t)}}},[e._v(e._s(e.$t("save")))])],1)],1)],1),s("v-dialog",{attrs:{width:"800px",persistent:""},model:{value:e.updateDialog,callback:function(t){e.updateDialog=t},expression:"updateDialog"}},[s("v-card",[s("v-card-title",{staticClass:"justify-center"},[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("createMockCircuitRule")))])]),s("v-card-text",[s("v-layout",{attrs:{wrap:""}},[s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-text-field",{attrs:{label:"服务名",hint:"请输入服务名"},model:{value:e.updateService,callback:function(t){e.updateService=t},expression:"updateService"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Group",hint:"{{$t('groupInputPrompt')}}"},model:{value:e.updateGroup,callback:function(t){e.updateGroup=t},expression:"updateGroup"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Version",hint:"{{$t('versionInputPrompt')}}"},model:{value:e.updateVersion,callback:function(t){e.updateVersion=t},expression:"updateVersion"}})],1)],1),s("v-layout",{attrs:{wrap:""}},[s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-text-field",{attrs:{label:"这里应该是个下拉框,有两个选项:当调用失败时返回、强制返回",hint:""},model:{value:e.updateMock,callback:function(t){e.updateMock=t},expression:"updateMock"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-text-field",{attrs:{label:"请输入具体返回值(如 json 结构体或字符串,具体取决于方法签名的返回值)",hint:"请点击链接查看如何配置 mock 值。"},model:{value:e.updateMock,callback:function(t){e.updateMock=t},expression:"updateMock"}})],1)],1)],1),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{flat:""},nativeOn:{click:function(t){return e.closeUpdateDialog(t)}}},[e._v(e._s(e.$t("close")))]),s("v-btn",{attrs:{depressed:"",color:"primary"},nativeOn:{click:function(t){return e.saveUpdate(t)}}},[e._v(e._s(e.$t("save")))])],1)],1)],1),s("v-dialog",{attrs:{persistent:"","max-width":"290"},model:{value:e.deleteDialog,callback:function(t){e.deleteDialog=t},expression:"deleteDialog"}},[s("v-card",[s("v-card-title",{staticClass:"text-h5"},[e._v(" 您确认删除这条数据嘛? ")]),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{color:"green darken-1",text:""},on:{click:function(t){e.deleteDialog=!1}}},[e._v(" 取消 ")]),s("v-btn",{attrs:{color:"green darken-1",text:""},on:{click:e.confirmDelete}},[e._v(" 确定 ")])],1)],1)],1)],1)],1)},Ds=[],Ss={name:"Mock",components:{Breadcrumb:N},data:()=>({breads:[{text:"trafficManagement",href:""},{text:"trafficMock",href:""}],typeAhead:[],input:null,searchLoading:!1,timerID:null,service:"",mock:"",group:"",version:"",createGroup:"",createVersion:"",updateService:"",updateMock:"",updateGroup:"",updateVersion:"",deleteDialog:!1,createService:"",createMock:"",deleteService:"",deleteMock:"",deleteVersion:"",deleteGroup:"",dialog:!1,headers:[],tableData:[],services:[],loading:!1,updateDialog:!1}),methods:{submit(){if(!this.service||!this.mock)return this.$notify.error("service is needed"),!1;this.search()},search(){this.$axios.get("/traffic/mock",{params:{service:this.service,mock:this.mock,group:this.group,version:this.version}}).then(e=>{this.tableData=[],e.data.forEach(e=>{this.tableData.push(e)}),console.log(this.tableData)})},saveUpdate(){this.updateDialog=!1,this.$axios.put("/traffic/mock",{service:this.updateService,mock:this.updateMock,group:this.updateGroup,version:this.updateVersion}).then(e=>{e&&alert("操作成功")})},setHeaders:function(){this.headers=[{text:"应用",value:"service"},{text:"Mock",value:"mock"},{text:"Group",value:"group"},{text:"Version",value:"version"},{text:"操作",value:""}]},closeUpdateDialog(){this.updateDialog=!1},create(){this.dialog=!0},confirmDelete(){console.log(this.deleteMock),this.$axios.delete("/traffic/mock",{service:this.deleteService,mock:this.deleteMock,group:this.deleteGroup,version:this.deleteVersion}).then(e=>{e&&alert("操作成功")}),this.deleteAccesslog=!1},deleteItem(e){this.deleteDialog=!0,this.deleteService=e.service,this.deleteMock=e.mock,this.deleteGroup=e.group,this.deleteVersion=e.version},update(e){this.updateService=e.service,this.updateMock=e.mock,this.updateGroup=e.group,this.updateVersion=e.version,this.updateDialog=!0},save(){this.$axios.post("/traffic/mock",{service:this.createService,mock:this.createMock,group:this.createGroup,version:this.createVersion}).then(e=>{e&&alert("操作成功")}),this.dialog=!1},closeDialog(){this.dialog=!1}},watch:{area(){this.setHeaders()}},mounted(){this.setHeaders()}},Cs=Ss,As=Object(n["a"])(Cs,Is,Ds,!1,null,null,null),Rs=As.exports,Es=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("v-container",{attrs:{"grid-list-xl":"",fluid:""}},[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{lg12:""}},[s("Breadcrumb",{attrs:{title:"trafficRegion",items:e.breads}})],1),s("v-flex",{attrs:{lg12:""}},[s("v-card",{attrs:{flat:"",color:"transparent"}},[s("v-card-text",[s("v-form",[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-text-field",{attrs:{flat:"",label:"请输入服务名"},model:{value:e.service,callback:function(t){e.service=t},expression:"service"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Version",hint:e.$t("dataIdVersionHint")},model:{value:e.group,callback:function(t){e.group=t},expression:"group"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Group",hint:e.$t("dataIdGroupHint")},model:{value:e.version,callback:function(t){e.version=t},expression:"version"}})],1),s("v-btn",{attrs:{color:"primary",large:""},on:{click:e.submit}},[e._v(e._s(e.$t("search")))]),s("v-btn",{attrs:{color:"primary",large:""},on:{click:e.create}},[e._v("新建")])],1)],1)],1)],1)],1),s("v-flex",{attrs:{xs12:""}},[s("v-card",[s("v-toolbar",{staticClass:"elevation-0",attrs:{flat:"",color:"transparent"}},[s("v-toolbar-title",[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("trafficRegion")))])]),s("v-spacer")],1),s("v-data-table",{staticClass:"elevation-1",attrs:{headers:e.headers,items:e.tableData,"hide-actions":""},scopedSlots:e._u([{key:"items",fn:function(t){return[s("td",[e._v(e._s(t.item.service))]),s("td",[e._v(e._s(t.item.rule))]),s("td",[e._v(e._s(t.item.group))]),s("td",[e._v(e._s(t.item.version))]),s("td",{staticClass:"text-xs-center px-0",attrs:{nowrap:""}},[s("v-btn",{staticClass:"tiny",attrs:{color:"success"},on:{click:function(s){return e.update(t.item)}}},[e._v(" 修改 ")]),s("v-btn",{staticClass:"tiny",attrs:{outline:""},on:{click:function(s){return e.deleteItem(t.item)}}},[e._v(" 删除 ")])],1)]}}])})],1)],1),s("v-dialog",{attrs:{width:"800px",persistent:""},model:{value:e.dialog,callback:function(t){e.dialog=t},expression:"dialog"}},[s("v-card",[s("v-card-title",{staticClass:"justify-center"},[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("createNewRoutingRule")))])]),s("v-card-text",[s("v-layout",{attrs:{wrap:""}},[s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-text-field",{attrs:{label:"服务名",hint:"请输入服务名"},model:{value:e.createService,callback:function(t){e.createService=t},expression:"createService"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Group",hint:"{{$t('groupInputPrompt')}}"},model:{value:e.createGroup,callback:function(t){e.createGroup=t},expression:"createGroup"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Version",hint:"{{$t('versionInputPrompt')}}"},model:{value:e.createVersion,callback:function(t){e.createVersion=t},expression:"createVersion"}})],1)],1),s("v-text-field",{attrs:{label:"开启或关闭同区域优先(这里应该是一个开关,让用户选择打开或关闭同区域优先)",hint:""},model:{value:e.createRule,callback:function(t){e.createRule=t},expression:"createRule"}}),s("v-text-field",{attrs:{label:"匹配以下条件的流量开启同区域优先(默认不显示,用户点击后才显示出来让用户输入)",hint:"请输入流量匹配规则(默认不设置,则对所有流量生效),配置后只有匹配规则的流量才会执行同区域优先调用,如 method=sayHello"},model:{value:e.createRule,callback:function(t){e.createRule=t},expression:"createRule"}})],1),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{flat:""},nativeOn:{click:function(t){return e.closeDialog(t)}}},[e._v(e._s(e.$t("close")))]),s("v-btn",{attrs:{depressed:"",color:"primary"},nativeOn:{click:function(t){return e.save(t)}}},[e._v(e._s(e.$t("save")))])],1)],1)],1),s("v-dialog",{attrs:{width:"800px",persistent:""},model:{value:e.updateDialog,callback:function(t){e.updateDialog=t},expression:"updateDialog"}},[s("v-card",[s("v-card-title",{staticClass:"justify-center"},[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("createNewRoutingRule")))])]),s("v-card-text",[s("v-layout",{attrs:{wrap:""}},[s("v-flex",[s("v-text-field",{attrs:{label:"服务名",hint:"请输入服务名"},model:{value:e.updateService,callback:function(t){e.updateService=t},expression:"updateService"}})],1)],1),s("v-text-field",{attrs:{label:"Group",hint:"{{$t('groupInputPrompt')}}"},model:{value:e.updateGroup,callback:function(t){e.updateGroup=t},expression:"updateGroup"}}),s("v-text-field",{attrs:{label:"Version",hint:"{{$t('versionInputPrompt')}}"},model:{value:e.updateVersion,callback:function(t){e.updateVersion=t},expression:"updateVersion"}}),s("v-text-field",{attrs:{label:"开启或关闭同区域优先(这里应该是一个开关,让用户选择打开或关闭同区域优先)",hint:"这应该是一个 radio button,让用户选择是否开启同区域优先?"},model:{value:e.updateRule1,callback:function(t){e.updateRule1=t},expression:"updateRule1"}}),s("v-text-field",{attrs:{label:"匹配以下条件的流量开启同区域优先(默认不显示,用户点击后才显示出来让用户输入)",hint:"请输入流量匹配规则(默认不设置,则对所有流量生效),配置后只有匹配规则的流量才会执行同区域优先调用,如 method=sayHello"},model:{value:e.updateRule2,callback:function(t){e.updateRule2=t},expression:"updateRule2"}})],1),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{flat:""},nativeOn:{click:function(t){return e.closeUpdateDialog(t)}}},[e._v(e._s(e.$t("close")))]),s("v-btn",{attrs:{depressed:"",color:"primary"},nativeOn:{click:function(t){return e.saveUpdate(t)}}},[e._v(e._s(e.$t("save")))])],1)],1)],1),s("v-dialog",{attrs:{persistent:"","max-width":"290"},model:{value:e.deleteDialog,callback:function(t){e.deleteDialog=t},expression:"deleteDialog"}},[s("v-card",[s("v-card-title",{staticClass:"text-h5"},[e._v(" 您确认删除这条数据嘛? ")]),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{color:"green darken-1",text:""},on:{click:function(t){e.deleteDialog=!1}}},[e._v(" 取消 ")]),s("v-btn",{attrs:{color:"green darken-1",text:""},on:{click:e.confirmDelete}},[e._v(" 确定 ")])],1)],1)],1)],1)],1)},Ts=[],Ls={name:"Region",components:{Breadcrumb:N},data:()=>({breads:[{text:"trafficManagement",href:""},{text:"trafficRegion",href:""}],typeAhead:[],input:null,searchLoading:!1,timerID:null,service:"",rule:"",group:"",version:"",createGroup:"",createVersion:"",updateService:"",updateRule:"",updateGroup:"",updateVersion:"",deleteDialog:!1,createService:"",createRule:"",deleteService:"",deleteRule:"",deleteVersion:"",deleteGroup:"",dialog:!1,headers:[],tableData:[],services:[],loading:!1,updateDialog:!1}),methods:{submit(){if(!this.service||!this.rule)return this.$notify.error("service is needed"),!1;this.search()},search(){this.$axios.get("/traffic/region",{params:{service:this.service,rule:this.rule,group:this.group,version:this.version}}).then(e=>{this.tableData=[],e.data.forEach(e=>{this.tableData.push(e)}),console.log(this.tableData)})},saveUpdate(){this.updateDialog=!1,this.$axios.put("/traffic/region",{service:this.updateService,rule:this.updateRule,group:this.updateGroup,version:this.updateVersion}).then(e=>{e&&alert("操作成功")})},setHeaders:function(){this.headers=[{text:"应用",value:"service"},{text:"应用规则",value:"rule"},{text:"Group",value:"group"},{text:"Version",value:"version"},{text:"操作",value:""}]},closeUpdateDialog(){this.updateDialog=!1},create(){this.dialog=!0},confirmDelete(){console.log(this.deleteRegion),this.$axios.delete("/traffic/region",{service:this.deleteService,rule:this.deleteRule,group:this.deleteGroup,version:this.deleteVersion}).then(e=>{e&&alert("操作成功")}),this.deleteRegion=!1},deleteItem(e){this.deleteDialog=!0,this.deleteService=e.service,this.deleteRule=e.rule,this.deleteGroup=e.group,this.deleteVersion=e.version},update(e){this.updateService=e.service,this.updateRule=e.rule,this.updateGroup=e.group,this.updateVersion=e.version,this.updateDialog=!0},save(){this.$axios.post("/traffic/region",{service:this.createService,rule:this.createRule,group:this.createGroup,version:this.createVersion}).then(e=>{e&&alert("操作成功")}),this.dialog=!1},closeDialog(){this.dialog=!1}},watch:{area(){this.setHeaders()}},mounted(){this.setHeaders()}},Vs=Ls,Hs=Object(n["a"])(Vs,Es,Ts,!1,null,null,null),Gs=Hs.exports,Os=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("v-container",{attrs:{"grid-list-xl":"",fluid:""}},[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{lg12:""}},[s("Breadcrumb",{attrs:{title:"trafficRetry",items:e.breads}})],1),s("v-flex",{attrs:{lg12:""}},[s("v-card",{attrs:{flat:"",color:"transparent"}},[s("v-card-text",[s("v-form",[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-text-field",{attrs:{flat:"",label:"请输入服务名"},model:{value:e.service,callback:function(t){e.service=t},expression:"service"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Version",hint:e.$t("dataIdVersionHint")},model:{value:e.group,callback:function(t){e.group=t},expression:"group"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Group",hint:e.$t("dataIdGroupHint")},model:{value:e.version,callback:function(t){e.version=t},expression:"version"}})],1),s("v-btn",{attrs:{color:"primary",large:""},on:{click:e.submit}},[e._v(e._s(e.$t("search")))]),s("v-btn",{attrs:{color:"primary",large:""},on:{click:e.create}},[e._v("新建")])],1)],1)],1)],1)],1),s("v-flex",{attrs:{xs12:""}},[s("v-card",[s("v-toolbar",{staticClass:"elevation-0",attrs:{flat:"",color:"transparent"}},[s("v-toolbar-title",[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("trafficRetry")))])]),s("v-spacer")],1),s("v-data-table",{staticClass:"elevation-1",attrs:{headers:e.headers,items:e.tableData,"hide-actions":""},scopedSlots:e._u([{key:"items",fn:function(t){return[s("td",[e._v(e._s(t.item.service))]),s("td",[e._v(e._s(t.item.retry))]),s("td",[e._v(e._s(t.item.group))]),s("td",[e._v(e._s(t.item.version))]),s("td",{staticClass:"text-xs-center px-0",attrs:{nowrap:""}},[s("v-btn",{staticClass:"tiny",attrs:{color:"success"},on:{click:function(s){return e.update(t.item)}}},[e._v(" 修改 ")]),s("v-btn",{staticClass:"tiny",attrs:{outline:""},on:{click:function(s){return e.deleteItem(t.item)}}},[e._v(" 删除 ")])],1)]}}])})],1)],1),s("v-dialog",{attrs:{width:"800px",persistent:""},model:{value:e.dialog,callback:function(t){e.dialog=t},expression:"dialog"}},[s("v-card",[s("v-card-title",{staticClass:"justify-center"},[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("createRetryRule")))])]),s("v-card-text",[s("v-layout",{attrs:{wrap:""}},[s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-text-field",{attrs:{label:"服务名",hint:"请输入服务名"},model:{value:e.createService,callback:function(t){e.createService=t},expression:"createService"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Group",hint:"请输入服务group(可选)"},model:{value:e.createGroup,callback:function(t){e.createGroup=t},expression:"createGroup"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Version",hint:"请输入服务version(可选)"},model:{value:e.createVersion,callback:function(t){e.createVersion=t},expression:"createVersion"}})],1)],1),s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-text-field",{attrs:{label:"重试次数",hint:"请输入一个整数值(如 3 代表在服务调用失败后重试 3 次)",type:"number"},model:{value:e.createRetry,callback:function(t){e.createRetry=t},expression:"createRetry"}})],1)],1),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{flat:""},nativeOn:{click:function(t){return e.closeDialog(t)}}},[e._v(e._s(e.$t("close")))]),s("v-btn",{attrs:{depressed:"",color:"primary"},nativeOn:{click:function(t){return e.save(t)}}},[e._v(e._s(e.$t("save")))])],1)],1)],1),s("v-dialog",{attrs:{width:"800px",persistent:""},model:{value:e.updateDialog,callback:function(t){e.updateDialog=t},expression:"updateDialog"}},[s("v-card",[s("v-card-title",{staticClass:"justify-center"},[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("createRetryRule")))])]),s("v-card-text",[s("v-layout",{attrs:{wrap:""}},[s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-text-field",{attrs:{label:"服务名",hint:"请输入服务名"},model:{value:e.updateService,callback:function(t){e.updateService=t},expression:"updateService"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Group",hint:"请输入服务group(可选)"},model:{value:e.updateGroup,callback:function(t){e.updateGroup=t},expression:"updateGroup"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Version",hint:"请输入服务version(可选)"},model:{value:e.updateVersion,callback:function(t){e.updateVersion=t},expression:"updateVersion"}})],1)],1),s("v-text-field",{attrs:{label:"重试次数",hint:"请输入一个整数值(如 3 代表在服务调用失败后重试 3 次)"},model:{value:e.updateRetry,callback:function(t){e.updateRetry=t},expression:"updateRetry"}})],1),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{flat:""},nativeOn:{click:function(t){return e.closeUpdateDialog(t)}}},[e._v(e._s(e.$t("close")))]),s("v-btn",{attrs:{depressed:"",color:"primary"},nativeOn:{click:function(t){return e.saveUpdate(t)}}},[e._v(e._s(e.$t("save")))])],1)],1)],1),s("v-dialog",{attrs:{persistent:"","max-width":"290"},model:{value:e.deleteDialog,callback:function(t){e.deleteDialog=t},expression:"deleteDialog"}},[s("v-card",[s("v-card-title",{staticClass:"text-h5"},[e._v(" 您确认删除这条数据嘛? ")]),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{color:"green darken-1",text:""},on:{click:function(t){e.deleteDialog=!1}}},[e._v(" 取消 ")]),s("v-btn",{attrs:{color:"green darken-1",text:""},on:{click:e.confirmDelete}},[e._v(" 确定 ")])],1)],1)],1)],1)],1)},Bs=[],Ns={name:"Retry",components:{Breadcrumb:N},data:()=>({breads:[{text:"trafficManagement",href:""},{text:"trafficRetry",href:""}],typeAhead:[],input:null,searchLoading:!1,timerID:null,service:"",retry:"",group:"",version:"",createGroup:"",createVersion:"",updateService:"",updateRetry:"",updateGroup:"",updateVersion:"",deleteDialog:!1,createService:"",createRetry:"",deleteService:"",deleteRetry:"",deleteVersion:"",deleteGroup:"",dialog:!1,headers:[],tableData:[],services:[],loading:!1,updateDialog:!1}),methods:{submit(){if(!this.service||!this.retry)return this.$notify.error("service is needed"),!1;this.search()},search(){this.$axios.get("/traffic/retry",{params:{service:this.service,retry:this.retry,group:this.group,version:this.version}}).then(e=>{this.tableData=[],e.data.forEach(e=>{this.tableData.push(e)}),console.log(this.tableData)})},saveUpdate(){this.updateDialog=!1,this.$axios.put("/traffic/retry",{service:this.updateService,retry:this.updateRetry,group:this.updateGroup,version:this.updateVersion}).then(e=>{e&&alert("操作成功")})},setHeaders:function(){this.headers=[{text:"应用",value:"service"},{text:"Retry",value:"retry"},{text:"Group",value:"group"},{text:"Version",value:"version"},{text:"操作",value:""}]},closeUpdateDialog(){this.updateDialog=!1},create(){this.dialog=!0},confirmDelete(){console.log(this.deleteRetry),this.$axios.delete("/traffic/retry",{service:this.deleteService,retry:this.deleteRetry,group:this.deleteGroup,version:this.deleteVersion}).then(e=>{e&&alert("操作成功")}),this.deleteRetry=!1},deleteItem(e){this.deleteDialog=!0,this.deleteService=e.service,this.deleteRetry=e.retry,this.deleteGroup=e.group,this.deleteVersion=e.version},update(e){this.updateService=e.service,this.updateRetry=e.retry,this.updateGroup=e.group,this.updateVersion=e.version,this.updateDialog=!0},save(){this.$axios.post("/traffic/retry",{service:this.createService,retry:this.createRetry,group:this.createGroup,version:this.createVersion}).then(e=>{e&&alert("操作成功")}),this.dialog=!1},closeDialog(){this.dialog=!1}},watch:{area(){this.setHeaders()}},mounted(){this.setHeaders()}},Ms=Ns,js=Object(n["a"])(Ms,Os,Bs,!1,null,null,null),Ps=js.exports,qs=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("v-container",{attrs:{"grid-list-xl":"",fluid:""}},[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{lg12:""}},[s("Breadcrumb",{attrs:{title:"trafficTimeout",items:e.breads}})],1),s("v-flex",{attrs:{lg12:""}},[s("v-card",{attrs:{flat:"",color:"transparent"}},[s("v-card-text",[s("v-form",[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-text-field",{attrs:{flat:"",label:"请输入服务名"},model:{value:e.service,callback:function(t){e.service=t},expression:"service"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Version",hint:e.$t("dataIdVersionHint")},model:{value:e.group,callback:function(t){e.group=t},expression:"group"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Group",hint:e.$t("dataIdGroupHint")},model:{value:e.version,callback:function(t){e.version=t},expression:"version"}})],1),s("v-btn",{attrs:{color:"primary",large:""},on:{click:e.submit}},[e._v(e._s(e.$t("search")))]),s("v-btn",{attrs:{color:"primary",large:""},on:{click:e.create}},[e._v("新建")])],1)],1)],1)],1)],1),s("v-flex",{attrs:{xs12:""}},[s("v-card",[s("v-toolbar",{staticClass:"elevation-0",attrs:{flat:"",color:"transparent"}},[s("v-toolbar-title",[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("trafficTimeout")))])]),s("v-spacer")],1),s("v-data-table",{staticClass:"elevation-1",attrs:{headers:e.headers,items:e.tableData,"hide-actions":""},scopedSlots:e._u([{key:"items",fn:function(t){return[s("td",[e._v(e._s(t.item.service))]),s("td",[e._v(e._s(t.item.timeout))]),s("td",[e._v(e._s(t.item.group))]),s("td",[e._v(e._s(t.item.version))]),s("td",{staticClass:"text-xs-center px-0",attrs:{nowrap:""}},[s("v-btn",{staticClass:"tiny",attrs:{color:"success"},on:{click:function(s){return e.update(t.item)}}},[e._v(" 修改 ")]),s("v-btn",{staticClass:"tiny",attrs:{outline:""},on:{click:function(s){return e.deleteItem(t.item)}}},[e._v(" 删除 ")])],1)]}}])})],1)],1),s("v-dialog",{attrs:{width:"800px",persistent:""},model:{value:e.dialog,callback:function(t){e.dialog=t},expression:"dialog"}},[s("v-card",[s("v-card-title",{staticClass:"justify-center"},[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("createTimeoutRule")))])]),s("v-card-text",[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-text-field",{attrs:{label:"服务名",hint:"请输入服务名"},model:{value:e.createService,callback:function(t){e.createService=t},expression:"createService"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"服务分组",hint:"请输入服务group(可选)"},model:{value:e.createGroup,callback:function(t){e.createGroup=t},expression:"createGroup"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"服务版本",hint:"请输入服务version(可选)"},model:{value:e.createVersion,callback:function(t){e.createVersion=t},expression:"createVersion"}})],1)],1),s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-text-field",{attrs:{label:"超时时间",hint:"请输入一个整数值作为超时时间(单位ms)",type:"number"},model:{value:e.createTimeout,callback:function(t){e.createTimeout=t},expression:"createTimeout"}})],1)],1),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{flat:""},nativeOn:{click:function(t){return e.closeDialog(t)}}},[e._v(e._s(e.$t("close")))]),s("v-btn",{attrs:{depressed:"",color:"primary"},nativeOn:{click:function(t){return e.save(t)}}},[e._v(e._s(e.$t("save")))])],1)],1)],1),s("v-dialog",{attrs:{width:"800px",persistent:""},model:{value:e.updateDialog,callback:function(t){e.updateDialog=t},expression:"updateDialog"}},[s("v-card",[s("v-card-title",{staticClass:"justify-center"},[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("createTimeoutRule")))])]),s("v-card-text",[s("v-layout",{attrs:{wrap:""}},[s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-text-field",{attrs:{label:"服务名",hint:"请输入服务名"},model:{value:e.updateService,callback:function(t){e.updateService=t},expression:"updateService"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"服务分组",hint:"请输入服务group(可选)"},model:{value:e.updateGroup,callback:function(t){e.updateGroup=t},expression:"updateGroup"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"服务版本",hint:"请输入服务version(可选)"},model:{value:e.updateVersion,callback:function(t){e.updateVersion=t},expression:"updateVersion"}})],1)],1),s("v-text-field",{attrs:{label:"超时时间",hint:"请输入一个整数值作为超时时间(单位ms)",type:"number"},model:{value:e.updateTimeout,callback:function(t){e.updateTimeout=t},expression:"updateTimeout"}})],1),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{flat:""},nativeOn:{click:function(t){return e.closeUpdateDialog(t)}}},[e._v(e._s(e.$t("close")))]),s("v-btn",{attrs:{depressed:"",color:"primary"},nativeOn:{click:function(t){return e.saveUpdate(t)}}},[e._v(e._s(e.$t("save")))])],1)],1)],1),s("v-dialog",{attrs:{persistent:"","max-width":"290"},model:{value:e.deleteDialog,callback:function(t){e.deleteDialog=t},expression:"deleteDialog"}},[s("v-card",[s("v-card-title",{staticClass:"text-h5"},[e._v(" 您确认删除这条数据嘛? ")]),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{color:"green darken-1",text:""},on:{click:function(t){e.deleteDialog=!1}}},[e._v(" 取消 ")]),s("v-btn",{attrs:{color:"green darken-1",text:""},on:{click:e.confirmDelete}},[e._v(" 确定 ")])],1)],1)],1)],1)],1)},Qs=[],Fs={name:"Timeout",components:{Breadcrumb:N},data:()=>({breads:[{text:"trafficManagement",href:""},{text:"trafficTimeout",href:""}],typeAhead:[],input:null,searchLoading:!1,timerID:null,service:"",timeout:null,group:"",version:"",createGroup:"",createVersion:"",updateService:"",updateTimeout:NaN,updateGroup:"",updateVersion:"",deleteDialog:!1,createService:"",createTimeout:NaN,deleteService:"",deleteTimeout:NaN,deleteVersion:"",deleteGroup:"",dialog:!1,headers:[],tableData:[],services:[],loading:!1,updateDialog:!1}),methods:{submit(){if(!this.service||!this.timeout)return this.$notify.error("service is needed"),!1;this.search()},search(){this.$axios.get("/traffic/timeout",{params:{service:this.service,timeout:parseInt(this.timeout),group:this.group,version:this.version}}).then(e=>{this.tableData=[],e.data.forEach(e=>{this.tableData.push(e)}),console.log(this.tableData)})},saveUpdate(){this.updateDialog=!1,this.$axios.put("/traffic/timeout",{service:this.updateService,timeout:parseInt(this.updateTimeout),group:this.updateGroup,version:this.updateVersion}).then(e=>{e&&alert("操作成功")})},setHeaders:function(){this.headers=[{text:"应用",value:"service"},{text:"Timeout",value:"timeout"},{text:"Group",value:"group"},{text:"Version",value:"version"},{text:"操作",value:""}]},closeUpdateDialog(){this.updateDialog=!1},create(){this.dialog=!0},confirmDelete(){console.log(this.deleteTimeout),this.$axios.delete("/traffic/timeout",{service:this.deleteService,timeout:parseInt(this.deleteTimeout),group:this.deleteGroup,version:this.deleteVersion}).then(e=>{e&&alert("操作成功")}),this.deleteTimeout=!1},deleteItem(e){this.deleteDialog=!0,this.deleteService=e.service,this.deleteTimeout=e.timeout,this.deleteGroup=e.group,this.deleteVersion=e.version},update(e){this.updateService=e.service,this.updateTimeout=e.timeout,this.updateGroup=e.group,this.updateVersion=e.version,this.updateDialog=!0},save(){this.$axios.post("/traffic/timeout",{service:this.createService,timeout:parseInt(this.createTimeout),group:this.createGroup,version:this.createVersion}).then(e=>{e&&alert("操作成功")}),this.dialog=!1},closeDialog(){this.dialog=!1}},watch:{area(){this.setHeaders()}},mounted(){this.setHeaders()}},Ws=Fs,Us=Object(n["a"])(Ws,qs,Qs,!1,null,null,null),Js=Us.exports,zs=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("v-container",{attrs:{"grid-list-xl":"",fluid:""}},[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{lg12:""}},[s("Breadcrumb",{attrs:{title:"trafficWeight",items:e.breads}})],1),s("v-flex",{attrs:{lg12:""}},[s("v-card",{attrs:{flat:"",color:"transparent"}},[s("v-card-text",[s("v-form",[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-combobox",{attrs:{loading:e.searchLoading,items:e.typeAhead,"search-input":e.application,flat:"","append-icon":"","hide-no-data":"",label:"请输入application",hint:"请输入application"},on:{"update:searchInput":function(t){e.application=t},"update:search-input":function(t){e.application=t}}}),s("v-combobox",{staticStyle:{"margin-left":"20px"},attrs:{loading:e.searchLoading,items:e.typeAhead,"search-input":e.accesslog,flat:"","append-icon":"","hide-no-data":"",label:"请输入accesslog",hint:"请输入accesslog"},on:{"update:searchInput":function(t){e.accesslog=t},"update:search-input":function(t){e.accesslog=t}}}),s("v-btn",{attrs:{color:"primary",large:""},on:{click:e.submit}},[e._v("搜索")]),s("v-btn",{attrs:{color:"primary",large:""},on:{click:e.create}},[e._v("新建")])],1)],1)],1)],1)],1),s("v-flex",{attrs:{xs12:""}},[s("v-card",[s("v-toolbar",{staticClass:"elevation-0",attrs:{flat:"",color:"transparent"}},[s("v-toolbar-title",[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("trafficWeight")))])]),s("v-spacer")],1),s("v-data-table",{staticClass:"elevation-1",attrs:{headers:e.headers,items:e.tableData,"hide-actions":""},scopedSlots:e._u([{key:"items",fn:function(t){return[s("td",[e._v(e._s(t.item.application))]),s("td",[e._v(e._s(t.item.accesslog))]),s("td",{staticClass:"text-xs-center px-0",attrs:{nowrap:""}},[s("v-btn",{staticClass:"tiny",attrs:{color:"success"},on:{click:function(s){return e.update(t.item)}}},[e._v(" 修改 ")]),s("v-btn",{staticClass:"tiny",attrs:{outline:""},on:{click:function(s){return e.deleteItem(t.item)}}},[e._v(" 删除 ")]),s("v-btn",{staticClass:"tiny",attrs:{outline:""}},[e._v(" 启用 ")])],1)]}}])})],1)],1),s("v-dialog",{attrs:{width:"800px",persistent:""},model:{value:e.dialog,callback:function(t){e.dialog=t},expression:"dialog"}},[s("v-card",[s("v-card-title",{staticClass:"justify-center"},[s("span",{staticClass:"headline"},[e._v("新增GRAY")])]),s("v-card-text",[s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-select",{staticStyle:{"margin-left":"20px"},attrs:{hint:"请选择key",items:e.keys,label:"Outlined style",outlined:""}})],1),e._l(e.createWeight.match.application.oneof,(function(t,a){return s("v-layout",{key:a,attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-select",{staticStyle:{"margin-left":"20px"},attrs:{items:e.items,label:"Outlined style",outlined:""},model:{value:e.selectedOption[a],callback:function(t){e.$set(e.selectedOption,a,t)},expression:"selectedOption[idx]"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md:""}},[s("v-text-field",{staticStyle:{"margin-left":"20px"},attrs:{label:"value",hint:"请输入匹配的值"},model:{value:t[e.selectedOption[a]],callback:function(s){e.$set(t,e.selectedOption[a],s)},expression:"item[selectedOption[idx]]"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-btn",{staticClass:"tiny",staticStyle:{"margin-left":"20px"},attrs:{color:"success",outline:""},on:{click:function(t){return e.addItem(e.index)}}},[e._v(" 新增一条 ")])],1)],1)}))],2),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{flat:""},nativeOn:{click:function(t){return e.closeDialog(t)}}},[e._v(e._s(e.$t("close")))]),s("v-btn",{attrs:{depressed:"",color:"primary"},nativeOn:{click:function(t){return e.save(t)}}},[e._v(e._s(e.$t("save")))])],1)],1)],1),s("v-dialog",{attrs:{width:"800px",persistent:""},model:{value:e.updateDialog,callback:function(t){e.updateDialog=t},expression:"updateDialog"}},[s("v-card",[s("v-card-title",{staticClass:"justify-center"},[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("createNewRoutingRule")))])]),s("v-card-text",[s("v-layout",{attrs:{wrap:""}},[s("v-flex",[s("v-text-field",{attrs:{label:"Application Name",hint:"请输入Application Name"},model:{value:e.updateApplication,callback:function(t){e.updateApplication=t},expression:"updateApplication"}})],1)],1),s("v-text-field",{attrs:{label:"Accesslog",hint:"请输入Accesslog"},model:{value:e.updateAccesslog,callback:function(t){e.updateAccesslog=t},expression:"updateAccesslog"}})],1),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{flat:""},nativeOn:{click:function(t){return e.closeUpdateDialog(t)}}},[e._v(e._s(e.$t("close")))]),s("v-btn",{attrs:{depressed:"",color:"primary"},nativeOn:{click:function(t){return e.saveUpdate(t)}}},[e._v(e._s(e.$t("save")))])],1)],1)],1),s("v-dialog",{attrs:{persistent:"","max-width":"290"},model:{value:e.deleteDialog,callback:function(t){e.deleteDialog=t},expression:"deleteDialog"}},[s("v-card",[s("v-card-title",{staticClass:"text-h5"},[e._v(" 您确认删除这条数据嘛? ")]),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{color:"green darken-1",text:""},on:{click:function(t){e.deleteDialog=!1}}},[e._v(" 取消 ")]),s("v-btn",{attrs:{color:"green darken-1",text:""},on:{click:e.confirmDelete}},[e._v(" 确定 ")])],1)],1)],1)],1)],1)},Ys=[],Zs={name:"Accesslog",components:{Breadcrumb:N},data:()=>({breads:[{text:"trafficManagement",href:""},{text:"trafficWeight",href:""}],typeAhead:[],input:null,searchLoading:!1,timerID:null,application:"",accesslog:"",items:["empty","exact","noempty","prefix","regex","wildcard"],keys:["application","service","param"],selectedKey:[],deleteDialog:!1,createApplication:"",selectedOption:[],createAccesslog:"",deleteApplication:"",createWeight:{match:{application:{oneof:[{empty:"",exact:"",noempty:"",prefix:"",regex:"",wildcard:""}]},param:[{key:"",value:{empty:"",exact:"",noempty:"",prefix:"",regex:"",wildcard:""}}],service:{oneof:[{empty:"",exact:"",noempty:"",prefix:"",regex:"",wildcard:""}]}},weight:0},deleteAccesslog:"",dialog:!1,headers:[],service:null,tableData:[],services:[],loading:!1,updateDialog:!1,updateApplication:"",updateAccesslog:""}),methods:{submit(){if(!this.accesslog||!this.application)return this.$notify.error("service is needed"),!1;this.search()},search(){this.$axios.get("/traffic/accesslog",{params:{application:this.application,accesslog:this.accesslog}}).then(e=>{console.log(e),this.tableData=[],e.data.forEach(e=>{this.tableData.push(e)}),console.log(this.tableData)})},saveUpdate(){console.log(this.updateAccesslog),this.updateDialog=!1,this.$axios.put("/traffic/accesslog",{application:this.updateApplication,accesslog:this.updateAccesslog}).then(e=>{e&&alert("操作成功")})},setHeaders:function(){this.headers=[{text:"服务",value:"application"},{text:"accesslog",value:"accesslog"}]},closeUpdateDialog(){this.updateDialog=!1},create(){this.dialog=!0},confirmDelete(){console.log(this.deleteAccesslog),this.$axios.delete("/traffic/accesslog",{application:this.deleteApplication,accesslog:this.deleteAccesslog}).then(e=>{e&&alert("操作成功")}),this.deleteAccesslog=!1},deleteItem(e){this.deleteDialog=!0,this.deleteAccesslog=e.accesslog,this.deleteApplication=e.application},update(e){console.log(e),this.updateApplication=e.application,this.updateAccesslog=e.accesslog,this.updateDialog=!0,console.log(this.updateApplication),console.log(this.updateAccesslog)},save(){this.$axios.post("/traffic/accesslog",{application:this.createApplication,accesslog:this.createAccesslog}).then(e=>{e&&alert("操作成功")})},closeDialog(){this.dialog=!1}},watch:{area(){this.setHeaders()}},mounted(){this.setHeaders()}},Xs=Zs,Ks=Object(n["a"])(Xs,zs,Ys,!1,null,null,null),ea=Ks.exports,ta=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("v-app",{attrs:{dark:e.dark}},[s("drawer"),s("toolbar"),s("v-content",[s("router-view")],1),s("footers")],1)},sa=[],aa=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("v-navigation-drawer",{attrs:{id:"appDrawer","mini-variant":e.mini,fixed:"",dark:e.$vuetify.dark,app:""},on:{"update:miniVariant":function(t){e.mini=t},"update:mini-variant":function(t){e.mini=t}},model:{value:e.drawer,callback:function(t){e.drawer=t},expression:"drawer"}},[a("v-toolbar",{attrs:{color:"primary darken-1",dark:""}},[a("img",{attrs:{src:s("cf05"),width:"24",height:"24"}}),a("v-toolbar-title",{staticClass:"ml-0 pl-3"},[a("span",{staticClass:"hidden-sm-and-down white--text"},[e._v(e._s(e.$store.state.appTitle))]),a("v-chip",{staticClass:"v-chip--x-small",attrs:{color:"green",disabled:"","text-color":"white",label:""}},[e._v(" "+e._s(e.config.version)+" ")])],1)],1),a("v-list",{attrs:{expand:""}},[e._l(e.menus,(function(t,s){return[t.items?a("v-list-group",{attrs:{group:t.group,"prepend-icon":t.icon,"no-action":""}},[a("v-list-tile",{attrs:{slot:"activator",ripple:""},slot:"activator"},[a("v-list-tile-content",[a("v-list-tile-title",[e._v(e._s(e.$t(t.title)))])],1)],1),e._l(t.items,(function(t,s){return[a("v-list-tile",{attrs:{to:t.path,ripple:""}},[a("v-list-tile-content",[a("v-list-tile-title",[e._v(e._s(e.$t(t.title)))])],1),t.badge?a("v-chip",{staticClass:"v-chip--x-small",attrs:{color:"primary",disabled:"","text-color":"white"}},[e._v(" "+e._s(t.badge)+" ")]):e._e()],1)]}))],2):a("v-list-tile",{key:t.title,attrs:{to:t.path,ripple:""}},[a("v-list-tile-action",[a("v-icon",[e._v(e._s(t.icon))])],1),a("v-list-tile-content",[e._v(e._s(e.$t(t.title)))]),t.badge?a("v-chip",{staticClass:"v-chip--x-small",attrs:{color:"primary",disabled:"","text-color":"white"}},[e._v(" "+e._s(t.badge)+" ")]):e._e()],1)]}))],2)],1)},ia=[];const ra=[{title:"homePage",path:"/",icon:"home"},{title:"serviceSearch",path:"/service",icon:"search"},{title:"trafficManagement",icon:"show_chart",group:"traffic",items:[{title:"trafficTimeout",path:"/traffic/timeout"},{title:"trafficRetry",path:"/traffic/retry"},{title:"trafficRegion",path:"/traffic/region"},{title:"trafficArguments",path:"/traffic/arguments"},{title:"trafficMock",path:"/traffic/mock"},{title:"trafficAccesslog",path:"/traffic/accesslog"},{title:"routingRule",path:"/governance/routingRule"},{title:"tagRule",path:"/governance/tagRule"},{title:"dynamicConfig",path:"/governance/config"}]},{title:"serviceManagement",group:"services",icon:"build",items:[{title:"serviceTest",path:"/test"},{title:"serviceMock",path:"/mock/rule"}]},{title:"serviceMetrics",path:"/metrics/index",icon:"show_chart"},{title:"kubernetes",path:"/kubernetes",icon:"cloud"}];var oa=ra,la=s("bc3a"),na=s.n(la),ca={name:"drawer",data:()=>({mini:!1,drawer:!0,menus:oa,config:{}}),created(){window.getApp.$on("DRAWER_TOGGLED",()=>{this.drawer=!this.drawer}),na.a.get("/dubbo-admin-info.json").then(e=>{this.config=e.data})},computed:{sideToolbarColor(){return this.$vuetify.options.extra.sideNav}}},da=ca,ua=(s("1fc0"),Object(n["a"])(da,aa,ia,!1,null,null,null)),pa=ua.exports,ha=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("v-toolbar",{attrs:{color:"primary",fixed:"",dark:"",app:""}},[a("v-toolbar-side-icon",{on:{click:function(t){return t.stopPropagation(),e.handleDrawerToggle(t)}}}),a("v-text-field",{staticClass:"hidden-sm-and-down",attrs:{flat:"","hide-details":"","solo-inverted":"","prepend-inner-icon":"search",label:e.$t("serviceSearch")},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.submit(t)}},model:{value:e.global,callback:function(t){e.global=t},expression:"global"}}),a("v-spacer"),e._e(),a("v-btn",{attrs:{icon:""},on:{click:function(t){return e.handleFullScreen()}}},[a("v-icon",[e._v("fullscreen")])],1),a("v-menu",{attrs:{attach:"",bottom:"",left:"","offset-y":"","max-height":"500"}},[a("v-btn",{staticStyle:{"mini-width":"48px"},attrs:{slot:"activator",flat:""},slot:"activator"},[e._v(" "+e._s(e.selectedLang)+" ")]),a("v-list",{staticClass:"pa-0"},e._l(e.lang,(function(t,s){return a("v-list-tile",{key:s,on:{click:function(t){return e.change(s)}}},[a("v-list-tile-content",[a("v-list-tile-title",[e._v(e._s(t))])],1)],1)})),1)],1),e._e(),a("v-menu",{attrs:{"offset-y":"",origin:"center center","nudge-bottom":10,transition:"scale-transition"}},[a("v-btn",{attrs:{slot:"activator",icon:"",large:"",flat:""},slot:"activator"},[a("v-avatar",{attrs:{size:"30px"}},[a("img",{attrs:{src:s("1195"),alt:"Logined User"}})])],1),a("v-list",{staticClass:"pa-0"},e._l(e.items,(function(t,s){return a("v-list-tile",{key:s,attrs:{to:t.href?null:{name:t.name},href:t.href,ripple:"ripple",disabled:t.disabled,target:t.target,rel:"noopener"},on:{click:t.click}},[t.icon?a("v-list-tile-action",[a("v-icon",[e._v(e._s(t.icon))])],1):e._e(),a("v-list-tile-content",[a("v-list-tile-title",[e._v(e._s(t.title))])],1)],1)})),1)],1)],1)},va=[],ma={name:"toolbar",data:()=>({selectedLang:"",global:"",lang:["简体中文","English"],items:[{icon:"account_circle",href:"#",title:"Profile",click:e=>{console.log(e)}},{icon:"fullscreen_exit",href:"#",title:"Logout",click:e=>{window.getApp.$emit("APP_LOGOUT")}}]}),methods:{submit(){window.location.href.includes("#/service")?(window.location.href="#/service?filter="+this.global+"&pattern=service",window.location.reload()):window.location.href="#/service?filter="+this.global+"&pattern=service",this.global=""},handleDrawerToggle(){window.getApp.$emit("DRAWER_TOGGLED")},change(e){this.selectedLang=this.lang[e],this.$i18n.locale=0===e?"zh":"en",this.$store.dispatch("changeArea",{area:this.$i18n.locale}),window.localStorage.setItem("locale",this.$i18n.locale),window.localStorage.setItem("selectedLang",this.selectedLang)},handleTheme(){window.getApp.$emit("CHANGE_THEME")},handleFullScreen(){W.toggleFullScreen()}},mounted:function(){"zh"===this.$i18n.locale?this.selectedLang="简体中文":this.selectedLang="English";const e=localStorage.getItem("username");e&&(this.items[0].title=this.$t("userName")+":"+e)}},fa=ma,ga=Object(n["a"])(fa,ha,va,!1,null,null,null),xa=ga.exports,ba=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("v-footer",{staticClass:"pa-3 footer-border-top",attrs:{inset:"",height:"auto"}},[s("v-spacer"),s("span",{staticClass:"caption mr-1"},[s("strong",[e._v("Copyright")]),e._v(" ©2018-2022 "),s("strong",[e._v("The Apache Software Foundation.")])])],1)},ya=[],_a={name:"footers"},ka=_a,wa=(s("33c4"),Object(n["a"])(ka,ba,ya,!1,null,null,null)),$a=wa.exports,Ia={name:"Index",components:{Drawer:pa,Toolbar:xa,Footers:$a},data(){return{dark:!1}},created(){window.getApp=this,window.getApp.$on("APP_LOGOUT",()=>{console.log("logout"),window.getApp.$axios.delete("/user/logout").then(e=>{200===e.status&&e.data&&(localStorage.removeItem("token"),localStorage.removeItem("username"),window.getApp.$router.replace("/login"))})})}},Da=Ia,Sa=Object(n["a"])(Da,ta,sa,!1,null,"2e81d7c0",null),Ca=Sa.exports,Aa=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("v-app",{attrs:{id:"inspire"}},[s("v-content",[s("v-container",{attrs:{fluid:"","fill-height":""}},[s("v-layout",{attrs:{"align-center":"","justify-center":""}},[s("v-flex",{attrs:{xs12:"",sm8:"",md4:""}},[s("v-card",{staticClass:"elevation-12"},[s("v-toolbar",{attrs:{dark:"",color:"primary"}},[s("v-spacer")],1),s("v-card-text",[s("v-form",{attrs:{action:"login"}},[s("v-text-field",{attrs:{required:"",name:"username","append-icon":"person",label:e.$t("userName"),type:"text"},model:{value:e.userName,callback:function(t){e.userName=t},expression:"userName"}}),s("v-text-field",{staticClass:"input-group--focused",attrs:{name:"input-10-2",label:e.$t("password"),"append-icon":e.e2?"visibility":"visibility_off","append-icon-cb":function(){return e.e2=!e.e2},type:e.e2?"password":"text"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.login(t)}},model:{value:e.password,callback:function(t){e.password=t},expression:"password"}}),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{color:"primary"},on:{click:e.login}},[e._v(e._s(e.$t("login"))),s("v-icon",[e._v("send")])],1),s("v-spacer")],1)],1)],1)],1)],1)],1)],1)],1),s("footers")],1)},Ra=[],Ea={name:"Login",data:()=>({userName:"",password:"",e2:!0}),components:{Footers:$a},methods:{login:function(){const e=this.userName,t=this.password,s=this;this.$axios.get("/user/login",{params:{userName:e,password:t}}).then(t=>{if(200===t.status&&t.data){localStorage.setItem("token",t.data),localStorage.setItem("username",e);const s=this.$route.query.redirect;s?this.$router.replace(s):this.$router.replace("/")}else s.$notify("Username or password error,please try again")})}}},Ta=Ea,La=Object(n["a"])(Ta,Aa,Ra,!1,null,"faf5dbb0",null),Va=La.exports;const Ha=u["a"].prototype.push;u["a"].prototype.push=function(e){return Ha.call(this,e).catch(e=>e)},a["default"].use(u["a"]);var Ga=new u["a"]({routes:[{path:"/",name:"Index",component:Ca,children:[{path:"/service",name:"ServiceSearch",component:g},{path:"/serviceDetail",name:"ServiceDetail",component:w},{path:"/testMethod",name:"TestMethod",component:Y},{path:"/governance/routingRule",name:"RoutingRule",component:ve},{path:"/governance/tagRule",name:"TagRule",component:ye},{path:"/governance/meshRule",name:"MeshRule",component:De},{path:"/governance/access",name:"AccessControl",component:Te},{path:"/governance/loadbalance",name:"LoadBalance",component:Be},{path:"/governance/weight",name:"WeightAdjust",component:Qe},{path:"/governance/config",name:"Overrides",component:Ye},{path:"/test",name:"ServiceTest",component:st},{path:"/mock/rule",name:"ServiceMock",component:Gt,meta:{requireLogin:!1}},{path:"/metrics/index",name:"ServiceMetrics",component:Pt,meta:{requireLogin:!1}},{path:"/metrics/relation",name:"ServiceRelation",component:Jt,meta:{requireLogin:!1}},{path:"/management",name:"Management",component:os,meta:{requireLogin:!1}},{path:"/apiDocs",name:"apiDocs",component:Rt,meta:{requireLogin:!1}},{path:"/traffic/accesslog",name:"accesslog",component:ps,meta:{requireLogin:!1}},{path:"/traffic/retry",name:"retry",component:Ps,meta:{requireLogin:!1}},{path:"/traffic/region",name:"region",component:Gs,meta:{requireLogin:!1}},{path:"/traffic/weight",name:"weight",component:ea,meta:{requireLogin:!1}},{path:"/traffic/arguments",name:"arguments",component:xs,meta:{requireLogin:!1}},{path:"/traffic/mock",name:"mock",component:Rs,meta:{requireLogin:!1}},{path:"/traffic/timeout",name:"timeout",component:Js,meta:{requireLogin:!1}},{path:"/traffic/gray",name:"gray",component:$s,meta:{requireLogin:!1}}]},{path:"/login",name:"Login",component:Va,meta:{requireLogin:!1}}]}),Oa=s("ce5b"),Ba=s.n(Oa),Na=(s("bf40"),s("2f62"));a["default"].use(Na["a"]);const Ma=new Na["a"].Store({state:{appTitle:"Dubbo Admin",area:null,serviceItems:null,appItems:null,consumerItems:null},mutations:{setArea(e,t){e.area=t},setServiceItems(e,t){e.serviceItems=t},setAppItems(e,t){e.appItems=t},setConsumerItems(e,t){e.consumerItems=t}},actions:{changeArea({commit:e},t){e("setArea",t)},loadServiceItems({commit:e}){a["default"].prototype.$axios.get("/services").then(t=>{if(200===t.status){const s=t.data;e("setServiceItems",s)}})},loadAppItems({commit:e}){a["default"].prototype.$axios.get("/applications").then(t=>{if(200===t.status){const s=t.data;e("setAppItems",s)}})},loadInstanceAppItems({commit:e}){a["default"].prototype.$axios.get("/applications/instance").then(t=>{if(200===t.status){const s=t.data;e("setAppItems",s)}})},loadConsumerItems({commit:e}){a["default"].prototype.$axios.get("/consumers").then(t=>{if(200===t.status){const s=t.data;e("setConsumerItems",s)}})}},getters:{getServiceItems:e=>t=>e.serviceItems.filter(e=>(e||"").toLowerCase().indexOf((t||"").toLowerCase())>-1),getAppItems:e=>t=>e.appItems.filter(e=>(e||"").toLowerCase().indexOf((t||"").toLowerCase())>-1),getConsumerItems:e=>t=>e.consumerItems.filter(e=>(e||"").toLowerCase().indexOf((t||"").toLowerCase())>-1)}});var ja=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("v-snackbar",{attrs:{color:e.color},model:{value:e.show,callback:function(t){e.show=t},expression:"show"}},[e._v(" "+e._s(e.text)+" "),s("v-btn",{attrs:{dark:"",flat:""},on:{click:function(t){e.show=!1}}},[e._v(" Close ")])],1)},Pa=[],qa={data(){return{show:!1,color:"",text:""}}},Qa=qa,Fa=Object(n["a"])(Qa,ja,Pa,!1,null,null,null),Wa=Fa.exports;const Ua={install:function(e){const t=e.extend(Wa),s=new t,a=s.$mount();document.querySelector("body").appendChild(a.$el),e.prototype.$notify=(e,t)=>{s.text=e,s.color=t,s.show=!0},e.prototype.$notify.error=e=>{s.text=e,s.color="error",s.show=!0},e.prototype.$notify.success=e=>{s.text=e,s.color="success",s.show=!0},e.prototype.$notify.info=e=>{s.text=e,s.color="info",s.show=!0}}};var Ja=Ua,za=s("4959"),Ya=s.n(za),Za=s("a925"),Xa={service:"Service",serviceSearch:"Search Service",serviceGovernance:"Routing Rule",trafficManagement:"Traffic Management",routingRule:"Condition Rule",tagRule:"Tag Rule",meshRule:"Mesh Rule",dynamicConfig:"Dynamic Config",accessControl:"Black White List",weightAdjust:"Weight Adjust",loadBalance:"Load Balance",serviceTest:"Service Test",serviceMock:"Service Mock",serviceMetrics:"Service Metrics",serviceRelation:"Service Relation",metrics:"Metrics",relation:"Relation",group:"Group",serviceInfo:"Service Info",providers:"Providers",consumers:"Consumers",version:"Version",app:"Application",ip:"IP",qps:"qps",rt:"rt",successRate:"success rate",port:"PORT",timeout:"timeout(ms)",serialization:"serialization",appName:"Application Name",serviceName:"Service Name",registrySource:"Registry Source",instanceRegistry:"Instance Registry",interfaceRegistry:"Interface Registry",allRegistry:"Instance / Interface Registry",operation:"Operation",searchResult:"Search Result",search:"Search",methodName:"Method Name",enabled:"Enabled",disabled:"Disabled",method:"Method",weight:"Weight",create:"CREATE",save:"SAVE",cancel:"CANCEL",close:"CLOSE",confirm:"CONFIRM",ruleContent:"RULE CONTENT",createNewRoutingRule:"Create New Routing Rule",createNewTagRule:"Create New Tag Rule",createNewMeshRule:"Create New Mesh Rule",createNewDynamicConfigRule:"Create New Dynamic Config Rule",createNewWeightRule:"Create New Weight Rule",createNewLoadBalanceRule:"Create new load balancing rule",createTimeoutRule:"Create timeout rule",createRetryRule:"Create timeout rule",createRegionRule:"Create retry rule",createArgumentRule:"Create argument routing rule",createMockCircuitRule:"Create mock (circuit breaking) rule",createAccesslogRule:"Create accesslog rule",createGrayRule:"Create gray rule",createWeightRule:"Create weighting rule",serviceIdHint:"Service ID",view:"View",edit:"Edit",delete:"Delete",searchRoutingRule:"Search Routing Rule",searchAccess:"Search Access Rule",searchWeightRule:"Search Weight Adjust Rule",dataIdClassHint:"Complete package path of service interface class",dataIdVersionHint:"The version of the service interface, which can be filled in according to the actual situation of the interface",dataIdGroupHint:"The group of the service interface, which can be filled in according to the actual situation of the interface",agree:"Agree",disagree:"Disagree",searchDynamicConfig:"Search Dynamic Config",appNameHint:"Application name the service belongs to",basicInfo:"BasicInfo",metaData:"MetaData",methodMetrics:"Method Statistics",searchDubboService:"Search Dubbo Services or applications",serviceSearchHint:"Service ID, org.apache.dubbo.demo.api.DemoService, * for all services",ipSearchHint:"Find all services provided by the target server on the specified IP address",appSearchHint:"Input an application name to find all services provided by one particular application, * for all",searchTagRule:"Search Tag Rule by application name",searchMeshRule:"Search Mesh Rule by application name",searchSingleMetrics:"Search Metrics by IP",searchBalanceRule:"Search Balancing Rule",noMetadataHint:"There is no metadata available, please update to Dubbo2.7, or check your config center configuration in application.properties, please check ",parameterList:"parameterList",returnType:"returnType",here:"here",configAddress:"https://github.com/apache/incubator-dubbo-admin/wiki/Dubbo-Admin-configuration",whiteList:"White List",whiteListHint:"White list IP address, divided by comma: 1.1.1.1,2.2.2.2",blackList:"Black List",blackListHint:"Black list IP address, divided by comma: 3.3.3.3,4.4.4.4",address:"Address",weightAddressHint:"IP addresses to set this weight, divided by comma: 1.1.1.1,2.2.2.2",weightHint:"weight value, default is 100",methodHint:"choose method of load balancing, * for all methods",strategy:"Strategy",balanceStrategyHint:"load balancing strategy",goIndex:"Go To Index",releaseLater:"will release later",later:{metrics:"Metrics will release later",serviceTest:"Service Test will release later",serviceMock:"Service Mock will release later"},by:"by ",$vuetify:{dataIterator:{rowsPerPageText:"Items per page:",rowsPerPageAll:"All",pageText:"{0}-{1} of {2}",noResultsText:"No matching records found",nextPage:"Next page",prevPage:"Previous page"},dataTable:{rowsPerPageText:"Rows per page:"},noDataText:"No data available"},configManage:"Configuration Management",configCenterAddress:"ConfigCenter Address",searchDubboConfig:"Search Dubbo Config",createNewDubboConfig:"Create New Dubbo Config",scope:"Scope",name:"Name",warnDeleteConfig:" Are you sure to Delete Dubbo Config: ",warnDeleteRouteRule:"Are you sure to Delete routing rule",warnDeleteDynamicConfig:"Are you sure to Delete dynamic config",warnDeleteBalancing:"Are you sure to Delete load balancing",warnDeleteAccessControl:"Are you sure to Delete access control",warnDeleteTagRule:"Are you sure to Delete tag rule",warnDeleteMeshRule:"Are you sure to Delete mesh rule",warnDeleteWeightAdjust:"Are you sure to Delete weight adjust",configNameHint:"Application name the config belongs to, use 'global'(without quotes) for global config",configContent:"Config Content",testMethod:"Test Method",execute:"EXECUTE",result:"Result: ",success:"SUCCESS",fail:"FAIL",detail:"Detail",more:"More",copyUrl:"Copy URL",copy:"Copy",url:"URL",copySuccessfully:"Copied",test:"Test",placeholders:{searchService:"Search by service name"},methods:"Methods",testModule:{searchServiceHint:"Entire service ID, org.apache.dubbo.demo.api.DemoService, press Enter to search"},userName:"User Name",password:"Password",login:"Login",apiDocs:"API Docs",apiDocsRes:{dubboProviderIP:"Dubbo Provider Ip",dubboProviderPort:"Dubbo Provider Port",loadApiList:"Load Api List",apiListText:"Api List",apiForm:{missingInterfaceInfo:"Missing interface information",getApiInfoErr:"Exception in obtaining interface information",api404Err:"Interface name is incorrect, interface parameters and response information are not found",apiRespDecShowLabel:"Response Description",apiNameShowLabel:"Api Name",apiPathShowLabel:"Api Path",apiMethodParamInfoLabel:"Api method parameters",apiVersionShowLabel:"Api Version",apiGroupShowLabel:"Api Group",apiDescriptionShowLabel:"Api Description",isAsyncFormLabel:"Whether to call asynchronously (this parameter cannot be modified, according to whether to display asynchronously defined by the interface)",apiModuleFormLabel:"Api module (this parameter cannot be modified)",apiFunctionNameFormLabel:"Api function name(this parameter cannot be modified)",registryCenterUrlFormLabel:"Registry address. If it is empty, Dubbo provider IP and port will be used for direct connection",paramNameLabel:"Parameter name",paramPathLabel:"Parameter path",paramDescriptionLabel:"Description",paramRequiredLabel:"This parameter is required",doTestBtn:"Do Test",responseLabel:"Response",responseExampleLabel:"Response Example",apiResponseLabel:"Api Response",LoadingLabel:"Loading...",requireTip:"There are required items not filled in",requireItemTip:"This field is required",requestApiErrorTip:"There is an exception in the request interface. Please check the submitted data, especially the JSON class data and the enumeration part",unsupportedHtmlTypeTip:"Temporarily unsupported form type",none:"none"}},authFailed:"Authorized failed,please login.",ruleList:"Rule List",mockRule:"Mock Rule",mockData:"Mock Data",globalDisable:"Global Disable",globalEnable:"Global Enable",saveRuleSuccess:"Save Rule Successfully",deleteRuleSuccess:"Delete Rule Successfully",disableRuleSuccess:"Disable Rule Successfully",enableRuleSuccess:"Enable Rule Successfully",methodNameHint:"The method name of Service",createMockRule:"Create Mock Rule",editMockRule:"Edit Mock Rule",deleteRuleTitle:"Are you sure to delete this mock rule?",trafficTimeout:"Timeout",trafficRetry:"Retry",trafficRegion:"Region Aware",trafficIsolation:"Isolation",trafficWeight:"Weight Percentage",trafficArguments:"Arg Routing",trafficMock:"Mock",trafficAccesslog:"Accesslog",trafficHost:"Host",homePage:"Cluster Overview",serviceManagement:"Dev & Test"},Ka={service:"服务",serviceSearch:"服务查询",serviceGovernance:"路由规则",trafficManagement:"流量管控",serviceMetrics:"服务统计",serviceRelation:"服务关系",routingRule:"条件路由",tagRule:"标签路由",meshRule:"Mesh路由",dynamicConfig:"动态配置",accessControl:"黑白名单",weightAdjust:"权重调整",loadBalance:"负载均衡",serviceTest:"服务测试",serviceMock:"服务Mock",providers:"提供者",consumers:"消费者",metrics:"统计",relation:"关系",group:"组",version:"版本",app:"应用",ip:"IP地址",qps:"qps",rt:"rt",successRate:"成功率",serviceInfo:"服务信息",port:"端口",timeout:"超时(毫秒)",serialization:"序列化",appName:"应用名",serviceName:"服务名",registrySource:"注册来源",instanceRegistry:"应用级",interfaceRegistry:"接口级",allRegistry:"应用级/接口级",operation:"操作",searchResult:"查询结果",search:"搜索",methodName:"方法名",enabled:"开启",disabled:"禁用",method:"方法",weight:"权重",create:"创建",save:"保存",cancel:"取消",close:"关闭",confirm:"确认",ruleContent:"规则内容",createNewRoutingRule:"创建新路由规则",createNewTagRule:"创建新标签规则",createMeshTagRule:"创建新mesh规则",createNewDynamicConfigRule:"创建新动态配置规则",createNewWeightRule:"新建权重规则",createNewLoadBalanceRule:"新建负载均衡规则",createTimeoutRule:"创建超时时间规则",createRetryRule:"创建重试规则",createRegionRule:"创建同区域优先规则",createArgumentRule:"创建参数路由规则",createMockCircuitRule:"创建调用降级规则",createAccesslogRule:"创建访问日志规则",createGrayRule:"创建灰度隔离规则",createWeightRule:"创建权重比例规则",serviceIdHint:"服务名",view:"查看",edit:"编辑",delete:"删除",searchRoutingRule:"搜索路由规则",searchAccessRule:"搜索黑白名单",searchWeightRule:"搜索权重调整规则",dataIdClassHint:"服务接口的类完整包路径",dataIdVersionHint:"服务接口的Version,根据接口实际情况选填",dataIdGroupHint:"服务接口的Group,根据接口实际情况选填",agree:"同意",disagree:"不同意",searchDynamicConfig:"搜索动态配置",appNameHint:"服务所属的应用名称",basicInfo:"基础信息",metaData:"元数据",methodMetrics:"服务方法统计",searchDubboService:"搜索Dubbo服务或应用",serviceSearchHint:"服务ID, org.apache.dubbo.demo.api.DemoService, * 代表所有服务",ipSearchHint:"在指定的IP地址上查找目标服务器提供的所有服务",appSearchHint:"输入应用名称以查找由一个特定应用提供的所有服务, * 代表所有",searchTagRule:"根据应用名搜索标签规则",searchMeshRule:"根据应用名搜索mesh规则",searchSingleMetrics:"输入IP搜索Metrics信息",searchBalanceRule:"搜索负载均衡规则",parameterList:"参数列表",returnType:"返回值",noMetadataHint:"无元数据信息,请升级至Dubbo2.7及以上版本,或者查看application.properties中关于config center的配置,详见",here:"这里",configAddress:"https://github.com/apache/incubator-dubbo-admin/wiki/Dubbo-Admin%E9%85%8D%E7%BD%AE%E8%AF%B4%E6%98%8E",whiteList:"白名单",whiteListHint:"白名单IP列表, 多个地址用逗号分隔: 1.1.1.1,2.2.2.2",blackList:"黑名单",blackListHint:"黑名单IP列表, 多个地址用逗号分隔: 3.3.3.3,4.4.4.4",address:"地址列表",weightAddressHint:"此权重设置的IP地址,用逗号分隔: 1.1.1.1,2.2.2.2",weightHint:"权重值,默认100",methodHint:"负载均衡生效的方法,*代表所有方法",strategy:"策略",balanceStrategyHint:"负载均衡策略",goIndex:"返回首页",releaseLater:"在后续版本中发布,敬请期待",later:{metrics:"Metrics会在后续版本中发布,敬请期待",serviceTest:"服务测试会在后续版本中发布,敬请期待",serviceMock:"服务Mock会在后续版本中发布,敬请期待"},by:"按",$vuetify:{dataIterator:{rowsPerPageText:"每页记录数:",rowsPerPageAll:"全部",pageText:"{0}-{1} 共 {2} 条",noResultsText:"没有找到匹配记录",nextPage:"下一页",prevPage:"上一页"},dataTable:{rowsPerPageText:"每页行数:"},noDataText:"无可用数据"},configManage:"配置管理",configCenterAddress:"配置中心地址",searchDubboConfig:"搜索Dubbo配置",createNewDubboConfig:"新建Dubbo配置",scope:"范围",name:"名称",warnDeleteConfig:" 是否要删除Dubbo配置: ",warnDeleteRouteRule:"是否要删除路由规则",warnDeleteDynamicConfig:"是否要删除动态配置",warnDeleteBalancing:"是否要删除负载均衡规则",warnDeleteAccessControl:"是否要删除黑白名单",warnDeleteTagRule:"是否要删除标签路由",warnDeleteMeshRule:"是否要删除mesh路由",warnDeleteWeightAdjust:"是否要删除权重规则",configNameHint:"配置所属的应用名, global 表示全局配置",configContent:"配置内容",testMethod:"测试方法",execute:"执行",result:"结果: ",success:" 成功",fail:"失败",detail:"详情",more:"更多",copyUrl:"复制 URL",copy:"复制",url:"URL",copySuccessfully:"已复制",test:"测试",placeholders:{searchService:"通过服务名搜索服务"},methods:"方法列表",testModule:{searchServiceHint:"完整服务ID, org.apache.dubbo.demo.api.DemoService, 按回车键查询"},userName:"用户名",password:"密码",login:"登录",apiDocs:"接口文档",apiDocsRes:{dubboProviderIP:"Dubbo 提供者Ip",dubboProviderPort:"Dubbo 提供者端口",loadApiList:"加载接口列表",apiListText:"接口列表",apiForm:{missingInterfaceInfo:"缺少接口信息",getApiInfoErr:"获取接口信息异常",api404Err:"接口名称不正确,没有查找到接口参数和响应信息",apiRespDecShowLabel:"响应说明",apiNameShowLabel:"接口名称",apiPathShowLabel:"接口位置",apiMethodParamInfoLabel:"接口参数",apiVersionShowLabel:"接口版本",apiGroupShowLabel:"接口分组",apiDescriptionShowLabel:"接口说明",isAsyncFormLabel:"是否异步调用(此参数不可修改,根据接口定义的是否异步显示)",apiModuleFormLabel:"接口模块(此参数不可修改)",apiFunctionNameFormLabel:"接口方法名(此参数不可修改)",registryCenterUrlFormLabel:"注册中心地址, 如果为空将使用Dubbo 提供者Ip和端口进行直连",paramNameLabel:"参数名",paramPathLabel:"参数位置",paramDescriptionLabel:"说明",paramRequiredLabel:"该参数为必填",doTestBtn:"测试",responseLabel:"响应",responseExampleLabel:"响应示例",apiResponseLabel:"接口响应",LoadingLabel:"加载中...",requireTip:"有未填写的必填项",requireItemTip:"该项为必填!",requestApiErrorTip:"请求接口发生异常,请检查提交的数据,特别是JSON类数据和其中的枚举部分",unsupportedHtmlTypeTip:"暂不支持的表单类型",none:"无"}},authFailed:"权限验证失败",ruleList:"规则列表",mockRule:"规则配置",mockData:"模拟数据",globalDisable:"全局禁用",globalEnable:"全局启用",saveRuleSuccess:"保存规则成功",deleteRuleSuccess:"删除成功",disableRuleSuccess:"禁用成功",enableRuleSuccess:"启用成功",methodNameHint:"服务方法名",createMockRule:"创建规则",editMockRule:"修改规则",deleteRuleTitle:"确定要删除此服务Mock规则吗?",trafficTimeout:"超时时间",trafficRetry:"调用重试",trafficRegion:"同区域优先",trafficIsolation:"环境隔离",trafficWeight:"权重比例",trafficArguments:"参数路由",trafficMock:"调用降级",trafficAccesslog:"访问日志",trafficHost:"固定机器导流",trafficGray:"流量灰度",homePage:"集群概览",serviceManagement:"开发测试",groupInputPrompt:"请输入服务group(可选)",versionInputPrompt:"请输入服务version(可选)"};a["default"].use(Za["a"]);const ei={en:{...Xa},zh:{...Ka}},ti=window.localStorage.getItem("locale"),si=window.localStorage.getItem("selectedLang");var ai=new Za["a"]({locale:null===ti?"zh":ti,selectedLang:null===si?"简体中文":si,messages:ei});const ii=na.a.create({baseURL:"/api/dev"});ii.interceptors.request.use(e=>{const t=localStorage.getItem("token");return t&&(e.headers.Authorization=t),e}),ii.interceptors.response.use(e=>e,e=>{if(e.message.indexOf("Network Error")>=0)a["default"].prototype.$notify.error("Network error, please check your network settings!");else if(e.response.status===Ya.a.UNAUTHORIZED){localStorage.removeItem("token"),localStorage.removeItem("username"),a["default"].prototype.$notify.error(ai.t("authFailed"));const e=location.href.split("#");if(e.length>1&&e[1].startsWith("/login"))return;Ga.push({path:"/login",query:{redirect:1===e.length?"/":e[1]}})}else e.response.status>=Ya.a.BAD_REQUEST&&a["default"].prototype.$notify.error(e.response.data.message)});const ri=ii;var oi=s("9ca8"),li=(s("ef97"),s("007d"),s("627c"),s("4eb5")),ni=s.n(li);s("9454");a["default"].use(Ba.a,{lang:{t:(e,...t)=>ai.t(e,t)}}),a["default"].use(Ja),a["default"].prototype.$axios=ri,a["default"].config.productionTip=!1,ni.a.config.autoSetContainer=!0,a["default"].use(ni.a),a["default"].component("chart",oi["a"]),Ga.beforeEach((e,t,s)=>{e.matched.some(e=>e.meta.requireLogin)?localStorage.getItem("token")?s():s({path:"/login",query:{redirect:e.fullPath}}):s()}),new a["default"]({router:Ga,store:Ma,i18n:ai,render:e=>e(d)}).$mount("#app")},"5a4f":function(e,t,s){},"758d":function(e,t,s){},"77b6":function(e,t,s){"use strict";var a=s("e337"),i=s.n(a);i.a},"8b76":function(e,t,s){"use strict";var a=s("3be4"),i=s.n(a);i.a},9454:function(e,t,s){const a=s("96eb"),i=a.Random;console.log(i),a.mock("/mock/user/list","get",{code:200,message:"成功",data:{"list|10":[{"id|+1":1,"age|18-40":20,"sex|1":["男","女"],name:"@cname",email:"@email",isShow:"@boolean"}]}})},a237:function(e,t,s){"use strict";var a=s("3a50"),i=s.n(a);i.a},c5e5:function(e,t,s){"use strict";var a=s("38a9"),i=s.n(a);i.a},c65a:function(e,t,s){},cf05:function(e,t,s){e.exports=s.p+"static/img/logo.5ba69830.png"},dc87:function(e,t,s){},e1a5:function(e,t,s){"use strict";var a=s("18ce"),i=s.n(a);i.a},e337:function(e,t,s){},ef61:function(e,t,s){"use strict";var a=s("0b70"),i=s.n(a);i.a},fb52:function(e,t,s){"use strict";var a=s("5a4f"),i=s.n(a);i.a}}); +(function(e){function t(t){for(var a,o,l=t[0],n=t[1],c=t[2],u=0,p=[];u{e&&e.length>=4?(this.searchLoading=!0,0===this.selected?this.typeAhead=this.$store.getters.getServiceItems(e):2===this.selected&&(this.typeAhead=this.$store.getters.getAppItems(e)),this.searchLoading=!1,this.timerID=null):this.typeAhead=[]},500)},getHref:function(e,t,s,a){let i="service="+e+"&app="+t;return null!==s&&(i=i+"&group="+s),null!=a&&(i=i+"&version="+a),"#/serviceDetail?"+i},governanceHref:function(e,t,s,a,i){const r="#/governance/"+e;let o=t;return"tagRule"===e&&(o=s),null!==a&&(o=o+"&serviceGroup="+a),null!==i&&(o=o+"&serviceVersion="+i),"tagRule"===e?r+"?application="+o:r+"?service="+o},submit(){if(this.filter=document.querySelector("#serviceSearch").value.trim(),!this.filter)return!1;{const e=this.items[this.selected].value;this.search(this.filter,e,!0)}},search:function(e,t,s){const a=this.pagination.page-1,i=-1===this.pagination.rowsPerPage?this.totalItems:this.pagination.rowsPerPage;this.loadingServices=!0,this.$axios.get("/service",{params:{pattern:t,filter:e,page:a,size:i}}).then(a=>{this.resultPage=a.data,this.totalItems=1,s&&this.$router.push({path:"service",query:{filter:e,pattern:t}})}).finally(()=>{this.loadingServices=!1})},toTestService(e){const t="#/test";let s="?service="+e.service;return e.group&&(s=s+"&group="+e.group),e.version&&(s=s+"&version="+e.version),t+s}},mounted:function(){this.setHeaders(),this.$store.dispatch("loadServiceItems"),this.$store.dispatch("loadAppItems");const e=this.$route.query;let t=null,s=null;Object.keys(e).forEach((function(a){"filter"===a&&(t=e[a]),"pattern"===a&&(s=e[a])})),null!=t&&null!=s?(this.filter=t,"service"===s?this.selected=0:"application"===s?this.selected=2:"ip"===s&&(this.selected=1),this.search(t,s,!1)):(this.filter="*",this.selected=0,s="service",this.search(this.filter,s,!0))}},m=v,f=(s("ef61"),Object(n["a"])(m,p,h,!1,null,"3626ac83",null)),g=f.exports,x=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("v-container",{attrs:{"grid-list-xl":"",fluid:""}},[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{sm12:""}},[s("h3",[e._v(e._s(e.$t("basicInfo")))])]),s("v-flex",{attrs:{lg12:""}},[s("v-data-table",{staticClass:"elevation-1",attrs:{items:e.basic,"hide-actions":"","hide-headers":""},scopedSlots:e._u([{key:"items",fn:function(t){return[s("td",[e._v(e._s(e.$t(t.item.name))+" ")]),s("td",[e._v(e._s(t.item.value))])]}}])})],1),s("v-flex",{attrs:{sm12:""}},[s("h3",[e._v(e._s(e.$t("serviceInfo")))])]),s("v-flex",{attrs:{lg12:""}},[s("v-tabs",{staticClass:"elevation-1"},[s("v-tab",[e._v(" "+e._s(e.$t("providers"))+" ")]),s("v-tab",[e._v(" "+e._s(e.$t("consumers"))+" ")]),s("v-tab-item",[s("v-data-table",{staticClass:"elevation-1",attrs:{headers:e.detailHeaders.providers,items:e.providerDetails},scopedSlots:e._u([{key:"items",fn:function(t){return[s("td",[e._v(e._s(e.getIp(t.item.address)))]),s("td",[e._v(e._s(e.getPort(t.item.address)))]),s("td",[e._v(e._s(t.item.registrySource))]),s("td",[e._v(e._s(t.item.timeout))]),s("td",[e._v(e._s(t.item.serialization))]),s("td",[e._v(e._s(t.item.weight))]),s("td",[s("v-tooltip",{attrs:{top:""}},[s("v-btn",{staticClass:"tiny",attrs:{slot:"activator",color:"primary"},on:{mouseover:function(s){return e.setHoverHint(t.item)},mouseout:function(s){return e.setoutHint(t.item)},click:function(s){return e.toCopyText(t.item.url)}},slot:"activator"},[e._v(" "+e._s(e.$t(t.item.hint))+" ")]),s("span",[e._v(e._s(t.item.url))])],1)],1)]}}])})],1),s("v-tab-item",[s("v-data-table",{staticClass:"elevation-1",attrs:{headers:e.detailHeaders.consumers,items:e.consumerDetails},scopedSlots:e._u([{key:"items",fn:function(t){return[s("td",[e._v(e._s(e.getIp(t.item.address)))]),s("td",[e._v(e._s(t.item.application))])]}}])})],1)],1)],1),s("v-flex",{attrs:{sm12:""}},[s("h3",[e._v(e._s(e.$t("metaData")))])]),s("v-flex",{attrs:{lg12:""}},[s("v-data-table",{staticClass:"elevation-1",attrs:{headers:e.metaHeaders,items:e.methodMetaData},scopedSlots:e._u([{key:"items",fn:function(t){return[s("td",[e._v(e._s(t.item.name))]),s("td",e._l(t.item.parameterTypes,(function(t,a){return s("v-chip",{key:t.id,attrs:{label:""}},[e._v(e._s(t))])})),1),s("td",[s("v-chip",{attrs:{label:""}},[e._v(e._s(t.item.returnType))])],1)]}}])},[s("template",{slot:"no-data"},[s("v-alert",{attrs:{value:!0,color:"warning",icon:"warning"}},[e._v(" "+e._s(e.$t("noMetadataHint"))+" "),s("a",{attrs:{href:e.$t("configAddress"),target:"_blank"}},[e._v(e._s(e.$t("here")))])])],1)],2)],1)],1)],1)},b=[],y={data:()=>({metaHeaders:[],detailHeaders:{},providerDetails:[],consumerDetails:[],methodMetaData:[],basic:[]}),methods:{setmetaHeaders:function(){this.metaHeaders=[{text:this.$t("methodName"),value:"method",sortable:!1},{text:this.$t("parameterList"),value:"parameter",sortable:!1},{text:this.$t("returnType"),value:"returnType",sortable:!1}]},setHoverHint:function(e){this.$set(e,"hint","copy")},setoutHint:function(e){this.$set(e,"hint","url")},setdetailHeaders:function(){this.detailHeaders={providers:[{text:this.$t("ip"),value:"ip"},{text:this.$t("port"),value:"port"},{text:this.$t("registrySource"),value:"registrySource"},{text:this.$t("timeout"),value:"timeout"},{text:this.$t("serialization"),value:"serialization"},{text:this.$t("weight"),value:"weight"},{text:this.$t("operation"),value:"operate"}],consumers:[{text:this.$t("ip"),value:"ip"},{text:this.$t("appName"),value:"appName"}]}},detail:function(e){this.$axios.get("/service/"+e).then(e=>{this.providerDetails=e.data.providers;const t=this.$t("instanceRegistry"),s=this.$t("interfaceRegistry"),a=this.$t("allRegistry");for(let i=0;i=2?e.split(":")[1]:null},toCopyText(e){this.$copyText(e).then(()=>{this.$notify.success(this.$t("copySuccessfully"))},()=>{})}},computed:{area(){return this.$i18n.locale}},watch:{area(){this.setdetailHeaders(),this.setmetaHeaders()}},mounted:function(){this.setmetaHeaders(),this.setdetailHeaders();const e=this.$route.query,t={service:"",app:"",group:"",version:""};var s=this;Object.keys(e).forEach((function(s){s in t&&(t[s]=e[s])}));let a=t.service;""!==t.group&&(a=t.group+"*"+a),""!==t.version&&(a=a+":"+t.version),""!==a&&(this.detail(a),Object.keys(t).forEach((function(e){const a={};a.value=t[e],a.name=e,s.basic.push(a)})))}},_=y,k=(s("77b6"),Object(n["a"])(_,x,b,!1,null,"32f6dafc",null)),w=k.exports,$=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("v-container",{attrs:{"grid-list-xl":"",fluid:""}},[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{lg12:""}},[s("breadcrumb",{attrs:{title:"testMethod",items:e.breads}})],1),s("v-flex",{staticClass:"test-form",attrs:{lg12:"",xl6:""}},[s("v-card",[s("v-card-title",{staticClass:"headline"},[e._v(e._s(e.$t("testMethod")+": "+e.method.signature))]),s("v-card-text",[s("json-editor",{attrs:{id:"test"},model:{value:e.method.json,callback:function(t){e.$set(e.method,"json",t)},expression:"method.json"}})],1),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{id:"execute","mt-0":"",color:"primary"},on:{click:function(t){return e.executeMethod()}}},[e._v(e._s(e.$t("execute")))])],1)],1)],1),s("v-flex",{staticClass:"test-result",attrs:{lg12:"",xl6:""}},[s("v-card",[s("v-card-title",{staticClass:"headline"},[e._v(e._s(e.$t("result"))+" "),!0===e.success?s("span",{staticClass:"green--text"},[e._v(e._s(e.$t("success")))]):e._e(),!1===e.success?s("span",{staticClass:"red--text"},[e._v(e._s(e.$t("fail")))]):e._e()]),s("v-card-text",[s("json-editor",{staticClass:"it-test-method-result-container",attrs:{name:"Result",readonly:""},model:{value:e.result,callback:function(t){e.result=t},expression:"result"}})],1)],1)],1)],1)],1)},I=[],D=(s("ddb0"),function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"jsoneditor-vue-container"})}),S=[],C=s("b2cd"),A=s.n(C),R=(s("f241"),{name:"json-editor",props:{value:null,mode:{type:String,default:"tree"},modes:{type:Array,default:()=>["tree","code"]},templates:Array,name:{type:String,default:"Parameters"},readonly:{type:Boolean,default:!1}},data(){return{$jsoneditor:null}},watch:{value(e,t){e!==t&&this.$jsoneditor&&this.$jsoneditor.update(e||{})}},mounted(){const e={name:this.name,navigationBar:!1,search:!1,mode:this.mode,modes:this.modes,onEditable:e=>!this.readonly,onChange:()=>{if(this.$jsoneditor){const e=this.$jsoneditor.get();this.$emit("input",e)}},templates:this.templates};this.$jsoneditor=new A.a(this.$el,e),this.$jsoneditor.set(this.value||{}),this.$jsoneditor.expandAll()},beforeDestroy(){this.$jsoneditor&&(this.$jsoneditor.destroy(),this.$jsoneditor=null)}}),E=R,T=(s("e1a5"),Object(n["a"])(E,D,S,!1,null,"c645be38",null)),L=T.exports,V=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("h2",[e._v(e._s(e.$t(e.title)))]),s("v-breadcrumbs",{attrs:{items:e.items},scopedSlots:e._u([{key:"item",fn:function(t){return[t.item.strong?e._e():s("span",[e._v(e._s(e.$t(t.item.text)))]),t.item.strong?s("strong",[e._v(" "+e._s(e.$t(t.item.text))+" "),s("span",{staticClass:"green--text"},[e._v(e._s(t.item.strong))])]):e._e()]}}])})],1)},H=[],G={name:"Breadcrumb",props:{title:{type:String,default:""},items:{type:Array,default:[]}},data:()=>({})},O=G,B=Object(n["a"])(O,V,H,!1,null,"37deb543",null),N=B.exports,M=s("0f5c"),j=s.n(M);s("5319");const P=(e=[])=>e[Math.floor(Math.random()*e.length)],q=e=>(e||"").replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),Q=()=>{const e=window.document,t=e.documentElement,s=t.requestFullscreen||t.mozRequestFullScreen||t.webkitRequestFullScreen||t.msRequestFullscreen,a=e.exitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen||e.msExitFullscreen;e.fullscreenElement||e.mozFullScreenElement||e.webkitFullscreenElement||e.msFullscreenElement?a.call(e):s.call(t)},F=e=>{const t={};for(const s in e)if(e.hasOwnProperty(s))if("object"===typeof e[s]&&null!==e[s]){const a=F(e[s]);for(const e in a)a.hasOwnProperty(e)&&(t[s+"."+e]=a[e])}else t[s]=e[s];return t};var W={randomElement:P,toggleFullScreen:Q,kebab:q,flattenObject:F},U={name:"TestMethod",components:{JsonEditor:L,Breadcrumb:N},data(){return{success:null,breads:[{text:"serviceSearch",href:"test"},{text:"serviceTest",href:"",strong:this.$route.query.service}],service:this.$route.query.service,application:this.$route.query.application,method:{name:null,signature:this.$route.query.method,parameterTypes:[],json:[],jsonTypes:[]},result:null}},methods:{executeMethod(){this.convertType(this.method.json,this.method.jsonTypes);const e={service:this.service,method:this.method.name,parameterTypes:this.method.parameterTypes,params:this.method.json};this.$axios.post("/test",e).then(e=>{e&&200===e.status&&(this.success=!0,this.result=e.data)}).catch(e=>{this.success=!1,this.result=e.response.data})},convertType(e,t){const s=W.flattenObject(e),a=W.flattenObject(t);Object.keys(s).forEach(t=>{"string"===typeof a[t]&&"string"!==typeof s[t]&&j()(e,t,String(s[t]))})}},mounted(){const e=this.$route.query,t=e.method;if(t){const[e,s]=t.split("~");this.method.name=e,this.method.parameterTypes=s?s.split(";"):[]}const s="/test/method?application="+this.application+"&service="+this.service+"&method="+t;this.$axios.get(encodeURI(s)).then(e=>{this.method.json=e.data.parameterTypes,this.method.jsonTypes=e.data.parameterTypes})}},J=U,z=Object(n["a"])(J,$,I,!1,null,"16526831",null),Y=z.exports,Z=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("v-container",{attrs:{"grid-list-xl":"",fluid:""}},[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{lg12:""}},[s("breadcrumb",{attrs:{title:"routingRule",items:e.breads}}),s("v-flex",{attrs:{lg12:""}},[s("a",{attrs:{href:"https://cn.dubbo.apache.org/zh-cn/overview/core-features/traffic/condition-rule/"}},[e._v("条件路由规则")])])],1),s("v-flex",{attrs:{lg12:""}},[s("v-card",{attrs:{flat:"",color:"transparent"}},[s("v-card-text",[s("v-form",[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",[s("v-combobox",{attrs:{id:"serviceSearch",loading:e.searchLoading,items:e.typeAhead,"search-input":e.input,flat:"","append-icon":"","hide-no-data":"",suffix:e.queryBy,label:e.$t("searchRoutingRule")},on:{"update:searchInput":function(t){e.input=t},"update:search-input":function(t){e.input=t},keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.submit(t)},input:function(t){return e.split(t)}},model:{value:e.filter,callback:function(t){e.filter=t},expression:"filter"}})],1),s("v-menu",{staticClass:"hidden-xs-only"},[s("v-btn",{attrs:{slot:"activator",large:"",icon:""},slot:"activator"},[s("v-icon",[e._v("unfold_more")])],1),s("v-list",e._l(e.items,(function(t,a){return s("v-list-tile",{key:a,on:{click:function(t){e.selected=a}}},[s("v-list-tile-title",[e._v(e._s(e.$t(t.title)))])],1)})),1)],1),s("v-flex",{directives:[{name:"show",rawName:"v-show",value:0===e.selected,expression:"selected === 0"}],attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{directives:[{name:"show",rawName:"v-show",value:0===e.selected,expression:"selected === 0"}],attrs:{label:"Version",hint:e.$t("dataIdVersionHint")},model:{value:e.serviceVersion4Search,callback:function(t){e.serviceVersion4Search=t},expression:"serviceVersion4Search"}})],1),s("v-flex",{directives:[{name:"show",rawName:"v-show",value:0===e.selected,expression:"selected === 0"}],attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Group",hint:e.$t("dataIdGroupHint")},model:{value:e.serviceGroup4Search,callback:function(t){e.serviceGroup4Search=t},expression:"serviceGroup4Search"}})],1),s("v-btn",{attrs:{color:"primary",large:""},on:{click:e.submit}},[e._v(e._s(e.$t("search")))])],1)],1)],1)],1)],1)],1),s("v-flex",{attrs:{lg12:""}},[s("v-card",[s("v-toolbar",{staticClass:"elevation-0",attrs:{flat:"",color:"transparent"}},[s("v-toolbar-title",[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("searchResult")))])]),s("v-spacer"),s("v-btn",{staticClass:"mb-2",attrs:{outline:"",color:"primary"},on:{click:function(t){return t.stopPropagation(),e.openDialog(t)}}},[e._v(e._s(e.$t("create")))])],1),s("v-card-text",{directives:[{name:"show",rawName:"v-show",value:0===e.selected,expression:"selected === 0"}],staticClass:"pa-0"},[s("v-data-table",{staticClass:"elevation-0",attrs:{headers:e.serviceHeaders,items:e.serviceRoutingRules,"hide-actions":""},scopedSlots:e._u([{key:"items",fn:function(t){return[s("td",{staticClass:"text-xs-left"},[e._v(e._s(t.item.service))]),s("td",{staticClass:"text-xs-left"},[e._v(e._s(t.item.serviceGroup))]),s("td",{staticClass:"text-xs-left"},[e._v(e._s(t.item.serviceVersion))]),s("td",{staticClass:"text-xs-left"},[e._v(e._s(t.item.enabled))]),s("td",{staticClass:"text-xs-center px-0"},e._l(e.operations,(function(a){return s("v-tooltip",{key:a.id,attrs:{bottom:""}},[s("v-icon",{staticClass:"mr-2",attrs:{slot:"activator",small:""},on:{click:function(s){e.itemOperation(a.icon(t.item),t.item)}},slot:"activator"},[e._v(" "+e._s(a.icon(t.item))+" ")]),s("span",[e._v(e._s(e.$t(a.tooltip(t.item))))])],1)})),1)]}}])})],1),s("v-card-text",{directives:[{name:"show",rawName:"v-show",value:1===e.selected,expression:"selected === 1"}],staticClass:"pa-0"},[s("v-data-table",{staticClass:"elevation-0",attrs:{headers:e.appHeaders,items:e.appRoutingRules,"hide-actions":""},scopedSlots:e._u([{key:"items",fn:function(t){return[s("td",{staticClass:"text-xs-left"},[e._v(e._s(t.item.application))]),s("td",{staticClass:"text-xs-left"},[e._v(e._s(t.item.enabled))]),s("td",{staticClass:"text-xs-center px-0"},e._l(e.operations,(function(a){return s("v-tooltip",{key:a.id,attrs:{bottom:""}},[s("v-icon",{staticClass:"mr-2",attrs:{slot:"activator",small:""},on:{click:function(s){e.itemOperation(a.icon(t.item),t.item)}},slot:"activator"},[e._v(" "+e._s(a.icon(t.item))+" ")]),s("span",[e._v(e._s(e.$t(a.tooltip(t.item))))])],1)})),1)]}}])})],1)],1)],1),s("v-dialog",{attrs:{width:"800px",persistent:""},model:{value:e.dialog,callback:function(t){e.dialog=t},expression:"dialog"}},[s("v-card",[s("v-card-title",{staticClass:"justify-center"},[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("createNewRoutingRule")))])]),s("v-card-text",[s("v-layout",{attrs:{wrap:""}},[s("v-flex",{attrs:{xs24:"",sm12:"",md8:""}},[s("v-text-field",{attrs:{label:"Service class",hint:e.$t("dataIdClassHint")},model:{value:e.service,callback:function(t){e.service=t},expression:"service"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Version",hint:e.$t("dataIdVersionHint")},model:{value:e.serviceVersion,callback:function(t){e.serviceVersion=t},expression:"serviceVersion"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Group",hint:e.$t("dataIdGroupHint")},model:{value:e.serviceGroup,callback:function(t){e.serviceGroup=t},expression:"serviceGroup"}})],1)],1),s("v-text-field",{attrs:{label:"Application Name",hint:"Application name the service belongs to"},model:{value:e.application,callback:function(t){e.application=t},expression:"application"}}),s("v-subheader",{staticClass:"pa-0 mt-3"},[e._v(e._s(e.$t("ruleContent")))]),s("ace-editor",{attrs:{readonly:e.readonly},model:{value:e.ruleText,callback:function(t){e.ruleText=t},expression:"ruleText"}})],1),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{flat:""},nativeOn:{click:function(t){return e.closeDialog(t)}}},[e._v(e._s(e.$t("close")))]),s("v-btn",{attrs:{depressed:"",color:"primary"},nativeOn:{click:function(t){return e.saveItem(t)}}},[e._v(e._s(e.$t("save")))])],1)],1)],1),s("v-dialog",{attrs:{persistent:"","max-width":"500px"},model:{value:e.warn,callback:function(t){e.warn=t},expression:"warn"}},[s("v-card",[s("v-card-title",{staticClass:"headline"},[e._v(e._s(e.$t(this.warnTitle)))]),s("v-card-text",[e._v(e._s(this.warnText))]),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{flat:""},nativeOn:{click:function(t){return e.closeWarn(t)}}},[e._v(e._s(e.$t("cancel")))]),s("v-btn",{attrs:{depressed:"",color:"primary"},nativeOn:{click:function(t){return e.deleteItem(e.warnStatus)}}},[e._v(e._s(e.$t("confirm")))])],1)],1)],1)],1)},X=[],K=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{style:{height:e.height,width:e.width}})},ee=[],te=s("061c"),se=s.n(te),ae={name:"ace-editor",props:{value:String,width:{type:String,default:"100%"},height:{type:String,default:"300px"},lang:{type:String,default:"yaml"},theme:{type:String,default:"monokai"},readonly:{type:Boolean,default:!1},fontsize:{type:Number,default:14},tabsize:{type:Number,default:2},overrideValueHistory:{type:Boolean,default:!0}},data(){return{$ace:null,_content:""}},watch:{value(e,t){e!==t&&this._content!==e&&(this._content=e,this.overrideValueHistory?this.$ace.getSession().setValue(e):this.$ace.setValue(e,1))},lang(e,t){e!==t&&e&&(s("c1d1")("./"+e),this.$ace.getSession().setMode("ace/mode/"+e))},theme(e,t){e!==t&&e&&(s("07ed")("./"+e),this.$ace.setTheme("ace/theme/"+e))},readonly(e,t){e!==t&&this.$ace.setReadOnly(e)},fontsize(e,t){e!==t&&this.$ace.setFontSize(e)}},mounted(){this.$ace=se.a.edit(this.$el),this.$ace.$blockScrolling=1/0;const{lang:e,theme:t,readonly:a,fontsize:i,tabsize:r,overrideValueHistory:o}=this;this.$emit("init",this.$ace);const l=this.$ace.getSession();s("c1d1")("./"+e),l.setMode("ace/mode/"+e),l.setTabSize(r),l.setUseSoftTabs(!0),l.setUseWrapMode(!0),o?l.setValue(this.value):this.$ace.setValue(this.value,1),s("07ed")("./"+t),this.$ace.setTheme("ace/theme/"+t),this.$ace.setReadOnly(a),this.$ace.setFontSize(i),this.$ace.setShowPrintMargin(!1),this.$ace.on("change",()=>{var e=this.$ace.getValue();this.$emit("input",e),this._content=e})}},ie=ae,re=Object(n["a"])(ie,K,ee,!1,null,null,null),oe=re.exports,le=s("651e"),ne=s.n(le);const ce=[{id:0,icon:function(e){return"visibility"},tooltip:function(e){return"View"}},{id:1,icon:function(e){return"edit"},tooltip:function(e){return"Edit"}},{id:2,icon:function(e){return e.enabled?"block":"check_circle_outline"},tooltip:function(e){return!0===e.enabled?"Disable":"Enable"}},{id:3,icon:function(e){return"delete"},tooltip:function(e){return"Delete"}}];var de=ce,ue={components:{Breadcrumb:N,AceEditor:oe},data:()=>({items:[{id:0,title:"serviceName",value:"service"},{id:1,title:"app",value:"application"}],breads:[{text:"serviceGovernance",href:""},{text:"routingRule",href:""}],selected:0,dropdown_font:["Service","App","IP"],ruleKeys:["enabled","force","runtime","group","version","rule"],pattern:"Service",filter:"",serviceVersion4Search:"",serviceGroup4Search:"",dialog:!1,warn:!1,updateId:"",application:"",service:"",serviceVersion:"",serviceGroup:"",warnTitle:"",warnText:"",warnStatus:{},height:0,searchLoading:!1,typeAhead:[],input:null,timerID:null,operations:de,serviceRoutingRules:[],appRoutingRules:[],template:"configVersion: 'v3.0'\nenabled: true\nruntime: false\nforce: true\nConfigVersion:\nconditions:\n - '=> host != 172.22.3.91'\n",ruleText:"",readonly:!1,appHeaders:[],serviceHeaders:[]}),methods:{setAppHeaders:function(){this.appHeaders=[{text:this.$t("appName"),value:"application",align:"left"},{text:this.$t("enabled"),value:"enabled",sortable:!1},{text:this.$t("operation"),value:"operation",sortable:!1,width:"115px"}]},setServiceHeaders:function(){this.serviceHeaders=[{text:this.$t("serviceName"),value:"service",align:"left"},{text:this.$t("group"),value:"group",align:"left"},{text:this.$t("version"),value:"group",align:"left"},{text:this.$t("enabled"),value:"enabled",sortable:!1},{text:this.$t("operation"),value:"operation",sortable:!1,width:"115px"}]},querySelections(e){this.timerID&&clearTimeout(this.timerID)},submit:function(){this.filter=document.querySelector("#serviceSearch").value.trim(),this.search(!0)},split:function(e){if(0===this.selected){const t=e.split("/"),s=e.split(":");console.log(t),console.log(s),t.length>1?this.serviceGroup4Search=t[0]:this.serviceGroup4Search="",s.length>1?this.serviceVersion4Search=s[1]:this.serviceVersion4Search="";const a=s[0].split("/");1===a.length?this.filter=a[0]:this.filter=a[1]}},search:function(e){if(!this.filter)return void this.$notify.error("Either service or application is needed");const t=this.items[this.selected].value,s="/rules/route/condition/?"+t+"="+this.filter+"&serviceVersion="+this.serviceVersion4Search+"&serviceGroup="+this.serviceGroup4Search;this.$axios.get(s).then(t=>{0===this.selected?this.serviceRoutingRules=t.data.data:this.appRoutingRules=t.data.data,e&&(0===this.selected?this.$router.push({path:"routingRule",query:{service:this.filter,serviceVersion:this.serviceVersion4Search,serviceGroup:this.serviceGroup4Search}}):1===this.selected&&this.$router.push({path:"routingRule",query:{application:this.filter}}))})},closeDialog:function(){this.ruleText=this.template,this.updateId="",this.service="",this.serviceVersion="",this.serviceGroup="",this.application="",this.dialog=!1,this.readonly=!1},openDialog:function(){this.dialog=!0},openWarn:function(e,t){this.warnTitle=e,this.warnText=t,this.warn=!0},closeWarn:function(){this.warnTitle="",this.warnText="",this.warn=!1},saveItem:function(){const e=ne.a.safeLoad(this.ruleText);if(!this.service&&!this.application)return void this.$notify.error("Either service or application is needed");if(this.service&&this.application)return void this.$notify.error("You can not set both service ID and application name");const t=this;e.service=this.service;const s=null==this.serviceVersion?"":this.serviceVersion,a=null==this.serviceGroup?"":this.serviceGroup;e.application=this.application,e.serviceVersion=s,e.serviceGroup=a,""!==this.updateId?"close"===this.updateId?this.closeDialog():(e.id=this.updateId,this.$axios.put("/rules/route/condition/"+e.id,e).then(e=>{200===e.status&&(t.service?(t.selected=0,t.search(t.service,!0),t.filter=t.service):(t.selected=1,t.search(t.application,!0),t.filter=t.application),this.closeDialog(),this.$notify.success("Update success"))})):this.$axios.post("/rules/route/condition/",e).then(e=>{console.log(e),200===e.status&&(t.service?(t.selected=0,t.search(t.service,!0),t.filter=t.service):(t.selected=1,t.search(t.application,!0),t.filter=t.application),this.closeDialog(),this.$notify.success("Create success"))}).catch(e=>{console.log(e)}),document.querySelector("#serviceSearch").value=this.service,this.submit()},itemOperation:function(e,t){const s=t.id,a=null==t.serviceVersion?"":t.serviceVersion,i=null==t.serviceGroup?"":t.serviceGroup,r=null==t.scope?"":t.scope;switch(e){case"visibility":this.$axios.get("/rules/route/condition/"+s).then(e=>{const t=e.data;this.serviceVersion=t.serviceVersion,this.serviceGroup=t.serviceGroup,this.scope=t.scope,delete t.serviceVersion,delete t.serviceGroup,delete t.scope,this.handleBalance(t,!0),this.updateId="close"});break;case"edit":this.$axios.get("/rules/route/condition/"+s).then(e=>{const t=e.data;this.serviceVersion=t.serviceVersion,this.serviceGroup=t.serviceGroup,this.scope=t.scope,delete t.serviceVersion,delete t.serviceGroup,delete t.scope,this.handleBalance(t,!1),this.updateId=s});break;case"block":this.openWarn(" Are you sure to block Routing Rule","service: "+s),this.warnStatus.operation="disable",this.warnStatus.id=s,this.warnStatus.serviceVersion=a,this.warnStatus.serviceGroup=i,this.warnStatus.scope=r;break;case"check_circle_outline":this.openWarn(" Are you sure to enable Routing Rule","service: "+s),this.warnStatus.operation="enable",this.warnStatus.id=s,this.warnStatus.serviceVersion=a,this.warnStatus.serviceGroup=i,this.warnStatus.scope=r;break;case"delete":this.openWarn("warnDeleteRouteRule","service: "+s),this.warnStatus.operation="delete",this.warnStatus.id=s,this.warnStatus.serviceVersion=a,this.warnStatus.serviceGroup=i,this.warnStatus.scope=r}},handleBalance:function(e,t){this.service=e.service,this.application=e.application,delete e.service,delete e.id,delete e.app,delete e.group,delete e.application,delete e.priority,this.ruleText=ne.a.safeDump(e),this.readonly=t,this.dialog=!0},setHeight:function(){this.height=.5*window.innerHeight},deleteItem:function(e){const t=e.id,s=e.operation,a=e.serviceVersion,i=e.serviceGroup,r=e.scope;"delete"===s?this.$axios.delete("/rules/route/condition/"+t+"?serviceVersion="+a+"&serviceGroup="+i+"&scope="+r).then(e=>{200===e.status&&(this.warn=!1,this.search(this.filter,!1),this.$notify.success("Delete success"))}):"disable"===s?this.$axios.put("/rules/route/condition/disable/"+t+"?serviceVersion="+a+"&serviceGroup="+i+"&scope="+r).then(e=>{200===e.status&&(this.warn=!1,this.search(this.filter,!1),this.$notify.success("Disable success"))}):"enable"===s&&this.$axios.put("/rules/route/condition/enable/"+t+"?serviceVersion="+a+"&serviceGroup="+i+"&scope="+r).then(e=>{200===e.status&&(this.warn=!1,this.search(this.filter,!1),this.$notify.success("Enable success"))})}},created(){this.setHeight(),this.ruleText=this.template},computed:{queryBy(){return this.$t("by")+this.$t(this.items[this.selected].title)},area(){return this.$i18n.locale}},watch:{input(e){this.querySelections(e)},area(){this.setAppHeaders(),this.setServiceHeaders()}},mounted:function(){this.setAppHeaders(),this.setServiceHeaders(),this.$store.dispatch("loadServiceItems"),this.$store.dispatch("loadConsumerItems"),this.ruleText=this.template;const e=this.$route.query;let t=null,s=null,a=null;const i=this;Object.keys(e).forEach((function(r){"service"===r&&(t=e[r],e.serviceVersion&&(s=e.serviceVersion),e.serviceGroup&&(a=e.serviceGroup),i.selected=0),"application"===r&&(t=e[r],i.selected=1)})),null!=s&&(this.serviceVersion4Search=e.serviceVersion),null!=a&&(this.serviceGroup4Search=e.serviceGroup),null!==t&&(this.filter=t,this.search(!1))}},pe=ue,he=Object(n["a"])(pe,Z,X,!1,null,null,null),ve=he.exports,me=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("v-container",{attrs:{"grid-list-xl":"",fluid:""}},[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{lg12:""}},[s("breadcrumb",{attrs:{title:"tagRule",items:e.breads}})],1),s("v-flex",{attrs:{lg12:""}},[s("a",{attrs:{href:"https://cn.dubbo.apache.org/zh-cn/overview/core-features/traffic/tag-rule/"}},[e._v("标签路由规则")])])],1),s("v-flex",{attrs:{lg12:""}},[s("v-card",{attrs:{flat:"",color:"transparent"}},[s("v-card-text",[s("v-form",[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-combobox",{attrs:{id:"serviceSearch",loading:e.searchLoading,items:e.typeAhead,"search-input":e.input,flat:"","append-icon":"","hide-no-data":"",label:e.$t("searchTagRule")},on:{"update:searchInput":function(t){e.input=t},"update:search-input":function(t){e.input=t},keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.submit(t)}},model:{value:e.filter,callback:function(t){e.filter=t},expression:"filter"}}),s("v-btn",{attrs:{color:"primary",large:""},on:{click:e.submit}},[e._v(e._s(e.$t("search")))])],1)],1)],1)],1)],1),s("v-flex",{attrs:{lg12:""}},[s("v-card",[s("v-toolbar",{staticClass:"elevation-0",attrs:{flat:"",color:"transparent"}},[s("v-toolbar-title",[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("searchResult")))])]),s("v-spacer"),s("v-btn",{staticClass:"mb-2",attrs:{outline:"",color:"primary"},on:{click:function(t){return t.stopPropagation(),e.openDialog(t)}}},[e._v(e._s(e.$t("create")))])],1),s("v-card-text",{staticClass:"pa-0"},[s("v-data-table",{staticClass:"elevation-0",attrs:{headers:e.headers,items:e.tagRoutingRules,"hide-actions":""},scopedSlots:e._u([{key:"items",fn:function(t){return[s("td",{staticClass:"text-xs-left"},[e._v(e._s(t.item.application))]),s("td",{staticClass:"text-xs-left"},[e._v(e._s(t.item.enabled))]),s("td",{staticClass:"text-xs-center px-0"},e._l(e.operations,(function(a){return s("v-tooltip",{key:a.id,attrs:{bottom:""}},[s("v-icon",{staticClass:"mr-2",attrs:{slot:"activator",small:""},on:{click:function(s){e.itemOperation(a.icon(t.item),t.item)}},slot:"activator"},[e._v(" "+e._s(a.icon(t.item))+" ")]),s("span",[e._v(e._s(e.$t(a.tooltip(t.item))))])],1)})),1)]}}])})],1)],1)],1),s("v-dialog",{attrs:{width:"800px",persistent:""},model:{value:e.dialog,callback:function(t){e.dialog=t},expression:"dialog"}},[s("v-card",[s("v-card-title",{staticClass:"justify-center"},[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("createNewTagRule")))])]),s("v-card-text",[s("v-text-field",{attrs:{label:e.$t("appName"),hint:e.$t("appNameHint")},model:{value:e.application,callback:function(t){e.application=t},expression:"application"}}),s("v-subheader",{staticClass:"pa-0 mt-3"},[e._v(e._s(e.$t("ruleContent")))]),s("ace-editor",{attrs:{readonly:e.readonly},model:{value:e.ruleText,callback:function(t){e.ruleText=t},expression:"ruleText"}})],1),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{flat:""},nativeOn:{click:function(t){return e.closeDialog(t)}}},[e._v(e._s(e.$t("close")))]),s("v-btn",{attrs:{depressed:"",color:"primary"},nativeOn:{click:function(t){return e.saveItem(t)}}},[e._v(e._s(e.$t("save")))])],1)],1)],1),s("v-dialog",{attrs:{persistent:"","max-width":"500px"},model:{value:e.warn.display,callback:function(t){e.$set(e.warn,"display",t)},expression:"warn.display"}},[s("v-card",[s("v-card-title",{staticClass:"headline"},[e._v(e._s(e.$t(this.warn.title)))]),s("v-card-text",[e._v(e._s(this.warn.text))]),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{flat:""},nativeOn:{click:function(t){return e.closeWarn(t)}}},[e._v("CANCLE")]),s("v-btn",{attrs:{depressed:"",color:"primary"},nativeOn:{click:function(t){return e.deleteItem(e.warn.status)}}},[e._v(e._s(e.$t("confirm")))])],1)],1)],1)],1)},fe=[],ge={components:{Breadcrumb:N,AceEditor:oe},data:()=>({dropdown_font:["Service","App","IP"],ruleKeys:["enabled","force","dynamic","runtime","group","version","rule"],pattern:"Service",filter:"",dialog:!1,updateId:"",application:"",searchLoading:!1,typeAhead:[],input:null,timerID:null,warn:{display:!1,title:"",text:"",status:{}},breads:[{text:"serviceGovernance",href:""},{text:"tagRule",href:""}],height:0,operations:de,tagRoutingRules:[],template:"configVersion: 'v3.0'\nforce: false\nenabled: true\nruntime: false\ntags:\n - name: gray\n match:\n - key: env\n value:\n exact: gray",ruleText:"",readonly:!1,headers:[]}),methods:{setHeaders:function(){this.headers=[{text:this.$t("appName"),value:"application",align:"left"},{text:this.$t("enabled"),value:"enabled",sortable:!1},{text:this.$t("operation"),value:"operation",sortable:!1,width:"115px"}]},querySelections(e){this.timerID&&clearTimeout(this.timerID),this.timerID=setTimeout(()=>{e&&e.length>=4?(this.searchLoading=!0,this.typeAhead=this.$store.getters.getAppItems(e),this.searchLoading=!1,this.timerID=null):this.typeAhead=[]},500)},submit:function(){this.filter?(this.filter=this.filter.trim(),this.search(!0)):this.$notify.error("application is needed")},search:function(e){const t="/rules/route/tag/?application="+this.filter;this.$axios.get(t).then(t=>{this.tagRoutingRules=t.data,e&&this.$router.push({path:"tagRule",query:{application:this.filter}})})},closeDialog:function(){this.ruleText=this.template,this.updateId="",this.application="",this.dialog=!1,this.readonly=!1},openDialog:function(){this.dialog=!0},openWarn:function(e,t){this.warn.title=e,this.warn.text=t,this.warn.display=!0},closeWarn:function(){this.warn.title="",this.warn.text="",this.warn.display=!1},saveItem:function(){const e=ne.a.safeLoad(this.ruleText);if(!this.application)return void this.$notify.error("application is required");e.application=this.application;const t=this;this.updateId?"close"===this.updateId?this.closeDialog():(e.id=this.updateId,this.$axios.put("/rules/route/tag/"+e.id,e).then(e=>{200===e.status&&(t.search(t.application,!0),t.closeDialog(),t.$notify.success("Update success"))})):this.$axios.post("/rules/route/tag/",e).then(e=>{201===e.status&&(t.search(t.application,!0),t.filter=t.application,t.closeDialog(),t.$notify.success("Create success"))}).catch(e=>{console.log(e)})},itemOperation:function(e,t){const s=t.application;switch(e){case"visibility":this.$axios.get("/rules/route/tag/"+s).then(e=>{const t=e.data;this.handleBalance(t,!0),this.updateId="close"});break;case"edit":this.$axios.get("/rules/route/tag/"+s).then(e=>{const t=e.data;this.handleBalance(t,!1),this.updateId=s});break;case"block":this.openWarn(" Are you sure to block Tag Rule","application: "+t.application),this.warn.status.operation="disable",this.warn.status.id=s;break;case"check_circle_outline":this.openWarn(" Are you sure to enable Tag Rule","application: "+t.application),this.warn.status.operation="enable",this.warn.status.id=s;break;case"delete":this.openWarn("warnDeleteTagRule","application: "+t.application),this.warn.status.operation="delete",this.warn.status.id=s}},handleBalance:function(e,t){this.application=e.application,delete e.id,delete e.app,delete e.group,delete e.application,delete e.service,delete e.priority,delete e.serviceVersion,delete e.serviceGroup,this.ruleText=ne.a.safeDump(e),this.readonly=t,this.dialog=!0},setHeight:function(){this.height=.5*window.innerHeight},deleteItem:function(e){const t=e.id,s=e.operation;"delete"===s?this.$axios.delete("/rules/route/tag/"+t).then(e=>{200===e.status&&(this.warn.display=!1,this.search(this.filter,!1),this.$notify.success("Delete success"))}):"disable"===s?this.$axios.put("/rules/route/tag/disable/"+t).then(e=>{200===e.status&&(this.warn.display=!1,this.search(this.filter,!1),this.$notify.success("Disable success"))}):"enable"===s&&this.$axios.put("/rules/route/tag/enable/"+t).then(e=>{200===e.status&&(this.warn.display=!1,this.search(this.filter,!1),this.$notify.success("Enable success"))})}},created(){this.setHeight()},computed:{area(){return this.$i18n.locale}},watch:{input(e){this.querySelections(e)},area(){this.setHeaders()}},mounted:function(){this.setHeaders(),this.$store.dispatch("loadAppItems"),this.ruleText=this.template;const e=this.$route.query;let t=null;Object.keys(e).forEach((function(s){"application"===s&&(t=e[s])})),null!==t&&(this.filter=t,this.search(!1))}},xe=ge,be=Object(n["a"])(xe,me,fe,!1,null,null,null),ye=be.exports,_e=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("v-container",{attrs:{"grid-list-xl":"",fluid:""}},[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{lg12:""}},[s("breadcrumb",{attrs:{title:"meshRule",items:e.breads}})],1)],1),s("v-flex",{attrs:{lg12:""}},[s("v-card",{attrs:{flat:"",color:"transparent"}},[s("v-card-text",[s("v-form",[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-combobox",{attrs:{id:"serviceSearch",loading:e.searchLoading,items:e.typeAhead,"search-input":e.input,flat:"","append-icon":"","hide-no-data":"",label:e.$t("searchMeshRule")},on:{"update:searchInput":function(t){e.input=t},"update:search-input":function(t){e.input=t},keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.submit(t)}},model:{value:e.filter,callback:function(t){e.filter=t},expression:"filter"}}),s("v-btn",{attrs:{color:"primary",large:""},on:{click:e.submit}},[e._v(e._s(e.$t("search")))])],1)],1)],1)],1)],1),s("v-flex",{attrs:{lg12:""}},[s("v-card",[s("v-toolbar",{staticClass:"elevation-0",attrs:{flat:"",color:"transparent"}},[s("v-toolbar-title",[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("searchResult")))])]),s("v-spacer"),s("v-btn",{staticClass:"mb-2",attrs:{outline:"",color:"primary"},on:{click:function(t){return t.stopPropagation(),e.openDialog(t)}}},[e._v(e._s(e.$t("create")))])],1),s("v-card-text",{staticClass:"pa-0"},[s("v-data-table",{staticClass:"elevation-0",attrs:{headers:e.headers,items:e.meshRoutingRules,"hide-actions":""},scopedSlots:e._u([{key:"items",fn:function(t){return[s("td",{staticClass:"text-xs-left"},[e._v(e._s(t.item.application))]),s("td",{staticClass:"text-xs-center px-0"},[s("v-tooltip",{attrs:{bottom:""}},[s("v-icon",{staticClass:"mr-2",attrs:{slot:"activator",small:"",color:"blue"},on:{click:function(s){return e.itemOperation("visibility",t.item)}},slot:"activator"},[e._v("visibility ")]),s("span",[e._v(e._s(e.$t("view")))])],1),s("v-tooltip",{attrs:{bottom:""}},[s("v-icon",{staticClass:"mr-2",attrs:{slot:"activator",small:"",color:"blue"},on:{click:function(s){return e.itemOperation("edit",t.item)}},slot:"activator"},[e._v("edit ")]),s("span",[e._v("Edit")])],1),s("v-tooltip",{attrs:{bottom:""}},[s("v-icon",{staticClass:"mr-2",attrs:{slot:"activator",small:"",color:"red"},on:{click:function(s){return e.itemOperation("delete",t.item)}},slot:"activator"},[e._v("delete ")]),s("span",[e._v("Delete")])],1)],1)]}}])})],1)],1)],1),s("v-dialog",{attrs:{width:"800px",persistent:""},model:{value:e.dialog,callback:function(t){e.dialog=t},expression:"dialog"}},[s("v-card",[s("v-card-title",{staticClass:"justify-center"},[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("createNewMeshRule")))])]),s("v-card-text",[s("v-text-field",{attrs:{label:e.$t("appName"),hint:e.$t("appNameHint")},model:{value:e.application,callback:function(t){e.application=t},expression:"application"}}),s("v-subheader",{staticClass:"pa-0 mt-3"},[e._v(e._s(e.$t("ruleContent")))]),s("ace-editor",{attrs:{readonly:e.readonly},model:{value:e.ruleText,callback:function(t){e.ruleText=t},expression:"ruleText"}})],1),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{flat:""},nativeOn:{click:function(t){return e.closeDialog(t)}}},[e._v(e._s(e.$t("close")))]),s("v-btn",{attrs:{depressed:"",color:"primary"},nativeOn:{click:function(t){return e.saveItem(t)}}},[e._v(e._s(e.$t("save")))])],1)],1)],1),s("v-dialog",{attrs:{persistent:"","max-width":"500px"},model:{value:e.warn.display,callback:function(t){e.$set(e.warn,"display",t)},expression:"warn.display"}},[s("v-card",[s("v-card-title",{staticClass:"headline"},[e._v(e._s(e.$t(this.warn.title)))]),s("v-card-text",[e._v(e._s(this.warn.text))]),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{flat:""},nativeOn:{click:function(t){return e.closeWarn(t)}}},[e._v("CANCLE")]),s("v-btn",{attrs:{depressed:"",color:"primary"},nativeOn:{click:function(t){return e.deleteItem(e.warn.status)}}},[e._v(e._s(e.$t("confirm")))])],1)],1)],1)],1)},ke=[],we={components:{Breadcrumb:N},data:()=>({dropdown_font:["Service","App","IP"],ruleKeys:["enabled","force","dynamic","runtime","group","version","rule"],pattern:"Service",filter:"",dialog:!1,updateId:"",application:"",searchLoading:!1,typeAhead:[],input:null,timerID:null,warn:{display:!1,title:"",text:"",status:{}},breads:[{text:"serviceGovernance",href:""},{text:"meshRule",href:""}],height:0,operations:de,meshRoutingRules:[],template:"apiVersion: service.dubbo.apache.org/v1alpha1\nkind: DestinationRule\nmetadata: { name: demo-route }\nspec:\n host: demo\n subsets:\n - labels: { env-sign: xxx, tag1: hello }\n name: isolation\n - labels: { env-sign: yyy }\n name: testing-trunk\n - labels: { env-sign: zzz }\n name: testing\n trafficPolicy:\n loadBalancer: { simple: ROUND_ROBIN }\n\n---\n\napiVersion: service.dubbo.apache.org/v1alpha1\nkind: VirtualService\nmetadata: {name: demo-route}\nspec:\n dubbo:\n - routedetail:\n - match:\n - sourceLabels: {trafficLabel: xxx}\n name: xxx-project\n route:\n - destination: {host: demo, subset: isolation}\n - match:\n - sourceLabels: {trafficLabel: testing-trunk}\n name: testing-trunk\n route:\n - destination: {host: demo, subset: testing-trunk}\n - name: testing\n route:\n - destination: {host: demo, subset: testing}\n services:\n - {regex: ccc}\n hosts: [demo]",ruleText:"",readonly:!1,headers:[]}),methods:{setHeaders:function(){this.headers=[{text:this.$t("appName"),value:"application",align:"left"},{text:this.$t("operation"),value:"operation",sortable:!1,width:"115px"}]},querySelections(e){this.timerID&&clearTimeout(this.timerID),this.timerID=setTimeout(()=>{e&&e.length>=4?(this.searchLoading=!0,this.typeAhead=this.$store.getters.getAppItems(e),this.searchLoading=!1,this.timerID=null):this.typeAhead=[]},500)},submit:function(){this.filter?(this.filter=this.filter.trim(),this.search(!0)):this.$notify.error("application is needed")},search:function(e){const t="/rules/route/mesh/?application="+this.filter;this.$axios.get(t).then(t=>{this.meshRoutingRules=t.data,e&&this.$router.push({path:"meshRule",query:{application:this.filter}})})},closeDialog:function(){this.ruleText=this.template,this.updateId="",this.application="",this.dialog=!1,this.readonly=!1},openDialog:function(){this.dialog=!0},openWarn:function(e,t){this.warn.title=e,this.warn.text=t,this.warn.display=!0},closeWarn:function(){this.warn.title="",this.warn.text="",this.warn.display=!1},saveItem:function(){const e={};if(e.meshRule=this.ruleText,!this.application)return void this.$notify.error("application is required");e.application=this.application;const t=this;this.updateId?"close"===this.updateId?this.closeDialog():(e.id=this.updateId,this.$axios.put("/rules/route/mesh/"+e.id,e).then(e=>{200===e.status&&(t.search(t.application,!0),t.closeDialog(),t.$notify.success("Update success"))})):this.$axios.post("/rules/route/mesh/",e).then(e=>{201===e.status&&(t.search(t.application,!0),t.filter=t.application,t.closeDialog(),t.$notify.success("Create success"))}).catch(e=>{console.log(e)})},itemOperation:function(e,t){const s=t.application;switch(e){case"visibility":this.$axios.get("/rules/route/mesh/"+s).then(e=>{const t=e.data;this.handleBalance(t,!0),this.updateId="close"});break;case"edit":this.$axios.get("/rules/route/mesh/"+s).then(e=>{const t=e.data;this.handleBalance(t,!1),this.updateId=s});break;case"delete":this.openWarn("warnDeleteMeshRule","application: "+t.application),this.warn.status.operation="delete",this.warn.status.id=s}},handleBalance:function(e,t){this.application=e.application,delete e.id,delete e.application,this.ruleText=e.meshRule,this.readonly=t,this.dialog=!0},setHeight:function(){this.height=.5*window.innerHeight},deleteItem:function(e){const t=e.id,s=e.operation;"delete"===s&&this.$axios.delete("/rules/route/mesh/"+t).then(e=>{200===e.status&&(this.warn.display=!1,this.search(this.filter,!1),this.$notify.success("Delete success"))})}},created(){this.setHeight()},computed:{area(){return this.$i18n.locale}},watch:{input(e){this.querySelections(e)},area(){this.setHeaders()}},mounted:function(){this.setHeaders(),this.$store.dispatch("loadInstanceAppItems"),this.ruleText=this.template;const e=this.$route.query;let t=null;Object.keys(e).forEach((function(s){"application"===s&&(t=e[s])})),null!==t&&(this.filter=t,this.search(!1))}},$e=we,Ie=Object(n["a"])($e,_e,ke,!1,null,null,null),De=Ie.exports,Se=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("v-container",{attrs:{"grid-list-xl":"",fluid:""}},[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{lg12:""}},[s("breadcrumb",{attrs:{title:"accessControl",items:e.breads}})],1),s("v-flex",{attrs:{lg12:""}},[s("v-card",{attrs:{flat:"",color:"transparent"}},[s("v-card-text",[s("v-form",[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",[s("v-combobox",{attrs:{id:"serviceSearch",loading:e.searchLoading,items:e.typeAhead,"search-input":e.input,flat:"","append-icon":"","hide-no-data":"",suffix:e.queryBy,label:e.$t("searchAccessRule")},on:{"update:searchInput":function(t){e.input=t},"update:search-input":function(t){e.input=t},keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.submit(t)},input:function(t){return e.split(t)}},model:{value:e.filter,callback:function(t){e.filter=t},expression:"filter"}})],1),s("v-menu",{staticClass:"hidden-xs-only"},[s("v-btn",{attrs:{slot:"activator",large:"",icon:""},slot:"activator"},[s("v-icon",[e._v("unfold_more")])],1),s("v-list",e._l(e.items,(function(t,a){return s("v-list-tile",{key:a,on:{click:function(t){e.selected=a}}},[s("v-list-tile-title",[e._v(e._s(e.$t(t.title)))])],1)})),1)],1),s("v-flex",{directives:[{name:"show",rawName:"v-show",value:0===e.selected,expression:"selected === 0"}],attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Version",hint:e.$t("dataIdVersionHint")},model:{value:e.serviceVersion4Search,callback:function(t){e.serviceVersion4Search=t},expression:"serviceVersion4Search"}})],1),s("v-flex",{directives:[{name:"show",rawName:"v-show",value:0===e.selected,expression:"selected === 0"}],attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{directives:[{name:"show",rawName:"v-show",value:0===e.selected,expression:"selected === 0"}],attrs:{label:"Group",hint:e.$t("dataIdGroupHint")},model:{value:e.serviceGroup4Search,callback:function(t){e.serviceGroup4Search=t},expression:"serviceGroup4Search"}})],1),s("v-btn",{attrs:{color:"primary",large:""},on:{click:e.submit}},[e._v(e._s(e.$t("search")))])],1)],1)],1)],1)],1)],1),s("v-flex",{attrs:{lg12:""}},[s("v-card",[s("v-toolbar",{staticClass:"elevation-0",attrs:{flat:"",color:"transparent"}},[s("v-toolbar-title",[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("searchResult")))])]),s("v-spacer"),s("v-btn",{staticClass:"mb-2",attrs:{outline:"",color:"primary"},on:{click:function(t){return t.stopPropagation(),e.toCreate(t)}}},[e._v(e._s(e.$t("create")))])],1),s("v-card-text",{directives:[{name:"show",rawName:"v-show",value:0===e.selected,expression:"selected === 0"}],staticClass:"pa-0"},[s("v-data-table",{staticClass:"elevation-0",attrs:{headers:e.serviceHeaders,items:e.accesses,loading:e.loading,"hide-actions":""},scopedSlots:e._u([{key:"items",fn:function(t){return[s("td",{staticClass:"text-xs-left"},[e._v(e._s(t.item.service))]),s("td",{staticClass:"text-xs-center px-0"},[s("v-tooltip",{attrs:{bottom:""}},[s("v-icon",{staticClass:"mr-2",attrs:{slot:"activator",small:"",color:"blue"},on:{click:function(s){return e.toEdit(t.item,!0)}},slot:"activator"},[e._v("visibility")]),s("span",[e._v(e._s(e.$t("view")))])],1),s("v-tooltip",{attrs:{bottom:""}},[s("v-icon",{staticClass:"mr-2",attrs:{slot:"activator",small:"",color:"blue"},on:{click:function(s){return e.toEdit(t.item,!1)}},slot:"activator"},[e._v("edit")]),s("span",[e._v(e._s(e.$t("edit")))])],1),s("v-tooltip",{attrs:{bottom:""}},[s("v-icon",{staticClass:"mr-2",attrs:{slot:"activator",small:"",color:"red"},on:{click:function(s){return e.toDelete(t.item)}},slot:"activator"},[e._v("delete")]),s("span",[e._v(e._s(e.$t("delete")))])],1)],1)]}}])})],1),s("v-card-text",{directives:[{name:"show",rawName:"v-show",value:1===e.selected,expression:"selected === 1"}],staticClass:"pa-0"},[s("v-data-table",{staticClass:"elevation-0",attrs:{headers:e.appHeaders,items:e.accesses,loading:e.loading,"hide-actions":""},scopedSlots:e._u([{key:"items",fn:function(t){return[s("td",{staticClass:"text-xs-left"},[e._v(e._s(t.item.application))]),s("td",{staticClass:"text-xs-center px-0"},[s("v-tooltip",{attrs:{bottom:""}},[s("v-icon",{staticClass:"mr-2",attrs:{slot:"activator",small:"",color:"blue"},on:{click:function(s){return e.toEdit(t.item,!0)}},slot:"activator"},[e._v("visibility")]),s("span",[e._v(e._s(e.$t("view")))])],1),s("v-tooltip",{attrs:{bottom:""}},[s("v-icon",{staticClass:"mr-2",attrs:{slot:"activator",small:"",color:"blue"},on:{click:function(s){return e.toEdit(t.item,!1)}},slot:"activator"},[e._v("edit")]),s("span",[e._v("Edit")])],1),s("v-tooltip",{attrs:{bottom:""}},[s("v-icon",{staticClass:"mr-2",attrs:{slot:"activator",small:"",color:"red"},on:{click:function(s){return e.toDelete(t.item)}},slot:"activator"},[e._v("delete")]),s("span",[e._v("Delete")])],1)],1)]}}])})],1)],1)],1),s("v-dialog",{attrs:{width:"800px",persistent:""},model:{value:e.modal.enable,callback:function(t){e.$set(e.modal,"enable",t)},expression:"modal.enable"}},[s("v-card",[s("v-card-title",{staticClass:"justify-center"},[s("span",{staticClass:"headline"},[e._v(e._s(e.modal.title)+" Access Control")])]),s("v-card-text",[s("v-form",{ref:"modalForm"},[s("v-layout",{attrs:{wrap:""}},[s("v-flex",{attrs:{xs24:"",sm12:"",md8:""}},[s("v-text-field",{attrs:{label:"Service class",hint:e.$t("dataIdClassHint")},model:{value:e.modal.service,callback:function(t){e.$set(e.modal,"service",t)},expression:"modal.service"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Version",hint:e.$t("dataIdVersionHint")},model:{value:e.modal.serviceVersion,callback:function(t){e.$set(e.modal,"serviceVersion",t)},expression:"modal.serviceVersion"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Group",hint:e.$t("dataIdGroupHint")},model:{value:e.modal.serviceGroup,callback:function(t){e.$set(e.modal,"serviceGroup",t)},expression:"modal.serviceGroup"}})],1)],1),s("v-text-field",{attrs:{label:e.$t("appName"),hint:e.$t("appNameHint"),readonly:e.modal.readonly},model:{value:e.modal.application,callback:function(t){e.$set(e.modal,"application",t)},expression:"modal.application"}}),s("v-layout",{attrs:{row:"","justify-space-between":""}},[s("v-flex",[s("v-text-field",{attrs:{readonly:e.modal.readonly,label:e.$t("whiteList"),hint:e.$t("whiteListHint")},model:{value:e.modal.whiteList,callback:function(t){e.$set(e.modal,"whiteList",t)},expression:"modal.whiteList"}})],1),s("v-spacer"),s("v-flex",[s("v-text-field",{attrs:{label:e.$t("blackList"),hint:e.$t("blackListHint"),readonly:e.modal.readonly},model:{value:e.modal.blackList,callback:function(t){e.$set(e.modal,"blackList",t)},expression:"modal.blackList"}})],1)],1)],1)],1),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{color:"darken-1",flat:""},on:{click:function(t){return e.closeModal()}}},[e._v(e._s(e.$t("close")))]),s("v-btn",{attrs:{color:"primary",depressed:""},on:{click:e.modal.click}},[e._v(e._s(e.modal.saveBtn))])],1)],1)],1),s("v-dialog",{attrs:{persistent:"","max-width":"500px"},model:{value:e.confirm.enable,callback:function(t){e.$set(e.confirm,"enable",t)},expression:"confirm.enable"}},[s("v-card",[s("v-card-title",{staticClass:"headline"},[e._v(e._s(this.confirm.title))]),s("v-card-text",[e._v(e._s(this.confirm.text))]),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{color:"darken-1",flat:""},on:{click:function(t){e.confirm.enable=!1}}},[e._v(e._s(e.$t("disagree")))]),s("v-btn",{attrs:{color:"primary",depressed:""},on:{click:function(t){return e.deleteItem(e.confirm.id)}}},[e._v(e._s(e.$t("agree")))])],1)],1)],1)],1)},Ce=[],Ae={name:"AccessControl",data:()=>({items:[{id:0,title:"serviceName",value:"service"},{id:1,title:"app",value:"application"}],breads:[{text:"serviceGovernance",href:""},{text:"accessControl",href:""}],selected:0,filter:null,loading:!1,serviceHeaders:[],appHeaders:[],accesses:[],searchLoading:!1,typeAhead:[],input:null,timerID:null,serviceVersion4Search:"",serviceGroup4Search:"",modal:{enable:!1,readonly:!1,title:"Create New",saveBtn:"Create",click:()=>{},id:null,service:null,serviceVersion:"",serviceGroup:"",application:null,content:"",blackList:"",whiteList:"",template:"blacklist:\n - 1.1.1.1\n - 2.2.2.2\nwhitelist:\n - 3.3.3.3\n - 4.4.*\n"},services:[],confirm:{enable:!1,title:"",text:"",id:null},snackbar:{enable:!1,text:""}}),methods:{setAppHeaders(){this.appHeaders=[{text:this.$t("appName"),value:"application",align:"left"},{text:this.$t("operation"),value:"operation",sortable:!1,width:"115px"}]},setServiceHeaders(){this.serviceHeaders=[{text:this.$t("serviceName"),value:"service",align:"left"},{text:this.$t("operation"),value:"operation",sortable:!1,width:"115px"}]},querySelections(e){this.timerID&&clearTimeout(this.timerID),this.timerID=setTimeout(()=>{e&&e.length>=4?(this.searchLoading=!0,0===this.selected?this.typeAhead=this.$store.getters.getServiceItems(e):1===this.selected&&(this.typeAhead=this.$store.getters.getConsumerItems(e)),this.searchLoading=!1,this.timerID=null):this.typeAhead=[]},500)},submit:function(){this.filter=document.querySelector("#serviceSearch").value.trim(),this.search(!0)},split:function(e){if(0===this.selected){const t=e.split("/"),s=e.split(":");t.length>1?this.serviceGroup4Search=t[0]:this.serviceGroup4Search="",s.length>1?this.serviceVersion4Search=s[1]:this.serviceVersion4Search="";const a=s[0].split("/");1===a.length?this.filter=a[0]:this.filter=a[1]}},search(e){if(!this.filter)return void this.$notify.error("Either service or application is needed");const t=this.items[this.selected].value;this.loading=!0,e&&(0===this.selected?this.$router.push({path:"access",query:{service:this.filter,serviceVersion:this.serviceVersion4Search,serviceGroup:this.serviceGroup4Search}}):1===this.selected&&this.$router.push({path:"access",query:{application:this.filter}}));const s="/rules/access/?"+t+"="+this.filter+"&serviceVersion="+this.serviceVersion4Search+"&serviceGroup="+this.serviceGroup4Search;this.$axios.get(s).then(e=>{this.accesses=e.data,this.loading=!1}).catch(e=>{this.showSnackbar("error",e.response.data.message),this.loading=!1})},closeModal(){this.modal.enable=!1,this.modal.id=null,this.$refs.modalForm.reset()},toCreate(){Object.assign(this.modal,{enable:!0,title:"Create New",saveBtn:"Create",readonly:!1,content:this.modal.template,click:this.createItem})},createItem(){if(this.filter="",!this.modal.service&&!this.modal.application)return void this.$notify.error("Either service or application is needed");if(this.modal.service&&this.modal.application)return void this.$notify.error("You can not set both service ID and application name");const e=this;let t=[],s=[];this.modal.blackList&&(t=this.modal.blackList.split(",")),this.modal.whiteList&&(s=this.modal.whiteList.split(",")),this.$axios.post("/rules/access",{service:this.modal.service,serviceVersion:this.modal.serviceVersion,serviceGroup:this.modal.serviceGroup,application:this.modal.application,whitelist:s,blacklist:t}).then(t=>{201===t.status&&(e.modal.service?(e.selected=0,e.filter=e.modal.service):(e.selected=1,e.filter=e.modal.application),this.search(),this.closeModal()),this.showSnackbar("success","Create success")}).catch(e=>this.showSnackbar("error",e.response.data.message))},toEdit(e,t){Object.assign(this.modal,{enable:!0,readonly:t,title:"Edit",saveBtn:"Update",click:this.editItem,id:e.id,service:e.service,serviceVersion:e.serviceVersion,serviceGroup:e.serviceGroup,application:e.application,whiteList:e.whitelist,blackList:e.blacklist})},editItem(){let e=[];this.modal.blackList&&(e=this.modal.blackList.split(","));let t=[];this.modal.whiteList&&(t=this.modal.whiteList.split(","));const s=this;this.$axios.put("/rules/access/"+this.modal.id,{whitelist:t,blacklist:e,application:this.modal.application,service:this.modal.service,serviceVersion:this.modal.serviceVersion,serviceGroup:this.modal.serviceGroup}).then(e=>{200===e.status&&(s.modal.service?(s.selected=0,s.filter=s.modal.service):(s.selected=1,s.filter=s.modal.application),s.closeModal(),s.search()),this.showSnackbar("success","Update success")}).catch(e=>this.showSnackbar("error",e.response.data.message))},toDelete(e){Object.assign(this.confirm,{enable:!0,title:"warnDeleteAccessControl",text:"Id: "+e.id,id:e.id})},deleteItem(e){this.$axios.delete("/rules/access/"+e).then(e=>{this.showSnackbar("success","Delete success"),this.search(this.filter)}).catch(e=>this.showSnackbar("error",e.response.data.message))},showSnackbar(e,t){this.$notify(t,e),this.confirm.enable=!1}},computed:{queryBy(){return this.$t("by")+this.$t(this.items[this.selected].title)},area(){return this.$i18n.locale}},watch:{input(e){this.querySelections(e)},area(){this.setAppHeaders(),this.setServiceHeaders()}},mounted(){this.setAppHeaders(),this.setServiceHeaders(),this.$store.dispatch("loadServiceItems"),this.$store.dispatch("loadConsumerItems");const e=this.$route.query;let t=null,s=null;"service"in e&&(this.filter=e.service,e.serviceVersion&&(t=e.serviceVersion),e.serviceGroup&&(s=e.serviceGroup),this.selected=0),"application"in e&&(this.filter=e.application,this.selected=1),null!=t&&(this.serviceVersion4Search=e.serviceVersion),null!=s&&(this.serviceGroup4Search=e.serviceGroup),null!==this.filter&&this.search()},components:{Breadcrumb:N}},Re=Ae,Ee=Object(n["a"])(Re,Se,Ce,!1,null,null,null),Te=Ee.exports,Le=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("v-container",{attrs:{"grid-list-xl":"",fluid:""}},[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{lg12:""}},[s("breadcrumb",{attrs:{title:"loadBalance",items:e.breads}})],1),s("v-flex",{attrs:{lg12:""}},[s("v-card",{attrs:{flat:"",color:"transparent"}},[s("v-card-text",[s("v-form",[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",[s("v-combobox",{attrs:{id:"serviceSearch",loading:e.searchLoading,items:e.typeAhead,"search-input":e.input,flat:"","append-icon":"","hide-no-data":"",suffix:e.queryBy,label:e.$t("searchBalanceRule")},on:{"update:searchInput":function(t){e.input=t},"update:search-input":function(t){e.input=t},keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.submit(t)},input:function(t){return e.split(t)}},model:{value:e.filter,callback:function(t){e.filter=t},expression:"filter"}})],1),s("v-menu",{staticClass:"hidden-xs-only"},[s("v-btn",{attrs:{slot:"activator",large:"",icon:""},slot:"activator"},[s("v-icon",[e._v("unfold_more")])],1),s("v-list",e._l(e.items,(function(t,a){return s("v-list-tile",{key:a,on:{click:function(t){e.selected=a}}},[s("v-list-tile-title",[e._v(e._s(e.$t(t.title)))])],1)})),1)],1),s("v-flex",{directives:[{name:"show",rawName:"v-show",value:0===e.selected,expression:"selected === 0"}],attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{directives:[{name:"show",rawName:"v-show",value:0===e.selected,expression:"selected === 0"}],attrs:{label:"Version",hint:e.$t("dataIdVersionHint")},model:{value:e.serviceVersion4Search,callback:function(t){e.serviceVersion4Search=t},expression:"serviceVersion4Search"}})],1),s("v-flex",{directives:[{name:"show",rawName:"v-show",value:0===e.selected,expression:"selected === 0"}],attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{directives:[{name:"show",rawName:"v-show",value:0===e.selected,expression:"selected === 0"}],attrs:{label:"Group",hint:e.$t("dataIdGroupHint")},model:{value:e.serviceGroup4Search,callback:function(t){e.serviceGroup4Search=t},expression:"serviceGroup4Search"}})],1),s("v-btn",{attrs:{color:"primary",large:""},on:{click:e.submit}},[e._v(e._s(e.$t("search")))])],1)],1)],1)],1)],1)],1),s("v-flex",{attrs:{lg12:""}},[s("v-card",[s("v-toolbar",{staticClass:"elevation-0",attrs:{flat:"",color:"transparent"}},[s("v-toolbar-title",[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("searchResult")))])]),s("v-spacer"),s("v-btn",{staticClass:"mb-2",attrs:{outline:"",color:"primary"},on:{click:function(t){return t.stopPropagation(),e.openDialog(t)}}},[e._v(e._s(e.$t("create")))])],1),s("v-card-text",{directives:[{name:"show",rawName:"v-show",value:0===e.selected,expression:"selected === 0"}],staticClass:"pa-0"},[s("v-data-table",{staticClass:"elevation-0",attrs:{headers:e.serviceHeaders,items:e.loadBalances,"hide-actions":""},scopedSlots:e._u([{key:"items",fn:function(t){return[s("td",{staticClass:"text-xs-left"},[e._v(e._s(t.item.service))]),s("td",{staticClass:"text-xs-left"},[e._v(e._s(t.item.methodName))]),s("td",{staticClass:"text-xs-center px-0"},e._l(e.operations,(function(a){return s("v-tooltip",{key:a.id,attrs:{bottom:""}},[s("v-icon",{staticClass:"mr-2",attrs:{slot:"activator",small:""},on:{click:function(s){return e.itemOperation(a.icon,t.item)}},slot:"activator"},[e._v(" "+e._s(a.icon)+" ")]),s("span",[e._v(e._s(e.$t(a.tooltip)))])],1)})),1)]}}])})],1),s("v-card-text",{directives:[{name:"show",rawName:"v-show",value:1===e.selected,expression:"selected === 1"}],staticClass:"pa-0"},[s("v-data-table",{staticClass:"elevation-0",attrs:{headers:e.appHeaders,items:e.loadBalances,"hide-actions":""},scopedSlots:e._u([{key:"items",fn:function(t){return[s("td",{staticClass:"text-xs-left"},[e._v(e._s(t.item.application))]),s("td",{staticClass:"text-xs-left"},[e._v(e._s(t.item.methodName))]),s("td",{staticClass:"text-xs-center px-0"},e._l(e.operations,(function(a){return s("v-tooltip",{key:a.id,attrs:{bottom:""}},[s("v-icon",{staticClass:"mr-2",attrs:{slot:"activator",small:""},on:{click:function(s){return e.itemOperation(a.icon,t.item)}},slot:"activator"},[e._v(" "+e._s(a.icon)+" ")]),s("span",[e._v(e._s(e.$t(a.tooltip)))])],1)})),1)]}}])})],1)],1)],1),s("v-dialog",{attrs:{width:"800px",persistent:""},model:{value:e.dialog,callback:function(t){e.dialog=t},expression:"dialog"}},[s("v-card",[s("v-card-title",{staticClass:"justify-center"},[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("createNewLoadBalanceRule")))])]),s("v-card-text",[s("v-layout",{attrs:{wrap:""}},[s("v-flex",{attrs:{xs24:"",sm12:"",md8:""}},[s("v-text-field",{attrs:{label:"Service class",hint:e.$t("dataIdClassHint")},model:{value:e.service,callback:function(t){e.service=t},expression:"service"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Version",hint:e.$t("dataIdVersionHint")},model:{value:e.serviceVersion,callback:function(t){e.serviceVersion=t},expression:"serviceVersion"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Group",hint:e.$t("dataIdGroupHint")},model:{value:e.serviceGroup,callback:function(t){e.serviceGroup=t},expression:"serviceGroup"}})],1)],1),s("v-text-field",{attrs:{label:e.$t("appName"),hint:e.$t("appNameHint"),readonly:e.readonly},model:{value:e.application,callback:function(t){e.application=t},expression:"application"}}),s("v-layout",{attrs:{row:"","justify-space-between":""}},[s("v-flex",[s("v-text-field",{attrs:{label:e.$t("method"),hint:e.$t("methodHint"),readonly:e.readonly},model:{value:e.rule.method,callback:function(t){e.$set(e.rule,"method",t)},expression:"rule.method"}})],1),s("v-spacer"),s("v-flex",[s("v-select",{attrs:{items:e.rule.strategyKey,label:e.$t("strategy"),readonly:e.readonly},model:{value:e.rule.strategy,callback:function(t){e.$set(e.rule,"strategy",t)},expression:"rule.strategy"}})],1)],1)],1),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{color:"darken-1",flat:""},nativeOn:{click:function(t){return e.closeDialog(t)}}},[e._v(e._s(e.$t("close")))]),s("v-btn",{attrs:{color:"primary darken-1",depressed:""},nativeOn:{click:function(t){return e.saveItem(t)}}},[e._v(e._s(e.$t("save")))])],1)],1)],1),s("v-dialog",{attrs:{persistent:"","max-width":"500px"},model:{value:e.warn,callback:function(t){e.warn=t},expression:"warn"}},[s("v-card",[s("v-card-title",{staticClass:"headline"},[e._v(e._s(e.$t(this.warnTitle)))]),s("v-card-text",[e._v(e._s(this.warnText))]),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{color:"darken-1",flat:""},nativeOn:{click:function(t){return e.closeWarn(t)}}},[e._v(e._s(e.$t("cancel")))]),s("v-btn",{attrs:{color:"primary darken-1",depressed:""},nativeOn:{click:function(t){return e.deleteItem(e.warnStatus.id)}}},[e._v(e._s(e.$t("confirm")))])],1)],1)],1)],1)},Ve=[],He={components:{Breadcrumb:N},data:()=>({items:[{id:0,title:"serviceName",value:"service"},{id:1,title:"app",value:"application"}],breads:[{text:"serviceGovernance",href:""},{text:"loadBalance",href:""}],selected:0,dropdown_font:["Service","App","IP"],ruleKeys:["method","strategy"],pattern:"Service",filter:"",updateId:"",dialog:!1,warn:!1,application:"",service:"",serviceVersion4Search:"",serviceGroup4Search:"",serviceVersion:"",serviceGroup:"",warnTitle:"",warnText:"",warnStatus:{},height:0,searchLoading:!1,typeAhead:[],input:null,timerID:null,operations:[{id:0,icon:"visibility",tooltip:"view"},{id:1,icon:"edit",tooltip:"edit"},{id:3,icon:"delete",tooltip:"delete"}],loadBalances:[],template:"methodName: * # * for all methods\nstrategy: # leastactive, random, roundrobin",rule:{method:"",strategy:"",strategyKey:[{text:"Least Active",value:"leastactive"},{text:"Random",value:"random"},{text:"Round Robin",value:"roundrobin"}]},ruleText:"",readonly:!1,serviceHeaders:[],appHeaders:[]}),methods:{setServiceHeaders:function(){this.serviceHeaders=[{text:this.$t("serviceName"),value:"service",align:"left"},{text:this.$t("method"),value:"method",align:"left"},{text:this.$t("operation"),value:"operation",sortable:!1,width:"115px"}]},setAppHeaders:function(){this.appHeaders=[{text:this.$t("appName"),value:"application",align:"left"},{text:this.$t("method"),value:"method",align:"left"},{text:this.$t("operation"),value:"operation",sortable:!1,width:"115px"}]},querySelections(e){this.timerID&&clearTimeout(this.timerID),this.timerID=setTimeout(()=>{e&&e.length>=4?(this.searchLoading=!0,0===this.selected?this.typeAhead=this.$store.getters.getServiceItems(e):1===this.selected&&(this.typeAhead=this.$store.getters.getAppItems(e)),this.searchLoading=!1,this.timerID=null):this.typeAhead=[]},500)},submit:function(){this.filter=document.querySelector("#serviceSearch").value.trim(),this.search(!0)},split:function(e){if(0===this.selected){const t=e.split("/"),s=e.split(":");t.length>1?this.serviceGroup4Search=t[0]:this.serviceGroup4Search="",s.length>1?this.serviceVersion4Search=s[1]:this.serviceVersion4Search="";const a=s[0].split("/");1===a.length?this.filter=a[0]:this.filter=a[1]}},search:function(e){if(!this.filter)return void this.$notify.error("Either service or application is needed");const t=this.items[this.selected].value,s="/rules/balancing/?"+t+"="+this.filter+"&serviceVersion="+this.serviceVersion4Search+"&serviceGroup="+this.serviceGroup4Search;this.$axios.get(s).then(t=>{this.loadBalances=t.data,e&&(0===this.selected?this.$router.push({path:"loadbalance",query:{service:this.filter}}):1===this.selected&&this.$router.push({path:"loadbalance",query:{application:this.filter}}))})},closeDialog:function(){this.ruleText=this.template,this.service="",this.dialog=!1,this.updateId="",this.readonly=!1},openDialog:function(){this.dialog=!0},openWarn:function(e,t){this.warnTitle=e,this.warnText=t,this.warn=!0},closeWarn:function(){this.warnTitle="",this.warnText="",this.warn=!1},saveItem:function(){this.ruleText=this.verifyRuleText(this.ruleText);const e={};if(!this.service&&!this.application)return void this.$notify.error("Either service or application is needed");if(this.service&&this.application)return void this.$notify.error("You can not set both service ID and application name");const t=this;e.service=this.service,e.serviceVersion=this.serviceVersion,e.serviceGroup=this.serviceGroup,e.application=this.application,e.methodName=this.rule.method,e.strategy=this.rule.strategy,this.updateId?"close"===this.updateId?this.closeDialog():(e.id=this.updateId,this.$axios.put("/rules/balancing/"+e.id,e).then(e=>{200===e.status&&(t.service?(t.selected=0,t.filter=t.service,t.search(!0)):(t.selected=1,t.filter=t.application,t.search(!0)),this.closeDialog(),this.$notify.success("Update success"))})):this.$axios.post("/rules/balancing",e).then(e=>{201===e.status&&(t.service?(t.selected=0,t.filter=t.service,t.search(!0)):(t.selected=1,t.filter=t.application,t.search(!0)),this.closeDialog(),this.$notify.success("Create success"))})},itemOperation:function(e,t){const s=t.id;switch(e){case"visibility":this.$axios.get("/rules/balancing/"+s).then(e=>{const t=e.data;this.handleBalance(t,!0),this.updateId="close"});break;case"edit":this.$axios.get("/rules/balancing/"+s).then(e=>{const t=e.data;this.handleBalance(t,!1),this.updateId=s});break;case"delete":this.openWarn("warnDeleteBalancing","service: "+s),this.warnStatus.operation="delete",this.warnStatus.id=s}},handleBalance:function(e,t){this.service=e.service,this.application=e.application,this.serviceVersion=e.serviceVersion,this.serviceGroup=e.serviceGroup,this.rule.method=e.methodName,this.rule.strategy=e.strategy,this.readonly=t,this.dialog=!0},setHeight:function(){this.height=.5*window.innerHeight},deleteItem:function(e){this.$axios.delete("/rules/balancing/"+e).then(e=>{200===e.status&&(this.warn=!1,this.search(!1),this.$notify.success("Delete success"))})},verifyRuleText:function(e){const t=e.split("\n");for(let a=0;a({items:[{id:0,title:"serviceName",value:"service"},{id:1,title:"app",value:"application"}],breads:[{text:"serviceGovernance",href:""},{text:"weightAdjust",href:""}],selected:0,dropdown_font:["Service","App","IP"],ruleKeys:["weight","address"],pattern:"Service",filter:"",dialog:!1,warn:!1,application:"",updateId:"",service:"",warnTitle:"",warnText:"",warnStatus:{},height:0,searchLoading:!1,typeAhead:[],input:null,timerID:null,serviceVersion4Search:"",serviceGroup4Search:"",serviceVersion:"",serviceGroup:"",operations:[{id:0,icon:"visibility",tooltip:"view"},{id:1,icon:"edit",tooltip:"edit"},{id:3,icon:"delete",tooltip:"delete"}],weights:[],template:"weight: 100 # 100 for default\naddresses: # addresses's ip\n - 192.168.0.1\n - 192.168.0.2",ruleText:"",rule:{weight:100,address:""},readonly:!1,serviceHeaders:[],appHeaders:[]}),methods:{setServiceHeaders:function(){this.serviceHeaders=[{text:this.$t("serviceName"),value:"service",align:"left"},{text:this.$t("weight"),value:"weight",align:"left"},{text:this.$t("operation"),value:"operation",sortable:!1,width:"115px"}]},querySelections(e){this.timerID&&clearTimeout(this.timerID),this.timerID=setTimeout(()=>{e&&e.length>=4?(this.searchLoading=!0,0===this.selected?this.typeAhead=this.$store.getters.getServiceItems(e):1===this.selected&&(this.typeAhead=this.$store.getters.getAppItems(e)),this.searchLoading=!1,this.timerID=null):this.typeAhead=[]},500)},setAppHeaders:function(){this.appHeaders=[{text:this.$t("appName"),value:"application",align:"left"},{text:this.$t("weight"),value:"weight",align:"left"},{text:this.$t("operation"),value:"operation",sortable:!1,width:"115px"}]},submit:function(){this.filter=document.querySelector("#serviceSearch").value.trim(),this.search(!0)},split:function(e){if(0===this.selected){const t=e.split("/"),s=e.split(":");t.length>1?this.serviceGroup4Search=t[0]:this.serviceGroup4Search="",s.length>1?this.serviceVersion4Search=s[1]:this.serviceVersion4Search="";const a=s[0].split("/");1===a.length?this.filter=a[0]:this.filter=a[1]}},search:function(e){if(!this.filter)return void this.$notify.error("Either service or application is needed");const t=this.items[this.selected].value,s="/rules/weight/?"+t+"="+this.filter+"&serviceVersion="+this.serviceVersion4Search+"&serviceGroup="+this.serviceGroup4Search;this.$axios.get(s).then(t=>{this.weights=t.data,e&&(0===this.selected?this.$router.push({path:"weight",query:{service:this.filter}}):1===this.selected&&this.$router.push({path:"weight",query:{application:this.filter}}))})},closeDialog:function(){this.ruleText=this.template,this.rule.address="",this.rule.weight=100,this.service="",this.dialog=!1,this.readonly=!1},openDialog:function(){this.updateId="",this.dialog=!0},openWarn:function(e,t){this.warnTitle=e,this.warnText=t,this.warn=!0},closeWarn:function(){this.warnTitle="",this.warnText="",this.warn=!1},saveItem:function(){const e={};if(!this.service&&!this.application)return void this.$notify.error("Either service or application is needed");if(this.service&&this.application)return void this.$notify.error("You can not set both service ID and application name");e.service=this.service,e.serviceVersion=this.serviceVersion,e.serviceGroup=this.serviceGroup,e.application=this.application,e.weight=this.rule.weight,e.addresses=this.rule.address.split(",");const t=this;this.updateId?"close"===this.updateId?this.closeDialog():(e.id=this.updateId,this.$axios.put("/rules/weight/"+e.id,e).then(e=>{200===e.status&&(t.service?(t.selected=0,t.search(t.service,!0),t.filter=t.service):(t.selected=1,t.search(t.application,!0),t.filter=t.application),this.closeDialog(),this.$notify.success("Update success"))})):this.$axios.post("/rules/weight",e).then(e=>{201===e.status&&(this.service?(t.selected=0,t.search(t.service,!0),t.filter=t.service):(t.selected=1,t.search(t.application,!0),t.filter=t.application),t.closeDialog(),t.$notify.success("Create success"))})},itemOperation:function(e,t){const s=t.id;switch(e){case"visibility":this.$axios.get("/rules/weight/"+s).then(e=>{const t=e.data;this.handleWeight(t,!0),this.updateId="close"});break;case"edit":this.$axios.get("/rules/weight/"+s).then(e=>{const t=e.data;this.handleWeight(t,!1),this.updateId=s});break;case"delete":this.openWarn("warnDeleteWeightAdjust","service: "+s),this.warnStatus.operation="delete",this.warnStatus.id=s}},handleWeight:function(e,t){this.service=e.service,this.serviceVersion=e.serviceVersion,this.serviceGroup=e.serviceGroup,this.application=e.application,this.rule.weight=e.weight,this.rule.address=e.addresses.join(","),this.readonly=t,this.dialog=!0},setHeight:function(){this.height=.5*window.innerHeight},deleteItem:function(e){this.$axios.delete("/rules/weight/"+e.id).then(e=>{200===e.status&&(this.warn=!1,this.search(this.filter,!1),this.$notify.success("Delete success"))})}},created(){this.setHeight()},computed:{queryBy(){return this.$t("by")+this.$t(this.items[this.selected].title)},area(){return this.$i18n.locale}},watch:{area(){this.setAppHeaders(),this.setServiceHeaders()},input(e){this.querySelections(e)}},mounted:function(){this.setAppHeaders(),this.setServiceHeaders(),this.$store.dispatch("loadServiceItems"),this.$store.dispatch("loadAppItems"),this.ruleText=this.template;const e=this.$route.query;let t=null,s=null,a=null;const i=this;Object.keys(e).forEach((function(r){"service"===r&&(a=e[r],e.serviceVersion&&(t=e.serviceVersion),e.serviceGroup&&(s=e.serviceGroup),i.selected=0),"application"===r&&(a=e[r],i.selected=1)})),null!=t&&(this.serviceVersion4Search=e.serviceVersion),null!=s&&(this.serviceGroup4Search=e.serviceGroup),null!==a&&(this.filter=a,this.search(!1))}},Pe=je,qe=Object(n["a"])(Pe,Ne,Me,!1,null,"bc3e304e",null),Qe=qe.exports,Fe=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("v-container",{attrs:{"grid-list-xl":"",fluid:""}},[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{lg12:""}},[s("breadcrumb",{attrs:{title:"dynamicConfig",items:e.breads}}),s("v-flex",{attrs:{lg12:""}},[s("a",{attrs:{href:"https://cn.dubbo.apache.org/zh-cn/overview/core-features/traffic/configuration-rule/"}},[e._v("动态配置规则")])])],1),s("v-flex",{attrs:{lg12:""}},[s("v-card",{attrs:{flat:"",color:"transparent"}},[s("v-card-text",[s("v-form",[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",[s("v-combobox",{attrs:{id:"serviceSearch",loading:e.searchLoading,items:e.typeAhead,"search-input":e.input,flat:"","append-icon":"","hide-no-data":"",suffix:e.queryBy,label:e.$t("searchDynamicConfig")},on:{"update:searchInput":function(t){e.input=t},"update:search-input":function(t){e.input=t},keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.submit(t)},input:function(t){return e.split(t)}},model:{value:e.filter,callback:function(t){e.filter=t},expression:"filter"}})],1),s("v-menu",{staticClass:"hidden-xs-only"},[s("v-btn",{attrs:{slot:"activator",large:"",icon:""},slot:"activator"},[s("v-icon",[e._v("unfold_more")])],1),s("v-list",e._l(e.items,(function(t,a){return s("v-list-tile",{key:a,on:{click:function(t){e.selected=a}}},[s("v-list-tile-title",[e._v(e._s(e.$t(t.service)))])],1)})),1)],1),s("v-flex",{directives:[{name:"show",rawName:"v-show",value:0===e.selected,expression:"selected === 0"}],attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Version",hint:e.$t("dataIdVersionHint")},model:{value:e.serviceVersion4Search,callback:function(t){e.serviceVersion4Search=t},expression:"serviceVersion4Search"}})],1),s("v-flex",{directives:[{name:"show",rawName:"v-show",value:0===e.selected,expression:"selected === 0"}],attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Group",hint:e.$t("dataIdGroupHint")},model:{value:e.serviceGroup4Search,callback:function(t){e.serviceGroup4Search=t},expression:"serviceGroup4Search"}})],1),s("v-btn",{attrs:{color:"primary",large:""},on:{click:e.submit}},[e._v(e._s(e.$t("search")))])],1)],1)],1)],1)],1)],1),s("v-flex",{attrs:{lg12:""}},[s("v-card",[s("v-toolbar",{staticClass:"elevation-0",attrs:{flat:"",color:"transparent"}},[s("v-toolbar-title",[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("searchResult")))])]),s("v-spacer"),s("v-btn",{staticClass:"mb-2",attrs:{outline:"",color:"primary"},on:{click:function(t){return t.stopPropagation(),e.openDialog(t)}}},[e._v(e._s(e.$t("create")))])],1),s("v-card-text",{directives:[{name:"show",rawName:"v-show",value:0===e.selected,expression:"selected === 0"}],staticClass:"pa-0"},[s("v-data-table",{staticClass:"elevation-0",attrs:{headers:e.serviceHeaders,items:e.serviceConfigs,"hide-actions":""},scopedSlots:e._u([{key:"items",fn:function(t){return[s("td",{staticClass:"text-xs-left"},[e._v(e._s(t.item.service))]),s("td",{staticClass:"text-xs-center px-0"},e._l(e.operations,(function(a){return s("v-tooltip",{key:a.id,attrs:{bottom:""}},[s("v-icon",{staticClass:"mr-2",attrs:{slot:"activator",small:""},on:{click:function(s){e.itemOperation(a.icon(t.item),t.item)}},slot:"activator"},[e._v(" "+e._s(a.icon(t.item))+" ")]),s("span",[e._v(e._s(e.$t(a.tooltip(t.item))))])],1)})),1)]}}])})],1),s("v-card-text",{directives:[{name:"show",rawName:"v-show",value:1===e.selected,expression:"selected === 1"}],staticClass:"pa-0"},[s("v-data-table",{staticClass:"elevation-0",attrs:{headers:e.appHeaders,items:e.appConfigs,"hide-actions":""},scopedSlots:e._u([{key:"items",fn:function(t){return[s("td",{staticClass:"text-xs-left"},[e._v(e._s(t.item.application))]),s("td",{staticClass:"text-xs-center px-0"},e._l(e.operations,(function(a){return s("v-tooltip",{key:a.id,attrs:{bottom:""}},[s("v-icon",{staticClass:"mr-2",attrs:{slot:"activator",small:""},on:{click:function(s){e.itemOperation(a.icon(t.item),t.item)}},slot:"activator"},[e._v(" "+e._s(a.icon(t.item))+" ")]),s("span",[e._v(e._s(e.$t(a.tooltip(t.item))))])],1)})),1)]}}])})],1)],1)],1),s("v-dialog",{attrs:{width:"800px",persistent:""},model:{value:e.dialog,callback:function(t){e.dialog=t},expression:"dialog"}},[s("v-card",[s("v-card-title",{staticClass:"justify-center"},[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("createNewDynamicConfigRule")))])]),s("v-card-text",[s("v-layout",{attrs:{wrap:""}},[s("v-flex",{attrs:{xs24:"",sm12:"",md8:""}},[s("v-text-field",{attrs:{label:"Service class",hint:e.$t("dataIdClassHint")},model:{value:e.service,callback:function(t){e.service=t},expression:"service"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Version",hint:e.$t("dataIdVersionHint")},model:{value:e.serviceVersion,callback:function(t){e.serviceVersion=t},expression:"serviceVersion"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Group",hint:e.$t("dataIdGroupHint")},model:{value:e.serviceGroup,callback:function(t){e.serviceGroup=t},expression:"serviceGroup"}})],1)],1),s("v-text-field",{attrs:{label:"Application Name",hint:"Application name the service belongs to"},model:{value:e.application,callback:function(t){e.application=t},expression:"application"}}),s("v-subheader",{staticClass:"pa-0 mt-3"},[e._v(e._s(e.$t("ruleContent")))]),s("ace-editor",{attrs:{readonly:e.readonly},model:{value:e.ruleText,callback:function(t){e.ruleText=t},expression:"ruleText"}})],1),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{color:"darken-1",flat:""},nativeOn:{click:function(t){return e.closeDialog(t)}}},[e._v(e._s(e.$t("close")))]),s("v-btn",{attrs:{color:"primary darken-1",depressed:""},nativeOn:{click:function(t){return e.saveItem(t)}}},[e._v(e._s(e.$t("save")))])],1)],1)],1),s("v-dialog",{attrs:{persistent:"","max-width":"500px"},model:{value:e.warn,callback:function(t){e.warn=t},expression:"warn"}},[s("v-card",[s("v-card-title",{staticClass:"headline"},[e._v(e._s(e.$t(this.warnTitle)))]),s("v-card-text",[e._v(e._s(this.warnText))]),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{color:"darken-1",flat:""},nativeOn:{click:function(t){return e.closeWarn(t)}}},[e._v(e._s(e.$t("cancel")))]),s("v-btn",{attrs:{color:"primary darken-1",depressed:""},nativeOn:{click:function(t){return e.deleteItem(e.warnStatus)}}},[e._v(e._s(e.$t("confirm")))])],1)],1)],1)],1)},We=[],Ue={components:{AceEditor:oe,Breadcrumb:N},data:()=>({items:[{id:0,title:"serviceName",value:"service"},{id:1,title:"app",value:"application"}],breads:[{text:"serviceGovernance",href:""},{text:"dynamicConfig",href:""}],selected:0,dropdown_font:["Service","App","IP"],pattern:"Service",filter:"",dialog:!1,warn:!1,application:"",updateId:"",service:"",serviceVersion:"",serviceGroup:"",serviceVersion4Search:"",serviceGroup4Search:"",warnTitle:"",warnText:"",warnStatus:{},height:0,operations:de,searchLoading:!1,typeAhead:[],input:null,timerID:null,serviceConfigs:[],appConfigs:[],template:"configVersion: 'v3.0'\nenabled: true\nconfigs: \n - side: consumer\n parameters:\n retries: '4'",ruleText:"",readonly:!1,serviceHeaders:[],appHeaders:[]}),methods:{setAppHeaders:function(){this.appHeaders=[{text:this.$t("appName"),value:"application",align:"left"},{text:this.$t("operation"),value:"operation",sortable:!1,width:"115px"}]},setServiceHeaders:function(){this.serviceHeaders=[{text:this.$t("serviceName"),value:"service",align:"left"},{text:this.$t("operation"),value:"operation",sortable:!1,width:"115px"}]},querySelections(e){this.timerID&&clearTimeout(this.timerID),this.timerID=setTimeout(()=>{e&&e.length>=4?(this.searchLoading=!0,0===this.selected?this.typeAhead=this.$store.getters.getServiceItems(e):1===this.selected&&(this.typeAhead=this.$store.getters.getAppItems(e)),this.searchLoading=!1,this.timerID=null):this.typeAhead=[]},500)},submit:function(){this.filter=document.querySelector("#serviceSearch").value.trim(),this.search(!0)},split:function(e){if(0===this.selected){const t=e.split("/"),s=e.split(":");t.length>1?this.serviceGroup4Search=t[0]:this.serviceGroup4Search="",s.length>1?this.serviceVersion4Search=s[1]:this.serviceVersion4Search="";const a=s[0].split("/");1===a.length?this.filter=a[0]:this.filter=a[1]}},search:function(e){if(!this.filter)return void this.$notify.error("Either service or application is needed");const t=this.items[this.selected].value,s="/rules/override/?"+t+"="+this.filter+"&serviceVersion="+this.serviceVersion4Search+"&serviceGroup="+this.serviceGroup4Search;this.$axios.get(s).then(t=>{0===this.selected?this.serviceConfigs=t.data:this.appConfigs=t.data,e&&(0===this.selected?this.$router.push({path:"config",query:{service:this.filter,serviceVersion:this.serviceVersion4Search,serviceGroup:this.serviceGroup4Search}}):1===this.selected&&this.$router.push({path:"config",query:{application:this.filter}}))})},closeDialog:function(){this.ruleText=this.template,this.service="",this.dialog=!1,this.updateId="",this.readonly=!1},openDialog:function(){this.dialog=!0},openWarn:function(e,t){this.warnTitle=e,this.warnText=t,this.warn=!0},closeWarn:function(){this.warnTitle="",this.warnText="",this.warn=!1},saveItem:function(){const e=ne.a.safeLoad(this.ruleText);if(!this.service&&!this.application)return void this.$notify.error("Either service or application is needed");if(this.service&&this.application)return void this.$notify.error("You can not set both service ID and application name");e.service=this.service,e.application=this.application,e.serviceVersion=this.serviceVersion,e.serviceGroup=this.serviceGroup;const t=this;this.updateId?"close"===this.updateId?this.closeDialog():this.$axios.put("/rules/override/"+this.updateId,e).then(e=>{200===e.status&&(t.service?(t.selected=0,t.search(this.service,!0),t.filter=t.service):(t.selected=1,t.search(t.application,!0),t.filter=t.application),this.$notify.success("Update success"),this.closeDialog())}):this.$axios.post("/rules/override",e).then(e=>{201===e.status&&(this.service?(t.selected=0,t.search(t.service,!0),t.filter=t.service):(t.selected=1,t.search(t.application,!0),t.filter=t.application),this.$notify.success("Create success"),this.closeDialog())})},itemOperation:function(e,t){const s=t.id;switch(e){case"visibility":this.$axios.get("/rules/override/"+s).then(e=>{const t=e.data;this.handleConfig(t,!0),this.updateId="close"});break;case"edit":this.$axios.get("/rules/override/"+s).then(e=>{const t=e.data;this.handleConfig(t,!1),this.updateId=s});break;case"block":this.openWarn(" Are you sure to block Dynamic Config","service: "+t.service),this.warnStatus.operation="disable",this.warnStatus.id=s;break;case"check_circle_outline":this.openWarn(" Are you sure to enable Dynamic Config","service: "+t.service),this.warnStatus.operation="enable",this.warnStatus.id=s;break;case"delete":this.openWarn("warnDeleteDynamicConfig","service: "+t.service),this.warnStatus.operation="delete",this.warnStatus.id=s}},handleConfig:function(e,t){this.service=e.service,this.serviceVersion=e.serviceVersion,this.serviceGroup=e.serviceGroup,this.application=e.application,delete e.service,delete e.serviceVersion,delete e.serviceGroup,delete e.application,delete e.id;for(let s=0;s{e[t]&&"object"===typeof e[t]?this.removeEmpty(e[t]):null==e[t]&&delete e[t]})},deleteItem:function(e){const t=e.id,s=e.operation;"delete"===s?this.$axios.delete("/rules/override/"+t).then(e=>{200===e.status&&(this.warn=!1,this.search(this.filter,!1),this.$notify.success("Delete success"))}):"disable"===s?this.$axios.put("/rules/override/disable/"+t).then(e=>{200===e.status&&(this.warn=!1,this.search(this.filter,!1),this.$notify.success("Disable success"))}):"enable"===s&&this.$axios.put("/rules/override/enable/"+t).then(e=>{200===e.status&&(this.warn=!1,this.search(this.filter,!1),this.$notify.success("Enable success"))})}},created(){this.setHeight()},computed:{queryBy(){return this.$t("by")+this.$t(this.items[this.selected].title)},area(){return this.$i18n.locale}},watch:{input(e){this.querySelections(e)},area(){this.setAppHeaders(),this.setServiceHeaders()}},mounted:function(){this.setAppHeaders(),this.setServiceHeaders(),this.$store.dispatch("loadServiceItems"),this.$store.dispatch("loadAppItems"),this.ruleText=this.template;const e=this.$route.query;let t=null,s=null,a=null;const i=this;Object.keys(e).forEach((function(r){"service"===r&&(t=e[r],e.serviceVersion&&(s=e.serviceVersion),e.serviceGroup&&(a=e.serviceGroup),i.selected=0),"application"===r&&(t=e[r],i.selected=1)})),null!=s&&(this.serviceVersion4Search=e.serviceVersion),null!=a&&(this.serviceGroup4Search=e.serviceGroup),null!==t&&(this.filter=t,this.search(!1))}},Je=Ue,ze=Object(n["a"])(Je,Fe,We,!1,null,null,null),Ye=ze.exports,Ze=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("v-container",{attrs:{"grid-list-xl":"",fluid:""}},[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{lg12:""}},[s("breadcrumb",{attrs:{title:"serviceTest",items:e.breads}})],1),s("v-flex",{attrs:{lg12:""}},[s("v-card",{attrs:{flat:"",color:"transparent"}},[s("v-card-text",[s("v-form",[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-combobox",{attrs:{id:"serviceTestSearch",loading:e.searchLoading,items:e.typeAhead,"search-input":e.input,flat:"","append-icon":"","hide-no-data":"",hint:e.$t("testModule.searchServiceHint"),label:e.$t("placeholders.searchService")},on:{"update:searchInput":function(t){e.input=t},"update:search-input":function(t){e.input=t},keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.submit(t)}},model:{value:e.filter,callback:function(t){e.filter=t},expression:"filter"}}),s("v-btn",{attrs:{color:"primary",large:""},on:{click:e.submit}},[e._v(e._s(e.$t("search")))])],1)],1)],1)],1)],1),s("v-flex",{attrs:{xs12:""}},[s("v-card",[s("v-toolbar",{staticClass:"elevation-0",attrs:{flat:"",color:"transparent"}},[s("v-toolbar-title",[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("methods")))])]),s("v-spacer")],1),s("v-card-text",{staticClass:"pa-0"},[s("v-data-table",{staticClass:"elevation-1",attrs:{headers:e.headers,items:e.methods,"hide-actions":""},scopedSlots:e._u([{key:"items",fn:function(t){return[s("td",[e._v(e._s(t.item.name))]),s("td",e._l(t.item.parameterTypes,(function(t,a){return s("v-chip",{key:a,attrs:{xs:"",label:""}},[e._v(e._s(t))])})),1),s("td",[s("v-chip",{attrs:{label:""}},[e._v(e._s(t.item.returnType))])],1),s("td",{staticClass:"text-xs-right"},[s("v-tooltip",{attrs:{bottom:""}},[s("v-btn",{attrs:{slot:"activator",fab:"",dark:"",small:"",color:"blue",href:e.getHref(t.item.application,t.item.service,t.item.signature)},slot:"activator"},[s("v-icon",[e._v("edit")])],1),s("span",[e._v(e._s(e.$t("test")))])],1)],1)]}}])})],1)],1)],1)],1)],1)},Xe=[],Ke={name:"ServiceTest",components:{Breadcrumb:N},data(){return{typeAhead:[],input:null,searchLoading:!1,timerID:null,filter:"",breads:[{text:"serviceSearch",href:"/test"}],headers:[],service:null,methods:[],services:[],loading:!1}},methods:{querySelections(e){this.timerID&&clearTimeout(this.timerID),this.timerID=setTimeout(()=>{e&&e.length>=4?(this.searchLoading=!0,this.typeAhead=this.$store.getters.getServiceItems(e),this.searchLoading=!1,this.timerID=null):this.typeAhead=[]},500)},submit(){if(this.filter=document.querySelector("#serviceTestSearch").value.trim(),!this.filter)return this.$notify.error("service is needed"),!1;{const e=this.filter.replace("/","*");this.search(e)}},setHeaders:function(){this.headers=[{text:this.$t("methodName"),value:"method",sortable:!1},{text:this.$t("parameterList"),value:"parameter",sortable:!1},{text:this.$t("returnType"),value:"returnType",sortable:!1},{text:"",value:"operation",sortable:!1}]},search(e){e&&this.$axios.get("/service/"+e).then(e=>{if(this.service=e.data,this.methods=[],this.service.metadata){const t=this.service.metadata.methods;for(let s=0;s{this.showSnackbar("error",e.response.data.message)})},searchServices(){let e=this.filter||"";e.startsWith("*")||(e="*"+e),e.endsWith("*")||(e+="*");const t="service";this.loading=!0,this.$axios.get("/service",{params:{pattern:t,filter:e}}).then(e=>{this.services=e.data}).finally(()=>{this.loading=!1})},getHref(e,t,s){return`/#/testMethod?application=${e}&service=${t}&method=${s}`}},computed:{area(){return this.$i18n.locale}},watch:{input(e){this.querySelections(e)},area(){this.setHeaders()}},mounted(){this.$store.dispatch("loadServiceItems");const e=this.$route.query;this.filter=e.service||"","group"in e&&(this.filter=e.group+"/"+this.filter),"version"in e&&(this.filter=this.filter+":"+e.version),this.filter&&this.search(this.filter.replace("/","*")),this.setHeaders()}},et=Ke,tt=(s("c5e5"),Object(n["a"])(et,Ze,Xe,!1,null,null,null)),st=tt.exports,at=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("v-container",{directives:[{name:"scroll",rawName:"v-scroll:#scroll-target",value:e.onScroll,expression:"onScroll",arg:"#scroll-target"}],attrs:{"grid-list-xl":"",fluid:""}},[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{lg12:""}},[s("breadcrumb",{attrs:{title:"apiDocs",items:e.breads}})],1),s("v-flex",{attrs:{lg12:""}},[s("v-card",{attrs:{flat:"",color:"transparent"}},[s("v-card-text",[s("v-form",[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-text-field",{attrs:{id:"dubboProviderIP",label:e.$t("apiDocsRes.dubboProviderIP"),rules:e.rules,placeholder:"127.0.0.1",value:"127.0.0.1",outline:""}}),s("v-text-field",{staticStyle:{marginLeft:"10px"},attrs:{id:"dubboProviderPort",label:e.$t("apiDocsRes.dubboProviderPort"),rules:e.rules,placeholder:"20880",value:"20881",outline:""}}),s("v-btn",{attrs:{color:"primary",large:""},on:{click:e.submit}},[e._v(e._s(e.$t("apiDocsRes.loadApiList")))])],1)],1)],1)],1)],1)],1),s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{class:{sticky_top:e.isApiListDivFixed,menu_panel_class:e.isBigScreen},attrs:{lg3:""}},[s("v-card",{staticClass:"mx-auto",attrs:{id:"apiListDiv"}},[s("v-toolbar",[s("v-toolbar-side-icon"),s("v-toolbar-title",[e._v(e._s(e.$t("apiDocsRes.apiListText")))]),s("v-spacer")],1),s("v-list",{class:e.isBigScreen?"menu_panel_content":""},e._l(e.apiModules,(function(t){return s("v-list-group",{key:t.title,attrs:{"no-action":""},scopedSlots:e._u([{key:"activator",fn:function(){return[s("v-list-tile",[s("v-list-tile-content",[s("v-list-tile-title",[e._v(e._s(t.title))])],1)],1)]},proxy:!0}],null,!0)},e._l(t.apis,(function(t){return s("v-list-tile",{key:t.title,staticClass:"apiListListTile",on:{click:function(s){return e.showApiForm(t.formInfo,s)}}},[s("v-list-tile-content",[s("v-list-tile-title",[e._v(e._s(t.title))])],1)],1)})),1)})),1)],1)],1),s("v-flex",{class:e.isBigScreen?"apidocs_content":"",attrs:{lg9:""}},[s("v-card",{ref:"apiFormDiv",attrs:{id:"apiFormDiv"}},[s("apiForm",{attrs:{formInfo:e.formInfo}})],1)],1)],1)],1)},it=[],rt=function(){var e=this,t=e.$createElement,s=e._self._c||t;return e.showForm?s("div",[s("div",{staticStyle:{"padding-left":"10px","padding-right":"10px"}},[s("div",[s("v-timeline",{attrs:{"align-top":"",dense:""}},[s("v-timeline-item",{attrs:{color:"cyan",small:""}},[s("div",[s("div",{staticClass:"font-weight-normal"},[s("strong",[e._v(e._s(e.$t("apiDocsRes.apiForm.apiNameShowLabel")))])]),s("div",[e._v(e._s(this.apiInfoData.apiDocName))])])]),s("v-timeline-item",{attrs:{color:"cyan",small:""}},[s("div",[s("div",{staticClass:"font-weight-normal"},[s("strong",[e._v(e._s(e.$t("apiDocsRes.apiForm.apiPathShowLabel")))])]),s("div",[e._v(e._s(this.apiInfoData.apiModelClass)+"#"+e._s(this.apiInfoData.apiName))])])]),s("v-timeline-item",{attrs:{color:"cyan",small:""}},[s("div",[s("div",{staticClass:"font-weight-normal"},[s("strong",[e._v(e._s(e.$t("apiDocsRes.apiForm.apiMethodParamInfoLabel")))])]),s("div",[e._v(e._s(this.apiInfoData.methodParamInfo||e.$t("apiDocsRes.apiForm.none")))])])]),s("v-timeline-item",{attrs:{color:"cyan",small:""}},[s("div",[s("div",{staticClass:"font-weight-normal"},[s("strong",[e._v(e._s(e.$t("apiDocsRes.apiForm.apiRespDecShowLabel")))])]),s("div",[e._v(" "+e._s(this.apiInfoData.apiRespDec||e.$t("apiDocsRes.apiForm.none"))+" ")])])]),s("v-timeline-item",{attrs:{color:"cyan",small:""}},[s("div",[s("div",{staticClass:"font-weight-normal"},[s("strong",[e._v(e._s(e.$t("apiDocsRes.apiForm.apiVersionShowLabel")))])]),s("div",[e._v(" "+e._s(this.apiInfoData.apiVersion||e.$t("apiDocsRes.apiForm.none"))+" ")])])]),s("v-timeline-item",{attrs:{color:"cyan",small:""}},[s("div",[s("div",{staticClass:"font-weight-normal"},[s("strong",[e._v(e._s(e.$t("apiDocsRes.apiForm.apiGroupShowLabel")))])]),s("div",[e._v(" "+e._s(this.apiInfoData.apiGroup||e.$t("apiDocsRes.apiForm.none"))+" ")])])]),s("v-timeline-item",{attrs:{color:"cyan",small:""}},[s("div",[s("div",{staticClass:"font-weight-normal"},[s("strong",[e._v(e._s(e.$t("apiDocsRes.apiForm.apiDescriptionShowLabel")))])]),s("div",[e._v(" "+e._s(this.apiInfoData.description||e.$t("apiDocsRes.apiForm.none"))+" ")])])])],1),s("v-form",{ref:"form"},[s("v-select",{attrs:{items:e.formItemAsyncSelectItems,label:e.$t("apiDocsRes.apiForm.isAsyncFormLabel"),outline:"",readonly:""},model:{value:e.formItemAsync,callback:function(t){e.formItemAsync=t},expression:"formItemAsync"}}),s("v-text-field",{attrs:{label:e.$t("apiDocsRes.apiForm.apiModuleFormLabel"),outline:"",readonly:""},model:{value:e.formItemInterfaceClassName,callback:function(t){e.formItemInterfaceClassName=t},expression:"formItemInterfaceClassName"}}),s("v-text-field",{attrs:{label:e.$t("apiDocsRes.apiForm.apiFunctionNameFormLabel"),outline:"",readonly:""},model:{value:e.formItemMethodName,callback:function(t){e.formItemMethodName=t},expression:"formItemMethodName"}}),s("v-text-field",{attrs:{label:e.$t("apiDocsRes.apiForm.registryCenterUrlFormLabel"),placeholder:"nacos://127.0.0.1:8848",outline:""},model:{value:e.formItemRegistryCenterUrl,callback:function(t){e.formItemRegistryCenterUrl=t},expression:"formItemRegistryCenterUrl"}}),e._l(this.publicFormsArray,(function(t){return s("div",{key:t.get("name"),staticStyle:{marginTop:"20px"}},[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{lg4:""}},[s("v-card",{staticStyle:{height:"300px",overflowY:"auto",overflowX:"hidden"}},[s("v-card-text",[s("v-timeline",{attrs:{"align-top":"",dense:""}},[s("v-timeline-item",{attrs:{color:"deep-purple lighten-1",small:""}},[s("div",[s("div",{staticClass:"font-weight-normal"},[s("strong",[e._v(e._s(e.$t("apiDocsRes.apiForm.paramNameLabel")))])]),s("div",{staticStyle:{wordBreak:"break-word"}},[e._v(e._s(t.get("name")))])])]),s("v-timeline-item",{attrs:{color:"deep-purple lighten-1",small:""}},[s("div",[s("div",{staticClass:"font-weight-normal"},[s("strong",[e._v(e._s(e.$t("apiDocsRes.apiForm.paramPathLabel")))])]),s("div",{staticStyle:{wordBreak:"break-word"}},[e._v("["+e._s(t.get("paramIndex"))+"]"+e._s(t.get("paramType"))+"#"+e._s(t.get("name")))])])]),s("v-timeline-item",{attrs:{color:"deep-purple lighten-1",small:""}},[s("div",[s("div",{staticClass:"font-weight-normal"},[s("strong",[e._v(e._s(e.$t("apiDocsRes.apiForm.paramDescriptionLabel")))])]),s("div",{staticStyle:{wordBreak:"break-word"}},[e._v(e._s(t.get("description")||e.$t("apiDocsRes.apiForm.none")))])])])],1)],1)],1)],1),s("v-flex",{attrs:{lg8:""}},[s("apiFormItem",{attrs:{formItemInfo:t,formValues:e.formValues}})],1)],1)],1)})),s("div",{staticStyle:{marginTop:"20px"}},[s("v-btn",{attrs:{block:"",elevation:"2","x-large":"",color:"info"},on:{click:function(t){return e.doTestApi()}}},[e._v(e._s(e.$t("apiDocsRes.apiForm.doTestBtn")))])],1)],2)],1),s("div",[s("v-system-bar",{staticStyle:{marginTop:"30px"},attrs:{window:"",dark:""}},[s("span",[e._v(e._s(e.$t("apiDocsRes.apiForm.responseLabel")))])]),s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{lg6:""}},[s("div",[s("v-system-bar",{attrs:{window:"",dark:"",color:"primary"}},[s("span",[e._v(e._s(e.$t("apiDocsRes.apiForm.responseExampleLabel")))])])],1),s("div",{staticStyle:{marginTop:"10px"}},[s("jsonViewer",{attrs:{value:e.getJsonOrString(this.apiInfoData.response),copyable:"",boxed:"",sort:""}})],1)]),s("v-flex",{attrs:{lg6:""}},[s("div",[s("v-system-bar",{attrs:{window:"",dark:"",color:"teal"}},[s("span",[e._v(e._s(e.$t("apiDocsRes.apiForm.apiResponseLabel")))])])],1),s("div",{staticStyle:{marginTop:"10px"}},[s("jsonViewer",{attrs:{value:e.responseData,copyable:"",boxed:"",sort:""}})],1)])],1)],1)])]):e._e()},ot=[],lt=s("349e"),nt=s.n(lt),ct=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[e.formItemInfo.get("required")?s("span",{staticStyle:{color:"red"}},[e._v("*")]):e._e(),"TEXT"===e.formItemInfo.get("htmlType")||"TEXT_BYTE"===e.formItemInfo.get("htmlType")||"TEXT_CHAR"===e.formItemInfo.get("htmlType")||"NUMBER_INTEGER"===e.formItemInfo.get("htmlType")||"NUMBER_DECIMAL"===e.formItemInfo.get("htmlType")?s("v-text-field",{ref:e.buildItemId(),attrs:{id:e.buildItemId(),name:e.buildItemId(),label:e.formItemInfo.get("docName"),placeholder:e.formItemInfo.get("example"),value:e.buildDefaultValue(),required:e.formItemInfo.get("required"),rules:[e.requiredCheck],outline:""},on:{change:function(t){return e.itemChange(t)}}}):"SELECT"===e.formItemInfo.get("htmlType")?s("v-select",{ref:e.buildItemId(),attrs:{id:e.buildItemId(),name:e.buildItemId(),label:e.formItemInfo.get("docName"),items:e.buildSelectItem(),"item-text":"label","item-value":"value",value:e.buildSelectDefaultValue(),required:e.formItemInfo.get("required"),rules:[e.requiredCheck],outline:""},on:{change:function(t){return e.itemChange(t)}}}):"TEXT_AREA"===e.formItemInfo.get("htmlType")?s("json-editor2",{ref:e.buildItemId(),staticStyle:{height:"300px"},attrs:{id:e.buildItemId(),name:e.buildItemId(),label:e.formItemInfo.get("docName"),json:e.buildJsonDefaultValue(),required:e.formItemInfo.get("required"),rules:[e.requiredCheck],onChange:e.itemChange,options:{modes:["code","tree"]},outline:""}}):"DATE_SELECTOR"===e.formItemInfo.get("htmlType")||"DATETIME_SELECTOR"===e.formItemInfo.get("htmlType")?s("v-text-field",{ref:e.buildItemId(),attrs:{id:e.buildItemId(),name:e.buildItemId(),label:e.formItemInfo.get("docName"),placeholder:e.formItemInfo.get("example"),value:e.buildDefaultValue(),required:e.formItemInfo.get("required"),rules:[e.requiredCheck],outline:""},on:{change:function(t){return e.itemChange(t)}}}):s("span",[e._v(e._s(e.$t("apiDocsRes.apiForm.unsupportedHtmlTypeTip")))])],1)},dt=[],ut=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{ref:"jsoneditor"})},pt=[],ht=(s("6014"),s("2ef0")),vt=s.n(ht),mt={name:"json-editor2",data(){return{editor:null,maxed:!1,jsoneditorModes:null}},props:{json:{required:!0},options:{type:Object,default:()=>({})},onChange:{type:Function}},watch:{json:{handler(e){this.editor&&this.editor.set(e)},deep:!0}},methods:{_onChange(e){this.onChange&&this.editor&&this.onChange(this.editor.get())},_onModeChange(e,t){const s=this.$refs.jsoneditor;s.getElementsByClassName("jsoneditor-modes")&&s.getElementsByClassName("jsoneditor-modes")[0]&&(this.jsoneditorModes=s.getElementsByClassName("jsoneditor-modes")[0]),"code"===e&&this.addMaxBtn()},addMaxBtn(){const e=this.$refs.jsoneditor;var t=e.getElementsByClassName("jsoneditor-menu")[0],s=document.createElement("button");s.type="button",s.classList.add("jsoneditor-max-btn"),s.jsoneditor={},s.jsoneditor.maxed=this.maxed,s.jsoneditor.editor=this.$refs.jsoneditor;var a=this;s.onclick=function(){this.jsoneditor.maxed?(e.getElementsByClassName("jsoneditor-modes")[0]||s.before(a.jsoneditorModes),this.jsoneditor.editor.classList.remove("jsoneditor-max"),this.jsoneditor.maxed=!1):(e.getElementsByClassName("jsoneditor-modes")&&e.getElementsByClassName("jsoneditor-modes")[0]&&e.getElementsByClassName("jsoneditor-modes")[0].remove(),this.jsoneditor.editor.classList.add("jsoneditor-max"),this.jsoneditor.maxed=!0)},t.appendChild(s)}},mounted(){const e=this.$refs.jsoneditor,t=vt.a.extend({onChange:this._onChange,onModeChange:this._onModeChange},this.options);this.editor=new A.a(e,t),this.editor.set(this.json),e.getElementsByClassName("jsoneditor-modes")&&e.getElementsByClassName("jsoneditor-modes")[0]&&(this.jsoneditorModes=e.getElementsByClassName("jsoneditor-modes")[0])},beforeDestroy(){this.editor&&(this.editor.destroy(),this.editor=null)}},ft=mt,gt=(s("8b76"),Object(n["a"])(ft,ut,pt,!1,null,null,null)),xt=gt.exports,bt={name:"ApiFormItem",components:{JsonEditor2:xt},props:{formItemInfo:{type:Map,default:function(){return new Map}},formValues:{type:Map,default:function(){return new Map}}},data:()=>({isSelectDefaultBuiled:!1,selectDefaultValue:""}),watch:{},methods:{buildItemId(){let e=this.formItemInfo.get("paramType")+"@@"+this.formItemInfo.get("paramIndex")+"@@"+this.formItemInfo.get("javaType")+"@@"+this.formItemInfo.get("name")+"@@"+this.formItemInfo.get("htmlType");return this.formItemInfo.get("methodParam")&&(e=e+"@@"+this.formItemInfo.get("methodParam")),e},requiredCheck(e){return!this.formItemInfo.get("required")||(!!e||this.$t("apiDocsRes.apiForm.requireItemTip"))},buildSelectItem(){var e=this.formItemInfo.get("allowableValues");const t=[];var s={label:"",value:""};t.push(s);for(var a=0;a({showForm:!1,formItemAsyncSelectItems:[!0,!1],formItemAsync:!1,formItemInterfaceClassName:"",formItemMethodName:"",formItemRegistryCenterUrl:"",apiInfoData:{},publicFormsArray:[],responseData:"",formValues:new Map}),watch:{formInfo:"changeFormInfo"},methods:{getJsonOrString(e){if(!e)return"";try{return JSON.parse(e)}catch(t){return e}},changeFormInfo(e){this.publicFormsArray=[],this.formValues=new Map,this.responseData="",this.$axios.get("/docs/apiParamsResp",{params:{dubboIp:e.dubboIp,dubboPort:e.dubboPort,apiName:e.moduleClassName+"."+e.apiName+e.paramsDesc}}).then(e=>{if(e&&e.data&&""!==e.data){this.apiInfoData=JSON.parse(e.data),this.formItemAsync=this.apiInfoData.async,this.formItemInterfaceClassName=this.apiInfoData.apiModelClass,this.formItemMethodName=this.apiInfoData.apiName;var t=this.apiInfoData.params;const n=[];for(var s=0;s{console.log("error",e.message)}),this.showForm=!0},doTestApi(){if(!this.$refs.form.validate())return!1;var e=new Map;this.formValues.forEach((t,s)=>{var a=s.split("@@"),i=a[0]+"@@"+a[1];a[5]&&(i=i+"@@"+a[5]);var r=e.get(i);r||(r=new Array,e.set(i,r));var o={};o.key=s,o.value=t,r.push(o)});var t=[];e.forEach((e,s)=>{var a={};if(t[s.split("@@")[1]]=a,a.paramType=s.split("@@")[0],s.split("@@")[2])a.paramValue=e[0].value;else{var i={};a.paramValue=i,e.forEach(e=>{var t=e.key.split("@@"),s=t[3];"TEXT_AREA"===t[4]?""!==e.value&&(i[s]=e.value):i[s]=e.value})}}),""===this.formItemRegistryCenterUrl&&(this.formItemRegistryCenterUrl="dubbo://"+this.formInfo.dubboIp+":"+this.formInfo.dubboPort),this.$axios({url:"/docs/requestDubbo",method:"post",params:{async:this.formItemAsync,interfaceClassName:this.formItemInterfaceClassName,methodName:this.formItemMethodName,registryCenterUrl:this.formItemRegistryCenterUrl,version:this.apiInfoData.apiVersion||"",group:this.apiInfoData.apiGroup||""},headers:{"Content-Type":"application/json; charset=UTF-8"},data:JSON.stringify(t)}).catch(e=>{console.log(e)}).then(e=>{this.responseData=e.data})}},mounted(){}},$t=wt,It=Object(n["a"])($t,rt,ot,!1,null,"15da7d38",null),Dt=It.exports,St={name:"ApiDocs",components:{Breadcrumb:N,ApiForm:Dt},computed:{isBigScreen:function(){const e=this;var t=!1;return e.$vuetify.breakpoint&&(t=e.$vuetify.breakpoint.md||e.$vuetify.breakpoint.lg||e.$vuetify.breakpoint.xl),t}},created(){const e=this;console.debug(e.$vuetify.breakpoint.md)},data:()=>({breads:[{text:"apiDocs",href:"/apiDocs"}],rules:[e=>!!e||"Required."],apiModules:[],formInfo:{},isApiListDivFixed:!1}),methods:{submit(){const e=document.querySelector("#dubboProviderIP").value.trim(),t=document.querySelector("#dubboProviderPort").value.trim();this.$axios.get("/docs/apiModuleList",{params:{dubboIp:e,dubboPort:t}}).then(s=>{const a=[];if(s&&s.data&&""!==s.data){const i=JSON.parse(s.data);i.sort((e,t)=>e.moduleDocName>t.moduleDocName);for(let s=0;se.apiName>t.apiName);const o={title:r.moduleDocName,apis:[]},l=r.moduleApiList;for(let s=0;s{console.log("error",e.message)})},showApiForm(e,t){this.formInfo=e;const s=document.getElementsByClassName("apiListListTile");for(var a=0;a=t&&(this.isApiListDivFixed=!0,document.getElementById("apiListDiv").classList.add("apiListDiv-fixed"),document.getElementById("apiListDiv").style.top="75px",document.getElementById("apiListDiv").style.width=s+"px"),this.isApiListDivFixed&&e<=t&&(this.isApiListDivFixed=!1,document.getElementById("apiListDiv").classList.remove("apiListDiv-fixed"),document.getElementById("apiListDiv").style.top="0px")},onScroll(){const e=this;var t=document.documentElement.scrollTop||document.body.scrollTop,s=document.getElementById("apiFormDiv").offsetTop;t>=s&&e.isBigScreen?e.isApiListDivFixed=!0:e.isApiListDivFixed=!1}},mounted(){window.addEventListener("scroll",this.onScroll)}},Ct=St,At=(s("1ca8"),Object(n["a"])(Ct,at,it,!1,null,"e656f73a",null)),Rt=At.exports,Et=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("v-container",{attrs:{"grid-list-xl":"",fluid:""}},[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{lg12:""}},[s("breadcrumb",{attrs:{title:"serviceMock",items:e.breads}})],1),s("v-flex",{attrs:{lg12:""}},[s("v-card",{attrs:{flat:"",color:"transparent"}},[s("v-card-text",[s("v-form",[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-combobox",{attrs:{id:"mockRule",loading:e.searchLoading,"search-input":e.input,flat:"","append-icon":"","hide-no-data":"",hint:e.$t("testModule.searchServiceHint"),label:e.$t("placeholders.searchService")},on:{"update:searchInput":[function(t){e.input=t},e.updateFilter],"update:search-input":function(t){e.input=t},keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.submitSearch(t)}},model:{value:e.filter,callback:function(t){e.filter=t},expression:"filter"}}),s("v-btn",{attrs:{color:"primary",large:""},on:{click:e.submitSearch}},[e._v(e._s(e.$t("search")))])],1)],1)],1)],1)],1),s("v-flex",{attrs:{xs12:""}},[s("v-card",[s("v-toolbar",{staticClass:"elevation-0",attrs:{flat:"",color:"transparent"}},[s("v-toolbar-title",[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("ruleList")))])]),s("v-spacer"),s("v-btn",{staticClass:"mb-2",attrs:{outline:"",color:"primary"},on:{click:function(t){return t.stopPropagation(),e.openDialog(t)}}},[e._v(e._s(e.$t("create")))])],1),s("v-card-text",{staticClass:"pa-0"},[s("v-data-table",{staticClass:"elevation-1",attrs:{headers:e.headers,items:e.mockRules,pagination:e.pagination,"total-items":e.totalItems,loading:e.loadingRules},on:{"update:pagination":function(t){e.pagination=t}},scopedSlots:e._u([{key:"items",fn:function(t){return[s("td",[e._v(e._s(t.item.serviceName))]),s("td",[s("v-chip",{attrs:{label:""}},[e._v(e._s(t.item.methodName))])],1),s("td",[e._v(e._s(t.item.rule)+" ")]),s("td",[s("v-switch",{attrs:{inset:""},on:{change:function(s){return e.enableOrDisableMockRule(t.item)}},model:{value:t.item.enable,callback:function(s){e.$set(t.item,"enable",s)},expression:"props.item.enable"}})],1),s("td",[s("v-btn",{staticClass:"tiny",attrs:{color:"primary"},on:{click:function(s){return e.editMockRule(t.item)}}},[e._v(" "+e._s(e.$t("edit"))+" ")]),s("v-btn",{staticClass:"tiny",attrs:{color:"error"},on:{click:function(s){return e.openDeleteDialog(t.item)}}},[e._v(" "+e._s(e.$t("delete"))+" ")])],1)]}}])})],1)],1)],1)],1),s("v-dialog",{attrs:{width:"800px",persistent:""},model:{value:e.dialog,callback:function(t){e.dialog=t},expression:"dialog"}},[s("v-card",[s("v-card-title",{staticClass:"justify-center"},[s("span",{staticClass:"headline"},[e._v(e._s(1===e.dialogType?e.$t("createMockRule"):e.$t("editMockRule")))])]),s("v-card-text",[s("v-text-field",{attrs:{label:e.$t("serviceName"),hint:e.$t("dataIdClassHint")},model:{value:e.mockRule.serviceName,callback:function(t){e.$set(e.mockRule,"serviceName",t)},expression:"mockRule.serviceName"}}),s("v-text-field",{attrs:{label:e.$t("methodName"),hint:e.$t("methodNameHint")},model:{value:e.mockRule.methodName,callback:function(t){e.$set(e.mockRule,"methodName",t)},expression:"mockRule.methodName"}}),s("v-subheader",{staticClass:"pa-0 mt-3"},[e._v(e._s(e.$t("ruleContent")))]),s("ace-editor",{model:{value:e.mockRule.rule,callback:function(t){e.$set(e.mockRule,"rule",t)},expression:"mockRule.rule"}})],1),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{flat:""},nativeOn:{click:function(t){return e.closeDialog(t)}}},[e._v(e._s(e.$t("close")))]),s("v-btn",{attrs:{depressed:"",color:"primary"},nativeOn:{click:function(t){return e.saveOrUpdateMockRule(t)}}},[e._v(e._s(e.$t("save")))])],1)],1)],1),s("v-dialog",{attrs:{persistent:"","max-width":"500px"},model:{value:e.warnDialog,callback:function(t){e.warnDialog=t},expression:"warnDialog"}},[s("v-card",[s("v-card-title",{staticClass:"headline"},[e._v(e._s(e.$t("deleteRuleTitle")))]),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{color:"darken-1",flat:""},nativeOn:{click:function(t){return e.closeDeleteDialog(t)}}},[e._v(e._s(e.$t("cancel")))]),s("v-btn",{attrs:{color:"primary darken-1",depressed:""},nativeOn:{click:function(t){return e.deleteMockRule(t)}}},[e._v(e._s(e.$t("confirm")))])],1)],1)],1)],1)},Tt=[],Lt={name:"ServiceMock",components:{Breadcrumb:N,AceEditor:oe},data(){return{headers:[],mockRules:[],breads:[{text:"mockRule",href:"/mock"}],pagination:{page:1,rowsPerPage:10},loadingRules:!1,searchLoading:!1,filter:null,totalItems:0,dialog:!1,mockRule:{serviceName:"",methodName:"",rule:"",enable:!0},dialogType:1,warnDialog:!1,deleteRule:null}},methods:{setHeaders(){this.headers=[{text:this.$t("serviceName"),value:"serviceName",sortable:!1},{text:this.$t("methodName"),value:"methodName",sortable:!1},{text:this.$t("mockData"),value:"rule",sortable:!1},{text:this.$t("enabled"),value:"enable",sortable:!1},{text:this.$t("operation"),value:"operation",sortable:!1}]},listMockRules(e){const t=this.pagination.page-1,s=-1===this.pagination.rowsPerPage?this.totalItems:this.pagination.rowsPerPage;this.loadingRules=!0,this.$axios.get("/mock/rule/list",{params:{page:t,size:s,filter:e}}).then(e=>{this.mockRules=e.data.content,this.totalItems=e.data.totalElements}).catch(e=>{this.showSnackbar("error",e.response.data.message)}).finally(this.loadingRules=!1)},submitSearch(){this.listMockRules(this.filter)},openDialog(){this.dialog=!0},closeDialog(){this.dialog=!1,this.dialogType=1,this.mockRule={serviceName:"",methodName:"",rule:"",enable:!0}},saveOrUpdateMockRule(){this.$axios.post("/mock/rule",this.mockRule).then(e=>{this.$notify(this.$t("saveRuleSuccess"),"success"),this.closeDialog(),this.listMockRules()}).catch(e=>this.showSnackbar("error",e.response.data.message))},deleteMockRule(){const e=this.deleteRule.id;this.$axios.delete("/mock/rule",{data:{id:e}}).then(e=>{this.$notify(this.$t("deleteRuleSuccess"),"success"),this.closeDeleteDialog(),this.listMockRules(this.filter)}).catch(e=>this.$notify(e.response.data.message,"error"))},editMockRule(e){this.mockRule=e,this.openDialog(),this.dialogType=2},enableOrDisableMockRule(e){this.$axios.post("/mock/rule",e).then(t=>this.$notify(e.enable?this.$t("enableRuleSuccess"):this.$t("disableRuleSuccess"),"success")).catch(e=>this.$notify(e.data.response.message,"error"))},updateFilter(){this.filter=document.querySelector("#mockRule").value.trim()},closeDeleteDialog(){this.warnDialog=!1,this.deleteRule=null},openDeleteDialog(e){this.warnDialog=!0,this.deleteRule=e}},mounted(){this.setHeaders(),this.listMockRules(this.filter)},computed:{area(){return this.$i18n.locale}},watch:{input(e){this.querySelections(e)},area(){this.setHeaders()},pagination:{handler(e,t){if(e.page===t.page&&e.rowsPerPage===t.rowsPerPage)return;const s=this.filter;this.listMockRules(s)},deep:!0}}},Vt=Lt,Ht=(s("fb52"),Object(n["a"])(Vt,Et,Tt,!1,null,"bcd8a582",null)),Gt=Ht.exports,Ot=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("v-container",{attrs:{"grid-list-xl":"",fluid:""}},[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",[s("iframe",{attrs:{src:"http://localhost:8081/dashboard-solo/new?utm_source=grafana_gettingstarted&orgId=1&from=1684139950126&to=1684161550126&panelId=1",width:"1350",height:"700",frameborder:"0"}})])],1)],1)},Bt=[],Nt={name:"ServiceMetrics"},Mt=Nt,jt=(s("a237"),Object(n["a"])(Mt,Ot,Bt,!1,null,"139d77c8",null)),Pt=jt.exports,qt=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("v-container",{attrs:{"grid-list-xl":"",fluid:""}},[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{lg12:""}},[s("breadcrumb",{attrs:{title:"serviceRelation",items:e.breads}})],1)],1),s("v-flex",{attrs:{lg12:""}},[s("v-card",[s("div",{staticStyle:{width:"100%",height:"500%"},attrs:{id:"chartContent"}})])],1)],1)},Qt=[],Ft={components:{Breadcrumb:N},data:()=>({success:null,breads:[{text:"serviceMetrics",href:""},{text:"serviceRelation",href:""}],responseData:null}),methods:{initData:function(){this.chartContent=echarts.init(document.getElementById("chartContent")),this.chartContent.showLoading(),this.$axios.get("/metrics/relation").then(e=>{e&&200===e.status&&(this.success=!0,this.responseData=e.data,this.responseData.type="force",this.initChart(this.responseData))}).catch(e=>{this.success=!1,this.responseData=e.response.data})},initChart:function(e){this.chartContent.hideLoading();const t={legend:{top:"bottom",data:e.categories.map(e=>e.name)},series:[{type:"graph",layout:"force",animation:!1,label:{normal:{show:!0,position:"right"}},draggable:!0,data:e.nodes.map((function(e,t){return e.id=t,e})),categories:this.responseData.categories,force:{edgeLength:100,repulsion:10},edges:e.links,edgeSymbol:["","arrow"],edgeSymbolSize:7}]};this.chartContent.setOption(t)}},mounted:function(){this.initData()}},Wt=Ft,Ut=Object(n["a"])(Wt,qt,Qt,!1,null,null,null),Jt=Ut.exports,zt=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("v-container",{attrs:{"grid-list-xl":"",fluid:""}},[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{xs12:""}},[s("search",{attrs:{id:"serviceSearch",submit:e.submit,label:e.$t("searchDubboConfig"),hint:e.$t("configNameHint")},model:{value:e.filter,callback:function(t){e.filter=t},expression:"filter"}})],1)],1),s("v-flex",{attrs:{lg12:""}},[s("v-card",[s("v-toolbar",{staticClass:"elevation-0",attrs:{flat:"",color:"transparent"}},[s("v-toolbar-title",[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("searchResult")))])]),s("v-spacer"),s("v-btn",{staticClass:"mb-2",attrs:{outline:"",color:"primary"},on:{click:function(t){return t.stopPropagation(),e.openDialog(t)}}},[e._v(e._s(e.$t("create")))])],1),s("v-card-text",{staticClass:"pa-0"},[s("v-data-table",{staticClass:"elevation-0",attrs:{headers:e.headers,items:e.dubboConfig,"hide-actions":""},scopedSlots:e._u([{key:"items",fn:function(t){return[s("td",{staticClass:"text-xs-left"},[s("v-tooltip",{attrs:{bottom:""}},[s("span",{attrs:{slot:"activator"},slot:"activator"},[e._v(" "+e._s(t.item.key)+" ")]),s("span",[e._v(e._s(t.item.path))])])],1),s("td",{staticClass:"text-xs-left"},[s("v-chip",{attrs:{color:e.getColor(t.item.scope),"text-color":"white"}},[e._v(" "+e._s(t.item.scope)+" ")])],1),s("td",{staticClass:"text-xs-center px-0"},e._l(e.operations,(function(a){return s("v-tooltip",{key:a.id,attrs:{bottom:""}},[s("v-icon",{staticClass:"mr-2",attrs:{slot:"activator",small:""},on:{click:function(s){return e.itemOperation(a.icon,t.item)}},slot:"activator"},[e._v(" "+e._s(a.icon)+" ")]),s("span",[e._v(e._s(e.$t(a.tooltip)))])],1)})),1)]}}])})],1)],1)],1),s("v-dialog",{attrs:{width:"800px",persistent:""},model:{value:e.dialog,callback:function(t){e.dialog=t},expression:"dialog"}},[s("v-card",[s("v-card-title",{staticClass:"justify-center"},[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("createNewDubboConfig")))])]),s("v-card-text",[s("v-text-field",{attrs:{label:e.$t("appName"),hint:e.$t("configNameHint")},model:{value:e.key,callback:function(t){e.key=t},expression:"key"}}),s("v-subheader",{staticClass:"pa-0 mt-3"},[e._v(e._s(e.$t("configContent")))]),s("ace-editor",{attrs:{lang:"properties",readonly:e.readonly},model:{value:e.rule,callback:function(t){e.rule=t},expression:"rule"}})],1),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{flat:""},nativeOn:{click:function(t){return e.closeDialog(t)}}},[e._v(e._s(e.$t("close")))]),s("v-btn",{attrs:{depressed:"",color:"primary"},nativeOn:{click:function(t){return e.saveItem(t)}}},[e._v(e._s(e.$t("save")))])],1)],1)],1),s("v-dialog",{attrs:{persistent:"","max-width":"500px"},model:{value:e.warn.display,callback:function(t){e.$set(e.warn,"display",t)},expression:"warn.display"}},[s("v-card",[s("v-card-title",{staticClass:"headline"},[e._v(e._s(e.$t(this.warn.title)+this.warnStatus.id))]),s("v-card-text",[e._v(e._s(this.warn.text))]),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{flat:""},nativeOn:{click:function(t){return e.closeWarn(t)}}},[e._v(e._s(e.$t("cancel")))]),s("v-btn",{attrs:{depressed:"",color:"primary"},nativeOn:{click:function(t){return e.deleteItem(e.warnStatus)}}},[e._v(e._s(e.$t("confirm")))])],1)],1)],1)],1)},Yt=[],Zt=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("v-card",{attrs:{flat:"",color:"transparent"}},[s("v-card-text",[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-text-field",{attrs:{label:e.label,clearable:"",hint:e.hint,value:e.value},on:{input:function(t){return e.$emit("input",t)},keydown:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.submit(t)}}}),s("v-btn",{attrs:{color:"primary",large:""},on:{click:e.submit}},[e._v(e._s(e.$t("search")))])],1)],1)],1)},Xt=[],Kt={name:"search",props:{value:String,submit:{type:Function,default:null},label:{type:String,default:""},hint:{type:String,default:""}},data:()=>({}),methods:{}},es=Kt,ts=Object(n["a"])(es,Zt,Xt,!1,null,null,null),ss=ts.exports,as={name:"Management",components:{AceEditor:oe,Search:ss},data:()=>({configCenter:"",rule:"",updateId:"",key:"",filter:"",readonly:!1,dialog:!1,operations:[{id:0,icon:"visibility",tooltip:"view"},{id:1,icon:"edit",tooltip:"edit"},{id:3,icon:"delete",tooltip:"delete"}],warn:{display:!1,title:"",text:"",status:{}},warnStatus:{},dubboConfig:[],headers:[]}),methods:{setHeaders(){this.headers=[{text:this.$t("name"),value:"name",align:"left"},{text:this.$t("scope"),value:"scope",sortable:!1},{text:this.$t("operation"),value:"operation",sortable:!1,width:"115px"}]},itemOperation(e,t){switch(e){case"visibility":this.dialog=!0,this.rule=t.config,this.key=t.key,this.readonly=!0,this.updateId="close";break;case"edit":this.dialog=!0,this.rule=t.config,this.key=t.key,this.updateId=t.key,this.readonly=!1;break;case"delete":this.openWarn("warnDeleteConfig"),this.warnStatus.id=t.key}},deleteItem:function(e){this.$axios.delete("/manage/config/"+e.id).then(e=>{200===e.status&&(this.warn.display=!1,this.search(this.filter),this.$notify.success("Delete success"))})},closeDialog:function(){this.rule="",this.key="",this.dialog=!1,this.readonly=!1},openDialog:function(){this.dialog=!0},openWarn:function(e,t){this.warn.title=e,this.warn.text=t,this.warn.display=!0},closeWarn:function(){this.warn.title="",this.warn.text="",this.warn.display=!1},saveItem:function(){const e={};if(!this.key)return void this.$notify.error("Config key is needed");e.key=this.key,e.config=this.rule;const t=this;this.updateId?"close"===this.updateId?this.closeDialog():this.$axios.put("/manage/config/"+this.updateId,e).then(e=>{200===e.status&&(t.search(t.key),t.filter=t.key,this.closeDialog(),this.$notify.success("Update success"))}):this.$axios.post("/manage/config/",e).then(e=>{201===e.status&&(t.search(t.key),t.filter=t.key,t.closeDialog(),t.$notify.success("Create success"))})},getColor(e){return"global"===e?"red":"application"===e?"green":"service"===e?"blue":void 0},submit(){this.filter?(this.filter=this.filter.trim(),this.search()):this.$notify.error("application is needed")},search(){this.$axios.get("/manage/config/"+this.filter).then(e=>{200===e.status&&(this.dubboConfig=e.data,this.$router.push({path:"management",query:{key:this.filter}}))})}},mounted(){this.setHeaders();const e=this.$route.query;let t=null;Object.keys(e).forEach((function(s){"key"===s&&(t=e[s])})),this.filter=null!==t?t:"global",this.search()}},is=as,rs=Object(n["a"])(is,zt,Yt,!1,null,"3786212b",null),os=rs.exports,ls=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("v-container",{attrs:{"grid-list-xl":"",fluid:""}},[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{lg12:""}},[s("Breadcrumb",{attrs:{title:"trafficAccesslog",items:e.breads}})],1),s("v-flex",{attrs:{lg12:""}},[s("v-card",{attrs:{flat:"",color:"transparent"}},[s("v-card-text",[s("v-form",[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-combobox",{attrs:{loading:e.searchLoading,items:e.typeAhead,"search-input":e.application,flat:"","append-icon":"","hide-no-data":"",label:"请输入application",hint:"请输入application"},on:{"update:searchInput":function(t){e.application=t},"update:search-input":function(t){e.application=t}}}),s("v-btn",{attrs:{color:"primary",large:""},on:{click:e.submit}},[e._v("搜索")]),s("v-btn",{attrs:{color:"primary",large:""},on:{click:e.create}},[e._v("新建")])],1)],1)],1)],1)],1),s("v-flex",{attrs:{xs12:""}},[s("v-card",[s("v-toolbar",{staticClass:"elevation-0",attrs:{flat:"",color:"transparent"}},[s("v-toolbar-title",[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("trafficAccesslog")))])]),s("v-spacer")],1),s("v-data-table",{staticClass:"elevation-1",attrs:{headers:e.headers,items:e.tableData,"hide-actions":""},scopedSlots:e._u([{key:"items",fn:function(t){return[s("td",[e._v(e._s(t.item.application))]),s("td",[e._v(e._s(t.item.accesslog))]),s("td",{staticClass:"text-xs-center px-0",attrs:{nowrap:""}},[s("v-btn",{staticClass:"tiny",attrs:{color:"success"},on:{click:function(s){return e.update(t.item)}}},[e._v(" 修改 ")]),s("v-btn",{staticClass:"tiny",attrs:{outline:""},on:{click:function(s){return e.deleteItem(t.item)}}},[e._v(" 删除 ")])],1)]}}])})],1)],1),s("v-dialog",{attrs:{width:"800px",persistent:""},model:{value:e.dialog,callback:function(t){e.dialog=t},expression:"dialog"}},[s("v-card",[s("v-card-title",{staticClass:"justify-center"},[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("createAccesslogRule")))])]),s("v-card-text",[s("v-layout",{attrs:{wrap:""}},[s("v-flex",{attrs:{xs6:"",sm3:"",md5:""}},[s("v-text-field",{attrs:{label:"Application Name",hint:"请输入Application Name"},model:{value:e.createApplication,callback:function(t){e.createApplication=t},expression:"createApplication"}})],1)],1),s("v-flex",{attrs:{xs6:"",sm3:"",md5:""}},[s("v-text-field",{attrs:{label:"开启 Accesslog(这里应该是一个开关按钮,用户点击打开或关闭)",hint:""},model:{value:e.createAccesslog,callback:function(t){e.createAccesslog=t},expression:"createAccesslog"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md5:""}},[s("v-text-field",{attrs:{label:"日志文件存储路径(此输入框默认隐藏,用户点击显示出来)",hint:"输入 accesslog 存储的目标文件绝对路径(如/home/user1/access.log)"},model:{value:e.createAccesslog,callback:function(t){e.createAccesslog=t},expression:"createAccesslog"}})],1)],1),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{flat:""},nativeOn:{click:function(t){return e.closeDialog(t)}}},[e._v(e._s(e.$t("close")))]),s("v-btn",{attrs:{depressed:"",color:"primary"},nativeOn:{click:function(t){return e.save(t)}}},[e._v(e._s(e.$t("save")))])],1)],1)],1),s("v-dialog",{attrs:{width:"800px",persistent:""},model:{value:e.updateDialog,callback:function(t){e.updateDialog=t},expression:"updateDialog"}},[s("v-card",[s("v-card-title",{staticClass:"justify-center"},[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("createAccesslogRule")))])]),s("v-card-text",[s("v-layout",{attrs:{wrap:""}},[s("v-flex",{attrs:{xs6:"",sm3:"",md5:""}},[s("v-text-field",{attrs:{label:"Application Name",hint:"请输入Application Name"},model:{value:e.updateApplication,callback:function(t){e.updateApplication=t},expression:"updateApplication"}})],1)],1),s("v-flex",{attrs:{xs6:"",sm3:"",md5:""}},[s("v-text-field",{attrs:{label:"开启 Accesslog(这里应该是一个开关按钮,用户点击打开或关闭)",hint:""},model:{value:e.updateAccesslog,callback:function(t){e.updateAccesslog=t},expression:"updateAccesslog"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md5:""}},[s("v-text-field",{attrs:{label:"日志文件存储路径(此输入框默认隐藏,用户点击后显示出来)",hint:"输入 accesslog 存储的目标文件绝对路径(如/home/user1/access.log)"},model:{value:e.updateAccesslog,callback:function(t){e.updateAccesslog=t},expression:"updateAccesslog"}})],1)],1),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{flat:""},nativeOn:{click:function(t){return e.closeUpdateDialog(t)}}},[e._v(e._s(e.$t("close")))]),s("v-btn",{attrs:{depressed:"",color:"primary"},nativeOn:{click:function(t){return e.saveUpdate(t)}}},[e._v(e._s(e.$t("save")))])],1)],1)],1),s("v-dialog",{attrs:{persistent:"","max-width":"290"},model:{value:e.deleteDialog,callback:function(t){e.deleteDialog=t},expression:"deleteDialog"}},[s("v-card",[s("v-card-title",{staticClass:"text-h5"},[e._v(" 您确认删除这条数据嘛? ")]),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{color:"green darken-1",text:""},on:{click:function(t){e.deleteDialog=!1}}},[e._v(" 取消 ")]),s("v-btn",{attrs:{color:"green darken-1",text:""},on:{click:e.confirmDelete}},[e._v(" 确定 ")])],1)],1)],1)],1)],1)},ns=[],cs={name:"Accesslog",components:{Breadcrumb:N},data:()=>({breads:[{text:"trafficManagement",href:""},{text:"trafficAccesslog",href:""}],typeAhead:[],input:null,searchLoading:!1,timerID:null,application:"",accesslog:"",deleteDialog:!1,createApplication:"",createAccesslog:"",deleteApplication:"",deleteAccesslog:"",dialog:!1,headers:[],service:null,tableData:[],services:[],loading:!1,updateDialog:!1,updateApplication:"",updateAccesslog:""}),methods:{submit(){if(!this.accesslog||!this.application)return this.$notify.error("service is needed"),!1;this.search()},search(){this.$axios.get("/traffic/accesslog",{params:{application:this.application,accesslog:this.accesslog}}).then(e=>{console.log(e),this.tableData=[],e.data.forEach(e=>{this.tableData.push(e)}),console.log(this.tableData)})},saveUpdate(){console.log(this.updateAccesslog),this.updateDialog=!1,this.$axios.put("/traffic/accesslog",{application:this.updateApplication,accesslog:this.updateAccesslog}).then(e=>{e&&alert("操作成功")})},setHeaders:function(){this.headers=[{text:"服务",value:"application"},{text:"accesslog",value:"accesslog"},{text:"操作",value:""}]},closeUpdateDialog(){this.updateDialog=!1},create(){this.dialog=!0},confirmDelete(){console.log(this.deleteAccesslog),this.$axios.delete("/traffic/accesslog",{application:this.deleteApplication,accesslog:this.deleteAccesslog}).then(e=>{e&&alert("操作成功")}),this.deleteAccesslog=!1},deleteItem(e){this.deleteDialog=!0,this.deleteAccesslog=e.accesslog,this.deleteApplication=e.application},update(e){console.log(e),this.updateApplication=e.application,this.updateAccesslog=e.accesslog,this.updateDialog=!0,console.log(this.updateApplication),console.log(this.updateAccesslog)},save(){this.$axios.post("/traffic/accesslog",{application:this.createApplication,accesslog:this.createAccesslog}).then(e=>{e&&alert("操作成功")})},closeDialog(){this.dialog=!1}},watch:{area(){this.setHeaders()}},mounted(){this.setHeaders()}},ds=cs,us=Object(n["a"])(ds,ls,ns,!1,null,null,null),ps=us.exports,hs=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("v-container",{attrs:{"grid-list-xl":"",fluid:""}},[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{lg12:""}},[s("Breadcrumb",{attrs:{title:"trafficArguments",items:e.breads}})],1),s("v-flex",{attrs:{lg12:""}},[s("v-card",{attrs:{flat:"",color:"transparent"}},[s("v-card-text",[s("v-form",[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-text-field",{attrs:{flat:"",label:"请输入服务名"},model:{value:e.service,callback:function(t){e.service=t},expression:"service"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Version",hint:e.$t("dataIdVersionHint")},model:{value:e.group,callback:function(t){e.group=t},expression:"group"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Group",hint:e.$t("dataIdGroupHint")},model:{value:e.version,callback:function(t){e.version=t},expression:"version"}})],1),s("v-btn",{attrs:{color:"primary",large:""},on:{click:e.submit}},[e._v(e._s(e.$t("search")))]),s("v-btn",{attrs:{color:"primary",large:""},on:{click:e.create}},[e._v("新建")])],1)],1)],1)],1)],1),s("v-flex",{attrs:{xs12:""}},[s("v-card",[s("v-toolbar",{staticClass:"elevation-0",attrs:{flat:"",color:"transparent"}},[s("v-toolbar-title",[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("trafficArguments")))])]),s("v-spacer")],1),s("v-data-table",{staticClass:"elevation-1",attrs:{headers:e.headers,items:e.tableData,"hide-actions":""},scopedSlots:e._u([{key:"items",fn:function(t){return[s("td",[e._v(e._s(t.item.service))]),s("td",[e._v(e._s(t.item.rule))]),s("td",[e._v(e._s(t.item.group))]),s("td",[e._v(e._s(t.item.version))]),s("td",{staticClass:"text-xs-center px-0",attrs:{nowrap:""}},[s("v-btn",{staticClass:"tiny",attrs:{color:"success"},on:{click:function(s){return e.update(t.item)}}},[e._v(" 修改 ")]),s("v-btn",{staticClass:"tiny",attrs:{outline:""},on:{click:function(s){return e.deleteItem(t.item)}}},[e._v(" 删除 ")])],1)]}}])})],1)],1),s("v-dialog",{attrs:{width:"800px",persistent:""},model:{value:e.dialog,callback:function(t){e.dialog=t},expression:"dialog"}},[s("v-card",[s("v-card-title",{staticClass:"justify-center"},[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("createArgumentRule")))])]),s("v-card-text",[s("v-layout",{attrs:{wrap:""}},[s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-text-field",{attrs:{label:"服务名",hint:"请输入服务名"},model:{value:e.createService,callback:function(t){e.createService=t},expression:"createService"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Group",hint:"请输入Group"},model:{value:e.createGroup,callback:function(t){e.createGroup=t},expression:"createGroup"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Version",hint:"请输入Version"},model:{value:e.createVersion,callback:function(t){e.createVersion=t},expression:"createVersion"}})],1)],1),s("v-layout",{attrs:{wrap:""}},[s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"方法名",hint:"请输入方法名"},model:{value:e.createRule,callback:function(t){e.createRule=t},expression:"createRule"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"参数索引",hint:"如第一个参数,请输入0",type:"number"},model:{value:e.createRule,callback:function(t){e.createRule=t},expression:"createRule"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"参数匹配条件",hint:"请输入参数匹配条件"},model:{value:e.createRule,callback:function(t){e.createRule=t},expression:"createRule"}})],1)],1)],1),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{flat:""},nativeOn:{click:function(t){return e.closeDialog(t)}}},[e._v(e._s(e.$t("close")))]),s("v-btn",{attrs:{depressed:"",color:"primary"},nativeOn:{click:function(t){return e.save(t)}}},[e._v(e._s(e.$t("save")))])],1)],1)],1),s("v-dialog",{attrs:{width:"800px",persistent:""},model:{value:e.updateDialog,callback:function(t){e.updateDialog=t},expression:"updateDialog"}},[s("v-card",[s("v-card-title",{staticClass:"justify-center"},[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("createArgumentRule")))])]),s("v-card-text",[s("v-layout",{attrs:{wrap:""}},[s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-text-field",{attrs:{label:"服务名",hint:"请输入服务名"},model:{value:e.updateService,callback:function(t){e.updateService=t},expression:"updateService"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Group",hint:"请输入Group"},model:{value:e.updateGroup,callback:function(t){e.updateGroup=t},expression:"updateGroup"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Version",hint:"请输入Version"},model:{value:e.updateVersion,callback:function(t){e.updateVersion=t},expression:"updateVersion"}})],1)],1),s("v-layout",{attrs:{wrap:""}},[s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"方法名",hint:"请输入方法名"},model:{value:e.createRule,callback:function(t){e.createRule=t},expression:"createRule"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"参数索引",hint:"如第一个参数,请输入0",type:"number"},model:{value:e.createRule,callback:function(t){e.createRule=t},expression:"createRule"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"参数匹配条件",hint:"请输入参数匹配条件"},model:{value:e.createRule,callback:function(t){e.createRule=t},expression:"createRule"}})],1)],1)],1),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{flat:""},nativeOn:{click:function(t){return e.closeUpdateDialog(t)}}},[e._v(e._s(e.$t("close")))]),s("v-btn",{attrs:{depressed:"",color:"primary"},nativeOn:{click:function(t){return e.saveUpdate(t)}}},[e._v(e._s(e.$t("save")))])],1)],1)],1),s("v-dialog",{attrs:{persistent:"","max-width":"290"},model:{value:e.deleteDialog,callback:function(t){e.deleteDialog=t},expression:"deleteDialog"}},[s("v-card",[s("v-card-title",{staticClass:"text-h5"},[e._v(" 您确认删除这条数据嘛? ")]),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{color:"green darken-1",text:""},on:{click:function(t){e.deleteDialog=!1}}},[e._v(" 取消 ")]),s("v-btn",{attrs:{color:"green darken-1",text:""},on:{click:e.confirmDelete}},[e._v(" 确定 ")])],1)],1)],1)],1)],1)},vs=[],ms={name:"Arguments",components:{Breadcrumb:N},data:()=>({breads:[{text:"trafficManagement",href:""},{text:"trafficArguments",href:""}],typeAhead:[],input:null,searchLoading:!1,timerID:null,service:"",rule:"",group:"",version:"",createGroup:"",createVersion:"",updateService:"",updateRule:"",updateGroup:"",updateVersion:"",deleteDialog:!1,createService:"",createRule:"",deleteService:"",deleteRule:"",deleteVersion:"",deleteGroup:"",dialog:!1,headers:[],tableData:[],services:[],loading:!1,updateDialog:!1}),methods:{submit(){if(!this.service||!this.rule)return this.$notify.error("service is needed"),!1;this.search()},search(){this.$axios.get("/traffic/argument",{params:{service:this.service,rule:this.rule,group:this.group,version:this.version}}).then(e=>{this.tableData=[],e.data.forEach(e=>{this.tableData.push(e)}),console.log(this.tableData)})},saveUpdate(){this.updateDialog=!1,this.$axios.put("/traffic/argument",{service:this.updateService,rule:this.updateRule,group:this.updateGroup,version:this.updateVersion}).then(e=>{e&&alert("操作成功")})},setHeaders:function(){this.headers=[{text:"应用",value:"service"},{text:"应用规则",value:"rule"},{text:"Group",value:"group"},{text:"Version",value:"version"},{text:"操作",value:""}]},closeUpdateDialog(){this.updateDialog=!1},create(){this.dialog=!0},confirmDelete(){console.log(this.deleteArguments),this.$axios.delete("/traffic/argument",{service:this.deleteService,rule:this.deleteRule,group:this.deleteGroup,version:this.deleteVersion}).then(e=>{e&&alert("操作成功")}),this.deleteArguments=!1},deleteItem(e){this.deleteDialog=!0,this.deleteService=e.service,this.deleteRule=e.rule,this.deleteGroup=e.group,this.deleteVersion=e.version},update(e){this.updateService=e.service,this.updateRule=e.rule,this.updateGroup=e.group,this.updateVersion=e.version,this.updateDialog=!0},save(){this.$axios.post("/traffic/argument",{service:this.createService,rule:this.createRule,group:this.createGroup,version:this.createVersion}).then(e=>{e&&alert("操作成功")}),this.dialog=!1},closeDialog(){this.dialog=!1}},watch:{area(){this.setHeaders()}},mounted(){this.setHeaders()}},fs=ms,gs=Object(n["a"])(fs,hs,vs,!1,null,null,null),xs=gs.exports,bs=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("v-container",{attrs:{"grid-list-xl":"",fluid:""}},[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{lg12:""}},[s("Breadcrumb",{attrs:{title:"trafficGray",items:e.breads}})],1),s("v-flex",{attrs:{lg12:""}},[s("v-card",{attrs:{flat:"",color:"transparent"}},[s("v-card-text",[s("v-form",[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{xs6:"",sm3:"",md9:""}},[s("v-text-field",{attrs:{flat:"",label:"请输入应用名"},model:{value:e.service,callback:function(t){e.service=t},expression:"service"}})],1),s("v-btn",{attrs:{color:"primary",large:""},on:{click:e.submit}},[e._v(e._s(e.$t("search")))]),s("v-btn",{attrs:{color:"primary",large:""},on:{click:e.create}},[e._v("新建")])],1)],1)],1)],1)],1),s("v-flex",{attrs:{xs12:""}},[s("v-card",[s("v-toolbar",{staticClass:"elevation-0",attrs:{flat:"",color:"transparent"}},[s("v-toolbar-title",[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("trafficGray")))])]),s("v-spacer")],1),s("v-data-table",{staticClass:"elevation-1",attrs:{headers:e.headers,items:e.tableData,"hide-actions":""},scopedSlots:e._u([{key:"items",fn:function(t){return[s("td",[e._v(e._s(t.item.service))]),s("td",[e._v(e._s(t.item.mock))]),s("td",[e._v(e._s(t.item.group))]),s("td",[e._v(e._s(t.item.version))]),s("td",{staticClass:"text-xs-center px-0",attrs:{nowrap:""}},[s("v-btn",{staticClass:"tiny",attrs:{color:"success"},on:{click:function(s){return e.Check(t.item)}}},[e._v(" 查看 ")]),s("v-btn",{staticClass:"tiny",attrs:{color:"success"},on:{click:function(s){return e.update(t.item)}}},[e._v(" 修改 ")]),s("v-btn",{staticClass:"tiny",attrs:{outline:""},on:{click:function(s){return e.deleteItem(t.item)}}},[e._v(" 删除 ")])],1)]}}])})],1)],1),s("v-dialog",{attrs:{width:"800px",persistent:""},model:{value:e.dialog,callback:function(t){e.dialog=t},expression:"dialog"}},[s("v-card",[s("v-card-title",{staticClass:"justify-center"},[s("span",{staticClass:"headline"},[e._v("新增GAY")])]),e._l(e.createGay.tags,(function(t,a){return s("v-card-text",{key:a},[s("v-flex",[s("v-text-field",{attrs:{label:"名称",hint:"请输入名称"},model:{value:t.name,callback:function(s){e.$set(t,"name",s)},expression:"modal.name"}})],1),e._l(t.match,(function(t,i){return s("v-layout",{key:i,attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-text-field",{attrs:{label:"key",hint:"请输入key"},model:{value:t.key,callback:function(s){e.$set(t,"key",s)},expression:"item.key"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-select",{staticStyle:{"margin-left":"20px"},attrs:{items:e.items,label:"Outlined style",outlined:""},on:{change:e.updateValue},model:{value:e.selectedOption[i],callback:function(t){e.$set(e.selectedOption,i,t)},expression:"selectedOption[idx]"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md:""}},[s("v-text-field",{staticStyle:{"margin-left":"20px"},attrs:{label:"value",hint:"请输入匹配的值"},model:{value:t.value[e.selectedOption[i]],callback:function(s){e.$set(t.value,e.selectedOption[i],s)},expression:"item.value[selectedOption[idx]]"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-btn",{staticClass:"tiny",staticStyle:{"margin-left":"20px"},attrs:{color:"success",outline:""},on:{click:function(t){return e.addItem(a)}}},[e._v(" 新增一条 ")])],1)],1)}))],2)})),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{flat:""},nativeOn:{click:function(t){return e.closeDialog(t)}}},[e._v(e._s(e.$t("close")))]),s("v-btn",{attrs:{depressed:"",color:"primary"},nativeOn:{click:function(t){return e.save(t)}}},[e._v(e._s(e.$t("save")))])],1)],2)],1),s("v-dialog",{attrs:{width:"800px",persistent:""},model:{value:e.updateDialog,callback:function(t){e.updateDialog=t},expression:"updateDialog"}},[s("v-card",[s("v-card-title",{staticClass:"justify-center"},[s("span",{staticClass:"headline"},[e._v("修改GAY")])]),e._l(e.gay.tags,(function(t,a){return s("v-card-text",{key:a},[s("v-flex",[s("v-text-field",{attrs:{label:"名称",hint:"请输入名称"},model:{value:t.name,callback:function(s){e.$set(t,"name",s)},expression:"modal.name"}})],1),e._l(t.match,(function(t,i){return s("v-layout",{key:i,attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-text-field",{attrs:{label:"key",hint:"请输入key"},model:{value:t.key,callback:function(s){e.$set(t,"key",s)},expression:"item.key"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-select",{staticStyle:{"margin-left":"20px"},attrs:{items:e.items,label:"Outlined style",outlined:""},on:{change:e.updateValue},model:{value:e.selectedOption[i],callback:function(t){e.$set(e.selectedOption,i,t)},expression:"selectedOption[idx]"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md:""}},[s("v-text-field",{staticStyle:{"margin-left":"20px"},attrs:{label:"value",hint:"请输入匹配的值"},model:{value:t.value[e.selectedOption[i]],callback:function(s){e.$set(t.value,e.selectedOption[i],s)},expression:"item.value[selectedOption[idx]]"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-btn",{staticClass:"tiny",staticStyle:{"margin-left":"20px"},attrs:{color:"success",outline:""},on:{click:function(t){return e.addItem(a)}}},[e._v(" 新增一条 ")])],1)],1)}))],2)})),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{flat:""},nativeOn:{click:function(t){return e.closeUpdateDialog(t)}}},[e._v(e._s(e.$t("close")))]),s("v-btn",{attrs:{depressed:"",color:"primary"},nativeOn:{click:function(t){return e.saveUpdate(t)}}},[e._v(e._s(e.$t("save")))])],1)],2)],1),s("v-dialog",{attrs:{persistent:"","max-width":"290"},model:{value:e.deleteDialog,callback:function(t){e.deleteDialog=t},expression:"deleteDialog"}},[s("v-card",[s("v-card-title",{staticClass:"text-h5"},[e._v(" 您确认删除这条数据嘛? ")]),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{color:"green darken-1",text:""},on:{click:function(t){e.deleteDialog=!1}}},[e._v(" 取消 ")]),s("v-btn",{attrs:{color:"green darken-1",text:""},on:{click:e.confirmDelete}},[e._v(" 确定 ")])],1)],1)],1)],1)],1)},ys=[],_s={name:"Gray",components:{Breadcrumb:N},data:()=>({breads:[{text:"trafficManagement",href:""},{text:"trafficGray",href:""}],typeAhead:[],input:null,searchLoading:!1,timerID:null,service:"",gay:"",mock:"",group:"",version:"",createGroup:"",createVersion:"",updateService:"",updateMock:"",updateGroup:"",updateVersion:"",deleteDialog:!1,createService:"",createMock:"",deleteService:"",deleteMock:"",deleteVersion:"",deleteGroup:"",dialog:!1,selectedOption:[],headers:[],items:["empty","exact","noempty","prefix","regex","wildcard"],tableData:[],services:[],loading:!1,updateDialog:!1,createGay:{application:"244",tags:[{name:"233",match:[{key:"string",value:{empty:"",exact:"",noempty:"",prefix:"",regex:"",wildcard:""}}]}]}}),methods:{updateValue(){console.log(this.selectedOption)},submit(){if(!this.service)return this.$notify.error("service is needed"),!1;this.search()},addItem(e){const t={key:"string",value:{empty:"",exact:"",noempty:"",prefix:"",regex:"",wildcard:""}},s=parseInt(e);this.createGay.tags[s].match.push(t)},search(){this.$axios.get("/traffic/gray",{params:{application:this.service}}).then(e=>{this.tableData=[],e.data.forEach(e=>{this.tableData.push(e)}),console.log(this.tableData)})},saveUpdate(){this.updateDialog=!1,this.$axios.put("/traffic/gray",this.gay).then(e=>{e&&alert("操作成功")}),this.dialog=!1},setHeaders:function(){this.headers=[{text:"应用名",value:"service"},{text:"灰度环境",value:"mock"},{text:"操作",value:"version"}]},closeUpdateDialog(){this.updateDialog=!1},create(){this.dialog=!0},confirmDelete(){console.log(this.deleteArguments),this.$axios.delete("/traffic/mock",{service:this.deleteService,mock:this.deleteMock,group:this.deleteGroup,version:this.deleteVersion}).then(e=>{e&&alert("操作成功")}),this.deleteArguments=!1},deleteItem(e){this.deleteDialog=!0,this.deleteService=e.service,this.deleteMock=e.mock,this.deleteGroup=e.group,this.deleteVersion=e.version},update(e){this.updateService=e.service,this.updateMock=e.mock,this.updateGroup=e.group,this.updateVersion=e.version,this.updateDialog=!0},save(){this.$axios.post("/traffic/gray",this.createGay).then(e=>{e&&alert("操作成功")}),this.dialog=!1},closeDialog(){this.dialog=!1}},watch:{area(){this.setHeaders()}},mounted(){this.setHeaders()}},ks=_s,ws=Object(n["a"])(ks,bs,ys,!1,null,null,null),$s=ws.exports,Is=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("v-container",{attrs:{"grid-list-xl":"",fluid:""}},[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{lg12:""}},[s("Breadcrumb",{attrs:{title:"trafficMock",items:e.breads}})],1),s("v-flex",{attrs:{lg12:""}},[s("v-card",{attrs:{flat:"",color:"transparent"}},[s("v-card-text",[s("v-form",[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-text-field",{attrs:{flat:"",label:"请输入服务名"},model:{value:e.service,callback:function(t){e.service=t},expression:"service"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Version",hint:e.$t("dataIdVersionHint")},model:{value:e.group,callback:function(t){e.group=t},expression:"group"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Group",hint:e.$t("dataIdGroupHint")},model:{value:e.version,callback:function(t){e.version=t},expression:"version"}})],1),s("v-btn",{attrs:{color:"primary",large:""},on:{click:e.submit}},[e._v(e._s(e.$t("search")))]),s("v-btn",{attrs:{color:"primary",large:""},on:{click:e.create}},[e._v("新建")])],1)],1)],1)],1)],1),s("v-flex",{attrs:{xs12:""}},[s("v-card",[s("v-toolbar",{staticClass:"elevation-0",attrs:{flat:"",color:"transparent"}},[s("v-toolbar-title",[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("trafficMock")))])]),s("v-spacer")],1),s("v-data-table",{staticClass:"elevation-1",attrs:{headers:e.headers,items:e.tableData,"hide-actions":""},scopedSlots:e._u([{key:"items",fn:function(t){return[s("td",[e._v(e._s(t.item.service))]),s("td",[e._v(e._s(t.item.mock))]),s("td",[e._v(e._s(t.item.group))]),s("td",[e._v(e._s(t.item.version))]),s("td",{staticClass:"text-xs-center px-0",attrs:{nowrap:""}},[s("v-btn",{staticClass:"tiny",attrs:{color:"success"},on:{click:function(s){return e.update(t.item)}}},[e._v(" 修改 ")]),s("v-btn",{staticClass:"tiny",attrs:{outline:""},on:{click:function(s){return e.deleteItem(t.item)}}},[e._v(" 删除 ")])],1)]}}])})],1)],1),s("v-dialog",{attrs:{width:"800px",persistent:""},model:{value:e.dialog,callback:function(t){e.dialog=t},expression:"dialog"}},[s("v-card",[s("v-card-title",{staticClass:"justify-center"},[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("createMockCircuitRule")))])]),s("v-card-text",[s("v-layout",{attrs:{wrap:""}},[s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-text-field",{attrs:{label:"服务名",hint:"请输入服务名"},model:{value:e.createService,callback:function(t){e.createService=t},expression:"createService"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Group",hint:"{{$t('groupInputPrompt')}}"},model:{value:e.createGroup,callback:function(t){e.createGroup=t},expression:"createGroup"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Version",hint:"{{$t('versionInputPrompt')}}"},model:{value:e.createVersion,callback:function(t){e.createVersion=t},expression:"createVersion"}})],1)],1),s("v-layout",{attrs:{wrap:""}},[s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-text-field",{attrs:{label:"这里应该是个下拉框,有两个选项:当调用失败时返回、强制返回",hint:""},model:{value:e.updateMock,callback:function(t){e.updateMock=t},expression:"updateMock"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-text-field",{attrs:{label:"请输入具体返回值(如 json 结构体或字符串,具体取决于方法签名的返回值)",hint:"请点击链接查看如何配置 mock 值。"},model:{value:e.updateMock,callback:function(t){e.updateMock=t},expression:"updateMock"}})],1)],1)],1),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{flat:""},nativeOn:{click:function(t){return e.closeDialog(t)}}},[e._v(e._s(e.$t("close")))]),s("v-btn",{attrs:{depressed:"",color:"primary"},nativeOn:{click:function(t){return e.save(t)}}},[e._v(e._s(e.$t("save")))])],1)],1)],1),s("v-dialog",{attrs:{width:"800px",persistent:""},model:{value:e.updateDialog,callback:function(t){e.updateDialog=t},expression:"updateDialog"}},[s("v-card",[s("v-card-title",{staticClass:"justify-center"},[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("createMockCircuitRule")))])]),s("v-card-text",[s("v-layout",{attrs:{wrap:""}},[s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-text-field",{attrs:{label:"服务名",hint:"请输入服务名"},model:{value:e.updateService,callback:function(t){e.updateService=t},expression:"updateService"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Group",hint:"{{$t('groupInputPrompt')}}"},model:{value:e.updateGroup,callback:function(t){e.updateGroup=t},expression:"updateGroup"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Version",hint:"{{$t('versionInputPrompt')}}"},model:{value:e.updateVersion,callback:function(t){e.updateVersion=t},expression:"updateVersion"}})],1)],1),s("v-layout",{attrs:{wrap:""}},[s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-text-field",{attrs:{label:"这里应该是个下拉框,有两个选项:当调用失败时返回、强制返回",hint:""},model:{value:e.updateMock,callback:function(t){e.updateMock=t},expression:"updateMock"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-text-field",{attrs:{label:"请输入具体返回值(如 json 结构体或字符串,具体取决于方法签名的返回值)",hint:"请点击链接查看如何配置 mock 值。"},model:{value:e.updateMock,callback:function(t){e.updateMock=t},expression:"updateMock"}})],1)],1)],1),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{flat:""},nativeOn:{click:function(t){return e.closeUpdateDialog(t)}}},[e._v(e._s(e.$t("close")))]),s("v-btn",{attrs:{depressed:"",color:"primary"},nativeOn:{click:function(t){return e.saveUpdate(t)}}},[e._v(e._s(e.$t("save")))])],1)],1)],1),s("v-dialog",{attrs:{persistent:"","max-width":"290"},model:{value:e.deleteDialog,callback:function(t){e.deleteDialog=t},expression:"deleteDialog"}},[s("v-card",[s("v-card-title",{staticClass:"text-h5"},[e._v(" 您确认删除这条数据嘛? ")]),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{color:"green darken-1",text:""},on:{click:function(t){e.deleteDialog=!1}}},[e._v(" 取消 ")]),s("v-btn",{attrs:{color:"green darken-1",text:""},on:{click:e.confirmDelete}},[e._v(" 确定 ")])],1)],1)],1)],1)],1)},Ds=[],Ss={name:"Mock",components:{Breadcrumb:N},data:()=>({breads:[{text:"trafficManagement",href:""},{text:"trafficMock",href:""}],typeAhead:[],input:null,searchLoading:!1,timerID:null,service:"",mock:"",group:"",version:"",createGroup:"",createVersion:"",updateService:"",updateMock:"",updateGroup:"",updateVersion:"",deleteDialog:!1,createService:"",createMock:"",deleteService:"",deleteMock:"",deleteVersion:"",deleteGroup:"",dialog:!1,headers:[],tableData:[],services:[],loading:!1,updateDialog:!1}),methods:{submit(){if(!this.service||!this.mock)return this.$notify.error("service is needed"),!1;this.search()},search(){this.$axios.get("/traffic/mock",{params:{service:this.service,mock:this.mock,group:this.group,version:this.version}}).then(e=>{this.tableData=[],e.data.forEach(e=>{this.tableData.push(e)}),console.log(this.tableData)})},saveUpdate(){this.updateDialog=!1,this.$axios.put("/traffic/mock",{service:this.updateService,mock:this.updateMock,group:this.updateGroup,version:this.updateVersion}).then(e=>{e&&alert("操作成功")})},setHeaders:function(){this.headers=[{text:"应用",value:"service"},{text:"Mock",value:"mock"},{text:"Group",value:"group"},{text:"Version",value:"version"},{text:"操作",value:""}]},closeUpdateDialog(){this.updateDialog=!1},create(){this.dialog=!0},confirmDelete(){console.log(this.deleteMock),this.$axios.delete("/traffic/mock",{service:this.deleteService,mock:this.deleteMock,group:this.deleteGroup,version:this.deleteVersion}).then(e=>{e&&alert("操作成功")}),this.deleteAccesslog=!1},deleteItem(e){this.deleteDialog=!0,this.deleteService=e.service,this.deleteMock=e.mock,this.deleteGroup=e.group,this.deleteVersion=e.version},update(e){this.updateService=e.service,this.updateMock=e.mock,this.updateGroup=e.group,this.updateVersion=e.version,this.updateDialog=!0},save(){this.$axios.post("/traffic/mock",{service:this.createService,mock:this.createMock,group:this.createGroup,version:this.createVersion}).then(e=>{e&&alert("操作成功")}),this.dialog=!1},closeDialog(){this.dialog=!1}},watch:{area(){this.setHeaders()}},mounted(){this.setHeaders()}},Cs=Ss,As=Object(n["a"])(Cs,Is,Ds,!1,null,null,null),Rs=As.exports,Es=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("v-container",{attrs:{"grid-list-xl":"",fluid:""}},[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{lg12:""}},[s("Breadcrumb",{attrs:{title:"trafficRegion",items:e.breads}})],1),s("v-flex",{attrs:{lg12:""}},[s("v-card",{attrs:{flat:"",color:"transparent"}},[s("v-card-text",[s("v-form",[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-text-field",{attrs:{flat:"",label:"请输入服务名"},model:{value:e.service,callback:function(t){e.service=t},expression:"service"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Version",hint:e.$t("dataIdVersionHint")},model:{value:e.group,callback:function(t){e.group=t},expression:"group"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Group",hint:e.$t("dataIdGroupHint")},model:{value:e.version,callback:function(t){e.version=t},expression:"version"}})],1),s("v-btn",{attrs:{color:"primary",large:""},on:{click:e.submit}},[e._v(e._s(e.$t("search")))]),s("v-btn",{attrs:{color:"primary",large:""},on:{click:e.create}},[e._v("新建")])],1)],1)],1)],1)],1),s("v-flex",{attrs:{xs12:""}},[s("v-card",[s("v-toolbar",{staticClass:"elevation-0",attrs:{flat:"",color:"transparent"}},[s("v-toolbar-title",[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("trafficRegion")))])]),s("v-spacer")],1),s("v-data-table",{staticClass:"elevation-1",attrs:{headers:e.headers,items:e.tableData,"hide-actions":""},scopedSlots:e._u([{key:"items",fn:function(t){return[s("td",[e._v(e._s(t.item.service))]),s("td",[e._v(e._s(t.item.rule))]),s("td",[e._v(e._s(t.item.group))]),s("td",[e._v(e._s(t.item.version))]),s("td",{staticClass:"text-xs-center px-0",attrs:{nowrap:""}},[s("v-btn",{staticClass:"tiny",attrs:{color:"success"},on:{click:function(s){return e.update(t.item)}}},[e._v(" 修改 ")]),s("v-btn",{staticClass:"tiny",attrs:{outline:""},on:{click:function(s){return e.deleteItem(t.item)}}},[e._v(" 删除 ")])],1)]}}])})],1)],1),s("v-dialog",{attrs:{width:"800px",persistent:""},model:{value:e.dialog,callback:function(t){e.dialog=t},expression:"dialog"}},[s("v-card",[s("v-card-title",{staticClass:"justify-center"},[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("createNewRoutingRule")))])]),s("v-card-text",[s("v-layout",{attrs:{wrap:""}},[s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-text-field",{attrs:{label:"服务名",hint:"请输入服务名"},model:{value:e.createService,callback:function(t){e.createService=t},expression:"createService"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Group",hint:"{{$t('groupInputPrompt')}}"},model:{value:e.createGroup,callback:function(t){e.createGroup=t},expression:"createGroup"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Version",hint:"{{$t('versionInputPrompt')}}"},model:{value:e.createVersion,callback:function(t){e.createVersion=t},expression:"createVersion"}})],1)],1),s("v-text-field",{attrs:{label:"开启或关闭同区域优先(这里应该是一个开关,让用户选择打开或关闭同区域优先)",hint:""},model:{value:e.createRule,callback:function(t){e.createRule=t},expression:"createRule"}}),s("v-text-field",{attrs:{label:"匹配以下条件的流量开启同区域优先(默认不显示,用户点击后才显示出来让用户输入)",hint:"请输入流量匹配规则(默认不设置,则对所有流量生效),配置后只有匹配规则的流量才会执行同区域优先调用,如 method=sayHello"},model:{value:e.createRule,callback:function(t){e.createRule=t},expression:"createRule"}})],1),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{flat:""},nativeOn:{click:function(t){return e.closeDialog(t)}}},[e._v(e._s(e.$t("close")))]),s("v-btn",{attrs:{depressed:"",color:"primary"},nativeOn:{click:function(t){return e.save(t)}}},[e._v(e._s(e.$t("save")))])],1)],1)],1),s("v-dialog",{attrs:{width:"800px",persistent:""},model:{value:e.updateDialog,callback:function(t){e.updateDialog=t},expression:"updateDialog"}},[s("v-card",[s("v-card-title",{staticClass:"justify-center"},[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("createNewRoutingRule")))])]),s("v-card-text",[s("v-layout",{attrs:{wrap:""}},[s("v-flex",[s("v-text-field",{attrs:{label:"服务名",hint:"请输入服务名"},model:{value:e.updateService,callback:function(t){e.updateService=t},expression:"updateService"}})],1)],1),s("v-text-field",{attrs:{label:"Group",hint:"{{$t('groupInputPrompt')}}"},model:{value:e.updateGroup,callback:function(t){e.updateGroup=t},expression:"updateGroup"}}),s("v-text-field",{attrs:{label:"Version",hint:"{{$t('versionInputPrompt')}}"},model:{value:e.updateVersion,callback:function(t){e.updateVersion=t},expression:"updateVersion"}}),s("v-text-field",{attrs:{label:"开启或关闭同区域优先(这里应该是一个开关,让用户选择打开或关闭同区域优先)",hint:"这应该是一个 radio button,让用户选择是否开启同区域优先?"},model:{value:e.updateRule1,callback:function(t){e.updateRule1=t},expression:"updateRule1"}}),s("v-text-field",{attrs:{label:"匹配以下条件的流量开启同区域优先(默认不显示,用户点击后才显示出来让用户输入)",hint:"请输入流量匹配规则(默认不设置,则对所有流量生效),配置后只有匹配规则的流量才会执行同区域优先调用,如 method=sayHello"},model:{value:e.updateRule2,callback:function(t){e.updateRule2=t},expression:"updateRule2"}})],1),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{flat:""},nativeOn:{click:function(t){return e.closeUpdateDialog(t)}}},[e._v(e._s(e.$t("close")))]),s("v-btn",{attrs:{depressed:"",color:"primary"},nativeOn:{click:function(t){return e.saveUpdate(t)}}},[e._v(e._s(e.$t("save")))])],1)],1)],1),s("v-dialog",{attrs:{persistent:"","max-width":"290"},model:{value:e.deleteDialog,callback:function(t){e.deleteDialog=t},expression:"deleteDialog"}},[s("v-card",[s("v-card-title",{staticClass:"text-h5"},[e._v(" 您确认删除这条数据嘛? ")]),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{color:"green darken-1",text:""},on:{click:function(t){e.deleteDialog=!1}}},[e._v(" 取消 ")]),s("v-btn",{attrs:{color:"green darken-1",text:""},on:{click:e.confirmDelete}},[e._v(" 确定 ")])],1)],1)],1)],1)],1)},Ts=[],Ls={name:"Region",components:{Breadcrumb:N},data:()=>({breads:[{text:"trafficManagement",href:""},{text:"trafficRegion",href:""}],typeAhead:[],input:null,searchLoading:!1,timerID:null,service:"",rule:"",group:"",version:"",createGroup:"",createVersion:"",updateService:"",updateRule:"",updateGroup:"",updateVersion:"",deleteDialog:!1,createService:"",createRule:"",deleteService:"",deleteRule:"",deleteVersion:"",deleteGroup:"",dialog:!1,headers:[],tableData:[],services:[],loading:!1,updateDialog:!1}),methods:{submit(){if(!this.service||!this.rule)return this.$notify.error("service is needed"),!1;this.search()},search(){this.$axios.get("/traffic/region",{params:{service:this.service,rule:this.rule,group:this.group,version:this.version}}).then(e=>{this.tableData=[],e.data.forEach(e=>{this.tableData.push(e)}),console.log(this.tableData)})},saveUpdate(){this.updateDialog=!1,this.$axios.put("/traffic/region",{service:this.updateService,rule:this.updateRule,group:this.updateGroup,version:this.updateVersion}).then(e=>{e&&alert("操作成功")})},setHeaders:function(){this.headers=[{text:"应用",value:"service"},{text:"应用规则",value:"rule"},{text:"Group",value:"group"},{text:"Version",value:"version"},{text:"操作",value:""}]},closeUpdateDialog(){this.updateDialog=!1},create(){this.dialog=!0},confirmDelete(){console.log(this.deleteRegion),this.$axios.delete("/traffic/region",{service:this.deleteService,rule:this.deleteRule,group:this.deleteGroup,version:this.deleteVersion}).then(e=>{e&&alert("操作成功")}),this.deleteRegion=!1},deleteItem(e){this.deleteDialog=!0,this.deleteService=e.service,this.deleteRule=e.rule,this.deleteGroup=e.group,this.deleteVersion=e.version},update(e){this.updateService=e.service,this.updateRule=e.rule,this.updateGroup=e.group,this.updateVersion=e.version,this.updateDialog=!0},save(){this.$axios.post("/traffic/region",{service:this.createService,rule:this.createRule,group:this.createGroup,version:this.createVersion}).then(e=>{e&&alert("操作成功")}),this.dialog=!1},closeDialog(){this.dialog=!1}},watch:{area(){this.setHeaders()}},mounted(){this.setHeaders()}},Vs=Ls,Hs=Object(n["a"])(Vs,Es,Ts,!1,null,null,null),Gs=Hs.exports,Os=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("v-container",{attrs:{"grid-list-xl":"",fluid:""}},[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{lg12:""}},[s("Breadcrumb",{attrs:{title:"trafficRetry",items:e.breads}})],1),s("v-flex",{attrs:{lg12:""}},[s("v-card",{attrs:{flat:"",color:"transparent"}},[s("v-card-text",[s("v-form",[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-text-field",{attrs:{flat:"",label:"请输入服务名"},model:{value:e.service,callback:function(t){e.service=t},expression:"service"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Version",hint:e.$t("dataIdVersionHint")},model:{value:e.group,callback:function(t){e.group=t},expression:"group"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Group",hint:e.$t("dataIdGroupHint")},model:{value:e.version,callback:function(t){e.version=t},expression:"version"}})],1),s("v-btn",{attrs:{color:"primary",large:""},on:{click:e.submit}},[e._v(e._s(e.$t("search")))]),s("v-btn",{attrs:{color:"primary",large:""},on:{click:e.create}},[e._v("新建")])],1)],1)],1)],1)],1),s("v-flex",{attrs:{xs12:""}},[s("v-card",[s("v-toolbar",{staticClass:"elevation-0",attrs:{flat:"",color:"transparent"}},[s("v-toolbar-title",[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("trafficRetry")))])]),s("v-spacer")],1),s("v-data-table",{staticClass:"elevation-1",attrs:{headers:e.headers,items:e.tableData,"hide-actions":""},scopedSlots:e._u([{key:"items",fn:function(t){return[s("td",[e._v(e._s(t.item.service))]),s("td",[e._v(e._s(t.item.retry))]),s("td",[e._v(e._s(t.item.group))]),s("td",[e._v(e._s(t.item.version))]),s("td",{staticClass:"text-xs-center px-0",attrs:{nowrap:""}},[s("v-btn",{staticClass:"tiny",attrs:{color:"success"},on:{click:function(s){return e.update(t.item)}}},[e._v(" 修改 ")]),s("v-btn",{staticClass:"tiny",attrs:{outline:""},on:{click:function(s){return e.deleteItem(t.item)}}},[e._v(" 删除 ")])],1)]}}])})],1)],1),s("v-dialog",{attrs:{width:"800px",persistent:""},model:{value:e.dialog,callback:function(t){e.dialog=t},expression:"dialog"}},[s("v-card",[s("v-card-title",{staticClass:"justify-center"},[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("createRetryRule")))])]),s("v-card-text",[s("v-layout",{attrs:{wrap:""}},[s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-text-field",{attrs:{label:"服务名",hint:"请输入服务名"},model:{value:e.createService,callback:function(t){e.createService=t},expression:"createService"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Group",hint:"请输入服务group(可选)"},model:{value:e.createGroup,callback:function(t){e.createGroup=t},expression:"createGroup"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Version",hint:"请输入服务version(可选)"},model:{value:e.createVersion,callback:function(t){e.createVersion=t},expression:"createVersion"}})],1)],1),s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-text-field",{attrs:{label:"重试次数",hint:"请输入一个整数值(如 3 代表在服务调用失败后重试 3 次)",type:"number"},model:{value:e.createRetry,callback:function(t){e.createRetry=t},expression:"createRetry"}})],1)],1),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{flat:""},nativeOn:{click:function(t){return e.closeDialog(t)}}},[e._v(e._s(e.$t("close")))]),s("v-btn",{attrs:{depressed:"",color:"primary"},nativeOn:{click:function(t){return e.save(t)}}},[e._v(e._s(e.$t("save")))])],1)],1)],1),s("v-dialog",{attrs:{width:"800px",persistent:""},model:{value:e.updateDialog,callback:function(t){e.updateDialog=t},expression:"updateDialog"}},[s("v-card",[s("v-card-title",{staticClass:"justify-center"},[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("createRetryRule")))])]),s("v-card-text",[s("v-layout",{attrs:{wrap:""}},[s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-text-field",{attrs:{label:"服务名",hint:"请输入服务名"},model:{value:e.updateService,callback:function(t){e.updateService=t},expression:"updateService"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Group",hint:"请输入服务group(可选)"},model:{value:e.updateGroup,callback:function(t){e.updateGroup=t},expression:"updateGroup"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Version",hint:"请输入服务version(可选)"},model:{value:e.updateVersion,callback:function(t){e.updateVersion=t},expression:"updateVersion"}})],1)],1),s("v-text-field",{attrs:{label:"重试次数",hint:"请输入一个整数值(如 3 代表在服务调用失败后重试 3 次)"},model:{value:e.updateRetry,callback:function(t){e.updateRetry=t},expression:"updateRetry"}})],1),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{flat:""},nativeOn:{click:function(t){return e.closeUpdateDialog(t)}}},[e._v(e._s(e.$t("close")))]),s("v-btn",{attrs:{depressed:"",color:"primary"},nativeOn:{click:function(t){return e.saveUpdate(t)}}},[e._v(e._s(e.$t("save")))])],1)],1)],1),s("v-dialog",{attrs:{persistent:"","max-width":"290"},model:{value:e.deleteDialog,callback:function(t){e.deleteDialog=t},expression:"deleteDialog"}},[s("v-card",[s("v-card-title",{staticClass:"text-h5"},[e._v(" 您确认删除这条数据嘛? ")]),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{color:"green darken-1",text:""},on:{click:function(t){e.deleteDialog=!1}}},[e._v(" 取消 ")]),s("v-btn",{attrs:{color:"green darken-1",text:""},on:{click:e.confirmDelete}},[e._v(" 确定 ")])],1)],1)],1)],1)],1)},Bs=[],Ns={name:"Retry",components:{Breadcrumb:N},data:()=>({breads:[{text:"trafficManagement",href:""},{text:"trafficRetry",href:""}],typeAhead:[],input:null,searchLoading:!1,timerID:null,service:"",retry:"",group:"",version:"",createGroup:"",createVersion:"",updateService:"",updateRetry:"",updateGroup:"",updateVersion:"",deleteDialog:!1,createService:"",createRetry:"",deleteService:"",deleteRetry:"",deleteVersion:"",deleteGroup:"",dialog:!1,headers:[],tableData:[],services:[],loading:!1,updateDialog:!1}),methods:{submit(){if(!this.service||!this.retry)return this.$notify.error("service is needed"),!1;this.search()},search(){this.$axios.get("/traffic/retry",{params:{service:this.service,retry:this.retry,group:this.group,version:this.version}}).then(e=>{this.tableData=[],e.data.forEach(e=>{this.tableData.push(e)}),console.log(this.tableData)})},saveUpdate(){this.updateDialog=!1,this.$axios.put("/traffic/retry",{service:this.updateService,retry:this.updateRetry,group:this.updateGroup,version:this.updateVersion}).then(e=>{e&&alert("操作成功")})},setHeaders:function(){this.headers=[{text:"应用",value:"service"},{text:"Retry",value:"retry"},{text:"Group",value:"group"},{text:"Version",value:"version"},{text:"操作",value:""}]},closeUpdateDialog(){this.updateDialog=!1},create(){this.dialog=!0},confirmDelete(){console.log(this.deleteRetry),this.$axios.delete("/traffic/retry",{service:this.deleteService,retry:this.deleteRetry,group:this.deleteGroup,version:this.deleteVersion}).then(e=>{e&&alert("操作成功")}),this.deleteRetry=!1},deleteItem(e){this.deleteDialog=!0,this.deleteService=e.service,this.deleteRetry=e.retry,this.deleteGroup=e.group,this.deleteVersion=e.version},update(e){this.updateService=e.service,this.updateRetry=e.retry,this.updateGroup=e.group,this.updateVersion=e.version,this.updateDialog=!0},save(){this.$axios.post("/traffic/retry",{service:this.createService,retry:this.createRetry,group:this.createGroup,version:this.createVersion}).then(e=>{e&&alert("操作成功")}),this.dialog=!1},closeDialog(){this.dialog=!1}},watch:{area(){this.setHeaders()}},mounted(){this.setHeaders()}},Ms=Ns,js=Object(n["a"])(Ms,Os,Bs,!1,null,null,null),Ps=js.exports,qs=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("v-container",{attrs:{"grid-list-xl":"",fluid:""}},[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{lg12:""}},[s("Breadcrumb",{attrs:{title:"trafficTimeout",items:e.breads}})],1),s("v-flex",{attrs:{lg12:""}},[s("v-card",{attrs:{flat:"",color:"transparent"}},[s("v-card-text",[s("v-form",[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-text-field",{attrs:{flat:"",label:"请输入服务名"},model:{value:e.service,callback:function(t){e.service=t},expression:"service"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Version",hint:e.$t("dataIdVersionHint")},model:{value:e.group,callback:function(t){e.group=t},expression:"group"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"Group",hint:e.$t("dataIdGroupHint")},model:{value:e.version,callback:function(t){e.version=t},expression:"version"}})],1),s("v-btn",{attrs:{color:"primary",large:""},on:{click:e.submit}},[e._v(e._s(e.$t("search")))]),s("v-btn",{attrs:{color:"primary",large:""},on:{click:e.create}},[e._v("新建")])],1)],1)],1)],1)],1),s("v-flex",{attrs:{xs12:""}},[s("v-card",[s("v-toolbar",{staticClass:"elevation-0",attrs:{flat:"",color:"transparent"}},[s("v-toolbar-title",[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("trafficTimeout")))])]),s("v-spacer")],1),s("v-data-table",{staticClass:"elevation-1",attrs:{headers:e.headers,items:e.tableData,"hide-actions":""},scopedSlots:e._u([{key:"items",fn:function(t){return[s("td",[e._v(e._s(t.item.service))]),s("td",[e._v(e._s(t.item.timeout))]),s("td",[e._v(e._s(t.item.group))]),s("td",[e._v(e._s(t.item.version))]),s("td",{staticClass:"text-xs-center px-0",attrs:{nowrap:""}},[s("v-btn",{staticClass:"tiny",attrs:{color:"success"},on:{click:function(s){return e.update(t.item)}}},[e._v(" 修改 ")]),s("v-btn",{staticClass:"tiny",attrs:{outline:""},on:{click:function(s){return e.deleteItem(t.item)}}},[e._v(" 删除 ")])],1)]}}])})],1)],1),s("v-dialog",{attrs:{width:"800px",persistent:""},model:{value:e.dialog,callback:function(t){e.dialog=t},expression:"dialog"}},[s("v-card",[s("v-card-title",{staticClass:"justify-center"},[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("createTimeoutRule")))])]),s("v-card-text",[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-text-field",{attrs:{label:"服务名",hint:"请输入服务名"},model:{value:e.createService,callback:function(t){e.createService=t},expression:"createService"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"服务分组",hint:"请输入服务group(可选)"},model:{value:e.createGroup,callback:function(t){e.createGroup=t},expression:"createGroup"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"服务版本",hint:"请输入服务version(可选)"},model:{value:e.createVersion,callback:function(t){e.createVersion=t},expression:"createVersion"}})],1)],1),s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-text-field",{attrs:{label:"超时时间",hint:"请输入一个整数值作为超时时间(单位ms)",type:"number"},model:{value:e.createTimeout,callback:function(t){e.createTimeout=t},expression:"createTimeout"}})],1)],1),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{flat:""},nativeOn:{click:function(t){return e.closeDialog(t)}}},[e._v(e._s(e.$t("close")))]),s("v-btn",{attrs:{depressed:"",color:"primary"},nativeOn:{click:function(t){return e.save(t)}}},[e._v(e._s(e.$t("save")))])],1)],1)],1),s("v-dialog",{attrs:{width:"800px",persistent:""},model:{value:e.updateDialog,callback:function(t){e.updateDialog=t},expression:"updateDialog"}},[s("v-card",[s("v-card-title",{staticClass:"justify-center"},[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("createTimeoutRule")))])]),s("v-card-text",[s("v-layout",{attrs:{wrap:""}},[s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-text-field",{attrs:{label:"服务名",hint:"请输入服务名"},model:{value:e.updateService,callback:function(t){e.updateService=t},expression:"updateService"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"服务分组",hint:"请输入服务group(可选)"},model:{value:e.updateGroup,callback:function(t){e.updateGroup=t},expression:"updateGroup"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md2:""}},[s("v-text-field",{attrs:{label:"服务版本",hint:"请输入服务version(可选)"},model:{value:e.updateVersion,callback:function(t){e.updateVersion=t},expression:"updateVersion"}})],1)],1),s("v-text-field",{attrs:{label:"超时时间",hint:"请输入一个整数值作为超时时间(单位ms)",type:"number"},model:{value:e.updateTimeout,callback:function(t){e.updateTimeout=t},expression:"updateTimeout"}})],1),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{flat:""},nativeOn:{click:function(t){return e.closeUpdateDialog(t)}}},[e._v(e._s(e.$t("close")))]),s("v-btn",{attrs:{depressed:"",color:"primary"},nativeOn:{click:function(t){return e.saveUpdate(t)}}},[e._v(e._s(e.$t("save")))])],1)],1)],1),s("v-dialog",{attrs:{persistent:"","max-width":"290"},model:{value:e.deleteDialog,callback:function(t){e.deleteDialog=t},expression:"deleteDialog"}},[s("v-card",[s("v-card-title",{staticClass:"text-h5"},[e._v(" 您确认删除这条数据嘛? ")]),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{color:"green darken-1",text:""},on:{click:function(t){e.deleteDialog=!1}}},[e._v(" 取消 ")]),s("v-btn",{attrs:{color:"green darken-1",text:""},on:{click:e.confirmDelete}},[e._v(" 确定 ")])],1)],1)],1)],1)],1)},Qs=[],Fs={name:"Timeout",components:{Breadcrumb:N},data:()=>({breads:[{text:"trafficManagement",href:""},{text:"trafficTimeout",href:""}],typeAhead:[],input:null,searchLoading:!1,timerID:null,service:"",timeout:null,group:"",version:"",createGroup:"",createVersion:"",updateService:"",updateTimeout:NaN,updateGroup:"",updateVersion:"",deleteDialog:!1,createService:"",createTimeout:NaN,deleteService:"",deleteTimeout:NaN,deleteVersion:"",deleteGroup:"",dialog:!1,headers:[],tableData:[],services:[],loading:!1,updateDialog:!1}),methods:{submit(){if(!this.service||!this.timeout)return this.$notify.error("service is needed"),!1;this.search()},search(){this.$axios.get("/traffic/timeout",{params:{service:this.service,timeout:parseInt(this.timeout),group:this.group,version:this.version}}).then(e=>{this.tableData=[],e.data.forEach(e=>{this.tableData.push(e)}),console.log(this.tableData)})},saveUpdate(){this.updateDialog=!1,this.$axios.put("/traffic/timeout",{service:this.updateService,timeout:parseInt(this.updateTimeout),group:this.updateGroup,version:this.updateVersion}).then(e=>{e&&alert("操作成功")})},setHeaders:function(){this.headers=[{text:"应用",value:"service"},{text:"Timeout",value:"timeout"},{text:"Group",value:"group"},{text:"Version",value:"version"},{text:"操作",value:""}]},closeUpdateDialog(){this.updateDialog=!1},create(){this.dialog=!0},confirmDelete(){console.log(this.deleteTimeout),this.$axios.delete("/traffic/timeout",{service:this.deleteService,timeout:parseInt(this.deleteTimeout),group:this.deleteGroup,version:this.deleteVersion}).then(e=>{e&&alert("操作成功")}),this.deleteTimeout=!1},deleteItem(e){this.deleteDialog=!0,this.deleteService=e.service,this.deleteTimeout=e.timeout,this.deleteGroup=e.group,this.deleteVersion=e.version},update(e){this.updateService=e.service,this.updateTimeout=e.timeout,this.updateGroup=e.group,this.updateVersion=e.version,this.updateDialog=!0},save(){this.$axios.post("/traffic/timeout",{service:this.createService,timeout:parseInt(this.createTimeout),group:this.createGroup,version:this.createVersion}).then(e=>{e&&alert("操作成功")}),this.dialog=!1},closeDialog(){this.dialog=!1}},watch:{area(){this.setHeaders()}},mounted(){this.setHeaders()}},Ws=Fs,Us=Object(n["a"])(Ws,qs,Qs,!1,null,null,null),Js=Us.exports,zs=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("v-container",{attrs:{"grid-list-xl":"",fluid:""}},[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{lg12:""}},[s("Breadcrumb",{attrs:{title:"trafficWeight",items:e.breads}})],1),s("v-flex",{attrs:{lg12:""}},[s("v-card",{attrs:{flat:"",color:"transparent"}},[s("v-card-text",[s("v-form",[s("v-layout",{attrs:{row:"",wrap:""}},[s("v-combobox",{attrs:{loading:e.searchLoading,items:e.typeAhead,"search-input":e.application,flat:"","append-icon":"","hide-no-data":"",label:"请输入application",hint:"请输入application"},on:{"update:searchInput":function(t){e.application=t},"update:search-input":function(t){e.application=t}}}),s("v-combobox",{staticStyle:{"margin-left":"20px"},attrs:{loading:e.searchLoading,items:e.typeAhead,"search-input":e.accesslog,flat:"","append-icon":"","hide-no-data":"",label:"请输入accesslog",hint:"请输入accesslog"},on:{"update:searchInput":function(t){e.accesslog=t},"update:search-input":function(t){e.accesslog=t}}}),s("v-btn",{attrs:{color:"primary",large:""},on:{click:e.submit}},[e._v("搜索")]),s("v-btn",{attrs:{color:"primary",large:""},on:{click:e.create}},[e._v("新建")])],1)],1)],1)],1)],1),s("v-flex",{attrs:{xs12:""}},[s("v-card",[s("v-toolbar",{staticClass:"elevation-0",attrs:{flat:"",color:"transparent"}},[s("v-toolbar-title",[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("trafficWeight")))])]),s("v-spacer")],1),s("v-data-table",{staticClass:"elevation-1",attrs:{headers:e.headers,items:e.tableData,"hide-actions":""},scopedSlots:e._u([{key:"items",fn:function(t){return[s("td",[e._v(e._s(t.item.application))]),s("td",[e._v(e._s(t.item.accesslog))]),s("td",{staticClass:"text-xs-center px-0",attrs:{nowrap:""}},[s("v-btn",{staticClass:"tiny",attrs:{color:"success"},on:{click:function(s){return e.update(t.item)}}},[e._v(" 修改 ")]),s("v-btn",{staticClass:"tiny",attrs:{outline:""},on:{click:function(s){return e.deleteItem(t.item)}}},[e._v(" 删除 ")]),s("v-btn",{staticClass:"tiny",attrs:{outline:""}},[e._v(" 启用 ")])],1)]}}])})],1)],1),s("v-dialog",{attrs:{width:"800px",persistent:""},model:{value:e.dialog,callback:function(t){e.dialog=t},expression:"dialog"}},[s("v-card",[s("v-card-title",{staticClass:"justify-center"},[s("span",{staticClass:"headline"},[e._v("新增GRAY")])]),s("v-card-text",[s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-select",{staticStyle:{"margin-left":"20px"},attrs:{hint:"请选择key",items:e.keys,label:"Outlined style",outlined:""}})],1),e._l(e.createWeight.match.application.oneof,(function(t,a){return s("v-layout",{key:a,attrs:{row:"",wrap:""}},[s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-select",{staticStyle:{"margin-left":"20px"},attrs:{items:e.items,label:"Outlined style",outlined:""},model:{value:e.selectedOption[a],callback:function(t){e.$set(e.selectedOption,a,t)},expression:"selectedOption[idx]"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md:""}},[s("v-text-field",{staticStyle:{"margin-left":"20px"},attrs:{label:"value",hint:"请输入匹配的值"},model:{value:t[e.selectedOption[a]],callback:function(s){e.$set(t,e.selectedOption[a],s)},expression:"item[selectedOption[idx]]"}})],1),s("v-flex",{attrs:{xs6:"",sm3:"",md3:""}},[s("v-btn",{staticClass:"tiny",staticStyle:{"margin-left":"20px"},attrs:{color:"success",outline:""},on:{click:function(t){return e.addItem(e.index)}}},[e._v(" 新增一条 ")])],1)],1)}))],2),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{flat:""},nativeOn:{click:function(t){return e.closeDialog(t)}}},[e._v(e._s(e.$t("close")))]),s("v-btn",{attrs:{depressed:"",color:"primary"},nativeOn:{click:function(t){return e.save(t)}}},[e._v(e._s(e.$t("save")))])],1)],1)],1),s("v-dialog",{attrs:{width:"800px",persistent:""},model:{value:e.updateDialog,callback:function(t){e.updateDialog=t},expression:"updateDialog"}},[s("v-card",[s("v-card-title",{staticClass:"justify-center"},[s("span",{staticClass:"headline"},[e._v(e._s(e.$t("createNewRoutingRule")))])]),s("v-card-text",[s("v-layout",{attrs:{wrap:""}},[s("v-flex",[s("v-text-field",{attrs:{label:"Application Name",hint:"请输入Application Name"},model:{value:e.updateApplication,callback:function(t){e.updateApplication=t},expression:"updateApplication"}})],1)],1),s("v-text-field",{attrs:{label:"Accesslog",hint:"请输入Accesslog"},model:{value:e.updateAccesslog,callback:function(t){e.updateAccesslog=t},expression:"updateAccesslog"}})],1),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{flat:""},nativeOn:{click:function(t){return e.closeUpdateDialog(t)}}},[e._v(e._s(e.$t("close")))]),s("v-btn",{attrs:{depressed:"",color:"primary"},nativeOn:{click:function(t){return e.saveUpdate(t)}}},[e._v(e._s(e.$t("save")))])],1)],1)],1),s("v-dialog",{attrs:{persistent:"","max-width":"290"},model:{value:e.deleteDialog,callback:function(t){e.deleteDialog=t},expression:"deleteDialog"}},[s("v-card",[s("v-card-title",{staticClass:"text-h5"},[e._v(" 您确认删除这条数据嘛? ")]),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{color:"green darken-1",text:""},on:{click:function(t){e.deleteDialog=!1}}},[e._v(" 取消 ")]),s("v-btn",{attrs:{color:"green darken-1",text:""},on:{click:e.confirmDelete}},[e._v(" 确定 ")])],1)],1)],1)],1)],1)},Ys=[],Zs={name:"Accesslog",components:{Breadcrumb:N},data:()=>({breads:[{text:"trafficManagement",href:""},{text:"trafficWeight",href:""}],typeAhead:[],input:null,searchLoading:!1,timerID:null,application:"",accesslog:"",items:["empty","exact","noempty","prefix","regex","wildcard"],keys:["application","service","param"],selectedKey:[],deleteDialog:!1,createApplication:"",selectedOption:[],createAccesslog:"",deleteApplication:"",createWeight:{match:{application:{oneof:[{empty:"",exact:"",noempty:"",prefix:"",regex:"",wildcard:""}]},param:[{key:"",value:{empty:"",exact:"",noempty:"",prefix:"",regex:"",wildcard:""}}],service:{oneof:[{empty:"",exact:"",noempty:"",prefix:"",regex:"",wildcard:""}]}},weight:0},deleteAccesslog:"",dialog:!1,headers:[],service:null,tableData:[],services:[],loading:!1,updateDialog:!1,updateApplication:"",updateAccesslog:""}),methods:{submit(){if(!this.accesslog||!this.application)return this.$notify.error("service is needed"),!1;this.search()},search(){this.$axios.get("/traffic/accesslog",{params:{application:this.application,accesslog:this.accesslog}}).then(e=>{console.log(e),this.tableData=[],e.data.forEach(e=>{this.tableData.push(e)}),console.log(this.tableData)})},saveUpdate(){console.log(this.updateAccesslog),this.updateDialog=!1,this.$axios.put("/traffic/accesslog",{application:this.updateApplication,accesslog:this.updateAccesslog}).then(e=>{e&&alert("操作成功")})},setHeaders:function(){this.headers=[{text:"服务",value:"application"},{text:"accesslog",value:"accesslog"}]},closeUpdateDialog(){this.updateDialog=!1},create(){this.dialog=!0},confirmDelete(){console.log(this.deleteAccesslog),this.$axios.delete("/traffic/accesslog",{application:this.deleteApplication,accesslog:this.deleteAccesslog}).then(e=>{e&&alert("操作成功")}),this.deleteAccesslog=!1},deleteItem(e){this.deleteDialog=!0,this.deleteAccesslog=e.accesslog,this.deleteApplication=e.application},update(e){console.log(e),this.updateApplication=e.application,this.updateAccesslog=e.accesslog,this.updateDialog=!0,console.log(this.updateApplication),console.log(this.updateAccesslog)},save(){this.$axios.post("/traffic/accesslog",{application:this.createApplication,accesslog:this.createAccesslog}).then(e=>{e&&alert("操作成功")})},closeDialog(){this.dialog=!1}},watch:{area(){this.setHeaders()}},mounted(){this.setHeaders()}},Xs=Zs,Ks=Object(n["a"])(Xs,zs,Ys,!1,null,null,null),ea=Ks.exports,ta=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("v-app",{attrs:{dark:e.dark}},[s("drawer"),s("toolbar"),s("v-content",[s("router-view")],1),s("footers")],1)},sa=[],aa=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("v-navigation-drawer",{attrs:{id:"appDrawer","mini-variant":e.mini,fixed:"",dark:e.$vuetify.dark,app:""},on:{"update:miniVariant":function(t){e.mini=t},"update:mini-variant":function(t){e.mini=t}},model:{value:e.drawer,callback:function(t){e.drawer=t},expression:"drawer"}},[a("v-toolbar",{attrs:{color:"primary darken-1",dark:""}},[a("img",{attrs:{src:s("cf05"),width:"24",height:"24"}}),a("v-toolbar-title",{staticClass:"ml-0 pl-3"},[a("span",{staticClass:"hidden-sm-and-down white--text"},[e._v(e._s(e.$store.state.appTitle))]),a("v-chip",{staticClass:"v-chip--x-small",attrs:{color:"green",disabled:"","text-color":"white",label:""}},[e._v(" "+e._s(e.config.version)+" ")])],1)],1),a("v-list",{attrs:{expand:""}},[e._l(e.menus,(function(t,s){return[t.items?a("v-list-group",{attrs:{group:t.group,"prepend-icon":t.icon,"no-action":""}},[a("v-list-tile",{attrs:{slot:"activator",ripple:""},slot:"activator"},[a("v-list-tile-content",[a("v-list-tile-title",[e._v(e._s(e.$t(t.title)))])],1)],1),e._l(t.items,(function(t,s){return[a("v-list-tile",{attrs:{to:t.path,ripple:""}},[a("v-list-tile-content",[a("v-list-tile-title",[e._v(e._s(e.$t(t.title)))])],1),t.badge?a("v-chip",{staticClass:"v-chip--x-small",attrs:{color:"primary",disabled:"","text-color":"white"}},[e._v(" "+e._s(t.badge)+" ")]):e._e()],1)]}))],2):a("v-list-tile",{key:t.title,attrs:{to:t.path,ripple:""}},[a("v-list-tile-action",[a("v-icon",[e._v(e._s(t.icon))])],1),a("v-list-tile-content",[e._v(e._s(e.$t(t.title)))]),t.badge?a("v-chip",{staticClass:"v-chip--x-small",attrs:{color:"primary",disabled:"","text-color":"white"}},[e._v(" "+e._s(t.badge)+" ")]):e._e()],1)]}))],2)],1)},ia=[];const ra=[{title:"homePage",path:"/",icon:"home"},{title:"serviceSearch",path:"/service",icon:"search"},{title:"trafficManagement",icon:"show_chart",group:"traffic",items:[{title:"trafficTimeout",path:"/traffic/timeout"},{title:"trafficRetry",path:"/traffic/retry"},{title:"trafficRegion",path:"/traffic/region"},{title:"trafficArguments",path:"/traffic/arguments"},{title:"trafficMock",path:"/traffic/mock"},{title:"trafficAccesslog",path:"/traffic/accesslog"},{title:"routingRule",path:"/governance/routingRule"},{title:"tagRule",path:"/governance/tagRule"},{title:"dynamicConfig",path:"/governance/config"}]},{title:"serviceManagement",group:"services",icon:"build",items:[{title:"serviceTest",path:"/test"},{title:"serviceMock",path:"/mock/rule"}]},{title:"serviceMetrics",path:"/metrics/index",icon:"show_chart"},{title:"kubernetes",path:"/kubernetes",icon:"cloud"}];var oa=ra,la=s("bc3a"),na=s.n(la),ca={name:"drawer",data:()=>({mini:!1,drawer:!0,menus:oa,config:{}}),created(){window.getApp.$on("DRAWER_TOGGLED",()=>{this.drawer=!this.drawer}),na.a.get("/dubbo-admin-info.json").then(e=>{this.config=e.data})},computed:{sideToolbarColor(){return this.$vuetify.options.extra.sideNav}}},da=ca,ua=(s("1fc0"),Object(n["a"])(da,aa,ia,!1,null,null,null)),pa=ua.exports,ha=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("v-toolbar",{attrs:{color:"primary",fixed:"",dark:"",app:""}},[a("v-toolbar-side-icon",{on:{click:function(t){return t.stopPropagation(),e.handleDrawerToggle(t)}}}),a("v-text-field",{staticClass:"hidden-sm-and-down",attrs:{flat:"","hide-details":"","solo-inverted":"","prepend-inner-icon":"search",label:e.$t("serviceSearch")},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.submit(t)}},model:{value:e.global,callback:function(t){e.global=t},expression:"global"}}),a("v-spacer"),e._e(),a("v-btn",{attrs:{icon:""},on:{click:function(t){return e.handleFullScreen()}}},[a("v-icon",[e._v("fullscreen")])],1),a("v-menu",{attrs:{attach:"",bottom:"",left:"","offset-y":"","max-height":"500"}},[a("v-btn",{staticStyle:{"mini-width":"48px"},attrs:{slot:"activator",flat:""},slot:"activator"},[e._v(" "+e._s(e.selectedLang)+" ")]),a("v-list",{staticClass:"pa-0"},e._l(e.lang,(function(t,s){return a("v-list-tile",{key:s,on:{click:function(t){return e.change(s)}}},[a("v-list-tile-content",[a("v-list-tile-title",[e._v(e._s(t))])],1)],1)})),1)],1),e._e(),a("v-menu",{attrs:{"offset-y":"",origin:"center center","nudge-bottom":10,transition:"scale-transition"}},[a("v-btn",{attrs:{slot:"activator",icon:"",large:"",flat:""},slot:"activator"},[a("v-avatar",{attrs:{size:"30px"}},[a("img",{attrs:{src:s("1195"),alt:"Logined User"}})])],1),a("v-list",{staticClass:"pa-0"},e._l(e.items,(function(t,s){return a("v-list-tile",{key:s,attrs:{to:t.href?null:{name:t.name},href:t.href,ripple:"ripple",disabled:t.disabled,target:t.target,rel:"noopener"},on:{click:t.click}},[t.icon?a("v-list-tile-action",[a("v-icon",[e._v(e._s(t.icon))])],1):e._e(),a("v-list-tile-content",[a("v-list-tile-title",[e._v(e._s(t.title))])],1)],1)})),1)],1)],1)},va=[],ma={name:"toolbar",data:()=>({selectedLang:"",global:"",lang:["简体中文","English"],items:[{icon:"account_circle",href:"#",title:"Profile",click:e=>{console.log(e)}},{icon:"fullscreen_exit",href:"#",title:"Logout",click:e=>{window.getApp.$emit("APP_LOGOUT")}}]}),methods:{submit(){window.location.href.includes("#/service")?(window.location.href="#/service?filter="+this.global+"&pattern=service",window.location.reload()):window.location.href="#/service?filter="+this.global+"&pattern=service",this.global=""},handleDrawerToggle(){window.getApp.$emit("DRAWER_TOGGLED")},change(e){this.selectedLang=this.lang[e],this.$i18n.locale=0===e?"zh":"en",this.$store.dispatch("changeArea",{area:this.$i18n.locale}),window.localStorage.setItem("locale",this.$i18n.locale),window.localStorage.setItem("selectedLang",this.selectedLang)},handleTheme(){window.getApp.$emit("CHANGE_THEME")},handleFullScreen(){W.toggleFullScreen()}},mounted:function(){"zh"===this.$i18n.locale?this.selectedLang="简体中文":this.selectedLang="English";const e=localStorage.getItem("username");e&&(this.items[0].title=this.$t("userName")+":"+e)}},fa=ma,ga=Object(n["a"])(fa,ha,va,!1,null,null,null),xa=ga.exports,ba=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("v-footer",{staticClass:"pa-3 footer-border-top",attrs:{inset:"",height:"auto"}},[s("v-spacer"),s("span",{staticClass:"caption mr-1"},[s("strong",[e._v("Copyright")]),e._v(" ©2018-2022 "),s("strong",[e._v("The Apache Software Foundation.")])])],1)},ya=[],_a={name:"footers"},ka=_a,wa=(s("33c4"),Object(n["a"])(ka,ba,ya,!1,null,null,null)),$a=wa.exports,Ia={name:"Index",components:{Drawer:pa,Toolbar:xa,Footers:$a},data(){return{dark:!1}},created(){window.getApp=this,window.getApp.$on("APP_LOGOUT",()=>{console.log("logout"),window.getApp.$axios.delete("/user/logout").then(e=>{200===e.status&&e.data&&(localStorage.removeItem("token"),localStorage.removeItem("username"),window.getApp.$router.replace("/login"))})})}},Da=Ia,Sa=Object(n["a"])(Da,ta,sa,!1,null,"2e81d7c0",null),Ca=Sa.exports,Aa=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("v-app",{attrs:{id:"inspire"}},[s("v-content",[s("v-container",{attrs:{fluid:"","fill-height":""}},[s("v-layout",{attrs:{"align-center":"","justify-center":""}},[s("v-flex",{attrs:{xs12:"",sm8:"",md4:""}},[s("v-card",{staticClass:"elevation-12"},[s("v-toolbar",{attrs:{dark:"",color:"primary"}},[s("v-spacer")],1),s("v-card-text",[s("v-form",{attrs:{action:"login"}},[s("v-text-field",{attrs:{required:"",name:"username","append-icon":"person",label:e.$t("userName"),type:"text"},model:{value:e.userName,callback:function(t){e.userName=t},expression:"userName"}}),s("v-text-field",{staticClass:"input-group--focused",attrs:{name:"input-10-2",label:e.$t("password"),"append-icon":e.e2?"visibility":"visibility_off","append-icon-cb":function(){return e.e2=!e.e2},type:e.e2?"password":"text"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.login(t)}},model:{value:e.password,callback:function(t){e.password=t},expression:"password"}}),s("v-card-actions",[s("v-spacer"),s("v-btn",{attrs:{color:"primary"},on:{click:e.login}},[e._v(e._s(e.$t("login"))),s("v-icon",[e._v("send")])],1),s("v-spacer")],1)],1)],1)],1)],1)],1)],1)],1),s("footers")],1)},Ra=[],Ea={name:"Login",data:()=>({userName:"",password:"",e2:!0}),components:{Footers:$a},methods:{login:function(){const e=this.userName,t=this.password,s=this;this.$axios.get("/user/login",{params:{userName:e,password:t}}).then(t=>{if(200===t.status&&t.data){localStorage.setItem("token",t.data),localStorage.setItem("username",e);const s=this.$route.query.redirect;s?this.$router.replace(s):this.$router.replace("/")}else s.$notify("Username or password error,please try again")})}}},Ta=Ea,La=Object(n["a"])(Ta,Aa,Ra,!1,null,"faf5dbb0",null),Va=La.exports;const Ha=u["a"].prototype.push;u["a"].prototype.push=function(e){return Ha.call(this,e).catch(e=>e)},a["default"].use(u["a"]);var Ga=new u["a"]({routes:[{path:"/",name:"Index",component:Ca,children:[{path:"/service",name:"ServiceSearch",component:g},{path:"/serviceDetail",name:"ServiceDetail",component:w},{path:"/testMethod",name:"TestMethod",component:Y},{path:"/governance/routingRule",name:"RoutingRule",component:ve},{path:"/governance/tagRule",name:"TagRule",component:ye},{path:"/governance/meshRule",name:"MeshRule",component:De},{path:"/governance/access",name:"AccessControl",component:Te},{path:"/governance/loadbalance",name:"LoadBalance",component:Be},{path:"/governance/weight",name:"WeightAdjust",component:Qe},{path:"/governance/config",name:"Overrides",component:Ye},{path:"/test",name:"ServiceTest",component:st},{path:"/mock/rule",name:"ServiceMock",component:Gt,meta:{requireLogin:!1}},{path:"/metrics/index",name:"ServiceMetrics",component:Pt,meta:{requireLogin:!1}},{path:"/metrics/relation",name:"ServiceRelation",component:Jt,meta:{requireLogin:!1}},{path:"/management",name:"Management",component:os,meta:{requireLogin:!1}},{path:"/apiDocs",name:"apiDocs",component:Rt,meta:{requireLogin:!1}},{path:"/traffic/accesslog",name:"accesslog",component:ps,meta:{requireLogin:!1}},{path:"/traffic/retry",name:"retry",component:Ps,meta:{requireLogin:!1}},{path:"/traffic/region",name:"region",component:Gs,meta:{requireLogin:!1}},{path:"/traffic/weight",name:"weight",component:ea,meta:{requireLogin:!1}},{path:"/traffic/arguments",name:"arguments",component:xs,meta:{requireLogin:!1}},{path:"/traffic/mock",name:"mock",component:Rs,meta:{requireLogin:!1}},{path:"/traffic/timeout",name:"timeout",component:Js,meta:{requireLogin:!1}},{path:"/traffic/gray",name:"gray",component:$s,meta:{requireLogin:!1}}]},{path:"/login",name:"Login",component:Va,meta:{requireLogin:!1}}]}),Oa=s("ce5b"),Ba=s.n(Oa),Na=(s("bf40"),s("2f62"));a["default"].use(Na["a"]);const Ma=new Na["a"].Store({state:{appTitle:"Dubbo Admin",area:null,serviceItems:null,appItems:null,consumerItems:null},mutations:{setArea(e,t){e.area=t},setServiceItems(e,t){e.serviceItems=t},setAppItems(e,t){e.appItems=t},setConsumerItems(e,t){e.consumerItems=t}},actions:{changeArea({commit:e},t){e("setArea",t)},loadServiceItems({commit:e}){a["default"].prototype.$axios.get("/services").then(t=>{if(200===t.status){const s=t.data;e("setServiceItems",s)}})},loadAppItems({commit:e}){a["default"].prototype.$axios.get("/applications").then(t=>{if(200===t.status){const s=t.data;e("setAppItems",s)}})},loadInstanceAppItems({commit:e}){a["default"].prototype.$axios.get("/applications/instance").then(t=>{if(200===t.status){const s=t.data;e("setAppItems",s)}})},loadConsumerItems({commit:e}){a["default"].prototype.$axios.get("/consumers").then(t=>{if(200===t.status){const s=t.data;e("setConsumerItems",s)}})}},getters:{getServiceItems:e=>t=>e.serviceItems.filter(e=>(e||"").toLowerCase().indexOf((t||"").toLowerCase())>-1),getAppItems:e=>t=>e.appItems.filter(e=>(e||"").toLowerCase().indexOf((t||"").toLowerCase())>-1),getConsumerItems:e=>t=>e.consumerItems.filter(e=>(e||"").toLowerCase().indexOf((t||"").toLowerCase())>-1)}});var ja=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("v-snackbar",{attrs:{color:e.color},model:{value:e.show,callback:function(t){e.show=t},expression:"show"}},[e._v(" "+e._s(e.text)+" "),s("v-btn",{attrs:{dark:"",flat:""},on:{click:function(t){e.show=!1}}},[e._v(" Close ")])],1)},Pa=[],qa={data(){return{show:!1,color:"",text:""}}},Qa=qa,Fa=Object(n["a"])(Qa,ja,Pa,!1,null,null,null),Wa=Fa.exports;const Ua={install:function(e){const t=e.extend(Wa),s=new t,a=s.$mount();document.querySelector("body").appendChild(a.$el),e.prototype.$notify=(e,t)=>{s.text=e,s.color=t,s.show=!0},e.prototype.$notify.error=e=>{s.text=e,s.color="error",s.show=!0},e.prototype.$notify.success=e=>{s.text=e,s.color="success",s.show=!0},e.prototype.$notify.info=e=>{s.text=e,s.color="info",s.show=!0}}};var Ja=Ua,za=s("4959"),Ya=s.n(za),Za=s("a925"),Xa={service:"Service",serviceSearch:"Search Service",serviceGovernance:"Routing Rule",trafficManagement:"Traffic Management",routingRule:"Condition Rule",tagRule:"Tag Rule",meshRule:"Mesh Rule",dynamicConfig:"Dynamic Config",accessControl:"Black White List",weightAdjust:"Weight Adjust",loadBalance:"Load Balance",serviceTest:"Service Test",serviceMock:"Service Mock",serviceMetrics:"Service Metrics",serviceRelation:"Service Relation",metrics:"Metrics",relation:"Relation",group:"Group",serviceInfo:"Service Info",providers:"Providers",consumers:"Consumers",version:"Version",app:"Application",ip:"IP",qps:"qps",rt:"rt",successRate:"success rate",port:"PORT",timeout:"timeout(ms)",serialization:"serialization",appName:"Application Name",serviceName:"Service Name",registrySource:"Registry Source",instanceRegistry:"Instance Registry",interfaceRegistry:"Interface Registry",allRegistry:"Instance / Interface Registry",operation:"Operation",searchResult:"Search Result",search:"Search",methodName:"Method Name",enabled:"Enabled",disabled:"Disabled",method:"Method",weight:"Weight",create:"CREATE",save:"SAVE",cancel:"CANCEL",close:"CLOSE",confirm:"CONFIRM",ruleContent:"RULE CONTENT",createNewRoutingRule:"Create New Routing Rule",createNewTagRule:"Create New Tag Rule",createNewMeshRule:"Create New Mesh Rule",createNewDynamicConfigRule:"Create New Dynamic Config Rule",createNewWeightRule:"Create New Weight Rule",createNewLoadBalanceRule:"Create new load balancing rule",createTimeoutRule:"Create timeout rule",createRetryRule:"Create timeout rule",createRegionRule:"Create retry rule",createArgumentRule:"Create argument routing rule",createMockCircuitRule:"Create mock (circuit breaking) rule",createAccesslogRule:"Create accesslog rule",createGrayRule:"Create gray rule",createWeightRule:"Create weighting rule",serviceIdHint:"Service ID",view:"View",edit:"Edit",delete:"Delete",searchRoutingRule:"Search Routing Rule",searchAccess:"Search Access Rule",searchWeightRule:"Search Weight Adjust Rule",dataIdClassHint:"Complete package path of service interface class",dataIdVersionHint:"The version of the service interface, which can be filled in according to the actual situation of the interface",dataIdGroupHint:"The group of the service interface, which can be filled in according to the actual situation of the interface",agree:"Agree",disagree:"Disagree",searchDynamicConfig:"Search Dynamic Config",appNameHint:"Application name the service belongs to",basicInfo:"BasicInfo",metaData:"MetaData",methodMetrics:"Method Statistics",searchDubboService:"Search Dubbo Services or applications",serviceSearchHint:"Service ID, org.apache.dubbo.demo.api.DemoService, * for all services",ipSearchHint:"Find all services provided by the target cp-server on the specified IP address",appSearchHint:"Input an application name to find all services provided by one particular application, * for all",searchTagRule:"Search Tag Rule by application name",searchMeshRule:"Search Mesh Rule by application name",searchSingleMetrics:"Search Metrics by IP",searchBalanceRule:"Search Balancing Rule",noMetadataHint:"There is no metadata available, please update to Dubbo2.7, or check your config center configuration in application.properties, please check ",parameterList:"parameterList",returnType:"returnType",here:"here",configAddress:"https://github.com/apache/incubator-dubbo-admin/wiki/Dubbo-Admin-configuration",whiteList:"White List",whiteListHint:"White list IP address, divided by comma: 1.1.1.1,2.2.2.2",blackList:"Black List",blackListHint:"Black list IP address, divided by comma: 3.3.3.3,4.4.4.4",address:"Address",weightAddressHint:"IP addresses to set this weight, divided by comma: 1.1.1.1,2.2.2.2",weightHint:"weight value, default is 100",methodHint:"choose method of load balancing, * for all methods",strategy:"Strategy",balanceStrategyHint:"load balancing strategy",goIndex:"Go To Index",releaseLater:"will release later",later:{metrics:"Metrics will release later",serviceTest:"Service Test will release later",serviceMock:"Service Mock will release later"},by:"by ",$vuetify:{dataIterator:{rowsPerPageText:"Items per page:",rowsPerPageAll:"All",pageText:"{0}-{1} of {2}",noResultsText:"No matching records found",nextPage:"Next page",prevPage:"Previous page"},dataTable:{rowsPerPageText:"Rows per page:"},noDataText:"No data available"},configManage:"Configuration Management",configCenterAddress:"ConfigCenter Address",searchDubboConfig:"Search Dubbo Config",createNewDubboConfig:"Create New Dubbo Config",scope:"Scope",name:"Name",warnDeleteConfig:" Are you sure to Delete Dubbo Config: ",warnDeleteRouteRule:"Are you sure to Delete routing rule",warnDeleteDynamicConfig:"Are you sure to Delete dynamic config",warnDeleteBalancing:"Are you sure to Delete load balancing",warnDeleteAccessControl:"Are you sure to Delete access control",warnDeleteTagRule:"Are you sure to Delete tag rule",warnDeleteMeshRule:"Are you sure to Delete mesh rule",warnDeleteWeightAdjust:"Are you sure to Delete weight adjust",configNameHint:"Application name the config belongs to, use 'global'(without quotes) for global config",configContent:"Config Content",testMethod:"Test Method",execute:"EXECUTE",result:"Result: ",success:"SUCCESS",fail:"FAIL",detail:"Detail",more:"More",copyUrl:"Copy URL",copy:"Copy",url:"URL",copySuccessfully:"Copied",test:"Test",placeholders:{searchService:"Search by service name"},methods:"Methods",testModule:{searchServiceHint:"Entire service ID, org.apache.dubbo.demo.api.DemoService, press Enter to search"},userName:"User Name",password:"Password",login:"Login",apiDocs:"API Docs",apiDocsRes:{dubboProviderIP:"Dubbo Provider Ip",dubboProviderPort:"Dubbo Provider Port",loadApiList:"Load Api List",apiListText:"Api List",apiForm:{missingInterfaceInfo:"Missing interface information",getApiInfoErr:"Exception in obtaining interface information",api404Err:"Interface name is incorrect, interface parameters and response information are not found",apiRespDecShowLabel:"Response Description",apiNameShowLabel:"Api Name",apiPathShowLabel:"Api Path",apiMethodParamInfoLabel:"Api method parameters",apiVersionShowLabel:"Api Version",apiGroupShowLabel:"Api Group",apiDescriptionShowLabel:"Api Description",isAsyncFormLabel:"Whether to call asynchronously (this parameter cannot be modified, according to whether to display asynchronously defined by the interface)",apiModuleFormLabel:"Api module (this parameter cannot be modified)",apiFunctionNameFormLabel:"Api function name(this parameter cannot be modified)",registryCenterUrlFormLabel:"Registry address. If it is empty, Dubbo provider IP and port will be used for direct storage",paramNameLabel:"Parameter name",paramPathLabel:"Parameter path",paramDescriptionLabel:"Description",paramRequiredLabel:"This parameter is required",doTestBtn:"Do Test",responseLabel:"Response",responseExampleLabel:"Response Example",apiResponseLabel:"Api Response",LoadingLabel:"Loading...",requireTip:"There are required items not filled in",requireItemTip:"This field is required",requestApiErrorTip:"There is an exception in the request interface. Please check the submitted data, especially the JSON class data and the enumeration part",unsupportedHtmlTypeTip:"Temporarily unsupported form type",none:"none"}},authFailed:"Authorized failed,please login.",ruleList:"Rule List",mockRule:"Mock Rule",mockData:"Mock Data",globalDisable:"Global Disable",globalEnable:"Global Enable",saveRuleSuccess:"Save Rule Successfully",deleteRuleSuccess:"Delete Rule Successfully",disableRuleSuccess:"Disable Rule Successfully",enableRuleSuccess:"Enable Rule Successfully",methodNameHint:"The method name of Service",createMockRule:"Create Mock Rule",editMockRule:"Edit Mock Rule",deleteRuleTitle:"Are you sure to delete this mock rule?",trafficTimeout:"Timeout",trafficRetry:"Retry",trafficRegion:"Region Aware",trafficIsolation:"Isolation",trafficWeight:"Weight Percentage",trafficArguments:"Arg Routing",trafficMock:"Mock",trafficAccesslog:"Accesslog",trafficHost:"Host",homePage:"Cluster Overview",serviceManagement:"Dev & Test"},Ka={service:"服务",serviceSearch:"服务查询",serviceGovernance:"路由规则",trafficManagement:"流量管控",serviceMetrics:"服务统计",serviceRelation:"服务关系",routingRule:"条件路由",tagRule:"标签路由",meshRule:"Mesh路由",dynamicConfig:"动态配置",accessControl:"黑白名单",weightAdjust:"权重调整",loadBalance:"负载均衡",serviceTest:"服务测试",serviceMock:"服务Mock",providers:"提供者",consumers:"消费者",metrics:"统计",relation:"关系",group:"组",version:"版本",app:"应用",ip:"IP地址",qps:"qps",rt:"rt",successRate:"成功率",serviceInfo:"服务信息",port:"端口",timeout:"超时(毫秒)",serialization:"序列化",appName:"应用名",serviceName:"服务名",registrySource:"注册来源",instanceRegistry:"应用级",interfaceRegistry:"接口级",allRegistry:"应用级/接口级",operation:"操作",searchResult:"查询结果",search:"搜索",methodName:"方法名",enabled:"开启",disabled:"禁用",method:"方法",weight:"权重",create:"创建",save:"保存",cancel:"取消",close:"关闭",confirm:"确认",ruleContent:"规则内容",createNewRoutingRule:"创建新路由规则",createNewTagRule:"创建新标签规则",createMeshTagRule:"创建新mesh规则",createNewDynamicConfigRule:"创建新动态配置规则",createNewWeightRule:"新建权重规则",createNewLoadBalanceRule:"新建负载均衡规则",createTimeoutRule:"创建超时时间规则",createRetryRule:"创建重试规则",createRegionRule:"创建同区域优先规则",createArgumentRule:"创建参数路由规则",createMockCircuitRule:"创建调用降级规则",createAccesslogRule:"创建访问日志规则",createGrayRule:"创建灰度隔离规则",createWeightRule:"创建权重比例规则",serviceIdHint:"服务名",view:"查看",edit:"编辑",delete:"删除",searchRoutingRule:"搜索路由规则",searchAccessRule:"搜索黑白名单",searchWeightRule:"搜索权重调整规则",dataIdClassHint:"服务接口的类完整包路径",dataIdVersionHint:"服务接口的Version,根据接口实际情况选填",dataIdGroupHint:"服务接口的Group,根据接口实际情况选填",agree:"同意",disagree:"不同意",searchDynamicConfig:"搜索动态配置",appNameHint:"服务所属的应用名称",basicInfo:"基础信息",metaData:"元数据",methodMetrics:"服务方法统计",searchDubboService:"搜索Dubbo服务或应用",serviceSearchHint:"服务ID, org.apache.dubbo.demo.api.DemoService, * 代表所有服务",ipSearchHint:"在指定的IP地址上查找目标服务器提供的所有服务",appSearchHint:"输入应用名称以查找由一个特定应用提供的所有服务, * 代表所有",searchTagRule:"根据应用名搜索标签规则",searchMeshRule:"根据应用名搜索mesh规则",searchSingleMetrics:"输入IP搜索Metrics信息",searchBalanceRule:"搜索负载均衡规则",parameterList:"参数列表",returnType:"返回值",noMetadataHint:"无元数据信息,请升级至Dubbo2.7及以上版本,或者查看application.properties中关于config center的配置,详见",here:"这里",configAddress:"https://github.com/apache/incubator-dubbo-admin/wiki/Dubbo-Admin%E9%85%8D%E7%BD%AE%E8%AF%B4%E6%98%8E",whiteList:"白名单",whiteListHint:"白名单IP列表, 多个地址用逗号分隔: 1.1.1.1,2.2.2.2",blackList:"黑名单",blackListHint:"黑名单IP列表, 多个地址用逗号分隔: 3.3.3.3,4.4.4.4",address:"地址列表",weightAddressHint:"此权重设置的IP地址,用逗号分隔: 1.1.1.1,2.2.2.2",weightHint:"权重值,默认100",methodHint:"负载均衡生效的方法,*代表所有方法",strategy:"策略",balanceStrategyHint:"负载均衡策略",goIndex:"返回首页",releaseLater:"在后续版本中发布,敬请期待",later:{metrics:"Metrics会在后续版本中发布,敬请期待",serviceTest:"服务测试会在后续版本中发布,敬请期待",serviceMock:"服务Mock会在后续版本中发布,敬请期待"},by:"按",$vuetify:{dataIterator:{rowsPerPageText:"每页记录数:",rowsPerPageAll:"全部",pageText:"{0}-{1} 共 {2} 条",noResultsText:"没有找到匹配记录",nextPage:"下一页",prevPage:"上一页"},dataTable:{rowsPerPageText:"每页行数:"},noDataText:"无可用数据"},configManage:"配置管理",configCenterAddress:"配置中心地址",searchDubboConfig:"搜索Dubbo配置",createNewDubboConfig:"新建Dubbo配置",scope:"范围",name:"名称",warnDeleteConfig:" 是否要删除Dubbo配置: ",warnDeleteRouteRule:"是否要删除路由规则",warnDeleteDynamicConfig:"是否要删除动态配置",warnDeleteBalancing:"是否要删除负载均衡规则",warnDeleteAccessControl:"是否要删除黑白名单",warnDeleteTagRule:"是否要删除标签路由",warnDeleteMeshRule:"是否要删除mesh路由",warnDeleteWeightAdjust:"是否要删除权重规则",configNameHint:"配置所属的应用名, global 表示全局配置",configContent:"配置内容",testMethod:"测试方法",execute:"执行",result:"结果: ",success:" 成功",fail:"失败",detail:"详情",more:"更多",copyUrl:"复制 URL",copy:"复制",url:"URL",copySuccessfully:"已复制",test:"测试",placeholders:{searchService:"通过服务名搜索服务"},methods:"方法列表",testModule:{searchServiceHint:"完整服务ID, org.apache.dubbo.demo.api.DemoService, 按回车键查询"},userName:"用户名",password:"密码",login:"登录",apiDocs:"接口文档",apiDocsRes:{dubboProviderIP:"Dubbo 提供者Ip",dubboProviderPort:"Dubbo 提供者端口",loadApiList:"加载接口列表",apiListText:"接口列表",apiForm:{missingInterfaceInfo:"缺少接口信息",getApiInfoErr:"获取接口信息异常",api404Err:"接口名称不正确,没有查找到接口参数和响应信息",apiRespDecShowLabel:"响应说明",apiNameShowLabel:"接口名称",apiPathShowLabel:"接口位置",apiMethodParamInfoLabel:"接口参数",apiVersionShowLabel:"接口版本",apiGroupShowLabel:"接口分组",apiDescriptionShowLabel:"接口说明",isAsyncFormLabel:"是否异步调用(此参数不可修改,根据接口定义的是否异步显示)",apiModuleFormLabel:"接口模块(此参数不可修改)",apiFunctionNameFormLabel:"接口方法名(此参数不可修改)",registryCenterUrlFormLabel:"注册中心地址, 如果为空将使用Dubbo 提供者Ip和端口进行直连",paramNameLabel:"参数名",paramPathLabel:"参数位置",paramDescriptionLabel:"说明",paramRequiredLabel:"该参数为必填",doTestBtn:"测试",responseLabel:"响应",responseExampleLabel:"响应示例",apiResponseLabel:"接口响应",LoadingLabel:"加载中...",requireTip:"有未填写的必填项",requireItemTip:"该项为必填!",requestApiErrorTip:"请求接口发生异常,请检查提交的数据,特别是JSON类数据和其中的枚举部分",unsupportedHtmlTypeTip:"暂不支持的表单类型",none:"无"}},authFailed:"权限验证失败",ruleList:"规则列表",mockRule:"规则配置",mockData:"模拟数据",globalDisable:"全局禁用",globalEnable:"全局启用",saveRuleSuccess:"保存规则成功",deleteRuleSuccess:"删除成功",disableRuleSuccess:"禁用成功",enableRuleSuccess:"启用成功",methodNameHint:"服务方法名",createMockRule:"创建规则",editMockRule:"修改规则",deleteRuleTitle:"确定要删除此服务Mock规则吗?",trafficTimeout:"超时时间",trafficRetry:"调用重试",trafficRegion:"同区域优先",trafficIsolation:"环境隔离",trafficWeight:"权重比例",trafficArguments:"参数路由",trafficMock:"调用降级",trafficAccesslog:"访问日志",trafficHost:"固定机器导流",trafficGray:"流量灰度",homePage:"集群概览",serviceManagement:"开发测试",groupInputPrompt:"请输入服务group(可选)",versionInputPrompt:"请输入服务version(可选)"};a["default"].use(Za["a"]);const ei={en:{...Xa},zh:{...Ka}},ti=window.localStorage.getItem("locale"),si=window.localStorage.getItem("selectedLang");var ai=new Za["a"]({locale:null===ti?"zh":ti,selectedLang:null===si?"简体中文":si,messages:ei});const ii=na.a.create({baseURL:"/api/dev"});ii.interceptors.request.use(e=>{const t=localStorage.getItem("token");return t&&(e.headers.Authorization=t),e}),ii.interceptors.response.use(e=>e,e=>{if(e.message.indexOf("Network Error")>=0)a["default"].prototype.$notify.error("Network error, please check your network settings!");else if(e.response.status===Ya.a.UNAUTHORIZED){localStorage.removeItem("token"),localStorage.removeItem("username"),a["default"].prototype.$notify.error(ai.t("authFailed"));const e=location.href.split("#");if(e.length>1&&e[1].startsWith("/login"))return;Ga.push({path:"/login",query:{redirect:1===e.length?"/":e[1]}})}else e.response.status>=Ya.a.BAD_REQUEST&&a["default"].prototype.$notify.error(e.response.data.message)});const ri=ii;var oi=s("9ca8"),li=(s("ef97"),s("007d"),s("627c"),s("4eb5")),ni=s.n(li);s("9454");a["default"].use(Ba.a,{lang:{t:(e,...t)=>ai.t(e,t)}}),a["default"].use(Ja),a["default"].prototype.$axios=ri,a["default"].config.productionTip=!1,ni.a.config.autoSetContainer=!0,a["default"].use(ni.a),a["default"].component("chart",oi["a"]),Ga.beforeEach((e,t,s)=>{e.matched.some(e=>e.meta.requireLogin)?localStorage.getItem("token")?s():s({path:"/login",query:{redirect:e.fullPath}}):s()}),new a["default"]({router:Ga,store:Ma,i18n:ai,render:e=>e(d)}).$mount("#app")},"5a4f":function(e,t,s){},"758d":function(e,t,s){},"77b6":function(e,t,s){"use strict";var a=s("e337"),i=s.n(a);i.a},"8b76":function(e,t,s){"use strict";var a=s("3be4"),i=s.n(a);i.a},9454:function(e,t,s){const a=s("96eb"),i=a.Random;console.log(i),a.mock("/mock/user/list","get",{code:200,message:"成功",data:{"list|10":[{"id|+1":1,"age|18-40":20,"sex|1":["男","女"],name:"@cname",email:"@email",isShow:"@boolean"}]}})},a237:function(e,t,s){"use strict";var a=s("3a50"),i=s.n(a);i.a},c5e5:function(e,t,s){"use strict";var a=s("38a9"),i=s.n(a);i.a},c65a:function(e,t,s){},cf05:function(e,t,s){e.exports=s.p+"static/img/logo.5ba69830.png"},dc87:function(e,t,s){},e1a5:function(e,t,s){"use strict";var a=s("18ce"),i=s.n(a);i.a},e337:function(e,t,s){},ef61:function(e,t,s){"use strict";var a=s("0b70"),i=s.n(a);i.a},fb52:function(e,t,s){"use strict";var a=s("5a4f"),i=s.n(a);i.a}}); //# sourceMappingURL=app.29227e12.js.map \ No newline at end of file diff --git a/cmd/ui/dist/static/js/app.29227e12.js.map b/app/dubbo-ui/dist/static/js/app.29227e12.js.map similarity index 100% rename from cmd/ui/dist/static/js/app.29227e12.js.map rename to app/dubbo-ui/dist/static/js/app.29227e12.js.map diff --git a/cmd/ui/dist/static/js/braceBase.39ce0e20.js b/app/dubbo-ui/dist/static/js/braceBase.39ce0e20.js similarity index 100% rename from cmd/ui/dist/static/js/braceBase.39ce0e20.js rename to app/dubbo-ui/dist/static/js/braceBase.39ce0e20.js diff --git a/cmd/ui/dist/static/js/braceBase.39ce0e20.js.map b/app/dubbo-ui/dist/static/js/braceBase.39ce0e20.js.map similarity index 100% rename from cmd/ui/dist/static/js/braceBase.39ce0e20.js.map rename to app/dubbo-ui/dist/static/js/braceBase.39ce0e20.js.map diff --git a/cmd/ui/dist/static/js/chunk-vendors.491fd433.js b/app/dubbo-ui/dist/static/js/chunk-vendors.491fd433.js similarity index 91% rename from cmd/ui/dist/static/js/chunk-vendors.491fd433.js rename to app/dubbo-ui/dist/static/js/chunk-vendors.491fd433.js index 2c46a99d1..0b762647c 100644 --- a/cmd/ui/dist/static/js/chunk-vendors.491fd433.js +++ b/app/dubbo-ui/dist/static/js/chunk-vendors.491fd433.js @@ -4,7 +4,7 @@ * (c) 2014-2019 Evan You * Released under the MIT License. */ -var n=Object.freeze({});function i(t){return void 0===t||null===t}function r(t){return void 0!==t&&null!==t}function o(t){return!0===t}function s(t){return!1===t}function a(t){return"string"===typeof t||"number"===typeof t||"symbol"===typeof t||"boolean"===typeof t}function l(t){return null!==t&&"object"===typeof t}var u=Object.prototype.toString;function c(t){return"[object Object]"===u.call(t)}function h(t){return"[object RegExp]"===u.call(t)}function d(t){var e=parseFloat(String(t));return e>=0&&Math.floor(e)===e&&isFinite(t)}function f(t){return r(t)&&"function"===typeof t.then&&"function"===typeof t.catch}function p(t){return null==t?"":Array.isArray(t)||c(t)&&t.toString===u?JSON.stringify(t,null,2):String(t)}function m(t){var e=parseFloat(t);return isNaN(e)?t:e}function v(t,e){for(var n=Object.create(null),i=t.split(","),r=0;r-1)return t.splice(n,1)}}var b=Object.prototype.hasOwnProperty;function x(t,e){return b.call(t,e)}function _(t){var e=Object.create(null);return function(n){var i=e[n];return i||(e[n]=t(n))}}var w=/-(\w)/g,S=_((function(t){return t.replace(w,(function(t,e){return e?e.toUpperCase():""}))})),C=_((function(t){return t.charAt(0).toUpperCase()+t.slice(1)})),E=/\B([A-Z])/g,T=_((function(t){return t.replace(E,"-$1").toLowerCase()}));function k(t,e){function n(n){var i=arguments.length;return i?i>1?t.apply(e,arguments):t.call(e,n):t.call(e)}return n._length=t.length,n}function A(t,e){return t.bind(e)}var D=Function.prototype.bind?A:k;function O(t,e){e=e||0;var n=t.length-e,i=new Array(n);while(n--)i[n]=t[n+e];return i}function I(t,e){for(var n in e)t[n]=e[n];return t}function M(t){for(var e={},n=0;n0,nt=Q&&Q.indexOf("edge/")>0,it=(Q&&Q.indexOf("android"),Q&&/iphone|ipad|ipod|ios/.test(Q)||"ios"===Z),rt=(Q&&/chrome\/\d+/.test(Q),Q&&/phantomjs/.test(Q),Q&&Q.match(/firefox\/(\d+)/)),ot={}.watch,st=!1;if(J)try{var at={};Object.defineProperty(at,"passive",{get:function(){st=!0}}),window.addEventListener("test-passive",null,at)}catch(Ss){}var lt=function(){return void 0===Y&&(Y=!J&&!K&&"undefined"!==typeof t&&(t["process"]&&"server"===t["process"].env.VUE_ENV)),Y},ut=J&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function ct(t){return"function"===typeof t&&/native code/.test(t.toString())}var ht,dt="undefined"!==typeof Symbol&&ct(Symbol)&&"undefined"!==typeof Reflect&&ct(Reflect.ownKeys);ht="undefined"!==typeof Set&&ct(Set)?Set:function(){function t(){this.set=Object.create(null)}return t.prototype.has=function(t){return!0===this.set[t]},t.prototype.add=function(t){this.set[t]=!0},t.prototype.clear=function(){this.set=Object.create(null)},t}();var ft=j,pt=0,mt=function(){this.id=pt++,this.subs=[]};mt.prototype.addSub=function(t){this.subs.push(t)},mt.prototype.removeSub=function(t){y(this.subs,t)},mt.prototype.depend=function(){mt.target&&mt.target.addDep(this)},mt.prototype.notify=function(){var t=this.subs.slice();for(var e=0,n=t.length;e-1)if(o&&!x(r,"default"))s=!1;else if(""===s||s===T(t)){var l=te(String,r.type);(l<0||a0&&(s=ke(s,(e||"")+"_"+n),Te(s[0])&&Te(u)&&(c[l]=wt(u.text+s[0].text),s.shift()),c.push.apply(c,s)):a(s)?Te(u)?c[l]=wt(u.text+s):""!==s&&c.push(wt(s)):Te(s)&&Te(u)?c[l]=wt(u.text+s.text):(o(t._isVList)&&r(s.tag)&&i(s.key)&&r(e)&&(s.key="__vlist"+e+"_"+n+"__"),c.push(s)));return c}function Ae(t){var e=t.$options.provide;e&&(t._provided="function"===typeof e?e.call(t):e)}function De(t){var e=Oe(t.$options.inject,t);e&&(Dt(!1),Object.keys(e).forEach((function(n){Pt(t,n,e[n])})),Dt(!0))}function Oe(t,e){if(t){for(var n=Object.create(null),i=dt?Reflect.ownKeys(t):Object.keys(t),r=0;r0,s=t?!!t.$stable:!o,a=t&&t.$key;if(t){if(t._normalized)return t._normalized;if(s&&i&&i!==n&&a===i.$key&&!o&&!i.$hasNormal)return i;for(var l in r={},t)t[l]&&"$"!==l[0]&&(r[l]=Pe(e,l,t[l]))}else r={};for(var u in e)u in r||(r[u]=Ne(e,u));return t&&Object.isExtensible(t)&&(t._normalized=r),W(r,"$stable",s),W(r,"$key",a),W(r,"$hasNormal",o),r}function Pe(t,e,n){var i=function(){var t=arguments.length?n.apply(null,arguments):n({});return t=t&&"object"===typeof t&&!Array.isArray(t)?[t]:Ee(t),t&&(0===t.length||1===t.length&&t[0].isComment)?void 0:t};return n.proxy&&Object.defineProperty(t,e,{get:i,enumerable:!0,configurable:!0}),i}function Ne(t,e){return function(){return t[e]}}function Ve(t,e){var n,i,o,s,a;if(Array.isArray(t)||"string"===typeof t)for(n=new Array(t.length),i=0,o=t.length;i1?O(n):n;for(var i=O(arguments,1),r='event handler for "'+t+'"',o=0,s=n.length;odocument.createEvent("Event").timeStamp&&(Yn=function(){return Xn.now()})}function Jn(){var t,e;for(Gn=Yn(),Un=!0,Bn.sort((function(t,e){return t.id-e.id})),Wn=0;WnWn&&Bn[n].id>t.id)n--;Bn.splice(n+1,0,t)}else Bn.push(t);Hn||(Hn=!0,pe(Jn))}}var ei=0,ni=function(t,e,n,i,r){this.vm=t,r&&(t._watcher=this),t._watchers.push(this),i?(this.deep=!!i.deep,this.user=!!i.user,this.lazy=!!i.lazy,this.sync=!!i.sync,this.before=i.before):this.deep=this.user=this.lazy=this.sync=!1,this.cb=n,this.id=++ei,this.active=!0,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new ht,this.newDepIds=new ht,this.expression="","function"===typeof e?this.getter=e:(this.getter=G(e),this.getter||(this.getter=j)),this.value=this.lazy?void 0:this.get()};ni.prototype.get=function(){var t;gt(this);var e=this.vm;try{t=this.getter.call(e,e)}catch(Ss){if(!this.user)throw Ss;ee(Ss,e,'getter for watcher "'+this.expression+'"')}finally{this.deep&&ve(t),yt(),this.cleanupDeps()}return t},ni.prototype.addDep=function(t){var e=t.id;this.newDepIds.has(e)||(this.newDepIds.add(e),this.newDeps.push(t),this.depIds.has(e)||t.addSub(this))},ni.prototype.cleanupDeps=function(){var t=this.deps.length;while(t--){var e=this.deps[t];this.newDepIds.has(e.id)||e.removeSub(this)}var n=this.depIds;this.depIds=this.newDepIds,this.newDepIds=n,this.newDepIds.clear(),n=this.deps,this.deps=this.newDeps,this.newDeps=n,this.newDeps.length=0},ni.prototype.update=function(){this.lazy?this.dirty=!0:this.sync?this.run():ti(this)},ni.prototype.run=function(){if(this.active){var t=this.get();if(t!==this.value||l(t)||this.deep){var e=this.value;if(this.value=t,this.user)try{this.cb.call(this.vm,t,e)}catch(Ss){ee(Ss,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,t,e)}}},ni.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},ni.prototype.depend=function(){var t=this.deps.length;while(t--)this.deps[t].depend()},ni.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||y(this.vm._watchers,this);var t=this.deps.length;while(t--)this.deps[t].removeSub(this);this.active=!1}};var ii={enumerable:!0,configurable:!0,get:j,set:j};function ri(t,e,n){ii.get=function(){return this[e][n]},ii.set=function(t){this[e][n]=t},Object.defineProperty(t,n,ii)}function oi(t){t._watchers=[];var e=t.$options;e.props&&si(t,e.props),e.methods&&pi(t,e.methods),e.data?ai(t):jt(t._data={},!0),e.computed&&ci(t,e.computed),e.watch&&e.watch!==ot&&mi(t,e.watch)}function si(t,e){var n=t.$options.propsData||{},i=t._props={},r=t.$options._propKeys=[],o=!t.$parent;o||Dt(!1);var s=function(o){r.push(o);var s=Jt(o,e,n,t);Pt(i,o,s),o in t||ri(t,"_props",o)};for(var a in e)s(a);Dt(!0)}function ai(t){var e=t.$options.data;e=t._data="function"===typeof e?li(e,t):e||{},c(e)||(e={});var n=Object.keys(e),i=t.$options.props,r=(t.$options.methods,n.length);while(r--){var o=n[r];0,i&&x(i,o)||U(o)||ri(t,"_data",o)}jt(e,!0)}function li(t,e){gt();try{return t.call(e,e)}catch(Ss){return ee(Ss,e,"data()"),{}}finally{yt()}}var ui={lazy:!0};function ci(t,e){var n=t._computedWatchers=Object.create(null),i=lt();for(var r in e){var o=e[r],s="function"===typeof o?o:o.get;0,i||(n[r]=new ni(t,s||j,j,ui)),r in t||hi(t,r,o)}}function hi(t,e,n){var i=!lt();"function"===typeof n?(ii.get=i?di(e):fi(n),ii.set=j):(ii.get=n.get?i&&!1!==n.cache?di(e):fi(n.get):j,ii.set=n.set||j),Object.defineProperty(t,e,ii)}function di(t){return function(){var e=this._computedWatchers&&this._computedWatchers[t];if(e)return e.dirty&&e.evaluate(),mt.target&&e.depend(),e.value}}function fi(t){return function(){return t.call(this,this)}}function pi(t,e){t.$options.props;for(var n in e)t[n]="function"!==typeof e[n]?j:D(e[n],t)}function mi(t,e){for(var n in e){var i=e[n];if(Array.isArray(i))for(var r=0;r-1)return this;var n=O(arguments,1);return n.unshift(this),"function"===typeof t.install?t.install.apply(t,n):"function"===typeof t&&t.apply(null,n),e.push(t),this}}function Ei(t){t.mixin=function(t){return this.options=Yt(this.options,t),this}}function Ti(t){t.cid=0;var e=1;t.extend=function(t){t=t||{};var n=this,i=n.cid,r=t._Ctor||(t._Ctor={});if(r[i])return r[i];var o=t.name||n.options.name;var s=function(t){this._init(t)};return s.prototype=Object.create(n.prototype),s.prototype.constructor=s,s.cid=e++,s.options=Yt(n.options,t),s["super"]=n,s.options.props&&ki(s),s.options.computed&&Ai(s),s.extend=n.extend,s.mixin=n.mixin,s.use=n.use,B.forEach((function(t){s[t]=n[t]})),o&&(s.options.components[o]=s),s.superOptions=n.options,s.extendOptions=t,s.sealedOptions=I({},s.options),r[i]=s,s}}function ki(t){var e=t.options.props;for(var n in e)ri(t.prototype,"_props",n)}function Ai(t){var e=t.options.computed;for(var n in e)hi(t.prototype,n,e[n])}function Di(t){B.forEach((function(e){t[e]=function(t,n){return n?("component"===e&&c(n)&&(n.name=n.name||t,n=this.options._base.extend(n)),"directive"===e&&"function"===typeof n&&(n={bind:n,update:n}),this.options[e+"s"][t]=n,n):this.options[e+"s"][t]}}))}function Oi(t){return t&&(t.Ctor.options.name||t.tag)}function Ii(t,e){return Array.isArray(t)?t.indexOf(e)>-1:"string"===typeof t?t.split(",").indexOf(e)>-1:!!h(t)&&t.test(e)}function Mi(t,e){var n=t.cache,i=t.keys,r=t._vnode;for(var o in n){var s=n[o];if(s){var a=Oi(s.componentOptions);a&&!e(a)&&ji(n,o,i,r)}}}function ji(t,e,n,i){var r=t[e];!r||i&&r.tag===i.tag||r.componentInstance.$destroy(),t[e]=null,y(n,e)}bi(Si),gi(Si),Dn(Si),jn(Si),yn(Si);var Pi=[String,RegExp,Array],Ni={name:"keep-alive",abstract:!0,props:{include:Pi,exclude:Pi,max:[String,Number]},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var t in this.cache)ji(this.cache,t,this.keys)},mounted:function(){var t=this;this.$watch("include",(function(e){Mi(t,(function(t){return Ii(e,t)}))})),this.$watch("exclude",(function(e){Mi(t,(function(t){return!Ii(e,t)}))}))},render:function(){var t=this.$slots.default,e=Sn(t),n=e&&e.componentOptions;if(n){var i=Oi(n),r=this,o=r.include,s=r.exclude;if(o&&(!i||!Ii(o,i))||s&&i&&Ii(s,i))return e;var a=this,l=a.cache,u=a.keys,c=null==e.key?n.Ctor.cid+(n.tag?"::"+n.tag:""):e.key;l[c]?(e.componentInstance=l[c].componentInstance,y(u,c),u.push(c)):(l[c]=e,u.push(c),this.max&&u.length>parseInt(this.max)&&ji(l,u[0],u,this._vnode)),e.data.keepAlive=!0}return e||t&&t[0]}},Vi={KeepAlive:Ni};function Fi(t){var e={get:function(){return z}};Object.defineProperty(t,"config",e),t.util={warn:ft,extend:I,mergeOptions:Yt,defineReactive:Pt},t.set=Nt,t.delete=Vt,t.nextTick=pe,t.observable=function(t){return jt(t),t},t.options=Object.create(null),B.forEach((function(e){t.options[e+"s"]=Object.create(null)})),t.options._base=t,I(t.options.components,Vi),Ci(t),Ei(t),Ti(t),Di(t)}Fi(Si),Object.defineProperty(Si.prototype,"$isServer",{get:lt}),Object.defineProperty(Si.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(Si,"FunctionalRenderContext",{value:Ke}),Si.version="2.6.11";var Ri=v("style,class"),Li=v("input,textarea,option,select,progress"),Bi=function(t,e,n){return"value"===n&&Li(t)&&"button"!==e||"selected"===n&&"option"===t||"checked"===n&&"input"===t||"muted"===n&&"video"===t},$i=v("contenteditable,draggable,spellcheck"),zi=v("events,caret,typing,plaintext-only"),Hi=function(t,e){return Yi(e)||"false"===e?"false":"contenteditable"===t&&zi(e)?e:"true"},Ui=v("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"),Wi="http://www.w3.org/1999/xlink",qi=function(t){return":"===t.charAt(5)&&"xlink"===t.slice(0,5)},Gi=function(t){return qi(t)?t.slice(6,t.length):""},Yi=function(t){return null==t||!1===t};function Xi(t){var e=t.data,n=t,i=t;while(r(i.componentInstance))i=i.componentInstance._vnode,i&&i.data&&(e=Ji(i.data,e));while(r(n=n.parent))n&&n.data&&(e=Ji(e,n.data));return Ki(e.staticClass,e.class)}function Ji(t,e){return{staticClass:Zi(t.staticClass,e.staticClass),class:r(t.class)?[t.class,e.class]:e.class}}function Ki(t,e){return r(t)||r(e)?Zi(t,Qi(e)):""}function Zi(t,e){return t?e?t+" "+e:t:e||""}function Qi(t){return Array.isArray(t)?tr(t):l(t)?er(t):"string"===typeof t?t:""}function tr(t){for(var e,n="",i=0,o=t.length;i-1?ar[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:ar[t]=/HTMLUnknownElement/.test(e.toString())}var ur=v("text,number,password,search,email,tel,url");function cr(t){if("string"===typeof t){var e=document.querySelector(t);return e||document.createElement("div")}return t}function hr(t,e){var n=document.createElement(t);return"select"!==t||e.data&&e.data.attrs&&void 0!==e.data.attrs.multiple&&n.setAttribute("multiple","multiple"),n}function dr(t,e){return document.createElementNS(nr[t],e)}function fr(t){return document.createTextNode(t)}function pr(t){return document.createComment(t)}function mr(t,e,n){t.insertBefore(e,n)}function vr(t,e){t.removeChild(e)}function gr(t,e){t.appendChild(e)}function yr(t){return t.parentNode}function br(t){return t.nextSibling}function xr(t){return t.tagName}function _r(t,e){t.textContent=e}function wr(t,e){t.setAttribute(e,"")}var Sr=Object.freeze({createElement:hr,createElementNS:dr,createTextNode:fr,createComment:pr,insertBefore:mr,removeChild:vr,appendChild:gr,parentNode:yr,nextSibling:br,tagName:xr,setTextContent:_r,setStyleScope:wr}),Cr={create:function(t,e){Er(e)},update:function(t,e){t.data.ref!==e.data.ref&&(Er(t,!0),Er(e))},destroy:function(t){Er(t,!0)}};function Er(t,e){var n=t.data.ref;if(r(n)){var i=t.context,o=t.componentInstance||t.elm,s=i.$refs;e?Array.isArray(s[n])?y(s[n],o):s[n]===o&&(s[n]=void 0):t.data.refInFor?Array.isArray(s[n])?s[n].indexOf(o)<0&&s[n].push(o):s[n]=[o]:s[n]=o}}var Tr=new bt("",{},[]),kr=["create","activate","update","remove","destroy"];function Ar(t,e){return t.key===e.key&&(t.tag===e.tag&&t.isComment===e.isComment&&r(t.data)===r(e.data)&&Dr(t,e)||o(t.isAsyncPlaceholder)&&t.asyncFactory===e.asyncFactory&&i(e.asyncFactory.error))}function Dr(t,e){if("input"!==t.tag)return!0;var n,i=r(n=t.data)&&r(n=n.attrs)&&n.type,o=r(n=e.data)&&r(n=n.attrs)&&n.type;return i===o||ur(i)&&ur(o)}function Or(t,e,n){var i,o,s={};for(i=e;i<=n;++i)o=t[i].key,r(o)&&(s[o]=i);return s}function Ir(t){var e,n,s={},l=t.modules,u=t.nodeOps;for(e=0;em?(h=i(n[y+1])?null:n[y+1].elm,S(t,h,n,p,y,o)):p>y&&E(e,d,m)}function A(t,e,n,i){for(var o=n;o-1?zr(t,e,n):Ui(e)?Yi(n)?t.removeAttribute(e):(n="allowfullscreen"===e&&"EMBED"===t.tagName?"true":e,t.setAttribute(e,n)):$i(e)?t.setAttribute(e,Hi(e,n)):qi(e)?Yi(n)?t.removeAttributeNS(Wi,Gi(e)):t.setAttributeNS(Wi,e,n):zr(t,e,n)}function zr(t,e,n){if(Yi(n))t.removeAttribute(e);else{if(tt&&!et&&"TEXTAREA"===t.tagName&&"placeholder"===e&&""!==n&&!t.__ieph){var i=function(e){e.stopImmediatePropagation(),t.removeEventListener("input",i)};t.addEventListener("input",i),t.__ieph=!0}t.setAttribute(e,n)}}var Hr={create:Br,update:Br};function Ur(t,e){var n=e.elm,o=e.data,s=t.data;if(!(i(o.staticClass)&&i(o.class)&&(i(s)||i(s.staticClass)&&i(s.class)))){var a=Xi(e),l=n._transitionClasses;r(l)&&(a=Zi(a,Qi(l))),a!==n._prevClass&&(n.setAttribute("class",a),n._prevClass=a)}}var Wr,qr={create:Ur,update:Ur},Gr="__r",Yr="__c";function Xr(t){if(r(t[Gr])){var e=tt?"change":"input";t[e]=[].concat(t[Gr],t[e]||[]),delete t[Gr]}r(t[Yr])&&(t.change=[].concat(t[Yr],t.change||[]),delete t[Yr])}function Jr(t,e,n){var i=Wr;return function r(){var o=e.apply(null,arguments);null!==o&&Qr(t,r,n,i)}}var Kr=se&&!(rt&&Number(rt[1])<=53);function Zr(t,e,n,i){if(Kr){var r=Gn,o=e;e=o._wrapper=function(t){if(t.target===t.currentTarget||t.timeStamp>=r||t.timeStamp<=0||t.target.ownerDocument!==document)return o.apply(this,arguments)}}Wr.addEventListener(t,e,st?{capture:n,passive:i}:n)}function Qr(t,e,n,i){(i||Wr).removeEventListener(t,e._wrapper||e,n)}function to(t,e){if(!i(t.data.on)||!i(e.data.on)){var n=e.data.on||{},r=t.data.on||{};Wr=e.elm,Xr(n),xe(n,r,Zr,Qr,Jr,e.context),Wr=void 0}}var eo,no={create:to,update:to};function io(t,e){if(!i(t.data.domProps)||!i(e.data.domProps)){var n,o,s=e.elm,a=t.data.domProps||{},l=e.data.domProps||{};for(n in r(l.__ob__)&&(l=e.data.domProps=I({},l)),a)n in l||(s[n]="");for(n in l){if(o=l[n],"textContent"===n||"innerHTML"===n){if(e.children&&(e.children.length=0),o===a[n])continue;1===s.childNodes.length&&s.removeChild(s.childNodes[0])}if("value"===n&&"PROGRESS"!==s.tagName){s._value=o;var u=i(o)?"":String(o);ro(s,u)&&(s.value=u)}else if("innerHTML"===n&&rr(s.tagName)&&i(s.innerHTML)){eo=eo||document.createElement("div"),eo.innerHTML=""+o+"";var c=eo.firstChild;while(s.firstChild)s.removeChild(s.firstChild);while(c.firstChild)s.appendChild(c.firstChild)}else if(o!==a[n])try{s[n]=o}catch(Ss){}}}}function ro(t,e){return!t.composing&&("OPTION"===t.tagName||oo(t,e)||so(t,e))}function oo(t,e){var n=!0;try{n=document.activeElement!==t}catch(Ss){}return n&&t.value!==e}function so(t,e){var n=t.value,i=t._vModifiers;if(r(i)){if(i.number)return m(n)!==m(e);if(i.trim)return n.trim()!==e.trim()}return n!==e}var ao={create:io,update:io},lo=_((function(t){var e={},n=/;(?![^(]*\))/g,i=/:(.+)/;return t.split(n).forEach((function(t){if(t){var n=t.split(i);n.length>1&&(e[n[0].trim()]=n[1].trim())}})),e}));function uo(t){var e=co(t.style);return t.staticStyle?I(t.staticStyle,e):e}function co(t){return Array.isArray(t)?M(t):"string"===typeof t?lo(t):t}function ho(t,e){var n,i={};if(e){var r=t;while(r.componentInstance)r=r.componentInstance._vnode,r&&r.data&&(n=uo(r.data))&&I(i,n)}(n=uo(t.data))&&I(i,n);var o=t;while(o=o.parent)o.data&&(n=uo(o.data))&&I(i,n);return i}var fo,po=/^--/,mo=/\s*!important$/,vo=function(t,e,n){if(po.test(e))t.style.setProperty(e,n);else if(mo.test(n))t.style.setProperty(T(e),n.replace(mo,""),"important");else{var i=yo(e);if(Array.isArray(n))for(var r=0,o=n.length;r-1?e.split(_o).forEach((function(e){return t.classList.add(e)})):t.classList.add(e);else{var n=" "+(t.getAttribute("class")||"")+" ";n.indexOf(" "+e+" ")<0&&t.setAttribute("class",(n+e).trim())}}function So(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(_o).forEach((function(e){return t.classList.remove(e)})):t.classList.remove(e),t.classList.length||t.removeAttribute("class");else{var n=" "+(t.getAttribute("class")||"")+" ",i=" "+e+" ";while(n.indexOf(i)>=0)n=n.replace(i," ");n=n.trim(),n?t.setAttribute("class",n):t.removeAttribute("class")}}function Co(t){if(t){if("object"===typeof t){var e={};return!1!==t.css&&I(e,Eo(t.name||"v")),I(e,t),e}return"string"===typeof t?Eo(t):void 0}}var Eo=_((function(t){return{enterClass:t+"-enter",enterToClass:t+"-enter-to",enterActiveClass:t+"-enter-active",leaveClass:t+"-leave",leaveToClass:t+"-leave-to",leaveActiveClass:t+"-leave-active"}})),To=J&&!et,ko="transition",Ao="animation",Do="transition",Oo="transitionend",Io="animation",Mo="animationend";To&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(Do="WebkitTransition",Oo="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(Io="WebkitAnimation",Mo="webkitAnimationEnd"));var jo=J?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(t){return t()};function Po(t){jo((function(){jo(t)}))}function No(t,e){var n=t._transitionClasses||(t._transitionClasses=[]);n.indexOf(e)<0&&(n.push(e),wo(t,e))}function Vo(t,e){t._transitionClasses&&y(t._transitionClasses,e),So(t,e)}function Fo(t,e,n){var i=Lo(t,e),r=i.type,o=i.timeout,s=i.propCount;if(!r)return n();var a=r===ko?Oo:Mo,l=0,u=function(){t.removeEventListener(a,c),n()},c=function(e){e.target===t&&++l>=s&&u()};setTimeout((function(){l0&&(n=ko,c=s,h=o.length):e===Ao?u>0&&(n=Ao,c=u,h=l.length):(c=Math.max(s,u),n=c>0?s>u?ko:Ao:null,h=n?n===ko?o.length:l.length:0);var d=n===ko&&Ro.test(i[Do+"Property"]);return{type:n,timeout:c,propCount:h,hasTransform:d}}function Bo(t,e){while(t.length1}function qo(t,e){!0!==e.data.show&&zo(e)}var Go=J?{create:qo,activate:qo,remove:function(t,e){!0!==t.data.show?Ho(t,e):e()}}:{},Yo=[Hr,qr,no,ao,xo,Go],Xo=Yo.concat(Lr),Jo=Ir({nodeOps:Sr,modules:Xo});et&&document.addEventListener("selectionchange",(function(){var t=document.activeElement;t&&t.vmodel&&rs(t,"input")}));var Ko={inserted:function(t,e,n,i){"select"===n.tag?(i.elm&&!i.elm._vOptions?_e(n,"postpatch",(function(){Ko.componentUpdated(t,e,n)})):Zo(t,e,n.context),t._vOptions=[].map.call(t.options,es)):("textarea"===n.tag||ur(t.type))&&(t._vModifiers=e.modifiers,e.modifiers.lazy||(t.addEventListener("compositionstart",ns),t.addEventListener("compositionend",is),t.addEventListener("change",is),et&&(t.vmodel=!0)))},componentUpdated:function(t,e,n){if("select"===n.tag){Zo(t,e,n.context);var i=t._vOptions,r=t._vOptions=[].map.call(t.options,es);if(r.some((function(t,e){return!V(t,i[e])}))){var o=t.multiple?e.value.some((function(t){return ts(t,r)})):e.value!==e.oldValue&&ts(e.value,r);o&&rs(t,"change")}}}};function Zo(t,e,n){Qo(t,e,n),(tt||nt)&&setTimeout((function(){Qo(t,e,n)}),0)}function Qo(t,e,n){var i=e.value,r=t.multiple;if(!r||Array.isArray(i)){for(var o,s,a=0,l=t.options.length;a-1,s.selected!==o&&(s.selected=o);else if(V(es(s),i))return void(t.selectedIndex!==a&&(t.selectedIndex=a));r||(t.selectedIndex=-1)}}function ts(t,e){return e.every((function(e){return!V(e,t)}))}function es(t){return"_value"in t?t._value:t.value}function ns(t){t.target.composing=!0}function is(t){t.target.composing&&(t.target.composing=!1,rs(t.target,"input"))}function rs(t,e){var n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!0),t.dispatchEvent(n)}function os(t){return!t.componentInstance||t.data&&t.data.transition?t:os(t.componentInstance._vnode)}var ss={bind:function(t,e,n){var i=e.value;n=os(n);var r=n.data&&n.data.transition,o=t.__vOriginalDisplay="none"===t.style.display?"":t.style.display;i&&r?(n.data.show=!0,zo(n,(function(){t.style.display=o}))):t.style.display=i?o:"none"},update:function(t,e,n){var i=e.value,r=e.oldValue;if(!i!==!r){n=os(n);var o=n.data&&n.data.transition;o?(n.data.show=!0,i?zo(n,(function(){t.style.display=t.__vOriginalDisplay})):Ho(n,(function(){t.style.display="none"}))):t.style.display=i?t.__vOriginalDisplay:"none"}},unbind:function(t,e,n,i,r){r||(t.style.display=t.__vOriginalDisplay)}},as={model:Ko,show:ss},ls={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function us(t){var e=t&&t.componentOptions;return e&&e.Ctor.options.abstract?us(Sn(e.children)):t}function cs(t){var e={},n=t.$options;for(var i in n.propsData)e[i]=t[i];var r=n._parentListeners;for(var o in r)e[S(o)]=r[o];return e}function hs(t,e){if(/\d-keep-alive$/.test(e.tag))return t("keep-alive",{props:e.componentOptions.propsData})}function ds(t){while(t=t.parent)if(t.data.transition)return!0}function fs(t,e){return e.key===t.key&&e.tag===t.tag}var ps=function(t){return t.tag||wn(t)},ms=function(t){return"show"===t.name},vs={name:"transition",props:ls,abstract:!0,render:function(t){var e=this,n=this.$slots.default;if(n&&(n=n.filter(ps),n.length)){0;var i=this.mode;0;var r=n[0];if(ds(this.$vnode))return r;var o=us(r);if(!o)return r;if(this._leaving)return hs(t,r);var s="__transition-"+this._uid+"-";o.key=null==o.key?o.isComment?s+"comment":s+o.tag:a(o.key)?0===String(o.key).indexOf(s)?o.key:s+o.key:o.key;var l=(o.data||(o.data={})).transition=cs(this),u=this._vnode,c=us(u);if(o.data.directives&&o.data.directives.some(ms)&&(o.data.show=!0),c&&c.data&&!fs(o,c)&&!wn(c)&&(!c.componentInstance||!c.componentInstance._vnode.isComment)){var h=c.data.transition=I({},l);if("out-in"===i)return this._leaving=!0,_e(h,"afterLeave",(function(){e._leaving=!1,e.$forceUpdate()})),hs(t,r);if("in-out"===i){if(wn(o))return u;var d,f=function(){d()};_e(l,"afterEnter",f),_e(l,"enterCancelled",f),_e(h,"delayLeave",(function(t){d=t}))}}return r}}},gs=I({tag:String,moveClass:String},ls);delete gs.mode;var ys={props:gs,beforeMount:function(){var t=this,e=this._update;this._update=function(n,i){var r=In(t);t.__patch__(t._vnode,t.kept,!1,!0),t._vnode=t.kept,r(),e.call(t,n,i)}},render:function(t){for(var e=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),i=this.prevChildren=this.children,r=this.$slots.default||[],o=this.children=[],s=cs(this),a=0;a0},extendFrom:function(t,e){if(t)for(var n in t)!t.hasOwnProperty(n)||!0!==e&&(!1===e?this.hasOwnProperty(n):null==t[n])||(this[n]=t[n])},set:function(t,e){"string"===typeof t?this[t]=e:this.extendFrom(t,!0)},clone:function(){var t=new this.constructor;return t.extendFrom(this,!0),t},getGradient:function(t,e,n){for(var i="radial"===e.type?u:l,r=i(t,e,n),o=e.colorStops,s=0;s=0&&Math.floor(e)===e&&isFinite(t)}function f(t){return r(t)&&"function"===typeof t.then&&"function"===typeof t.catch}function p(t){return null==t?"":Array.isArray(t)||c(t)&&t.toString===u?JSON.stringify(t,null,2):String(t)}function m(t){var e=parseFloat(t);return isNaN(e)?t:e}function v(t,e){for(var n=Object.create(null),i=t.split(","),r=0;r-1)return t.splice(n,1)}}var b=Object.prototype.hasOwnProperty;function x(t,e){return b.call(t,e)}function _(t){var e=Object.create(null);return function(n){var i=e[n];return i||(e[n]=t(n))}}var w=/-(\w)/g,S=_((function(t){return t.replace(w,(function(t,e){return e?e.toUpperCase():""}))})),C=_((function(t){return t.charAt(0).toUpperCase()+t.slice(1)})),E=/\B([A-Z])/g,T=_((function(t){return t.replace(E,"-$1").toLowerCase()}));function k(t,e){function n(n){var i=arguments.length;return i?i>1?t.apply(e,arguments):t.call(e,n):t.call(e)}return n._length=t.length,n}function A(t,e){return t.bind(e)}var D=Function.prototype.bind?A:k;function O(t,e){e=e||0;var n=t.length-e,i=new Array(n);while(n--)i[n]=t[n+e];return i}function I(t,e){for(var n in e)t[n]=e[n];return t}function M(t){for(var e={},n=0;n0,nt=Q&&Q.indexOf("edge/")>0,it=(Q&&Q.indexOf("android"),Q&&/iphone|ipad|ipod|ios/.test(Q)||"ios"===Z),rt=(Q&&/chrome\/\d+/.test(Q),Q&&/phantomjs/.test(Q),Q&&Q.match(/firefox\/(\d+)/)),ot={}.watch,st=!1;if(J)try{var at={};Object.defineProperty(at,"passive",{get:function(){st=!0}}),window.addEventListener("test-passive",null,at)}catch(Ss){}var lt=function(){return void 0===Y&&(Y=!J&&!K&&"undefined"!==typeof t&&(t["process"]&&"cp-server"===t["process"].env.VUE_ENV)),Y},ut=J&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function ct(t){return"function"===typeof t&&/native code/.test(t.toString())}var ht,dt="undefined"!==typeof Symbol&&ct(Symbol)&&"undefined"!==typeof Reflect&&ct(Reflect.ownKeys);ht="undefined"!==typeof Set&&ct(Set)?Set:function(){function t(){this.set=Object.create(null)}return t.prototype.has=function(t){return!0===this.set[t]},t.prototype.add=function(t){this.set[t]=!0},t.prototype.clear=function(){this.set=Object.create(null)},t}();var ft=j,pt=0,mt=function(){this.id=pt++,this.subs=[]};mt.prototype.addSub=function(t){this.subs.push(t)},mt.prototype.removeSub=function(t){y(this.subs,t)},mt.prototype.depend=function(){mt.target&&mt.target.addDep(this)},mt.prototype.notify=function(){var t=this.subs.slice();for(var e=0,n=t.length;e-1)if(o&&!x(r,"default"))s=!1;else if(""===s||s===T(t)){var l=te(String,r.type);(l<0||a0&&(s=ke(s,(e||"")+"_"+n),Te(s[0])&&Te(u)&&(c[l]=wt(u.text+s[0].text),s.shift()),c.push.apply(c,s)):a(s)?Te(u)?c[l]=wt(u.text+s):""!==s&&c.push(wt(s)):Te(s)&&Te(u)?c[l]=wt(u.text+s.text):(o(t._isVList)&&r(s.tag)&&i(s.key)&&r(e)&&(s.key="__vlist"+e+"_"+n+"__"),c.push(s)));return c}function Ae(t){var e=t.$options.provide;e&&(t._provided="function"===typeof e?e.call(t):e)}function De(t){var e=Oe(t.$options.inject,t);e&&(Dt(!1),Object.keys(e).forEach((function(n){Pt(t,n,e[n])})),Dt(!0))}function Oe(t,e){if(t){for(var n=Object.create(null),i=dt?Reflect.ownKeys(t):Object.keys(t),r=0;r0,s=t?!!t.$stable:!o,a=t&&t.$key;if(t){if(t._normalized)return t._normalized;if(s&&i&&i!==n&&a===i.$key&&!o&&!i.$hasNormal)return i;for(var l in r={},t)t[l]&&"$"!==l[0]&&(r[l]=Pe(e,l,t[l]))}else r={};for(var u in e)u in r||(r[u]=Ne(e,u));return t&&Object.isExtensible(t)&&(t._normalized=r),W(r,"$stable",s),W(r,"$key",a),W(r,"$hasNormal",o),r}function Pe(t,e,n){var i=function(){var t=arguments.length?n.apply(null,arguments):n({});return t=t&&"object"===typeof t&&!Array.isArray(t)?[t]:Ee(t),t&&(0===t.length||1===t.length&&t[0].isComment)?void 0:t};return n.proxy&&Object.defineProperty(t,e,{get:i,enumerable:!0,configurable:!0}),i}function Ne(t,e){return function(){return t[e]}}function Ve(t,e){var n,i,o,s,a;if(Array.isArray(t)||"string"===typeof t)for(n=new Array(t.length),i=0,o=t.length;i1?O(n):n;for(var i=O(arguments,1),r='event handler for "'+t+'"',o=0,s=n.length;odocument.createEvent("Event").timeStamp&&(Yn=function(){return Xn.now()})}function Jn(){var t,e;for(Gn=Yn(),Un=!0,Bn.sort((function(t,e){return t.id-e.id})),Wn=0;WnWn&&Bn[n].id>t.id)n--;Bn.splice(n+1,0,t)}else Bn.push(t);Hn||(Hn=!0,pe(Jn))}}var ei=0,ni=function(t,e,n,i,r){this.vm=t,r&&(t._watcher=this),t._watchers.push(this),i?(this.deep=!!i.deep,this.user=!!i.user,this.lazy=!!i.lazy,this.sync=!!i.sync,this.before=i.before):this.deep=this.user=this.lazy=this.sync=!1,this.cb=n,this.id=++ei,this.active=!0,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new ht,this.newDepIds=new ht,this.expression="","function"===typeof e?this.getter=e:(this.getter=G(e),this.getter||(this.getter=j)),this.value=this.lazy?void 0:this.get()};ni.prototype.get=function(){var t;gt(this);var e=this.vm;try{t=this.getter.call(e,e)}catch(Ss){if(!this.user)throw Ss;ee(Ss,e,'getter for watcher "'+this.expression+'"')}finally{this.deep&&ve(t),yt(),this.cleanupDeps()}return t},ni.prototype.addDep=function(t){var e=t.id;this.newDepIds.has(e)||(this.newDepIds.add(e),this.newDeps.push(t),this.depIds.has(e)||t.addSub(this))},ni.prototype.cleanupDeps=function(){var t=this.deps.length;while(t--){var e=this.deps[t];this.newDepIds.has(e.id)||e.removeSub(this)}var n=this.depIds;this.depIds=this.newDepIds,this.newDepIds=n,this.newDepIds.clear(),n=this.deps,this.deps=this.newDeps,this.newDeps=n,this.newDeps.length=0},ni.prototype.update=function(){this.lazy?this.dirty=!0:this.sync?this.run():ti(this)},ni.prototype.run=function(){if(this.active){var t=this.get();if(t!==this.value||l(t)||this.deep){var e=this.value;if(this.value=t,this.user)try{this.cb.call(this.vm,t,e)}catch(Ss){ee(Ss,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,t,e)}}},ni.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},ni.prototype.depend=function(){var t=this.deps.length;while(t--)this.deps[t].depend()},ni.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||y(this.vm._watchers,this);var t=this.deps.length;while(t--)this.deps[t].removeSub(this);this.active=!1}};var ii={enumerable:!0,configurable:!0,get:j,set:j};function ri(t,e,n){ii.get=function(){return this[e][n]},ii.set=function(t){this[e][n]=t},Object.defineProperty(t,n,ii)}function oi(t){t._watchers=[];var e=t.$options;e.props&&si(t,e.props),e.methods&&pi(t,e.methods),e.data?ai(t):jt(t._data={},!0),e.computed&&ci(t,e.computed),e.watch&&e.watch!==ot&&mi(t,e.watch)}function si(t,e){var n=t.$options.propsData||{},i=t._props={},r=t.$options._propKeys=[],o=!t.$parent;o||Dt(!1);var s=function(o){r.push(o);var s=Jt(o,e,n,t);Pt(i,o,s),o in t||ri(t,"_props",o)};for(var a in e)s(a);Dt(!0)}function ai(t){var e=t.$options.data;e=t._data="function"===typeof e?li(e,t):e||{},c(e)||(e={});var n=Object.keys(e),i=t.$options.props,r=(t.$options.methods,n.length);while(r--){var o=n[r];0,i&&x(i,o)||U(o)||ri(t,"_data",o)}jt(e,!0)}function li(t,e){gt();try{return t.call(e,e)}catch(Ss){return ee(Ss,e,"data()"),{}}finally{yt()}}var ui={lazy:!0};function ci(t,e){var n=t._computedWatchers=Object.create(null),i=lt();for(var r in e){var o=e[r],s="function"===typeof o?o:o.get;0,i||(n[r]=new ni(t,s||j,j,ui)),r in t||hi(t,r,o)}}function hi(t,e,n){var i=!lt();"function"===typeof n?(ii.get=i?di(e):fi(n),ii.set=j):(ii.get=n.get?i&&!1!==n.cache?di(e):fi(n.get):j,ii.set=n.set||j),Object.defineProperty(t,e,ii)}function di(t){return function(){var e=this._computedWatchers&&this._computedWatchers[t];if(e)return e.dirty&&e.evaluate(),mt.target&&e.depend(),e.value}}function fi(t){return function(){return t.call(this,this)}}function pi(t,e){t.$options.props;for(var n in e)t[n]="function"!==typeof e[n]?j:D(e[n],t)}function mi(t,e){for(var n in e){var i=e[n];if(Array.isArray(i))for(var r=0;r-1)return this;var n=O(arguments,1);return n.unshift(this),"function"===typeof t.install?t.install.apply(t,n):"function"===typeof t&&t.apply(null,n),e.push(t),this}}function Ei(t){t.mixin=function(t){return this.options=Yt(this.options,t),this}}function Ti(t){t.cid=0;var e=1;t.extend=function(t){t=t||{};var n=this,i=n.cid,r=t._Ctor||(t._Ctor={});if(r[i])return r[i];var o=t.name||n.options.name;var s=function(t){this._init(t)};return s.prototype=Object.create(n.prototype),s.prototype.constructor=s,s.cid=e++,s.options=Yt(n.options,t),s["super"]=n,s.options.props&&ki(s),s.options.computed&&Ai(s),s.extend=n.extend,s.mixin=n.mixin,s.use=n.use,B.forEach((function(t){s[t]=n[t]})),o&&(s.options.components[o]=s),s.superOptions=n.options,s.extendOptions=t,s.sealedOptions=I({},s.options),r[i]=s,s}}function ki(t){var e=t.options.props;for(var n in e)ri(t.prototype,"_props",n)}function Ai(t){var e=t.options.computed;for(var n in e)hi(t.prototype,n,e[n])}function Di(t){B.forEach((function(e){t[e]=function(t,n){return n?("component"===e&&c(n)&&(n.name=n.name||t,n=this.options._base.extend(n)),"directive"===e&&"function"===typeof n&&(n={bind:n,update:n}),this.options[e+"s"][t]=n,n):this.options[e+"s"][t]}}))}function Oi(t){return t&&(t.Ctor.options.name||t.tag)}function Ii(t,e){return Array.isArray(t)?t.indexOf(e)>-1:"string"===typeof t?t.split(",").indexOf(e)>-1:!!h(t)&&t.test(e)}function Mi(t,e){var n=t.cache,i=t.keys,r=t._vnode;for(var o in n){var s=n[o];if(s){var a=Oi(s.componentOptions);a&&!e(a)&&ji(n,o,i,r)}}}function ji(t,e,n,i){var r=t[e];!r||i&&r.tag===i.tag||r.componentInstance.$destroy(),t[e]=null,y(n,e)}bi(Si),gi(Si),Dn(Si),jn(Si),yn(Si);var Pi=[String,RegExp,Array],Ni={name:"keep-alive",abstract:!0,props:{include:Pi,exclude:Pi,max:[String,Number]},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var t in this.cache)ji(this.cache,t,this.keys)},mounted:function(){var t=this;this.$watch("include",(function(e){Mi(t,(function(t){return Ii(e,t)}))})),this.$watch("exclude",(function(e){Mi(t,(function(t){return!Ii(e,t)}))}))},render:function(){var t=this.$slots.default,e=Sn(t),n=e&&e.componentOptions;if(n){var i=Oi(n),r=this,o=r.include,s=r.exclude;if(o&&(!i||!Ii(o,i))||s&&i&&Ii(s,i))return e;var a=this,l=a.cache,u=a.keys,c=null==e.key?n.Ctor.cid+(n.tag?"::"+n.tag:""):e.key;l[c]?(e.componentInstance=l[c].componentInstance,y(u,c),u.push(c)):(l[c]=e,u.push(c),this.max&&u.length>parseInt(this.max)&&ji(l,u[0],u,this._vnode)),e.data.keepAlive=!0}return e||t&&t[0]}},Vi={KeepAlive:Ni};function Fi(t){var e={get:function(){return z}};Object.defineProperty(t,"config",e),t.util={warn:ft,extend:I,mergeOptions:Yt,defineReactive:Pt},t.set=Nt,t.delete=Vt,t.nextTick=pe,t.observable=function(t){return jt(t),t},t.options=Object.create(null),B.forEach((function(e){t.options[e+"s"]=Object.create(null)})),t.options._base=t,I(t.options.components,Vi),Ci(t),Ei(t),Ti(t),Di(t)}Fi(Si),Object.defineProperty(Si.prototype,"$isServer",{get:lt}),Object.defineProperty(Si.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(Si,"FunctionalRenderContext",{value:Ke}),Si.version="2.6.11";var Ri=v("style,class"),Li=v("input,textarea,option,select,progress"),Bi=function(t,e,n){return"value"===n&&Li(t)&&"button"!==e||"selected"===n&&"option"===t||"checked"===n&&"input"===t||"muted"===n&&"video"===t},$i=v("contenteditable,draggable,spellcheck"),zi=v("events,caret,typing,plaintext-only"),Hi=function(t,e){return Yi(e)||"false"===e?"false":"contenteditable"===t&&zi(e)?e:"true"},Ui=v("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"),Wi="http://www.w3.org/1999/xlink",qi=function(t){return":"===t.charAt(5)&&"xlink"===t.slice(0,5)},Gi=function(t){return qi(t)?t.slice(6,t.length):""},Yi=function(t){return null==t||!1===t};function Xi(t){var e=t.data,n=t,i=t;while(r(i.componentInstance))i=i.componentInstance._vnode,i&&i.data&&(e=Ji(i.data,e));while(r(n=n.parent))n&&n.data&&(e=Ji(e,n.data));return Ki(e.staticClass,e.class)}function Ji(t,e){return{staticClass:Zi(t.staticClass,e.staticClass),class:r(t.class)?[t.class,e.class]:e.class}}function Ki(t,e){return r(t)||r(e)?Zi(t,Qi(e)):""}function Zi(t,e){return t?e?t+" "+e:t:e||""}function Qi(t){return Array.isArray(t)?tr(t):l(t)?er(t):"string"===typeof t?t:""}function tr(t){for(var e,n="",i=0,o=t.length;i-1?ar[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:ar[t]=/HTMLUnknownElement/.test(e.toString())}var ur=v("text,number,password,search,email,tel,url");function cr(t){if("string"===typeof t){var e=document.querySelector(t);return e||document.createElement("div")}return t}function hr(t,e){var n=document.createElement(t);return"select"!==t||e.data&&e.data.attrs&&void 0!==e.data.attrs.multiple&&n.setAttribute("multiple","multiple"),n}function dr(t,e){return document.createElementNS(nr[t],e)}function fr(t){return document.createTextNode(t)}function pr(t){return document.createComment(t)}function mr(t,e,n){t.insertBefore(e,n)}function vr(t,e){t.removeChild(e)}function gr(t,e){t.appendChild(e)}function yr(t){return t.parentNode}function br(t){return t.nextSibling}function xr(t){return t.tagName}function _r(t,e){t.textContent=e}function wr(t,e){t.setAttribute(e,"")}var Sr=Object.freeze({createElement:hr,createElementNS:dr,createTextNode:fr,createComment:pr,insertBefore:mr,removeChild:vr,appendChild:gr,parentNode:yr,nextSibling:br,tagName:xr,setTextContent:_r,setStyleScope:wr}),Cr={create:function(t,e){Er(e)},update:function(t,e){t.data.ref!==e.data.ref&&(Er(t,!0),Er(e))},destroy:function(t){Er(t,!0)}};function Er(t,e){var n=t.data.ref;if(r(n)){var i=t.context,o=t.componentInstance||t.elm,s=i.$refs;e?Array.isArray(s[n])?y(s[n],o):s[n]===o&&(s[n]=void 0):t.data.refInFor?Array.isArray(s[n])?s[n].indexOf(o)<0&&s[n].push(o):s[n]=[o]:s[n]=o}}var Tr=new bt("",{},[]),kr=["create","activate","update","remove","destroy"];function Ar(t,e){return t.key===e.key&&(t.tag===e.tag&&t.isComment===e.isComment&&r(t.data)===r(e.data)&&Dr(t,e)||o(t.isAsyncPlaceholder)&&t.asyncFactory===e.asyncFactory&&i(e.asyncFactory.error))}function Dr(t,e){if("input"!==t.tag)return!0;var n,i=r(n=t.data)&&r(n=n.attrs)&&n.type,o=r(n=e.data)&&r(n=n.attrs)&&n.type;return i===o||ur(i)&&ur(o)}function Or(t,e,n){var i,o,s={};for(i=e;i<=n;++i)o=t[i].key,r(o)&&(s[o]=i);return s}function Ir(t){var e,n,s={},l=t.modules,u=t.nodeOps;for(e=0;em?(h=i(n[y+1])?null:n[y+1].elm,S(t,h,n,p,y,o)):p>y&&E(e,d,m)}function A(t,e,n,i){for(var o=n;o-1?zr(t,e,n):Ui(e)?Yi(n)?t.removeAttribute(e):(n="allowfullscreen"===e&&"EMBED"===t.tagName?"true":e,t.setAttribute(e,n)):$i(e)?t.setAttribute(e,Hi(e,n)):qi(e)?Yi(n)?t.removeAttributeNS(Wi,Gi(e)):t.setAttributeNS(Wi,e,n):zr(t,e,n)}function zr(t,e,n){if(Yi(n))t.removeAttribute(e);else{if(tt&&!et&&"TEXTAREA"===t.tagName&&"placeholder"===e&&""!==n&&!t.__ieph){var i=function(e){e.stopImmediatePropagation(),t.removeEventListener("input",i)};t.addEventListener("input",i),t.__ieph=!0}t.setAttribute(e,n)}}var Hr={create:Br,update:Br};function Ur(t,e){var n=e.elm,o=e.data,s=t.data;if(!(i(o.staticClass)&&i(o.class)&&(i(s)||i(s.staticClass)&&i(s.class)))){var a=Xi(e),l=n._transitionClasses;r(l)&&(a=Zi(a,Qi(l))),a!==n._prevClass&&(n.setAttribute("class",a),n._prevClass=a)}}var Wr,qr={create:Ur,update:Ur},Gr="__r",Yr="__c";function Xr(t){if(r(t[Gr])){var e=tt?"change":"input";t[e]=[].concat(t[Gr],t[e]||[]),delete t[Gr]}r(t[Yr])&&(t.change=[].concat(t[Yr],t.change||[]),delete t[Yr])}function Jr(t,e,n){var i=Wr;return function r(){var o=e.apply(null,arguments);null!==o&&Qr(t,r,n,i)}}var Kr=se&&!(rt&&Number(rt[1])<=53);function Zr(t,e,n,i){if(Kr){var r=Gn,o=e;e=o._wrapper=function(t){if(t.target===t.currentTarget||t.timeStamp>=r||t.timeStamp<=0||t.target.ownerDocument!==document)return o.apply(this,arguments)}}Wr.addEventListener(t,e,st?{capture:n,passive:i}:n)}function Qr(t,e,n,i){(i||Wr).removeEventListener(t,e._wrapper||e,n)}function to(t,e){if(!i(t.data.on)||!i(e.data.on)){var n=e.data.on||{},r=t.data.on||{};Wr=e.elm,Xr(n),xe(n,r,Zr,Qr,Jr,e.context),Wr=void 0}}var eo,no={create:to,update:to};function io(t,e){if(!i(t.data.domProps)||!i(e.data.domProps)){var n,o,s=e.elm,a=t.data.domProps||{},l=e.data.domProps||{};for(n in r(l.__ob__)&&(l=e.data.domProps=I({},l)),a)n in l||(s[n]="");for(n in l){if(o=l[n],"textContent"===n||"innerHTML"===n){if(e.children&&(e.children.length=0),o===a[n])continue;1===s.childNodes.length&&s.removeChild(s.childNodes[0])}if("value"===n&&"PROGRESS"!==s.tagName){s._value=o;var u=i(o)?"":String(o);ro(s,u)&&(s.value=u)}else if("innerHTML"===n&&rr(s.tagName)&&i(s.innerHTML)){eo=eo||document.createElement("div"),eo.innerHTML=""+o+"";var c=eo.firstChild;while(s.firstChild)s.removeChild(s.firstChild);while(c.firstChild)s.appendChild(c.firstChild)}else if(o!==a[n])try{s[n]=o}catch(Ss){}}}}function ro(t,e){return!t.composing&&("OPTION"===t.tagName||oo(t,e)||so(t,e))}function oo(t,e){var n=!0;try{n=document.activeElement!==t}catch(Ss){}return n&&t.value!==e}function so(t,e){var n=t.value,i=t._vModifiers;if(r(i)){if(i.number)return m(n)!==m(e);if(i.trim)return n.trim()!==e.trim()}return n!==e}var ao={create:io,update:io},lo=_((function(t){var e={},n=/;(?![^(]*\))/g,i=/:(.+)/;return t.split(n).forEach((function(t){if(t){var n=t.split(i);n.length>1&&(e[n[0].trim()]=n[1].trim())}})),e}));function uo(t){var e=co(t.style);return t.staticStyle?I(t.staticStyle,e):e}function co(t){return Array.isArray(t)?M(t):"string"===typeof t?lo(t):t}function ho(t,e){var n,i={};if(e){var r=t;while(r.componentInstance)r=r.componentInstance._vnode,r&&r.data&&(n=uo(r.data))&&I(i,n)}(n=uo(t.data))&&I(i,n);var o=t;while(o=o.parent)o.data&&(n=uo(o.data))&&I(i,n);return i}var fo,po=/^--/,mo=/\s*!important$/,vo=function(t,e,n){if(po.test(e))t.style.setProperty(e,n);else if(mo.test(n))t.style.setProperty(T(e),n.replace(mo,""),"important");else{var i=yo(e);if(Array.isArray(n))for(var r=0,o=n.length;r-1?e.split(_o).forEach((function(e){return t.classList.add(e)})):t.classList.add(e);else{var n=" "+(t.getAttribute("class")||"")+" ";n.indexOf(" "+e+" ")<0&&t.setAttribute("class",(n+e).trim())}}function So(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(_o).forEach((function(e){return t.classList.remove(e)})):t.classList.remove(e),t.classList.length||t.removeAttribute("class");else{var n=" "+(t.getAttribute("class")||"")+" ",i=" "+e+" ";while(n.indexOf(i)>=0)n=n.replace(i," ");n=n.trim(),n?t.setAttribute("class",n):t.removeAttribute("class")}}function Co(t){if(t){if("object"===typeof t){var e={};return!1!==t.css&&I(e,Eo(t.name||"v")),I(e,t),e}return"string"===typeof t?Eo(t):void 0}}var Eo=_((function(t){return{enterClass:t+"-enter",enterToClass:t+"-enter-to",enterActiveClass:t+"-enter-active",leaveClass:t+"-leave",leaveToClass:t+"-leave-to",leaveActiveClass:t+"-leave-active"}})),To=J&&!et,ko="transition",Ao="animation",Do="transition",Oo="transitionend",Io="animation",Mo="animationend";To&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(Do="WebkitTransition",Oo="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(Io="WebkitAnimation",Mo="webkitAnimationEnd"));var jo=J?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(t){return t()};function Po(t){jo((function(){jo(t)}))}function No(t,e){var n=t._transitionClasses||(t._transitionClasses=[]);n.indexOf(e)<0&&(n.push(e),wo(t,e))}function Vo(t,e){t._transitionClasses&&y(t._transitionClasses,e),So(t,e)}function Fo(t,e,n){var i=Lo(t,e),r=i.type,o=i.timeout,s=i.propCount;if(!r)return n();var a=r===ko?Oo:Mo,l=0,u=function(){t.removeEventListener(a,c),n()},c=function(e){e.target===t&&++l>=s&&u()};setTimeout((function(){l0&&(n=ko,c=s,h=o.length):e===Ao?u>0&&(n=Ao,c=u,h=l.length):(c=Math.max(s,u),n=c>0?s>u?ko:Ao:null,h=n?n===ko?o.length:l.length:0);var d=n===ko&&Ro.test(i[Do+"Property"]);return{type:n,timeout:c,propCount:h,hasTransform:d}}function Bo(t,e){while(t.length1}function qo(t,e){!0!==e.data.show&&zo(e)}var Go=J?{create:qo,activate:qo,remove:function(t,e){!0!==t.data.show?Ho(t,e):e()}}:{},Yo=[Hr,qr,no,ao,xo,Go],Xo=Yo.concat(Lr),Jo=Ir({nodeOps:Sr,modules:Xo});et&&document.addEventListener("selectionchange",(function(){var t=document.activeElement;t&&t.vmodel&&rs(t,"input")}));var Ko={inserted:function(t,e,n,i){"select"===n.tag?(i.elm&&!i.elm._vOptions?_e(n,"postpatch",(function(){Ko.componentUpdated(t,e,n)})):Zo(t,e,n.context),t._vOptions=[].map.call(t.options,es)):("textarea"===n.tag||ur(t.type))&&(t._vModifiers=e.modifiers,e.modifiers.lazy||(t.addEventListener("compositionstart",ns),t.addEventListener("compositionend",is),t.addEventListener("change",is),et&&(t.vmodel=!0)))},componentUpdated:function(t,e,n){if("select"===n.tag){Zo(t,e,n.context);var i=t._vOptions,r=t._vOptions=[].map.call(t.options,es);if(r.some((function(t,e){return!V(t,i[e])}))){var o=t.multiple?e.value.some((function(t){return ts(t,r)})):e.value!==e.oldValue&&ts(e.value,r);o&&rs(t,"change")}}}};function Zo(t,e,n){Qo(t,e,n),(tt||nt)&&setTimeout((function(){Qo(t,e,n)}),0)}function Qo(t,e,n){var i=e.value,r=t.multiple;if(!r||Array.isArray(i)){for(var o,s,a=0,l=t.options.length;a-1,s.selected!==o&&(s.selected=o);else if(V(es(s),i))return void(t.selectedIndex!==a&&(t.selectedIndex=a));r||(t.selectedIndex=-1)}}function ts(t,e){return e.every((function(e){return!V(e,t)}))}function es(t){return"_value"in t?t._value:t.value}function ns(t){t.target.composing=!0}function is(t){t.target.composing&&(t.target.composing=!1,rs(t.target,"input"))}function rs(t,e){var n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!0),t.dispatchEvent(n)}function os(t){return!t.componentInstance||t.data&&t.data.transition?t:os(t.componentInstance._vnode)}var ss={bind:function(t,e,n){var i=e.value;n=os(n);var r=n.data&&n.data.transition,o=t.__vOriginalDisplay="none"===t.style.display?"":t.style.display;i&&r?(n.data.show=!0,zo(n,(function(){t.style.display=o}))):t.style.display=i?o:"none"},update:function(t,e,n){var i=e.value,r=e.oldValue;if(!i!==!r){n=os(n);var o=n.data&&n.data.transition;o?(n.data.show=!0,i?zo(n,(function(){t.style.display=t.__vOriginalDisplay})):Ho(n,(function(){t.style.display="none"}))):t.style.display=i?t.__vOriginalDisplay:"none"}},unbind:function(t,e,n,i,r){r||(t.style.display=t.__vOriginalDisplay)}},as={model:Ko,show:ss},ls={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function us(t){var e=t&&t.componentOptions;return e&&e.Ctor.options.abstract?us(Sn(e.children)):t}function cs(t){var e={},n=t.$options;for(var i in n.propsData)e[i]=t[i];var r=n._parentListeners;for(var o in r)e[S(o)]=r[o];return e}function hs(t,e){if(/\d-keep-alive$/.test(e.tag))return t("keep-alive",{props:e.componentOptions.propsData})}function ds(t){while(t=t.parent)if(t.data.transition)return!0}function fs(t,e){return e.key===t.key&&e.tag===t.tag}var ps=function(t){return t.tag||wn(t)},ms=function(t){return"show"===t.name},vs={name:"transition",props:ls,abstract:!0,render:function(t){var e=this,n=this.$slots.default;if(n&&(n=n.filter(ps),n.length)){0;var i=this.mode;0;var r=n[0];if(ds(this.$vnode))return r;var o=us(r);if(!o)return r;if(this._leaving)return hs(t,r);var s="__transition-"+this._uid+"-";o.key=null==o.key?o.isComment?s+"comment":s+o.tag:a(o.key)?0===String(o.key).indexOf(s)?o.key:s+o.key:o.key;var l=(o.data||(o.data={})).transition=cs(this),u=this._vnode,c=us(u);if(o.data.directives&&o.data.directives.some(ms)&&(o.data.show=!0),c&&c.data&&!fs(o,c)&&!wn(c)&&(!c.componentInstance||!c.componentInstance._vnode.isComment)){var h=c.data.transition=I({},l);if("out-in"===i)return this._leaving=!0,_e(h,"afterLeave",(function(){e._leaving=!1,e.$forceUpdate()})),hs(t,r);if("in-out"===i){if(wn(o))return u;var d,f=function(){d()};_e(l,"afterEnter",f),_e(l,"enterCancelled",f),_e(h,"delayLeave",(function(t){d=t}))}}return r}}},gs=I({tag:String,moveClass:String},ls);delete gs.mode;var ys={props:gs,beforeMount:function(){var t=this,e=this._update;this._update=function(n,i){var r=In(t);t.__patch__(t._vnode,t.kept,!1,!0),t._vnode=t.kept,r(),e.call(t,n,i)}},render:function(t){for(var e=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),i=this.prevChildren=this.children,r=this.$slots.default||[],o=this.children=[],s=cs(this),a=0;a0},extendFrom:function(t,e){if(t)for(var n in t)!t.hasOwnProperty(n)||!0!==e&&(!1===e?this.hasOwnProperty(n):null==t[n])||(this[n]=t[n])},set:function(t,e){"string"===typeof t?this[t]=e:this.extendFrom(t,!0)},clone:function(){var t=new this.constructor;return t.extendFrom(this,!0),t},getGradient:function(t,e,n){for(var i="radial"===e.type?u:l,r=i(t,e,n),o=e.colorStops,s=0;s @@ -18,19 +18,19 @@ var n=Object.freeze({});function i(t){return void 0===t||null===t}function r(t){ * (c) 2020 Evan You * @license MIT */ -function n(t){var e=Number(t.version.split(".")[0]);if(e>=2)t.mixin({beforeCreate:i});else{var n=t.prototype._init;t.prototype._init=function(t){void 0===t&&(t={}),t.init=t.init?[i].concat(t.init):i,n.call(this,t)}}function i(){var t=this.$options;t.store?this.$store="function"===typeof t.store?t.store():t.store:t.parent&&t.parent.$store&&(this.$store=t.parent.$store)}}var i="undefined"!==typeof window?window:"undefined"!==typeof t?t:{},r=i.__VUE_DEVTOOLS_GLOBAL_HOOK__;function o(t){r&&(t._devtoolHook=r,r.emit("vuex:init",t),r.on("vuex:travel-to-state",(function(e){t.replaceState(e)})),t.subscribe((function(t,e){r.emit("vuex:mutation",t,e)}),{prepend:!0}),t.subscribeAction((function(t,e){r.emit("vuex:action",t,e)}),{prepend:!0}))}function s(t,e){return t.filter(e)[0]}function a(t,e){if(void 0===e&&(e=[]),null===t||"object"!==typeof t)return t;var n=s(e,(function(e){return e.original===t}));if(n)return n.copy;var i=Array.isArray(t)?[]:{};return e.push({original:t,copy:i}),Object.keys(t).forEach((function(n){i[n]=a(t[n],e)})),i}function l(t,e){Object.keys(t).forEach((function(n){return e(t[n],n)}))}function u(t){return null!==t&&"object"===typeof t}function c(t){return t&&"function"===typeof t.then}function h(t,e){return function(){return t(e)}}var d=function(t,e){this.runtime=e,this._children=Object.create(null),this._rawModule=t;var n=t.state;this.state=("function"===typeof n?n():n)||{}},f={namespaced:{configurable:!0}};f.namespaced.get=function(){return!!this._rawModule.namespaced},d.prototype.addChild=function(t,e){this._children[t]=e},d.prototype.removeChild=function(t){delete this._children[t]},d.prototype.getChild=function(t){return this._children[t]},d.prototype.hasChild=function(t){return t in this._children},d.prototype.update=function(t){this._rawModule.namespaced=t.namespaced,t.actions&&(this._rawModule.actions=t.actions),t.mutations&&(this._rawModule.mutations=t.mutations),t.getters&&(this._rawModule.getters=t.getters)},d.prototype.forEachChild=function(t){l(this._children,t)},d.prototype.forEachGetter=function(t){this._rawModule.getters&&l(this._rawModule.getters,t)},d.prototype.forEachAction=function(t){this._rawModule.actions&&l(this._rawModule.actions,t)},d.prototype.forEachMutation=function(t){this._rawModule.mutations&&l(this._rawModule.mutations,t)},Object.defineProperties(d.prototype,f);var p=function(t){this.register([],t,!1)};function m(t,e,n){if(e.update(n),n.modules)for(var i in n.modules){if(!e.getChild(i))return void 0;m(t.concat(i),e.getChild(i),n.modules[i])}}p.prototype.get=function(t){return t.reduce((function(t,e){return t.getChild(e)}),this.root)},p.prototype.getNamespace=function(t){var e=this.root;return t.reduce((function(t,n){return e=e.getChild(n),t+(e.namespaced?n+"/":"")}),"")},p.prototype.update=function(t){m([],this.root,t)},p.prototype.register=function(t,e,n){var i=this;void 0===n&&(n=!0);var r=new d(e,n);if(0===t.length)this.root=r;else{var o=this.get(t.slice(0,-1));o.addChild(t[t.length-1],r)}e.modules&&l(e.modules,(function(e,r){i.register(t.concat(r),e,n)}))},p.prototype.unregister=function(t){var e=this.get(t.slice(0,-1)),n=t[t.length-1],i=e.getChild(n);i&&i.runtime&&e.removeChild(n)},p.prototype.isRegistered=function(t){var e=this.get(t.slice(0,-1)),n=t[t.length-1];return e.hasChild(n)};var v;var g=function(t){var e=this;void 0===t&&(t={}),!v&&"undefined"!==typeof window&&window.Vue&&I(window.Vue);var n=t.plugins;void 0===n&&(n=[]);var i=t.strict;void 0===i&&(i=!1),this._committing=!1,this._actions=Object.create(null),this._actionSubscribers=[],this._mutations=Object.create(null),this._wrappedGetters=Object.create(null),this._modules=new p(t),this._modulesNamespaceMap=Object.create(null),this._subscribers=[],this._watcherVM=new v,this._makeLocalGettersCache=Object.create(null);var r=this,s=this,a=s.dispatch,l=s.commit;this.dispatch=function(t,e){return a.call(r,t,e)},this.commit=function(t,e,n){return l.call(r,t,e,n)},this.strict=i;var u=this._modules.root.state;w(this,u,[],this._modules.root),_(this,u),n.forEach((function(t){return t(e)}));var c=void 0!==t.devtools?t.devtools:v.config.devtools;c&&o(this)},y={state:{configurable:!0}};function b(t,e,n){return e.indexOf(t)<0&&(n&&n.prepend?e.unshift(t):e.push(t)),function(){var n=e.indexOf(t);n>-1&&e.splice(n,1)}}function x(t,e){t._actions=Object.create(null),t._mutations=Object.create(null),t._wrappedGetters=Object.create(null),t._modulesNamespaceMap=Object.create(null);var n=t.state;w(t,n,[],t._modules.root,!0),_(t,n,e)}function _(t,e,n){var i=t._vm;t.getters={},t._makeLocalGettersCache=Object.create(null);var r=t._wrappedGetters,o={};l(r,(function(e,n){o[n]=h(e,t),Object.defineProperty(t.getters,n,{get:function(){return t._vm[n]},enumerable:!0})}));var s=v.config.silent;v.config.silent=!0,t._vm=new v({data:{$$state:e},computed:o}),v.config.silent=s,t.strict&&A(t),i&&(n&&t._withCommit((function(){i._data.$$state=null})),v.nextTick((function(){return i.$destroy()})))}function w(t,e,n,i,r){var o=!n.length,s=t._modules.getNamespace(n);if(i.namespaced&&(t._modulesNamespaceMap[s],t._modulesNamespaceMap[s]=i),!o&&!r){var a=D(e,n.slice(0,-1)),l=n[n.length-1];t._withCommit((function(){v.set(a,l,i.state)}))}var u=i.context=S(t,s,n);i.forEachMutation((function(e,n){var i=s+n;E(t,i,e,u)})),i.forEachAction((function(e,n){var i=e.root?n:s+n,r=e.handler||e;T(t,i,r,u)})),i.forEachGetter((function(e,n){var i=s+n;k(t,i,e,u)})),i.forEachChild((function(i,o){w(t,e,n.concat(o),i,r)}))}function S(t,e,n){var i=""===e,r={dispatch:i?t.dispatch:function(n,i,r){var o=O(n,i,r),s=o.payload,a=o.options,l=o.type;return a&&a.root||(l=e+l),t.dispatch(l,s)},commit:i?t.commit:function(n,i,r){var o=O(n,i,r),s=o.payload,a=o.options,l=o.type;a&&a.root||(l=e+l),t.commit(l,s,a)}};return Object.defineProperties(r,{getters:{get:i?function(){return t.getters}:function(){return C(t,e)}},state:{get:function(){return D(t.state,n)}}}),r}function C(t,e){if(!t._makeLocalGettersCache[e]){var n={},i=e.length;Object.keys(t.getters).forEach((function(r){if(r.slice(0,i)===e){var o=r.slice(i);Object.defineProperty(n,o,{get:function(){return t.getters[r]},enumerable:!0})}})),t._makeLocalGettersCache[e]=n}return t._makeLocalGettersCache[e]}function E(t,e,n,i){var r=t._mutations[e]||(t._mutations[e]=[]);r.push((function(e){n.call(t,i.state,e)}))}function T(t,e,n,i){var r=t._actions[e]||(t._actions[e]=[]);r.push((function(e){var r=n.call(t,{dispatch:i.dispatch,commit:i.commit,getters:i.getters,state:i.state,rootGetters:t.getters,rootState:t.state},e);return c(r)||(r=Promise.resolve(r)),t._devtoolHook?r.catch((function(e){throw t._devtoolHook.emit("vuex:error",e),e})):r}))}function k(t,e,n,i){t._wrappedGetters[e]||(t._wrappedGetters[e]=function(t){return n(i.state,i.getters,t.state,t.getters)})}function A(t){t._vm.$watch((function(){return this._data.$$state}),(function(){0}),{deep:!0,sync:!0})}function D(t,e){return e.reduce((function(t,e){return t[e]}),t)}function O(t,e,n){return u(t)&&t.type&&(n=e,e=t,t=t.type),{type:t,payload:e,options:n}}function I(t){v&&t===v||(v=t,n(v))}y.state.get=function(){return this._vm._data.$$state},y.state.set=function(t){0},g.prototype.commit=function(t,e,n){var i=this,r=O(t,e,n),o=r.type,s=r.payload,a=(r.options,{type:o,payload:s}),l=this._mutations[o];l&&(this._withCommit((function(){l.forEach((function(t){t(s)}))})),this._subscribers.slice().forEach((function(t){return t(a,i.state)})))},g.prototype.dispatch=function(t,e){var n=this,i=O(t,e),r=i.type,o=i.payload,s={type:r,payload:o},a=this._actions[r];if(a){try{this._actionSubscribers.slice().filter((function(t){return t.before})).forEach((function(t){return t.before(s,n.state)}))}catch(u){0}var l=a.length>1?Promise.all(a.map((function(t){return t(o)}))):a[0](o);return new Promise((function(t,e){l.then((function(e){try{n._actionSubscribers.filter((function(t){return t.after})).forEach((function(t){return t.after(s,n.state)}))}catch(u){0}t(e)}),(function(t){try{n._actionSubscribers.filter((function(t){return t.error})).forEach((function(e){return e.error(s,n.state,t)}))}catch(u){0}e(t)}))}))}},g.prototype.subscribe=function(t,e){return b(t,this._subscribers,e)},g.prototype.subscribeAction=function(t,e){var n="function"===typeof t?{before:t}:t;return b(n,this._actionSubscribers,e)},g.prototype.watch=function(t,e,n){var i=this;return this._watcherVM.$watch((function(){return t(i.state,i.getters)}),e,n)},g.prototype.replaceState=function(t){var e=this;this._withCommit((function(){e._vm._data.$$state=t}))},g.prototype.registerModule=function(t,e,n){void 0===n&&(n={}),"string"===typeof t&&(t=[t]),this._modules.register(t,e),w(this,this.state,t,this._modules.get(t),n.preserveState),_(this,this.state)},g.prototype.unregisterModule=function(t){var e=this;"string"===typeof t&&(t=[t]),this._modules.unregister(t),this._withCommit((function(){var n=D(e.state,t.slice(0,-1));v.delete(n,t[t.length-1])})),x(this)},g.prototype.hasModule=function(t){return"string"===typeof t&&(t=[t]),this._modules.isRegistered(t)},g.prototype.hotUpdate=function(t){this._modules.update(t),x(this,!0)},g.prototype._withCommit=function(t){var e=this._committing;this._committing=!0,t(),this._committing=e},Object.defineProperties(g.prototype,y);var M=L((function(t,e){var n={};return F(e).forEach((function(e){var i=e.key,r=e.val;n[i]=function(){var e=this.$store.state,n=this.$store.getters;if(t){var i=B(this.$store,"mapState",t);if(!i)return;e=i.context.state,n=i.context.getters}return"function"===typeof r?r.call(this,e,n):e[r]},n[i].vuex=!0})),n})),j=L((function(t,e){var n={};return F(e).forEach((function(e){var i=e.key,r=e.val;n[i]=function(){var e=[],n=arguments.length;while(n--)e[n]=arguments[n];var i=this.$store.commit;if(t){var o=B(this.$store,"mapMutations",t);if(!o)return;i=o.context.commit}return"function"===typeof r?r.apply(this,[i].concat(e)):i.apply(this.$store,[r].concat(e))}})),n})),P=L((function(t,e){var n={};return F(e).forEach((function(e){var i=e.key,r=e.val;r=t+r,n[i]=function(){if(!t||B(this.$store,"mapGetters",t))return this.$store.getters[r]},n[i].vuex=!0})),n})),N=L((function(t,e){var n={};return F(e).forEach((function(e){var i=e.key,r=e.val;n[i]=function(){var e=[],n=arguments.length;while(n--)e[n]=arguments[n];var i=this.$store.dispatch;if(t){var o=B(this.$store,"mapActions",t);if(!o)return;i=o.context.dispatch}return"function"===typeof r?r.apply(this,[i].concat(e)):i.apply(this.$store,[r].concat(e))}})),n})),V=function(t){return{mapState:M.bind(null,t),mapGetters:P.bind(null,t),mapMutations:j.bind(null,t),mapActions:N.bind(null,t)}};function F(t){return R(t)?Array.isArray(t)?t.map((function(t){return{key:t,val:t}})):Object.keys(t).map((function(e){return{key:e,val:t[e]}})):[]}function R(t){return Array.isArray(t)||u(t)}function L(t){return function(e,n){return"string"!==typeof e?(n=e,e=""):"/"!==e.charAt(e.length-1)&&(e+="/"),t(e,n)}}function B(t,e,n){var i=t._modulesNamespaceMap[n];return i}function $(t){void 0===t&&(t={});var e=t.collapsed;void 0===e&&(e=!0);var n=t.filter;void 0===n&&(n=function(t,e,n){return!0});var i=t.transformer;void 0===i&&(i=function(t){return t});var r=t.mutationTransformer;void 0===r&&(r=function(t){return t});var o=t.actionFilter;void 0===o&&(o=function(t,e){return!0});var s=t.actionTransformer;void 0===s&&(s=function(t){return t});var l=t.logMutations;void 0===l&&(l=!0);var u=t.logActions;void 0===u&&(u=!0);var c=t.logger;return void 0===c&&(c=console),function(t){var h=a(t.state);"undefined"!==typeof c&&(l&&t.subscribe((function(t,o){var s=a(o);if(n(t,h,s)){var l=U(),u=r(t),d="mutation "+t.type+l;z(c,d,e),c.log("%c prev state","color: #9E9E9E; font-weight: bold",i(h)),c.log("%c mutation","color: #03A9F4; font-weight: bold",u),c.log("%c next state","color: #4CAF50; font-weight: bold",i(s)),H(c)}h=s})),u&&t.subscribeAction((function(t,n){if(o(t,n)){var i=U(),r=s(t),a="action "+t.type+i;z(c,a,e),c.log("%c action","color: #03A9F4; font-weight: bold",r),H(c)}})))}}function z(t,e,n){var i=n?t.groupCollapsed:t.group;try{i.call(t,e)}catch(r){t.log(e)}}function H(t){try{t.groupEnd()}catch(e){t.log("—— log end ——")}}function U(){var t=new Date;return" @ "+q(t.getHours(),2)+":"+q(t.getMinutes(),2)+":"+q(t.getSeconds(),2)+"."+q(t.getMilliseconds(),3)}function W(t,e){return new Array(e+1).join(t)}function q(t,e){return W("0",e-t.toString().length)+t}var G={Store:g,install:I,version:"3.5.1",mapState:M,mapMutations:j,mapGetters:P,mapActions:N,createNamespacedHelpers:V,createLogger:$};e["a"]=G}).call(this,n("c8ba"))},3041:function(t,e,n){var i=n("e1fc"),r=n("0da8"),o=n("76a5"),s=n("d9fc"),a=n("c7a2"),l=n("ae69"),u=n("cb11"),c=n("cbe5"),h=n("87b1"),d=n("d498"),f=n("48a9"),p=n("2b61"),m=n("1687"),v=n("342d"),g=v.createFromString,y=n("6d8b"),b=y.isString,x=y.extend,_=y.defaults,w=y.trim,S=y.each,C=/[\s,]+/;function E(t){if(b(t)){var e=new DOMParser;t=e.parseFromString(t,"text/xml")}9===t.nodeType&&(t=t.firstChild);while("svg"!==t.nodeName.toLowerCase()||1!==t.nodeType)t=t.nextSibling;return t}function T(){this._defs={},this._root=null,this._isDefine=!1,this._isText=!1}T.prototype.parse=function(t,e){e=e||{};var n=E(t);if(!n)throw new Error("Illegal svg");var r=new i;this._root=r;var o=n.getAttribute("viewBox")||"",s=parseFloat(n.getAttribute("width")||e.width),l=parseFloat(n.getAttribute("height")||e.height);isNaN(s)&&(s=null),isNaN(l)&&(l=null),j(n,r,null,!0);var u,c,h=n.firstChild;while(h)this._parseNode(h,r),h=h.nextSibling;if(o){var d=w(o).split(C);d.length>=4&&(u={x:parseFloat(d[0]||0),y:parseFloat(d[1]||0),width:parseFloat(d[2]),height:parseFloat(d[3])})}if(u&&null!=s&&null!=l&&(c=B(u,s,l),!e.ignoreViewBox)){var f=r;r=new i,r.add(f),f.scale=c.scale.slice(),f.position=c.position.slice()}return e.ignoreRootClip||null==s||null==l||r.setClipPath(new a({shape:{x:0,y:0,width:s,height:l}})),{root:r,width:s,height:l,viewBoxRect:u,viewBoxTransform:c}},T.prototype._parseNode=function(t,e){var n,i=t.nodeName.toLowerCase();if("defs"===i?this._isDefine=!0:"text"===i&&(this._isText=!0),this._isDefine){var r=A[i];if(r){var o=r.call(this,t),s=t.getAttribute("id");s&&(this._defs[s]=o)}}else{r=k[i];r&&(n=r.call(this,t,e),e.add(n))}var a=t.firstChild;while(a)1===a.nodeType&&this._parseNode(a,n),3===a.nodeType&&this._isText&&this._parseText(a,n),a=a.nextSibling;"defs"===i?this._isDefine=!1:"text"===i&&(this._isText=!1)},T.prototype._parseText=function(t,e){if(1===t.nodeType){var n=t.getAttribute("dx")||0,i=t.getAttribute("dy")||0;this._textX+=parseFloat(n),this._textY+=parseFloat(i)}var r=new o({style:{text:t.textContent,transformText:!0},position:[this._textX||0,this._textY||0]});O(e,r),j(t,r,this._defs);var s=r.style.fontSize;s&&s<9&&(r.style.fontSize=9,r.scale=r.scale||[1,1],r.scale[0]*=s/9,r.scale[1]*=s/9);var a=r.getBoundingRect();return this._textX+=a.width,e.add(r),r};var k={g:function(t,e){var n=new i;return O(e,n),j(t,n,this._defs),n},rect:function(t,e){var n=new a;return O(e,n),j(t,n,this._defs),n.setShape({x:parseFloat(t.getAttribute("x")||0),y:parseFloat(t.getAttribute("y")||0),width:parseFloat(t.getAttribute("width")||0),height:parseFloat(t.getAttribute("height")||0)}),n},circle:function(t,e){var n=new s;return O(e,n),j(t,n,this._defs),n.setShape({cx:parseFloat(t.getAttribute("cx")||0),cy:parseFloat(t.getAttribute("cy")||0),r:parseFloat(t.getAttribute("r")||0)}),n},line:function(t,e){var n=new u;return O(e,n),j(t,n,this._defs),n.setShape({x1:parseFloat(t.getAttribute("x1")||0),y1:parseFloat(t.getAttribute("y1")||0),x2:parseFloat(t.getAttribute("x2")||0),y2:parseFloat(t.getAttribute("y2")||0)}),n},ellipse:function(t,e){var n=new l;return O(e,n),j(t,n,this._defs),n.setShape({cx:parseFloat(t.getAttribute("cx")||0),cy:parseFloat(t.getAttribute("cy")||0),rx:parseFloat(t.getAttribute("rx")||0),ry:parseFloat(t.getAttribute("ry")||0)}),n},polygon:function(t,e){var n=t.getAttribute("points");n&&(n=I(n));var i=new h({shape:{points:n||[]}});return O(e,i),j(t,i,this._defs),i},polyline:function(t,e){var n=new c;O(e,n),j(t,n,this._defs);var i=t.getAttribute("points");i&&(i=I(i));var r=new d({shape:{points:i||[]}});return r},image:function(t,e){var n=new r;return O(e,n),j(t,n,this._defs),n.setStyle({image:t.getAttribute("xlink:href"),x:t.getAttribute("x"),y:t.getAttribute("y"),width:t.getAttribute("width"),height:t.getAttribute("height")}),n},text:function(t,e){var n=t.getAttribute("x")||0,r=t.getAttribute("y")||0,o=t.getAttribute("dx")||0,s=t.getAttribute("dy")||0;this._textX=parseFloat(n)+parseFloat(o),this._textY=parseFloat(r)+parseFloat(s);var a=new i;return O(e,a),j(t,a,this._defs),a},tspan:function(t,e){var n=t.getAttribute("x"),r=t.getAttribute("y");null!=n&&(this._textX=parseFloat(n)),null!=r&&(this._textY=parseFloat(r));var o=t.getAttribute("dx")||0,s=t.getAttribute("dy")||0,a=new i;return O(e,a),j(t,a,this._defs),this._textX+=o,this._textY+=s,a},path:function(t,e){var n=t.getAttribute("d")||"",i=g(n);return O(e,i),j(t,i,this._defs),i}},A={lineargradient:function(t){var e=parseInt(t.getAttribute("x1")||0,10),n=parseInt(t.getAttribute("y1")||0,10),i=parseInt(t.getAttribute("x2")||10,10),r=parseInt(t.getAttribute("y2")||0,10),o=new f(e,n,i,r);return D(t,o),o},radialgradient:function(t){}};function D(t,e){var n=t.firstChild;while(n){if(1===n.nodeType){var i=n.getAttribute("offset");i=i.indexOf("%")>0?parseInt(i,10)/100:i?parseFloat(i):0;var r=n.getAttribute("stop-color")||"#000000";e.addColorStop(i,r)}n=n.nextSibling}}function O(t,e){t&&t.__inheritedStyle&&(e.__inheritedStyle||(e.__inheritedStyle={}),_(e.__inheritedStyle,t.__inheritedStyle))}function I(t){for(var e=w(t).split(C),n=[],i=0;i0;o-=2){var s=r[o],a=r[o-1];switch(i=i||m.create(),a){case"translate":s=w(s).split(C),m.translate(i,i,[parseFloat(s[0]),parseFloat(s[1]||0)]);break;case"scale":s=w(s).split(C),m.scale(i,i,[parseFloat(s[0]),parseFloat(s[1]||s[0])]);break;case"rotate":s=w(s).split(C),m.rotate(i,i,parseFloat(s[0]));break;case"skew":s=w(s).split(C),console.warn("Skew transform is not supported yet");break;case"matrix":s=w(s).split(C);i[0]=parseFloat(s[0]),i[1]=parseFloat(s[1]),i[2]=parseFloat(s[2]),i[3]=parseFloat(s[3]),i[4]=parseFloat(s[4]),i[5]=parseFloat(s[5]);break}}e.setLocalTransform(i)}}var R=/([^\s:;]+)\s*:\s*([^:;]+)/g;function L(t){var e=t.getAttribute("style"),n={};if(!e)return n;var i,r={};R.lastIndex=0;while(null!=(i=R.exec(e)))r[i[1]]=i[2];for(var o in M)M.hasOwnProperty(o)&&null!=r[o]&&(n[M[o]]=r[o]);return n}function B(t,e,n){var i=e/t.width,r=n/t.height,o=Math.min(i,r),s=[o,o],a=[-(t.x+t.width/2)*o+e/2,-(t.y+t.height/2)*o+n/2];return{scale:s,position:a}}function $(t,e){var n=new T;return n.parse(t,e)}e.parseXML=E,e.makeViewBoxTransform=B,e.parseSVG=$},3044:function(t,e,n){"use strict";var i=n("872a");function r(){return!0}function o(){}function s(){return""}function a(t){return"undefined"===typeof t}t.exports=new i("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:r,construct:o,predicate:a,represent:s})},"30a3":function(t,e,n){var i=n("6d8b"),r=n("607d"),o=r.Dispatcher,s=n("98b7"),a=n("06ad"),l=function(t){t=t||{},this.stage=t.stage||{},this.onframe=t.onframe||function(){},this._clips=[],this._running=!1,this._time,this._pausedTime,this._pauseStart,this._paused=!1,o.call(this)};l.prototype={constructor:l,addClip:function(t){this._clips.push(t)},addAnimator:function(t){t.animation=this;for(var e=t.getClips(),n=0;n=0&&this._clips.splice(e,1)},removeAnimator:function(t){for(var e=t.getClips(),n=0;n1&&(c*=s(x),f*=s(x));var _=(r===o?-1:1)*s((c*c*(f*f)-c*c*(b*b)-f*f*(y*y))/(c*c*(b*b)+f*f*(y*y)))||0,w=_*c*b/f,S=_*-f*y/c,C=(t+n)/2+l(g)*w-a(g)*S,E=(e+i)/2+a(g)*w+l(g)*S,T=d([1,0],[(y-w)/c,(b-S)/f]),k=[(y-w)/c,(b-S)/f],A=[(-1*y-w)/c,(-1*b-S)/f],D=d(k,A);h(k,A)<=-1&&(D=u),h(k,A)>=1&&(D=0),0===o&&D>0&&(D-=2*u),1===o&&D<0&&(D+=2*u),v.addData(m,C,E,c,f,T,D,g,o)}var p=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/gi,m=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function v(t){if(!t)return new r;for(var e,n=0,i=0,o=n,s=i,a=new r,l=r.CMD,u=t.match(p),c=0;c=this.expandDepth)},methods:{toggle:function(){this.expand=!this.expand;try{this.$el.dispatchEvent(new Event("resized"))}catch(t){var e=document.createEvent("Event");e.initEvent("resized",!0,!1),this.$el.dispatchEvent(e)}}},render:function(t){var e=this,n=[],d=void 0;null===this.value||void 0===this.value?d=o.default:Array.isArray(this.value)?d=u.default:"[object Date]"===Object.prototype.toString.call(this.value)?d=h.default:"object"===i(this.value)?d=l.default:"number"==typeof this.value?d=s.default:"string"==typeof this.value?d=r.default:"boolean"==typeof this.value?d=a.default:"function"==typeof this.value&&(d=c.default);var f=this.keyName&&this.value&&(Array.isArray(this.value)||"object"===i(this.value)&&"[object Date]"!==Object.prototype.toString.call(this.value));return!this.previewMode&&f&&n.push(t("span",{class:{"jv-toggle":!0,open:!!this.expand},on:{click:this.toggle}})),this.keyName&&n.push(t("span",{class:{"jv-key":!0},domProps:{innerText:this.keyName+":"}})),n.push(t(d,{class:{"jv-push":!0},props:{jsonValue:this.value,keyName:this.keyName,sort:this.sort,depth:this.depth,expand:this.expand,previewMode:this.previewMode},on:{"update:expand":function(t){e.expand=t}}})),t("div",{class:{"jv-node":!0,toggle:!this.previewMode&&f}},n)}}},function(t,e,n){"use strict";n.r(e);var i,r=n(6),o=n.n(r);for(i in r)"default"!==i&&function(t){n.d(e,t,(function(){return r[t]}))}(i);e.default=o.a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=/^\w+:\/\//;e.default={name:"JsonString",props:{jsonValue:{type:String,required:!0}},data:function(){return{expand:!1,canExtend:!1}},mounted:function(){this.$refs.itemRef.offsetHeight>this.$refs.holderRef.offsetHeight&&(this.canExtend=!0)},methods:{toggle:function(){this.expand=!this.expand}},render:function(t){var e=this.jsonValue,n=i.test(e),r=void 0;return this.expand?r={class:{"jv-ellipsis":!0},on:{click:this.toggle},domProps:{innerText:"..."}}:(r={class:{"jv-item":!0,"jv-string":!0},ref:"itemRef"},n?(e=''+e+"",r.domProps={innerHTML:'"'+e.toString()+'"'}):r.domProps={innerText:'"'+e.toString()+'"'}),t("span",{},[this.canExtend&&t("span",{class:{"jv-toggle":!0,open:this.expand},on:{click:this.toggle}}),t("span",{class:{"jv-holder-node":!0},ref:"holderRef"}),t("span",r)])}}},function(t,e,n){"use strict";n.r(e);var i,r=n(8),o=n.n(r);for(i in r)"default"!==i&&function(t){n.d(e,t,(function(){return r[t]}))}(i);e.default=o.a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={name:"JsonUndefined",functional:!0,props:{jsonValue:{type:Object,default:null}},render:function(t,e){return t("span",{class:{"jv-item":!0,"jv-undefined":!0},domProps:{innerText:null===e.props.jsonValue?"null":"undefined"}})}}},function(t,e,n){"use strict";n.r(e);var i,r=n(10),o=n.n(r);for(i in r)"default"!==i&&function(t){n.d(e,t,(function(){return r[t]}))}(i);e.default=o.a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={name:"JsonNumber",functional:!0,props:{jsonValue:{type:Number,required:!0}},render:function(t,e){var n=e.props;e=Number.isInteger(n.jsonValue);return t("span",{class:{"jv-item":!0,"jv-number":!0,"jv-number-integer":e,"jv-number-float":!e},domProps:{innerText:n.jsonValue.toString()}})}}},function(t,e,n){"use strict";n.r(e);var i,r=n(12),o=n.n(r);for(i in r)"default"!==i&&function(t){n.d(e,t,(function(){return r[t]}))}(i);e.default=o.a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={name:"JsonBoolean",functional:!0,props:{jsonValue:Boolean},render:function(t,e){return t("span",{class:{"jv-item":!0,"jv-boolean":!0},domProps:{innerText:e.props.jsonValue.toString()}})}}},function(t,e,n){"use strict";n.r(e);var i,r=n(14),o=n.n(r);for(i in r)"default"!==i&&function(t){n.d(e,t,(function(){return r[t]}))}(i);e.default=o.a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=n(21),o=(i=r)&&i.__esModule?i:{default:i};e.default={name:"JsonObject",props:{jsonValue:{type:Object,required:!0},keyName:{type:String,default:""},depth:{type:Number,default:0},expand:Boolean,sort:Boolean,previewMode:Boolean},data:function(){return{value:{}}},computed:{ordered:function(){var t=this;if(!this.sort)return this.value;var e={};return Object.keys(this.value).sort().forEach((function(n){e[n]=t.value[n]})),e}},watch:{jsonValue:function(t){this.setValue(t)}},mounted:function(){this.setValue(this.jsonValue)},methods:{setValue:function(t){var e=this;setTimeout((function(){e.value=t}),0)},toggle:function(){this.$emit("update:expand",!this.expand),this.dispatchEvent()},dispatchEvent:function(){try{this.$el.dispatchEvent(new Event("resized"))}catch(t){var e=document.createEvent("Event");e.initEvent("resized",!0,!1),this.$el.dispatchEvent(e)}}},render:function(t){var e,n=[];if(this.previewMode||this.keyName||n.push(t("span",{class:{"jv-toggle":!0,open:!!this.expand},on:{click:this.toggle}})),n.push(t("span",{class:{"jv-item":!0,"jv-object":!0},domProps:{innerText:"{"}})),this.expand)for(var i in this.ordered)this.ordered.hasOwnProperty(i)&&(e=this.ordered[i],n.push(t(o.default,{key:i,style:{display:this.expand?void 0:"none"},props:{sort:this.sort,keyName:i,depth:this.depth+1,value:e,previewMode:this.previewMode}})));return!this.expand&&Object.keys(this.value).length&&n.push(t("span",{style:{display:this.expand?"none":void 0},class:{"jv-ellipsis":!0},on:{click:this.toggle},attrs:{title:"click to reveal object content (keys: "+Object.keys(this.ordered).join(", ")+")"},domProps:{innerText:"..."}})),n.push(t("span",{class:{"jv-item":!0,"jv-object":!0},domProps:{innerText:"}"}})),t("span",n)}}},function(t,e,n){"use strict";n.r(e);var i,r=n(16),o=n.n(r);for(i in r)"default"!==i&&function(t){n.d(e,t,(function(){return r[t]}))}(i);e.default=o.a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=n(21),o=(i=r)&&i.__esModule?i:{default:i};e.default={name:"JsonArray",props:{jsonValue:{type:Array,required:!0},keyName:{type:String,default:""},depth:{type:Number,default:0},sort:Boolean,expand:Boolean,previewMode:Boolean},data:function(){return{value:[]}},watch:{jsonValue:function(t){this.setValue(t)}},mounted:function(){this.setValue(this.jsonValue)},methods:{setValue:function(t,e){var n=this,i=1i&&(n.value.push(t[i]),n.setValue(t,i+1))}),0)},toggle:function(){this.$emit("update:expand",!this.expand);try{this.$el.dispatchEvent(new Event("resized"))}catch(t){var e=document.createEvent("Event");e.initEvent("resized",!0,!1),this.$el.dispatchEvent(e)}}},render:function(t){var e=this,n=[];return this.previewMode||this.keyName||n.push(t("span",{class:{"jv-toggle":!0,open:!!this.expand},on:{click:this.toggle}})),n.push(t("span",{class:{"jv-item":!0,"jv-array":!0},domProps:{innerText:"["}})),this.expand&&this.value.forEach((function(i,r){n.push(t(o.default,{key:r,style:{display:e.expand?void 0:"none"},props:{sort:e.sort,depth:e.depth+1,value:i,previewMode:e.previewMode}}))})),!this.expand&&this.value.length&&n.push(t("span",{style:{display:void 0},class:{"jv-ellipsis":!0},on:{click:this.toggle},attrs:{title:"click to reveal "+this.value.length+" hidden items"},domProps:{innerText:"..."}})),n.push(t("span",{class:{"jv-item":!0,"jv-array":!0},domProps:{innerText:"]"}})),t("span",n)}}},function(t,e,n){"use strict";n.r(e);var i,r=n(18),o=n.n(r);for(i in r)"default"!==i&&function(t){n.d(e,t,(function(){return r[t]}))}(i);e.default=o.a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={name:"JsonFunction",functional:!0,props:{jsonValue:{type:Function,required:!0}},render:function(t,e){return t("span",{class:{"jv-item":!0,"jv-function":!0},attrs:{title:e.props.jsonValue.toString()},domProps:{innerHTML:"<function>"}})}}},function(t,e,n){"use strict";n.r(e);var i,r=n(20),o=n.n(r);for(i in r)"default"!==i&&function(t){n.d(e,t,(function(){return r[t]}))}(i);e.default=o.a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={name:"JsonDate",inject:["timeformat"],functional:!0,props:{jsonValue:{type:Date,required:!0}},render:function(t,e){var n=e.props;e=e.injections,n=n.jsonValue;return t("span",{class:{"jv-item":!0,"jv-string":!0},domProps:{innerText:'"'+(0,e.timeformat)(n)+'"'}})}}},function(t,e,n){"use strict";n.r(e);var i,r=n(3);for(i in r)"default"!==i&&function(t){n.d(e,t,(function(){return r[t]}))}(i);n(38);var o=n(0);o=Object(o.a)(r.default,void 0,void 0,!1,null,null,null);o.options.__file="lib/json-box.vue",e.default=o.exports},function(t,e,n){"use strict";function i(){var t=this,e=t.$createElement;return(e=t._self._c||e)("div",{class:t.jvClass},[t.copyable?e("div",{staticClass:"jv-tooltip"},[e("span",{ref:"clip",staticClass:"jv-button",class:{copied:t.copied}},[t._t("copy",[t._v("\n "+t._s(t.copied?t.copyText.copiedText:t.copyText.copyText)+"\n ")],{copied:t.copied})],2)]):t._e(),t._v(" "),e("div",{staticClass:"jv-code",class:{open:t.expandCode,boxed:t.boxed}},[e("json-box",{ref:"jsonBox",attrs:{value:t.value,sort:t.sort,"preview-mode":t.previewMode}})],1),t._v(" "),t.expandableCode&&t.boxed?e("div",{staticClass:"jv-more",on:{click:t.toggleExpandCode}},[e("span",{staticClass:"jv-toggle",class:{open:!!t.expandCode}})]):t._e()])}var r=[];i._withStripped=!0,n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return r}))},function(t,e,n){var i=n(39);"string"==typeof i&&(i=[[t.i,i,""]]);var r={hmr:!0,transform:void 0};n(25)(i,r),i.locals&&(t.exports=i.locals)},function(t,e,n){"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=function(t,e){var n=t[1]||"",i=t[3];return i?e&&"function"==typeof btoa?(t=function(t){return t=btoa(unescape(encodeURIComponent(JSON.stringify(t)))),t="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(t),"/*# ".concat(t," */")}(i),e=i.sources.map((function(t){return"/*# sourceURL=".concat(i.sourceRoot||"").concat(t," */")})),[n].concat(e).concat([t]).join("\n")):[n].join("\n"):n}(e,t);return e[2]?"@media ".concat(e[2]," {").concat(n,"}"):n})).join("")},e.i=function(t,n,i){"string"==typeof t&&(t=[[null,t,""]]);var r={};if(i)for(var o=0;ol)r.f(t,n=i[l++],e[n]);return t}},3842:function(t,e,n){var i=n("6d8b"),r=1e-4;function o(t){return t.replace(/^\s+|\s+$/g,"")}function s(t,e,n,i){var r=e[1]-e[0],o=n[1]-n[0];if(0===r)return 0===o?n[0]:(n[0]+n[1])/2;if(i)if(r>0){if(t<=e[0])return n[0];if(t>=e[1])return n[1]}else{if(t>=e[0])return n[0];if(t<=e[1])return n[1]}else{if(t===e[0])return n[0];if(t===e[1])return n[1]}return(t-e[0])/r*o+n[0]}function a(t,e){switch(t){case"center":case"middle":t="50%";break;case"left":case"top":t="0%";break;case"right":case"bottom":t="100%";break}return"string"===typeof t?o(t).match(/%$/)?parseFloat(t)/100*e:parseFloat(t):null==t?NaN:+t}function l(t,e,n){return null==e&&(e=10),e=Math.min(Math.max(0,e),20),t=(+t).toFixed(e),n?t:+t}function u(t){return t.sort((function(t,e){return t-e})),t}function c(t){if(t=+t,isNaN(t))return 0;var e=1,n=0;while(Math.round(t*e)/e!==t)e*=10,n++;return n}function h(t){var e=t.toString(),n=e.indexOf("e");if(n>0){var i=+e.slice(n+1);return i<0?-i:0}var r=e.indexOf(".");return r<0?0:e.length-1-r}function d(t,e){var n=Math.log,i=Math.LN10,r=Math.floor(n(t[1]-t[0])/i),o=Math.round(n(Math.abs(e[1]-e[0]))/i),s=Math.min(Math.max(-r+o,0),20);return isFinite(s)?s:20}function f(t,e,n){if(!t[e])return 0;var r=i.reduce(t,(function(t,e){return t+(isNaN(e)?0:e)}),0);if(0===r)return 0;var o=Math.pow(10,n),s=i.map(t,(function(t){return(isNaN(t)?0:t)/r*o*100})),a=100*o,l=i.map(s,(function(t){return Math.floor(t)})),u=i.reduce(l,(function(t,e){return t+e}),0),c=i.map(s,(function(t,e){return t-l[e]}));while(uh&&(h=c[f],d=f);++l[d],c[d]=0,++u}return l[e]/o}var p=9007199254740991;function m(t){var e=2*Math.PI;return(t%e+e)%e}function v(t){return t>-r&&t=10&&e++,e}function _(t,e){var n,i=x(t),r=Math.pow(10,i),o=t/r;return n=e?o<1.5?1:o<2.5?2:o<4?3:o<7?5:10:o<1?1:o<2?2:o<3?3:o<5?5:10,t=n*r,i>=-20?+t.toFixed(i<0?-i:0):t}function w(t,e){var n=(t.length-1)*e+1,i=Math.floor(n),r=+t[i-1],o=n-i;return o?r+o*(t[i]-r):r}function S(t){t.sort((function(t,e){return a(t,e,0)?-1:1}));for(var e=-1/0,n=1,i=0;i=0}e.linearMap=s,e.parsePercent=a,e.round=l,e.asc=u,e.getPrecision=c,e.getPrecisionSafe=h,e.getPixelPrecision=d,e.getPercentWithPrecision=f,e.MAX_SAFE_INTEGER=p,e.remRadian=m,e.isRadianAroundZero=v,e.parseDate=y,e.quantity=b,e.quantityExponent=x,e.nice=_,e.quantile=w,e.reformIntervals=S,e.isNumeric=C},"387f":function(t,e,n){"use strict";t.exports=function(t,e,n,i,r){return t.config=e,n&&(t.code=n),t.request=i,t.response=r,t}},"38a2":function(t,e,n){var i=n("2b17"),r=i.retrieveRawValue,o=n("eda2"),s=o.getTooltipMarker,a=o.formatTpl,l=n("e0d3"),u=l.getTooltipRenderMode,c=/\{@(.+?)\}/g,h={getDataParams:function(t,e){var n=this.getData(e),i=this.getRawValue(t,e),r=n.getRawIndex(t),o=n.getName(t),a=n.getRawDataItem(t),l=n.getItemVisual(t,"color"),c=n.getItemVisual(t,"borderColor"),h=this.ecModel.getComponent("tooltip"),d=h&&h.get("renderMode"),f=u(d),p=this.mainType,m="series"===p,v=n.userOutput;return{componentType:p,componentSubType:this.subType,componentIndex:this.componentIndex,seriesType:m?this.subType:null,seriesIndex:this.seriesIndex,seriesId:m?this.id:null,seriesName:m?this.name:null,name:o,dataIndex:r,data:a,dataType:e,value:i,color:l,borderColor:c,dimensionNames:v?v.dimensionNames:null,encode:v?v.encode:null,marker:s({color:l,renderMode:f}),$vars:["seriesName","name","value"]}},getFormattedLabel:function(t,e,n,i,o){e=e||"normal";var s=this.getData(n),l=s.getItemModel(t),u=this.getDataParams(t,n);null!=i&&u.value instanceof Array&&(u.value=u.value[i]);var h=l.get("normal"===e?[o||"label","formatter"]:[e,o||"label","formatter"]);if("function"===typeof h)return u.status=e,u.dimensionIndex=i,h(u);if("string"===typeof h){var d=a(h,u);return d.replace(c,(function(e,n){var i=n.length;return"["===n.charAt(0)&&"]"===n.charAt(i-1)&&(n=+n.slice(1,i-1)),r(s,t,n)}))}},getRawValue:function(t,e){return r(this.getData(e),t)},formatTooltip:function(){}};t.exports=h},3901:function(t,e,n){var i=n("282b"),r=i([["lineWidth","width"],["stroke","color"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]),o={getLineStyle:function(t){var e=r(this,t);return e.lineDash=this.getLineDash(e.lineWidth),e},getLineDash:function(t){null==t&&(t=1);var e=this.get("type"),n=Math.max(t,2),i=4*t;return"solid"!==e&&null!=e&&("dashed"===e?[i,i]:[n,n])}};t.exports=o},"392f":function(t,e,n){var i=n("6d8b"),r=i.inherits,o=n("19eb"),s=n("9850");function a(t){o.call(this,t),this._displayables=[],this._temporaryDisplayables=[],this._cursor=0,this.notClear=!0}a.prototype.incremental=!0,a.prototype.clearDisplaybles=function(){this._displayables=[],this._temporaryDisplayables=[],this._cursor=0,this.dirty(),this.notClear=!1},a.prototype.addDisplayable=function(t,e){e?this._temporaryDisplayables.push(t):this._displayables.push(t),this.dirty()},a.prototype.addDisplayables=function(t,e){e=e||!1;for(var n=0;n=0&&(e=e.slice(1)),".inf"===e?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===e?NaN:e.indexOf(":")>=0?(e.split(":").forEach((function(t){r.unshift(parseFloat(t,10))})),e=0,i=1,r.forEach((function(t){e+=t*i,i*=60})),n*e):n*parseFloat(e,10)}var l=/^[-+]?[0-9]+e/;function u(t,e){var n;if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(i.isNegativeZero(t))return"-0.0";return n=t.toString(10),l.test(n)?n.replace("e",".e"):n}function c(t){return"[object Number]"===Object.prototype.toString.call(t)&&(t%1!==0||i.isNegativeZero(t))}t.exports=new r("tag:yaml.org,2002:float",{kind:"scalar",resolve:s,construct:a,predicate:c,represent:u,defaultStyle:"lowercase"})},"3eba":function(t,e,n){var i=n("4e08"),r=(i.__DEV__,n("697e7")),o=n("6d8b"),s=n("41ef"),a=n("22d1"),l=n("04f6"),u=n("1fab"),c=n("7e63"),h=n("843e"),d=n("2039"),f=n("ca98"),p=n("fb05"),m=n("d15d"),v=n("6cb7"),g=n("4f85"),y=n("b12f"),b=n("e887"),x=n("2306"),_=n("e0d3"),w=n("88b3"),S=w.throttle,C=n("fd63"),E=n("b809"),T=n("998c"),k=n("69ff"),A=n("c533"),D=n("f219");n("0352");var O=n("ec34"),I=o.assert,M=o.each,j=o.isFunction,P=o.isObject,N=v.parseClassType,V="4.8.0",F={zrender:"4.3.1"},R=1,L=1e3,B=800,$=900,z=5e3,H=1e3,U=1100,W=2e3,q=3e3,G=3500,Y=4e3,X=5e3,J={PROCESSOR:{FILTER:L,SERIES_FILTER:B,STATISTIC:z},VISUAL:{LAYOUT:H,PROGRESSIVE_LAYOUT:U,GLOBAL:W,CHART:q,POST_CHART_LAYOUT:G,COMPONENT:Y,BRUSH:X}},K="__flagInMainProcess",Z="__optionUpdated",Q=/^[a-zA-Z0-9_]+$/;function tt(t,e){return function(n,i,r){e||!this._disposed?(n=n&&n.toLowerCase(),u.prototype[t].call(this,n,i,r)):xt(this.id)}}function et(){u.call(this)}function nt(t,e,n){n=n||{},"string"===typeof e&&(e=Mt[e]),this.id,this.group,this._dom=t;var i="canvas",s=this._zr=r.init(t,{renderer:n.renderer||i,devicePixelRatio:n.devicePixelRatio,width:n.width,height:n.height});this._throttledZrFlush=S(o.bind(s.flush,s),17);e=o.clone(e);e&&p(e,!0),this._theme=e,this._chartsViews=[],this._chartsMap={},this._componentsViews=[],this._componentsMap={},this._coordSysMgr=new d;var a=this._api=Ct(this);function c(t,e){return t.__prio-e.__prio}l(It,c),l(At,c),this._scheduler=new k(this,a,At,It),u.call(this,this._ecEventProcessor=new Et),this._messageCenter=new et,this._initEvents(),this.resize=o.bind(this.resize,this),this._pendingActions=[],s.animation.on("frame",this._onframe,this),dt(s,this),o.setAsPrimitive(this)}et.prototype.on=tt("on",!0),et.prototype.off=tt("off",!0),et.prototype.one=tt("one",!0),o.mixin(et,u);var it=nt.prototype;function rt(t,e,n){if(this._disposed)xt(this.id);else{var i,r=this._model,o=this._coordSysMgr.getCoordinateSystems();e=_.parseFinder(r,e);for(var s=0;s0&&t.unfinished);t.unfinished||this._zr.flush()}}},it.getDom=function(){return this._dom},it.getZr=function(){return this._zr},it.setOption=function(t,e,n){if(this._disposed)xt(this.id);else{var i;if(P(e)&&(n=e.lazyUpdate,i=e.silent,e=e.notMerge),this[K]=!0,!this._model||e){var r=new f(this._api),o=this._theme,s=this._model=new c;s.scheduler=this._scheduler,s.init(null,null,o,r)}this._model.setOption(t,Dt),n?(this[Z]={silent:i},this[K]=!1):(st(this),ot.update.call(this),this._zr.flush(),this[Z]=!1,this[K]=!1,ct.call(this,i),ht.call(this,i))}},it.setTheme=function(){console.error("ECharts#setTheme() is DEPRECATED in ECharts 3.0")},it.getModel=function(){return this._model},it.getOption=function(){return this._model&&this._model.getOption()},it.getWidth=function(){return this._zr.getWidth()},it.getHeight=function(){return this._zr.getHeight()},it.getDevicePixelRatio=function(){return this._zr.painter.dpr||window.devicePixelRatio||1},it.getRenderedCanvas=function(t){if(a.canvasSupported){t=t||{},t.pixelRatio=t.pixelRatio||1,t.backgroundColor=t.backgroundColor||this._model.get("backgroundColor");var e=this._zr;return e.painter.getRenderedCanvas(t)}},it.getSvgDataURL=function(){if(a.svgSupported){var t=this._zr,e=t.storage.getDisplayList();return o.each(e,(function(t){t.stopAnimation(!0)})),t.painter.toDataURL()}},it.getDataURL=function(t){if(!this._disposed){t=t||{};var e=t.excludeComponents,n=this._model,i=[],r=this;M(e,(function(t){n.eachComponent({mainType:t},(function(t){var e=r._componentsMap[t.__viewId];e.group.ignore||(i.push(e),e.group.ignore=!0)}))}));var o="svg"===this._zr.painter.getType()?this.getSvgDataURL():this.getRenderedCanvas(t).toDataURL("image/"+(t&&t.type||"png"));return M(i,(function(t){t.group.ignore=!1})),o}xt(this.id)},it.getConnectedDataURL=function(t){if(this._disposed)xt(this.id);else if(a.canvasSupported){var e="svg"===t.type,n=this.group,i=Math.min,s=Math.max,l=1/0;if(Nt[n]){var u=l,c=l,h=-l,d=-l,f=[],p=t&&t.pixelRatio||1;o.each(Pt,(function(r,a){if(r.group===n){var l=e?r.getZr().painter.getSvgDom().innerHTML:r.getRenderedCanvas(o.clone(t)),p=r.getDom().getBoundingClientRect();u=i(p.left,u),c=i(p.top,c),h=s(p.right,h),d=s(p.bottom,d),f.push({dom:l,left:p.left,top:p.top})}})),u*=p,c*=p,h*=p,d*=p;var m=h-u,v=d-c,g=o.createCanvas(),y=r.init(g,{renderer:e?"svg":"canvas"});if(y.resize({width:m,height:v}),e){var b="";return M(f,(function(t){var e=t.left-u,n=t.top-c;b+=''+t.dom+""})),y.painter.getSvgRoot().innerHTML=b,t.connectedBackgroundColor&&y.painter.setBackgroundColor(t.connectedBackgroundColor),y.refreshImmediately(),y.painter.toDataURL()}return t.connectedBackgroundColor&&y.add(new x.Rect({shape:{x:0,y:0,width:m,height:v},style:{fill:t.connectedBackgroundColor}})),M(f,(function(t){var e=new x.Image({style:{x:t.left*p-u,y:t.top*p-c,image:t.dom}});y.add(e)})),y.refreshImmediately(),g.toDataURL("image/"+(t&&t.type||"png"))}return this.getDataURL(t)}},it.convertToPixel=o.curry(rt,"convertToPixel"),it.convertFromPixel=o.curry(rt,"convertFromPixel"),it.containPixel=function(t,e){if(!this._disposed){var n,i=this._model;return t=_.parseFinder(i,t),o.each(t,(function(t,i){i.indexOf("Models")>=0&&o.each(t,(function(t){var r=t.coordinateSystem;if(r&&r.containPoint)n|=!!r.containPoint(e);else if("seriesModels"===i){var o=this._chartsMap[t.__viewId];o&&o.containPoint&&(n|=o.containPoint(e,t))}}),this)}),this),!!n}xt(this.id)},it.getVisual=function(t,e){var n=this._model;t=_.parseFinder(n,t,{defaultMainType:"series"});var i=t.seriesModel,r=i.getData(),o=t.hasOwnProperty("dataIndexInside")?t.dataIndexInside:t.hasOwnProperty("dataIndex")?r.indexOfRawIndex(t.dataIndex):null;return null!=o?r.getItemVisual(o,e):r.getVisual(e)},it.getViewOfComponentModel=function(t){return this._componentsMap[t.__viewId]},it.getViewOfSeriesModel=function(t){return this._chartsMap[t.__viewId]};var ot={prepareAndUpdate:function(t){st(this),ot.update.call(this,t)},update:function(t){var e=this._model,n=this._api,i=this._zr,r=this._coordSysMgr,o=this._scheduler;if(e){o.restoreData(e,t),o.performSeriesTasks(e),r.create(e,n),o.performDataProcessorTasks(e,t),lt(this,e),r.update(e,n),pt(e),o.performVisualTasks(e,t),mt(this,e,n,t);var l=e.get("backgroundColor")||"transparent";if(a.canvasSupported)i.setBackgroundColor(l);else{var u=s.parse(l);l=s.stringify(u,"rgb"),0===u[3]&&(l="transparent")}yt(e,n)}},updateTransform:function(t){var e=this._model,n=this,i=this._api;if(e){var r=[];e.eachComponent((function(o,s){var a=n.getViewOfComponentModel(s);if(a&&a.__alive)if(a.updateTransform){var l=a.updateTransform(s,e,i,t);l&&l.update&&r.push(a)}else r.push(a)}));var s=o.createHashMap();e.eachSeries((function(r){var o=n._chartsMap[r.__viewId];if(o.updateTransform){var a=o.updateTransform(r,e,i,t);a&&a.update&&s.set(r.uid,1)}else s.set(r.uid,1)})),pt(e),this._scheduler.performVisualTasks(e,t,{setDirty:!0,dirtyMap:s}),gt(n,e,i,t,s),yt(e,this._api)}},updateView:function(t){var e=this._model;e&&(b.markUpdateMethod(t,"updateView"),pt(e),this._scheduler.performVisualTasks(e,t,{setDirty:!0}),mt(this,this._model,this._api,t),yt(e,this._api))},updateVisual:function(t){ot.update.call(this,t)},updateLayout:function(t){ot.update.call(this,t)}};function st(t){var e=t._model,n=t._scheduler;n.restorePipelines(e),n.prepareStageTasks(),ft(t,"component",e,n),ft(t,"chart",e,n),n.plan()}function at(t,e,n,i,r){var s=t._model;if(i){var a={};a[i+"Id"]=n[i+"Id"],a[i+"Index"]=n[i+"Index"],a[i+"Name"]=n[i+"Name"];var l={mainType:i,query:a};r&&(l.subType=r);var u=n.excludeSeriesId;null!=u&&(u=o.createHashMap(_.normalizeToArray(u))),s&&s.eachComponent(l,(function(e){u&&null!=u.get(e.id)||c(t["series"===i?"_chartsMap":"_componentsMap"][e.__viewId])}),t)}else M(t._componentsViews.concat(t._chartsViews),c);function c(i){i&&i.__alive&&i[e]&&i[e](i.__model,s,t._api,n)}}function lt(t,e){var n=t._chartsMap,i=t._scheduler;e.eachSeries((function(t){i.updateStreamModes(t,n[t.__viewId])}))}function ut(t,e){var n=t.type,i=t.escapeConnect,r=Tt[n],s=r.actionInfo,a=(s.update||"update").split(":"),l=a.pop();a=null!=a[0]&&N(a[0]),this[K]=!0;var u=[t],c=!1;t.batch&&(c=!0,u=o.map(t.batch,(function(e){return e=o.defaults(o.extend({},e),t),e.batch=null,e})));var h,d=[],f="highlight"===n||"downplay"===n;M(u,(function(t){h=r.action(t,this._model,this._api),h=h||o.extend({},t),h.type=s.event||h.type,d.push(h),f?at(this,l,t,"series"):a&&at(this,l,t,a.main,a.sub)}),this),"none"===l||f||a||(this[Z]?(st(this),ot.update.call(this,t),this[Z]=!1):ot[l].call(this,t)),h=c?{type:s.event||n,escapeConnect:i,batch:d}:d[0],this[K]=!1,!e&&this._messageCenter.trigger(h.type,h)}function ct(t){var e=this._pendingActions;while(e.length){var n=e.shift();ut.call(this,n,t)}}function ht(t){!t&&this.trigger("updated")}function dt(t,e){t.on("rendered",(function(){e.trigger("rendered"),!t.animation.isFinished()||e[Z]||e._scheduler.unfinished||e._pendingActions.length||e.trigger("finished")}))}function ft(t,e,n,i){for(var r="component"===e,o=r?t._componentsViews:t._chartsViews,s=r?t._componentsMap:t._chartsMap,a=t._zr,l=t._api,u=0;ue.get("hoverLayerThreshold")&&!a.node&&e.eachSeries((function(e){if(!e.preventUsingHoverLayer){var n=t._chartsMap[e.__viewId];n.__alive&&n.group.traverse((function(t){t.useHoverLayer=!0}))}}))}function wt(t,e){var n=t.get("blendMode")||null;e.group.traverse((function(t){t.isGroup||t.style.blend!==n&&t.setStyle("blend",n),t.eachPendingDisplayable&&t.eachPendingDisplayable((function(t){t.setStyle("blend",n)}))}))}function St(t,e){var n=t.get("z"),i=t.get("zlevel");e.group.traverse((function(t){"group"!==t.type&&(null!=n&&(t.z=n),null!=i&&(t.zlevel=i))}))}function Ct(t){var e=t._coordSysMgr;return o.extend(new h(t),{getCoordinateSystems:o.bind(e.getCoordinateSystems,e),getComponentByElement:function(e){while(e){var n=e.__ecComponentInfo;if(null!=n)return t._model.getComponent(n.mainType,n.index);e=e.parent}}})}function Et(){this.eventInfo}it._initEvents=function(){M(bt,(function(t){var e=function(e){var n,i=this.getModel(),r=e.target,s="globalout"===t;if(s)n={};else if(r&&null!=r.dataIndex){var a=r.dataModel||i.getSeriesByIndex(r.seriesIndex);n=a&&a.getDataParams(r.dataIndex,r.dataType,r)||{}}else r&&r.eventData&&(n=o.extend({},r.eventData));if(n){var l=n.componentType,u=n.componentIndex;"markLine"!==l&&"markPoint"!==l&&"markArea"!==l||(l="series",u=n.seriesIndex);var c=l&&null!=u&&i.getComponent(l,u),h=c&&this["series"===c.mainType?"_chartsMap":"_componentsMap"][c.__viewId];n.event=e,n.type=t,this._ecEventProcessor.eventInfo={targetEl:r,packedEvent:n,model:c,view:h},this.trigger(t,n)}};e.zrEventfulCallAtLast=!0,this._zr.on(t,e,this)}),this),M(kt,(function(t,e){this._messageCenter.on(e,(function(t){this.trigger(e,t)}),this)}),this)},it.isDisposed=function(){return this._disposed},it.clear=function(){this._disposed?xt(this.id):this.setOption({series:[]},!0)},it.dispose=function(){if(this._disposed)xt(this.id);else{this._disposed=!0,_.setAttribute(this.getDom(),Rt,"");var t=this._api,e=this._model;M(this._componentsViews,(function(n){n.dispose(e,t)})),M(this._chartsViews,(function(n){n.dispose(e,t)})),this._zr.dispose(),delete Pt[this.id]}},o.mixin(nt,u),Et.prototype={constructor:Et,normalizeQuery:function(t){var e={},n={},i={};if(o.isString(t)){var r=N(t);e.mainType=r.main||null,e.subType=r.sub||null}else{var s=["Index","Name","Id"],a={name:1,dataIndex:1,dataType:1};o.each(t,(function(t,r){for(var o=!1,l=0;l0&&c===r.length-u.length){var h=r.slice(0,c);"data"!==h&&(e.mainType=h,e[u.toLowerCase()]=t,o=!0)}}a.hasOwnProperty(r)&&(n[r]=t,o=!0),o||(i[r]=t)}))}return{cptQuery:e,dataQuery:n,otherQuery:i}},filter:function(t,e,n){var i=this.eventInfo;if(!i)return!0;var r=i.targetEl,o=i.packedEvent,s=i.model,a=i.view;if(!s||!a)return!0;var l=e.cptQuery,u=e.dataQuery;return c(l,s,"mainType")&&c(l,s,"subType")&&c(l,s,"index","componentIndex")&&c(l,s,"name")&&c(l,s,"id")&&c(u,o,"name")&&c(u,o,"dataIndex")&&c(u,o,"dataType")&&(!a.filterForExposedEvent||a.filterForExposedEvent(t,e.otherQuery,r,o));function c(t,e,n,i){return null==t[n]||e[i||n]===t[n]}},afterTrigger:function(){this.eventInfo=null}};var Tt={},kt={},At=[],Dt=[],Ot=[],It=[],Mt={},jt={},Pt={},Nt={},Vt=new Date-0,Ft=new Date-0,Rt="_echarts_instance_";function Lt(t){var e=0,n=1,i=2,r="__connectUpdateStatus";function o(t,e){for(var n=0;n255?255:t}function s(t){return t=Math.round(t),t<0?0:t>360?360:t}function a(t){return t<0?0:t>1?1:t}function l(t){return t.length&&"%"===t.charAt(t.length-1)?o(parseFloat(t)/100*255):o(parseInt(t,10))}function u(t){return t.length&&"%"===t.charAt(t.length-1)?a(parseFloat(t)/100):a(parseFloat(t))}function c(t,e,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?t+(e-t)*n*6:2*n<1?e:3*n<2?t+(e-t)*(2/3-n)*6:t}function h(t,e,n){return t+(e-t)*n}function d(t,e,n,i,r){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t}function f(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}var p=new i(20),m=null;function v(t,e){m&&f(m,e),m=p.put(t,m||e.slice())}function g(t,e){if(t){e=e||[];var n=p.get(t);if(n)return f(e,n);t+="";var i=t.replace(/ /g,"").toLowerCase();if(i in r)return f(e,r[i]),v(t,e),e;if("#"!==i.charAt(0)){var o=i.indexOf("("),s=i.indexOf(")");if(-1!==o&&s+1===i.length){var a=i.substr(0,o),c=i.substr(o+1,s-(o+1)).split(","),h=1;switch(a){case"rgba":if(4!==c.length)return void d(e,0,0,0,1);h=u(c.pop());case"rgb":return 3!==c.length?void d(e,0,0,0,1):(d(e,l(c[0]),l(c[1]),l(c[2]),h),v(t,e),e);case"hsla":return 4!==c.length?void d(e,0,0,0,1):(c[3]=u(c[3]),y(c,e),v(t,e),e);case"hsl":return 3!==c.length?void d(e,0,0,0,1):(y(c,e),v(t,e),e);default:return}}d(e,0,0,0,1)}else{if(4===i.length){var m=parseInt(i.substr(1),16);return m>=0&&m<=4095?(d(e,(3840&m)>>4|(3840&m)>>8,240&m|(240&m)>>4,15&m|(15&m)<<4,1),v(t,e),e):void d(e,0,0,0,1)}if(7===i.length){m=parseInt(i.substr(1),16);return m>=0&&m<=16777215?(d(e,(16711680&m)>>16,(65280&m)>>8,255&m,1),v(t,e),e):void d(e,0,0,0,1)}}}}function y(t,e){var n=(parseFloat(t[0])%360+360)%360/360,i=u(t[1]),r=u(t[2]),s=r<=.5?r*(i+1):r+i-r*i,a=2*r-s;return e=e||[],d(e,o(255*c(a,s,n+1/3)),o(255*c(a,s,n)),o(255*c(a,s,n-1/3)),1),4===t.length&&(e[3]=t[3]),e}function b(t){if(t){var e,n,i=t[0]/255,r=t[1]/255,o=t[2]/255,s=Math.min(i,r,o),a=Math.max(i,r,o),l=a-s,u=(a+s)/2;if(0===l)e=0,n=0;else{n=u<.5?l/(a+s):l/(2-a-s);var c=((a-i)/6+l/2)/l,h=((a-r)/6+l/2)/l,d=((a-o)/6+l/2)/l;i===a?e=d-h:r===a?e=1/3+c-d:o===a&&(e=2/3+h-c),e<0&&(e+=1),e>1&&(e-=1)}var f=[360*e,n,u];return null!=t[3]&&f.push(t[3]),f}}function x(t,e){var n=g(t);if(n){for(var i=0;i<3;i++)n[i]=e<0?n[i]*(1-e)|0:(255-n[i])*e+n[i]|0,n[i]>255?n[i]=255:t[i]<0&&(n[i]=0);return A(n,4===n.length?"rgba":"rgb")}}function _(t){var e=g(t);if(e)return((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1)}function w(t,e,n){if(e&&e.length&&t>=0&&t<=1){n=n||[];var i=t*(e.length-1),r=Math.floor(i),s=Math.ceil(i),l=e[r],u=e[s],c=i-r;return n[0]=o(h(l[0],u[0],c)),n[1]=o(h(l[1],u[1],c)),n[2]=o(h(l[2],u[2],c)),n[3]=a(h(l[3],u[3],c)),n}}var S=w;function C(t,e,n){if(e&&e.length&&t>=0&&t<=1){var i=t*(e.length-1),r=Math.floor(i),s=Math.ceil(i),l=g(e[r]),u=g(e[s]),c=i-r,d=A([o(h(l[0],u[0],c)),o(h(l[1],u[1],c)),o(h(l[2],u[2],c)),a(h(l[3],u[3],c))],"rgba");return n?{color:d,leftIndex:r,rightIndex:s,value:i}:d}}var E=C;function T(t,e,n,i){if(t=g(t),t)return t=b(t),null!=e&&(t[0]=s(e)),null!=n&&(t[1]=u(n)),null!=i&&(t[2]=u(i)),A(y(t),"rgba")}function k(t,e){if(t=g(t),t&&null!=e)return t[3]=a(e),A(t,"rgba")}function A(t,e){if(t&&t.length){var n=t[0]+","+t[1]+","+t[2];return"rgba"!==e&&"hsva"!==e&&"hsla"!==e||(n+=","+t[3]),e+"("+n+")"}}e.parse=g,e.lift=x,e.toHex=_,e.fastLerp=w,e.fastMapToColor=S,e.lerp=C,e.mapToColor=E,e.modifyHSL=T,e.modifyAlpha=k,e.stringify=A},4245:function(t,e,n){var i=n("1290");function r(t,e){var n=t.__data__;return i(e)?n["string"==typeof e?"string":"hash"]:n.map}t.exports=r},"428f":function(t,e,n){var i=n("da84");t.exports=i},"42e5":function(t,e){var n=function(t){this.colorStops=t||[]};n.prototype={constructor:n,addColorStop:function(t,e){this.colorStops.push({offset:t,color:e})}};var i=n;t.exports=i},"42f6":function(t,e,n){var i=n("3eba"),r=n("6d8b"),o=n("22d1"),s=n("07d7"),a=n("82f9"),l=n("eda2"),u=n("3842"),c=n("2306"),h=n("133d"),d=n("f934"),f=n("4319"),p=n("17d6"),m=n("697e"),v=n("ff2e"),g=n("e0d3"),y=g.getTooltipRenderMode,b=r.bind,x=r.each,_=u.parsePercent,w=new c.Rect({shape:{x:-1,y:-1,width:2,height:2}}),S=i.extendComponentView({type:"tooltip",init:function(t,e){if(!o.node){var n,i=t.getComponent("tooltip"),r=i.get("renderMode");this._renderMode=y(r),"html"===this._renderMode?(n=new s(e.getDom(),e,{appendToBody:i.get("appendToBody",!0)}),this._newLine="
"):(n=new a(e),this._newLine="\n"),this._tooltipContent=n}},render:function(t,e,n){if(!o.node){this.group.removeAll(),this._tooltipModel=t,this._ecModel=e,this._api=n,this._lastDataByCoordSys=null,this._alwaysShowContent=t.get("alwaysShowContent");var i=this._tooltipContent;i.update(),i.setEnterable(t.get("enterable")),this._initGlobalListener(),this._keepShow()}},_initGlobalListener:function(){var t=this._tooltipModel,e=t.get("triggerOn");p.register("itemTooltip",this._api,b((function(t,n,i){"none"!==e&&(e.indexOf(t)>=0?this._tryShow(n,i):"leave"===t&&this._hide(i))}),this))},_keepShow:function(){var t=this._tooltipModel,e=this._ecModel,n=this._api;if(null!=this._lastX&&null!=this._lastY&&"none"!==t.get("triggerOn")){var i=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout((function(){!n.isDisposed()&&i.manuallyShowTip(t,e,n,{x:i._lastX,y:i._lastY})}))}},manuallyShowTip:function(t,e,n,i){if(i.from!==this.uid&&!o.node){var r=E(i,n);this._ticket="";var s=i.dataByCoordSys;if(i.tooltip&&null!=i.x&&null!=i.y){var a=w;a.position=[i.x,i.y],a.update(),a.tooltip=i.tooltip,this._tryShow({offsetX:i.x,offsetY:i.y,target:a},r)}else if(s)this._tryShow({offsetX:i.x,offsetY:i.y,position:i.position,dataByCoordSys:i.dataByCoordSys,tooltipOption:i.tooltipOption},r);else if(null!=i.seriesIndex){if(this._manuallyAxisShowTip(t,e,n,i))return;var l=h(i,e),u=l.point[0],c=l.point[1];null!=u&&null!=c&&this._tryShow({offsetX:u,offsetY:c,position:i.position,target:l.el},r)}else null!=i.x&&null!=i.y&&(n.dispatchAction({type:"updateAxisPointer",x:i.x,y:i.y}),this._tryShow({offsetX:i.x,offsetY:i.y,position:i.position,target:n.getZr().findHover(i.x,i.y).target},r))}},manuallyHideTip:function(t,e,n,i){var r=this._tooltipContent;!this._alwaysShowContent&&this._tooltipModel&&r.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=null,i.from!==this.uid&&this._hide(E(i,n))},_manuallyAxisShowTip:function(t,e,n,i){var r=i.seriesIndex,o=i.dataIndex,s=e.getComponent("axisPointer").coordSysAxesInfo;if(null!=r&&null!=o&&null!=s){var a=e.getSeriesByIndex(r);if(a){var l=a.getData();t=C([l.getItemModel(o),a,(a.coordinateSystem||{}).model,t]);if("axis"===t.get("trigger"))return n.dispatchAction({type:"updateAxisPointer",seriesIndex:r,dataIndex:o,position:i.position}),!0}}},_tryShow:function(t,e){var n=t.target,i=this._tooltipModel;if(i){this._lastX=t.offsetX,this._lastY=t.offsetY;var r=t.dataByCoordSys;r&&r.length?this._showAxisTooltip(r,t):n&&null!=n.dataIndex?(this._lastDataByCoordSys=null,this._showSeriesItemTooltip(t,n,e)):n&&n.tooltip?(this._lastDataByCoordSys=null,this._showComponentItemTooltip(t,n,e)):(this._lastDataByCoordSys=null,this._hide(e))}},_showOrMove:function(t,e){var n=t.get("showDelay");e=r.bind(e,this),clearTimeout(this._showTimout),n>0?this._showTimout=setTimeout(e,n):e()},_showAxisTooltip:function(t,e){var n=this._ecModel,i=this._tooltipModel,o=[e.offsetX,e.offsetY],s=[],a=[],u=C([e.tooltipOption,i]),c=this._renderMode,h=this._newLine,d={};x(t,(function(t){x(t.dataByAxis,(function(t){var e=n.getComponent(t.axisDim+"Axis",t.axisIndex),i=t.value,o=[];if(e&&null!=i){var u=v.getValueLabel(i,e.axis,n,t.seriesDataIndices,t.valueLabelOpt);r.each(t.seriesDataIndices,(function(s){var l=n.getSeriesByIndex(s.seriesIndex),h=s.dataIndexInside,f=l&&l.getDataParams(h);if(f.axisDim=t.axisDim,f.axisIndex=t.axisIndex,f.axisType=t.axisType,f.axisId=t.axisId,f.axisValue=m.getAxisRawValue(e.axis,i),f.axisValueLabel=u,f){a.push(f);var p,v=l.formatTooltip(h,!0,null,c);if(r.isObject(v)){p=v.html;var g=v.markers;r.merge(d,g)}else p=v;o.push(p)}}));var f=u;"html"!==c?s.push(o.join(h)):s.push((f?l.encodeHTML(f)+h:"")+o.join(h))}}))}),this),s.reverse(),s=s.join(this._newLine+this._newLine);var f=e.position;this._showOrMove(u,(function(){this._updateContentNotChangedOnAxis(t)?this._updatePosition(u,f,o[0],o[1],this._tooltipContent,a):this._showTooltipContent(u,s,a,Math.random(),o[0],o[1],f,void 0,d)}))},_showSeriesItemTooltip:function(t,e,n){var i=this._ecModel,o=e.seriesIndex,s=i.getSeriesByIndex(o),a=e.dataModel||s,l=e.dataIndex,u=e.dataType,c=a.getData(u),h=C([c.getItemModel(l),a,s&&(s.coordinateSystem||{}).model,this._tooltipModel]),d=h.get("trigger");if(null==d||"item"===d){var f,p,m=a.getDataParams(l,u),v=a.formatTooltip(l,!1,u,this._renderMode);r.isObject(v)?(f=v.html,p=v.markers):(f=v,p=null);var g="item_"+a.name+"_"+l;this._showOrMove(h,(function(){this._showTooltipContent(h,f,m,g,t.offsetX,t.offsetY,t.position,t.target,p)})),n({type:"showTip",dataIndexInside:l,dataIndex:c.getRawIndex(l),seriesIndex:o,from:this.uid})}},_showComponentItemTooltip:function(t,e,n){var i=e.tooltip;if("string"===typeof i){var r=i;i={content:r,formatter:r}}var o=new f(i,this._tooltipModel,this._ecModel),s=o.get("content"),a=Math.random();this._showOrMove(o,(function(){this._showTooltipContent(o,s,o.get("formatterParams")||{},a,t.offsetX,t.offsetY,t.position,e)})),n({type:"showTip",from:this.uid})},_showTooltipContent:function(t,e,n,i,r,o,s,a,u){if(this._ticket="",t.get("showContent")&&t.get("show")){var c=this._tooltipContent,h=t.get("formatter");s=s||t.get("position");var d=e;if(h&&"string"===typeof h)d=l.formatTpl(h,n,!0);else if("function"===typeof h){var f=b((function(e,i){e===this._ticket&&(c.setContent(i,u,t),this._updatePosition(t,s,r,o,c,n,a))}),this);this._ticket=i,d=h(n,i,f)}c.setContent(d,u,t),c.show(t),this._updatePosition(t,s,r,o,c,n,a)}},_updatePosition:function(t,e,n,i,o,s,a){var l=this._api.getWidth(),u=this._api.getHeight();e=e||t.get("position");var c=o.getSize(),h=t.get("align"),f=t.get("verticalAlign"),p=a&&a.getBoundingRect().clone();if(a&&p.applyTransform(a.transform),"function"===typeof e&&(e=e([n,i],s,o.el,p,{viewSize:[l,u],contentSize:c.slice()})),r.isArray(e))n=_(e[0],l),i=_(e[1],u);else if(r.isObject(e)){e.width=c[0],e.height=c[1];var m=d.getLayoutRect(e,{width:l,height:u});n=m.x,i=m.y,h=null,f=null}else if("string"===typeof e&&a){var v=A(e,p,c);n=v[0],i=v[1]}else{v=T(n,i,o,l,u,h?null:20,f?null:20);n=v[0],i=v[1]}if(h&&(n-=D(h)?c[0]/2:"right"===h?c[0]:0),f&&(i-=D(f)?c[1]/2:"bottom"===f?c[1]:0),t.get("confine")){v=k(n,i,o,l,u);n=v[0],i=v[1]}o.moveTo(n,i)},_updateContentNotChangedOnAxis:function(t){var e=this._lastDataByCoordSys,n=!!e&&e.length===t.length;return n&&x(e,(function(e,i){var r=e.dataByAxis||{},o=t[i]||{},s=o.dataByAxis||[];n&=r.length===s.length,n&&x(r,(function(t,e){var i=s[e]||{},r=t.seriesDataIndices||[],o=i.seriesDataIndices||[];n&=t.value===i.value&&t.axisType===i.axisType&&t.axisId===i.axisId&&r.length===o.length,n&&x(r,(function(t,e){var i=o[e];n&=t.seriesIndex===i.seriesIndex&&t.dataIndex===i.dataIndex}))}))})),this._lastDataByCoordSys=t,!!n},_hide:function(t){this._lastDataByCoordSys=null,t({type:"hideTip",from:this.uid})},dispose:function(t,e){o.node||(this._tooltipContent.dispose(),p.unregister("itemTooltip",e))}});function C(t){var e=t.pop();while(t.length){var n=t.pop();n&&(f.isInstance(n)&&(n=n.get("tooltip",!0)),"string"===typeof n&&(n={formatter:n}),e=new f(n,e,e.ecModel))}return e}function E(t,e){return t.dispatchAction||r.bind(e.dispatchAction,e)}function T(t,e,n,i,r,o,s){var a=n.getOuterSize(),l=a.width,u=a.height;return null!=o&&(t+l+o>i?t-=l+o:t+=o),null!=s&&(e+u+s>r?e-=u+s:e+=s),[t,e]}function k(t,e,n,i,r){var o=n.getOuterSize(),s=o.width,a=o.height;return t=Math.min(t+s,i)-s,e=Math.min(e+a,r)-a,t=Math.max(t,0),e=Math.max(e,0),[t,e]}function A(t,e,n){var i=n[0],r=n[1],o=5,s=0,a=0,l=e.width,u=e.height;switch(t){case"inside":s=e.x+l/2-i/2,a=e.y+u/2-r/2;break;case"top":s=e.x+l/2-i/2,a=e.y-r-o;break;case"bottom":s=e.x+l/2-i/2,a=e.y+u+o;break;case"left":s=e.x-i-o,a=e.y+u/2-r/2;break;case"right":s=e.x+l+o,a=e.y+u/2-r/2}return[s,a]}function D(t){return"center"===t||"middle"===t}t.exports=S},4319:function(t,e,n){var i=n("6d8b"),r=n("22d1"),o=n("e0d3"),s=o.makeInner,a=n("625e"),l=a.enableClassExtend,u=a.enableClassCheck,c=n("3901"),h=n("9bdb"),d=n("fe21"),f=n("551f"),p=i.mixin,m=s();function v(t,e,n){this.parentModel=e,this.ecModel=n,this.option=t}function g(t,e,n){for(var i=0;i-l&&tl||t<-l}function g(t,e,n,i,r){var o=1-r;return o*o*(o*t+3*r*e)+r*r*(r*i+3*o*n)}function y(t,e,n,i,r){var o=1-r;return 3*(((e-t)*o+2*(n-e)*r)*o+(i-n)*r*r)}function b(t,e,n,i,r,o){var l=i+3*(e-n)-t,u=3*(n-2*e+t),d=3*(e-t),f=t-r,p=u*u-3*l*d,v=u*d-9*l*f,g=d*d-3*u*f,y=0;if(m(p)&&m(v))if(m(u))o[0]=0;else{var b=-d/u;b>=0&&b<=1&&(o[y++]=b)}else{var x=v*v-4*p*g;if(m(x)){var _=v/p,w=(b=-u/l+_,-_/2);b>=0&&b<=1&&(o[y++]=b),w>=0&&w<=1&&(o[y++]=w)}else if(x>0){var S=a(x),C=p*u+1.5*l*(-v+S),E=p*u+1.5*l*(-v-S);C=C<0?-s(-C,h):s(C,h),E=E<0?-s(-E,h):s(E,h);b=(-u-(C+E))/(3*l);b>=0&&b<=1&&(o[y++]=b)}else{var T=(2*p*u-3*l*v)/(2*a(p*p*p)),k=Math.acos(T)/3,A=a(p),D=Math.cos(k),O=(b=(-u-2*A*D)/(3*l),w=(-u+A*(D+c*Math.sin(k)))/(3*l),(-u+A*(D-c*Math.sin(k)))/(3*l));b>=0&&b<=1&&(o[y++]=b),w>=0&&w<=1&&(o[y++]=w),O>=0&&O<=1&&(o[y++]=O)}}return y}function x(t,e,n,i,r){var o=6*n-12*e+6*t,s=9*e+3*i-3*t-9*n,l=3*e-3*t,u=0;if(m(s)){if(v(o)){var c=-l/o;c>=0&&c<=1&&(r[u++]=c)}}else{var h=o*o-4*s*l;if(m(h))r[0]=-o/(2*s);else if(h>0){var d=a(h),f=(c=(-o+d)/(2*s),(-o-d)/(2*s));c>=0&&c<=1&&(r[u++]=c),f>=0&&f<=1&&(r[u++]=f)}}return u}function _(t,e,n,i,r,o){var s=(e-t)*r+t,a=(n-e)*r+e,l=(i-n)*r+n,u=(a-s)*r+s,c=(l-a)*r+a,h=(c-u)*r+u;o[0]=t,o[1]=s,o[2]=u,o[3]=h,o[4]=h,o[5]=c,o[6]=l,o[7]=i}function w(t,e,n,i,r,s,l,c,h,m,v){var y,b,x,_,w,S=.005,C=1/0;d[0]=h,d[1]=m;for(var E=0;E<1;E+=.05)f[0]=g(t,n,r,l,E),f[1]=g(e,i,s,c,E),_=o(d,f),_=0&&_=0&&c<=1&&(r[u++]=c)}}else{var h=s*s-4*o*l;if(m(h)){c=-s/(2*o);c>=0&&c<=1&&(r[u++]=c)}else if(h>0){var d=a(h),f=(c=(-s+d)/(2*o),(-s-d)/(2*o));c>=0&&c<=1&&(r[u++]=c),f>=0&&f<=1&&(r[u++]=f)}}return u}function T(t,e,n){var i=t+n-2*e;return 0===i?.5:(t-e)/i}function k(t,e,n,i,r){var o=(e-t)*i+t,s=(n-e)*i+e,a=(s-o)*i+o;r[0]=t,r[1]=o,r[2]=a,r[3]=a,r[4]=s,r[5]=n}function A(t,e,n,i,r,s,l,c,h){var m,v=.005,g=1/0;d[0]=l,d[1]=c;for(var y=0;y<1;y+=.05){f[0]=S(t,n,r,y),f[1]=S(e,i,s,y);var b=o(d,f);b=0&&bc)if(a=l[c++],a!=a)return!0}else for(;u>c;c++)if((t||c in l)&&l[c]===n)return t||c||0;return!t&&-1}};t.exports={includes:s(!0),indexOf:s(!1)}},"4e08":function(t,e,n){(function(t){var n;"undefined"!==typeof window?n=window.__DEV__:"undefined"!==typeof t&&(n=t.__DEV__),"undefined"===typeof n&&(n=!0);var i=n;e.__DEV__=i}).call(this,n("c8ba"))},"4eb5":function(t,e,n){var i=n("6981"),r={autoSetContainer:!1},o={install:function(t){t.prototype.$clipboardConfig=r,t.prototype.$copyText=function(t,e){return new Promise((function(n,r){var o=document.createElement("button"),s=new i(o,{text:function(){return t},action:function(){return"copy"},container:"object"===typeof e?e:document.body});s.on("success",(function(t){s.destroy(),n(t)})),s.on("error",(function(t){s.destroy(),r(t)})),o.click()}))},t.directive("clipboard",{bind:function(t,e,n){if("success"===e.arg)t._v_clipboard_success=e.value;else if("error"===e.arg)t._v_clipboard_error=e.value;else{var o=new i(t,{text:function(){return e.value},action:function(){return"cut"===e.arg?"cut":"copy"},container:r.autoSetContainer?t:void 0});o.on("success",(function(e){var n=t._v_clipboard_success;n&&n(e)})),o.on("error",(function(e){var n=t._v_clipboard_error;n&&n(e)})),t._v_clipboard=o}},update:function(t,e){"success"===e.arg?t._v_clipboard_success=e.value:"error"===e.arg?t._v_clipboard_error=e.value:(t._v_clipboard.text=function(){return e.value},t._v_clipboard.action=function(){return"cut"===e.arg?"cut":"copy"})},unbind:function(t,e){"success"===e.arg?delete t._v_clipboard_success:"error"===e.arg?delete t._v_clipboard_error:(t._v_clipboard.destroy(),delete t._v_clipboard)}})},config:r};t.exports=o},"4f85":function(t,e,n){var i=n("4e08"),r=(i.__DEV__,n("6d8b")),o=n("22d1"),s=n("eda2"),a=s.formatTime,l=s.encodeHTML,u=s.addCommas,c=s.getTooltipMarker,h=n("e0d3"),d=n("6cb7"),f=n("e47b"),p=n("38a2"),m=n("f934"),v=m.getLayoutParams,g=m.mergeLayoutParam,y=n("f47d"),b=y.createTask,x=n("0f99"),_=x.prepareSource,w=x.getSource,S=n("2b17"),C=S.retrieveRawValue,E=h.makeInner(),T=d.extend({type:"series.__base__",seriesIndex:0,coordinateSystem:null,defaultOption:null,legendVisualProvider:null,visualColorAccessPath:"itemStyle.color",visualBorderColorAccessPath:"itemStyle.borderColor",layoutMode:null,init:function(t,e,n,i){this.seriesIndex=this.componentIndex,this.dataTask=b({count:D,reset:O}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(t,n),_(this);var r=this.getInitialData(t,n);M(r,this),this.dataTask.context.data=r,E(this).dataBeforeProcessed=r,k(this)},mergeDefaultAndTheme:function(t,e){var n=this.layoutMode,i=n?v(t):{},o=this.subType;d.hasClass(o)&&(o+="Series"),r.merge(t,e.getTheme().get(this.subType)),r.merge(t,this.getDefaultOption()),h.defaultEmphasis(t,"label",["show"]),this.fillDataTextStyle(t.data),n&&g(t,i,n)},mergeOption:function(t,e){t=r.merge(this.option,t,!0),this.fillDataTextStyle(t.data);var n=this.layoutMode;n&&g(this.option,t,n),_(this);var i=this.getInitialData(t,e);M(i,this),this.dataTask.dirty(),this.dataTask.context.data=i,E(this).dataBeforeProcessed=i,k(this)},fillDataTextStyle:function(t){if(t&&!r.isTypedArray(t))for(var e=["show"],n=0;n":"\n",d="richText"===i,f={},p=0;function m(n){var s=r.reduce(n,(function(t,e,n){var i=g.getDimensionInfo(n);return t|(i&&!1!==i.tooltip&&null!=i.displayName)}),0),h=[];function m(t,n){var r=g.getDimensionInfo(n);if(r&&!1!==r.otherDims.tooltip){var m=r.type,v="sub"+o.seriesIndex+"at"+p,y=c({color:w,type:"subItem",renderMode:i,markerId:v}),b="string"===typeof y?y:y.content,x=(s?b+l(r.displayName||"-")+": ":"")+l("ordinal"===m?t+"":"time"===m?e?"":a("yyyy/MM/dd hh:mm:ss",t):u(t));x&&h.push(x),d&&(f[v]=w,++p)}}y.length?r.each(y,(function(e){m(C(g,t,e),e)})):r.each(n,m);var v=s?d?"\n":"
":"",b=v+h.join(v||", ");return{renderMode:i,content:b,style:f}}function v(t){return{renderMode:i,content:l(u(t)),style:f}}var g=this.getData(),y=g.mapDimension("defaultedTooltip",!0),b=y.length,x=this.getRawValue(t),_=r.isArray(x),w=g.getItemVisual(t,"color");r.isObject(w)&&w.colorStops&&(w=(w.colorStops[0]||{}).color),w=w||"transparent";var S=b>1||_&&!b?m(x):v(b?C(g,t,y[0]):_?x[0]:x),E=S.content,T=o.seriesIndex+"at"+p,k=c({color:w,type:"item",renderMode:i,markerId:T});f[T]=w,++p;var A=g.getName(t),D=this.name;h.isNameSpecified(this)||(D=""),D=D?l(D)+(e?": ":s):"";var O="string"===typeof k?k:k.content,I=e?O+D+E:D+O+(A?l(A)+": "+E:E);return{html:I,markers:f}},isAnimationEnabled:function(){if(o.node)return!1;var t=this.getShallow("animation");return t&&this.getData().count()>this.getShallow("animationThreshold")&&(t=!1),t},restoreData:function(){this.dataTask.dirty()},getColorFromPalette:function(t,e,n){var i=this.ecModel,r=f.getColorFromPalette.call(this,t,e,n);return r||(r=i.getColorFromPalette(t,e,n)),r},coordDimToDataDim:function(t){return this.getRawData().mapDimension(t,!0)},getProgressive:function(){return this.get("progressive")},getProgressiveThreshold:function(){return this.get("progressiveThreshold")},getAxisTooltipData:null,getTooltipPosition:null,pipeTask:null,preventIncremental:null,pipelineContext:null});function k(t){var e=t.name;h.isNameSpecified(t)||(t.name=A(t)||e)}function A(t){var e=t.getRawData(),n=e.mapDimension("seriesName",!0),i=[];return r.each(n,(function(t){var n=e.getDimensionInfo(t);n.displayName&&i.push(n.displayName)})),i.join(" ")}function D(t){return t.model.getRawData().count()}function O(t){var e=t.model;return e.setData(e.getRawData().cloneShallow()),I}function I(t,e){e.outputData&&t.end>e.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function M(t,e){r.each(t.CHANGABLE_METHODS,(function(n){t.wrapMethod(n,r.curry(j,e))}))}function j(t){var e=P(t);e&&e.setOutputEnd(this.count())}function P(t){var e=(t.ecModel||{}).scheduler,n=e&&e.getPipeline(t.uid);if(n){var i=n.currentTask;if(i){var r=i.agentStubMap;r&&(i=r.get(t.uid))}return i}}r.mixin(T,p),r.mixin(T,f);var N=T;t.exports=N},"4fac":function(t,e,n){var i=n("620b"),r=n("9c2c");function o(t,e,n){var o=e.points,s=e.smooth;if(o&&o.length>=2){if(s&&"spline"!==s){var a=r(o,s,n,e.smoothConstraint);t.moveTo(o[0][0],o[0][1]);for(var l=o.length,u=0;u<(n?l:l-1);u++){var c=a[2*u],h=a[2*u+1],d=o[(u+1)%l];t.bezierCurveTo(c[0],c[1],h[0],h[1],d[0],d[1])}}else{"spline"===s&&(o=i(o,n)),t.moveTo(o[0][0],o[0][1]);u=1;for(var f=o.length;u0?r(i(t),9007199254740991):0}},"510d":function(t,e,n){"use strict";var i=n("872a");function r(t){if(null===t)return!1;if(0===t.length)return!1;var e=t,n=/\/([gim]*)$/.exec(t),i="";if("/"===e[0]){if(n&&(i=n[1]),i.length>3)return!1;if("/"!==e[e.length-i.length-1])return!1}return!0}function o(t){var e=t,n=/\/([gim]*)$/.exec(t),i="";return"/"===e[0]&&(n&&(i=n[1]),e=e.slice(1,e.length-i.length-1)),new RegExp(e,i)}function s(t){var e="/"+t.source+"/";return t.global&&(e+="g"),t.multiline&&(e+="m"),t.ignoreCase&&(e+="i"),e}function a(t){return"[object RegExp]"===Object.prototype.toString.call(t)}t.exports=new i("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:r,construct:o,predicate:a,represent:s})},5135:function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},5270:function(t,e,n){"use strict";var i=n("c532"),r=n("c401"),o=n("2e67"),s=n("2444"),a=n("d925"),l=n("e683");function u(t){t.cancelToken&&t.cancelToken.throwIfRequested()}t.exports=function(t){u(t),t.baseURL&&!a(t.url)&&(t.url=l(t.baseURL,t.url)),t.headers=t.headers||{},t.data=r(t.data,t.headers,t.transformRequest),t.headers=i.merge(t.headers.common||{},t.headers[t.method]||{},t.headers||{}),i.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]}));var e=t.adapter||s.adapter;return e(t).then((function(e){return u(t),e.data=r(e.data,e.headers,t.transformResponse),e}),(function(e){return o(e)||(u(t),e&&e.response&&(e.response.data=r(e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))}},5319:function(t,e,n){"use strict";var i=n("d784"),r=n("825a"),o=n("7b0b"),s=n("50c4"),a=n("a691"),l=n("1d80"),u=n("8aa5"),c=n("14c3"),h=Math.max,d=Math.min,f=Math.floor,p=/\$([$&'`]|\d\d?|<[^>]*>)/g,m=/\$([$&'`]|\d\d?)/g,v=function(t){return void 0===t?t:String(t)};i("replace",2,(function(t,e,n,i){var g=i.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,y=i.REPLACE_KEEPS_$0,b=g?"$":"$0";return[function(n,i){var r=l(this),o=void 0==n?void 0:n[t];return void 0!==o?o.call(n,r,i):e.call(String(r),n,i)},function(t,i){if(!g&&y||"string"===typeof i&&-1===i.indexOf(b)){var o=n(e,t,this,i);if(o.done)return o.value}var l=r(t),f=String(this),p="function"===typeof i;p||(i=String(i));var m=l.global;if(m){var _=l.unicode;l.lastIndex=0}var w=[];while(1){var S=c(l,f);if(null===S)break;if(w.push(S),!m)break;var C=String(S[0]);""===C&&(l.lastIndex=u(f,s(l.lastIndex),_))}for(var E="",T=0,k=0;k=T&&(E+=f.slice(T,D)+P,T=D+A.length)}return E+f.slice(T)}];function x(t,n,i,r,s,a){var l=i+t.length,u=r.length,c=m;return void 0!==s&&(s=o(s),c=p),e.call(a,c,(function(e,o){var a;switch(o.charAt(0)){case"$":return"$";case"&":return t;case"`":return n.slice(0,i);case"'":return n.slice(l);case"<":a=s[o.slice(1,-1)];break;default:var c=+o;if(0===c)return e;if(c>u){var h=f(c/10);return 0===h?e:h<=u?void 0===r[h-1]?o.charAt(1):r[h-1]+o.charAt(1):e}a=r[c-1]}return void 0===a?"":a}))}}))},"551f":function(t,e,n){var i=n("282b"),r=i([["fill","color"],["stroke","borderColor"],["lineWidth","borderWidth"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["textPosition"],["textAlign"]]),o={getItemStyle:function(t,e){var n=r(this,t,e),i=this.getBorderLineDash();return i&&(n.lineDash=i),n},getBorderLineDash:function(){var t=this.get("borderType");return"solid"===t||null==t?null:"dashed"===t?[5,5]:[1,1]}};t.exports=o},"562e":function(t,e,n){var i=n("6d8b");function r(t){null!=t&&i.extend(this,t),this.otherDims={}}var o=r;t.exports=o},5692:function(t,e,n){var i=n("c430"),r=n("c6cd");(t.exports=function(t,e){return r[t]||(r[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.6.5",mode:i?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},5693:function(t,e){function n(t,e){var n,i,r,o,s,a=e.x,l=e.y,u=e.width,c=e.height,h=e.r;u<0&&(a+=u,u=-u),c<0&&(l+=c,c=-c),"number"===typeof h?n=i=r=o=h:h instanceof Array?1===h.length?n=i=r=o=h[0]:2===h.length?(n=r=h[0],i=o=h[1]):3===h.length?(n=h[0],i=o=h[1],r=h[2]):(n=h[0],i=h[1],r=h[2],o=h[3]):n=i=r=o=0,n+i>u&&(s=n+i,n*=u/s,i*=u/s),r+o>u&&(s=r+o,r*=u/s,o*=u/s),i+r>c&&(s=i+r,i*=c/s,r*=c/s),n+o>c&&(s=n+o,n*=c/s,o*=c/s),t.moveTo(a+n,l),t.lineTo(a+u-i,l),0!==i&&t.arc(a+u-i,l+i,i,-Math.PI/2,0),t.lineTo(a+u,l+c-r),0!==r&&t.arc(a+u-r,l+c-r,r,0,Math.PI/2),t.lineTo(a+o,l+c),0!==o&&t.arc(a+o,l+c-o,o,Math.PI/2,Math.PI),t.lineTo(a,l+n),0!==n&&t.arc(a+n,l+n,n,Math.PI,1.5*Math.PI)}e.buildPath=n},"56d3":function(t,e,n){"use strict";var i=n("de50");t.exports=i.DEFAULT=new i({include:[n("6771")],explicit:[n("3044"),n("510d"),n("363a")]})},"56ef":function(t,e,n){var i=n("d066"),r=n("241c"),o=n("7418"),s=n("825a");t.exports=i("Reflect","ownKeys")||function(t){var e=r.f(s(t)),n=o.f;return n?e.concat(n(t)):e}},"585a":function(t,e,n){(function(e){var n="object"==typeof e&&e&&e.Object===Object&&e;t.exports=n}).call(this,n("c8ba"))},"58df":function(t,e,n){var i=n("6d8b"),r=n("2306");function o(t,e,n,o){var s=n.axis;if(!s.scale.isBlank()){var a=n.getModel("splitArea"),l=a.getModel("areaStyle"),u=l.get("color"),c=o.coordinateSystem.getRect(),h=s.getTicksCoords({tickModel:a,clamp:!0});if(h.length){var d=u.length,f=t.__splitAreaColors,p=i.createHashMap(),m=0;if(f)for(var v=0;v0?t.charCodeAt(o-1):null,f=f&&U(s,a)}else{for(o=0;oi&&" "!==t[d+1],d=o);else if(!z(s))return K;a=o>0?t.charCodeAt(o-1):null,f=f&&U(s,a)}u=u||h&&o-d-1>i&&" "!==t[d+1]}return l||u?n>9&&q(t)?K:u?J:X:f&&!r(t)?G:Y}function Q(t,e,n,i){t.dump=function(){if(0===e.length)return"''";if(!t.noCompatMode&&-1!==P.indexOf(e))return"'"+e+"'";var o=t.indent*Math.max(1,n),s=-1===t.lineWidth?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-o),a=i||t.flowLevel>-1&&n>=t.flowLevel;function l(e){return B(t,e)}switch(Z(e,a,t.indent,s,l)){case G:return e;case Y:return"'"+e.replace(/'/g,"''")+"'";case X:return"|"+tt(e,t.indent)+et(R(e,o));case J:return">"+tt(e,t.indent)+et(R(nt(e,s),o));case K:return'"'+rt(e,s)+'"';default:throw new r("impossible error: invalid scalar style")}}()}function tt(t,e){var n=q(t)?String(e):"",i="\n"===t[t.length-1],r=i&&("\n"===t[t.length-2]||"\n"===t),o=r?"+":i?"":"-";return n+o+"\n"}function et(t){return"\n"===t[t.length-1]?t.slice(0,-1):t}function nt(t,e){var n,i,r=/(\n+)([^\n]*)/g,o=function(){var n=t.indexOf("\n");return n=-1!==n?n:t.length,r.lastIndex=n,it(t.slice(0,n),e)}(),s="\n"===t[0]||" "===t[0];while(i=r.exec(t)){var a=i[1],l=i[2];n=" "===l[0],o+=a+(s||n||""===l?"":"\n")+it(l,e),s=n}return o}function it(t,e){if(""===t||" "===t[0])return t;var n,i,r=/ [^ ]/g,o=0,s=0,a=0,l="";while(n=r.exec(t))a=n.index,a-o>e&&(i=s>o?s:a,l+="\n"+t.slice(o,i),o=i+1),s=a;return l+="\n",t.length-o>e&&s>o?l+=t.slice(o,s)+"\n"+t.slice(s+1):l+=t.slice(o),l.slice(1)}function rt(t){for(var e,n,i,r="",o=0;o=55296&&e<=56319&&(n=t.charCodeAt(o+1),n>=56320&&n<=57343)?(r+=V(1024*(e-55296)+n-56320+65536),o++):(i=j[e],r+=!i&&z(e)?t[o]:i||V(e));return r}function ot(t,e,n){var i,r,o="",s=t.tag;for(i=0,r=n.length;i1024&&(a+="? "),a+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),ct(t,e,s,!1,!1)&&(a+=t.dump,l+=a));t.tag=u,t.dump="{"+l+"}"}function lt(t,e,n,i){var o,s,a,l,u,h,d="",f=t.tag,p=Object.keys(n);if(!0===t.sortKeys)p.sort();else if("function"===typeof t.sortKeys)p.sort(t.sortKeys);else if(t.sortKeys)throw new r("sortKeys must be a boolean or a function");for(o=0,s=p.length;o1024,u&&(t.dump&&c===t.dump.charCodeAt(0)?h+="?":h+="? "),h+=t.dump,u&&(h+=L(t,e)),ct(t,e+1,l,!0,u)&&(t.dump&&c===t.dump.charCodeAt(0)?h+=":":h+=": ",h+=t.dump,d+=h));t.tag=f,t.dump=d||"{}"}function ut(t,e,n){var i,o,s,u,c,h;for(o=n?t.explicitTypes:t.implicitTypes,s=0,u=o.length;s tag resolver accepts not "'+h+'" style');i=c.represent[h](e,h)}t.dump=i}return!0}return!1}function ct(t,e,n,i,o,s){t.tag=null,t.dump=n,ut(t,n,!1)||ut(t,n,!0);var l=a.call(t.dump);i&&(i=t.flowLevel<0||t.flowLevel>e);var u,c,h="[object Object]"===l||"[object Array]"===l;if(h&&(u=t.duplicates.indexOf(n),c=-1!==u),(null!==t.tag&&"?"!==t.tag||c||2!==t.indent&&e>0)&&(o=!1),c&&t.usedDuplicates[u])t.dump="*ref_"+u;else{if(h&&c&&!t.usedDuplicates[u]&&(t.usedDuplicates[u]=!0),"[object Object]"===l)i&&0!==Object.keys(t.dump).length?(lt(t,e,t.dump,o),c&&(t.dump="&ref_"+u+t.dump)):(at(t,e,t.dump),c&&(t.dump="&ref_"+u+" "+t.dump));else if("[object Array]"===l){var d=t.noArrayIndent&&e>0?e-1:e;i&&0!==t.dump.length?(st(t,d,t.dump,o),c&&(t.dump="&ref_"+u+t.dump)):(ot(t,d,t.dump),c&&(t.dump="&ref_"+u+" "+t.dump))}else{if("[object String]"!==l){if(t.skipInvalid)return!1;throw new r("unacceptable kind of an object to dump "+l)}"?"!==t.tag&&Q(t,t.dump,e,s)}null!==t.tag&&"?"!==t.tag&&(t.dump="!<"+t.tag+"> "+t.dump)}return!0}function ht(t,e){var n,i,r=[],o=[];for(dt(t,r,o),n=0,i=o.length;n=0;if(r){var o="touchend"!==i?e.targetTouches[0]:e.changedTouches[0];o&&h(t,o,e,n)}else h(t,e,e,n),e.zrDelta=e.wheelDelta?e.wheelDelta/120:-(e.detail||0)/3;var s=e.button;return null==e.which&&void 0!==s&&u.test(e.type)&&(e.which=1&s?1:2&s?3:4&s?2:0),e}function m(t,e,n,i){l?t.addEventListener(e,n,i):t.attachEvent("on"+e,n)}function v(t,e,n,i){l?t.removeEventListener(e,n,i):t.detachEvent("on"+e,n)}var g=l?function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0}:function(t){t.returnValue=!1,t.cancelBubble=!0};function y(t){return 2===t.which||3===t.which}function b(t){return t.which>1}e.clientToLocal=h,e.getNativeEvent=f,e.normalizeEvent=p,e.addEventListener=m,e.removeEventListener=v,e.stop=g,e.isMiddleOrRightButtonOnMouseUpDown=y,e.notLeftMouse=b},6179:function(t,e,n){var i=n("4e08"),r=(i.__DEV__,n("6d8b")),o=n("4319"),s=n("80f0"),a=n("ec6f"),l=n("2b17"),u=l.defaultDimValueGetters,c=l.DefaultDataProvider,h=n("2f45"),d=h.summarizeDimensions,f=n("562e"),p=r.isObject,m="undefined",v=-1,g="e\0\0",y={float:typeof Float64Array===m?Array:Float64Array,int:typeof Int32Array===m?Array:Int32Array,ordinal:Array,number:Array,time:Array},b=typeof Uint32Array===m?Array:Uint32Array,x=typeof Int32Array===m?Array:Int32Array,_=typeof Uint16Array===m?Array:Uint16Array;function w(t){return t._rawCount>65535?b:_}function S(t){var e=t.constructor;return e===Array?t.slice():new e(t)}var C=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_rawData","_chunkSize","_chunkCount","_dimValueGetter","_count","_rawCount","_nameDimIdx","_idDimIdx"],E=["_extent","_approximateExtent","_rawExtent"];function T(t,e){r.each(C.concat(e.__wrappedMethods||[]),(function(n){e.hasOwnProperty(n)&&(t[n]=e[n])})),t.__wrappedMethods=e.__wrappedMethods,r.each(E,(function(n){t[n]=r.clone(e[n])})),t._calculationInfo=r.extend(e._calculationInfo)}var k=function(t,e){t=t||["x","y"];for(var n={},i=[],o={},s=0;s=0?this._indices[t]:-1}function P(t,e){var n=t._idList[e];return null==n&&(n=I(t,t._idDimIdx,e)),null==n&&(n=g+e),n}function N(t){return r.isArray(t)||(t=[t]),t}function V(t,e){var n=t.dimensions,i=new k(r.map(n,t.getDimensionInfo,t),t.hostModel);T(i,t);for(var o=i._storage={},s=t._storage,a=0;a=0?(o[l]=F(s[l]),i._rawExtent[l]=R(),i._extent[l]=null):o[l]=s[l])}return i}function F(t){for(var e=new Array(t.length),n=0;nb[1]&&(b[1]=y)}e&&(this._nameList[f]=e[p])}this._rawCount=this._count=l,this._extent={},O(this)},A._initDataFromProvider=function(t,e){if(!(t>=e)){for(var n,i=this._chunkSize,r=this._rawData,o=this._storage,s=this.dimensions,a=s.length,l=this._dimensionInfos,u=this._nameList,c=this._idList,h=this._rawExtent,d=this._nameRepeatCount={},f=this._chunkCount,p=0;pC[1]&&(C[1]=S)}if(!r.pure){var E=u[y];if(g&&null==E)if(null!=g.name)u[y]=E=g.name;else if(null!=n){var T=s[n],k=o[T][b];if(k){E=k[x];var A=l[T].ordinalMeta;A&&A.categories.length&&(E=A.categories[E])}}var I=null==g?null:g.id;null==I&&null!=E&&(d[E]=d[E]||0,I=E,d[E]>0&&(I+="__ec__"+d[E]),d[E]++),null!=I&&(c[y]=I)}}!r.persistent&&r.clean&&r.clean(),this._rawCount=this._count=e,this._extent={},O(this)}},A.count=function(){return this._count},A.getIndices=function(){var t=this._indices;if(t){var e=t.constructor,n=this._count;if(e===Array){r=new e(n);for(var i=0;i=0&&e=0&&ea&&(a=u)}return i=[s,a],this._extent[t]=i,i},A.getApproximateExtent=function(t){return t=this.getDimension(t),this._approximateExtent[t]||this.getDataExtent(t)},A.setApproximateExtent=function(t,e){e=this.getDimension(e),this._approximateExtent[e]=t.slice()},A.getCalculationInfo=function(t){return this._calculationInfo[t]},A.setCalculationInfo=function(t,e){p(t)?r.extend(this._calculationInfo,t):this._calculationInfo[t]=e},A.getSum=function(t){var e=this._storage[t],n=0;if(e)for(var i=0,r=this.count();i=this._rawCount||t<0)return-1;if(!this._indices)return t;var e=this._indices,n=e[t];if(null!=n&&nt))return o;r=o-1}}return-1},A.indicesOfNearest=function(t,e,n){var i=this._storage,r=i[t],o=[];if(!r)return o;null==n&&(n=1/0);for(var s=1/0,a=-1,l=0,u=0,c=this.count();u=0&&a<0)&&(s=d,a=h,l=0),h===a&&(o[l++]=u))}return o.length=l,o},A.getRawIndex=M,A.getRawDataItem=function(t){if(this._rawData.persistent)return this._rawData.getItem(this.getRawIndex(t));for(var e=[],n=0;n=u&&y<=c||isNaN(y))&&(s[a++]=d),d++}h=!0}else if(2===i){f=this._storage[l];var b=this._storage[e[1]],x=t[e[1]][0],_=t[e[1]][1];for(p=0;p=u&&y<=c||isNaN(y))&&(C>=x&&C<=_||isNaN(C))&&(s[a++]=d),d++}}h=!0}}if(!h)if(1===i)for(g=0;g=u&&y<=c||isNaN(y))&&(s[a++]=E)}else for(g=0;gt[k][1])&&(T=!1)}T&&(s[a++]=this.getRawIndex(g))}return aw[1]&&(w[1]=_)}}}return o},A.downSample=function(t,e,n,i){for(var r=V(this,[t]),o=r._storage,s=[],a=Math.floor(1/e),l=o[t],u=this.count(),c=this._chunkSize,h=r._rawExtent[t],d=new(w(this))(u),f=0,p=0;pu-p&&(a=u-p,s.length=a);for(var m=0;mh[1]&&(h[1]=b),d[f++]=x}return r._count=f,r._indices=d,r.getRawIndex=j,r},A.getItemModel=function(t){var e=this.hostModel;return new o(this.getRawDataItem(t),e,e&&e.ecModel)},A.diff=function(t){var e=this;return new s(t?t.getIndices():[],this.getIndices(),(function(e){return P(t,e)}),(function(t){return P(e,t)}))},A.getVisual=function(t){var e=this._visual;return e&&e[t]},A.setVisual=function(t,e){if(p(t))for(var n in t)t.hasOwnProperty(n)&&this.setVisual(n,t[n]);else this._visual=this._visual||{},this._visual[t]=e},A.setLayout=function(t,e){if(p(t))for(var n in t)t.hasOwnProperty(n)&&this.setLayout(n,t[n]);else this._layout[t]=e},A.getLayout=function(t){return this._layout[t]},A.getItemLayout=function(t){return this._itemLayouts[t]},A.setItemLayout=function(t,e,n){this._itemLayouts[t]=n?r.extend(this._itemLayouts[t]||{},e):e},A.clearItemLayouts=function(){this._itemLayouts.length=0},A.getItemVisual=function(t,e,n){var i=this._itemVisuals[t],r=i&&i[e];return null!=r||n?r:this.getVisual(e)},A.setItemVisual=function(t,e,n){var i=this._itemVisuals[t]||{},r=this.hasItemVisual;if(this._itemVisuals[t]=i,p(e))for(var o in e)e.hasOwnProperty(o)&&(i[o]=e[o],r[o]=!0);else i[e]=n,r[e]=!0},A.clearAllVisual=function(){this._visual={},this._itemVisuals=[],this.hasItemVisual={}};var L=function(t){t.seriesIndex=this.seriesIndex,t.dataIndex=this.dataIndex,t.dataType=this.dataType};A.setItemGraphicEl=function(t,e){var n=this.hostModel;e&&(e.dataIndex=t,e.dataType=this.dataType,e.seriesIndex=n&&n.seriesIndex,"group"===e.type&&e.traverse(L,e)),this._graphicEls[t]=e},A.getItemGraphicEl=function(t){return this._graphicEls[t]},A.eachItemGraphicEl=function(t,e){r.each(this._graphicEls,(function(n,i){n&&t&&t.call(e,n,i)}))},A.cloneShallow=function(t){if(!t){var e=r.map(this.dimensions,this.getDimensionInfo,this);t=new k(e,this.hostModel)}if(t._storage=this._storage,T(t,this),this._indices){var n=this._indices.constructor;t._indices=new n(this._indices)}else t._indices=null;return t.getRawIndex=t._indices?j:M,t},A.wrapMethod=function(t,e){var n=this[t];"function"===typeof n&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(t),this[t]=function(){var t=n.apply(this,arguments);return e.apply(this,[t].concat(r.slice(arguments)))})},A.TRANSFERABLE_METHODS=["cloneShallow","downSample","map"],A.CHANGABLE_METHODS=["filterSelf","selectRange"];var B=k;t.exports=B},"620b":function(t,e,n){var i=n("401b"),r=i.distance;function o(t,e,n,i,r,o,s){var a=.5*(n-t),l=.5*(i-e);return(2*(e-n)+a+l)*s+(-3*(e-n)-2*a-l)*o+a*r+e}function s(t,e){for(var n=t.length,i=[],s=0,a=1;an-2?n-1:f+1],h=t[f>n-3?n-1:f+2]);var v=p*p,g=p*v;i.push([o(u[0],m[0],c[0],h[0],p,v,g),o(u[1],m[1],c[1],h[1],p,v,g)])}return i}t.exports=s},"625e":function(t,e,n){var i=n("4e08"),r=(i.__DEV__,n("6d8b")),o=".",s="___EC__COMPONENT__CONTAINER___";function a(t){var e={main:"",sub:""};return t&&(t=t.split(o),e.main=t[0]||"",e.sub=t[1]||""),e}function l(t){r.assert(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(t),'componentType "'+t+'" illegal')}function u(t,e){t.$constructor=t,t.extend=function(t){var e=this,n=function(){t.$constructor?t.$constructor.apply(this,arguments):e.apply(this,arguments)};return r.extend(n.prototype,t),n.extend=this.extend,n.superCall=d,n.superApply=f,r.inherits(n,this),n.superClass=e,n}}var c=0;function h(t){var e=["__\0is_clz",c++,Math.random().toFixed(3)].join("_");t.prototype[e]=!0,t.isInstance=function(t){return!(!t||!t[e])}}function d(t,e){var n=r.slice(arguments,2);return this.superClass.prototype[e].apply(t,n)}function f(t,e,n){return this.superClass.prototype[e].apply(t,n)}function p(t,e){e=e||{};var n={};function i(t){var e=n[t.main];return e&&e[s]||(e=n[t.main]={},e[s]=!0),e}if(t.registerClass=function(t,e){if(e)if(l(e),e=a(e),e.sub){if(e.sub!==s){var r=i(e);r[e.sub]=t}}else n[e.main]=t;return t},t.getClass=function(t,e,i){var r=n[t];if(r&&r[s]&&(r=e?r[e]:null),i&&!r)throw new Error(e?"Component "+t+"."+(e||"")+" not exists. Load it first.":t+".type should be specified.");return r},t.getClassesByMainType=function(t){t=a(t);var e=[],i=n[t.main];return i&&i[s]?r.each(i,(function(t,n){n!==s&&e.push(t)})):e.push(i),e},t.hasClass=function(t){return t=a(t),!!n[t.main]},t.getAllClassMainTypes=function(){var t=[];return r.each(n,(function(e,n){t.push(n)})),t},t.hasSubTypes=function(t){t=a(t);var e=n[t.main];return e&&e[s]},t.parseClassType=a,e.registerWhenExtend){var o=t.extend;o&&(t.extend=function(e){var n=o.call(this,e);return t.registerClass(n,e.type)})}return t}function m(t,e){}e.parseClassType=a,e.enableClassExtend=u,e.enableClassCheck=h,e.enableClassManagement=p,e.setReadOnly=m},"627c":function(t,e,n){var i=n("6d8b"),r=n("3eba"),o=n("2306"),s=n("f934"),a=s.getLayoutRect,l=n("eda2"),u=l.windowOpen;r.extendComponentModel({type:"title",layoutMode:{type:"box",ignoreSize:!0},defaultOption:{zlevel:0,z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:0,top:0,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bolder",color:"#333"},subtextStyle:{color:"#aaa"}}}),r.extendComponentView({type:"title",render:function(t,e,n){if(this.group.removeAll(),t.get("show")){var r=this.group,s=t.getModel("textStyle"),l=t.getModel("subtextStyle"),c=t.get("textAlign"),h=i.retrieve2(t.get("textBaseline"),t.get("textVerticalAlign")),d=new o.Text({style:o.setTextStyle({},s,{text:t.get("text"),textFill:s.getTextColor()},{disableBox:!0}),z2:10}),f=d.getBoundingRect(),p=t.get("subtext"),m=new o.Text({style:o.setTextStyle({},l,{text:p,textFill:l.getTextColor(),y:f.height+t.get("itemGap"),textVerticalAlign:"top"},{disableBox:!0}),z2:10}),v=t.get("link"),g=t.get("sublink"),y=t.get("triggerEvent",!0);d.silent=!v&&!y,m.silent=!g&&!y,v&&d.on("click",(function(){u(v,"_"+t.get("target"))})),g&&m.on("click",(function(){u(v,"_"+t.get("subtarget"))})),d.eventData=m.eventData=y?{componentType:"title",componentIndex:t.componentIndex}:null,r.add(d),p&&r.add(m);var b=r.getBoundingRect(),x=t.getBoxLayoutParams();x.width=b.width,x.height=b.height;var _=a(x,{width:n.getWidth(),height:n.getHeight()},t.get("padding"));c||(c=t.get("left")||t.get("right"),"middle"===c&&(c="center"),"right"===c?_.x+=_.width:"center"===c&&(_.x+=_.width/2)),h||(h=t.get("top")||t.get("bottom"),"center"===h&&(h="middle"),"bottom"===h?_.y+=_.height:"middle"===h&&(_.y+=_.height/2),h=h||"top"),r.attr("position",[_.x,_.y]);var w={textAlign:c,textVerticalAlign:h};d.setStyle(w),m.setStyle(w),b=r.getBoundingRect();var S=_.margin,C=t.getItemStyle(["color","opacity"]);C.fill=t.get("backgroundColor");var E=new o.Rect({shape:{x:b.x-S[3],y:b.y-S[0],width:b.width+S[1]+S[3],height:b.height+S[0]+S[2],r:t.get("borderRadius")},style:C,subPixelOptimize:!0,silent:!0});r.add(E)}}})},"62e4":function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},6366:function(t,e,n){"use strict";function i(t){return"undefined"===typeof t||null===t}function r(t){return"object"===typeof t&&null!==t}function o(t){return Array.isArray(t)?t:i(t)?[]:[t]}function s(t,e){var n,i,r,o;if(e)for(o=Object.keys(e),n=0,i=o.length;n=u?t?"":void 0:(o=a.charCodeAt(l),o<55296||o>56319||l+1===u||(s=a.charCodeAt(l+1))<56320||s>57343?t?a.charAt(l):o:t?a.slice(l,l+2):s-56320+(o-55296<<10)+65536)}};t.exports={codeAt:o(!1),charAt:o(!0)}},"65ed":function(t,e,n){var i=n("22d1"),r=n("84ec"),o=r.buildTransformer,s="___zrEVENTSAVED",a=[];function l(t,e,n,i,r){return u(a,e,i,r,!0)&&u(t,n,a[0],a[1])}function u(t,e,n,r,o){if(e.getBoundingClientRect&&i.domSupported&&!d(e)){var a=e[s]||(e[s]={}),l=c(e,a),u=h(l,a,o);if(u)return u(t,n,r),!0}return!1}function c(t,e){var n=e.markers;if(n)return n;n=e.markers=[];for(var i=["left","right"],r=["top","bottom"],o=0;o<4;o++){var s=document.createElement("div"),a=s.style,l=o%2,u=(o>>1)%2;a.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",i[l]+":0",r[u]+":0",i[1-l]+":auto",r[1-u]+":auto",""].join("!important;"),t.appendChild(s),n.push(s)}return n}function h(t,e,n){for(var i=n?"invTrans":"trans",r=e[i],s=e.srcCoords,a=!0,l=[],u=[],c=0;c<4;c++){var h=t[c].getBoundingClientRect(),d=2*c,f=h.left,p=h.top;l.push(f,p),a=a&&s&&f===s[d]&&p===s[d+1],u.push(t[c].offsetLeft,t[c].offsetTop)}return a&&r?r:(e.srcCoords=l,e[i]=n?o(u,l):o(l,u))}function d(t){return"CANVAS"===t.nodeName.toUpperCase()}e.transformLocalCoord=l,e.transformCoordWithViewport=u,e.isCanvasEl=d},6679:function(t,e,n){var i=n("4e08"),r=(i.__DEV__,n("3eba")),o=n("cd33"),s=r.extendComponentView({type:"axis",_axisPointer:null,axisPointerClass:null,render:function(t,e,n,i){this.axisPointerClass&&o.fixValue(t),s.superApply(this,"render",arguments),a(this,t,e,n,i,!0)},updateAxisPointer:function(t,e,n,i,r){a(this,t,e,n,i,!1)},remove:function(t,e){var n=this._axisPointer;n&&n.remove(e),s.superApply(this,"remove",arguments)},dispose:function(t,e){l(this,e),s.superApply(this,"dispose",arguments)}});function a(t,e,n,i,r,a){var u=s.getAxisPointerClass(t.axisPointerClass);if(u){var c=o.getAxisPointerModel(e);c?(t._axisPointer||(t._axisPointer=new u)).render(e,c,i,a):l(t,i)}}function l(t,e,n){var i=t._axisPointer;i&&i.dispose(e,n),t._axisPointer=null}var u=[];s.registerAxisPointerClass=function(t,e){u[t]=e},s.getAxisPointerClass=function(t){return t&&u[t]};var c=s;t.exports=c},6747:function(t,e){var n=Array.isArray;t.exports=n},6771:function(t,e,n){"use strict";var i=n("de50");t.exports=new i({include:[n("4528")],implicit:[n("e0ce"),n("b294")],explicit:[n("8ced"),n("f3e9"),n("0df5"),n("a736")]})},"67ca":function(t,e,n){var i=n("cb5a");function r(t,e){var n=this.__data__,r=i(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}t.exports=r},"68ab":function(t,e,n){var i=n("4a3f"),r=i.quadraticProjectPoint;function o(t,e,n,i,o,s,a,l,u){if(0===a)return!1;var c=a;if(u>e+c&&u>i+c&&u>s+c||ut+c&&l>n+c&&l>o+c||l0&&u>0&&!f&&(a=0),a<0&&u<0&&!p&&(u=0));var v=e.ecModel;if(v&&"time"===s){var g,y=c("bar",v);if(r.each(y,(function(t){g|=t.getBaseAxis()===e.axis})),g){var b=h(y),x=m(a,u,e,b);a=x.min,u=x.max}}return{extent:[a,u],fixMin:f,fixMax:p}}function m(t,e,n,i){var o=n.axis.getExtent(),s=o[1]-o[0],a=d(i,n.axis);if(void 0===a)return{min:t,max:e};var l=1/0;r.each(a,(function(t){l=Math.min(t.offset,l)}));var u=-1/0;r.each(a,(function(t){u=Math.max(t.offset+t.width,u)})),l=Math.abs(l),u=Math.abs(u);var c=l+u,h=e-t,f=1-(l+u)/s,p=h/f-h;return e+=p*(u/c),t-=p*(l/c),{min:t,max:e}}function v(t,e){var n=p(t,e),i=n.extent,r=e.get("splitNumber");"log"===t.type&&(t.base=e.get("logBase"));var o=t.type;t.setExtent(i[0],i[1]),t.niceExtent({splitNumber:r,fixMin:n.fixMin,fixMax:n.fixMax,minInterval:"interval"===o||"time"===o?e.get("minInterval"):null,maxInterval:"interval"===o||"time"===o?e.get("maxInterval"):null});var s=e.get("interval");null!=s&&t.setInterval&&t.setInterval(s)}function g(t,e){if(e=e||t.get("type"),e)switch(e){case"category":return new o(t.getOrdinalMeta?t.getOrdinalMeta():t.getCategories(),[1/0,-1/0]);case"value":return new s;default:return(a.getClass(e)||s).create(t)}}function y(t){var e=t.scale.getExtent(),n=e[0],i=e[1];return!(n>0&&i>0||n<0&&i<0)}function b(t){var e=t.getLabelModel().get("formatter"),n="category"===t.type?t.scale.getExtent()[0]:null;return"string"===typeof e?(e=function(e){return function(n){return n=t.scale.getLabel(n),e.replace("{value}",null!=n?n:"")}}(e),e):"function"===typeof e?function(i,r){return null!=n&&(r=i-n),e(x(t,i),r)}:function(e){return t.scale.getLabel(e)}}function x(t,e){return"category"===t.type?t.scale.getLabel(e):e}function _(t){var e=t.model,n=t.scale;if(e.get("axisLabel.show")&&!n.isBlank()){var i,r,o="category"===t.type,s=n.getExtent();o?r=n.count():(i=n.getTicks(),r=i.length);var a,l=t.getLabelModel(),u=b(t),c=1;r>40&&(c=Math.ceil(r/40));for(var h=0;h=2)t.mixin({beforeCreate:i});else{var n=t.prototype._init;t.prototype._init=function(t){void 0===t&&(t={}),t.init=t.init?[i].concat(t.init):i,n.call(this,t)}}function i(){var t=this.$options;t.store?this.$store="function"===typeof t.store?t.store():t.store:t.parent&&t.parent.$store&&(this.$store=t.parent.$store)}}var i="undefined"!==typeof window?window:"undefined"!==typeof t?t:{},r=i.__VUE_DEVTOOLS_GLOBAL_HOOK__;function o(t){r&&(t._devtoolHook=r,r.emit("vuex:init",t),r.on("vuex:travel-to-state",(function(e){t.replaceState(e)})),t.subscribe((function(t,e){r.emit("vuex:mutation",t,e)}),{prepend:!0}),t.subscribeAction((function(t,e){r.emit("vuex:action",t,e)}),{prepend:!0}))}function s(t,e){return t.filter(e)[0]}function a(t,e){if(void 0===e&&(e=[]),null===t||"object"!==typeof t)return t;var n=s(e,(function(e){return e.original===t}));if(n)return n.copy;var i=Array.isArray(t)?[]:{};return e.push({original:t,copy:i}),Object.keys(t).forEach((function(n){i[n]=a(t[n],e)})),i}function l(t,e){Object.keys(t).forEach((function(n){return e(t[n],n)}))}function u(t){return null!==t&&"object"===typeof t}function c(t){return t&&"function"===typeof t.then}function h(t,e){return function(){return t(e)}}var d=function(t,e){this.runtime=e,this._children=Object.create(null),this._rawModule=t;var n=t.state;this.state=("function"===typeof n?n():n)||{}},f={namespaced:{configurable:!0}};f.namespaced.get=function(){return!!this._rawModule.namespaced},d.prototype.addChild=function(t,e){this._children[t]=e},d.prototype.removeChild=function(t){delete this._children[t]},d.prototype.getChild=function(t){return this._children[t]},d.prototype.hasChild=function(t){return t in this._children},d.prototype.update=function(t){this._rawModule.namespaced=t.namespaced,t.actions&&(this._rawModule.actions=t.actions),t.mutations&&(this._rawModule.mutations=t.mutations),t.getters&&(this._rawModule.getters=t.getters)},d.prototype.forEachChild=function(t){l(this._children,t)},d.prototype.forEachGetter=function(t){this._rawModule.getters&&l(this._rawModule.getters,t)},d.prototype.forEachAction=function(t){this._rawModule.actions&&l(this._rawModule.actions,t)},d.prototype.forEachMutation=function(t){this._rawModule.mutations&&l(this._rawModule.mutations,t)},Object.defineProperties(d.prototype,f);var p=function(t){this.register([],t,!1)};function m(t,e,n){if(e.update(n),n.modules)for(var i in n.modules){if(!e.getChild(i))return void 0;m(t.concat(i),e.getChild(i),n.modules[i])}}p.prototype.get=function(t){return t.reduce((function(t,e){return t.getChild(e)}),this.root)},p.prototype.getNamespace=function(t){var e=this.root;return t.reduce((function(t,n){return e=e.getChild(n),t+(e.namespaced?n+"/":"")}),"")},p.prototype.update=function(t){m([],this.root,t)},p.prototype.register=function(t,e,n){var i=this;void 0===n&&(n=!0);var r=new d(e,n);if(0===t.length)this.root=r;else{var o=this.get(t.slice(0,-1));o.addChild(t[t.length-1],r)}e.modules&&l(e.modules,(function(e,r){i.register(t.concat(r),e,n)}))},p.prototype.unregister=function(t){var e=this.get(t.slice(0,-1)),n=t[t.length-1],i=e.getChild(n);i&&i.runtime&&e.removeChild(n)},p.prototype.isRegistered=function(t){var e=this.get(t.slice(0,-1)),n=t[t.length-1];return e.hasChild(n)};var v;var g=function(t){var e=this;void 0===t&&(t={}),!v&&"undefined"!==typeof window&&window.Vue&&I(window.Vue);var n=t.plugins;void 0===n&&(n=[]);var i=t.strict;void 0===i&&(i=!1),this._committing=!1,this._actions=Object.create(null),this._actionSubscribers=[],this._mutations=Object.create(null),this._wrappedGetters=Object.create(null),this._modules=new p(t),this._modulesNamespaceMap=Object.create(null),this._subscribers=[],this._watcherVM=new v,this._makeLocalGettersCache=Object.create(null);var r=this,s=this,a=s.dispatch,l=s.commit;this.dispatch=function(t,e){return a.call(r,t,e)},this.commit=function(t,e,n){return l.call(r,t,e,n)},this.strict=i;var u=this._modules.root.state;w(this,u,[],this._modules.root),_(this,u),n.forEach((function(t){return t(e)}));var c=void 0!==t.devtools?t.devtools:v.config.devtools;c&&o(this)},y={state:{configurable:!0}};function b(t,e,n){return e.indexOf(t)<0&&(n&&n.prepend?e.unshift(t):e.push(t)),function(){var n=e.indexOf(t);n>-1&&e.splice(n,1)}}function x(t,e){t._actions=Object.create(null),t._mutations=Object.create(null),t._wrappedGetters=Object.create(null),t._modulesNamespaceMap=Object.create(null);var n=t.state;w(t,n,[],t._modules.root,!0),_(t,n,e)}function _(t,e,n){var i=t._vm;t.getters={},t._makeLocalGettersCache=Object.create(null);var r=t._wrappedGetters,o={};l(r,(function(e,n){o[n]=h(e,t),Object.defineProperty(t.getters,n,{get:function(){return t._vm[n]},enumerable:!0})}));var s=v.config.silent;v.config.silent=!0,t._vm=new v({data:{$$state:e},computed:o}),v.config.silent=s,t.strict&&A(t),i&&(n&&t._withCommit((function(){i._data.$$state=null})),v.nextTick((function(){return i.$destroy()})))}function w(t,e,n,i,r){var o=!n.length,s=t._modules.getNamespace(n);if(i.namespaced&&(t._modulesNamespaceMap[s],t._modulesNamespaceMap[s]=i),!o&&!r){var a=D(e,n.slice(0,-1)),l=n[n.length-1];t._withCommit((function(){v.set(a,l,i.state)}))}var u=i.context=S(t,s,n);i.forEachMutation((function(e,n){var i=s+n;E(t,i,e,u)})),i.forEachAction((function(e,n){var i=e.root?n:s+n,r=e.handler||e;T(t,i,r,u)})),i.forEachGetter((function(e,n){var i=s+n;k(t,i,e,u)})),i.forEachChild((function(i,o){w(t,e,n.concat(o),i,r)}))}function S(t,e,n){var i=""===e,r={dispatch:i?t.dispatch:function(n,i,r){var o=O(n,i,r),s=o.payload,a=o.options,l=o.type;return a&&a.root||(l=e+l),t.dispatch(l,s)},commit:i?t.commit:function(n,i,r){var o=O(n,i,r),s=o.payload,a=o.options,l=o.type;a&&a.root||(l=e+l),t.commit(l,s,a)}};return Object.defineProperties(r,{getters:{get:i?function(){return t.getters}:function(){return C(t,e)}},state:{get:function(){return D(t.state,n)}}}),r}function C(t,e){if(!t._makeLocalGettersCache[e]){var n={},i=e.length;Object.keys(t.getters).forEach((function(r){if(r.slice(0,i)===e){var o=r.slice(i);Object.defineProperty(n,o,{get:function(){return t.getters[r]},enumerable:!0})}})),t._makeLocalGettersCache[e]=n}return t._makeLocalGettersCache[e]}function E(t,e,n,i){var r=t._mutations[e]||(t._mutations[e]=[]);r.push((function(e){n.call(t,i.state,e)}))}function T(t,e,n,i){var r=t._actions[e]||(t._actions[e]=[]);r.push((function(e){var r=n.call(t,{dispatch:i.dispatch,commit:i.commit,getters:i.getters,state:i.state,rootGetters:t.getters,rootState:t.state},e);return c(r)||(r=Promise.resolve(r)),t._devtoolHook?r.catch((function(e){throw t._devtoolHook.emit("vuex:error",e),e})):r}))}function k(t,e,n,i){t._wrappedGetters[e]||(t._wrappedGetters[e]=function(t){return n(i.state,i.getters,t.state,t.getters)})}function A(t){t._vm.$watch((function(){return this._data.$$state}),(function(){0}),{deep:!0,sync:!0})}function D(t,e){return e.reduce((function(t,e){return t[e]}),t)}function O(t,e,n){return u(t)&&t.type&&(n=e,e=t,t=t.type),{type:t,payload:e,options:n}}function I(t){v&&t===v||(v=t,n(v))}y.state.get=function(){return this._vm._data.$$state},y.state.set=function(t){0},g.prototype.commit=function(t,e,n){var i=this,r=O(t,e,n),o=r.type,s=r.payload,a=(r.options,{type:o,payload:s}),l=this._mutations[o];l&&(this._withCommit((function(){l.forEach((function(t){t(s)}))})),this._subscribers.slice().forEach((function(t){return t(a,i.state)})))},g.prototype.dispatch=function(t,e){var n=this,i=O(t,e),r=i.type,o=i.payload,s={type:r,payload:o},a=this._actions[r];if(a){try{this._actionSubscribers.slice().filter((function(t){return t.before})).forEach((function(t){return t.before(s,n.state)}))}catch(u){0}var l=a.length>1?Promise.all(a.map((function(t){return t(o)}))):a[0](o);return new Promise((function(t,e){l.then((function(e){try{n._actionSubscribers.filter((function(t){return t.after})).forEach((function(t){return t.after(s,n.state)}))}catch(u){0}t(e)}),(function(t){try{n._actionSubscribers.filter((function(t){return t.error})).forEach((function(e){return e.error(s,n.state,t)}))}catch(u){0}e(t)}))}))}},g.prototype.subscribe=function(t,e){return b(t,this._subscribers,e)},g.prototype.subscribeAction=function(t,e){var n="function"===typeof t?{before:t}:t;return b(n,this._actionSubscribers,e)},g.prototype.watch=function(t,e,n){var i=this;return this._watcherVM.$watch((function(){return t(i.state,i.getters)}),e,n)},g.prototype.replaceState=function(t){var e=this;this._withCommit((function(){e._vm._data.$$state=t}))},g.prototype.registerModule=function(t,e,n){void 0===n&&(n={}),"string"===typeof t&&(t=[t]),this._modules.register(t,e),w(this,this.state,t,this._modules.get(t),n.preserveState),_(this,this.state)},g.prototype.unregisterModule=function(t){var e=this;"string"===typeof t&&(t=[t]),this._modules.unregister(t),this._withCommit((function(){var n=D(e.state,t.slice(0,-1));v.delete(n,t[t.length-1])})),x(this)},g.prototype.hasModule=function(t){return"string"===typeof t&&(t=[t]),this._modules.isRegistered(t)},g.prototype.hotUpdate=function(t){this._modules.update(t),x(this,!0)},g.prototype._withCommit=function(t){var e=this._committing;this._committing=!0,t(),this._committing=e},Object.defineProperties(g.prototype,y);var M=L((function(t,e){var n={};return F(e).forEach((function(e){var i=e.key,r=e.val;n[i]=function(){var e=this.$store.state,n=this.$store.getters;if(t){var i=B(this.$store,"mapState",t);if(!i)return;e=i.context.state,n=i.context.getters}return"function"===typeof r?r.call(this,e,n):e[r]},n[i].vuex=!0})),n})),j=L((function(t,e){var n={};return F(e).forEach((function(e){var i=e.key,r=e.val;n[i]=function(){var e=[],n=arguments.length;while(n--)e[n]=arguments[n];var i=this.$store.commit;if(t){var o=B(this.$store,"mapMutations",t);if(!o)return;i=o.context.commit}return"function"===typeof r?r.apply(this,[i].concat(e)):i.apply(this.$store,[r].concat(e))}})),n})),P=L((function(t,e){var n={};return F(e).forEach((function(e){var i=e.key,r=e.val;r=t+r,n[i]=function(){if(!t||B(this.$store,"mapGetters",t))return this.$store.getters[r]},n[i].vuex=!0})),n})),N=L((function(t,e){var n={};return F(e).forEach((function(e){var i=e.key,r=e.val;n[i]=function(){var e=[],n=arguments.length;while(n--)e[n]=arguments[n];var i=this.$store.dispatch;if(t){var o=B(this.$store,"mapActions",t);if(!o)return;i=o.context.dispatch}return"function"===typeof r?r.apply(this,[i].concat(e)):i.apply(this.$store,[r].concat(e))}})),n})),V=function(t){return{mapState:M.bind(null,t),mapGetters:P.bind(null,t),mapMutations:j.bind(null,t),mapActions:N.bind(null,t)}};function F(t){return R(t)?Array.isArray(t)?t.map((function(t){return{key:t,val:t}})):Object.keys(t).map((function(e){return{key:e,val:t[e]}})):[]}function R(t){return Array.isArray(t)||u(t)}function L(t){return function(e,n){return"string"!==typeof e?(n=e,e=""):"/"!==e.charAt(e.length-1)&&(e+="/"),t(e,n)}}function B(t,e,n){var i=t._modulesNamespaceMap[n];return i}function $(t){void 0===t&&(t={});var e=t.collapsed;void 0===e&&(e=!0);var n=t.filter;void 0===n&&(n=function(t,e,n){return!0});var i=t.transformer;void 0===i&&(i=function(t){return t});var r=t.mutationTransformer;void 0===r&&(r=function(t){return t});var o=t.actionFilter;void 0===o&&(o=function(t,e){return!0});var s=t.actionTransformer;void 0===s&&(s=function(t){return t});var l=t.logMutations;void 0===l&&(l=!0);var u=t.logActions;void 0===u&&(u=!0);var c=t.logger;return void 0===c&&(c=console),function(t){var h=a(t.state);"undefined"!==typeof c&&(l&&t.subscribe((function(t,o){var s=a(o);if(n(t,h,s)){var l=U(),u=r(t),d="mutation "+t.type+l;z(c,d,e),c.log("%c prev state","color: #9E9E9E; font-weight: bold",i(h)),c.log("%c mutation","color: #03A9F4; font-weight: bold",u),c.log("%c next state","color: #4CAF50; font-weight: bold",i(s)),H(c)}h=s})),u&&t.subscribeAction((function(t,n){if(o(t,n)){var i=U(),r=s(t),a="action "+t.type+i;z(c,a,e),c.log("%c action","color: #03A9F4; font-weight: bold",r),H(c)}})))}}function z(t,e,n){var i=n?t.groupCollapsed:t.group;try{i.call(t,e)}catch(r){t.log(e)}}function H(t){try{t.groupEnd()}catch(e){t.log("—— log end ——")}}function U(){var t=new Date;return" @ "+q(t.getHours(),2)+":"+q(t.getMinutes(),2)+":"+q(t.getSeconds(),2)+"."+q(t.getMilliseconds(),3)}function W(t,e){return new Array(e+1).join(t)}function q(t,e){return W("0",e-t.toString().length)+t}var G={Store:g,install:I,version:"3.5.1",mapState:M,mapMutations:j,mapGetters:P,mapActions:N,createNamespacedHelpers:V,createLogger:$};e["a"]=G}).call(this,n("c8ba"))},3041:function(t,e,n){var i=n("e1fc"),r=n("0da8"),o=n("76a5"),s=n("d9fc"),a=n("c7a2"),l=n("ae69"),u=n("cb11"),c=n("cbe5"),h=n("87b1"),d=n("d498"),f=n("48a9"),p=n("2b61"),m=n("1687"),v=n("342d"),g=v.createFromString,y=n("6d8b"),b=y.isString,x=y.extend,_=y.defaults,w=y.trim,S=y.each,C=/[\s,]+/;function E(t){if(b(t)){var e=new DOMParser;t=e.parseFromString(t,"text/xml")}9===t.nodeType&&(t=t.firstChild);while("svg"!==t.nodeName.toLowerCase()||1!==t.nodeType)t=t.nextSibling;return t}function T(){this._defs={},this._root=null,this._isDefine=!1,this._isText=!1}T.prototype.parse=function(t,e){e=e||{};var n=E(t);if(!n)throw new Error("Illegal svg");var r=new i;this._root=r;var o=n.getAttribute("viewBox")||"",s=parseFloat(n.getAttribute("width")||e.width),l=parseFloat(n.getAttribute("height")||e.height);isNaN(s)&&(s=null),isNaN(l)&&(l=null),j(n,r,null,!0);var u,c,h=n.firstChild;while(h)this._parseNode(h,r),h=h.nextSibling;if(o){var d=w(o).split(C);d.length>=4&&(u={x:parseFloat(d[0]||0),y:parseFloat(d[1]||0),width:parseFloat(d[2]),height:parseFloat(d[3])})}if(u&&null!=s&&null!=l&&(c=B(u,s,l),!e.ignoreViewBox)){var f=r;r=new i,r.add(f),f.scale=c.scale.slice(),f.position=c.position.slice()}return e.ignoreRootClip||null==s||null==l||r.setClipPath(new a({shape:{x:0,y:0,width:s,height:l}})),{root:r,width:s,height:l,viewBoxRect:u,viewBoxTransform:c}},T.prototype._parseNode=function(t,e){var n,i=t.nodeName.toLowerCase();if("defs"===i?this._isDefine=!0:"text"===i&&(this._isText=!0),this._isDefine){var r=A[i];if(r){var o=r.call(this,t),s=t.getAttribute("id");s&&(this._defs[s]=o)}}else{r=k[i];r&&(n=r.call(this,t,e),e.add(n))}var a=t.firstChild;while(a)1===a.nodeType&&this._parseNode(a,n),3===a.nodeType&&this._isText&&this._parseText(a,n),a=a.nextSibling;"defs"===i?this._isDefine=!1:"text"===i&&(this._isText=!1)},T.prototype._parseText=function(t,e){if(1===t.nodeType){var n=t.getAttribute("dx")||0,i=t.getAttribute("dy")||0;this._textX+=parseFloat(n),this._textY+=parseFloat(i)}var r=new o({style:{text:t.textContent,transformText:!0},position:[this._textX||0,this._textY||0]});O(e,r),j(t,r,this._defs);var s=r.style.fontSize;s&&s<9&&(r.style.fontSize=9,r.scale=r.scale||[1,1],r.scale[0]*=s/9,r.scale[1]*=s/9);var a=r.getBoundingRect();return this._textX+=a.width,e.add(r),r};var k={g:function(t,e){var n=new i;return O(e,n),j(t,n,this._defs),n},rect:function(t,e){var n=new a;return O(e,n),j(t,n,this._defs),n.setShape({x:parseFloat(t.getAttribute("x")||0),y:parseFloat(t.getAttribute("y")||0),width:parseFloat(t.getAttribute("width")||0),height:parseFloat(t.getAttribute("height")||0)}),n},circle:function(t,e){var n=new s;return O(e,n),j(t,n,this._defs),n.setShape({cx:parseFloat(t.getAttribute("cx")||0),cy:parseFloat(t.getAttribute("cy")||0),r:parseFloat(t.getAttribute("r")||0)}),n},line:function(t,e){var n=new u;return O(e,n),j(t,n,this._defs),n.setShape({x1:parseFloat(t.getAttribute("x1")||0),y1:parseFloat(t.getAttribute("y1")||0),x2:parseFloat(t.getAttribute("x2")||0),y2:parseFloat(t.getAttribute("y2")||0)}),n},ellipse:function(t,e){var n=new l;return O(e,n),j(t,n,this._defs),n.setShape({cx:parseFloat(t.getAttribute("cx")||0),cy:parseFloat(t.getAttribute("cy")||0),rx:parseFloat(t.getAttribute("rx")||0),ry:parseFloat(t.getAttribute("ry")||0)}),n},polygon:function(t,e){var n=t.getAttribute("points");n&&(n=I(n));var i=new h({shape:{points:n||[]}});return O(e,i),j(t,i,this._defs),i},polyline:function(t,e){var n=new c;O(e,n),j(t,n,this._defs);var i=t.getAttribute("points");i&&(i=I(i));var r=new d({shape:{points:i||[]}});return r},image:function(t,e){var n=new r;return O(e,n),j(t,n,this._defs),n.setStyle({image:t.getAttribute("xlink:href"),x:t.getAttribute("x"),y:t.getAttribute("y"),width:t.getAttribute("width"),height:t.getAttribute("height")}),n},text:function(t,e){var n=t.getAttribute("x")||0,r=t.getAttribute("y")||0,o=t.getAttribute("dx")||0,s=t.getAttribute("dy")||0;this._textX=parseFloat(n)+parseFloat(o),this._textY=parseFloat(r)+parseFloat(s);var a=new i;return O(e,a),j(t,a,this._defs),a},tspan:function(t,e){var n=t.getAttribute("x"),r=t.getAttribute("y");null!=n&&(this._textX=parseFloat(n)),null!=r&&(this._textY=parseFloat(r));var o=t.getAttribute("dx")||0,s=t.getAttribute("dy")||0,a=new i;return O(e,a),j(t,a,this._defs),this._textX+=o,this._textY+=s,a},path:function(t,e){var n=t.getAttribute("d")||"",i=g(n);return O(e,i),j(t,i,this._defs),i}},A={lineargradient:function(t){var e=parseInt(t.getAttribute("x1")||0,10),n=parseInt(t.getAttribute("y1")||0,10),i=parseInt(t.getAttribute("x2")||10,10),r=parseInt(t.getAttribute("y2")||0,10),o=new f(e,n,i,r);return D(t,o),o},radialgradient:function(t){}};function D(t,e){var n=t.firstChild;while(n){if(1===n.nodeType){var i=n.getAttribute("offset");i=i.indexOf("%")>0?parseInt(i,10)/100:i?parseFloat(i):0;var r=n.getAttribute("stop-color")||"#000000";e.addColorStop(i,r)}n=n.nextSibling}}function O(t,e){t&&t.__inheritedStyle&&(e.__inheritedStyle||(e.__inheritedStyle={}),_(e.__inheritedStyle,t.__inheritedStyle))}function I(t){for(var e=w(t).split(C),n=[],i=0;i0;o-=2){var s=r[o],a=r[o-1];switch(i=i||m.create(),a){case"translate":s=w(s).split(C),m.translate(i,i,[parseFloat(s[0]),parseFloat(s[1]||0)]);break;case"scale":s=w(s).split(C),m.scale(i,i,[parseFloat(s[0]),parseFloat(s[1]||s[0])]);break;case"rotate":s=w(s).split(C),m.rotate(i,i,parseFloat(s[0]));break;case"skew":s=w(s).split(C),console.warn("Skew transform is not supported yet");break;case"matrix":s=w(s).split(C);i[0]=parseFloat(s[0]),i[1]=parseFloat(s[1]),i[2]=parseFloat(s[2]),i[3]=parseFloat(s[3]),i[4]=parseFloat(s[4]),i[5]=parseFloat(s[5]);break}}e.setLocalTransform(i)}}var R=/([^\s:;]+)\s*:\s*([^:;]+)/g;function L(t){var e=t.getAttribute("style"),n={};if(!e)return n;var i,r={};R.lastIndex=0;while(null!=(i=R.exec(e)))r[i[1]]=i[2];for(var o in M)M.hasOwnProperty(o)&&null!=r[o]&&(n[M[o]]=r[o]);return n}function B(t,e,n){var i=e/t.width,r=n/t.height,o=Math.min(i,r),s=[o,o],a=[-(t.x+t.width/2)*o+e/2,-(t.y+t.height/2)*o+n/2];return{scale:s,position:a}}function $(t,e){var n=new T;return n.parse(t,e)}e.parseXML=E,e.makeViewBoxTransform=B,e.parseSVG=$},3044:function(t,e,n){"use strict";var i=n("872a");function r(){return!0}function o(){}function s(){return""}function a(t){return"undefined"===typeof t}t.exports=new i("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:r,construct:o,predicate:a,represent:s})},"30a3":function(t,e,n){var i=n("6d8b"),r=n("607d"),o=r.Dispatcher,s=n("98b7"),a=n("06ad"),l=function(t){t=t||{},this.stage=t.stage||{},this.onframe=t.onframe||function(){},this._clips=[],this._running=!1,this._time,this._pausedTime,this._pauseStart,this._paused=!1,o.call(this)};l.prototype={constructor:l,addClip:function(t){this._clips.push(t)},addAnimator:function(t){t.animation=this;for(var e=t.getClips(),n=0;n=0&&this._clips.splice(e,1)},removeAnimator:function(t){for(var e=t.getClips(),n=0;n1&&(c*=s(x),f*=s(x));var _=(r===o?-1:1)*s((c*c*(f*f)-c*c*(b*b)-f*f*(y*y))/(c*c*(b*b)+f*f*(y*y)))||0,w=_*c*b/f,S=_*-f*y/c,C=(t+n)/2+l(g)*w-a(g)*S,E=(e+i)/2+a(g)*w+l(g)*S,T=d([1,0],[(y-w)/c,(b-S)/f]),k=[(y-w)/c,(b-S)/f],A=[(-1*y-w)/c,(-1*b-S)/f],D=d(k,A);h(k,A)<=-1&&(D=u),h(k,A)>=1&&(D=0),0===o&&D>0&&(D-=2*u),1===o&&D<0&&(D+=2*u),v.addData(m,C,E,c,f,T,D,g,o)}var p=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/gi,m=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function v(t){if(!t)return new r;for(var e,n=0,i=0,o=n,s=i,a=new r,l=r.CMD,u=t.match(p),c=0;c=this.expandDepth)},methods:{toggle:function(){this.expand=!this.expand;try{this.$el.dispatchEvent(new Event("resized"))}catch(t){var e=document.createEvent("Event");e.initEvent("resized",!0,!1),this.$el.dispatchEvent(e)}}},render:function(t){var e=this,n=[],d=void 0;null===this.value||void 0===this.value?d=o.default:Array.isArray(this.value)?d=u.default:"[object Date]"===Object.prototype.toString.call(this.value)?d=h.default:"object"===i(this.value)?d=l.default:"number"==typeof this.value?d=s.default:"string"==typeof this.value?d=r.default:"boolean"==typeof this.value?d=a.default:"function"==typeof this.value&&(d=c.default);var f=this.keyName&&this.value&&(Array.isArray(this.value)||"object"===i(this.value)&&"[object Date]"!==Object.prototype.toString.call(this.value));return!this.previewMode&&f&&n.push(t("span",{class:{"jv-toggle":!0,open:!!this.expand},on:{click:this.toggle}})),this.keyName&&n.push(t("span",{class:{"jv-key":!0},domProps:{innerText:this.keyName+":"}})),n.push(t(d,{class:{"jv-push":!0},props:{jsonValue:this.value,keyName:this.keyName,sort:this.sort,depth:this.depth,expand:this.expand,previewMode:this.previewMode},on:{"update:expand":function(t){e.expand=t}}})),t("div",{class:{"jv-node":!0,toggle:!this.previewMode&&f}},n)}}},function(t,e,n){"use strict";n.r(e);var i,r=n(6),o=n.n(r);for(i in r)"default"!==i&&function(t){n.d(e,t,(function(){return r[t]}))}(i);e.default=o.a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=/^\w+:\/\//;e.default={name:"JsonString",props:{jsonValue:{type:String,required:!0}},data:function(){return{expand:!1,canExtend:!1}},mounted:function(){this.$refs.itemRef.offsetHeight>this.$refs.holderRef.offsetHeight&&(this.canExtend=!0)},methods:{toggle:function(){this.expand=!this.expand}},render:function(t){var e=this.jsonValue,n=i.test(e),r=void 0;return this.expand?r={class:{"jv-ellipsis":!0},on:{click:this.toggle},domProps:{innerText:"..."}}:(r={class:{"jv-item":!0,"jv-string":!0},ref:"itemRef"},n?(e=''+e+"",r.domProps={innerHTML:'"'+e.toString()+'"'}):r.domProps={innerText:'"'+e.toString()+'"'}),t("span",{},[this.canExtend&&t("span",{class:{"jv-toggle":!0,open:this.expand},on:{click:this.toggle}}),t("span",{class:{"jv-holder-node":!0},ref:"holderRef"}),t("span",r)])}}},function(t,e,n){"use strict";n.r(e);var i,r=n(8),o=n.n(r);for(i in r)"default"!==i&&function(t){n.d(e,t,(function(){return r[t]}))}(i);e.default=o.a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={name:"JsonUndefined",functional:!0,props:{jsonValue:{type:Object,default:null}},render:function(t,e){return t("span",{class:{"jv-item":!0,"jv-undefined":!0},domProps:{innerText:null===e.props.jsonValue?"null":"undefined"}})}}},function(t,e,n){"use strict";n.r(e);var i,r=n(10),o=n.n(r);for(i in r)"default"!==i&&function(t){n.d(e,t,(function(){return r[t]}))}(i);e.default=o.a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={name:"JsonNumber",functional:!0,props:{jsonValue:{type:Number,required:!0}},render:function(t,e){var n=e.props;e=Number.isInteger(n.jsonValue);return t("span",{class:{"jv-item":!0,"jv-number":!0,"jv-number-integer":e,"jv-number-float":!e},domProps:{innerText:n.jsonValue.toString()}})}}},function(t,e,n){"use strict";n.r(e);var i,r=n(12),o=n.n(r);for(i in r)"default"!==i&&function(t){n.d(e,t,(function(){return r[t]}))}(i);e.default=o.a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={name:"JsonBoolean",functional:!0,props:{jsonValue:Boolean},render:function(t,e){return t("span",{class:{"jv-item":!0,"jv-boolean":!0},domProps:{innerText:e.props.jsonValue.toString()}})}}},function(t,e,n){"use strict";n.r(e);var i,r=n(14),o=n.n(r);for(i in r)"default"!==i&&function(t){n.d(e,t,(function(){return r[t]}))}(i);e.default=o.a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=n(21),o=(i=r)&&i.__esModule?i:{default:i};e.default={name:"JsonObject",props:{jsonValue:{type:Object,required:!0},keyName:{type:String,default:""},depth:{type:Number,default:0},expand:Boolean,sort:Boolean,previewMode:Boolean},data:function(){return{value:{}}},computed:{ordered:function(){var t=this;if(!this.sort)return this.value;var e={};return Object.keys(this.value).sort().forEach((function(n){e[n]=t.value[n]})),e}},watch:{jsonValue:function(t){this.setValue(t)}},mounted:function(){this.setValue(this.jsonValue)},methods:{setValue:function(t){var e=this;setTimeout((function(){e.value=t}),0)},toggle:function(){this.$emit("update:expand",!this.expand),this.dispatchEvent()},dispatchEvent:function(){try{this.$el.dispatchEvent(new Event("resized"))}catch(t){var e=document.createEvent("Event");e.initEvent("resized",!0,!1),this.$el.dispatchEvent(e)}}},render:function(t){var e,n=[];if(this.previewMode||this.keyName||n.push(t("span",{class:{"jv-toggle":!0,open:!!this.expand},on:{click:this.toggle}})),n.push(t("span",{class:{"jv-item":!0,"jv-object":!0},domProps:{innerText:"{"}})),this.expand)for(var i in this.ordered)this.ordered.hasOwnProperty(i)&&(e=this.ordered[i],n.push(t(o.default,{key:i,style:{display:this.expand?void 0:"none"},props:{sort:this.sort,keyName:i,depth:this.depth+1,value:e,previewMode:this.previewMode}})));return!this.expand&&Object.keys(this.value).length&&n.push(t("span",{style:{display:this.expand?"none":void 0},class:{"jv-ellipsis":!0},on:{click:this.toggle},attrs:{title:"click to reveal object content (keys: "+Object.keys(this.ordered).join(", ")+")"},domProps:{innerText:"..."}})),n.push(t("span",{class:{"jv-item":!0,"jv-object":!0},domProps:{innerText:"}"}})),t("span",n)}}},function(t,e,n){"use strict";n.r(e);var i,r=n(16),o=n.n(r);for(i in r)"default"!==i&&function(t){n.d(e,t,(function(){return r[t]}))}(i);e.default=o.a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=n(21),o=(i=r)&&i.__esModule?i:{default:i};e.default={name:"JsonArray",props:{jsonValue:{type:Array,required:!0},keyName:{type:String,default:""},depth:{type:Number,default:0},sort:Boolean,expand:Boolean,previewMode:Boolean},data:function(){return{value:[]}},watch:{jsonValue:function(t){this.setValue(t)}},mounted:function(){this.setValue(this.jsonValue)},methods:{setValue:function(t,e){var n=this,i=1i&&(n.value.push(t[i]),n.setValue(t,i+1))}),0)},toggle:function(){this.$emit("update:expand",!this.expand);try{this.$el.dispatchEvent(new Event("resized"))}catch(t){var e=document.createEvent("Event");e.initEvent("resized",!0,!1),this.$el.dispatchEvent(e)}}},render:function(t){var e=this,n=[];return this.previewMode||this.keyName||n.push(t("span",{class:{"jv-toggle":!0,open:!!this.expand},on:{click:this.toggle}})),n.push(t("span",{class:{"jv-item":!0,"jv-array":!0},domProps:{innerText:"["}})),this.expand&&this.value.forEach((function(i,r){n.push(t(o.default,{key:r,style:{display:e.expand?void 0:"none"},props:{sort:e.sort,depth:e.depth+1,value:i,previewMode:e.previewMode}}))})),!this.expand&&this.value.length&&n.push(t("span",{style:{display:void 0},class:{"jv-ellipsis":!0},on:{click:this.toggle},attrs:{title:"click to reveal "+this.value.length+" hidden items"},domProps:{innerText:"..."}})),n.push(t("span",{class:{"jv-item":!0,"jv-array":!0},domProps:{innerText:"]"}})),t("span",n)}}},function(t,e,n){"use strict";n.r(e);var i,r=n(18),o=n.n(r);for(i in r)"default"!==i&&function(t){n.d(e,t,(function(){return r[t]}))}(i);e.default=o.a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={name:"JsonFunction",functional:!0,props:{jsonValue:{type:Function,required:!0}},render:function(t,e){return t("span",{class:{"jv-item":!0,"jv-function":!0},attrs:{title:e.props.jsonValue.toString()},domProps:{innerHTML:"<function>"}})}}},function(t,e,n){"use strict";n.r(e);var i,r=n(20),o=n.n(r);for(i in r)"default"!==i&&function(t){n.d(e,t,(function(){return r[t]}))}(i);e.default=o.a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={name:"JsonDate",inject:["timeformat"],functional:!0,props:{jsonValue:{type:Date,required:!0}},render:function(t,e){var n=e.props;e=e.injections,n=n.jsonValue;return t("span",{class:{"jv-item":!0,"jv-string":!0},domProps:{innerText:'"'+(0,e.timeformat)(n)+'"'}})}}},function(t,e,n){"use strict";n.r(e);var i,r=n(3);for(i in r)"default"!==i&&function(t){n.d(e,t,(function(){return r[t]}))}(i);n(38);var o=n(0);o=Object(o.a)(r.default,void 0,void 0,!1,null,null,null);o.options.__file="lib/json-box.vue",e.default=o.exports},function(t,e,n){"use strict";function i(){var t=this,e=t.$createElement;return(e=t._self._c||e)("div",{class:t.jvClass},[t.copyable?e("div",{staticClass:"jv-tooltip"},[e("span",{ref:"clip",staticClass:"jv-button",class:{copied:t.copied}},[t._t("copy",[t._v("\n "+t._s(t.copied?t.copyText.copiedText:t.copyText.copyText)+"\n ")],{copied:t.copied})],2)]):t._e(),t._v(" "),e("div",{staticClass:"jv-code",class:{open:t.expandCode,boxed:t.boxed}},[e("json-box",{ref:"jsonBox",attrs:{value:t.value,sort:t.sort,"preview-mode":t.previewMode}})],1),t._v(" "),t.expandableCode&&t.boxed?e("div",{staticClass:"jv-more",on:{click:t.toggleExpandCode}},[e("span",{staticClass:"jv-toggle",class:{open:!!t.expandCode}})]):t._e()])}var r=[];i._withStripped=!0,n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return r}))},function(t,e,n){var i=n(39);"string"==typeof i&&(i=[[t.i,i,""]]);var r={hmr:!0,transform:void 0};n(25)(i,r),i.locals&&(t.exports=i.locals)},function(t,e,n){"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=function(t,e){var n=t[1]||"",i=t[3];return i?e&&"function"==typeof btoa?(t=function(t){return t=btoa(unescape(encodeURIComponent(JSON.stringify(t)))),t="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(t),"/*# ".concat(t," */")}(i),e=i.sources.map((function(t){return"/*# sourceURL=".concat(i.sourceRoot||"").concat(t," */")})),[n].concat(e).concat([t]).join("\n")):[n].join("\n"):n}(e,t);return e[2]?"@media ".concat(e[2]," {").concat(n,"}"):n})).join("")},e.i=function(t,n,i){"string"==typeof t&&(t=[[null,t,""]]);var r={};if(i)for(var o=0;ol)r.f(t,n=i[l++],e[n]);return t}},3842:function(t,e,n){var i=n("6d8b"),r=1e-4;function o(t){return t.replace(/^\s+|\s+$/g,"")}function s(t,e,n,i){var r=e[1]-e[0],o=n[1]-n[0];if(0===r)return 0===o?n[0]:(n[0]+n[1])/2;if(i)if(r>0){if(t<=e[0])return n[0];if(t>=e[1])return n[1]}else{if(t>=e[0])return n[0];if(t<=e[1])return n[1]}else{if(t===e[0])return n[0];if(t===e[1])return n[1]}return(t-e[0])/r*o+n[0]}function a(t,e){switch(t){case"center":case"middle":t="50%";break;case"left":case"top":t="0%";break;case"right":case"bottom":t="100%";break}return"string"===typeof t?o(t).match(/%$/)?parseFloat(t)/100*e:parseFloat(t):null==t?NaN:+t}function l(t,e,n){return null==e&&(e=10),e=Math.min(Math.max(0,e),20),t=(+t).toFixed(e),n?t:+t}function u(t){return t.sort((function(t,e){return t-e})),t}function c(t){if(t=+t,isNaN(t))return 0;var e=1,n=0;while(Math.round(t*e)/e!==t)e*=10,n++;return n}function h(t){var e=t.toString(),n=e.indexOf("e");if(n>0){var i=+e.slice(n+1);return i<0?-i:0}var r=e.indexOf(".");return r<0?0:e.length-1-r}function d(t,e){var n=Math.log,i=Math.LN10,r=Math.floor(n(t[1]-t[0])/i),o=Math.round(n(Math.abs(e[1]-e[0]))/i),s=Math.min(Math.max(-r+o,0),20);return isFinite(s)?s:20}function f(t,e,n){if(!t[e])return 0;var r=i.reduce(t,(function(t,e){return t+(isNaN(e)?0:e)}),0);if(0===r)return 0;var o=Math.pow(10,n),s=i.map(t,(function(t){return(isNaN(t)?0:t)/r*o*100})),a=100*o,l=i.map(s,(function(t){return Math.floor(t)})),u=i.reduce(l,(function(t,e){return t+e}),0),c=i.map(s,(function(t,e){return t-l[e]}));while(uh&&(h=c[f],d=f);++l[d],c[d]=0,++u}return l[e]/o}var p=9007199254740991;function m(t){var e=2*Math.PI;return(t%e+e)%e}function v(t){return t>-r&&t=10&&e++,e}function _(t,e){var n,i=x(t),r=Math.pow(10,i),o=t/r;return n=e?o<1.5?1:o<2.5?2:o<4?3:o<7?5:10:o<1?1:o<2?2:o<3?3:o<5?5:10,t=n*r,i>=-20?+t.toFixed(i<0?-i:0):t}function w(t,e){var n=(t.length-1)*e+1,i=Math.floor(n),r=+t[i-1],o=n-i;return o?r+o*(t[i]-r):r}function S(t){t.sort((function(t,e){return a(t,e,0)?-1:1}));for(var e=-1/0,n=1,i=0;i=0}e.linearMap=s,e.parsePercent=a,e.round=l,e.asc=u,e.getPrecision=c,e.getPrecisionSafe=h,e.getPixelPrecision=d,e.getPercentWithPrecision=f,e.MAX_SAFE_INTEGER=p,e.remRadian=m,e.isRadianAroundZero=v,e.parseDate=y,e.quantity=b,e.quantityExponent=x,e.nice=_,e.quantile=w,e.reformIntervals=S,e.isNumeric=C},"387f":function(t,e,n){"use strict";t.exports=function(t,e,n,i,r){return t.config=e,n&&(t.code=n),t.request=i,t.response=r,t}},"38a2":function(t,e,n){var i=n("2b17"),r=i.retrieveRawValue,o=n("eda2"),s=o.getTooltipMarker,a=o.formatTpl,l=n("e0d3"),u=l.getTooltipRenderMode,c=/\{@(.+?)\}/g,h={getDataParams:function(t,e){var n=this.getData(e),i=this.getRawValue(t,e),r=n.getRawIndex(t),o=n.getName(t),a=n.getRawDataItem(t),l=n.getItemVisual(t,"color"),c=n.getItemVisual(t,"borderColor"),h=this.ecModel.getComponent("tooltip"),d=h&&h.get("renderMode"),f=u(d),p=this.mainType,m="series"===p,v=n.userOutput;return{componentType:p,componentSubType:this.subType,componentIndex:this.componentIndex,seriesType:m?this.subType:null,seriesIndex:this.seriesIndex,seriesId:m?this.id:null,seriesName:m?this.name:null,name:o,dataIndex:r,data:a,dataType:e,value:i,color:l,borderColor:c,dimensionNames:v?v.dimensionNames:null,encode:v?v.encode:null,marker:s({color:l,renderMode:f}),$vars:["seriesName","name","value"]}},getFormattedLabel:function(t,e,n,i,o){e=e||"normal";var s=this.getData(n),l=s.getItemModel(t),u=this.getDataParams(t,n);null!=i&&u.value instanceof Array&&(u.value=u.value[i]);var h=l.get("normal"===e?[o||"label","formatter"]:[e,o||"label","formatter"]);if("function"===typeof h)return u.status=e,u.dimensionIndex=i,h(u);if("string"===typeof h){var d=a(h,u);return d.replace(c,(function(e,n){var i=n.length;return"["===n.charAt(0)&&"]"===n.charAt(i-1)&&(n=+n.slice(1,i-1)),r(s,t,n)}))}},getRawValue:function(t,e){return r(this.getData(e),t)},formatTooltip:function(){}};t.exports=h},3901:function(t,e,n){var i=n("282b"),r=i([["lineWidth","width"],["stroke","color"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]),o={getLineStyle:function(t){var e=r(this,t);return e.lineDash=this.getLineDash(e.lineWidth),e},getLineDash:function(t){null==t&&(t=1);var e=this.get("type"),n=Math.max(t,2),i=4*t;return"solid"!==e&&null!=e&&("dashed"===e?[i,i]:[n,n])}};t.exports=o},"392f":function(t,e,n){var i=n("6d8b"),r=i.inherits,o=n("19eb"),s=n("9850");function a(t){o.call(this,t),this._displayables=[],this._temporaryDisplayables=[],this._cursor=0,this.notClear=!0}a.prototype.incremental=!0,a.prototype.clearDisplaybles=function(){this._displayables=[],this._temporaryDisplayables=[],this._cursor=0,this.dirty(),this.notClear=!1},a.prototype.addDisplayable=function(t,e){e?this._temporaryDisplayables.push(t):this._displayables.push(t),this.dirty()},a.prototype.addDisplayables=function(t,e){e=e||!1;for(var n=0;n=0&&(e=e.slice(1)),".inf"===e?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===e?NaN:e.indexOf(":")>=0?(e.split(":").forEach((function(t){r.unshift(parseFloat(t,10))})),e=0,i=1,r.forEach((function(t){e+=t*i,i*=60})),n*e):n*parseFloat(e,10)}var l=/^[-+]?[0-9]+e/;function u(t,e){var n;if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(i.isNegativeZero(t))return"-0.0";return n=t.toString(10),l.test(n)?n.replace("e",".e"):n}function c(t){return"[object Number]"===Object.prototype.toString.call(t)&&(t%1!==0||i.isNegativeZero(t))}t.exports=new r("tag:yaml.org,2002:float",{kind:"scalar",resolve:s,construct:a,predicate:c,represent:u,defaultStyle:"lowercase"})},"3eba":function(t,e,n){var i=n("4e08"),r=(i.__DEV__,n("697e7")),o=n("6d8b"),s=n("41ef"),a=n("22d1"),l=n("04f6"),u=n("1fab"),c=n("7e63"),h=n("843e"),d=n("2039"),f=n("ca98"),p=n("fb05"),m=n("d15d"),v=n("6cb7"),g=n("4f85"),y=n("b12f"),b=n("e887"),x=n("2306"),_=n("e0d3"),w=n("88b3"),S=w.throttle,C=n("fd63"),E=n("b809"),T=n("998c"),k=n("69ff"),A=n("c533"),D=n("f219");n("0352");var O=n("ec34"),I=o.assert,M=o.each,j=o.isFunction,P=o.isObject,N=v.parseClassType,V="4.8.0",F={zrender:"4.3.1"},R=1,L=1e3,B=800,$=900,z=5e3,H=1e3,U=1100,W=2e3,q=3e3,G=3500,Y=4e3,X=5e3,J={PROCESSOR:{FILTER:L,SERIES_FILTER:B,STATISTIC:z},VISUAL:{LAYOUT:H,PROGRESSIVE_LAYOUT:U,GLOBAL:W,CHART:q,POST_CHART_LAYOUT:G,COMPONENT:Y,BRUSH:X}},K="__flagInMainProcess",Z="__optionUpdated",Q=/^[a-zA-Z0-9_]+$/;function tt(t,e){return function(n,i,r){e||!this._disposed?(n=n&&n.toLowerCase(),u.prototype[t].call(this,n,i,r)):xt(this.id)}}function et(){u.call(this)}function nt(t,e,n){n=n||{},"string"===typeof e&&(e=Mt[e]),this.id,this.group,this._dom=t;var i="canvas",s=this._zr=r.init(t,{renderer:n.renderer||i,devicePixelRatio:n.devicePixelRatio,width:n.width,height:n.height});this._throttledZrFlush=S(o.bind(s.flush,s),17);e=o.clone(e);e&&p(e,!0),this._theme=e,this._chartsViews=[],this._chartsMap={},this._componentsViews=[],this._componentsMap={},this._coordSysMgr=new d;var a=this._api=Ct(this);function c(t,e){return t.__prio-e.__prio}l(It,c),l(At,c),this._scheduler=new k(this,a,At,It),u.call(this,this._ecEventProcessor=new Et),this._messageCenter=new et,this._initEvents(),this.resize=o.bind(this.resize,this),this._pendingActions=[],s.animation.on("frame",this._onframe,this),dt(s,this),o.setAsPrimitive(this)}et.prototype.on=tt("on",!0),et.prototype.off=tt("off",!0),et.prototype.one=tt("one",!0),o.mixin(et,u);var it=nt.prototype;function rt(t,e,n){if(this._disposed)xt(this.id);else{var i,r=this._model,o=this._coordSysMgr.getCoordinateSystems();e=_.parseFinder(r,e);for(var s=0;s0&&t.unfinished);t.unfinished||this._zr.flush()}}},it.getDom=function(){return this._dom},it.getZr=function(){return this._zr},it.setOption=function(t,e,n){if(this._disposed)xt(this.id);else{var i;if(P(e)&&(n=e.lazyUpdate,i=e.silent,e=e.notMerge),this[K]=!0,!this._model||e){var r=new f(this._api),o=this._theme,s=this._model=new c;s.scheduler=this._scheduler,s.init(null,null,o,r)}this._model.setOption(t,Dt),n?(this[Z]={silent:i},this[K]=!1):(st(this),ot.update.call(this),this._zr.flush(),this[Z]=!1,this[K]=!1,ct.call(this,i),ht.call(this,i))}},it.setTheme=function(){console.error("ECharts#setTheme() is DEPRECATED in ECharts 3.0")},it.getModel=function(){return this._model},it.getOption=function(){return this._model&&this._model.getOption()},it.getWidth=function(){return this._zr.getWidth()},it.getHeight=function(){return this._zr.getHeight()},it.getDevicePixelRatio=function(){return this._zr.painter.dpr||window.devicePixelRatio||1},it.getRenderedCanvas=function(t){if(a.canvasSupported){t=t||{},t.pixelRatio=t.pixelRatio||1,t.backgroundColor=t.backgroundColor||this._model.get("backgroundColor");var e=this._zr;return e.painter.getRenderedCanvas(t)}},it.getSvgDataURL=function(){if(a.svgSupported){var t=this._zr,e=t.storage.getDisplayList();return o.each(e,(function(t){t.stopAnimation(!0)})),t.painter.toDataURL()}},it.getDataURL=function(t){if(!this._disposed){t=t||{};var e=t.excludeComponents,n=this._model,i=[],r=this;M(e,(function(t){n.eachComponent({mainType:t},(function(t){var e=r._componentsMap[t.__viewId];e.group.ignore||(i.push(e),e.group.ignore=!0)}))}));var o="svg"===this._zr.painter.getType()?this.getSvgDataURL():this.getRenderedCanvas(t).toDataURL("image/"+(t&&t.type||"png"));return M(i,(function(t){t.group.ignore=!1})),o}xt(this.id)},it.getConnectedDataURL=function(t){if(this._disposed)xt(this.id);else if(a.canvasSupported){var e="svg"===t.type,n=this.group,i=Math.min,s=Math.max,l=1/0;if(Nt[n]){var u=l,c=l,h=-l,d=-l,f=[],p=t&&t.pixelRatio||1;o.each(Pt,(function(r,a){if(r.group===n){var l=e?r.getZr().painter.getSvgDom().innerHTML:r.getRenderedCanvas(o.clone(t)),p=r.getDom().getBoundingClientRect();u=i(p.left,u),c=i(p.top,c),h=s(p.right,h),d=s(p.bottom,d),f.push({dom:l,left:p.left,top:p.top})}})),u*=p,c*=p,h*=p,d*=p;var m=h-u,v=d-c,g=o.createCanvas(),y=r.init(g,{renderer:e?"svg":"canvas"});if(y.resize({width:m,height:v}),e){var b="";return M(f,(function(t){var e=t.left-u,n=t.top-c;b+=''+t.dom+""})),y.painter.getSvgRoot().innerHTML=b,t.connectedBackgroundColor&&y.painter.setBackgroundColor(t.connectedBackgroundColor),y.refreshImmediately(),y.painter.toDataURL()}return t.connectedBackgroundColor&&y.add(new x.Rect({shape:{x:0,y:0,width:m,height:v},style:{fill:t.connectedBackgroundColor}})),M(f,(function(t){var e=new x.Image({style:{x:t.left*p-u,y:t.top*p-c,image:t.dom}});y.add(e)})),y.refreshImmediately(),g.toDataURL("image/"+(t&&t.type||"png"))}return this.getDataURL(t)}},it.convertToPixel=o.curry(rt,"convertToPixel"),it.convertFromPixel=o.curry(rt,"convertFromPixel"),it.containPixel=function(t,e){if(!this._disposed){var n,i=this._model;return t=_.parseFinder(i,t),o.each(t,(function(t,i){i.indexOf("Models")>=0&&o.each(t,(function(t){var r=t.coordinateSystem;if(r&&r.containPoint)n|=!!r.containPoint(e);else if("seriesModels"===i){var o=this._chartsMap[t.__viewId];o&&o.containPoint&&(n|=o.containPoint(e,t))}}),this)}),this),!!n}xt(this.id)},it.getVisual=function(t,e){var n=this._model;t=_.parseFinder(n,t,{defaultMainType:"series"});var i=t.seriesModel,r=i.getData(),o=t.hasOwnProperty("dataIndexInside")?t.dataIndexInside:t.hasOwnProperty("dataIndex")?r.indexOfRawIndex(t.dataIndex):null;return null!=o?r.getItemVisual(o,e):r.getVisual(e)},it.getViewOfComponentModel=function(t){return this._componentsMap[t.__viewId]},it.getViewOfSeriesModel=function(t){return this._chartsMap[t.__viewId]};var ot={prepareAndUpdate:function(t){st(this),ot.update.call(this,t)},update:function(t){var e=this._model,n=this._api,i=this._zr,r=this._coordSysMgr,o=this._scheduler;if(e){o.restoreData(e,t),o.performSeriesTasks(e),r.create(e,n),o.performDataProcessorTasks(e,t),lt(this,e),r.update(e,n),pt(e),o.performVisualTasks(e,t),mt(this,e,n,t);var l=e.get("backgroundColor")||"transparent";if(a.canvasSupported)i.setBackgroundColor(l);else{var u=s.parse(l);l=s.stringify(u,"rgb"),0===u[3]&&(l="transparent")}yt(e,n)}},updateTransform:function(t){var e=this._model,n=this,i=this._api;if(e){var r=[];e.eachComponent((function(o,s){var a=n.getViewOfComponentModel(s);if(a&&a.__alive)if(a.updateTransform){var l=a.updateTransform(s,e,i,t);l&&l.update&&r.push(a)}else r.push(a)}));var s=o.createHashMap();e.eachSeries((function(r){var o=n._chartsMap[r.__viewId];if(o.updateTransform){var a=o.updateTransform(r,e,i,t);a&&a.update&&s.set(r.uid,1)}else s.set(r.uid,1)})),pt(e),this._scheduler.performVisualTasks(e,t,{setDirty:!0,dirtyMap:s}),gt(n,e,i,t,s),yt(e,this._api)}},updateView:function(t){var e=this._model;e&&(b.markUpdateMethod(t,"updateView"),pt(e),this._scheduler.performVisualTasks(e,t,{setDirty:!0}),mt(this,this._model,this._api,t),yt(e,this._api))},updateVisual:function(t){ot.update.call(this,t)},updateLayout:function(t){ot.update.call(this,t)}};function st(t){var e=t._model,n=t._scheduler;n.restorePipelines(e),n.prepareStageTasks(),ft(t,"component",e,n),ft(t,"chart",e,n),n.plan()}function at(t,e,n,i,r){var s=t._model;if(i){var a={};a[i+"Id"]=n[i+"Id"],a[i+"Index"]=n[i+"Index"],a[i+"Name"]=n[i+"Name"];var l={mainType:i,query:a};r&&(l.subType=r);var u=n.excludeSeriesId;null!=u&&(u=o.createHashMap(_.normalizeToArray(u))),s&&s.eachComponent(l,(function(e){u&&null!=u.get(e.id)||c(t["series"===i?"_chartsMap":"_componentsMap"][e.__viewId])}),t)}else M(t._componentsViews.concat(t._chartsViews),c);function c(i){i&&i.__alive&&i[e]&&i[e](i.__model,s,t._api,n)}}function lt(t,e){var n=t._chartsMap,i=t._scheduler;e.eachSeries((function(t){i.updateStreamModes(t,n[t.__viewId])}))}function ut(t,e){var n=t.type,i=t.escapeConnect,r=Tt[n],s=r.actionInfo,a=(s.update||"update").split(":"),l=a.pop();a=null!=a[0]&&N(a[0]),this[K]=!0;var u=[t],c=!1;t.batch&&(c=!0,u=o.map(t.batch,(function(e){return e=o.defaults(o.extend({},e),t),e.batch=null,e})));var h,d=[],f="highlight"===n||"downplay"===n;M(u,(function(t){h=r.action(t,this._model,this._api),h=h||o.extend({},t),h.type=s.event||h.type,d.push(h),f?at(this,l,t,"series"):a&&at(this,l,t,a.main,a.sub)}),this),"none"===l||f||a||(this[Z]?(st(this),ot.update.call(this,t),this[Z]=!1):ot[l].call(this,t)),h=c?{type:s.event||n,escapeConnect:i,batch:d}:d[0],this[K]=!1,!e&&this._messageCenter.trigger(h.type,h)}function ct(t){var e=this._pendingActions;while(e.length){var n=e.shift();ut.call(this,n,t)}}function ht(t){!t&&this.trigger("updated")}function dt(t,e){t.on("rendered",(function(){e.trigger("rendered"),!t.animation.isFinished()||e[Z]||e._scheduler.unfinished||e._pendingActions.length||e.trigger("finished")}))}function ft(t,e,n,i){for(var r="component"===e,o=r?t._componentsViews:t._chartsViews,s=r?t._componentsMap:t._chartsMap,a=t._zr,l=t._api,u=0;ue.get("hoverLayerThreshold")&&!a.node&&e.eachSeries((function(e){if(!e.preventUsingHoverLayer){var n=t._chartsMap[e.__viewId];n.__alive&&n.group.traverse((function(t){t.useHoverLayer=!0}))}}))}function wt(t,e){var n=t.get("blendMode")||null;e.group.traverse((function(t){t.isGroup||t.style.blend!==n&&t.setStyle("blend",n),t.eachPendingDisplayable&&t.eachPendingDisplayable((function(t){t.setStyle("blend",n)}))}))}function St(t,e){var n=t.get("z"),i=t.get("zlevel");e.group.traverse((function(t){"group"!==t.type&&(null!=n&&(t.z=n),null!=i&&(t.zlevel=i))}))}function Ct(t){var e=t._coordSysMgr;return o.extend(new h(t),{getCoordinateSystems:o.bind(e.getCoordinateSystems,e),getComponentByElement:function(e){while(e){var n=e.__ecComponentInfo;if(null!=n)return t._model.getComponent(n.mainType,n.index);e=e.parent}}})}function Et(){this.eventInfo}it._initEvents=function(){M(bt,(function(t){var e=function(e){var n,i=this.getModel(),r=e.target,s="globalout"===t;if(s)n={};else if(r&&null!=r.dataIndex){var a=r.dataModel||i.getSeriesByIndex(r.seriesIndex);n=a&&a.getDataParams(r.dataIndex,r.dataType,r)||{}}else r&&r.eventData&&(n=o.extend({},r.eventData));if(n){var l=n.componentType,u=n.componentIndex;"markLine"!==l&&"markPoint"!==l&&"markArea"!==l||(l="series",u=n.seriesIndex);var c=l&&null!=u&&i.getComponent(l,u),h=c&&this["series"===c.mainType?"_chartsMap":"_componentsMap"][c.__viewId];n.event=e,n.type=t,this._ecEventProcessor.eventInfo={targetEl:r,packedEvent:n,model:c,view:h},this.trigger(t,n)}};e.zrEventfulCallAtLast=!0,this._zr.on(t,e,this)}),this),M(kt,(function(t,e){this._messageCenter.on(e,(function(t){this.trigger(e,t)}),this)}),this)},it.isDisposed=function(){return this._disposed},it.clear=function(){this._disposed?xt(this.id):this.setOption({series:[]},!0)},it.dispose=function(){if(this._disposed)xt(this.id);else{this._disposed=!0,_.setAttribute(this.getDom(),Rt,"");var t=this._api,e=this._model;M(this._componentsViews,(function(n){n.dispose(e,t)})),M(this._chartsViews,(function(n){n.dispose(e,t)})),this._zr.dispose(),delete Pt[this.id]}},o.mixin(nt,u),Et.prototype={constructor:Et,normalizeQuery:function(t){var e={},n={},i={};if(o.isString(t)){var r=N(t);e.mainType=r.main||null,e.subType=r.sub||null}else{var s=["Index","Name","Id"],a={name:1,dataIndex:1,dataType:1};o.each(t,(function(t,r){for(var o=!1,l=0;l0&&c===r.length-u.length){var h=r.slice(0,c);"data"!==h&&(e.mainType=h,e[u.toLowerCase()]=t,o=!0)}}a.hasOwnProperty(r)&&(n[r]=t,o=!0),o||(i[r]=t)}))}return{cptQuery:e,dataQuery:n,otherQuery:i}},filter:function(t,e,n){var i=this.eventInfo;if(!i)return!0;var r=i.targetEl,o=i.packedEvent,s=i.model,a=i.view;if(!s||!a)return!0;var l=e.cptQuery,u=e.dataQuery;return c(l,s,"mainType")&&c(l,s,"subType")&&c(l,s,"index","componentIndex")&&c(l,s,"name")&&c(l,s,"id")&&c(u,o,"name")&&c(u,o,"dataIndex")&&c(u,o,"dataType")&&(!a.filterForExposedEvent||a.filterForExposedEvent(t,e.otherQuery,r,o));function c(t,e,n,i){return null==t[n]||e[i||n]===t[n]}},afterTrigger:function(){this.eventInfo=null}};var Tt={},kt={},At=[],Dt=[],Ot=[],It=[],Mt={},jt={},Pt={},Nt={},Vt=new Date-0,Ft=new Date-0,Rt="_echarts_instance_";function Lt(t){var e=0,n=1,i=2,r="__connectUpdateStatus";function o(t,e){for(var n=0;n255?255:t}function s(t){return t=Math.round(t),t<0?0:t>360?360:t}function a(t){return t<0?0:t>1?1:t}function l(t){return t.length&&"%"===t.charAt(t.length-1)?o(parseFloat(t)/100*255):o(parseInt(t,10))}function u(t){return t.length&&"%"===t.charAt(t.length-1)?a(parseFloat(t)/100):a(parseFloat(t))}function c(t,e,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?t+(e-t)*n*6:2*n<1?e:3*n<2?t+(e-t)*(2/3-n)*6:t}function h(t,e,n){return t+(e-t)*n}function d(t,e,n,i,r){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t}function f(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}var p=new i(20),m=null;function v(t,e){m&&f(m,e),m=p.put(t,m||e.slice())}function g(t,e){if(t){e=e||[];var n=p.get(t);if(n)return f(e,n);t+="";var i=t.replace(/ /g,"").toLowerCase();if(i in r)return f(e,r[i]),v(t,e),e;if("#"!==i.charAt(0)){var o=i.indexOf("("),s=i.indexOf(")");if(-1!==o&&s+1===i.length){var a=i.substr(0,o),c=i.substr(o+1,s-(o+1)).split(","),h=1;switch(a){case"rgba":if(4!==c.length)return void d(e,0,0,0,1);h=u(c.pop());case"rgb":return 3!==c.length?void d(e,0,0,0,1):(d(e,l(c[0]),l(c[1]),l(c[2]),h),v(t,e),e);case"hsla":return 4!==c.length?void d(e,0,0,0,1):(c[3]=u(c[3]),y(c,e),v(t,e),e);case"hsl":return 3!==c.length?void d(e,0,0,0,1):(y(c,e),v(t,e),e);default:return}}d(e,0,0,0,1)}else{if(4===i.length){var m=parseInt(i.substr(1),16);return m>=0&&m<=4095?(d(e,(3840&m)>>4|(3840&m)>>8,240&m|(240&m)>>4,15&m|(15&m)<<4,1),v(t,e),e):void d(e,0,0,0,1)}if(7===i.length){m=parseInt(i.substr(1),16);return m>=0&&m<=16777215?(d(e,(16711680&m)>>16,(65280&m)>>8,255&m,1),v(t,e),e):void d(e,0,0,0,1)}}}}function y(t,e){var n=(parseFloat(t[0])%360+360)%360/360,i=u(t[1]),r=u(t[2]),s=r<=.5?r*(i+1):r+i-r*i,a=2*r-s;return e=e||[],d(e,o(255*c(a,s,n+1/3)),o(255*c(a,s,n)),o(255*c(a,s,n-1/3)),1),4===t.length&&(e[3]=t[3]),e}function b(t){if(t){var e,n,i=t[0]/255,r=t[1]/255,o=t[2]/255,s=Math.min(i,r,o),a=Math.max(i,r,o),l=a-s,u=(a+s)/2;if(0===l)e=0,n=0;else{n=u<.5?l/(a+s):l/(2-a-s);var c=((a-i)/6+l/2)/l,h=((a-r)/6+l/2)/l,d=((a-o)/6+l/2)/l;i===a?e=d-h:r===a?e=1/3+c-d:o===a&&(e=2/3+h-c),e<0&&(e+=1),e>1&&(e-=1)}var f=[360*e,n,u];return null!=t[3]&&f.push(t[3]),f}}function x(t,e){var n=g(t);if(n){for(var i=0;i<3;i++)n[i]=e<0?n[i]*(1-e)|0:(255-n[i])*e+n[i]|0,n[i]>255?n[i]=255:t[i]<0&&(n[i]=0);return A(n,4===n.length?"rgba":"rgb")}}function _(t){var e=g(t);if(e)return((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1)}function w(t,e,n){if(e&&e.length&&t>=0&&t<=1){n=n||[];var i=t*(e.length-1),r=Math.floor(i),s=Math.ceil(i),l=e[r],u=e[s],c=i-r;return n[0]=o(h(l[0],u[0],c)),n[1]=o(h(l[1],u[1],c)),n[2]=o(h(l[2],u[2],c)),n[3]=a(h(l[3],u[3],c)),n}}var S=w;function C(t,e,n){if(e&&e.length&&t>=0&&t<=1){var i=t*(e.length-1),r=Math.floor(i),s=Math.ceil(i),l=g(e[r]),u=g(e[s]),c=i-r,d=A([o(h(l[0],u[0],c)),o(h(l[1],u[1],c)),o(h(l[2],u[2],c)),a(h(l[3],u[3],c))],"rgba");return n?{color:d,leftIndex:r,rightIndex:s,value:i}:d}}var E=C;function T(t,e,n,i){if(t=g(t),t)return t=b(t),null!=e&&(t[0]=s(e)),null!=n&&(t[1]=u(n)),null!=i&&(t[2]=u(i)),A(y(t),"rgba")}function k(t,e){if(t=g(t),t&&null!=e)return t[3]=a(e),A(t,"rgba")}function A(t,e){if(t&&t.length){var n=t[0]+","+t[1]+","+t[2];return"rgba"!==e&&"hsva"!==e&&"hsla"!==e||(n+=","+t[3]),e+"("+n+")"}}e.parse=g,e.lift=x,e.toHex=_,e.fastLerp=w,e.fastMapToColor=S,e.lerp=C,e.mapToColor=E,e.modifyHSL=T,e.modifyAlpha=k,e.stringify=A},4245:function(t,e,n){var i=n("1290");function r(t,e){var n=t.__data__;return i(e)?n["string"==typeof e?"string":"hash"]:n.map}t.exports=r},"428f":function(t,e,n){var i=n("da84");t.exports=i},"42e5":function(t,e){var n=function(t){this.colorStops=t||[]};n.prototype={constructor:n,addColorStop:function(t,e){this.colorStops.push({offset:t,color:e})}};var i=n;t.exports=i},"42f6":function(t,e,n){var i=n("3eba"),r=n("6d8b"),o=n("22d1"),s=n("07d7"),a=n("82f9"),l=n("eda2"),u=n("3842"),c=n("2306"),h=n("133d"),d=n("f934"),f=n("4319"),p=n("17d6"),m=n("697e"),v=n("ff2e"),g=n("e0d3"),y=g.getTooltipRenderMode,b=r.bind,x=r.each,_=u.parsePercent,w=new c.Rect({shape:{x:-1,y:-1,width:2,height:2}}),S=i.extendComponentView({type:"tooltip",init:function(t,e){if(!o.node){var n,i=t.getComponent("tooltip"),r=i.get("renderMode");this._renderMode=y(r),"html"===this._renderMode?(n=new s(e.getDom(),e,{appendToBody:i.get("appendToBody",!0)}),this._newLine="
"):(n=new a(e),this._newLine="\n"),this._tooltipContent=n}},render:function(t,e,n){if(!o.node){this.group.removeAll(),this._tooltipModel=t,this._ecModel=e,this._api=n,this._lastDataByCoordSys=null,this._alwaysShowContent=t.get("alwaysShowContent");var i=this._tooltipContent;i.update(),i.setEnterable(t.get("enterable")),this._initGlobalListener(),this._keepShow()}},_initGlobalListener:function(){var t=this._tooltipModel,e=t.get("triggerOn");p.register("itemTooltip",this._api,b((function(t,n,i){"none"!==e&&(e.indexOf(t)>=0?this._tryShow(n,i):"leave"===t&&this._hide(i))}),this))},_keepShow:function(){var t=this._tooltipModel,e=this._ecModel,n=this._api;if(null!=this._lastX&&null!=this._lastY&&"none"!==t.get("triggerOn")){var i=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout((function(){!n.isDisposed()&&i.manuallyShowTip(t,e,n,{x:i._lastX,y:i._lastY})}))}},manuallyShowTip:function(t,e,n,i){if(i.from!==this.uid&&!o.node){var r=E(i,n);this._ticket="";var s=i.dataByCoordSys;if(i.tooltip&&null!=i.x&&null!=i.y){var a=w;a.position=[i.x,i.y],a.update(),a.tooltip=i.tooltip,this._tryShow({offsetX:i.x,offsetY:i.y,target:a},r)}else if(s)this._tryShow({offsetX:i.x,offsetY:i.y,position:i.position,dataByCoordSys:i.dataByCoordSys,tooltipOption:i.tooltipOption},r);else if(null!=i.seriesIndex){if(this._manuallyAxisShowTip(t,e,n,i))return;var l=h(i,e),u=l.point[0],c=l.point[1];null!=u&&null!=c&&this._tryShow({offsetX:u,offsetY:c,position:i.position,target:l.el},r)}else null!=i.x&&null!=i.y&&(n.dispatchAction({type:"updateAxisPointer",x:i.x,y:i.y}),this._tryShow({offsetX:i.x,offsetY:i.y,position:i.position,target:n.getZr().findHover(i.x,i.y).target},r))}},manuallyHideTip:function(t,e,n,i){var r=this._tooltipContent;!this._alwaysShowContent&&this._tooltipModel&&r.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=null,i.from!==this.uid&&this._hide(E(i,n))},_manuallyAxisShowTip:function(t,e,n,i){var r=i.seriesIndex,o=i.dataIndex,s=e.getComponent("axisPointer").coordSysAxesInfo;if(null!=r&&null!=o&&null!=s){var a=e.getSeriesByIndex(r);if(a){var l=a.getData();t=C([l.getItemModel(o),a,(a.coordinateSystem||{}).model,t]);if("axis"===t.get("trigger"))return n.dispatchAction({type:"updateAxisPointer",seriesIndex:r,dataIndex:o,position:i.position}),!0}}},_tryShow:function(t,e){var n=t.target,i=this._tooltipModel;if(i){this._lastX=t.offsetX,this._lastY=t.offsetY;var r=t.dataByCoordSys;r&&r.length?this._showAxisTooltip(r,t):n&&null!=n.dataIndex?(this._lastDataByCoordSys=null,this._showSeriesItemTooltip(t,n,e)):n&&n.tooltip?(this._lastDataByCoordSys=null,this._showComponentItemTooltip(t,n,e)):(this._lastDataByCoordSys=null,this._hide(e))}},_showOrMove:function(t,e){var n=t.get("showDelay");e=r.bind(e,this),clearTimeout(this._showTimout),n>0?this._showTimout=setTimeout(e,n):e()},_showAxisTooltip:function(t,e){var n=this._ecModel,i=this._tooltipModel,o=[e.offsetX,e.offsetY],s=[],a=[],u=C([e.tooltipOption,i]),c=this._renderMode,h=this._newLine,d={};x(t,(function(t){x(t.dataByAxis,(function(t){var e=n.getComponent(t.axisDim+"Axis",t.axisIndex),i=t.value,o=[];if(e&&null!=i){var u=v.getValueLabel(i,e.axis,n,t.seriesDataIndices,t.valueLabelOpt);r.each(t.seriesDataIndices,(function(s){var l=n.getSeriesByIndex(s.seriesIndex),h=s.dataIndexInside,f=l&&l.getDataParams(h);if(f.axisDim=t.axisDim,f.axisIndex=t.axisIndex,f.axisType=t.axisType,f.axisId=t.axisId,f.axisValue=m.getAxisRawValue(e.axis,i),f.axisValueLabel=u,f){a.push(f);var p,v=l.formatTooltip(h,!0,null,c);if(r.isObject(v)){p=v.html;var g=v.markers;r.merge(d,g)}else p=v;o.push(p)}}));var f=u;"html"!==c?s.push(o.join(h)):s.push((f?l.encodeHTML(f)+h:"")+o.join(h))}}))}),this),s.reverse(),s=s.join(this._newLine+this._newLine);var f=e.position;this._showOrMove(u,(function(){this._updateContentNotChangedOnAxis(t)?this._updatePosition(u,f,o[0],o[1],this._tooltipContent,a):this._showTooltipContent(u,s,a,Math.random(),o[0],o[1],f,void 0,d)}))},_showSeriesItemTooltip:function(t,e,n){var i=this._ecModel,o=e.seriesIndex,s=i.getSeriesByIndex(o),a=e.dataModel||s,l=e.dataIndex,u=e.dataType,c=a.getData(u),h=C([c.getItemModel(l),a,s&&(s.coordinateSystem||{}).model,this._tooltipModel]),d=h.get("trigger");if(null==d||"item"===d){var f,p,m=a.getDataParams(l,u),v=a.formatTooltip(l,!1,u,this._renderMode);r.isObject(v)?(f=v.html,p=v.markers):(f=v,p=null);var g="item_"+a.name+"_"+l;this._showOrMove(h,(function(){this._showTooltipContent(h,f,m,g,t.offsetX,t.offsetY,t.position,t.target,p)})),n({type:"showTip",dataIndexInside:l,dataIndex:c.getRawIndex(l),seriesIndex:o,from:this.uid})}},_showComponentItemTooltip:function(t,e,n){var i=e.tooltip;if("string"===typeof i){var r=i;i={content:r,formatter:r}}var o=new f(i,this._tooltipModel,this._ecModel),s=o.get("content"),a=Math.random();this._showOrMove(o,(function(){this._showTooltipContent(o,s,o.get("formatterParams")||{},a,t.offsetX,t.offsetY,t.position,e)})),n({type:"showTip",from:this.uid})},_showTooltipContent:function(t,e,n,i,r,o,s,a,u){if(this._ticket="",t.get("showContent")&&t.get("show")){var c=this._tooltipContent,h=t.get("formatter");s=s||t.get("position");var d=e;if(h&&"string"===typeof h)d=l.formatTpl(h,n,!0);else if("function"===typeof h){var f=b((function(e,i){e===this._ticket&&(c.setContent(i,u,t),this._updatePosition(t,s,r,o,c,n,a))}),this);this._ticket=i,d=h(n,i,f)}c.setContent(d,u,t),c.show(t),this._updatePosition(t,s,r,o,c,n,a)}},_updatePosition:function(t,e,n,i,o,s,a){var l=this._api.getWidth(),u=this._api.getHeight();e=e||t.get("position");var c=o.getSize(),h=t.get("align"),f=t.get("verticalAlign"),p=a&&a.getBoundingRect().clone();if(a&&p.applyTransform(a.transform),"function"===typeof e&&(e=e([n,i],s,o.el,p,{viewSize:[l,u],contentSize:c.slice()})),r.isArray(e))n=_(e[0],l),i=_(e[1],u);else if(r.isObject(e)){e.width=c[0],e.height=c[1];var m=d.getLayoutRect(e,{width:l,height:u});n=m.x,i=m.y,h=null,f=null}else if("string"===typeof e&&a){var v=A(e,p,c);n=v[0],i=v[1]}else{v=T(n,i,o,l,u,h?null:20,f?null:20);n=v[0],i=v[1]}if(h&&(n-=D(h)?c[0]/2:"right"===h?c[0]:0),f&&(i-=D(f)?c[1]/2:"bottom"===f?c[1]:0),t.get("confine")){v=k(n,i,o,l,u);n=v[0],i=v[1]}o.moveTo(n,i)},_updateContentNotChangedOnAxis:function(t){var e=this._lastDataByCoordSys,n=!!e&&e.length===t.length;return n&&x(e,(function(e,i){var r=e.dataByAxis||{},o=t[i]||{},s=o.dataByAxis||[];n&=r.length===s.length,n&&x(r,(function(t,e){var i=s[e]||{},r=t.seriesDataIndices||[],o=i.seriesDataIndices||[];n&=t.value===i.value&&t.axisType===i.axisType&&t.axisId===i.axisId&&r.length===o.length,n&&x(r,(function(t,e){var i=o[e];n&=t.seriesIndex===i.seriesIndex&&t.dataIndex===i.dataIndex}))}))})),this._lastDataByCoordSys=t,!!n},_hide:function(t){this._lastDataByCoordSys=null,t({type:"hideTip",from:this.uid})},dispose:function(t,e){o.node||(this._tooltipContent.dispose(),p.unregister("itemTooltip",e))}});function C(t){var e=t.pop();while(t.length){var n=t.pop();n&&(f.isInstance(n)&&(n=n.get("tooltip",!0)),"string"===typeof n&&(n={formatter:n}),e=new f(n,e,e.ecModel))}return e}function E(t,e){return t.dispatchAction||r.bind(e.dispatchAction,e)}function T(t,e,n,i,r,o,s){var a=n.getOuterSize(),l=a.width,u=a.height;return null!=o&&(t+l+o>i?t-=l+o:t+=o),null!=s&&(e+u+s>r?e-=u+s:e+=s),[t,e]}function k(t,e,n,i,r){var o=n.getOuterSize(),s=o.width,a=o.height;return t=Math.min(t+s,i)-s,e=Math.min(e+a,r)-a,t=Math.max(t,0),e=Math.max(e,0),[t,e]}function A(t,e,n){var i=n[0],r=n[1],o=5,s=0,a=0,l=e.width,u=e.height;switch(t){case"inside":s=e.x+l/2-i/2,a=e.y+u/2-r/2;break;case"top":s=e.x+l/2-i/2,a=e.y-r-o;break;case"bottom":s=e.x+l/2-i/2,a=e.y+u+o;break;case"left":s=e.x-i-o,a=e.y+u/2-r/2;break;case"right":s=e.x+l+o,a=e.y+u/2-r/2}return[s,a]}function D(t){return"center"===t||"middle"===t}t.exports=S},4319:function(t,e,n){var i=n("6d8b"),r=n("22d1"),o=n("e0d3"),s=o.makeInner,a=n("625e"),l=a.enableClassExtend,u=a.enableClassCheck,c=n("3901"),h=n("9bdb"),d=n("fe21"),f=n("551f"),p=i.mixin,m=s();function v(t,e,n){this.parentModel=e,this.ecModel=n,this.option=t}function g(t,e,n){for(var i=0;i-l&&tl||t<-l}function g(t,e,n,i,r){var o=1-r;return o*o*(o*t+3*r*e)+r*r*(r*i+3*o*n)}function y(t,e,n,i,r){var o=1-r;return 3*(((e-t)*o+2*(n-e)*r)*o+(i-n)*r*r)}function b(t,e,n,i,r,o){var l=i+3*(e-n)-t,u=3*(n-2*e+t),d=3*(e-t),f=t-r,p=u*u-3*l*d,v=u*d-9*l*f,g=d*d-3*u*f,y=0;if(m(p)&&m(v))if(m(u))o[0]=0;else{var b=-d/u;b>=0&&b<=1&&(o[y++]=b)}else{var x=v*v-4*p*g;if(m(x)){var _=v/p,w=(b=-u/l+_,-_/2);b>=0&&b<=1&&(o[y++]=b),w>=0&&w<=1&&(o[y++]=w)}else if(x>0){var S=a(x),C=p*u+1.5*l*(-v+S),E=p*u+1.5*l*(-v-S);C=C<0?-s(-C,h):s(C,h),E=E<0?-s(-E,h):s(E,h);b=(-u-(C+E))/(3*l);b>=0&&b<=1&&(o[y++]=b)}else{var T=(2*p*u-3*l*v)/(2*a(p*p*p)),k=Math.acos(T)/3,A=a(p),D=Math.cos(k),O=(b=(-u-2*A*D)/(3*l),w=(-u+A*(D+c*Math.sin(k)))/(3*l),(-u+A*(D-c*Math.sin(k)))/(3*l));b>=0&&b<=1&&(o[y++]=b),w>=0&&w<=1&&(o[y++]=w),O>=0&&O<=1&&(o[y++]=O)}}return y}function x(t,e,n,i,r){var o=6*n-12*e+6*t,s=9*e+3*i-3*t-9*n,l=3*e-3*t,u=0;if(m(s)){if(v(o)){var c=-l/o;c>=0&&c<=1&&(r[u++]=c)}}else{var h=o*o-4*s*l;if(m(h))r[0]=-o/(2*s);else if(h>0){var d=a(h),f=(c=(-o+d)/(2*s),(-o-d)/(2*s));c>=0&&c<=1&&(r[u++]=c),f>=0&&f<=1&&(r[u++]=f)}}return u}function _(t,e,n,i,r,o){var s=(e-t)*r+t,a=(n-e)*r+e,l=(i-n)*r+n,u=(a-s)*r+s,c=(l-a)*r+a,h=(c-u)*r+u;o[0]=t,o[1]=s,o[2]=u,o[3]=h,o[4]=h,o[5]=c,o[6]=l,o[7]=i}function w(t,e,n,i,r,s,l,c,h,m,v){var y,b,x,_,w,S=.005,C=1/0;d[0]=h,d[1]=m;for(var E=0;E<1;E+=.05)f[0]=g(t,n,r,l,E),f[1]=g(e,i,s,c,E),_=o(d,f),_=0&&_=0&&c<=1&&(r[u++]=c)}}else{var h=s*s-4*o*l;if(m(h)){c=-s/(2*o);c>=0&&c<=1&&(r[u++]=c)}else if(h>0){var d=a(h),f=(c=(-s+d)/(2*o),(-s-d)/(2*o));c>=0&&c<=1&&(r[u++]=c),f>=0&&f<=1&&(r[u++]=f)}}return u}function T(t,e,n){var i=t+n-2*e;return 0===i?.5:(t-e)/i}function k(t,e,n,i,r){var o=(e-t)*i+t,s=(n-e)*i+e,a=(s-o)*i+o;r[0]=t,r[1]=o,r[2]=a,r[3]=a,r[4]=s,r[5]=n}function A(t,e,n,i,r,s,l,c,h){var m,v=.005,g=1/0;d[0]=l,d[1]=c;for(var y=0;y<1;y+=.05){f[0]=S(t,n,r,y),f[1]=S(e,i,s,y);var b=o(d,f);b=0&&bc)if(a=l[c++],a!=a)return!0}else for(;u>c;c++)if((t||c in l)&&l[c]===n)return t||c||0;return!t&&-1}};t.exports={includes:s(!0),indexOf:s(!1)}},"4e08":function(t,e,n){(function(t){var n;"undefined"!==typeof window?n=window.__DEV__:"undefined"!==typeof t&&(n=t.__DEV__),"undefined"===typeof n&&(n=!0);var i=n;e.__DEV__=i}).call(this,n("c8ba"))},"4eb5":function(t,e,n){var i=n("6981"),r={autoSetContainer:!1},o={install:function(t){t.prototype.$clipboardConfig=r,t.prototype.$copyText=function(t,e){return new Promise((function(n,r){var o=document.createElement("button"),s=new i(o,{text:function(){return t},action:function(){return"copy"},container:"object"===typeof e?e:document.body});s.on("success",(function(t){s.destroy(),n(t)})),s.on("error",(function(t){s.destroy(),r(t)})),o.click()}))},t.directive("clipboard",{bind:function(t,e,n){if("success"===e.arg)t._v_clipboard_success=e.value;else if("error"===e.arg)t._v_clipboard_error=e.value;else{var o=new i(t,{text:function(){return e.value},action:function(){return"cut"===e.arg?"cut":"copy"},container:r.autoSetContainer?t:void 0});o.on("success",(function(e){var n=t._v_clipboard_success;n&&n(e)})),o.on("error",(function(e){var n=t._v_clipboard_error;n&&n(e)})),t._v_clipboard=o}},update:function(t,e){"success"===e.arg?t._v_clipboard_success=e.value:"error"===e.arg?t._v_clipboard_error=e.value:(t._v_clipboard.text=function(){return e.value},t._v_clipboard.action=function(){return"cut"===e.arg?"cut":"copy"})},unbind:function(t,e){"success"===e.arg?delete t._v_clipboard_success:"error"===e.arg?delete t._v_clipboard_error:(t._v_clipboard.destroy(),delete t._v_clipboard)}})},config:r};t.exports=o},"4f85":function(t,e,n){var i=n("4e08"),r=(i.__DEV__,n("6d8b")),o=n("22d1"),s=n("eda2"),a=s.formatTime,l=s.encodeHTML,u=s.addCommas,c=s.getTooltipMarker,h=n("e0d3"),d=n("6cb7"),f=n("e47b"),p=n("38a2"),m=n("f934"),v=m.getLayoutParams,g=m.mergeLayoutParam,y=n("f47d"),b=y.createTask,x=n("0f99"),_=x.prepareSource,w=x.getSource,S=n("2b17"),C=S.retrieveRawValue,E=h.makeInner(),T=d.extend({type:"series.__base__",seriesIndex:0,coordinateSystem:null,defaultOption:null,legendVisualProvider:null,visualColorAccessPath:"itemStyle.color",visualBorderColorAccessPath:"itemStyle.borderColor",layoutMode:null,init:function(t,e,n,i){this.seriesIndex=this.componentIndex,this.dataTask=b({count:D,reset:O}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(t,n),_(this);var r=this.getInitialData(t,n);M(r,this),this.dataTask.context.data=r,E(this).dataBeforeProcessed=r,k(this)},mergeDefaultAndTheme:function(t,e){var n=this.layoutMode,i=n?v(t):{},o=this.subType;d.hasClass(o)&&(o+="Series"),r.merge(t,e.getTheme().get(this.subType)),r.merge(t,this.getDefaultOption()),h.defaultEmphasis(t,"label",["show"]),this.fillDataTextStyle(t.data),n&&g(t,i,n)},mergeOption:function(t,e){t=r.merge(this.option,t,!0),this.fillDataTextStyle(t.data);var n=this.layoutMode;n&&g(this.option,t,n),_(this);var i=this.getInitialData(t,e);M(i,this),this.dataTask.dirty(),this.dataTask.context.data=i,E(this).dataBeforeProcessed=i,k(this)},fillDataTextStyle:function(t){if(t&&!r.isTypedArray(t))for(var e=["show"],n=0;n":"\n",d="richText"===i,f={},p=0;function m(n){var s=r.reduce(n,(function(t,e,n){var i=g.getDimensionInfo(n);return t|(i&&!1!==i.tooltip&&null!=i.displayName)}),0),h=[];function m(t,n){var r=g.getDimensionInfo(n);if(r&&!1!==r.otherDims.tooltip){var m=r.type,v="sub"+o.seriesIndex+"at"+p,y=c({color:w,type:"subItem",renderMode:i,markerId:v}),b="string"===typeof y?y:y.content,x=(s?b+l(r.displayName||"-")+": ":"")+l("ordinal"===m?t+"":"time"===m?e?"":a("yyyy/MM/dd hh:mm:ss",t):u(t));x&&h.push(x),d&&(f[v]=w,++p)}}y.length?r.each(y,(function(e){m(C(g,t,e),e)})):r.each(n,m);var v=s?d?"\n":"
":"",b=v+h.join(v||", ");return{renderMode:i,content:b,style:f}}function v(t){return{renderMode:i,content:l(u(t)),style:f}}var g=this.getData(),y=g.mapDimension("defaultedTooltip",!0),b=y.length,x=this.getRawValue(t),_=r.isArray(x),w=g.getItemVisual(t,"color");r.isObject(w)&&w.colorStops&&(w=(w.colorStops[0]||{}).color),w=w||"transparent";var S=b>1||_&&!b?m(x):v(b?C(g,t,y[0]):_?x[0]:x),E=S.content,T=o.seriesIndex+"at"+p,k=c({color:w,type:"item",renderMode:i,markerId:T});f[T]=w,++p;var A=g.getName(t),D=this.name;h.isNameSpecified(this)||(D=""),D=D?l(D)+(e?": ":s):"";var O="string"===typeof k?k:k.content,I=e?O+D+E:D+O+(A?l(A)+": "+E:E);return{html:I,markers:f}},isAnimationEnabled:function(){if(o.node)return!1;var t=this.getShallow("animation");return t&&this.getData().count()>this.getShallow("animationThreshold")&&(t=!1),t},restoreData:function(){this.dataTask.dirty()},getColorFromPalette:function(t,e,n){var i=this.ecModel,r=f.getColorFromPalette.call(this,t,e,n);return r||(r=i.getColorFromPalette(t,e,n)),r},coordDimToDataDim:function(t){return this.getRawData().mapDimension(t,!0)},getProgressive:function(){return this.get("progressive")},getProgressiveThreshold:function(){return this.get("progressiveThreshold")},getAxisTooltipData:null,getTooltipPosition:null,pipeTask:null,preventIncremental:null,pipelineContext:null});function k(t){var e=t.name;h.isNameSpecified(t)||(t.name=A(t)||e)}function A(t){var e=t.getRawData(),n=e.mapDimension("seriesName",!0),i=[];return r.each(n,(function(t){var n=e.getDimensionInfo(t);n.displayName&&i.push(n.displayName)})),i.join(" ")}function D(t){return t.model.getRawData().count()}function O(t){var e=t.model;return e.setData(e.getRawData().cloneShallow()),I}function I(t,e){e.outputData&&t.end>e.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function M(t,e){r.each(t.CHANGABLE_METHODS,(function(n){t.wrapMethod(n,r.curry(j,e))}))}function j(t){var e=P(t);e&&e.setOutputEnd(this.count())}function P(t){var e=(t.ecModel||{}).scheduler,n=e&&e.getPipeline(t.uid);if(n){var i=n.currentTask;if(i){var r=i.agentStubMap;r&&(i=r.get(t.uid))}return i}}r.mixin(T,p),r.mixin(T,f);var N=T;t.exports=N},"4fac":function(t,e,n){var i=n("620b"),r=n("9c2c");function o(t,e,n){var o=e.points,s=e.smooth;if(o&&o.length>=2){if(s&&"spline"!==s){var a=r(o,s,n,e.smoothConstraint);t.moveTo(o[0][0],o[0][1]);for(var l=o.length,u=0;u<(n?l:l-1);u++){var c=a[2*u],h=a[2*u+1],d=o[(u+1)%l];t.bezierCurveTo(c[0],c[1],h[0],h[1],d[0],d[1])}}else{"spline"===s&&(o=i(o,n)),t.moveTo(o[0][0],o[0][1]);u=1;for(var f=o.length;u0?r(i(t),9007199254740991):0}},"510d":function(t,e,n){"use strict";var i=n("872a");function r(t){if(null===t)return!1;if(0===t.length)return!1;var e=t,n=/\/([gim]*)$/.exec(t),i="";if("/"===e[0]){if(n&&(i=n[1]),i.length>3)return!1;if("/"!==e[e.length-i.length-1])return!1}return!0}function o(t){var e=t,n=/\/([gim]*)$/.exec(t),i="";return"/"===e[0]&&(n&&(i=n[1]),e=e.slice(1,e.length-i.length-1)),new RegExp(e,i)}function s(t){var e="/"+t.source+"/";return t.global&&(e+="g"),t.multiline&&(e+="m"),t.ignoreCase&&(e+="i"),e}function a(t){return"[object RegExp]"===Object.prototype.toString.call(t)}t.exports=new i("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:r,construct:o,predicate:a,represent:s})},5135:function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},5270:function(t,e,n){"use strict";var i=n("c532"),r=n("c401"),o=n("2e67"),s=n("2444"),a=n("d925"),l=n("e683");function u(t){t.cancelToken&&t.cancelToken.throwIfRequested()}t.exports=function(t){u(t),t.baseURL&&!a(t.url)&&(t.url=l(t.baseURL,t.url)),t.headers=t.headers||{},t.data=r(t.data,t.headers,t.transformRequest),t.headers=i.merge(t.headers.common||{},t.headers[t.method]||{},t.headers||{}),i.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]}));var e=t.adapter||s.adapter;return e(t).then((function(e){return u(t),e.data=r(e.data,e.headers,t.transformResponse),e}),(function(e){return o(e)||(u(t),e&&e.response&&(e.response.data=r(e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))}},5319:function(t,e,n){"use strict";var i=n("d784"),r=n("825a"),o=n("7b0b"),s=n("50c4"),a=n("a691"),l=n("1d80"),u=n("8aa5"),c=n("14c3"),h=Math.max,d=Math.min,f=Math.floor,p=/\$([$&'`]|\d\d?|<[^>]*>)/g,m=/\$([$&'`]|\d\d?)/g,v=function(t){return void 0===t?t:String(t)};i("replace",2,(function(t,e,n,i){var g=i.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,y=i.REPLACE_KEEPS_$0,b=g?"$":"$0";return[function(n,i){var r=l(this),o=void 0==n?void 0:n[t];return void 0!==o?o.call(n,r,i):e.call(String(r),n,i)},function(t,i){if(!g&&y||"string"===typeof i&&-1===i.indexOf(b)){var o=n(e,t,this,i);if(o.done)return o.value}var l=r(t),f=String(this),p="function"===typeof i;p||(i=String(i));var m=l.global;if(m){var _=l.unicode;l.lastIndex=0}var w=[];while(1){var S=c(l,f);if(null===S)break;if(w.push(S),!m)break;var C=String(S[0]);""===C&&(l.lastIndex=u(f,s(l.lastIndex),_))}for(var E="",T=0,k=0;k=T&&(E+=f.slice(T,D)+P,T=D+A.length)}return E+f.slice(T)}];function x(t,n,i,r,s,a){var l=i+t.length,u=r.length,c=m;return void 0!==s&&(s=o(s),c=p),e.call(a,c,(function(e,o){var a;switch(o.charAt(0)){case"$":return"$";case"&":return t;case"`":return n.slice(0,i);case"'":return n.slice(l);case"<":a=s[o.slice(1,-1)];break;default:var c=+o;if(0===c)return e;if(c>u){var h=f(c/10);return 0===h?e:h<=u?void 0===r[h-1]?o.charAt(1):r[h-1]+o.charAt(1):e}a=r[c-1]}return void 0===a?"":a}))}}))},"551f":function(t,e,n){var i=n("282b"),r=i([["fill","color"],["stroke","borderColor"],["lineWidth","borderWidth"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["textPosition"],["textAlign"]]),o={getItemStyle:function(t,e){var n=r(this,t,e),i=this.getBorderLineDash();return i&&(n.lineDash=i),n},getBorderLineDash:function(){var t=this.get("borderType");return"solid"===t||null==t?null:"dashed"===t?[5,5]:[1,1]}};t.exports=o},"562e":function(t,e,n){var i=n("6d8b");function r(t){null!=t&&i.extend(this,t),this.otherDims={}}var o=r;t.exports=o},5692:function(t,e,n){var i=n("c430"),r=n("c6cd");(t.exports=function(t,e){return r[t]||(r[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.6.5",mode:i?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},5693:function(t,e){function n(t,e){var n,i,r,o,s,a=e.x,l=e.y,u=e.width,c=e.height,h=e.r;u<0&&(a+=u,u=-u),c<0&&(l+=c,c=-c),"number"===typeof h?n=i=r=o=h:h instanceof Array?1===h.length?n=i=r=o=h[0]:2===h.length?(n=r=h[0],i=o=h[1]):3===h.length?(n=h[0],i=o=h[1],r=h[2]):(n=h[0],i=h[1],r=h[2],o=h[3]):n=i=r=o=0,n+i>u&&(s=n+i,n*=u/s,i*=u/s),r+o>u&&(s=r+o,r*=u/s,o*=u/s),i+r>c&&(s=i+r,i*=c/s,r*=c/s),n+o>c&&(s=n+o,n*=c/s,o*=c/s),t.moveTo(a+n,l),t.lineTo(a+u-i,l),0!==i&&t.arc(a+u-i,l+i,i,-Math.PI/2,0),t.lineTo(a+u,l+c-r),0!==r&&t.arc(a+u-r,l+c-r,r,0,Math.PI/2),t.lineTo(a+o,l+c),0!==o&&t.arc(a+o,l+c-o,o,Math.PI/2,Math.PI),t.lineTo(a,l+n),0!==n&&t.arc(a+n,l+n,n,Math.PI,1.5*Math.PI)}e.buildPath=n},"56d3":function(t,e,n){"use strict";var i=n("de50");t.exports=i.DEFAULT=new i({include:[n("6771")],explicit:[n("3044"),n("510d"),n("363a")]})},"56ef":function(t,e,n){var i=n("d066"),r=n("241c"),o=n("7418"),s=n("825a");t.exports=i("Reflect","ownKeys")||function(t){var e=r.f(s(t)),n=o.f;return n?e.concat(n(t)):e}},"585a":function(t,e,n){(function(e){var n="object"==typeof e&&e&&e.Object===Object&&e;t.exports=n}).call(this,n("c8ba"))},"58df":function(t,e,n){var i=n("6d8b"),r=n("2306");function o(t,e,n,o){var s=n.axis;if(!s.scale.isBlank()){var a=n.getModel("splitArea"),l=a.getModel("areaStyle"),u=l.get("color"),c=o.coordinateSystem.getRect(),h=s.getTicksCoords({tickModel:a,clamp:!0});if(h.length){var d=u.length,f=t.__splitAreaColors,p=i.createHashMap(),m=0;if(f)for(var v=0;v0?t.charCodeAt(o-1):null,f=f&&U(s,a)}else{for(o=0;oi&&" "!==t[d+1],d=o);else if(!z(s))return K;a=o>0?t.charCodeAt(o-1):null,f=f&&U(s,a)}u=u||h&&o-d-1>i&&" "!==t[d+1]}return l||u?n>9&&q(t)?K:u?J:X:f&&!r(t)?G:Y}function Q(t,e,n,i){t.dump=function(){if(0===e.length)return"''";if(!t.noCompatMode&&-1!==P.indexOf(e))return"'"+e+"'";var o=t.indent*Math.max(1,n),s=-1===t.lineWidth?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-o),a=i||t.flowLevel>-1&&n>=t.flowLevel;function l(e){return B(t,e)}switch(Z(e,a,t.indent,s,l)){case G:return e;case Y:return"'"+e.replace(/'/g,"''")+"'";case X:return"|"+tt(e,t.indent)+et(R(e,o));case J:return">"+tt(e,t.indent)+et(R(nt(e,s),o));case K:return'"'+rt(e,s)+'"';default:throw new r("impossible error: invalid scalar style")}}()}function tt(t,e){var n=q(t)?String(e):"",i="\n"===t[t.length-1],r=i&&("\n"===t[t.length-2]||"\n"===t),o=r?"+":i?"":"-";return n+o+"\n"}function et(t){return"\n"===t[t.length-1]?t.slice(0,-1):t}function nt(t,e){var n,i,r=/(\n+)([^\n]*)/g,o=function(){var n=t.indexOf("\n");return n=-1!==n?n:t.length,r.lastIndex=n,it(t.slice(0,n),e)}(),s="\n"===t[0]||" "===t[0];while(i=r.exec(t)){var a=i[1],l=i[2];n=" "===l[0],o+=a+(s||n||""===l?"":"\n")+it(l,e),s=n}return o}function it(t,e){if(""===t||" "===t[0])return t;var n,i,r=/ [^ ]/g,o=0,s=0,a=0,l="";while(n=r.exec(t))a=n.index,a-o>e&&(i=s>o?s:a,l+="\n"+t.slice(o,i),o=i+1),s=a;return l+="\n",t.length-o>e&&s>o?l+=t.slice(o,s)+"\n"+t.slice(s+1):l+=t.slice(o),l.slice(1)}function rt(t){for(var e,n,i,r="",o=0;o=55296&&e<=56319&&(n=t.charCodeAt(o+1),n>=56320&&n<=57343)?(r+=V(1024*(e-55296)+n-56320+65536),o++):(i=j[e],r+=!i&&z(e)?t[o]:i||V(e));return r}function ot(t,e,n){var i,r,o="",s=t.tag;for(i=0,r=n.length;i1024&&(a+="? "),a+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),ct(t,e,s,!1,!1)&&(a+=t.dump,l+=a));t.tag=u,t.dump="{"+l+"}"}function lt(t,e,n,i){var o,s,a,l,u,h,d="",f=t.tag,p=Object.keys(n);if(!0===t.sortKeys)p.sort();else if("function"===typeof t.sortKeys)p.sort(t.sortKeys);else if(t.sortKeys)throw new r("sortKeys must be a boolean or a function");for(o=0,s=p.length;o1024,u&&(t.dump&&c===t.dump.charCodeAt(0)?h+="?":h+="? "),h+=t.dump,u&&(h+=L(t,e)),ct(t,e+1,l,!0,u)&&(t.dump&&c===t.dump.charCodeAt(0)?h+=":":h+=": ",h+=t.dump,d+=h));t.tag=f,t.dump=d||"{}"}function ut(t,e,n){var i,o,s,u,c,h;for(o=n?t.explicitTypes:t.implicitTypes,s=0,u=o.length;s tag resolver accepts not "'+h+'" style');i=c.represent[h](e,h)}t.dump=i}return!0}return!1}function ct(t,e,n,i,o,s){t.tag=null,t.dump=n,ut(t,n,!1)||ut(t,n,!0);var l=a.call(t.dump);i&&(i=t.flowLevel<0||t.flowLevel>e);var u,c,h="[object Object]"===l||"[object Array]"===l;if(h&&(u=t.duplicates.indexOf(n),c=-1!==u),(null!==t.tag&&"?"!==t.tag||c||2!==t.indent&&e>0)&&(o=!1),c&&t.usedDuplicates[u])t.dump="*ref_"+u;else{if(h&&c&&!t.usedDuplicates[u]&&(t.usedDuplicates[u]=!0),"[object Object]"===l)i&&0!==Object.keys(t.dump).length?(lt(t,e,t.dump,o),c&&(t.dump="&ref_"+u+t.dump)):(at(t,e,t.dump),c&&(t.dump="&ref_"+u+" "+t.dump));else if("[object Array]"===l){var d=t.noArrayIndent&&e>0?e-1:e;i&&0!==t.dump.length?(st(t,d,t.dump,o),c&&(t.dump="&ref_"+u+t.dump)):(ot(t,d,t.dump),c&&(t.dump="&ref_"+u+" "+t.dump))}else{if("[object String]"!==l){if(t.skipInvalid)return!1;throw new r("unacceptable kind of an object to dump "+l)}"?"!==t.tag&&Q(t,t.dump,e,s)}null!==t.tag&&"?"!==t.tag&&(t.dump="!<"+t.tag+"> "+t.dump)}return!0}function ht(t,e){var n,i,r=[],o=[];for(dt(t,r,o),n=0,i=o.length;n=0;if(r){var o="touchend"!==i?e.targetTouches[0]:e.changedTouches[0];o&&h(t,o,e,n)}else h(t,e,e,n),e.zrDelta=e.wheelDelta?e.wheelDelta/120:-(e.detail||0)/3;var s=e.button;return null==e.which&&void 0!==s&&u.test(e.type)&&(e.which=1&s?1:2&s?3:4&s?2:0),e}function m(t,e,n,i){l?t.addEventListener(e,n,i):t.attachEvent("on"+e,n)}function v(t,e,n,i){l?t.removeEventListener(e,n,i):t.detachEvent("on"+e,n)}var g=l?function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0}:function(t){t.returnValue=!1,t.cancelBubble=!0};function y(t){return 2===t.which||3===t.which}function b(t){return t.which>1}e.clientToLocal=h,e.getNativeEvent=f,e.normalizeEvent=p,e.addEventListener=m,e.removeEventListener=v,e.stop=g,e.isMiddleOrRightButtonOnMouseUpDown=y,e.notLeftMouse=b},6179:function(t,e,n){var i=n("4e08"),r=(i.__DEV__,n("6d8b")),o=n("4319"),s=n("80f0"),a=n("ec6f"),l=n("2b17"),u=l.defaultDimValueGetters,c=l.DefaultDataProvider,h=n("2f45"),d=h.summarizeDimensions,f=n("562e"),p=r.isObject,m="undefined",v=-1,g="e\0\0",y={float:typeof Float64Array===m?Array:Float64Array,int:typeof Int32Array===m?Array:Int32Array,ordinal:Array,number:Array,time:Array},b=typeof Uint32Array===m?Array:Uint32Array,x=typeof Int32Array===m?Array:Int32Array,_=typeof Uint16Array===m?Array:Uint16Array;function w(t){return t._rawCount>65535?b:_}function S(t){var e=t.constructor;return e===Array?t.slice():new e(t)}var C=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_rawData","_chunkSize","_chunkCount","_dimValueGetter","_count","_rawCount","_nameDimIdx","_idDimIdx"],E=["_extent","_approximateExtent","_rawExtent"];function T(t,e){r.each(C.concat(e.__wrappedMethods||[]),(function(n){e.hasOwnProperty(n)&&(t[n]=e[n])})),t.__wrappedMethods=e.__wrappedMethods,r.each(E,(function(n){t[n]=r.clone(e[n])})),t._calculationInfo=r.extend(e._calculationInfo)}var k=function(t,e){t=t||["x","y"];for(var n={},i=[],o={},s=0;s=0?this._indices[t]:-1}function P(t,e){var n=t._idList[e];return null==n&&(n=I(t,t._idDimIdx,e)),null==n&&(n=g+e),n}function N(t){return r.isArray(t)||(t=[t]),t}function V(t,e){var n=t.dimensions,i=new k(r.map(n,t.getDimensionInfo,t),t.hostModel);T(i,t);for(var o=i._storage={},s=t._storage,a=0;a=0?(o[l]=F(s[l]),i._rawExtent[l]=R(),i._extent[l]=null):o[l]=s[l])}return i}function F(t){for(var e=new Array(t.length),n=0;nb[1]&&(b[1]=y)}e&&(this._nameList[f]=e[p])}this._rawCount=this._count=l,this._extent={},O(this)},A._initDataFromProvider=function(t,e){if(!(t>=e)){for(var n,i=this._chunkSize,r=this._rawData,o=this._storage,s=this.dimensions,a=s.length,l=this._dimensionInfos,u=this._nameList,c=this._idList,h=this._rawExtent,d=this._nameRepeatCount={},f=this._chunkCount,p=0;pC[1]&&(C[1]=S)}if(!r.pure){var E=u[y];if(g&&null==E)if(null!=g.name)u[y]=E=g.name;else if(null!=n){var T=s[n],k=o[T][b];if(k){E=k[x];var A=l[T].ordinalMeta;A&&A.categories.length&&(E=A.categories[E])}}var I=null==g?null:g.id;null==I&&null!=E&&(d[E]=d[E]||0,I=E,d[E]>0&&(I+="__ec__"+d[E]),d[E]++),null!=I&&(c[y]=I)}}!r.persistent&&r.clean&&r.clean(),this._rawCount=this._count=e,this._extent={},O(this)}},A.count=function(){return this._count},A.getIndices=function(){var t=this._indices;if(t){var e=t.constructor,n=this._count;if(e===Array){r=new e(n);for(var i=0;i=0&&e=0&&ea&&(a=u)}return i=[s,a],this._extent[t]=i,i},A.getApproximateExtent=function(t){return t=this.getDimension(t),this._approximateExtent[t]||this.getDataExtent(t)},A.setApproximateExtent=function(t,e){e=this.getDimension(e),this._approximateExtent[e]=t.slice()},A.getCalculationInfo=function(t){return this._calculationInfo[t]},A.setCalculationInfo=function(t,e){p(t)?r.extend(this._calculationInfo,t):this._calculationInfo[t]=e},A.getSum=function(t){var e=this._storage[t],n=0;if(e)for(var i=0,r=this.count();i=this._rawCount||t<0)return-1;if(!this._indices)return t;var e=this._indices,n=e[t];if(null!=n&&nt))return o;r=o-1}}return-1},A.indicesOfNearest=function(t,e,n){var i=this._storage,r=i[t],o=[];if(!r)return o;null==n&&(n=1/0);for(var s=1/0,a=-1,l=0,u=0,c=this.count();u=0&&a<0)&&(s=d,a=h,l=0),h===a&&(o[l++]=u))}return o.length=l,o},A.getRawIndex=M,A.getRawDataItem=function(t){if(this._rawData.persistent)return this._rawData.getItem(this.getRawIndex(t));for(var e=[],n=0;n=u&&y<=c||isNaN(y))&&(s[a++]=d),d++}h=!0}else if(2===i){f=this._storage[l];var b=this._storage[e[1]],x=t[e[1]][0],_=t[e[1]][1];for(p=0;p=u&&y<=c||isNaN(y))&&(C>=x&&C<=_||isNaN(C))&&(s[a++]=d),d++}}h=!0}}if(!h)if(1===i)for(g=0;g=u&&y<=c||isNaN(y))&&(s[a++]=E)}else for(g=0;gt[k][1])&&(T=!1)}T&&(s[a++]=this.getRawIndex(g))}return aw[1]&&(w[1]=_)}}}return o},A.downSample=function(t,e,n,i){for(var r=V(this,[t]),o=r._storage,s=[],a=Math.floor(1/e),l=o[t],u=this.count(),c=this._chunkSize,h=r._rawExtent[t],d=new(w(this))(u),f=0,p=0;pu-p&&(a=u-p,s.length=a);for(var m=0;mh[1]&&(h[1]=b),d[f++]=x}return r._count=f,r._indices=d,r.getRawIndex=j,r},A.getItemModel=function(t){var e=this.hostModel;return new o(this.getRawDataItem(t),e,e&&e.ecModel)},A.diff=function(t){var e=this;return new s(t?t.getIndices():[],this.getIndices(),(function(e){return P(t,e)}),(function(t){return P(e,t)}))},A.getVisual=function(t){var e=this._visual;return e&&e[t]},A.setVisual=function(t,e){if(p(t))for(var n in t)t.hasOwnProperty(n)&&this.setVisual(n,t[n]);else this._visual=this._visual||{},this._visual[t]=e},A.setLayout=function(t,e){if(p(t))for(var n in t)t.hasOwnProperty(n)&&this.setLayout(n,t[n]);else this._layout[t]=e},A.getLayout=function(t){return this._layout[t]},A.getItemLayout=function(t){return this._itemLayouts[t]},A.setItemLayout=function(t,e,n){this._itemLayouts[t]=n?r.extend(this._itemLayouts[t]||{},e):e},A.clearItemLayouts=function(){this._itemLayouts.length=0},A.getItemVisual=function(t,e,n){var i=this._itemVisuals[t],r=i&&i[e];return null!=r||n?r:this.getVisual(e)},A.setItemVisual=function(t,e,n){var i=this._itemVisuals[t]||{},r=this.hasItemVisual;if(this._itemVisuals[t]=i,p(e))for(var o in e)e.hasOwnProperty(o)&&(i[o]=e[o],r[o]=!0);else i[e]=n,r[e]=!0},A.clearAllVisual=function(){this._visual={},this._itemVisuals=[],this.hasItemVisual={}};var L=function(t){t.seriesIndex=this.seriesIndex,t.dataIndex=this.dataIndex,t.dataType=this.dataType};A.setItemGraphicEl=function(t,e){var n=this.hostModel;e&&(e.dataIndex=t,e.dataType=this.dataType,e.seriesIndex=n&&n.seriesIndex,"group"===e.type&&e.traverse(L,e)),this._graphicEls[t]=e},A.getItemGraphicEl=function(t){return this._graphicEls[t]},A.eachItemGraphicEl=function(t,e){r.each(this._graphicEls,(function(n,i){n&&t&&t.call(e,n,i)}))},A.cloneShallow=function(t){if(!t){var e=r.map(this.dimensions,this.getDimensionInfo,this);t=new k(e,this.hostModel)}if(t._storage=this._storage,T(t,this),this._indices){var n=this._indices.constructor;t._indices=new n(this._indices)}else t._indices=null;return t.getRawIndex=t._indices?j:M,t},A.wrapMethod=function(t,e){var n=this[t];"function"===typeof n&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(t),this[t]=function(){var t=n.apply(this,arguments);return e.apply(this,[t].concat(r.slice(arguments)))})},A.TRANSFERABLE_METHODS=["cloneShallow","downSample","map"],A.CHANGABLE_METHODS=["filterSelf","selectRange"];var B=k;t.exports=B},"620b":function(t,e,n){var i=n("401b"),r=i.distance;function o(t,e,n,i,r,o,s){var a=.5*(n-t),l=.5*(i-e);return(2*(e-n)+a+l)*s+(-3*(e-n)-2*a-l)*o+a*r+e}function s(t,e){for(var n=t.length,i=[],s=0,a=1;an-2?n-1:f+1],h=t[f>n-3?n-1:f+2]);var v=p*p,g=p*v;i.push([o(u[0],m[0],c[0],h[0],p,v,g),o(u[1],m[1],c[1],h[1],p,v,g)])}return i}t.exports=s},"625e":function(t,e,n){var i=n("4e08"),r=(i.__DEV__,n("6d8b")),o=".",s="___EC__COMPONENT__CONTAINER___";function a(t){var e={main:"",sub:""};return t&&(t=t.split(o),e.main=t[0]||"",e.sub=t[1]||""),e}function l(t){r.assert(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(t),'componentType "'+t+'" illegal')}function u(t,e){t.$constructor=t,t.extend=function(t){var e=this,n=function(){t.$constructor?t.$constructor.apply(this,arguments):e.apply(this,arguments)};return r.extend(n.prototype,t),n.extend=this.extend,n.superCall=d,n.superApply=f,r.inherits(n,this),n.superClass=e,n}}var c=0;function h(t){var e=["__\0is_clz",c++,Math.random().toFixed(3)].join("_");t.prototype[e]=!0,t.isInstance=function(t){return!(!t||!t[e])}}function d(t,e){var n=r.slice(arguments,2);return this.superClass.prototype[e].apply(t,n)}function f(t,e,n){return this.superClass.prototype[e].apply(t,n)}function p(t,e){e=e||{};var n={};function i(t){var e=n[t.main];return e&&e[s]||(e=n[t.main]={},e[s]=!0),e}if(t.registerClass=function(t,e){if(e)if(l(e),e=a(e),e.sub){if(e.sub!==s){var r=i(e);r[e.sub]=t}}else n[e.main]=t;return t},t.getClass=function(t,e,i){var r=n[t];if(r&&r[s]&&(r=e?r[e]:null),i&&!r)throw new Error(e?"Component "+t+"."+(e||"")+" not exists. Load it first.":t+".type should be specified.");return r},t.getClassesByMainType=function(t){t=a(t);var e=[],i=n[t.main];return i&&i[s]?r.each(i,(function(t,n){n!==s&&e.push(t)})):e.push(i),e},t.hasClass=function(t){return t=a(t),!!n[t.main]},t.getAllClassMainTypes=function(){var t=[];return r.each(n,(function(e,n){t.push(n)})),t},t.hasSubTypes=function(t){t=a(t);var e=n[t.main];return e&&e[s]},t.parseClassType=a,e.registerWhenExtend){var o=t.extend;o&&(t.extend=function(e){var n=o.call(this,e);return t.registerClass(n,e.type)})}return t}function m(t,e){}e.parseClassType=a,e.enableClassExtend=u,e.enableClassCheck=h,e.enableClassManagement=p,e.setReadOnly=m},"627c":function(t,e,n){var i=n("6d8b"),r=n("3eba"),o=n("2306"),s=n("f934"),a=s.getLayoutRect,l=n("eda2"),u=l.windowOpen;r.extendComponentModel({type:"title",layoutMode:{type:"box",ignoreSize:!0},defaultOption:{zlevel:0,z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:0,top:0,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bolder",color:"#333"},subtextStyle:{color:"#aaa"}}}),r.extendComponentView({type:"title",render:function(t,e,n){if(this.group.removeAll(),t.get("show")){var r=this.group,s=t.getModel("textStyle"),l=t.getModel("subtextStyle"),c=t.get("textAlign"),h=i.retrieve2(t.get("textBaseline"),t.get("textVerticalAlign")),d=new o.Text({style:o.setTextStyle({},s,{text:t.get("text"),textFill:s.getTextColor()},{disableBox:!0}),z2:10}),f=d.getBoundingRect(),p=t.get("subtext"),m=new o.Text({style:o.setTextStyle({},l,{text:p,textFill:l.getTextColor(),y:f.height+t.get("itemGap"),textVerticalAlign:"top"},{disableBox:!0}),z2:10}),v=t.get("link"),g=t.get("sublink"),y=t.get("triggerEvent",!0);d.silent=!v&&!y,m.silent=!g&&!y,v&&d.on("click",(function(){u(v,"_"+t.get("target"))})),g&&m.on("click",(function(){u(v,"_"+t.get("subtarget"))})),d.eventData=m.eventData=y?{componentType:"title",componentIndex:t.componentIndex}:null,r.add(d),p&&r.add(m);var b=r.getBoundingRect(),x=t.getBoxLayoutParams();x.width=b.width,x.height=b.height;var _=a(x,{width:n.getWidth(),height:n.getHeight()},t.get("padding"));c||(c=t.get("left")||t.get("right"),"middle"===c&&(c="center"),"right"===c?_.x+=_.width:"center"===c&&(_.x+=_.width/2)),h||(h=t.get("top")||t.get("bottom"),"center"===h&&(h="middle"),"bottom"===h?_.y+=_.height:"middle"===h&&(_.y+=_.height/2),h=h||"top"),r.attr("position",[_.x,_.y]);var w={textAlign:c,textVerticalAlign:h};d.setStyle(w),m.setStyle(w),b=r.getBoundingRect();var S=_.margin,C=t.getItemStyle(["color","opacity"]);C.fill=t.get("backgroundColor");var E=new o.Rect({shape:{x:b.x-S[3],y:b.y-S[0],width:b.width+S[1]+S[3],height:b.height+S[0]+S[2],r:t.get("borderRadius")},style:C,subPixelOptimize:!0,silent:!0});r.add(E)}}})},"62e4":function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},6366:function(t,e,n){"use strict";function i(t){return"undefined"===typeof t||null===t}function r(t){return"object"===typeof t&&null!==t}function o(t){return Array.isArray(t)?t:i(t)?[]:[t]}function s(t,e){var n,i,r,o;if(e)for(o=Object.keys(e),n=0,i=o.length;n=u?t?"":void 0:(o=a.charCodeAt(l),o<55296||o>56319||l+1===u||(s=a.charCodeAt(l+1))<56320||s>57343?t?a.charAt(l):o:t?a.slice(l,l+2):s-56320+(o-55296<<10)+65536)}};t.exports={codeAt:o(!1),charAt:o(!0)}},"65ed":function(t,e,n){var i=n("22d1"),r=n("84ec"),o=r.buildTransformer,s="___zrEVENTSAVED",a=[];function l(t,e,n,i,r){return u(a,e,i,r,!0)&&u(t,n,a[0],a[1])}function u(t,e,n,r,o){if(e.getBoundingClientRect&&i.domSupported&&!d(e)){var a=e[s]||(e[s]={}),l=c(e,a),u=h(l,a,o);if(u)return u(t,n,r),!0}return!1}function c(t,e){var n=e.markers;if(n)return n;n=e.markers=[];for(var i=["left","right"],r=["top","bottom"],o=0;o<4;o++){var s=document.createElement("div"),a=s.style,l=o%2,u=(o>>1)%2;a.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",i[l]+":0",r[u]+":0",i[1-l]+":auto",r[1-u]+":auto",""].join("!important;"),t.appendChild(s),n.push(s)}return n}function h(t,e,n){for(var i=n?"invTrans":"trans",r=e[i],s=e.srcCoords,a=!0,l=[],u=[],c=0;c<4;c++){var h=t[c].getBoundingClientRect(),d=2*c,f=h.left,p=h.top;l.push(f,p),a=a&&s&&f===s[d]&&p===s[d+1],u.push(t[c].offsetLeft,t[c].offsetTop)}return a&&r?r:(e.srcCoords=l,e[i]=n?o(u,l):o(l,u))}function d(t){return"CANVAS"===t.nodeName.toUpperCase()}e.transformLocalCoord=l,e.transformCoordWithViewport=u,e.isCanvasEl=d},6679:function(t,e,n){var i=n("4e08"),r=(i.__DEV__,n("3eba")),o=n("cd33"),s=r.extendComponentView({type:"axis",_axisPointer:null,axisPointerClass:null,render:function(t,e,n,i){this.axisPointerClass&&o.fixValue(t),s.superApply(this,"render",arguments),a(this,t,e,n,i,!0)},updateAxisPointer:function(t,e,n,i,r){a(this,t,e,n,i,!1)},remove:function(t,e){var n=this._axisPointer;n&&n.remove(e),s.superApply(this,"remove",arguments)},dispose:function(t,e){l(this,e),s.superApply(this,"dispose",arguments)}});function a(t,e,n,i,r,a){var u=s.getAxisPointerClass(t.axisPointerClass);if(u){var c=o.getAxisPointerModel(e);c?(t._axisPointer||(t._axisPointer=new u)).render(e,c,i,a):l(t,i)}}function l(t,e,n){var i=t._axisPointer;i&&i.dispose(e,n),t._axisPointer=null}var u=[];s.registerAxisPointerClass=function(t,e){u[t]=e},s.getAxisPointerClass=function(t){return t&&u[t]};var c=s;t.exports=c},6747:function(t,e){var n=Array.isArray;t.exports=n},6771:function(t,e,n){"use strict";var i=n("de50");t.exports=new i({include:[n("4528")],implicit:[n("e0ce"),n("b294")],explicit:[n("8ced"),n("f3e9"),n("0df5"),n("a736")]})},"67ca":function(t,e,n){var i=n("cb5a");function r(t,e){var n=this.__data__,r=i(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}t.exports=r},"68ab":function(t,e,n){var i=n("4a3f"),r=i.quadraticProjectPoint;function o(t,e,n,i,o,s,a,l,u){if(0===a)return!1;var c=a;if(u>e+c&&u>i+c&&u>s+c||ut+c&&l>n+c&&l>o+c||l0&&u>0&&!f&&(a=0),a<0&&u<0&&!p&&(u=0));var v=e.ecModel;if(v&&"time"===s){var g,y=c("bar",v);if(r.each(y,(function(t){g|=t.getBaseAxis()===e.axis})),g){var b=h(y),x=m(a,u,e,b);a=x.min,u=x.max}}return{extent:[a,u],fixMin:f,fixMax:p}}function m(t,e,n,i){var o=n.axis.getExtent(),s=o[1]-o[0],a=d(i,n.axis);if(void 0===a)return{min:t,max:e};var l=1/0;r.each(a,(function(t){l=Math.min(t.offset,l)}));var u=-1/0;r.each(a,(function(t){u=Math.max(t.offset+t.width,u)})),l=Math.abs(l),u=Math.abs(u);var c=l+u,h=e-t,f=1-(l+u)/s,p=h/f-h;return e+=p*(u/c),t-=p*(l/c),{min:t,max:e}}function v(t,e){var n=p(t,e),i=n.extent,r=e.get("splitNumber");"log"===t.type&&(t.base=e.get("logBase"));var o=t.type;t.setExtent(i[0],i[1]),t.niceExtent({splitNumber:r,fixMin:n.fixMin,fixMax:n.fixMax,minInterval:"interval"===o||"time"===o?e.get("minInterval"):null,maxInterval:"interval"===o||"time"===o?e.get("maxInterval"):null});var s=e.get("interval");null!=s&&t.setInterval&&t.setInterval(s)}function g(t,e){if(e=e||t.get("type"),e)switch(e){case"category":return new o(t.getOrdinalMeta?t.getOrdinalMeta():t.getCategories(),[1/0,-1/0]);case"value":return new s;default:return(a.getClass(e)||s).create(t)}}function y(t){var e=t.scale.getExtent(),n=e[0],i=e[1];return!(n>0&&i>0||n<0&&i<0)}function b(t){var e=t.getLabelModel().get("formatter"),n="category"===t.type?t.scale.getExtent()[0]:null;return"string"===typeof e?(e=function(e){return function(n){return n=t.scale.getLabel(n),e.replace("{value}",null!=n?n:"")}}(e),e):"function"===typeof e?function(i,r){return null!=n&&(r=i-n),e(x(t,i),r)}:function(e){return t.scale.getLabel(e)}}function x(t,e){return"category"===t.type?t.scale.getLabel(e):e}function _(t){var e=t.model,n=t.scale;if(e.get("axisLabel.show")&&!n.isBlank()){var i,r,o="category"===t.type,s=n.getExtent();o?r=n.count():(i=n.getTicks(),r=i.length);var a,l=t.getLabelModel(),u=b(t),c=1;r>40&&(c=Math.ceil(r/40));for(var h=0;hn.blockIndex,o=r?n.step:null,s=i&&i.modDataCount,a=null!=s?Math.ceil(s/o):null;return{step:o,modBy:a,modDataCount:s}}},y.getPipeline=function(t){return this._pipelineMap.get(t)},y.updateStreamModes=function(t,e){var n=this._pipelineMap.get(t.uid),i=t.getData(),r=i.count(),o=n.progressiveEnabled&&e.incrementalPrepareRender&&r>=n.threshold,s=t.get("large")&&r>=t.get("largeThreshold"),a="mod"===t.get("progressiveChunkMode")?r:null;t.pipelineContext=n.context={progressiveRender:o,modDataCount:a,large:s}},y.restorePipelines=function(t){var e=this,n=e._pipelineMap=a();t.eachSeries((function(t){var i=t.getProgressive(),r=t.uid;n.set(r,{id:r,head:null,tail:null,threshold:t.getProgressiveThreshold(),progressiveEnabled:i&&!(t.preventIncremental&&t.preventIncremental()),blockIndex:-1,step:Math.round(i||700),count:0}),M(e,t,t.dataTask)}))},y.prepareStageTasks=function(){var t=this._stageTaskMap,e=this.ecInstance.getModel(),n=this.api;r(this._allHandlers,(function(i){var r=t.get(i.uid)||t.set(i.uid,[]);i.reset&&_(this,i,r,e,n),i.overallReset&&w(this,i,r,e,n)}),this)},y.prepareView=function(t,e,n,i){var r=t.renderTask,o=r.context;o.model=e,o.ecModel=n,o.api=i,r.__block=!t.incrementalPrepareRender,M(this,e,r)},y.performDataProcessorTasks=function(t,e){b(this,this._dataProcessorHandlers,t,e,{block:!0})},y.performVisualTasks=function(t,e,n){b(this,this._visualHandlers,t,e,n)},y.performSeriesTasks=function(t){var e;t.eachSeries((function(t){e|=t.dataTask.perform()})),this.unfinished|=e},y.plan=function(){this._pipelineMap.each((function(t){var e=t.tail;do{if(e.__block){t.blockIndex=e.__idxInPipeline;break}e=e.getUpstream()}while(e)}))};var x=y.updatePayload=function(t,e){"remain"!==e&&(t.context.payload=e)};function _(t,e,n,i,r){var o=n.seriesTaskMap||(n.seriesTaskMap=a()),s=e.seriesType,l=e.getTargetSeries;function u(n){var s=n.uid,a=o.get(s)||o.set(s,c({plan:k,reset:A,count:I}));a.context={model:n,ecModel:i,api:r,useClearVisual:e.isVisual&&!e.isLayout,plan:e.plan,reset:e.reset,scheduler:t},M(t,n,a)}e.createOnAllSeries?i.eachRawSeries(u):s?i.eachRawSeriesByType(s,u):l&&l(i,r).each(u);var h=t._pipelineMap;o.each((function(t,e){h.get(e)||(t.dispose(),o.removeKey(e))}))}function w(t,e,n,i,o){var s=n.overallTask=n.overallTask||c({reset:S});s.context={ecModel:i,api:o,overallReset:e.overallReset,scheduler:t};var l=s.agentStubMap=s.agentStubMap||a(),u=e.seriesType,h=e.getTargetSeries,d=!0,f=e.modifyOutputEnd;function p(e){var n=e.uid,i=l.get(n);i||(i=l.set(n,c({reset:C,onDirty:T})),s.dirty()),i.context={model:e,overallProgress:d,modifyOutputEnd:f},i.agent=s,i.__block=d,M(t,e,i)}u?i.eachRawSeriesByType(u,p):h?h(i,o).each(p):(d=!1,r(i.getSeries(),p));var m=t._pipelineMap;l.each((function(t,e){m.get(e)||(t.dispose(),s.dirty(),l.removeKey(e))}))}function S(t){t.overallReset(t.ecModel,t.api,t.payload)}function C(t,e){return t.overallProgress&&E}function E(){this.agent.dirty(),this.getDownstream().dirty()}function T(){this.agent&&this.agent.dirty()}function k(t){return t.plan&&t.plan(t.model,t.ecModel,t.api,t.payload)}function A(t){t.useClearVisual&&t.data.clearAllVisual();var e=t.resetDefines=v(t.reset(t.model,t.ecModel,t.api,t.payload));return e.length>1?o(e,(function(t,e){return O(e)})):D}var D=O(0);function O(t){return function(e,n){var i=n.data,r=n.resetDefines[t];if(r&&r.dataEach)for(var o=e.start;o=0;s--)o=i.merge(o,e[s],!0);t.defaultOption=o}return t.defaultOption},getReferringComponents:function(t){return this.ecModel.queryComponents({mainType:t,index:this.get(t+"Index",!0),id:this.get(t+"Id",!0)})}});function m(t){var e=[];return i.each(p.getClassesByMainType(t),(function(t){e=e.concat(t.prototype.dependencies||[])})),e=i.map(e,(function(t){return l(t).main})),"dataset"!==t&&i.indexOf(e,"dataset")<=0&&e.unshift("dataset"),e}a(p,{registerWhenExtend:!0}),o.enableSubTypeDefaulter(p),o.enableTopologicalTravel(p,m),i.mixin(p,d);var v=p;t.exports=v},"6d8b":function(t,e){var n={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1,"[object CanvasPattern]":1,"[object Image]":1,"[object Canvas]":1},i={"[object Int8Array]":1,"[object Uint8Array]":1,"[object Uint8ClampedArray]":1,"[object Int16Array]":1,"[object Uint16Array]":1,"[object Int32Array]":1,"[object Uint32Array]":1,"[object Float32Array]":1,"[object Float64Array]":1},r=Object.prototype.toString,o=Array.prototype,s=o.forEach,a=o.filter,l=o.slice,u=o.map,c=o.reduce,h={};function d(t,e){"createCanvas"===t&&(y=null),h[t]=e}function f(t){if(null==t||"object"!==typeof t)return t;var e=t,o=r.call(t);if("[object Array]"===o){if(!X(t)){e=[];for(var s=0,a=t.length;s",d="<",f="prototype",p="script",m=c("IE_PROTO"),v=function(){},g=function(t){return d+p+h+t+d+"/"+p+h},y=function(t){t.write(g("")),t.close();var e=t.parentWindow.Object;return t=null,e},b=function(){var t,e=u("iframe"),n="java"+p+":";return e.style.display="none",l.appendChild(e),e.src=String(n),t=e.contentWindow.document,t.open(),t.write(g("document.F=Object")),t.close(),t.F},x=function(){try{i=document.domain&&new ActiveXObject("htmlfile")}catch(e){}x=i?y(i):b();var t=s.length;while(t--)delete x[f][s[t]];return x()};a[m]=!0,t.exports=Object.create||function(t,e){var n;return null!==t?(v[f]=r(t),n=new v,v[f]=null,n[m]=t):n=x(),void 0===e?n:o(n,e)}},"7d6d":function(t,e){var n={shadowBlur:1,shadowOffsetX:1,shadowOffsetY:1,textShadowBlur:1,textShadowOffsetX:1,textShadowOffsetY:1,textBoxShadowBlur:1,textBoxShadowOffsetX:1,textBoxShadowOffsetY:1};function i(t,e,i){return n.hasOwnProperty(e)?i*t.dpr:i}t.exports=i},"7dd0":function(t,e,n){"use strict";var i=n("23e7"),r=n("9ed3"),o=n("e163"),s=n("d2bb"),a=n("d44e"),l=n("9112"),u=n("6eeb"),c=n("b622"),h=n("c430"),d=n("3f8c"),f=n("ae93"),p=f.IteratorPrototype,m=f.BUGGY_SAFARI_ITERATORS,v=c("iterator"),g="keys",y="values",b="entries",x=function(){return this};t.exports=function(t,e,n,c,f,_,w){r(n,e,c);var S,C,E,T=function(t){if(t===f&&I)return I;if(!m&&t in D)return D[t];switch(t){case g:return function(){return new n(this,t)};case y:return function(){return new n(this,t)};case b:return function(){return new n(this,t)}}return function(){return new n(this)}},k=e+" Iterator",A=!1,D=t.prototype,O=D[v]||D["@@iterator"]||f&&D[f],I=!m&&O||T(f),M="Array"==e&&D.entries||O;if(M&&(S=o(M.call(new t)),p!==Object.prototype&&S.next&&(h||o(S)===p||(s?s(S,p):"function"!=typeof S[v]&&l(S,v,x)),a(S,k,!0,!0),h&&(d[k]=x))),f==y&&O&&O.name!==y&&(A=!0,I=function(){return O.call(this)}),h&&!w||D[v]===I||l(D,v,I),d[e]=I,f)if(C={values:T(y),keys:_?I:T(g),entries:T(b)},w)for(E in C)(m||A||!(E in D))&&u(D,E,C[E]);else i({target:e,proto:!0,forced:m||A},C);return C}},"7e63":function(t,e,n){var i=n("4e08"),r=(i.__DEV__,n("6d8b")),o=r.each,s=r.filter,a=r.map,l=r.isArray,u=r.indexOf,c=r.isObject,h=r.isString,d=r.createHashMap,f=r.assert,p=r.clone,m=r.merge,v=r.extend,g=r.mixin,y=n("e0d3"),b=n("4319"),x=n("6cb7"),_=n("8971"),w=n("e47b"),S=n("0f99"),C=S.resetSourceDefaulter,E="\0_ec_inner",T=b.extend({init:function(t,e,n,i){n=n||{},this.option=null,this._theme=new b(n),this._optionManager=i},setOption:function(t,e){f(!(E in t),"please use chart.getOption()"),this._optionManager.setOption(t,e),this.resetOption(null)},resetOption:function(t){var e=!1,n=this._optionManager;if(!t||"recreate"===t){var i=n.mountOption("recreate"===t);this.option&&"recreate"!==t?(this.restoreData(),this.mergeOption(i)):D.call(this,i),e=!0}if("timeline"!==t&&"media"!==t||this.restoreData(),!t||"recreate"===t||"timeline"===t){var r=n.getTimelineOption(this);r&&(this.mergeOption(r),e=!0)}if(!t||"recreate"===t||"media"===t){var s=n.getMediaOption(this,this._api);s.length&&o(s,(function(t){this.mergeOption(t,e=!0)}),this)}return e},mergeOption:function(t){var e=this.option,n=this._componentsMap,i=[];function r(i,r){var s=y.normalizeToArray(t[i]),a=y.mappingToExists(n.get(i),s);y.makeIdAndName(a),o(a,(function(t,e){var n=t.option;c(n)&&(t.keyInfo.mainType=i,t.keyInfo.subType=I(i,n,t.exist))}));var l=O(n,r);e[i]=[],n.set(i,[]),o(a,(function(t,r){var o=t.exist,s=t.option;if(f(c(s)||o,"Empty component definition"),s){var a=x.getClass(i,t.keyInfo.subType,!0);if(o&&o.constructor===a)o.name=t.keyInfo.name,o.mergeOption(s,this),o.optionUpdated(s,!1);else{var u=v({dependentModels:l,componentIndex:r},t.keyInfo);o=new a(s,this,this,u),v(o,u),o.init(s,this,this,u),o.optionUpdated(null,!0)}}else o.mergeOption({},this),o.optionUpdated({},!1);n.get(i)[r]=o,e[i][r]=o.option}),this),"series"===i&&M(this,n.get("series"))}C(this),o(t,(function(t,n){null!=t&&(x.hasClass(n)?n&&i.push(n):e[n]=null==e[n]?p(t):m(e[n],t,!0))})),x.topologicalTravel(i,x.getAllClassMainTypes(),r,this),this._seriesIndicesMap=d(this._seriesIndices=this._seriesIndices||[])},getOption:function(){var t=p(this.option);return o(t,(function(e,n){if(x.hasClass(n)){e=y.normalizeToArray(e);for(var i=e.length-1;i>=0;i--)y.isIdInner(e[i])&&e.splice(i,1);t[n]=e}})),delete t[E],t},getTheme:function(){return this._theme},getComponent:function(t,e){var n=this._componentsMap.get(t);if(n)return n[e||0]},queryComponents:function(t){var e=t.mainType;if(!e)return[];var n,i=t.index,r=t.id,o=t.name,c=this._componentsMap.get(e);if(!c||!c.length)return[];if(null!=i)l(i)||(i=[i]),n=s(a(i,(function(t){return c[t]})),(function(t){return!!t}));else if(null!=r){var h=l(r);n=s(c,(function(t){return h&&u(r,t.id)>=0||!h&&t.id===r}))}else if(null!=o){var d=l(o);n=s(c,(function(t){return d&&u(o,t.name)>=0||!d&&t.name===o}))}else n=c.slice();return j(n,t)},findComponents:function(t){var e=t.query,n=t.mainType,i=o(e),r=i?this.queryComponents(i):this._componentsMap.get(n);return a(j(r,t));function o(t){var e=n+"Index",i=n+"Id",r=n+"Name";return!t||null==t[e]&&null==t[i]&&null==t[r]?null:{mainType:n,index:t[e],id:t[i],name:t[r]}}function a(e){return t.filter?s(e,t.filter):e}},eachComponent:function(t,e,n){var i=this._componentsMap;if("function"===typeof t)n=e,e=t,i.each((function(t,i){o(t,(function(t,r){e.call(n,i,t,r)}))}));else if(h(t))o(i.get(t),e,n);else if(c(t)){var r=this.findComponents(t);o(r,e,n)}},getSeriesByName:function(t){var e=this._componentsMap.get("series");return s(e,(function(e){return e.name===t}))},getSeriesByIndex:function(t){return this._componentsMap.get("series")[t]},getSeriesByType:function(t){var e=this._componentsMap.get("series");return s(e,(function(e){return e.subType===t}))},getSeries:function(){return this._componentsMap.get("series").slice()},getSeriesCount:function(){return this._componentsMap.get("series").length},eachSeries:function(t,e){P(this),o(this._seriesIndices,(function(n){var i=this._componentsMap.get("series")[n];t.call(e,i,n)}),this)},eachRawSeries:function(t,e){o(this._componentsMap.get("series"),t,e)},eachSeriesByType:function(t,e,n){P(this),o(this._seriesIndices,(function(i){var r=this._componentsMap.get("series")[i];r.subType===t&&e.call(n,r,i)}),this)},eachRawSeriesByType:function(t,e,n){return o(this.getSeriesByType(t),e,n)},isSeriesFiltered:function(t){return P(this),null==this._seriesIndicesMap.get(t.componentIndex)},getCurrentSeriesIndices:function(){return(this._seriesIndices||[]).slice()},filterSeries:function(t,e){P(this);var n=s(this._componentsMap.get("series"),t,e);M(this,n)},restoreData:function(t){var e=this._componentsMap;M(this,e.get("series"));var n=[];e.each((function(t,e){n.push(e)})),x.topologicalTravel(n,x.getAllClassMainTypes(),(function(n,i){o(e.get(n),(function(e){("series"!==n||!k(e,t))&&e.restoreData()}))}))}});function k(t,e){if(e){var n=e.seiresIndex,i=e.seriesId,r=e.seriesName;return null!=n&&t.componentIndex!==n||null!=i&&t.id!==i||null!=r&&t.name!==r}}function A(t,e){var n=t.color&&!t.colorLayer;o(e,(function(e,i){"colorLayer"===i&&n||x.hasClass(i)||("object"===typeof e?t[i]=t[i]?m(t[i],e,!1):p(e):null==t[i]&&(t[i]=e))}))}function D(t){t=t,this.option={},this.option[E]=1,this._componentsMap=d({series:[]}),this._seriesIndices,this._seriesIndicesMap,A(t,this._theme.option),m(t,_,!1),this.mergeOption(t)}function O(t,e){l(e)||(e=e?[e]:[]);var n={};return o(e,(function(e){n[e]=(t.get(e)||[]).slice()})),n}function I(t,e,n){var i=e.type?e.type:n?n.subType:x.determineSubType(t,e);return i}function M(t,e){t._seriesIndicesMap=d(t._seriesIndices=a(e,(function(t){return t.componentIndex}))||[])}function j(t,e){return e.hasOwnProperty("subType")?s(t,(function(t){return t.subType===e.subType})):t}function P(t){}g(T,w);var N=T;t.exports=N},"7f96":function(t,e,n){var i=n("6d8b"),r=i.isFunction;function o(t,e,n){return{seriesType:t,performRawSeries:!0,reset:function(t,i,o){var s=t.getData(),a=t.get("symbol"),l=t.get("symbolSize"),u=t.get("symbolKeepAspect"),c=t.get("symbolRotate"),h=r(a),d=r(l),f=r(c),p=h||d||f,m=!h&&a?a:e,v=d?null:l;if(s.setVisual({legendSymbol:n||m,symbol:m,symbolSize:v,symbolKeepAspect:u,symbolRotate:c}),!i.isSeriesFiltered(t))return{dataEach:s.hasItemOption||p?g:null};function g(e,n){if(p){var i=t.getRawValue(n),r=t.getDataParams(n);h&&e.setItemVisual(n,"symbol",a(i,r)),d&&e.setItemVisual(n,"symbolSize",l(i,r)),f&&e.setItemVisual(n,"symbolRotate",c(i,r))}if(e.hasItemOption){var o=e.getItemModel(n),s=o.getShallow("symbol",!0),u=o.getShallow("symbolSize",!0),m=o.getShallow("symbolRotate",!0),v=o.getShallow("symbolKeepAspect",!0);null!=s&&e.setItemVisual(n,"symbol",s),null!=u&&e.setItemVisual(n,"symbolSize",u),null!=m&&e.setItemVisual(n,"symbolRotate",m),null!=v&&e.setItemVisual(n,"symbolKeepAspect",v)}}}}}t.exports=o},"7f9a":function(t,e,n){var i=n("da84"),r=n("8925"),o=i.WeakMap;t.exports="function"===typeof o&&/native code/.test(r(o))},"80f0":function(t,e){function n(t){return t}function i(t,e,i,r,o){this._old=t,this._new=e,this._oldKeyGetter=i||n,this._newKeyGetter=r||n,this.context=o}function r(t,e,n,i,r){for(var o=0;o=0){var u=o.indexOf(a),c=o.substr(l+s.length,u-l-s.length);c.indexOf("sub")>-1?i["marker"+c]={textWidth:4,textHeight:4,textBorderRadius:2,textBackgroundColor:e[c],textOffset:[3,0]}:i["marker"+c]={textWidth:10,textHeight:10,textBorderRadius:5,textBackgroundColor:e[c]},o=o.substr(u+1),l=o.indexOf("{marker")}this.el=new r({style:{rich:i,text:t,textLineHeight:20,textBackgroundColor:n.get("backgroundColor"),textBorderRadius:n.get("borderRadius"),textFill:n.get("textStyle.color"),textPadding:n.get("padding")},z:n.get("z")}),this._zr.add(this.el);var h=this;this.el.on("mouseover",(function(){h._enterable&&(clearTimeout(h._hideTimeout),h._show=!0),h._inContent=!0})),this.el.on("mouseout",(function(){h._enterable&&h._show&&h.hideLater(h._hideDelay),h._inContent=!1}))},setEnterable:function(t){this._enterable=t},getSize:function(){var t=this.el.getBoundingRect();return[t.width,t.height]},moveTo:function(t,e){this.el&&this.el.attr("position",[t,e])},hide:function(){this.el&&this.el.hide(),this._show=!1},hideLater:function(t){!this._show||this._inContent&&this._enterable||(t?(this._hideDelay=t,this._show=!1,this._hideTimeout=setTimeout(i.bind(this.hide,this),t)):this.hide())},isShow:function(){return this._show},getOuterSize:function(){var t=this.getSize();return{width:t[0],height:t[1]}}};var s=o;t.exports=s},"83ab":function(t,e,n){var i=n("d039");t.exports=!i((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},"843e":function(t,e,n){var i=n("6d8b"),r=["getDom","getZr","getWidth","getHeight","getDevicePixelRatio","dispatchAction","isDisposed","on","off","getDataURL","getConnectedDataURL","getModel","getOption","getViewOfComponentModel","getViewOfSeriesModel"];function o(t){i.each(r,(function(e){this[e]=i.bind(t[e],t)}),this)}var s=o;t.exports=s},"84ce":function(t,e,n){var i=n("6d8b"),r=i.each,o=i.map,s=n("3842"),a=s.linearMap,l=s.getPixelPrecision,u=s.round,c=n("e073"),h=c.createAxisTicks,d=c.createAxisLabels,f=c.calculateCategoryInterval,p=[0,1],m=function(t,e,n){this.dim=t,this.scale=e,this._extent=n||[0,0],this.inverse=!1,this.onBand=!1};function v(t,e){var n=t[1]-t[0],i=e,r=n/i/2;t[0]+=r,t[1]-=r}function g(t,e,n,i){var o=e.length;if(t.onBand&&!n&&o){var s,a,l=t.getExtent();if(1===o)e[0].coord=l[0],s=e[1]={coord:l[0]};else{var c=e[o-1].tickValue-e[0].tickValue,h=(e[o-1].coord-e[0].coord)/c;r(e,(function(t){t.coord-=h/2}));var d=t.scale.getExtent();a=1+d[1]-e[o-1].tickValue,s={coord:e[o-1].coord+h*a},e.push(s)}var f=l[0]>l[1];p(e[0].coord,l[0])&&(i?e[0].coord=l[0]:e.shift()),i&&p(l[0],e[0].coord)&&e.unshift({coord:l[0]}),p(l[1],s.coord)&&(i?s.coord=l[1]:e.pop()),i&&p(s.coord,l[1])&&e.push({coord:l[1]})}function p(t,e){return t=u(t),e=u(e),f?t>e:t=n&&t<=i},containData:function(t){return this.scale.contain(t)},getExtent:function(){return this._extent.slice()},getPixelPrecision:function(t){return l(t||this.scale.getExtent(),this._extent)},setExtent:function(t,e){var n=this._extent;n[0]=t,n[1]=e},dataToCoord:function(t,e){var n=this._extent,i=this.scale;return t=i.normalize(t),this.onBand&&"ordinal"===i.type&&(n=n.slice(),v(n,i.count())),a(t,p,n,e)},coordToData:function(t,e){var n=this._extent,i=this.scale;this.onBand&&"ordinal"===i.type&&(n=n.slice(),v(n,i.count()));var r=a(t,n,p,e);return this.scale.scale(r)},pointToData:function(t,e){},getTicksCoords:function(t){t=t||{};var e=t.tickModel||this.getTickModel(),n=h(this,e),i=n.ticks,r=o(i,(function(t){return{coord:this.dataToCoord(t),tickValue:t}}),this),s=e.get("alignWithLabel");return g(this,r,s,t.clamp),r},getMinorTicksCoords:function(){if("ordinal"===this.scale.type)return[];var t=this.model.getModel("minorTick"),e=t.get("splitNumber");e>0&&e<100||(e=5);var n=this.scale.getMinorTicks(e),i=o(n,(function(t){return o(t,(function(t){return{coord:this.dataToCoord(t),tickValue:t}}),this)}),this);return i},getViewLabels:function(){return d(this).labels},getLabelModel:function(){return this.model.getModel("axisLabel")},getTickModel:function(){return this.model.getModel("axisTick")},getBandWidth:function(){var t=this._extent,e=this.scale.getExtent(),n=e[1]-e[0]+(this.onBand?1:0);0===n&&(n=1);var i=Math.abs(t[1]-t[0]);return Math.abs(i)/n},isHorizontal:null,getRotate:null,calculateCategoryInterval:function(){return f(this)}};var y=m;t.exports=y},"84ec":function(t,e){var n=Math.log(2);function i(t,e,r,o,s,a){var l=o+"-"+s,u=t.length;if(a.hasOwnProperty(l))return a[l];if(1===e){var c=Math.round(Math.log((1<e&&o>i||or?s:0}t.exports=n},"872a":function(t,e,n){"use strict";var i=n("c3ea"),r=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],o=["scalar","sequence","mapping"];function s(t){var e={};return null!==t&&Object.keys(t).forEach((function(n){t[n].forEach((function(t){e[String(t)]=n}))})),e}function a(t,e){if(e=e||{},Object.keys(e).forEach((function(e){if(-1===r.indexOf(e))throw new i('Unknown option "'+e+'" is met in definition of "'+t+'" YAML type.')})),this.tag=t,this.kind=e["kind"]||null,this.resolve=e["resolve"]||function(){return!0},this.construct=e["construct"]||function(t){return t},this.instanceOf=e["instanceOf"]||null,this.predicate=e["predicate"]||null,this.represent=e["represent"]||null,this.defaultStyle=e["defaultStyle"]||null,this.styleAliases=s(e["styleAliases"]||null),-1===o.indexOf(this.kind))throw new i('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}t.exports=a},"872a6":function(t,e,n){var i=n("3b4a");function r(t,e,n){"__proto__"==e&&i?i(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}t.exports=r},"87b1":function(t,e,n){var i=n("cbe5"),r=n("4fac"),o=i.extend({type:"polygon",shape:{points:null,smooth:!1,smoothConstraint:null},buildPath:function(t,e){r.buildPath(t,e,!0)}});t.exports=o},"87c3":function(t,e,n){var i=n("6d8b"),r=i.map,o=n("cccd"),s=n("ee1a"),a=s.isDimensionStacked;function l(t){return{seriesType:t,plan:o(),reset:function(t){var e=t.getData(),n=t.coordinateSystem,i=t.pipelineContext,o=i.large;if(n){var s=r(n.dimensions,(function(t){return e.mapDimension(t)})).slice(0,2),l=s.length,u=e.getCalculationInfo("stackResultDimension");return a(e,s[0])&&(s[0]=u),a(e,s[1])&&(s[1]=u),l&&{progress:c}}function c(t,e){for(var i=t.end-t.start,r=o&&new Float32Array(i*l),a=t.start,u=0,c=[],h=[];a=0?h():c=setTimeout(h,-r),l=i};return d.clear=function(){c&&(clearTimeout(c),c=null)},d.debounceNextCall=function(t){a=t},d}function s(t,e,s,a){var l=t[e];if(l){var u=l[n]||l,c=l[r],h=l[i];if(h!==s||c!==a){if(null==s||!a)return t[e]=u;l=t[e]=o(u,s,"debounce"===a),l[n]=u,l[r]=a,l[i]=s}return l}}function a(t,e){var i=t[e];i&&i[n]&&(t[e]=i[n])}e.throttle=o,e.createOrUpdate=s,e.clear=a},8918:function(t,e,n){var i=n("6d8b"),r=n("625e"),o=r.parseClassType,s=0;function a(t){return[t||"",s++,Math.random().toFixed(5)].join("_")}function l(t){var e={};return t.registerSubTypeDefaulter=function(t,n){t=o(t),e[t.main]=n},t.determineSubType=function(n,i){var r=i.type;if(!r){var s=o(n).main;t.hasSubTypes(n)&&e[s]&&(r=e[s](i))}return r},t}function u(t,e){function n(t){var n={},s=[];return i.each(t,(function(a){var l=r(n,a),u=l.originalDeps=e(a),c=o(u,t);l.entryCount=c.length,0===l.entryCount&&s.push(a),i.each(c,(function(t){i.indexOf(l.predecessor,t)<0&&l.predecessor.push(t);var e=r(n,t);i.indexOf(e.successor,t)<0&&e.successor.push(a)}))})),{graph:n,noEntryList:s}}function r(t,e){return t[e]||(t[e]={predecessor:[],successor:[]}),t[e]}function o(t,e){var n=[];return i.each(t,(function(t){i.indexOf(e,t)>=0&&n.push(t)})),n}t.topologicalTravel=function(t,e,r,o){if(t.length){var s=n(e),a=s.graph,l=s.noEntryList,u={};i.each(t,(function(t){u[t]=!0}));while(l.length){var c=l.pop(),h=a[c],d=!!u[c];d&&(r.call(o,c,h.originalDeps.slice()),delete u[c]),i.each(h.successor,d?p:f)}i.each(u,(function(){throw new Error("Circle dependency may exists")}))}function f(t){a[t].entryCount--,0===a[t].entryCount&&l.push(t)}function p(t){u[t]=!0,f(t)}}}e.getUID=a,e.enableSubTypeDefaulter=l,e.enableTopologicalTravel=u},8925:function(t,e,n){var i=n("c6cd"),r=Function.toString;"function"!=typeof i.inspectSource&&(i.inspectSource=function(t){return r.call(t)}),t.exports=i.inspectSource},8971:function(t,e){var n="";"undefined"!==typeof navigator&&(n=navigator.platform||"");var i={color:["#c23531","#2f4554","#61a0a8","#d48265","#91c7ae","#749f83","#ca8622","#bda29a","#6e7074","#546570","#c4ccd3"],gradientColor:["#f6efa6","#d88273","#bf444c"],textStyle:{fontFamily:n.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,animation:"auto",animationDuration:1e3,animationDurationUpdate:300,animationEasing:"exponentialOut",animationEasingUpdate:"cubicOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1};t.exports=i},"897a":function(t,e,n){var i=n("22d1"),r=[["shadowBlur",0],["shadowColor","#000"],["shadowOffsetX",0],["shadowOffsetY",0]];function o(t){return i.browser.ie&&i.browser.version>=11?function(){var e,n=this.__clipPaths,i=this.style;if(n)for(var o=0;oe[1]&&(e[1]=t[1]),l.prototype.setExtent.call(this,e[0],e[1])},getInterval:function(){return this._interval},setInterval:function(t){this._interval=t,this._niceExtent=this._extent.slice(),this._intervalPrecision=s.getIntervalPrecision(t)},getTicks:function(t){var e=this._interval,n=this._extent,i=this._niceExtent,r=this._intervalPrecision,o=[];if(!e)return o;var s=1e4;n[0]s)return[]}var u=o.length?o[o.length-1]:i[1];return n[1]>u&&(t?o.push(a(u+e,r)):o.push(n[1])),o},getMinorTicks:function(t){for(var e=this.getTicks(!0),n=[],r=this.getExtent(),o=1;or[0]&&d0)i*=10;var s=[o.round(d(e[0]/i)*i),o.round(h(e[1]/i)*i)];this._interval=i,this._niceExtent=s}},niceExtent:function(t){l.niceExtent.call(this,t);var e=this._originalScale;e.__fixMin=t.fixMin,e.__fixMax=t.fixMax}});function v(t,e){return c(t,u(e))}i.each(["contain","normalize"],(function(t){m.prototype[t]=function(e){return e=p(e)/p(this.base),a[t].call(this,e)}})),m.create=function(){return new m};var g=m;t.exports=g},"8c4f":function(t,e,n){"use strict"; +!function(e,n){t.exports=n()}(0,(function(){return n={},t.m=e=[function(t,e){t.exports=function(t){var e;if("SELECT"===t.nodeName)t.focus(),e=t.value;else if("INPUT"===t.nodeName||"TEXTAREA"===t.nodeName){var n=t.hasAttribute("readonly");n||t.setAttribute("readonly",""),t.select(),t.setSelectionRange(0,t.value.length),n||t.removeAttribute("readonly"),e=t.value}else{t.hasAttribute("contenteditable")&&t.focus();var i=window.getSelection(),r=document.createRange();r.selectNodeContents(t),i.removeAllRanges(),i.addRange(r),e=i.toString()}return e}},function(t,e){function n(){}n.prototype={on:function(t,e,n){var i=this.e||(this.e={});return(i[t]||(i[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){var i=this;function r(){i.off(t,r),e.apply(n,arguments)}return r._=e,this.on(t,r,n)},emit:function(t){for(var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),i=0,r=n.length;in.blockIndex,o=r?n.step:null,s=i&&i.modDataCount,a=null!=s?Math.ceil(s/o):null;return{step:o,modBy:a,modDataCount:s}}},y.getPipeline=function(t){return this._pipelineMap.get(t)},y.updateStreamModes=function(t,e){var n=this._pipelineMap.get(t.uid),i=t.getData(),r=i.count(),o=n.progressiveEnabled&&e.incrementalPrepareRender&&r>=n.threshold,s=t.get("large")&&r>=t.get("largeThreshold"),a="mod"===t.get("progressiveChunkMode")?r:null;t.pipelineContext=n.context={progressiveRender:o,modDataCount:a,large:s}},y.restorePipelines=function(t){var e=this,n=e._pipelineMap=a();t.eachSeries((function(t){var i=t.getProgressive(),r=t.uid;n.set(r,{id:r,head:null,tail:null,threshold:t.getProgressiveThreshold(),progressiveEnabled:i&&!(t.preventIncremental&&t.preventIncremental()),blockIndex:-1,step:Math.round(i||700),count:0}),M(e,t,t.dataTask)}))},y.prepareStageTasks=function(){var t=this._stageTaskMap,e=this.ecInstance.getModel(),n=this.api;r(this._allHandlers,(function(i){var r=t.get(i.uid)||t.set(i.uid,[]);i.reset&&_(this,i,r,e,n),i.overallReset&&w(this,i,r,e,n)}),this)},y.prepareView=function(t,e,n,i){var r=t.renderTask,o=r.context;o.model=e,o.ecModel=n,o.api=i,r.__block=!t.incrementalPrepareRender,M(this,e,r)},y.performDataProcessorTasks=function(t,e){b(this,this._dataProcessorHandlers,t,e,{block:!0})},y.performVisualTasks=function(t,e,n){b(this,this._visualHandlers,t,e,n)},y.performSeriesTasks=function(t){var e;t.eachSeries((function(t){e|=t.dataTask.perform()})),this.unfinished|=e},y.plan=function(){this._pipelineMap.each((function(t){var e=t.tail;do{if(e.__block){t.blockIndex=e.__idxInPipeline;break}e=e.getUpstream()}while(e)}))};var x=y.updatePayload=function(t,e){"remain"!==e&&(t.context.payload=e)};function _(t,e,n,i,r){var o=n.seriesTaskMap||(n.seriesTaskMap=a()),s=e.seriesType,l=e.getTargetSeries;function u(n){var s=n.uid,a=o.get(s)||o.set(s,c({plan:k,reset:A,count:I}));a.context={model:n,ecModel:i,api:r,useClearVisual:e.isVisual&&!e.isLayout,plan:e.plan,reset:e.reset,scheduler:t},M(t,n,a)}e.createOnAllSeries?i.eachRawSeries(u):s?i.eachRawSeriesByType(s,u):l&&l(i,r).each(u);var h=t._pipelineMap;o.each((function(t,e){h.get(e)||(t.dispose(),o.removeKey(e))}))}function w(t,e,n,i,o){var s=n.overallTask=n.overallTask||c({reset:S});s.context={ecModel:i,api:o,overallReset:e.overallReset,scheduler:t};var l=s.agentStubMap=s.agentStubMap||a(),u=e.seriesType,h=e.getTargetSeries,d=!0,f=e.modifyOutputEnd;function p(e){var n=e.uid,i=l.get(n);i||(i=l.set(n,c({reset:C,onDirty:T})),s.dirty()),i.context={model:e,overallProgress:d,modifyOutputEnd:f},i.agent=s,i.__block=d,M(t,e,i)}u?i.eachRawSeriesByType(u,p):h?h(i,o).each(p):(d=!1,r(i.getSeries(),p));var m=t._pipelineMap;l.each((function(t,e){m.get(e)||(t.dispose(),s.dirty(),l.removeKey(e))}))}function S(t){t.overallReset(t.ecModel,t.api,t.payload)}function C(t,e){return t.overallProgress&&E}function E(){this.agent.dirty(),this.getDownstream().dirty()}function T(){this.agent&&this.agent.dirty()}function k(t){return t.plan&&t.plan(t.model,t.ecModel,t.api,t.payload)}function A(t){t.useClearVisual&&t.data.clearAllVisual();var e=t.resetDefines=v(t.reset(t.model,t.ecModel,t.api,t.payload));return e.length>1?o(e,(function(t,e){return O(e)})):D}var D=O(0);function O(t){return function(e,n){var i=n.data,r=n.resetDefines[t];if(r&&r.dataEach)for(var o=e.start;o=0;s--)o=i.merge(o,e[s],!0);t.defaultOption=o}return t.defaultOption},getReferringComponents:function(t){return this.ecModel.queryComponents({mainType:t,index:this.get(t+"Index",!0),id:this.get(t+"Id",!0)})}});function m(t){var e=[];return i.each(p.getClassesByMainType(t),(function(t){e=e.concat(t.prototype.dependencies||[])})),e=i.map(e,(function(t){return l(t).main})),"dataset"!==t&&i.indexOf(e,"dataset")<=0&&e.unshift("dataset"),e}a(p,{registerWhenExtend:!0}),o.enableSubTypeDefaulter(p),o.enableTopologicalTravel(p,m),i.mixin(p,d);var v=p;t.exports=v},"6d8b":function(t,e){var n={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1,"[object CanvasPattern]":1,"[object Image]":1,"[object Canvas]":1},i={"[object Int8Array]":1,"[object Uint8Array]":1,"[object Uint8ClampedArray]":1,"[object Int16Array]":1,"[object Uint16Array]":1,"[object Int32Array]":1,"[object Uint32Array]":1,"[object Float32Array]":1,"[object Float64Array]":1},r=Object.prototype.toString,o=Array.prototype,s=o.forEach,a=o.filter,l=o.slice,u=o.map,c=o.reduce,h={};function d(t,e){"createCanvas"===t&&(y=null),h[t]=e}function f(t){if(null==t||"object"!==typeof t)return t;var e=t,o=r.call(t);if("[object Array]"===o){if(!X(t)){e=[];for(var s=0,a=t.length;s",d="<",f="prototype",p="script",m=c("IE_PROTO"),v=function(){},g=function(t){return d+p+h+t+d+"/"+p+h},y=function(t){t.write(g("")),t.close();var e=t.parentWindow.Object;return t=null,e},b=function(){var t,e=u("iframe"),n="java"+p+":";return e.style.display="none",l.appendChild(e),e.src=String(n),t=e.contentWindow.document,t.open(),t.write(g("document.F=Object")),t.close(),t.F},x=function(){try{i=document.domain&&new ActiveXObject("htmlfile")}catch(e){}x=i?y(i):b();var t=s.length;while(t--)delete x[f][s[t]];return x()};a[m]=!0,t.exports=Object.create||function(t,e){var n;return null!==t?(v[f]=r(t),n=new v,v[f]=null,n[m]=t):n=x(),void 0===e?n:o(n,e)}},"7d6d":function(t,e){var n={shadowBlur:1,shadowOffsetX:1,shadowOffsetY:1,textShadowBlur:1,textShadowOffsetX:1,textShadowOffsetY:1,textBoxShadowBlur:1,textBoxShadowOffsetX:1,textBoxShadowOffsetY:1};function i(t,e,i){return n.hasOwnProperty(e)?i*t.dpr:i}t.exports=i},"7dd0":function(t,e,n){"use strict";var i=n("23e7"),r=n("9ed3"),o=n("e163"),s=n("d2bb"),a=n("d44e"),l=n("9112"),u=n("6eeb"),c=n("b622"),h=n("c430"),d=n("3f8c"),f=n("ae93"),p=f.IteratorPrototype,m=f.BUGGY_SAFARI_ITERATORS,v=c("iterator"),g="keys",y="values",b="entries",x=function(){return this};t.exports=function(t,e,n,c,f,_,w){r(n,e,c);var S,C,E,T=function(t){if(t===f&&I)return I;if(!m&&t in D)return D[t];switch(t){case g:return function(){return new n(this,t)};case y:return function(){return new n(this,t)};case b:return function(){return new n(this,t)}}return function(){return new n(this)}},k=e+" Iterator",A=!1,D=t.prototype,O=D[v]||D["@@iterator"]||f&&D[f],I=!m&&O||T(f),M="Array"==e&&D.entries||O;if(M&&(S=o(M.call(new t)),p!==Object.prototype&&S.next&&(h||o(S)===p||(s?s(S,p):"function"!=typeof S[v]&&l(S,v,x)),a(S,k,!0,!0),h&&(d[k]=x))),f==y&&O&&O.name!==y&&(A=!0,I=function(){return O.call(this)}),h&&!w||D[v]===I||l(D,v,I),d[e]=I,f)if(C={values:T(y),keys:_?I:T(g),entries:T(b)},w)for(E in C)(m||A||!(E in D))&&u(D,E,C[E]);else i({target:e,proto:!0,forced:m||A},C);return C}},"7e63":function(t,e,n){var i=n("4e08"),r=(i.__DEV__,n("6d8b")),o=r.each,s=r.filter,a=r.map,l=r.isArray,u=r.indexOf,c=r.isObject,h=r.isString,d=r.createHashMap,f=r.assert,p=r.clone,m=r.merge,v=r.extend,g=r.mixin,y=n("e0d3"),b=n("4319"),x=n("6cb7"),_=n("8971"),w=n("e47b"),S=n("0f99"),C=S.resetSourceDefaulter,E="\0_ec_inner",T=b.extend({init:function(t,e,n,i){n=n||{},this.option=null,this._theme=new b(n),this._optionManager=i},setOption:function(t,e){f(!(E in t),"please use chart.getOption()"),this._optionManager.setOption(t,e),this.resetOption(null)},resetOption:function(t){var e=!1,n=this._optionManager;if(!t||"recreate"===t){var i=n.mountOption("recreate"===t);this.option&&"recreate"!==t?(this.restoreData(),this.mergeOption(i)):D.call(this,i),e=!0}if("timeline"!==t&&"media"!==t||this.restoreData(),!t||"recreate"===t||"timeline"===t){var r=n.getTimelineOption(this);r&&(this.mergeOption(r),e=!0)}if(!t||"recreate"===t||"media"===t){var s=n.getMediaOption(this,this._api);s.length&&o(s,(function(t){this.mergeOption(t,e=!0)}),this)}return e},mergeOption:function(t){var e=this.option,n=this._componentsMap,i=[];function r(i,r){var s=y.normalizeToArray(t[i]),a=y.mappingToExists(n.get(i),s);y.makeIdAndName(a),o(a,(function(t,e){var n=t.option;c(n)&&(t.keyInfo.mainType=i,t.keyInfo.subType=I(i,n,t.exist))}));var l=O(n,r);e[i]=[],n.set(i,[]),o(a,(function(t,r){var o=t.exist,s=t.option;if(f(c(s)||o,"Empty bootstrap definition"),s){var a=x.getClass(i,t.keyInfo.subType,!0);if(o&&o.constructor===a)o.name=t.keyInfo.name,o.mergeOption(s,this),o.optionUpdated(s,!1);else{var u=v({dependentModels:l,componentIndex:r},t.keyInfo);o=new a(s,this,this,u),v(o,u),o.init(s,this,this,u),o.optionUpdated(null,!0)}}else o.mergeOption({},this),o.optionUpdated({},!1);n.get(i)[r]=o,e[i][r]=o.option}),this),"series"===i&&M(this,n.get("series"))}C(this),o(t,(function(t,n){null!=t&&(x.hasClass(n)?n&&i.push(n):e[n]=null==e[n]?p(t):m(e[n],t,!0))})),x.topologicalTravel(i,x.getAllClassMainTypes(),r,this),this._seriesIndicesMap=d(this._seriesIndices=this._seriesIndices||[])},getOption:function(){var t=p(this.option);return o(t,(function(e,n){if(x.hasClass(n)){e=y.normalizeToArray(e);for(var i=e.length-1;i>=0;i--)y.isIdInner(e[i])&&e.splice(i,1);t[n]=e}})),delete t[E],t},getTheme:function(){return this._theme},getComponent:function(t,e){var n=this._componentsMap.get(t);if(n)return n[e||0]},queryComponents:function(t){var e=t.mainType;if(!e)return[];var n,i=t.index,r=t.id,o=t.name,c=this._componentsMap.get(e);if(!c||!c.length)return[];if(null!=i)l(i)||(i=[i]),n=s(a(i,(function(t){return c[t]})),(function(t){return!!t}));else if(null!=r){var h=l(r);n=s(c,(function(t){return h&&u(r,t.id)>=0||!h&&t.id===r}))}else if(null!=o){var d=l(o);n=s(c,(function(t){return d&&u(o,t.name)>=0||!d&&t.name===o}))}else n=c.slice();return j(n,t)},findComponents:function(t){var e=t.query,n=t.mainType,i=o(e),r=i?this.queryComponents(i):this._componentsMap.get(n);return a(j(r,t));function o(t){var e=n+"Index",i=n+"Id",r=n+"Name";return!t||null==t[e]&&null==t[i]&&null==t[r]?null:{mainType:n,index:t[e],id:t[i],name:t[r]}}function a(e){return t.filter?s(e,t.filter):e}},eachComponent:function(t,e,n){var i=this._componentsMap;if("function"===typeof t)n=e,e=t,i.each((function(t,i){o(t,(function(t,r){e.call(n,i,t,r)}))}));else if(h(t))o(i.get(t),e,n);else if(c(t)){var r=this.findComponents(t);o(r,e,n)}},getSeriesByName:function(t){var e=this._componentsMap.get("series");return s(e,(function(e){return e.name===t}))},getSeriesByIndex:function(t){return this._componentsMap.get("series")[t]},getSeriesByType:function(t){var e=this._componentsMap.get("series");return s(e,(function(e){return e.subType===t}))},getSeries:function(){return this._componentsMap.get("series").slice()},getSeriesCount:function(){return this._componentsMap.get("series").length},eachSeries:function(t,e){P(this),o(this._seriesIndices,(function(n){var i=this._componentsMap.get("series")[n];t.call(e,i,n)}),this)},eachRawSeries:function(t,e){o(this._componentsMap.get("series"),t,e)},eachSeriesByType:function(t,e,n){P(this),o(this._seriesIndices,(function(i){var r=this._componentsMap.get("series")[i];r.subType===t&&e.call(n,r,i)}),this)},eachRawSeriesByType:function(t,e,n){return o(this.getSeriesByType(t),e,n)},isSeriesFiltered:function(t){return P(this),null==this._seriesIndicesMap.get(t.componentIndex)},getCurrentSeriesIndices:function(){return(this._seriesIndices||[]).slice()},filterSeries:function(t,e){P(this);var n=s(this._componentsMap.get("series"),t,e);M(this,n)},restoreData:function(t){var e=this._componentsMap;M(this,e.get("series"));var n=[];e.each((function(t,e){n.push(e)})),x.topologicalTravel(n,x.getAllClassMainTypes(),(function(n,i){o(e.get(n),(function(e){("series"!==n||!k(e,t))&&e.restoreData()}))}))}});function k(t,e){if(e){var n=e.seiresIndex,i=e.seriesId,r=e.seriesName;return null!=n&&t.componentIndex!==n||null!=i&&t.id!==i||null!=r&&t.name!==r}}function A(t,e){var n=t.color&&!t.colorLayer;o(e,(function(e,i){"colorLayer"===i&&n||x.hasClass(i)||("object"===typeof e?t[i]=t[i]?m(t[i],e,!1):p(e):null==t[i]&&(t[i]=e))}))}function D(t){t=t,this.option={},this.option[E]=1,this._componentsMap=d({series:[]}),this._seriesIndices,this._seriesIndicesMap,A(t,this._theme.option),m(t,_,!1),this.mergeOption(t)}function O(t,e){l(e)||(e=e?[e]:[]);var n={};return o(e,(function(e){n[e]=(t.get(e)||[]).slice()})),n}function I(t,e,n){var i=e.type?e.type:n?n.subType:x.determineSubType(t,e);return i}function M(t,e){t._seriesIndicesMap=d(t._seriesIndices=a(e,(function(t){return t.componentIndex}))||[])}function j(t,e){return e.hasOwnProperty("subType")?s(t,(function(t){return t.subType===e.subType})):t}function P(t){}g(T,w);var N=T;t.exports=N},"7f96":function(t,e,n){var i=n("6d8b"),r=i.isFunction;function o(t,e,n){return{seriesType:t,performRawSeries:!0,reset:function(t,i,o){var s=t.getData(),a=t.get("symbol"),l=t.get("symbolSize"),u=t.get("symbolKeepAspect"),c=t.get("symbolRotate"),h=r(a),d=r(l),f=r(c),p=h||d||f,m=!h&&a?a:e,v=d?null:l;if(s.setVisual({legendSymbol:n||m,symbol:m,symbolSize:v,symbolKeepAspect:u,symbolRotate:c}),!i.isSeriesFiltered(t))return{dataEach:s.hasItemOption||p?g:null};function g(e,n){if(p){var i=t.getRawValue(n),r=t.getDataParams(n);h&&e.setItemVisual(n,"symbol",a(i,r)),d&&e.setItemVisual(n,"symbolSize",l(i,r)),f&&e.setItemVisual(n,"symbolRotate",c(i,r))}if(e.hasItemOption){var o=e.getItemModel(n),s=o.getShallow("symbol",!0),u=o.getShallow("symbolSize",!0),m=o.getShallow("symbolRotate",!0),v=o.getShallow("symbolKeepAspect",!0);null!=s&&e.setItemVisual(n,"symbol",s),null!=u&&e.setItemVisual(n,"symbolSize",u),null!=m&&e.setItemVisual(n,"symbolRotate",m),null!=v&&e.setItemVisual(n,"symbolKeepAspect",v)}}}}}t.exports=o},"7f9a":function(t,e,n){var i=n("da84"),r=n("8925"),o=i.WeakMap;t.exports="function"===typeof o&&/native code/.test(r(o))},"80f0":function(t,e){function n(t){return t}function i(t,e,i,r,o){this._old=t,this._new=e,this._oldKeyGetter=i||n,this._newKeyGetter=r||n,this.context=o}function r(t,e,n,i,r){for(var o=0;o=0){var u=o.indexOf(a),c=o.substr(l+s.length,u-l-s.length);c.indexOf("sub")>-1?i["marker"+c]={textWidth:4,textHeight:4,textBorderRadius:2,textBackgroundColor:e[c],textOffset:[3,0]}:i["marker"+c]={textWidth:10,textHeight:10,textBorderRadius:5,textBackgroundColor:e[c]},o=o.substr(u+1),l=o.indexOf("{marker")}this.el=new r({style:{rich:i,text:t,textLineHeight:20,textBackgroundColor:n.get("backgroundColor"),textBorderRadius:n.get("borderRadius"),textFill:n.get("textStyle.color"),textPadding:n.get("padding")},z:n.get("z")}),this._zr.add(this.el);var h=this;this.el.on("mouseover",(function(){h._enterable&&(clearTimeout(h._hideTimeout),h._show=!0),h._inContent=!0})),this.el.on("mouseout",(function(){h._enterable&&h._show&&h.hideLater(h._hideDelay),h._inContent=!1}))},setEnterable:function(t){this._enterable=t},getSize:function(){var t=this.el.getBoundingRect();return[t.width,t.height]},moveTo:function(t,e){this.el&&this.el.attr("position",[t,e])},hide:function(){this.el&&this.el.hide(),this._show=!1},hideLater:function(t){!this._show||this._inContent&&this._enterable||(t?(this._hideDelay=t,this._show=!1,this._hideTimeout=setTimeout(i.bind(this.hide,this),t)):this.hide())},isShow:function(){return this._show},getOuterSize:function(){var t=this.getSize();return{width:t[0],height:t[1]}}};var s=o;t.exports=s},"83ab":function(t,e,n){var i=n("d039");t.exports=!i((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},"843e":function(t,e,n){var i=n("6d8b"),r=["getDom","getZr","getWidth","getHeight","getDevicePixelRatio","dispatchAction","isDisposed","on","off","getDataURL","getConnectedDataURL","getModel","getOption","getViewOfComponentModel","getViewOfSeriesModel"];function o(t){i.each(r,(function(e){this[e]=i.bind(t[e],t)}),this)}var s=o;t.exports=s},"84ce":function(t,e,n){var i=n("6d8b"),r=i.each,o=i.map,s=n("3842"),a=s.linearMap,l=s.getPixelPrecision,u=s.round,c=n("e073"),h=c.createAxisTicks,d=c.createAxisLabels,f=c.calculateCategoryInterval,p=[0,1],m=function(t,e,n){this.dim=t,this.scale=e,this._extent=n||[0,0],this.inverse=!1,this.onBand=!1};function v(t,e){var n=t[1]-t[0],i=e,r=n/i/2;t[0]+=r,t[1]-=r}function g(t,e,n,i){var o=e.length;if(t.onBand&&!n&&o){var s,a,l=t.getExtent();if(1===o)e[0].coord=l[0],s=e[1]={coord:l[0]};else{var c=e[o-1].tickValue-e[0].tickValue,h=(e[o-1].coord-e[0].coord)/c;r(e,(function(t){t.coord-=h/2}));var d=t.scale.getExtent();a=1+d[1]-e[o-1].tickValue,s={coord:e[o-1].coord+h*a},e.push(s)}var f=l[0]>l[1];p(e[0].coord,l[0])&&(i?e[0].coord=l[0]:e.shift()),i&&p(l[0],e[0].coord)&&e.unshift({coord:l[0]}),p(l[1],s.coord)&&(i?s.coord=l[1]:e.pop()),i&&p(s.coord,l[1])&&e.push({coord:l[1]})}function p(t,e){return t=u(t),e=u(e),f?t>e:t=n&&t<=i},containData:function(t){return this.scale.contain(t)},getExtent:function(){return this._extent.slice()},getPixelPrecision:function(t){return l(t||this.scale.getExtent(),this._extent)},setExtent:function(t,e){var n=this._extent;n[0]=t,n[1]=e},dataToCoord:function(t,e){var n=this._extent,i=this.scale;return t=i.normalize(t),this.onBand&&"ordinal"===i.type&&(n=n.slice(),v(n,i.count())),a(t,p,n,e)},coordToData:function(t,e){var n=this._extent,i=this.scale;this.onBand&&"ordinal"===i.type&&(n=n.slice(),v(n,i.count()));var r=a(t,n,p,e);return this.scale.scale(r)},pointToData:function(t,e){},getTicksCoords:function(t){t=t||{};var e=t.tickModel||this.getTickModel(),n=h(this,e),i=n.ticks,r=o(i,(function(t){return{coord:this.dataToCoord(t),tickValue:t}}),this),s=e.get("alignWithLabel");return g(this,r,s,t.clamp),r},getMinorTicksCoords:function(){if("ordinal"===this.scale.type)return[];var t=this.model.getModel("minorTick"),e=t.get("splitNumber");e>0&&e<100||(e=5);var n=this.scale.getMinorTicks(e),i=o(n,(function(t){return o(t,(function(t){return{coord:this.dataToCoord(t),tickValue:t}}),this)}),this);return i},getViewLabels:function(){return d(this).labels},getLabelModel:function(){return this.model.getModel("axisLabel")},getTickModel:function(){return this.model.getModel("axisTick")},getBandWidth:function(){var t=this._extent,e=this.scale.getExtent(),n=e[1]-e[0]+(this.onBand?1:0);0===n&&(n=1);var i=Math.abs(t[1]-t[0]);return Math.abs(i)/n},isHorizontal:null,getRotate:null,calculateCategoryInterval:function(){return f(this)}};var y=m;t.exports=y},"84ec":function(t,e){var n=Math.log(2);function i(t,e,r,o,s,a){var l=o+"-"+s,u=t.length;if(a.hasOwnProperty(l))return a[l];if(1===e){var c=Math.round(Math.log((1<e&&o>i||or?s:0}t.exports=n},"872a":function(t,e,n){"use strict";var i=n("c3ea"),r=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],o=["scalar","sequence","mapping"];function s(t){var e={};return null!==t&&Object.keys(t).forEach((function(n){t[n].forEach((function(t){e[String(t)]=n}))})),e}function a(t,e){if(e=e||{},Object.keys(e).forEach((function(e){if(-1===r.indexOf(e))throw new i('Unknown option "'+e+'" is met in definition of "'+t+'" YAML type.')})),this.tag=t,this.kind=e["kind"]||null,this.resolve=e["resolve"]||function(){return!0},this.construct=e["construct"]||function(t){return t},this.instanceOf=e["instanceOf"]||null,this.predicate=e["predicate"]||null,this.represent=e["represent"]||null,this.defaultStyle=e["defaultStyle"]||null,this.styleAliases=s(e["styleAliases"]||null),-1===o.indexOf(this.kind))throw new i('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}t.exports=a},"872a6":function(t,e,n){var i=n("3b4a");function r(t,e,n){"__proto__"==e&&i?i(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}t.exports=r},"87b1":function(t,e,n){var i=n("cbe5"),r=n("4fac"),o=i.extend({type:"polygon",shape:{points:null,smooth:!1,smoothConstraint:null},buildPath:function(t,e){r.buildPath(t,e,!0)}});t.exports=o},"87c3":function(t,e,n){var i=n("6d8b"),r=i.map,o=n("cccd"),s=n("ee1a"),a=s.isDimensionStacked;function l(t){return{seriesType:t,plan:o(),reset:function(t){var e=t.getData(),n=t.coordinateSystem,i=t.pipelineContext,o=i.large;if(n){var s=r(n.dimensions,(function(t){return e.mapDimension(t)})).slice(0,2),l=s.length,u=e.getCalculationInfo("stackResultDimension");return a(e,s[0])&&(s[0]=u),a(e,s[1])&&(s[1]=u),l&&{progress:c}}function c(t,e){for(var i=t.end-t.start,r=o&&new Float32Array(i*l),a=t.start,u=0,c=[],h=[];a=0?h():c=setTimeout(h,-r),l=i};return d.clear=function(){c&&(clearTimeout(c),c=null)},d.debounceNextCall=function(t){a=t},d}function s(t,e,s,a){var l=t[e];if(l){var u=l[n]||l,c=l[r],h=l[i];if(h!==s||c!==a){if(null==s||!a)return t[e]=u;l=t[e]=o(u,s,"debounce"===a),l[n]=u,l[r]=a,l[i]=s}return l}}function a(t,e){var i=t[e];i&&i[n]&&(t[e]=i[n])}e.throttle=o,e.createOrUpdate=s,e.clear=a},8918:function(t,e,n){var i=n("6d8b"),r=n("625e"),o=r.parseClassType,s=0;function a(t){return[t||"",s++,Math.random().toFixed(5)].join("_")}function l(t){var e={};return t.registerSubTypeDefaulter=function(t,n){t=o(t),e[t.main]=n},t.determineSubType=function(n,i){var r=i.type;if(!r){var s=o(n).main;t.hasSubTypes(n)&&e[s]&&(r=e[s](i))}return r},t}function u(t,e){function n(t){var n={},s=[];return i.each(t,(function(a){var l=r(n,a),u=l.originalDeps=e(a),c=o(u,t);l.entryCount=c.length,0===l.entryCount&&s.push(a),i.each(c,(function(t){i.indexOf(l.predecessor,t)<0&&l.predecessor.push(t);var e=r(n,t);i.indexOf(e.successor,t)<0&&e.successor.push(a)}))})),{graph:n,noEntryList:s}}function r(t,e){return t[e]||(t[e]={predecessor:[],successor:[]}),t[e]}function o(t,e){var n=[];return i.each(t,(function(t){i.indexOf(e,t)>=0&&n.push(t)})),n}t.topologicalTravel=function(t,e,r,o){if(t.length){var s=n(e),a=s.graph,l=s.noEntryList,u={};i.each(t,(function(t){u[t]=!0}));while(l.length){var c=l.pop(),h=a[c],d=!!u[c];d&&(r.call(o,c,h.originalDeps.slice()),delete u[c]),i.each(h.successor,d?p:f)}i.each(u,(function(){throw new Error("Circle dependency may exists")}))}function f(t){a[t].entryCount--,0===a[t].entryCount&&l.push(t)}function p(t){u[t]=!0,f(t)}}}e.getUID=a,e.enableSubTypeDefaulter=l,e.enableTopologicalTravel=u},8925:function(t,e,n){var i=n("c6cd"),r=Function.toString;"function"!=typeof i.inspectSource&&(i.inspectSource=function(t){return r.call(t)}),t.exports=i.inspectSource},8971:function(t,e){var n="";"undefined"!==typeof navigator&&(n=navigator.platform||"");var i={color:["#c23531","#2f4554","#61a0a8","#d48265","#91c7ae","#749f83","#ca8622","#bda29a","#6e7074","#546570","#c4ccd3"],gradientColor:["#f6efa6","#d88273","#bf444c"],textStyle:{fontFamily:n.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,animation:"auto",animationDuration:1e3,animationDurationUpdate:300,animationEasing:"exponentialOut",animationEasingUpdate:"cubicOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1};t.exports=i},"897a":function(t,e,n){var i=n("22d1"),r=[["shadowBlur",0],["shadowColor","#000"],["shadowOffsetX",0],["shadowOffsetY",0]];function o(t){return i.browser.ie&&i.browser.version>=11?function(){var e,n=this.__clipPaths,i=this.style;if(n)for(var o=0;oe[1]&&(e[1]=t[1]),l.prototype.setExtent.call(this,e[0],e[1])},getInterval:function(){return this._interval},setInterval:function(t){this._interval=t,this._niceExtent=this._extent.slice(),this._intervalPrecision=s.getIntervalPrecision(t)},getTicks:function(t){var e=this._interval,n=this._extent,i=this._niceExtent,r=this._intervalPrecision,o=[];if(!e)return o;var s=1e4;n[0]s)return[]}var u=o.length?o[o.length-1]:i[1];return n[1]>u&&(t?o.push(a(u+e,r)):o.push(n[1])),o},getMinorTicks:function(t){for(var e=this.getTicks(!0),n=[],r=this.getExtent(),o=1;or[0]&&d0)i*=10;var s=[o.round(d(e[0]/i)*i),o.round(h(e[1]/i)*i)];this._interval=i,this._niceExtent=s}},niceExtent:function(t){l.niceExtent.call(this,t);var e=this._originalScale;e.__fixMin=t.fixMin,e.__fixMax=t.fixMax}});function v(t,e){return c(t,u(e))}i.each(["contain","normalize"],(function(t){m.prototype[t]=function(e){return e=p(e)/p(this.base),a[t].call(this,e)}})),m.create=function(){return new m};var g=m;t.exports=g},"8c4f":function(t,e,n){"use strict"; /*! * vue-router v3.3.4 * (c) 2020 Evan You * @license MIT - */function i(t,e){0}function r(t){return Object.prototype.toString.call(t).indexOf("Error")>-1}function o(t,e){return r(t)&&t._isRouter&&(null==e||t.type===e)}function s(t,e){for(var n in e)t[n]=e[n];return t}var a={name:"RouterView",functional:!0,props:{name:{type:String,default:"default"}},render:function(t,e){var n=e.props,i=e.children,r=e.parent,o=e.data;o.routerView=!0;var a=r.$createElement,u=n.name,c=r.$route,h=r._routerViewCache||(r._routerViewCache={}),d=0,f=!1;while(r&&r._routerRoot!==r){var p=r.$vnode?r.$vnode.data:{};p.routerView&&d++,p.keepAlive&&r._directInactive&&r._inactive&&(f=!0),r=r.$parent}if(o.routerViewDepth=d,f){var m=h[u],v=m&&m.component;return v?(m.configProps&&l(v,o,m.route,m.configProps),a(v,o,i)):a()}var g=c.matched[d],y=g&&g.components[u];if(!g||!y)return h[u]=null,a();h[u]={component:y},o.registerRouteInstance=function(t,e){var n=g.instances[u];(e&&n!==t||!e&&n===t)&&(g.instances[u]=e)},(o.hook||(o.hook={})).prepatch=function(t,e){g.instances[u]=e.componentInstance},o.hook.init=function(t){t.data.keepAlive&&t.componentInstance&&t.componentInstance!==g.instances[u]&&(g.instances[u]=t.componentInstance)};var b=g.props&&g.props[u];return b&&(s(h[u],{route:c,configProps:b}),l(y,o,c,b)),a(y,o,i)}};function l(t,e,n,i){var r=e.props=u(n,i);if(r){r=e.props=s({},r);var o=e.attrs=e.attrs||{};for(var a in r)t.props&&a in t.props||(o[a]=r[a],delete r[a])}}function u(t,e){switch(typeof e){case"undefined":return;case"object":return e;case"function":return e(t);case"boolean":return e?t.params:void 0;default:0}}var c=/[!'()*]/g,h=function(t){return"%"+t.charCodeAt(0).toString(16)},d=/%2C/g,f=function(t){return encodeURIComponent(t).replace(c,h).replace(d,",")},p=decodeURIComponent;function m(t,e,n){void 0===e&&(e={});var i,r=n||v;try{i=r(t||"")}catch(s){i={}}for(var o in e)i[o]=e[o];return i}function v(t){var e={};return t=t.trim().replace(/^(\?|#|&)/,""),t?(t.split("&").forEach((function(t){var n=t.replace(/\+/g," ").split("="),i=p(n.shift()),r=n.length>0?p(n.join("=")):null;void 0===e[i]?e[i]=r:Array.isArray(e[i])?e[i].push(r):e[i]=[e[i],r]})),e):e}function g(t){var e=t?Object.keys(t).map((function(e){var n=t[e];if(void 0===n)return"";if(null===n)return f(e);if(Array.isArray(n)){var i=[];return n.forEach((function(t){void 0!==t&&(null===t?i.push(f(e)):i.push(f(e)+"="+f(t)))})),i.join("&")}return f(e)+"="+f(n)})).filter((function(t){return t.length>0})).join("&"):null;return e?"?"+e:""}var y=/\/?$/;function b(t,e,n,i){var r=i&&i.options.stringifyQuery,o=e.query||{};try{o=x(o)}catch(a){}var s={name:e.name||t&&t.name,meta:t&&t.meta||{},path:e.path||"/",hash:e.hash||"",query:o,params:e.params||{},fullPath:S(e,r),matched:t?w(t):[]};return n&&(s.redirectedFrom=S(n,r)),Object.freeze(s)}function x(t){if(Array.isArray(t))return t.map(x);if(t&&"object"===typeof t){var e={};for(var n in t)e[n]=x(t[n]);return e}return t}var _=b(null,{path:"/"});function w(t){var e=[];while(t)e.unshift(t),t=t.parent;return e}function S(t,e){var n=t.path,i=t.query;void 0===i&&(i={});var r=t.hash;void 0===r&&(r="");var o=e||g;return(n||"/")+o(i)+r}function C(t,e){return e===_?t===e:!!e&&(t.path&&e.path?t.path.replace(y,"")===e.path.replace(y,"")&&t.hash===e.hash&&E(t.query,e.query):!(!t.name||!e.name)&&(t.name===e.name&&t.hash===e.hash&&E(t.query,e.query)&&E(t.params,e.params)))}function E(t,e){if(void 0===t&&(t={}),void 0===e&&(e={}),!t||!e)return t===e;var n=Object.keys(t),i=Object.keys(e);return n.length===i.length&&n.every((function(n){var i=t[n],r=e[n];return"object"===typeof i&&"object"===typeof r?E(i,r):String(i)===String(r)}))}function T(t,e){return 0===t.path.replace(y,"/").indexOf(e.path.replace(y,"/"))&&(!e.hash||t.hash===e.hash)&&k(t.query,e.query)}function k(t,e){for(var n in e)if(!(n in t))return!1;return!0}function A(t,e,n){var i=t.charAt(0);if("/"===i)return t;if("?"===i||"#"===i)return e+t;var r=e.split("/");n&&r[r.length-1]||r.pop();for(var o=t.replace(/^\//,"").split("/"),s=0;s=0&&(e=t.slice(i),t=t.slice(0,i));var r=t.indexOf("?");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{path:t,query:n,hash:e}}function O(t){return t.replace(/\/\//g,"/")}var I=Array.isArray||function(t){return"[object Array]"==Object.prototype.toString.call(t)},M=K,j=R,P=L,N=z,V=J,F=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function R(t,e){var n,i=[],r=0,o=0,s="",a=e&&e.delimiter||"/";while(null!=(n=F.exec(t))){var l=n[0],u=n[1],c=n.index;if(s+=t.slice(o,c),o=c+l.length,u)s+=u[1];else{var h=t[o],d=n[2],f=n[3],p=n[4],m=n[5],v=n[6],g=n[7];s&&(i.push(s),s="");var y=null!=d&&null!=h&&h!==d,b="+"===v||"*"===v,x="?"===v||"*"===v,_=n[2]||a,w=p||m;i.push({name:f||r++,prefix:d||"",delimiter:_,optional:x,repeat:b,partial:y,asterisk:!!g,pattern:w?U(w):g?".*":"[^"+H(_)+"]+?"})}}return o1||!w.length)return 0===w.length?t():t("span",{},w)}if("a"===this.tag)_.on=x,_.attrs={href:l,"aria-current":g};else{var S=at(this.$slots.default);if(S){S.isStatic=!1;var E=S.data=s({},S.data);for(var k in E.on=E.on||{},E.on){var A=E.on[k];k in x&&(E.on[k]=Array.isArray(A)?A:[A])}for(var D in x)D in E.on?E.on[D].push(x[D]):E.on[D]=y;var O=S.data.attrs=s({},S.data.attrs);O.href=l,O["aria-current"]=g}else _.on=x}return t(this.tag,_,this.$slots.default)}};function st(t){if(!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)&&!t.defaultPrevented&&(void 0===t.button||0===t.button)){if(t.currentTarget&&t.currentTarget.getAttribute){var e=t.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return t.preventDefault&&t.preventDefault(),!0}}function at(t){if(t)for(var e,n=0;n-1&&(a.params[d]=n.params[d]);return a.path=Q(u.path,a.params,'named route "'+l+'"'),c(u,a,s)}if(a.path){a.params={};for(var f=0;f=t.length?n():t[r]?e(t[r],(function(){i(r+1)})):i(r+1)};i(0)}function Lt(t){return function(e,n,i){var o=!1,s=0,a=null;Bt(t,(function(t,e,n,l){if("function"===typeof t&&void 0===t.cid){o=!0,s++;var u,c=Ut((function(e){Ht(e)&&(e=e.default),t.resolved="function"===typeof e?e:et.extend(e),n.components[l]=e,s--,s<=0&&i()})),h=Ut((function(t){var e="Failed to resolve async component "+l+": "+t;a||(a=r(t)?t:new Error(e),i(a))}));try{u=t(c,h)}catch(f){h(f)}if(u)if("function"===typeof u.then)u.then(c,h);else{var d=u.component;d&&"function"===typeof d.then&&d.then(c,h)}}})),o||i()}}function Bt(t,e){return $t(t.map((function(t){return Object.keys(t.components).map((function(n){return e(t.components[n],t.instances[n],t,n)}))})))}function $t(t){return Array.prototype.concat.apply([],t)}var zt="function"===typeof Symbol&&"symbol"===typeof Symbol.toStringTag;function Ht(t){return t.__esModule||zt&&"Module"===t[Symbol.toStringTag]}function Ut(t){var e=!1;return function(){var n=[],i=arguments.length;while(i--)n[i]=arguments[i];if(!e)return e=!0,t.apply(this,n)}}var Wt={redirected:1,aborted:2,cancelled:3,duplicated:4};function qt(t,e){return Jt(t,e,Wt.redirected,'Redirected when going from "'+t.fullPath+'" to "'+Zt(e)+'" via a navigation guard.')}function Gt(t,e){return Jt(t,e,Wt.duplicated,'Avoided redundant navigation to current location: "'+t.fullPath+'".')}function Yt(t,e){return Jt(t,e,Wt.cancelled,'Navigation cancelled from "'+t.fullPath+'" to "'+e.fullPath+'" with a new navigation.')}function Xt(t,e){return Jt(t,e,Wt.aborted,'Navigation aborted from "'+t.fullPath+'" to "'+e.fullPath+'" via a navigation guard.')}function Jt(t,e,n,i){var r=new Error(i);return r._isRouter=!0,r.from=t,r.to=e,r.type=n,r}var Kt=["params","query","hash"];function Zt(t){if("string"===typeof t)return t;if("path"in t)return t.path;var e={};return Kt.forEach((function(n){n in t&&(e[n]=t[n])})),JSON.stringify(e,null,2)}var Qt=function(t,e){this.router=t,this.base=te(e),this.current=_,this.pending=null,this.ready=!1,this.readyCbs=[],this.readyErrorCbs=[],this.errorCbs=[],this.listeners=[]};function te(t){if(!t)if(ut){var e=document.querySelector("base");t=e&&e.getAttribute("href")||"/",t=t.replace(/^https?:\/\/[^\/]+/,"")}else t="/";return"/"!==t.charAt(0)&&(t="/"+t),t.replace(/\/$/,"")}function ee(t,e){var n,i=Math.max(t.length,e.length);for(n=0;n0)){var e=this.router,n=e.options.scrollBehavior,i=Nt&&n;i&&this.listeners.push(St());var r=function(){var n=t.current,r=he(t.base);t.current===_&&r===t._startLocation||t.transitionTo(r,(function(t){i&&Ct(e,t,n,!0)}))};window.addEventListener("popstate",r),this.listeners.push((function(){window.removeEventListener("popstate",r)}))}},e.prototype.go=function(t){window.history.go(t)},e.prototype.push=function(t,e,n){var i=this,r=this,o=r.current;this.transitionTo(t,(function(t){Vt(O(i.base+t.fullPath)),Ct(i.router,t,o,!1),e&&e(t)}),n)},e.prototype.replace=function(t,e,n){var i=this,r=this,o=r.current;this.transitionTo(t,(function(t){Ft(O(i.base+t.fullPath)),Ct(i.router,t,o,!1),e&&e(t)}),n)},e.prototype.ensureURL=function(t){if(he(this.base)!==this.current.fullPath){var e=O(this.base+this.current.fullPath);t?Vt(e):Ft(e)}},e.prototype.getCurrentLocation=function(){return he(this.base)},e}(Qt);function he(t){var e=decodeURI(window.location.pathname);return t&&0===e.toLowerCase().indexOf(t.toLowerCase())&&(e=e.slice(t.length)),(e||"/")+window.location.search+window.location.hash}var de=function(t){function e(e,n,i){t.call(this,e,n),i&&fe(this.base)||pe()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setupListeners=function(){var t=this;if(!(this.listeners.length>0)){var e=this.router,n=e.options.scrollBehavior,i=Nt&&n;i&&this.listeners.push(St());var r=function(){var e=t.current;pe()&&t.transitionTo(me(),(function(n){i&&Ct(t.router,n,e,!0),Nt||ye(n.fullPath)}))},o=Nt?"popstate":"hashchange";window.addEventListener(o,r),this.listeners.push((function(){window.removeEventListener(o,r)}))}},e.prototype.push=function(t,e,n){var i=this,r=this,o=r.current;this.transitionTo(t,(function(t){ge(t.fullPath),Ct(i.router,t,o,!1),e&&e(t)}),n)},e.prototype.replace=function(t,e,n){var i=this,r=this,o=r.current;this.transitionTo(t,(function(t){ye(t.fullPath),Ct(i.router,t,o,!1),e&&e(t)}),n)},e.prototype.go=function(t){window.history.go(t)},e.prototype.ensureURL=function(t){var e=this.current.fullPath;me()!==e&&(t?ge(e):ye(e))},e.prototype.getCurrentLocation=function(){return me()},e}(Qt);function fe(t){var e=he(t);if(!/^\/#/.test(e))return window.location.replace(O(t+"/#"+e)),!0}function pe(){var t=me();return"/"===t.charAt(0)||(ye("/"+t),!1)}function me(){var t=window.location.href,e=t.indexOf("#");if(e<0)return"";t=t.slice(e+1);var n=t.indexOf("?");if(n<0){var i=t.indexOf("#");t=i>-1?decodeURI(t.slice(0,i))+t.slice(i):decodeURI(t)}else t=decodeURI(t.slice(0,n))+t.slice(n);return t}function ve(t){var e=window.location.href,n=e.indexOf("#"),i=n>=0?e.slice(0,n):e;return i+"#"+t}function ge(t){Nt?Vt(ve(t)):window.location.hash=t}function ye(t){Nt?Ft(ve(t)):window.location.replace(ve(t))}var be=function(t){function e(e,n){t.call(this,e,n),this.stack=[],this.index=-1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.push=function(t,e,n){var i=this;this.transitionTo(t,(function(t){i.stack=i.stack.slice(0,i.index+1).concat(t),i.index++,e&&e(t)}),n)},e.prototype.replace=function(t,e,n){var i=this;this.transitionTo(t,(function(t){i.stack=i.stack.slice(0,i.index).concat(t),e&&e(t)}),n)},e.prototype.go=function(t){var e=this,n=this.index+t;if(!(n<0||n>=this.stack.length)){var i=this.stack[n];this.confirmTransition(i,(function(){e.index=n,e.updateRoute(i)}),(function(t){o(t,Wt.duplicated)&&(e.index=n)}))}},e.prototype.getCurrentLocation=function(){var t=this.stack[this.stack.length-1];return t?t.fullPath:"/"},e.prototype.ensureURL=function(){},e}(Qt),xe=function(t){void 0===t&&(t={}),this.app=null,this.apps=[],this.options=t,this.beforeHooks=[],this.resolveHooks=[],this.afterHooks=[],this.matcher=pt(t.routes||[],this);var e=t.mode||"hash";switch(this.fallback="history"===e&&!Nt&&!1!==t.fallback,this.fallback&&(e="hash"),ut||(e="abstract"),this.mode=e,e){case"history":this.history=new ce(this,t.base);break;case"hash":this.history=new de(this,t.base,this.fallback);break;case"abstract":this.history=new be(this,t.base);break;default:0}},_e={currentRoute:{configurable:!0}};function we(t,e){return t.push(e),function(){var n=t.indexOf(e);n>-1&&t.splice(n,1)}}function Se(t,e,n){var i="hash"===n?"#"+e:e;return t?O(t+"/"+i):i}xe.prototype.match=function(t,e,n){return this.matcher.match(t,e,n)},_e.currentRoute.get=function(){return this.history&&this.history.current},xe.prototype.init=function(t){var e=this;if(this.apps.push(t),t.$once("hook:destroyed",(function(){var n=e.apps.indexOf(t);n>-1&&e.apps.splice(n,1),e.app===t&&(e.app=e.apps[0]||null),e.app||e.history.teardownListeners()})),!this.app){this.app=t;var n=this.history;if(n instanceof ce||n instanceof de){var i=function(){n.setupListeners()};n.transitionTo(n.getCurrentLocation(),i,i)}n.listen((function(t){e.apps.forEach((function(e){e._route=t}))}))}},xe.prototype.beforeEach=function(t){return we(this.beforeHooks,t)},xe.prototype.beforeResolve=function(t){return we(this.resolveHooks,t)},xe.prototype.afterEach=function(t){return we(this.afterHooks,t)},xe.prototype.onReady=function(t,e){this.history.onReady(t,e)},xe.prototype.onError=function(t){this.history.onError(t)},xe.prototype.push=function(t,e,n){var i=this;if(!e&&!n&&"undefined"!==typeof Promise)return new Promise((function(e,n){i.history.push(t,e,n)}));this.history.push(t,e,n)},xe.prototype.replace=function(t,e,n){var i=this;if(!e&&!n&&"undefined"!==typeof Promise)return new Promise((function(e,n){i.history.replace(t,e,n)}));this.history.replace(t,e,n)},xe.prototype.go=function(t){this.history.go(t)},xe.prototype.back=function(){this.go(-1)},xe.prototype.forward=function(){this.go(1)},xe.prototype.getMatchedComponents=function(t){var e=t?t.matched?t:this.resolve(t).route:this.currentRoute;return e?[].concat.apply([],e.matched.map((function(t){return Object.keys(t.components).map((function(e){return t.components[e]}))}))):[]},xe.prototype.resolve=function(t,e,n){e=e||this.history.current;var i=tt(t,e,n,this),r=this.match(i,e),o=r.redirectedFrom||r.fullPath,s=this.history.base,a=Se(s,o,this.mode);return{location:i,route:r,href:a,normalizedTo:i,resolved:r}},xe.prototype.addRoutes=function(t){this.matcher.addRoutes(t),this.history.current!==_&&this.history.transitionTo(this.history.getCurrentLocation())},Object.defineProperties(xe.prototype,_e),xe.install=lt,xe.version="3.3.4",ut&&window.Vue&&window.Vue.use(xe),e["a"]=xe},"8ced":function(t,e,n){"use strict";var i;try{i=n("b639").Buffer}catch(c){}var r=n("872a"),o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";function s(t){if(null===t)return!1;var e,n,i=0,r=t.length,s=o;for(n=0;n64)){if(e<0)return!1;i+=6}return i%8===0}function a(t){var e,n,r=t.replace(/[\r\n=]/g,""),s=r.length,a=o,l=0,u=[];for(e=0;e>16&255),u.push(l>>8&255),u.push(255&l)),l=l<<6|a.indexOf(r.charAt(e));return n=s%4*6,0===n?(u.push(l>>16&255),u.push(l>>8&255),u.push(255&l)):18===n?(u.push(l>>10&255),u.push(l>>2&255)):12===n&&u.push(l>>4&255),i?i.from?i.from(u):new i(u):u}function l(t){var e,n,i="",r=0,s=t.length,a=o;for(e=0;e>18&63],i+=a[r>>12&63],i+=a[r>>6&63],i+=a[63&r]),r=(r<<8)+t[e];return n=s%3,0===n?(i+=a[r>>18&63],i+=a[r>>12&63],i+=a[r>>6&63],i+=a[63&r]):2===n?(i+=a[r>>10&63],i+=a[r>>4&63],i+=a[r<<2&63],i+=a[64]):1===n&&(i+=a[r>>2&63],i+=a[r<<4&63],i+=a[64],i+=a[64]),i}function u(t){return i&&i.isBuffer(t)}t.exports=new r("tag:yaml.org,2002:binary",{kind:"scalar",resolve:s,construct:a,predicate:u,represent:l})},"8d32":function(t,e,n){var i=n("cbe5"),r=i.extend({type:"arc",shape:{cx:0,cy:0,r:0,startAngle:0,endAngle:2*Math.PI,clockwise:!0},style:{stroke:"#000",fill:null},buildPath:function(t,e){var n=e.cx,i=e.cy,r=Math.max(e.r,0),o=e.startAngle,s=e.endAngle,a=e.clockwise,l=Math.cos(o),u=Math.sin(o);t.moveTo(l*r+n,u*r+i),t.arc(n,i,r,o,s,!a)}});t.exports=r},"8df4":function(t,e,n){"use strict";var i=n("7a77");function r(t){if("function"!==typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var n=this;t((function(t){n.reason||(n.reason=new i(t),e(n.reason))}))}r.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},r.source=function(){var t,e=new r((function(e){t=e}));return{token:e,cancel:t}},t.exports=r},"8e43":function(t,e,n){var i=n("6d8b"),r=i.createHashMap,o=i.isObject,s=i.map;function a(t){this.categories=t.categories||[],this._needCollect=t.needCollect,this._deduplication=t.deduplication,this._map}a.createByAxisModel=function(t){var e=t.option,n=e.data,i=n&&s(n,c);return new a({categories:i,needCollect:!i,deduplication:!1!==e.dedplication})};var l=a.prototype;function u(t){return t._map||(t._map=r(t.categories))}function c(t){return o(t)&&null!=t.value?t.value:t+""}l.getOrdinal=function(t){return u(this).get(t)},l.parseAndCollect=function(t){var e,n=this._needCollect;if("string"!==typeof t&&!n)return t;if(n&&!this._deduplication)return e=this.categories.length,this.categories[e]=t,e;var i=u(this);return e=i.get(t),null==e&&(n?(e=this.categories.length,this.categories[e]=t,i.set(t,e)):e=NaN),e};var h=a;t.exports=h},"8ed2":function(t,e,n){n("48c7");var i=n("6cb7"),r=i.extend({type:"grid",dependencies:["xAxis","yAxis"],layoutMode:"box",coordinateSystem:null,defaultOption:{show:!1,zlevel:0,z:0,left:"10%",top:60,right:"10%",bottom:60,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"}});t.exports=r},"90e3":function(t,e){var n=0,i=Math.random();t.exports=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++n+i).toString(36)}},9112:function(t,e,n){var i=n("83ab"),r=n("9bf2"),o=n("5c6c");t.exports=i?function(t,e,n){return r.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},9152:function(t,e){e.read=function(t,e,n,i,r){var o,s,a=8*r-i-1,l=(1<>1,c=-7,h=n?r-1:0,d=n?-1:1,f=t[e+h];for(h+=d,o=f&(1<<-c)-1,f>>=-c,c+=a;c>0;o=256*o+t[e+h],h+=d,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=i;c>0;s=256*s+t[e+h],h+=d,c-=8);if(0===o)o=1-u;else{if(o===l)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,i),o-=u}return(f?-1:1)*s*Math.pow(2,o-i)},e.write=function(t,e,n,i,r,o){var s,a,l,u=8*o-r-1,c=(1<>1,d=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,f=i?0:o-1,p=i?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=c):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),e+=s+h>=1?d/l:d*Math.pow(2,1-h),e*l>=2&&(s++,l/=2),s+h>=c?(a=0,s=c):s+h>=1?(a=(e*l-1)*Math.pow(2,r),s+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,r),s=0));r>=8;t[n+f]=255&a,f+=p,a/=256,r-=8);for(s=s<0;t[n+f]=255&s,f+=p,s/=256,u-=8);t[n+f-p]|=128*m}},9263:function(t,e,n){"use strict";var i=n("ad6d"),r=n("9f7f"),o=RegExp.prototype.exec,s=String.prototype.replace,a=o,l=function(){var t=/a/,e=/b*/g;return o.call(t,"a"),o.call(e,"a"),0!==t.lastIndex||0!==e.lastIndex}(),u=r.UNSUPPORTED_Y||r.BROKEN_CARET,c=void 0!==/()??/.exec("")[1],h=l||c||u;h&&(a=function(t){var e,n,r,a,h=this,d=u&&h.sticky,f=i.call(h),p=h.source,m=0,v=t;return d&&(f=f.replace("y",""),-1===f.indexOf("g")&&(f+="g"),v=String(t).slice(h.lastIndex),h.lastIndex>0&&(!h.multiline||h.multiline&&"\n"!==t[h.lastIndex-1])&&(p="(?: "+p+")",v=" "+v,m++),n=new RegExp("^(?:"+p+")",f)),c&&(n=new RegExp("^"+p+"$(?!\\s)",f)),l&&(e=h.lastIndex),r=o.call(d?n:h,v),d?r?(r.input=r.input.slice(m),r[0]=r[0].slice(m),r.index=h.lastIndex,h.lastIndex+=r[0].length):h.lastIndex=0:l&&r&&(h.lastIndex=h.global?r.index+r[0].length:e),c&&r&&r.length>1&&s.call(r[0],n,(function(){for(a=1;ao&&(c=a.interval=o);var h=a.intervalPrecision=s(c),d=a.niceTickExtent=[r(Math.ceil(t[0]/c)*c,h),r(Math.floor(t[1]/c)*c,h)];return l(d,t),a}function s(t){return i.getPrecisionSafe(t)+2}function a(t,e,n){t[e]=Math.max(Math.min(t[e],n[1]),n[0])}function l(t,e){!isFinite(t[0])&&(t[0]=e[0]),!isFinite(t[1])&&(t[1]=e[1]),a(t,0,e),a(t,1,e),t[0]>t[1]&&(t[0]=t[1])}e.intervalScaleNiceTicks=o,e.getIntervalPrecision=s,e.fixExtent=l},"94ca":function(t,e,n){var i=n("d039"),r=/#|\.prototype\./,o=function(t,e){var n=a[s(t)];return n==u||n!=l&&("function"==typeof e?i(e):!!e)},s=o.normalize=function(t){return String(t).replace(r,".").toLowerCase()},a=o.data={},l=o.NATIVE="N",u=o.POLYFILL="P";t.exports=o},9520:function(t,e,n){var i=n("3729"),r=n("1a8c"),o="[object AsyncFunction]",s="[object Function]",a="[object GeneratorFunction]",l="[object Proxy]";function u(t){if(!r(t))return!1;var e=i(t);return e==s||e==a||e==o||e==l}t.exports=u},9638:function(t,e){function n(t,e){return t===e||t!==t&&e!==e}t.exports=n},9680:function(t,e){function n(t,e,n,i,r,o,s){if(0===r)return!1;var a=r,l=0,u=t;if(s>e+a&&s>i+a||st+a&&o>n+a||o-1}function o(t,e){return r(t)&&t._isRouter&&(null==e||t.type===e)}function s(t,e){for(var n in e)t[n]=e[n];return t}var a={name:"RouterView",functional:!0,props:{name:{type:String,default:"default"}},render:function(t,e){var n=e.props,i=e.children,r=e.parent,o=e.data;o.routerView=!0;var a=r.$createElement,u=n.name,c=r.$route,h=r._routerViewCache||(r._routerViewCache={}),d=0,f=!1;while(r&&r._routerRoot!==r){var p=r.$vnode?r.$vnode.data:{};p.routerView&&d++,p.keepAlive&&r._directInactive&&r._inactive&&(f=!0),r=r.$parent}if(o.routerViewDepth=d,f){var m=h[u],v=m&&m.component;return v?(m.configProps&&l(v,o,m.route,m.configProps),a(v,o,i)):a()}var g=c.matched[d],y=g&&g.components[u];if(!g||!y)return h[u]=null,a();h[u]={component:y},o.registerRouteInstance=function(t,e){var n=g.instances[u];(e&&n!==t||!e&&n===t)&&(g.instances[u]=e)},(o.hook||(o.hook={})).prepatch=function(t,e){g.instances[u]=e.componentInstance},o.hook.init=function(t){t.data.keepAlive&&t.componentInstance&&t.componentInstance!==g.instances[u]&&(g.instances[u]=t.componentInstance)};var b=g.props&&g.props[u];return b&&(s(h[u],{route:c,configProps:b}),l(y,o,c,b)),a(y,o,i)}};function l(t,e,n,i){var r=e.props=u(n,i);if(r){r=e.props=s({},r);var o=e.attrs=e.attrs||{};for(var a in r)t.props&&a in t.props||(o[a]=r[a],delete r[a])}}function u(t,e){switch(typeof e){case"undefined":return;case"object":return e;case"function":return e(t);case"boolean":return e?t.params:void 0;default:0}}var c=/[!'()*]/g,h=function(t){return"%"+t.charCodeAt(0).toString(16)},d=/%2C/g,f=function(t){return encodeURIComponent(t).replace(c,h).replace(d,",")},p=decodeURIComponent;function m(t,e,n){void 0===e&&(e={});var i,r=n||v;try{i=r(t||"")}catch(s){i={}}for(var o in e)i[o]=e[o];return i}function v(t){var e={};return t=t.trim().replace(/^(\?|#|&)/,""),t?(t.split("&").forEach((function(t){var n=t.replace(/\+/g," ").split("="),i=p(n.shift()),r=n.length>0?p(n.join("=")):null;void 0===e[i]?e[i]=r:Array.isArray(e[i])?e[i].push(r):e[i]=[e[i],r]})),e):e}function g(t){var e=t?Object.keys(t).map((function(e){var n=t[e];if(void 0===n)return"";if(null===n)return f(e);if(Array.isArray(n)){var i=[];return n.forEach((function(t){void 0!==t&&(null===t?i.push(f(e)):i.push(f(e)+"="+f(t)))})),i.join("&")}return f(e)+"="+f(n)})).filter((function(t){return t.length>0})).join("&"):null;return e?"?"+e:""}var y=/\/?$/;function b(t,e,n,i){var r=i&&i.options.stringifyQuery,o=e.query||{};try{o=x(o)}catch(a){}var s={name:e.name||t&&t.name,meta:t&&t.meta||{},path:e.path||"/",hash:e.hash||"",query:o,params:e.params||{},fullPath:S(e,r),matched:t?w(t):[]};return n&&(s.redirectedFrom=S(n,r)),Object.freeze(s)}function x(t){if(Array.isArray(t))return t.map(x);if(t&&"object"===typeof t){var e={};for(var n in t)e[n]=x(t[n]);return e}return t}var _=b(null,{path:"/"});function w(t){var e=[];while(t)e.unshift(t),t=t.parent;return e}function S(t,e){var n=t.path,i=t.query;void 0===i&&(i={});var r=t.hash;void 0===r&&(r="");var o=e||g;return(n||"/")+o(i)+r}function C(t,e){return e===_?t===e:!!e&&(t.path&&e.path?t.path.replace(y,"")===e.path.replace(y,"")&&t.hash===e.hash&&E(t.query,e.query):!(!t.name||!e.name)&&(t.name===e.name&&t.hash===e.hash&&E(t.query,e.query)&&E(t.params,e.params)))}function E(t,e){if(void 0===t&&(t={}),void 0===e&&(e={}),!t||!e)return t===e;var n=Object.keys(t),i=Object.keys(e);return n.length===i.length&&n.every((function(n){var i=t[n],r=e[n];return"object"===typeof i&&"object"===typeof r?E(i,r):String(i)===String(r)}))}function T(t,e){return 0===t.path.replace(y,"/").indexOf(e.path.replace(y,"/"))&&(!e.hash||t.hash===e.hash)&&k(t.query,e.query)}function k(t,e){for(var n in e)if(!(n in t))return!1;return!0}function A(t,e,n){var i=t.charAt(0);if("/"===i)return t;if("?"===i||"#"===i)return e+t;var r=e.split("/");n&&r[r.length-1]||r.pop();for(var o=t.replace(/^\//,"").split("/"),s=0;s=0&&(e=t.slice(i),t=t.slice(0,i));var r=t.indexOf("?");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{path:t,query:n,hash:e}}function O(t){return t.replace(/\/\//g,"/")}var I=Array.isArray||function(t){return"[object Array]"==Object.prototype.toString.call(t)},M=K,j=R,P=L,N=z,V=J,F=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function R(t,e){var n,i=[],r=0,o=0,s="",a=e&&e.delimiter||"/";while(null!=(n=F.exec(t))){var l=n[0],u=n[1],c=n.index;if(s+=t.slice(o,c),o=c+l.length,u)s+=u[1];else{var h=t[o],d=n[2],f=n[3],p=n[4],m=n[5],v=n[6],g=n[7];s&&(i.push(s),s="");var y=null!=d&&null!=h&&h!==d,b="+"===v||"*"===v,x="?"===v||"*"===v,_=n[2]||a,w=p||m;i.push({name:f||r++,prefix:d||"",delimiter:_,optional:x,repeat:b,partial:y,asterisk:!!g,pattern:w?U(w):g?".*":"[^"+H(_)+"]+?"})}}return o1||!w.length)return 0===w.length?t():t("span",{},w)}if("a"===this.tag)_.on=x,_.attrs={href:l,"aria-current":g};else{var S=at(this.$slots.default);if(S){S.isStatic=!1;var E=S.data=s({},S.data);for(var k in E.on=E.on||{},E.on){var A=E.on[k];k in x&&(E.on[k]=Array.isArray(A)?A:[A])}for(var D in x)D in E.on?E.on[D].push(x[D]):E.on[D]=y;var O=S.data.attrs=s({},S.data.attrs);O.href=l,O["aria-current"]=g}else _.on=x}return t(this.tag,_,this.$slots.default)}};function st(t){if(!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)&&!t.defaultPrevented&&(void 0===t.button||0===t.button)){if(t.currentTarget&&t.currentTarget.getAttribute){var e=t.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return t.preventDefault&&t.preventDefault(),!0}}function at(t){if(t)for(var e,n=0;n-1&&(a.params[d]=n.params[d]);return a.path=Q(u.path,a.params,'named route "'+l+'"'),c(u,a,s)}if(a.path){a.params={};for(var f=0;f=t.length?n():t[r]?e(t[r],(function(){i(r+1)})):i(r+1)};i(0)}function Lt(t){return function(e,n,i){var o=!1,s=0,a=null;Bt(t,(function(t,e,n,l){if("function"===typeof t&&void 0===t.cid){o=!0,s++;var u,c=Ut((function(e){Ht(e)&&(e=e.default),t.resolved="function"===typeof e?e:et.extend(e),n.components[l]=e,s--,s<=0&&i()})),h=Ut((function(t){var e="Failed to resolve async bootstrap "+l+": "+t;a||(a=r(t)?t:new Error(e),i(a))}));try{u=t(c,h)}catch(f){h(f)}if(u)if("function"===typeof u.then)u.then(c,h);else{var d=u.component;d&&"function"===typeof d.then&&d.then(c,h)}}})),o||i()}}function Bt(t,e){return $t(t.map((function(t){return Object.keys(t.components).map((function(n){return e(t.components[n],t.instances[n],t,n)}))})))}function $t(t){return Array.prototype.concat.apply([],t)}var zt="function"===typeof Symbol&&"symbol"===typeof Symbol.toStringTag;function Ht(t){return t.__esModule||zt&&"Module"===t[Symbol.toStringTag]}function Ut(t){var e=!1;return function(){var n=[],i=arguments.length;while(i--)n[i]=arguments[i];if(!e)return e=!0,t.apply(this,n)}}var Wt={redirected:1,aborted:2,cancelled:3,duplicated:4};function qt(t,e){return Jt(t,e,Wt.redirected,'Redirected when going from "'+t.fullPath+'" to "'+Zt(e)+'" via a navigation guard.')}function Gt(t,e){return Jt(t,e,Wt.duplicated,'Avoided redundant navigation to current location: "'+t.fullPath+'".')}function Yt(t,e){return Jt(t,e,Wt.cancelled,'Navigation cancelled from "'+t.fullPath+'" to "'+e.fullPath+'" with a new navigation.')}function Xt(t,e){return Jt(t,e,Wt.aborted,'Navigation aborted from "'+t.fullPath+'" to "'+e.fullPath+'" via a navigation guard.')}function Jt(t,e,n,i){var r=new Error(i);return r._isRouter=!0,r.from=t,r.to=e,r.type=n,r}var Kt=["params","query","hash"];function Zt(t){if("string"===typeof t)return t;if("path"in t)return t.path;var e={};return Kt.forEach((function(n){n in t&&(e[n]=t[n])})),JSON.stringify(e,null,2)}var Qt=function(t,e){this.router=t,this.base=te(e),this.current=_,this.pending=null,this.ready=!1,this.readyCbs=[],this.readyErrorCbs=[],this.errorCbs=[],this.listeners=[]};function te(t){if(!t)if(ut){var e=document.querySelector("base");t=e&&e.getAttribute("href")||"/",t=t.replace(/^https?:\/\/[^\/]+/,"")}else t="/";return"/"!==t.charAt(0)&&(t="/"+t),t.replace(/\/$/,"")}function ee(t,e){var n,i=Math.max(t.length,e.length);for(n=0;n0)){var e=this.router,n=e.options.scrollBehavior,i=Nt&&n;i&&this.listeners.push(St());var r=function(){var n=t.current,r=he(t.base);t.current===_&&r===t._startLocation||t.transitionTo(r,(function(t){i&&Ct(e,t,n,!0)}))};window.addEventListener("popstate",r),this.listeners.push((function(){window.removeEventListener("popstate",r)}))}},e.prototype.go=function(t){window.history.go(t)},e.prototype.push=function(t,e,n){var i=this,r=this,o=r.current;this.transitionTo(t,(function(t){Vt(O(i.base+t.fullPath)),Ct(i.router,t,o,!1),e&&e(t)}),n)},e.prototype.replace=function(t,e,n){var i=this,r=this,o=r.current;this.transitionTo(t,(function(t){Ft(O(i.base+t.fullPath)),Ct(i.router,t,o,!1),e&&e(t)}),n)},e.prototype.ensureURL=function(t){if(he(this.base)!==this.current.fullPath){var e=O(this.base+this.current.fullPath);t?Vt(e):Ft(e)}},e.prototype.getCurrentLocation=function(){return he(this.base)},e}(Qt);function he(t){var e=decodeURI(window.location.pathname);return t&&0===e.toLowerCase().indexOf(t.toLowerCase())&&(e=e.slice(t.length)),(e||"/")+window.location.search+window.location.hash}var de=function(t){function e(e,n,i){t.call(this,e,n),i&&fe(this.base)||pe()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setupListeners=function(){var t=this;if(!(this.listeners.length>0)){var e=this.router,n=e.options.scrollBehavior,i=Nt&&n;i&&this.listeners.push(St());var r=function(){var e=t.current;pe()&&t.transitionTo(me(),(function(n){i&&Ct(t.router,n,e,!0),Nt||ye(n.fullPath)}))},o=Nt?"popstate":"hashchange";window.addEventListener(o,r),this.listeners.push((function(){window.removeEventListener(o,r)}))}},e.prototype.push=function(t,e,n){var i=this,r=this,o=r.current;this.transitionTo(t,(function(t){ge(t.fullPath),Ct(i.router,t,o,!1),e&&e(t)}),n)},e.prototype.replace=function(t,e,n){var i=this,r=this,o=r.current;this.transitionTo(t,(function(t){ye(t.fullPath),Ct(i.router,t,o,!1),e&&e(t)}),n)},e.prototype.go=function(t){window.history.go(t)},e.prototype.ensureURL=function(t){var e=this.current.fullPath;me()!==e&&(t?ge(e):ye(e))},e.prototype.getCurrentLocation=function(){return me()},e}(Qt);function fe(t){var e=he(t);if(!/^\/#/.test(e))return window.location.replace(O(t+"/#"+e)),!0}function pe(){var t=me();return"/"===t.charAt(0)||(ye("/"+t),!1)}function me(){var t=window.location.href,e=t.indexOf("#");if(e<0)return"";t=t.slice(e+1);var n=t.indexOf("?");if(n<0){var i=t.indexOf("#");t=i>-1?decodeURI(t.slice(0,i))+t.slice(i):decodeURI(t)}else t=decodeURI(t.slice(0,n))+t.slice(n);return t}function ve(t){var e=window.location.href,n=e.indexOf("#"),i=n>=0?e.slice(0,n):e;return i+"#"+t}function ge(t){Nt?Vt(ve(t)):window.location.hash=t}function ye(t){Nt?Ft(ve(t)):window.location.replace(ve(t))}var be=function(t){function e(e,n){t.call(this,e,n),this.stack=[],this.index=-1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.push=function(t,e,n){var i=this;this.transitionTo(t,(function(t){i.stack=i.stack.slice(0,i.index+1).concat(t),i.index++,e&&e(t)}),n)},e.prototype.replace=function(t,e,n){var i=this;this.transitionTo(t,(function(t){i.stack=i.stack.slice(0,i.index).concat(t),e&&e(t)}),n)},e.prototype.go=function(t){var e=this,n=this.index+t;if(!(n<0||n>=this.stack.length)){var i=this.stack[n];this.confirmTransition(i,(function(){e.index=n,e.updateRoute(i)}),(function(t){o(t,Wt.duplicated)&&(e.index=n)}))}},e.prototype.getCurrentLocation=function(){var t=this.stack[this.stack.length-1];return t?t.fullPath:"/"},e.prototype.ensureURL=function(){},e}(Qt),xe=function(t){void 0===t&&(t={}),this.app=null,this.apps=[],this.options=t,this.beforeHooks=[],this.resolveHooks=[],this.afterHooks=[],this.matcher=pt(t.routes||[],this);var e=t.mode||"hash";switch(this.fallback="history"===e&&!Nt&&!1!==t.fallback,this.fallback&&(e="hash"),ut||(e="abstract"),this.mode=e,e){case"history":this.history=new ce(this,t.base);break;case"hash":this.history=new de(this,t.base,this.fallback);break;case"abstract":this.history=new be(this,t.base);break;default:0}},_e={currentRoute:{configurable:!0}};function we(t,e){return t.push(e),function(){var n=t.indexOf(e);n>-1&&t.splice(n,1)}}function Se(t,e,n){var i="hash"===n?"#"+e:e;return t?O(t+"/"+i):i}xe.prototype.match=function(t,e,n){return this.matcher.match(t,e,n)},_e.currentRoute.get=function(){return this.history&&this.history.current},xe.prototype.init=function(t){var e=this;if(this.apps.push(t),t.$once("hook:destroyed",(function(){var n=e.apps.indexOf(t);n>-1&&e.apps.splice(n,1),e.app===t&&(e.app=e.apps[0]||null),e.app||e.history.teardownListeners()})),!this.app){this.app=t;var n=this.history;if(n instanceof ce||n instanceof de){var i=function(){n.setupListeners()};n.transitionTo(n.getCurrentLocation(),i,i)}n.listen((function(t){e.apps.forEach((function(e){e._route=t}))}))}},xe.prototype.beforeEach=function(t){return we(this.beforeHooks,t)},xe.prototype.beforeResolve=function(t){return we(this.resolveHooks,t)},xe.prototype.afterEach=function(t){return we(this.afterHooks,t)},xe.prototype.onReady=function(t,e){this.history.onReady(t,e)},xe.prototype.onError=function(t){this.history.onError(t)},xe.prototype.push=function(t,e,n){var i=this;if(!e&&!n&&"undefined"!==typeof Promise)return new Promise((function(e,n){i.history.push(t,e,n)}));this.history.push(t,e,n)},xe.prototype.replace=function(t,e,n){var i=this;if(!e&&!n&&"undefined"!==typeof Promise)return new Promise((function(e,n){i.history.replace(t,e,n)}));this.history.replace(t,e,n)},xe.prototype.go=function(t){this.history.go(t)},xe.prototype.back=function(){this.go(-1)},xe.prototype.forward=function(){this.go(1)},xe.prototype.getMatchedComponents=function(t){var e=t?t.matched?t:this.resolve(t).route:this.currentRoute;return e?[].concat.apply([],e.matched.map((function(t){return Object.keys(t.components).map((function(e){return t.components[e]}))}))):[]},xe.prototype.resolve=function(t,e,n){e=e||this.history.current;var i=tt(t,e,n,this),r=this.match(i,e),o=r.redirectedFrom||r.fullPath,s=this.history.base,a=Se(s,o,this.mode);return{location:i,route:r,href:a,normalizedTo:i,resolved:r}},xe.prototype.addRoutes=function(t){this.matcher.addRoutes(t),this.history.current!==_&&this.history.transitionTo(this.history.getCurrentLocation())},Object.defineProperties(xe.prototype,_e),xe.install=lt,xe.version="3.3.4",ut&&window.Vue&&window.Vue.use(xe),e["a"]=xe},"8ced":function(t,e,n){"use strict";var i;try{i=n("b639").Buffer}catch(c){}var r=n("872a"),o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";function s(t){if(null===t)return!1;var e,n,i=0,r=t.length,s=o;for(n=0;n64)){if(e<0)return!1;i+=6}return i%8===0}function a(t){var e,n,r=t.replace(/[\r\n=]/g,""),s=r.length,a=o,l=0,u=[];for(e=0;e>16&255),u.push(l>>8&255),u.push(255&l)),l=l<<6|a.indexOf(r.charAt(e));return n=s%4*6,0===n?(u.push(l>>16&255),u.push(l>>8&255),u.push(255&l)):18===n?(u.push(l>>10&255),u.push(l>>2&255)):12===n&&u.push(l>>4&255),i?i.from?i.from(u):new i(u):u}function l(t){var e,n,i="",r=0,s=t.length,a=o;for(e=0;e>18&63],i+=a[r>>12&63],i+=a[r>>6&63],i+=a[63&r]),r=(r<<8)+t[e];return n=s%3,0===n?(i+=a[r>>18&63],i+=a[r>>12&63],i+=a[r>>6&63],i+=a[63&r]):2===n?(i+=a[r>>10&63],i+=a[r>>4&63],i+=a[r<<2&63],i+=a[64]):1===n&&(i+=a[r>>2&63],i+=a[r<<4&63],i+=a[64],i+=a[64]),i}function u(t){return i&&i.isBuffer(t)}t.exports=new r("tag:yaml.org,2002:binary",{kind:"scalar",resolve:s,construct:a,predicate:u,represent:l})},"8d32":function(t,e,n){var i=n("cbe5"),r=i.extend({type:"arc",shape:{cx:0,cy:0,r:0,startAngle:0,endAngle:2*Math.PI,clockwise:!0},style:{stroke:"#000",fill:null},buildPath:function(t,e){var n=e.cx,i=e.cy,r=Math.max(e.r,0),o=e.startAngle,s=e.endAngle,a=e.clockwise,l=Math.cos(o),u=Math.sin(o);t.moveTo(l*r+n,u*r+i),t.arc(n,i,r,o,s,!a)}});t.exports=r},"8df4":function(t,e,n){"use strict";var i=n("7a77");function r(t){if("function"!==typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var n=this;t((function(t){n.reason||(n.reason=new i(t),e(n.reason))}))}r.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},r.source=function(){var t,e=new r((function(e){t=e}));return{token:e,cancel:t}},t.exports=r},"8e43":function(t,e,n){var i=n("6d8b"),r=i.createHashMap,o=i.isObject,s=i.map;function a(t){this.categories=t.categories||[],this._needCollect=t.needCollect,this._deduplication=t.deduplication,this._map}a.createByAxisModel=function(t){var e=t.option,n=e.data,i=n&&s(n,c);return new a({categories:i,needCollect:!i,deduplication:!1!==e.dedplication})};var l=a.prototype;function u(t){return t._map||(t._map=r(t.categories))}function c(t){return o(t)&&null!=t.value?t.value:t+""}l.getOrdinal=function(t){return u(this).get(t)},l.parseAndCollect=function(t){var e,n=this._needCollect;if("string"!==typeof t&&!n)return t;if(n&&!this._deduplication)return e=this.categories.length,this.categories[e]=t,e;var i=u(this);return e=i.get(t),null==e&&(n?(e=this.categories.length,this.categories[e]=t,i.set(t,e)):e=NaN),e};var h=a;t.exports=h},"8ed2":function(t,e,n){n("48c7");var i=n("6cb7"),r=i.extend({type:"grid",dependencies:["xAxis","yAxis"],layoutMode:"box",coordinateSystem:null,defaultOption:{show:!1,zlevel:0,z:0,left:"10%",top:60,right:"10%",bottom:60,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"}});t.exports=r},"90e3":function(t,e){var n=0,i=Math.random();t.exports=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++n+i).toString(36)}},9112:function(t,e,n){var i=n("83ab"),r=n("9bf2"),o=n("5c6c");t.exports=i?function(t,e,n){return r.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},9152:function(t,e){e.read=function(t,e,n,i,r){var o,s,a=8*r-i-1,l=(1<>1,c=-7,h=n?r-1:0,d=n?-1:1,f=t[e+h];for(h+=d,o=f&(1<<-c)-1,f>>=-c,c+=a;c>0;o=256*o+t[e+h],h+=d,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=i;c>0;s=256*s+t[e+h],h+=d,c-=8);if(0===o)o=1-u;else{if(o===l)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,i),o-=u}return(f?-1:1)*s*Math.pow(2,o-i)},e.write=function(t,e,n,i,r,o){var s,a,l,u=8*o-r-1,c=(1<>1,d=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,f=i?0:o-1,p=i?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=c):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),e+=s+h>=1?d/l:d*Math.pow(2,1-h),e*l>=2&&(s++,l/=2),s+h>=c?(a=0,s=c):s+h>=1?(a=(e*l-1)*Math.pow(2,r),s+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,r),s=0));r>=8;t[n+f]=255&a,f+=p,a/=256,r-=8);for(s=s<0;t[n+f]=255&s,f+=p,s/=256,u-=8);t[n+f-p]|=128*m}},9263:function(t,e,n){"use strict";var i=n("ad6d"),r=n("9f7f"),o=RegExp.prototype.exec,s=String.prototype.replace,a=o,l=function(){var t=/a/,e=/b*/g;return o.call(t,"a"),o.call(e,"a"),0!==t.lastIndex||0!==e.lastIndex}(),u=r.UNSUPPORTED_Y||r.BROKEN_CARET,c=void 0!==/()??/.exec("")[1],h=l||c||u;h&&(a=function(t){var e,n,r,a,h=this,d=u&&h.sticky,f=i.call(h),p=h.source,m=0,v=t;return d&&(f=f.replace("y",""),-1===f.indexOf("g")&&(f+="g"),v=String(t).slice(h.lastIndex),h.lastIndex>0&&(!h.multiline||h.multiline&&"\n"!==t[h.lastIndex-1])&&(p="(?: "+p+")",v=" "+v,m++),n=new RegExp("^(?:"+p+")",f)),c&&(n=new RegExp("^"+p+"$(?!\\s)",f)),l&&(e=h.lastIndex),r=o.call(d?n:h,v),d?r?(r.input=r.input.slice(m),r[0]=r[0].slice(m),r.index=h.lastIndex,h.lastIndex+=r[0].length):h.lastIndex=0:l&&r&&(h.lastIndex=h.global?r.index+r[0].length:e),c&&r&&r.length>1&&s.call(r[0],n,(function(){for(a=1;ao&&(c=a.interval=o);var h=a.intervalPrecision=s(c),d=a.niceTickExtent=[r(Math.ceil(t[0]/c)*c,h),r(Math.floor(t[1]/c)*c,h)];return l(d,t),a}function s(t){return i.getPrecisionSafe(t)+2}function a(t,e,n){t[e]=Math.max(Math.min(t[e],n[1]),n[0])}function l(t,e){!isFinite(t[0])&&(t[0]=e[0]),!isFinite(t[1])&&(t[1]=e[1]),a(t,0,e),a(t,1,e),t[0]>t[1]&&(t[0]=t[1])}e.intervalScaleNiceTicks=o,e.getIntervalPrecision=s,e.fixExtent=l},"94ca":function(t,e,n){var i=n("d039"),r=/#|\.prototype\./,o=function(t,e){var n=a[s(t)];return n==u||n!=l&&("function"==typeof e?i(e):!!e)},s=o.normalize=function(t){return String(t).replace(r,".").toLowerCase()},a=o.data={},l=o.NATIVE="N",u=o.POLYFILL="P";t.exports=o},9520:function(t,e,n){var i=n("3729"),r=n("1a8c"),o="[object AsyncFunction]",s="[object Function]",a="[object GeneratorFunction]",l="[object Proxy]";function u(t){if(!r(t))return!1;var e=i(t);return e==s||e==a||e==o||e==l}t.exports=u},9638:function(t,e){function n(t,e){return t===e||t!==t&&e!==e}t.exports=n},9680:function(t,e){function n(t,e,n,i,r,o,s){if(0===r)return!1;var a=r,l=0,u=t;if(s>e+a&&s>i+a||st+a&&o>n+a||o=2)t.mixin({beforeCreat * vue-i18n v8.18.2 * (c) 2020 kazuya kawaguchi * Released under the MIT License. - */var i=["style","currency","currencyDisplay","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","localeMatcher","formatMatcher","unit"];function r(t,e){"undefined"!==typeof console&&(console.warn("[vue-i18n] "+t),e&&console.warn(e.stack))}function o(t,e){"undefined"!==typeof console&&(console.error("[vue-i18n] "+t),e&&console.error(e.stack))}var s=Array.isArray;function a(t){return null!==t&&"object"===typeof t}function l(t){return"boolean"===typeof t}function u(t){return"string"===typeof t}var c=Object.prototype.toString,h="[object Object]";function d(t){return c.call(t)===h}function f(t){return null===t||void 0===t}function p(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var n=null,i=null;return 1===t.length?a(t[0])||Array.isArray(t[0])?i=t[0]:"string"===typeof t[0]&&(n=t[0]):2===t.length&&("string"===typeof t[0]&&(n=t[0]),(a(t[1])||Array.isArray(t[1]))&&(i=t[1])),{locale:n,params:i}}function m(t){return JSON.parse(JSON.stringify(t))}function v(t,e){if(t.length){var n=t.indexOf(e);if(n>-1)return t.splice(n,1)}}function g(t,e){return!!~t.indexOf(e)}var y=Object.prototype.hasOwnProperty;function b(t,e){return y.call(t,e)}function x(t){for(var e=arguments,n=Object(t),i=1;i0)e[n]=arguments[n+1];var i=this.$i18n;return i._t.apply(i,[t,i.locale,i._getMessages(),this].concat(e))},t.prototype.$tc=function(t,e){var n=[],i=arguments.length-2;while(i-- >0)n[i]=arguments[i+2];var r=this.$i18n;return r._tc.apply(r,[t,r.locale,r._getMessages(),this,e].concat(n))},t.prototype.$te=function(t,e){var n=this.$i18n;return n._te(t,n.locale,n._getMessages(),e)},t.prototype.$d=function(t){var e,n=[],i=arguments.length-1;while(i-- >0)n[i]=arguments[i+1];return(e=this.$i18n).d.apply(e,[t].concat(n))},t.prototype.$n=function(t){var e,n=[],i=arguments.length-1;while(i-- >0)n[i]=arguments[i+1];return(e=this.$i18n).n.apply(e,[t].concat(n))}}var S={beforeCreate:function(){var t=this.$options;if(t.i18n=t.i18n||(t.__i18n?{}:null),t.i18n)if(t.i18n instanceof _t){if(t.__i18n)try{var e={};t.__i18n.forEach((function(t){e=x(e,JSON.parse(t))})),Object.keys(e).forEach((function(n){t.i18n.mergeLocaleMessage(n,e[n])}))}catch(s){0}this._i18n=t.i18n,this._i18nWatcher=this._i18n.watchI18nData()}else if(d(t.i18n)){var n=this.$root&&this.$root.$i18n&&this.$root.$i18n instanceof _t?this.$root.$i18n:null;if(n&&(t.i18n.root=this.$root,t.i18n.formatter=n.formatter,t.i18n.fallbackLocale=n.fallbackLocale,t.i18n.formatFallbackMessages=n.formatFallbackMessages,t.i18n.silentTranslationWarn=n.silentTranslationWarn,t.i18n.silentFallbackWarn=n.silentFallbackWarn,t.i18n.pluralizationRules=n.pluralizationRules,t.i18n.preserveDirectiveContent=n.preserveDirectiveContent),t.__i18n)try{var i={};t.__i18n.forEach((function(t){i=x(i,JSON.parse(t))})),t.i18n.messages=i}catch(s){0}var r=t.i18n,o=r.sharedMessages;o&&d(o)&&(t.i18n.messages=x(t.i18n.messages,o)),this._i18n=new _t(t.i18n),this._i18nWatcher=this._i18n.watchI18nData(),(void 0===t.i18n.sync||t.i18n.sync)&&(this._localeWatcher=this.$i18n.watchLocale()),n&&n.onComponentInstanceCreated(this._i18n)}else 0;else this.$root&&this.$root.$i18n&&this.$root.$i18n instanceof _t?this._i18n=this.$root.$i18n:t.parent&&t.parent.$i18n&&t.parent.$i18n instanceof _t&&(this._i18n=t.parent.$i18n)},beforeMount:function(){var t=this.$options;t.i18n=t.i18n||(t.__i18n?{}:null),t.i18n?(t.i18n instanceof _t||d(t.i18n))&&(this._i18n.subscribeDataChanging(this),this._subscribing=!0):(this.$root&&this.$root.$i18n&&this.$root.$i18n instanceof _t||t.parent&&t.parent.$i18n&&t.parent.$i18n instanceof _t)&&(this._i18n.subscribeDataChanging(this),this._subscribing=!0)},beforeDestroy:function(){if(this._i18n){var t=this;this.$nextTick((function(){t._subscribing&&(t._i18n.unsubscribeDataChanging(t),delete t._subscribing),t._i18nWatcher&&(t._i18nWatcher(),t._i18n.destroyVM(),delete t._i18nWatcher),t._localeWatcher&&(t._localeWatcher(),delete t._localeWatcher)}))}}},C={name:"i18n",functional:!0,props:{tag:{type:[String,Boolean],default:"span"},path:{type:String,required:!0},locale:{type:String},places:{type:[Array,Object]}},render:function(t,e){var n=e.data,i=e.parent,r=e.props,o=e.slots,s=i.$i18n;if(s){var a=r.path,l=r.locale,u=r.places,c=o(),h=s.i(a,l,E(c)||u?T(c.default,u):c),d=r.tag&&!0!==r.tag||!1===r.tag?r.tag:"span";return d?t(d,n,h):h}}};function E(t){var e;for(e in t)if("default"!==e)return!1;return Boolean(e)}function T(t,e){var n=e?k(e):{};if(!t)return n;t=t.filter((function(t){return t.tag||""!==t.text.trim()}));var i=t.every(O);return t.reduce(i?A:D,n)}function k(t){return Array.isArray(t)?t.reduce(D,{}):Object.assign({},t)}function A(t,e){return e.data&&e.data.attrs&&e.data.attrs.place&&(t[e.data.attrs.place]=e),t}function D(t,e,n){return t[n]=e,t}function O(t){return Boolean(t.data&&t.data.attrs&&t.data.attrs.place)}var I,M={name:"i18n-n",functional:!0,props:{tag:{type:[String,Boolean],default:"span"},value:{type:Number,required:!0},format:{type:[String,Object]},locale:{type:String}},render:function(t,e){var n=e.props,r=e.parent,o=e.data,s=r.$i18n;if(!s)return null;var l=null,c=null;u(n.format)?l=n.format:a(n.format)&&(n.format.key&&(l=n.format.key),c=Object.keys(n.format).reduce((function(t,e){var r;return g(i,e)?Object.assign({},t,(r={},r[e]=n.format[e],r)):t}),null));var h=n.locale||s.locale,d=s._ntp(n.value,h,l,c),f=d.map((function(t,e){var n,i=o.scopedSlots&&o.scopedSlots[t.type];return i?i((n={},n[t.type]=t.value,n.index=e,n.parts=d,n)):t.value})),p=n.tag&&!0!==n.tag||!1===n.tag?n.tag:"span";return p?t(p,{attrs:o.attrs,class:o["class"],staticClass:o.staticClass},f):f}};function j(t,e,n){V(t,n)&&R(t,e,n)}function P(t,e,n,i){if(V(t,n)){var r=n.context.$i18n;F(t,n)&&_(e.value,e.oldValue)&&_(t._localeMessage,r.getLocaleMessage(r.locale))||R(t,e,n)}}function N(t,e,n,i){var o=n.context;if(o){var s=n.context.$i18n||{};e.modifiers.preserve||s.preserveDirectiveContent||(t.textContent=""),t._vt=void 0,delete t["_vt"],t._locale=void 0,delete t["_locale"],t._localeMessage=void 0,delete t["_localeMessage"]}else r("Vue instance does not exists in VNode context")}function V(t,e){var n=e.context;return n?!!n.$i18n||(r("VueI18n instance does not exists in Vue instance"),!1):(r("Vue instance does not exists in VNode context"),!1)}function F(t,e){var n=e.context;return t._locale===n.$i18n.locale}function R(t,e,n){var i,o,s=e.value,a=L(s),l=a.path,u=a.locale,c=a.args,h=a.choice;if(l||u||c)if(l){var d=n.context;t._vt=t.textContent=null!=h?(i=d.$i18n).tc.apply(i,[l,h].concat(B(u,c))):(o=d.$i18n).t.apply(o,[l].concat(B(u,c))),t._locale=d.$i18n.locale,t._localeMessage=d.$i18n.getLocaleMessage(d.$i18n.locale)}else r("`path` is required in v-t directive");else r("value type not supported")}function L(t){var e,n,i,r;return u(t)?e=t:d(t)&&(e=t.path,n=t.locale,i=t.args,r=t.choice),{path:e,locale:n,args:i,choice:r}}function B(t,e){var n=[];return t&&n.push(t),e&&(Array.isArray(e)||d(e))&&n.push(e),n}function $(t){$.installed=!0,I=t;I.version&&Number(I.version.split(".")[0]);w(I),I.mixin(S),I.directive("t",{bind:j,update:P,unbind:N}),I.component(C.name,C),I.component(M.name,M);var e=I.config.optionMergeStrategies;e.i18n=function(t,e){return void 0===e?t:e}}var z=function(){this._caches=Object.create(null)};z.prototype.interpolate=function(t,e){if(!e)return[t];var n=this._caches[t];return n||(n=W(t),this._caches[t]=n),q(n,e)};var H=/^(?:\d)+/,U=/^(?:\w)+/;function W(t){var e=[],n=0,i="";while(n0)h--,c=et,d[G]();else{if(h=0,void 0===n)return!1;if(n=ht(n),!1===n)return!1;d[Y]()}};while(null!==c)if(u++,e=t[u],"\\"!==e||!f()){if(r=ct(e),a=st[c],o=a[r]||a["else"]||ot,o===ot)return;if(c=o[0],s=d[o[1]],s&&(i=o[2],i=void 0===i?e:i,!1===s()))return;if(c===rt)return l}}var ft=function(){this._cache=Object.create(null)};ft.prototype.parsePath=function(t){var e=this._cache[t];return e||(e=dt(t),e&&(this._cache[t]=e)),e||[]},ft.prototype.getPathValue=function(t,e){if(!a(t))return null;var n=this.parsePath(e);if(0===n.length)return null;var i=n.length,r=t,o=0;while(o/,vt=/(?:@(?:\.[a-z]+)?:(?:[\w\-_|.]+|\([\w\-_|.]+\)))/g,gt=/^@(?:\.([a-z]+))?:/,yt=/[()]/g,bt={upper:function(t){return t.toLocaleUpperCase()},lower:function(t){return t.toLocaleLowerCase()},capitalize:function(t){return""+t.charAt(0).toLocaleUpperCase()+t.substr(1)}},xt=new z,_t=function(t){var e=this;void 0===t&&(t={}),!I&&"undefined"!==typeof window&&window.Vue&&$(window.Vue);var n=t.locale||"en-US",i=!1!==t.fallbackLocale&&(t.fallbackLocale||"en-US"),r=t.messages||{},o=t.dateTimeFormats||{},s=t.numberFormats||{};this._vm=null,this._formatter=t.formatter||xt,this._modifiers=t.modifiers||{},this._missing=t.missing||null,this._root=t.root||null,this._sync=void 0===t.sync||!!t.sync,this._fallbackRoot=void 0===t.fallbackRoot||!!t.fallbackRoot,this._formatFallbackMessages=void 0!==t.formatFallbackMessages&&!!t.formatFallbackMessages,this._silentTranslationWarn=void 0!==t.silentTranslationWarn&&t.silentTranslationWarn,this._silentFallbackWarn=void 0!==t.silentFallbackWarn&&!!t.silentFallbackWarn,this._dateTimeFormatters={},this._numberFormatters={},this._path=new ft,this._dataListeners=[],this._componentInstanceCreatedListener=t.componentInstanceCreatedListener||null,this._preserveDirectiveContent=void 0!==t.preserveDirectiveContent&&!!t.preserveDirectiveContent,this.pluralizationRules=t.pluralizationRules||{},this._warnHtmlInMessage=t.warnHtmlInMessage||"off",this._postTranslation=t.postTranslation||null,this.getChoiceIndex=function(t,n){var i=Object.getPrototypeOf(e);if(i&&i.getChoiceIndex){var r=i.getChoiceIndex;return r.call(e,t,n)}var o=function(t,e){return t=Math.abs(t),2===e?t?t>1?1:0:1:t?Math.min(t,2):0};return e.locale in e.pluralizationRules?e.pluralizationRules[e.locale].apply(e,[t,n]):o(t,n)},this._exist=function(t,n){return!(!t||!n)&&(!f(e._path.getPathValue(t,n))||!!t[n])},"warn"!==this._warnHtmlInMessage&&"error"!==this._warnHtmlInMessage||Object.keys(r).forEach((function(t){e._checkLocaleMessage(t,e._warnHtmlInMessage,r[t])})),this._initVM({locale:n,fallbackLocale:i,messages:r,dateTimeFormats:o,numberFormats:s})},wt={vm:{configurable:!0},messages:{configurable:!0},dateTimeFormats:{configurable:!0},numberFormats:{configurable:!0},availableLocales:{configurable:!0},locale:{configurable:!0},fallbackLocale:{configurable:!0},formatFallbackMessages:{configurable:!0},missing:{configurable:!0},formatter:{configurable:!0},silentTranslationWarn:{configurable:!0},silentFallbackWarn:{configurable:!0},preserveDirectiveContent:{configurable:!0},warnHtmlInMessage:{configurable:!0},postTranslation:{configurable:!0}};_t.prototype._checkLocaleMessage=function(t,e,n){var i=[],s=function(t,e,n,i){if(d(n))Object.keys(n).forEach((function(r){var o=n[r];d(o)?(i.push(r),i.push("."),s(t,e,o,i),i.pop(),i.pop()):(i.push(r),s(t,e,o,i),i.pop())}));else if(Array.isArray(n))n.forEach((function(n,r){d(n)?(i.push("["+r+"]"),i.push("."),s(t,e,n,i),i.pop(),i.pop()):(i.push("["+r+"]"),s(t,e,n,i),i.pop())}));else if(u(n)){var a=mt.test(n);if(a){var l="Detected HTML in message '"+n+"' of keypath '"+i.join("")+"' at '"+e+"'. Consider component interpolation with '' to avoid XSS. See https://bit.ly/2ZqJzkp";"warn"===t?r(l):"error"===t&&o(l)}}};s(e,t,n,i)},_t.prototype._initVM=function(t){var e=I.config.silent;I.config.silent=!0,this._vm=new I({data:t}),I.config.silent=e},_t.prototype.destroyVM=function(){this._vm.$destroy()},_t.prototype.subscribeDataChanging=function(t){this._dataListeners.push(t)},_t.prototype.unsubscribeDataChanging=function(t){v(this._dataListeners,t)},_t.prototype.watchI18nData=function(){var t=this;return this._vm.$watch("$data",(function(){var e=t._dataListeners.length;while(e--)I.nextTick((function(){t._dataListeners[e]&&t._dataListeners[e].$forceUpdate()}))}),{deep:!0})},_t.prototype.watchLocale=function(){if(!this._sync||!this._root)return null;var t=this._vm;return this._root.$i18n.vm.$watch("locale",(function(e){t.$set(t,"locale",e),t.$forceUpdate()}),{immediate:!0})},_t.prototype.onComponentInstanceCreated=function(t){this._componentInstanceCreatedListener&&this._componentInstanceCreatedListener(t,this)},wt.vm.get=function(){return this._vm},wt.messages.get=function(){return m(this._getMessages())},wt.dateTimeFormats.get=function(){return m(this._getDateTimeFormats())},wt.numberFormats.get=function(){return m(this._getNumberFormats())},wt.availableLocales.get=function(){return Object.keys(this.messages).sort()},wt.locale.get=function(){return this._vm.locale},wt.locale.set=function(t){this._vm.$set(this._vm,"locale",t)},wt.fallbackLocale.get=function(){return this._vm.fallbackLocale},wt.fallbackLocale.set=function(t){this._localeChainCache={},this._vm.$set(this._vm,"fallbackLocale",t)},wt.formatFallbackMessages.get=function(){return this._formatFallbackMessages},wt.formatFallbackMessages.set=function(t){this._formatFallbackMessages=t},wt.missing.get=function(){return this._missing},wt.missing.set=function(t){this._missing=t},wt.formatter.get=function(){return this._formatter},wt.formatter.set=function(t){this._formatter=t},wt.silentTranslationWarn.get=function(){return this._silentTranslationWarn},wt.silentTranslationWarn.set=function(t){this._silentTranslationWarn=t},wt.silentFallbackWarn.get=function(){return this._silentFallbackWarn},wt.silentFallbackWarn.set=function(t){this._silentFallbackWarn=t},wt.preserveDirectiveContent.get=function(){return this._preserveDirectiveContent},wt.preserveDirectiveContent.set=function(t){this._preserveDirectiveContent=t},wt.warnHtmlInMessage.get=function(){return this._warnHtmlInMessage},wt.warnHtmlInMessage.set=function(t){var e=this,n=this._warnHtmlInMessage;if(this._warnHtmlInMessage=t,n!==t&&("warn"===t||"error"===t)){var i=this._getMessages();Object.keys(i).forEach((function(t){e._checkLocaleMessage(t,e._warnHtmlInMessage,i[t])}))}},wt.postTranslation.get=function(){return this._postTranslation},wt.postTranslation.set=function(t){this._postTranslation=t},_t.prototype._getMessages=function(){return this._vm.messages},_t.prototype._getDateTimeFormats=function(){return this._vm.dateTimeFormats},_t.prototype._getNumberFormats=function(){return this._vm.numberFormats},_t.prototype._warnDefault=function(t,e,n,i,r,o){if(!f(n))return n;if(this._missing){var s=this._missing.apply(null,[t,e,i,r]);if(u(s))return s}else 0;if(this._formatFallbackMessages){var a=p.apply(void 0,r);return this._render(e,o,a.params,e)}return e},_t.prototype._isFallbackRoot=function(t){return!t&&!f(this._root)&&this._fallbackRoot},_t.prototype._isSilentFallbackWarn=function(t){return this._silentFallbackWarn instanceof RegExp?this._silentFallbackWarn.test(t):this._silentFallbackWarn},_t.prototype._isSilentFallback=function(t,e){return this._isSilentFallbackWarn(e)&&(this._isFallbackRoot()||t!==this.fallbackLocale)},_t.prototype._isSilentTranslationWarn=function(t){return this._silentTranslationWarn instanceof RegExp?this._silentTranslationWarn.test(t):this._silentTranslationWarn},_t.prototype._interpolate=function(t,e,n,i,r,o,s){if(!e)return null;var a,l=this._path.getPathValue(e,n);if(Array.isArray(l)||d(l))return l;if(f(l)){if(!d(e))return null;if(a=e[n],!u(a))return null}else{if(!u(l))return null;a=l}return(a.indexOf("@:")>=0||a.indexOf("@.")>=0)&&(a=this._link(t,e,a,i,"raw",o,s)),this._render(a,r,o,n)},_t.prototype._link=function(t,e,n,i,r,o,s){var a=n,l=a.match(vt);for(var u in l)if(l.hasOwnProperty(u)){var c=l[u],h=c.match(gt),d=h[0],f=h[1],p=c.replace(d,"").replace(yt,"");if(g(s,p))return a;s.push(p);var m=this._interpolate(t,e,p,i,"raw"===r?"string":r,"raw"===r?void 0:o,s);if(this._isFallbackRoot(m)){if(!this._root)throw Error("unexpected error");var v=this._root.$i18n;m=v._translate(v._getMessages(),v.locale,v.fallbackLocale,p,i,r,o)}m=this._warnDefault(t,p,m,i,Array.isArray(o)?o:[o],r),this._modifiers.hasOwnProperty(f)?m=this._modifiers[f](m):bt.hasOwnProperty(f)&&(m=bt[f](m)),s.pop(),a=m?a.replace(c,m):a}return a},_t.prototype._render=function(t,e,n,i){var r=this._formatter.interpolate(t,n,i);return r||(r=xt.interpolate(t,n,i)),"string"!==e||u(r)?r:r.join("")},_t.prototype._appendItemToChain=function(t,e,n){var i=!1;return g(t,e)||(i=!0,e&&(i="!"!==e[e.length-1],e=e.replace(/!/g,""),t.push(e),n&&n[e]&&(i=n[e]))),i},_t.prototype._appendLocaleToChain=function(t,e,n){var i,r=e.split("-");do{var o=r.join("-");i=this._appendItemToChain(t,o,n),r.splice(-1,1)}while(r.length&&!0===i);return i},_t.prototype._appendBlockToChain=function(t,e,n){for(var i=!0,r=0;r0)o[s]=arguments[s+4];if(!t)return"";var a=p.apply(void 0,o),l=a.locale||e,u=this._translate(n,l,this.fallbackLocale,t,i,"string",a.params);if(this._isFallbackRoot(u)){if(!this._root)throw Error("unexpected error");return(r=this._root).$t.apply(r,[t].concat(o))}return u=this._warnDefault(l,t,u,i,o,"string"),this._postTranslation&&null!==u&&void 0!==u&&(u=this._postTranslation(u,t)),u},_t.prototype.t=function(t){var e,n=[],i=arguments.length-1;while(i-- >0)n[i]=arguments[i+1];return(e=this)._t.apply(e,[t,this.locale,this._getMessages(),null].concat(n))},_t.prototype._i=function(t,e,n,i,r){var o=this._translate(n,e,this.fallbackLocale,t,i,"raw",r);if(this._isFallbackRoot(o)){if(!this._root)throw Error("unexpected error");return this._root.$i18n.i(t,e,r)}return this._warnDefault(e,t,o,i,[r],"raw")},_t.prototype.i=function(t,e,n){return t?(u(e)||(e=this.locale),this._i(t,e,this._getMessages(),null,n)):""},_t.prototype._tc=function(t,e,n,i,r){var o,s=[],a=arguments.length-5;while(a-- >0)s[a]=arguments[a+5];if(!t)return"";void 0===r&&(r=1);var l={count:r,n:r},u=p.apply(void 0,s);return u.params=Object.assign(l,u.params),s=null===u.locale?[u.params]:[u.locale,u.params],this.fetchChoice((o=this)._t.apply(o,[t,e,n,i].concat(s)),r)},_t.prototype.fetchChoice=function(t,e){if(!t&&!u(t))return null;var n=t.split("|");return e=this.getChoiceIndex(e,n.length),n[e]?n[e].trim():t},_t.prototype.tc=function(t,e){var n,i=[],r=arguments.length-2;while(r-- >0)i[r]=arguments[r+2];return(n=this)._tc.apply(n,[t,this.locale,this._getMessages(),null,e].concat(i))},_t.prototype._te=function(t,e,n){var i=[],r=arguments.length-3;while(r-- >0)i[r]=arguments[r+3];var o=p.apply(void 0,i).locale||e;return this._exist(n[o],t)},_t.prototype.te=function(t,e){return this._te(t,this.locale,this._getMessages(),e)},_t.prototype.getLocaleMessage=function(t){return m(this._vm.messages[t]||{})},_t.prototype.setLocaleMessage=function(t,e){"warn"!==this._warnHtmlInMessage&&"error"!==this._warnHtmlInMessage||this._checkLocaleMessage(t,this._warnHtmlInMessage,e),this._vm.$set(this._vm.messages,t,e)},_t.prototype.mergeLocaleMessage=function(t,e){"warn"!==this._warnHtmlInMessage&&"error"!==this._warnHtmlInMessage||this._checkLocaleMessage(t,this._warnHtmlInMessage,e),this._vm.$set(this._vm.messages,t,x({},this._vm.messages[t]||{},e))},_t.prototype.getDateTimeFormat=function(t){return m(this._vm.dateTimeFormats[t]||{})},_t.prototype.setDateTimeFormat=function(t,e){this._vm.$set(this._vm.dateTimeFormats,t,e),this._clearDateTimeFormat(t,e)},_t.prototype.mergeDateTimeFormat=function(t,e){this._vm.$set(this._vm.dateTimeFormats,t,x(this._vm.dateTimeFormats[t]||{},e)),this._clearDateTimeFormat(t,e)},_t.prototype._clearDateTimeFormat=function(t,e){for(var n in e){var i=t+"__"+n;this._dateTimeFormatters.hasOwnProperty(i)&&delete this._dateTimeFormatters[i]}},_t.prototype._localizeDateTime=function(t,e,n,i,r){for(var o=e,s=i[o],a=this._getLocaleChain(e,n),l=0;l0)e[n]=arguments[n+1];var i=this.locale,r=null;return 1===e.length?u(e[0])?r=e[0]:a(e[0])&&(e[0].locale&&(i=e[0].locale),e[0].key&&(r=e[0].key)):2===e.length&&(u(e[0])&&(r=e[0]),u(e[1])&&(i=e[1])),this._d(t,i,r)},_t.prototype.getNumberFormat=function(t){return m(this._vm.numberFormats[t]||{})},_t.prototype.setNumberFormat=function(t,e){this._vm.$set(this._vm.numberFormats,t,e),this._clearNumberFormat(t,e)},_t.prototype.mergeNumberFormat=function(t,e){this._vm.$set(this._vm.numberFormats,t,x(this._vm.numberFormats[t]||{},e)),this._clearNumberFormat(t,e)},_t.prototype._clearNumberFormat=function(t,e){for(var n in e){var i=t+"__"+n;this._numberFormatters.hasOwnProperty(i)&&delete this._numberFormatters[i]}},_t.prototype._getNumberFormatter=function(t,e,n,i,r,o){for(var s=e,a=i[s],l=this._getLocaleChain(e,n),u=0;u0)e[n]=arguments[n+1];var r=this.locale,o=null,s=null;return 1===e.length?u(e[0])?o=e[0]:a(e[0])&&(e[0].locale&&(r=e[0].locale),e[0].key&&(o=e[0].key),s=Object.keys(e[0]).reduce((function(t,n){var r;return g(i,n)?Object.assign({},t,(r={},r[n]=e[0][n],r)):t}),null)):2===e.length&&(u(e[0])&&(o=e[0]),u(e[1])&&(r=e[1])),this._n(t,r,o,s)},_t.prototype._ntp=function(t,e,n,i){if(!_t.availabilities.numberFormat)return[];if(!n){var r=i?new Intl.NumberFormat(e,i):new Intl.NumberFormat(e);return r.formatToParts(t)}var o=this._getNumberFormatter(t,e,this.fallbackLocale,this._getNumberFormats(),n,i),s=o&&o.formatToParts(t);if(this._isFallbackRoot(s)){if(!this._root)throw Error("unexpected error");return this._root.$i18n._ntp(t,e,n,i)}return s||[]},Object.defineProperties(_t.prototype,wt),Object.defineProperty(_t,"availabilities",{get:function(){if(!pt){var t="undefined"!==typeof Intl;pt={dateTimeFormat:t&&"undefined"!==typeof Intl.DateTimeFormat,numberFormat:t&&"undefined"!==typeof Intl.NumberFormat}}return pt}}),_t.install=$,_t.version="8.18.2",e["a"]=_t},a96b:function(t,e,n){var i=n("3eba"),r=i.extendComponentModel({type:"tooltip",dependencies:["axisPointer"],defaultOption:{zlevel:0,z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",renderMode:"auto",confine:!1,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"rgba(50,50,50,0.7)",borderColor:"#333",borderRadius:4,borderWidth:0,padding:5,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",textStyle:{}}},textStyle:{color:"#fff",fontSize:14}}});t.exports=r},ac0f:function(t,e,n){var i=n("cbe5"),r=n("401b"),o=n("4a3f"),s=o.quadraticSubdivide,a=o.cubicSubdivide,l=o.quadraticAt,u=o.cubicAt,c=o.quadraticDerivativeAt,h=o.cubicDerivativeAt,d=[];function f(t,e,n){var i=t.cpx2,r=t.cpy2;return null===i||null===r?[(n?h:u)(t.x1,t.cpx1,t.cpx2,t.x2,e),(n?h:u)(t.y1,t.cpy1,t.cpy2,t.y2,e)]:[(n?c:l)(t.x1,t.cpx1,t.x2,e),(n?c:l)(t.y1,t.cpy1,t.y2,e)]}var p=i.extend({type:"bezier-curve",shape:{x1:0,y1:0,x2:0,y2:0,cpx1:0,cpy1:0,percent:1},style:{stroke:"#000",fill:null},buildPath:function(t,e){var n=e.x1,i=e.y1,r=e.x2,o=e.y2,l=e.cpx1,u=e.cpy1,c=e.cpx2,h=e.cpy2,f=e.percent;0!==f&&(t.moveTo(n,i),null==c||null==h?(f<1&&(s(n,l,r,f,d),l=d[1],r=d[2],s(i,u,o,f,d),u=d[1],o=d[2]),t.quadraticCurveTo(l,u,r,o)):(f<1&&(a(n,l,c,r,f,d),l=d[1],c=d[2],r=d[3],a(i,u,h,o,f,d),u=d[1],h=d[2],o=d[3]),t.bezierCurveTo(l,u,c,h,r,o)))},pointAt:function(t){return f(this.shape,t,!1)},tangentAt:function(t){var e=f(this.shape,t,!0);return r.normalize(e,e)}});t.exports=p},ac1f:function(t,e,n){"use strict";var i=n("23e7"),r=n("9263");i({target:"RegExp",proto:!0,forced:/./.exec!==r},{exec:r})},ad6d:function(t,e,n){"use strict";var i=n("825a");t.exports=function(){var t=i(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},ae69:function(t,e,n){var i=n("cbe5"),r=i.extend({type:"ellipse",shape:{cx:0,cy:0,rx:0,ry:0},buildPath:function(t,e){var n=.5522848,i=e.cx,r=e.cy,o=e.rx,s=e.ry,a=o*n,l=s*n;t.moveTo(i-o,r),t.bezierCurveTo(i-o,r-l,i-a,r-s,i,r-s),t.bezierCurveTo(i+a,r-s,i+o,r-l,i+o,r),t.bezierCurveTo(i+o,r+l,i+a,r+s,i,r+s),t.bezierCurveTo(i-a,r+s,i-o,r+l,i-o,r),t.closePath()}});t.exports=r},ae93:function(t,e,n){"use strict";var i,r,o,s=n("e163"),a=n("9112"),l=n("5135"),u=n("b622"),c=n("c430"),h=u("iterator"),d=!1,f=function(){return this};[].keys&&(o=[].keys(),"next"in o?(r=s(s(o)),r!==Object.prototype&&(i=r)):d=!0),void 0==i&&(i={}),c||l(i,h)||a(i,h,f),t.exports={IteratorPrototype:i,BUGGY_SAFARI_ITERATORS:d}},af24:function(t,e,n){n("48c7"),n("f273")},afa0:function(t,e,n){var i=n("6d8b"),r=n("22d1"),o=n("e1fc"),s=n("04f6");function a(t,e){return t.zlevel===e.zlevel?t.z===e.z?t.z2-e.z2:t.z-e.z:t.zlevel-e.zlevel}var l=function(){this._roots=[],this._displayList=[],this._displayListLen=0};l.prototype={constructor:l,traverse:function(t,e){for(var n=0;n=0&&(this.delFromStorage(t),this._roots.splice(s,1),t instanceof o&&t.delChildrenFromStorage(this))}},addToStorage:function(t){return t&&(t.__storage=this,t.dirty(!1)),this},delFromStorage:function(t){return t&&(t.__storage=null),this},dispose:function(){this._renderList=this._roots=null},displayableSortFunc:a};var u=l;t.exports=u},b047:function(t,e,n){var i=n("1a8c"),r=n("408c"),o=n("b4b0"),s="Expected a function",a=Math.max,l=Math.min;function u(t,e,n){var u,c,h,d,f,p,m=0,v=!1,g=!1,y=!0;if("function"!=typeof t)throw new TypeError(s);function b(e){var n=u,i=c;return u=c=void 0,m=e,d=t.apply(i,n),d}function x(t){return m=t,f=setTimeout(S,e),v?b(t):d}function _(t){var n=t-p,i=t-m,r=e-n;return g?l(r,h-i):r}function w(t){var n=t-p,i=t-m;return void 0===p||n>=e||n<0||g&&i>=h}function S(){var t=r();if(w(t))return C(t);f=setTimeout(S,_(t))}function C(t){return f=void 0,y&&u?b(t):(u=c=void 0,d)}function E(){void 0!==f&&clearTimeout(f),m=0,u=p=c=f=void 0}function T(){return void 0===f?d:C(r())}function k(){var t=r(),n=w(t);if(u=arguments,c=this,p=t,n){if(void 0===f)return x(p);if(g)return clearTimeout(f),f=setTimeout(S,e),b(p)}return void 0===f&&(f=setTimeout(S,e)),d}return e=o(e)||0,i(n)&&(v=!!n.leading,g="maxWait"in n,h=g?a(o(n.maxWait)||0,e):h,y="trailing"in n?!!n.trailing:y),k.cancel=E,k.flush=T,k}t.exports=u},b0af:function(t,e,n){var i=n("2306"),r=n("3842"),o=r.round;function s(t,e,n){var r=t.getArea(),o=t.getBaseAxis().isHorizontal(),s=r.x,a=r.y,l=r.width,u=r.height,c=n.get("lineStyle.width")||2;s-=c/2,a-=c/2,l+=c,u+=c,s=Math.floor(s),l=Math.round(l);var h=new i.Rect({shape:{x:s,y:a,width:l,height:u}});return e&&(h.shape[o?"width":"height"]=0,i.initProps(h,{shape:{width:l,height:u}},n)),h}function a(t,e,n){var r=t.getArea(),s=new i.Sector({shape:{cx:o(t.cx,1),cy:o(t.cy,1),r0:o(r.r0,1),r:o(r.r,1),startAngle:r.startAngle,endAngle:r.endAngle,clockwise:r.clockwise}});return e&&(s.shape.endAngle=r.startAngle,i.initProps(s,{shape:{endAngle:r.endAngle}},n)),s}function l(t,e,n){return t?"polar"===t.type?a(t,e,n):"cartesian2d"===t.type?s(t,e,n):null:null}e.createGridClipPath=s,e.createPolarClipPath=a,e.createClipPath=l},b12f:function(t,e,n){var i=n("e1fc"),r=n("8918"),o=n("625e"),s=function(){this.group=new i,this.uid=r.getUID("viewComponent")};s.prototype={constructor:s,init:function(t,e){},render:function(t,e,n,i){},dispose:function(){},filterForExposedEvent:null};var a=s.prototype;a.updateView=a.updateLayout=a.updateVisual=function(t,e,n,i){},o.enableClassExtend(s),o.enableClassManagement(s,{registerWhenExtend:!0});var l=s;t.exports=l},b1d4:function(t,e,n){var i=n("862d");function r(t,e){return e=e||{},i(e.coordDimensions||[],t,{dimsDef:e.dimensionsDefine||t.dimensionsDefine,encodeDef:e.encodeDefine||t.encodeDefine,dimCount:e.dimensionsCount,encodeDefaulter:e.encodeDefaulter,generateCoord:e.generateCoord,generateCoordCount:e.generateCoordCount})}t.exports=r},b294:function(t,e,n){"use strict";var i=n("872a");function r(t){return"<<"===t||null===t}t.exports=new i("tag:yaml.org,2002:merge",{kind:"scalar",resolve:r})},b2cd:function(t,e,n){ + */var i=["style","currency","currencyDisplay","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","localeMatcher","formatMatcher","unit"];function r(t,e){"undefined"!==typeof console&&(console.warn("[vue-i18n] "+t),e&&console.warn(e.stack))}function o(t,e){"undefined"!==typeof console&&(console.error("[vue-i18n] "+t),e&&console.error(e.stack))}var s=Array.isArray;function a(t){return null!==t&&"object"===typeof t}function l(t){return"boolean"===typeof t}function u(t){return"string"===typeof t}var c=Object.prototype.toString,h="[object Object]";function d(t){return c.call(t)===h}function f(t){return null===t||void 0===t}function p(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var n=null,i=null;return 1===t.length?a(t[0])||Array.isArray(t[0])?i=t[0]:"string"===typeof t[0]&&(n=t[0]):2===t.length&&("string"===typeof t[0]&&(n=t[0]),(a(t[1])||Array.isArray(t[1]))&&(i=t[1])),{locale:n,params:i}}function m(t){return JSON.parse(JSON.stringify(t))}function v(t,e){if(t.length){var n=t.indexOf(e);if(n>-1)return t.splice(n,1)}}function g(t,e){return!!~t.indexOf(e)}var y=Object.prototype.hasOwnProperty;function b(t,e){return y.call(t,e)}function x(t){for(var e=arguments,n=Object(t),i=1;i0)e[n]=arguments[n+1];var i=this.$i18n;return i._t.apply(i,[t,i.locale,i._getMessages(),this].concat(e))},t.prototype.$tc=function(t,e){var n=[],i=arguments.length-2;while(i-- >0)n[i]=arguments[i+2];var r=this.$i18n;return r._tc.apply(r,[t,r.locale,r._getMessages(),this,e].concat(n))},t.prototype.$te=function(t,e){var n=this.$i18n;return n._te(t,n.locale,n._getMessages(),e)},t.prototype.$d=function(t){var e,n=[],i=arguments.length-1;while(i-- >0)n[i]=arguments[i+1];return(e=this.$i18n).d.apply(e,[t].concat(n))},t.prototype.$n=function(t){var e,n=[],i=arguments.length-1;while(i-- >0)n[i]=arguments[i+1];return(e=this.$i18n).n.apply(e,[t].concat(n))}}var S={beforeCreate:function(){var t=this.$options;if(t.i18n=t.i18n||(t.__i18n?{}:null),t.i18n)if(t.i18n instanceof _t){if(t.__i18n)try{var e={};t.__i18n.forEach((function(t){e=x(e,JSON.parse(t))})),Object.keys(e).forEach((function(n){t.i18n.mergeLocaleMessage(n,e[n])}))}catch(s){0}this._i18n=t.i18n,this._i18nWatcher=this._i18n.watchI18nData()}else if(d(t.i18n)){var n=this.$root&&this.$root.$i18n&&this.$root.$i18n instanceof _t?this.$root.$i18n:null;if(n&&(t.i18n.root=this.$root,t.i18n.formatter=n.formatter,t.i18n.fallbackLocale=n.fallbackLocale,t.i18n.formatFallbackMessages=n.formatFallbackMessages,t.i18n.silentTranslationWarn=n.silentTranslationWarn,t.i18n.silentFallbackWarn=n.silentFallbackWarn,t.i18n.pluralizationRules=n.pluralizationRules,t.i18n.preserveDirectiveContent=n.preserveDirectiveContent),t.__i18n)try{var i={};t.__i18n.forEach((function(t){i=x(i,JSON.parse(t))})),t.i18n.messages=i}catch(s){0}var r=t.i18n,o=r.sharedMessages;o&&d(o)&&(t.i18n.messages=x(t.i18n.messages,o)),this._i18n=new _t(t.i18n),this._i18nWatcher=this._i18n.watchI18nData(),(void 0===t.i18n.sync||t.i18n.sync)&&(this._localeWatcher=this.$i18n.watchLocale()),n&&n.onComponentInstanceCreated(this._i18n)}else 0;else this.$root&&this.$root.$i18n&&this.$root.$i18n instanceof _t?this._i18n=this.$root.$i18n:t.parent&&t.parent.$i18n&&t.parent.$i18n instanceof _t&&(this._i18n=t.parent.$i18n)},beforeMount:function(){var t=this.$options;t.i18n=t.i18n||(t.__i18n?{}:null),t.i18n?(t.i18n instanceof _t||d(t.i18n))&&(this._i18n.subscribeDataChanging(this),this._subscribing=!0):(this.$root&&this.$root.$i18n&&this.$root.$i18n instanceof _t||t.parent&&t.parent.$i18n&&t.parent.$i18n instanceof _t)&&(this._i18n.subscribeDataChanging(this),this._subscribing=!0)},beforeDestroy:function(){if(this._i18n){var t=this;this.$nextTick((function(){t._subscribing&&(t._i18n.unsubscribeDataChanging(t),delete t._subscribing),t._i18nWatcher&&(t._i18nWatcher(),t._i18n.destroyVM(),delete t._i18nWatcher),t._localeWatcher&&(t._localeWatcher(),delete t._localeWatcher)}))}}},C={name:"i18n",functional:!0,props:{tag:{type:[String,Boolean],default:"span"},path:{type:String,required:!0},locale:{type:String},places:{type:[Array,Object]}},render:function(t,e){var n=e.data,i=e.parent,r=e.props,o=e.slots,s=i.$i18n;if(s){var a=r.path,l=r.locale,u=r.places,c=o(),h=s.i(a,l,E(c)||u?T(c.default,u):c),d=r.tag&&!0!==r.tag||!1===r.tag?r.tag:"span";return d?t(d,n,h):h}}};function E(t){var e;for(e in t)if("default"!==e)return!1;return Boolean(e)}function T(t,e){var n=e?k(e):{};if(!t)return n;t=t.filter((function(t){return t.tag||""!==t.text.trim()}));var i=t.every(O);return t.reduce(i?A:D,n)}function k(t){return Array.isArray(t)?t.reduce(D,{}):Object.assign({},t)}function A(t,e){return e.data&&e.data.attrs&&e.data.attrs.place&&(t[e.data.attrs.place]=e),t}function D(t,e,n){return t[n]=e,t}function O(t){return Boolean(t.data&&t.data.attrs&&t.data.attrs.place)}var I,M={name:"i18n-n",functional:!0,props:{tag:{type:[String,Boolean],default:"span"},value:{type:Number,required:!0},format:{type:[String,Object]},locale:{type:String}},render:function(t,e){var n=e.props,r=e.parent,o=e.data,s=r.$i18n;if(!s)return null;var l=null,c=null;u(n.format)?l=n.format:a(n.format)&&(n.format.key&&(l=n.format.key),c=Object.keys(n.format).reduce((function(t,e){var r;return g(i,e)?Object.assign({},t,(r={},r[e]=n.format[e],r)):t}),null));var h=n.locale||s.locale,d=s._ntp(n.value,h,l,c),f=d.map((function(t,e){var n,i=o.scopedSlots&&o.scopedSlots[t.type];return i?i((n={},n[t.type]=t.value,n.index=e,n.parts=d,n)):t.value})),p=n.tag&&!0!==n.tag||!1===n.tag?n.tag:"span";return p?t(p,{attrs:o.attrs,class:o["class"],staticClass:o.staticClass},f):f}};function j(t,e,n){V(t,n)&&R(t,e,n)}function P(t,e,n,i){if(V(t,n)){var r=n.context.$i18n;F(t,n)&&_(e.value,e.oldValue)&&_(t._localeMessage,r.getLocaleMessage(r.locale))||R(t,e,n)}}function N(t,e,n,i){var o=n.context;if(o){var s=n.context.$i18n||{};e.modifiers.preserve||s.preserveDirectiveContent||(t.textContent=""),t._vt=void 0,delete t["_vt"],t._locale=void 0,delete t["_locale"],t._localeMessage=void 0,delete t["_localeMessage"]}else r("Vue instance does not exists in VNode context")}function V(t,e){var n=e.context;return n?!!n.$i18n||(r("VueI18n instance does not exists in Vue instance"),!1):(r("Vue instance does not exists in VNode context"),!1)}function F(t,e){var n=e.context;return t._locale===n.$i18n.locale}function R(t,e,n){var i,o,s=e.value,a=L(s),l=a.path,u=a.locale,c=a.args,h=a.choice;if(l||u||c)if(l){var d=n.context;t._vt=t.textContent=null!=h?(i=d.$i18n).tc.apply(i,[l,h].concat(B(u,c))):(o=d.$i18n).t.apply(o,[l].concat(B(u,c))),t._locale=d.$i18n.locale,t._localeMessage=d.$i18n.getLocaleMessage(d.$i18n.locale)}else r("`path` is required in v-t directive");else r("value type not supported")}function L(t){var e,n,i,r;return u(t)?e=t:d(t)&&(e=t.path,n=t.locale,i=t.args,r=t.choice),{path:e,locale:n,args:i,choice:r}}function B(t,e){var n=[];return t&&n.push(t),e&&(Array.isArray(e)||d(e))&&n.push(e),n}function $(t){$.installed=!0,I=t;I.version&&Number(I.version.split(".")[0]);w(I),I.mixin(S),I.directive("t",{bind:j,update:P,unbind:N}),I.component(C.name,C),I.component(M.name,M);var e=I.config.optionMergeStrategies;e.i18n=function(t,e){return void 0===e?t:e}}var z=function(){this._caches=Object.create(null)};z.prototype.interpolate=function(t,e){if(!e)return[t];var n=this._caches[t];return n||(n=W(t),this._caches[t]=n),q(n,e)};var H=/^(?:\d)+/,U=/^(?:\w)+/;function W(t){var e=[],n=0,i="";while(n0)h--,c=et,d[G]();else{if(h=0,void 0===n)return!1;if(n=ht(n),!1===n)return!1;d[Y]()}};while(null!==c)if(u++,e=t[u],"\\"!==e||!f()){if(r=ct(e),a=st[c],o=a[r]||a["else"]||ot,o===ot)return;if(c=o[0],s=d[o[1]],s&&(i=o[2],i=void 0===i?e:i,!1===s()))return;if(c===rt)return l}}var ft=function(){this._cache=Object.create(null)};ft.prototype.parsePath=function(t){var e=this._cache[t];return e||(e=dt(t),e&&(this._cache[t]=e)),e||[]},ft.prototype.getPathValue=function(t,e){if(!a(t))return null;var n=this.parsePath(e);if(0===n.length)return null;var i=n.length,r=t,o=0;while(o/,vt=/(?:@(?:\.[a-z]+)?:(?:[\w\-_|.]+|\([\w\-_|.]+\)))/g,gt=/^@(?:\.([a-z]+))?:/,yt=/[()]/g,bt={upper:function(t){return t.toLocaleUpperCase()},lower:function(t){return t.toLocaleLowerCase()},capitalize:function(t){return""+t.charAt(0).toLocaleUpperCase()+t.substr(1)}},xt=new z,_t=function(t){var e=this;void 0===t&&(t={}),!I&&"undefined"!==typeof window&&window.Vue&&$(window.Vue);var n=t.locale||"en-US",i=!1!==t.fallbackLocale&&(t.fallbackLocale||"en-US"),r=t.messages||{},o=t.dateTimeFormats||{},s=t.numberFormats||{};this._vm=null,this._formatter=t.formatter||xt,this._modifiers=t.modifiers||{},this._missing=t.missing||null,this._root=t.root||null,this._sync=void 0===t.sync||!!t.sync,this._fallbackRoot=void 0===t.fallbackRoot||!!t.fallbackRoot,this._formatFallbackMessages=void 0!==t.formatFallbackMessages&&!!t.formatFallbackMessages,this._silentTranslationWarn=void 0!==t.silentTranslationWarn&&t.silentTranslationWarn,this._silentFallbackWarn=void 0!==t.silentFallbackWarn&&!!t.silentFallbackWarn,this._dateTimeFormatters={},this._numberFormatters={},this._path=new ft,this._dataListeners=[],this._componentInstanceCreatedListener=t.componentInstanceCreatedListener||null,this._preserveDirectiveContent=void 0!==t.preserveDirectiveContent&&!!t.preserveDirectiveContent,this.pluralizationRules=t.pluralizationRules||{},this._warnHtmlInMessage=t.warnHtmlInMessage||"off",this._postTranslation=t.postTranslation||null,this.getChoiceIndex=function(t,n){var i=Object.getPrototypeOf(e);if(i&&i.getChoiceIndex){var r=i.getChoiceIndex;return r.call(e,t,n)}var o=function(t,e){return t=Math.abs(t),2===e?t?t>1?1:0:1:t?Math.min(t,2):0};return e.locale in e.pluralizationRules?e.pluralizationRules[e.locale].apply(e,[t,n]):o(t,n)},this._exist=function(t,n){return!(!t||!n)&&(!f(e._path.getPathValue(t,n))||!!t[n])},"warn"!==this._warnHtmlInMessage&&"error"!==this._warnHtmlInMessage||Object.keys(r).forEach((function(t){e._checkLocaleMessage(t,e._warnHtmlInMessage,r[t])})),this._initVM({locale:n,fallbackLocale:i,messages:r,dateTimeFormats:o,numberFormats:s})},wt={vm:{configurable:!0},messages:{configurable:!0},dateTimeFormats:{configurable:!0},numberFormats:{configurable:!0},availableLocales:{configurable:!0},locale:{configurable:!0},fallbackLocale:{configurable:!0},formatFallbackMessages:{configurable:!0},missing:{configurable:!0},formatter:{configurable:!0},silentTranslationWarn:{configurable:!0},silentFallbackWarn:{configurable:!0},preserveDirectiveContent:{configurable:!0},warnHtmlInMessage:{configurable:!0},postTranslation:{configurable:!0}};_t.prototype._checkLocaleMessage=function(t,e,n){var i=[],s=function(t,e,n,i){if(d(n))Object.keys(n).forEach((function(r){var o=n[r];d(o)?(i.push(r),i.push("."),s(t,e,o,i),i.pop(),i.pop()):(i.push(r),s(t,e,o,i),i.pop())}));else if(Array.isArray(n))n.forEach((function(n,r){d(n)?(i.push("["+r+"]"),i.push("."),s(t,e,n,i),i.pop(),i.pop()):(i.push("["+r+"]"),s(t,e,n,i),i.pop())}));else if(u(n)){var a=mt.test(n);if(a){var l="Detected HTML in message '"+n+"' of keypath '"+i.join("")+"' at '"+e+"'. Consider bootstrap interpolation with '' to avoid XSS. See https://bit.ly/2ZqJzkp";"warn"===t?r(l):"error"===t&&o(l)}}};s(e,t,n,i)},_t.prototype._initVM=function(t){var e=I.config.silent;I.config.silent=!0,this._vm=new I({data:t}),I.config.silent=e},_t.prototype.destroyVM=function(){this._vm.$destroy()},_t.prototype.subscribeDataChanging=function(t){this._dataListeners.push(t)},_t.prototype.unsubscribeDataChanging=function(t){v(this._dataListeners,t)},_t.prototype.watchI18nData=function(){var t=this;return this._vm.$watch("$data",(function(){var e=t._dataListeners.length;while(e--)I.nextTick((function(){t._dataListeners[e]&&t._dataListeners[e].$forceUpdate()}))}),{deep:!0})},_t.prototype.watchLocale=function(){if(!this._sync||!this._root)return null;var t=this._vm;return this._root.$i18n.vm.$watch("locale",(function(e){t.$set(t,"locale",e),t.$forceUpdate()}),{immediate:!0})},_t.prototype.onComponentInstanceCreated=function(t){this._componentInstanceCreatedListener&&this._componentInstanceCreatedListener(t,this)},wt.vm.get=function(){return this._vm},wt.messages.get=function(){return m(this._getMessages())},wt.dateTimeFormats.get=function(){return m(this._getDateTimeFormats())},wt.numberFormats.get=function(){return m(this._getNumberFormats())},wt.availableLocales.get=function(){return Object.keys(this.messages).sort()},wt.locale.get=function(){return this._vm.locale},wt.locale.set=function(t){this._vm.$set(this._vm,"locale",t)},wt.fallbackLocale.get=function(){return this._vm.fallbackLocale},wt.fallbackLocale.set=function(t){this._localeChainCache={},this._vm.$set(this._vm,"fallbackLocale",t)},wt.formatFallbackMessages.get=function(){return this._formatFallbackMessages},wt.formatFallbackMessages.set=function(t){this._formatFallbackMessages=t},wt.missing.get=function(){return this._missing},wt.missing.set=function(t){this._missing=t},wt.formatter.get=function(){return this._formatter},wt.formatter.set=function(t){this._formatter=t},wt.silentTranslationWarn.get=function(){return this._silentTranslationWarn},wt.silentTranslationWarn.set=function(t){this._silentTranslationWarn=t},wt.silentFallbackWarn.get=function(){return this._silentFallbackWarn},wt.silentFallbackWarn.set=function(t){this._silentFallbackWarn=t},wt.preserveDirectiveContent.get=function(){return this._preserveDirectiveContent},wt.preserveDirectiveContent.set=function(t){this._preserveDirectiveContent=t},wt.warnHtmlInMessage.get=function(){return this._warnHtmlInMessage},wt.warnHtmlInMessage.set=function(t){var e=this,n=this._warnHtmlInMessage;if(this._warnHtmlInMessage=t,n!==t&&("warn"===t||"error"===t)){var i=this._getMessages();Object.keys(i).forEach((function(t){e._checkLocaleMessage(t,e._warnHtmlInMessage,i[t])}))}},wt.postTranslation.get=function(){return this._postTranslation},wt.postTranslation.set=function(t){this._postTranslation=t},_t.prototype._getMessages=function(){return this._vm.messages},_t.prototype._getDateTimeFormats=function(){return this._vm.dateTimeFormats},_t.prototype._getNumberFormats=function(){return this._vm.numberFormats},_t.prototype._warnDefault=function(t,e,n,i,r,o){if(!f(n))return n;if(this._missing){var s=this._missing.apply(null,[t,e,i,r]);if(u(s))return s}else 0;if(this._formatFallbackMessages){var a=p.apply(void 0,r);return this._render(e,o,a.params,e)}return e},_t.prototype._isFallbackRoot=function(t){return!t&&!f(this._root)&&this._fallbackRoot},_t.prototype._isSilentFallbackWarn=function(t){return this._silentFallbackWarn instanceof RegExp?this._silentFallbackWarn.test(t):this._silentFallbackWarn},_t.prototype._isSilentFallback=function(t,e){return this._isSilentFallbackWarn(e)&&(this._isFallbackRoot()||t!==this.fallbackLocale)},_t.prototype._isSilentTranslationWarn=function(t){return this._silentTranslationWarn instanceof RegExp?this._silentTranslationWarn.test(t):this._silentTranslationWarn},_t.prototype._interpolate=function(t,e,n,i,r,o,s){if(!e)return null;var a,l=this._path.getPathValue(e,n);if(Array.isArray(l)||d(l))return l;if(f(l)){if(!d(e))return null;if(a=e[n],!u(a))return null}else{if(!u(l))return null;a=l}return(a.indexOf("@:")>=0||a.indexOf("@.")>=0)&&(a=this._link(t,e,a,i,"raw",o,s)),this._render(a,r,o,n)},_t.prototype._link=function(t,e,n,i,r,o,s){var a=n,l=a.match(vt);for(var u in l)if(l.hasOwnProperty(u)){var c=l[u],h=c.match(gt),d=h[0],f=h[1],p=c.replace(d,"").replace(yt,"");if(g(s,p))return a;s.push(p);var m=this._interpolate(t,e,p,i,"raw"===r?"string":r,"raw"===r?void 0:o,s);if(this._isFallbackRoot(m)){if(!this._root)throw Error("unexpected error");var v=this._root.$i18n;m=v._translate(v._getMessages(),v.locale,v.fallbackLocale,p,i,r,o)}m=this._warnDefault(t,p,m,i,Array.isArray(o)?o:[o],r),this._modifiers.hasOwnProperty(f)?m=this._modifiers[f](m):bt.hasOwnProperty(f)&&(m=bt[f](m)),s.pop(),a=m?a.replace(c,m):a}return a},_t.prototype._render=function(t,e,n,i){var r=this._formatter.interpolate(t,n,i);return r||(r=xt.interpolate(t,n,i)),"string"!==e||u(r)?r:r.join("")},_t.prototype._appendItemToChain=function(t,e,n){var i=!1;return g(t,e)||(i=!0,e&&(i="!"!==e[e.length-1],e=e.replace(/!/g,""),t.push(e),n&&n[e]&&(i=n[e]))),i},_t.prototype._appendLocaleToChain=function(t,e,n){var i,r=e.split("-");do{var o=r.join("-");i=this._appendItemToChain(t,o,n),r.splice(-1,1)}while(r.length&&!0===i);return i},_t.prototype._appendBlockToChain=function(t,e,n){for(var i=!0,r=0;r0)o[s]=arguments[s+4];if(!t)return"";var a=p.apply(void 0,o),l=a.locale||e,u=this._translate(n,l,this.fallbackLocale,t,i,"string",a.params);if(this._isFallbackRoot(u)){if(!this._root)throw Error("unexpected error");return(r=this._root).$t.apply(r,[t].concat(o))}return u=this._warnDefault(l,t,u,i,o,"string"),this._postTranslation&&null!==u&&void 0!==u&&(u=this._postTranslation(u,t)),u},_t.prototype.t=function(t){var e,n=[],i=arguments.length-1;while(i-- >0)n[i]=arguments[i+1];return(e=this)._t.apply(e,[t,this.locale,this._getMessages(),null].concat(n))},_t.prototype._i=function(t,e,n,i,r){var o=this._translate(n,e,this.fallbackLocale,t,i,"raw",r);if(this._isFallbackRoot(o)){if(!this._root)throw Error("unexpected error");return this._root.$i18n.i(t,e,r)}return this._warnDefault(e,t,o,i,[r],"raw")},_t.prototype.i=function(t,e,n){return t?(u(e)||(e=this.locale),this._i(t,e,this._getMessages(),null,n)):""},_t.prototype._tc=function(t,e,n,i,r){var o,s=[],a=arguments.length-5;while(a-- >0)s[a]=arguments[a+5];if(!t)return"";void 0===r&&(r=1);var l={count:r,n:r},u=p.apply(void 0,s);return u.params=Object.assign(l,u.params),s=null===u.locale?[u.params]:[u.locale,u.params],this.fetchChoice((o=this)._t.apply(o,[t,e,n,i].concat(s)),r)},_t.prototype.fetchChoice=function(t,e){if(!t&&!u(t))return null;var n=t.split("|");return e=this.getChoiceIndex(e,n.length),n[e]?n[e].trim():t},_t.prototype.tc=function(t,e){var n,i=[],r=arguments.length-2;while(r-- >0)i[r]=arguments[r+2];return(n=this)._tc.apply(n,[t,this.locale,this._getMessages(),null,e].concat(i))},_t.prototype._te=function(t,e,n){var i=[],r=arguments.length-3;while(r-- >0)i[r]=arguments[r+3];var o=p.apply(void 0,i).locale||e;return this._exist(n[o],t)},_t.prototype.te=function(t,e){return this._te(t,this.locale,this._getMessages(),e)},_t.prototype.getLocaleMessage=function(t){return m(this._vm.messages[t]||{})},_t.prototype.setLocaleMessage=function(t,e){"warn"!==this._warnHtmlInMessage&&"error"!==this._warnHtmlInMessage||this._checkLocaleMessage(t,this._warnHtmlInMessage,e),this._vm.$set(this._vm.messages,t,e)},_t.prototype.mergeLocaleMessage=function(t,e){"warn"!==this._warnHtmlInMessage&&"error"!==this._warnHtmlInMessage||this._checkLocaleMessage(t,this._warnHtmlInMessage,e),this._vm.$set(this._vm.messages,t,x({},this._vm.messages[t]||{},e))},_t.prototype.getDateTimeFormat=function(t){return m(this._vm.dateTimeFormats[t]||{})},_t.prototype.setDateTimeFormat=function(t,e){this._vm.$set(this._vm.dateTimeFormats,t,e),this._clearDateTimeFormat(t,e)},_t.prototype.mergeDateTimeFormat=function(t,e){this._vm.$set(this._vm.dateTimeFormats,t,x(this._vm.dateTimeFormats[t]||{},e)),this._clearDateTimeFormat(t,e)},_t.prototype._clearDateTimeFormat=function(t,e){for(var n in e){var i=t+"__"+n;this._dateTimeFormatters.hasOwnProperty(i)&&delete this._dateTimeFormatters[i]}},_t.prototype._localizeDateTime=function(t,e,n,i,r){for(var o=e,s=i[o],a=this._getLocaleChain(e,n),l=0;l0)e[n]=arguments[n+1];var i=this.locale,r=null;return 1===e.length?u(e[0])?r=e[0]:a(e[0])&&(e[0].locale&&(i=e[0].locale),e[0].key&&(r=e[0].key)):2===e.length&&(u(e[0])&&(r=e[0]),u(e[1])&&(i=e[1])),this._d(t,i,r)},_t.prototype.getNumberFormat=function(t){return m(this._vm.numberFormats[t]||{})},_t.prototype.setNumberFormat=function(t,e){this._vm.$set(this._vm.numberFormats,t,e),this._clearNumberFormat(t,e)},_t.prototype.mergeNumberFormat=function(t,e){this._vm.$set(this._vm.numberFormats,t,x(this._vm.numberFormats[t]||{},e)),this._clearNumberFormat(t,e)},_t.prototype._clearNumberFormat=function(t,e){for(var n in e){var i=t+"__"+n;this._numberFormatters.hasOwnProperty(i)&&delete this._numberFormatters[i]}},_t.prototype._getNumberFormatter=function(t,e,n,i,r,o){for(var s=e,a=i[s],l=this._getLocaleChain(e,n),u=0;u0)e[n]=arguments[n+1];var r=this.locale,o=null,s=null;return 1===e.length?u(e[0])?o=e[0]:a(e[0])&&(e[0].locale&&(r=e[0].locale),e[0].key&&(o=e[0].key),s=Object.keys(e[0]).reduce((function(t,n){var r;return g(i,n)?Object.assign({},t,(r={},r[n]=e[0][n],r)):t}),null)):2===e.length&&(u(e[0])&&(o=e[0]),u(e[1])&&(r=e[1])),this._n(t,r,o,s)},_t.prototype._ntp=function(t,e,n,i){if(!_t.availabilities.numberFormat)return[];if(!n){var r=i?new Intl.NumberFormat(e,i):new Intl.NumberFormat(e);return r.formatToParts(t)}var o=this._getNumberFormatter(t,e,this.fallbackLocale,this._getNumberFormats(),n,i),s=o&&o.formatToParts(t);if(this._isFallbackRoot(s)){if(!this._root)throw Error("unexpected error");return this._root.$i18n._ntp(t,e,n,i)}return s||[]},Object.defineProperties(_t.prototype,wt),Object.defineProperty(_t,"availabilities",{get:function(){if(!pt){var t="undefined"!==typeof Intl;pt={dateTimeFormat:t&&"undefined"!==typeof Intl.DateTimeFormat,numberFormat:t&&"undefined"!==typeof Intl.NumberFormat}}return pt}}),_t.install=$,_t.version="8.18.2",e["a"]=_t},a96b:function(t,e,n){var i=n("3eba"),r=i.extendComponentModel({type:"tooltip",dependencies:["axisPointer"],defaultOption:{zlevel:0,z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",renderMode:"auto",confine:!1,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"rgba(50,50,50,0.7)",borderColor:"#333",borderRadius:4,borderWidth:0,padding:5,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",textStyle:{}}},textStyle:{color:"#fff",fontSize:14}}});t.exports=r},ac0f:function(t,e,n){var i=n("cbe5"),r=n("401b"),o=n("4a3f"),s=o.quadraticSubdivide,a=o.cubicSubdivide,l=o.quadraticAt,u=o.cubicAt,c=o.quadraticDerivativeAt,h=o.cubicDerivativeAt,d=[];function f(t,e,n){var i=t.cpx2,r=t.cpy2;return null===i||null===r?[(n?h:u)(t.x1,t.cpx1,t.cpx2,t.x2,e),(n?h:u)(t.y1,t.cpy1,t.cpy2,t.y2,e)]:[(n?c:l)(t.x1,t.cpx1,t.x2,e),(n?c:l)(t.y1,t.cpy1,t.y2,e)]}var p=i.extend({type:"bezier-curve",shape:{x1:0,y1:0,x2:0,y2:0,cpx1:0,cpy1:0,percent:1},style:{stroke:"#000",fill:null},buildPath:function(t,e){var n=e.x1,i=e.y1,r=e.x2,o=e.y2,l=e.cpx1,u=e.cpy1,c=e.cpx2,h=e.cpy2,f=e.percent;0!==f&&(t.moveTo(n,i),null==c||null==h?(f<1&&(s(n,l,r,f,d),l=d[1],r=d[2],s(i,u,o,f,d),u=d[1],o=d[2]),t.quadraticCurveTo(l,u,r,o)):(f<1&&(a(n,l,c,r,f,d),l=d[1],c=d[2],r=d[3],a(i,u,h,o,f,d),u=d[1],h=d[2],o=d[3]),t.bezierCurveTo(l,u,c,h,r,o)))},pointAt:function(t){return f(this.shape,t,!1)},tangentAt:function(t){var e=f(this.shape,t,!0);return r.normalize(e,e)}});t.exports=p},ac1f:function(t,e,n){"use strict";var i=n("23e7"),r=n("9263");i({target:"RegExp",proto:!0,forced:/./.exec!==r},{exec:r})},ad6d:function(t,e,n){"use strict";var i=n("825a");t.exports=function(){var t=i(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},ae69:function(t,e,n){var i=n("cbe5"),r=i.extend({type:"ellipse",shape:{cx:0,cy:0,rx:0,ry:0},buildPath:function(t,e){var n=.5522848,i=e.cx,r=e.cy,o=e.rx,s=e.ry,a=o*n,l=s*n;t.moveTo(i-o,r),t.bezierCurveTo(i-o,r-l,i-a,r-s,i,r-s),t.bezierCurveTo(i+a,r-s,i+o,r-l,i+o,r),t.bezierCurveTo(i+o,r+l,i+a,r+s,i,r+s),t.bezierCurveTo(i-a,r+s,i-o,r+l,i-o,r),t.closePath()}});t.exports=r},ae93:function(t,e,n){"use strict";var i,r,o,s=n("e163"),a=n("9112"),l=n("5135"),u=n("b622"),c=n("c430"),h=u("iterator"),d=!1,f=function(){return this};[].keys&&(o=[].keys(),"next"in o?(r=s(s(o)),r!==Object.prototype&&(i=r)):d=!0),void 0==i&&(i={}),c||l(i,h)||a(i,h,f),t.exports={IteratorPrototype:i,BUGGY_SAFARI_ITERATORS:d}},af24:function(t,e,n){n("48c7"),n("f273")},afa0:function(t,e,n){var i=n("6d8b"),r=n("22d1"),o=n("e1fc"),s=n("04f6");function a(t,e){return t.zlevel===e.zlevel?t.z===e.z?t.z2-e.z2:t.z-e.z:t.zlevel-e.zlevel}var l=function(){this._roots=[],this._displayList=[],this._displayListLen=0};l.prototype={constructor:l,traverse:function(t,e){for(var n=0;n=0&&(this.delFromStorage(t),this._roots.splice(s,1),t instanceof o&&t.delChildrenFromStorage(this))}},addToStorage:function(t){return t&&(t.__storage=this,t.dirty(!1)),this},delFromStorage:function(t){return t&&(t.__storage=null),this},dispose:function(){this._renderList=this._roots=null},displayableSortFunc:a};var u=l;t.exports=u},b047:function(t,e,n){var i=n("1a8c"),r=n("408c"),o=n("b4b0"),s="Expected a function",a=Math.max,l=Math.min;function u(t,e,n){var u,c,h,d,f,p,m=0,v=!1,g=!1,y=!0;if("function"!=typeof t)throw new TypeError(s);function b(e){var n=u,i=c;return u=c=void 0,m=e,d=t.apply(i,n),d}function x(t){return m=t,f=setTimeout(S,e),v?b(t):d}function _(t){var n=t-p,i=t-m,r=e-n;return g?l(r,h-i):r}function w(t){var n=t-p,i=t-m;return void 0===p||n>=e||n<0||g&&i>=h}function S(){var t=r();if(w(t))return C(t);f=setTimeout(S,_(t))}function C(t){return f=void 0,y&&u?b(t):(u=c=void 0,d)}function E(){void 0!==f&&clearTimeout(f),m=0,u=p=c=f=void 0}function T(){return void 0===f?d:C(r())}function k(){var t=r(),n=w(t);if(u=arguments,c=this,p=t,n){if(void 0===f)return x(p);if(g)return clearTimeout(f),f=setTimeout(S,e),b(p)}return void 0===f&&(f=setTimeout(S,e)),d}return e=o(e)||0,i(n)&&(v=!!n.leading,g="maxWait"in n,h=g?a(o(n.maxWait)||0,e):h,y="trailing"in n?!!n.trailing:y),k.cancel=E,k.flush=T,k}t.exports=u},b0af:function(t,e,n){var i=n("2306"),r=n("3842"),o=r.round;function s(t,e,n){var r=t.getArea(),o=t.getBaseAxis().isHorizontal(),s=r.x,a=r.y,l=r.width,u=r.height,c=n.get("lineStyle.width")||2;s-=c/2,a-=c/2,l+=c,u+=c,s=Math.floor(s),l=Math.round(l);var h=new i.Rect({shape:{x:s,y:a,width:l,height:u}});return e&&(h.shape[o?"width":"height"]=0,i.initProps(h,{shape:{width:l,height:u}},n)),h}function a(t,e,n){var r=t.getArea(),s=new i.Sector({shape:{cx:o(t.cx,1),cy:o(t.cy,1),r0:o(r.r0,1),r:o(r.r,1),startAngle:r.startAngle,endAngle:r.endAngle,clockwise:r.clockwise}});return e&&(s.shape.endAngle=r.startAngle,i.initProps(s,{shape:{endAngle:r.endAngle}},n)),s}function l(t,e,n){return t?"polar"===t.type?a(t,e,n):"cartesian2d"===t.type?s(t,e,n):null:null}e.createGridClipPath=s,e.createPolarClipPath=a,e.createClipPath=l},b12f:function(t,e,n){var i=n("e1fc"),r=n("8918"),o=n("625e"),s=function(){this.group=new i,this.uid=r.getUID("viewComponent")};s.prototype={constructor:s,init:function(t,e){},render:function(t,e,n,i){},dispose:function(){},filterForExposedEvent:null};var a=s.prototype;a.updateView=a.updateLayout=a.updateVisual=function(t,e,n,i){},o.enableClassExtend(s),o.enableClassManagement(s,{registerWhenExtend:!0});var l=s;t.exports=l},b1d4:function(t,e,n){var i=n("862d");function r(t,e){return e=e||{},i(e.coordDimensions||[],t,{dimsDef:e.dimensionsDefine||t.dimensionsDefine,encodeDef:e.encodeDefine||t.encodeDefine,dimCount:e.dimensionsCount,encodeDefaulter:e.encodeDefaulter,generateCoord:e.generateCoord,generateCoordCount:e.generateCoordCount})}t.exports=r},b294:function(t,e,n){"use strict";var i=n("872a");function r(t){return"<<"===t||null===t}t.exports=new i("tag:yaml.org,2002:merge",{kind:"scalar",resolve:r})},b2cd:function(t,e,n){ /*! * jsoneditor.js * @@ -1065,7 +1065,7 @@ t.exports=function(t){return null!=t&&null!=t.constructor&&"function"===typeof t /*!***********************************!*\ !*** ./src/mixins/registrable.ts ***! \***********************************/ -/*! exports provided: inject, provide */function(t,e,n){"use strict";n.r(e),n.d(e,"inject",(function(){return a})),n.d(e,"provide",(function(){return l}));var i=n(/*! vue */"vue"),r=n.n(i),o=n(/*! ../util/console */"./src/util/console.ts");function s(t,e){return function(){return Object(o["consoleWarn"])("The "+t+" component must be used inside a "+e)}}function a(t,e,n){var i,o=e&&n?{register:s(e,n),unregister:s(e,n)}:null;return r.a.extend({name:"registrable-inject",inject:(i={},i[t]={default:o},i)})}function l(t){return r.a.extend({name:"registrable-provide",methods:{register:null,unregister:null},provide:function(){var e;return e={},e[t]={register:this.register,unregister:this.unregister},e}})}},"./src/mixins/returnable.ts": +/*! exports provided: inject, provide */function(t,e,n){"use strict";n.r(e),n.d(e,"inject",(function(){return a})),n.d(e,"provide",(function(){return l}));var i=n(/*! vue */"vue"),r=n.n(i),o=n(/*! ../util/console */"./src/util/console.ts");function s(t,e){return function(){return Object(o["consoleWarn"])("The "+t+" bootstrap must be used inside a "+e)}}function a(t,e,n){var i,o=e&&n?{register:s(e,n),unregister:s(e,n)}:null;return r.a.extend({name:"registrable-inject",inject:(i={},i[t]={default:o},i)})}function l(t){return r.a.extend({name:"registrable-provide",methods:{register:null,unregister:null},provide:function(){var e;return e={},e[t]={register:this.register,unregister:this.unregister},e}})}},"./src/mixins/returnable.ts": /*!**********************************!*\ !*** ./src/mixins/returnable.ts ***! \**********************************/ diff --git a/cmd/ui/dist/static/js/chunk-vendors.491fd433.js.map b/app/dubbo-ui/dist/static/js/chunk-vendors.491fd433.js.map similarity index 100% rename from cmd/ui/dist/static/js/chunk-vendors.491fd433.js.map rename to app/dubbo-ui/dist/static/js/chunk-vendors.491fd433.js.map diff --git a/cmd/ui/fs.go b/app/dubbo-ui/fs.go old mode 100755 new mode 100644 similarity index 100% rename from cmd/ui/fs.go rename to app/dubbo-ui/fs.go diff --git a/pkg/dubboctl/cmd/manifest.go b/app/dubboctl/cmd/manifest.go similarity index 95% rename from pkg/dubboctl/cmd/manifest.go rename to app/dubboctl/cmd/manifest.go index 7bca06640..222f3366e 100644 --- a/pkg/dubboctl/cmd/manifest.go +++ b/app/dubboctl/cmd/manifest.go @@ -16,7 +16,7 @@ package cmd import ( - subcmd "github.com/apache/dubbo-admin/pkg/dubboctl/cmd/subcmd" + subcmd "github.com/apache/dubbo-admin/app/dubboctl/cmd/subcmd" "github.com/spf13/cobra" ) diff --git a/pkg/dubboctl/cmd/manifest_test.go b/app/dubboctl/cmd/manifest_test.go similarity index 93% rename from pkg/dubboctl/cmd/manifest_test.go rename to app/dubboctl/cmd/manifest_test.go index e35749165..5fddd8425 100644 --- a/pkg/dubboctl/cmd/manifest_test.go +++ b/app/dubboctl/cmd/manifest_test.go @@ -21,7 +21,7 @@ import ( "strings" "testing" - "github.com/apache/dubbo-admin/pkg/dubboctl/cmd/subcmd" + "github.com/apache/dubbo-admin/app/dubboctl/cmd/subcmd" "sigs.k8s.io/controller-runtime/pkg/client/fake" ) @@ -38,15 +38,15 @@ func TestManifestGenerate(t *testing.T) { cmd: "manifest generate", }, { - desc: "setting specification of built-in component", + desc: "setting specification of built-in bootstrap", cmd: "manifest generate --set spec.components.nacos.replicas=3", }, { - desc: "setting specification of add-on component", + desc: "setting specification of add-on bootstrap", cmd: "manifest generate --set spec.components.grafana.replicas=3", }, { - desc: "disabling component", + desc: "disabling bootstrap", cmd: "manifest generate --set spec.componentsMeta.nacos.enabled=false", }, { @@ -55,11 +55,11 @@ func TestManifestGenerate(t *testing.T) { " --set spec.componentsMeta.grafana.version=6.31.0", }, { - desc: "setting specification of built-in component with wrong path", + desc: "setting specification of built-in bootstrap with wrong path", cmd: "manifest generate --set components.nacos.replicas=3", }, { - desc: "setting specification of built-in component with wrong path", + desc: "setting specification of built-in bootstrap with wrong path", cmd: "manifest generate --set components.grafana.replicas=3", }, { diff --git a/pkg/dubboctl/cmd/profile.go b/app/dubboctl/cmd/profile.go similarity index 95% rename from pkg/dubboctl/cmd/profile.go rename to app/dubboctl/cmd/profile.go index e0c3534b9..93e73d2b0 100644 --- a/pkg/dubboctl/cmd/profile.go +++ b/app/dubboctl/cmd/profile.go @@ -16,7 +16,7 @@ package cmd import ( - "github.com/apache/dubbo-admin/pkg/dubboctl/cmd/subcmd" + "github.com/apache/dubbo-admin/app/dubboctl/cmd/subcmd" "github.com/spf13/cobra" ) diff --git a/pkg/dubboctl/cmd/profile_test.go b/app/dubboctl/cmd/profile_test.go similarity index 100% rename from pkg/dubboctl/cmd/profile_test.go rename to app/dubboctl/cmd/profile_test.go diff --git a/pkg/dubboctl/cmd/root.go b/app/dubboctl/cmd/root.go similarity index 100% rename from pkg/dubboctl/cmd/root.go rename to app/dubboctl/cmd/root.go diff --git a/pkg/dubboctl/cmd/subcmd/common.go b/app/dubboctl/cmd/subcmd/common.go similarity index 100% rename from pkg/dubboctl/cmd/subcmd/common.go rename to app/dubboctl/cmd/subcmd/common.go diff --git a/pkg/dubboctl/cmd/subcmd/manifest_diff.go b/app/dubboctl/cmd/subcmd/manifest_diff.go similarity index 97% rename from pkg/dubboctl/cmd/subcmd/manifest_diff.go rename to app/dubboctl/cmd/subcmd/manifest_diff.go index b1dbd6d20..e84b60625 100644 --- a/pkg/dubboctl/cmd/subcmd/manifest_diff.go +++ b/app/dubboctl/cmd/subcmd/manifest_diff.go @@ -18,12 +18,12 @@ package subcmd import ( "errors" "fmt" + "github.com/apache/dubbo-admin/pkg/core/logger" "os" "path/filepath" "strings" - "github.com/apache/dubbo-admin/pkg/dubboctl/internal/kube" - "github.com/apache/dubbo-admin/pkg/logger" + "github.com/apache/dubbo-admin/app/dubboctl/internal/kube" "github.com/spf13/cobra" "go.uber.org/zap/zapcore" ) diff --git a/pkg/dubboctl/cmd/subcmd/manifest_generate.go b/app/dubboctl/cmd/subcmd/manifest_generate.go similarity index 93% rename from pkg/dubboctl/cmd/subcmd/manifest_generate.go rename to app/dubboctl/cmd/subcmd/manifest_generate.go index a45181968..19cdc2377 100644 --- a/pkg/dubboctl/cmd/subcmd/manifest_generate.go +++ b/app/dubboctl/cmd/subcmd/manifest_generate.go @@ -17,21 +17,21 @@ package subcmd import ( "fmt" + "github.com/apache/dubbo-admin/pkg/core/logger" "os" "path" "sort" "strings" - "github.com/apache/dubbo-admin/pkg/logger" "go.uber.org/zap/zapcore" - "github.com/apache/dubbo-admin/pkg/dubboctl/identifier" + "github.com/apache/dubbo-admin/app/dubboctl/identifier" - "github.com/apache/dubbo-admin/pkg/dubboctl/internal/apis/dubbo.apache.org/v1alpha1" - "github.com/apache/dubbo-admin/pkg/dubboctl/internal/manifest" - "github.com/apache/dubbo-admin/pkg/dubboctl/internal/manifest/render" - "github.com/apache/dubbo-admin/pkg/dubboctl/internal/operator" - "github.com/apache/dubbo-admin/pkg/dubboctl/internal/util" + "github.com/apache/dubbo-admin/app/dubboctl/internal/apis/dubbo.apache.org/v1alpha1" + "github.com/apache/dubbo-admin/app/dubboctl/internal/manifest" + "github.com/apache/dubbo-admin/app/dubboctl/internal/manifest/render" + "github.com/apache/dubbo-admin/app/dubboctl/internal/operator" + "github.com/apache/dubbo-admin/app/dubboctl/internal/util" "github.com/spf13/cobra" "sigs.k8s.io/yaml" @@ -65,13 +65,13 @@ func ConfigManifestGenerateCmd(baseCmd *cobra.Command) { Example: ` # Generate a default Dubbo control plane manifest dubboctl manifest generate - # Setting specification of built-in component + # Setting specification of built-in bootstrap dubboctl manifest generate --set spec.components.nacos.replicas=3 - # Setting specification of add-on component + # Setting specification of add-on bootstrap dubboctl manifest generate --set spec.components.grafana.replicas=3 - # Disabling component + # Disabling bootstrap dubboctl manifest generate --set spec.componentsMeta.nacos.enabled=false # Setting repository url and version of remote chart diff --git a/pkg/dubboctl/cmd/subcmd/manifest_install.go b/app/dubboctl/cmd/subcmd/manifest_install.go similarity index 92% rename from pkg/dubboctl/cmd/subcmd/manifest_install.go rename to app/dubboctl/cmd/subcmd/manifest_install.go index 23aad1d45..98791ca9a 100644 --- a/pkg/dubboctl/cmd/subcmd/manifest_install.go +++ b/app/dubboctl/cmd/subcmd/manifest_install.go @@ -16,10 +16,10 @@ package subcmd import ( - "github.com/apache/dubbo-admin/pkg/dubboctl/internal/apis/dubbo.apache.org/v1alpha1" - "github.com/apache/dubbo-admin/pkg/dubboctl/internal/kube" - "github.com/apache/dubbo-admin/pkg/dubboctl/internal/operator" - "github.com/apache/dubbo-admin/pkg/logger" + "github.com/apache/dubbo-admin/app/dubboctl/internal/apis/dubbo.apache.org/v1alpha1" + "github.com/apache/dubbo-admin/app/dubboctl/internal/kube" + "github.com/apache/dubbo-admin/app/dubboctl/internal/operator" + "github.com/apache/dubbo-admin/pkg/core/logger" "github.com/spf13/cobra" "go.uber.org/zap/zapcore" ) diff --git a/pkg/dubboctl/cmd/subcmd/manifest_uninstall.go b/app/dubboctl/cmd/subcmd/manifest_uninstall.go similarity index 92% rename from pkg/dubboctl/cmd/subcmd/manifest_uninstall.go rename to app/dubboctl/cmd/subcmd/manifest_uninstall.go index a84de755d..61d4402ce 100644 --- a/pkg/dubboctl/cmd/subcmd/manifest_uninstall.go +++ b/app/dubboctl/cmd/subcmd/manifest_uninstall.go @@ -16,10 +16,10 @@ package subcmd import ( - "github.com/apache/dubbo-admin/pkg/dubboctl/internal/apis/dubbo.apache.org/v1alpha1" - "github.com/apache/dubbo-admin/pkg/dubboctl/internal/kube" - "github.com/apache/dubbo-admin/pkg/dubboctl/internal/operator" - "github.com/apache/dubbo-admin/pkg/logger" + "github.com/apache/dubbo-admin/app/dubboctl/internal/apis/dubbo.apache.org/v1alpha1" + "github.com/apache/dubbo-admin/app/dubboctl/internal/kube" + "github.com/apache/dubbo-admin/app/dubboctl/internal/operator" + "github.com/apache/dubbo-admin/pkg/core/logger" "github.com/spf13/cobra" "go.uber.org/zap/zapcore" ) diff --git a/pkg/dubboctl/cmd/subcmd/profile_diff.go b/app/dubboctl/cmd/subcmd/profile_diff.go similarity index 93% rename from pkg/dubboctl/cmd/subcmd/profile_diff.go rename to app/dubboctl/cmd/subcmd/profile_diff.go index 1a864387b..bd7b14494 100644 --- a/pkg/dubboctl/cmd/subcmd/profile_diff.go +++ b/app/dubboctl/cmd/subcmd/profile_diff.go @@ -18,11 +18,11 @@ package subcmd import ( "errors" "fmt" + "github.com/apache/dubbo-admin/pkg/core/logger" - "github.com/apache/dubbo-admin/pkg/dubboctl/identifier" - "github.com/apache/dubbo-admin/pkg/dubboctl/internal/kube" - "github.com/apache/dubbo-admin/pkg/dubboctl/internal/manifest" - "github.com/apache/dubbo-admin/pkg/logger" + "github.com/apache/dubbo-admin/app/dubboctl/identifier" + "github.com/apache/dubbo-admin/app/dubboctl/internal/kube" + "github.com/apache/dubbo-admin/app/dubboctl/internal/manifest" "github.com/spf13/cobra" "go.uber.org/zap/zapcore" ) diff --git a/pkg/dubboctl/cmd/subcmd/profile_list.go b/app/dubboctl/cmd/subcmd/profile_list.go similarity index 92% rename from pkg/dubboctl/cmd/subcmd/profile_list.go rename to app/dubboctl/cmd/subcmd/profile_list.go index dd1701725..2f1bd58ba 100644 --- a/pkg/dubboctl/cmd/subcmd/profile_list.go +++ b/app/dubboctl/cmd/subcmd/profile_list.go @@ -17,12 +17,12 @@ package subcmd import ( "errors" + "github.com/apache/dubbo-admin/pkg/core/logger" "strings" - "github.com/apache/dubbo-admin/pkg/dubboctl/identifier" - "github.com/apache/dubbo-admin/pkg/dubboctl/internal/manifest" - "github.com/apache/dubbo-admin/pkg/dubboctl/internal/util" - "github.com/apache/dubbo-admin/pkg/logger" + "github.com/apache/dubbo-admin/app/dubboctl/identifier" + "github.com/apache/dubbo-admin/app/dubboctl/internal/manifest" + "github.com/apache/dubbo-admin/app/dubboctl/internal/util" "github.com/spf13/cobra" "go.uber.org/zap/zapcore" ) diff --git a/pkg/dubboctl/cmd/testdata/customization/user.yaml b/app/dubboctl/cmd/testdata/customization/user.yaml similarity index 100% rename from pkg/dubboctl/cmd/testdata/customization/user.yaml rename to app/dubboctl/cmd/testdata/customization/user.yaml diff --git a/pkg/dubboctl/cmd/testdata/diff/profileA.yaml b/app/dubboctl/cmd/testdata/diff/profileA.yaml similarity index 100% rename from pkg/dubboctl/cmd/testdata/diff/profileA.yaml rename to app/dubboctl/cmd/testdata/diff/profileA.yaml diff --git a/pkg/dubboctl/cmd/testdata/diff/profileB.yaml b/app/dubboctl/cmd/testdata/diff/profileB.yaml similarity index 100% rename from pkg/dubboctl/cmd/testdata/diff/profileB.yaml rename to app/dubboctl/cmd/testdata/diff/profileB.yaml diff --git a/pkg/dubboctl/cmd/testdata/profile/test0.yaml b/app/dubboctl/cmd/testdata/profile/test0.yaml similarity index 100% rename from pkg/dubboctl/cmd/testdata/profile/test0.yaml rename to app/dubboctl/cmd/testdata/profile/test0.yaml diff --git a/pkg/dubboctl/cmd/testdata/profile/test1.yaml b/app/dubboctl/cmd/testdata/profile/test1.yaml similarity index 100% rename from pkg/dubboctl/cmd/testdata/profile/test1.yaml rename to app/dubboctl/cmd/testdata/profile/test1.yaml diff --git a/pkg/dubboctl/cmd/testdata/profile/test2_wrong_format.yaml b/app/dubboctl/cmd/testdata/profile/test2_wrong_format.yaml similarity index 100% rename from pkg/dubboctl/cmd/testdata/profile/test2_wrong_format.yaml rename to app/dubboctl/cmd/testdata/profile/test2_wrong_format.yaml diff --git a/pkg/dubboctl/identifier/constant.go b/app/dubboctl/identifier/constant.go similarity index 100% rename from pkg/dubboctl/identifier/constant.go rename to app/dubboctl/identifier/constant.go diff --git a/pkg/dubboctl/identifier/env.go b/app/dubboctl/identifier/env.go similarity index 100% rename from pkg/dubboctl/identifier/env.go rename to app/dubboctl/identifier/env.go diff --git a/pkg/dubboctl/internal/apis/dubbo.apache.org/v1alpha1/types.go b/app/dubboctl/internal/apis/dubbo.apache.org/v1alpha1/types.go similarity index 100% rename from pkg/dubboctl/internal/apis/dubbo.apache.org/v1alpha1/types.go rename to app/dubboctl/internal/apis/dubbo.apache.org/v1alpha1/types.go diff --git a/pkg/dubboctl/internal/kube/client.go b/app/dubboctl/internal/kube/client.go similarity index 98% rename from pkg/dubboctl/internal/kube/client.go rename to app/dubboctl/internal/kube/client.go index 876be1553..9bacf69cf 100644 --- a/pkg/dubboctl/internal/kube/client.go +++ b/app/dubboctl/internal/kube/client.go @@ -29,7 +29,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" ) -// CtlClient wraps controller-runtime client and is used by dubboctl +// CtlClient wraps controller-runtime clientgen and is used by dubboctl type CtlClient struct { client.Client opts *CtlClientOptions diff --git a/pkg/dubboctl/internal/kube/client_test.go b/app/dubboctl/internal/kube/client_test.go similarity index 100% rename from pkg/dubboctl/internal/kube/client_test.go rename to app/dubboctl/internal/kube/client_test.go diff --git a/pkg/dubboctl/internal/kube/common.go b/app/dubboctl/internal/kube/common.go similarity index 100% rename from pkg/dubboctl/internal/kube/common.go rename to app/dubboctl/internal/kube/common.go diff --git a/pkg/dubboctl/internal/kube/common_test.go b/app/dubboctl/internal/kube/common_test.go similarity index 100% rename from pkg/dubboctl/internal/kube/common_test.go rename to app/dubboctl/internal/kube/common_test.go diff --git a/pkg/dubboctl/internal/kube/object.go b/app/dubboctl/internal/kube/object.go similarity index 99% rename from pkg/dubboctl/internal/kube/object.go rename to app/dubboctl/internal/kube/object.go index e78bee931..29c3491ce 100644 --- a/pkg/dubboctl/internal/kube/object.go +++ b/app/dubboctl/internal/kube/object.go @@ -21,7 +21,7 @@ import ( "sort" "strings" - "github.com/apache/dubbo-admin/pkg/dubboctl/internal/util" + "github.com/apache/dubbo-admin/app/dubboctl/internal/util" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/util/yaml" diff --git a/pkg/dubboctl/internal/kube/object_test.go b/app/dubboctl/internal/kube/object_test.go similarity index 100% rename from pkg/dubboctl/internal/kube/object_test.go rename to app/dubboctl/internal/kube/object_test.go diff --git a/pkg/dubboctl/internal/kube/testdata/input/ctl_client-apply_manifest.yaml b/app/dubboctl/internal/kube/testdata/input/ctl_client-apply_manifest.yaml similarity index 100% rename from pkg/dubboctl/internal/kube/testdata/input/ctl_client-apply_manifest.yaml rename to app/dubboctl/internal/kube/testdata/input/ctl_client-apply_manifest.yaml diff --git a/pkg/dubboctl/internal/kube/testdata/input/ctl_client-apply_object-create.yaml b/app/dubboctl/internal/kube/testdata/input/ctl_client-apply_object-create.yaml similarity index 100% rename from pkg/dubboctl/internal/kube/testdata/input/ctl_client-apply_object-create.yaml rename to app/dubboctl/internal/kube/testdata/input/ctl_client-apply_object-create.yaml diff --git a/pkg/dubboctl/internal/kube/testdata/input/ctl_client-apply_object-update-before.yaml b/app/dubboctl/internal/kube/testdata/input/ctl_client-apply_object-update-before.yaml similarity index 100% rename from pkg/dubboctl/internal/kube/testdata/input/ctl_client-apply_object-update-before.yaml rename to app/dubboctl/internal/kube/testdata/input/ctl_client-apply_object-update-before.yaml diff --git a/pkg/dubboctl/internal/kube/testdata/input/ctl_client-apply_object-update.yaml b/app/dubboctl/internal/kube/testdata/input/ctl_client-apply_object-update.yaml similarity index 100% rename from pkg/dubboctl/internal/kube/testdata/input/ctl_client-apply_object-update.yaml rename to app/dubboctl/internal/kube/testdata/input/ctl_client-apply_object-update.yaml diff --git a/pkg/dubboctl/internal/kube/testdata/input/ctl_client-remove_manifest-before.yaml b/app/dubboctl/internal/kube/testdata/input/ctl_client-remove_manifest-before.yaml similarity index 100% rename from pkg/dubboctl/internal/kube/testdata/input/ctl_client-remove_manifest-before.yaml rename to app/dubboctl/internal/kube/testdata/input/ctl_client-remove_manifest-before.yaml diff --git a/pkg/dubboctl/internal/kube/testdata/input/ctl_client-remove_manifest.yaml b/app/dubboctl/internal/kube/testdata/input/ctl_client-remove_manifest.yaml similarity index 100% rename from pkg/dubboctl/internal/kube/testdata/input/ctl_client-remove_manifest.yaml rename to app/dubboctl/internal/kube/testdata/input/ctl_client-remove_manifest.yaml diff --git a/pkg/dubboctl/internal/kube/testdata/input/ctl_client-remove_object-delete-before.yaml b/app/dubboctl/internal/kube/testdata/input/ctl_client-remove_object-delete-before.yaml similarity index 100% rename from pkg/dubboctl/internal/kube/testdata/input/ctl_client-remove_object-delete-before.yaml rename to app/dubboctl/internal/kube/testdata/input/ctl_client-remove_object-delete-before.yaml diff --git a/pkg/dubboctl/internal/kube/testdata/input/ctl_client-remove_object-delete.yaml b/app/dubboctl/internal/kube/testdata/input/ctl_client-remove_object-delete.yaml similarity index 100% rename from pkg/dubboctl/internal/kube/testdata/input/ctl_client-remove_object-delete.yaml rename to app/dubboctl/internal/kube/testdata/input/ctl_client-remove_object-delete.yaml diff --git a/pkg/dubboctl/internal/kube/testdata/want/ctl_client-apply_object-create.yaml b/app/dubboctl/internal/kube/testdata/want/ctl_client-apply_object-create.yaml similarity index 100% rename from pkg/dubboctl/internal/kube/testdata/want/ctl_client-apply_object-create.yaml rename to app/dubboctl/internal/kube/testdata/want/ctl_client-apply_object-create.yaml diff --git a/pkg/dubboctl/internal/kube/testdata/want/ctl_client-apply_object-update.yaml b/app/dubboctl/internal/kube/testdata/want/ctl_client-apply_object-update.yaml similarity index 100% rename from pkg/dubboctl/internal/kube/testdata/want/ctl_client-apply_object-update.yaml rename to app/dubboctl/internal/kube/testdata/want/ctl_client-apply_object-update.yaml diff --git a/pkg/dubboctl/internal/manifest/common.go b/app/dubboctl/internal/manifest/common.go similarity index 97% rename from pkg/dubboctl/internal/manifest/common.go rename to app/dubboctl/internal/manifest/common.go index c5f29cdbd..cc1225edb 100644 --- a/pkg/dubboctl/internal/manifest/common.go +++ b/app/dubboctl/internal/manifest/common.go @@ -21,8 +21,8 @@ import ( "path" "strings" - "github.com/apache/dubbo-admin/pkg/dubboctl/internal/apis/dubbo.apache.org/v1alpha1" - "github.com/apache/dubbo-admin/pkg/dubboctl/internal/util" + "github.com/apache/dubbo-admin/app/dubboctl/internal/apis/dubbo.apache.org/v1alpha1" + "github.com/apache/dubbo-admin/app/dubboctl/internal/util" "sigs.k8s.io/yaml" ) diff --git a/pkg/dubboctl/internal/manifest/common_test.go b/app/dubboctl/internal/manifest/common_test.go similarity index 100% rename from pkg/dubboctl/internal/manifest/common_test.go rename to app/dubboctl/internal/manifest/common_test.go diff --git a/pkg/dubboctl/internal/manifest/render/render.go b/app/dubboctl/internal/manifest/render/render.go similarity index 96% rename from pkg/dubboctl/internal/manifest/render/render.go rename to app/dubboctl/internal/manifest/render/render.go index 18289e70c..0ffe2f49f 100644 --- a/pkg/dubboctl/internal/manifest/render/render.go +++ b/app/dubboctl/internal/manifest/render/render.go @@ -26,16 +26,16 @@ import ( "sort" "strings" - "github.com/apache/dubbo-admin/pkg/dubboctl/internal/util" + "github.com/apache/dubbo-admin/app/dubboctl/internal/util" - "github.com/apache/dubbo-admin/pkg/dubboctl/identifier" + "github.com/apache/dubbo-admin/app/dubboctl/identifier" "helm.sh/helm/v3/pkg/cli" "helm.sh/helm/v3/pkg/downloader" "helm.sh/helm/v3/pkg/getter" "helm.sh/helm/v3/pkg/repo" - "github.com/apache/dubbo-admin/pkg/dubboctl/internal/manifest" + "github.com/apache/dubbo-admin/app/dubboctl/internal/manifest" "helm.sh/helm/v3/pkg/action" "helm.sh/helm/v3/pkg/chart" "helm.sh/helm/v3/pkg/chart/loader" @@ -129,7 +129,7 @@ func (lr *LocalRenderer) Init() error { fileNames, err := getFileNames(lr.Opts.FS, lr.Opts.Dir) if err != nil { if os.IsNotExist(err) { - return fmt.Errorf("chart of component %s doesn't exist", lr.Opts.Name) + return fmt.Errorf("chart of bootstrap %s doesn't exist", lr.Opts.Name) } return fmt.Errorf("getFileNames err: %s", err) } @@ -149,7 +149,7 @@ func (lr *LocalRenderer) Init() error { } newChart, err := loader.LoadFiles(files) if err != nil { - return fmt.Errorf("load chart of component %s err: %s", lr.Opts.Name, err) + return fmt.Errorf("load chart of bootstrap %s err: %s", lr.Opts.Name, err) } lr.Chart = newChart lr.Started = true @@ -239,7 +239,7 @@ func NewRemoteRenderer(opts ...RendererOption) (Renderer, error) { func verifyRendererOptions(opts *RendererOptions) error { if opts.Name == "" { - return errors.New("missing component name for Renderer") + return errors.New("missing bootstrap name for Renderer") } if opts.Namespace == "" { // logger.Log("using default namespace) diff --git a/pkg/dubboctl/internal/manifest/render/render_test.go b/app/dubboctl/internal/manifest/render/render_test.go similarity index 98% rename from pkg/dubboctl/internal/manifest/render/render_test.go rename to app/dubboctl/internal/manifest/render/render_test.go index 188956658..eb419a468 100644 --- a/pkg/dubboctl/internal/manifest/render/render_test.go +++ b/app/dubboctl/internal/manifest/render/render_test.go @@ -19,7 +19,7 @@ import ( "os" "testing" - "github.com/apache/dubbo-admin/pkg/dubboctl/identifier" + "github.com/apache/dubbo-admin/app/dubboctl/identifier" ) const ( @@ -183,7 +183,7 @@ metadata: apiVersion: v1 kind: Pod metadata: - name: "nginx-testchart-test-connection" + name: "nginx-testchart-test-storage" labels: helm.sh/chart: testchart-0.1.0 app.kubernetes.io/name: testchart @@ -295,7 +295,7 @@ metadata: apiVersion: v1 kind: Pod metadata: - name: "nginx-testchart-test-connection" + name: "nginx-testchart-test-storage" labels: helm.sh/chart: testchart-0.1.0 app.kubernetes.io/name: testchart @@ -666,7 +666,7 @@ func TestRemoteRenderer_Init(t *testing.T) { // run.sh: |- // @test "Test Health" { // url="http://grafana/api/health" -// code=$(wget --server-response --spider --timeout 10 --tries 1 ${url} 2>&1 | awk '/^ HTTP/{print $2}') +// code=$(wget --cp-server-response --spider --timeout 10 --tries 1 ${url} 2>&1 | awk '/^ HTTP/{print $2}') // [ "$code" == "200" ] // } //--- @@ -874,7 +874,7 @@ func TestRemoteRenderer_Init(t *testing.T) { //apiVersion: v1 //kind: Pod //metadata: -// name: "nginx-testchart-test-connection" +// name: "nginx-testchart-test-storage" // labels: // helm.sh/chart: testchart-0.1.0 // app.kubernetes.io/name: testchart diff --git a/pkg/dubboctl/internal/manifest/render/testchart/.helmignore b/app/dubboctl/internal/manifest/render/testchart/.helmignore similarity index 100% rename from pkg/dubboctl/internal/manifest/render/testchart/.helmignore rename to app/dubboctl/internal/manifest/render/testchart/.helmignore diff --git a/pkg/dubboctl/internal/manifest/render/testchart/Chart.yaml b/app/dubboctl/internal/manifest/render/testchart/Chart.yaml similarity index 100% rename from pkg/dubboctl/internal/manifest/render/testchart/Chart.yaml rename to app/dubboctl/internal/manifest/render/testchart/Chart.yaml diff --git a/pkg/dubboctl/internal/manifest/render/testchart/templates/NOTES.txt b/app/dubboctl/internal/manifest/render/testchart/templates/NOTES.txt similarity index 100% rename from pkg/dubboctl/internal/manifest/render/testchart/templates/NOTES.txt rename to app/dubboctl/internal/manifest/render/testchart/templates/NOTES.txt diff --git a/pkg/dubboctl/internal/manifest/render/testchart/templates/_helpers.tpl b/app/dubboctl/internal/manifest/render/testchart/templates/_helpers.tpl similarity index 100% rename from pkg/dubboctl/internal/manifest/render/testchart/templates/_helpers.tpl rename to app/dubboctl/internal/manifest/render/testchart/templates/_helpers.tpl diff --git a/pkg/dubboctl/internal/manifest/render/testchart/templates/deployment.yaml b/app/dubboctl/internal/manifest/render/testchart/templates/deployment.yaml similarity index 100% rename from pkg/dubboctl/internal/manifest/render/testchart/templates/deployment.yaml rename to app/dubboctl/internal/manifest/render/testchart/templates/deployment.yaml diff --git a/pkg/dubboctl/internal/manifest/render/testchart/templates/hpa.yaml b/app/dubboctl/internal/manifest/render/testchart/templates/hpa.yaml similarity index 100% rename from pkg/dubboctl/internal/manifest/render/testchart/templates/hpa.yaml rename to app/dubboctl/internal/manifest/render/testchart/templates/hpa.yaml diff --git a/pkg/dubboctl/internal/manifest/render/testchart/templates/ingress.yaml b/app/dubboctl/internal/manifest/render/testchart/templates/ingress.yaml similarity index 100% rename from pkg/dubboctl/internal/manifest/render/testchart/templates/ingress.yaml rename to app/dubboctl/internal/manifest/render/testchart/templates/ingress.yaml diff --git a/pkg/dubboctl/internal/manifest/render/testchart/templates/service.yaml b/app/dubboctl/internal/manifest/render/testchart/templates/service.yaml similarity index 100% rename from pkg/dubboctl/internal/manifest/render/testchart/templates/service.yaml rename to app/dubboctl/internal/manifest/render/testchart/templates/service.yaml diff --git a/pkg/dubboctl/internal/manifest/render/testchart/templates/serviceaccount.yaml b/app/dubboctl/internal/manifest/render/testchart/templates/serviceaccount.yaml similarity index 100% rename from pkg/dubboctl/internal/manifest/render/testchart/templates/serviceaccount.yaml rename to app/dubboctl/internal/manifest/render/testchart/templates/serviceaccount.yaml diff --git a/pkg/dubboctl/internal/manifest/render/testchart/templates/tests/test-connection.yaml b/app/dubboctl/internal/manifest/render/testchart/templates/tests/test-connection.yaml similarity index 94% rename from pkg/dubboctl/internal/manifest/render/testchart/templates/tests/test-connection.yaml rename to app/dubboctl/internal/manifest/render/testchart/templates/tests/test-connection.yaml index b06af8e58..d963d60b9 100644 --- a/pkg/dubboctl/internal/manifest/render/testchart/templates/tests/test-connection.yaml +++ b/app/dubboctl/internal/manifest/render/testchart/templates/tests/test-connection.yaml @@ -16,7 +16,7 @@ apiVersion: v1 kind: Pod metadata: - name: "{{ include "testchart.fullname" . }}-test-connection" + name: "{{ include "testchart.fullname" . }}-test-storage" labels: {{- include "testchart.labels" . | nindent 4 }} annotations: diff --git a/pkg/dubboctl/internal/manifest/render/testchart/values.yaml b/app/dubboctl/internal/manifest/render/testchart/values.yaml similarity index 100% rename from pkg/dubboctl/internal/manifest/render/testchart/values.yaml rename to app/dubboctl/internal/manifest/render/testchart/values.yaml diff --git a/pkg/dubboctl/internal/manifest/tree.go b/app/dubboctl/internal/manifest/tree.go similarity index 99% rename from pkg/dubboctl/internal/manifest/tree.go rename to app/dubboctl/internal/manifest/tree.go index d65594a86..ec7a19835 100644 --- a/pkg/dubboctl/internal/manifest/tree.go +++ b/app/dubboctl/internal/manifest/tree.go @@ -38,7 +38,7 @@ import ( "strconv" "strings" - "github.com/apache/dubbo-admin/pkg/dubboctl/internal/util" + "github.com/apache/dubbo-admin/app/dubboctl/internal/util" "gopkg.in/yaml.v2" yaml2 "sigs.k8s.io/yaml" diff --git a/pkg/dubboctl/internal/manifest/util.go b/app/dubboctl/internal/manifest/util.go similarity index 100% rename from pkg/dubboctl/internal/manifest/util.go rename to app/dubboctl/internal/manifest/util.go diff --git a/pkg/dubboctl/internal/operator/component.go b/app/dubboctl/internal/operator/component.go similarity index 97% rename from pkg/dubboctl/internal/operator/component.go rename to app/dubboctl/internal/operator/component.go index 925894c1e..cd5f1a27a 100644 --- a/pkg/dubboctl/internal/operator/component.go +++ b/app/dubboctl/internal/operator/component.go @@ -24,11 +24,11 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "github.com/apache/dubbo-admin/pkg/dubboctl/identifier" - "github.com/apache/dubbo-admin/pkg/dubboctl/internal/apis/dubbo.apache.org/v1alpha1" - "github.com/apache/dubbo-admin/pkg/dubboctl/internal/manifest" - "github.com/apache/dubbo-admin/pkg/dubboctl/internal/manifest/render" - "github.com/apache/dubbo-admin/pkg/dubboctl/internal/util" + "github.com/apache/dubbo-admin/app/dubboctl/identifier" + "github.com/apache/dubbo-admin/app/dubboctl/internal/apis/dubbo.apache.org/v1alpha1" + "github.com/apache/dubbo-admin/app/dubboctl/internal/manifest" + "github.com/apache/dubbo-admin/app/dubboctl/internal/manifest/render" + "github.com/apache/dubbo-admin/app/dubboctl/internal/util" "sigs.k8s.io/yaml" ) @@ -527,7 +527,7 @@ func renderManifest(spec any, renderer render.Renderer, addOn bool, name Compone var err error if addOn { // see /deploy/addons - // values-*.yaml is the base yaml for addon component + // values-*.yaml is the base yaml for addon bootstrap valsYaml, err = manifest.ReadAndOverlayYamls([]string{ path.Join(identifier.Addons, "values-"+string(name)+".yaml"), }) @@ -566,7 +566,7 @@ func renderManifest(spec any, renderer render.Renderer, addOn bool, name Compone return final, nil } -// Hack function of grafana component. It needs external dashboard json file. +// Hack function of grafana bootstrap. It needs external dashboard json file. // We would consider design a more robust way to add dashboards files or merge these files to grafana chart. // Assume that base ends with yaml separator. func addDashboards(base string, namespace string) (string, error) { diff --git a/pkg/dubboctl/internal/operator/component_test.go b/app/dubboctl/internal/operator/component_test.go similarity index 96% rename from pkg/dubboctl/internal/operator/component_test.go rename to app/dubboctl/internal/operator/component_test.go index 743e03d64..151a4ed05 100644 --- a/pkg/dubboctl/internal/operator/component_test.go +++ b/app/dubboctl/internal/operator/component_test.go @@ -20,9 +20,9 @@ import ( "path" "testing" - "github.com/apache/dubbo-admin/pkg/dubboctl/identifier" - "github.com/apache/dubbo-admin/pkg/dubboctl/internal/apis/dubbo.apache.org/v1alpha1" - "github.com/apache/dubbo-admin/pkg/dubboctl/internal/util" + "github.com/apache/dubbo-admin/app/dubboctl/identifier" + "github.com/apache/dubbo-admin/app/dubboctl/internal/apis/dubbo.apache.org/v1alpha1" + "github.com/apache/dubbo-admin/app/dubboctl/internal/util" ) const ( diff --git a/pkg/dubboctl/internal/operator/operator.go b/app/dubboctl/internal/operator/operator.go similarity index 85% rename from pkg/dubboctl/internal/operator/operator.go rename to app/dubboctl/internal/operator/operator.go index 38ed6c99b..b77c1cf0a 100644 --- a/pkg/dubboctl/internal/operator/operator.go +++ b/app/dubboctl/internal/operator/operator.go @@ -18,13 +18,12 @@ package operator import ( "errors" "fmt" + "github.com/apache/dubbo-admin/pkg/core/logger" - "github.com/apache/dubbo-admin/pkg/logger" + "github.com/apache/dubbo-admin/app/dubboctl/internal/kube" - "github.com/apache/dubbo-admin/pkg/dubboctl/internal/kube" - - "github.com/apache/dubbo-admin/pkg/dubboctl/identifier" - "github.com/apache/dubbo-admin/pkg/dubboctl/internal/apis/dubbo.apache.org/v1alpha1" + "github.com/apache/dubbo-admin/app/dubboctl/identifier" + "github.com/apache/dubbo-admin/app/dubboctl/internal/apis/dubbo.apache.org/v1alpha1" ) type DubboOperator struct { @@ -38,14 +37,14 @@ type DubboOperator struct { func (do *DubboOperator) Run() error { for name, component := range do.components { if err := component.Run(); err != nil { - return fmt.Errorf("component %s run failed, err: %s", name, err) + return fmt.Errorf("bootstrap %s run failed, err: %s", name, err) } } do.started = true return nil } -// RenderManifest renders component manifests specified by DubboConfigSpec. +// RenderManifest renders bootstrap manifests specified by DubboConfigSpec. func (do *DubboOperator) RenderManifest() (map[ComponentName]string, error) { if !do.started { return nil, errors.New("DubboOperator is not running") @@ -54,39 +53,39 @@ func (do *DubboOperator) RenderManifest() (map[ComponentName]string, error) { for name, component := range do.components { manifest, err := component.RenderManifest() if err != nil { - return nil, fmt.Errorf("component %s RenderManifest err: %v", name, err) + return nil, fmt.Errorf("bootstrap %s RenderManifest err: %v", name, err) } res[name] = manifest } return res, nil } -// ApplyManifest apply component manifests to k8s cluster +// ApplyManifest apply bootstrap manifests to k8s cluster func (do *DubboOperator) ApplyManifest(manifestMap map[ComponentName]string) error { if do.kubeCli == nil { return errors.New("no injected k8s cli into DubboOperator") } for name, manifest := range manifestMap { - logger.CmdSugar().Infof("Start applying component %s\n", name) + logger.CmdSugar().Infof("Start applying bootstrap %s\n", name) if err := do.kubeCli.ApplyManifest(manifest, do.spec.Namespace); err != nil { - return fmt.Errorf("component %s ApplyManifest err: %v", name, err) + return fmt.Errorf("bootstrap %s ApplyManifest err: %v", name, err) } - logger.CmdSugar().Infof("Applying component %s successfully\n", name) + logger.CmdSugar().Infof("Applying bootstrap %s successfully\n", name) } return nil } -// RemoveManifest removes resources represented by component manifests +// RemoveManifest removes resources represented by bootstrap manifests func (do *DubboOperator) RemoveManifest(manifestMap map[ComponentName]string) error { if do.kubeCli == nil { return errors.New("no injected k8s cli into DubboOperator") } for name, manifest := range manifestMap { - logger.CmdSugar().Infof("Start removing component %s\n", name) + logger.CmdSugar().Infof("Start removing bootstrap %s\n", name) if err := do.kubeCli.RemoveManifest(manifest, do.spec.Namespace); err != nil { - return fmt.Errorf("component %s RemoveManifest err: %v", name, err) + return fmt.Errorf("bootstrap %s RemoveManifest err: %v", name, err) } - logger.CmdSugar().Infof("Removing component %s successfully\n", name) + logger.CmdSugar().Infof("Removing bootstrap %s successfully\n", name) } return nil } diff --git a/pkg/dubboctl/internal/operator/testdata/want/admin_component-render_manifest.golden.yaml b/app/dubboctl/internal/operator/testdata/want/admin_component-render_manifest.golden.yaml similarity index 100% rename from pkg/dubboctl/internal/operator/testdata/want/admin_component-render_manifest.golden.yaml rename to app/dubboctl/internal/operator/testdata/want/admin_component-render_manifest.golden.yaml diff --git a/pkg/dubboctl/internal/operator/testdata/want/grafana_component-render_manifest.golden.yaml b/app/dubboctl/internal/operator/testdata/want/grafana_component-render_manifest.golden.yaml similarity index 100% rename from pkg/dubboctl/internal/operator/testdata/want/grafana_component-render_manifest.golden.yaml rename to app/dubboctl/internal/operator/testdata/want/grafana_component-render_manifest.golden.yaml diff --git a/pkg/dubboctl/internal/operator/testdata/want/nacos_component-render_manifest.golden.yaml b/app/dubboctl/internal/operator/testdata/want/nacos_component-render_manifest.golden.yaml similarity index 96% rename from pkg/dubboctl/internal/operator/testdata/want/nacos_component-render_manifest.golden.yaml rename to app/dubboctl/internal/operator/testdata/want/nacos_component-render_manifest.golden.yaml index a272fbb0f..bfebf9a2d 100644 --- a/pkg/dubboctl/internal/operator/testdata/want/nacos_component-render_manifest.golden.yaml +++ b/app/dubboctl/internal/operator/testdata/want/nacos_component-render_manifest.golden.yaml @@ -41,7 +41,7 @@ spec: value: standalone - name: EMBEDDED_STORAGE value: embedded - image: nacos/nacos-server:latest + image: nacos/nacos-cp-server:latest imagePullPolicy: IfNotPresent livenessProbe: httpGet: @@ -57,7 +57,7 @@ spec: name: http protocol: TCP - containerPort: 9848 - name: client-rpc + name: clientgen-rpc - containerPort: 9849 name: raft-rpc - containerPort: 7848 @@ -103,7 +103,7 @@ spec: port: 8848 protocol: TCP targetPort: 8848 - - name: client-rpc + - name: clientgen-rpc port: 9848 targetPort: 9848 - name: raft-rpc diff --git a/pkg/dubboctl/internal/operator/testdata/want/prometheus_component-render_manifest.golden.yaml b/app/dubboctl/internal/operator/testdata/want/prometheus_component-render_manifest.golden.yaml similarity index 98% rename from pkg/dubboctl/internal/operator/testdata/want/prometheus_component-render_manifest.golden.yaml rename to app/dubboctl/internal/operator/testdata/want/prometheus_component-render_manifest.golden.yaml index fd1491a64..36a44dc1e 100644 --- a/pkg/dubboctl/internal/operator/testdata/want/prometheus_component-render_manifest.golden.yaml +++ b/app/dubboctl/internal/operator/testdata/want/prometheus_component-render_manifest.golden.yaml @@ -190,7 +190,7 @@ metadata: app.kubernetes.io/name: alertmanager app.kubernetes.io/version: v0.25.0 helm.sh/chart: alertmanager-0.24.1 - name: prometheus-alertmanager-test-connection + name: prometheus-alertmanager-test-storage namespace: dubbo-system spec: containers: @@ -803,10 +803,10 @@ metadata: labels: app: prometheus chart: prometheus-20.0.2 - component: server + component: cp-server heritage: Helm release: prometheus - name: prometheus-server + name: prometheus-cp-server namespace: dubbo-system rules: - apiGroups: @@ -846,18 +846,18 @@ metadata: labels: app: prometheus chart: prometheus-20.0.2 - component: server + component: cp-server heritage: Helm release: prometheus - name: prometheus-server + name: prometheus-cp-server namespace: dubbo-system roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole - name: prometheus-server + name: prometheus-cp-server subjects: - kind: ServiceAccount - name: prometheus-server + name: prometheus-cp-server namespace: dubbo-system --- @@ -1178,10 +1178,10 @@ metadata: labels: app: prometheus chart: prometheus-20.0.2 - component: server + component: cp-server heritage: Helm release: prometheus - name: prometheus-server + name: prometheus-cp-server namespace: dubbo-system --- @@ -1191,17 +1191,17 @@ metadata: labels: app: prometheus chart: prometheus-20.0.2 - component: server + component: cp-server heritage: Helm release: prometheus - name: prometheus-server + name: prometheus-cp-server namespace: dubbo-system spec: replicas: 1 selector: matchLabels: app: prometheus - component: server + component: cp-server release: prometheus strategy: rollingUpdate: null @@ -1211,7 +1211,7 @@ spec: labels: app: prometheus chart: prometheus-20.0.2 - component: server + component: cp-server heritage: Helm release: prometheus spec: @@ -1221,7 +1221,7 @@ spec: - --reload-url=http://127.0.0.1:9090/-/reload image: quay.io/prometheus-operator/prometheus-config-reloader:v0.63.0 imagePullPolicy: IfNotPresent - name: prometheus-server-configmap-reload + name: prometheus-cp-server-configmap-reload resources: {} volumeMounts: - mountPath: /etc/config @@ -1246,7 +1246,7 @@ spec: periodSeconds: 15 successThreshold: 1 timeoutSeconds: 10 - name: prometheus-server + name: prometheus-cp-server ports: - containerPort: 9090 readinessProbe: @@ -1273,11 +1273,11 @@ spec: runAsGroup: 65534 runAsNonRoot: true runAsUser: 65534 - serviceAccountName: prometheus-server + serviceAccountName: prometheus-cp-server terminationGracePeriodSeconds: 300 volumes: - configMap: - name: prometheus-server + name: prometheus-cp-server name: config-volume - emptyDir: {} name: storage-volume @@ -1289,10 +1289,10 @@ metadata: labels: app: prometheus chart: prometheus-20.0.2 - component: server + component: cp-server heritage: Helm release: prometheus - name: prometheus-server + name: prometheus-cp-server namespace: dubbo-system spec: ports: @@ -1302,7 +1302,7 @@ spec: targetPort: 9090 selector: app: prometheus - component: server + component: cp-server release: prometheus sessionAffinity: None type: ClusterIP @@ -1315,10 +1315,10 @@ metadata: labels: app: prometheus chart: prometheus-20.0.2 - component: server + component: cp-server heritage: Helm release: prometheus - name: prometheus-server + name: prometheus-cp-server namespace: dubbo-system --- diff --git a/pkg/dubboctl/internal/operator/testdata/want/skywalking_component-render_manifest.golden.yaml b/app/dubboctl/internal/operator/testdata/want/skywalking_component-render_manifest.golden.yaml similarity index 99% rename from pkg/dubboctl/internal/operator/testdata/want/skywalking_component-render_manifest.golden.yaml rename to app/dubboctl/internal/operator/testdata/want/skywalking_component-render_manifest.golden.yaml index 91e6af8a1..115b301f2 100644 --- a/pkg/dubboctl/internal/operator/testdata/want/skywalking_component-render_manifest.golden.yaml +++ b/app/dubboctl/internal/operator/testdata/want/skywalking_component-render_manifest.golden.yaml @@ -271,7 +271,7 @@ spec: value: xxx - name: SW_ES_PASSWORD value: xxx - image: skywalking.docker.scarf.sh/apache/skywalking-oap-server:9.3.0 + image: skywalking.docker.scarf.sh/apache/skywalking-oap-cp-server:9.3.0 imagePullPolicy: IfNotPresent name: oap volumeMounts: null @@ -334,7 +334,7 @@ spec: - name: SW_CLUSTER_K8S_NAMESPACE value: dubbo-system - name: SW_CLUSTER_K8S_LABEL - value: app=skywalking,release=skywalking,component=oap + value: app=skywalking,release=skywalking,bootstrap=oap - name: SKYWALKING_COLLECTOR_UID valueFrom: fieldRef: @@ -347,7 +347,7 @@ spec: value: xxx - name: SW_ES_PASSWORD value: xxx - image: skywalking.docker.scarf.sh/apache/skywalking-oap-server:9.3.0 + image: skywalking.docker.scarf.sh/apache/skywalking-oap-cp-server:9.3.0 imagePullPolicy: IfNotPresent livenessProbe: initialDelaySeconds: 15 diff --git a/pkg/dubboctl/internal/operator/testdata/want/zipkin_component-render_manifest.golden.yaml b/app/dubboctl/internal/operator/testdata/want/zipkin_component-render_manifest.golden.yaml similarity index 100% rename from pkg/dubboctl/internal/operator/testdata/want/zipkin_component-render_manifest.golden.yaml rename to app/dubboctl/internal/operator/testdata/want/zipkin_component-render_manifest.golden.yaml diff --git a/pkg/dubboctl/internal/operator/testdata/want/zookeeper_component-render_manifest.golden.yaml b/app/dubboctl/internal/operator/testdata/want/zookeeper_component-render_manifest.golden.yaml similarity index 98% rename from pkg/dubboctl/internal/operator/testdata/want/zookeeper_component-render_manifest.golden.yaml rename to app/dubboctl/internal/operator/testdata/want/zookeeper_component-render_manifest.golden.yaml index da736dd52..7741348a9 100644 --- a/pkg/dubboctl/internal/operator/testdata/want/zookeeper_component-render_manifest.golden.yaml +++ b/app/dubboctl/internal/operator/testdata/want/zookeeper_component-render_manifest.golden.yaml @@ -156,7 +156,7 @@ spec: name: zookeeper ports: - containerPort: 2181 - name: client + name: clientgen - containerPort: 2888 name: follower - containerPort: 3888 @@ -217,9 +217,9 @@ metadata: spec: clusterIP: None ports: - - name: tcp-client + - name: tcp-clientgen port: 2181 - targetPort: client + targetPort: clientgen - name: tcp-follower port: 2888 targetPort: follower @@ -247,10 +247,10 @@ metadata: namespace: dubbo-system spec: ports: - - name: tcp-client + - name: tcp-clientgen nodePort: null port: 2181 - targetPort: client + targetPort: clientgen - name: tcp-follower port: 2888 targetPort: follower diff --git a/pkg/dubboctl/internal/util/filter.go b/app/dubboctl/internal/util/filter.go similarity index 100% rename from pkg/dubboctl/internal/util/filter.go rename to app/dubboctl/internal/util/filter.go diff --git a/pkg/dubboctl/internal/util/filter_test.go b/app/dubboctl/internal/util/filter_test.go similarity index 100% rename from pkg/dubboctl/internal/util/filter_test.go rename to app/dubboctl/internal/util/filter_test.go diff --git a/pkg/dubboctl/internal/util/golden.go b/app/dubboctl/internal/util/golden.go similarity index 100% rename from pkg/dubboctl/internal/util/golden.go rename to app/dubboctl/internal/util/golden.go diff --git a/pkg/dubboctl/internal/util/golden_test.go b/app/dubboctl/internal/util/golden_test.go similarity index 100% rename from pkg/dubboctl/internal/util/golden_test.go rename to app/dubboctl/internal/util/golden_test.go diff --git a/pkg/dubboctl/internal/util/path.go b/app/dubboctl/internal/util/path.go similarity index 100% rename from pkg/dubboctl/internal/util/path.go rename to app/dubboctl/internal/util/path.go diff --git a/pkg/dubboctl/internal/util/reflect.go b/app/dubboctl/internal/util/reflect.go similarity index 100% rename from pkg/dubboctl/internal/util/reflect.go rename to app/dubboctl/internal/util/reflect.go diff --git a/pkg/dubboctl/internal/util/yaml.go b/app/dubboctl/internal/util/yaml.go similarity index 100% rename from pkg/dubboctl/internal/util/yaml.go rename to app/dubboctl/internal/util/yaml.go diff --git a/pkg/dubboctl/internal/util/yaml_test.go b/app/dubboctl/internal/util/yaml_test.go similarity index 100% rename from pkg/dubboctl/internal/util/yaml_test.go rename to app/dubboctl/internal/util/yaml_test.go diff --git a/cmd/dubboctl/main.go b/app/dubboctl/main.go similarity index 94% rename from cmd/dubboctl/main.go rename to app/dubboctl/main.go index 0df39add4..ab1bfd624 100644 --- a/cmd/dubboctl/main.go +++ b/app/dubboctl/main.go @@ -20,7 +20,7 @@ package main import ( "os" - "github.com/apache/dubbo-admin/pkg/dubboctl/cmd" + "github.com/apache/dubbo-admin/app/dubboctl/cmd" ) func main() { diff --git a/cmd/admin/cmd/auth.go b/cmd/admin/cmd/auth.go deleted file mode 100755 index 0ac2af1f0..000000000 --- a/cmd/admin/cmd/auth.go +++ /dev/null @@ -1,33 +0,0 @@ -package cmd - -import ( - "github.com/apache/dubbo-admin/pkg/core/cmd" - "github.com/apache/dubbo-admin/pkg/logger" - - "github.com/spf13/cobra" -) - -func newAuthCmdWithOpts(opts cmd.RunCmdOpts) *cobra.Command { - args := struct { - configPath string - }{} - - cmd := &cobra.Command{ - Use: "auth", - Short: "Launch Dubbo Admin auth server.", - Long: `Launch Dubbo Admin auth server.`, - RunE: func(cmd *cobra.Command, _ []string) error { - // start CA - if err := startCA(cmd); err != nil { - logger.Error("Failed to start auth server.") - return err - } - return nil - }, - } - - // flags - cmd.PersistentFlags().StringVarP(&args.configPath, "config-file", "c", "", "configuration file") - - return cmd -} diff --git a/cmd/admin/cmd/console.go b/cmd/admin/cmd/console.go deleted file mode 100755 index f41594d64..000000000 --- a/cmd/admin/cmd/console.go +++ /dev/null @@ -1,33 +0,0 @@ -package cmd - -import ( - "github.com/apache/dubbo-admin/pkg/core/cmd" - "github.com/apache/dubbo-admin/pkg/logger" - - "github.com/spf13/cobra" -) - -func newConsoleCmdWithOpts(opts cmd.RunCmdOpts) *cobra.Command { - args := struct { - configPath string - }{} - - cmd := &cobra.Command{ - Use: "auth", - Short: "Launch Dubbo Admin console server.", - Long: `Launch Dubbo Admin console server.`, - RunE: func(cmd *cobra.Command, _ []string) error { - // start CA - if err := startCA(cmd); err != nil { - logger.Error("Failed to start auth server.") - return err - } - return nil - }, - } - - // flags - cmd.PersistentFlags().StringVarP(&args.configPath, "config-file", "c", "", "configuration file") - - return cmd -} diff --git a/cmd/admin/cmd/run.go b/cmd/admin/cmd/run.go deleted file mode 100755 index b12a1b6cd..000000000 --- a/cmd/admin/cmd/run.go +++ /dev/null @@ -1,93 +0,0 @@ -package cmd - -import ( - "github.com/apache/dubbo-admin/pkg/admin/config" - "github.com/apache/dubbo-admin/pkg/admin/constant" - "github.com/apache/dubbo-admin/pkg/admin/providers/mock" - "github.com/apache/dubbo-admin/pkg/admin/router" - "github.com/apache/dubbo-admin/pkg/admin/services" - "github.com/apache/dubbo-admin/pkg/authority" - "github.com/apache/dubbo-admin/pkg/core/cmd" - "github.com/apache/dubbo-admin/pkg/logger" - - caconfig "github.com/apache/dubbo-admin/pkg/authority/config" - - "os" - "time" - - "github.com/spf13/cobra" -) - -const gracefullyShutdownDuration = 3 * time.Second - -// This is the open file limit below which the control plane may not -// reasonably have enough descriptors to accept all its clients. -const minOpenFileLimit = 4096 - -func newRunCmdWithOpts(opts cmd.RunCmdOpts) *cobra.Command { - args := struct { - configPath string - }{} - cmd := &cobra.Command{ - Use: "run", - Short: "Launch Dubbo Admin", - Long: `Launch Dubbo Admin.`, - RunE: func(cmd *cobra.Command, _ []string) error { - // init config - config.LoadConfig() - - // subscribe to registries - go services.StartSubscribe(config.RegistryCenter) - defer func() { - services.DestroySubscribe(config.RegistryCenter) - }() - - // start mock server - os.Setenv(constant.ConfigFileEnvKey, config.MockProviderConf) - go mock.RunMockServiceServer() - - // start console server - router := router.InitRouter() - if err := router.Run(":38080"); err != nil { - logger.Error("Failed to start Admin console server.") - return err - } - - // start CA - if err := startCA(cmd); err != nil { - logger.Error("Failed to start CA server.") - return err - } - - // start - - return nil - }, - } - - // flags - cmd.PersistentFlags().StringVarP(&args.configPath, "config-file", "c", "", "configuration file") - - return cmd -} - -func startCA(cmd *cobra.Command) error { - options := caconfig.NewOptions() - - if err := authority.Initialize(cmd); err != nil { - logger.Fatal("Failed to initialize CA server.") - return err - } - - logger.Infof("Authority command Run with options: %+v", options) - if errs := options.Validate(); len(errs) != 0 { - logger.Fatal(errs) - return errs[0] - } - - if err := authority.Run(options); err != nil { - logger.Fatal(err) - return err - } - return nil -} diff --git a/cmd/authority/app/authority.go b/cmd/authority/app/authority.go deleted file mode 100644 index 922cba1b3..000000000 --- a/cmd/authority/app/authority.go +++ /dev/null @@ -1,58 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one or more -// contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. -// The ASF licenses this file to You under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with -// the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package app - -import ( - "flag" - "github.com/apache/dubbo-admin/pkg/authority" - "github.com/apache/dubbo-admin/pkg/authority/config" - "github.com/apache/dubbo-admin/pkg/logger" - "github.com/spf13/cobra" -) - -func NewAppCommand() *cobra.Command { - options := config.NewOptions() - - cmd := &cobra.Command{ - Use: "authority", - Long: `The authority app is responsible for controllers in dubbo authority`, - PersistentPreRunE: func(cmd *cobra.Command, args []string) error { - logger.Infof("Authority command PersistentPreRun") - if err := authority.Initialize(cmd); err != nil { - logger.Fatal("Failed to initialize CA server.") - return err - } - return nil - }, - RunE: func(cmd *cobra.Command, args []string) error { - logger.Infof("Authority command Run with options: %+v", options) - if errs := options.Validate(); len(errs) != 0 { - logger.Fatal(errs) - return errs[0] - } - - if err := authority.Run(options); err != nil { - logger.Fatal(err) - return err - } - return nil - }, - } - - cmd.Flags().AddGoFlagSet(flag.CommandLine) - options.FillFlags(cmd.Flags()) - return cmd -} diff --git a/cmd/mapping/app/mapping.go b/cmd/mapping/app/mapping.go deleted file mode 100644 index 73319e90f..000000000 --- a/cmd/mapping/app/mapping.go +++ /dev/null @@ -1,91 +0,0 @@ -/* -Licensed to the Apache Software Foundation (ASF) under one or more -contributor license agreements. See the NOTICE file distributed with -this work for additional information regarding copyright ownership. -The ASF licenses this file to You under the Apache License, Version 2.0 -(the "License"); you may not use this file except in compliance with -the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package app - -import ( - "flag" - "fmt" - "github.com/apache/dubbo-admin/pkg/logger" - "github.com/apache/dubbo-admin/pkg/mapping/bootstrap" - "github.com/apache/dubbo-admin/pkg/mapping/config" - "github.com/spf13/cobra" - "github.com/spf13/pflag" - "github.com/spf13/viper" - "os" - "os/signal" - "strings" - "syscall" -) - -var ( - replaceWithCamelCase = false -) - -func Flags(cmd *cobra.Command, v *viper.Viper) { - cmd.Flags().VisitAll(func(f *pflag.Flag) { - configName := f.Name - if replaceWithCamelCase { - configName = strings.ReplaceAll(f.Name, "-", "") - } - if !f.Changed && v.IsSet(configName) { - val := v.Get(configName) - cmd.Flags().Set(f.Name, fmt.Sprintf("%v", val)) - } - }) -} - -func initial(cmd *cobra.Command) error { - v := viper.New() - v.SetEnvKeyReplacer(strings.NewReplacer("-", "_")) - v.AutomaticEnv() - Flags(cmd, v) - return nil -} - -func Command() *cobra.Command { - options := config.NewOptions() - cmd := &cobra.Command{ - Use: "ServiceMapping", - PersistentPreRun: func(cmd *cobra.Command, args []string) { - logger.Infof("PreRun Service Mapping") - initial(cmd) - }, - Run: func(cmd *cobra.Command, args []string) { - logger.Infof("Run Service Mapping %+v", options) - if err := Run(options); err != nil { - logger.Fatal(err) - } - }, - } - cmd.Flags().AddGoFlagSet(flag.CommandLine) - options.FillFlags(cmd.Flags()) - return cmd -} - -func Run(option *config.Options) error { - s := bootstrap.NewServer(option) - - s.Init() - s.Start() - - c := make(chan os.Signal, 1) - signal.Notify(c, syscall.SIGINT, syscall.SIGTERM) - signal.Notify(s.StopChan, syscall.SIGINT, syscall.SIGTERM) - <-c - return nil -} diff --git a/cmd/mapping/main.go b/cmd/mapping/main.go deleted file mode 100644 index 3b652e73c..000000000 --- a/cmd/mapping/main.go +++ /dev/null @@ -1,31 +0,0 @@ -/* -Licensed to the Apache Software Foundation (ASF) under one or more -contributor license agreements. See the NOTICE file distributed with -this work for additional information regarding copyright ownership. -The ASF licenses this file to You under the Apache License, Version 2.0 -(the "License"); you may not use this file except in compliance with -the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package main - -import ( - "github.com/apache/dubbo-admin/cmd/mapping/app" - "github.com/apache/dubbo-admin/pkg/logger" - "os" -) - -func main() { - logger.Init() - if err := app.Command().Execute(); err != nil { - os.Exit(1) - } -} diff --git a/conf/admin.yml b/conf/admin.yml index 8df11f61c..682fb3a67 100644 --- a/conf/admin.yml +++ b/conf/admin.yml @@ -14,9 +14,14 @@ # limitations under the License. admin: - registry: - address: zookeeper://127.0.0.1:2181 + admin-port: 38080 config-center: zookeeper://127.0.0.1:2181 metadata-report: address: zookeeper://127.0.0.1:2181 - # mysql-dsn: root:password@tcp(127.0.0.1:3306)/dubbo-admin?charset=utf8&parseTime=true \ No newline at end of file + registry: + address: zookeeper://127.0.0.1:2181 + prometheus: + ip: 127.0.0.1 + port: 9090 + monitor-port: 22222 + #mysql-dsn: root:password@tcp(127.0.0.1:3306)/dubbo-admin?charset=utf8&parseTime=true \ No newline at end of file diff --git a/deploy/addons/env.sh b/deploy/addons/env.sh old mode 100755 new mode 100644 diff --git a/deploy/addons/values-skywalking.yaml b/deploy/addons/values-skywalking.yaml index 4aedc5f30..8b2b89662 100644 --- a/deploy/addons/values-skywalking.yaml +++ b/deploy/addons/values-skywalking.yaml @@ -15,7 +15,7 @@ oap: image: - repository: skywalking.docker.scarf.sh/apache/skywalking-oap-server + repository: skywalking.docker.scarf.sh/apache/skywalking-oap-cp-server tag: 9.3.0 storageType: elasticsearch ui: diff --git a/deploy/charts/dubbo-admin/values.yaml b/deploy/charts/dubbo-admin/values.yaml index df84169d8..4eb55fd62 100644 --- a/deploy/charts/dubbo-admin/values.yaml +++ b/deploy/charts/dubbo-admin/values.yaml @@ -160,16 +160,16 @@ check: ## check signSecret signSecret: ~ -## server.compression configuration +## cp-server.compression configuration server: compression: - ## server compression enabled + ## cp-server compression enabled enabled: true - ## server compression mime-types + ## cp-server compression mime-types types: text/css,text/javascript,application/javascript - ## server compression min-response-size + ## cp-server compression min-response-size size: 10240 ## Spring datasource configuration @@ -478,9 +478,9 @@ networkPolicy: ## @param networkPolicy.enabled Enable creation of NetworkPolicy resources. Only Ingress traffic is filtered for now. ## enabled: false - ## @param networkPolicy.allowExternal Don't require client label for connections + ## @param networkPolicy.allowExternal Don't require clientgen label for connections ## The Policy model to apply. When set to false, only pods with the correct - ## client label will have network access to dubbo-admin port defined. + ## clientgen label will have network access to dubbo-admin port defined. ## When true, dubbo-admin will accept connections from any source ## (with the correct destination port). ## diff --git a/deploy/charts/nacos/templates/statefulset.yaml b/deploy/charts/nacos/templates/statefulset.yaml index 53625ad36..95e27faa4 100644 --- a/deploy/charts/nacos/templates/statefulset.yaml +++ b/deploy/charts/nacos/templates/statefulset.yaml @@ -79,7 +79,7 @@ spec: containerPort: {{ .Values.service.port }} protocol: TCP - containerPort: {{ add .Values.service.port 1000 }} - name: client-rpc + name: clientgen-rpc - containerPort: {{ add .Values.service.port 1001 }} name: raft-rpc - containerPort: 7848 diff --git a/deploy/charts/nacos/templates/svc-headless.yaml b/deploy/charts/nacos/templates/svc-headless.yaml index 4f38db4c3..831617f74 100644 --- a/deploy/charts/nacos/templates/svc-headless.yaml +++ b/deploy/charts/nacos/templates/svc-headless.yaml @@ -28,7 +28,7 @@ spec: protocol: TCP name: http - port: {{ add .Values.service.port 1000 }} - name: client-rpc + name: clientgen-rpc targetPort: {{ add .Values.service.port 1000 }} - port: {{ add .Values.service.port 1001 }} name: raft-rpc diff --git a/deploy/charts/nacos/templates/svc.yaml b/deploy/charts/nacos/templates/svc.yaml index a939daaf3..f54e1a817 100644 --- a/deploy/charts/nacos/templates/svc.yaml +++ b/deploy/charts/nacos/templates/svc.yaml @@ -27,7 +27,7 @@ spec: protocol: TCP name: http - port: {{ add .Values.service.port 1000 }} - name: client-rpc + name: clientgen-rpc targetPort: {{add .Values.service.port 1000 }} - port: {{add .Values.service.port 1001 }} name: raft-rpc diff --git a/deploy/charts/nacos/values.yaml b/deploy/charts/nacos/values.yaml index f0437d328..ee798bc58 100644 --- a/deploy/charts/nacos/values.yaml +++ b/deploy/charts/nacos/values.yaml @@ -20,7 +20,7 @@ global: image: registry: docker.io # e.g registry.k8s.io - repository: nacos/nacos-server + repository: nacos/nacos-cp-server tag: latest pullPolicy: IfNotPresent @@ -154,9 +154,9 @@ networkPolicy: ## @param networkPolicy.enabled Enable creation of NetworkPolicy resources. Only Ingress traffic is filtered for now. ## enabled: false - ## @param networkPolicy.allowExternal Don't require client label for connections + ## @param networkPolicy.allowExternal Don't require clientgen label for connections ## The Policy model to apply. When set to false, only pods with the correct - ## client label will have network access to dubbo-admin port defined. + ## clientgen label will have network access to dubbo-admin port defined. ## When true, dubbo-admin will accept connections from any source ## (with the correct destination port). ## diff --git a/deploy/crd.yaml b/deploy/crd.yaml index 0228f0a82..072a1a555 100644 --- a/deploy/crd.yaml +++ b/deploy/crd.yaml @@ -337,3 +337,451 @@ spec: kind: AuthorizationPolicy shortNames: - az + +--- + +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: servicenamemappings.dubbo.apache.org +spec: + group: dubbo.apache.org + versions: + - name: v1alpha1 + served: true + storage: true + schema: + openAPIV3Schema: + properties: + spec: + description: + 'Spec defines the behavior of a service mapping. + https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status' + properties: + applicationNames: + items: + type: string + type: array + interfaceName: + type: string + type: object + type: object + scope: Namespaced + names: + plural: servicenamemappings + singular: servicenamemapping + kind: ServiceNameMapping + shortNames: + - snp + +--- + +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.11.3 + creationTimestamp: null + name: conditionroutes.dubbo.apache.org +spec: + group: dubbo.apache.org + names: + kind: ConditionRoute + listKind: ConditionRouteList + plural: conditionroutes + shortNames: + - cd + singular: conditionroute + scope: Namespaced + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + description: ConditionRoute is the Schema for the conditionroutes API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the clientgen + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: ConditionRouteSpec defines the desired state of ConditionRoute + properties: + conditions: + description: The condition routing rule definition of this configuration. + Check Condition for details + items: + type: string + type: array + configVersion: + description: The version of the condition rule definition, currently + available version is v3.0 + enum: + - v3.0 + type: string + enabled: + default: true + description: Whether enable this rule or not, set enabled:false to + disable this rule. + type: boolean + force: + description: The behaviour when the instance subset is empty after + after routing. true means return no provider exception while false + means ignore this rule. + type: boolean + key: + description: The identifier of the target service or application that + this rule is about to apply to. If scope:serviceis set, then keyshould + be specified as the Dubbo service key that this rule targets to + control. If scope:application is set, then keyshould be specified + as the name of the application that this rule targets to control, + application should always be a Dubbo Consumer. + type: string + priority: + type: integer + runtime: + description: Whether run routing rule for every rpc invocation or + use routing cache if available. + type: boolean + scope: + description: Supports service and application scope rules. + enum: + - service + - application + type: string + required: + - conditions + - configVersion + - enabled + - key + - scope + type: object + type: object + served: true + storage: true +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.11.3 + creationTimestamp: null + name: dynamicconfigs.dubbo.apache.org +spec: + group: dubbo.apache.org + names: + kind: DynamicConfig + listKind: DynamicConfigList + plural: dynamicconfigs + shortNames: + - dc + singular: dynamicconfig + scope: Namespaced + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + description: DynamicConfig is the Schema for the dynamicconfigs API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the clientgen + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: DynamicConfigSpec defines the desired state of DynamicConfig + properties: + configVersion: + description: The version of the tag rule definition, currently available + version is v3.0 + enum: + - v3.0 + type: string + configs: + description: The match condition and configuration of this rule. + items: + properties: + addresses: + description: replaced with address in MatchCondition + items: + type: string + type: array + applications: + description: replaced with application in MatchCondition + items: + type: string + type: array + enabled: + type: boolean + match: + description: A set of criterion to be met in order for the rule/config + to be applied to the Dubbo instance. + properties: + address: + description: 'The instance address matching condition for + this config rule to take effect. xact: “value” for exact + string match prefix: “value” for prefix-based match regex: + “value” for RE2 style regex-based match (https://github.com/google/re2/wiki/Syntax)).' + properties: + cird: + type: string + exact: + type: string + wildcard: + type: string + type: object + application: + description: "The application matching condition for this + config rule to take effect. Effective when scope: service + is set. \n exact: “value” for exact string match prefix: + “value” for prefix-based match regex: “value” for RE2 + style regex-based match (https://github.com/google/re2/wiki/Syntax))." + properties: + oneof: + items: + properties: + empty: + type: string + exact: + type: string + noempty: + type: string + prefix: + type: string + regex: + type: string + wildcard: + type: string + type: object + type: array + type: object + param: + description: The Dubbo url keys and values matching condition + for this config rule to take effect. + items: + properties: + key: + description: The name of the key in the Dubbo url + address. + type: string + value: + description: The matching condition for the value + in the Dubbo url address. + properties: + empty: + type: string + exact: + type: string + noempty: + type: string + prefix: + type: string + regex: + type: string + wildcard: + type: string + type: object + type: object + type: array + service: + description: 'The service matching condition for this config + rule to take effect. Effective when scope: application + is set. exact: “value” for exact string match prefix: + “value” for prefix-based match regex: “value” for RE2 + style regex-based match (https://github.com/google/re2/wiki/Syntax)).' + properties: + oneof: + items: + properties: + empty: + type: string + exact: + type: string + noempty: + type: string + prefix: + type: string + regex: + type: string + wildcard: + type: string + type: object + type: array + type: object + type: object + parameters: + additionalProperties: + type: string + type: object + providerAddresses: + description: not supported anymore + items: + type: string + type: array + services: + description: replaced with service in MatchCondition + items: + type: string + type: array + side: + description: 'Especially useful when scope:service is set. side: + providermeans this Config will only take effect on the provider + instances of the service key. side: consumermeans this Config + will only take effect on the consumer instances of the service + key' + type: string + type: + type: string + type: object + type: array + enabled: + default: true + description: Whether enable this rule or not, set enabled:false to + disable this rule. + type: boolean + key: + description: The identifier of the target service or application that + this rule is about to apply to. If scope:serviceis set, then keyshould + be specified as the Dubbo service key that this rule targets to + control. If scope:application is set, then keyshould be specified + as the name of the application that this rule targets to control, + application should always be a Dubbo Consumer. + type: string + scope: + description: Supports service and application scope rules. + enum: + - service + - application + type: string + type: object + type: object + served: true + storage: true +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.11.3 + creationTimestamp: null + name: tagroutes.dubbo.apache.org +spec: + group: dubbo.apache.org + names: + kind: TagRoute + listKind: TagRouteList + plural: tagroutes + shortNames: + - tg + singular: tagroute + scope: Namespaced + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + description: TagRoute is the Schema for the tagroutes API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the clientgen + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: TagRouteSpec defines the desired state of TagRoute + properties: + configVersion: + description: The version of the tag rule definition, currently available + version is v3.0 + enum: + - v3.0 + type: string + enabled: + default: true + description: Whether enable this rule or not, set enabled:false to + disable this rule. + type: boolean + force: + default: true + description: The behaviour when the instance subset is empty after + after routing. true means return no provider exception while false + means ignore this rule. + type: boolean + key: + description: The identifier of the target application that this rule + is about to control + type: string + priority: + maximum: 2147483647 + minimum: -2147483648 + type: integer + runtime: + default: true + description: Whether run routing rule for every rpc invocation or + use routing cache if available. + type: boolean + tags: + description: The tag definition of this rule. + items: + properties: + addresses: + items: + type: string + type: array + match: + description: A set of criterion to be met for instances to be + classified as member of this tag. + items: + properties: + key: + description: The name of the key in the Dubbo url address. + type: string + value: + description: The matching condition for the value in the + Dubbo url address. + properties: + empty: + type: string + exact: + type: string + noempty: + type: string + prefix: + type: string + regex: + type: string + wildcard: + type: string + type: object + type: object + type: array + name: + description: The name of the tag used to match the dubbo.tag + value in the request context. + type: string + type: object + type: array + type: object + type: object + served: true + storage: true diff --git a/deploy/example-traffic.yaml b/deploy/example-traffic.yaml new file mode 100644 index 000000000..f26be9b07 --- /dev/null +++ b/deploy/example-traffic.yaml @@ -0,0 +1,68 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: dubbo.apache.org/v1beta1 +kind: ConditionRoute +metadata: + namespace: dubbo-demo + name: conditionroute-sample +spec: + configVersion: v3.0 + force: true + scope: service + runtime: true + enabled: true + key: org.apache.dubbo.samples.CommentService + conditions: + - method=getComment => region=Hangzhou + +--- + +apiVersion: dubbo.apache.org/v1beta1 +kind: DynamicConfig +metadata: + name: dynamicconfig-sample + namespace: dubbo-demo +spec: + configVersion: v3.0 + scope: service + key: org.apache.dubbo.samples.UserService + configs: + - match: + application: + oneof: + - exact: shop-frontend + side: consumer + parameters: + retries: '4' + +--- + +apiVersion: dubbo.apache.org/v1beta1 +kind: TagRoute +metadata: + namespace: dubbo-demo + name: tagroute-sample +spec: + configVersion: v3.0 + force: true + enabled: true + key: shop-details + tags: + - name: gray + match: + - key: env + value: + exact: gray diff --git a/deploy/kubernetes/prometheus.yaml b/deploy/kubernetes/prometheus.yaml index 88c74e588..10dd0d52e 100644 --- a/deploy/kubernetes/prometheus.yaml +++ b/deploy/kubernetes/prometheus.yaml @@ -19,12 +19,12 @@ apiVersion: v1 kind: ServiceAccount metadata: labels: - component: "server" + component: "cp-server" app: prometheus release: prometheus chart: prometheus-20.0.2 heritage: Helm - name: prometheus-server + name: prometheus-cp-server namespace: dubbo-system annotations: {} @@ -34,12 +34,12 @@ apiVersion: v1 kind: ConfigMap metadata: labels: - component: "server" + component: "cp-server" app: prometheus release: prometheus chart: prometheus-20.0.2 heritage: Helm - name: prometheus-server + name: prometheus-cp-server namespace: dubbo-system data: allow-snippet-annotations: "false" @@ -359,12 +359,12 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: labels: - component: "server" + component: "cp-server" app: prometheus release: prometheus chart: prometheus-20.0.2 heritage: Helm - name: prometheus-server + name: prometheus-cp-server rules: - apiGroups: - "" @@ -401,32 +401,32 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: labels: - component: "server" + component: "cp-server" app: prometheus release: prometheus chart: prometheus-20.0.2 heritage: Helm - name: prometheus-server + name: prometheus-cp-server subjects: - kind: ServiceAccount - name: prometheus-server + name: prometheus-cp-server namespace: dubbo-system roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole - name: prometheus-server + name: prometheus-cp-server --- # Source: prometheus/templates/service.yaml apiVersion: v1 kind: Service metadata: labels: - component: "server" + component: "cp-server" app: prometheus release: prometheus chart: prometheus-20.0.2 heritage: Helm - name: prometheus-server + name: prometheus-cp-server namespace: dubbo-system spec: ports: @@ -435,7 +435,7 @@ spec: protocol: TCP targetPort: 9090 selector: - component: "server" + component: "cp-server" app: prometheus release: prometheus sessionAffinity: None @@ -446,17 +446,17 @@ apiVersion: apps/v1 kind: Deployment metadata: labels: - component: "server" + component: "cp-server" app: prometheus release: prometheus chart: prometheus-20.0.2 heritage: Helm - name: prometheus-server + name: prometheus-cp-server namespace: dubbo-system spec: selector: matchLabels: - component: "server" + component: "cp-server" app: prometheus release: prometheus replicas: 1 @@ -466,16 +466,16 @@ spec: template: metadata: labels: - component: "server" + component: "cp-server" app: prometheus release: prometheus chart: prometheus-20.0.2 heritage: Helm spec: enableServiceLinks: true - serviceAccountName: prometheus-server + serviceAccountName: prometheus-cp-server containers: - - name: prometheus-server-configmap-reload + - name: prometheus-cp-server-configmap-reload image: "quay.io/prometheus-operator/prometheus-config-reloader:v0.63.0" imagePullPolicy: "IfNotPresent" args: @@ -488,7 +488,7 @@ spec: mountPath: /etc/config readOnly: true - - name: prometheus-server + - name: prometheus-cp-server image: "quay.io/prometheus/prometheus:v2.43.0" imagePullPolicy: "IfNotPresent" args: @@ -538,7 +538,7 @@ spec: volumes: - name: config-volume configMap: - name: prometheus-server + name: prometheus-cp-server - name: storage-volume emptyDir: {} diff --git a/deploy/kubernetes/skywalking.yaml b/deploy/kubernetes/skywalking.yaml index c4c7c7aae..e600ebaeb 100644 --- a/deploy/kubernetes/skywalking.yaml +++ b/deploy/kubernetes/skywalking.yaml @@ -223,7 +223,7 @@ spec: command: ['sh', '-c', 'for i in $(seq 1 60); do nc -z -w3 elasticsearch 9200 && exit 0 || sleep 5; done; exit 1'] containers: - name: oap - image: skywalking.docker.scarf.sh/apache/skywalking-oap-server:9.3.0 + image: skywalking.docker.scarf.sh/apache/skywalking-oap-cp-server:9.3.0 imagePullPolicy: IfNotPresent livenessProbe: tcpSocket: @@ -248,7 +248,7 @@ spec: - name: SW_CLUSTER_K8S_NAMESPACE value: "dubbo-system" - name: SW_CLUSTER_K8S_LABEL - value: "app=skywalking,release=skywalking,component=oap" + value: "app=skywalking,release=skywalking,bootstrap=oap" - name: SKYWALKING_COLLECTOR_UID valueFrom: fieldRef: @@ -363,7 +363,7 @@ spec: command: ['sh', '-c', 'for i in $(seq 1 60); do nc -z -w3 elasticsearch 9200 && exit 0 || sleep 5; done; exit 1'] containers: - name: oap - image: skywalking.docker.scarf.sh/apache/skywalking-oap-server:9.3.0 + image: skywalking.docker.scarf.sh/apache/skywalking-oap-cp-server:9.3.0 imagePullPolicy: IfNotPresent env: - name: JAVA_OPTS diff --git a/deploy/kubernetes/zookeeper.yaml b/deploy/kubernetes/zookeeper.yaml index aa6d232d6..0ada68644 100644 --- a/deploy/kubernetes/zookeeper.yaml +++ b/deploy/kubernetes/zookeeper.yaml @@ -66,9 +66,9 @@ spec: clusterIP: None publishNotReadyAddresses: true ports: - - name: tcp-client + - name: tcp-clientgen port: 2181 - targetPort: client + targetPort: clientgen - name: tcp-follower port: 2888 targetPort: follower @@ -96,9 +96,9 @@ spec: type: ClusterIP sessionAffinity: None ports: - - name: tcp-client + - name: tcp-clientgen port: 2181 - targetPort: client + targetPort: clientgen nodePort: null - name: tcp-follower port: 2888 @@ -228,7 +228,7 @@ spec: apiVersion: v1 fieldPath: metadata.name ports: - - name: client + - name: clientgen containerPort: 2181 - name: follower containerPort: 2888 diff --git a/deploy/manifests/dubbo.apache.org_authenticationpolicies.yaml b/deploy/manifests/dubbo.apache.org_authenticationpolicies.yaml index 9016a0444..95372aea6 100644 --- a/deploy/manifests/dubbo.apache.org_authenticationpolicies.yaml +++ b/deploy/manifests/dubbo.apache.org_authenticationpolicies.yaml @@ -42,7 +42,7 @@ spec: type: string kind: description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client + object represents. Servers may infer this from the endpoint the clientgen submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string metadata: diff --git a/deploy/manifests/dubbo.apache.org_authorizationpolicies.yaml b/deploy/manifests/dubbo.apache.org_authorizationpolicies.yaml index e66ef0741..0d835cfd5 100644 --- a/deploy/manifests/dubbo.apache.org_authorizationpolicies.yaml +++ b/deploy/manifests/dubbo.apache.org_authorizationpolicies.yaml @@ -42,7 +42,7 @@ spec: type: string kind: description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client + object represents. Servers may infer this from the endpoint the clientgen submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string metadata: diff --git a/pkg/traffic/config/crd/bases/traffic.dubbo.apache.org_conditionroutes.yaml b/deploy/manifests/dubbo.apache.org_conditionroutes.yaml similarity index 51% rename from pkg/traffic/config/crd/bases/traffic.dubbo.apache.org_conditionroutes.yaml rename to deploy/manifests/dubbo.apache.org_conditionroutes.yaml index 9624913d6..22e1fba13 100644 --- a/pkg/traffic/config/crd/bases/traffic.dubbo.apache.org_conditionroutes.yaml +++ b/deploy/manifests/dubbo.apache.org_conditionroutes.yaml @@ -19,17 +19,19 @@ metadata: annotations: controller-gen.kubebuilder.io/version: v0.11.3 creationTimestamp: null - name: conditionroutes.traffic.dubbo.apache.org + name: conditionroutes.dubbo.apache.org spec: - group: traffic.dubbo.apache.org + group: dubbo.apache.org names: kind: ConditionRoute listKind: ConditionRouteList plural: conditionroutes + shortNames: + - cd singular: conditionroute scope: Namespaced versions: - - name: v1 + - name: v1beta1 schema: openAPIV3Schema: description: ConditionRoute is the Schema for the conditionroutes API @@ -41,7 +43,7 @@ spec: type: string kind: description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client + object represents. Servers may infer this from the endpoint the clientgen submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string metadata: @@ -49,16 +51,55 @@ spec: spec: description: ConditionRouteSpec defines the desired state of ConditionRoute properties: - foo: - description: Foo is an example field of ConditionRoute. Edit conditionroute_types.go - to remove/update + conditions: + description: The condition routing rule definition of this configuration. + Check Condition for details + items: + type: string + type: array + configVersion: + description: The version of the condition rule definition, currently + available version is v3.0 + enum: + - v3.0 type: string - type: object - status: - description: ConditionRouteStatus defines the observed state of ConditionRoute + enabled: + default: true + description: Whether enable this rule or not, set enabled:false to + disable this rule. + type: boolean + force: + description: The behaviour when the instance subset is empty after + after routing. true means return no provider exception while false + means ignore this rule. + type: boolean + key: + description: The identifier of the target service or application that + this rule is about to apply to. If scope:serviceis set, then keyshould + be specified as the Dubbo service key that this rule targets to + control. If scope:application is set, then keyshould be specified + as the name of the application that this rule targets to control, + application should always be a Dubbo Consumer. + type: string + priority: + type: integer + runtime: + description: Whether run routing rule for every rpc invocation or + use routing cache if available. + type: boolean + scope: + description: Supports service and application scope rules. + enum: + - service + - application + type: string + required: + - conditions + - configVersion + - enabled + - key + - scope type: object type: object served: true storage: true - subresources: - status: {} diff --git a/deploy/manifests/dubbo.apache.org_dynamicconfigs.yaml b/deploy/manifests/dubbo.apache.org_dynamicconfigs.yaml new file mode 100644 index 000000000..18f501eaf --- /dev/null +++ b/deploy/manifests/dubbo.apache.org_dynamicconfigs.yaml @@ -0,0 +1,219 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.11.3 + creationTimestamp: null + name: dynamicconfigs.dubbo.apache.org +spec: + group: dubbo.apache.org + names: + kind: DynamicConfig + listKind: DynamicConfigList + plural: dynamicconfigs + shortNames: + - dc + singular: dynamicconfig + scope: Namespaced + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + description: DynamicConfig is the Schema for the dynamicconfigs API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the clientgen + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: DynamicConfigSpec defines the desired state of DynamicConfig + properties: + configVersion: + description: The version of the tag rule definition, currently available + version is v3.0 + enum: + - v3.0 + type: string + configs: + description: The match condition and configuration of this rule. + items: + properties: + addresses: + description: replaced with address in MatchCondition + items: + type: string + type: array + applications: + description: replaced with application in MatchCondition + items: + type: string + type: array + enabled: + type: boolean + match: + description: A set of criterion to be met in order for the rule/config + to be applied to the Dubbo instance. + properties: + address: + description: 'The instance address matching condition for + this config rule to take effect. xact: “value” for exact + string match prefix: “value” for prefix-based match regex: + “value” for RE2 style regex-based match (https://github.com/google/re2/wiki/Syntax)).' + properties: + cird: + type: string + exact: + type: string + wildcard: + type: string + type: object + application: + description: "The application matching condition for this + config rule to take effect. Effective when scope: service + is set. \n exact: “value” for exact string match prefix: + “value” for prefix-based match regex: “value” for RE2 + style regex-based match (https://github.com/google/re2/wiki/Syntax))." + properties: + oneof: + items: + properties: + empty: + type: string + exact: + type: string + noempty: + type: string + prefix: + type: string + regex: + type: string + wildcard: + type: string + type: object + type: array + type: object + param: + description: The Dubbo url keys and values matching condition + for this config rule to take effect. + items: + properties: + key: + description: The name of the key in the Dubbo url + address. + type: string + value: + description: The matching condition for the value + in the Dubbo url address. + properties: + empty: + type: string + exact: + type: string + noempty: + type: string + prefix: + type: string + regex: + type: string + wildcard: + type: string + type: object + type: object + type: array + service: + description: 'The service matching condition for this config + rule to take effect. Effective when scope: application + is set. exact: “value” for exact string match prefix: + “value” for prefix-based match regex: “value” for RE2 + style regex-based match (https://github.com/google/re2/wiki/Syntax)).' + properties: + oneof: + items: + properties: + empty: + type: string + exact: + type: string + noempty: + type: string + prefix: + type: string + regex: + type: string + wildcard: + type: string + type: object + type: array + type: object + type: object + parameters: + additionalProperties: + type: string + type: object + providerAddresses: + description: not supported anymore + items: + type: string + type: array + services: + description: replaced with service in MatchCondition + items: + type: string + type: array + side: + description: 'Especially useful when scope:service is set. side: + providermeans this Config will only take effect on the provider + instances of the service key. side: consumermeans this Config + will only take effect on the consumer instances of the service + key' + type: string + type: + type: string + type: object + type: array + enabled: + default: true + description: Whether enable this rule or not, set enabled:false to + disable this rule. + type: boolean + key: + description: The identifier of the target service or application that + this rule is about to apply to. If scope:serviceis set, then keyshould + be specified as the Dubbo service key that this rule targets to + control. If scope:application is set, then keyshould be specified + as the name of the application that this rule targets to control, + application should always be a Dubbo Consumer. + type: string + scope: + description: Supports service and application scope rules. + enum: + - service + - application + type: string + type: object + type: object + served: true + storage: true diff --git a/deploy/manifests/dubbo.apache.org_tagroutes.yaml b/deploy/manifests/dubbo.apache.org_tagroutes.yaml new file mode 100644 index 000000000..d5972017c --- /dev/null +++ b/deploy/manifests/dubbo.apache.org_tagroutes.yaml @@ -0,0 +1,128 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.11.3 + creationTimestamp: null + name: tagroutes.dubbo.apache.org +spec: + group: dubbo.apache.org + names: + kind: TagRoute + listKind: TagRouteList + plural: tagroutes + shortNames: + - tg + singular: tagroute + scope: Namespaced + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + description: TagRoute is the Schema for the tagroutes API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the clientgen + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: TagRouteSpec defines the desired state of TagRoute + properties: + configVersion: + description: The version of the tag rule definition, currently available + version is v3.0 + enum: + - v3.0 + type: string + enabled: + default: true + description: Whether enable this rule or not, set enabled:false to + disable this rule. + type: boolean + force: + default: true + description: The behaviour when the instance subset is empty after + after routing. true means return no provider exception while false + means ignore this rule. + type: boolean + key: + description: The identifier of the target application that this rule + is about to control + type: string + priority: + maximum: 2147483647 + minimum: -2147483648 + type: integer + runtime: + default: true + description: Whether run routing rule for every rpc invocation or + use routing cache if available. + type: boolean + tags: + description: The tag definition of this rule. + items: + properties: + addresses: + items: + type: string + type: array + match: + description: A set of criterion to be met for instances to be + classified as member of this tag. + items: + properties: + key: + description: The name of the key in the Dubbo url address. + type: string + value: + description: The matching condition for the value in the + Dubbo url address. + properties: + empty: + type: string + exact: + type: string + noempty: + type: string + prefix: + type: string + regex: + type: string + wildcard: + type: string + type: object + type: object + type: array + name: + description: The name of the tag used to match the dubbo.tag + value in the request context. + type: string + type: object + type: array + type: object + type: object + served: true + storage: true diff --git a/go.mod b/go.mod index b8c445650..7a8f89c68 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,3 @@ -// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. @@ -6,7 +5,7 @@ // (the "License"); you may not use this file except in compliance with // the License. You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, @@ -16,207 +15,169 @@ module github.com/apache/dubbo-admin -go 1.19 +go 1.20 require ( - dubbo.apache.org/dubbo-go/v3 v3.0.6-0.20230516071747-5b2397c8b0b0 + dubbo.apache.org/dubbo-go/v3 v3.0.5 + github.com/dubbogo/go-zookeeper v1.0.4-0.20211212162352-f9d2183d89d5 github.com/dubbogo/gost v1.13.2 github.com/dubbogo/grpc-go v1.42.10 + github.com/dubbogo/triple v1.2.2-rc2 github.com/evanphx/json-patch/v5 v5.6.0 github.com/gin-gonic/gin v1.9.1 - github.com/glebarez/sqlite v1.8.0 github.com/golang-jwt/jwt/v4 v4.5.0 github.com/golang/mock v1.6.0 + github.com/google/uuid v1.3.0 github.com/google/yamlfmt v0.9.0 github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 github.com/kylelemons/godebug v1.1.0 - github.com/mattbaird/jsonpatch v0.0.0-20200820163806-098863c1fc24 - github.com/prometheus/client_golang v1.14.0 - github.com/prometheus/common v0.37.0 + github.com/mattbaird/jsonpatch v0.0.0-20230413205102-771768614e91 + github.com/pkg/errors v0.9.1 + github.com/prometheus/client_golang v1.15.1 + github.com/prometheus/common v0.42.0 github.com/spf13/cobra v1.6.1 - github.com/spf13/pflag v1.0.5 - github.com/spf13/viper v1.8.1 github.com/stretchr/testify v1.8.3 github.com/tidwall/gjson v1.14.4 github.com/vcraescu/go-paginator v1.0.0 + go.uber.org/atomic v1.9.0 go.uber.org/zap v1.24.0 golang.org/x/net v0.10.0 - google.golang.org/grpc v1.53.0 - google.golang.org/protobuf v1.30.0 + google.golang.org/grpc v1.56.2 + google.golang.org/protobuf v1.31.0 gopkg.in/yaml.v2 v2.4.0 - helm.sh/helm/v3 v3.11.2 - k8s.io/api v0.26.1 - k8s.io/apimachinery v0.26.1 - k8s.io/client-go v0.26.1 - k8s.io/kubectl v0.26.0 - k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 - sigs.k8s.io/controller-runtime v0.14.6 - sigs.k8s.io/structured-merge-diff/v4 v4.2.3 + gorm.io/driver/mysql v1.5.1 + gorm.io/driver/sqlite v1.5.2 + gorm.io/gorm v1.25.2-0.20230530020048-26663ab9bf55 + helm.sh/helm/v3 v3.12.1 + k8s.io/api v0.27.3 + k8s.io/apimachinery v0.27.3 + k8s.io/client-go v0.27.3 + k8s.io/kubectl v0.27.3 + k8s.io/utils v0.0.0-20230220204549-a5ecb0141aa5 + sigs.k8s.io/controller-runtime v0.15.0 sigs.k8s.io/yaml v1.3.0 ) require ( - cloud.google.com/go/compute v1.18.0 // indirect + cloud.google.com/go/compute v1.19.1 // indirect cloud.google.com/go/compute/metadata v0.2.3 // indirect - github.com/RageCage64/multilinediff v0.2.0 // indirect - github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5 // indirect - github.com/alibaba/sentinel-golang v1.0.4 // indirect - github.com/bmatcuk/doublestar/v4 v4.6.0 // indirect - github.com/braydonk/yaml v0.7.0 // indirect - github.com/bytedance/sonic v1.9.1 // indirect - github.com/census-instrumentation/opencensus-proto v0.4.1 // indirect - github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect - github.com/cncf/udpa/go v0.0.0-20220112060539-c52dc94e7fbe // indirect - github.com/cncf/xds/go v0.0.0-20230105202645-06c439db220b // indirect - github.com/coreos/go-semver v0.3.0 // indirect - github.com/coreos/go-systemd/v22 v22.3.2 // indirect - github.com/dlclark/regexp2 v1.7.0 // indirect - github.com/dustin/go-humanize v1.0.1 // indirect - github.com/envoyproxy/go-control-plane v0.11.0 // indirect - github.com/envoyproxy/protoc-gen-validate v0.9.1 // indirect - github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d // indirect - github.com/fatih/color v1.13.0 // indirect - github.com/gabriel-vasile/mimetype v1.4.2 // indirect - github.com/glebarez/go-sqlite v1.21.1 // indirect - github.com/go-co-op/gocron v1.9.0 // indirect - github.com/go-gorp/gorp/v3 v3.0.5 // indirect - github.com/go-logr/stdr v1.2.2 // indirect - github.com/go-resty/resty/v2 v2.7.0 // indirect - github.com/go-sql-driver/mysql v1.7.0 // indirect - github.com/gosuri/uitable v0.0.4 // indirect - github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 // indirect - github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 // indirect - github.com/hashicorp/errwrap v1.1.0 // indirect - github.com/hashicorp/go-multierror v1.1.1 // indirect - github.com/hashicorp/vault/sdk v0.7.0 // indirect - github.com/huandu/xstrings v1.4.0 // indirect - github.com/jinzhu/gorm v1.9.2 // indirect - github.com/jinzhu/inflection v1.0.0 // indirect - github.com/jinzhu/now v1.1.5 // indirect - github.com/klauspost/cpuid/v2 v2.2.4 // indirect - github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect - github.com/mattn/go-runewidth v0.0.9 // indirect - github.com/mitchellh/go-homedir v1.1.0 // indirect - github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852 // indirect - github.com/opencontainers/go-digest v1.0.0 // indirect - github.com/opencontainers/image-spec v1.1.0-rc2 // indirect - github.com/opentracing/opentracing-go v1.2.0 // indirect - github.com/pierrec/lz4 v2.5.2+incompatible // indirect - github.com/polarismesh/polaris-go v1.3.0 // indirect - github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect - github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect - github.com/robfig/cron/v3 v3.0.1 // indirect - github.com/shirou/gopsutil/v3 v3.22.2 // indirect - github.com/shopspring/decimal v1.3.1 // indirect - github.com/sirupsen/logrus v1.9.0 // indirect - github.com/spaolacci/murmur3 v1.1.0 // indirect - github.com/tklauser/go-sysconf v0.3.10 // indirect - github.com/tklauser/numcpus v0.4.0 // indirect - github.com/twitchyliquid64/golang-asm v0.15.1 // indirect - github.com/uber/jaeger-client-go v2.29.1+incompatible // indirect - github.com/uber/jaeger-lib v2.4.1+incompatible // indirect - github.com/yusufpapurcu/wmi v1.2.2 // indirect - go.etcd.io/etcd/api/v3 v3.5.7 // indirect - go.etcd.io/etcd/client/pkg/v3 v3.5.7 // indirect - go.etcd.io/etcd/client/v3 v3.5.7 // indirect - go.opentelemetry.io/otel v1.11.0 // indirect - go.opentelemetry.io/otel/trace v1.11.0 // indirect - golang.org/x/arch v0.3.0 // indirect - k8s.io/apiextensions-apiserver v0.26.1 // indirect - k8s.io/apiserver v0.26.1 // indirect - k8s.io/cli-runtime v0.26.0 // indirect - k8s.io/component-base v0.26.1 // indirect - modernc.org/libc v1.22.3 // indirect - modernc.org/mathutil v1.5.0 // indirect - modernc.org/memory v1.5.0 // indirect - modernc.org/sqlite v1.21.1 // indirect - oras.land/oras-go v1.2.2 // indirect -) - -require ( contrib.go.opencensus.io/exporter/prometheus v0.4.1 // indirect + github.com/AdaLogics/go-fuzz-headers v0.0.0-20230106234847-43070de90fa1 // indirect github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect github.com/BurntSushi/toml v1.2.1 // indirect github.com/MakeNowJust/heredoc v1.0.0 // indirect github.com/Masterminds/goutils v1.1.1 // indirect - github.com/Masterminds/semver/v3 v3.2.0 // indirect + github.com/Masterminds/semver/v3 v3.2.1 // indirect github.com/Masterminds/sprig/v3 v3.2.3 // indirect - github.com/Masterminds/squirrel v1.5.3 // indirect + github.com/Masterminds/squirrel v1.5.4 // indirect + github.com/RageCage64/multilinediff v0.2.0 // indirect github.com/RoaringBitmap/roaring v1.2.3 // indirect github.com/Workiva/go-datastructures v1.0.52 // indirect + github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5 // indirect + github.com/alibaba/sentinel-golang v1.0.4 // indirect github.com/aliyun/alibaba-cloud-sdk-go v1.61.1704 // indirect - github.com/apache/dubbo-getty v1.4.9 // indirect - github.com/apache/dubbo-go-hessian2 v1.12.0 // indirect + github.com/apache/dubbo-getty v1.4.9-0.20221022181821-4dc6252ce98c // indirect + github.com/apache/dubbo-go-hessian2 v1.11.5 // indirect github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bits-and-blooms/bitset v1.2.0 // indirect + github.com/bmatcuk/doublestar/v4 v4.6.0 // indirect + github.com/braydonk/yaml v0.7.0 // indirect github.com/buger/jsonparser v1.1.1 // indirect + github.com/bytedance/sonic v1.9.1 // indirect + github.com/census-instrumentation/opencensus-proto v0.4.1 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/chai2010/gettext-go v1.0.2 // indirect - github.com/containerd/containerd v1.6.18 // indirect + github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect + github.com/cncf/udpa/go v0.0.0-20220112060539-c52dc94e7fbe // indirect + github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4 // indirect + github.com/containerd/containerd v1.7.0 // indirect + github.com/coreos/go-semver v0.3.0 // indirect + github.com/coreos/go-systemd/v22 v22.5.0 // indirect github.com/creasty/defaults v1.5.2 // indirect github.com/cyphar/filepath-securejoin v0.2.3 // indirect github.com/davecgh/go-spew v1.1.1 // indirect + github.com/dlclark/regexp2 v1.7.0 // indirect github.com/docker/cli v20.10.21+incompatible // indirect github.com/docker/distribution v2.8.2+incompatible // indirect github.com/docker/docker v20.10.24+incompatible // indirect github.com/docker/docker-credential-helpers v0.7.0 // indirect github.com/docker/go-connections v0.4.0 // indirect github.com/docker/go-metrics v0.0.1 // indirect - github.com/docker/go-units v0.4.0 // indirect - github.com/dubbogo/go-zookeeper v1.0.4-0.20211212162352-f9d2183d89d5 - github.com/dubbogo/triple v1.2.2-rc3 + github.com/docker/go-units v0.5.0 // indirect github.com/emicklei/go-restful/v3 v3.10.1 // indirect + github.com/envoyproxy/go-control-plane v0.11.1-0.20230524094728-9239064ad72f // indirect + github.com/envoyproxy/protoc-gen-validate v0.10.1 // indirect github.com/evanphx/json-patch v5.6.0+incompatible // indirect - github.com/fsnotify/fsnotify v1.6.0 // indirect + github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d // indirect + github.com/fatih/color v1.13.0 // indirect + github.com/gabriel-vasile/mimetype v1.4.2 // indirect github.com/gin-contrib/sse v0.1.0 // indirect - github.com/go-errors/errors v1.0.1 // indirect - github.com/go-kit/log v0.2.0 // indirect + github.com/go-co-op/gocron v1.9.0 // indirect + github.com/go-errors/errors v1.4.2 // indirect + github.com/go-gorp/gorp/v3 v3.0.5 // indirect + github.com/go-kit/log v0.2.1 // indirect github.com/go-logfmt/logfmt v0.5.1 // indirect - github.com/go-logr/logr v1.2.3 // indirect + github.com/go-logr/logr v1.2.4 // indirect + github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.2.6 // indirect - github.com/go-openapi/jsonpointer v0.19.5 // indirect - github.com/go-openapi/jsonreference v0.20.0 // indirect - github.com/go-openapi/swag v0.19.14 // indirect + github.com/go-openapi/jsonpointer v0.19.6 // indirect + github.com/go-openapi/jsonreference v0.20.1 // indirect + github.com/go-openapi/swag v0.22.3 // indirect github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect github.com/go-playground/validator/v10 v10.14.0 // indirect + github.com/go-resty/resty/v2 v2.7.0 // indirect + github.com/go-sql-driver/mysql v1.7.0 // indirect github.com/gobwas/glob v0.2.3 // indirect github.com/goccy/go-json v0.10.2 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/golang/protobuf v1.5.2 // indirect + github.com/golang/protobuf v1.5.3 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/btree v1.0.1 // indirect github.com/google/gnostic v0.5.7-v3refs // indirect github.com/google/go-cmp v0.5.9 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect - github.com/google/uuid v1.3.0 // indirect github.com/gorilla/mux v1.8.0 // indirect github.com/gorilla/websocket v1.4.2 // indirect - github.com/hashicorp/hcl v1.0.0 // indirect + github.com/gosuri/uitable v0.0.4 // indirect + github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 // indirect + github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 // indirect + github.com/hashicorp/errwrap v1.1.0 // indirect + github.com/hashicorp/go-multierror v1.1.1 // indirect + github.com/hashicorp/vault/sdk v0.7.0 // indirect + github.com/huandu/xstrings v1.4.0 // indirect github.com/imdario/mergo v0.3.13 // indirect github.com/inconshreveable/mousetrap v1.0.1 // indirect github.com/jinzhu/copier v0.3.5 // indirect + github.com/jinzhu/gorm v1.9.2 // indirect + github.com/jinzhu/inflection v1.0.0 // indirect + github.com/jinzhu/now v1.1.5 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/jmoiron/sqlx v1.3.5 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/k0kubun/pp v3.0.1+incompatible // indirect - github.com/klauspost/compress v1.11.13 // indirect + github.com/klauspost/compress v1.16.0 // indirect + github.com/klauspost/cpuid/v2 v2.2.4 // indirect github.com/knadh/koanf v1.5.0 // indirect github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect github.com/leodido/go-urn v1.2.4 // indirect - github.com/lib/pq v1.10.7 // indirect + github.com/lib/pq v1.10.9 // indirect github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect + github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect github.com/magiconair/properties v1.8.7 // indirect - github.com/mailru/easyjson v0.7.6 // indirect + github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.19 // indirect + github.com/mattn/go-runewidth v0.0.9 // indirect + github.com/mattn/go-sqlite3 v1.14.17 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect + github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-wordwrap v1.0.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect @@ -231,49 +192,74 @@ require ( github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/nacos-group/nacos-sdk-go v1.1.4 // indirect github.com/natefinch/lumberjack v2.0.0+incompatible // indirect + github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852 // indirect + github.com/opencontainers/go-digest v1.0.0 // indirect + github.com/opencontainers/image-spec v1.1.0-rc2.0.20221005185240-3a7f492d3f1b // indirect + github.com/opentracing/opentracing-go v1.2.0 // indirect github.com/pelletier/go-toml v1.9.5 // indirect github.com/pelletier/go-toml/v2 v2.0.8 // indirect github.com/peterbourgon/diskv v2.0.1+incompatible // indirect - github.com/pkg/errors v0.9.1 + github.com/pierrec/lz4 v2.5.2+incompatible // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_model v0.3.0 // indirect - github.com/prometheus/procfs v0.8.0 // indirect + github.com/polarismesh/polaris-go v1.3.0 // indirect + github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect + github.com/prometheus/client_model v0.4.0 // indirect + github.com/prometheus/procfs v0.9.0 // indirect github.com/prometheus/statsd_exporter v0.21.0 // indirect + github.com/robfig/cron/v3 v3.0.1 // indirect github.com/rubenv/sql-migrate v1.3.1 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect - github.com/spf13/afero v1.9.2 // indirect + github.com/shirou/gopsutil/v3 v3.22.2 // indirect + github.com/shopspring/decimal v1.3.1 // indirect + github.com/sirupsen/logrus v1.9.0 // indirect + github.com/spaolacci/murmur3 v1.1.0 // indirect github.com/spf13/cast v1.5.0 // indirect - github.com/spf13/jwalterweatherman v1.1.0 // indirect - github.com/subosito/gotenv v1.2.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect github.com/tidwall/match v1.1.1 // indirect - github.com/tidwall/pretty v1.2.1 // indirect + github.com/tidwall/pretty v1.2.0 // indirect + github.com/tklauser/go-sysconf v0.3.10 // indirect + github.com/tklauser/numcpus v0.4.0 // indirect + github.com/twitchyliquid64/golang-asm v0.15.1 // indirect + github.com/uber/jaeger-client-go v2.30.0+incompatible // indirect + github.com/uber/jaeger-lib v2.4.1+incompatible // indirect github.com/ugorji/go/codec v1.2.11 // indirect - github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect + github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect github.com/xeipuuv/gojsonschema v1.2.0 // indirect github.com/xlab/treeprint v1.1.0 // indirect + github.com/yusufpapurcu/wmi v1.2.2 // indirect + go.etcd.io/etcd/api/v3 v3.5.7 // indirect + go.etcd.io/etcd/client/pkg/v3 v3.5.7 // indirect + go.etcd.io/etcd/client/v3 v3.5.7 // indirect go.opencensus.io v0.24.0 // indirect + go.opentelemetry.io/otel v1.14.0 // indirect + go.opentelemetry.io/otel/trace v1.14.0 // indirect go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // indirect - go.uber.org/atomic v1.10.0 // indirect - go.uber.org/multierr v1.9.0 // indirect + go.uber.org/multierr v1.8.0 // indirect + golang.org/x/arch v0.3.0 // indirect golang.org/x/crypto v0.9.0 // indirect - golang.org/x/oauth2 v0.4.0 // indirect - golang.org/x/sync v0.1.0 // indirect + golang.org/x/mod v0.10.0 // indirect + golang.org/x/oauth2 v0.7.0 // indirect + golang.org/x/sync v0.2.0 // indirect golang.org/x/sys v0.8.0 // indirect golang.org/x/term v0.8.0 // indirect golang.org/x/text v0.9.0 // indirect golang.org/x/time v0.3.0 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20230221151758-ace64dc21148 // indirect + google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/ini.v1 v1.66.2 // indirect gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - gorm.io/driver/mysql v1.4.7 - gorm.io/gorm v1.24.6 - k8s.io/klog/v2 v2.80.1 // indirect - k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect - sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect - sigs.k8s.io/kustomize/api v0.12.1 // indirect - sigs.k8s.io/kustomize/kyaml v0.13.9 // indirect + k8s.io/apiextensions-apiserver v0.27.2 // indirect + k8s.io/apiserver v0.27.2 // indirect + k8s.io/cli-runtime v0.27.3 // indirect + k8s.io/component-base v0.27.3 // indirect + k8s.io/klog/v2 v2.90.1 // indirect + k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect + oras.land/oras-go v1.2.2 // indirect + sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect + sigs.k8s.io/kustomize/api v0.13.2 // indirect + sigs.k8s.io/kustomize/kyaml v0.14.1 // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect ) diff --git a/go.sum b/go.sum index 1179c9eda..6d27d01db 100644 --- a/go.sum +++ b/go.sum @@ -3,7 +3,6 @@ cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= @@ -16,362 +15,38 @@ cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOY cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= -cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= -cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= -cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM= -cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY= -cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ= -cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= -cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= -cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= -cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= -cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A= -cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= -cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU= -cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRYtA= -cloud.google.com/go v0.105.0/go.mod h1:PrLgOJNe5nfE9UMxKxgXj4mD3voiP+YQ6gdt6KMFOKM= -cloud.google.com/go/accessapproval v1.4.0/go.mod h1:zybIuC3KpDOvotz59lFe5qxRZx6C75OtwbisN56xYB4= -cloud.google.com/go/accessapproval v1.5.0/go.mod h1:HFy3tuiGvMdcd/u+Cu5b9NkO1pEICJ46IR82PoUdplw= -cloud.google.com/go/accesscontextmanager v1.3.0/go.mod h1:TgCBehyr5gNMz7ZaH9xubp+CE8dkrszb4oK9CWyvD4o= -cloud.google.com/go/accesscontextmanager v1.4.0/go.mod h1:/Kjh7BBu/Gh83sv+K60vN9QE5NJcd80sU33vIe2IFPE= -cloud.google.com/go/aiplatform v1.22.0/go.mod h1:ig5Nct50bZlzV6NvKaTwmplLLddFx0YReh9WfTO5jKw= -cloud.google.com/go/aiplatform v1.24.0/go.mod h1:67UUvRBKG6GTayHKV8DBv2RtR1t93YRu5B1P3x99mYY= -cloud.google.com/go/analytics v0.11.0/go.mod h1:DjEWCu41bVbYcKyvlws9Er60YE4a//bK6mnhWvQeFNI= -cloud.google.com/go/analytics v0.12.0/go.mod h1:gkfj9h6XRf9+TS4bmuhPEShsh3hH8PAZzm/41OOhQd4= -cloud.google.com/go/apigateway v1.3.0/go.mod h1:89Z8Bhpmxu6AmUxuVRg/ECRGReEdiP3vQtk4Z1J9rJk= -cloud.google.com/go/apigateway v1.4.0/go.mod h1:pHVY9MKGaH9PQ3pJ4YLzoj6U5FUDeDFBllIz7WmzJoc= -cloud.google.com/go/apigeeconnect v1.3.0/go.mod h1:G/AwXFAKo0gIXkPTVfZDd2qA1TxBXJ3MgMRBQkIi9jc= -cloud.google.com/go/apigeeconnect v1.4.0/go.mod h1:kV4NwOKqjvt2JYR0AoIWo2QGfoRtn/pkS3QlHp0Ni04= -cloud.google.com/go/appengine v1.4.0/go.mod h1:CS2NhuBuDXM9f+qscZ6V86m1MIIqPj3WC/UoEuR1Sno= -cloud.google.com/go/appengine v1.5.0/go.mod h1:TfasSozdkFI0zeoxW3PTBLiNqRmzraodCWatWI9Dmak= -cloud.google.com/go/area120 v0.5.0/go.mod h1:DE/n4mp+iqVyvxHN41Vf1CR602GiHQjFPusMFW6bGR4= -cloud.google.com/go/area120 v0.6.0/go.mod h1:39yFJqWVgm0UZqWTOdqkLhjoC7uFfgXRC8g/ZegeAh0= -cloud.google.com/go/artifactregistry v1.6.0/go.mod h1:IYt0oBPSAGYj/kprzsBjZ/4LnG/zOcHyFHjWPCi6SAQ= -cloud.google.com/go/artifactregistry v1.7.0/go.mod h1:mqTOFOnGZx8EtSqK/ZWcsm/4U8B77rbcLP6ruDU2Ixk= -cloud.google.com/go/artifactregistry v1.8.0/go.mod h1:w3GQXkJX8hiKN0v+at4b0qotwijQbYUqF2GWkZzAhC0= -cloud.google.com/go/artifactregistry v1.9.0/go.mod h1:2K2RqvA2CYvAeARHRkLDhMDJ3OXy26h3XW+3/Jh2uYc= -cloud.google.com/go/asset v1.5.0/go.mod h1:5mfs8UvcM5wHhqtSv8J1CtxxaQq3AdBxxQi2jGW/K4o= -cloud.google.com/go/asset v1.7.0/go.mod h1:YbENsRK4+xTiL+Ofoj5Ckf+O17kJtgp3Y3nn4uzZz5s= -cloud.google.com/go/asset v1.8.0/go.mod h1:mUNGKhiqIdbr8X7KNayoYvyc4HbbFO9URsjbytpUaW0= -cloud.google.com/go/asset v1.9.0/go.mod h1:83MOE6jEJBMqFKadM9NLRcs80Gdw76qGuHn8m3h8oHQ= -cloud.google.com/go/asset v1.10.0/go.mod h1:pLz7uokL80qKhzKr4xXGvBQXnzHn5evJAEAtZiIb0wY= -cloud.google.com/go/assuredworkloads v1.5.0/go.mod h1:n8HOZ6pff6re5KYfBXcFvSViQjDwxFkAkmUFffJRbbY= -cloud.google.com/go/assuredworkloads v1.6.0/go.mod h1:yo2YOk37Yc89Rsd5QMVECvjaMKymF9OP+QXWlKXUkXw= -cloud.google.com/go/assuredworkloads v1.7.0/go.mod h1:z/736/oNmtGAyU47reJgGN+KVoYoxeLBoj4XkKYscNI= -cloud.google.com/go/assuredworkloads v1.8.0/go.mod h1:AsX2cqyNCOvEQC8RMPnoc0yEarXQk6WEKkxYfL6kGIo= -cloud.google.com/go/assuredworkloads v1.9.0/go.mod h1:kFuI1P78bplYtT77Tb1hi0FMxM0vVpRC7VVoJC3ZoT0= -cloud.google.com/go/automl v1.5.0/go.mod h1:34EjfoFGMZ5sgJ9EoLsRtdPSNZLcfflJR39VbVNS2M0= -cloud.google.com/go/automl v1.6.0/go.mod h1:ugf8a6Fx+zP0D59WLhqgTDsQI9w07o64uf/Is3Nh5p8= -cloud.google.com/go/automl v1.7.0/go.mod h1:RL9MYCCsJEOmt0Wf3z9uzG0a7adTT1fe+aObgSpkCt8= -cloud.google.com/go/automl v1.8.0/go.mod h1:xWx7G/aPEe/NP+qzYXktoBSDfjO+vnKMGgsApGJJquM= -cloud.google.com/go/baremetalsolution v0.3.0/go.mod h1:XOrocE+pvK1xFfleEnShBlNAXf+j5blPPxrhjKgnIFc= -cloud.google.com/go/baremetalsolution v0.4.0/go.mod h1:BymplhAadOO/eBa7KewQ0Ppg4A4Wplbn+PsFKRLo0uI= -cloud.google.com/go/batch v0.3.0/go.mod h1:TR18ZoAekj1GuirsUsR1ZTKN3FC/4UDnScjT8NXImFE= -cloud.google.com/go/batch v0.4.0/go.mod h1:WZkHnP43R/QCGQsZ+0JyG4i79ranE2u8xvjq/9+STPE= -cloud.google.com/go/beyondcorp v0.2.0/go.mod h1:TB7Bd+EEtcw9PCPQhCJtJGjk/7TC6ckmnSFS+xwTfm4= -cloud.google.com/go/beyondcorp v0.3.0/go.mod h1:E5U5lcrcXMsCuoDNyGrpyTm/hn7ne941Jz2vmksAxW8= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/bigquery v1.42.0/go.mod h1:8dRTJxhtG+vwBKzE5OseQn/hiydoQN3EedCaOdYmxRA= -cloud.google.com/go/bigquery v1.43.0/go.mod h1:ZMQcXHsl+xmU1z36G2jNGZmKp9zNY5BUua5wDgmNCfw= -cloud.google.com/go/billing v1.4.0/go.mod h1:g9IdKBEFlItS8bTtlrZdVLWSSdSyFUZKXNS02zKMOZY= -cloud.google.com/go/billing v1.5.0/go.mod h1:mztb1tBc3QekhjSgmpf/CV4LzWXLzCArwpLmP2Gm88s= -cloud.google.com/go/billing v1.6.0/go.mod h1:WoXzguj+BeHXPbKfNWkqVtDdzORazmCjraY+vrxcyvI= -cloud.google.com/go/billing v1.7.0/go.mod h1:q457N3Hbj9lYwwRbnlD7vUpyjq6u5U1RAOArInEiD5Y= -cloud.google.com/go/binaryauthorization v1.1.0/go.mod h1:xwnoWu3Y84jbuHa0zd526MJYmtnVXn0syOjaJgy4+dM= -cloud.google.com/go/binaryauthorization v1.2.0/go.mod h1:86WKkJHtRcv5ViNABtYMhhNWRrD1Vpi//uKEy7aYEfI= -cloud.google.com/go/binaryauthorization v1.3.0/go.mod h1:lRZbKgjDIIQvzYQS1p99A7/U1JqvqeZg0wiI5tp6tg0= -cloud.google.com/go/binaryauthorization v1.4.0/go.mod h1:tsSPQrBd77VLplV70GUhBf/Zm3FsKmgSqgm4UmiDItk= -cloud.google.com/go/certificatemanager v1.3.0/go.mod h1:n6twGDvcUBFu9uBgt4eYvvf3sQ6My8jADcOVwHmzadg= -cloud.google.com/go/certificatemanager v1.4.0/go.mod h1:vowpercVFyqs8ABSmrdV+GiFf2H/ch3KyudYQEMM590= -cloud.google.com/go/channel v1.8.0/go.mod h1:W5SwCXDJsq/rg3tn3oG0LOxpAo6IMxNa09ngphpSlnk= -cloud.google.com/go/channel v1.9.0/go.mod h1:jcu05W0my9Vx4mt3/rEHpfxc9eKi9XwsdDL8yBMbKUk= -cloud.google.com/go/cloudbuild v1.3.0/go.mod h1:WequR4ULxlqvMsjDEEEFnOG5ZSRSgWOywXYDb1vPE6U= -cloud.google.com/go/cloudbuild v1.4.0/go.mod h1:5Qwa40LHiOXmz3386FrjrYM93rM/hdRr7b53sySrTqA= -cloud.google.com/go/clouddms v1.3.0/go.mod h1:oK6XsCDdW4Ib3jCCBugx+gVjevp2TMXFtgxvPSee3OM= -cloud.google.com/go/clouddms v1.4.0/go.mod h1:Eh7sUGCC+aKry14O1NRljhjyrr0NFC0G2cjwX0cByRk= -cloud.google.com/go/cloudtasks v1.5.0/go.mod h1:fD92REy1x5woxkKEkLdvavGnPJGEn8Uic9nWuLzqCpY= -cloud.google.com/go/cloudtasks v1.6.0/go.mod h1:C6Io+sxuke9/KNRkbQpihnW93SWDU3uXt92nu85HkYI= -cloud.google.com/go/cloudtasks v1.7.0/go.mod h1:ImsfdYWwlWNJbdgPIIGJWC+gemEGTBK/SunNQQNCAb4= -cloud.google.com/go/cloudtasks v1.8.0/go.mod h1:gQXUIwCSOI4yPVK7DgTVFiiP0ZW/eQkydWzwVMdHxrI= -cloud.google.com/go/compute v0.1.0/go.mod h1:GAesmwr110a34z04OlxYkATPBEfVhkymfTBXtfbBFow= -cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJWM7YD99wM= -cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6mkzQJeu0M= -cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz/FMzPu0s= -cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= -cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= -cloud.google.com/go/compute v1.10.0/go.mod h1:ER5CLbMxl90o2jtNbGSbtfOpQKR0t15FOtRsugnLrlU= -cloud.google.com/go/compute v1.12.0/go.mod h1:e8yNOBcBONZU1vJKCvCoDw/4JQsA0dpM4x/6PIIOocU= -cloud.google.com/go/compute v1.12.1/go.mod h1:e8yNOBcBONZU1vJKCvCoDw/4JQsA0dpM4x/6PIIOocU= -cloud.google.com/go/compute v1.18.0 h1:FEigFqoDbys2cvFkZ9Fjq4gnHBP55anJ0yQyau2f9oY= -cloud.google.com/go/compute v1.18.0/go.mod h1:1X7yHxec2Ga+Ss6jPyjxRxpu2uu7PLgsOVXvgU0yacs= -cloud.google.com/go/compute/metadata v0.1.0/go.mod h1:Z1VN+bulIf6bt4P/C37K4DyZYZEXYonfTBHHFPO/4UU= -cloud.google.com/go/compute/metadata v0.2.1/go.mod h1:jgHgmJd2RKBGzXqF5LR2EZMGxBkeanZ9wwa75XHJgOM= +cloud.google.com/go/compute v1.19.1 h1:am86mquDUgjGNWxiGn+5PGLbmgiWXlE/yNWpIpNvuXY= +cloud.google.com/go/compute v1.19.1/go.mod h1:6ylj3a05WF8leseCdIf77NK0g1ey+nj5IKd5/kvShxE= cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= -cloud.google.com/go/contactcenterinsights v1.3.0/go.mod h1:Eu2oemoePuEFc/xKFPjbTuPSj0fYJcPls9TFlPNnHHY= -cloud.google.com/go/contactcenterinsights v1.4.0/go.mod h1:L2YzkGbPsv+vMQMCADxJoT9YiTTnSEd6fEvCeHTYVck= -cloud.google.com/go/container v1.6.0/go.mod h1:Xazp7GjJSeUYo688S+6J5V+n/t+G5sKBTFkKNudGRxg= -cloud.google.com/go/container v1.7.0/go.mod h1:Dp5AHtmothHGX3DwwIHPgq45Y8KmNsgN3amoYfxVkLo= -cloud.google.com/go/containeranalysis v0.5.1/go.mod h1:1D92jd8gRR/c0fGMlymRgxWD3Qw9C1ff6/T7mLgVL8I= -cloud.google.com/go/containeranalysis v0.6.0/go.mod h1:HEJoiEIu+lEXM+k7+qLCci0h33lX3ZqoYFdmPcoO7s4= -cloud.google.com/go/datacatalog v1.3.0/go.mod h1:g9svFY6tuR+j+hrTw3J2dNcmI0dzmSiyOzm8kpLq0a0= -cloud.google.com/go/datacatalog v1.5.0/go.mod h1:M7GPLNQeLfWqeIm3iuiruhPzkt65+Bx8dAKvScX8jvs= -cloud.google.com/go/datacatalog v1.6.0/go.mod h1:+aEyF8JKg+uXcIdAmmaMUmZ3q1b/lKLtXCmXdnc0lbc= -cloud.google.com/go/datacatalog v1.7.0/go.mod h1:9mEl4AuDYWw81UGc41HonIHH7/sn52H0/tc8f8ZbZIE= -cloud.google.com/go/datacatalog v1.8.0/go.mod h1:KYuoVOv9BM8EYz/4eMFxrr4DUKhGIOXxZoKYF5wdISM= -cloud.google.com/go/dataflow v0.6.0/go.mod h1:9QwV89cGoxjjSR9/r7eFDqqjtvbKxAK2BaYU6PVk9UM= -cloud.google.com/go/dataflow v0.7.0/go.mod h1:PX526vb4ijFMesO1o202EaUmouZKBpjHsTlCtB4parQ= -cloud.google.com/go/dataform v0.3.0/go.mod h1:cj8uNliRlHpa6L3yVhDOBrUXH+BPAO1+KFMQQNSThKo= -cloud.google.com/go/dataform v0.4.0/go.mod h1:fwV6Y4Ty2yIFL89huYlEkwUPtS7YZinZbzzj5S9FzCE= -cloud.google.com/go/dataform v0.5.0/go.mod h1:GFUYRe8IBa2hcomWplodVmUx/iTL0FrsauObOM3Ipr0= -cloud.google.com/go/datafusion v1.4.0/go.mod h1:1Zb6VN+W6ALo85cXnM1IKiPw+yQMKMhB9TsTSRDo/38= -cloud.google.com/go/datafusion v1.5.0/go.mod h1:Kz+l1FGHB0J+4XF2fud96WMmRiq/wj8N9u007vyXZ2w= -cloud.google.com/go/datalabeling v0.5.0/go.mod h1:TGcJ0G2NzcsXSE/97yWjIZO0bXj0KbVlINXMG9ud42I= -cloud.google.com/go/datalabeling v0.6.0/go.mod h1:WqdISuk/+WIGeMkpw/1q7bK/tFEZxsrFJOJdY2bXvTQ= -cloud.google.com/go/dataplex v1.3.0/go.mod h1:hQuRtDg+fCiFgC8j0zV222HvzFQdRd+SVX8gdmFcZzA= -cloud.google.com/go/dataplex v1.4.0/go.mod h1:X51GfLXEMVJ6UN47ESVqvlsRplbLhcsAt0kZCCKsU0A= -cloud.google.com/go/dataproc v1.7.0/go.mod h1:CKAlMjII9H90RXaMpSxQ8EU6dQx6iAYNPcYPOkSbi8s= -cloud.google.com/go/dataproc v1.8.0/go.mod h1:5OW+zNAH0pMpw14JVrPONsxMQYMBqJuzORhIBfBn9uI= -cloud.google.com/go/dataqna v0.5.0/go.mod h1:90Hyk596ft3zUQ8NkFfvICSIfHFh1Bc7C4cK3vbhkeo= -cloud.google.com/go/dataqna v0.6.0/go.mod h1:1lqNpM7rqNLVgWBJyk5NF6Uen2PHym0jtVJonplVsDA= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/datastream v1.2.0/go.mod h1:i/uTP8/fZwgATHS/XFu0TcNUhuA0twZxxQ3EyCUQMwo= -cloud.google.com/go/datastream v1.3.0/go.mod h1:cqlOX8xlyYF/uxhiKn6Hbv6WjwPPuI9W2M9SAXwaLLQ= -cloud.google.com/go/datastream v1.4.0/go.mod h1:h9dpzScPhDTs5noEMQVWP8Wx8AFBRyS0s8KWPx/9r0g= -cloud.google.com/go/datastream v1.5.0/go.mod h1:6TZMMNPwjUqZHBKPQ1wwXpb0d5VDVPl2/XoS5yi88q4= -cloud.google.com/go/deploy v1.4.0/go.mod h1:5Xghikd4VrmMLNaF6FiRFDlHb59VM59YoDQnOUdsH/c= -cloud.google.com/go/deploy v1.5.0/go.mod h1:ffgdD0B89tToyW/U/D2eL0jN2+IEV/3EMuXHA0l4r+s= -cloud.google.com/go/dialogflow v1.15.0/go.mod h1:HbHDWs33WOGJgn6rfzBW1Kv807BE3O1+xGbn59zZWI4= -cloud.google.com/go/dialogflow v1.16.1/go.mod h1:po6LlzGfK+smoSmTBnbkIZY2w8ffjz/RcGSS+sh1el0= -cloud.google.com/go/dialogflow v1.17.0/go.mod h1:YNP09C/kXA1aZdBgC/VtXX74G/TKn7XVCcVumTflA+8= -cloud.google.com/go/dialogflow v1.18.0/go.mod h1:trO7Zu5YdyEuR+BhSNOqJezyFQ3aUzz0njv7sMx/iek= -cloud.google.com/go/dialogflow v1.19.0/go.mod h1:JVmlG1TwykZDtxtTXujec4tQ+D8SBFMoosgy+6Gn0s0= -cloud.google.com/go/dlp v1.6.0/go.mod h1:9eyB2xIhpU0sVwUixfBubDoRwP+GjeUoxxeueZmqvmM= -cloud.google.com/go/dlp v1.7.0/go.mod h1:68ak9vCiMBjbasxeVD17hVPxDEck+ExiHavX8kiHG+Q= -cloud.google.com/go/documentai v1.7.0/go.mod h1:lJvftZB5NRiFSX4moiye1SMxHx0Bc3x1+p9e/RfXYiU= -cloud.google.com/go/documentai v1.8.0/go.mod h1:xGHNEB7CtsnySCNrCFdCyyMz44RhFEEX2Q7UD0c5IhU= -cloud.google.com/go/documentai v1.9.0/go.mod h1:FS5485S8R00U10GhgBC0aNGrJxBP8ZVpEeJ7PQDZd6k= -cloud.google.com/go/documentai v1.10.0/go.mod h1:vod47hKQIPeCfN2QS/jULIvQTugbmdc0ZvxxfQY1bg4= -cloud.google.com/go/domains v0.6.0/go.mod h1:T9Rz3GasrpYk6mEGHh4rymIhjlnIuB4ofT1wTxDeT4Y= -cloud.google.com/go/domains v0.7.0/go.mod h1:PtZeqS1xjnXuRPKE/88Iru/LdfoRyEHYA9nFQf4UKpg= -cloud.google.com/go/edgecontainer v0.1.0/go.mod h1:WgkZ9tp10bFxqO8BLPqv2LlfmQF1X8lZqwW4r1BTajk= -cloud.google.com/go/edgecontainer v0.2.0/go.mod h1:RTmLijy+lGpQ7BXuTDa4C4ssxyXT34NIuHIgKuP4s5w= -cloud.google.com/go/essentialcontacts v1.3.0/go.mod h1:r+OnHa5jfj90qIfZDO/VztSFqbQan7HV75p8sA+mdGI= -cloud.google.com/go/essentialcontacts v1.4.0/go.mod h1:8tRldvHYsmnBCHdFpvU+GL75oWiBKl80BiqlFh9tp+8= -cloud.google.com/go/eventarc v1.7.0/go.mod h1:6ctpF3zTnaQCxUjHUdcfgcA1A2T309+omHZth7gDfmc= -cloud.google.com/go/eventarc v1.8.0/go.mod h1:imbzxkyAU4ubfsaKYdQg04WS1NvncblHEup4kvF+4gw= -cloud.google.com/go/filestore v1.3.0/go.mod h1:+qbvHGvXU1HaKX2nD0WEPo92TP/8AQuCVEBXNY9z0+w= -cloud.google.com/go/filestore v1.4.0/go.mod h1:PaG5oDfo9r224f8OYXURtAsY+Fbyq/bLYoINEK8XQAI= cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= -cloud.google.com/go/functions v1.6.0/go.mod h1:3H1UA3qiIPRWD7PeZKLvHZ9SaQhR26XIJcC0A5GbvAk= -cloud.google.com/go/functions v1.7.0/go.mod h1:+d+QBcWM+RsrgZfV9xo6KfA1GlzJfxcfZcRPEhDDfzg= -cloud.google.com/go/functions v1.8.0/go.mod h1:RTZ4/HsQjIqIYP9a9YPbU+QFoQsAlYgrwOXJWHn1POY= -cloud.google.com/go/functions v1.9.0/go.mod h1:Y+Dz8yGguzO3PpIjhLTbnqV1CWmgQ5UwtlpzoyquQ08= -cloud.google.com/go/gaming v1.5.0/go.mod h1:ol7rGcxP/qHTRQE/RO4bxkXq+Fix0j6D4LFPzYTIrDM= -cloud.google.com/go/gaming v1.6.0/go.mod h1:YMU1GEvA39Qt3zWGyAVA9bpYz/yAhTvaQ1t2sK4KPUA= -cloud.google.com/go/gaming v1.7.0/go.mod h1:LrB8U7MHdGgFG851iHAfqUdLcKBdQ55hzXy9xBJz0+w= -cloud.google.com/go/gaming v1.8.0/go.mod h1:xAqjS8b7jAVW0KFYeRUxngo9My3f33kFmua++Pi+ggM= -cloud.google.com/go/gkebackup v0.2.0/go.mod h1:XKvv/4LfG829/B8B7xRkk8zRrOEbKtEam6yNfuQNH60= -cloud.google.com/go/gkebackup v0.3.0/go.mod h1:n/E671i1aOQvUxT541aTkCwExO/bTer2HDlj4TsBRAo= -cloud.google.com/go/gkeconnect v0.5.0/go.mod h1:c5lsNAg5EwAy7fkqX/+goqFsU1Da/jQFqArp+wGNr/o= -cloud.google.com/go/gkeconnect v0.6.0/go.mod h1:Mln67KyU/sHJEBY8kFZ0xTeyPtzbq9StAVvEULYK16A= -cloud.google.com/go/gkehub v0.9.0/go.mod h1:WYHN6WG8w9bXU0hqNxt8rm5uxnk8IH+lPY9J2TV7BK0= -cloud.google.com/go/gkehub v0.10.0/go.mod h1:UIPwxI0DsrpsVoWpLB0stwKCP+WFVG9+y977wO+hBH0= -cloud.google.com/go/gkemulticloud v0.3.0/go.mod h1:7orzy7O0S+5kq95e4Hpn7RysVA7dPs8W/GgfUtsPbrA= -cloud.google.com/go/gkemulticloud v0.4.0/go.mod h1:E9gxVBnseLWCk24ch+P9+B2CoDFJZTyIgLKSalC7tuI= -cloud.google.com/go/grafeas v0.2.0/go.mod h1:KhxgtF2hb0P191HlY5besjYm6MqTSTj3LSI+M+ByZHc= -cloud.google.com/go/gsuiteaddons v1.3.0/go.mod h1:EUNK/J1lZEZO8yPtykKxLXI6JSVN2rg9bN8SXOa0bgM= -cloud.google.com/go/gsuiteaddons v1.4.0/go.mod h1:rZK5I8hht7u7HxFQcFei0+AtfS9uSushomRlg+3ua1o= -cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= -cloud.google.com/go/iam v0.5.0/go.mod h1:wPU9Vt0P4UmCux7mqtRu6jcpPAb74cP1fh50J3QpkUc= -cloud.google.com/go/iam v0.6.0/go.mod h1:+1AH33ueBne5MzYccyMHtEKqLE4/kJOibtffMHDMFMc= -cloud.google.com/go/iam v0.7.0/go.mod h1:H5Br8wRaDGNc8XP3keLc4unfUUZeyH3Sfl9XpQEYOeg= -cloud.google.com/go/iap v1.4.0/go.mod h1:RGFwRJdihTINIe4wZ2iCP0zF/qu18ZwyKxrhMhygBEc= -cloud.google.com/go/iap v1.5.0/go.mod h1:UH/CGgKd4KyohZL5Pt0jSKE4m3FR51qg6FKQ/z/Ix9A= -cloud.google.com/go/ids v1.1.0/go.mod h1:WIuwCaYVOzHIj2OhN9HAwvW+DBdmUAdcWlFxRl+KubM= -cloud.google.com/go/ids v1.2.0/go.mod h1:5WXvp4n25S0rA/mQWAg1YEEBBq6/s+7ml1RDCW1IrcY= -cloud.google.com/go/iot v1.3.0/go.mod h1:r7RGh2B61+B8oz0AGE+J72AhA0G7tdXItODWsaA2oLs= -cloud.google.com/go/iot v1.4.0/go.mod h1:dIDxPOn0UvNDUMD8Ger7FIaTuvMkj+aGk94RPP0iV+g= -cloud.google.com/go/kms v1.5.0/go.mod h1:QJS2YY0eJGBg3mnDfuaCyLauWwBJiHRboYxJ++1xJNg= -cloud.google.com/go/kms v1.6.0/go.mod h1:Jjy850yySiasBUDi6KFUwUv2n1+o7QZFyuUJg6OgjA0= -cloud.google.com/go/language v1.4.0/go.mod h1:F9dRpNFQmJbkaop6g0JhSBXCNlO90e1KWx5iDdxbWic= -cloud.google.com/go/language v1.6.0/go.mod h1:6dJ8t3B+lUYfStgls25GusK04NLh3eDLQnWM3mdEbhI= -cloud.google.com/go/language v1.7.0/go.mod h1:DJ6dYN/W+SQOjF8e1hLQXMF21AkH2w9wiPzPCJa2MIE= -cloud.google.com/go/language v1.8.0/go.mod h1:qYPVHf7SPoNNiCL2Dr0FfEFNil1qi3pQEyygwpgVKB8= -cloud.google.com/go/lifesciences v0.5.0/go.mod h1:3oIKy8ycWGPUyZDR/8RNnTOYevhaMLqh5vLUXs9zvT8= -cloud.google.com/go/lifesciences v0.6.0/go.mod h1:ddj6tSX/7BOnhxCSd3ZcETvtNr8NZ6t/iPhY2Tyfu08= -cloud.google.com/go/longrunning v0.1.1/go.mod h1:UUFxuDWkv22EuY93jjmDMFT5GPQKeFVJBIF6QlTqdsE= -cloud.google.com/go/longrunning v0.3.0/go.mod h1:qth9Y41RRSUE69rDcOn6DdK3HfQfsUI0YSmW3iIlLJc= -cloud.google.com/go/managedidentities v1.3.0/go.mod h1:UzlW3cBOiPrzucO5qWkNkh0w33KFtBJU281hacNvsdE= -cloud.google.com/go/managedidentities v1.4.0/go.mod h1:NWSBYbEMgqmbZsLIyKvxrYbtqOsxY1ZrGM+9RgDqInM= -cloud.google.com/go/mediatranslation v0.5.0/go.mod h1:jGPUhGTybqsPQn91pNXw0xVHfuJ3leR1wj37oU3y1f4= -cloud.google.com/go/mediatranslation v0.6.0/go.mod h1:hHdBCTYNigsBxshbznuIMFNe5QXEowAuNmmC7h8pu5w= -cloud.google.com/go/memcache v1.4.0/go.mod h1:rTOfiGZtJX1AaFUrOgsMHX5kAzaTQ8azHiuDoTPzNsE= -cloud.google.com/go/memcache v1.5.0/go.mod h1:dk3fCK7dVo0cUU2c36jKb4VqKPS22BTkf81Xq617aWM= -cloud.google.com/go/memcache v1.6.0/go.mod h1:XS5xB0eQZdHtTuTF9Hf8eJkKtR3pVRCcvJwtm68T3rA= -cloud.google.com/go/memcache v1.7.0/go.mod h1:ywMKfjWhNtkQTxrWxCkCFkoPjLHPW6A7WOTVI8xy3LY= -cloud.google.com/go/metastore v1.5.0/go.mod h1:2ZNrDcQwghfdtCwJ33nM0+GrBGlVuh8rakL3vdPY3XY= -cloud.google.com/go/metastore v1.6.0/go.mod h1:6cyQTls8CWXzk45G55x57DVQ9gWg7RiH65+YgPsNh9s= -cloud.google.com/go/metastore v1.7.0/go.mod h1:s45D0B4IlsINu87/AsWiEVYbLaIMeUSoxlKKDqBGFS8= -cloud.google.com/go/metastore v1.8.0/go.mod h1:zHiMc4ZUpBiM7twCIFQmJ9JMEkDSyZS9U12uf7wHqSI= -cloud.google.com/go/monitoring v1.7.0/go.mod h1:HpYse6kkGo//7p6sT0wsIC6IBDET0RhIsnmlA53dvEk= -cloud.google.com/go/monitoring v1.8.0/go.mod h1:E7PtoMJ1kQXWxPjB6mv2fhC5/15jInuulFdYYtlcvT4= -cloud.google.com/go/networkconnectivity v1.4.0/go.mod h1:nOl7YL8odKyAOtzNX73/M5/mGZgqqMeryi6UPZTk/rA= -cloud.google.com/go/networkconnectivity v1.5.0/go.mod h1:3GzqJx7uhtlM3kln0+x5wyFvuVH1pIBJjhCpjzSt75o= -cloud.google.com/go/networkconnectivity v1.6.0/go.mod h1:OJOoEXW+0LAxHh89nXd64uGG+FbQoeH8DtxCHVOMlaM= -cloud.google.com/go/networkconnectivity v1.7.0/go.mod h1:RMuSbkdbPwNMQjB5HBWD5MpTBnNm39iAVpC3TmsExt8= -cloud.google.com/go/networkmanagement v1.4.0/go.mod h1:Q9mdLLRn60AsOrPc8rs8iNV6OHXaGcDdsIQe1ohekq8= -cloud.google.com/go/networkmanagement v1.5.0/go.mod h1:ZnOeZ/evzUdUsnvRt792H0uYEnHQEMaz+REhhzJRcf4= -cloud.google.com/go/networksecurity v0.5.0/go.mod h1:xS6fOCoqpVC5zx15Z/MqkfDwH4+m/61A3ODiDV1xmiQ= -cloud.google.com/go/networksecurity v0.6.0/go.mod h1:Q5fjhTr9WMI5mbpRYEbiexTzROf7ZbDzvzCrNl14nyU= -cloud.google.com/go/notebooks v1.2.0/go.mod h1:9+wtppMfVPUeJ8fIWPOq1UnATHISkGXGqTkxeieQ6UY= -cloud.google.com/go/notebooks v1.3.0/go.mod h1:bFR5lj07DtCPC7YAAJ//vHskFBxA5JzYlH68kXVdk34= -cloud.google.com/go/notebooks v1.4.0/go.mod h1:4QPMngcwmgb6uw7Po99B2xv5ufVoIQ7nOGDyL4P8AgA= -cloud.google.com/go/notebooks v1.5.0/go.mod h1:q8mwhnP9aR8Hpfnrc5iN5IBhrXUy8S2vuYs+kBJ/gu0= -cloud.google.com/go/optimization v1.1.0/go.mod h1:5po+wfvX5AQlPznyVEZjGJTMr4+CAkJf2XSTQOOl9l4= -cloud.google.com/go/optimization v1.2.0/go.mod h1:Lr7SOHdRDENsh+WXVmQhQTrzdu9ybg0NecjHidBq6xs= -cloud.google.com/go/orchestration v1.3.0/go.mod h1:Sj5tq/JpWiB//X/q3Ngwdl5K7B7Y0KZ7bfv0wL6fqVA= -cloud.google.com/go/orchestration v1.4.0/go.mod h1:6W5NLFWs2TlniBphAViZEVhrXRSMgUGDfW7vrWKvsBk= -cloud.google.com/go/orgpolicy v1.4.0/go.mod h1:xrSLIV4RePWmP9P3tBl8S93lTmlAxjm06NSm2UTmKvE= -cloud.google.com/go/orgpolicy v1.5.0/go.mod h1:hZEc5q3wzwXJaKrsx5+Ewg0u1LxJ51nNFlext7Tanwc= -cloud.google.com/go/osconfig v1.7.0/go.mod h1:oVHeCeZELfJP7XLxcBGTMBvRO+1nQ5tFG9VQTmYS2Fs= -cloud.google.com/go/osconfig v1.8.0/go.mod h1:EQqZLu5w5XA7eKizepumcvWx+m8mJUhEwiPqWiZeEdg= -cloud.google.com/go/osconfig v1.9.0/go.mod h1:Yx+IeIZJ3bdWmzbQU4fxNl8xsZ4amB+dygAwFPlvnNo= -cloud.google.com/go/osconfig v1.10.0/go.mod h1:uMhCzqC5I8zfD9zDEAfvgVhDS8oIjySWh+l4WK6GnWw= -cloud.google.com/go/oslogin v1.4.0/go.mod h1:YdgMXWRaElXz/lDk1Na6Fh5orF7gvmJ0FGLIs9LId4E= -cloud.google.com/go/oslogin v1.5.0/go.mod h1:D260Qj11W2qx/HVF29zBg+0fd6YCSjSqLUkY/qEenQU= -cloud.google.com/go/oslogin v1.6.0/go.mod h1:zOJ1O3+dTU8WPlGEkFSh7qeHPPSoxrcMbbK1Nm2iX70= -cloud.google.com/go/oslogin v1.7.0/go.mod h1:e04SN0xO1UNJ1M5GP0vzVBFicIe4O53FOfcixIqTyXo= -cloud.google.com/go/phishingprotection v0.5.0/go.mod h1:Y3HZknsK9bc9dMi+oE8Bim0lczMU6hrX0UpADuMefr0= -cloud.google.com/go/phishingprotection v0.6.0/go.mod h1:9Y3LBLgy0kDTcYET8ZH3bq/7qni15yVUoAxiFxnlSUA= -cloud.google.com/go/policytroubleshooter v1.3.0/go.mod h1:qy0+VwANja+kKrjlQuOzmlvscn4RNsAc0e15GGqfMxg= -cloud.google.com/go/policytroubleshooter v1.4.0/go.mod h1:DZT4BcRw3QoO8ota9xw/LKtPa8lKeCByYeKTIf/vxdE= -cloud.google.com/go/privatecatalog v0.5.0/go.mod h1:XgosMUvvPyxDjAVNDYxJ7wBW8//hLDDYmnsNcMGq1K0= -cloud.google.com/go/privatecatalog v0.6.0/go.mod h1:i/fbkZR0hLN29eEWiiwue8Pb+GforiEIBnV9yrRUOKI= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/recaptchaenterprise v1.3.1/go.mod h1:OdD+q+y4XGeAlxRaMn1Y7/GveP6zmq76byL6tjPE7d4= -cloud.google.com/go/recaptchaenterprise/v2 v2.1.0/go.mod h1:w9yVqajwroDNTfGuhmOjPDN//rZGySaf6PtFVcSCa7o= -cloud.google.com/go/recaptchaenterprise/v2 v2.2.0/go.mod h1:/Zu5jisWGeERrd5HnlS3EUGb/D335f9k51B/FVil0jk= -cloud.google.com/go/recaptchaenterprise/v2 v2.3.0/go.mod h1:O9LwGCjrhGHBQET5CA7dd5NwwNQUErSgEDit1DLNTdo= -cloud.google.com/go/recaptchaenterprise/v2 v2.4.0/go.mod h1:Am3LHfOuBstrLrNCBrlI5sbwx9LBg3te2N6hGvHn2mE= -cloud.google.com/go/recaptchaenterprise/v2 v2.5.0/go.mod h1:O8LzcHXN3rz0j+LBC91jrwI3R+1ZSZEWrfL7XHgNo9U= -cloud.google.com/go/recommendationengine v0.5.0/go.mod h1:E5756pJcVFeVgaQv3WNpImkFP8a+RptV6dDLGPILjvg= -cloud.google.com/go/recommendationengine v0.6.0/go.mod h1:08mq2umu9oIqc7tDy8sx+MNJdLG0fUi3vaSVbztHgJ4= -cloud.google.com/go/recommender v1.5.0/go.mod h1:jdoeiBIVrJe9gQjwd759ecLJbxCDED4A6p+mqoqDvTg= -cloud.google.com/go/recommender v1.6.0/go.mod h1:+yETpm25mcoiECKh9DEScGzIRyDKpZ0cEhWGo+8bo+c= -cloud.google.com/go/recommender v1.7.0/go.mod h1:XLHs/W+T8olwlGOgfQenXBTbIseGclClff6lhFVe9Bs= -cloud.google.com/go/recommender v1.8.0/go.mod h1:PkjXrTT05BFKwxaUxQmtIlrtj0kph108r02ZZQ5FE70= -cloud.google.com/go/redis v1.7.0/go.mod h1:V3x5Jq1jzUcg+UNsRvdmsfuFnit1cfe3Z/PGyq/lm4Y= -cloud.google.com/go/redis v1.8.0/go.mod h1:Fm2szCDavWzBk2cDKxrkmWBqoCiL1+Ctwq7EyqBCA/A= -cloud.google.com/go/redis v1.9.0/go.mod h1:HMYQuajvb2D0LvMgZmLDZW8V5aOC/WxstZHiy4g8OiA= -cloud.google.com/go/redis v1.10.0/go.mod h1:ThJf3mMBQtW18JzGgh41/Wld6vnDDc/F/F35UolRZPM= -cloud.google.com/go/resourcemanager v1.3.0/go.mod h1:bAtrTjZQFJkiWTPDb1WBjzvc6/kifjj4QBYuKCCoqKA= -cloud.google.com/go/resourcemanager v1.4.0/go.mod h1:MwxuzkumyTX7/a3n37gmsT3py7LIXwrShilPh3P1tR0= -cloud.google.com/go/resourcesettings v1.3.0/go.mod h1:lzew8VfESA5DQ8gdlHwMrqZs1S9V87v3oCnKCWoOuQU= -cloud.google.com/go/resourcesettings v1.4.0/go.mod h1:ldiH9IJpcrlC3VSuCGvjR5of/ezRrOxFtpJoJo5SmXg= -cloud.google.com/go/retail v1.8.0/go.mod h1:QblKS8waDmNUhghY2TI9O3JLlFk8jybHeV4BF19FrE4= -cloud.google.com/go/retail v1.9.0/go.mod h1:g6jb6mKuCS1QKnH/dpu7isX253absFl6iE92nHwlBUY= -cloud.google.com/go/retail v1.10.0/go.mod h1:2gDk9HsL4HMS4oZwz6daui2/jmKvqShXKQuB2RZ+cCc= -cloud.google.com/go/retail v1.11.0/go.mod h1:MBLk1NaWPmh6iVFSz9MeKG/Psyd7TAgm6y/9L2B4x9Y= -cloud.google.com/go/run v0.2.0/go.mod h1:CNtKsTA1sDcnqqIFR3Pb5Tq0usWxJJvsWOCPldRU3Do= -cloud.google.com/go/run v0.3.0/go.mod h1:TuyY1+taHxTjrD0ZFk2iAR+xyOXEA0ztb7U3UNA0zBo= -cloud.google.com/go/scheduler v1.4.0/go.mod h1:drcJBmxF3aqZJRhmkHQ9b3uSSpQoltBPGPxGAWROx6s= -cloud.google.com/go/scheduler v1.5.0/go.mod h1:ri073ym49NW3AfT6DZi21vLZrG07GXr5p3H1KxN5QlI= -cloud.google.com/go/scheduler v1.6.0/go.mod h1:SgeKVM7MIwPn3BqtcBntpLyrIJftQISRrYB5ZtT+KOk= -cloud.google.com/go/scheduler v1.7.0/go.mod h1:jyCiBqWW956uBjjPMMuX09n3x37mtyPJegEWKxRsn44= -cloud.google.com/go/secretmanager v1.6.0/go.mod h1:awVa/OXF6IiyaU1wQ34inzQNc4ISIDIrId8qE5QGgKA= -cloud.google.com/go/secretmanager v1.8.0/go.mod h1:hnVgi/bN5MYHd3Gt0SPuTPPp5ENina1/LxM+2W9U9J4= -cloud.google.com/go/secretmanager v1.9.0/go.mod h1:b71qH2l1yHmWQHt9LC80akm86mX8AL6X1MA01dW8ht4= -cloud.google.com/go/security v1.5.0/go.mod h1:lgxGdyOKKjHL4YG3/YwIL2zLqMFCKs0UbQwgyZmfJl4= -cloud.google.com/go/security v1.7.0/go.mod h1:mZklORHl6Bg7CNnnjLH//0UlAlaXqiG7Lb9PsPXLfD0= -cloud.google.com/go/security v1.8.0/go.mod h1:hAQOwgmaHhztFhiQ41CjDODdWP0+AE1B3sX4OFlq+GU= -cloud.google.com/go/security v1.9.0/go.mod h1:6Ta1bO8LXI89nZnmnsZGp9lVoVWXqsVbIq/t9dzI+2Q= -cloud.google.com/go/security v1.10.0/go.mod h1:QtOMZByJVlibUT2h9afNDWRZ1G96gVywH8T5GUSb9IA= -cloud.google.com/go/securitycenter v1.13.0/go.mod h1:cv5qNAqjY84FCN6Y9z28WlkKXyWsgLO832YiWwkCWcU= -cloud.google.com/go/securitycenter v1.14.0/go.mod h1:gZLAhtyKv85n52XYWt6RmeBdydyxfPeTrpToDPw4Auc= -cloud.google.com/go/securitycenter v1.15.0/go.mod h1:PeKJ0t8MoFmmXLXWm41JidyzI3PJjd8sXWaVqg43WWk= -cloud.google.com/go/securitycenter v1.16.0/go.mod h1:Q9GMaLQFUD+5ZTabrbujNWLtSLZIZF7SAR0wWECrjdk= -cloud.google.com/go/servicecontrol v1.4.0/go.mod h1:o0hUSJ1TXJAmi/7fLJAedOovnujSEvjKCAFNXPQ1RaU= -cloud.google.com/go/servicecontrol v1.5.0/go.mod h1:qM0CnXHhyqKVuiZnGKrIurvVImCs8gmqWsDoqe9sU1s= -cloud.google.com/go/servicedirectory v1.4.0/go.mod h1:gH1MUaZCgtP7qQiI+F+A+OpeKF/HQWgtAddhTbhL2bs= -cloud.google.com/go/servicedirectory v1.5.0/go.mod h1:QMKFL0NUySbpZJ1UZs3oFAmdvVxhhxB6eJ/Vlp73dfg= -cloud.google.com/go/servicedirectory v1.6.0/go.mod h1:pUlbnWsLH9c13yGkxCmfumWEPjsRs1RlmJ4pqiNjVL4= -cloud.google.com/go/servicedirectory v1.7.0/go.mod h1:5p/U5oyvgYGYejufvxhgwjL8UVXjkuw7q5XcG10wx1U= -cloud.google.com/go/servicemanagement v1.4.0/go.mod h1:d8t8MDbezI7Z2R1O/wu8oTggo3BI2GKYbdG4y/SJTco= -cloud.google.com/go/servicemanagement v1.5.0/go.mod h1:XGaCRe57kfqu4+lRxaFEAuqmjzF0r+gWHjWqKqBvKFo= -cloud.google.com/go/serviceusage v1.3.0/go.mod h1:Hya1cozXM4SeSKTAgGXgj97GlqUvF5JaoXacR1JTP/E= -cloud.google.com/go/serviceusage v1.4.0/go.mod h1:SB4yxXSaYVuUBYUml6qklyONXNLt83U0Rb+CXyhjEeU= -cloud.google.com/go/shell v1.3.0/go.mod h1:VZ9HmRjZBsjLGXusm7K5Q5lzzByZmJHf1d0IWHEN5X4= -cloud.google.com/go/shell v1.4.0/go.mod h1:HDxPzZf3GkDdhExzD/gs8Grqk+dmYcEjGShZgYa9URw= -cloud.google.com/go/speech v1.6.0/go.mod h1:79tcr4FHCimOp56lwC01xnt/WPJZc4v3gzyT7FoBkCM= -cloud.google.com/go/speech v1.7.0/go.mod h1:KptqL+BAQIhMsj1kOP2la5DSEEerPDuOP/2mmkhHhZQ= -cloud.google.com/go/speech v1.8.0/go.mod h1:9bYIl1/tjsAnMgKGHKmBZzXKEkGgtU+MpdDPTE9f7y0= -cloud.google.com/go/speech v1.9.0/go.mod h1:xQ0jTcmnRFFM2RfX/U+rk6FQNUF6DQlydUSyoooSpco= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= -cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= -cloud.google.com/go/storage v1.23.0/go.mod h1:vOEEDNFnciUMhBeT6hsJIn3ieU5cFRmzeLgDvXzfIXc= -cloud.google.com/go/storage v1.27.0/go.mod h1:x9DOL8TK/ygDUMieqwfhdpQryTeEkhGKMi80i/iqR2s= -cloud.google.com/go/storagetransfer v1.5.0/go.mod h1:dxNzUopWy7RQevYFHewchb29POFv3/AaBgnhqzqiK0w= -cloud.google.com/go/storagetransfer v1.6.0/go.mod h1:y77xm4CQV/ZhFZH75PLEXY0ROiS7Gh6pSKrM8dJyg6I= -cloud.google.com/go/talent v1.1.0/go.mod h1:Vl4pt9jiHKvOgF9KoZo6Kob9oV4lwd/ZD5Cto54zDRw= -cloud.google.com/go/talent v1.2.0/go.mod h1:MoNF9bhFQbiJ6eFD3uSsg0uBALw4n4gaCaEjBw9zo8g= -cloud.google.com/go/talent v1.3.0/go.mod h1:CmcxwJ/PKfRgd1pBjQgU6W3YBwiewmUzQYH5HHmSCmM= -cloud.google.com/go/talent v1.4.0/go.mod h1:ezFtAgVuRf8jRsvyE6EwmbTK5LKciD4KVnHuDEFmOOA= -cloud.google.com/go/texttospeech v1.4.0/go.mod h1:FX8HQHA6sEpJ7rCMSfXuzBcysDAuWusNNNvN9FELDd8= -cloud.google.com/go/texttospeech v1.5.0/go.mod h1:oKPLhR4n4ZdQqWKURdwxMy0uiTS1xU161C8W57Wkea4= -cloud.google.com/go/tpu v1.3.0/go.mod h1:aJIManG0o20tfDQlRIej44FcwGGl/cD0oiRyMKG19IQ= -cloud.google.com/go/tpu v1.4.0/go.mod h1:mjZaX8p0VBgllCzF6wcU2ovUXN9TONFLd7iz227X2Xg= -cloud.google.com/go/trace v1.3.0/go.mod h1:FFUE83d9Ca57C+K8rDl/Ih8LwOzWIV1krKgxg6N0G28= -cloud.google.com/go/trace v1.4.0/go.mod h1:UG0v8UBqzusp+z63o7FK74SdFE+AXpCLdFb1rshXG+Y= -cloud.google.com/go/translate v1.3.0/go.mod h1:gzMUwRjvOqj5i69y/LYLd8RrNQk+hOmIXTi9+nb3Djs= -cloud.google.com/go/translate v1.4.0/go.mod h1:06Dn/ppvLD6WvA5Rhdp029IX2Mi3Mn7fpMRLPvXT5Wg= -cloud.google.com/go/video v1.8.0/go.mod h1:sTzKFc0bUSByE8Yoh8X0mn8bMymItVGPfTuUBUyRgxk= -cloud.google.com/go/video v1.9.0/go.mod h1:0RhNKFRF5v92f8dQt0yhaHrEuH95m068JYOvLZYnJSw= -cloud.google.com/go/videointelligence v1.6.0/go.mod h1:w0DIDlVRKtwPCn/C4iwZIJdvC69yInhW0cfi+p546uU= -cloud.google.com/go/videointelligence v1.7.0/go.mod h1:k8pI/1wAhjznARtVT9U1llUaFNPh7muw8QyOUpavru4= -cloud.google.com/go/videointelligence v1.8.0/go.mod h1:dIcCn4gVDdS7yte/w+koiXn5dWVplOZkE+xwG9FgK+M= -cloud.google.com/go/videointelligence v1.9.0/go.mod h1:29lVRMPDYHikk3v8EdPSaL8Ku+eMzDljjuvRs105XoU= -cloud.google.com/go/vision v1.2.0/go.mod h1:SmNwgObm5DpFBme2xpyOyasvBc1aPdjvMk2bBk0tKD0= -cloud.google.com/go/vision/v2 v2.2.0/go.mod h1:uCdV4PpN1S0jyCyq8sIM42v2Y6zOLkZs+4R9LrGYwFo= -cloud.google.com/go/vision/v2 v2.3.0/go.mod h1:UO61abBx9QRMFkNBbf1D8B1LXdS2cGiiCRx0vSpZoUo= -cloud.google.com/go/vision/v2 v2.4.0/go.mod h1:VtI579ll9RpVTrdKdkMzckdnwMyX2JILb+MhPqRbPsY= -cloud.google.com/go/vision/v2 v2.5.0/go.mod h1:MmaezXOOE+IWa+cS7OhRRLK2cNv1ZL98zhqFFZaaH2E= -cloud.google.com/go/vmmigration v1.2.0/go.mod h1:IRf0o7myyWFSmVR1ItrBSFLFD/rJkfDCUTO4vLlJvsE= -cloud.google.com/go/vmmigration v1.3.0/go.mod h1:oGJ6ZgGPQOFdjHuocGcLqX4lc98YQ7Ygq8YQwHh9A7g= -cloud.google.com/go/vpcaccess v1.4.0/go.mod h1:aQHVbTWDYUR1EbTApSVvMq1EnT57ppDmQzZ3imqIk4w= -cloud.google.com/go/vpcaccess v1.5.0/go.mod h1:drmg4HLk9NkZpGfCmZ3Tz0Bwnm2+DKqViEpeEpOq0m8= -cloud.google.com/go/webrisk v1.4.0/go.mod h1:Hn8X6Zr+ziE2aNd8SliSDWpEnSS1u4R9+xXZmFiHmGE= -cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuWDEEsqMTg= -cloud.google.com/go/webrisk v1.6.0/go.mod h1:65sW9V9rOosnc9ZY7A7jsy1zoHS5W9IAXv6dGqhMQMc= -cloud.google.com/go/webrisk v1.7.0/go.mod h1:mVMHgEYH0r337nmt1JyLthzMr6YxwN1aAIEc2fTcq7A= -cloud.google.com/go/websecurityscanner v1.3.0/go.mod h1:uImdKm2wyeXQevQJXeh8Uun/Ym1VqworNDlBXQevGMo= -cloud.google.com/go/websecurityscanner v1.4.0/go.mod h1:ebit/Fp0a+FWu5j4JOmJEV8S8CzdTkAS77oDsiSqYWQ= -cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0= -cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= -cloud.google.com/go/workflows v1.8.0/go.mod h1:ysGhmEajwZxGn1OhGOGKsTXc5PyxOc0vfKf5Af+to4M= -cloud.google.com/go/workflows v1.9.0/go.mod h1:ZGkj1aFIOd9c8Gerkjjq7OW7I5+l6cSvT3ujaO/WwSA= contrib.go.opencensus.io/exporter/prometheus v0.4.1 h1:oObVeKo2NxpdF/fIfrPsNj6K0Prg0R0mHM+uANlYMiM= contrib.go.opencensus.io/exporter/prometheus v0.4.1/go.mod h1:t9wvfitlUjGXG2IXAZsuFq26mDGid/JwCEXp+gTG/9U= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -dubbo.apache.org/dubbo-go/v3 v3.0.6-0.20230516071747-5b2397c8b0b0 h1:i3ISiXADEOlzWu9jmksVTIZFWPElO+6UxlYtriYE3D8= -dubbo.apache.org/dubbo-go/v3 v3.0.6-0.20230516071747-5b2397c8b0b0/go.mod h1:V65HgmjrKf6xOK35nJCBk24jssuoLDF2G1LAQ1IjRuw= +dubbo.apache.org/dubbo-go/v3 v3.0.5 h1:14GKXcCJ4/Z5l3KQiQJ7xDoUNlZs0uo5OMi41ykNn+o= +dubbo.apache.org/dubbo-go/v3 v3.0.5/go.mod h1:87jr5U/NZGMkzGLsmbwXTxVh8h2MnaGOjHj/aHwf0ZM= +github.com/AdaLogics/go-fuzz-headers v0.0.0-20230106234847-43070de90fa1 h1:EKPd1INOIyr5hWOWhvpmQpY6tKjeG0hT1s3AMC/9fic= +github.com/AdaLogics/go-fuzz-headers v0.0.0-20230106234847-43070de90fa1/go.mod h1:VzwV+t+dZ9j/H867F1M2ziD+yLHtB46oM35FxxMJ4d0= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= @@ -388,15 +63,16 @@ github.com/MakeNowJust/heredoc v1.0.0/go.mod h1:mG5amYoWBHf8vpLOuehzbGGw0EHxpZZ6 github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= -github.com/Masterminds/semver/v3 v3.2.0 h1:3MEsd0SM6jqZojhjLWWeBY+Kcjy9i6MQAeY7YgDP83g= github.com/Masterminds/semver/v3 v3.2.0/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= +github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0rYXWg0= +github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= github.com/Masterminds/sprig/v3 v3.2.1/go.mod h1:UoaO7Yp8KlPnJIYWTFkMaqPUYKTfGFPhxNuwnnxkKlk= github.com/Masterminds/sprig/v3 v3.2.3 h1:eL2fZNezLomi0uOLqjQoN6BfsDD+fyLtgbJMAj9n6YA= github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBaRMhvYXJNkGuM= -github.com/Masterminds/squirrel v1.5.3 h1:YPpoceAcxuzIljlr5iWpNKaql7hLeG1KLSrhvdHpkZc= -github.com/Masterminds/squirrel v1.5.3/go.mod h1:NNaOrjSoIDfDA40n7sr2tPNZRfjzjA400rg+riTZj10= -github.com/Microsoft/go-winio v0.5.2 h1:a9IhgEQBCUEk6QCdml9CiJGhAws+YwffDHEMp1VMrpA= -github.com/Microsoft/hcsshim v0.9.6 h1:VwnDOgLeoi2du6dAznfmspNqTiwczvjv4K7NxuY9jsY= +github.com/Masterminds/squirrel v1.5.4 h1:uUcX/aBc8O7Fg9kaISIUsHXdKuqehiXAMQTYX8afzqM= +github.com/Masterminds/squirrel v1.5.4/go.mod h1:NNaOrjSoIDfDA40n7sr2tPNZRfjzjA400rg+riTZj10= +github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg= +github.com/Microsoft/hcsshim v0.10.0-rc.7 h1:HBytQPxcv8Oy4244zbQbe6hnOnx544eL5QPUqhJldz8= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/RageCage64/multilinediff v0.2.0 h1:yNSpSF5NXIrmo6bRIgO4Q0g7SXqFD4j/WEcBE+BdCFY= github.com/RageCage64/multilinediff v0.2.0/go.mod h1:pKr+KLgP0gvRzA+yv0/IUaYQuBYN1ucWysvsL58aMP0= @@ -426,12 +102,13 @@ github.com/aliyun/alibaba-cloud-sdk-go v1.61.18/go.mod h1:v8ESoHo4SyHmuB4b1tJqDH github.com/aliyun/alibaba-cloud-sdk-go v1.61.1704 h1:PpfENOj/vPfhhy9N2OFRjpue0hjM5XqAp2thFmkXXIk= github.com/aliyun/alibaba-cloud-sdk-go v1.61.1704/go.mod h1:RcDobYh8k5VP6TNybz9m++gL3ijVI5wueVr0EM10VsU= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/apache/dubbo-getty v1.4.9 h1:Y8l1EYJqIc7BnmyfYtvG4H4Nmu4v7P1uS31fFQGdJzM= -github.com/apache/dubbo-getty v1.4.9/go.mod h1:6qmrqBSPGs3B35zwEuGhEYNVsx1nfGT/xzV2yOt2amM= +github.com/apache/dubbo-getty v1.4.9-0.20221022181821-4dc6252ce98c h1:2LE4IlyVBBlMo0ZDI+vq9YIb35dyij1YR5EnNWVPnNQ= +github.com/apache/dubbo-getty v1.4.9-0.20221022181821-4dc6252ce98c/go.mod h1:6qmrqBSPGs3B35zwEuGhEYNVsx1nfGT/xzV2yOt2amM= github.com/apache/dubbo-go-hessian2 v1.9.1/go.mod h1:xQUjE7F8PX49nm80kChFvepA/AvqAZ0oh/UaB6+6pBE= github.com/apache/dubbo-go-hessian2 v1.9.3/go.mod h1:xQUjE7F8PX49nm80kChFvepA/AvqAZ0oh/UaB6+6pBE= -github.com/apache/dubbo-go-hessian2 v1.12.0 h1:n2JXPMGc4u/ihBbOt25d3mmv1k92X9TvLnqfgyNscKQ= -github.com/apache/dubbo-go-hessian2 v1.12.0/go.mod h1:QP9Tc0w/B/mDopjusebo/c7GgEfl6Lz8jeuFg8JA6yw= +github.com/apache/dubbo-go-hessian2 v1.11.4/go.mod h1:QP9Tc0w/B/mDopjusebo/c7GgEfl6Lz8jeuFg8JA6yw= +github.com/apache/dubbo-go-hessian2 v1.11.5 h1:rcK22+yMw2Hejm6GRG7WrdZ0DinW2QMZc01c7YVZjcQ= +github.com/apache/dubbo-go-hessian2 v1.11.5/go.mod h1:QP9Tc0w/B/mDopjusebo/c7GgEfl6Lz8jeuFg8JA6yw= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= @@ -485,7 +162,7 @@ github.com/bytedance/sonic v1.9.1/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZX github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= -github.com/cenkalti/backoff/v4 v4.1.3 h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8UtC4= +github.com/cenkalti/backoff/v4 v4.2.0 h1:HN5dHm3WBOgndBH6E8V0q2jIYIR3s9yglV8k/+MN3u4= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/census-instrumentation/opencensus-proto v0.4.1 h1:iKLQ0xPNFxR/2hzXZMrBo8f1j86j5WHzznCCQxV/b8g= github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91VeyqjLS6ao50K5bOcLKN6Q42XnYaRYw= @@ -518,17 +195,17 @@ github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20220314180256-7f1daf1720fc/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20230105202645-06c439db220b h1:ACGZRIr7HsgBKHsueQ1yM4WaVaXh21ynwqsF8M8tXhA= -github.com/cncf/xds/go v0.0.0-20230105202645-06c439db220b/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4 h1:/inchEIKaYC1Akx+H+gqO04wryn5h75LSazbRlnya1k= +github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h6jFvWxBdQXxjopDMZyH2UVceIRfR84bdzbkoKrsWNo= github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA= github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/containerd/cgroups v1.0.4 h1:jN/mbWBEaz+T1pi5OFtnkQ+8qnmEbAr1Oo1FRm5B0dA= -github.com/containerd/containerd v1.6.18 h1:qZbsLvmyu+Vlty0/Ex5xc0z2YtKpIsb5n45mAMI+2Ns= -github.com/containerd/containerd v1.6.18/go.mod h1:1RdCUu95+gc2v9t3IL+zIlpClSmew7/0YS8O5eQZrOw= +github.com/containerd/cgroups v1.1.0 h1:v8rEWFl6EoqHB+swVNjVoCJE8o3jX7e8nqBGPLaDFBM= +github.com/containerd/containerd v1.7.0 h1:G/ZQr3gMZs6ZT0qPUZ15znx5QSdQdASW11nXTLTM2Pg= +github.com/containerd/containerd v1.7.0/go.mod h1:QfR7Efgb/6X2BDpTPJRvPTYDE9rsF0FsXX9J8sIs/sc= +github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= @@ -538,8 +215,9 @@ github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3Ee github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.1.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= -github.com/coreos/go-systemd/v22 v22.3.2 h1:D9/bQk5vlXQFZ6Kwuu6zaiXJ9oTPe68++AzAJc1DzSI= github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= +github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs= +github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= @@ -576,8 +254,8 @@ github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5Xh github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c h1:+pKlWGMw7gf6bQ+oDZB4KHQFypsfjYlq/C4rfL7D3g8= github.com/docker/go-metrics v0.0.1 h1:AgB/0SvBxihN0X8OR4SjsblXkbMvalQ8cjmtKQ2rQV8= github.com/docker/go-metrics v0.0.1/go.mod h1:cG1hvH2utMXtqgqqYE9plW6lDxS3/5ayHzueweSI3Vw= -github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= -github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= +github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docker/libtrust v0.0.0-20150114040149-fa567046d9b1 h1:ZClxb8laGDf5arXfYcAtECDFgAgHklGI8CxgjHnXKJ4= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/dubbogo/go-zookeeper v1.0.3/go.mod h1:fn6n2CAEer3novYgk9ULLwAjuV8/g4DdC2ENwRb6E+c= @@ -595,17 +273,15 @@ github.com/dubbogo/grpc-go v1.42.10/go.mod h1:JMkPt1mIHL96GAFeYsMoMjew6f1ROKycik github.com/dubbogo/jsonparser v1.0.1/go.mod h1:tYAtpctvSP/tWw4MeelsowSPgXQRVHHWbqL6ynps8jU= github.com/dubbogo/net v0.0.4/go.mod h1:1CGOnM7X3he+qgGNqjeADuE5vKZQx/eMSeUkpU3ujIc= github.com/dubbogo/triple v1.0.9/go.mod h1:1t9me4j4CTvNDcsMZy6/OGarbRyAUSY0tFXGXHCp7Iw= -github.com/dubbogo/triple v1.2.2-rc3 h1:9rxLqru35MmJkypCHJMiZb1VzwH+zmbPBend9Cq+VOI= -github.com/dubbogo/triple v1.2.2-rc3/go.mod h1:9pgEahtmsY/avYJp3dzUQE8CMMVe1NtGBmUhfICKLJk= +github.com/dubbogo/triple v1.2.2-rc2 h1:2AaLd+uKwnNnR3qOIXTNPU/OHk77qIDNGMX3GstEtaY= +github.com/dubbogo/triple v1.2.2-rc2/go.mod h1:8qprF2uJX82IE5hjiIuswp416sEr0oL/+bb7IjiizYs= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= -github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= -github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153 h1:yUdfgN0XgIJw7foRItutHYUIhlcKzcSf5vDpdhQAKTc= github.com/emicklei/go-restful/v3 v3.10.1 h1:rc42Y5YTp7Am7CS630D7JmhRjq4UlEUuEKfrDac4bSQ= github.com/emicklei/go-restful/v3 v3.10.1/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= @@ -620,11 +296,11 @@ github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go. github.com/envoyproxy/go-control-plane v0.10.0/go.mod h1:AY7fTTXNdv/aJ2O5jwpxAPOWUZ7hQAEvzN5Pf27BkQQ= github.com/envoyproxy/go-control-plane v0.10.1/go.mod h1:AY7fTTXNdv/aJ2O5jwpxAPOWUZ7hQAEvzN5Pf27BkQQ= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= -github.com/envoyproxy/go-control-plane v0.11.0 h1:jtLewhRR2vMRNnq2ZZUoCjUlgut+Y0+sDDWPOfwOi1o= -github.com/envoyproxy/go-control-plane v0.11.0/go.mod h1:VnHyVMpzcLvCFt9yUz1UnCwHLhwx1WguiVDV7pTG/tI= +github.com/envoyproxy/go-control-plane v0.11.1-0.20230524094728-9239064ad72f h1:7T++XKzy4xg7PKy+bM+Sa9/oe1OC88yz2hXQUISoXfA= +github.com/envoyproxy/go-control-plane v0.11.1-0.20230524094728-9239064ad72f/go.mod h1:sfYdkwUW4BA3PbKjySwjJy+O4Pu0h62rlqCMHNk+K+Q= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/envoyproxy/protoc-gen-validate v0.9.1 h1:PS7VIOgmSVhWUEeZwTe7z7zouA22Cr590PzXKbZHOVY= -github.com/envoyproxy/protoc-gen-validate v0.9.1/go.mod h1:OKNgG7TCp5pF4d6XftA0++PMirau2/yoOwVac3AbF2w= +github.com/envoyproxy/protoc-gen-validate v0.10.1 h1:c0g45+xCJhdgFGw7a5QAfdS4byAbud7miNWJ1WwEVf8= +github.com/envoyproxy/protoc-gen-validate v0.10.1/go.mod h1:DRjgyB0I43LtJapqN6NiRwroiAU2PaFuvk/vjgh61ss= github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5 h1:Yzb9+7DPaBjB8zlTR87/ElzFsnQfuHnVUVqpZZIcV5Y= github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5/go.mod h1:a2zkGnVExMxdzMo3M0Hi/3sEU+cWnZpSni0O6/Yb/P0= github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U= @@ -644,7 +320,7 @@ github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= -github.com/form3tech-oss/jwt-go v3.2.3+incompatible h1:7ZaBxOI7TMoYBfyA3cQHErNNyAWIKUMIwqxEtgHOs5c= +github.com/foxcpp/go-mockdns v1.0.0 h1:7jBqxd3WDWwi/6WhDvacvH1XsN3rOLXyHM1uhvIx6FI= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= github.com/frankban/quicktest v1.10.0/go.mod h1:ui7WezCLWMWxVWr1GETZY3smRy0G4KWq9vcPtJmFl7Y= @@ -662,15 +338,12 @@ github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg= github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= -github.com/glebarez/go-sqlite v1.21.1 h1:7MZyUPh2XTrHS7xNEHQbrhfMZuPSzhkm2A1qgg0y5NY= -github.com/glebarez/go-sqlite v1.21.1/go.mod h1:ISs8MF6yk5cL4n/43rSOmVMGJJjHYr7L2MbZZ5Q4E2E= -github.com/glebarez/sqlite v1.8.0 h1:02X12E2I/4C1n+v90yTqrjRa8yuo7c3KeHI3FRznCvc= -github.com/glebarez/sqlite v1.8.0/go.mod h1:bpET16h1za2KOOMb8+jCp6UBP/iahDpfPQqSaYLTLx8= github.com/go-asn1-ber/asn1-ber v1.3.1/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0= github.com/go-co-op/gocron v1.9.0 h1:+V+DDenw3ryB7B+tK1bAIC5p0ruw4oX9IqAsdRnGIf0= github.com/go-co-op/gocron v1.9.0/go.mod h1:DbJm9kdgr1sEvWpHCA7dFFs/PGHPMil9/97EXCRPr4k= -github.com/go-errors/errors v1.0.1 h1:LUHzmkK3GUKUrL/1gfBUxAHzcev3apQlezX/+O7ma6w= github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= +github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= +github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -680,8 +353,8 @@ github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2 github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= -github.com/go-kit/log v0.2.0 h1:7i2K3eKTos3Vc0enKCfnVcgHh2olr/MyfboYq7cAcFw= -github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= +github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= +github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-ldap/ldap v3.0.2+incompatible/go.mod h1:qfd9rJvER9Q0/D/Sqn1DfHRoBp40uXYvFoEVrNEPqRc= github.com/go-ldap/ldap/v3 v3.1.10/go.mod h1:5Zun81jBTabRaI8lzN7E1JjyEl1g6zI6u9pd8luAK4Q= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= @@ -691,29 +364,30 @@ github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNV github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= +github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-logr/zapr v1.2.3 h1:a9vnzlIBPQBBkeaR9IuMUfmVOrQlkoC4YfPoFkX3T7A= +github.com/go-logr/zapr v1.2.4 h1:QHVo+6stLbfJmYGkQ7uGHUCu5hnAFAj6mDe6Ea0SeOo= github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM= github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= -github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= -github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.20.0 h1:MYlu0sBgChmCfJxxUKZ8g1cPWFOB37YSZqewK7OKeyA= -github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.14 h1:gm3vOOXfiuw5i9p5N9xJvfjvuofpyvLA9Wr6QfK5Fng= -github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= +github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= +github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= +github.com/go-openapi/jsonreference v0.20.1 h1:FBLnyygC4/IZZr893oiomc9XaghoveYTrLC1F86HID8= +github.com/go-openapi/jsonreference v0.20.1/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= +github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= +github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= -github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= +github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= +github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= -github.com/go-playground/validator/v10 v10.12.0/go.mod h1:hCAPuzYvKdP33pxWa+2+6AIKXEKqjIUyqsNCtbsSJrA= +github.com/go-playground/validator/v10 v10.11.0/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4dMGDBiPU55YFDl0WbKdWU= github.com/go-playground/validator/v10 v10.14.0 h1:vgvQWe3XCz3gIeFDm/HnTIbj6UGmg/+t63MyGU2n5js= github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= github.com/go-resty/resty/v2 v2.7.0 h1:me+K9p3uhSmXtrBZ4k9jcEAfJmuC8IivWHwaLZwPrFY= @@ -724,6 +398,7 @@ github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LB github.com/go-sql-driver/mysql v1.7.0 h1:ueSltNNllEqE3qcWBTD0iQd3IpL/6U+mJxLkazJ7YPc= github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= github.com/go-test/deep v1.0.2-0.20181118220953-042da051cf31/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/gobuffalo/logger v1.0.6 h1:nnZNpxYo0zx+Aj9RfMPBm+x9zAU2OayFh/xrAWi34HU= @@ -789,11 +464,11 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/gomodule/redigo v1.8.2 h1:H5XSIre1MB5NbPYFp+i1NBbb5qN1W8Y8YAQoAYbkm8k= @@ -832,7 +507,6 @@ github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/ github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= @@ -842,13 +516,9 @@ github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26 h1:Xim43kblpZXfIBQsbuBVKCudVG457BR2GZFIz3uw3hQ= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= @@ -859,20 +529,8 @@ github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/yamlfmt v0.9.0 h1:spfe6s8BvtplRZ2kDB61PYmqKWEz1vy9GsNg3ltDYvA= github.com/google/yamlfmt v0.9.0/go.mod h1:jW0ice5/S1EBCHhIV9rkGVfUjyCXD1cTlddkKwI8TKo= -github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= -github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= -github.com/googleapis/enterprise-certificate-proxy v0.2.0/go.mod h1:8C0jb7/mgJe/9KK8Lm7X9ctZC2t60YyIpYEI16jx0Qg= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= -github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= -github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/OthfcblKl4IGNaM= -github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM= -github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= -github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqEF02fYlzkUCyo= -github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY= -github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= -github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v0.0.0-20190910122728-9d188e94fb99 h1:twflg0XRTjwKpxb/jFExr4HGq6on2dEOmnL6FV+fgPw= github.com/gopherjs/gopherjs v0.0.0-20190910122728-9d188e94fb99/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= @@ -902,9 +560,7 @@ github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t github.com/grpc-ecosystem/grpc-gateway v1.14.6/go.mod h1:zdiPV4Yse/1gnckTHtghG4GkDEdKCRJduHpTxT3/jcw= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks= github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3 h1:lLT7ZLSzGLI08vc9cpd+tYmNWjdKDqyr/2L+f6U12Fk= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3/go.mod h1:o//XUCC/F+yRGJoPO/VU0GSB0f8Nhgmxx0VIRUvaC0w= github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 h1:MJG/KsmcqMwFAkh8mTnAwhyKoB+sTAnY4CACC110tbU= github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645/go.mod h1:6iZfnjpejD4L/4DwD7NryNaJyCQdzwWwH2MWhCA90Kw= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= @@ -983,7 +639,6 @@ github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq github.com/huandu/xstrings v1.4.0 h1:D17IlohoQq4UcpqD7fDk80P7l+lwAmlFaBHgOipl2FU= github.com/huandu/xstrings v1.4.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= -github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= @@ -1003,7 +658,6 @@ github.com/jinzhu/gorm v1.9.2/go.mod h1:Vla75njaFJ8clLU1W44h34PjIkijhjHIYnZxMqCd github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= github.com/jinzhu/now v1.1.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= -github.com/jinzhu/now v1.1.4/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= @@ -1048,8 +702,8 @@ github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvW github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.11.13 h1:eSvu8Tmq6j2psUJqJrLcWH6K3w5Dwc+qipbaA6eVEN4= -github.com/klauspost/compress v1.11.13/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= +github.com/klauspost/compress v1.16.0 h1:iULayQNOReoYUe+1qtKOqw9CwJv3aNQu8ivo7lw1HU4= +github.com/klauspost/compress v1.16.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.2.4 h1:acbojRNwl3o09bUq+yDCtZFc1aiwaAAxtcn8YkZXnvk= github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= @@ -1077,7 +731,7 @@ github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 h1:SOEGU9fKiNWd/HOJuq github.com/lann/builder v0.0.0-20180802200727-47ae307949d0/go.mod h1:dXGbAdH5GtBTC4WfIxhKZfyBF/HBFgRZSWwZ9g/He9o= github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 h1:P6pPBnrTSX3DEVR4fDembhRWSsG5rVo6hYhAB/ADZrk= github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0/go.mod h1:vmVJ0l/dxyfGW6FmdpVm2joNMFikkuWg0EoCKLGUMNw= -github.com/leodido/go-urn v1.2.2/go.mod h1:kUaIbLZWttglzwNuG0pgsh5vuV6u2YcGBYz1hIPjtOQ= +github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q= github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= github.com/lestrrat/go-envload v0.0.0-20180220120943-6ed08b54a570/go.mod h1:BLt8L9ld7wVsvEWQbuLrUZnCMnUmLZ+CGDzKtclrTlE= @@ -1085,33 +739,31 @@ github.com/lestrrat/go-file-rotatelogs v0.0.0-20180223000712-d3151e2a480f/go.mod github.com/lestrrat/go-strftime v0.0.0-20180220042222-ba3bf9c1d042/go.mod h1:TPpsiPUEh0zFL1Snz4crhMlBe60PYxRHr5oFF3rRYg0= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.8.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= +github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de h1:9TO3cAIGXtEhnIaL+V+BEER86oLrvS+kWobKpbJuye0= github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= -github.com/lyft/protoc-gen-star v0.6.1/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA= -github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/markbates/errx v1.1.0 h1:QDFeR+UP95dO12JgW+tgi2UVfo0V8YBHiUIOaeBPiEI= github.com/markbates/errx v1.1.0/go.mod h1:PLa46Oex9KNbVDZhKel8v1OT7hD5JZ2eI7AHhA0wswc= github.com/markbates/oncer v1.0.0 h1:E83IaVAHygyndzPimgUYJjbshhDTALZyXxvk9FOlQRY= github.com/markbates/oncer v1.0.0/go.mod h1:Z59JA581E9GP6w96jai+TGqafHPW+cPfRxz2aSZ0mcI= github.com/markbates/safe v1.0.1 h1:yjZkbvRM6IzKj9tlu/zMJLS0n/V351OZWRnF3QfaUxI= github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= -github.com/mattbaird/jsonpatch v0.0.0-20200820163806-098863c1fc24 h1:uYuGXJBAi1umT+ZS4oQJUgKtfXCAYTR+n9zw1ViT0vA= -github.com/mattbaird/jsonpatch v0.0.0-20200820163806-098863c1fc24/go.mod h1:M1qoD/MqPgTZIk0EWKB38wE28ACRfVcn+cU08jyArI0= +github.com/mattbaird/jsonpatch v0.0.0-20230413205102-771768614e91 h1:JnZSkFP1/GLwKCEuuWVhsacvbDQIVa5BRwAwd+9k2Vw= +github.com/mattbaird/jsonpatch v0.0.0-20230413205102-771768614e91/go.mod h1:M1qoD/MqPgTZIk0EWKB38wE28ACRfVcn+cU08jyArI0= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= @@ -1137,12 +789,14 @@ github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m github.com/mattn/go-sqlite3 v1.14.3/go.mod h1:WVKg1VTActs4Qso6iwGbiFih2UIHo0ENGwNd0Lj+XmI= github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/mattn/go-sqlite3 v1.14.15/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= -github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y= +github.com/mattn/go-sqlite3 v1.14.17 h1:mCRHCLDUBXgpKAqIKsaAaAsrAlbkeomtRFKXh2L6YIM= +github.com/mattn/go-sqlite3 v1.14.17/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= +github.com/miekg/dns v1.1.41 h1:WMszZWJG0XmzbK9FEmzH2TVcqYzFesusSIB41b8KHxY= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= @@ -1171,7 +825,7 @@ github.com/moby/locker v1.0.1 h1:fOXqR41zeveg4fFODix+1Ch4mj/gT0NE1XJbp/epuBg= github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc= github.com/moby/spdystream v0.2.0 h1:cjW1zVyyoiM0T7b6UoySUFqzXMoqRckQtXwGPiBhOM8= github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= -github.com/moby/sys/mountinfo v0.5.0 h1:2Ks8/r6lopsxWi9m58nlwjaeSzUX9iiL1vj5qB/9ObI= +github.com/moby/sys/mountinfo v0.6.2 h1:BzJjoreD5BMFNmD9Rus6gdd1pLuecOFPt8wC+Vygl78= github.com/moby/term v0.0.0-20221205130635-1aeaba878587 h1:HfkjXDfhgVaN5rmueG8cL8KKeFNecRCXFhaJ2qZ5SKA= github.com/moby/term v0.0.0-20221205130635-1aeaba878587/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -1221,14 +875,14 @@ github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852/go.mod h1:eqOVx github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0 h1:WSHQ+IS43OoUrWtD1/bbclrwK8TTH5hzp+umCiuxHgs= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo/v2 v2.6.0 h1:9t9b9vRUbFq3C4qKFCGkVuq/fIHji802N1nrtkh1mNc= +github.com/onsi/ginkgo/v2 v2.9.5 h1:+6Hr4uxzP4XIUyAkg61dWBw8lb/gc4/X5luuxN/EC+Q= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.24.1 h1:KORJXNNTzJXzu4ScJWssJfJMnJ+2QJqhoQSRwNlze9E= +github.com/onsi/gomega v1.27.7 h1:fVih9JD6ogIiHUN6ePK7HJidyEDpWGVB5mzM7cWNXoU= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= -github.com/opencontainers/image-spec v1.1.0-rc2 h1:2zx/Stx4Wc5pIPDvIxHXvXtQFW/7XWJGmnM7r3wg034= -github.com/opencontainers/image-spec v1.1.0-rc2/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ= +github.com/opencontainers/image-spec v1.1.0-rc2.0.20221005185240-3a7f492d3f1b h1:YWuSjZCQAPM8UUBLkYUk1e+rZcvWHJmFb6i6rM44Xs8= +github.com/opencontainers/image-spec v1.1.0-rc2.0.20221005185240-3a7f492d3f1b/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ= github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= @@ -1265,7 +919,6 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= -github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/polarismesh/polaris-go v1.3.0 h1:KZKX//ow4OPPoS5+s7h07ptprg+2AcNVGrN6WakC9QM= @@ -1291,16 +944,16 @@ github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqr github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= -github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw= -github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y= +github.com/prometheus/client_golang v1.15.1 h1:8tXpTmJbyH5lydzFPoxSIJ0J46jdh3tylbvM1xCv0LI= +github.com/prometheus/client_golang v1.15.1/go.mod h1:e9yaBhRPU2pPNsZwE+JdQl0KEt1N9XgF6zxWmaC0xOk= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= -github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= +github.com/prometheus/client_model v0.4.0 h1:5lQXD3cAg1OXBf4Wq03gTrXHeaV0TQvGfUooCfx1yqY= +github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= @@ -1313,8 +966,8 @@ github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16 github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.28.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.37.0 h1:ccBbHCgIiT9uSoFY0vX8H3zsNR5eLt17/RQLUvn8pXE= -github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= +github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM= +github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= @@ -1325,15 +978,12 @@ github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4O github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= -github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= +github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI= +github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY= github.com/prometheus/statsd_exporter v0.21.0 h1:hA05Q5RFeIjgwKIYEdFd59xu5Wwaznf33yKI+pyX6T8= github.com/prometheus/statsd_exporter v0.21.0/go.mod h1:rbT83sZq2V+p73lHhPZfMc3MLCHmSHelCh9hSGYNLTQ= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= -github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= -github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/rhnvrm/simples3 v0.6.1/go.mod h1:Y+3vYm2V7Y4VijFoJHHTrja6OgPrJ2cBti8dPGkC3sA= github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= @@ -1342,14 +992,13 @@ github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6L github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= -github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rubenv/sql-migrate v1.3.1 h1:Vx+n4Du8X8VTYuXbhNxdEUoh6wiJERA0GlWocR5FrbA= github.com/rubenv/sql-migrate v1.3.1/go.mod h1:YzG/Vh82CwyhTFXy+Mf5ahAiiEOpAlHurg+23VEzcsk= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/rwtodd/Go.Sed v0.0.0-20210816025313-55464686f9ef/go.mod h1:8AEUvGVi2uQ5b24BIhcr0GCcpd/RNAFWaN2CJFrWIIQ= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= @@ -1384,10 +1033,7 @@ github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasO github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= -github.com/spf13/afero v1.9.2 h1:j49Hj62F0n+DaZ1dDCvhABaPNSGNkt32oRFxI33IEMw= -github.com/spf13/afero v1.9.2/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= @@ -1399,7 +1045,6 @@ github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t6 github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA= github.com/spf13/cobra v1.6.1/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= @@ -1407,7 +1052,6 @@ github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/spf13/viper v1.8.1 h1:Kq1fyeebqsBfbjZj4EL7gj2IO0mMaiyjYUWcUsl2O44= github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= @@ -1430,16 +1074,14 @@ github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY= github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tebeka/strftime v0.1.3/go.mod h1:7wJm3dZlpr4l/oVK0t1HYIc4rMzQ2XJlOMIUJUJH6XQ= github.com/tidwall/gjson v1.14.4 h1:uo0p8EbA09J7RQaflQ1aBRffTR7xedD2bcIVSYxLnkM= github.com/tidwall/gjson v1.14.4/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= +github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs= github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= -github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4= -github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= github.com/tklauser/go-sysconf v0.3.6/go.mod h1:MkWzOF4RMCshBAMXuhXJs64Rte09mITnppBXY/rYEFI= github.com/tklauser/go-sysconf v0.3.9/go.mod h1:11DU/5sG7UexIrp/O6g35hrWzu0JxlwQ3LSFUzyeuhs= github.com/tklauser/go-sysconf v0.3.10 h1:IJ1AZGZRWbY8T5Vfk04D9WOA5WSejdflXxP03OUqALw= @@ -1451,14 +1093,14 @@ github.com/tklauser/numcpus v0.4.0/go.mod h1:1+UI3pD8NW14VMwdgJNJ1ESk2UnwhAnz5hM github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20200427203606-3cfed13b9966/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802 h1:uruHq4dN7GR16kFc5fp3d1RIYzJW5onx8Ybykw2YQFA= github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75 h1:6fotK7otjonDflCTK0BCfls4SPy3NcCVb5dqqmbRknE= github.com/toolkits/concurrent v0.0.0-20150624120057-a4371d70e3e3/go.mod h1:QDlpd3qS71vYtakd2hmdpqhJ9nwv6mD6A30bQ1BPBFE= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= -github.com/uber/jaeger-client-go v2.29.1+incompatible h1:R9ec3zO3sGpzs0abd43Y+fBZRJ9uiH6lXyR/+u6brW4= -github.com/uber/jaeger-client-go v2.29.1+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= +github.com/uber/jaeger-client-go v2.30.0+incompatible h1:D6wyKGCecFaSRUpo8lCVbaOOb6ThwMmTEbhRwtKR97o= +github.com/uber/jaeger-client-go v2.30.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= github.com/uber/jaeger-lib v2.4.1+incompatible h1:td4jdvLcExb4cBISKIpHuGoVXh+dVKhn2Um6rjCsSsg= github.com/uber/jaeger-lib v2.4.1+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= @@ -1470,8 +1112,9 @@ github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijb github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/vcraescu/go-paginator v1.0.0 h1:ilNmRhlgG8N44LuxfGoPI2u8guXMA6gUqaPGA5BmRFs= github.com/vcraescu/go-paginator v1.0.0/go.mod h1:caZCjjt2qcA1O2aDzW7lwAcK4Rxw3LNvdEVF/ONxZWw= -github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= +github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo= +github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74= @@ -1496,7 +1139,7 @@ github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f h1 go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= -go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= +go.etcd.io/bbolt v1.3.7 h1:j+zJOnnEjF/kyHlDDgGnVL/AIqIJPq8UoB2GSNfkUfQ= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738 h1:VcrIfasaLFkyjk6KNlXQSzO+B0fZcnECiDrKJsfxka0= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.etcd.io/etcd/api/v3 v3.5.0-alpha.0/go.mod h1:mPcW6aZJukV6Aa81LSKpBjQXTWlXB5r74ymPoSWa3Sw= @@ -1510,17 +1153,17 @@ go.etcd.io/etcd/client/pkg/v3 v3.5.7 h1:y3kf5Gbp4e4q7egZdn5T7W9TSHUvkClN6u+Rq9mE go.etcd.io/etcd/client/pkg/v3 v3.5.7/go.mod h1:o0Abi1MK86iad3YrWhgUsbGx1pmTS+hrORWc2CamuhY= go.etcd.io/etcd/client/v2 v2.305.0-alpha.0/go.mod h1:kdV+xzCJ3luEBSIeQyB/OEKkWKd8Zkux4sbDeANrosU= go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= -go.etcd.io/etcd/client/v2 v2.305.5 h1:DktRP60//JJpnPC0VBymAN/7V71GHMdjDCBt4ZPXDjI= +go.etcd.io/etcd/client/v2 v2.305.7 h1:AELPkjNR3/igjbO7CjyF1fPuVPjrblliiKj+Y6xSGOU= go.etcd.io/etcd/client/v3 v3.5.0-alpha.0/go.mod h1:wKt7jgDgf/OfKiYmCq5WFGxOFAkVMLxiiXgLDFhECr8= go.etcd.io/etcd/client/v3 v3.5.4/go.mod h1:ZaRkVgBZC+L+dLCjTcF1hRXpgZXQPOvnA/Ak/gq3kiY= go.etcd.io/etcd/client/v3 v3.5.7 h1:u/OhpiuCgYY8awOHlhIhmGIGpxfBU/GZBUP3m/3/Iz4= go.etcd.io/etcd/client/v3 v3.5.7/go.mod h1:sOWmj9DZUMyAngS7QQwCyAXXAL6WhgTOPLNS/NabQgw= go.etcd.io/etcd/pkg/v3 v3.5.0-alpha.0/go.mod h1:tV31atvwzcybuqejDoY3oaNRTtlD2l/Ot78Pc9w7DMY= -go.etcd.io/etcd/pkg/v3 v3.5.5 h1:Ablg7T7OkR+AeeeU32kdVhw/AGDsitkKPl7aW73ssjU= +go.etcd.io/etcd/pkg/v3 v3.5.7 h1:obOzeVwerFwZ9trMWapU/VjDcYUJb5OfgC1zqEGWO/0= go.etcd.io/etcd/raft/v3 v3.5.0-alpha.0/go.mod h1:FAwse6Zlm5v4tEWZaTjmNhe17Int4Oxbu7+2r0DiD3w= -go.etcd.io/etcd/raft/v3 v3.5.5 h1:Ibz6XyZ60OYyRopu73lLM/P+qco3YtlZMOhnXNS051I= +go.etcd.io/etcd/raft/v3 v3.5.7 h1:aN79qxLmV3SvIq84aNTliYGmjwsW6NqJSnqmI1HLJKc= go.etcd.io/etcd/server/v3 v3.5.0-alpha.0/go.mod h1:tsKetYpt980ZTpzl/gb+UOJj9RkIyCb1u4wjzMg90BQ= -go.etcd.io/etcd/server/v3 v3.5.5 h1:jNjYm/9s+f9A9r6+SC4RvNaz6AqixpOvhrFdT0PvIj0= +go.etcd.io/etcd/server/v3 v3.5.7 h1:BTBD8IJUV7YFgsczZMHhMTS67XuA4KpRquL0MFOJGRk= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= @@ -1532,18 +1175,20 @@ go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.35.0 h1:xFSRQBbXF6VvYRf2lqMJXxoB72XI1K/azav8TekHHSw= -go.opentelemetry.io/otel v1.11.0 h1:kfToEGMDq6TrVrJ9Vht84Y8y9enykSZzDDZglV0kIEk= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.40.0 h1:5jD3teb4Qh7mx/nfzq4jO2WFFpvXD0vYWFDrdvNWmXk= go.opentelemetry.io/otel v1.11.0/go.mod h1:H2KtuEphyMvlhZ+F7tg9GRhAOe60moNx61Ex+WmiKkk= -go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.10.0 h1:TaB+1rQhddO1sF71MpZOZAuSPW1klK2M8XxfrBMfK7Y= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.10.0 h1:pDDYmo0QadUPal5fwXoY1pmMpFcdyhXOmL5drCrI3vU= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.10.0 h1:KtiUEhQmj/Pa874bVYKGNVdq8NPKiacPbaRRtgXi+t4= -go.opentelemetry.io/otel/sdk v1.10.0 h1:jZ6K7sVn04kk/3DNUdJ4mqRlGDiXAVuIG+MMENpTNdY= -go.opentelemetry.io/otel/trace v1.11.0 h1:20U/Vj42SX+mASlXLmSGBg6jpI1jQtv682lZtTAOVFI= +go.opentelemetry.io/otel v1.14.0 h1:/79Huy8wbf5DnIPhemGB+zEPVwnN6fuQybr/SRXa6hM= +go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU= +go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.14.0 h1:/fXHZHGvro6MVqV34fJzDhi7sHGpX3Ej/Qjmfn003ho= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.14.0 h1:TKf2uAs2ueguzLaxOCBXNpHxfO/aC7PAdDsSH0IbeRQ= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.14.0 h1:ap+y8RXX3Mu9apKVtOkM6WSFESLM8K3wNQyOU8sWHcc= +go.opentelemetry.io/otel/metric v0.37.0 h1:pHDQuLQOZwYD+Km0eb657A25NaRzy0a+eLyKfDXedEs= +go.opentelemetry.io/otel/sdk v1.14.0 h1:PDCppFRDq8A1jL9v6KMI6dYesaq+DFcDZvjsoGvxGzY= go.opentelemetry.io/otel/trace v1.11.0/go.mod h1:nyYjis9jy0gytE9LXGU+/m1sHTKbRY0fX0hulNNDP1U= +go.opentelemetry.io/otel/trace v1.14.0 h1:wp2Mmvj41tDsyAJXiWDWpfNsOiIyd38fy85pyKcFq/M= +go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.opentelemetry.io/proto/otlp v0.19.0 h1:IVN6GR+mhC4s5yfcTbmzHYODqvWAp3ZedA2SJPI1Nnw= -go.opentelemetry.io/proto/otlp v0.19.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 h1:+FNtrFTmVw0YZGpBGX56XDee331t6JAXeK2bcyhLOOc= go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5/go.mod h1:nmDLcffg48OtT/PSW0Hg7FvpRQsQh5OSqIylirxKC7o= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= @@ -1551,18 +1196,16 @@ go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= -go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= -go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk= +go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8= go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= -go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI= -go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= @@ -1589,13 +1232,11 @@ golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= -golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g= golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1639,8 +1280,8 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk= +golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180530234432-1e491301e022/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1685,34 +1326,20 @@ golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= -golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211029224645-99673261e6eb/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211105192438-b53810dc28af/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220617184016-355a448f1bc9/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= -golang.org/x/net v0.0.0-20221012135044-0b7e1fb9d458/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= -golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= -golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= -golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1728,21 +1355,9 @@ golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= -golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= -golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= -golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= -golang.org/x/oauth2 v0.0.0-20221006150949-b44042a4b9c1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= -golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= -golang.org/x/oauth2 v0.4.0 h1:NF0gk8LVPg1Ml7SSbGyySuoxdsXitj7TvgvuRxIMc/M= -golang.org/x/oauth2 v0.4.0/go.mod h1:RznEsdpjGAINPTOF0UH/t+xJ75L18YO3Ho6Pyn+uRec= +golang.org/x/oauth2 v0.7.0 h1:qe6s0zUXlPX80/dITx3440hWZ7GwMwgDDyrSGTPJG/g= +golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1754,11 +1369,9 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= +golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1823,7 +1436,6 @@ golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1832,57 +1444,36 @@ golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210816074244-15123e1e1f71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211106132015-ebca88c72f68/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220111092808-5a964db01320/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20221013171732-95e765b1cc43/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= -golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.8.0 h1:n5xxQn2i3PC0yLAbjTpNT85q/Kgzcr2gIoX9OrJUols= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1895,12 +1486,8 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1972,26 +1559,18 @@ golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.7/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k= -golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.9.1 h1:8WMNJAz3zrtPmnYC7ISf5dEn3MT0gY7jBJfw27yrrLo= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -gomodules.xyz/jsonpatch/v2 v2.2.0 h1:4pT439QV83L+G9FkcCriY6EkpcK6r6bK+A5FBUMI7qY= +gomodules.xyz/jsonpatch/v2 v2.3.0 h1:8NFhfS6gzxNqjLIYnZxg319wZ5Qjnx4m/CcX+Klzazc= gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= @@ -2019,35 +1598,6 @@ google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjR google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= google.golang.org/api v0.44.0/go.mod h1:EBOGZqzyhtvMDoxwS97ctnh0zUmYY6CxqXsc1AvkYD8= -google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= -google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= -google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= -google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= -google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= -google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= -google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= -google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= -google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I= -google.golang.org/api v0.63.0/go.mod h1:gs4ij2ffTRXwuzzgJl/56BdwJaA194ijkfn++9tDuPo= -google.golang.org/api v0.67.0/go.mod h1:ShHKP8E60yPsKNw/w8w+VYaj9H6buA5UqDp8dhbQZ6g= -google.golang.org/api v0.70.0/go.mod h1:Bs4ZM2HGifEvXwd50TtW70ovgJffJYw2oRCOFU/SkfA= -google.golang.org/api v0.71.0/go.mod h1:4PyU6e6JogV1f9eA4voyrTY2batOLdgZ5qZ5HOCc4j8= -google.golang.org/api v0.74.0/go.mod h1:ZpfMZOVRMywNyvJFeqL9HRWBgAuRfSjJFpe9QtRRyDs= -google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= -google.golang.org/api v0.77.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= -google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= -google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= -google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= -google.golang.org/api v0.85.0/go.mod h1:AqZf8Ep9uZ2pyTvgL+x0D3Zt0eoT9b5E8fmzfu6FO2g= -google.golang.org/api v0.90.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= -google.golang.org/api v0.93.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= -google.golang.org/api v0.95.0/go.mod h1:eADj+UBuxkh5zlrSntJghuNeg8HwQ1w5lTKkuqaETEI= -google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= -google.golang.org/api v0.97.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= -google.golang.org/api v0.98.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= -google.golang.org/api v0.99.0/go.mod h1:1YOf74vkVndF7pG6hIHuINsM7eWwpVTAfNMNiL91A08= -google.golang.org/api v0.100.0/go.mod h1:ZE3Z2+ZOr87Rx7dqFsdRQkRBk36kDtp/h+QpHbB7a70= -google.golang.org/api v0.102.0/go.mod h1:3VFl6/fzoA+qNuS1N1/VfXY4LjoXN/wzeIp7TweWwGo= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -2099,81 +1649,16 @@ google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210106152847-07624b53cd92/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210329143202-679c6ae281ee/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= -google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= -google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= -google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= -google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= -google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= -google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211104193956-4c6863e31247/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211221195035-429b39de9b1c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220207164111-0872dc986b00/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220304144024-325a89244dc8/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220324131243-acbaeb5b85eb/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220414192740-2d67ff6cf2b4/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220421151946-72621c1f0bd3/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220429170224-98d788798c3e/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220502173005-c8bf987b8c21/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= google.golang.org/genproto v0.0.0-20220504150022-98cd25cafc72/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220518221133-4f43b3371335/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220523171625-347a074981d8/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220628213854-d9e0b6570c03/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220722212130-b98a9ff5e252/go.mod h1:GkXuJDJ6aQ7lnJcRF+SJVgFdQhypqgl3LB1C9vabdRE= -google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= -google.golang.org/genproto v0.0.0-20220815135757-37a418bb8959/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= -google.golang.org/genproto v0.0.0-20220817144833-d7fd3f11b9b1/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= -google.golang.org/genproto v0.0.0-20220822174746-9e6da59bd2fc/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= -google.golang.org/genproto v0.0.0-20220829144015-23454907ede3/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= -google.golang.org/genproto v0.0.0-20220829175752-36a9c930ecbf/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= -google.golang.org/genproto v0.0.0-20220913154956-18f8339a66a5/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= -google.golang.org/genproto v0.0.0-20220914142337-ca0e39ece12f/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= -google.golang.org/genproto v0.0.0-20220915135415-7fd63a7952de/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= -google.golang.org/genproto v0.0.0-20220916172020-2692e8806bfa/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= -google.golang.org/genproto v0.0.0-20220919141832-68c03719ef51/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= -google.golang.org/genproto v0.0.0-20220920201722-2b89144ce006/go.mod h1:ht8XFiar2npT/g4vkk7O0WYS1sHOHbdujxbEp7CJWbw= -google.golang.org/genproto v0.0.0-20220926165614-551eb538f295/go.mod h1:woMGP53BroOrRY3xTxlbr8Y3eB/nzAvvFM83q7kG2OI= -google.golang.org/genproto v0.0.0-20220926220553-6981cbe3cfce/go.mod h1:woMGP53BroOrRY3xTxlbr8Y3eB/nzAvvFM83q7kG2OI= -google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqwhZAwq4wsRUaVG555sVgsNmIjRtO7t/JH29U= -google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= -google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= -google.golang.org/genproto v0.0.0-20221024153911-1573dae28c9c/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= -google.golang.org/genproto v0.0.0-20221024183307-1bc688fe9f3e/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= -google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c/go.mod h1:CGI5F/G+E5bKwmfYo09AXuVN4dD894kIKUFmVbP2/Fo= -google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= -google.golang.org/genproto v0.0.0-20230221151758-ace64dc21148 h1:muK+gVBJBfFb4SejshDBlN2/UgxCCOKH9Y34ljqEGOc= -google.golang.org/genproto v0.0.0-20230221151758-ace64dc21148/go.mod h1:3Dl5ZL0q0isWJt+FVcfpQyirqemEuLAK/iFvg1UP1Hw= +google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A= +google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU= google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= @@ -2202,28 +1687,15 @@ google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA5 google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= -google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/grpc v1.41.0/go.mod h1:U3l9uK9J0sini8mHphKoXyaqDA/8VyGnDee1zzIUK6k= -google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.52.0/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5vorUY= -google.golang.org/grpc v1.53.0 h1:LAv2ds7cmFV/XTS3XG1NneeENYrXGmorPxsBbptIjNc= -google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw= -google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= +google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsAIPww= +google.golang.org/grpc v1.56.2 h1:fVRFRnXvU+x6C4IlHZewvJOVHoOv1TUuQyoRsYnB4bI= +google.golang.org/grpc v1.56.2/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -2239,8 +1711,8 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= -google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -2282,20 +1754,21 @@ gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gorm.io/driver/mysql v1.4.7 h1:rY46lkCspzGHn7+IYsNpSfEv9tA+SU4SkkB+GFX125Y= -gorm.io/driver/mysql v1.4.7/go.mod h1:SxzItlnT1cb6e1e4ZRpgJN2VYtcqJgqnHxWr4wsP8oc= -gorm.io/driver/sqlite v1.1.3 h1:BYfdVuZB5He/u9dt4qDpZqiqDJ6KhPqs5QUqsr/Eeuc= +gorm.io/driver/mysql v1.5.1 h1:WUEH5VF9obL/lTtzjmML/5e6VfFR/788coz2uaVCAZw= +gorm.io/driver/mysql v1.5.1/go.mod h1:Jo3Xu7mMhCyj8dlrb3WoCaRd1FhsVh+yMXb1jUInf5o= gorm.io/driver/sqlite v1.1.3/go.mod h1:AKDgRWk8lcSQSw+9kxCJnX/yySj8G3rdwYlU57cB45c= +gorm.io/driver/sqlite v1.5.2 h1:TpQ+/dqCY4uCigCFyrfnrJnrW9zjpelWVoEVNy5qJkc= +gorm.io/driver/sqlite v1.5.2/go.mod h1:qxAuCol+2r6PannQDpOP1FP6ag3mKi4esLnB/jHed+4= gorm.io/gorm v1.20.1/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw= gorm.io/gorm v1.20.6/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw= -gorm.io/gorm v1.23.8/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= -gorm.io/gorm v1.24.6 h1:wy98aq9oFEetsc4CAbKD2SoBCdMzsbSIvSUUFJuHi5s= -gorm.io/gorm v1.24.6/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= +gorm.io/gorm v1.25.1/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= +gorm.io/gorm v1.25.2-0.20230530020048-26663ab9bf55 h1:sC1Xj4TYrLqg1n3AN10w871An7wJM0gzgcm8jkIkECQ= +gorm.io/gorm v1.25.2-0.20230530020048-26663ab9bf55/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= -gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0= -helm.sh/helm/v3 v3.11.2 h1:P3cLaFxfoxaGLGJVnoPrhf1j86LC5EDINSpYSpMUkkA= -helm.sh/helm/v3 v3.11.2/go.mod h1:Hw+09mfpDiRRKAgAIZlFkPSeOkvv7Acl5McBvQyNPVw= +gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= +helm.sh/helm/v3 v3.12.1 h1:lzU7etZX24A6BTMXYQF3bFq0ECfD8s+fKlNBBL8AbEc= +helm.sh/helm/v3 v3.12.1/go.mod h1:qhmSY9kcX7yH1xebe+FDMZa7E5NAeZ+LvK5j1gSln48= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -2304,50 +1777,42 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.26.1 h1:f+SWYiPd/GsiWwVRz+NbFyCgvv75Pk9NK6dlkZgpCRQ= -k8s.io/api v0.26.1/go.mod h1:xd/GBNgR0f707+ATNyPmQ1oyKSgndzXij81FzWGsejg= -k8s.io/apiextensions-apiserver v0.26.1 h1:cB8h1SRk6e/+i3NOrQgSFij1B2S0Y0wDoNl66bn8RMI= -k8s.io/apiextensions-apiserver v0.26.1/go.mod h1:AptjOSXDGuE0JICx/Em15PaoO7buLwTs0dGleIHixSM= -k8s.io/apimachinery v0.26.1 h1:8EZ/eGJL+hY/MYCNwhmDzVqq2lPl3N3Bo8rvweJwXUQ= -k8s.io/apimachinery v0.26.1/go.mod h1:tnPmbONNJ7ByJNz9+n9kMjNP8ON+1qoAIIC70lztu74= -k8s.io/apiserver v0.26.1 h1:6vmnAqCDO194SVCPU3MU8NcDgSqsUA62tBUSWrFXhsc= -k8s.io/apiserver v0.26.1/go.mod h1:wr75z634Cv+sifswE9HlAo5FQ7UoUauIICRlOE+5dCg= -k8s.io/cli-runtime v0.26.0 h1:aQHa1SyUhpqxAw1fY21x2z2OS5RLtMJOCj7tN4oq8mw= -k8s.io/cli-runtime v0.26.0/go.mod h1:o+4KmwHzO/UK0wepE1qpRk6l3o60/txUZ1fEXWGIKTY= -k8s.io/client-go v0.26.1 h1:87CXzYJnAMGaa/IDDfRdhTzxk/wzGZ+/HUQpqgVSZXU= -k8s.io/client-go v0.26.1/go.mod h1:IWNSglg+rQ3OcvDkhY6+QLeasV4OYHDjdqeWkDQZwGE= -k8s.io/component-base v0.26.1 h1:4ahudpeQXHZL5kko+iDHqLj/FSGAEUnSVO0EBbgDd+4= -k8s.io/component-base v0.26.1/go.mod h1:VHrLR0b58oC035w6YQiBSbtsf0ThuSwXP+p5dD/kAWU= -k8s.io/klog/v2 v2.80.1 h1:atnLQ121W371wYYFawwYx1aEY2eUfs4l3J72wtgAwV4= -k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 h1:+70TFaan3hfJzs+7VK2o+OGxg8HsuBr/5f6tVAjDu6E= -k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280/go.mod h1:+Axhij7bCpeqhklhUTe3xmOn6bWxolyZEeyaFpjGtl4= -k8s.io/kubectl v0.26.0 h1:xmrzoKR9CyNdzxBmXV7jW9Ln8WMrwRK6hGbbf69o4T0= -k8s.io/kubectl v0.26.0/go.mod h1:eInP0b+U9XUJWSYeU9XZnTA+cVYuWyl3iYPGtru0qhQ= -k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 h1:KTgPnR10d5zhztWptI952TNtt/4u5h3IzDXkdIMuo2Y= -k8s.io/utils v0.0.0-20221128185143-99ec85e7a448/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -modernc.org/libc v1.22.3 h1:D/g6O5ftAfavceqlLOFwaZuA5KYafKwmr30A6iSqoyY= -modernc.org/libc v1.22.3/go.mod h1:MQrloYP209xa2zHome2a8HLiLm6k0UT8CoHpV74tOFw= -modernc.org/mathutil v1.5.0 h1:rV0Ko/6SfM+8G+yKiyI830l3Wuz1zRutdslNoQ0kfiQ= -modernc.org/mathutil v1.5.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= -modernc.org/memory v1.5.0 h1:N+/8c5rE6EqugZwHii4IFsaJ7MUhoWX07J5tC/iI5Ds= -modernc.org/memory v1.5.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= -modernc.org/sqlite v1.21.1 h1:GyDFqNnESLOhwwDRaHGdp2jKLDzpyT/rNLglX3ZkMSU= -modernc.org/sqlite v1.21.1/go.mod h1:XwQ0wZPIh1iKb5mkvCJ3szzbhk+tykC8ZWqTRTgYRwI= +k8s.io/api v0.27.3 h1:yR6oQXXnUEBWEWcvPWS0jQL575KoAboQPfJAuKNrw5Y= +k8s.io/api v0.27.3/go.mod h1:C4BNvZnQOF7JA/0Xed2S+aUyJSfTGkGFxLXz9MnpIpg= +k8s.io/apiextensions-apiserver v0.27.2 h1:iwhyoeS4xj9Y7v8YExhUwbVuBhMr3Q4bd/laClBV6Bo= +k8s.io/apiextensions-apiserver v0.27.2/go.mod h1:Oz9UdvGguL3ULgRdY9QMUzL2RZImotgxvGjdWRq6ZXQ= +k8s.io/apimachinery v0.27.3 h1:Ubye8oBufD04l9QnNtW05idcOe9Z3GQN8+7PqmuVcUM= +k8s.io/apimachinery v0.27.3/go.mod h1:XNfZ6xklnMCOGGFNqXG7bUrQCoR04dh/E7FprV6pb+E= +k8s.io/apiserver v0.27.2 h1:p+tjwrcQEZDrEorCZV2/qE8osGTINPuS5ZNqWAvKm5E= +k8s.io/apiserver v0.27.2/go.mod h1:EsOf39d75rMivgvvwjJ3OW/u9n1/BmUMK5otEOJrb1Y= +k8s.io/cli-runtime v0.27.3 h1:h592I+2eJfXj/4jVYM+tu9Rv8FEc/dyCoD80UJlMW2Y= +k8s.io/cli-runtime v0.27.3/go.mod h1:LzXud3vFFuDFXn2LIrWnscPgUiEj7gQQcYZE2UPn9Kw= +k8s.io/client-go v0.27.3 h1:7dnEGHZEJld3lYwxvLl7WoehK6lAq7GvgjxpA3nv1E8= +k8s.io/client-go v0.27.3/go.mod h1:2MBEKuTo6V1lbKy3z1euEGnhPfGZLKTS9tiJ2xodM48= +k8s.io/component-base v0.27.3 h1:g078YmdcdTfrCE4fFobt7qmVXwS8J/3cI1XxRi/2+6k= +k8s.io/component-base v0.27.3/go.mod h1:JNiKYcGImpQ44iwSYs6dysxzR9SxIIgQalk4HaCNVUY= +k8s.io/klog/v2 v2.90.1 h1:m4bYOKall2MmOiRaR1J+We67Do7vm9KiQVlT96lnHUw= +k8s.io/klog/v2 v2.90.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f h1:2kWPakN3i/k81b0gvD5C5FJ2kxm1WrQFanWchyKuqGg= +k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f/go.mod h1:byini6yhqGC14c3ebc/QwanvYwhuMWF6yz2F8uwW8eg= +k8s.io/kubectl v0.27.3 h1:HyC4o+8rCYheGDWrkcOQHGwDmyLKR5bxXFgpvF82BOw= +k8s.io/kubectl v0.27.3/go.mod h1:g9OQNCC2zxT+LT3FS09ZYqnDhlvsKAfFq76oyarBcq4= +k8s.io/utils v0.0.0-20230220204549-a5ecb0141aa5 h1:kmDqav+P+/5e1i9tFfHq1qcF3sOrDp+YEkVDAHu7Jwk= +k8s.io/utils v0.0.0-20230220204549-a5ecb0141aa5/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= oras.land/oras-go v1.2.2 h1:0E9tOHUfrNH7TCDk5KU0jVBEzCqbfdyuVfGmJ7ZeRPE= oras.land/oras-go v1.2.2/go.mod h1:Apa81sKoZPpP7CDciE006tSZ0x3Q3+dOoBcMZ/aNxvw= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/controller-runtime v0.14.6 h1:oxstGVvXGNnMvY7TAESYk+lzr6S3V5VFxQ6d92KcwQA= -sigs.k8s.io/controller-runtime v0.14.6/go.mod h1:WqIdsAY6JBsjfc/CqO0CORmNtoCtE4S6qbPc9s68h+0= -sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 h1:iXTIw73aPyC+oRdyqqvVJuloN1p0AC/kzH07hu3NE+k= -sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= -sigs.k8s.io/kustomize/api v0.12.1 h1:7YM7gW3kYBwtKvoY216ZzY+8hM+lV53LUayghNRJ0vM= -sigs.k8s.io/kustomize/api v0.12.1/go.mod h1:y3JUhimkZkR6sbLNwfJHxvo1TCLwuwm14sCYnkH6S1s= -sigs.k8s.io/kustomize/kyaml v0.13.9 h1:Qz53EAaFFANyNgyOEJbT/yoIHygK40/ZcvU3rgry2Tk= -sigs.k8s.io/kustomize/kyaml v0.13.9/go.mod h1:QsRbD0/KcU+wdk0/L0fIp2KLnohkVzs6fQ85/nOXac4= +sigs.k8s.io/controller-runtime v0.15.0 h1:ML+5Adt3qZnMSYxZ7gAverBLNPSMQEibtzAgp0UPojU= +sigs.k8s.io/controller-runtime v0.15.0/go.mod h1:7ngYvp1MLT+9GeZ+6lH3LOlcHkp/+tzA/fmHa4iq9kk= +sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= +sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= +sigs.k8s.io/kustomize/api v0.13.2 h1:kejWfLeJhUsTGioDoFNJET5LQe/ajzXhJGYoU+pJsiA= +sigs.k8s.io/kustomize/api v0.13.2/go.mod h1:DUp325VVMFVcQSq+ZxyDisA8wtldwHxLZbr1g94UHsw= +sigs.k8s.io/kustomize/kyaml v0.14.1 h1:c8iibius7l24G2wVAGZn/Va2wNys03GXLjYVIcFVxKA= +sigs.k8s.io/kustomize/kyaml v0.14.1/go.mod h1:AN1/IpawKilWD7V+YvQwRGUvuUOOWpjsHu6uHwonSF4= sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE= sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= diff --git a/pkg/admin/bootstrap.go b/pkg/admin/bootstrap.go new file mode 100644 index 000000000..b71c5dcb0 --- /dev/null +++ b/pkg/admin/bootstrap.go @@ -0,0 +1,172 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package admin + +import ( + "github.com/apache/dubbo-admin/pkg/admin/providers/mock" + "github.com/apache/dubbo-admin/pkg/admin/services" + "github.com/apache/dubbo-admin/pkg/core/logger" + "net/url" + "os" + "strings" + + "dubbo.apache.org/dubbo-go/v3/common" + "dubbo.apache.org/dubbo-go/v3/common/extension" + "dubbo.apache.org/dubbo-go/v3/config_center" + "gorm.io/driver/mysql" + "gorm.io/driver/sqlite" + "gorm.io/gorm" + + "github.com/apache/dubbo-admin/pkg/admin/config" + "github.com/apache/dubbo-admin/pkg/admin/constant" + "github.com/apache/dubbo-admin/pkg/admin/model" + conf "github.com/apache/dubbo-admin/pkg/config" + "github.com/apache/dubbo-admin/pkg/config/admin" + core_runtime "github.com/apache/dubbo-admin/pkg/core/runtime" +) + +func RegisterDatabase(rt core_runtime.Runtime) error { + dsn := rt.Config().Admin.MysqlDSN + var db *gorm.DB + var err error + if dsn == "" { + db, err = gorm.Open(sqlite.Open(":memory:"), &gorm.Config{}) + } else { + db, err = gorm.Open(mysql.Open(dsn), &gorm.Config{}) + } + if err != nil { + panic(err) + } else { + config.DataBase = db + // init table + initErr := config.DataBase.AutoMigrate(&model.MockRuleEntity{}) + if initErr != nil { + panic(initErr) + } + } + return nil +} + +func RegisterOther(rt core_runtime.Runtime) error { + config.AdminPort = rt.Config().Admin.AdminPort + config.PrometheusIp = rt.Config().Admin.Prometheus.Ip + config.PrometheusPort = rt.Config().Admin.Prometheus.Port + config.PrometheusMonitorPort = rt.Config().Admin.Prometheus.MonitorPort + address := rt.Config().Admin.ConfigCenter + registryAddress := rt.Config().Admin.Registry.Address + metadataReportAddress := rt.Config().Admin.MetadataReport.Address + c, addrUrl := getValidAddressConfig(address, registryAddress) + configCenter := newConfigCenter(c, addrUrl) + config.Governance = config.NewGovernanceConfig(configCenter, c.GetProtocol()) + properties, err := configCenter.GetProperties(constant.DubboPropertyKey) + if err != nil { + logger.Info("No configuration found in config center.") + } + if len(properties) > 0 { + logger.Infof("Loaded remote configuration from config center:\n %s", properties) + for _, property := range strings.Split(properties, "\n") { + if strings.HasPrefix(property, constant.RegistryAddressKey) { + registryAddress = strings.Split(property, "=")[1] + } + if strings.HasPrefix(property, constant.MetadataReportAddressKey) { + metadataReportAddress = strings.Split(property, "=")[1] + } + } + } + if len(registryAddress) > 0 { + logger.Infof("Valid registry address is %s", registryAddress) + c := newAddressConfig(registryAddress) + addrUrl, err := c.ToURL() + if err != nil { + panic(err) + } + config.RegistryCenter, err = extension.GetRegistry(c.GetProtocol(), addrUrl) + if err != nil { + panic(err) + } + } + if len(metadataReportAddress) > 0 { + logger.Infof("Valid meta center address is %s", metadataReportAddress) + c := newAddressConfig(metadataReportAddress) + addrUrl, err := c.ToURL() + if err != nil { + panic(err) + } + factory := extension.GetMetadataReportFactory(c.GetProtocol()) + config.MetadataReportCenter = factory.CreateMetadataReport(addrUrl) + } + + // subscribe to registries + go services.StartSubscribe(config.RegistryCenter) + defer func() { + services.DestroySubscribe(config.RegistryCenter) + }() + + // start mock cp-server + os.Setenv(constant.ConfigFileEnvKey, conf.MockProviderConf) + go mock.RunMockServiceServer() + + return nil +} + +func getValidAddressConfig(address string, registryAddress string) (admin.AddressConfig, *common.URL) { + if len(address) <= 0 && len(registryAddress) <= 0 { + panic("Must at least specify `admin.config-center.address` or `admin.registry.address`!") + } + + var c admin.AddressConfig + if len(address) > 0 { + logger.Infof("Specified config center address is %s", address) + c = newAddressConfig(address) + } else { + logger.Info("Using registry address as default config center address") + c = newAddressConfig(registryAddress) + } + + configUrl, err := c.ToURL() + if err != nil { + panic(err) + } + return c, configUrl +} + +func newAddressConfig(address string) admin.AddressConfig { + config := admin.AddressConfig{} + config.Address = address + var err error + config.Url, err = url.Parse(address) + if err != nil { + panic(err) + } + return config +} + +func newConfigCenter(c admin.AddressConfig, url *common.URL) config_center.DynamicConfiguration { + factory, err := extension.GetConfigCenterFactory(c.GetProtocol()) + if err != nil { + logger.Info(err.Error()) + panic(err) + } + + configCenter, err := factory.GetDynamicConfiguration(url) + if err != nil { + logger.Info("Failed to init config center, error msg is %s.", err.Error()) + panic(err) + } + return configCenter +} diff --git a/pkg/admin/config/config.go b/pkg/admin/config/config.go index 460e59d1e..b7836e8b2 100644 --- a/pkg/admin/config/config.go +++ b/pkg/admin/config/config.go @@ -18,52 +18,13 @@ package config import ( - "net/url" - "os" - "path/filepath" - "strings" - - "dubbo.apache.org/dubbo-go/v3/common" - - "dubbo.apache.org/dubbo-go/v3/common/extension" - "dubbo.apache.org/dubbo-go/v3/config_center" "dubbo.apache.org/dubbo-go/v3/metadata/report" "dubbo.apache.org/dubbo-go/v3/registry" - "github.com/glebarez/sqlite" - "gorm.io/driver/mysql" "gorm.io/gorm" - "github.com/apache/dubbo-admin/pkg/admin/constant" _ "github.com/apache/dubbo-admin/pkg/admin/imports" - "github.com/apache/dubbo-admin/pkg/admin/model" - "github.com/apache/dubbo-admin/pkg/logger" - "gopkg.in/yaml.v2" -) - -const ( - conf = "./conf/admin.yml" - confPathKey = "ADMIN_CONFIG_PATH" ) -const MockProviderConf = "./conf/mock_provider.yml" - -type Config struct { - Admin Admin `yaml:"admin"` - Prometheus Prometheus `yaml:"prometheus"` -} - -type Prometheus struct { - Ip string `json:"ip"` - Port string `json:"port"` -} - -type Admin struct { - ConfigCenter string `yaml:"config-center"` - MetadataReport AddressConfig `yaml:"metadata-report"` - Registry AddressConfig `yaml:"registry"` - MysqlDsn string `yaml:"mysql-dsn"` -} - var ( Governance GovernanceConfig RegistryCenter registry.Registry @@ -73,153 +34,8 @@ var ( ) var ( - PrometheusIp string - PrometheusPort string + PrometheusIp string + PrometheusPort string + PrometheusMonitorPort string + AdminPort int ) - -func LoadConfig() { - configFilePath := conf - if envPath := os.Getenv(confPathKey); envPath != "" { - configFilePath = envPath - } - path, err := filepath.Abs(configFilePath) - if err != nil { - path = filepath.Clean(configFilePath) - } - content, err := os.ReadFile(path) - if err != nil { - panic(err) - } - var config Config - err = yaml.Unmarshal(content, &config) - if err != nil { - logger.Errorf("Invalid configuration: \n %s", content) - panic(err) - } - - address := config.Admin.ConfigCenter - registryAddress := config.Admin.Registry.Address - metadataReportAddress := config.Admin.MetadataReport.Address - - loadDatabaseConfig(config.Admin.MysqlDsn) - - PrometheusIp = config.Prometheus.Ip - PrometheusPort = config.Prometheus.Port - if PrometheusIp == "" { - PrometheusIp = "127.0.0.1" - } - if PrometheusPort == "" { - PrometheusPort = "9090" - } - - c, addrUrl := getValidAddressConfig(address, registryAddress) - configCenter := newConfigCenter(c, addrUrl) - Governance = newGovernanceConfig(configCenter, c.getProtocol()) - properties, err := configCenter.GetProperties(constant.DubboPropertyKey) - if err != nil { - logger.Info("No configuration found in config center.") - } - - if len(properties) > 0 { - logger.Infof("Loaded remote configuration from config center:\n %s", properties) - for _, property := range strings.Split(properties, "\n") { - if strings.HasPrefix(property, constant.RegistryAddressKey) { - registryAddress = strings.Split(property, "=")[1] - } - if strings.HasPrefix(property, constant.MetadataReportAddressKey) { - metadataReportAddress = strings.Split(property, "=")[1] - } - } - } - - if len(registryAddress) > 0 { - logger.Infof("Valid registry address is %s", registryAddress) - c := newAddressConfig(registryAddress) - addrUrl, err := c.toURL() - if err != nil { - panic(err) - } - RegistryCenter, err = extension.GetRegistry(c.getProtocol(), addrUrl) - if err != nil { - panic(err) - } - } - if len(metadataReportAddress) > 0 { - logger.Infof("Valid meta center address is %s", metadataReportAddress) - c := newAddressConfig(metadataReportAddress) - addrUrl, err := c.toURL() - if err != nil { - panic(err) - } - factory := extension.GetMetadataReportFactory(c.getProtocol()) - MetadataReportCenter = factory.CreateMetadataReport(addrUrl) - } -} - -func getValidAddressConfig(address string, registryAddress string) (AddressConfig, *common.URL) { - if len(address) <= 0 && len(registryAddress) <= 0 { - panic("Must at least specify `admin.config-center.address` or `admin.registry.address`!") - } - - var c AddressConfig - if len(address) > 0 { - logger.Infof("Specified config center address is %s", address) - c = newAddressConfig(address) - } else { - logger.Info("Using registry address as default config center address") - c = newAddressConfig(registryAddress) - } - - configUrl, err := c.toURL() - if err != nil { - panic(err) - } - return c, configUrl -} - -func newConfigCenter(c AddressConfig, url *common.URL) config_center.DynamicConfiguration { - factory, err := extension.GetConfigCenterFactory(c.getProtocol()) - if err != nil { - logger.Info(err.Error()) - panic(err) - } - - configCenter, err := factory.GetDynamicConfiguration(url) - if err != nil { - logger.Info("Failed to init config center, error msg is %s.", err.Error()) - panic(err) - } - return configCenter -} - -func newAddressConfig(address string) AddressConfig { - config := AddressConfig{} - config.Address = address - var err error - config.url, err = url.Parse(address) - if err != nil { - panic(err) - } - return config -} - -// load database for mock rule storage, if dsn is empty, use sqlite in memory -func loadDatabaseConfig(dsn string) { - var db *gorm.DB - var err error - if dsn == "" { - db, err = gorm.Open(sqlite.Open(":memory:"), &gorm.Config{}) - } else { - db, err = gorm.Open(mysql.Open(dsn), &gorm.Config{}) - } - if err != nil { - panic(err) - } else { - DataBase = db - // init table - initErr := DataBase.AutoMigrate(&model.MockRuleEntity{}) - if initErr != nil { - panic(initErr) - } - } -} diff --git a/pkg/admin/config/governance_config.go b/pkg/admin/config/governance_config.go index f9705e779..fb43d2ddc 100644 --- a/pkg/admin/config/governance_config.go +++ b/pkg/admin/config/governance_config.go @@ -81,7 +81,7 @@ func init() { } } -func newGovernanceConfig(cc config_center.DynamicConfiguration, p string) GovernanceConfig { +func NewGovernanceConfig(cc config_center.DynamicConfiguration, p string) GovernanceConfig { return impls[p](cc) } diff --git a/pkg/admin/handlers/condition_route.go b/pkg/admin/handlers/condition_route.go index 2fecdf16d..520cfc00a 100644 --- a/pkg/admin/handlers/condition_route.go +++ b/pkg/admin/handlers/condition_route.go @@ -18,11 +18,10 @@ package handlers import ( + "github.com/apache/dubbo-admin/pkg/core/logger" "net/http" "github.com/apache/dubbo-admin/pkg/admin/config" - "github.com/apache/dubbo-admin/pkg/logger" - "github.com/apache/dubbo-admin/pkg/admin/model" "github.com/gin-gonic/gin" ) diff --git a/pkg/admin/handlers/mock_rule.go b/pkg/admin/handlers/mock_rule.go index f0677e21b..f1c7bd581 100644 --- a/pkg/admin/handlers/mock_rule.go +++ b/pkg/admin/handlers/mock_rule.go @@ -18,13 +18,13 @@ package handlers import ( + "github.com/apache/dubbo-admin/pkg/core/logger" "net/http" "strconv" "github.com/apache/dubbo-admin/pkg/admin/mapper" "github.com/apache/dubbo-admin/pkg/admin/model" "github.com/apache/dubbo-admin/pkg/admin/services" - "github.com/apache/dubbo-admin/pkg/logger" "github.com/gin-gonic/gin" ) diff --git a/pkg/admin/handlers/overrides.go b/pkg/admin/handlers/overrides.go index 42109ce97..ad49c05c1 100644 --- a/pkg/admin/handlers/overrides.go +++ b/pkg/admin/handlers/overrides.go @@ -16,11 +16,10 @@ package handlers import ( + "github.com/apache/dubbo-admin/pkg/core/logger" "net/http" "github.com/apache/dubbo-admin/pkg/admin/config" - "github.com/apache/dubbo-admin/pkg/logger" - "github.com/apache/dubbo-admin/pkg/admin/model" "github.com/apache/dubbo-admin/pkg/admin/services" "github.com/apache/dubbo-admin/pkg/admin/util" diff --git a/pkg/admin/handlers/service.go b/pkg/admin/handlers/service.go index b7fc4989d..d53d914c1 100644 --- a/pkg/admin/handlers/service.go +++ b/pkg/admin/handlers/service.go @@ -19,13 +19,13 @@ package handlers import ( "encoding/json" + "github.com/apache/dubbo-admin/pkg/core/cmd/version" + "github.com/apache/dubbo-admin/pkg/core/logger" "net/http" "strconv" "dubbo.apache.org/dubbo-go/v3/metadata/definition" - "github.com/apache/dubbo-admin/pkg/logger" - "github.com/apache/dubbo-admin/pkg/admin/constant" "github.com/vcraescu/go-paginator" "github.com/vcraescu/go-paginator/adapter" @@ -36,7 +36,7 @@ import ( "github.com/apache/dubbo-admin/pkg/admin/util" "github.com/apache/dubbo-admin/pkg/admin/services" - "github.com/apache/dubbo-admin/pkg/version" + "github.com/gin-gonic/gin" ) diff --git a/pkg/admin/handlers/tag_route.go b/pkg/admin/handlers/tag_route.go index ae671fc3b..74fed91aa 100644 --- a/pkg/admin/handlers/tag_route.go +++ b/pkg/admin/handlers/tag_route.go @@ -18,12 +18,11 @@ package handlers import ( + "github.com/apache/dubbo-admin/pkg/core/logger" "net/http" "strings" "github.com/apache/dubbo-admin/pkg/admin/config" - "github.com/apache/dubbo-admin/pkg/logger" - "github.com/apache/dubbo-admin/pkg/admin/model" "github.com/apache/dubbo-admin/pkg/admin/services" "github.com/gin-gonic/gin" diff --git a/pkg/admin/handlers/traffic/accesslog.go b/pkg/admin/handlers/traffic/accesslog.go index 56682da2b..825458ab1 100644 --- a/pkg/admin/handlers/traffic/accesslog.go +++ b/pkg/admin/handlers/traffic/accesslog.go @@ -18,11 +18,11 @@ package traffic import ( + "github.com/apache/dubbo-admin/pkg/core/logger" "net/http" "github.com/apache/dubbo-admin/pkg/admin/model" "github.com/apache/dubbo-admin/pkg/admin/services/traffic" - "github.com/apache/dubbo-admin/pkg/logger" "github.com/gin-gonic/gin" ) diff --git a/pkg/admin/handlers/traffic/argument.go b/pkg/admin/handlers/traffic/argument.go index ada51940f..986ef8e9a 100644 --- a/pkg/admin/handlers/traffic/argument.go +++ b/pkg/admin/handlers/traffic/argument.go @@ -18,11 +18,11 @@ package traffic import ( + "github.com/apache/dubbo-admin/pkg/core/logger" "net/http" "github.com/apache/dubbo-admin/pkg/admin/model" "github.com/apache/dubbo-admin/pkg/admin/services/traffic" - "github.com/apache/dubbo-admin/pkg/logger" "github.com/gin-gonic/gin" ) diff --git a/pkg/admin/handlers/traffic/gray.go b/pkg/admin/handlers/traffic/gray.go index c0c4a17ad..d2bc5de35 100644 --- a/pkg/admin/handlers/traffic/gray.go +++ b/pkg/admin/handlers/traffic/gray.go @@ -18,11 +18,11 @@ package traffic import ( + "github.com/apache/dubbo-admin/pkg/core/logger" "net/http" "github.com/apache/dubbo-admin/pkg/admin/model" "github.com/apache/dubbo-admin/pkg/admin/services/traffic" - "github.com/apache/dubbo-admin/pkg/logger" "github.com/gin-gonic/gin" ) diff --git a/pkg/admin/handlers/traffic/mock.go b/pkg/admin/handlers/traffic/mock.go index b452fb77a..1a088ac53 100644 --- a/pkg/admin/handlers/traffic/mock.go +++ b/pkg/admin/handlers/traffic/mock.go @@ -18,11 +18,11 @@ package traffic import ( + "github.com/apache/dubbo-admin/pkg/core/logger" "net/http" "github.com/apache/dubbo-admin/pkg/admin/model" "github.com/apache/dubbo-admin/pkg/admin/services/traffic" - "github.com/apache/dubbo-admin/pkg/logger" "github.com/gin-gonic/gin" ) diff --git a/pkg/admin/handlers/traffic/region.go b/pkg/admin/handlers/traffic/region.go index e07504d7b..d475972a2 100644 --- a/pkg/admin/handlers/traffic/region.go +++ b/pkg/admin/handlers/traffic/region.go @@ -18,11 +18,11 @@ package traffic import ( + "github.com/apache/dubbo-admin/pkg/core/logger" "net/http" "github.com/apache/dubbo-admin/pkg/admin/model" "github.com/apache/dubbo-admin/pkg/admin/services/traffic" - "github.com/apache/dubbo-admin/pkg/logger" "github.com/gin-gonic/gin" ) diff --git a/pkg/admin/handlers/traffic/retry.go b/pkg/admin/handlers/traffic/retry.go index 71cbba3f3..166e2fba2 100644 --- a/pkg/admin/handlers/traffic/retry.go +++ b/pkg/admin/handlers/traffic/retry.go @@ -18,11 +18,11 @@ package traffic import ( + "github.com/apache/dubbo-admin/pkg/core/logger" "net/http" "github.com/apache/dubbo-admin/pkg/admin/model" "github.com/apache/dubbo-admin/pkg/admin/services/traffic" - "github.com/apache/dubbo-admin/pkg/logger" "github.com/gin-gonic/gin" ) diff --git a/pkg/admin/handlers/traffic/timeout.go b/pkg/admin/handlers/traffic/timeout.go index 48adc85b4..b156fc3cf 100644 --- a/pkg/admin/handlers/traffic/timeout.go +++ b/pkg/admin/handlers/traffic/timeout.go @@ -18,11 +18,11 @@ package traffic import ( + "github.com/apache/dubbo-admin/pkg/core/logger" "net/http" "github.com/apache/dubbo-admin/pkg/admin/model" "github.com/apache/dubbo-admin/pkg/admin/services/traffic" - "github.com/apache/dubbo-admin/pkg/logger" "github.com/gin-gonic/gin" ) diff --git a/pkg/admin/handlers/traffic/weight.go b/pkg/admin/handlers/traffic/weight.go index 70969f45c..c6cd7e383 100644 --- a/pkg/admin/handlers/traffic/weight.go +++ b/pkg/admin/handlers/traffic/weight.go @@ -18,11 +18,11 @@ package traffic import ( + "github.com/apache/dubbo-admin/pkg/core/logger" "net/http" "github.com/apache/dubbo-admin/pkg/admin/model" "github.com/apache/dubbo-admin/pkg/admin/services/traffic" - "github.com/apache/dubbo-admin/pkg/logger" "github.com/gin-gonic/gin" ) diff --git a/pkg/admin/providers/mock/api/mock_triple.pb.go b/pkg/admin/providers/mock/api/mock_triple.pb.go index b6084d8e8..04cd70609 100644 --- a/pkg/admin/providers/mock/api/mock_triple.pb.go +++ b/pkg/admin/providers/mock/api/mock_triple.pb.go @@ -41,7 +41,7 @@ import ( // is compatible with the grpc package it is being compiled against. const _ = grpc_go.SupportPackageIsVersion7 -// MockServiceClient is the client API for MockService service. +// MockServiceClient is the clientgen API for MockService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type MockServiceClient interface { @@ -74,7 +74,7 @@ func (c *mockServiceClient) GetMockData(ctx context.Context, in *GetMockDataReq, return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetMockData", in, out) } -// MockServiceServer is the server API for MockService service. +// MockServiceServer is the cp-server API for MockService service. // All implementations must embed UnimplementedMockServiceServer // for forward compatibility type MockServiceServer interface { diff --git a/pkg/admin/providers/mock/mock_provider.go b/pkg/admin/providers/mock/mock_provider.go index 3b13b4fb7..31f155c48 100644 --- a/pkg/admin/providers/mock/mock_provider.go +++ b/pkg/admin/providers/mock/mock_provider.go @@ -19,13 +19,13 @@ package mock import ( "context" + "github.com/apache/dubbo-admin/pkg/core/logger" "dubbo.apache.org/dubbo-go/v3/config" _ "dubbo.apache.org/dubbo-go/v3/imports" "github.com/apache/dubbo-admin/pkg/admin/mapper" "github.com/apache/dubbo-admin/pkg/admin/providers/mock/api" "github.com/apache/dubbo-admin/pkg/admin/services" - "github.com/apache/dubbo-admin/pkg/logger" ) var _ api.MockServiceServer = (*MockServiceServer)(nil) diff --git a/pkg/admin/router/router.go b/pkg/admin/router/router.go index 77991b35e..518a423b3 100644 --- a/pkg/admin/router/router.go +++ b/pkg/admin/router/router.go @@ -18,15 +18,66 @@ package router import ( + "context" + "github.com/apache/dubbo-admin/pkg/admin/config" + "github.com/apache/dubbo-admin/pkg/core/logger" "net/http" + "strconv" - "github.com/apache/dubbo-admin/cmd/ui" + "github.com/apache/dubbo-admin/app/dubbo-ui" "github.com/apache/dubbo-admin/pkg/admin/handlers" "github.com/apache/dubbo-admin/pkg/admin/handlers/traffic" "github.com/gin-gonic/gin" ) -func InitRouter() *gin.Engine { +type Router struct { + Engine *gin.Engine +} + +// TODO maybe tls? +func (r *Router) Start(stop <-chan struct{}) error { + errChan := make(chan error) + + var httpServer *http.Server + httpServer = r.startHttpServer(errChan) + select { + case <-stop: + logger.Sugar().Info("stopping admin") + if httpServer != nil { + return httpServer.Shutdown(context.Background()) + } + case err := <-errChan: + return err + } + return nil +} + +func (r *Router) startHttpServer(errChan chan error) *http.Server { + server := &http.Server{ + Addr: ":" + strconv.Itoa(config.AdminPort), + Handler: r.Engine, + } + + go func() { + err := server.ListenAndServe() + if err != nil { + switch err { + case http.ErrServerClosed: + logger.Sugar().Info("shutting down HTTP Server") + default: + logger.Sugar().Error(err, "could not start an HTTP Server") + errChan <- err + } + } + }() + return server +} + +func (r *Router) NeedLeaderElection() bool { + return false +} + +func InitRouter() *Router { router := gin.Default() server := router.Group("/api/:env") @@ -151,5 +202,7 @@ func InitRouter() *gin.Engine { // Admin UI router.StaticFS("/admin", http.FS(ui.FS())) - return router + return &Router{ + Engine: router, + } } diff --git a/pkg/admin/services/mock_rule_service_impl_test.go b/pkg/admin/services/mock_rule_service_impl_test.go index ec277e29e..4e66d11ce 100644 --- a/pkg/admin/services/mock_rule_service_impl_test.go +++ b/pkg/admin/services/mock_rule_service_impl_test.go @@ -19,12 +19,12 @@ package services import ( "context" + "github.com/apache/dubbo-admin/pkg/core/logger" "reflect" "testing" "github.com/apache/dubbo-admin/pkg/admin/mapper" "github.com/apache/dubbo-admin/pkg/admin/model" - "github.com/apache/dubbo-admin/pkg/logger" "github.com/golang/mock/gomock" ) diff --git a/pkg/admin/services/override_service_impl.go b/pkg/admin/services/override_service_impl.go index 123f865b4..62e62cfbf 100644 --- a/pkg/admin/services/override_service_impl.go +++ b/pkg/admin/services/override_service_impl.go @@ -16,6 +16,7 @@ package services import ( + "github.com/apache/dubbo-admin/pkg/core/logger" "strings" "github.com/dubbogo/gost/encoding/yaml" @@ -25,7 +26,6 @@ import ( "github.com/apache/dubbo-admin/pkg/admin/model" "github.com/apache/dubbo-admin/pkg/admin/model/util" util2 "github.com/apache/dubbo-admin/pkg/admin/util" - "github.com/apache/dubbo-admin/pkg/logger" ) type OverrideServiceImpl struct{} diff --git a/pkg/admin/services/prometheus_service_impl.go b/pkg/admin/services/prometheus_service_impl.go index d2b222ffc..a4ac79570 100644 --- a/pkg/admin/services/prometheus_service_impl.go +++ b/pkg/admin/services/prometheus_service_impl.go @@ -18,6 +18,7 @@ package services import ( "context" "fmt" + logger2 "github.com/apache/dubbo-admin/pkg/core/logger" "net/http" "time" @@ -30,8 +31,7 @@ import ( "github.com/apache/dubbo-admin/pkg/admin/constant" "github.com/apache/dubbo-admin/pkg/admin/model" util2 "github.com/apache/dubbo-admin/pkg/admin/util" - "github.com/apache/dubbo-admin/pkg/logger" - "github.com/apache/dubbo-admin/pkg/monitor/prometheus" + "github.com/apache/dubbo-admin/pkg/core/monitor/prometheus" ) var ( @@ -49,7 +49,7 @@ func (p *PrometheusServiceImpl) PromDiscovery(w http.ResponseWriter) ([]model.Ta // Find all provider addresses proAddr, err := providerServiceImpl.findAddresses() if err != nil { - logger.Sugar().Errorf("Error provider findAddresses: %v\n", err) + logger2.Sugar().Errorf("Error provider findAddresses: %v\n", err) return nil, err } addresses := set.NewSet() @@ -81,7 +81,7 @@ func (p *PrometheusServiceImpl) ClusterMetrics() (model.ClusterMetricsRes, error applications, err := providerService.FindApplications() appNum := 0 if err != nil { - logger.Sugar().Errorf("Error find applications: %v\n", err) + logger2.Sugar().Errorf("Error find applications: %v\n", err) } else { appNum = applications.Size() } @@ -91,7 +91,7 @@ func (p *PrometheusServiceImpl) ClusterMetrics() (model.ClusterMetricsRes, error services, err := providerService.FindServices() svc := 0 if err != nil { - logger.Sugar().Errorf("Error find services: %v\n", err) + logger2.Sugar().Errorf("Error find services: %v\n", err) } else { svc = services.Size() } @@ -100,7 +100,7 @@ func (p *PrometheusServiceImpl) ClusterMetrics() (model.ClusterMetricsRes, error providers, err := providerService.FindService(constant.IP, constant.AnyValue) pro := 0 if err != nil { - logger.Sugar().Errorf("Error find providers: %v\n", err) + logger2.Sugar().Errorf("Error find providers: %v\n", err) } else { pro = len(providers) } @@ -109,7 +109,7 @@ func (p *PrometheusServiceImpl) ClusterMetrics() (model.ClusterMetricsRes, error consumers, err := consumerService.FindAll() con := 0 if err != nil { - logger.Sugar().Errorf("Error find consumers: %v\n", err) + logger2.Sugar().Errorf("Error find consumers: %v\n", err) } else { con = len(consumers) } @@ -131,7 +131,7 @@ func (p *PrometheusServiceImpl) FlowMetrics() (model.FlowMetricsRes, error) { Address: address, }) if err != nil { - logger.Sugar().Errorf("Error creating client: %v\n", err) + logger2.Sugar().Errorf("Error creating clientgen: %v\n", err) return res, err } v1api := prom_v1.NewAPI(client) @@ -143,7 +143,7 @@ func (p *PrometheusServiceImpl) FlowMetrics() (model.FlowMetricsRes, error) { err = vector1.Err qps := float64(0) if err != nil { - logger.Sugar().Errorf("Error query qps: %v\n", err) + logger2.Sugar().Errorf("Error query qps: %v\n", err) } else { if vector1.Vector.Len() != 0 { qps = float64(vector1.Vector[0].Value) @@ -155,7 +155,7 @@ func (p *PrometheusServiceImpl) FlowMetrics() (model.FlowMetricsRes, error) { vector3 := prometheus.FetchQuery(ctx, v1api, constant.MetricsHttpRequestTotalCount, nil) total := float64(0) if vector3.Err != nil { - logger.Sugar().Errorf("Error query total count: %v\n", err) + logger2.Sugar().Errorf("Error query total count: %v\n", err) } else { if vector3.Vector.Len() != 0 { total = float64(vector3.Vector[0].Value) @@ -167,7 +167,7 @@ func (p *PrometheusServiceImpl) FlowMetrics() (model.FlowMetricsRes, error) { vector2 := prometheus.FetchQuery(ctx, v1api, constant.MetricsHttpRequestSuccessCount, nil) success := float64(0) if vector2.Err != nil { - logger.Sugar().Errorf("Error query success count: %v\n", err) + logger2.Sugar().Errorf("Error query success count: %v\n", err) } else { if vector2.Vector.Len() != 0 { success = float64(vector2.Vector[0].Value) @@ -179,7 +179,7 @@ func (p *PrometheusServiceImpl) FlowMetrics() (model.FlowMetricsRes, error) { vector4 := prometheus.FetchQuery(ctx, v1api, constant.MetricsHttpRequestOutOfTimeCount, nil) timeout := float64(0) if vector4.Err != nil { - logger.Sugar().Errorf("Error query timeout count: %v\n", err) + logger2.Sugar().Errorf("Error query timeout count: %v\n", err) } else { if vector4.Vector.Len() != 0 { timeout = float64(vector4.Vector[0].Value) @@ -191,7 +191,7 @@ func (p *PrometheusServiceImpl) FlowMetrics() (model.FlowMetricsRes, error) { vector5 := prometheus.FetchQuery(ctx, v1api, constant.MetricsHttpRequestAddressNotFount, nil) addrNotFound := float64(0) if vector5.Err != nil { - logger.Sugar().Errorf("Error query address not found count: %v\n", err) + logger2.Sugar().Errorf("Error query address not found count: %v\n", err) } else { if vector5.Vector.Len() != 0 { addrNotFound = float64(vector5.Vector[0].Value) @@ -203,7 +203,7 @@ func (p *PrometheusServiceImpl) FlowMetrics() (model.FlowMetricsRes, error) { vector6 := prometheus.FetchQuery(ctx, v1api, constant.MetricsHttpRequestOtherException, nil) others := float64(0) if vector6.Err != nil { - logger.Sugar().Errorf("Error query othere exceptions count: %v\n", err) + logger2.Sugar().Errorf("Error query othere exceptions count: %v\n", err) } else { if vector6.Vector.Len() != 0 { others = float64(vector6.Vector[0].Value) @@ -219,14 +219,14 @@ func (p *PrometheusServiceImpl) Metadata() (model.Metadata, error) { // versions versions, err := providerService.FindVersions() if err != nil { - logger.Error("Failed to parse versions!") + logger2.Error("Failed to parse versions!") } metadata.Versions = versions.Values() // protocols protocols, err := providerService.FindProtocols() if err != nil { - logger.Error("Failed to parse protocols!") + logger2.Error("Failed to parse protocols!") } metadata.Protocols = protocols.Values() diff --git a/pkg/admin/services/prometheus_service_impl_test.go b/pkg/admin/services/prometheus_service_impl_test.go index 66a9b1310..6da44ab71 100644 --- a/pkg/admin/services/prometheus_service_impl_test.go +++ b/pkg/admin/services/prometheus_service_impl_test.go @@ -18,6 +18,7 @@ package services import ( + "github.com/apache/dubbo-admin/pkg/admin/config" "io" "net/http" "net/http/httptest" @@ -133,10 +134,10 @@ func TestPrometheusServiceImpl_PromDiscovery(t *testing.T) { { Labels: map[string]string{}, Targets: []string{ - "127.0.0.1:22222", - "198.127.163.150:22222", - "198.127.163.153:22222", - "198.127.163.151:22222", + "127.0.0.1:" + config.PrometheusMonitorPort, + "198.127.163.150:" + config.PrometheusMonitorPort, + "198.127.163.153:" + config.PrometheusMonitorPort, + "198.127.163.151:" + config.PrometheusMonitorPort, }, }, }, diff --git a/pkg/admin/services/registry_service_sync.go b/pkg/admin/services/registry_service_sync.go index 25519ba19..9ac50cac8 100644 --- a/pkg/admin/services/registry_service_sync.go +++ b/pkg/admin/services/registry_service_sync.go @@ -18,12 +18,11 @@ package services import ( + "github.com/apache/dubbo-admin/pkg/core/logger" "net/url" "strings" "sync" - "github.com/apache/dubbo-admin/pkg/logger" - "github.com/apache/dubbo-admin/pkg/admin/cache" "github.com/apache/dubbo-admin/pkg/admin/constant" util2 "github.com/apache/dubbo-admin/pkg/admin/util" diff --git a/pkg/admin/services/route_service_impl.go b/pkg/admin/services/route_service_impl.go index a51c3b44f..ed0f850fa 100644 --- a/pkg/admin/services/route_service_impl.go +++ b/pkg/admin/services/route_service_impl.go @@ -19,10 +19,9 @@ package services import ( "fmt" + "github.com/apache/dubbo-admin/pkg/core/logger" "strings" - "github.com/apache/dubbo-admin/pkg/logger" - "github.com/apache/dubbo-admin/pkg/admin/config" "github.com/apache/dubbo-admin/pkg/admin/constant" "github.com/apache/dubbo-admin/pkg/admin/model" diff --git a/pkg/admin/services/traffic/generic_rule_operation.go b/pkg/admin/services/traffic/generic_rule_operation.go index 90228d614..c40022c50 100644 --- a/pkg/admin/services/traffic/generic_rule_operation.go +++ b/pkg/admin/services/traffic/generic_rule_operation.go @@ -20,7 +20,7 @@ package traffic import ( "github.com/apache/dubbo-admin/pkg/admin/config" "github.com/apache/dubbo-admin/pkg/admin/model" - "github.com/apache/dubbo-admin/pkg/logger" + "github.com/apache/dubbo-admin/pkg/core/logger" perrors "github.com/pkg/errors" "gopkg.in/yaml.v2" ) diff --git a/pkg/traffic/internal/controller/notify.go b/pkg/admin/setup.go similarity index 61% rename from pkg/traffic/internal/controller/notify.go rename to pkg/admin/setup.go index 35c53de8c..a42ca2cea 100644 --- a/pkg/traffic/internal/controller/notify.go +++ b/pkg/admin/setup.go @@ -15,20 +15,23 @@ * limitations under the License. */ -package controller +package admin import ( - "github.com/apache/dubbo-admin/pkg/traffic/internal/pb" - "github.com/apache/dubbo-admin/pkg/traffic/internal/watchserver" + "github.com/apache/dubbo-admin/pkg/admin/router" + core_runtime "github.com/apache/dubbo-admin/pkg/core/runtime" + "github.com/pkg/errors" ) -func notify(bytes []byte, key string) { - var events []pb.Event - events = append(events, pb.Event{ - Kv: &pb.KeyValue{ - Key: []byte(key), - Value: bytes, - }, - }) - watchserver.WatchSrv.Watchable.Notify(events) +func Setup(rt core_runtime.Runtime) error { + if err := RegisterDatabase(rt); err != nil { + return errors.Wrap(err, "Database register failed") + } + if err := RegisterOther(rt); err != nil { + return errors.Wrap(err, "register failed") + } + if err := rt.Add(router.InitRouter()); err != nil { + return errors.Wrap(err, "Add admin bootstrap failed") + } + return nil } diff --git a/pkg/admin/util/monitor_utils.go b/pkg/admin/util/monitor_utils.go index f7a328ab5..377c1f447 100644 --- a/pkg/admin/util/monitor_utils.go +++ b/pkg/admin/util/monitor_utils.go @@ -15,12 +15,16 @@ package util -import "strings" +import ( + "strings" + + "github.com/apache/dubbo-admin/pkg/admin/config" +) func GetDiscoveryPath(address string) string { if strings.Contains(address, ":") { index := strings.Index(address, ":") - return address[0:index] + ":22222" + return address[0:index] + ":" + config.PrometheusMonitorPort } - return address + ":22222" + return address + ":" + config.PrometheusMonitorPort } diff --git a/pkg/admin/util/monitor_utils_test.go b/pkg/admin/util/monitor_utils_test.go index 56044740c..53fda000b 100644 --- a/pkg/admin/util/monitor_utils_test.go +++ b/pkg/admin/util/monitor_utils_test.go @@ -16,6 +16,7 @@ package util import ( + "github.com/apache/dubbo-admin/pkg/admin/config" "reflect" "testing" ) @@ -34,14 +35,14 @@ func TestGetDiscoveryPath(t *testing.T) { args: args{ address: "127.0.0.1:0", }, - want: "127.0.0.1:22222", + want: "127.0.0.1:" + config.PrometheusMonitorPort, }, { name: "RightTest2", args: args{ address: "192.168.127.153", }, - want: "192.168.127.153:22222", + want: "192.168.127.153:" + config.PrometheusMonitorPort, }, } for _, tt := range tests { diff --git a/pkg/authority/apis/dubbo.apache.org/v1beta1/types.go b/pkg/authority/apis/dubbo.apache.org/v1beta1/types.go deleted file mode 100644 index 1dbe94574..000000000 --- a/pkg/authority/apis/dubbo.apache.org/v1beta1/types.go +++ /dev/null @@ -1,253 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one or more -// contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. -// The ASF licenses this file to You under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with -// the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package v1beta1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// +genclient -// +kubebuilder:object:root=true -// +kubebuilder:resource:shortName=ac -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -type AuthenticationPolicy struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - // +optional - Spec AuthenticationPolicySpec `json:"spec"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -type AuthenticationPolicyList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata"` - - Items []AuthenticationPolicy `json:"items"` -} - -type AuthenticationPolicySpec struct { - // The action to take when a rule is matched. - // +required - // +kubebuilder:validation:Required - // +kubebuilder:validation:Type=string - // +kubebuilder:validation:Enum=NONE;DISABLED;PERMISSIVE;STRICT - Action string `json:"action"` - // +optional - Selector []AuthenticationPolicySelector `json:"selector,omitempty"` - - // +optional - PortLevel []AuthenticationPolicyPortLevel `json:"PortLevel,omitempty"` -} - -type AuthenticationPolicySelector struct { - // The namespaces to match of the source workload. - // +optional - Namespaces []string `json:"namespaces,omitempty"` - // The namespaces not to match of the source workload. - // +optional - NotNamespaces []string `json:"notNamespaces,omitempty"` - // The IP addresses to match of the source workload. - // +optional - IpBlocks []string `json:"ipBlocks,omitempty"` - // The IP addresses not to match of the source workload. - // +optional - NotIpBlocks []string `json:"notIpBlocks,omitempty"` - // The identities(from spiffe) to match of the source workload. - // +optional - Principals []string `json:"principals,omitempty"` - // The identities(from spiffe) not to match of the source workload. - // +optional - NotPrincipals []string `json:"notPrincipals,omitempty"` - // The extended identities(from Dubbo Auth) to match of the source workload. - // +optional - Extends []AuthenticationPolicyExtend `json:"extends,omitempty"` - // The extended identities(from Dubbo Auth) not to match of the source workload. - // +optional - NotExtends []AuthenticationPolicyExtend `json:"notExtends,omitempty"` -} - -type AuthenticationPolicyPortLevel struct { - // The key of the extended identity. - // +required - // +kubebuilder:validation:Required - // +kubebuilder:validation:Type=number - // +kubebuilder:validation:Minimum=0 - // +kubebuilder:validation:Maximum=65535 - // +kubebuilder:default=0 - Port int `json:"port,omitempty"` - // +required - // +kubebuilder:validation:Required - // +kubebuilder:validation:Type=string - // +kubebuilder:validation:Enum=NONE;DISABLED;PERMISSIVE;STRICT - Action string `json:"action,omitempty"` -} - -type AuthenticationPolicyExtend struct { - // The key of the extended identity. - // +optional - Key string `json:"key,omitempty"` - // The value of the extended identity. - // +optional - Value string `json:"value,omitempty"` -} - -// +genclient -// +kubebuilder:object:root=true -// +kubebuilder:resource:shortName=az -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -type AuthorizationPolicy struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - // +optional - Spec AuthorizationPolicySpec `json:"spec"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -type AuthorizationPolicyList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata"` - - Items []AuthorizationPolicy `json:"items"` -} - -type AuthorizationPolicySpec struct { - // The action to take when a rule is matched - // +required - // +kubebuilder:validation:Required - // +kubebuilder:validation:Type=string - // +kubebuilder:validation:Enum=ALLOW;DENY;ADUIT - Action string `json:"action"` - // +optional - Rules []AuthorizationPolicyRule `json:"rules,omitempty"` - // The sample rate of the rule. The value is between 0 and 100. - // +optional - // +kubebuilder:validation:Type=number - // +kubebuilder:validation:Minimum=0 - // +kubebuilder:validation:Maximum=100 - // +kubebuilder:default=100 - Samples float32 `json:"samples,omitempty"` - // The order of the rule. - // +optional - // +kubebuilder:validation:Type=number - // +kubebuilder:validation:Minimum=-2147483648 - // +kubebuilder:validation:Maximum=2147483647 - // +kubebuilder:default=0 - Order float32 `json:"order,omitempty"` - // The match type of the rules. - // +optional - // +kubebuilder:validation:Type=string - // +kubebuilder:validation:Enum=anyMatch;allMatch - // +kubebuilder:default=anyMatch - MatchType string `json:"matchType,omitempty"` -} - -type AuthorizationPolicyRule struct { - // The source of the traffic to be matched. - // +optional - From AuthorizationPolicySource `json:"from,omitempty"` - // The destination of the traffic to be matched. - // +optional - To AuthorizationPolicyTarget `json:"to,omitempty"` - // +optional - When AuthorizationPolicyCondition `json:"when,omitempty"` -} - -type AuthorizationPolicySource struct { - // The namespaces to match of the source workload. - // +optional - Namespaces []string `json:"namespaces,omitempty"` - // The namespaces not to match of the source workload. - // +optional - NotNamespaces []string `json:"notNamespaces,omitempty"` - // The IP addresses to match of the source workload. - // +optional - IpBlocks []string `json:"ipBlocks,omitempty"` - // The IP addresses not to match of the source workload. - // +optional - NotIpBlocks []string `json:"notIpBlocks,omitempty"` - // The identities(from spiffe) to match of the source workload. - // +optional - Principals []string `json:"principals,omitempty"` - // The identities(from spiffe) not to match of the source workload - // +optional - NotPrincipals []string `json:"notPrincipals,omitempty"` - // The extended identities(from Dubbo Auth) to match of the source workload. - // +optional - Extends []AuthorizationPolicyExtend `json:"extends,omitempty"` - // The extended identities(from Dubbo Auth) not to match of the source workload. - // +optional - NotExtends []AuthorizationPolicyExtend `json:"notExtends,omitempty"` -} - -type AuthorizationPolicyTarget struct { - // The namespaces to match of the source workload. - // +optional - Namespaces []string `json:"namespaces,omitempty"` - // The namespaces not to match of the source workload. - // +optional - NotNamespaces []string `json:"notNamespaces,omitempty"` - // The IP addresses to match of the destination workload. - // +optional - IpBlocks []string `json:"ipBlocks,omitempty"` - // The IP addresses not to match of the destination workload. - // +optional - NotIpBlocks []string `json:"notIpBlocks,omitempty"` - // The identities(from spiffe) to match of the destination workload. - // +optional - Principals []string `json:"principals,omitempty"` - // The identities(from spiffe) not to match of the destination workload. - // +optional - NotPrincipals []string `json:"notPrincipals,omitempty"` - // The extended identities(from Dubbo Auth) to match of the destination workload. - // +optional - Extends []AuthorizationPolicyExtend `json:"extends,omitempty"` - // The extended identities(from Dubbo Auth) not to match of the destination workload. - // +optional - NotExtends []AuthorizationPolicyExtend `json:"notExtends,omitempty"` -} - -type AuthorizationPolicyCondition struct { - // +optional - Key string `json:"key,omitempty"` - // +optional - Values []AuthorizationPolicyMatch `json:"values,omitempty"` - // +optional - NotValues []AuthorizationPolicyMatch `json:"notValues,omitempty"` -} - -type AuthorizationPolicyMatch struct { - // +optional - // +kubebuilder:validation:Type=string - // +kubebuilder:validation:Enum=equals;regex;ognl - // +kubebuilder:default=equals - Type string `json:"type,omitempty"` - // +optional - Value string `json:"value,omitempty"` -} - -type AuthorizationPolicyExtend struct { - // The key of the extended identity. - // +optional - Key string `json:"key,omitempty"` - // The value of the extended identity - // +optional - Value string `json:"value,omitempty"` -} diff --git a/pkg/authority/cert/storage_test.go b/pkg/authority/cert/storage_test.go deleted file mode 100644 index 33780c277..000000000 --- a/pkg/authority/cert/storage_test.go +++ /dev/null @@ -1,237 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one or more -// contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. -// The ASF licenses this file to You under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with -// the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package cert - -import ( - "crypto/ecdsa" - "crypto/elliptic" - "crypto/rand" - "crypto/x509" - "os" - "reflect" - "sync" - "testing" - "time" - - "github.com/apache/dubbo-admin/pkg/authority/config" - "github.com/apache/dubbo-admin/pkg/logger" -) - -func TestIsValid(t *testing.T) { - t.Parallel() - - c := &Cert{} - if c.IsValid() { - t.Errorf("cert is not valid") - } - - c.Cert = &x509.Certificate{} - if c.IsValid() { - t.Errorf("cert is not valid") - } - - c.CertPem = "test" - if c.IsValid() { - t.Errorf("cert is not valid") - } - - c.PrivateKey, _ = ecdsa.GenerateKey(elliptic.P256(), rand.Reader) - if c.IsValid() { - t.Errorf("cert is not valid") - } - - c.Cert.NotBefore = time.Now().Add(-1 * time.Hour) - c.Cert.NotAfter = time.Now().Add(1 * time.Hour) - if c.IsValid() { - t.Errorf("cert is not valid") - } - - c = GenerateAuthorityCert(nil, 2*60*60*1000) - if !c.IsValid() { - t.Errorf("cert is valid") - } -} - -func TestNeedRefresh(t *testing.T) { - t.Parallel() - - c := &Cert{} - if !c.NeedRefresh() { - t.Errorf("cert is need refresh") - } - - c.Cert = &x509.Certificate{} - if !c.NeedRefresh() { - t.Errorf("cert is need refresh") - } - - c.CertPem = "test" - if !c.NeedRefresh() { - t.Errorf("cert is need refresh") - } - - c.PrivateKey, _ = ecdsa.GenerateKey(elliptic.P256(), rand.Reader) - if !c.NeedRefresh() { - t.Errorf("cert is need refresh") - } - - c.Cert.NotBefore = time.Now().Add(1 * time.Hour) - if !c.NeedRefresh() { - t.Errorf("cert is not need refresh") - } - - c.Cert.NotBefore = time.Now().Add(-1 * time.Hour) - c.Cert.NotAfter = time.Now().Add(-1 * time.Hour) - if !c.NeedRefresh() { - t.Errorf("cert is not need refresh") - } - - c.Cert.NotBefore = time.Now().Add(-1 * time.Hour).Add(2 * 60 * -0.3 * time.Minute) - c.Cert.NotAfter = time.Now().Add(-1 * time.Hour).Add(2 * 60 * 0.7 * time.Minute) - if !c.NeedRefresh() { - t.Errorf("cert is need refresh") - } - - c.Cert.NotAfter = time.Now().Add(1 * time.Hour) - if !c.NeedRefresh() { - t.Errorf("cert is need refresh") - } - - c = GenerateAuthorityCert(nil, 2*60*60*1000) - if c.NeedRefresh() { - t.Errorf("cert is valid") - } -} - -func TestGetTlsCert(t *testing.T) { - t.Parallel() - - cert := GenerateAuthorityCert(nil, 2*60*60*1000) - - tlsCert := cert.GetTlsCert() - if !reflect.DeepEqual(tlsCert.PrivateKey, cert.PrivateKey) { - t.Errorf("cert is not equal") - } - - if tlsCert != cert.GetTlsCert() { - t.Errorf("cert is not equal") - } -} - -func TestGetServerCert(t *testing.T) { - t.Parallel() - - cert := GenerateAuthorityCert(nil, 24*60*60*1000) - - s := &storageImpl{ - authorityCert: cert, - mutex: &sync.Mutex{}, - caValidity: 24 * 60 * 60 * 1000, - certValidity: 2 * 60 * 60 * 1000, - } - - c := s.GetServerCert("localhost") - - pool := x509.NewCertPool() - pool.AddCert(cert.Cert) - certificate, err := x509.ParseCertificate(c.Certificate[0]) - if err != nil { - t.Errorf(err.Error()) - return - } - - _, err = certificate.Verify(x509.VerifyOptions{ - Roots: pool, - DNSName: "localhost", - }) - - if err != nil { - t.Errorf(err.Error()) - return - } - - if c != s.GetServerCert("localhost") { - t.Errorf("cert is not equal") - } - - if c != s.GetServerCert("") { - t.Errorf("cert is not equal") - } - - c = s.GetServerCert("newhost") - - pool = x509.NewCertPool() - pool.AddCert(cert.Cert) - certificate, err = x509.ParseCertificate(c.Certificate[0]) - if err != nil { - t.Errorf(err.Error()) - return - } - - _, err = certificate.Verify(x509.VerifyOptions{ - Roots: pool, - DNSName: "localhost", - }) - - if err != nil { - t.Errorf(err.Error()) - return - } - - _, err = certificate.Verify(x509.VerifyOptions{ - Roots: pool, - DNSName: "newhost", - }) - - if err != nil { - t.Errorf(err.Error()) - return - } -} - -func TestRefreshServerCert(t *testing.T) { - t.Parallel() - - logger.Init() - s := NewStorage(&config.Options{ - CaValidity: 24 * 60 * 60 * 1000, - CertValidity: 10, - }) - s.authorityCert = GenerateAuthorityCert(nil, 24*60*60*1000) - - go s.RefreshServerCert() - - c := s.GetServerCert("localhost") - origin := s.serverCerts - - for i := 0; i < 100; i++ { - // at most 10s - time.Sleep(100 * time.Millisecond) - if origin != s.serverCerts { - break - } - } - - if c == s.GetServerCert("localhost") { - t.Errorf("cert is not equal") - } - - if reflect.DeepEqual(c, s.GetServerCert("localhost")) { - t.Errorf("cert is not equal") - } - - s.stopChan <- os.Kill -} diff --git a/pkg/authority/config/options.go b/pkg/authority/config/options.go deleted file mode 100644 index f5c456e81..000000000 --- a/pkg/authority/config/options.go +++ /dev/null @@ -1,146 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one or more -// contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. -// The ASF licenses this file to You under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with -// the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package config - -import ( - "crypto/rand" - "encoding/base32" - "fmt" - "os" - "strconv" - - "github.com/spf13/pflag" -) - -type Options struct { - Namespace string - ServiceName string - - PlainServerPort int - SecureServerPort int - DebugPort int - - WebhookPort int32 - WebhookAllowOnErr bool - - CaValidity int64 - CertValidity int64 - - InPodEnv bool - IsKubernetesConnected bool - IsTrustAnyone bool - - // TODO remove EnableOIDCCheck - EnableOIDCCheck bool - ResourcelockIdentity string - - // Qps for rest config - RestConfigQps int - // Burst for rest config - RestConfigBurst int -} - -func NewOptions() *Options { - return &Options{ - Namespace: "dubbo-system", - ServiceName: "dubbo-ca", - PlainServerPort: 30060, - SecureServerPort: 30062, - DebugPort: 30070, - WebhookPort: 30080, - WebhookAllowOnErr: true, - CaValidity: 30 * 24 * 60 * 60 * 1000, // 30 day - CertValidity: 1 * 60 * 60 * 1000, // 1 hour - - InPodEnv: false, - IsKubernetesConnected: false, - EnableOIDCCheck: true, - ResourcelockIdentity: GetStringEnv("POD_NAME", GetDefaultResourcelockIdentity()), - RestConfigQps: 50, - RestConfigBurst: 100, - } -} - -func (o *Options) FillFlags(flags *pflag.FlagSet) { - flags.StringVar(&o.Namespace, "namespace", "dubbo-system", "dubbo namespace") - flags.StringVar(&o.ServiceName, "service-name", "dubbo-ca", "dubbo service name") - flags.IntVar(&o.PlainServerPort, "plain-server-port", 30060, "dubbo plain server port") - flags.IntVar(&o.SecureServerPort, "secure-server-port", 30062, "dubbo secure server port") - flags.IntVar(&o.DebugPort, "debug-port", 30070, "dubbo debug port") - flags.Int32Var(&o.WebhookPort, "webhook-port", 30080, "dubbo webhook port") - flags.BoolVar(&o.WebhookAllowOnErr, "webhook-allow-on-err", true, "dubbo webhook allow on error") - flags.BoolVar(&o.InPodEnv, "in-pod-env", false, "dubbo run in pod environment") - flags.BoolVar(&o.IsKubernetesConnected, "is-kubernetes-connected", false, "dubbo connected with kubernetes") - flags.BoolVar(&o.EnableOIDCCheck, "enable-oidc-check", false, "dubbo enable OIDC check") - flags.IntVar(&o.RestConfigQps, "rest-config-qps", 50, "qps for rest config") - flags.IntVar(&o.RestConfigBurst, "rest-config-burst", 100, "burst for rest config") -} - -func (o *Options) Validate() []error { - // TODO validate options - return nil -} - -func GetStringEnv(name string, defvalue string) string { - val, ex := os.LookupEnv(name) - if ex { - return val - } else { - return defvalue - } -} - -func GetIntEnv(name string, defvalue int) int { - val, ex := os.LookupEnv(name) - if ex { - num, err := strconv.Atoi(val) - if err != nil { - return defvalue - } else { - return num - } - } else { - return defvalue - } -} - -func GetBoolEnv(name string, defvalue bool) bool { - val, ex := os.LookupEnv(name) - if ex { - boolVal, err := strconv.ParseBool(val) - if err != nil { - return defvalue - } else { - return boolVal - } - } else { - return defvalue - } -} - -func GetDefaultResourcelockIdentity() string { - hostname, err := os.Hostname() - if err != nil { - panic(err) - } - randomBytes := make([]byte, 5) - _, err = rand.Read(randomBytes) - if err != nil { - panic(err) - } - randomStr := base32.StdEncoding.EncodeToString(randomBytes) - return fmt.Sprintf("%s-%s", hostname, randomStr) -} diff --git a/pkg/authority/generated/applyconfiguration/dubbo.apache.org/v1beta1/authenticationpolicy.go b/pkg/authority/generated/applyconfiguration/dubbo.apache.org/v1beta1/authenticationpolicy.go deleted file mode 100644 index 363b048e2..000000000 --- a/pkg/authority/generated/applyconfiguration/dubbo.apache.org/v1beta1/authenticationpolicy.go +++ /dev/null @@ -1,209 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one or more -// contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. -// The ASF licenses this file to You under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with -// the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1beta1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - v1 "k8s.io/client-go/applyconfigurations/meta/v1" -) - -// AuthenticationPolicyApplyConfiguration represents an declarative configuration of the AuthenticationPolicy type for use -// with apply. -type AuthenticationPolicyApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` - *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - Spec *AuthenticationPolicySpecApplyConfiguration `json:"spec,omitempty"` -} - -// AuthenticationPolicy constructs an declarative configuration of the AuthenticationPolicy type for use with -// apply. -func AuthenticationPolicy(name, namespace string) *AuthenticationPolicyApplyConfiguration { - b := &AuthenticationPolicyApplyConfiguration{} - b.WithName(name) - b.WithNamespace(namespace) - b.WithKind("AuthenticationPolicy") - b.WithAPIVersion("dubbo.apache.org/v1beta1") - return b -} - -// WithKind sets the Kind field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Kind field is set to the value of the last call. -func (b *AuthenticationPolicyApplyConfiguration) WithKind(value string) *AuthenticationPolicyApplyConfiguration { - b.Kind = &value - return b -} - -// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the APIVersion field is set to the value of the last call. -func (b *AuthenticationPolicyApplyConfiguration) WithAPIVersion(value string) *AuthenticationPolicyApplyConfiguration { - b.APIVersion = &value - return b -} - -// WithName sets the Name field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Name field is set to the value of the last call. -func (b *AuthenticationPolicyApplyConfiguration) WithName(value string) *AuthenticationPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Name = &value - return b -} - -// WithGenerateName sets the GenerateName field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the GenerateName field is set to the value of the last call. -func (b *AuthenticationPolicyApplyConfiguration) WithGenerateName(value string) *AuthenticationPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.GenerateName = &value - return b -} - -// WithNamespace sets the Namespace field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Namespace field is set to the value of the last call. -func (b *AuthenticationPolicyApplyConfiguration) WithNamespace(value string) *AuthenticationPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Namespace = &value - return b -} - -// WithUID sets the UID field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the UID field is set to the value of the last call. -func (b *AuthenticationPolicyApplyConfiguration) WithUID(value types.UID) *AuthenticationPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.UID = &value - return b -} - -// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ResourceVersion field is set to the value of the last call. -func (b *AuthenticationPolicyApplyConfiguration) WithResourceVersion(value string) *AuthenticationPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.ResourceVersion = &value - return b -} - -// WithGeneration sets the Generation field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Generation field is set to the value of the last call. -func (b *AuthenticationPolicyApplyConfiguration) WithGeneration(value int64) *AuthenticationPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Generation = &value - return b -} - -// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the CreationTimestamp field is set to the value of the last call. -func (b *AuthenticationPolicyApplyConfiguration) WithCreationTimestamp(value metav1.Time) *AuthenticationPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.CreationTimestamp = &value - return b -} - -// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DeletionTimestamp field is set to the value of the last call. -func (b *AuthenticationPolicyApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *AuthenticationPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.DeletionTimestamp = &value - return b -} - -// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. -func (b *AuthenticationPolicyApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *AuthenticationPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.DeletionGracePeriodSeconds = &value - return b -} - -// WithLabels puts the entries into the Labels field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, the entries provided by each call will be put on the Labels field, -// overwriting an existing map entries in Labels field with the same key. -func (b *AuthenticationPolicyApplyConfiguration) WithLabels(entries map[string]string) *AuthenticationPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - if b.Labels == nil && len(entries) > 0 { - b.Labels = make(map[string]string, len(entries)) - } - for k, v := range entries { - b.Labels[k] = v - } - return b -} - -// WithAnnotations puts the entries into the Annotations field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, the entries provided by each call will be put on the Annotations field, -// overwriting an existing map entries in Annotations field with the same key. -func (b *AuthenticationPolicyApplyConfiguration) WithAnnotations(entries map[string]string) *AuthenticationPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - if b.Annotations == nil && len(entries) > 0 { - b.Annotations = make(map[string]string, len(entries)) - } - for k, v := range entries { - b.Annotations[k] = v - } - return b -} - -// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the OwnerReferences field. -func (b *AuthenticationPolicyApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *AuthenticationPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - for i := range values { - if values[i] == nil { - panic("nil value passed to WithOwnerReferences") - } - b.OwnerReferences = append(b.OwnerReferences, *values[i]) - } - return b -} - -// WithFinalizers adds the given value to the Finalizers field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Finalizers field. -func (b *AuthenticationPolicyApplyConfiguration) WithFinalizers(values ...string) *AuthenticationPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - for i := range values { - b.Finalizers = append(b.Finalizers, values[i]) - } - return b -} - -func (b *AuthenticationPolicyApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { - if b.ObjectMetaApplyConfiguration == nil { - b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} - } -} - -// WithSpec sets the Spec field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Spec field is set to the value of the last call. -func (b *AuthenticationPolicyApplyConfiguration) WithSpec(value *AuthenticationPolicySpecApplyConfiguration) *AuthenticationPolicyApplyConfiguration { - b.Spec = value - return b -} diff --git a/pkg/authority/generated/applyconfiguration/dubbo.apache.org/v1beta1/authenticationpolicyextend.go b/pkg/authority/generated/applyconfiguration/dubbo.apache.org/v1beta1/authenticationpolicyextend.go deleted file mode 100644 index 9b9b4bf1d..000000000 --- a/pkg/authority/generated/applyconfiguration/dubbo.apache.org/v1beta1/authenticationpolicyextend.go +++ /dev/null @@ -1,47 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one or more -// contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. -// The ASF licenses this file to You under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with -// the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1beta1 - -// AuthenticationPolicyExtendApplyConfiguration represents an declarative configuration of the AuthenticationPolicyExtend type for use -// with apply. -type AuthenticationPolicyExtendApplyConfiguration struct { - Key *string `json:"key,omitempty"` - Value *string `json:"value,omitempty"` -} - -// AuthenticationPolicyExtendApplyConfiguration constructs an declarative configuration of the AuthenticationPolicyExtend type for use with -// apply. -func AuthenticationPolicyExtend() *AuthenticationPolicyExtendApplyConfiguration { - return &AuthenticationPolicyExtendApplyConfiguration{} -} - -// WithKey sets the Key field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Key field is set to the value of the last call. -func (b *AuthenticationPolicyExtendApplyConfiguration) WithKey(value string) *AuthenticationPolicyExtendApplyConfiguration { - b.Key = &value - return b -} - -// WithValue sets the Value field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Value field is set to the value of the last call. -func (b *AuthenticationPolicyExtendApplyConfiguration) WithValue(value string) *AuthenticationPolicyExtendApplyConfiguration { - b.Value = &value - return b -} diff --git a/pkg/authority/generated/applyconfiguration/dubbo.apache.org/v1beta1/authenticationpolicyportlevel.go b/pkg/authority/generated/applyconfiguration/dubbo.apache.org/v1beta1/authenticationpolicyportlevel.go deleted file mode 100644 index 6d5fb4283..000000000 --- a/pkg/authority/generated/applyconfiguration/dubbo.apache.org/v1beta1/authenticationpolicyportlevel.go +++ /dev/null @@ -1,47 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one or more -// contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. -// The ASF licenses this file to You under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with -// the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1beta1 - -// AuthenticationPolicyPortLevelApplyConfiguration represents an declarative configuration of the AuthenticationPolicyPortLevel type for use -// with apply. -type AuthenticationPolicyPortLevelApplyConfiguration struct { - Port *int `json:"port,omitempty"` - Action *string `json:"action,omitempty"` -} - -// AuthenticationPolicyPortLevelApplyConfiguration constructs an declarative configuration of the AuthenticationPolicyPortLevel type for use with -// apply. -func AuthenticationPolicyPortLevel() *AuthenticationPolicyPortLevelApplyConfiguration { - return &AuthenticationPolicyPortLevelApplyConfiguration{} -} - -// WithPort sets the Port field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Port field is set to the value of the last call. -func (b *AuthenticationPolicyPortLevelApplyConfiguration) WithPort(value int) *AuthenticationPolicyPortLevelApplyConfiguration { - b.Port = &value - return b -} - -// WithAction sets the Action field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Action field is set to the value of the last call. -func (b *AuthenticationPolicyPortLevelApplyConfiguration) WithAction(value string) *AuthenticationPolicyPortLevelApplyConfiguration { - b.Action = &value - return b -} diff --git a/pkg/authority/generated/applyconfiguration/dubbo.apache.org/v1beta1/authenticationpolicyselector.go b/pkg/authority/generated/applyconfiguration/dubbo.apache.org/v1beta1/authenticationpolicyselector.go deleted file mode 100644 index f0fffb087..000000000 --- a/pkg/authority/generated/applyconfiguration/dubbo.apache.org/v1beta1/authenticationpolicyselector.go +++ /dev/null @@ -1,123 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one or more -// contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. -// The ASF licenses this file to You under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with -// the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1beta1 - -// AuthenticationPolicySelectorApplyConfiguration represents an declarative configuration of the AuthenticationPolicySelector type for use -// with apply. -type AuthenticationPolicySelectorApplyConfiguration struct { - Namespaces []string `json:"namespaces,omitempty"` - NotNamespaces []string `json:"notNamespaces,omitempty"` - IpBlocks []string `json:"ipBlocks,omitempty"` - NotIpBlocks []string `json:"notIpBlocks,omitempty"` - Principals []string `json:"principals,omitempty"` - NotPrincipals []string `json:"notPrincipals,omitempty"` - Extends []AuthenticationPolicyExtendApplyConfiguration `json:"extends,omitempty"` - NotExtends []AuthenticationPolicyExtendApplyConfiguration `json:"notExtends,omitempty"` -} - -// AuthenticationPolicySelectorApplyConfiguration constructs an declarative configuration of the AuthenticationPolicySelector type for use with -// apply. -func AuthenticationPolicySelector() *AuthenticationPolicySelectorApplyConfiguration { - return &AuthenticationPolicySelectorApplyConfiguration{} -} - -// WithNamespaces adds the given value to the Namespaces field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Namespaces field. -func (b *AuthenticationPolicySelectorApplyConfiguration) WithNamespaces(values ...string) *AuthenticationPolicySelectorApplyConfiguration { - for i := range values { - b.Namespaces = append(b.Namespaces, values[i]) - } - return b -} - -// WithNotNamespaces adds the given value to the NotNamespaces field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the NotNamespaces field. -func (b *AuthenticationPolicySelectorApplyConfiguration) WithNotNamespaces(values ...string) *AuthenticationPolicySelectorApplyConfiguration { - for i := range values { - b.NotNamespaces = append(b.NotNamespaces, values[i]) - } - return b -} - -// WithIpBlocks adds the given value to the IpBlocks field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the IpBlocks field. -func (b *AuthenticationPolicySelectorApplyConfiguration) WithIpBlocks(values ...string) *AuthenticationPolicySelectorApplyConfiguration { - for i := range values { - b.IpBlocks = append(b.IpBlocks, values[i]) - } - return b -} - -// WithNotIpBlocks adds the given value to the NotIpBlocks field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the NotIpBlocks field. -func (b *AuthenticationPolicySelectorApplyConfiguration) WithNotIpBlocks(values ...string) *AuthenticationPolicySelectorApplyConfiguration { - for i := range values { - b.NotIpBlocks = append(b.NotIpBlocks, values[i]) - } - return b -} - -// WithPrincipals adds the given value to the Principals field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Principals field. -func (b *AuthenticationPolicySelectorApplyConfiguration) WithPrincipals(values ...string) *AuthenticationPolicySelectorApplyConfiguration { - for i := range values { - b.Principals = append(b.Principals, values[i]) - } - return b -} - -// WithNotPrincipals adds the given value to the NotPrincipals field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the NotPrincipals field. -func (b *AuthenticationPolicySelectorApplyConfiguration) WithNotPrincipals(values ...string) *AuthenticationPolicySelectorApplyConfiguration { - for i := range values { - b.NotPrincipals = append(b.NotPrincipals, values[i]) - } - return b -} - -// WithExtends adds the given value to the Extends field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Extends field. -func (b *AuthenticationPolicySelectorApplyConfiguration) WithExtends(values ...*AuthenticationPolicyExtendApplyConfiguration) *AuthenticationPolicySelectorApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithExtends") - } - b.Extends = append(b.Extends, *values[i]) - } - return b -} - -// WithNotExtends adds the given value to the NotExtends field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the NotExtends field. -func (b *AuthenticationPolicySelectorApplyConfiguration) WithNotExtends(values ...*AuthenticationPolicyExtendApplyConfiguration) *AuthenticationPolicySelectorApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithNotExtends") - } - b.NotExtends = append(b.NotExtends, *values[i]) - } - return b -} diff --git a/pkg/authority/generated/applyconfiguration/dubbo.apache.org/v1beta1/authenticationpolicyspec.go b/pkg/authority/generated/applyconfiguration/dubbo.apache.org/v1beta1/authenticationpolicyspec.go deleted file mode 100644 index f7d38669a..000000000 --- a/pkg/authority/generated/applyconfiguration/dubbo.apache.org/v1beta1/authenticationpolicyspec.go +++ /dev/null @@ -1,66 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one or more -// contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. -// The ASF licenses this file to You under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with -// the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1beta1 - -// AuthenticationPolicySpecApplyConfiguration represents an declarative configuration of the AuthenticationPolicySpec type for use -// with apply. -type AuthenticationPolicySpecApplyConfiguration struct { - Action *string `json:"action,omitempty"` - Selector []AuthenticationPolicySelectorApplyConfiguration `json:"selector,omitempty"` - PortLevel []AuthenticationPolicyPortLevelApplyConfiguration `json:"PortLevel,omitempty"` -} - -// AuthenticationPolicySpecApplyConfiguration constructs an declarative configuration of the AuthenticationPolicySpec type for use with -// apply. -func AuthenticationPolicySpec() *AuthenticationPolicySpecApplyConfiguration { - return &AuthenticationPolicySpecApplyConfiguration{} -} - -// WithAction sets the Action field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Action field is set to the value of the last call. -func (b *AuthenticationPolicySpecApplyConfiguration) WithAction(value string) *AuthenticationPolicySpecApplyConfiguration { - b.Action = &value - return b -} - -// WithSelector adds the given value to the Selector field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Selector field. -func (b *AuthenticationPolicySpecApplyConfiguration) WithSelector(values ...*AuthenticationPolicySelectorApplyConfiguration) *AuthenticationPolicySpecApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithSelector") - } - b.Selector = append(b.Selector, *values[i]) - } - return b -} - -// WithPortLevel adds the given value to the PortLevel field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the PortLevel field. -func (b *AuthenticationPolicySpecApplyConfiguration) WithPortLevel(values ...*AuthenticationPolicyPortLevelApplyConfiguration) *AuthenticationPolicySpecApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithPortLevel") - } - b.PortLevel = append(b.PortLevel, *values[i]) - } - return b -} diff --git a/pkg/authority/generated/applyconfiguration/dubbo.apache.org/v1beta1/authorizationpolicy.go b/pkg/authority/generated/applyconfiguration/dubbo.apache.org/v1beta1/authorizationpolicy.go deleted file mode 100644 index 19599ef3b..000000000 --- a/pkg/authority/generated/applyconfiguration/dubbo.apache.org/v1beta1/authorizationpolicy.go +++ /dev/null @@ -1,209 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one or more -// contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. -// The ASF licenses this file to You under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with -// the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1beta1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - v1 "k8s.io/client-go/applyconfigurations/meta/v1" -) - -// AuthorizationPolicyApplyConfiguration represents an declarative configuration of the AuthorizationPolicy type for use -// with apply. -type AuthorizationPolicyApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` - *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - Spec *AuthorizationPolicySpecApplyConfiguration `json:"spec,omitempty"` -} - -// AuthorizationPolicy constructs an declarative configuration of the AuthorizationPolicy type for use with -// apply. -func AuthorizationPolicy(name, namespace string) *AuthorizationPolicyApplyConfiguration { - b := &AuthorizationPolicyApplyConfiguration{} - b.WithName(name) - b.WithNamespace(namespace) - b.WithKind("AuthorizationPolicy") - b.WithAPIVersion("dubbo.apache.org/v1beta1") - return b -} - -// WithKind sets the Kind field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Kind field is set to the value of the last call. -func (b *AuthorizationPolicyApplyConfiguration) WithKind(value string) *AuthorizationPolicyApplyConfiguration { - b.Kind = &value - return b -} - -// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the APIVersion field is set to the value of the last call. -func (b *AuthorizationPolicyApplyConfiguration) WithAPIVersion(value string) *AuthorizationPolicyApplyConfiguration { - b.APIVersion = &value - return b -} - -// WithName sets the Name field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Name field is set to the value of the last call. -func (b *AuthorizationPolicyApplyConfiguration) WithName(value string) *AuthorizationPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Name = &value - return b -} - -// WithGenerateName sets the GenerateName field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the GenerateName field is set to the value of the last call. -func (b *AuthorizationPolicyApplyConfiguration) WithGenerateName(value string) *AuthorizationPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.GenerateName = &value - return b -} - -// WithNamespace sets the Namespace field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Namespace field is set to the value of the last call. -func (b *AuthorizationPolicyApplyConfiguration) WithNamespace(value string) *AuthorizationPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Namespace = &value - return b -} - -// WithUID sets the UID field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the UID field is set to the value of the last call. -func (b *AuthorizationPolicyApplyConfiguration) WithUID(value types.UID) *AuthorizationPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.UID = &value - return b -} - -// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ResourceVersion field is set to the value of the last call. -func (b *AuthorizationPolicyApplyConfiguration) WithResourceVersion(value string) *AuthorizationPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.ResourceVersion = &value - return b -} - -// WithGeneration sets the Generation field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Generation field is set to the value of the last call. -func (b *AuthorizationPolicyApplyConfiguration) WithGeneration(value int64) *AuthorizationPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Generation = &value - return b -} - -// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the CreationTimestamp field is set to the value of the last call. -func (b *AuthorizationPolicyApplyConfiguration) WithCreationTimestamp(value metav1.Time) *AuthorizationPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.CreationTimestamp = &value - return b -} - -// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DeletionTimestamp field is set to the value of the last call. -func (b *AuthorizationPolicyApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *AuthorizationPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.DeletionTimestamp = &value - return b -} - -// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. -func (b *AuthorizationPolicyApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *AuthorizationPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.DeletionGracePeriodSeconds = &value - return b -} - -// WithLabels puts the entries into the Labels field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, the entries provided by each call will be put on the Labels field, -// overwriting an existing map entries in Labels field with the same key. -func (b *AuthorizationPolicyApplyConfiguration) WithLabels(entries map[string]string) *AuthorizationPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - if b.Labels == nil && len(entries) > 0 { - b.Labels = make(map[string]string, len(entries)) - } - for k, v := range entries { - b.Labels[k] = v - } - return b -} - -// WithAnnotations puts the entries into the Annotations field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, the entries provided by each call will be put on the Annotations field, -// overwriting an existing map entries in Annotations field with the same key. -func (b *AuthorizationPolicyApplyConfiguration) WithAnnotations(entries map[string]string) *AuthorizationPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - if b.Annotations == nil && len(entries) > 0 { - b.Annotations = make(map[string]string, len(entries)) - } - for k, v := range entries { - b.Annotations[k] = v - } - return b -} - -// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the OwnerReferences field. -func (b *AuthorizationPolicyApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *AuthorizationPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - for i := range values { - if values[i] == nil { - panic("nil value passed to WithOwnerReferences") - } - b.OwnerReferences = append(b.OwnerReferences, *values[i]) - } - return b -} - -// WithFinalizers adds the given value to the Finalizers field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Finalizers field. -func (b *AuthorizationPolicyApplyConfiguration) WithFinalizers(values ...string) *AuthorizationPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - for i := range values { - b.Finalizers = append(b.Finalizers, values[i]) - } - return b -} - -func (b *AuthorizationPolicyApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { - if b.ObjectMetaApplyConfiguration == nil { - b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} - } -} - -// WithSpec sets the Spec field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Spec field is set to the value of the last call. -func (b *AuthorizationPolicyApplyConfiguration) WithSpec(value *AuthorizationPolicySpecApplyConfiguration) *AuthorizationPolicyApplyConfiguration { - b.Spec = value - return b -} diff --git a/pkg/authority/generated/applyconfiguration/dubbo.apache.org/v1beta1/authorizationpolicycondition.go b/pkg/authority/generated/applyconfiguration/dubbo.apache.org/v1beta1/authorizationpolicycondition.go deleted file mode 100644 index fab1bcb22..000000000 --- a/pkg/authority/generated/applyconfiguration/dubbo.apache.org/v1beta1/authorizationpolicycondition.go +++ /dev/null @@ -1,66 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one or more -// contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. -// The ASF licenses this file to You under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with -// the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1beta1 - -// AuthorizationPolicyConditionApplyConfiguration represents an declarative configuration of the AuthorizationPolicyCondition type for use -// with apply. -type AuthorizationPolicyConditionApplyConfiguration struct { - Key *string `json:"key,omitempty"` - Values []AuthorizationPolicyMatchApplyConfiguration `json:"values,omitempty"` - NotValues []AuthorizationPolicyMatchApplyConfiguration `json:"notValues,omitempty"` -} - -// AuthorizationPolicyConditionApplyConfiguration constructs an declarative configuration of the AuthorizationPolicyCondition type for use with -// apply. -func AuthorizationPolicyCondition() *AuthorizationPolicyConditionApplyConfiguration { - return &AuthorizationPolicyConditionApplyConfiguration{} -} - -// WithKey sets the Key field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Key field is set to the value of the last call. -func (b *AuthorizationPolicyConditionApplyConfiguration) WithKey(value string) *AuthorizationPolicyConditionApplyConfiguration { - b.Key = &value - return b -} - -// WithValues adds the given value to the Values field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Values field. -func (b *AuthorizationPolicyConditionApplyConfiguration) WithValues(values ...*AuthorizationPolicyMatchApplyConfiguration) *AuthorizationPolicyConditionApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithValues") - } - b.Values = append(b.Values, *values[i]) - } - return b -} - -// WithNotValues adds the given value to the NotValues field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the NotValues field. -func (b *AuthorizationPolicyConditionApplyConfiguration) WithNotValues(values ...*AuthorizationPolicyMatchApplyConfiguration) *AuthorizationPolicyConditionApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithNotValues") - } - b.NotValues = append(b.NotValues, *values[i]) - } - return b -} diff --git a/pkg/authority/generated/applyconfiguration/dubbo.apache.org/v1beta1/authorizationpolicyextend.go b/pkg/authority/generated/applyconfiguration/dubbo.apache.org/v1beta1/authorizationpolicyextend.go deleted file mode 100644 index 9ab353dc9..000000000 --- a/pkg/authority/generated/applyconfiguration/dubbo.apache.org/v1beta1/authorizationpolicyextend.go +++ /dev/null @@ -1,47 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one or more -// contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. -// The ASF licenses this file to You under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with -// the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1beta1 - -// AuthorizationPolicyExtendApplyConfiguration represents an declarative configuration of the AuthorizationPolicyExtend type for use -// with apply. -type AuthorizationPolicyExtendApplyConfiguration struct { - Key *string `json:"key,omitempty"` - Value *string `json:"value,omitempty"` -} - -// AuthorizationPolicyExtendApplyConfiguration constructs an declarative configuration of the AuthorizationPolicyExtend type for use with -// apply. -func AuthorizationPolicyExtend() *AuthorizationPolicyExtendApplyConfiguration { - return &AuthorizationPolicyExtendApplyConfiguration{} -} - -// WithKey sets the Key field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Key field is set to the value of the last call. -func (b *AuthorizationPolicyExtendApplyConfiguration) WithKey(value string) *AuthorizationPolicyExtendApplyConfiguration { - b.Key = &value - return b -} - -// WithValue sets the Value field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Value field is set to the value of the last call. -func (b *AuthorizationPolicyExtendApplyConfiguration) WithValue(value string) *AuthorizationPolicyExtendApplyConfiguration { - b.Value = &value - return b -} diff --git a/pkg/authority/generated/applyconfiguration/dubbo.apache.org/v1beta1/authorizationpolicymatch.go b/pkg/authority/generated/applyconfiguration/dubbo.apache.org/v1beta1/authorizationpolicymatch.go deleted file mode 100644 index fdc4843c8..000000000 --- a/pkg/authority/generated/applyconfiguration/dubbo.apache.org/v1beta1/authorizationpolicymatch.go +++ /dev/null @@ -1,47 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one or more -// contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. -// The ASF licenses this file to You under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with -// the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1beta1 - -// AuthorizationPolicyMatchApplyConfiguration represents an declarative configuration of the AuthorizationPolicyMatch type for use -// with apply. -type AuthorizationPolicyMatchApplyConfiguration struct { - Type *string `json:"type,omitempty"` - Value *string `json:"value,omitempty"` -} - -// AuthorizationPolicyMatchApplyConfiguration constructs an declarative configuration of the AuthorizationPolicyMatch type for use with -// apply. -func AuthorizationPolicyMatch() *AuthorizationPolicyMatchApplyConfiguration { - return &AuthorizationPolicyMatchApplyConfiguration{} -} - -// WithType sets the Type field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Type field is set to the value of the last call. -func (b *AuthorizationPolicyMatchApplyConfiguration) WithType(value string) *AuthorizationPolicyMatchApplyConfiguration { - b.Type = &value - return b -} - -// WithValue sets the Value field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Value field is set to the value of the last call. -func (b *AuthorizationPolicyMatchApplyConfiguration) WithValue(value string) *AuthorizationPolicyMatchApplyConfiguration { - b.Value = &value - return b -} diff --git a/pkg/authority/generated/applyconfiguration/dubbo.apache.org/v1beta1/authorizationpolicyrule.go b/pkg/authority/generated/applyconfiguration/dubbo.apache.org/v1beta1/authorizationpolicyrule.go deleted file mode 100644 index e53d7c3a6..000000000 --- a/pkg/authority/generated/applyconfiguration/dubbo.apache.org/v1beta1/authorizationpolicyrule.go +++ /dev/null @@ -1,56 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one or more -// contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. -// The ASF licenses this file to You under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with -// the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1beta1 - -// AuthorizationPolicyRuleApplyConfiguration represents an declarative configuration of the AuthorizationPolicyRule type for use -// with apply. -type AuthorizationPolicyRuleApplyConfiguration struct { - From *AuthorizationPolicySourceApplyConfiguration `json:"from,omitempty"` - To *AuthorizationPolicyTargetApplyConfiguration `json:"to,omitempty"` - When *AuthorizationPolicyConditionApplyConfiguration `json:"when,omitempty"` -} - -// AuthorizationPolicyRuleApplyConfiguration constructs an declarative configuration of the AuthorizationPolicyRule type for use with -// apply. -func AuthorizationPolicyRule() *AuthorizationPolicyRuleApplyConfiguration { - return &AuthorizationPolicyRuleApplyConfiguration{} -} - -// WithFrom sets the From field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the From field is set to the value of the last call. -func (b *AuthorizationPolicyRuleApplyConfiguration) WithFrom(value *AuthorizationPolicySourceApplyConfiguration) *AuthorizationPolicyRuleApplyConfiguration { - b.From = value - return b -} - -// WithTo sets the To field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the To field is set to the value of the last call. -func (b *AuthorizationPolicyRuleApplyConfiguration) WithTo(value *AuthorizationPolicyTargetApplyConfiguration) *AuthorizationPolicyRuleApplyConfiguration { - b.To = value - return b -} - -// WithWhen sets the When field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the When field is set to the value of the last call. -func (b *AuthorizationPolicyRuleApplyConfiguration) WithWhen(value *AuthorizationPolicyConditionApplyConfiguration) *AuthorizationPolicyRuleApplyConfiguration { - b.When = value - return b -} diff --git a/pkg/authority/generated/applyconfiguration/dubbo.apache.org/v1beta1/authorizationpolicysource.go b/pkg/authority/generated/applyconfiguration/dubbo.apache.org/v1beta1/authorizationpolicysource.go deleted file mode 100644 index be9816aca..000000000 --- a/pkg/authority/generated/applyconfiguration/dubbo.apache.org/v1beta1/authorizationpolicysource.go +++ /dev/null @@ -1,123 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one or more -// contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. -// The ASF licenses this file to You under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with -// the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1beta1 - -// AuthorizationPolicySourceApplyConfiguration represents an declarative configuration of the AuthorizationPolicySource type for use -// with apply. -type AuthorizationPolicySourceApplyConfiguration struct { - Namespaces []string `json:"namespaces,omitempty"` - NotNamespaces []string `json:"notNamespaces,omitempty"` - IpBlocks []string `json:"ipBlocks,omitempty"` - NotIpBlocks []string `json:"notIpBlocks,omitempty"` - Principals []string `json:"principals,omitempty"` - NotPrincipals []string `json:"notPrincipals,omitempty"` - Extends []AuthorizationPolicyExtendApplyConfiguration `json:"extends,omitempty"` - NotExtends []AuthorizationPolicyExtendApplyConfiguration `json:"notExtends,omitempty"` -} - -// AuthorizationPolicySourceApplyConfiguration constructs an declarative configuration of the AuthorizationPolicySource type for use with -// apply. -func AuthorizationPolicySource() *AuthorizationPolicySourceApplyConfiguration { - return &AuthorizationPolicySourceApplyConfiguration{} -} - -// WithNamespaces adds the given value to the Namespaces field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Namespaces field. -func (b *AuthorizationPolicySourceApplyConfiguration) WithNamespaces(values ...string) *AuthorizationPolicySourceApplyConfiguration { - for i := range values { - b.Namespaces = append(b.Namespaces, values[i]) - } - return b -} - -// WithNotNamespaces adds the given value to the NotNamespaces field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the NotNamespaces field. -func (b *AuthorizationPolicySourceApplyConfiguration) WithNotNamespaces(values ...string) *AuthorizationPolicySourceApplyConfiguration { - for i := range values { - b.NotNamespaces = append(b.NotNamespaces, values[i]) - } - return b -} - -// WithIpBlocks adds the given value to the IpBlocks field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the IpBlocks field. -func (b *AuthorizationPolicySourceApplyConfiguration) WithIpBlocks(values ...string) *AuthorizationPolicySourceApplyConfiguration { - for i := range values { - b.IpBlocks = append(b.IpBlocks, values[i]) - } - return b -} - -// WithNotIpBlocks adds the given value to the NotIpBlocks field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the NotIpBlocks field. -func (b *AuthorizationPolicySourceApplyConfiguration) WithNotIpBlocks(values ...string) *AuthorizationPolicySourceApplyConfiguration { - for i := range values { - b.NotIpBlocks = append(b.NotIpBlocks, values[i]) - } - return b -} - -// WithPrincipals adds the given value to the Principals field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Principals field. -func (b *AuthorizationPolicySourceApplyConfiguration) WithPrincipals(values ...string) *AuthorizationPolicySourceApplyConfiguration { - for i := range values { - b.Principals = append(b.Principals, values[i]) - } - return b -} - -// WithNotPrincipals adds the given value to the NotPrincipals field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the NotPrincipals field. -func (b *AuthorizationPolicySourceApplyConfiguration) WithNotPrincipals(values ...string) *AuthorizationPolicySourceApplyConfiguration { - for i := range values { - b.NotPrincipals = append(b.NotPrincipals, values[i]) - } - return b -} - -// WithExtends adds the given value to the Extends field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Extends field. -func (b *AuthorizationPolicySourceApplyConfiguration) WithExtends(values ...*AuthorizationPolicyExtendApplyConfiguration) *AuthorizationPolicySourceApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithExtends") - } - b.Extends = append(b.Extends, *values[i]) - } - return b -} - -// WithNotExtends adds the given value to the NotExtends field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the NotExtends field. -func (b *AuthorizationPolicySourceApplyConfiguration) WithNotExtends(values ...*AuthorizationPolicyExtendApplyConfiguration) *AuthorizationPolicySourceApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithNotExtends") - } - b.NotExtends = append(b.NotExtends, *values[i]) - } - return b -} diff --git a/pkg/authority/generated/applyconfiguration/dubbo.apache.org/v1beta1/authorizationpolicyspec.go b/pkg/authority/generated/applyconfiguration/dubbo.apache.org/v1beta1/authorizationpolicyspec.go deleted file mode 100644 index ccb22ab10..000000000 --- a/pkg/authority/generated/applyconfiguration/dubbo.apache.org/v1beta1/authorizationpolicyspec.go +++ /dev/null @@ -1,79 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one or more -// contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. -// The ASF licenses this file to You under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with -// the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1beta1 - -// AuthorizationPolicySpecApplyConfiguration represents an declarative configuration of the AuthorizationPolicySpec type for use -// with apply. -type AuthorizationPolicySpecApplyConfiguration struct { - Action *string `json:"action,omitempty"` - Rules []AuthorizationPolicyRuleApplyConfiguration `json:"rules,omitempty"` - Samples *float32 `json:"samples,omitempty"` - Order *float32 `json:"order,omitempty"` - MatchType *string `json:"matchType,omitempty"` -} - -// AuthorizationPolicySpecApplyConfiguration constructs an declarative configuration of the AuthorizationPolicySpec type for use with -// apply. -func AuthorizationPolicySpec() *AuthorizationPolicySpecApplyConfiguration { - return &AuthorizationPolicySpecApplyConfiguration{} -} - -// WithAction sets the Action field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Action field is set to the value of the last call. -func (b *AuthorizationPolicySpecApplyConfiguration) WithAction(value string) *AuthorizationPolicySpecApplyConfiguration { - b.Action = &value - return b -} - -// WithRules adds the given value to the Rules field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Rules field. -func (b *AuthorizationPolicySpecApplyConfiguration) WithRules(values ...*AuthorizationPolicyRuleApplyConfiguration) *AuthorizationPolicySpecApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithRules") - } - b.Rules = append(b.Rules, *values[i]) - } - return b -} - -// WithSamples sets the Samples field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Samples field is set to the value of the last call. -func (b *AuthorizationPolicySpecApplyConfiguration) WithSamples(value float32) *AuthorizationPolicySpecApplyConfiguration { - b.Samples = &value - return b -} - -// WithOrder sets the Order field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Order field is set to the value of the last call. -func (b *AuthorizationPolicySpecApplyConfiguration) WithOrder(value float32) *AuthorizationPolicySpecApplyConfiguration { - b.Order = &value - return b -} - -// WithMatchType sets the MatchType field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the MatchType field is set to the value of the last call. -func (b *AuthorizationPolicySpecApplyConfiguration) WithMatchType(value string) *AuthorizationPolicySpecApplyConfiguration { - b.MatchType = &value - return b -} diff --git a/pkg/authority/generated/applyconfiguration/dubbo.apache.org/v1beta1/authorizationpolicytarget.go b/pkg/authority/generated/applyconfiguration/dubbo.apache.org/v1beta1/authorizationpolicytarget.go deleted file mode 100644 index 490b77ab6..000000000 --- a/pkg/authority/generated/applyconfiguration/dubbo.apache.org/v1beta1/authorizationpolicytarget.go +++ /dev/null @@ -1,123 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one or more -// contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. -// The ASF licenses this file to You under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with -// the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1beta1 - -// AuthorizationPolicyTargetApplyConfiguration represents an declarative configuration of the AuthorizationPolicyTarget type for use -// with apply. -type AuthorizationPolicyTargetApplyConfiguration struct { - Namespaces []string `json:"namespaces,omitempty"` - NotNamespaces []string `json:"notNamespaces,omitempty"` - IpBlocks []string `json:"ipBlocks,omitempty"` - NotIpBlocks []string `json:"notIpBlocks,omitempty"` - Principals []string `json:"principals,omitempty"` - NotPrincipals []string `json:"notPrincipals,omitempty"` - Extends []AuthorizationPolicyExtendApplyConfiguration `json:"extends,omitempty"` - NotExtends []AuthorizationPolicyExtendApplyConfiguration `json:"notExtends,omitempty"` -} - -// AuthorizationPolicyTargetApplyConfiguration constructs an declarative configuration of the AuthorizationPolicyTarget type for use with -// apply. -func AuthorizationPolicyTarget() *AuthorizationPolicyTargetApplyConfiguration { - return &AuthorizationPolicyTargetApplyConfiguration{} -} - -// WithNamespaces adds the given value to the Namespaces field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Namespaces field. -func (b *AuthorizationPolicyTargetApplyConfiguration) WithNamespaces(values ...string) *AuthorizationPolicyTargetApplyConfiguration { - for i := range values { - b.Namespaces = append(b.Namespaces, values[i]) - } - return b -} - -// WithNotNamespaces adds the given value to the NotNamespaces field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the NotNamespaces field. -func (b *AuthorizationPolicyTargetApplyConfiguration) WithNotNamespaces(values ...string) *AuthorizationPolicyTargetApplyConfiguration { - for i := range values { - b.NotNamespaces = append(b.NotNamespaces, values[i]) - } - return b -} - -// WithIpBlocks adds the given value to the IpBlocks field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the IpBlocks field. -func (b *AuthorizationPolicyTargetApplyConfiguration) WithIpBlocks(values ...string) *AuthorizationPolicyTargetApplyConfiguration { - for i := range values { - b.IpBlocks = append(b.IpBlocks, values[i]) - } - return b -} - -// WithNotIpBlocks adds the given value to the NotIpBlocks field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the NotIpBlocks field. -func (b *AuthorizationPolicyTargetApplyConfiguration) WithNotIpBlocks(values ...string) *AuthorizationPolicyTargetApplyConfiguration { - for i := range values { - b.NotIpBlocks = append(b.NotIpBlocks, values[i]) - } - return b -} - -// WithPrincipals adds the given value to the Principals field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Principals field. -func (b *AuthorizationPolicyTargetApplyConfiguration) WithPrincipals(values ...string) *AuthorizationPolicyTargetApplyConfiguration { - for i := range values { - b.Principals = append(b.Principals, values[i]) - } - return b -} - -// WithNotPrincipals adds the given value to the NotPrincipals field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the NotPrincipals field. -func (b *AuthorizationPolicyTargetApplyConfiguration) WithNotPrincipals(values ...string) *AuthorizationPolicyTargetApplyConfiguration { - for i := range values { - b.NotPrincipals = append(b.NotPrincipals, values[i]) - } - return b -} - -// WithExtends adds the given value to the Extends field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Extends field. -func (b *AuthorizationPolicyTargetApplyConfiguration) WithExtends(values ...*AuthorizationPolicyExtendApplyConfiguration) *AuthorizationPolicyTargetApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithExtends") - } - b.Extends = append(b.Extends, *values[i]) - } - return b -} - -// WithNotExtends adds the given value to the NotExtends field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the NotExtends field. -func (b *AuthorizationPolicyTargetApplyConfiguration) WithNotExtends(values ...*AuthorizationPolicyExtendApplyConfiguration) *AuthorizationPolicyTargetApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithNotExtends") - } - b.NotExtends = append(b.NotExtends, *values[i]) - } - return b -} diff --git a/pkg/authority/generated/applyconfiguration/internal/internal.go b/pkg/authority/generated/applyconfiguration/internal/internal.go deleted file mode 100644 index 041ac5feb..000000000 --- a/pkg/authority/generated/applyconfiguration/internal/internal.go +++ /dev/null @@ -1,61 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one or more -// contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. -// The ASF licenses this file to You under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with -// the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package internal - -import ( - "fmt" - "sync" - - typed "sigs.k8s.io/structured-merge-diff/v4/typed" -) - -func Parser() *typed.Parser { - parserOnce.Do(func() { - var err error - parser, err = typed.NewParser(schemaYAML) - if err != nil { - panic(fmt.Sprintf("Failed to parse schema: %v", err)) - } - }) - return parser -} - -var parserOnce sync.Once -var parser *typed.Parser -var schemaYAML = typed.YAMLObject(`types: -- name: __untyped_atomic_ - scalar: untyped - list: - elementType: - namedType: __untyped_atomic_ - elementRelationship: atomic - map: - elementType: - namedType: __untyped_atomic_ - elementRelationship: atomic -- name: __untyped_deduced_ - scalar: untyped - list: - elementType: - namedType: __untyped_atomic_ - elementRelationship: atomic - map: - elementType: - namedType: __untyped_deduced_ - elementRelationship: separable -`) diff --git a/pkg/authority/generated/applyconfiguration/utils.go b/pkg/authority/generated/applyconfiguration/utils.go deleted file mode 100644 index ea7ec47d7..000000000 --- a/pkg/authority/generated/applyconfiguration/utils.go +++ /dev/null @@ -1,60 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one or more -// contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. -// The ASF licenses this file to You under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with -// the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package applyconfiguration - -import ( - v1beta1 "github.com/apache/dubbo-admin/pkg/authority/apis/dubbo.apache.org/v1beta1" - dubboapacheorgv1beta1 "github.com/apache/dubbo-admin/pkg/authority/generated/applyconfiguration/dubbo.apache.org/v1beta1" - schema "k8s.io/apimachinery/pkg/runtime/schema" -) - -// ForKind returns an apply configuration type for the given GroupVersionKind, or nil if no -// apply configuration type exists for the given GroupVersionKind. -func ForKind(kind schema.GroupVersionKind) interface{} { - switch kind { - // Group=dubbo.apache.org, Version=v1beta1 - case v1beta1.SchemeGroupVersion.WithKind("AuthenticationPolicy"): - return &dubboapacheorgv1beta1.AuthenticationPolicyApplyConfiguration{} - case v1beta1.SchemeGroupVersion.WithKind("AuthenticationPolicyExtend"): - return &dubboapacheorgv1beta1.AuthenticationPolicyExtendApplyConfiguration{} - case v1beta1.SchemeGroupVersion.WithKind("AuthenticationPolicyPortLevel"): - return &dubboapacheorgv1beta1.AuthenticationPolicyPortLevelApplyConfiguration{} - case v1beta1.SchemeGroupVersion.WithKind("AuthenticationPolicySelector"): - return &dubboapacheorgv1beta1.AuthenticationPolicySelectorApplyConfiguration{} - case v1beta1.SchemeGroupVersion.WithKind("AuthenticationPolicySpec"): - return &dubboapacheorgv1beta1.AuthenticationPolicySpecApplyConfiguration{} - case v1beta1.SchemeGroupVersion.WithKind("AuthorizationPolicy"): - return &dubboapacheorgv1beta1.AuthorizationPolicyApplyConfiguration{} - case v1beta1.SchemeGroupVersion.WithKind("AuthorizationPolicyCondition"): - return &dubboapacheorgv1beta1.AuthorizationPolicyConditionApplyConfiguration{} - case v1beta1.SchemeGroupVersion.WithKind("AuthorizationPolicyExtend"): - return &dubboapacheorgv1beta1.AuthorizationPolicyExtendApplyConfiguration{} - case v1beta1.SchemeGroupVersion.WithKind("AuthorizationPolicyMatch"): - return &dubboapacheorgv1beta1.AuthorizationPolicyMatchApplyConfiguration{} - case v1beta1.SchemeGroupVersion.WithKind("AuthorizationPolicyRule"): - return &dubboapacheorgv1beta1.AuthorizationPolicyRuleApplyConfiguration{} - case v1beta1.SchemeGroupVersion.WithKind("AuthorizationPolicySource"): - return &dubboapacheorgv1beta1.AuthorizationPolicySourceApplyConfiguration{} - case v1beta1.SchemeGroupVersion.WithKind("AuthorizationPolicySpec"): - return &dubboapacheorgv1beta1.AuthorizationPolicySpecApplyConfiguration{} - case v1beta1.SchemeGroupVersion.WithKind("AuthorizationPolicyTarget"): - return &dubboapacheorgv1beta1.AuthorizationPolicyTargetApplyConfiguration{} - - } - return nil -} diff --git a/pkg/authority/generated/listers/dubbo.apache.org/v1beta1/expansion_generated.go b/pkg/authority/generated/listers/dubbo.apache.org/v1beta1/expansion_generated.go deleted file mode 100644 index afd41a848..000000000 --- a/pkg/authority/generated/listers/dubbo.apache.org/v1beta1/expansion_generated.go +++ /dev/null @@ -1,34 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one or more -// contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. -// The ASF licenses this file to You under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with -// the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by lister-gen. DO NOT EDIT. - -package v1beta1 - -// AuthenticationPolicyListerExpansion allows custom methods to be added to -// AuthenticationPolicyLister. -type AuthenticationPolicyListerExpansion interface{} - -// AuthenticationPolicyNamespaceListerExpansion allows custom methods to be added to -// AuthenticationPolicyNamespaceLister. -type AuthenticationPolicyNamespaceListerExpansion interface{} - -// AuthorizationPolicyListerExpansion allows custom methods to be added to -// AuthorizationPolicyLister. -type AuthorizationPolicyListerExpansion interface{} - -// AuthorizationPolicyNamespaceListerExpansion allows custom methods to be added to -// AuthorizationPolicyNamespaceLister. -type AuthorizationPolicyNamespaceListerExpansion interface{} diff --git a/pkg/authority/k8s/controller.go b/pkg/authority/k8s/controller.go deleted file mode 100644 index ac0302a06..000000000 --- a/pkg/authority/k8s/controller.go +++ /dev/null @@ -1,325 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one or more -// contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. -// The ASF licenses this file to You under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with -// the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package k8s - -import ( - apiV1beta1 "github.com/apache/dubbo-admin/pkg/authority/apis/dubbo.apache.org/v1beta1" - clientSet "github.com/apache/dubbo-admin/pkg/authority/generated/clientset/versioned" - informerV1beta1 "github.com/apache/dubbo-admin/pkg/authority/generated/informers/externalversions/dubbo.apache.org/v1beta1" - "github.com/apache/dubbo-admin/pkg/authority/rule/authentication" - "github.com/apache/dubbo-admin/pkg/authority/rule/authorization" - "github.com/apache/dubbo-admin/pkg/logger" - "k8s.io/client-go/tools/cache" - "k8s.io/utils/strings/slices" -) - -type NotificationType int - -const ( - // AddNotification is a notification type for add events. - AddNotification NotificationType = iota - // UpdateNotification is a notification type for update events. - UpdateNotification - // DeleteNotification is a notification type for delete events. - DeleteNotification -) - -// Controller is the controller implementation for Foo resources -type Controller struct { - dubboClientSet clientSet.Interface - - rootNamespace string - - authenticationSynced cache.InformerSynced - authorizationSynced cache.InformerSynced - - authenticationHandler authentication.Handler - authorizationHandler authorization.Handler -} - -// NewController returns a new sample controller -func NewController( - clientSet clientSet.Interface, - rootNamespace string, - authenticationHandler authentication.Handler, - authorizationHandler authorization.Handler, - acInformer informerV1beta1.AuthenticationPolicyInformer, - apInformer informerV1beta1.AuthorizationPolicyInformer, -) *Controller { - controller := &Controller{ - dubboClientSet: clientSet, - rootNamespace: rootNamespace, - - authenticationSynced: acInformer.Informer().HasSynced, - authorizationSynced: apInformer.Informer().HasSynced, - - authenticationHandler: authenticationHandler, - authorizationHandler: authorizationHandler, - } - - logger.Sugar().Info("Setting up event handlers") - // Set up an event handler for when Foo resources change - _, err := acInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{ - AddFunc: func(obj interface{}) { - controller.handleEvent(obj, AddNotification) - }, - UpdateFunc: func(oldObj, newObj interface{}) { - controller.handleEvent(newObj, UpdateNotification) - }, - DeleteFunc: func(obj interface{}) { - controller.handleEvent(obj, DeleteNotification) - }, - }) - if err != nil { - return nil - } - _, err = apInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{ - AddFunc: func(obj interface{}) { - controller.handleEvent(obj, AddNotification) - }, - UpdateFunc: func(oldObj, newObj interface{}) { - controller.handleEvent(newObj, UpdateNotification) - }, - DeleteFunc: func(obj interface{}) { - controller.handleEvent(obj, DeleteNotification) - }, - }) - if err != nil { - return nil - } - - return controller -} - -func (c *Controller) WaitSynced() { - logger.Sugar().Info("Waiting for informer caches to sync") - - if !cache.WaitForCacheSync(make(chan struct{}), c.authenticationSynced, c.authorizationSynced) { - logger.Sugar().Error("Timed out waiting for caches to sync") - return - } else { - logger.Sugar().Info("Caches synced") - } -} - -func (c *Controller) handleEvent(obj interface{}, eventType NotificationType) { - key, err := cache.MetaNamespaceKeyFunc(obj) - if err != nil { - logger.Sugar().Errorf("error getting key for object: %v", err) - return - } - - switch o := obj.(type) { - case *apiV1beta1.AuthenticationPolicy: - a := CopyToAuthentication(key, c.rootNamespace, o) - - switch eventType { - case AddNotification: - c.authenticationHandler.Add(key, a) - case UpdateNotification: - c.authenticationHandler.Update(key, a) - case DeleteNotification: - c.authenticationHandler.Delete(key) - } - return - case *apiV1beta1.AuthorizationPolicy: - a := CopyToAuthorization(key, c.rootNamespace, o) - - switch eventType { - case AddNotification: - c.authorizationHandler.Add(key, a) - case UpdateNotification: - c.authorizationHandler.Update(key, a) - case DeleteNotification: - c.authorizationHandler.Delete(key) - } - default: - logger.Sugar().Errorf("unexpected object type: %v", obj) - return - } -} - -func CopyToAuthentication(key, rootNamespace string, pa *apiV1beta1.AuthenticationPolicy) *authentication.Policy { - a := &authentication.Policy{} - a.Name = key - a.Spec = &authentication.PolicySpec{} - a.Spec.Action = pa.Spec.Action - if pa.Spec.Selector != nil { - for _, selector := range pa.Spec.Selector { - r := &authentication.Selector{ - Namespaces: selector.Namespaces, - NotNamespaces: selector.NotNamespaces, - IpBlocks: selector.IpBlocks, - NotIpBlocks: selector.NotIpBlocks, - Principals: selector.Principals, - NotPrincipals: selector.NotPrincipals, - } - if selector.Extends != nil { - for _, extends := range selector.Extends { - r.Extends = append(r.Extends, &authentication.Extend{ - Key: extends.Key, - Value: extends.Value, - }) - } - } - if selector.NotExtends != nil { - for _, notExtend := range selector.NotExtends { - r.NotExtends = append(r.NotExtends, &authentication.Extend{ - Key: notExtend.Key, - Value: notExtend.Value, - }) - } - } - a.Spec.Selector = append(a.Spec.Selector, r) - } - } - - if pa.Spec.PortLevel != nil { - for _, portLevel := range pa.Spec.PortLevel { - r := &authentication.PortLevel{ - Port: portLevel.Port, - Action: portLevel.Action, - } - - a.Spec.PortLevel = append(a.Spec.PortLevel, r) - } - } - - if rootNamespace == pa.Namespace { - return a - } - - if len(a.Spec.Selector) == 0 { - a.Spec.Selector = append(a.Spec.Selector, &authentication.Selector{ - Namespaces: []string{pa.Namespace}, - }) - } else { - for _, selector := range a.Spec.Selector { - if !slices.Contains(selector.Namespaces, pa.Namespace) { - selector.Namespaces = append(selector.Namespaces, pa.Namespace) - } - } - } - - return a -} - -func CopyToAuthorization(key, rootNamespace string, pa *apiV1beta1.AuthorizationPolicy) *authorization.Policy { - a := &authorization.Policy{} - a.Name = key - a.Spec = &authorization.PolicySpec{} - a.Spec.Action = pa.Spec.Action - if pa.Spec.Rules != nil { - for _, rule := range pa.Spec.Rules { - r := &authorization.PolicyRule{ - From: &authorization.Source{ - Namespaces: rule.From.Namespaces, - NotNamespaces: rule.From.NotNamespaces, - IpBlocks: rule.From.IpBlocks, - NotIpBlocks: rule.From.NotIpBlocks, - Principals: rule.From.Principals, - NotPrincipals: rule.From.NotPrincipals, - }, - To: &authorization.Target{ - Namespaces: rule.To.Namespaces, - NotNamespaces: rule.To.NotNamespaces, - IpBlocks: rule.To.IpBlocks, - NotIpBlocks: rule.To.NotIpBlocks, - Principals: rule.To.Principals, - NotPrincipals: rule.To.NotPrincipals, - }, - When: &authorization.Condition{ - Key: rule.When.Key, - }, - } - if rule.From.Extends != nil { - for _, extends := range rule.From.Extends { - r.From.Extends = append(r.From.Extends, &authorization.Extend{ - Key: extends.Key, - Value: extends.Value, - }) - } - } - if rule.From.NotExtends != nil { - for _, notExtend := range rule.From.NotExtends { - r.From.NotExtends = append(r.From.NotExtends, &authorization.Extend{ - Key: notExtend.Key, - Value: notExtend.Value, - }) - } - } - if rule.To.Extends != nil { - for _, extends := range rule.To.Extends { - r.To.Extends = append(r.To.Extends, &authorization.Extend{ - Key: extends.Key, - Value: extends.Value, - }) - } - } - if rule.To.NotExtends != nil { - for _, notExtend := range rule.To.NotExtends { - r.To.NotExtends = append(r.To.NotExtends, &authorization.Extend{ - Key: notExtend.Key, - Value: notExtend.Value, - }) - } - } - if rule.When.Values != nil { - for _, value := range rule.When.Values { - r.When.Values = append(r.When.Values, &authorization.Match{ - Type: value.Type, - Value: value.Value, - }) - } - } - if rule.When.NotValues != nil { - for _, notValue := range rule.When.NotValues { - r.When.Values = append(r.When.Values, &authorization.Match{ - Type: notValue.Type, - Value: notValue.Value, - }) - } - } - - a.Spec.Rules = append(a.Spec.Rules, r) - } - } - a.Spec.Samples = pa.Spec.Samples - a.Spec.Order = pa.Spec.Order - a.Spec.MatchType = pa.Spec.MatchType - - if rootNamespace == pa.Namespace { - return a - } - - if len(a.Spec.Rules) == 0 { - a.Spec.Rules = append(a.Spec.Rules, &authorization.PolicyRule{ - To: &authorization.Target{ - Namespaces: []string{pa.Namespace}, - }, - }) - } else { - for _, rule := range a.Spec.Rules { - if rule.To != nil { - rule.To = &authorization.Target{} - } - if !slices.Contains(rule.To.Namespaces, pa.Namespace) { - rule.To.Namespaces = append(rule.To.Namespaces, pa.Namespace) - } - } - } - return a -} diff --git a/pkg/authority/patch/javasdk.go b/pkg/authority/patch/javasdk.go index 5f3a00aa1..5af36945a 100644 --- a/pkg/authority/patch/javasdk.go +++ b/pkg/authority/patch/javasdk.go @@ -16,19 +16,19 @@ package patch import ( + dubbo_cp "github.com/apache/dubbo-admin/pkg/config/app/dubbo-cp" + "github.com/apache/dubbo-admin/pkg/core/cert/provider" "strconv" - "github.com/apache/dubbo-admin/pkg/authority/config" - "github.com/apache/dubbo-admin/pkg/authority/k8s" v1 "k8s.io/api/core/v1" ) type JavaSdk struct { - options *config.Options - kubeClient k8s.Client + options *dubbo_cp.Config + kubeClient provider.Client } -func NewJavaSdk(options *config.Options, kubeClient k8s.Client) *JavaSdk { +func NewJavaSdk(options *dubbo_cp.Config, kubeClient provider.Client) *JavaSdk { return &JavaSdk{ options: options, kubeClient: kubeClient, @@ -80,7 +80,7 @@ func (s *JavaSdk) NewPod(origin *v1.Pod) (*v1.Pod, error) { func (s *JavaSdk) injectContainers(c *v1.Container) { c.Env = append(c.Env, v1.EnvVar{ Name: "DUBBO_CA_ADDRESS", - Value: s.options.ServiceName + "." + s.options.Namespace + ".svc:" + strconv.Itoa(s.options.SecureServerPort), + Value: s.options.KubeConfig.ServiceName + "." + s.options.KubeConfig.Namespace + ".svc:" + strconv.Itoa(s.options.GrpcServer.SecureServerPort), }) c.Env = append(c.Env, v1.EnvVar{ Name: "DUBBO_CA_CERT_PATH", diff --git a/pkg/authority/patch/javasdk_test.go b/pkg/authority/patch/javasdk_test.go index 4fd7662f3..6d87ec733 100644 --- a/pkg/authority/patch/javasdk_test.go +++ b/pkg/authority/patch/javasdk_test.go @@ -16,16 +16,19 @@ package patch import ( + dubbo_cp "github.com/apache/dubbo-admin/pkg/config/app/dubbo-cp" + "github.com/apache/dubbo-admin/pkg/config/kube" + "github.com/apache/dubbo-admin/pkg/config/security" + "github.com/apache/dubbo-admin/pkg/config/server" + kube2 "github.com/apache/dubbo-admin/pkg/core/cert/provider" "reflect" "testing" - "github.com/apache/dubbo-admin/pkg/authority/config" - "github.com/apache/dubbo-admin/pkg/authority/k8s" v1 "k8s.io/api/core/v1" ) type fakeKubeClient struct { - k8s.Client + kube2.Client } func (f *fakeKubeClient) GetNamespaceLabels(namespace string) map[string]string { @@ -41,17 +44,23 @@ func (f *fakeKubeClient) GetNamespaceLabels(namespace string) map[string]string func TestEmpty(t *testing.T) { t.Parallel() - options := &config.Options{ - IsKubernetesConnected: false, - Namespace: "dubbo-system", - ServiceName: "dubbo-ca", - PlainServerPort: 30060, - SecureServerPort: 30062, - DebugPort: 30070, - WebhookPort: 30080, - WebhookAllowOnErr: false, - CaValidity: 30 * 24 * 60 * 60 * 1000, // 30 day - CertValidity: 1 * 60 * 60 * 1000, // 1 hour + options := &dubbo_cp.Config{ + KubeConfig: kube.KubeConfig{ + IsKubernetesConnected: false, + Namespace: "dubbo-system", + ServiceName: "dubbo-ca", + }, + Security: security.SecurityConfig{ + CaValidity: 30 * 24 * 60 * 60 * 1000, // 30 day + CertValidity: 1 * 60 * 60 * 1000, // 1 hour + WebhookPort: 30080, + WebhookAllowOnErr: false, + }, + GrpcServer: server.ServerConfig{ + PlainServerPort: 30060, + SecureServerPort: 30062, + DebugPort: 30070, + }, } sdk := NewJavaSdk(options, &fakeKubeClient{}) @@ -67,17 +76,23 @@ func TestEmpty(t *testing.T) { func TestInjectFromLabel(t *testing.T) { t.Parallel() - options := &config.Options{ - IsKubernetesConnected: false, - Namespace: "dubbo-system", - ServiceName: "dubbo-ca", - PlainServerPort: 30060, - SecureServerPort: 30062, - DebugPort: 30070, - WebhookPort: 30080, - WebhookAllowOnErr: false, - CaValidity: 30 * 24 * 60 * 60 * 1000, // 30 day - CertValidity: 1 * 60 * 60 * 1000, // 1 hour + options := &dubbo_cp.Config{ + KubeConfig: kube.KubeConfig{ + IsKubernetesConnected: false, + Namespace: "dubbo-system", + ServiceName: "dubbo-ca", + }, + Security: security.SecurityConfig{ + CaValidity: 30 * 24 * 60 * 60 * 1000, // 30 day + CertValidity: 1 * 60 * 60 * 1000, // 1 hour + WebhookPort: 30080, + WebhookAllowOnErr: false, + }, + GrpcServer: server.ServerConfig{ + PlainServerPort: 30060, + SecureServerPort: 30062, + DebugPort: 30070, + }, } sdk := NewJavaSdk(options, &fakeKubeClient{}) @@ -96,19 +111,24 @@ func TestInjectFromLabel(t *testing.T) { func TestInjectFromNs(t *testing.T) { t.Parallel() - options := &config.Options{ - IsKubernetesConnected: false, - Namespace: "dubbo-system", - ServiceName: "dubbo-ca", - PlainServerPort: 30060, - SecureServerPort: 30062, - DebugPort: 30070, - WebhookPort: 30080, - WebhookAllowOnErr: false, - CaValidity: 30 * 24 * 60 * 60 * 1000, // 30 day - CertValidity: 1 * 60 * 60 * 1000, // 1 hour + options := &dubbo_cp.Config{ + KubeConfig: kube.KubeConfig{ + IsKubernetesConnected: false, + Namespace: "dubbo-system", + ServiceName: "dubbo-ca", + }, + Security: security.SecurityConfig{ + CaValidity: 30 * 24 * 60 * 60 * 1000, // 30 day + CertValidity: 1 * 60 * 60 * 1000, // 1 hour + WebhookPort: 30080, + WebhookAllowOnErr: false, + }, + GrpcServer: server.ServerConfig{ + PlainServerPort: 30060, + SecureServerPort: 30062, + DebugPort: 30070, + }, } - sdk := NewJavaSdk(options, &fakeKubeClient{}) pod := &v1.Pod{} @@ -124,19 +144,24 @@ func TestInjectFromNs(t *testing.T) { func TestInjectVolumes(t *testing.T) { t.Parallel() - options := &config.Options{ - IsKubernetesConnected: false, - Namespace: "dubbo-system", - ServiceName: "dubbo-ca", - PlainServerPort: 30060, - SecureServerPort: 30062, - DebugPort: 30070, - WebhookPort: 30080, - WebhookAllowOnErr: false, - CaValidity: 30 * 24 * 60 * 60 * 1000, // 30 day - CertValidity: 1 * 60 * 60 * 1000, // 1 hour + options := &dubbo_cp.Config{ + KubeConfig: kube.KubeConfig{ + IsKubernetesConnected: false, + Namespace: "dubbo-system", + ServiceName: "dubbo-ca", + }, + Security: security.SecurityConfig{ + CaValidity: 30 * 24 * 60 * 60 * 1000, // 30 day + CertValidity: 1 * 60 * 60 * 1000, // 1 hour + WebhookPort: 30080, + WebhookAllowOnErr: false, + }, + GrpcServer: server.ServerConfig{ + PlainServerPort: 30060, + SecureServerPort: 30062, + DebugPort: 30070, + }, } - sdk := NewJavaSdk(options, &fakeKubeClient{}) pod := &v1.Pod{} @@ -200,17 +225,23 @@ func TestInjectVolumes(t *testing.T) { func TestInjectOneContainer(t *testing.T) { t.Parallel() - options := &config.Options{ - IsKubernetesConnected: false, - Namespace: "dubbo-system", - ServiceName: "dubbo-ca", - PlainServerPort: 30060, - SecureServerPort: 30062, - DebugPort: 30070, - WebhookPort: 30080, - WebhookAllowOnErr: false, - CaValidity: 30 * 24 * 60 * 60 * 1000, // 30 day - CertValidity: 1 * 60 * 60 * 1000, // 1 hour + options := &dubbo_cp.Config{ + KubeConfig: kube.KubeConfig{ + IsKubernetesConnected: false, + Namespace: "dubbo-system", + ServiceName: "dubbo-ca", + }, + Security: security.SecurityConfig{ + CaValidity: 30 * 24 * 60 * 60 * 1000, // 30 day + CertValidity: 1 * 60 * 60 * 1000, // 1 hour + WebhookPort: 30080, + WebhookAllowOnErr: false, + }, + GrpcServer: server.ServerConfig{ + PlainServerPort: 30060, + SecureServerPort: 30062, + DebugPort: 30070, + }, } sdk := NewJavaSdk(options, &fakeKubeClient{}) @@ -238,19 +269,24 @@ func TestInjectOneContainer(t *testing.T) { func TestInjectTwoContainer(t *testing.T) { t.Parallel() - options := &config.Options{ - IsKubernetesConnected: false, - Namespace: "dubbo-system", - ServiceName: "dubbo-ca", - PlainServerPort: 30060, - SecureServerPort: 30062, - DebugPort: 30070, - WebhookPort: 30080, - WebhookAllowOnErr: false, - CaValidity: 30 * 24 * 60 * 60 * 1000, // 30 day - CertValidity: 1 * 60 * 60 * 1000, // 1 hour + options := &dubbo_cp.Config{ + KubeConfig: kube.KubeConfig{ + IsKubernetesConnected: false, + Namespace: "dubbo-system", + ServiceName: "dubbo-ca", + }, + Security: security.SecurityConfig{ + CaValidity: 30 * 24 * 60 * 60 * 1000, // 30 day + CertValidity: 1 * 60 * 60 * 1000, // 1 hour + WebhookPort: 30080, + WebhookAllowOnErr: false, + }, + GrpcServer: server.ServerConfig{ + PlainServerPort: 30060, + SecureServerPort: 30062, + DebugPort: 30070, + }, } - sdk := NewJavaSdk(options, &fakeKubeClient{}) pod := &v1.Pod{} @@ -342,17 +378,23 @@ func checkContainer(t *testing.T, container v1.Container) { func TestCheckVolume1(t *testing.T) { t.Parallel() - options := &config.Options{ - IsKubernetesConnected: false, - Namespace: "dubbo-system", - ServiceName: "dubbo-ca", - PlainServerPort: 30060, - SecureServerPort: 30062, - DebugPort: 30070, - WebhookPort: 30080, - WebhookAllowOnErr: false, - CaValidity: 30 * 24 * 60 * 60 * 1000, // 30 day - CertValidity: 1 * 60 * 60 * 1000, // 1 hour + options := &dubbo_cp.Config{ + KubeConfig: kube.KubeConfig{ + IsKubernetesConnected: false, + Namespace: "dubbo-system", + ServiceName: "dubbo-ca", + }, + Security: security.SecurityConfig{ + CaValidity: 30 * 24 * 60 * 60 * 1000, // 30 day + CertValidity: 1 * 60 * 60 * 1000, // 1 hour + WebhookPort: 30080, + WebhookAllowOnErr: false, + }, + GrpcServer: server.ServerConfig{ + PlainServerPort: 30060, + SecureServerPort: 30062, + DebugPort: 30070, + }, } sdk := NewJavaSdk(options, &fakeKubeClient{}) @@ -376,17 +418,23 @@ func TestCheckVolume1(t *testing.T) { func TestCheckVolume2(t *testing.T) { t.Parallel() - options := &config.Options{ - IsKubernetesConnected: false, - Namespace: "dubbo-system", - ServiceName: "dubbo-ca", - PlainServerPort: 30060, - SecureServerPort: 30062, - DebugPort: 30070, - WebhookPort: 30080, - WebhookAllowOnErr: false, - CaValidity: 30 * 24 * 60 * 60 * 1000, // 30 day - CertValidity: 1 * 60 * 60 * 1000, // 1 hour + options := &dubbo_cp.Config{ + KubeConfig: kube.KubeConfig{ + IsKubernetesConnected: false, + Namespace: "dubbo-system", + ServiceName: "dubbo-ca", + }, + Security: security.SecurityConfig{ + CaValidity: 30 * 24 * 60 * 60 * 1000, // 30 day + CertValidity: 1 * 60 * 60 * 1000, // 1 hour + WebhookPort: 30080, + WebhookAllowOnErr: false, + }, + GrpcServer: server.ServerConfig{ + PlainServerPort: 30060, + SecureServerPort: 30062, + DebugPort: 30070, + }, } sdk := NewJavaSdk(options, &fakeKubeClient{}) @@ -410,17 +458,23 @@ func TestCheckVolume2(t *testing.T) { func TestCheckEnv1(t *testing.T) { t.Parallel() - options := &config.Options{ - IsKubernetesConnected: false, - Namespace: "dubbo-system", - ServiceName: "dubbo-ca", - PlainServerPort: 30060, - SecureServerPort: 30062, - DebugPort: 30070, - WebhookPort: 30080, - WebhookAllowOnErr: false, - CaValidity: 30 * 24 * 60 * 60 * 1000, // 30 day - CertValidity: 1 * 60 * 60 * 1000, // 1 hour + options := &dubbo_cp.Config{ + KubeConfig: kube.KubeConfig{ + IsKubernetesConnected: false, + Namespace: "dubbo-system", + ServiceName: "dubbo-ca", + }, + Security: security.SecurityConfig{ + CaValidity: 30 * 24 * 60 * 60 * 1000, // 30 day + CertValidity: 1 * 60 * 60 * 1000, // 1 hour + WebhookPort: 30080, + WebhookAllowOnErr: false, + }, + GrpcServer: server.ServerConfig{ + PlainServerPort: 30060, + SecureServerPort: 30062, + DebugPort: 30070, + }, } sdk := NewJavaSdk(options, &fakeKubeClient{}) @@ -444,17 +498,23 @@ func TestCheckEnv1(t *testing.T) { func TestCheckEnv2(t *testing.T) { t.Parallel() - options := &config.Options{ - IsKubernetesConnected: false, - Namespace: "dubbo-system", - ServiceName: "dubbo-ca", - PlainServerPort: 30060, - SecureServerPort: 30062, - DebugPort: 30070, - WebhookPort: 30080, - WebhookAllowOnErr: false, - CaValidity: 30 * 24 * 60 * 60 * 1000, // 30 day - CertValidity: 1 * 60 * 60 * 1000, // 1 hour + options := &dubbo_cp.Config{ + KubeConfig: kube.KubeConfig{ + IsKubernetesConnected: false, + Namespace: "dubbo-system", + ServiceName: "dubbo-ca", + }, + Security: security.SecurityConfig{ + CaValidity: 30 * 24 * 60 * 60 * 1000, // 30 day + CertValidity: 1 * 60 * 60 * 1000, // 1 hour + WebhookPort: 30080, + WebhookAllowOnErr: false, + }, + GrpcServer: server.ServerConfig{ + PlainServerPort: 30060, + SecureServerPort: 30062, + DebugPort: 30070, + }, } sdk := NewJavaSdk(options, &fakeKubeClient{}) @@ -478,17 +538,23 @@ func TestCheckEnv2(t *testing.T) { func TestCheckEnv3(t *testing.T) { t.Parallel() - options := &config.Options{ - IsKubernetesConnected: false, - Namespace: "dubbo-system", - ServiceName: "dubbo-ca", - PlainServerPort: 30060, - SecureServerPort: 30062, - DebugPort: 30070, - WebhookPort: 30080, - WebhookAllowOnErr: false, - CaValidity: 30 * 24 * 60 * 60 * 1000, // 30 day - CertValidity: 1 * 60 * 60 * 1000, // 1 hour + options := &dubbo_cp.Config{ + KubeConfig: kube.KubeConfig{ + IsKubernetesConnected: false, + Namespace: "dubbo-system", + ServiceName: "dubbo-ca", + }, + Security: security.SecurityConfig{ + CaValidity: 30 * 24 * 60 * 60 * 1000, // 30 day + CertValidity: 1 * 60 * 60 * 1000, // 1 hour + WebhookPort: 30080, + WebhookAllowOnErr: false, + }, + GrpcServer: server.ServerConfig{ + PlainServerPort: 30060, + SecureServerPort: 30062, + DebugPort: 30070, + }, } sdk := NewJavaSdk(options, &fakeKubeClient{}) @@ -512,17 +578,23 @@ func TestCheckEnv3(t *testing.T) { func TestCheckEnv4(t *testing.T) { t.Parallel() - options := &config.Options{ - IsKubernetesConnected: false, - Namespace: "dubbo-system", - ServiceName: "dubbo-ca", - PlainServerPort: 30060, - SecureServerPort: 30062, - DebugPort: 30070, - WebhookPort: 30080, - WebhookAllowOnErr: false, - CaValidity: 30 * 24 * 60 * 60 * 1000, // 30 day - CertValidity: 1 * 60 * 60 * 1000, // 1 hour + options := &dubbo_cp.Config{ + KubeConfig: kube.KubeConfig{ + IsKubernetesConnected: false, + Namespace: "dubbo-system", + ServiceName: "dubbo-ca", + }, + Security: security.SecurityConfig{ + CaValidity: 30 * 24 * 60 * 60 * 1000, // 30 day + CertValidity: 1 * 60 * 60 * 1000, // 1 hour + WebhookPort: 30080, + WebhookAllowOnErr: false, + }, + GrpcServer: server.ServerConfig{ + PlainServerPort: 30060, + SecureServerPort: 30062, + DebugPort: 30070, + }, } sdk := NewJavaSdk(options, &fakeKubeClient{}) @@ -547,17 +619,23 @@ func TestCheckEnv4(t *testing.T) { func TestCheckContainerVolume1(t *testing.T) { t.Parallel() - options := &config.Options{ - IsKubernetesConnected: false, - Namespace: "dubbo-system", - ServiceName: "dubbo-ca", - PlainServerPort: 30060, - SecureServerPort: 30062, - DebugPort: 30070, - WebhookPort: 30080, - WebhookAllowOnErr: false, - CaValidity: 30 * 24 * 60 * 60 * 1000, // 30 day - CertValidity: 1 * 60 * 60 * 1000, // 1 hour + options := &dubbo_cp.Config{ + KubeConfig: kube.KubeConfig{ + IsKubernetesConnected: false, + Namespace: "dubbo-system", + ServiceName: "dubbo-ca", + }, + Security: security.SecurityConfig{ + CaValidity: 30 * 24 * 60 * 60 * 1000, // 30 day + CertValidity: 1 * 60 * 60 * 1000, // 1 hour + WebhookPort: 30080, + WebhookAllowOnErr: false, + }, + GrpcServer: server.ServerConfig{ + PlainServerPort: 30060, + SecureServerPort: 30062, + DebugPort: 30070, + }, } sdk := NewJavaSdk(options, &fakeKubeClient{}) @@ -581,17 +659,23 @@ func TestCheckContainerVolume1(t *testing.T) { func TestCheckContainerVolume2(t *testing.T) { t.Parallel() - options := &config.Options{ - IsKubernetesConnected: false, - Namespace: "dubbo-system", - ServiceName: "dubbo-ca", - PlainServerPort: 30060, - SecureServerPort: 30062, - DebugPort: 30070, - WebhookPort: 30080, - WebhookAllowOnErr: false, - CaValidity: 30 * 24 * 60 * 60 * 1000, // 30 day - CertValidity: 1 * 60 * 60 * 1000, // 1 hour + options := &dubbo_cp.Config{ + KubeConfig: kube.KubeConfig{ + IsKubernetesConnected: false, + Namespace: "dubbo-system", + ServiceName: "dubbo-ca", + }, + Security: security.SecurityConfig{ + CaValidity: 30 * 24 * 60 * 60 * 1000, // 30 day + CertValidity: 1 * 60 * 60 * 1000, // 1 hour + WebhookPort: 30080, + WebhookAllowOnErr: false, + }, + GrpcServer: server.ServerConfig{ + PlainServerPort: 30060, + SecureServerPort: 30062, + DebugPort: 30070, + }, } sdk := NewJavaSdk(options, &fakeKubeClient{}) @@ -615,17 +699,23 @@ func TestCheckContainerVolume2(t *testing.T) { func TestCheckContainerVolume3(t *testing.T) { t.Parallel() - options := &config.Options{ - IsKubernetesConnected: false, - Namespace: "dubbo-system", - ServiceName: "dubbo-ca", - PlainServerPort: 30060, - SecureServerPort: 30062, - DebugPort: 30070, - WebhookPort: 30080, - WebhookAllowOnErr: false, - CaValidity: 30 * 24 * 60 * 60 * 1000, // 30 day - CertValidity: 1 * 60 * 60 * 1000, // 1 hour + options := &dubbo_cp.Config{ + KubeConfig: kube.KubeConfig{ + IsKubernetesConnected: false, + Namespace: "dubbo-system", + ServiceName: "dubbo-ca", + }, + Security: security.SecurityConfig{ + CaValidity: 30 * 24 * 60 * 60 * 1000, // 30 day + CertValidity: 1 * 60 * 60 * 1000, // 1 hour + WebhookPort: 30080, + WebhookAllowOnErr: false, + }, + GrpcServer: server.ServerConfig{ + PlainServerPort: 30060, + SecureServerPort: 30062, + DebugPort: 30070, + }, } sdk := NewJavaSdk(options, &fakeKubeClient{}) diff --git a/pkg/authority/security/server.go b/pkg/authority/security/server.go deleted file mode 100644 index 34f6d10ce..000000000 --- a/pkg/authority/security/server.go +++ /dev/null @@ -1,269 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one or more -// contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. -// The ASF licenses this file to You under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with -// the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package security - -import ( - "crypto/tls" - "crypto/x509" - "log" - "math" - "net" - "os" - "strconv" - "time" - - "github.com/apache/dubbo-admin/pkg/authority/election" - - cert2 "github.com/apache/dubbo-admin/pkg/authority/cert" - "github.com/apache/dubbo-admin/pkg/authority/config" - "github.com/apache/dubbo-admin/pkg/authority/k8s" - "github.com/apache/dubbo-admin/pkg/authority/patch" - "github.com/apache/dubbo-admin/pkg/authority/rule/authentication" - "github.com/apache/dubbo-admin/pkg/authority/rule/authorization" - "github.com/apache/dubbo-admin/pkg/authority/rule/connection" - "github.com/apache/dubbo-admin/pkg/authority/v1alpha1" - "github.com/apache/dubbo-admin/pkg/authority/webhook" - "github.com/apache/dubbo-admin/pkg/logger" - "google.golang.org/grpc" - "google.golang.org/grpc/credentials" - "google.golang.org/grpc/reflection" -) - -type Server struct { - StopChan chan os.Signal - - Options *config.Options - CertStorage cert2.Storage - - ConnectionStorage *connection.Storage - AuthenticationHandler authentication.Handler - AuthorizationHandler authorization.Handler - - KubeClient k8s.Client - - CertificateServer *v1alpha1.AuthorityServiceImpl - ObserveServer *v1alpha1.RuleServiceImpl - PlainServer *grpc.Server - SecureServer *grpc.Server - - WebhookServer *webhook.Webhook - JavaInjector *patch.JavaSdk - Elec election.LeaderElection -} - -func NewServer(options *config.Options) *Server { - return &Server{ - Options: options, - StopChan: make(chan os.Signal, 1), - } -} - -func (s *Server) Init() { - // TODO bypass k8s work - if s.KubeClient == nil { - s.KubeClient = k8s.NewClient() - } - if !s.KubeClient.Init(s.Options) { - logger.Sugar().Warnf("Failed to connect to Kubernetes cluster. Will ignore OpenID Connect check.") - s.Options.IsKubernetesConnected = false - } else { - s.Options.IsKubernetesConnected = true - } - - if s.CertStorage == nil { - s.CertStorage = cert2.NewStorage(s.Options) - } - if s.Elec == nil { - s.Elec = election.NewleaderElection() - } - go s.CertStorage.RefreshServerCert() - - s.LoadRootCert() - s.LoadAuthorityCert() - - s.PlainServer = grpc.NewServer() - reflection.Register(s.PlainServer) - - pool := x509.NewCertPool() - tlsConfig := &tls.Config{ - GetCertificate: func(info *tls.ClientHelloInfo) (*tls.Certificate, error) { - for _, cert := range s.CertStorage.GetTrustedCerts() { - pool.AddCert(cert.Cert) - } - return s.CertStorage.GetServerCert(info.ServerName), nil - }, - ClientCAs: pool, - ClientAuth: tls.VerifyClientCertIfGiven, - } - - s.CertStorage.GetServerCert("localhost") - s.CertStorage.GetServerCert("dubbo-ca." + s.Options.Namespace + ".svc") - s.CertStorage.GetServerCert("dubbo-ca." + s.Options.Namespace + ".svc.cluster.local") - - s.SecureServer = grpc.NewServer(grpc.Creds(credentials.NewTLS(tlsConfig))) - - s.initRuleHandler() - - s.registerCertificateService() - s.registerObserveService() - s.registerTrafficService() - - reflection.Register(s.SecureServer) - - if s.Options.InPodEnv { - s.WebhookServer = webhook.NewWebhook( - func(info *tls.ClientHelloInfo) (*tls.Certificate, error) { - return s.CertStorage.GetServerCert(info.ServerName), nil - }) - s.WebhookServer.Init(s.Options) - - s.JavaInjector = patch.NewJavaSdk(s.Options, s.KubeClient) - s.WebhookServer.Patches = append(s.WebhookServer.Patches, s.JavaInjector.NewPod) - } -} - -func (s *Server) registerObserveService() { - ruleImpl := &v1alpha1.RuleServiceImpl{ - Storage: s.ConnectionStorage, - KubeClient: s.KubeClient, - Options: s.Options, - CertStorage: s.CertStorage, - } - v1alpha1.RegisterRuleServiceServer(s.SecureServer, ruleImpl) - v1alpha1.RegisterRuleServiceServer(s.PlainServer, ruleImpl) -} - -func (s *Server) initRuleHandler() { - s.ConnectionStorage = connection.NewStorage() - s.AuthenticationHandler = authentication.NewHandler(s.ConnectionStorage) - s.AuthorizationHandler = authorization.NewHandler(s.ConnectionStorage) -} - -func (s *Server) registerCertificateService() { - impl := &v1alpha1.AuthorityServiceImpl{ - Options: s.Options, - CertStorage: s.CertStorage, - KubeClient: s.KubeClient, - } - - v1alpha1.RegisterAuthorityServiceServer(s.PlainServer, impl) - v1alpha1.RegisterAuthorityServiceServer(s.SecureServer, impl) -} - -func (s *Server) LoadRootCert() { - // todo -} - -func (s *Server) LoadAuthorityCert() { - if s.Options.IsKubernetesConnected { - certStr, priStr := s.KubeClient.GetAuthorityCert(s.Options.Namespace) - if certStr != "" && priStr != "" { - s.CertStorage.GetAuthorityCert().Cert = cert2.DecodeCert(certStr) - s.CertStorage.GetAuthorityCert().CertPem = certStr - s.CertStorage.GetAuthorityCert().PrivateKey = cert2.DecodePrivateKey(priStr) - } - } - - s.RefreshAuthorityCert() - go s.ScheduleRefreshAuthorityCert() -} - -func (s *Server) ScheduleRefreshAuthorityCert() { - interval := math.Min(math.Floor(float64(s.Options.CaValidity)/100), 10_000) - for { - time.Sleep(time.Duration(interval) * time.Millisecond) - if s.CertStorage.GetAuthorityCert().NeedRefresh() { - logger.Sugar().Infof("Authority cert is invalid, refresh it.") - // TODO lock if multi server - // TODO refresh signed cert - - s.Elec.Election(s.CertStorage, s.Options, s.KubeClient.GetKubClient()) - if s.Options.IsKubernetesConnected { - s.KubeClient.UpdateAuthorityCert(s.CertStorage.GetAuthorityCert().CertPem, cert2.EncodePrivateKey(s.CertStorage.GetAuthorityCert().PrivateKey), s.Options.Namespace) - s.KubeClient.UpdateWebhookConfig(s.Options, s.CertStorage) - if s.KubeClient.UpdateAuthorityPublicKey(s.CertStorage.GetAuthorityCert().CertPem) { - logger.Sugar().Infof("Write ca to config maps success.") - } else { - logger.Sugar().Warnf("Write ca to config maps failed.") - } - } - } - - select { - case <-s.StopChan: - return - default: - continue - } - } -} - -func (s *Server) RefreshAuthorityCert() { - if s.CertStorage.GetAuthorityCert().IsValid() { - logger.Sugar().Infof("Load authority cert from kubernetes secrect success.") - } else { - logger.Sugar().Warnf("Load authority cert from kubernetes secrect failed.") - s.CertStorage.SetAuthorityCert(cert2.GenerateAuthorityCert(s.CertStorage.GetRootCert(), s.Options.CaValidity)) - - // TODO lock if multi server - if s.Options.IsKubernetesConnected { - s.KubeClient.UpdateAuthorityCert(s.CertStorage.GetAuthorityCert().CertPem, cert2.EncodePrivateKey(s.CertStorage.GetAuthorityCert().PrivateKey), s.Options.Namespace) - } - } - - if s.Options.IsKubernetesConnected { - logger.Sugar().Info("Writing ca to config maps.") - if s.KubeClient.UpdateAuthorityPublicKey(s.CertStorage.GetAuthorityCert().CertPem) { - logger.Sugar().Info("Write ca to config maps success.") - } else { - logger.Sugar().Warnf("Write ca to config maps failed.") - } - } - - s.CertStorage.AddTrustedCert(s.CertStorage.GetAuthorityCert()) -} - -func (s *Server) Start() { - go func() { - lis, err := net.Listen("tcp", ":"+strconv.Itoa(s.Options.PlainServerPort)) - if err != nil { - log.Fatal(err) - } - err = s.PlainServer.Serve(lis) - if err != nil { - log.Fatal(err) - } - }() - go func() { - lis, err := net.Listen("tcp", ":"+strconv.Itoa(s.Options.SecureServerPort)) - if err != nil { - log.Fatal(err) - } - err = s.SecureServer.Serve(lis) - if err != nil { - log.Fatal(err) - } - }() - - if s.Options.InPodEnv { - go s.WebhookServer.Serve() - s.KubeClient.UpdateWebhookConfig(s.Options, s.CertStorage) - } - - s.KubeClient.InitController(s.AuthenticationHandler, s.AuthorizationHandler) - - logger.Sugar().Info("Server started.") -} diff --git a/pkg/authority/security/server_test.go b/pkg/authority/security/server_test.go deleted file mode 100644 index 0e36b6894..000000000 --- a/pkg/authority/security/server_test.go +++ /dev/null @@ -1,209 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one or more -// contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. -// The ASF licenses this file to You under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with -// the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package security - -import ( - "crypto/tls" - "os" - "testing" - "time" - - "github.com/apache/dubbo-admin/pkg/authority/election" - - "k8s.io/client-go/kubernetes" - - cert2 "github.com/apache/dubbo-admin/pkg/authority/cert" - "github.com/apache/dubbo-admin/pkg/authority/config" - "github.com/apache/dubbo-admin/pkg/authority/k8s" - "github.com/apache/dubbo-admin/pkg/logger" -) - -type mockKubeClient struct { - k8s.Client -} - -var ( - certPEM = "" - priPEM = "" -) - -func (s *mockKubeClient) Init(options *config.Options) bool { - return true -} - -func (s *mockKubeClient) GetAuthorityCert(namespace string) (string, string) { - return certPEM, priPEM -} - -func (s *mockKubeClient) UpdateAuthorityCert(cert string, pri string, namespace string) { -} - -func (s *mockKubeClient) UpdateAuthorityPublicKey(cert string) bool { - return true -} - -func (s *mockKubeClient) UpdateWebhookConfig(options *config.Options, storage cert2.Storage) { -} - -func (s *mockKubeClient) GetKubClient() *kubernetes.Clientset { - return nil -} - -type mockStorage struct { - cert2.Storage - origin cert2.Storage -} - -func (s *mockStorage) GetServerCert(serverName string) *tls.Certificate { - return nil -} - -func (s *mockStorage) RefreshServerCert() { -} - -func (s *mockStorage) SetAuthorityCert(cert *cert2.Cert) { - s.origin.SetAuthorityCert(cert) -} - -func (s *mockStorage) GetAuthorityCert() *cert2.Cert { - return s.origin.GetAuthorityCert() -} - -func (s *mockStorage) SetRootCert(cert *cert2.Cert) { - s.origin.SetRootCert(cert) -} - -func (s *mockStorage) GetRootCert() *cert2.Cert { - return s.origin.GetRootCert() -} - -func (s *mockStorage) AddTrustedCert(cert *cert2.Cert) { - s.origin.AddTrustedCert(cert) -} - -func (s *mockStorage) GetTrustedCerts() []*cert2.Cert { - return s.origin.GetTrustedCerts() -} - -func (s *mockStorage) GetStopChan() chan os.Signal { - return s.origin.GetStopChan() -} - -type mockLeaderElection struct { - election.LeaderElection -} - -func (s *mockLeaderElection) Election(storage cert2.Storage, options *config.Options, kubeClient *kubernetes.Clientset) error { - storage.SetAuthorityCert(cert2.GenerateAuthorityCert(storage.GetRootCert(), options.CaValidity)) - return nil -} - -func TestInit(t *testing.T) { - t.Parallel() - - logger.Init() - - options := &config.Options{ - IsKubernetesConnected: true, - Namespace: "dubbo-system", - PlainServerPort: 30060, - SecureServerPort: 30062, - DebugPort: 30070, - CaValidity: 30 * 24 * 60 * 60 * 1000, // 30 day - CertValidity: 1 * 60 * 60 * 1000, // 1 hour - } - - s := NewServer(options) - s.KubeClient = &mockKubeClient{} - - s.Init() - if !s.CertStorage.GetAuthorityCert().IsValid() { - t.Fatal("Authority cert is not valid") - return - } - - certPEM = s.CertStorage.GetAuthorityCert().CertPem - priPEM = cert2.EncodePrivateKey(s.CertStorage.GetAuthorityCert().PrivateKey) - - s.PlainServer.Stop() - s.SecureServer.Stop() - s.StopChan <- os.Kill - - s = NewServer(options) - s.KubeClient = &mockKubeClient{} - s.Init() - - if !s.CertStorage.GetAuthorityCert().IsValid() { - t.Fatal("Authority cert is not valid") - - return - } - - if s.CertStorage.GetAuthorityCert().CertPem != certPEM { - t.Fatal("Authority cert is not equal") - - return - } - - s.PlainServer.Stop() - s.SecureServer.Stop() - s.StopChan <- os.Kill - s.CertStorage.GetStopChan() <- os.Kill -} - -func TestRefresh(t *testing.T) { - t.Parallel() - - logger.Init() - - options := &config.Options{ - IsKubernetesConnected: false, - Namespace: "dubbo-system", - PlainServerPort: 30060, - SecureServerPort: 30062, - DebugPort: 30070, - CaValidity: 10, - } - - s := NewServer(options) - - s.KubeClient = &mockKubeClient{} - storage := &mockStorage{} - s.Elec = &mockLeaderElection{} - storage.origin = cert2.NewStorage(options) - s.CertStorage = storage - - s.Init() - - origin := s.CertStorage.GetAuthorityCert() - - for i := 0; i < 1000; i++ { - // wait at most 100s - time.Sleep(100 * time.Millisecond) - if s.CertStorage.GetAuthorityCert() != origin { - break - } - } - - if s.CertStorage.GetAuthorityCert() == origin { - t.Fatal("Authority cert is not refreshed") - return - } - - s.PlainServer.Stop() - s.SecureServer.Stop() - s.StopChan <- os.Kill -} diff --git a/pkg/authority/v1alpha1/authority.go b/pkg/authority/server/authority.go similarity index 51% rename from pkg/authority/v1alpha1/authority.go rename to pkg/authority/server/authority.go index 579ff4db8..66707d17c 100644 --- a/pkg/authority/v1alpha1/authority.go +++ b/pkg/authority/server/authority.go @@ -13,34 +13,78 @@ // See the License for the specific language governing permissions and // limitations under the License. -package v1alpha1 +package server import ( "context" - "time" - - "github.com/apache/dubbo-admin/pkg/authority/jwt" - - "github.com/apache/dubbo-admin/pkg/authority/cert" - "github.com/apache/dubbo-admin/pkg/authority/config" - "github.com/apache/dubbo-admin/pkg/authority/k8s" - "github.com/apache/dubbo-admin/pkg/logger" + "github.com/apache/dubbo-admin/api/mesh" + "github.com/apache/dubbo-admin/pkg/authority/patch" + "github.com/apache/dubbo-admin/pkg/authority/webhook" + dubbo_cp "github.com/apache/dubbo-admin/pkg/config/app/dubbo-cp" + cert "github.com/apache/dubbo-admin/pkg/core/cert/provider" + "github.com/apache/dubbo-admin/pkg/core/jwt" + "github.com/apache/dubbo-admin/pkg/core/logger" + "github.com/apache/dubbo-admin/pkg/core/tools/endpoint" "google.golang.org/grpc/peer" + "net/http" + "time" ) -type AuthorityServiceImpl struct { - UnimplementedAuthorityServiceServer - Options *config.Options +type AuthorityService struct { + mesh.UnimplementedAuthorityServiceServer + Options *dubbo_cp.Config + KubuClient cert.Client CertStorage cert.Storage - KubeClient k8s.Client + + WebhookServer *webhook.Webhook + JavaInjector *patch.JavaSdk +} + +func (s *AuthorityService) NeedLeaderElection() bool { + return false +} + +func (s *AuthorityService) Start(stop <-chan struct{}) error { + errChan := make(chan error) + if s.Options.KubeConfig.InPodEnv { + go func() { + err := s.WebhookServer.Server.ListenAndServe() + if err != nil { + switch err { + case http.ErrServerClosed: + logger.Sugar().Info("shutting down HTTP Server") + default: + logger.Sugar().Error(err, "could not start an HTTP Server") + errChan <- err + } + } + }() + s.KubuClient.UpdateWebhookConfig(s.Options, s.CertStorage) + select { + case <-stop: + logger.Sugar().Info("stopping admin") + if s.WebhookServer.Server != nil { + return s.WebhookServer.Server.Shutdown(context.Background()) + } + case err := <-errChan: + return err + } + } + return nil +} + +func NewServer(options *dubbo_cp.Config) *AuthorityService { + return &AuthorityService{ + Options: options, + } } -func (s *AuthorityServiceImpl) CreateIdentity( +func (s *AuthorityService) CreateIdentity( c context.Context, - req *IdentityRequest, -) (*IdentityResponse, error) { + req *mesh.IdentityRequest, +) (*mesh.IdentityResponse, error) { if req.Csr == "" { - return &IdentityResponse{ + return &mesh.IdentityResponse{ Success: false, Message: "CSR is empty.", }, nil @@ -48,28 +92,28 @@ func (s *AuthorityServiceImpl) CreateIdentity( csr, err := cert.LoadCSR(req.Csr) if csr == nil || err != nil { - return &IdentityResponse{ + return &mesh.IdentityResponse{ Success: false, Message: "Decode csr failed.", }, nil } p, _ := peer.FromContext(c) - endpoint, err := ExactEndpoint(c, s.CertStorage, s.Options, s.KubeClient) + endpoint, err := endpoint.ExactEndpoint(c, s.CertStorage, s.Options, s.KubuClient) if err != nil { logger.Sugar().Warnf("Failed to exact endpoint from context: %v. RemoteAddr: %s", err, p.Addr.String()) - return &IdentityResponse{ + return &mesh.IdentityResponse{ Success: false, Message: err.Error(), }, nil } - certPem, err := cert.SignFromCSR(csr, endpoint, s.CertStorage.GetAuthorityCert(), s.Options.CertValidity) + certPem, err := cert.SignFromCSR(csr, endpoint, s.CertStorage.GetAuthorityCert(), s.Options.Security.CertValidity) if err != nil { logger.Sugar().Warnf("Failed to sign certificate from csr: %v. RemoteAddr: %s", err, p.Addr.String()) - return &IdentityResponse{ + return &mesh.IdentityResponse{ Success: false, Message: err.Error(), }, nil @@ -77,11 +121,11 @@ func (s *AuthorityServiceImpl) CreateIdentity( logger.Sugar().Infof("Success to sign certificate from csr. RemoteAddr: %s", p.Addr.String()) - token, err := jwt.NewClaims(endpoint.SpiffeID, endpoint.ToString(), endpoint.ID, s.Options.CertValidity).Sign(s.CertStorage.GetAuthorityCert().PrivateKey) + token, err := jwt.NewClaims(endpoint.SpiffeID, endpoint.ToString(), endpoint.ID, s.Options.Security.CertValidity).Sign(s.CertStorage.GetAuthorityCert().PrivateKey) if err != nil { logger.Sugar().Warnf("Failed to sign jwt token: %v. RemoteAddr: %s", err, p.Addr.String()) - return &IdentityResponse{ + return &mesh.IdentityResponse{ Success: false, Message: err.Error(), }, nil @@ -93,14 +137,14 @@ func (s *AuthorityServiceImpl) CreateIdentity( trustedCerts = append(trustedCerts, c.CertPem) trustedTokenPublicKeys = append(trustedTokenPublicKeys, cert.EncodePublicKey(&c.PrivateKey.PublicKey)) } - return &IdentityResponse{ + return &mesh.IdentityResponse{ Success: true, Message: "OK", CertPem: certPem, TrustCerts: trustedCerts, Token: token, TrustedTokenPublicKeys: trustedTokenPublicKeys, - RefreshTime: time.Now().UnixMilli() + (s.Options.CertValidity / 2), - ExpireTime: time.Now().UnixMilli() + s.Options.CertValidity, + RefreshTime: time.Now().UnixMilli() + (s.Options.Security.CertValidity / 2), + ExpireTime: time.Now().UnixMilli() + s.Options.Security.CertValidity, }, nil } diff --git a/pkg/authority/v1alpha1/authority_test.go b/pkg/authority/server/authority_test.go similarity index 59% rename from pkg/authority/v1alpha1/authority_test.go rename to pkg/authority/server/authority_test.go index 0ce729d3f..8fc444892 100644 --- a/pkg/authority/v1alpha1/authority_test.go +++ b/pkg/authority/server/authority_test.go @@ -13,31 +13,33 @@ // See the License for the specific language governing permissions and // limitations under the License. -package v1alpha1 +package server import ( + "github.com/apache/dubbo-admin/api/mesh" + dubbo_cp "github.com/apache/dubbo-admin/pkg/config/app/dubbo-cp" + "github.com/apache/dubbo-admin/pkg/config/kube" + "github.com/apache/dubbo-admin/pkg/config/security" + "github.com/apache/dubbo-admin/pkg/core/cert/provider" + "github.com/apache/dubbo-admin/pkg/core/endpoint" + "github.com/apache/dubbo-admin/pkg/core/jwt" + "github.com/apache/dubbo-admin/pkg/core/logger" "net" "testing" - "github.com/apache/dubbo-admin/pkg/authority/jwt" "github.com/stretchr/testify/assert" - cert2 "github.com/apache/dubbo-admin/pkg/authority/cert" - "github.com/apache/dubbo-admin/pkg/authority/config" - "github.com/apache/dubbo-admin/pkg/authority/k8s" - "github.com/apache/dubbo-admin/pkg/authority/rule" - "github.com/apache/dubbo-admin/pkg/logger" "golang.org/x/net/context" "google.golang.org/grpc/metadata" "google.golang.org/grpc/peer" ) type fakeKubeClient struct { - k8s.Client + provider.Client } -func (c fakeKubeClient) VerifyServiceAccount(token string, authorizationType string) (*rule.Endpoint, bool) { - return &rule.Endpoint{}, "expceted-token" == token +func (c fakeKubeClient) VerifyServiceAccount(token string, authorizationType string) (*endpoint.Endpoint, bool) { + return &endpoint.Endpoint{}, "expceted-token" == token } type fakeAddr struct { @@ -58,22 +60,26 @@ func TestCSRFailed(t *testing.T) { c := metadata.NewIncomingContext(context.TODO(), metadata.MD{}) c = peer.NewContext(c, &peer.Peer{Addr: &fakeAddr{}}) - options := &config.Options{ - IsKubernetesConnected: false, - CertValidity: 24 * 60 * 60 * 1000, - CaValidity: 365 * 24 * 60 * 60 * 1000, + options := &dubbo_cp.Config{ + KubeConfig: kube.KubeConfig{ + IsKubernetesConnected: false, + }, + Security: security.SecurityConfig{ + CertValidity: 24 * 60 * 60 * 1000, + CaValidity: 365 * 24 * 60 * 60 * 1000, + }, } - storage := cert2.NewStorage(options) - storage.SetAuthorityCert(cert2.GenerateAuthorityCert(nil, options.CaValidity)) + storage := provider.NewStorage(options, &provider.ClientImpl{}) + storage.SetAuthorityCert(provider.GenerateAuthorityCert(nil, options.Security.CaValidity)) kubeClient := &fakeKubeClient{} - impl := &AuthorityServiceImpl{ + impl := &AuthorityService{ Options: options, CertStorage: storage, - KubeClient: kubeClient.Client, + KubuClient: kubeClient.Client, } - certificate, err := impl.CreateIdentity(c, &IdentityRequest{ + certificate, err := impl.CreateIdentity(c, &mesh.IdentityRequest{ Csr: "", }) if err != nil { @@ -86,7 +92,7 @@ func TestCSRFailed(t *testing.T) { return } - certificate, err = impl.CreateIdentity(c, &IdentityRequest{ + certificate, err = impl.CreateIdentity(c, &mesh.IdentityRequest{ Csr: "123", }) @@ -100,7 +106,7 @@ func TestCSRFailed(t *testing.T) { return } - certificate, err = impl.CreateIdentity(c, &IdentityRequest{ + certificate, err = impl.CreateIdentity(c, &mesh.IdentityRequest{ Csr: "-----BEGIN CERTIFICATE-----\n" + "123\n" + "-----END CERTIFICATE-----", @@ -124,29 +130,33 @@ func TestTokenFailed(t *testing.T) { p := peer.NewContext(context.TODO(), &peer.Peer{Addr: &fakeAddr{}}) - options := &config.Options{ - IsKubernetesConnected: true, - EnableOIDCCheck: true, - CertValidity: 24 * 60 * 60 * 1000, - CaValidity: 365 * 24 * 60 * 60 * 1000, + options := &dubbo_cp.Config{ + KubeConfig: kube.KubeConfig{ + IsKubernetesConnected: true, + }, + Security: security.SecurityConfig{ + CertValidity: 24 * 60 * 60 * 1000, + CaValidity: 365 * 24 * 60 * 60 * 1000, + EnableOIDCCheck: true, + }, } - storage := cert2.NewStorage(options) - storage.SetAuthorityCert(cert2.GenerateAuthorityCert(nil, options.CaValidity)) + storage := provider.NewStorage(options, &provider.ClientImpl{}) + storage.SetAuthorityCert(provider.GenerateAuthorityCert(nil, options.Security.CaValidity)) kubeClient := &fakeKubeClient{} - impl := &AuthorityServiceImpl{ + impl := &AuthorityService{ Options: options, CertStorage: storage, - KubeClient: kubeClient, + KubuClient: kubeClient, } - csr, privateKey, err := cert2.GenerateCSR() + csr, privateKey, err := provider.GenerateCSR() if err != nil { t.Fatal(err) return } - certificate, err := impl.CreateIdentity(p, &IdentityRequest{ + certificate, err := impl.CreateIdentity(p, &mesh.IdentityRequest{ Csr: csr, }) if err != nil { @@ -163,7 +173,7 @@ func TestTokenFailed(t *testing.T) { md["authorization"] = []string{"123"} c := metadata.NewIncomingContext(p, md) - certificate, err = impl.CreateIdentity(c, &IdentityRequest{ + certificate, err = impl.CreateIdentity(c, &mesh.IdentityRequest{ Csr: csr, }) @@ -181,7 +191,7 @@ func TestTokenFailed(t *testing.T) { md["authorization"] = []string{"Bearer 123"} c = metadata.NewIncomingContext(p, md) - certificate, err = impl.CreateIdentity(c, &IdentityRequest{ + certificate, err = impl.CreateIdentity(c, &mesh.IdentityRequest{ Csr: csr, }) @@ -199,7 +209,7 @@ func TestTokenFailed(t *testing.T) { md["authorization"] = []string{"Bearer expceted-token"} c = metadata.NewIncomingContext(p, md) - certificate, err = impl.CreateIdentity(c, &IdentityRequest{ + certificate, err = impl.CreateIdentity(c, &mesh.IdentityRequest{ Csr: csr, }) @@ -213,8 +223,8 @@ func TestTokenFailed(t *testing.T) { return } - generatedCert := cert2.DecodeCert(certificate.CertPem) - c2 := &cert2.Cert{ + generatedCert := provider.DecodeCert(certificate.CertPem) + c2 := &provider.Cert{ Cert: generatedCert, CertPem: certificate.CertPem, PrivateKey: privateKey, @@ -234,30 +244,35 @@ func TestSuccess(t *testing.T) { c := metadata.NewIncomingContext(context.TODO(), metadata.MD{}) c = peer.NewContext(c, &peer.Peer{Addr: &fakeAddr{}}) - options := &config.Options{ - IsKubernetesConnected: false, - IsTrustAnyone: true, - CertValidity: 24 * 60 * 60 * 1000, - CaValidity: 365 * 24 * 60 * 60 * 1000, + options := &dubbo_cp.Config{ + KubeConfig: kube.KubeConfig{ + IsKubernetesConnected: false, + }, + Security: security.SecurityConfig{ + CertValidity: 24 * 60 * 60 * 1000, + CaValidity: 365 * 24 * 60 * 60 * 1000, + IsTrustAnyone: true, + }, } - storage := cert2.NewStorage(options) - storage.SetAuthorityCert(cert2.GenerateAuthorityCert(nil, options.CaValidity)) + + storage := provider.NewStorage(options, &provider.ClientImpl{}) + storage.SetAuthorityCert(provider.GenerateAuthorityCert(nil, options.Security.CaValidity)) storage.AddTrustedCert(storage.GetAuthorityCert()) kubeClient := &fakeKubeClient{} - impl := &AuthorityServiceImpl{ + impl := &AuthorityService{ Options: options, CertStorage: storage, - KubeClient: kubeClient, + KubuClient: kubeClient, } - csr, privateKey, err := cert2.GenerateCSR() + csr, privateKey, err := provider.GenerateCSR() if err != nil { t.Fatal(err) return } - certificate, err := impl.CreateIdentity(c, &IdentityRequest{ + certificate, err := impl.CreateIdentity(c, &mesh.IdentityRequest{ Csr: csr, }) if err != nil { @@ -270,8 +285,8 @@ func TestSuccess(t *testing.T) { return } - generatedCert := cert2.DecodeCert(certificate.CertPem) - c2 := &cert2.Cert{ + generatedCert := provider.DecodeCert(certificate.CertPem) + c2 := &provider.Cert{ Cert: generatedCert, CertPem: certificate.CertPem, PrivateKey: privateKey, @@ -287,5 +302,5 @@ func TestSuccess(t *testing.T) { assert.NotNil(t, claims) assert.Equal(t, 1, len(certificate.TrustedTokenPublicKeys)) - assert.Equal(t, cert2.EncodePublicKey(&storage.GetAuthorityCert().PrivateKey.PublicKey), certificate.TrustedTokenPublicKeys[0]) + assert.Equal(t, provider.EncodePublicKey(&storage.GetAuthorityCert().PrivateKey.PublicKey), certificate.TrustedTokenPublicKeys[0]) } diff --git a/pkg/authority/setup.go b/pkg/authority/setup.go index 50377b55a..422ae45f3 100644 --- a/pkg/authority/setup.go +++ b/pkg/authority/setup.go @@ -1,73 +1,55 @@ +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package authority import ( - "fmt" - "github.com/apache/dubbo-admin/pkg/authority/config" - "github.com/apache/dubbo-admin/pkg/authority/security" - "github.com/spf13/cobra" - "github.com/spf13/pflag" - "github.com/spf13/viper" - "os" - "os/signal" - "strings" - "syscall" + "crypto/tls" + "github.com/apache/dubbo-admin/api/mesh" + "github.com/apache/dubbo-admin/pkg/authority/patch" + "github.com/apache/dubbo-admin/pkg/authority/server" + "github.com/apache/dubbo-admin/pkg/authority/webhook" + core_runtime "github.com/apache/dubbo-admin/pkg/core/runtime" + "github.com/pkg/errors" ) -var ( - // For example, --webhook-port is bound to DUBBO_WEBHOOK_PORT. - envNamePrefix = "DUBBO" - - // Replace hyphenated flag names with camelCase - replaceWithCamelCase = false -) - -func Run(options *config.Options) error { - s := security.NewServer(options) - - s.Init() - s.Start() - - c := make(chan os.Signal, 1) - signal.Notify(c, syscall.SIGINT, syscall.SIGTERM) - signal.Notify(s.StopChan, syscall.SIGINT, syscall.SIGTERM) - signal.Notify(s.CertStorage.GetStopChan(), syscall.SIGINT, syscall.SIGTERM) - - <-c - +func Setup(rt core_runtime.Runtime) error { + server := server.NewServer(rt.Config()) + if rt.Config().KubeConfig.InPodEnv { + server.WebhookServer = webhook.NewWebhook( + func(info *tls.ClientHelloInfo) (*tls.Certificate, error) { + return rt.CertStorage().GetServerCert(info.ServerName), nil + }) + server.WebhookServer.Init(rt.Config()) + server.JavaInjector = patch.NewJavaSdk(rt.Config(), rt.KubuClient()) + server.WebhookServer.Patches = append(server.WebhookServer.Patches, server.JavaInjector.NewPod) + server.KubuClient = rt.KubuClient() + server.CertStorage = rt.CertStorage() + } + if err := RegisterCertificateService(rt, server); err != nil { + return errors.Wrap(err, "CertificateService register failed") + } + + if err := rt.Add(server); err != nil { + return errors.Wrap(err, "Add Authority Component failed") + } return nil } -func Initialize(cmd *cobra.Command) error { - v := viper.New() - - // For example, --webhook-port is bound to DUBBO_WEBHOOK_PORT. - v.SetEnvPrefix(envNamePrefix) - - // keys with underscores, e.g. DUBBO-WEBHOOK-PORT to DUBBO_WEBHOOK_PORT - v.SetEnvKeyReplacer(strings.NewReplacer("-", "_")) - - // Bind to environment variables - v.AutomaticEnv() - - // Bind the current command's flags to viper - bindFlags(cmd, v) - +func RegisterCertificateService(rt core_runtime.Runtime, service *server.AuthorityService) error { + mesh.RegisterAuthorityServiceServer(rt.GrpcServer().PlainServer, service) + mesh.RegisterAuthorityServiceServer(rt.GrpcServer().SecureServer, service) return nil } - -func bindFlags(cmd *cobra.Command, v *viper.Viper) { - cmd.Flags().VisitAll(func(f *pflag.Flag) { - configName := f.Name - - // Replace hyphens with a camelCased string. - if replaceWithCamelCase { - configName = strings.ReplaceAll(f.Name, "-", "") - } - - // Apply the viper config value to the flag when the flag is not set and viper has a value - if !f.Changed && v.IsSet(configName) { - val := v.Get(configName) - cmd.Flags().Set(f.Name, fmt.Sprintf("%v", val)) - } - }) -} diff --git a/pkg/authority/v1alpha1/rule.go b/pkg/authority/v1alpha1/rule.go deleted file mode 100644 index 84e863f26..000000000 --- a/pkg/authority/v1alpha1/rule.go +++ /dev/null @@ -1,98 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one or more -// contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. -// The ASF licenses this file to You under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with -// the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package v1alpha1 - -import ( - "fmt" - - "github.com/apache/dubbo-admin/pkg/authority/cert" - - "github.com/apache/dubbo-admin/pkg/authority/config" - "github.com/apache/dubbo-admin/pkg/authority/k8s" - "github.com/apache/dubbo-admin/pkg/authority/rule/connection" - "github.com/apache/dubbo-admin/pkg/logger" - "google.golang.org/grpc/peer" -) - -type RuleServiceImpl struct { - UnimplementedRuleServiceServer - - Options *config.Options - CertStorage cert.Storage - KubeClient k8s.Client - Storage *connection.Storage -} - -func (s *RuleServiceImpl) Observe(stream RuleService_ObserveServer) error { - c := &GrpcEndpointConnection{ - stream: stream, - stopChan: make(chan int, 1), - } - - p, ok := peer.FromContext(stream.Context()) - if !ok { - logger.Sugar().Errorf("failed to get peer from context") - - return fmt.Errorf("failed to get peer from context") - } - - endpoint, err := ExactEndpoint(stream.Context(), s.CertStorage, s.Options, s.KubeClient) - if err != nil { - logger.Sugar().Errorf("failed to get endpoint from context: %v. RemoteAddr: %s", err, p.Addr) - - return err - } - - logger.Sugar().Infof("New observe connection from %s", endpoint) - s.Storage.Connected(endpoint, c) - - <-c.stopChan - return nil -} - -type GrpcEndpointConnection struct { - connection.EndpointConnection - - stream RuleService_ObserveServer - stopChan chan int -} - -func (c *GrpcEndpointConnection) Send(r *connection.ObserveResponse) error { - pbr := &ObserveResponse{ - Nonce: r.Nonce, - Type: r.Type, - Revision: r.Data.Revision(), - Data: r.Data.Data(), - } - - return c.stream.Send(pbr) -} - -func (c *GrpcEndpointConnection) Recv() (*connection.ObserveRequest, error) { - in, err := c.stream.Recv() - if err != nil { - return nil, err - } - - return &connection.ObserveRequest{ - Nonce: in.Nonce, - Type: in.Type, - }, nil -} - -func (c *GrpcEndpointConnection) Disconnect() { - c.stopChan <- 0 -} diff --git a/pkg/authority/webhook/server.go b/pkg/authority/webhook/server.go index 85f79b113..bf89314c9 100644 --- a/pkg/authority/webhook/server.go +++ b/pkg/authority/webhook/server.go @@ -19,11 +19,11 @@ import ( "crypto/tls" "encoding/json" "fmt" + dubbo_cp "github.com/apache/dubbo-admin/pkg/config/app/dubbo-cp" + "github.com/apache/dubbo-admin/pkg/core/logger" "io" "net/http" - "github.com/apache/dubbo-admin/pkg/authority/config" - "github.com/apache/dubbo-admin/pkg/logger" "github.com/mattbaird/jsonpatch" admissionV1 "k8s.io/api/admission/v1" @@ -63,23 +63,25 @@ func (wh *Webhook) NewServer(port int32) *http.Server { } } -func (wh *Webhook) Init(options *config.Options) { - wh.Server = wh.NewServer(options.WebhookPort) - wh.AllowOnErr = options.WebhookAllowOnErr +func (wh *Webhook) Init(options *dubbo_cp.Config) { + wh.Server = wh.NewServer(options.Security.WebhookPort) + wh.AllowOnErr = options.Security.WebhookAllowOnErr } +// Serve only for test func (wh *Webhook) Serve() { err := wh.Server.ListenAndServeTLS("", "") if err != nil { - logger.Sugar().Warnf("[Webhook] Serve webhook server failed. %v", err.Error()) + logger.Sugar().Warnf("[Webhook] Serve webhook cp-server failed. %v", err.Error()) return } } +// Stop only for test func (wh *Webhook) Stop() { if err := wh.Server.Close(); err != nil { - logger.Sugar().Warnf("[Webhook] Stop webhook server failed. %v", err.Error()) + logger.Sugar().Warnf("[Webhook] Stop webhook cp-server failed. %v", err.Error()) return } diff --git a/pkg/authority/webhook/server_test.go b/pkg/authority/webhook/server_test.go index f346882fc..9eb5df18e 100644 --- a/pkg/authority/webhook/server_test.go +++ b/pkg/authority/webhook/server_test.go @@ -20,6 +20,9 @@ import ( "crypto/x509" "encoding/json" "fmt" + dubbo_cp "github.com/apache/dubbo-admin/pkg/config/app/dubbo-cp" + "github.com/apache/dubbo-admin/pkg/config/security" + "github.com/apache/dubbo-admin/pkg/core/cert/provider" "io" "net" "net/http" @@ -38,18 +41,14 @@ import ( "github.com/stretchr/testify/assert" - "github.com/apache/dubbo-admin/pkg/authority/config" - "github.com/apache/dubbo-admin/pkg/authority/webhook" - - "github.com/apache/dubbo-admin/pkg/authority/cert" ) func TestServe(t *testing.T) { t.Parallel() - authority := cert.GenerateAuthorityCert(nil, 60*60*1000) - c := cert.SignServerCert(authority, []string{"localhost"}, 60*60*1000) + authority := provider.GenerateAuthorityCert(nil, 60*60*1000) + c := provider.SignServerCert(authority, []string{"localhost"}, 60*60*1000) server := webhook.NewWebhook(func(info *tls.ClientHelloInfo) (*tls.Certificate, error) { return c.GetTlsCert(), nil @@ -57,8 +56,10 @@ func TestServe(t *testing.T) { port := getAvailablePort() - server.Init(&config.Options{ - WebhookPort: port, + server.Init(&dubbo_cp.Config{ + Security: security.SecurityConfig{ + WebhookPort: port, + }, }) go server.Serve() @@ -75,7 +76,7 @@ func TestServe(t *testing.T) { client := http.Client{Transport: trans, Timeout: 15 * time.Second} res, err := client.Get("https://localhost:" + strconv.Itoa(int(port)) + "/health") if err != nil { - t.Log("server is not ready: ", err) + t.Log("cp-server is not ready: ", err) return false } @@ -87,7 +88,7 @@ func TestServe(t *testing.T) { } return true - }, 30*time.Second, 1*time.Second, "server should be ready") + }, 30*time.Second, 1*time.Second, "cp-server should be ready") server.Stop() } diff --git a/pkg/admin/config/address_config.go b/pkg/config/admin/address_config.go similarity index 77% rename from pkg/admin/config/address_config.go rename to pkg/config/admin/address_config.go index 66b387b9a..4281f12c7 100644 --- a/pkg/admin/config/address_config.go +++ b/pkg/config/admin/address_config.go @@ -15,7 +15,7 @@ * limitations under the License. */ -package config +package admin import ( "net/url" @@ -26,15 +26,21 @@ import ( type AddressConfig struct { Address string `yaml:"address"` - url *url.URL + Url *url.URL } -func (c *AddressConfig) getProtocol() string { - return c.url.Scheme +func (c *AddressConfig) Sanitize() {} + +func (c *AddressConfig) Validate() error { + return nil +} + +func (c *AddressConfig) GetProtocol() string { + return c.Url.Scheme } -func (c *AddressConfig) getAddress() string { - return c.url.Host +func (c *AddressConfig) GetAddress() string { + return c.Url.Host } func (c *AddressConfig) GetUrlMap() url.Values { @@ -45,16 +51,16 @@ func (c *AddressConfig) GetUrlMap() url.Values { } func (c *AddressConfig) param(key string, defaultValue string) string { - param := c.url.Query().Get(key) + param := c.Url.Query().Get(key) if len(param) > 0 { return param } return defaultValue } -func (c *AddressConfig) toURL() (*common.URL, error) { - return common.NewURL(c.getAddress(), - common.WithProtocol(c.getProtocol()), +func (c *AddressConfig) ToURL() (*common.URL, error) { + return common.NewURL(c.GetAddress(), + common.WithProtocol(c.GetProtocol()), common.WithParams(c.GetUrlMap()), common.WithUsername(c.param("username", "")), common.WithPassword(c.param("password", "")), diff --git a/pkg/config/admin/config.go b/pkg/config/admin/config.go new file mode 100644 index 000000000..9ec3b315c --- /dev/null +++ b/pkg/config/admin/config.go @@ -0,0 +1,68 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package admin + +import ( + "github.com/apache/dubbo-admin/pkg/config" + "github.com/pkg/errors" +) + +type Admin struct { + AdminPort int `yaml:"admin-port"` + ConfigCenter string `yaml:"config-center"` + MetadataReport AddressConfig `yaml:"metadata-report"` + Registry AddressConfig `yaml:"registry"` + Prometheus Prometheus `yaml:"prometheus"` + MysqlDSN string `yaml:"mysql-dsn"` +} + +type Prometheus struct { + Ip string `json:"ip"` + Port string `json:"port"` + MonitorPort string `json:"monitor-port"` +} + +func (c *Prometheus) Sanitize() {} + +func (c *Prometheus) Validate() error { + // TODO Validate admin + return nil +} + +func (c *Admin) Sanitize() { + c.Prometheus.Sanitize() + c.Registry.Sanitize() + c.MetadataReport.Sanitize() + c.MysqlDSN = config.SanitizedValue +} + +func (c *Admin) Validate() error { + err := c.Prometheus.Validate() + if err != nil { + return errors.Wrap(err, "Prometheus validation failed") + } + err = c.Registry.Validate() + if err != nil { + return errors.Wrap(err, "Registry validation failed") + } + err = c.MetadataReport.Validate() + if err != nil { + return errors.Wrap(err, "MetadataReport validation failed") + } + return nil +} diff --git a/pkg/config/app/dubbo-cp/config.go b/pkg/config/app/dubbo-cp/config.go new file mode 100644 index 000000000..651439f4b --- /dev/null +++ b/pkg/config/app/dubbo-cp/config.go @@ -0,0 +1,105 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dubbo_cp + +import ( + "github.com/apache/dubbo-admin/pkg/config" + "github.com/pkg/errors" + + "github.com/apache/dubbo-admin/pkg/config/admin" + "github.com/apache/dubbo-admin/pkg/config/kube" + "github.com/apache/dubbo-admin/pkg/config/security" + "github.com/apache/dubbo-admin/pkg/config/server" +) + +type Config struct { + Admin admin.Admin `yaml:"admin"` + GrpcServer server.ServerConfig `yaml:"grpc-cp-server"` + Security security.SecurityConfig `yaml:"security"` + KubeConfig kube.KubeConfig `yaml:"KubeConfig-config"` +} + +func (c *Config) Sanitize() { + c.Security.Sanitize() + c.Admin.Sanitize() + c.GrpcServer.Sanitize() + c.KubeConfig.Sanitize() +} + +func (c *Config) Validate() error { + err := c.Security.Validate() + if err != nil { + return errors.Wrap(err, "SecurityConfig validation failed") + } + err = c.Admin.Validate() + if err != nil { + return errors.Wrap(err, "Admin validation failed") + } + err = c.GrpcServer.Validate() + if err != nil { + return errors.Wrap(err, "ServerConfig validation failed") + } + err = c.KubeConfig.Validate() + if err != nil { + return errors.Wrap(err, "KubeConfig validation failed") + } + return nil +} + +var DefaultConfig = func() Config { + return Config{ + Admin: admin.Admin{ + AdminPort: 38080, + ConfigCenter: "zookeeper://127.0.0.1:2181", + MetadataReport: admin.AddressConfig{ + Address: "zookeeper://127.0.0.1:2181", + }, + Registry: admin.AddressConfig{ + Address: "zookeeper://127.0.0.1:2181", + }, + Prometheus: admin.Prometheus{ + Ip: "127.0.0.1", + Port: "9090", + MonitorPort: "22222", + }, + MysqlDSN: "root:password@tcp(127.0.0.1:3306)/dubbo-admin?charset=utf8&parseTime=true", + }, + GrpcServer: server.ServerConfig{ + PlainServerPort: 30060, + SecureServerPort: 30062, + DebugPort: 30070, + }, + Security: security.SecurityConfig{ + CaValidity: 30 * 24 * 60 * 60 * 1000, + CertValidity: 1 * 60 * 60 * 1000, + IsTrustAnyone: false, + EnableOIDCCheck: true, + ResourcelockIdentity: config.GetStringEnv("POD_NAME", config.GetDefaultResourcelockIdentity()), + WebhookPort: 30080, + WebhookAllowOnErr: true, + }, + KubeConfig: kube.KubeConfig{ + Namespace: "dubbo-system", + ServiceName: "dubbo-ca", + InPodEnv: false, + IsKubernetesConnected: false, + RestConfigQps: 50, + RestConfigBurst: 100, + }, + } +} diff --git a/pkg/traffic/config/crd/kustomizeconfig.yaml b/pkg/config/app/dubbo-cp/dubbo-cp.default.yaml similarity index 51% rename from pkg/traffic/config/crd/kustomizeconfig.yaml rename to pkg/config/app/dubbo-cp/dubbo-cp.default.yaml index 4c3210e72..c3f922560 100644 --- a/pkg/traffic/config/crd/kustomizeconfig.yaml +++ b/pkg/config/app/dubbo-cp/dubbo-cp.default.yaml @@ -12,23 +12,31 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - -# This file is for teaching kustomize how to substitute name and namespace reference in CRD -nameReference: -- kind: Service - version: v1 - fieldSpecs: - - kind: CustomResourceDefinition - version: v1 - group: apiextensions.k8s.io - path: spec/conversion/webhook/clientConfig/service/name - -namespace: -- kind: CustomResourceDefinition - version: v1 - group: apiextensions.k8s.io - path: spec/conversion/webhook/clientConfig/service/namespace - create: false - -varReference: -- path: metadata/annotations +admin: + admin-port: 38080 + config-center: zookeeper://127.0.0.1:2181 + metadata-report: + address: zookeeper://127.0.0.1:2181 + registry: + address: zookeeper://127.0.0.1:2181 + prometheus: + ip: 127.0.0.1 + port: 9090 + monitor-port: 22222 + mysql-dsn: root:password@tcp(127.0.0.1:3306)/dubbo-admin?charset=utf8&parseTime=true +security: + ca-validity: 30 * 24 * 60 * 60 * 1000 + cert-validity: 1 * 60 * 60 * 1000 + enable-oidc-check: true + webhook-port: 30080 + webhook-allow-on-err: true +kube-config: + namespace: dubbo-system + service-name: dubbo-ca + in-pod-env: false + rest-config-qps: 50 + rest-config-burst: 100 +grpc-server: + plain-server-port: 30060 + secure-server-port: 30062 + debug-port: 30070 \ No newline at end of file diff --git a/pkg/traffic/cache/config_cache.go b/pkg/config/config.go similarity index 77% rename from pkg/traffic/cache/config_cache.go rename to pkg/config/config.go index dbbbb3ec5..9e5dab813 100644 --- a/pkg/traffic/cache/config_cache.go +++ b/pkg/config/config.go @@ -15,14 +15,16 @@ * limitations under the License. */ -package cache +package config -import "github.com/apache/dubbo-admin/pkg/admin/constant" +const ( + SanitizedValue = "*****" + conf = "./conf/admin.yml" + confPathKey = "ADMIN_CONFIG_PATH" + MockProviderConf = "./conf/mock_provider.yml" +) -var ConfigMap = make(map[string]string) - -func Init() { - ConfigMap[constant.TagRoute] = "" - ConfigMap[constant.ConditionRoute] = "" - ConfigMap[constant.DynamicKey] = "" +type Config interface { + Sanitize() + Validate() error } diff --git a/pkg/config/display.go b/pkg/config/display.go new file mode 100644 index 000000000..5010cb2bd --- /dev/null +++ b/pkg/config/display.go @@ -0,0 +1,62 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package config + +import ( + "encoding/json" + "os" + "reflect" + + "gopkg.in/yaml.v2" +) + +func ConfigForDisplay(cfg Config) (Config, error) { + // copy config so we don't override values, because nested structs in config are pointers + newCfg, err := copyConfig(cfg) + if err != nil { + return nil, err + } + newCfg.Sanitize() + return newCfg, nil +} + +func copyConfig(cfg Config) (Config, error) { + cfgBytes, err := json.Marshal(cfg) + if err != nil { + return nil, err + } + + newCfg := reflect.New(reflect.TypeOf(cfg).Elem()).Interface().(Config) + if err := json.Unmarshal(cfgBytes, newCfg); err != nil { + return nil, err + } + return newCfg, nil +} + +func DumpToFile(filename string, cfg Config) error { + if err := cfg.Validate(); err != nil { + return err + } + + b, err := yaml.Marshal(cfg) + if err != nil { + return err + } + + return os.WriteFile(filename, b, 0666) +} diff --git a/pkg/traffic/internal/watchserver/watch_test.go b/pkg/config/kube/config.go similarity index 62% rename from pkg/traffic/internal/watchserver/watch_test.go rename to pkg/config/kube/config.go index 5e77d337f..9cd4a6d75 100644 --- a/pkg/traffic/internal/watchserver/watch_test.go +++ b/pkg/config/kube/config.go @@ -15,22 +15,23 @@ * limitations under the License. */ -package watchserver +package kube -import ( - "testing" +type KubeConfig struct { + Namespace string `yaml:"namespace"` + ServiceName string `yaml:"service-name"` - "github.com/apache/dubbo-admin/pkg/admin/constant" - "github.com/apache/dubbo-admin/pkg/traffic/cache" -) + InPodEnv bool `yaml:"in-pod-env"` + IsKubernetesConnected bool `yaml:"is-kubernetes-connected"` + // Qps for rest config + RestConfigQps int `yaml:"rest-config-qps"` + // Burst for rest config + RestConfigBurst int `yaml:"rest-config-burst"` +} + +func (o *KubeConfig) Sanitize() {} -func TestGetCache(t *testing.T) { - cache.ConfigMap[constant.TagRoute] = "Test Get Rule" - defer func() { - cache.ConfigMap[constant.TagRoute] = "" - }() - s := cache.ConfigMap[constant.TagRoute] - if s != "Test Get Rule" { - t.Errorf("GetCache error") - } +func (o *KubeConfig) Validate() error { + // TODO Validate options config + return nil } diff --git a/pkg/config/loader.go b/pkg/config/loader.go new file mode 100644 index 000000000..55a8c8ccc --- /dev/null +++ b/pkg/config/loader.go @@ -0,0 +1,62 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package config + +import ( + "github.com/apache/dubbo-admin/pkg/core/logger" + "os" + + "github.com/pkg/errors" + "gopkg.in/yaml.v2" + "path/filepath" +) + +func Load(file string, cfg Config) error { + return LoadWithOption(file, cfg, true) +} + +func LoadWithOption(file string, cfg Config, validate bool) error { + if file == "" { + file = conf + if envPath := os.Getenv(confPathKey); envPath != "" { + file = envPath + } + } + path, err := filepath.Abs(file) + if err != nil { + path = filepath.Clean(file) + } + if _, err := os.Stat(file); err != nil { + return errors.Errorf("Failed to access configuration file %q", file) + } + content, err := os.ReadFile(path) + if err != nil { + panic(err) + } + err = yaml.Unmarshal(content, cfg) + if err != nil { + logger.Errorf("Invalid configuration: \n %s", content) + panic(err) + } + if validate { + if err := cfg.Validate(); err != nil { + return errors.Wrapf(err, "Invalid configuration") + } + } + return nil +} diff --git a/pkg/config/security/config.go b/pkg/config/security/config.go new file mode 100644 index 000000000..359f42c12 --- /dev/null +++ b/pkg/config/security/config.go @@ -0,0 +1,35 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package security + +type SecurityConfig struct { + CaValidity int64 `yaml:"ca-validity"` + CertValidity int64 `yaml:"cert-validity"` + IsTrustAnyone bool `yaml:"is-trust-anyone"` + EnableOIDCCheck bool `yaml:"enable-oidc-check"` + ResourcelockIdentity string `yaml:"resourcelock-identity"` + WebhookPort int32 `yaml:"webhook-port"` + WebhookAllowOnErr bool `yaml:"webhook-allow-on-err"` +} + +func (o *SecurityConfig) Sanitize() {} + +func (o *SecurityConfig) Validate() error { + // TODO Validate options config + return nil +} diff --git a/pkg/traffic/client/config.go b/pkg/config/server/config.go similarity index 72% rename from pkg/traffic/client/config.go rename to pkg/config/server/config.go index b91b6a87b..dcbbf0ffd 100644 --- a/pkg/traffic/client/config.go +++ b/pkg/config/server/config.go @@ -15,16 +15,17 @@ * limitations under the License. */ -package client +package server -import ( - "context" -) +type ServerConfig struct { + PlainServerPort int `yaml:"plain-cp-server-port"` + SecureServerPort int `yaml:"secure-cp-server-port"` + DebugPort int `yaml:"debug-port"` +} -type Config struct { - Endpoints string `json:"endpoints"` +func (s *ServerConfig) Sanitize() {} - // Context is the default client context; it can be used to cancel grpc dial out and - // other operations that do not have an explicit context. - Context context.Context +func (s *ServerConfig) Validate() error { + // TODO Validate ServerConfig + return nil } diff --git a/pkg/config/util.go b/pkg/config/util.go new file mode 100644 index 000000000..9ae2e4aae --- /dev/null +++ b/pkg/config/util.go @@ -0,0 +1,98 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package config + +import ( + "crypto/rand" + "encoding/base32" + "fmt" + "os" + "sigs.k8s.io/yaml" + "strconv" +) + +func FromYAML(content []byte, cfg Config) error { + return yaml.Unmarshal(content, cfg) +} + +func ToYAML(cfg Config) ([]byte, error) { + return yaml.Marshal(cfg) +} + +// ToJson converts through YAML, because we only have `yaml` tags on Config. +// This JSON cannot be parsed by json.Unmarshal because durations are marshaled by yaml to pretty form like "1s". +// To change it to simple json.Marshal we need to add `json` tag everywhere. +func ToJson(cfg Config) ([]byte, error) { + yamlBytes, err := ToYAML(cfg) + if err != nil { + return nil, err + } + // there is no easy way to convert yaml to json using gopkg.in/yaml.v2 + return yaml.YAMLToJSON(yamlBytes) +} + +func GetStringEnv(name string, defvalue string) string { + val, ex := os.LookupEnv(name) + if ex { + return val + } else { + return defvalue + } +} + +func GetIntEnv(name string, defvalue int) int { + val, ex := os.LookupEnv(name) + if ex { + num, err := strconv.Atoi(val) + if err != nil { + return defvalue + } else { + return num + } + } else { + return defvalue + } +} + +func GetBoolEnv(name string, defvalue bool) bool { + val, ex := os.LookupEnv(name) + if ex { + boolVal, err := strconv.ParseBool(val) + if err != nil { + return defvalue + } else { + return boolVal + } + } else { + return defvalue + } +} + +func GetDefaultResourcelockIdentity() string { + hostname, err := os.Hostname() + if err != nil { + panic(err) + } + randomBytes := make([]byte, 5) + _, err = rand.Read(randomBytes) + if err != nil { + panic(err) + } + randomStr := base32.StdEncoding.EncodeToString(randomBytes) + return fmt.Sprintf("%s-%s", hostname, randomStr) +} diff --git a/pkg/core/alias.go b/pkg/core/alias.go old mode 100755 new mode 100644 index 426b67f94..469ce6870 --- a/pkg/core/alias.go +++ b/pkg/core/alias.go @@ -1,23 +1,32 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package core import ( "context" + "github.com/apache/dubbo-admin/pkg/core/logger" + "github.com/google/uuid" "os" "os/signal" "syscall" - "time" - - "github.com/google/uuid" - kube_log "sigs.k8s.io/controller-runtime/pkg/log" ) var ( - // TODO remove dependency on kubernetes see: https://github.com/kumahq/kuma/issues/2798 - Log = kube_log.Log - SetLogger = kube_log.SetLogger - Now = time.Now - TempDir = os.TempDir - SetupSignalHandler = func() (context.Context, context.Context) { gracefulCtx, gracefulCancel := context.WithCancel(context.Background()) ctx, cancel := context.WithCancel(context.Background()) @@ -25,13 +34,13 @@ var ( signal.Notify(c, syscall.SIGINT, syscall.SIGTERM) go func() { s := <-c - Log.Info("Received signal, stopping instance gracefully", "signal", s.String()) + logger.Sugar().Info("Received signal, stopping instance gracefully", "signal", s.String()) gracefulCancel() s = <-c - Log.Info("Received second signal, stopping instance", "signal", s.String()) + logger.Sugar().Info("Received second signal, stopping instance", "signal", s.String()) cancel() s = <-c - Log.Info("Received third signal, force exit", "signal", s.String()) + logger.Sugar().Info("Received third signal, force exit", "signal", s.String()) os.Exit(1) }() return gracefulCtx, ctx diff --git a/pkg/core/bootstrap/bootstrap.go b/pkg/core/bootstrap/bootstrap.go new file mode 100644 index 000000000..2010501c0 --- /dev/null +++ b/pkg/core/bootstrap/bootstrap.go @@ -0,0 +1,146 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package bootstrap + +import ( + "context" + dubbo_cp "github.com/apache/dubbo-admin/pkg/config/app/dubbo-cp" + "github.com/apache/dubbo-admin/pkg/core/cert/provider" + "github.com/apache/dubbo-admin/pkg/core/election/kube" + "github.com/apache/dubbo-admin/pkg/core/logger" + core_runtime "github.com/apache/dubbo-admin/pkg/core/runtime" + "github.com/apache/dubbo-admin/pkg/core/runtime/component" + "github.com/apache/dubbo-admin/pkg/cp-server/server" +) + +func buildRuntime(appCtx context.Context, cfg *dubbo_cp.Config) (core_runtime.Runtime, error) { + builder, err := core_runtime.BuilderFor(appCtx, cfg) + if err != nil { + return nil, err + } + + if err := initKubuClient(cfg, builder); err != nil { + return nil, err + } + + if cfg.KubeConfig.IsKubernetesConnected == false { + rt, err := builder.Build() + if err != nil { + return nil, err + } + return rt, nil + } + + if err := initCertStorage(cfg, builder); err != nil { + return nil, err + } + + if err := initGrpcServer(cfg, builder); err != nil { + return nil, err + } + + builder.WithComponentManager(component.NewManager(kube.NewLeaderElection(builder.Config().KubeConfig.Namespace, + builder.Config().KubeConfig.ServiceName, + "dubbo-cp-lock", + builder.KubuClient().GetKubClient()))) + rt, err := builder.Build() + if err != nil { + return nil, err + } + return rt, nil +} + +func Bootstrap(appCtx context.Context, cfg *dubbo_cp.Config) (core_runtime.Runtime, error) { + runtime, err := buildRuntime(appCtx, cfg) + if err != nil { + return nil, err + } + return runtime, nil +} + +func initKubuClient(cfg *dubbo_cp.Config, builder *core_runtime.Builder) error { + client := provider.NewClient() + if !client.Init(cfg) { + logger.Sugar().Warnf("Failed to connect to Kubernetes cluster. Will ignore OpenID Connect check.") + cfg.KubeConfig.IsKubernetesConnected = false + } else { + cfg.KubeConfig.IsKubernetesConnected = true + } + builder.WithKubuClient(client) + return nil +} + +func initCertStorage(cfg *dubbo_cp.Config, builder *core_runtime.Builder) error { + storage := provider.NewStorage(cfg, builder.KubuClient()) + loadRootCert() + loadAuthorityCert(storage, cfg, builder) + + storage.GetServerCert("localhost") + storage.GetServerCert("dubbo-ca." + storage.GetConfig().KubeConfig.Namespace + ".svc") + storage.GetServerCert("dubbo-ca." + storage.GetConfig().KubeConfig.Namespace + ".svc.cluster.local") + builder.WithCertStorage(storage) + return nil +} + +func loadRootCert() { + // TODO +} + +func loadAuthorityCert(storage provider.Storage, cfg *dubbo_cp.Config, builder *core_runtime.Builder) { + if cfg.KubeConfig.IsKubernetesConnected { + certStr, priStr := builder.KubuClient().GetAuthorityCert(cfg.KubeConfig.Namespace) + if certStr != "" && priStr != "" { + storage.GetAuthorityCert().Cert = provider.DecodeCert(certStr) + storage.GetAuthorityCert().CertPem = certStr + storage.GetAuthorityCert().PrivateKey = provider.DecodePrivateKey(priStr) + } + } + refreshAuthorityCert(storage, cfg) +} + +func refreshAuthorityCert(storage provider.Storage, cfg *dubbo_cp.Config) { + if storage.GetAuthorityCert().IsValid() { + logger.Sugar().Infof("Load authority cert from kubernetes secrect success.") + } else { + logger.Sugar().Warnf("Load authority cert from kubernetes secrect failed.") + storage.SetAuthorityCert(provider.GenerateAuthorityCert(storage.GetRootCert(), cfg.Security.CaValidity)) + + // TODO lock if multi cp-server + if storage.GetConfig().KubeConfig.IsKubernetesConnected { + storage.GetKubuClient().UpdateAuthorityCert(storage.GetAuthorityCert().CertPem, + provider.EncodePrivateKey(storage.GetAuthorityCert().PrivateKey), storage.GetConfig().KubeConfig.Namespace) + } + } + + if storage.GetConfig().KubeConfig.IsKubernetesConnected { + logger.Sugar().Info("Writing ca to config maps.") + if storage.GetKubuClient().UpdateAuthorityPublicKey(storage.GetAuthorityCert().CertPem) { + logger.Sugar().Info("Write ca to config maps success.") + } else { + logger.Sugar().Warnf("Write ca to config maps failed.") + } + } + + storage.AddTrustedCert(storage.GetAuthorityCert()) +} + +func initGrpcServer(cfg *dubbo_cp.Config, builder *core_runtime.Builder) error { + grpcServer := server.NewGrpcServer(builder.CertStorage(), cfg) + builder.WithGrpcServer(grpcServer) + return nil +} diff --git a/pkg/authority/election/leaderelection.go b/pkg/core/cert/provider/certelection.go similarity index 79% rename from pkg/authority/election/leaderelection.go rename to pkg/core/cert/provider/certelection.go index 83157f053..f8751ecd3 100644 --- a/pkg/authority/election/leaderelection.go +++ b/pkg/core/cert/provider/certelection.go @@ -12,14 +12,14 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -package election + +package provider import ( "context" + dubbo_cp "github.com/apache/dubbo-admin/pkg/config/app/dubbo-cp" "time" - "github.com/apache/dubbo-admin/pkg/authority/cert" - "github.com/apache/dubbo-admin/pkg/authority/config" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" "k8s.io/client-go/tools/leaderelection" @@ -27,7 +27,7 @@ import ( ) type LeaderElection interface { - Election(storage cert.Storage, options *config.Options, kubeClient *kubernetes.Clientset) error + Election(storage Storage, options *dubbo_cp.Config, kubeClient *kubernetes.Clientset) error } type leaderElectionImpl struct{} @@ -36,12 +36,12 @@ func NewleaderElection() LeaderElection { return &leaderElectionImpl{} } -func (c *leaderElectionImpl) Election(storage cert.Storage, options *config.Options, kubeClient *kubernetes.Clientset) error { - identity := options.ResourcelockIdentity +func (c *leaderElectionImpl) Election(storage Storage, options *dubbo_cp.Config, kubeClient *kubernetes.Clientset) error { + identity := options.Security.ResourcelockIdentity rlConfig := resourcelock.ResourceLockConfig{ Identity: identity, } - namespace := options.Namespace + namespace := options.KubeConfig.Namespace _, err := kubeClient.CoreV1().Namespaces().Get(context.TODO(), namespace, metav1.GetOptions{}) if err != nil { namespace = "default" @@ -58,8 +58,8 @@ func (c *leaderElectionImpl) Election(storage cert.Storage, options *config.Opti Callbacks: leaderelection.LeaderCallbacks{ // leader OnStartedLeading: func(ctx context.Context) { - // lock if multi server,refresh signed cert - storage.SetAuthorityCert(cert.GenerateAuthorityCert(storage.GetRootCert(), options.CaValidity)) + // lock if multi cp-server,refresh signed cert + storage.SetAuthorityCert(GenerateAuthorityCert(storage.GetRootCert(), options.Security.CaValidity)) }, // not leader OnStoppedLeading: func() { diff --git a/pkg/authority/k8s/client.go b/pkg/core/cert/provider/client.go similarity index 84% rename from pkg/authority/k8s/client.go rename to pkg/core/cert/provider/client.go index 489dbfafc..2eb0954f5 100644 --- a/pkg/authority/k8s/client.go +++ b/pkg/core/cert/provider/client.go @@ -13,25 +13,16 @@ // See the License for the specific language governing permissions and // limitations under the License. -package k8s +package provider import ( "context" "flag" - "os" - "path/filepath" - "reflect" - "strings" - "time" - - "github.com/apache/dubbo-admin/pkg/authority/cert" - "github.com/apache/dubbo-admin/pkg/authority/config" - infoemerclient "github.com/apache/dubbo-admin/pkg/authority/generated/clientset/versioned" - informers "github.com/apache/dubbo-admin/pkg/authority/generated/informers/externalversions" - "github.com/apache/dubbo-admin/pkg/authority/rule" - "github.com/apache/dubbo-admin/pkg/authority/rule/authentication" - "github.com/apache/dubbo-admin/pkg/authority/rule/authorization" - "github.com/apache/dubbo-admin/pkg/logger" + "github.com/apache/dubbo-admin/pkg/core/endpoint" + "github.com/apache/dubbo-admin/pkg/core/logger" + + dubbo_cp "github.com/apache/dubbo-admin/pkg/config/app/dubbo-cp" + informerclient "github.com/apache/dubbo-admin/pkg/rule/clientgen/clientset/versioned" admissionregistrationV1 "k8s.io/api/admissionregistration/v1" k8sauth "k8s.io/api/authentication/v1" v1 "k8s.io/api/core/v1" @@ -41,6 +32,10 @@ import ( "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" "k8s.io/client-go/util/homedir" + "os" + "path/filepath" + "reflect" + "strings" ) var kubeconfig string @@ -51,31 +46,31 @@ func init() { } type Client interface { - Init(options *config.Options) bool + Init(options *dubbo_cp.Config) bool GetAuthorityCert(namespace string) (string, string) UpdateAuthorityCert(cert string, pri string, namespace string) UpdateAuthorityPublicKey(cert string) bool - VerifyServiceAccount(token string, authorizationType string) (*rule.Endpoint, bool) - UpdateWebhookConfig(options *config.Options, storage cert.Storage) + VerifyServiceAccount(token string, authorizationType string) (*endpoint.Endpoint, bool) + UpdateWebhookConfig(options *dubbo_cp.Config, storage Storage) GetNamespaceLabels(namespace string) map[string]string - InitController(paHandler authentication.Handler, apHandler authorization.Handler) GetKubClient() *kubernetes.Clientset + GetInformerClient() *informerclient.Clientset } type ClientImpl struct { - options *config.Options + options *dubbo_cp.Config kubeClient *kubernetes.Clientset - informerClient *infoemerclient.Clientset + informerClient *informerclient.Clientset } func NewClient() Client { return &ClientImpl{} } -func (c *ClientImpl) Init(options *config.Options) bool { +func (c *ClientImpl) Init(options *dubbo_cp.Config) bool { c.options = options config, err := rest.InClusterConfig() - options.InPodEnv = err == nil + options.KubeConfig.InPodEnv = err == nil if err != nil { logger.Sugar().Infof("Failed to load config from Pod. Will fall back to kube config file.") // Read kubeconfig from command line @@ -99,17 +94,17 @@ func (c *ClientImpl) Init(options *config.Options) bool { } // set qps and burst for rest config - config.QPS = float32(c.options.RestConfigQps) - config.Burst = c.options.RestConfigBurst + config.QPS = float32(c.options.KubeConfig.RestConfigQps) + config.Burst = c.options.KubeConfig.RestConfigBurst // creates the clientset clientSet, err := kubernetes.NewForConfig(config) if err != nil { - logger.Sugar().Warnf("Failed to create client to kubernetes. " + err.Error()) + logger.Sugar().Warnf("Failed to create clientgen to kubernetes. " + err.Error()) return false } - informerClient, err := infoemerclient.NewForConfig(config) + informerClient, err := informerclient.NewForConfig(config) if err != nil { - logger.Sugar().Warnf("Failed to create client to kubernetes. " + err.Error()) + logger.Sugar().Warnf("Failed to create clientgen to kubernetes. " + err.Error()) return false } c.kubeClient = clientSet @@ -214,7 +209,7 @@ func (c *ClientImpl) GetNamespaceLabels(namespace string) map[string]string { return map[string]string{} } -func (c *ClientImpl) VerifyServiceAccount(token string, authorizationType string) (*rule.Endpoint, bool) { +func (c *ClientImpl) VerifyServiceAccount(token string, authorizationType string) (*endpoint.Endpoint, bool) { var tokenReview *k8sauth.TokenReview if authorizationType == "dubbo-ca-token" { tokenReview = &k8sauth.TokenReview{ @@ -269,7 +264,7 @@ func (c *ClientImpl) VerifyServiceAccount(token string, authorizationType string return nil, false } - e := &rule.Endpoint{} + e := &endpoint.Endpoint{} e.ID = string(pod.UID) for _, i := range pod.Status.PodIPs { @@ -287,7 +282,7 @@ func (c *ClientImpl) VerifyServiceAccount(token string, authorizationType string } } - e.KubernetesEnv = &rule.KubernetesEnv{ + e.KubernetesEnv = &endpoint.KubernetesEnv{ Namespace: pod.Namespace, PodName: pod.Name, PodLabels: pod.Labels, @@ -297,7 +292,7 @@ func (c *ClientImpl) VerifyServiceAccount(token string, authorizationType string return e, true } -func (c *ClientImpl) UpdateWebhookConfig(options *config.Options, storage cert.Storage) { +func (c *ClientImpl) UpdateWebhookConfig(options *dubbo_cp.Config, storage Storage) { path := "/mutating-services" failurePolicy := admissionregistrationV1.Ignore sideEffects := admissionregistrationV1.SideEffectClassNone @@ -314,9 +309,9 @@ func (c *ClientImpl) UpdateWebhookConfig(options *config.Options, storage cert.S Name: "dubbo-ca" + ".k8s.io", ClientConfig: admissionregistrationV1.WebhookClientConfig{ Service: &admissionregistrationV1.ServiceReference{ - Name: options.ServiceName, - Namespace: options.Namespace, - Port: &options.WebhookPort, + Name: options.KubeConfig.ServiceName, + Namespace: options.KubeConfig.Namespace, + Port: &options.Security.WebhookPort, Path: &path, }, CABundle: []byte(bundle), @@ -373,26 +368,10 @@ func (c *ClientImpl) UpdateWebhookConfig(options *config.Options, storage cert.S } } -func (c *ClientImpl) InitController( - authenticationHandler authentication.Handler, - authorizationHandler authorization.Handler, -) { - logger.Sugar().Info("Init rule controller...") - - informerFactory := informers.NewSharedInformerFactory(c.informerClient, time.Second*30) - - stopCh := make(chan struct{}) - controller := NewController(c.informerClient, - c.options.Namespace, - authenticationHandler, - authorizationHandler, - informerFactory.Dubbo().V1beta1().AuthenticationPolicies(), - informerFactory.Dubbo().V1beta1().AuthorizationPolicies()) - informerFactory.Start(stopCh) - - controller.WaitSynced() -} - func (c *ClientImpl) GetKubClient() *kubernetes.Clientset { return c.kubeClient } + +func (c *ClientImpl) GetInformerClient() *informerclient.Clientset { + return c.informerClient +} diff --git a/pkg/authority/cert/storage.go b/pkg/core/cert/provider/storage.go similarity index 67% rename from pkg/authority/cert/storage.go rename to pkg/core/cert/provider/storage.go index 31c8bd4e2..dd5f1dcaa 100644 --- a/pkg/authority/cert/storage.go +++ b/pkg/core/cert/provider/storage.go @@ -13,30 +13,26 @@ // See the License for the specific language governing permissions and // limitations under the License. -package cert +package provider import ( "crypto/ecdsa" "crypto/tls" "crypto/x509" + dubbo_cp "github.com/apache/dubbo-admin/pkg/config/app/dubbo-cp" + "github.com/apache/dubbo-admin/pkg/core/logger" "math" - "os" "reflect" "sync" "time" - - "github.com/apache/dubbo-admin/pkg/authority/config" - "github.com/apache/dubbo-admin/pkg/logger" ) type storageImpl struct { - Storage + config *dubbo_cp.Config - mutex *sync.Mutex - stopChan chan os.Signal + kubuClient Client - caValidity int64 - certValidity int64 + mutex *sync.Mutex rootCert *Cert authorityCert *Cert @@ -48,7 +44,7 @@ type storageImpl struct { type Storage interface { GetServerCert(serverName string) *tls.Certificate - RefreshServerCert() + RefreshServerCert(<-chan struct{}) SetAuthorityCert(*Cert) GetAuthorityCert() *Cert @@ -59,7 +55,49 @@ type Storage interface { AddTrustedCert(*Cert) GetTrustedCerts() []*Cert - GetStopChan() chan os.Signal + GetConfig() *dubbo_cp.Config + GetKubuClient() Client + + Start(stop <-chan struct{}) error + NeedLeaderElection() bool +} + +func (s storageImpl) Start(stop <-chan struct{}) error { + go s.RefreshServerCert(stop) + go func(stop <-chan struct{}) { + interval := math.Min(math.Floor(float64(s.config.Security.CaValidity)/100), 10_000) + for { + time.Sleep(time.Duration(interval) * time.Millisecond) + if s.GetAuthorityCert().NeedRefresh() { + logger.Sugar().Infof("Authority cert is invalid, refresh it.") + // TODO lock if multi cp-server + // TODO refresh signed cert + + NewleaderElection().Election(&s, s.config, s.kubuClient.GetKubClient()) + if s.config.KubeConfig.IsKubernetesConnected { + s.kubuClient.UpdateAuthorityCert(s.GetAuthorityCert().CertPem, EncodePrivateKey(s.GetAuthorityCert().PrivateKey), s.config.KubeConfig.Namespace) + s.kubuClient.UpdateWebhookConfig(s.config, &s) + if s.kubuClient.UpdateAuthorityPublicKey(s.GetAuthorityCert().CertPem) { + logger.Sugar().Infof("Write ca to config maps success.") + } else { + logger.Sugar().Warnf("Write ca to config maps failed.") + } + } + } + + select { + case <-stop: + return + default: + continue + } + } + }(stop) + return nil +} + +func (s storageImpl) NeedLeaderElection() bool { + return false } type Cert struct { @@ -70,15 +108,14 @@ type Cert struct { tlsCert *tls.Certificate } -func NewStorage(options *config.Options) *storageImpl { +func NewStorage(options *dubbo_cp.Config, kubuClient Client) *storageImpl { return &storageImpl{ - mutex: &sync.Mutex{}, - stopChan: make(chan os.Signal, 1), + mutex: &sync.Mutex{}, authorityCert: &Cert{}, trustedCerts: []*Cert{}, - certValidity: options.CertValidity, - caValidity: options.CaValidity, + config: options, + kubuClient: kubuClient, } } @@ -131,32 +168,11 @@ func (c *Cert) GetTlsCert() *tls.Certificate { return c.tlsCert } -func (s *storageImpl) GetServerCert(serverName string) *tls.Certificate { - nameSigned := serverName == "" - for _, name := range s.serverNames { - if name == serverName { - nameSigned = true - break - } - } - if nameSigned && s.serverCerts != nil && s.serverCerts.IsValid() { - return s.serverCerts.GetTlsCert() - } - s.mutex.Lock() - defer s.mutex.Unlock() - if !nameSigned { - s.serverNames = append(s.serverNames, serverName) - } - - s.serverCerts = SignServerCert(s.authorityCert, s.serverNames, s.certValidity) - return s.serverCerts.GetTlsCert() -} - -func (s *storageImpl) RefreshServerCert() { - interval := math.Min(math.Floor(float64(s.certValidity)/100), 10_000) +func (s *storageImpl) RefreshServerCert(stop <-chan struct{}) { + interval := math.Min(math.Floor(float64(s.config.Security.CertValidity)/100), 10_000) for true { select { - case <-s.stopChan: + case <-stop: return default: } @@ -171,12 +187,33 @@ func (s *storageImpl) RefreshServerCert() { } if s.serverCerts == nil || !s.serverCerts.IsValid() { logger.Sugar().Infof("Server cert is invalid, refresh it.") - s.serverCerts = SignServerCert(s.authorityCert, s.serverNames, s.certValidity) + s.serverCerts = SignServerCert(s.authorityCert, s.serverNames, s.config.Security.CertValidity) } }() } } +func (s *storageImpl) GetServerCert(serverName string) *tls.Certificate { + nameSigned := serverName == "" + for _, name := range s.serverNames { + if name == serverName { + nameSigned = true + break + } + } + if nameSigned && s.serverCerts != nil && s.serverCerts.IsValid() { + return s.serverCerts.GetTlsCert() + } + s.mutex.Lock() + defer s.mutex.Unlock() + if !nameSigned { + s.serverNames = append(s.serverNames, serverName) + } + + s.serverCerts = SignServerCert(s.authorityCert, s.serverNames, s.config.Security.CertValidity) + return s.serverCerts.GetTlsCert() +} + func (s *storageImpl) SetAuthorityCert(cert *Cert) { s.authorityCert = cert } @@ -201,6 +238,10 @@ func (s *storageImpl) GetTrustedCerts() []*Cert { return s.trustedCerts } -func (s *storageImpl) GetStopChan() chan os.Signal { - return s.stopChan +func (s *storageImpl) GetConfig() *dubbo_cp.Config { + return s.config +} + +func (s *storageImpl) GetKubuClient() Client { + return s.kubuClient } diff --git a/pkg/authority/cert/util.go b/pkg/core/cert/provider/util.go similarity index 95% rename from pkg/authority/cert/util.go rename to pkg/core/cert/provider/util.go index d7d5eb8a2..d7a464848 100644 --- a/pkg/authority/cert/util.go +++ b/pkg/core/cert/provider/util.go @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package cert +package provider import ( "bytes" @@ -24,13 +24,12 @@ import ( "crypto/x509/pkix" "encoding/asn1" "encoding/pem" + "github.com/apache/dubbo-admin/pkg/core/endpoint" + "github.com/apache/dubbo-admin/pkg/core/logger" "log" "math/big" "net/url" "time" - - "github.com/apache/dubbo-admin/pkg/authority/rule" - "github.com/apache/dubbo-admin/pkg/logger" ) const ( @@ -201,7 +200,7 @@ func LoadCSR(csrString string) (*x509.CertificateRequest, error) { return csr, nil } -func SignFromCSR(csr *x509.CertificateRequest, endpoint *rule.Endpoint, authorityCert *Cert, certValidity int64) (string, error) { +func SignFromCSR(csr *x509.CertificateRequest, endpoint *endpoint.Endpoint, authorityCert *Cert, certValidity int64) (string, error) { csrTemplate := &x509.Certificate{ PublicKeyAlgorithm: csr.PublicKeyAlgorithm, PublicKey: csr.PublicKey, @@ -237,7 +236,7 @@ func SignFromCSR(csr *x509.CertificateRequest, endpoint *rule.Endpoint, authorit return cert, nil } -func AppendEndpoint(endpoint *rule.Endpoint, cert *x509.Certificate) { +func AppendEndpoint(endpoint *endpoint.Endpoint, cert *x509.Certificate) { if endpoint.ID != "" { cert.Subject.CommonName = endpoint.ID } diff --git a/pkg/authority/cert/util_test.go b/pkg/core/cert/provider/util_test.go similarity index 94% rename from pkg/authority/cert/util_test.go rename to pkg/core/cert/provider/util_test.go index 5a2c4605d..660fa507a 100644 --- a/pkg/authority/cert/util_test.go +++ b/pkg/core/cert/provider/util_test.go @@ -13,19 +13,18 @@ // See the License for the specific language governing permissions and // limitations under the License. -package cert +package provider import ( "bytes" "crypto/ecdsa" "encoding/pem" + "github.com/apache/dubbo-admin/pkg/core/endpoint" + "github.com/apache/dubbo-admin/pkg/core/logger" "net/url" "testing" - "github.com/apache/dubbo-admin/pkg/authority/rule" "github.com/stretchr/testify/assert" - - "github.com/apache/dubbo-admin/pkg/logger" ) func TestCSR(t *testing.T) { @@ -45,7 +44,7 @@ func TestCSR(t *testing.T) { cert := GenerateAuthorityCert(nil, 365*24*60*60*1000) - target, err := SignFromCSR(request, &rule.Endpoint{SpiffeID: "spiffe://cluster.local"}, cert, 365*24*60*60*1000) + target, err := SignFromCSR(request, &endpoint.Endpoint{SpiffeID: "spiffe://cluster.local"}, cert, 365*24*60*60*1000) if err != nil { t.Fatal(err) return @@ -67,7 +66,7 @@ func TestCSR(t *testing.T) { assert.Equal(t, 1, len(certificate.URIs)) assert.Equal(t, &url.URL{Scheme: "spiffe", Host: "cluster.local"}, certificate.URIs[0]) - target, err = SignFromCSR(request, &rule.Endpoint{SpiffeID: "://"}, cert, 365*24*60*60*1000) + target, err = SignFromCSR(request, &endpoint.Endpoint{SpiffeID: "://"}, cert, 365*24*60*60*1000) assert.Nil(t, err) certificate = DecodeCert(target) diff --git a/pkg/authority/rule/rule.go b/pkg/core/cert/setup.go similarity index 73% rename from pkg/authority/rule/rule.go rename to pkg/core/cert/setup.go index df9a1fdb4..995768d05 100644 --- a/pkg/authority/rule/rule.go +++ b/pkg/core/cert/setup.go @@ -13,16 +13,16 @@ // See the License for the specific language governing permissions and // limitations under the License. -package rule +package cert -type ToClient interface { - Type() string - Revision() int64 - Data() string -} +import ( + core_runtime "github.com/apache/dubbo-admin/pkg/core/runtime" + "github.com/pkg/errors" +) -type Origin interface { - Type() string - Revision() int64 - Exact(endpoint *Endpoint) (ToClient, error) +func Setup(rt core_runtime.Runtime) error { + if err := rt.Add(rt.CertStorage()); err != nil { + return errors.Wrap(err, "Add CertStorage recurring event failed") + } + return nil } diff --git a/pkg/core/cmd/helpers.go b/pkg/core/cmd/helpers.go old mode 100755 new mode 100644 index d6ff11701..0b710d309 --- a/pkg/core/cmd/helpers.go +++ b/pkg/core/cmd/helpers.go @@ -1,3 +1,20 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package cmd import ( diff --git a/pkg/core/cmd/util.go b/pkg/core/cmd/util.go old mode 100755 new mode 100644 index 7b79464d8..1dce94c49 --- a/pkg/core/cmd/util.go +++ b/pkg/core/cmd/util.go @@ -1,3 +1,20 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package cmd import ( diff --git a/pkg/version/version.go b/pkg/core/cmd/version/version.go similarity index 99% rename from pkg/version/version.go rename to pkg/core/cmd/version/version.go index 73c9451d4..641aabcb5 100644 --- a/pkg/version/version.go +++ b/pkg/core/cmd/version/version.go @@ -20,8 +20,9 @@ package version import ( "encoding/json" "fmt" - "github.com/spf13/cobra" "runtime" + + "github.com/spf13/cobra" ) var ( diff --git a/pkg/core/election/kube/leaderelection.go b/pkg/core/election/kube/leaderelection.go new file mode 100644 index 000000000..05ba31a26 --- /dev/null +++ b/pkg/core/election/kube/leaderelection.go @@ -0,0 +1,155 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package kube + +import ( + "context" + "github.com/apache/dubbo-admin/pkg/core/logger" + "github.com/apache/dubbo-admin/pkg/core/runtime/component" + "go.uber.org/atomic" + "k8s.io/client-go/kubernetes" + "k8s.io/client-go/tools/leaderelection" + "k8s.io/client-go/tools/leaderelection/resourcelock" + syncatomic "sync/atomic" + "time" +) + +const ( + backoffTime = time.Millisecond +) + +type LeaderElection struct { + leader int32 + namespace string + name string + callbacks []component.LeaderCallbacks + client kubernetes.Interface + ttl time.Duration + + // Records which "cycle" the election is on. This is incremented each time an election is won and then lost + // This is mostly just for testing + cycle *atomic.Int32 + electionID string +} + +// Start will start leader election, calling all runFns when we become the leader. +func (l *LeaderElection) Start(stop <-chan struct{}) { + logger.Sugar().Info("starting Leader Elector") + for { + le, err := l.create() + if err != nil { + // This should never happen; errors are only from invalid input and the input is not user modifiable + panic("LeaderElection creation failed: " + err.Error()) + } + l.cycle.Inc() + ctx, cancel := context.WithCancel(context.Background()) + go func() { + <-stop + cancel() + }() + le.Run(ctx) + select { + case <-stop: + // We were told to stop explicitly. Exit now + return + default: + cancel() + // Otherwise, we may have lost our lock. In practice, this is extremely rare; we need to have the lock, then lose it + // Typically this means something went wrong, such as API server downtime, etc + // If this does happen, we will start the cycle over again + logger.Sugar().Errorf("Leader election cycle %v lost. Trying again", l.cycle.Load()) + } + } + logger.Sugar().Info("Leader Elector stopped") +} + +func (l *LeaderElection) create() (*leaderelection.LeaderElector, error) { + callbacks := leaderelection.LeaderCallbacks{ + OnStartedLeading: func(ctx context.Context) { + l.setLeader(true) + for _, f := range l.callbacks { + if f.OnStartedLeading != nil { + go f.OnStartedLeading() + } + } + }, + OnStoppedLeading: func() { + logger.Sugar().Infof("leader election lock lost: %v", l.electionID) + l.setLeader(false) + for _, f := range l.callbacks { + if f.OnStoppedLeading != nil { + go f.OnStoppedLeading() + } + } + }, + } + lock, err := resourcelock.New(resourcelock.ConfigMapsLeasesResourceLock, + l.namespace, + l.electionID, + l.client.CoreV1(), + l.client.CoordinationV1(), + resourcelock.ResourceLockConfig{ + Identity: l.name, + }, + ) + if err != nil { + return nil, err + } + return leaderelection.NewLeaderElector(leaderelection.LeaderElectionConfig{ + Lock: lock, + LeaseDuration: l.ttl, + RenewDeadline: l.ttl / 2, + RetryPeriod: l.ttl / 4, + Callbacks: callbacks, + // When exits, the lease will be dropped. This is more likely to lead to a case where + // to instances are both considered the leaders. As such, if this is intended to be use for mission-critical + // usages (rather than avoiding duplication of work), this may need to be re-evaluated. + ReleaseOnCancel: true, + }) +} + +func (p *LeaderElection) AddCallbacks(callbacks component.LeaderCallbacks) { + p.callbacks = append(p.callbacks, callbacks) +} + +func (p *LeaderElection) IsLeader() bool { + return syncatomic.LoadInt32(&(p.leader)) == 1 +} + +func (p *LeaderElection) setLeader(leader bool) { + var value int32 = 0 + if leader { + value = 1 + } + syncatomic.StoreInt32(&p.leader, value) +} + +func NewLeaderElection(namespace, name, electionID string, client kubernetes.Interface) *LeaderElection { + if name == "" { + name = "unknown" + } + return &LeaderElection{ + namespace: namespace, + name: name, + electionID: electionID, + client: client, + // Default to a 30s ttl. Overridable for tests + ttl: time.Second * 30, + cycle: atomic.NewInt32(0), + } +} diff --git a/pkg/core/election/kube/leaderelection_test.go b/pkg/core/election/kube/leaderelection_test.go new file mode 100644 index 000000000..c5369029c --- /dev/null +++ b/pkg/core/election/kube/leaderelection_test.go @@ -0,0 +1,142 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package kube + +import ( + "context" + "fmt" + "github.com/apache/dubbo-admin/pkg/core/runtime/component" + "github.com/apache/dubbo-admin/test/util/retry" + "testing" + "time" + + "go.uber.org/atomic" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/client-go/kubernetes" + "k8s.io/client-go/kubernetes/fake" + k8stesting "k8s.io/client-go/testing" +) + +const testLock = "test-lock" + +func createElection(t *testing.T, name string, expectLeader bool, client kubernetes.Interface, + fns ...component.LeaderCallbacks) (*LeaderElection, chan struct{}) { + t.Helper() + l := NewLeaderElection("ns", name, testLock, client) + l.ttl = time.Second + gotLeader := make(chan struct{}) + l.AddCallbacks(component.LeaderCallbacks{OnStartedLeading: func() { + gotLeader <- struct{}{} + }}) + for _, fn := range fns { + l.AddCallbacks(fn) + } + stop := make(chan struct{}) + go l.Start(stop) + + if expectLeader { + select { + case <-gotLeader: + case <-time.After(time.Second * 15): + t.Fatal("failed to acquire lease") + } + } else { + select { + case <-gotLeader: + t.Fatal("unexpectedly acquired lease") + case <-time.After(time.Second * 1): + } + } + return l, stop +} + +func TestLeaderElection(t *testing.T) { + client := fake.NewSimpleClientset() + // First pod becomes the leader + _, stop := createElection(t, "pod1", true, client) + // A new pod is not the leader + _, stop2 := createElection(t, "pod2", false, client) + // The first pod exists, now the new pod becomes the leader + close(stop2) + close(stop) + _, _ = createElection(t, "pod2", true, client) +} + +func TestLeaderElectionConfigMapRemoved(t *testing.T) { + client := fake.NewSimpleClientset() + _, stop := createElection(t, "pod1", true, client) + if err := client.CoreV1().ConfigMaps("ns").Delete(context.TODO(), testLock, v1.DeleteOptions{}); err != nil { + t.Fatal(err) + } + retry.UntilSuccessOrFail(t, func() error { + l, err := client.CoreV1().ConfigMaps("ns").List(context.TODO(), v1.ListOptions{}) + if err != nil { + return err + } + if len(l.Items) != 1 { + return fmt.Errorf("got unexpected config map entry: %v", l.Items) + } + return nil + }) + close(stop) +} + +func TestLeaderElectionNoPermission(t *testing.T) { + client := fake.NewSimpleClientset() + allowRbac := atomic.NewBool(true) + client.Fake.PrependReactor("update", "*", func(action k8stesting.Action) (bool, runtime.Object, error) { + if allowRbac.Load() { + return false, nil, nil + } + return true, nil, fmt.Errorf("nope, out of luck") + }) + + completions := atomic.NewInt32(0) + l, stop := createElection(t, "pod1", true, client, component.LeaderCallbacks{OnStartedLeading: func() { + completions.Add(1) + }}) + // Expect to run once + expectInt(t, completions.Load, 1) + + // drop RBAC permssions to update the configmap + // This simulates loosing an active lease + allowRbac.Store(false) + + // We should start a new cycle at this point + expectInt(t, l.cycle.Load, 2) + + // Add configmap permission back + allowRbac.Store(true) + + // We should get the leader lock back + expectInt(t, completions.Load, 2) + + close(stop) +} + +func expectInt(t *testing.T, f func() int32, expected int32) { + t.Helper() + retry.UntilSuccessOrFail(t, func() error { + got := f() + if got != expected { + return fmt.Errorf("unexpected count: %v, want %v", got, expected) + } + return nil + }, retry.Timeout(time.Second)) +} diff --git a/pkg/authority/rule/endpoint.go b/pkg/core/endpoint/endpoint.go similarity index 96% rename from pkg/authority/rule/endpoint.go rename to pkg/core/endpoint/endpoint.go index 5822b9cbf..c3a027c23 100644 --- a/pkg/authority/rule/endpoint.go +++ b/pkg/core/endpoint/endpoint.go @@ -13,12 +13,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -package rule +package endpoint import ( "encoding/json" - - "github.com/apache/dubbo-admin/pkg/logger" + "github.com/apache/dubbo-admin/pkg/core/logger" ) type Endpoint struct { diff --git a/pkg/authority/rule/endpoint_test.go b/pkg/core/endpoint/endpoint_test.go similarity index 91% rename from pkg/authority/rule/endpoint_test.go rename to pkg/core/endpoint/endpoint_test.go index 0ed50d982..a5b0a1a0f 100644 --- a/pkg/authority/rule/endpoint_test.go +++ b/pkg/core/endpoint/endpoint_test.go @@ -13,20 +13,19 @@ // See the License for the specific language governing permissions and // limitations under the License. -package rule_test +package endpoint_test import ( + "github.com/apache/dubbo-admin/pkg/core/endpoint" "testing" "github.com/stretchr/testify/assert" - - "github.com/apache/dubbo-admin/pkg/authority/rule" ) func TestToString(t *testing.T) { t.Parallel() - endpoint := &rule.Endpoint{} + endpoint := &endpoint.Endpoint{} assert.Equal(t, "{}", endpoint.ToString()) diff --git a/pkg/authority/jwt/util.go b/pkg/core/jwt/util.go similarity index 100% rename from pkg/authority/jwt/util.go rename to pkg/core/jwt/util.go diff --git a/pkg/authority/jwt/util_test.go b/pkg/core/jwt/util_test.go similarity index 97% rename from pkg/authority/jwt/util_test.go rename to pkg/core/jwt/util_test.go index 31b9f6c42..ee93c09d5 100644 --- a/pkg/authority/jwt/util_test.go +++ b/pkg/core/jwt/util_test.go @@ -20,10 +20,10 @@ import ( "crypto/elliptic" "crypto/rand" "crypto/rsa" + "github.com/apache/dubbo-admin/pkg/core/jwt" "testing" "time" - "github.com/apache/dubbo-admin/pkg/authority/jwt" v4 "github.com/golang-jwt/jwt/v4" "github.com/stretchr/testify/assert" ) diff --git a/pkg/logger/log.go b/pkg/core/logger/log.go similarity index 100% rename from pkg/logger/log.go rename to pkg/core/logger/log.go diff --git a/pkg/logger/log_wrapper.go b/pkg/core/logger/log_wrapper.go similarity index 100% rename from pkg/logger/log_wrapper.go rename to pkg/core/logger/log_wrapper.go diff --git a/pkg/monitor/prometheus/metrics.go b/pkg/core/monitor/prometheus/metrics.go similarity index 97% rename from pkg/monitor/prometheus/metrics.go rename to pkg/core/monitor/prometheus/metrics.go index 837cd37fe..fa6575124 100644 --- a/pkg/monitor/prometheus/metrics.go +++ b/pkg/core/monitor/prometheus/metrics.go @@ -18,12 +18,11 @@ package prometheus import ( "context" "fmt" + "github.com/apache/dubbo-admin/pkg/core/logger" "time" prom_v1 "github.com/prometheus/client_golang/api/prometheus/v1" "github.com/prometheus/common/model" - - "github.com/apache/dubbo-admin/pkg/logger" ) func stitchingLabels(labels []string) string { diff --git a/pkg/monitor/prometheus/types.go b/pkg/core/monitor/prometheus/types.go similarity index 100% rename from pkg/monitor/prometheus/types.go rename to pkg/core/monitor/prometheus/types.go diff --git a/pkg/core/rule/server.go b/pkg/core/rule/server.go deleted file mode 100644 index 3c3d8210b..000000000 --- a/pkg/core/rule/server.go +++ /dev/null @@ -1,269 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one or more -// contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. -// The ASF licenses this file to You under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with -// the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package rule - -import ( - "crypto/tls" - "crypto/x509" - "log" - "math" - "net" - "os" - "strconv" - "time" - - "github.com/apache/dubbo-admin/pkg/authority/election" - - cert2 "github.com/apache/dubbo-admin/pkg/authority/cert" - "github.com/apache/dubbo-admin/pkg/authority/config" - "github.com/apache/dubbo-admin/pkg/authority/k8s" - "github.com/apache/dubbo-admin/pkg/authority/patch" - "github.com/apache/dubbo-admin/pkg/authority/rule/authentication" - "github.com/apache/dubbo-admin/pkg/authority/rule/authorization" - "github.com/apache/dubbo-admin/pkg/authority/rule/connection" - "github.com/apache/dubbo-admin/pkg/authority/v1alpha1" - "github.com/apache/dubbo-admin/pkg/authority/webhook" - "github.com/apache/dubbo-admin/pkg/logger" - "google.golang.org/grpc" - "google.golang.org/grpc/credentials" - "google.golang.org/grpc/reflection" -) - -type Server struct { - StopChan chan os.Signal - - Options *config.Options - CertStorage cert2.Storage - - ConnectionStorage *connection.Storage - AuthenticationHandler authentication.Handler - AuthorizationHandler authorization.Handler - - KubeClient k8s.Client - - CertificateServer *v1alpha1.AuthorityServiceImpl - ObserveServer *v1alpha1.RuleServiceImpl - PlainServer *grpc.Server - SecureServer *grpc.Server - - WebhookServer *webhook.Webhook - JavaInjector *patch.JavaSdk - Elec election.LeaderElection -} - -func NewServer(options *config.Options) *Server { - return &Server{ - Options: options, - StopChan: make(chan os.Signal, 1), - } -} - -func (s *Server) Init() { - // TODO bypass k8s work - if s.KubeClient == nil { - s.KubeClient = k8s.NewClient() - } - if !s.KubeClient.Init(s.Options) { - logger.Sugar().Warnf("Failed to connect to Kubernetes cluster. Will ignore OpenID Connect check.") - s.Options.IsKubernetesConnected = false - } else { - s.Options.IsKubernetesConnected = true - } - - if s.CertStorage == nil { - s.CertStorage = cert2.NewStorage(s.Options) - } - if s.Elec == nil { - s.Elec = election.NewleaderElection() - } - go s.CertStorage.RefreshServerCert() - - s.LoadRootCert() - s.LoadAuthorityCert() - - s.PlainServer = grpc.NewServer() - reflection.Register(s.PlainServer) - - pool := x509.NewCertPool() - tlsConfig := &tls.Config{ - GetCertificate: func(info *tls.ClientHelloInfo) (*tls.Certificate, error) { - for _, cert := range s.CertStorage.GetTrustedCerts() { - pool.AddCert(cert.Cert) - } - return s.CertStorage.GetServerCert(info.ServerName), nil - }, - ClientCAs: pool, - ClientAuth: tls.VerifyClientCertIfGiven, - } - - s.CertStorage.GetServerCert("localhost") - s.CertStorage.GetServerCert("dubbo-ca." + s.Options.Namespace + ".svc") - s.CertStorage.GetServerCert("dubbo-ca." + s.Options.Namespace + ".svc.cluster.local") - - s.SecureServer = grpc.NewServer(grpc.Creds(credentials.NewTLS(tlsConfig))) - - s.initRuleHandler() - - s.registerCertificateService() - s.registerObserveService() - s.registerTrafficService() - - reflection.Register(s.SecureServer) - - if s.Options.InPodEnv { - s.WebhookServer = webhook.NewWebhook( - func(info *tls.ClientHelloInfo) (*tls.Certificate, error) { - return s.CertStorage.GetServerCert(info.ServerName), nil - }) - s.WebhookServer.Init(s.Options) - - s.JavaInjector = patch.NewJavaSdk(s.Options, s.KubeClient) - s.WebhookServer.Patches = append(s.WebhookServer.Patches, s.JavaInjector.NewPod) - } -} - -func (s *Server) registerObserveService() { - ruleImpl := &v1alpha1.RuleServiceImpl{ - Storage: s.ConnectionStorage, - KubeClient: s.KubeClient, - Options: s.Options, - CertStorage: s.CertStorage, - } - v1alpha1.RegisterRuleServiceServer(s.SecureServer, ruleImpl) - v1alpha1.RegisterRuleServiceServer(s.PlainServer, ruleImpl) -} - -func (s *Server) initRuleHandler() { - s.ConnectionStorage = connection.NewStorage() - s.AuthenticationHandler = authentication.NewHandler(s.ConnectionStorage) - s.AuthorizationHandler = authorization.NewHandler(s.ConnectionStorage) -} - -func (s *Server) registerCertificateService() { - impl := &v1alpha1.AuthorityServiceImpl{ - Options: s.Options, - CertStorage: s.CertStorage, - KubeClient: s.KubeClient, - } - - v1alpha1.RegisterAuthorityServiceServer(s.PlainServer, impl) - v1alpha1.RegisterAuthorityServiceServer(s.SecureServer, impl) -} - -func (s *Server) LoadRootCert() { - // todo -} - -func (s *Server) LoadAuthorityCert() { - if s.Options.IsKubernetesConnected { - certStr, priStr := s.KubeClient.GetAuthorityCert(s.Options.Namespace) - if certStr != "" && priStr != "" { - s.CertStorage.GetAuthorityCert().Cert = cert2.DecodeCert(certStr) - s.CertStorage.GetAuthorityCert().CertPem = certStr - s.CertStorage.GetAuthorityCert().PrivateKey = cert2.DecodePrivateKey(priStr) - } - } - - s.RefreshAuthorityCert() - go s.ScheduleRefreshAuthorityCert() -} - -func (s *Server) ScheduleRefreshAuthorityCert() { - interval := math.Min(math.Floor(float64(s.Options.CaValidity)/100), 10_000) - for { - time.Sleep(time.Duration(interval) * time.Millisecond) - if s.CertStorage.GetAuthorityCert().NeedRefresh() { - logger.Sugar().Infof("Authority cert is invalid, refresh it.") - // TODO lock if multi server - // TODO refresh signed cert - - s.Elec.Election(s.CertStorage, s.Options, s.KubeClient.GetKubClient()) - if s.Options.IsKubernetesConnected { - s.KubeClient.UpdateAuthorityCert(s.CertStorage.GetAuthorityCert().CertPem, cert2.EncodePrivateKey(s.CertStorage.GetAuthorityCert().PrivateKey), s.Options.Namespace) - s.KubeClient.UpdateWebhookConfig(s.Options, s.CertStorage) - if s.KubeClient.UpdateAuthorityPublicKey(s.CertStorage.GetAuthorityCert().CertPem) { - logger.Sugar().Infof("Write ca to config maps success.") - } else { - logger.Sugar().Warnf("Write ca to config maps failed.") - } - } - } - - select { - case <-s.StopChan: - return - default: - continue - } - } -} - -func (s *Server) RefreshAuthorityCert() { - if s.CertStorage.GetAuthorityCert().IsValid() { - logger.Sugar().Infof("Load authority cert from kubernetes secrect success.") - } else { - logger.Sugar().Warnf("Load authority cert from kubernetes secrect failed.") - s.CertStorage.SetAuthorityCert(cert2.GenerateAuthorityCert(s.CertStorage.GetRootCert(), s.Options.CaValidity)) - - // TODO lock if multi server - if s.Options.IsKubernetesConnected { - s.KubeClient.UpdateAuthorityCert(s.CertStorage.GetAuthorityCert().CertPem, cert2.EncodePrivateKey(s.CertStorage.GetAuthorityCert().PrivateKey), s.Options.Namespace) - } - } - - if s.Options.IsKubernetesConnected { - logger.Sugar().Info("Writing ca to config maps.") - if s.KubeClient.UpdateAuthorityPublicKey(s.CertStorage.GetAuthorityCert().CertPem) { - logger.Sugar().Info("Write ca to config maps success.") - } else { - logger.Sugar().Warnf("Write ca to config maps failed.") - } - } - - s.CertStorage.AddTrustedCert(s.CertStorage.GetAuthorityCert()) -} - -func (s *Server) Start() { - go func() { - lis, err := net.Listen("tcp", ":"+strconv.Itoa(s.Options.PlainServerPort)) - if err != nil { - log.Fatal(err) - } - err = s.PlainServer.Serve(lis) - if err != nil { - log.Fatal(err) - } - }() - go func() { - lis, err := net.Listen("tcp", ":"+strconv.Itoa(s.Options.SecureServerPort)) - if err != nil { - log.Fatal(err) - } - err = s.SecureServer.Serve(lis) - if err != nil { - log.Fatal(err) - } - }() - - if s.Options.InPodEnv { - go s.WebhookServer.Serve() - s.KubeClient.UpdateWebhookConfig(s.Options, s.CertStorage) - } - - s.KubeClient.InitController(s.AuthenticationHandler, s.AuthorizationHandler) - - logger.Sugar().Info("Server started.") -} diff --git a/pkg/core/rule/server_test.go b/pkg/core/rule/server_test.go deleted file mode 100644 index b52bec834..000000000 --- a/pkg/core/rule/server_test.go +++ /dev/null @@ -1,209 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one or more -// contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. -// The ASF licenses this file to You under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with -// the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package rule - -import ( - "crypto/tls" - "os" - "testing" - "time" - - "github.com/apache/dubbo-admin/pkg/authority/election" - - "k8s.io/client-go/kubernetes" - - cert2 "github.com/apache/dubbo-admin/pkg/authority/cert" - "github.com/apache/dubbo-admin/pkg/authority/config" - "github.com/apache/dubbo-admin/pkg/authority/k8s" - "github.com/apache/dubbo-admin/pkg/logger" -) - -type mockKubeClient struct { - k8s.Client -} - -var ( - certPEM = "" - priPEM = "" -) - -func (s *mockKubeClient) Init(options *config.Options) bool { - return true -} - -func (s *mockKubeClient) GetAuthorityCert(namespace string) (string, string) { - return certPEM, priPEM -} - -func (s *mockKubeClient) UpdateAuthorityCert(cert string, pri string, namespace string) { -} - -func (s *mockKubeClient) UpdateAuthorityPublicKey(cert string) bool { - return true -} - -func (s *mockKubeClient) UpdateWebhookConfig(options *config.Options, storage cert2.Storage) { -} - -func (s *mockKubeClient) GetKubClient() *kubernetes.Clientset { - return nil -} - -type mockStorage struct { - cert2.Storage - origin cert2.Storage -} - -func (s *mockStorage) GetServerCert(serverName string) *tls.Certificate { - return nil -} - -func (s *mockStorage) RefreshServerCert() { -} - -func (s *mockStorage) SetAuthorityCert(cert *cert2.Cert) { - s.origin.SetAuthorityCert(cert) -} - -func (s *mockStorage) GetAuthorityCert() *cert2.Cert { - return s.origin.GetAuthorityCert() -} - -func (s *mockStorage) SetRootCert(cert *cert2.Cert) { - s.origin.SetRootCert(cert) -} - -func (s *mockStorage) GetRootCert() *cert2.Cert { - return s.origin.GetRootCert() -} - -func (s *mockStorage) AddTrustedCert(cert *cert2.Cert) { - s.origin.AddTrustedCert(cert) -} - -func (s *mockStorage) GetTrustedCerts() []*cert2.Cert { - return s.origin.GetTrustedCerts() -} - -func (s *mockStorage) GetStopChan() chan os.Signal { - return s.origin.GetStopChan() -} - -type mockLeaderElection struct { - election.LeaderElection -} - -func (s *mockLeaderElection) Election(storage cert2.Storage, options *config.Options, kubeClient *kubernetes.Clientset) error { - storage.SetAuthorityCert(cert2.GenerateAuthorityCert(storage.GetRootCert(), options.CaValidity)) - return nil -} - -func TestInit(t *testing.T) { - t.Parallel() - - logger.Init() - - options := &config.Options{ - IsKubernetesConnected: true, - Namespace: "dubbo-system", - PlainServerPort: 30060, - SecureServerPort: 30062, - DebugPort: 30070, - CaValidity: 30 * 24 * 60 * 60 * 1000, // 30 day - CertValidity: 1 * 60 * 60 * 1000, // 1 hour - } - - s := NewServer(options) - s.KubeClient = &mockKubeClient{} - - s.Init() - if !s.CertStorage.GetAuthorityCert().IsValid() { - t.Fatal("Authority cert is not valid") - return - } - - certPEM = s.CertStorage.GetAuthorityCert().CertPem - priPEM = cert2.EncodePrivateKey(s.CertStorage.GetAuthorityCert().PrivateKey) - - s.PlainServer.Stop() - s.SecureServer.Stop() - s.StopChan <- os.Kill - - s = NewServer(options) - s.KubeClient = &mockKubeClient{} - s.Init() - - if !s.CertStorage.GetAuthorityCert().IsValid() { - t.Fatal("Authority cert is not valid") - - return - } - - if s.CertStorage.GetAuthorityCert().CertPem != certPEM { - t.Fatal("Authority cert is not equal") - - return - } - - s.PlainServer.Stop() - s.SecureServer.Stop() - s.StopChan <- os.Kill - s.CertStorage.GetStopChan() <- os.Kill -} - -func TestRefresh(t *testing.T) { - t.Parallel() - - logger.Init() - - options := &config.Options{ - IsKubernetesConnected: false, - Namespace: "dubbo-system", - PlainServerPort: 30060, - SecureServerPort: 30062, - DebugPort: 30070, - CaValidity: 10, - } - - s := NewServer(options) - - s.KubeClient = &mockKubeClient{} - storage := &mockStorage{} - s.Elec = &mockLeaderElection{} - storage.origin = cert2.NewStorage(options) - s.CertStorage = storage - - s.Init() - - origin := s.CertStorage.GetAuthorityCert() - - for i := 0; i < 1000; i++ { - // wait at most 100s - time.Sleep(100 * time.Millisecond) - if s.CertStorage.GetAuthorityCert() != origin { - break - } - } - - if s.CertStorage.GetAuthorityCert() == origin { - t.Fatal("Authority cert is not refreshed") - return - } - - s.PlainServer.Stop() - s.SecureServer.Stop() - s.StopChan <- os.Kill -} diff --git a/pkg/core/runtime/builder.go b/pkg/core/runtime/builder.go old mode 100755 new mode 100644 index 43477c870..c18c93d0b --- a/pkg/core/runtime/builder.go +++ b/pkg/core/runtime/builder.go @@ -1,117 +1,125 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package runtime import ( "context" "fmt" + dubbo_cp "github.com/apache/dubbo-admin/pkg/config/app/dubbo-cp" "github.com/apache/dubbo-admin/pkg/core" + "github.com/apache/dubbo-admin/pkg/core/cert/provider" "github.com/apache/dubbo-admin/pkg/core/runtime/component" + "github.com/apache/dubbo-admin/pkg/cp-server/server" + "github.com/pkg/errors" "os" "time" - - "github.com/pkg/errors" ) -// BuilderContext provides access to Builder's interim state. type BuilderContext interface { ComponentManager() component.Manager - ResourceStore() core_store.ResourceStore - SecretStore() store.SecretStore - ConfigStore() core_store.ResourceStore - ResourceManager() core_manager.CustomizableResourceManager - Config() kuma_cp.Config - DataSourceLoader() datasource.Loader - Extensions() context.Context - ConfigManager() config_manager.ConfigManager - LeaderInfo() component.LeaderInfo - Metrics() metrics.Metrics - EventReaderFactory() events.ListenerFactory - APIManager() api_server.APIManager - XDSHooks() *xds_hooks.Hooks - CAProvider() secrets.CaProvider - DpServer() *dp_server.DpServer - ResourceValidators() ResourceValidators - KDSContext() *kds_context.Context - APIServerAuthenticator() authn.Authenticator - Access() Access - TokenIssuers() builtin.TokenIssuers - MeshCache() *mesh.Cache - InterCPClientPool() *client.Pool + Config() *dubbo_cp.Config + CertStorage() provider.Storage + KubuClient() provider.Client } var _ BuilderContext = &Builder{} -// Builder represents a multi-step initialization process. type Builder struct { - cfg kuma_cp.Config - cm component.Manager - rs core_store.ResourceStore + cfg *dubbo_cp.Config + cm component.Manager + appCtx context.Context + + grpcServer *server.GrpcServer + kubuClient provider.Client + certStorage provider.Storage *runtimeInfo } -func BuilderFor(appCtx context.Context, cfg kuma_cp.Config) (*Builder, error) { +func (b *Builder) KubuClient() provider.Client { + return b.kubuClient +} + +func (b *Builder) CertStorage() provider.Storage { + return b.certStorage +} + +func (b *Builder) Config() *dubbo_cp.Config { + return b.cfg +} + +func (b *Builder) ComponentManager() component.Manager { + return b.cm +} + +func BuilderFor(appCtx context.Context, cfg *dubbo_cp.Config) (*Builder, error) { hostname, err := os.Hostname() if err != nil { return nil, errors.Wrap(err, "could not get hostname") } suffix := core.NewUUID()[0:4] return &Builder{ - cfg: cfg, - ext: context.Background(), - cam: core_ca.Managers{}, + cfg: cfg, + appCtx: appCtx, runtimeInfo: &runtimeInfo{ instanceId: fmt.Sprintf("%s-%s", hostname, suffix), startTime: time.Now(), }, - appCtx: appCtx, }, nil } -func (b *Builder) WithComponentManager(cm component.Manager) *Builder { - b.cm = cm - return b -} - func (b *Builder) Build() (Runtime, error) { - if b.cm == nil { - return nil, errors.Errorf("ComponentManager has not been configured") + if b.grpcServer == nil { + return nil, errors.Errorf("grpcServer has not been configured") + } + if b.certStorage == nil { + return nil, errors.Errorf("certStorage has not been configured") + } + if b.kubuClient == nil { + return nil, errors.Errorf("kubuClient has not been configured") } return &runtime{ RuntimeInfo: b.runtimeInfo, RuntimeContext: &runtimeContext{ - cfg: b.cfg, - rm: b.rm, - rom: b.rom, - rs: b.rs, - ss: b.ss, - cam: b.cam, - dsl: b.dsl, - ext: b.ext, - configm: b.configm, - leadInfo: b.leadInfo, - lif: b.lif, - eac: b.eac, - metrics: b.metrics, - erf: b.erf, - apim: b.apim, - xdsauth: b.xdsauth, - xdsCallbacks: b.xdsCallbacks, - xdsh: b.xdsh, - cap: b.cap, - dps: b.dps, - kdsctx: b.kdsctx, - rv: b.rv, - au: b.au, - acc: b.acc, - appCtx: b.appCtx, - extraReportsFn: b.extraReportsFn, - tokenIssuers: b.tokenIssuers, - meshCache: b.meshCache, - interCpPool: b.interCpPool, + cfg: b.cfg, + grpcServer: b.grpcServer, + certStorage: b.certStorage, + kubuClient: b.kubuClient, }, Manager: b.cm, }, nil } -func (b *Builder) ComponentManager() component.Manager { - return b.cm +func (b *Builder) WithCertStorage(storage provider.Storage) *Builder { + b.certStorage = storage + return b +} + +func (b *Builder) WithKubuClient(client provider.Client) *Builder { + b.kubuClient = client + return b +} + +func (b *Builder) WithGrpcServer(grpcServer server.GrpcServer) *Builder { + b.grpcServer = &grpcServer + return b +} + +func (b *Builder) WithComponentManager(cm component.Manager) *Builder { + b.cm = cm + return b } diff --git a/pkg/core/runtime/component/component.go b/pkg/core/runtime/component/component.go old mode 100755 new mode 100644 index 5e18dac40..09c84d46d --- a/pkg/core/runtime/component/component.go +++ b/pkg/core/runtime/component/component.go @@ -1,11 +1,29 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package component import ( + "errors" + "github.com/apache/dubbo-admin/pkg/core/logger" + "github.com/apache/dubbo-admin/pkg/core/tools/channels" "sync" ) -var log = core.Log.WithName("bootstrap") - // Component defines a process that will be run in the application // Component should be designed in such a way that it can be stopped by stop channel and started again (for example when instance is reelected for a leader). type Component interface { @@ -72,17 +90,41 @@ func NewManager(leaderElector LeaderElector) Manager { } } +var LeaderComponentAddAfterStartErr = errors.New("cannot add leader component after component manager is started") + type manager struct { - components []Component leaderElector LeaderElector + + sync.Mutex // protects access to fields below + components []Component + started bool + stopCh <-chan struct{} + errCh chan error } func (cm *manager) Add(c ...Component) error { + cm.Lock() + defer cm.Unlock() cm.components = append(cm.components, c...) + if cm.started { + // start component if it's added in runtime after Start is called. + for _, component := range c { + if component.NeedLeaderElection() { + return LeaderComponentAddAfterStartErr + } + go func(c Component, stopCh <-chan struct{}, errCh chan error) { + if err := c.Start(stopCh); err != nil { + errCh <- err + } + }(component, cm.stopCh, cm.errCh) + } + } return nil } func (cm *manager) waitForDone() { + // limitation: waitForDone does not wait for components added after Start() is called. + // This is ok for now, because it's used only in context of Kuma DP where we are not adding components in runtime. for _, c := range cm.components { if gc, ok := c.(GracefulComponent); ok { gc.WaitForDone() @@ -93,7 +135,13 @@ func (cm *manager) waitForDone() { func (cm *manager) Start(stop <-chan struct{}) error { errCh := make(chan error) + cm.Lock() cm.startNonLeaderComponents(stop, errCh) + cm.started = true + cm.stopCh = stop + cm.errCh = errCh + cm.Unlock() + // this has to be called outside of lock because it can be leader at any time, and it locks in leader callbacks. cm.startLeaderComponents(stop, errCh) defer cm.waitForDone() @@ -133,10 +181,13 @@ func (cm *manager) startLeaderComponents(stop <-chan struct{}, errCh chan error) cm.leaderElector.AddCallbacks(LeaderCallbacks{ OnStartedLeading: func() { - log.Info("leader acquired") + logger.Sugar().Info("leader acquired") mutex.Lock() defer mutex.Unlock() leaderStopCh = make(chan struct{}) + + cm.Lock() + defer cm.Unlock() for _, component := range cm.components { if component.NeedLeaderElection() { go func(c Component) { @@ -148,7 +199,7 @@ func (cm *manager) startLeaderComponents(stop <-chan struct{}, errCh chan error) } }, OnStoppedLeading: func() { - log.Info("leader lost") + logger.Sugar().Info("leader lost") closeLeaderCh() }, }) diff --git a/pkg/core/runtime/component/leader.go b/pkg/core/runtime/component/leader.go old mode 100755 new mode 100644 index 3edbc4e9c..cd11ac52b --- a/pkg/core/runtime/component/leader.go +++ b/pkg/core/runtime/component/leader.go @@ -1,6 +1,21 @@ -package component +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ -import "sync/atomic" +package component // LeaderCallbacks defines callbacks for events from LeaderElector // It is guaranteed that each methods will be executed from the same goroutine, so only one method can be run at once. @@ -18,36 +33,3 @@ type LeaderElector interface { // Start blocks until the channel is closed or an error occurs. Start(stop <-chan struct{}) } - -type LeaderInfo interface { - IsLeader() bool -} - -var _ LeaderInfo = &LeaderInfoComponent{} -var _ Component = &LeaderInfoComponent{} - -type LeaderInfoComponent struct { - leader int32 -} - -func (l *LeaderInfoComponent) Start(stop <-chan struct{}) error { - l.setLeader(true) - <-stop - l.setLeader(false) - return nil -} - -func (l *LeaderInfoComponent) NeedLeaderElection() bool { - return true -} - -func (p *LeaderInfoComponent) setLeader(leader bool) { - var value int32 = 0 - if leader { - value = 1 - } - atomic.StoreInt32(&p.leader, value) -} -func (p *LeaderInfoComponent) IsLeader() bool { - return atomic.LoadInt32(&(p.leader)) == 1 -} diff --git a/pkg/core/runtime/component/resilient.go b/pkg/core/runtime/component/resilient.go deleted file mode 100755 index 8167f5190..000000000 --- a/pkg/core/runtime/component/resilient.go +++ /dev/null @@ -1,60 +0,0 @@ -package component - -import ( - "time" - - "github.com/go-logr/logr" - "github.com/pkg/errors" -) - -const ( - backoffTime = 5 * time.Second -) - -type resilientComponent struct { - log logr.Logger - component Component -} - -func NewResilientComponent(log logr.Logger, component Component) Component { - return &resilientComponent{ - log: log, - component: component, - } -} - -func (r *resilientComponent) Start(stop <-chan struct{}) error { - r.log.Info("starting resilient component ...") - for generationID := uint64(1); ; generationID++ { - errCh := make(chan error, 1) - go func(errCh chan<- error) { - defer close(errCh) - // recover from a panic - defer func() { - if e := recover(); e != nil { - if err, ok := e.(error); ok { - errCh <- err - } else { - errCh <- errors.Errorf("%v", e) - } - } - }() - - errCh <- r.component.Start(stop) - }(errCh) - select { - case <-stop: - r.log.Info("done") - return nil - case err := <-errCh: - if err != nil { - r.log.WithValues("generationID", generationID).Error(err, "component terminated with an error") - } - } - <-time.After(backoffTime) - } -} - -func (r *resilientComponent) NeedLeaderElection() bool { - return r.component.NeedLeaderElection() -} diff --git a/pkg/core/runtime/runtime.go b/pkg/core/runtime/runtime.go old mode 100755 new mode 100644 index 76f2e0917..ab1321a37 --- a/pkg/core/runtime/runtime.go +++ b/pkg/core/runtime/runtime.go @@ -1,12 +1,31 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package runtime import ( + dubbo_cp "github.com/apache/dubbo-admin/pkg/config/app/dubbo-cp" + "github.com/apache/dubbo-admin/pkg/core/cert/provider" "github.com/apache/dubbo-admin/pkg/core/runtime/component" + "github.com/apache/dubbo-admin/pkg/cp-server/server" "sync" "time" ) -// Runtime represents initialized application state. type Runtime interface { RuntimeInfo RuntimeContext @@ -20,24 +39,6 @@ type RuntimeInfo interface { GetStartTime() time.Time } -type RuntimeContext interface { - Config() kuma_cp.Config - DataSourceLoader() datasource.Loader - ResourceManager() core_manager.ResourceManager -} - -type ExtraReportsFn func(Runtime) (map[string]string, error) - -var _ Runtime = &runtime{} - -type runtime struct { - RuntimeInfo - RuntimeContext - component.Manager -} - -var _ RuntimeInfo = &runtimeInfo{} - type runtimeInfo struct { mtx sync.RWMutex @@ -66,22 +67,42 @@ func (i *runtimeInfo) GetStartTime() time.Time { return i.startTime } +type RuntimeContext interface { + Config() *dubbo_cp.Config + GrpcServer() *server.GrpcServer + CertStorage() provider.Storage + KubuClient() provider.Client +} + +type runtime struct { + RuntimeInfo + RuntimeContext + component.Manager +} + +var _ RuntimeInfo = &runtimeInfo{} + var _ RuntimeContext = &runtimeContext{} type runtimeContext struct { - cfg kuma_cp.Config - rm core_manager.ResourceManager - rs core_store.ResourceStore + cfg *dubbo_cp.Config + grpcServer *server.GrpcServer + certStorage provider.Storage + kubuClient provider.Client } -func (rc *runtimeContext) Config() kuma_cp.Config { - return rc.cfg +func (rc *runtimeContext) KubuClient() provider.Client { + return rc.kubuClient } -func (rc *runtimeContext) ResourceManager() core_manager.ResourceManager { - return rc.rm +func (rc *runtimeContext) CertStorage() provider.Storage { + return rc.certStorage +} + +func (rc *runtimeContext) Config() *dubbo_cp.Config { + return rc.cfg } -func (rc *runtimeContext) ResourceStore() core_store.ResourceStore { - return rc.rs +func (rc *runtimeContext) GrpcServer() *server.GrpcServer { + return rc.grpcServer } diff --git a/pkg/core/tools/channels/closed.go b/pkg/core/tools/channels/closed.go new file mode 100644 index 000000000..f26765ba2 --- /dev/null +++ b/pkg/core/tools/channels/closed.go @@ -0,0 +1,28 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package channels + +// IsClosed checks if channel is closed by reading the value. It is useful for checking +func IsClosed(ch <-chan struct{}) bool { + select { + case <-ch: + return true + default: + } + return false +} diff --git a/pkg/authority/v1alpha1/tools.go b/pkg/core/tools/endpoint/endpoint.go similarity index 74% rename from pkg/authority/v1alpha1/tools.go rename to pkg/core/tools/endpoint/endpoint.go index c6a125759..ef0dec8b9 100644 --- a/pkg/authority/v1alpha1/tools.go +++ b/pkg/core/tools/endpoint/endpoint.go @@ -13,28 +13,26 @@ // See the License for the specific language governing permissions and // limitations under the License. -package v1alpha1 +package endpoint import ( "context" "encoding/json" "fmt" + dubbo_cp "github.com/apache/dubbo-admin/pkg/config/app/dubbo-cp" + "github.com/apache/dubbo-admin/pkg/core/cert/provider" + "github.com/apache/dubbo-admin/pkg/core/endpoint" + "github.com/apache/dubbo-admin/pkg/core/jwt" "net" "strings" - "github.com/apache/dubbo-admin/pkg/authority/jwt" - "google.golang.org/grpc/credentials" - "github.com/apache/dubbo-admin/pkg/authority/cert" - "github.com/apache/dubbo-admin/pkg/authority/config" - "github.com/apache/dubbo-admin/pkg/authority/k8s" - "github.com/apache/dubbo-admin/pkg/authority/rule" "google.golang.org/grpc/metadata" "google.golang.org/grpc/peer" ) -func ExactEndpoint(c context.Context, certStorage cert.Storage, options *config.Options, kubeClient k8s.Client) (*rule.Endpoint, error) { +func ExactEndpoint(c context.Context, certStorage provider.Storage, options *dubbo_cp.Config, kubeClient provider.Client) (*endpoint.Endpoint, error) { if c == nil { return nil, fmt.Errorf("context is nil") } @@ -44,18 +42,18 @@ func ExactEndpoint(c context.Context, certStorage cert.Storage, options *config. return nil, fmt.Errorf("failed to get peer from context") } - endpoint, endpointErr := tryFromHeader(c, certStorage, options, kubeClient) + endpoints, endpointErr := tryFromHeader(c, certStorage, options, kubeClient) if endpointErr == nil { - return endpoint, nil + return endpoints, nil } - endpoint, connectionErr := tryFromConnection(p) + endpoints, connectionErr := tryFromConnection(p) if connectionErr == nil { - return endpoint, nil + return endpoints, nil } - if !options.IsTrustAnyone && connectionErr != nil { - return nil, fmt.Errorf("Failed to get endpoint from header: %s. Failed to get endpoint from connection: %s. RemoteAddr: %s", + if !options.Security.IsTrustAnyone && connectionErr != nil { + return nil, fmt.Errorf("Failed to get endpoint from header: %s. Failed to get endpoint from storage: %s. RemoteAddr: %s", endpointErr.Error(), connectionErr.Error(), p.Addr.String()) } @@ -64,13 +62,13 @@ func ExactEndpoint(c context.Context, certStorage cert.Storage, options *config. return nil, err } - return &rule.Endpoint{ + return &endpoint.Endpoint{ ID: p.Addr.String(), Ips: []string{host}, }, nil } -func tryFromHeader(c context.Context, certStorage cert.Storage, options *config.Options, kubeClient k8s.Client) (*rule.Endpoint, error) { +func tryFromHeader(c context.Context, certStorage provider.Storage, options *dubbo_cp.Config, kubeClient provider.Client) (*endpoint.Endpoint, error) { // TODO refactor as coreos/go-oidc authorization := metadata.ValueFromIncomingContext(c, "authorization") if len(authorization) != 1 { @@ -96,7 +94,7 @@ func tryFromHeader(c context.Context, certStorage cert.Storage, options *config. if err != nil { continue } - endpoint := &rule.Endpoint{SpiffeID: claims.Subject} + endpoint := &endpoint.Endpoint{SpiffeID: claims.Subject} err = json.Unmarshal([]byte(claims.Extensions), endpoint) if err != nil { continue @@ -106,7 +104,7 @@ func tryFromHeader(c context.Context, certStorage cert.Storage, options *config. return nil, fmt.Errorf("failed to verify Authorization header from dubbo-jwt") } - if options.IsKubernetesConnected && options.EnableOIDCCheck { + if options.KubeConfig.IsKubernetesConnected && options.Security.EnableOIDCCheck { endpoint, ok := kubeClient.VerifyServiceAccount(token, authorizationType) if !ok { return nil, fmt.Errorf("failed to verify Authorization header from kubernetes") @@ -117,7 +115,7 @@ func tryFromHeader(c context.Context, certStorage cert.Storage, options *config. return nil, fmt.Errorf("failed to verify Authorization header") } -func tryFromConnection(p *peer.Peer) (*rule.Endpoint, error) { +func tryFromConnection(p *peer.Peer) (*endpoint.Endpoint, error) { if p.AuthInfo != nil && p.AuthInfo.AuthType() == "tls" { tlsInfo, ok := p.AuthInfo.(credentials.TLSInfo) if !ok { @@ -131,7 +129,7 @@ func tryFromConnection(p *peer.Peer) (*rule.Endpoint, error) { if tlsInfo.SPIFFEID == nil { return nil, fmt.Errorf("failed to get SPIFFE ID from peer") } - return &rule.Endpoint{ + return &endpoint.Endpoint{ ID: p.Addr.String(), SpiffeID: tlsInfo.SPIFFEID.String(), Ips: []string{host}, diff --git a/pkg/authority/v1alpha1/tools_test.go b/pkg/core/tools/endpoint/endpoint_test.go similarity index 62% rename from pkg/authority/v1alpha1/tools_test.go rename to pkg/core/tools/endpoint/endpoint_test.go index f23dbcf0c..3636a47b6 100644 --- a/pkg/authority/v1alpha1/tools_test.go +++ b/pkg/core/tools/endpoint/endpoint_test.go @@ -13,24 +13,23 @@ // See the License for the specific language governing permissions and // limitations under the License. -package v1alpha1_test +package endpoint import ( "context" + dubbo_cp "github.com/apache/dubbo-admin/pkg/config/app/dubbo-cp" + "github.com/apache/dubbo-admin/pkg/config/kube" + "github.com/apache/dubbo-admin/pkg/config/security" + "github.com/apache/dubbo-admin/pkg/core/cert/provider" + "github.com/apache/dubbo-admin/pkg/core/endpoint" + "github.com/apache/dubbo-admin/pkg/core/jwt" "net/url" "testing" "google.golang.org/grpc/credentials" - "github.com/apache/dubbo-admin/pkg/authority/jwt" - - "github.com/apache/dubbo-admin/pkg/authority/cert" - "github.com/apache/dubbo-admin/pkg/authority/config" - "github.com/apache/dubbo-admin/pkg/authority/k8s" - "github.com/apache/dubbo-admin/pkg/authority/rule" "google.golang.org/grpc/metadata" - "github.com/apache/dubbo-admin/pkg/authority/v1alpha1" "github.com/stretchr/testify/assert" "google.golang.org/grpc/peer" ) @@ -46,17 +45,17 @@ func (f *fakeAddr) Network() string { } type fakeKubeClient struct { - k8s.Client + provider.Client } -func (c fakeKubeClient) VerifyServiceAccount(token string, authorizationType string) (*rule.Endpoint, bool) { +func (c fakeKubeClient) VerifyServiceAccount(token string, authorizationType string) (*endpoint.Endpoint, bool) { if token == "kubernetes-token" && authorizationType == "kubernetes" { - return &rule.Endpoint{ + return &endpoint.Endpoint{ ID: "kubernetes", }, true } if token == "dubbo-token" && authorizationType == "dubbo-ca-token" { - return &rule.Endpoint{ + return &endpoint.Endpoint{ ID: "dubbo-endpoint", }, true } @@ -65,63 +64,67 @@ func (c fakeKubeClient) VerifyServiceAccount(token string, authorizationType str func TestKubernetes(t *testing.T) { t.Parallel() - _, err := v1alpha1.ExactEndpoint(nil, nil, nil, nil) // nolint: staticcheck + _, err := ExactEndpoint(nil, nil, nil, nil) // nolint: staticcheck assert.NotNil(t, err) - _, err = v1alpha1.ExactEndpoint(context.TODO(), nil, nil, nil) + _, err = ExactEndpoint(context.TODO(), nil, nil, nil) assert.NotNil(t, err) c := peer.NewContext(context.TODO(), &peer.Peer{Addr: &fakeAddr{}}) - options := &config.Options{ - IsKubernetesConnected: false, - IsTrustAnyone: false, - CertValidity: 24 * 60 * 60 * 1000, - CaValidity: 365 * 24 * 60 * 60 * 1000, + options := &dubbo_cp.Config{ + Security: security.SecurityConfig{ + IsTrustAnyone: false, + CertValidity: 24 * 60 * 60 * 1000, + CaValidity: 365 * 24 * 60 * 60 * 1000, + }, + KubeConfig: kube.KubeConfig{ + IsKubernetesConnected: false, + }, } - storage := cert.NewStorage(options) - storage.SetAuthorityCert(cert.GenerateAuthorityCert(nil, options.CaValidity)) + storage := provider.NewStorage(options, &provider.ClientImpl{}) + storage.SetAuthorityCert(provider.GenerateAuthorityCert(nil, options.Security.CaValidity)) storage.AddTrustedCert(storage.GetAuthorityCert()) // verify failed - _, err = v1alpha1.ExactEndpoint(c, storage, options, &fakeKubeClient{}) + _, err = ExactEndpoint(c, storage, options, &fakeKubeClient{}) assert.NotNil(t, err) - options.IsTrustAnyone = true + options.Security.IsTrustAnyone = true // trust anyone - endpoint, err := v1alpha1.ExactEndpoint(c, storage, options, &fakeKubeClient{}) + endpoint, err := ExactEndpoint(c, storage, options, &fakeKubeClient{}) assert.Nil(t, err) assert.NotNil(t, endpoint) assert.Equal(t, "127.0.0.1:12345", endpoint.ID) assert.Equal(t, 1, len(endpoint.Ips)) - options.IsTrustAnyone = false + options.Security.IsTrustAnyone = false // empty authorization - _, err = v1alpha1.ExactEndpoint(c, storage, options, &fakeKubeClient{}) + _, err = ExactEndpoint(c, storage, options, &fakeKubeClient{}) assert.NotNil(t, err) // invalid header md := metadata.MD{} md["authorization"] = []string{"invalid"} withAuthorization := metadata.NewIncomingContext(c, md) - _, err = v1alpha1.ExactEndpoint(withAuthorization, storage, options, &fakeKubeClient{}) + _, err = ExactEndpoint(withAuthorization, storage, options, &fakeKubeClient{}) assert.NotNil(t, err) // invalid token md = metadata.MD{} md["authorization"] = []string{"Bearer invalid"} withAuthorization = metadata.NewIncomingContext(c, md) - _, err = v1alpha1.ExactEndpoint(withAuthorization, storage, options, &fakeKubeClient{}) + _, err = ExactEndpoint(withAuthorization, storage, options, &fakeKubeClient{}) assert.NotNil(t, err) - options.IsKubernetesConnected = true - options.EnableOIDCCheck = true + options.KubeConfig.IsKubernetesConnected = true + options.Security.EnableOIDCCheck = true // kubernetes token md = metadata.MD{} md["authorization"] = []string{"Bearer kubernetes-token"} withAuthorization = metadata.NewIncomingContext(c, md) - endpoint, err = v1alpha1.ExactEndpoint(withAuthorization, storage, options, &fakeKubeClient{}) + endpoint, err = ExactEndpoint(withAuthorization, storage, options, &fakeKubeClient{}) assert.Nil(t, err) assert.NotNil(t, endpoint) assert.Equal(t, "kubernetes", endpoint.ID) @@ -131,7 +134,7 @@ func TestKubernetes(t *testing.T) { md["authorization"] = []string{"Bearer kubernetes-token"} md["authorization-type"] = []string{"kubernetes"} withAuthorization = metadata.NewIncomingContext(c, md) - endpoint, err = v1alpha1.ExactEndpoint(withAuthorization, storage, options, &fakeKubeClient{}) + endpoint, err = ExactEndpoint(withAuthorization, storage, options, &fakeKubeClient{}) assert.Nil(t, err) assert.NotNil(t, endpoint) assert.Equal(t, "kubernetes", endpoint.ID) @@ -141,7 +144,7 @@ func TestKubernetes(t *testing.T) { md["authorization"] = []string{"Bearer dubbo-token"} md["authorization-type"] = []string{"dubbo-ca-token"} withAuthorization = metadata.NewIncomingContext(c, md) - endpoint, err = v1alpha1.ExactEndpoint(withAuthorization, storage, options, &fakeKubeClient{}) + endpoint, err = ExactEndpoint(withAuthorization, storage, options, &fakeKubeClient{}) assert.Nil(t, err) assert.NotNil(t, endpoint) assert.Equal(t, "dubbo-endpoint", endpoint.ID) @@ -151,24 +154,28 @@ func TestJwt(t *testing.T) { t.Parallel() c := peer.NewContext(context.TODO(), &peer.Peer{Addr: &fakeAddr{}}) - options := &config.Options{ - IsKubernetesConnected: false, - IsTrustAnyone: false, - CertValidity: 24 * 60 * 60 * 1000, - CaValidity: 365 * 24 * 60 * 60 * 1000, + options := &dubbo_cp.Config{ + Security: security.SecurityConfig{ + IsTrustAnyone: false, + CertValidity: 24 * 60 * 60 * 1000, + CaValidity: 365 * 24 * 60 * 60 * 1000, + }, + KubeConfig: kube.KubeConfig{ + IsKubernetesConnected: false, + }, } - storage := cert.NewStorage(options) - storage.SetAuthorityCert(cert.GenerateAuthorityCert(nil, options.CaValidity)) + storage := provider.NewStorage(options, &provider.ClientImpl{}) + storage.SetAuthorityCert(provider.GenerateAuthorityCert(nil, options.Security.CaValidity)) storage.AddTrustedCert(storage.GetAuthorityCert()) - options.IsTrustAnyone = false + options.Security.IsTrustAnyone = false // invalid token md := metadata.MD{} md["authorization"] = []string{"Bearer kubernetes-token"} md["authorization-type"] = []string{"dubbo-jwt"} withAuthorization := metadata.NewIncomingContext(c, md) - _, err := v1alpha1.ExactEndpoint(withAuthorization, storage, options, &fakeKubeClient{}) + _, err := ExactEndpoint(withAuthorization, storage, options, &fakeKubeClient{}) assert.NotNil(t, err) // invalid jwt data @@ -178,16 +185,16 @@ func TestJwt(t *testing.T) { md["authorization"] = []string{"Bearer " + token} md["authorization-type"] = []string{"dubbo-jwt"} withAuthorization = metadata.NewIncomingContext(c, md) - _, err = v1alpha1.ExactEndpoint(withAuthorization, storage, options, &fakeKubeClient{}) + _, err = ExactEndpoint(withAuthorization, storage, options, &fakeKubeClient{}) assert.NotNil(t, err) // dubbo-ca token md = metadata.MD{} - originEndpoint := &rule.Endpoint{ + originEndpoint := &endpoint.Endpoint{ ID: "dubbo-endpoint", SpiffeID: "spiffe://cluster.local", Ips: []string{"127.0.0.1"}, - KubernetesEnv: &rule.KubernetesEnv{ + KubernetesEnv: &endpoint.KubernetesEnv{ Namespace: "default", }, } @@ -197,7 +204,7 @@ func TestJwt(t *testing.T) { md["authorization"] = []string{"Bearer " + token} md["authorization-type"] = []string{"dubbo-jwt"} withAuthorization = metadata.NewIncomingContext(c, md) - endpoint, err := v1alpha1.ExactEndpoint(withAuthorization, storage, options, &fakeKubeClient{}) + endpoint, err := ExactEndpoint(withAuthorization, storage, options, &fakeKubeClient{}) assert.Nil(t, err) assert.NotNil(t, endpoint) assert.Equal(t, originEndpoint, endpoint) @@ -206,17 +213,21 @@ func TestJwt(t *testing.T) { func TestConnection(t *testing.T) { t.Parallel() - options := &config.Options{ - IsKubernetesConnected: false, - IsTrustAnyone: false, - CertValidity: 24 * 60 * 60 * 1000, - CaValidity: 365 * 24 * 60 * 60 * 1000, + options := &dubbo_cp.Config{ + Security: security.SecurityConfig{ + IsTrustAnyone: false, + CertValidity: 24 * 60 * 60 * 1000, + CaValidity: 365 * 24 * 60 * 60 * 1000, + }, + KubeConfig: kube.KubeConfig{ + IsKubernetesConnected: false, + }, } - storage := cert.NewStorage(options) - storage.SetAuthorityCert(cert.GenerateAuthorityCert(nil, options.CaValidity)) + storage := provider.NewStorage(options, &provider.ClientImpl{}) + storage.SetAuthorityCert(provider.GenerateAuthorityCert(nil, options.Security.CaValidity)) storage.AddTrustedCert(storage.GetAuthorityCert()) - options.IsTrustAnyone = false + options.Security.IsTrustAnyone = false // invalid token c := peer.NewContext(context.TODO(), &peer.Peer{ @@ -224,7 +235,7 @@ func TestConnection(t *testing.T) { AuthInfo: credentials.TLSInfo{}, }) - _, err := v1alpha1.ExactEndpoint(c, storage, options, &fakeKubeClient{}) + _, err := ExactEndpoint(c, storage, options, &fakeKubeClient{}) assert.NotNil(t, err) // invalid token c = peer.NewContext(context.TODO(), &peer.Peer{ @@ -232,7 +243,7 @@ func TestConnection(t *testing.T) { AuthInfo: &credentials.TLSInfo{}, }) - _, err = v1alpha1.ExactEndpoint(c, storage, options, &fakeKubeClient{}) + _, err = ExactEndpoint(c, storage, options, &fakeKubeClient{}) assert.NotNil(t, err) // valid token @@ -246,7 +257,7 @@ func TestConnection(t *testing.T) { }, }) - endpoint, err := v1alpha1.ExactEndpoint(c, storage, options, &fakeKubeClient{}) + endpoint, err := ExactEndpoint(c, storage, options, &fakeKubeClient{}) assert.Nil(t, err) assert.NotNil(t, endpoint) assert.Equal(t, "127.0.0.1:12345", endpoint.ID) diff --git a/pkg/cp-server/server/server.go b/pkg/cp-server/server/server.go new file mode 100644 index 000000000..ce445e02f --- /dev/null +++ b/pkg/cp-server/server/server.go @@ -0,0 +1,107 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package server + +import ( + "crypto/tls" + "crypto/x509" + "fmt" + dubbo_cp "github.com/apache/dubbo-admin/pkg/config/app/dubbo-cp" + "github.com/apache/dubbo-admin/pkg/core/cert/provider" + "github.com/apache/dubbo-admin/pkg/core/logger" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials" + "google.golang.org/grpc/reflection" + "net" +) + +type GrpcServer struct { + PlainServer *grpc.Server + PlainServerPort int + SecureServer *grpc.Server + SecureServerPort int +} + +func NewGrpcServer(s provider.Storage, config *dubbo_cp.Config) GrpcServer { + srv := GrpcServer{ + PlainServerPort: config.GrpcServer.PlainServerPort, + SecureServerPort: config.GrpcServer.SecureServerPort, + } + pool := x509.NewCertPool() + tlsConfig := &tls.Config{ + GetCertificate: func(info *tls.ClientHelloInfo) (*tls.Certificate, error) { + for _, cert := range s.GetTrustedCerts() { + pool.AddCert(cert.Cert) + } + return s.GetServerCert(info.ServerName), nil + }, + ClientCAs: pool, + ClientAuth: tls.VerifyClientCertIfGiven, + } + + srv.PlainServer = grpc.NewServer() + reflection.Register(srv.PlainServer) + + srv.SecureServer = grpc.NewServer(grpc.Creds(credentials.NewTLS(tlsConfig))) + reflection.Register(srv.SecureServer) + return srv +} + +func (d *GrpcServer) NeedLeaderElection() bool { + return false +} + +func (d *GrpcServer) Start(stop <-chan struct{}) error { + plainLis, err := net.Listen("tcp", fmt.Sprintf(":%d", d.PlainServerPort)) + if err != nil { + return err + } + secureLis, err := net.Listen("tcp", fmt.Sprintf(":%d", d.SecureServerPort)) + if err != nil { + return err + } + errChan := make(chan error) + go func() { + defer close(errChan) + if err = d.PlainServer.Serve(plainLis); err != nil { + logger.Sugar().Error(err, "terminated with an error") + errChan <- err + } else { + logger.Sugar().Error("terminated normally") + } + }() + go func() { + defer close(errChan) + if err = d.SecureServer.Serve(secureLis); err != nil { + logger.Sugar().Error(err, "terminated with an error") + errChan <- err + } else { + logger.Sugar().Error("terminated normally") + } + }() + + select { + case <-stop: + logger.Sugar().Info("stopping gracefully") + d.PlainServer.GracefulStop() + d.SecureServer.GracefulStop() + return nil + case err := <-errChan: + return err + } +} diff --git a/cmd/traffic/main.go b/pkg/cp-server/setup.go similarity index 80% rename from cmd/traffic/main.go rename to pkg/cp-server/setup.go index 2b6e30a75..1dd16eb76 100644 --- a/cmd/traffic/main.go +++ b/pkg/cp-server/setup.go @@ -15,10 +15,13 @@ * limitations under the License. */ -package main +package cp_server -import "github.com/apache/dubbo-admin/pkg/traffic/cmd" +import "github.com/apache/dubbo-admin/pkg/core/runtime" -func main() { - cmd.Start() +func Setup(rt runtime.Runtime) error { + if err := rt.Add(rt.GrpcServer()); err != nil { + return err + } + return nil } diff --git a/pkg/mapping/apis/dubbo.apache.org/v1alpha1/doc.go b/pkg/mapping/apis/dubbo.apache.org/v1alpha1/doc.go deleted file mode 100644 index a31823f1b..000000000 --- a/pkg/mapping/apis/dubbo.apache.org/v1alpha1/doc.go +++ /dev/null @@ -1,21 +0,0 @@ -/* -Licensed to the Apache Software Foundation (ASF) under one or more -contributor license agreements. See the NOTICE file distributed with -this work for additional information regarding copyright ownership. -The ASF licenses this file to You under the Apache License, Version 2.0 -(the "License"); you may not use this file except in compliance with -the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// +k8s:deepcopy-gen=package -// +groupName=dubbo.apache.org - -package v1alpha1 diff --git a/pkg/mapping/apis/dubbo.apache.org/v1alpha1/register.go b/pkg/mapping/apis/dubbo.apache.org/v1alpha1/register.go deleted file mode 100644 index 7e565311e..000000000 --- a/pkg/mapping/apis/dubbo.apache.org/v1alpha1/register.go +++ /dev/null @@ -1,47 +0,0 @@ -/* -Licensed to the Apache Software Foundation (ASF) under one or more -contributor license agreements. See the NOTICE file distributed with -this work for additional information regarding copyright ownership. -The ASF licenses this file to You under the Apache License, Version 2.0 -(the "License"); you may not use this file except in compliance with -the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -const GroupName = "dubbo.apache.org" - -var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"} - -func Resource(resource string) schema.GroupResource { - return SchemeGroupVersion.WithResource(resource).GroupResource() -} - -var ( - SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) - localSchemeBuilder = &SchemeBuilder - AddToScheme = localSchemeBuilder.AddToScheme -) - -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(SchemeGroupVersion, - &ServiceNameMapping{}, - &ServiceNameMappingList{}, - ) - metav1.AddToGroupVersion(scheme, SchemeGroupVersion) - return nil -} diff --git a/pkg/mapping/apis/dubbo.apache.org/v1alpha1/type.go b/pkg/mapping/apis/dubbo.apache.org/v1alpha1/type.go deleted file mode 100644 index 02279b5b0..000000000 --- a/pkg/mapping/apis/dubbo.apache.org/v1alpha1/type.go +++ /dev/null @@ -1,49 +0,0 @@ -/* -Licensed to the Apache Software Foundation (ASF) under one or more -contributor license agreements. See the NOTICE file distributed with -this work for additional information regarding copyright ownership. -The ASF licenses this file to You under the Apache License, Version 2.0 -(the "License"); you may not use this file except in compliance with -the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1 - -import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// +kubetype-gen -// +kubetype-gen:groupVersion=dubbo.apache.org/v1alpha1 -// +genclient -// +genclient:noStatus -// +k8s:deepcopy-gen=true -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type ServiceNameMapping struct { - v1.TypeMeta `json:",inline"` - // +optional - v1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - // +optional - Spec ServiceNameMappingSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` -} - -type ServiceNameMappingSpec struct { - InterfaceName string `json:"interfaceName,omitempty" protobuf:"bytes,1,opt,name=interfaceName,proto3"` - ApplicationNames []string `json:"applicationNames,omitempty" protobuf:"bytes,2,rep,name=applicationNames,proto3"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type ServiceNameMappingList struct { - v1.TypeMeta `json:",inline"` - // +optional - v1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - Items []*ServiceNameMapping `json:"items" protobuf:"bytes,2,rep,name=items"` -} diff --git a/pkg/mapping/apis/dubbo.apache.org/v1alpha1/zz_generated.deepcopy.go b/pkg/mapping/apis/dubbo.apache.org/v1alpha1/zz_generated.deepcopy.go deleted file mode 100644 index cad832780..000000000 --- a/pkg/mapping/apis/dubbo.apache.org/v1alpha1/zz_generated.deepcopy.go +++ /dev/null @@ -1,112 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Licensed to the Apache Software Foundation (ASF) under one or more -contributor license agreements. See the NOTICE file distributed with -this work for additional information regarding copyright ownership. -The ASF licenses this file to You under the Apache License, Version 2.0 -(the "License"); you may not use this file except in compliance with -the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by deepcopy-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ServiceNameMapping) DeepCopyInto(out *ServiceNameMapping) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceNameMapping. -func (in *ServiceNameMapping) DeepCopy() *ServiceNameMapping { - if in == nil { - return nil - } - out := new(ServiceNameMapping) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ServiceNameMapping) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ServiceNameMappingList) DeepCopyInto(out *ServiceNameMappingList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]*ServiceNameMapping, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(ServiceNameMapping) - (*in).DeepCopyInto(*out) - } - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceNameMappingList. -func (in *ServiceNameMappingList) DeepCopy() *ServiceNameMappingList { - if in == nil { - return nil - } - out := new(ServiceNameMappingList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ServiceNameMappingList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ServiceNameMappingSpec) DeepCopyInto(out *ServiceNameMappingSpec) { - *out = *in - if in.ApplicationNames != nil { - in, out := &in.ApplicationNames, &out.ApplicationNames - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceNameMappingSpec. -func (in *ServiceNameMappingSpec) DeepCopy() *ServiceNameMappingSpec { - if in == nil { - return nil - } - out := new(ServiceNameMappingSpec) - in.DeepCopyInto(out) - return out -} diff --git a/pkg/mapping/bootstrap/server.go b/pkg/mapping/bootstrap/server.go deleted file mode 100644 index 80581655b..000000000 --- a/pkg/mapping/bootstrap/server.go +++ /dev/null @@ -1,71 +0,0 @@ -/* -Licensed to the Apache Software Foundation (ASF) under one or more -contributor license agreements. See the NOTICE file distributed with -this work for additional information regarding copyright ownership. -The ASF licenses this file to You under the Apache License, Version 2.0 -(the "License"); you may not use this file except in compliance with -the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package bootstrap - -import ( - "github.com/apache/dubbo-admin/pkg/logger" - "github.com/apache/dubbo-admin/pkg/mapping/config" - dubbov1alpha1 "github.com/apache/dubbo-admin/pkg/mapping/dubbo" - informerV1alpha1 "github.com/apache/dubbo-admin/pkg/mapping/generated/informers/externalversions/dubbo.apache.org/v1alpha1" - "github.com/apache/dubbo-admin/pkg/mapping/kube" - "google.golang.org/grpc" - "google.golang.org/grpc/reflection" - "os" -) - -type Server struct { - StopChan chan os.Signal - Options *config.Options - KubeClient kube.Client - snpServer *dubbov1alpha1.Snp - GrpcServer *grpc.Server - informer informerV1alpha1.ServiceNameMappingInformer -} - -func NewServer(options *config.Options) *Server { - return &Server{ - Options: options, - StopChan: make(chan os.Signal, 1), - } -} - -func (s *Server) Init() { - if s.KubeClient == nil { - s.KubeClient = kube.NewClient() - } - if s.KubeClient != nil { - s.snpServer = dubbov1alpha1.NewSnp(s.KubeClient) - } - if !s.KubeClient.Init(s.Options) { - logger.Sugar().Warnf("Failed to connect to Kubernetes cluster. Will ignore OpenID Connect check.") - s.Options.IsKubernetesConnected = false - } else { - s.Options.IsKubernetesConnected = true - } - logger.Infof("Starting grpc Server") - s.GrpcServer = grpc.NewServer() - logger.Infof("Started grpc Server") - reflection.Register(s.GrpcServer) - logger.Infof("Service Mapping grpc Server") - s.snpServer.Register(s.GrpcServer) -} - -func (s *Server) Start() { - s.KubeClient.InitContainer() - logger.Sugar().Infof("Server started.") -} diff --git a/pkg/mapping/config/options.go b/pkg/mapping/config/options.go deleted file mode 100644 index 0afdef1ee..000000000 --- a/pkg/mapping/config/options.go +++ /dev/null @@ -1,65 +0,0 @@ -/* -Licensed to the Apache Software Foundation (ASF) under one or more -contributor license agreements. See the NOTICE file distributed with -this work for additional information regarding copyright ownership. -The ASF licenses this file to You under the Apache License, Version 2.0 -(the "License"); you may not use this file except in compliance with -the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package config - -import ( - "crypto/rand" - "encoding/base32" - "fmt" - "github.com/spf13/pflag" - "os" -) - -type Options struct { - IsKubernetesConnected bool - ResourceIdentity string -} - -func NewOptions() *Options { - return &Options{ - IsKubernetesConnected: false, - ResourceIdentity: GetStringEnv("POD_NAME", GetDefaultResourceIdentity()), - } -} - -func (o *Options) FillFlags(flags *pflag.FlagSet) { - flags.BoolVar(&o.IsKubernetesConnected, "is-kubernetes-connected", false, "dubbo connected with kubernetes") -} - -func GetStringEnv(name string, def string) string { - val, ex := os.LookupEnv(name) - if ex { - return val - } else { - return def - } -} - -func GetDefaultResourceIdentity() string { - hostname, err := os.Hostname() - if err != nil { - return "" - } - randomBytes := make([]byte, 5) - _, err = rand.Read(randomBytes) - if err != nil { - return "" - } - randomStr := base32.StdEncoding.EncodeToString(randomBytes) - return fmt.Sprintf("%s-%s", hostname, randomStr) -} diff --git a/pkg/mapping/dubbo/servicenamemapping_server.go b/pkg/mapping/dubbo/servicenamemapping_server.go deleted file mode 100644 index e2738a004..000000000 --- a/pkg/mapping/dubbo/servicenamemapping_server.go +++ /dev/null @@ -1,282 +0,0 @@ -/* -Licensed to the Apache Software Foundation (ASF) under one or more -contributor license agreements. See the NOTICE file distributed with -this work for additional information regarding copyright ownership. -The ASF licenses this file to You under the Apache License, Version 2.0 -(the "License"); you may not use this file except in compliance with -the License. You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1 - -import ( - "context" - "fmt" - "github.com/dubbogo/gost/log/logger" - "strings" - "time" -) - -import ( - apisv1alpha1 "github.com/apache/dubbo-admin/pkg/mapping/apis/dubbo.apache.org/v1alpha1" - "github.com/apache/dubbo-admin/pkg/mapping/kube" - "github.com/apache/dubbo-admin/pkg/mapping/model" - dubbov1alpha1 "github.com/apache/dubbo-admin/pkg/mapping/v1alpha1" - "github.com/pkg/errors" - "google.golang.org/grpc" - apierror "k8s.io/apimachinery/pkg/api/errors" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -type Snp struct { - dubbov1alpha1.UnimplementedServiceNameMappingServiceServer - - KubeClient kube.Client - queue chan *RegisterRequest - debounceAfter time.Duration - debounceMax time.Duration - enableDebounce bool -} - -func NewSnp(kubeClient kube.Client) *Snp { - return &Snp{ - KubeClient: kubeClient, - queue: make(chan *RegisterRequest, 10), - } -} - -func (s *Snp) RegisterServiceAppMapping(ctx context.Context, req *dubbov1alpha1.ServiceMappingRequest) (*dubbov1alpha1.ServiceMappingResponse, error) { - namespace := req.GetNamespace() - interfaces := req.GetInterfaceNames() - applicationName := req.GetApplicationName() - - registerReq := &RegisterRequest{ConfigsUpdated: map[model.ConfigKey]map[string]struct{}{}} - for _, interfaceName := range interfaces { - key := model.ConfigKey{ - Name: interfaceName, - Namespace: namespace, - } - if _, ok := registerReq.ConfigsUpdated[key]; !ok { - registerReq.ConfigsUpdated[key] = make(map[string]struct{}) - } - registerReq.ConfigsUpdated[key][applicationName] = struct{}{} - } - s.queue <- registerReq - - return &dubbov1alpha1.ServiceMappingResponse{}, nil -} - -func (s *Snp) Register(server *grpc.Server) { - dubbov1alpha1.RegisterServiceNameMappingServiceServer(server, s) -} - -func (s *Snp) Start(stop <-chan struct{}) { - if s == nil { - logger.Warn("Snp server is not init, skip start") - return - } - go s.debounce(stop, s.push) -} - -func (s *Snp) push(req *RegisterRequest) { - for key, m := range req.ConfigsUpdated { - var appNames []string - for app := range m { - appNames = append(appNames, app) - } - for i := 0; i < 3; i++ { - if err := tryRegister(s.KubeClient, key.Namespace, key.Name, appNames); err != nil { - logger.Errorf(" register [%v] failed: %v, try again later", key, err) - } else { - break - } - } - } -} - -func (s *Snp) debounce(stopCh <-chan struct{}, pushFn func(req *RegisterRequest)) { - ch := s.queue - var timeChan <-chan time.Time - var startDebounce time.Time - var lastConfigUpdateTime time.Time - - pushCounter := 0 - debouncedEvents := 0 - - var req *RegisterRequest - - free := true - freeCh := make(chan struct{}, 1) - - push := func(req *RegisterRequest) { - pushFn(req) - freeCh <- struct{}{} - } - - pushWorker := func() { - eventDelay := time.Since(startDebounce) - quietTime := time.Since(lastConfigUpdateTime) - if eventDelay >= s.debounceMax || quietTime >= s.debounceAfter { - if req != nil { - pushCounter++ - - if req.ConfigsUpdated != nil { - logger.Infof(" Push debounce stable[%d] %d for config %s: %v since last change, %v since last push", - pushCounter, debouncedEvents, configsUpdated(req), - quietTime, eventDelay) - } - free = false - go push(req) - req = nil - debouncedEvents = 0 - } - } else { - timeChan = time.After(s.debounceAfter - quietTime) - } - } - - for { - select { - case <-freeCh: - free = true - pushWorker() - case r := <-ch: - if !s.enableDebounce { - go push(r) - req = nil - continue - } - - lastConfigUpdateTime = time.Now() - if debouncedEvents == 0 { - timeChan = time.After(200 * time.Millisecond) - startDebounce = lastConfigUpdateTime - } - debouncedEvents++ - - req = req.Merge(r) - case <-timeChan: - if free { - pushWorker() - } - case <-stopCh: - return - } - } -} - -func getOrCreateSnp(kubeClient kube.Client, namespace string, interfaceName string, newApps []string) (*apisv1alpha1.ServiceNameMapping, bool, error) { - ctx := context.TODO() - lowerCaseName := strings.ToLower(strings.ReplaceAll(interfaceName, ".", "-")) - snpInterface := kubeClient.Admin().DubboV1alpha1().ServiceNameMappings(namespace) - snp, err := snpInterface.Get(ctx, lowerCaseName, v1.GetOptions{}) - if err != nil { - if apierror.IsNotFound(err) { - snp, err = snpInterface.Create(ctx, &apisv1alpha1.ServiceNameMapping{ - ObjectMeta: v1.ObjectMeta{ - Name: lowerCaseName, - Namespace: namespace, - Labels: map[string]string{ - "interface": interfaceName, - }, - }, - Spec: apisv1alpha1.ServiceNameMappingSpec{ - InterfaceName: interfaceName, - ApplicationNames: newApps, - }, - }, v1.CreateOptions{}) - if err == nil { - logger.Debugf("create snp %s revision %s", interfaceName, snp.ResourceVersion) - return snp, true, nil - } - if apierror.IsAlreadyExists(err) { - logger.Debugf("[%s] has been exists, err: %v", err) - snp, err = snpInterface.Get(ctx, lowerCaseName, v1.GetOptions{}) - if err != nil { - return nil, false, errors.Wrap(err, "tryRegister retry get snp error") - } - } - } else { - return nil, false, errors.Wrap(err, "tryRegister get snp error") - } - } - return snp, false, nil -} - -func tryRegister(kubeClient kube.Client, namespace, interfaceName string, newApps []string) error { - logger.Debugf("try register [%s] in namespace [%s] with [%v] apps", interfaceName, namespace, len(newApps)) - snp, created, err := getOrCreateSnp(kubeClient, namespace, interfaceName, newApps) - if created { - logger.Debugf("register success, revision:%s", snp.ResourceVersion) - return nil - } - if err != nil { - return err - } - - previousLen := len(snp.Spec.ApplicationNames) - previousAppNames := make(map[string]struct{}, previousLen) - for _, name := range snp.Spec.ApplicationNames { - previousAppNames[name] = struct{}{} - } - for _, newApp := range newApps { - previousAppNames[newApp] = struct{}{} - } - if len(previousAppNames) == previousLen { - logger.Debugf("[%s] has been registered: %v", interfaceName, newApps) - return nil - } - - mergedApps := make([]string, 0, len(previousAppNames)) - for name := range previousAppNames { - mergedApps = append(mergedApps, name) - } - snp.Spec.ApplicationNames = mergedApps - snpInterface := kubeClient.Admin().DubboV1alpha1().ServiceNameMappings(namespace) - snp, err = snpInterface.Update(context.Background(), snp, v1.UpdateOptions{}) - if err != nil { - return errors.Wrap(err, " update failed") - } - logger.Debugf("register update success, revision:%s", snp.ResourceVersion) - return nil -} - -type RegisterRequest struct { - ConfigsUpdated map[model.ConfigKey]map[string]struct{} -} - -func (r *RegisterRequest) Merge(req *RegisterRequest) *RegisterRequest { - if r == nil { - return req - } - for key, newApps := range req.ConfigsUpdated { - if _, ok := r.ConfigsUpdated[key]; !ok { - r.ConfigsUpdated[key] = make(map[string]struct{}) - } - for app, _ := range newApps { - r.ConfigsUpdated[key][app] = struct{}{} - } - } - return r -} - -func configsUpdated(req *RegisterRequest) string { - configs := "" - for key := range req.ConfigsUpdated { - configs += key.Name + key.Namespace - break - } - if len(req.ConfigsUpdated) > 1 { - more := fmt.Sprintf(" and %d more configs", len(req.ConfigsUpdated)-1) - configs += more - } - return configs -} diff --git a/pkg/mapping/generated/clientset/versioned/clientset.go b/pkg/mapping/generated/clientset/versioned/clientset.go deleted file mode 100644 index 808b4199b..000000000 --- a/pkg/mapping/generated/clientset/versioned/clientset.go +++ /dev/null @@ -1,120 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package versioned - -import ( - "fmt" - dubbov1alpha1 "github.com/apache/dubbo-admin/pkg/mapping/generated/clientset/versioned/typed/dubbo.apache.org/v1alpha1" - "net/http" - - discovery "k8s.io/client-go/discovery" - rest "k8s.io/client-go/rest" - flowcontrol "k8s.io/client-go/util/flowcontrol" -) - -type Interface interface { - Discovery() discovery.DiscoveryInterface - DubboV1alpha1() dubbov1alpha1.DubboV1alpha1Interface -} - -// Clientset contains the clients for groups. -type Clientset struct { - *discovery.DiscoveryClient - dubboV1alpha1 *dubbov1alpha1.DubboV1alpha1Client -} - -// DubboV1alpha1 retrieves the DubboV1alpha1Client -func (c *Clientset) DubboV1alpha1() dubbov1alpha1.DubboV1alpha1Interface { - return c.dubboV1alpha1 -} - -// Discovery retrieves the DiscoveryClient -func (c *Clientset) Discovery() discovery.DiscoveryInterface { - if c == nil { - return nil - } - return c.DiscoveryClient -} - -// NewForConfig creates a new Clientset for the given config. -// If config's RateLimiter is not set and QPS and Burst are acceptable, -// NewForConfig will generate a rate-limiter in configShallowCopy. -// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), -// where httpClient was generated with rest.HTTPClientFor(c). -func NewForConfig(c *rest.Config) (*Clientset, error) { - configShallowCopy := *c - - if configShallowCopy.UserAgent == "" { - configShallowCopy.UserAgent = rest.DefaultKubernetesUserAgent() - } - - // share the transport between all clients - httpClient, err := rest.HTTPClientFor(&configShallowCopy) - if err != nil { - return nil, err - } - - return NewForConfigAndClient(&configShallowCopy, httpClient) -} - -// NewForConfigAndClient creates a new Clientset for the given config and http client. -// Note the http client provided takes precedence over the configured transport values. -// If config's RateLimiter is not set and QPS and Burst are acceptable, -// NewForConfigAndClient will generate a rate-limiter in configShallowCopy. -func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, error) { - configShallowCopy := *c - if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { - if configShallowCopy.Burst <= 0 { - return nil, fmt.Errorf("burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0") - } - configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst) - } - - var cs Clientset - var err error - cs.dubboV1alpha1, err = dubbov1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient) - if err != nil { - return nil, err - } - - cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfigAndClient(&configShallowCopy, httpClient) - if err != nil { - return nil, err - } - return &cs, nil -} - -// NewForConfigOrDie creates a new Clientset for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *Clientset { - cs, err := NewForConfig(c) - if err != nil { - panic(err) - } - return cs -} - -// New creates a new Clientset for the given RESTClient. -func New(c rest.Interface) *Clientset { - var cs Clientset - cs.dubboV1alpha1 = dubbov1alpha1.New(c) - - cs.DiscoveryClient = discovery.NewDiscoveryClient(c) - return &cs -} diff --git a/pkg/mapping/generated/clientset/versioned/fake/clientset_generated.go b/pkg/mapping/generated/clientset/versioned/fake/clientset_generated.go deleted file mode 100644 index 3e11b2c49..000000000 --- a/pkg/mapping/generated/clientset/versioned/fake/clientset_generated.go +++ /dev/null @@ -1,86 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - clientset "github.com/apache/dubbo-admin/pkg/mapping/generated/clientset/versioned" - dubbov1alpha1 "github.com/apache/dubbo-admin/pkg/mapping/generated/clientset/versioned/typed/dubbo.apache.org/v1alpha1" - fakedubbov1alpha1 "github.com/apache/dubbo-admin/pkg/mapping/generated/clientset/versioned/typed/dubbo.apache.org/v1alpha1/fake" - - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/discovery" - fakediscovery "k8s.io/client-go/discovery/fake" - "k8s.io/client-go/testing" -) - -// NewSimpleClientset returns a clientset that will respond with the provided objects. -// It's backed by a very simple object tracker that processes creates, updates and deletions as-is, -// without applying any validations and/or defaults. It shouldn't be considered a replacement -// for a real clientset and is mostly useful in simple unit tests. -func NewSimpleClientset(objects ...runtime.Object) *Clientset { - o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder()) - for _, obj := range objects { - if err := o.Add(obj); err != nil { - panic(err) - } - } - - cs := &Clientset{tracker: o} - cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake} - cs.AddReactor("*", "*", testing.ObjectReaction(o)) - cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { - gvr := action.GetResource() - ns := action.GetNamespace() - watch, err := o.Watch(gvr, ns) - if err != nil { - return false, nil, err - } - return true, watch, nil - }) - - return cs -} - -// Clientset implements clientset.Interface. Meant to be embedded into a -// struct to get a default implementation. This makes faking out just the method -// you want to test easier. -type Clientset struct { - testing.Fake - discovery *fakediscovery.FakeDiscovery - tracker testing.ObjectTracker -} - -func (c *Clientset) Discovery() discovery.DiscoveryInterface { - return c.discovery -} - -func (c *Clientset) Tracker() testing.ObjectTracker { - return c.tracker -} - -var ( - _ clientset.Interface = &Clientset{} - _ testing.FakeClient = &Clientset{} -) - -// DubboV1alpha1 retrieves the DubboV1alpha1Client -func (c *Clientset) DubboV1alpha1() dubbov1alpha1.DubboV1alpha1Interface { - return &fakedubbov1alpha1.FakeDubboV1alpha1{Fake: &c.Fake} -} diff --git a/pkg/mapping/generated/clientset/versioned/fake/doc.go b/pkg/mapping/generated/clientset/versioned/fake/doc.go deleted file mode 100644 index 9b99e7167..000000000 --- a/pkg/mapping/generated/clientset/versioned/fake/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// This package has the automatically generated fake clientset. -package fake diff --git a/pkg/mapping/generated/clientset/versioned/fake/register.go b/pkg/mapping/generated/clientset/versioned/fake/register.go deleted file mode 100644 index 0d54b0785..000000000 --- a/pkg/mapping/generated/clientset/versioned/fake/register.go +++ /dev/null @@ -1,57 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - dubbov1alpha1 "github.com/apache/dubbo-admin/pkg/mapping/apis/dubbo.apache.org/v1alpha1" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - serializer "k8s.io/apimachinery/pkg/runtime/serializer" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" -) - -var scheme = runtime.NewScheme() -var codecs = serializer.NewCodecFactory(scheme) - -var localSchemeBuilder = runtime.SchemeBuilder{ - dubbov1alpha1.AddToScheme, -} - -// AddToScheme adds all types of this clientset into the given scheme. This allows composition -// of clientsets, like in: -// -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) -// -// kclientset, _ := kubernetes.NewForConfig(c) -// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) -// -// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types -// correctly. -var AddToScheme = localSchemeBuilder.AddToScheme - -func init() { - v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) - utilruntime.Must(AddToScheme(scheme)) -} diff --git a/pkg/mapping/generated/clientset/versioned/scheme/doc.go b/pkg/mapping/generated/clientset/versioned/scheme/doc.go deleted file mode 100644 index 7dc375616..000000000 --- a/pkg/mapping/generated/clientset/versioned/scheme/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// This package contains the scheme of the automatically generated clientset. -package scheme diff --git a/pkg/mapping/generated/clientset/versioned/scheme/register.go b/pkg/mapping/generated/clientset/versioned/scheme/register.go deleted file mode 100644 index 6df5ebc65..000000000 --- a/pkg/mapping/generated/clientset/versioned/scheme/register.go +++ /dev/null @@ -1,57 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package scheme - -import ( - dubbov1alpha1 "github.com/apache/dubbo-admin/pkg/mapping/apis/dubbo.apache.org/v1alpha1" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - serializer "k8s.io/apimachinery/pkg/runtime/serializer" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" -) - -var Scheme = runtime.NewScheme() -var Codecs = serializer.NewCodecFactory(Scheme) -var ParameterCodec = runtime.NewParameterCodec(Scheme) -var localSchemeBuilder = runtime.SchemeBuilder{ - dubbov1alpha1.AddToScheme, -} - -// AddToScheme adds all types of this clientset into the given scheme. This allows composition -// of clientsets, like in: -// -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) -// -// kclientset, _ := kubernetes.NewForConfig(c) -// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) -// -// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types -// correctly. -var AddToScheme = localSchemeBuilder.AddToScheme - -func init() { - v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) - utilruntime.Must(AddToScheme(Scheme)) -} diff --git a/pkg/mapping/generated/clientset/versioned/typed/dubbo.apache.org/v1alpha1/doc.go b/pkg/mapping/generated/clientset/versioned/typed/dubbo.apache.org/v1alpha1/doc.go deleted file mode 100644 index df51baa4d..000000000 --- a/pkg/mapping/generated/clientset/versioned/typed/dubbo.apache.org/v1alpha1/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// This package has the automatically generated typed clients. -package v1alpha1 diff --git a/pkg/mapping/generated/clientset/versioned/typed/dubbo.apache.org/v1alpha1/dubbo.apache.org_client.go b/pkg/mapping/generated/clientset/versioned/typed/dubbo.apache.org/v1alpha1/dubbo.apache.org_client.go deleted file mode 100644 index 17b50d195..000000000 --- a/pkg/mapping/generated/clientset/versioned/typed/dubbo.apache.org/v1alpha1/dubbo.apache.org_client.go +++ /dev/null @@ -1,107 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - v1alpha1 "github.com/apache/dubbo-admin/pkg/mapping/apis/dubbo.apache.org/v1alpha1" - "github.com/apache/dubbo-admin/pkg/mapping/generated/clientset/versioned/scheme" - "net/http" - - rest "k8s.io/client-go/rest" -) - -type DubboV1alpha1Interface interface { - RESTClient() rest.Interface - ServiceNameMappingsGetter -} - -// DubboV1alpha1Client is used to interact with features provided by the dubbo.apache.org group. -type DubboV1alpha1Client struct { - restClient rest.Interface -} - -func (c *DubboV1alpha1Client) ServiceNameMappings(namespace string) ServiceNameMappingInterface { - return newServiceNameMappings(c, namespace) -} - -// NewForConfig creates a new DubboV1alpha1Client for the given config. -// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), -// where httpClient was generated with rest.HTTPClientFor(c). -func NewForConfig(c *rest.Config) (*DubboV1alpha1Client, error) { - config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } - httpClient, err := rest.HTTPClientFor(&config) - if err != nil { - return nil, err - } - return NewForConfigAndClient(&config, httpClient) -} - -// NewForConfigAndClient creates a new DubboV1alpha1Client for the given config and http client. -// Note the http client provided takes precedence over the configured transport values. -func NewForConfigAndClient(c *rest.Config, h *http.Client) (*DubboV1alpha1Client, error) { - config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } - client, err := rest.RESTClientForConfigAndClient(&config, h) - if err != nil { - return nil, err - } - return &DubboV1alpha1Client{client}, nil -} - -// NewForConfigOrDie creates a new DubboV1alpha1Client for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *DubboV1alpha1Client { - client, err := NewForConfig(c) - if err != nil { - panic(err) - } - return client -} - -// New creates a new DubboV1alpha1Client for the given RESTClient. -func New(c rest.Interface) *DubboV1alpha1Client { - return &DubboV1alpha1Client{c} -} - -func setConfigDefaults(config *rest.Config) error { - gv := v1alpha1.SchemeGroupVersion - config.GroupVersion = &gv - config.APIPath = "/apis" - config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() - - if config.UserAgent == "" { - config.UserAgent = rest.DefaultKubernetesUserAgent() - } - - return nil -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *DubboV1alpha1Client) RESTClient() rest.Interface { - if c == nil { - return nil - } - return c.restClient -} diff --git a/pkg/mapping/generated/clientset/versioned/typed/dubbo.apache.org/v1alpha1/fake/doc.go b/pkg/mapping/generated/clientset/versioned/typed/dubbo.apache.org/v1alpha1/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/pkg/mapping/generated/clientset/versioned/typed/dubbo.apache.org/v1alpha1/fake/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/pkg/mapping/generated/clientset/versioned/typed/dubbo.apache.org/v1alpha1/fake/fake_dubbo.apache.org_client.go b/pkg/mapping/generated/clientset/versioned/typed/dubbo.apache.org/v1alpha1/fake/fake_dubbo.apache.org_client.go deleted file mode 100644 index 2ab51be96..000000000 --- a/pkg/mapping/generated/clientset/versioned/typed/dubbo.apache.org/v1alpha1/fake/fake_dubbo.apache.org_client.go +++ /dev/null @@ -1,41 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - v1alpha1 "github.com/apache/dubbo-admin/pkg/mapping/generated/clientset/versioned/typed/dubbo.apache.org/v1alpha1" - - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeDubboV1alpha1 struct { - *testing.Fake -} - -func (c *FakeDubboV1alpha1) ServiceNameMappings(namespace string) v1alpha1.ServiceNameMappingInterface { - return &FakeServiceNameMappings{c, namespace} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeDubboV1alpha1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/pkg/mapping/generated/clientset/versioned/typed/dubbo.apache.org/v1alpha1/generated_expansion.go b/pkg/mapping/generated/clientset/versioned/typed/dubbo.apache.org/v1alpha1/generated_expansion.go deleted file mode 100644 index 09ac4658e..000000000 --- a/pkg/mapping/generated/clientset/versioned/typed/dubbo.apache.org/v1alpha1/generated_expansion.go +++ /dev/null @@ -1,21 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha1 - -type ServiceNameMappingExpansion interface{} diff --git a/pkg/mapping/generated/informers/externalversions/dubbo.apache.org/interface.go b/pkg/mapping/generated/informers/externalversions/dubbo.apache.org/interface.go deleted file mode 100644 index 777d2e3b0..000000000 --- a/pkg/mapping/generated/informers/externalversions/dubbo.apache.org/interface.go +++ /dev/null @@ -1,46 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package dubbo - -import ( - v1alpha1 "github.com/apache/dubbo-admin/pkg/mapping/generated/informers/externalversions/dubbo.apache.org/v1alpha1" - internalinterfaces "github.com/apache/dubbo-admin/pkg/mapping/generated/informers/externalversions/internalinterfaces" -) - -// Interface provides access to each of this group's versions. -type Interface interface { - // V1alpha1 provides access to shared informers for resources in V1alpha1. - V1alpha1() v1alpha1.Interface -} - -type group struct { - factory internalinterfaces.SharedInformerFactory - namespace string - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// New returns a new Interface. -func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { - return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} -} - -// V1alpha1 returns a new v1alpha1.Interface. -func (g *group) V1alpha1() v1alpha1.Interface { - return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions) -} diff --git a/pkg/mapping/generated/informers/externalversions/dubbo.apache.org/v1alpha1/interface.go b/pkg/mapping/generated/informers/externalversions/dubbo.apache.org/v1alpha1/interface.go deleted file mode 100644 index f894ad116..000000000 --- a/pkg/mapping/generated/informers/externalversions/dubbo.apache.org/v1alpha1/interface.go +++ /dev/null @@ -1,45 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - internalinterfaces "github.com/apache/dubbo-admin/pkg/mapping/generated/informers/externalversions/internalinterfaces" -) - -// Interface provides access to all the informers in this group version. -type Interface interface { - // ServiceNameMappings returns a ServiceNameMappingInformer. - ServiceNameMappings() ServiceNameMappingInformer -} - -type version struct { - factory internalinterfaces.SharedInformerFactory - namespace string - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// New returns a new Interface. -func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { - return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} -} - -// ServiceNameMappings returns a ServiceNameMappingInformer. -func (v *version) ServiceNameMappings() ServiceNameMappingInformer { - return &serviceNameMappingInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} -} diff --git a/pkg/mapping/generated/informers/externalversions/factory.go b/pkg/mapping/generated/informers/externalversions/factory.go deleted file mode 100644 index 0c9497762..000000000 --- a/pkg/mapping/generated/informers/externalversions/factory.go +++ /dev/null @@ -1,251 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package externalversions - -import ( - versioned "github.com/apache/dubbo-admin/pkg/mapping/generated/clientset/versioned" - dubboapacheorg "github.com/apache/dubbo-admin/pkg/mapping/generated/informers/externalversions/dubbo.apache.org" - internalinterfaces "github.com/apache/dubbo-admin/pkg/mapping/generated/informers/externalversions/internalinterfaces" - reflect "reflect" - sync "sync" - time "time" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - cache "k8s.io/client-go/tools/cache" -) - -// SharedInformerOption defines the functional option type for SharedInformerFactory. -type SharedInformerOption func(*sharedInformerFactory) *sharedInformerFactory - -type sharedInformerFactory struct { - client versioned.Interface - namespace string - tweakListOptions internalinterfaces.TweakListOptionsFunc - lock sync.Mutex - defaultResync time.Duration - customResync map[reflect.Type]time.Duration - - informers map[reflect.Type]cache.SharedIndexInformer - // startedInformers is used for tracking which informers have been started. - // This allows Start() to be called multiple times safely. - startedInformers map[reflect.Type]bool - // wg tracks how many goroutines were started. - wg sync.WaitGroup - // shuttingDown is true when Shutdown has been called. It may still be running - // because it needs to wait for goroutines. - shuttingDown bool -} - -// WithCustomResyncConfig sets a custom resync period for the specified informer types. -func WithCustomResyncConfig(resyncConfig map[v1.Object]time.Duration) SharedInformerOption { - return func(factory *sharedInformerFactory) *sharedInformerFactory { - for k, v := range resyncConfig { - factory.customResync[reflect.TypeOf(k)] = v - } - return factory - } -} - -// WithTweakListOptions sets a custom filter on all listers of the configured SharedInformerFactory. -func WithTweakListOptions(tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerOption { - return func(factory *sharedInformerFactory) *sharedInformerFactory { - factory.tweakListOptions = tweakListOptions - return factory - } -} - -// WithNamespace limits the SharedInformerFactory to the specified namespace. -func WithNamespace(namespace string) SharedInformerOption { - return func(factory *sharedInformerFactory) *sharedInformerFactory { - factory.namespace = namespace - return factory - } -} - -// NewSharedInformerFactory constructs a new instance of sharedInformerFactory for all namespaces. -func NewSharedInformerFactory(client versioned.Interface, defaultResync time.Duration) SharedInformerFactory { - return NewSharedInformerFactoryWithOptions(client, defaultResync) -} - -// NewFilteredSharedInformerFactory constructs a new instance of sharedInformerFactory. -// Listers obtained via this SharedInformerFactory will be subject to the same filters -// as specified here. -// Deprecated: Please use NewSharedInformerFactoryWithOptions instead -func NewFilteredSharedInformerFactory(client versioned.Interface, defaultResync time.Duration, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerFactory { - return NewSharedInformerFactoryWithOptions(client, defaultResync, WithNamespace(namespace), WithTweakListOptions(tweakListOptions)) -} - -// NewSharedInformerFactoryWithOptions constructs a new instance of a SharedInformerFactory with additional options. -func NewSharedInformerFactoryWithOptions(client versioned.Interface, defaultResync time.Duration, options ...SharedInformerOption) SharedInformerFactory { - factory := &sharedInformerFactory{ - client: client, - namespace: v1.NamespaceAll, - defaultResync: defaultResync, - informers: make(map[reflect.Type]cache.SharedIndexInformer), - startedInformers: make(map[reflect.Type]bool), - customResync: make(map[reflect.Type]time.Duration), - } - - // Apply all options - for _, opt := range options { - factory = opt(factory) - } - - return factory -} - -func (f *sharedInformerFactory) Start(stopCh <-chan struct{}) { - f.lock.Lock() - defer f.lock.Unlock() - - if f.shuttingDown { - return - } - - for informerType, informer := range f.informers { - if !f.startedInformers[informerType] { - f.wg.Add(1) - // We need a new variable in each loop iteration, - // otherwise the goroutine would use the loop variable - // and that keeps changing. - informer := informer - go func() { - defer f.wg.Done() - informer.Run(stopCh) - }() - f.startedInformers[informerType] = true - } - } -} - -func (f *sharedInformerFactory) Shutdown() { - f.lock.Lock() - f.shuttingDown = true - f.lock.Unlock() - - // Will return immediately if there is nothing to wait for. - f.wg.Wait() -} - -func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool { - informers := func() map[reflect.Type]cache.SharedIndexInformer { - f.lock.Lock() - defer f.lock.Unlock() - - informers := map[reflect.Type]cache.SharedIndexInformer{} - for informerType, informer := range f.informers { - if f.startedInformers[informerType] { - informers[informerType] = informer - } - } - return informers - }() - - res := map[reflect.Type]bool{} - for informType, informer := range informers { - res[informType] = cache.WaitForCacheSync(stopCh, informer.HasSynced) - } - return res -} - -// InternalInformerFor returns the SharedIndexInformer for obj using an internal -// client. -func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer { - f.lock.Lock() - defer f.lock.Unlock() - - informerType := reflect.TypeOf(obj) - informer, exists := f.informers[informerType] - if exists { - return informer - } - - resyncPeriod, exists := f.customResync[informerType] - if !exists { - resyncPeriod = f.defaultResync - } - - informer = newFunc(f.client, resyncPeriod) - f.informers[informerType] = informer - - return informer -} - -// SharedInformerFactory provides shared informers for resources in all known -// API group versions. -// -// It is typically used like this: -// -// ctx, cancel := context.Background() -// defer cancel() -// factory := NewSharedInformerFactory(client, resyncPeriod) -// defer factory.WaitForStop() // Returns immediately if nothing was started. -// genericInformer := factory.ForResource(resource) -// typedInformer := factory.SomeAPIGroup().V1().SomeType() -// factory.Start(ctx.Done()) // Start processing these informers. -// synced := factory.WaitForCacheSync(ctx.Done()) -// for v, ok := range synced { -// if !ok { -// fmt.Fprintf(os.Stderr, "caches failed to sync: %v", v) -// return -// } -// } -// -// // Creating informers can also be created after Start, but then -// // Start must be called again: -// anotherGenericInformer := factory.ForResource(resource) -// factory.Start(ctx.Done()) -type SharedInformerFactory interface { - internalinterfaces.SharedInformerFactory - - // Start initializes all requested informers. They are handled in goroutines - // which run until the stop channel gets closed. - Start(stopCh <-chan struct{}) - - // Shutdown marks a factory as shutting down. At that point no new - // informers can be started anymore and Start will return without - // doing anything. - // - // In addition, Shutdown blocks until all goroutines have terminated. For that - // to happen, the close channel(s) that they were started with must be closed, - // either before Shutdown gets called or while it is waiting. - // - // Shutdown may be called multiple times, even concurrently. All such calls will - // block until all goroutines have terminated. - Shutdown() - - // WaitForCacheSync blocks until all started informers' caches were synced - // or the stop channel gets closed. - WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool - - // ForResource gives generic access to a shared informer of the matching type. - ForResource(resource schema.GroupVersionResource) (GenericInformer, error) - - // InternalInformerFor returns the SharedIndexInformer for obj using an internal - // client. - InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer - - Dubbo() dubboapacheorg.Interface -} - -func (f *sharedInformerFactory) Dubbo() dubboapacheorg.Interface { - return dubboapacheorg.New(f, f.namespace, f.tweakListOptions) -} diff --git a/pkg/mapping/generated/informers/externalversions/generic.go b/pkg/mapping/generated/informers/externalversions/generic.go deleted file mode 100644 index 87dd38b88..000000000 --- a/pkg/mapping/generated/informers/externalversions/generic.go +++ /dev/null @@ -1,62 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package externalversions - -import ( - "fmt" - v1alpha1 "github.com/apache/dubbo-admin/pkg/mapping/apis/dubbo.apache.org/v1alpha1" - - schema "k8s.io/apimachinery/pkg/runtime/schema" - cache "k8s.io/client-go/tools/cache" -) - -// GenericInformer is type of SharedIndexInformer which will locate and delegate to other -// sharedInformers based on type -type GenericInformer interface { - Informer() cache.SharedIndexInformer - Lister() cache.GenericLister -} - -type genericInformer struct { - informer cache.SharedIndexInformer - resource schema.GroupResource -} - -// Informer returns the SharedIndexInformer. -func (f *genericInformer) Informer() cache.SharedIndexInformer { - return f.informer -} - -// Lister returns the GenericLister. -func (f *genericInformer) Lister() cache.GenericLister { - return cache.NewGenericLister(f.Informer().GetIndexer(), f.resource) -} - -// ForResource gives generic access to a shared informer of the matching type -// TODO extend this to unknown resources with a client pool -func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { - switch resource { - // Group=dubbo.apache.org, Version=v1alpha1 - case v1alpha1.SchemeGroupVersion.WithResource("servicenamemappings"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Dubbo().V1alpha1().ServiceNameMappings().Informer()}, nil - - } - - return nil, fmt.Errorf("no informer found for %v", resource) -} diff --git a/pkg/mapping/generated/informers/externalversions/internalinterfaces/factory_interfaces.go b/pkg/mapping/generated/informers/externalversions/internalinterfaces/factory_interfaces.go deleted file mode 100644 index bcfaeff39..000000000 --- a/pkg/mapping/generated/informers/externalversions/internalinterfaces/factory_interfaces.go +++ /dev/null @@ -1,40 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package internalinterfaces - -import ( - versioned "github.com/apache/dubbo-admin/pkg/mapping/generated/clientset/versioned" - time "time" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - cache "k8s.io/client-go/tools/cache" -) - -// NewInformerFunc takes versioned.Interface and time.Duration to return a SharedIndexInformer. -type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer - -// SharedInformerFactory a small interface to allow for adding an informer without an import cycle -type SharedInformerFactory interface { - Start(stopCh <-chan struct{}) - InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer -} - -// TweakListOptionsFunc is a function that transforms a v1.ListOptions. -type TweakListOptionsFunc func(*v1.ListOptions) diff --git a/pkg/mapping/generated/listers/dubbo.apache.org/v1alpha1/expansion_generated.go b/pkg/mapping/generated/listers/dubbo.apache.org/v1alpha1/expansion_generated.go deleted file mode 100644 index ef7453f39..000000000 --- a/pkg/mapping/generated/listers/dubbo.apache.org/v1alpha1/expansion_generated.go +++ /dev/null @@ -1,27 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by lister-gen. DO NOT EDIT. - -package v1alpha1 - -// ServiceNameMappingListerExpansion allows custom methods to be added to -// ServiceNameMappingLister. -type ServiceNameMappingListerExpansion interface{} - -// ServiceNameMappingNamespaceListerExpansion allows custom methods to be added to -// ServiceNameMappingNamespaceLister. -type ServiceNameMappingNamespaceListerExpansion interface{} diff --git a/pkg/mapping/kube/client.go b/pkg/mapping/kube/client.go deleted file mode 100644 index e24876851..000000000 --- a/pkg/mapping/kube/client.go +++ /dev/null @@ -1,137 +0,0 @@ -/* -Licensed to the Apache Software Foundation (ASF) under one or more -contributor license agreements. See the NOTICE file distributed with -this work for additional information regarding copyright ownership. -The ASF licenses this file to You under the Apache License, Version 2.0 -(the "License"); you may not use this file except in compliance with -the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package kube - -import ( - "flag" - "fmt" - "github.com/apache/dubbo-admin/pkg/logger" - corev1 "github.com/apache/dubbo-admin/pkg/mapping/apis/dubbo.apache.org/v1alpha1" - "github.com/apache/dubbo-admin/pkg/mapping/config" - clientsetClient "github.com/apache/dubbo-admin/pkg/mapping/generated/clientset/versioned" - informers "github.com/apache/dubbo-admin/pkg/mapping/generated/informers/externalversions" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/client-go/kubernetes" - "k8s.io/client-go/rest" - "k8s.io/client-go/tools/clientcmd" - "k8s.io/client-go/util/homedir" - "os" - "path/filepath" - "time" -) - -var kubeconfig string - -func init() { - flag.StringVar(&kubeconfig, "kubeconfig", "", - "Paths to a kubeconfig. Only required if out-of-cluster.") -} - -type Client interface { - Init(options *config.Options) bool - Admin() clientsetClient.Interface - InitContainer() -} - -type client struct { - options *config.Options - kube kubernetes.Interface - informerClient *clientsetClient.Clientset - kubeClient *kubernetes.Clientset -} - -func NewClient() Client { - return &client{} -} - -func (c *client) Admin() clientsetClient.Interface { - return c.informerClient -} - -func (c *client) Init(options *config.Options) bool { - c.options = options - config, err := rest.InClusterConfig() - if err != nil { - if len(kubeconfig) <= 0 { - kubeconfig = os.Getenv(clientcmd.RecommendedConfigPathEnvVar) - if len(kubeconfig) <= 0 { - if home := homedir.HomeDir(); home != "" { - kubeconfig = filepath.Join(home, ".kube", "config") - } - } - } - logger.Sugar().Infof("Read kubeconfig from %s", kubeconfig) - config, err = clientcmd.BuildConfigFromFlags("", kubeconfig) - if err != nil { - logger.Sugar().Warnf("Failed to load config from kube config file.") - return false - } - } - clientSet, err := kubernetes.NewForConfig(config) - if err != nil { - logger.Sugar().Warnf("Failed to create client to kubernetes. " + err.Error()) - return false - } - informerClient, err := clientsetClient.NewForConfig(config) - if err != nil { - logger.Sugar().Warnf("Failed to create client to kubernetes. " + err.Error()) - return false - } - service := &corev1.ServiceNameMapping{ - ObjectMeta: metav1.ObjectMeta{ - Name: "my-app", - Namespace: "default", - Annotations: map[string]string{ - "dubbo.apache.org/application": "dubbo-admin", - "dubbo.apache.org/protocol": "dubbo", - }, - }, - Spec: corev1.ServiceNameMappingSpec{ - InterfaceName: "dubbo", - ApplicationNames: []string{ - "dubbo-admin", - }, - }, - } - if err != nil { - fmt.Printf("Failed to convert service to unstructured: %v\n", err) - os.Exit(1) - } - logger.Sugar().Infof("Service created: %s\n", service.Name) - if err != nil { - logger.Sugar().Errorf("Failed to convert service to unstructured: %v\n", err) - os.Exit(1) - } - c.kubeClient = clientSet - c.informerClient = informerClient - - return true - -} - -func (c *client) InitContainer() { - logger.Sugar().Info("Init controller...") - informerFactory := informers.NewSharedInformerFactory(c.informerClient, time.Second*10) - controller := NewController(informerFactory.Dubbo().V1alpha1().ServiceNameMappings()) - stopCh := make(chan struct{}) - informerFactory.Start(stopCh) - err := controller.PreRun(1, stopCh) - if err != nil { - return - } -} diff --git a/pkg/mapping/kube/controller.go b/pkg/mapping/kube/controller.go deleted file mode 100644 index 2a8451998..000000000 --- a/pkg/mapping/kube/controller.go +++ /dev/null @@ -1,155 +0,0 @@ -/* -Licensed to the Apache Software Foundation (ASF) under one or more -contributor license agreements. See the NOTICE file distributed with -this work for additional information regarding copyright ownership. -The ASF licenses this file to You under the Apache License, Version 2.0 -(the "License"); you may not use this file except in compliance with -the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package kube - -import ( - "fmt" - "github.com/apache/dubbo-admin/pkg/logger" - crdV1alpha1 "github.com/apache/dubbo-admin/pkg/mapping/apis/dubbo.apache.org/v1alpha1" - informerV1alpha1 "github.com/apache/dubbo-admin/pkg/mapping/generated/informers/externalversions/dubbo.apache.org/v1alpha1" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/util/runtime" - "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/client-go/tools/cache" - "k8s.io/client-go/util/workqueue" - "time" -) - -type Controller struct { - informer informerV1alpha1.ServiceNameMappingInformer - workqueue workqueue.RateLimitingInterface - informerSynced cache.InformerSynced -} - -func NewController(spInformer informerV1alpha1.ServiceNameMappingInformer) *Controller { - controller := &Controller{ - informer: spInformer, - workqueue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "ServiceMappings"), - } - logger.Sugar().Info("Setting up service mappings event handlers") - _, err := spInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{ - AddFunc: controller.enqueueServiceMapping, - UpdateFunc: func(old, new interface{}) { - oldObj := old.(*crdV1alpha1.ServiceNameMapping) - newObj := new.(*crdV1alpha1.ServiceNameMapping) - if oldObj.ResourceVersion == newObj.ResourceVersion { - return - } - controller.enqueueServiceMapping(new) - }, - DeleteFunc: controller.enqueueServiceMappingForDelete, - }) - if err != nil { - return nil - } - return controller -} - -func (c *Controller) Process() bool { - obj, shutdown := c.workqueue.Get() - if shutdown { - return false - } - err := func(obj interface{}) error { - defer c.workqueue.Done(obj) - var key string - var ok bool - if key, ok = obj.(string); !ok { - c.workqueue.Forget(obj) - runtime.HandleError(fmt.Errorf("expected string in workqueue but got %#v", obj)) - return nil - } - if err := c.syncHandler(key); err != nil { - logger.Sugar().Error("error syncing '%s': %s", key, err.Error()) - return nil - } - c.workqueue.Forget(obj) - logger.Sugar().Infof("Successfully synced %s", key) - return nil - }(obj) - - if err != nil { - runtime.HandleError(err) - return true - } - return true -} -func (c *Controller) PreRun(thread int, stopCh <-chan struct{}) error { - defer runtime.HandleCrash() - defer c.workqueue.ShutDown() - - logger.Sugar().Info("Starting Service Mapping control loop") - logger.Sugar().Info("Waiting for informer caches to sync") - logger.Sugar().Info("Starting sync") - for i := 0; i < thread; i++ { - go wait.Until(c.Run, time.Second, stopCh) - } - logger.Sugar().Info("Started sync") - <-stopCh - logger.Sugar().Info("Shutting down") - return nil -} - -func (c *Controller) Run() { - for c.Process() { - } -} - -func (c *Controller) syncHandler(key string) error { - namespace, name, err := cache.SplitMetaNamespaceKey(key) - if err != nil { - runtime.HandleError(fmt.Errorf("invalid resource key: %s", key)) - return nil - } - - sp, err := c.informer.Lister().ServiceNameMappings(namespace).Get(name) - - if err != nil { - if errors.IsNotFound(err) { - logger.Sugar().Warnf("[ServiceMappingsCRD] %s/%s does not exist in local cache, will delete it from service mapping ...", - namespace, name) - logger.Sugar().Infof("[ServiceMappingsCRD] deleting service mapping: %s/%s ...", namespace, name) - return nil - } - runtime.HandleError(fmt.Errorf("failed to get service mapping by: %s/%s", namespace, name)) - return err - } - logger.Sugar().Infof("[ServiceMappingsCRD] Trying to handle service mapping: %#v ...", sp) - return nil -} - -func (c *Controller) enqueueServiceMapping(obj interface{}) { - var key string - var err error - if key, err = cache.MetaNamespaceKeyFunc(obj); err != nil { - runtime.HandleError(err) - return - } - c.workqueue.AddRateLimited(key) -} - -func (c *Controller) enqueueServiceMappingForDelete(obj interface{}) { - var key string - var err error - key, err = cache.DeletionHandlingMetaNamespaceKeyFunc(obj) - if err != nil { - runtime.HandleError(err) - return - } - c.workqueue.AddRateLimited(key) -} diff --git a/pkg/mapping/model/config.go b/pkg/mapping/model/config.go deleted file mode 100644 index 6f0ec5d86..000000000 --- a/pkg/mapping/model/config.go +++ /dev/null @@ -1,32 +0,0 @@ -/* -Licensed to the Apache Software Foundation (ASF) under one or more -contributor license agreements. See the NOTICE file distributed with -this work for additional information regarding copyright ownership. -The ASF licenses this file to You under the Apache License, Version 2.0 -(the "License"); you may not use this file except in compliance with -the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package model - -type Config struct { - Spec Spec - Status Status -} - -type ConfigKey struct { - Name string - Namespace string -} - -type Spec interface{} - -type Status interface{} diff --git a/pkg/mapping/v1alpha1/servicenamemapping.pb.go b/pkg/mapping/v1alpha1/servicenamemapping.pb.go deleted file mode 100644 index d05f85b9e..000000000 --- a/pkg/mapping/v1alpha1/servicenamemapping.pb.go +++ /dev/null @@ -1,154 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc v3.21.5 -// source: servicenamemapping.proto - -package v1alpha1 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type ServiceNameMapping struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - InterfaceName string `protobuf:"bytes,1,opt,name=interfaceName,proto3" json:"interfaceName,omitempty"` - ApplicationNames []string `protobuf:"bytes,2,rep,name=applicationNames,proto3" json:"applicationNames,omitempty"` -} - -func (x *ServiceNameMapping) Reset() { - *x = ServiceNameMapping{} - if protoimpl.UnsafeEnabled { - mi := &file_servicenamemapping_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ServiceNameMapping) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ServiceNameMapping) ProtoMessage() {} - -func (x *ServiceNameMapping) ProtoReflect() protoreflect.Message { - mi := &file_servicenamemapping_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ServiceNameMapping.ProtoReflect.Descriptor instead. -func (*ServiceNameMapping) Descriptor() ([]byte, []int) { - return file_servicenamemapping_proto_rawDescGZIP(), []int{0} -} - -func (x *ServiceNameMapping) GetInterfaceName() string { - if x != nil { - return x.InterfaceName - } - return "" -} - -func (x *ServiceNameMapping) GetApplicationNames() []string { - if x != nil { - return x.ApplicationNames - } - return nil -} - -var File_servicenamemapping_proto protoreflect.FileDescriptor - -var file_servicenamemapping_proto_rawDesc = []byte{ - 0x0a, 0x18, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x6d, 0x61, 0x70, - 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x22, 0x66, 0x0a, 0x12, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, - 0x61, 0x6d, 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x12, 0x24, 0x0a, 0x0d, 0x69, 0x6e, - 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0d, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, - 0x12, 0x2a, 0x0a, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, - 0x61, 0x6d, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x10, 0x61, 0x70, 0x70, 0x6c, - 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x42, 0x04, 0x5a, 0x02, - 0x2e, 0x2f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_servicenamemapping_proto_rawDescOnce sync.Once - file_servicenamemapping_proto_rawDescData = file_servicenamemapping_proto_rawDesc -) - -func file_servicenamemapping_proto_rawDescGZIP() []byte { - file_servicenamemapping_proto_rawDescOnce.Do(func() { - file_servicenamemapping_proto_rawDescData = protoimpl.X.CompressGZIP(file_servicenamemapping_proto_rawDescData) - }) - return file_servicenamemapping_proto_rawDescData -} - -var file_servicenamemapping_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_servicenamemapping_proto_goTypes = []interface{}{ - (*ServiceNameMapping)(nil), // 0: v1alpha1.ServiceNameMapping -} -var file_servicenamemapping_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_servicenamemapping_proto_init() } -func file_servicenamemapping_proto_init() { - if File_servicenamemapping_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_servicenamemapping_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ServiceNameMapping); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_servicenamemapping_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_servicenamemapping_proto_goTypes, - DependencyIndexes: file_servicenamemapping_proto_depIdxs, - MessageInfos: file_servicenamemapping_proto_msgTypes, - }.Build() - File_servicenamemapping_proto = out.File - file_servicenamemapping_proto_rawDesc = nil - file_servicenamemapping_proto_goTypes = nil - file_servicenamemapping_proto_depIdxs = nil -} diff --git a/pkg/mapping/v1alpha1/servicenamemapping.proto b/pkg/mapping/v1alpha1/servicenamemapping.proto deleted file mode 100644 index 320184be8..000000000 --- a/pkg/mapping/v1alpha1/servicenamemapping.proto +++ /dev/null @@ -1,15 +0,0 @@ -syntax = "proto3"; - -package v1alpha1; - -option go_package="./"; - -// +kubetype-gen -// +kubetype-gen:groupVersion=dubbo.apache.org/v1alpha1 -// +genclient -// +k8s:deepcopy-gen=true - -message ServiceNameMapping{ - string interfaceName = 1; - repeated string applicationNames = 2; -} \ No newline at end of file diff --git a/pkg/mapping/v1alpha1/snp.pb.go b/pkg/mapping/v1alpha1/snp.pb.go deleted file mode 100644 index f79c1e1bb..000000000 --- a/pkg/mapping/v1alpha1/snp.pb.go +++ /dev/null @@ -1,315 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc v3.21.5 -// source: snp.proto - -package v1alpha1 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// When dubbo provider start up, it reports its applicationName and its interfaceName, -// and Dubbo consumer will get the service name mapping info by xDS. -type ServiceMappingRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // This is namespace of proxyless dubbo server - Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` - ApplicationName string `protobuf:"bytes,2,opt,name=applicationName,proto3" json:"applicationName,omitempty"` - InterfaceNames []string `protobuf:"bytes,3,rep,name=interfaceNames,proto3" json:"interfaceNames,omitempty"` -} - -func (x *ServiceMappingRequest) Reset() { - *x = ServiceMappingRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_snp_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ServiceMappingRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ServiceMappingRequest) ProtoMessage() {} - -func (x *ServiceMappingRequest) ProtoReflect() protoreflect.Message { - mi := &file_snp_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ServiceMappingRequest.ProtoReflect.Descriptor instead. -func (*ServiceMappingRequest) Descriptor() ([]byte, []int) { - return file_snp_proto_rawDescGZIP(), []int{0} -} - -func (x *ServiceMappingRequest) GetNamespace() string { - if x != nil { - return x.Namespace - } - return "" -} - -func (x *ServiceMappingRequest) GetApplicationName() string { - if x != nil { - return x.ApplicationName - } - return "" -} - -func (x *ServiceMappingRequest) GetInterfaceNames() []string { - if x != nil { - return x.InterfaceNames - } - return nil -} - -type ServiceMappingResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *ServiceMappingResponse) Reset() { - *x = ServiceMappingResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_snp_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ServiceMappingResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ServiceMappingResponse) ProtoMessage() {} - -func (x *ServiceMappingResponse) ProtoReflect() protoreflect.Message { - mi := &file_snp_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ServiceMappingResponse.ProtoReflect.Descriptor instead. -func (*ServiceMappingResponse) Descriptor() ([]byte, []int) { - return file_snp_proto_rawDescGZIP(), []int{1} -} - -type ServiceMappingXdsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // This is namespace of proxyless dubbo server - Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` - InterfaceName string `protobuf:"bytes,2,opt,name=interfaceName,proto3" json:"interfaceName,omitempty"` - ApplicationNames []string `protobuf:"bytes,3,rep,name=applicationNames,proto3" json:"applicationNames,omitempty"` -} - -func (x *ServiceMappingXdsResponse) Reset() { - *x = ServiceMappingXdsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_snp_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ServiceMappingXdsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ServiceMappingXdsResponse) ProtoMessage() {} - -func (x *ServiceMappingXdsResponse) ProtoReflect() protoreflect.Message { - mi := &file_snp_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ServiceMappingXdsResponse.ProtoReflect.Descriptor instead. -func (*ServiceMappingXdsResponse) Descriptor() ([]byte, []int) { - return file_snp_proto_rawDescGZIP(), []int{2} -} - -func (x *ServiceMappingXdsResponse) GetNamespace() string { - if x != nil { - return x.Namespace - } - return "" -} - -func (x *ServiceMappingXdsResponse) GetInterfaceName() string { - if x != nil { - return x.InterfaceName - } - return "" -} - -func (x *ServiceMappingXdsResponse) GetApplicationNames() []string { - if x != nil { - return x.ApplicationNames - } - return nil -} - -var File_snp_proto protoreflect.FileDescriptor - -var file_snp_proto_rawDesc = []byte{ - 0x0a, 0x09, 0x73, 0x6e, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x22, 0x87, 0x01, 0x0a, 0x15, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x28, 0x0a, - 0x0f, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x0e, 0x69, 0x6e, 0x74, 0x65, 0x72, - 0x66, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x0e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x22, - 0x18, 0x0a, 0x16, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, - 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x8b, 0x01, 0x0a, 0x19, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x58, 0x64, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, - 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, - 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, - 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x69, 0x6e, - 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x10, 0x61, - 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x18, - 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x32, 0x7b, 0x0a, 0x19, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x12, 0x5e, 0x0a, 0x19, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x41, 0x70, 0x70, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, - 0x67, 0x12, 0x1f, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x04, 0x5a, 0x02, 0x2e, 0x2f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, -} - -var ( - file_snp_proto_rawDescOnce sync.Once - file_snp_proto_rawDescData = file_snp_proto_rawDesc -) - -func file_snp_proto_rawDescGZIP() []byte { - file_snp_proto_rawDescOnce.Do(func() { - file_snp_proto_rawDescData = protoimpl.X.CompressGZIP(file_snp_proto_rawDescData) - }) - return file_snp_proto_rawDescData -} - -var file_snp_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_snp_proto_goTypes = []interface{}{ - (*ServiceMappingRequest)(nil), // 0: v1alpha1.ServiceMappingRequest - (*ServiceMappingResponse)(nil), // 1: v1alpha1.ServiceMappingResponse - (*ServiceMappingXdsResponse)(nil), // 2: v1alpha1.ServiceMappingXdsResponse -} -var file_snp_proto_depIdxs = []int32{ - 0, // 0: v1alpha1.ServiceNameMappingService.registerServiceAppMapping:input_type -> v1alpha1.ServiceMappingRequest - 1, // 1: v1alpha1.ServiceNameMappingService.registerServiceAppMapping:output_type -> v1alpha1.ServiceMappingResponse - 1, // [1:2] is the sub-list for method output_type - 0, // [0:1] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_snp_proto_init() } -func file_snp_proto_init() { - if File_snp_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_snp_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ServiceMappingRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_snp_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ServiceMappingResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_snp_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ServiceMappingXdsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_snp_proto_rawDesc, - NumEnums: 0, - NumMessages: 3, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_snp_proto_goTypes, - DependencyIndexes: file_snp_proto_depIdxs, - MessageInfos: file_snp_proto_msgTypes, - }.Build() - File_snp_proto = out.File - file_snp_proto_rawDesc = nil - file_snp_proto_goTypes = nil - file_snp_proto_depIdxs = nil -} diff --git a/pkg/mapping/v1alpha1/snp.proto b/pkg/mapping/v1alpha1/snp.proto deleted file mode 100644 index 1c207cab9..000000000 --- a/pkg/mapping/v1alpha1/snp.proto +++ /dev/null @@ -1,35 +0,0 @@ -syntax = "proto3"; - -package v1alpha1; - -option go_package = "./"; - -// Provides an service for reporting the mapping relationship between interface => cluster -// the cluster name will be versioned FQDN. such as "demo.default.svc.cluster.local" -service ServiceNameMappingService{ - rpc registerServiceAppMapping(ServiceMappingRequest) returns (ServiceMappingResponse); -} - -// When dubbo provider start up, it reports its applicationName and its interfaceName, -// and Dubbo consumer will get the service name mapping info by xDS. -message ServiceMappingRequest{ - // This is namespace of proxyless dubbo server - string namespace = 1; - - string applicationName = 2; - - repeated string interfaceNames = 3; -} - -message ServiceMappingResponse{ -} - - -message ServiceMappingXdsResponse{ - // This is namespace of proxyless dubbo server - string namespace = 1; - - string interfaceName = 2; - - repeated string applicationNames = 3; -} \ No newline at end of file diff --git a/pkg/mapping/v1alpha1/snp_grpc.pb.go b/pkg/mapping/v1alpha1/snp_grpc.pb.go deleted file mode 100644 index cb0d24ef4..000000000 --- a/pkg/mapping/v1alpha1/snp_grpc.pb.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc v3.21.5 -// source: snp.proto - -package v1alpha1 - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -const ( - ServiceNameMappingService_RegisterServiceAppMapping_FullMethodName = "/v1alpha1.ServiceNameMappingService/registerServiceAppMapping" -) - -// ServiceNameMappingServiceClient is the client API for ServiceNameMappingService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type ServiceNameMappingServiceClient interface { - RegisterServiceAppMapping(ctx context.Context, in *ServiceMappingRequest, opts ...grpc.CallOption) (*ServiceMappingResponse, error) -} - -type serviceNameMappingServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewServiceNameMappingServiceClient(cc grpc.ClientConnInterface) ServiceNameMappingServiceClient { - return &serviceNameMappingServiceClient{cc} -} - -func (c *serviceNameMappingServiceClient) RegisterServiceAppMapping(ctx context.Context, in *ServiceMappingRequest, opts ...grpc.CallOption) (*ServiceMappingResponse, error) { - out := new(ServiceMappingResponse) - err := c.cc.Invoke(ctx, ServiceNameMappingService_RegisterServiceAppMapping_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// ServiceNameMappingServiceServer is the server API for ServiceNameMappingService service. -// All implementations must embed UnimplementedServiceNameMappingServiceServer -// for forward compatibility -type ServiceNameMappingServiceServer interface { - RegisterServiceAppMapping(context.Context, *ServiceMappingRequest) (*ServiceMappingResponse, error) - mustEmbedUnimplementedServiceNameMappingServiceServer() -} - -// UnimplementedServiceNameMappingServiceServer must be embedded to have forward compatible implementations. -type UnimplementedServiceNameMappingServiceServer struct { -} - -func (UnimplementedServiceNameMappingServiceServer) RegisterServiceAppMapping(context.Context, *ServiceMappingRequest) (*ServiceMappingResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RegisterServiceAppMapping not implemented") -} -func (UnimplementedServiceNameMappingServiceServer) mustEmbedUnimplementedServiceNameMappingServiceServer() { -} - -// UnsafeServiceNameMappingServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to ServiceNameMappingServiceServer will -// result in compilation errors. -type UnsafeServiceNameMappingServiceServer interface { - mustEmbedUnimplementedServiceNameMappingServiceServer() -} - -func RegisterServiceNameMappingServiceServer(s grpc.ServiceRegistrar, srv ServiceNameMappingServiceServer) { - s.RegisterService(&ServiceNameMappingService_ServiceDesc, srv) -} - -func _ServiceNameMappingService_RegisterServiceAppMapping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ServiceMappingRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServiceNameMappingServiceServer).RegisterServiceAppMapping(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ServiceNameMappingService_RegisterServiceAppMapping_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServiceNameMappingServiceServer).RegisterServiceAppMapping(ctx, req.(*ServiceMappingRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// ServiceNameMappingService_ServiceDesc is the grpc.ServiceDesc for ServiceNameMappingService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var ServiceNameMappingService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "v1alpha1.ServiceNameMappingService", - HandlerType: (*ServiceNameMappingServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "registerServiceAppMapping", - Handler: _ServiceNameMappingService_RegisterServiceAppMapping_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "snp.proto", -} diff --git a/pkg/authority/apis/dubbo.apache.org/v1beta1/doc.go b/pkg/rule/apis/dubbo.apache.org/v1beta1/doc.go similarity index 100% rename from pkg/authority/apis/dubbo.apache.org/v1beta1/doc.go rename to pkg/rule/apis/dubbo.apache.org/v1beta1/doc.go diff --git a/pkg/authority/apis/dubbo.apache.org/v1beta1/register.go b/pkg/rule/apis/dubbo.apache.org/v1beta1/register.go similarity index 96% rename from pkg/authority/apis/dubbo.apache.org/v1beta1/register.go rename to pkg/rule/apis/dubbo.apache.org/v1beta1/register.go index 3e575c2c0..f659c7bbd 100644 --- a/pkg/authority/apis/dubbo.apache.org/v1beta1/register.go +++ b/pkg/rule/apis/dubbo.apache.org/v1beta1/register.go @@ -46,6 +46,10 @@ func addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(SchemeGroupVersion, &AuthenticationPolicy{}, &AuthorizationPolicy{}, + &ServiceNameMapping{}, + &ConditionRoute{}, + &DynamicConfig{}, + &TagRoute{}, ) metav1.AddToGroupVersion(scheme, SchemeGroupVersion) return nil diff --git a/pkg/rule/apis/dubbo.apache.org/v1beta1/types.go b/pkg/rule/apis/dubbo.apache.org/v1beta1/types.go new file mode 100644 index 000000000..a10223654 --- /dev/null +++ b/pkg/rule/apis/dubbo.apache.org/v1beta1/types.go @@ -0,0 +1,579 @@ +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// +genclient +// +kubebuilder:object:root=true +// +kubebuilder:resource:shortName=ac +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +type AuthenticationPolicy struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + // +optional + Spec AuthenticationPolicySpec `json:"spec"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +type AuthenticationPolicyList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata"` + + Items []AuthenticationPolicy `json:"items"` +} + +type AuthenticationPolicySpec struct { + // The action to take when a rule is matched. + // +required + // +kubebuilder:validation:Required + // +kubebuilder:validation:Type=string + // +kubebuilder:validation:Enum=NONE;DISABLED;PERMISSIVE;STRICT + Action string `json:"action"` + // +optional + Selector []AuthenticationPolicySelector `json:"selector,omitempty"` + + // +optional + PortLevel []AuthenticationPolicyPortLevel `json:"PortLevel,omitempty"` +} + +type AuthenticationPolicySelector struct { + // The namespaces to match of the source workload. + // +optional + Namespaces []string `json:"namespaces,omitempty"` + // The namespaces not to match of the source workload. + // +optional + NotNamespaces []string `json:"notNamespaces,omitempty"` + // The IP addresses to match of the source workload. + // +optional + IpBlocks []string `json:"ipBlocks,omitempty"` + // The IP addresses not to match of the source workload. + // +optional + NotIpBlocks []string `json:"notIpBlocks,omitempty"` + // The identities(from spiffe) to match of the source workload. + // +optional + Principals []string `json:"principals,omitempty"` + // The identities(from spiffe) not to match of the source workload. + // +optional + NotPrincipals []string `json:"notPrincipals,omitempty"` + // The extended identities(from Dubbo Auth) to match of the source workload. + // +optional + Extends []AuthenticationPolicyExtend `json:"extends,omitempty"` + // The extended identities(from Dubbo Auth) not to match of the source workload. + // +optional + NotExtends []AuthenticationPolicyExtend `json:"notExtends,omitempty"` +} + +type AuthenticationPolicyPortLevel struct { + // The key of the extended identity. + // +required + // +kubebuilder:validation:Required + // +kubebuilder:validation:Type=number + // +kubebuilder:validation:Minimum=0 + // +kubebuilder:validation:Maximum=65535 + // +kubebuilder:default=0 + Port int `json:"port,omitempty"` + // +required + // +kubebuilder:validation:Required + // +kubebuilder:validation:Type=string + // +kubebuilder:validation:Enum=NONE;DISABLED;PERMISSIVE;STRICT + Action string `json:"action,omitempty"` +} + +type AuthenticationPolicyExtend struct { + // The key of the extended identity. + // +optional + Key string `json:"key,omitempty"` + // The value of the extended identity. + // +optional + Value string `json:"value,omitempty"` +} + +// +genclient +// +kubebuilder:object:root=true +// +kubebuilder:resource:shortName=az +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +type AuthorizationPolicy struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + // +optional + Spec AuthorizationPolicySpec `json:"spec"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +type AuthorizationPolicyList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata"` + + Items []AuthorizationPolicy `json:"items"` +} + +type AuthorizationPolicySpec struct { + // The action to take when a rule is matched + // +required + // +kubebuilder:validation:Required + // +kubebuilder:validation:Type=string + // +kubebuilder:validation:Enum=ALLOW;DENY;ADUIT + Action string `json:"action"` + // +optional + Rules []AuthorizationPolicyRule `json:"rules,omitempty"` + // The sample rate of the rule. The value is between 0 and 100. + // +optional + // +kubebuilder:validation:Type=number + // +kubebuilder:validation:Minimum=0 + // +kubebuilder:validation:Maximum=100 + // +kubebuilder:default=100 + Samples float32 `json:"samples,omitempty"` + // The order of the rule. + // +optional + // +kubebuilder:validation:Type=number + // +kubebuilder:validation:Minimum=-2147483648 + // +kubebuilder:validation:Maximum=2147483647 + // +kubebuilder:default=0 + Order float32 `json:"order,omitempty"` + // The match type of the rules. + // +optional + // +kubebuilder:validation:Type=string + // +kubebuilder:validation:Enum=anyMatch;allMatch + // +kubebuilder:default=anyMatch + MatchType string `json:"matchType,omitempty"` +} + +type AuthorizationPolicyRule struct { + // The source of the traffic to be matched. + // +optional + From AuthorizationPolicySource `json:"from,omitempty"` + // The destination of the traffic to be matched. + // +optional + To AuthorizationPolicyTarget `json:"to,omitempty"` + // +optional + When AuthorizationPolicyCondition `json:"when,omitempty"` +} + +type AuthorizationPolicySource struct { + // The namespaces to match of the source workload. + // +optional + Namespaces []string `json:"namespaces,omitempty"` + // The namespaces not to match of the source workload. + // +optional + NotNamespaces []string `json:"notNamespaces,omitempty"` + // The IP addresses to match of the source workload. + // +optional + IpBlocks []string `json:"ipBlocks,omitempty"` + // The IP addresses not to match of the source workload. + // +optional + NotIpBlocks []string `json:"notIpBlocks,omitempty"` + // The identities(from spiffe) to match of the source workload. + // +optional + Principals []string `json:"principals,omitempty"` + // The identities(from spiffe) not to match of the source workload + // +optional + NotPrincipals []string `json:"notPrincipals,omitempty"` + // The extended identities(from Dubbo Auth) to match of the source workload. + // +optional + Extends []AuthorizationPolicyExtend `json:"extends,omitempty"` + // The extended identities(from Dubbo Auth) not to match of the source workload. + // +optional + NotExtends []AuthorizationPolicyExtend `json:"notExtends,omitempty"` +} + +type AuthorizationPolicyTarget struct { + // The namespaces to match of the source workload. + // +optional + Namespaces []string `json:"namespaces,omitempty"` + // The namespaces not to match of the source workload. + // +optional + NotNamespaces []string `json:"notNamespaces,omitempty"` + // The IP addresses to match of the destination workload. + // +optional + IpBlocks []string `json:"ipBlocks,omitempty"` + // The IP addresses not to match of the destination workload. + // +optional + NotIpBlocks []string `json:"notIpBlocks,omitempty"` + // The identities(from spiffe) to match of the destination workload. + // +optional + Principals []string `json:"principals,omitempty"` + // The identities(from spiffe) not to match of the destination workload. + // +optional + NotPrincipals []string `json:"notPrincipals,omitempty"` + // The extended identities(from Dubbo Auth) to match of the destination workload. + // +optional + Extends []AuthorizationPolicyExtend `json:"extends,omitempty"` + // The extended identities(from Dubbo Auth) not to match of the destination workload. + // +optional + NotExtends []AuthorizationPolicyExtend `json:"notExtends,omitempty"` +} + +type AuthorizationPolicyCondition struct { + // +optional + Key string `json:"key,omitempty"` + // +optional + Values []AuthorizationPolicyMatch `json:"values,omitempty"` + // +optional + NotValues []AuthorizationPolicyMatch `json:"notValues,omitempty"` +} + +type AuthorizationPolicyMatch struct { + // +optional + // +kubebuilder:validation:Type=string + // +kubebuilder:validation:Enum=equals;regex;ognl + // +kubebuilder:default=equals + Type string `json:"type,omitempty"` + // +optional + Value string `json:"value,omitempty"` +} + +type AuthorizationPolicyExtend struct { + // The key of the extended identity. + // +optional + Key string `json:"key,omitempty"` + // The value of the extended identity + // +optional + Value string `json:"value,omitempty"` +} + +// +kubetype-gen +// +kubetype-gen:groupVersion=dubbo.apache.org/v1alpha1 +// +genclient +// +genclient:noStatus +// +k8s:deepcopy-gen=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ServiceNameMapping struct { + metav1.TypeMeta `json:",inline"` + // +optional + metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + // +optional + Spec ServiceNameMappingSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` +} + +type ServiceNameMappingSpec struct { + InterfaceName string `json:"interfaceName,omitempty" protobuf:"bytes,1,opt,name=interfaceName,proto3"` + ApplicationNames []string `json:"applicationNames,omitempty" protobuf:"bytes,2,rep,name=applicationNames,proto3"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ServiceNameMappingList struct { + metav1.TypeMeta `json:",inline"` + // +optional + metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + Items []*ServiceNameMapping `json:"items" protobuf:"bytes,2,rep,name=items"` +} + +// ConditionRouteSpec defines the desired state of ConditionRoute +type ConditionRouteSpec struct { + // +optional + Priority int `json:"priority" yaml:"priority,omitempty"` + // Whether enable this rule or not, set enabled:false to disable this rule. + // +required + // +kubebuilder:validation:Required + // +kubebuilder:validation:Type=boolean + // +kubebuilder:default=true + Enabled bool `json:"enabled" yaml:"enabled"` + // The behaviour when the instance subset is empty after after routing. true means return no provider exception while false means ignore this rule. + // +optional + Force bool `json:"force" yaml:"force"` + // Whether run routing rule for every rpc invocation or use routing cache if available. + // +optional + Runtime bool `json:"runtime" yaml:"runtime"` + // The identifier of the target service or application that this rule is about to apply to. + // If scope:serviceis set, then keyshould be specified as the Dubbo service key that this rule targets to control. + // If scope:application is set, then keyshould be specified as the name of the application that this rule targets to control, application should always be a Dubbo Consumer. + // +required + // +kubebuilder:validation:Required + // +kubebuilder:validation:Type=string + Key string `json:"key" yaml:"key"` + // Supports service and application scope rules. + // +required + // +kubebuilder:validation:Required + // +kubebuilder:validation:Type=string + // +kubebuilder:validation:Enum=service;application + Scope string `json:"scope" yaml:"scope"` + // The condition routing rule definition of this configuration. Check Condition for details + // +required + // +kubebuilder:validation:Required + Conditions []string `json:"conditions" yaml:"conditions"` + // The version of the condition rule definition, currently available version is v3.0 + // +required + // +kubebuilder:validation:Required + // +kubebuilder:validation:Type=string + // +kubebuilder:validation:Enum=v3.0 + ConfigVersion string `json:"configVersion" yaml:"configVersion"` +} + +// +genclient +//+kubebuilder:object:root=true +// +kubebuilder:resource:shortName=cd +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// ConditionRoute is the Schema for the conditionroutes API +type ConditionRoute struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + // +optional + Spec ConditionRouteSpec `json:"spec"` +} + +//+kubebuilder:object:root=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// ConditionRouteList contains a list of ConditionRoute +type ConditionRouteList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []ConditionRoute `json:"items"` +} + +// TagRouteSpec defines the desired state of TagRoute +type TagRouteSpec struct { + // +optional + // +kubebuilder:validation:Optional + // +kubebuilder:validation:integer + // +kubebuilder:validation:Minimum=-2147483648 + // +kubebuilder:validation:Maximum=2147483647 + Priority int `json:"priority,omitempty"` + // Whether enable this rule or not, set enabled:false to disable this rule. + // +required + // +kubebuilder:validation:Required + // +kubebuilder:validation:Type=boolean + // +kubebuilder:default=true + Enabled bool `json:"enabled,omitempty"` + // The behaviour when the instance subset is empty after after routing. true means return no provider exception while false means ignore this rule. + // +optional + // +kubebuilder:validation:Optional + // +kubebuilder:validation:boolean + // +kubebuilder:default=true + Force bool `json:"force,omitempty"` + // Whether run routing rule for every rpc invocation or use routing cache if available. + // +optional + // +kubebuilder:validation:Optional + // +kubebuilder:validation:boolean + // +kubebuilder:default=true + Runtime bool `json:"runtime,omitempty"` + // The identifier of the target application that this rule is about to control + // +required + // +kubebuilder:validation:Required + // +kubebuilder:validation:Type=string + Key string `json:"key,omitempty"` + // The tag definition of this rule. + // +required + // +kubebuilder:validation:Required + Tags []Tag `json:"tags,omitempty"` + // The version of the tag rule definition, currently available version is v3.0 + // +required + // +kubebuilder:validation:Required + // +kubebuilder:validation:Type=string + // +kubebuilder:validation:Enum=v3.0 + ConfigVersion string `json:"configVersion,omitempty"` +} + +type Tag struct { + // The name of the tag used to match the dubbo.tag value in the request context. + // +required + // +kubebuilder:validation:Required + // +kubebuilder:validation:Type=string + Name string `json:"name,omitempty"` + // A set of criterion to be met for instances to be classified as member of this tag. + // +optional + // +kubebuilder:validation:Optional + Match []ParamMatch `json:"match,omitempty"` + // +optional + Addresses []string `json:"addresses,omitempty"` +} + +type StringMatch struct { + // +optional + Exact string `json:"exact,omitempty"` + // +optional + Prefix string `json:"prefix,omitempty"` + // +optional + Regex string `json:"regex,omitempty"` + // +optional + Noempty string `json:"noempty,omitempty"` + // +optional + Empty string `json:"empty,omitempty"` + // +optional + Wildcard string `json:"wildcard,omitempty"` +} + +type ParamMatch struct { + // The name of the key in the Dubbo url address. + // +required + // +kubebuilder:validation:Required + // +kubebuilder:validation:Type=string + Key string `json:"key,omitempty"` + // The matching condition for the value in the Dubbo url address. + // +required + Value StringMatch `json:"value,omitempty"` +} + +// +genclient +// +kubebuilder:object:root=true +// +kubebuilder:resource:shortName=tg +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// TagRoute is the Schema for the tagroutes API +type TagRoute struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + // +optional + Spec TagRouteSpec `json:"spec"` +} + +//+kubebuilder:object:root=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// TagRouteList contains a list of TagRoute +type TagRouteList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []TagRoute `json:"items"` +} + +// DynamicConfigSpec defines the desired state of DynamicConfig +type DynamicConfigSpec struct { + // The identifier of the target service or application that this rule is about to apply to. + // If scope:serviceis set, then keyshould be specified as the Dubbo service key that this rule targets to control. + // If scope:application is set, then keyshould be specified as the name of the application that this rule targets to control, application should always be a Dubbo Consumer. + // +required + // +kubebuilder:validation:Required + // +kubebuilder:validation:Type=string + Key string `json:"key,omitempty"` + // Supports service and application scope rules. + // +required + // +kubebuilder:validation:Required + // +kubebuilder:validation:Type=string + // +kubebuilder:validation:Enum=service;application + Scope string `json:"scope,omitempty"` + // The version of the tag rule definition, currently available version is v3.0 + // +required + // +kubebuilder:validation:Required + // +kubebuilder:validation:Type=string + // +kubebuilder:validation:Enum=v3.0 + ConfigVersion string `json:"configVersion,omitempty"` + // Whether enable this rule or not, set enabled:false to disable this rule. + // +required + // +required + // +kubebuilder:validation:Type=boolean + // +kubebuilder:default=true + Enabled bool `json:"enabled,omitempty"` + // The match condition and configuration of this rule. + // +required + // +kubebuilder:validation:Required + Configs []OverrideConfig `json:"configs,omitempty"` +} + +type OverrideConfig struct { + // Especially useful when scope:service is set. + // side: providermeans this Config will only take effect on the provider instances of the service key. + // side: consumermeans this Config will only take effect on the consumer instances of the service key + // +required + // +kubebuilder:validation:Required + // +kubebuilder:validation:Type=string + Side string `json:"side,omitempty"` + // replaced with address in MatchCondition + // +optional + Addresses []string `json:"addresses,omitempty"` + // not supported anymore + // +optional + ProviderAddresses []string `json:"providerAddresses,omitempty"` + // +optional + Parameters map[string]string `json:"parameters,omitempty"` + // replaced with application in MatchCondition + // +optional + Applications []string `json:"applications,omitempty"` + // replaced with service in MatchCondition + // +optional + Services []string `json:"services,omitempty"` + // +optional + Type string `json:"type,omitempty"` + // +optional + Enabled bool `json:"enabled,omitempty"` + // A set of criterion to be met in order for the rule/config to be applied to the Dubbo instance. + // +optional + Match ConditionMatch `json:"match,omitempty"` +} + +type ConditionMatch struct { + // The instance address matching condition for this config rule to take effect. + // xact: “value” for exact string match + // prefix: “value” for prefix-based match + // regex: “value” for RE2 style regex-based match (https://github.com/google/re2/wiki/Syntax)). + // +optional + Address AddressMatch `json:"address,omitempty"` + // The service matching condition for this config rule to take effect. Effective when scope: application is set. + // exact: “value” for exact string match + // prefix: “value” for prefix-based match + // regex: “value” for RE2 style regex-based match (https://github.com/google/re2/wiki/Syntax)). + // +optional + Service ListStringMatch `json:"service,omitempty"` + // The application matching condition for this config rule to take effect. Effective when scope: service is set. + // + // exact: “value” for exact string match + // prefix: “value” for prefix-based match + // regex: “value” for RE2 style regex-based match (https://github.com/google/re2/wiki/Syntax)). + // +optional + Application ListStringMatch `json:"application,omitempty"` + // The Dubbo url keys and values matching condition for this config rule to take effect. + // +optional + Param []ParamMatch `json:"param,omitempty"` +} + +type AddressMatch struct { + // +optional + Wildcard string `json:"wildcard,omitempty"` + // +optional + Cird string `json:"cird,omitempty"` + // +optional + Exact string `json:"exact,omitempty"` +} + +type ListStringMatch struct { + // +optional + Oneof []StringMatch `json:"oneof,omitempty"` +} + +// +genclient +// +kubebuilder:object:root=true +// +kubebuilder:resource:shortName=dc +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// DynamicConfig is the Schema for the dynamicconfigs API +type DynamicConfig struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + // +optional + Spec DynamicConfigSpec `json:"spec"` +} + +//+kubebuilder:object:root=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// DynamicConfigList contains a list of DynamicConfig +type DynamicConfigList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []DynamicConfig `json:"items"` +} diff --git a/pkg/authority/apis/dubbo.apache.org/v1beta1/zz_generated.deepcopy.go b/pkg/rule/apis/dubbo.apache.org/v1beta1/zz_generated.deepcopy.go similarity index 51% rename from pkg/authority/apis/dubbo.apache.org/v1beta1/zz_generated.deepcopy.go rename to pkg/rule/apis/dubbo.apache.org/v1beta1/zz_generated.deepcopy.go index a5542bf45..c88447ada 100644 --- a/pkg/authority/apis/dubbo.apache.org/v1beta1/zz_generated.deepcopy.go +++ b/pkg/rule/apis/dubbo.apache.org/v1beta1/zz_generated.deepcopy.go @@ -471,3 +471,483 @@ func (in *AuthorizationPolicyTarget) DeepCopy() *AuthorizationPolicyTarget { in.DeepCopyInto(out) return out } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceNameMapping) DeepCopyInto(out *ServiceNameMapping) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceNameMapping. +func (in *ServiceNameMapping) DeepCopy() *ServiceNameMapping { + if in == nil { + return nil + } + out := new(ServiceNameMapping) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceNameMapping) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceNameMappingList) DeepCopyInto(out *ServiceNameMappingList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]*ServiceNameMapping, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(ServiceNameMapping) + (*in).DeepCopyInto(*out) + } + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceNameMappingList. +func (in *ServiceNameMappingList) DeepCopy() *ServiceNameMappingList { + if in == nil { + return nil + } + out := new(ServiceNameMappingList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceNameMappingList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceNameMappingSpec) DeepCopyInto(out *ServiceNameMappingSpec) { + *out = *in + if in.ApplicationNames != nil { + in, out := &in.ApplicationNames, &out.ApplicationNames + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceNameMappingSpec. +func (in *ServiceNameMappingSpec) DeepCopy() *ServiceNameMappingSpec { + if in == nil { + return nil + } + out := new(ServiceNameMappingSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConditionRoute) DeepCopyInto(out *ConditionRoute) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConditionRoute. +func (in *ConditionRoute) DeepCopy() *ConditionRoute { + if in == nil { + return nil + } + out := new(ConditionRoute) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ConditionRoute) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConditionRouteList) DeepCopyInto(out *ConditionRouteList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ConditionRoute, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConditionRouteList. +func (in *ConditionRouteList) DeepCopy() *ConditionRouteList { + if in == nil { + return nil + } + out := new(ConditionRouteList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ConditionRouteList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConditionRouteSpec) DeepCopyInto(out *ConditionRouteSpec) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConditionRouteSpec. +func (in *ConditionRouteSpec) DeepCopy() *ConditionRouteSpec { + if in == nil { + return nil + } + out := new(ConditionRouteSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AddressMatch) DeepCopyInto(out *AddressMatch) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AddressMatch. +func (in *AddressMatch) DeepCopy() *AddressMatch { + if in == nil { + return nil + } + out := new(AddressMatch) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConditionMatch) DeepCopyInto(out *ConditionMatch) { + *out = *in + out.Address = in.Address + in.Service.DeepCopyInto(&out.Service) + in.Application.DeepCopyInto(&out.Application) + if in.Param != nil { + in, out := &in.Param, &out.Param + *out = make([]ParamMatch, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConditionMatch. +func (in *ConditionMatch) DeepCopy() *ConditionMatch { + if in == nil { + return nil + } + out := new(ConditionMatch) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DynamicConfig) DeepCopyInto(out *DynamicConfig) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DynamicConfig. +func (in *DynamicConfig) DeepCopy() *DynamicConfig { + if in == nil { + return nil + } + out := new(DynamicConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DynamicConfig) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DynamicConfigList) DeepCopyInto(out *DynamicConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]DynamicConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DynamicConfigList. +func (in *DynamicConfigList) DeepCopy() *DynamicConfigList { + if in == nil { + return nil + } + out := new(DynamicConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DynamicConfigList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DynamicConfigSpec) DeepCopyInto(out *DynamicConfigSpec) { + *out = *in + if in.Configs != nil { + in, out := &in.Configs, &out.Configs + *out = make([]OverrideConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DynamicConfigSpec. +func (in *DynamicConfigSpec) DeepCopy() *DynamicConfigSpec { + if in == nil { + return nil + } + out := new(DynamicConfigSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ListStringMatch) DeepCopyInto(out *ListStringMatch) { + *out = *in + if in.Oneof != nil { + in, out := &in.Oneof, &out.Oneof + *out = make([]StringMatch, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ListStringMatch. +func (in *ListStringMatch) DeepCopy() *ListStringMatch { + if in == nil { + return nil + } + out := new(ListStringMatch) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OverrideConfig) DeepCopyInto(out *OverrideConfig) { + *out = *in + if in.Addresses != nil { + in, out := &in.Addresses, &out.Addresses + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.ProviderAddresses != nil { + in, out := &in.ProviderAddresses, &out.ProviderAddresses + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Parameters != nil { + in, out := &in.Parameters, &out.Parameters + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Applications != nil { + in, out := &in.Applications, &out.Applications + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Services != nil { + in, out := &in.Services, &out.Services + *out = make([]string, len(*in)) + copy(*out, *in) + } + in.Match.DeepCopyInto(&out.Match) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OverrideConfig. +func (in *OverrideConfig) DeepCopy() *OverrideConfig { + if in == nil { + return nil + } + out := new(OverrideConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ParamMatch) DeepCopyInto(out *ParamMatch) { + *out = *in + out.Value = in.Value +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ParamMatch. +func (in *ParamMatch) DeepCopy() *ParamMatch { + if in == nil { + return nil + } + out := new(ParamMatch) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StringMatch) DeepCopyInto(out *StringMatch) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StringMatch. +func (in *StringMatch) DeepCopy() *StringMatch { + if in == nil { + return nil + } + out := new(StringMatch) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Tag) DeepCopyInto(out *Tag) { + *out = *in + if in.Match != nil { + in, out := &in.Match, &out.Match + *out = make([]ParamMatch, len(*in)) + copy(*out, *in) + } + if in.Addresses != nil { + in, out := &in.Addresses, &out.Addresses + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Tag. +func (in *Tag) DeepCopy() *Tag { + if in == nil { + return nil + } + out := new(Tag) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TagRoute) DeepCopyInto(out *TagRoute) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TagRoute. +func (in *TagRoute) DeepCopy() *TagRoute { + if in == nil { + return nil + } + out := new(TagRoute) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *TagRoute) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TagRouteList) DeepCopyInto(out *TagRouteList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]TagRoute, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TagRouteList. +func (in *TagRouteList) DeepCopy() *TagRouteList { + if in == nil { + return nil + } + out := new(TagRouteList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *TagRouteList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TagRouteSpec) DeepCopyInto(out *TagRouteSpec) { + *out = *in + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make([]Tag, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TagRouteSpec. +func (in *TagRouteSpec) DeepCopy() *TagRouteSpec { + if in == nil { + return nil + } + out := new(TagRouteSpec) + in.DeepCopyInto(out) + return out +} diff --git a/pkg/authority/generated/clientset/versioned/clientset.go b/pkg/rule/clientgen/clientset/versioned/clientset.go similarity index 79% rename from pkg/authority/generated/clientset/versioned/clientset.go rename to pkg/rule/clientgen/clientset/versioned/clientset.go index 9fe9b823a..5dcf1d151 100644 --- a/pkg/authority/generated/clientset/versioned/clientset.go +++ b/pkg/rule/clientgen/clientset/versioned/clientset.go @@ -13,15 +13,31 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Code generated by client-gen. DO NOT EDIT. +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by clientgen-gen. DO NOT EDIT. package versioned import ( "fmt" + dubbov1beta1 "github.com/apache/dubbo-admin/pkg/rule/clientgen/clientset/versioned/typed/dubbo.apache.org/v1beta1" "net/http" - dubbov1beta1 "github.com/apache/dubbo-admin/pkg/authority/generated/clientset/versioned/typed/dubbo.apache.org/v1beta1" discovery "k8s.io/client-go/discovery" rest "k8s.io/client-go/rest" flowcontrol "k8s.io/client-go/util/flowcontrol" @@ -32,7 +48,8 @@ type Interface interface { DubboV1beta1() dubbov1beta1.DubboV1beta1Interface } -// Clientset contains the clients for groups. +// Clientset contains the clients for groups. Each group has exactly one +// version included in a Clientset. type Clientset struct { *discovery.DiscoveryClient dubboV1beta1 *dubbov1beta1.DubboV1beta1Client @@ -72,8 +89,8 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { return NewForConfigAndClient(&configShallowCopy, httpClient) } -// NewForConfigAndClient creates a new Clientset for the given config and http client. -// Note the http client provided takes precedence over the configured transport values. +// NewForConfigAndClient creates a new Clientset for the given config and http clientgen. +// Note the http clientgen provided takes precedence over the configured transport values. // If config's RateLimiter is not set and QPS and Burst are acceptable, // NewForConfigAndClient will generate a rate-limiter in configShallowCopy. func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, error) { diff --git a/pkg/rule/clientgen/clientset/versioned/doc.go b/pkg/rule/clientgen/clientset/versioned/doc.go new file mode 100644 index 000000000..0ca42814c --- /dev/null +++ b/pkg/rule/clientgen/clientset/versioned/doc.go @@ -0,0 +1,35 @@ +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by clientgen-gen. DO NOT EDIT. + +// This package has the automatically generated clientset. +package versioned diff --git a/pkg/authority/generated/clientset/versioned/fake/clientset_generated.go b/pkg/rule/clientgen/clientset/versioned/fake/clientset_generated.go similarity index 74% rename from pkg/authority/generated/clientset/versioned/fake/clientset_generated.go rename to pkg/rule/clientgen/clientset/versioned/fake/clientset_generated.go index 4f7a26542..ffe943114 100644 --- a/pkg/authority/generated/clientset/versioned/fake/clientset_generated.go +++ b/pkg/rule/clientgen/clientset/versioned/fake/clientset_generated.go @@ -12,15 +12,31 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +/* +Copyright The Kubernetes Authors. -// Code generated by client-gen. DO NOT EDIT. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by clientgen-gen. DO NOT EDIT. package fake import ( - clientset "github.com/apache/dubbo-admin/pkg/authority/generated/clientset/versioned" - dubbov1beta1 "github.com/apache/dubbo-admin/pkg/authority/generated/clientset/versioned/typed/dubbo.apache.org/v1beta1" - fakedubbov1beta1 "github.com/apache/dubbo-admin/pkg/authority/generated/clientset/versioned/typed/dubbo.apache.org/v1beta1/fake" + clientset "github.com/apache/dubbo-admin/pkg/rule/clientgen/clientset/versioned" + dubbov1beta1 "github.com/apache/dubbo-admin/pkg/rule/clientgen/clientset/versioned/typed/dubbo.apache.org/v1beta1" + fakedubbov1beta1 "github.com/apache/dubbo-admin/pkg/rule/clientgen/clientset/versioned/typed/dubbo.apache.org/v1beta1/fake" + "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/discovery" diff --git a/pkg/authority/generated/clientset/versioned/fake/doc.go b/pkg/rule/clientgen/clientset/versioned/fake/doc.go similarity index 58% rename from pkg/authority/generated/clientset/versioned/fake/doc.go rename to pkg/rule/clientgen/clientset/versioned/fake/doc.go index 9da463906..999d4769f 100644 --- a/pkg/authority/generated/clientset/versioned/fake/doc.go +++ b/pkg/rule/clientgen/clientset/versioned/fake/doc.go @@ -12,8 +12,23 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +/* +Copyright The Kubernetes Authors. -// Code generated by client-gen. DO NOT EDIT. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by clientgen-gen. DO NOT EDIT. // This package has the automatically generated fake clientset. package fake diff --git a/pkg/authority/generated/clientset/versioned/fake/register.go b/pkg/rule/clientgen/clientset/versioned/fake/register.go similarity index 68% rename from pkg/authority/generated/clientset/versioned/fake/register.go rename to pkg/rule/clientgen/clientset/versioned/fake/register.go index 6751e2f23..7bf09900e 100644 --- a/pkg/authority/generated/clientset/versioned/fake/register.go +++ b/pkg/rule/clientgen/clientset/versioned/fake/register.go @@ -12,13 +12,29 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +/* +Copyright The Kubernetes Authors. -// Code generated by client-gen. DO NOT EDIT. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by clientgen-gen. DO NOT EDIT. package fake import ( - dubbov1beta1 "github.com/apache/dubbo-admin/pkg/authority/apis/dubbo.apache.org/v1beta1" + dubbov1beta1 "github.com/apache/dubbo-admin/pkg/rule/apis/dubbo.apache.org/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -37,9 +53,9 @@ var localSchemeBuilder = runtime.SchemeBuilder{ // of clientsets, like in: // // import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// "k8s.io/clientgen-go/kubernetes" +// clientsetscheme "k8s.io/clientgen-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/clientgen/clientset_generated/clientset/scheme" // ) // // kclientset, _ := kubernetes.NewForConfig(c) diff --git a/pkg/authority/generated/clientset/versioned/scheme/doc.go b/pkg/rule/clientgen/clientset/versioned/scheme/doc.go similarity index 59% rename from pkg/authority/generated/clientset/versioned/scheme/doc.go rename to pkg/rule/clientgen/clientset/versioned/scheme/doc.go index 039ebd3c1..ca39dde74 100644 --- a/pkg/authority/generated/clientset/versioned/scheme/doc.go +++ b/pkg/rule/clientgen/clientset/versioned/scheme/doc.go @@ -12,8 +12,23 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +/* +Copyright The Kubernetes Authors. -// Code generated by client-gen. DO NOT EDIT. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by clientgen-gen. DO NOT EDIT. // This package contains the scheme of the automatically generated clientset. package scheme diff --git a/pkg/authority/generated/clientset/versioned/scheme/register.go b/pkg/rule/clientgen/clientset/versioned/scheme/register.go similarity index 69% rename from pkg/authority/generated/clientset/versioned/scheme/register.go rename to pkg/rule/clientgen/clientset/versioned/scheme/register.go index ffdcf269b..507f9bd51 100644 --- a/pkg/authority/generated/clientset/versioned/scheme/register.go +++ b/pkg/rule/clientgen/clientset/versioned/scheme/register.go @@ -12,13 +12,29 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +/* +Copyright The Kubernetes Authors. -// Code generated by client-gen. DO NOT EDIT. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by clientgen-gen. DO NOT EDIT. package scheme import ( - dubbov1beta1 "github.com/apache/dubbo-admin/pkg/authority/apis/dubbo.apache.org/v1beta1" + dubbov1beta1 "github.com/apache/dubbo-admin/pkg/rule/apis/dubbo.apache.org/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -37,9 +53,9 @@ var localSchemeBuilder = runtime.SchemeBuilder{ // of clientsets, like in: // // import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// "k8s.io/clientgen-go/kubernetes" +// clientsetscheme "k8s.io/clientgen-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/clientgen/clientset_generated/clientset/scheme" // ) // // kclientset, _ := kubernetes.NewForConfig(c) diff --git a/pkg/authority/generated/clientset/versioned/typed/dubbo.apache.org/v1beta1/authenticationpolicy.go b/pkg/rule/clientgen/clientset/versioned/typed/dubbo.apache.org/v1beta1/authenticationpolicy.go similarity index 81% rename from pkg/authority/generated/clientset/versioned/typed/dubbo.apache.org/v1beta1/authenticationpolicy.go rename to pkg/rule/clientgen/clientset/versioned/typed/dubbo.apache.org/v1beta1/authenticationpolicy.go index d1a0608c9..323cc60aa 100644 --- a/pkg/authority/generated/clientset/versioned/typed/dubbo.apache.org/v1beta1/authenticationpolicy.go +++ b/pkg/rule/clientgen/clientset/versioned/typed/dubbo.apache.org/v1beta1/authenticationpolicy.go @@ -12,20 +12,32 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +/* +Copyright The Kubernetes Authors. -// Code generated by client-gen. DO NOT EDIT. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by clientgen-gen. DO NOT EDIT. package v1beta1 import ( "context" - json "encoding/json" - "fmt" + v1beta1 "github.com/apache/dubbo-admin/pkg/rule/apis/dubbo.apache.org/v1beta1" + scheme "github.com/apache/dubbo-admin/pkg/rule/clientgen/clientset/versioned/scheme" "time" - v1beta1 "github.com/apache/dubbo-admin/pkg/authority/apis/dubbo.apache.org/v1beta1" - dubboapacheorgv1beta1 "github.com/apache/dubbo-admin/pkg/authority/generated/applyconfiguration/dubbo.apache.org/v1beta1" - scheme "github.com/apache/dubbo-admin/pkg/authority/generated/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" @@ -33,7 +45,7 @@ import ( ) // AuthenticationPoliciesGetter has a method to return a AuthenticationPolicyInterface. -// A group's client should implement this interface. +// A group's clientgen should implement this interface. type AuthenticationPoliciesGetter interface { AuthenticationPolicies(namespace string) AuthenticationPolicyInterface } @@ -48,7 +60,6 @@ type AuthenticationPolicyInterface interface { List(ctx context.Context, opts v1.ListOptions) (*v1beta1.AuthenticationPolicyList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.AuthenticationPolicy, err error) - Apply(ctx context.Context, authenticationPolicy *dubboapacheorgv1beta1.AuthenticationPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.AuthenticationPolicy, err error) AuthenticationPolicyExpansion } @@ -179,29 +190,3 @@ func (c *authenticationPolicies) Patch(ctx context.Context, name string, pt type Into(result) return } - -// Apply takes the given apply declarative configuration, applies it and returns the applied authenticationPolicy. -func (c *authenticationPolicies) Apply(ctx context.Context, authenticationPolicy *dubboapacheorgv1beta1.AuthenticationPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.AuthenticationPolicy, err error) { - if authenticationPolicy == nil { - return nil, fmt.Errorf("authenticationPolicy provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(authenticationPolicy) - if err != nil { - return nil, err - } - name := authenticationPolicy.Name - if name == nil { - return nil, fmt.Errorf("authenticationPolicy.Name must be provided to Apply") - } - result = &v1beta1.AuthenticationPolicy{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("authenticationpolicies"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/authority/generated/clientset/versioned/typed/dubbo.apache.org/v1beta1/authorizationpolicy.go b/pkg/rule/clientgen/clientset/versioned/typed/dubbo.apache.org/v1beta1/authorizationpolicy.go similarity index 81% rename from pkg/authority/generated/clientset/versioned/typed/dubbo.apache.org/v1beta1/authorizationpolicy.go rename to pkg/rule/clientgen/clientset/versioned/typed/dubbo.apache.org/v1beta1/authorizationpolicy.go index 438d73526..e7feeee09 100644 --- a/pkg/authority/generated/clientset/versioned/typed/dubbo.apache.org/v1beta1/authorizationpolicy.go +++ b/pkg/rule/clientgen/clientset/versioned/typed/dubbo.apache.org/v1beta1/authorizationpolicy.go @@ -12,20 +12,32 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +/* +Copyright The Kubernetes Authors. -// Code generated by client-gen. DO NOT EDIT. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by clientgen-gen. DO NOT EDIT. package v1beta1 import ( "context" - json "encoding/json" - "fmt" + v1beta1 "github.com/apache/dubbo-admin/pkg/rule/apis/dubbo.apache.org/v1beta1" + scheme "github.com/apache/dubbo-admin/pkg/rule/clientgen/clientset/versioned/scheme" "time" - v1beta1 "github.com/apache/dubbo-admin/pkg/authority/apis/dubbo.apache.org/v1beta1" - dubboapacheorgv1beta1 "github.com/apache/dubbo-admin/pkg/authority/generated/applyconfiguration/dubbo.apache.org/v1beta1" - scheme "github.com/apache/dubbo-admin/pkg/authority/generated/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" @@ -33,7 +45,7 @@ import ( ) // AuthorizationPoliciesGetter has a method to return a AuthorizationPolicyInterface. -// A group's client should implement this interface. +// A group's clientgen should implement this interface. type AuthorizationPoliciesGetter interface { AuthorizationPolicies(namespace string) AuthorizationPolicyInterface } @@ -48,7 +60,6 @@ type AuthorizationPolicyInterface interface { List(ctx context.Context, opts v1.ListOptions) (*v1beta1.AuthorizationPolicyList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.AuthorizationPolicy, err error) - Apply(ctx context.Context, authorizationPolicy *dubboapacheorgv1beta1.AuthorizationPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.AuthorizationPolicy, err error) AuthorizationPolicyExpansion } @@ -179,29 +190,3 @@ func (c *authorizationPolicies) Patch(ctx context.Context, name string, pt types Into(result) return } - -// Apply takes the given apply declarative configuration, applies it and returns the applied authorizationPolicy. -func (c *authorizationPolicies) Apply(ctx context.Context, authorizationPolicy *dubboapacheorgv1beta1.AuthorizationPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.AuthorizationPolicy, err error) { - if authorizationPolicy == nil { - return nil, fmt.Errorf("authorizationPolicy provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(authorizationPolicy) - if err != nil { - return nil, err - } - name := authorizationPolicy.Name - if name == nil { - return nil, fmt.Errorf("authorizationPolicy.Name must be provided to Apply") - } - result = &v1beta1.AuthorizationPolicy{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("authorizationpolicies"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/rule/clientgen/clientset/versioned/typed/dubbo.apache.org/v1beta1/conditionroute.go b/pkg/rule/clientgen/clientset/versioned/typed/dubbo.apache.org/v1beta1/conditionroute.go new file mode 100644 index 000000000..c3008d734 --- /dev/null +++ b/pkg/rule/clientgen/clientset/versioned/typed/dubbo.apache.org/v1beta1/conditionroute.go @@ -0,0 +1,192 @@ +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by clientgen-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + v1beta1 "github.com/apache/dubbo-admin/pkg/rule/apis/dubbo.apache.org/v1beta1" + scheme "github.com/apache/dubbo-admin/pkg/rule/clientgen/clientset/versioned/scheme" + "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// ConditionRoutesGetter has a method to return a ConditionRouteInterface. +// A group's clientgen should implement this interface. +type ConditionRoutesGetter interface { + ConditionRoutes(namespace string) ConditionRouteInterface +} + +// ConditionRouteInterface has methods to work with ConditionRoute resources. +type ConditionRouteInterface interface { + Create(ctx context.Context, conditionRoute *v1beta1.ConditionRoute, opts v1.CreateOptions) (*v1beta1.ConditionRoute, error) + Update(ctx context.Context, conditionRoute *v1beta1.ConditionRoute, opts v1.UpdateOptions) (*v1beta1.ConditionRoute, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.ConditionRoute, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ConditionRouteList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ConditionRoute, err error) + ConditionRouteExpansion +} + +// conditionRoutes implements ConditionRouteInterface +type conditionRoutes struct { + client rest.Interface + ns string +} + +// newConditionRoutes returns a ConditionRoutes +func newConditionRoutes(c *DubboV1beta1Client, namespace string) *conditionRoutes { + return &conditionRoutes{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the conditionRoute, and returns the corresponding conditionRoute object, and an error if there is any. +func (c *conditionRoutes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ConditionRoute, err error) { + result = &v1beta1.ConditionRoute{} + err = c.client.Get(). + Namespace(c.ns). + Resource("conditionroutes"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ConditionRoutes that match those selectors. +func (c *conditionRoutes) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ConditionRouteList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.ConditionRouteList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("conditionroutes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested conditionRoutes. +func (c *conditionRoutes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("conditionroutes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a conditionRoute and creates it. Returns the server's representation of the conditionRoute, and an error, if there is any. +func (c *conditionRoutes) Create(ctx context.Context, conditionRoute *v1beta1.ConditionRoute, opts v1.CreateOptions) (result *v1beta1.ConditionRoute, err error) { + result = &v1beta1.ConditionRoute{} + err = c.client.Post(). + Namespace(c.ns). + Resource("conditionroutes"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(conditionRoute). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a conditionRoute and updates it. Returns the server's representation of the conditionRoute, and an error, if there is any. +func (c *conditionRoutes) Update(ctx context.Context, conditionRoute *v1beta1.ConditionRoute, opts v1.UpdateOptions) (result *v1beta1.ConditionRoute, err error) { + result = &v1beta1.ConditionRoute{} + err = c.client.Put(). + Namespace(c.ns). + Resource("conditionroutes"). + Name(conditionRoute.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(conditionRoute). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the conditionRoute and deletes it. Returns an error if one occurs. +func (c *conditionRoutes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("conditionroutes"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *conditionRoutes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("conditionroutes"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched conditionRoute. +func (c *conditionRoutes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ConditionRoute, err error) { + result = &v1beta1.ConditionRoute{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("conditionroutes"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/authority/generated/clientset/versioned/typed/dubbo.apache.org/v1beta1/doc.go b/pkg/rule/clientgen/clientset/versioned/typed/dubbo.apache.org/v1beta1/doc.go similarity index 58% rename from pkg/authority/generated/clientset/versioned/typed/dubbo.apache.org/v1beta1/doc.go rename to pkg/rule/clientgen/clientset/versioned/typed/dubbo.apache.org/v1beta1/doc.go index a1112f7a7..d90dcfffc 100644 --- a/pkg/authority/generated/clientset/versioned/typed/dubbo.apache.org/v1beta1/doc.go +++ b/pkg/rule/clientgen/clientset/versioned/typed/dubbo.apache.org/v1beta1/doc.go @@ -12,8 +12,23 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +/* +Copyright The Kubernetes Authors. -// Code generated by client-gen. DO NOT EDIT. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by clientgen-gen. DO NOT EDIT. // This package has the automatically generated typed clients. package v1beta1 diff --git a/pkg/authority/generated/clientset/versioned/typed/dubbo.apache.org/v1beta1/dubbo.apache.org_client.go b/pkg/rule/clientgen/clientset/versioned/typed/dubbo.apache.org/v1beta1/dubbo.apache.org_client.go similarity index 67% rename from pkg/authority/generated/clientset/versioned/typed/dubbo.apache.org/v1beta1/dubbo.apache.org_client.go rename to pkg/rule/clientgen/clientset/versioned/typed/dubbo.apache.org/v1beta1/dubbo.apache.org_client.go index 498f2c674..b4c1b845e 100644 --- a/pkg/authority/generated/clientset/versioned/typed/dubbo.apache.org/v1beta1/dubbo.apache.org_client.go +++ b/pkg/rule/clientgen/clientset/versioned/typed/dubbo.apache.org/v1beta1/dubbo.apache.org_client.go @@ -12,16 +12,31 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +/* +Copyright The Kubernetes Authors. -// Code generated by client-gen. DO NOT EDIT. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by clientgen-gen. DO NOT EDIT. package v1beta1 import ( + v1beta1 "github.com/apache/dubbo-admin/pkg/rule/apis/dubbo.apache.org/v1beta1" + "github.com/apache/dubbo-admin/pkg/rule/clientgen/clientset/versioned/scheme" "net/http" - v1beta1 "github.com/apache/dubbo-admin/pkg/authority/apis/dubbo.apache.org/v1beta1" - "github.com/apache/dubbo-admin/pkg/authority/generated/clientset/versioned/scheme" rest "k8s.io/client-go/rest" ) @@ -29,6 +44,10 @@ type DubboV1beta1Interface interface { RESTClient() rest.Interface AuthenticationPoliciesGetter AuthorizationPoliciesGetter + ConditionRoutesGetter + DynamicConfigsGetter + ServiceNameMappingsGetter + TagRoutesGetter } // DubboV1beta1Client is used to interact with features provided by the dubbo.apache.org group. @@ -44,6 +63,22 @@ func (c *DubboV1beta1Client) AuthorizationPolicies(namespace string) Authorizati return newAuthorizationPolicies(c, namespace) } +func (c *DubboV1beta1Client) ConditionRoutes(namespace string) ConditionRouteInterface { + return newConditionRoutes(c, namespace) +} + +func (c *DubboV1beta1Client) DynamicConfigs(namespace string) DynamicConfigInterface { + return newDynamicConfigs(c, namespace) +} + +func (c *DubboV1beta1Client) ServiceNameMappings(namespace string) ServiceNameMappingInterface { + return newServiceNameMappings(c, namespace) +} + +func (c *DubboV1beta1Client) TagRoutes(namespace string) TagRouteInterface { + return newTagRoutes(c, namespace) +} + // NewForConfig creates a new DubboV1beta1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). @@ -59,8 +94,8 @@ func NewForConfig(c *rest.Config) (*DubboV1beta1Client, error) { return NewForConfigAndClient(&config, httpClient) } -// NewForConfigAndClient creates a new DubboV1beta1Client for the given config and http client. -// Note the http client provided takes precedence over the configured transport values. +// NewForConfigAndClient creates a new DubboV1beta1Client for the given config and http clientgen. +// Note the http clientgen provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*DubboV1beta1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { @@ -102,7 +137,7 @@ func setConfigDefaults(config *rest.Config) error { } // RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. +// with API server by this clientgen implementation. func (c *DubboV1beta1Client) RESTClient() rest.Interface { if c == nil { return nil diff --git a/pkg/rule/clientgen/clientset/versioned/typed/dubbo.apache.org/v1beta1/dynamicconfig.go b/pkg/rule/clientgen/clientset/versioned/typed/dubbo.apache.org/v1beta1/dynamicconfig.go new file mode 100644 index 000000000..9df8b9445 --- /dev/null +++ b/pkg/rule/clientgen/clientset/versioned/typed/dubbo.apache.org/v1beta1/dynamicconfig.go @@ -0,0 +1,192 @@ +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by clientgen-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + v1beta1 "github.com/apache/dubbo-admin/pkg/rule/apis/dubbo.apache.org/v1beta1" + scheme "github.com/apache/dubbo-admin/pkg/rule/clientgen/clientset/versioned/scheme" + "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// DynamicConfigsGetter has a method to return a DynamicConfigInterface. +// A group's clientgen should implement this interface. +type DynamicConfigsGetter interface { + DynamicConfigs(namespace string) DynamicConfigInterface +} + +// DynamicConfigInterface has methods to work with DynamicConfig resources. +type DynamicConfigInterface interface { + Create(ctx context.Context, dynamicConfig *v1beta1.DynamicConfig, opts v1.CreateOptions) (*v1beta1.DynamicConfig, error) + Update(ctx context.Context, dynamicConfig *v1beta1.DynamicConfig, opts v1.UpdateOptions) (*v1beta1.DynamicConfig, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.DynamicConfig, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.DynamicConfigList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.DynamicConfig, err error) + DynamicConfigExpansion +} + +// dynamicConfigs implements DynamicConfigInterface +type dynamicConfigs struct { + client rest.Interface + ns string +} + +// newDynamicConfigs returns a DynamicConfigs +func newDynamicConfigs(c *DubboV1beta1Client, namespace string) *dynamicConfigs { + return &dynamicConfigs{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the dynamicConfig, and returns the corresponding dynamicConfig object, and an error if there is any. +func (c *dynamicConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.DynamicConfig, err error) { + result = &v1beta1.DynamicConfig{} + err = c.client.Get(). + Namespace(c.ns). + Resource("dynamicconfigs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of DynamicConfigs that match those selectors. +func (c *dynamicConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.DynamicConfigList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.DynamicConfigList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("dynamicconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested dynamicConfigs. +func (c *dynamicConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("dynamicconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a dynamicConfig and creates it. Returns the server's representation of the dynamicConfig, and an error, if there is any. +func (c *dynamicConfigs) Create(ctx context.Context, dynamicConfig *v1beta1.DynamicConfig, opts v1.CreateOptions) (result *v1beta1.DynamicConfig, err error) { + result = &v1beta1.DynamicConfig{} + err = c.client.Post(). + Namespace(c.ns). + Resource("dynamicconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(dynamicConfig). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a dynamicConfig and updates it. Returns the server's representation of the dynamicConfig, and an error, if there is any. +func (c *dynamicConfigs) Update(ctx context.Context, dynamicConfig *v1beta1.DynamicConfig, opts v1.UpdateOptions) (result *v1beta1.DynamicConfig, err error) { + result = &v1beta1.DynamicConfig{} + err = c.client.Put(). + Namespace(c.ns). + Resource("dynamicconfigs"). + Name(dynamicConfig.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(dynamicConfig). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the dynamicConfig and deletes it. Returns an error if one occurs. +func (c *dynamicConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("dynamicconfigs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *dynamicConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("dynamicconfigs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched dynamicConfig. +func (c *dynamicConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.DynamicConfig, err error) { + result = &v1beta1.DynamicConfig{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("dynamicconfigs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/authority/generated/clientset/versioned/typed/dubbo.apache.org/v1beta1/fake/doc.go b/pkg/rule/clientgen/clientset/versioned/typed/dubbo.apache.org/v1beta1/fake/doc.go similarity index 58% rename from pkg/authority/generated/clientset/versioned/typed/dubbo.apache.org/v1beta1/fake/doc.go rename to pkg/rule/clientgen/clientset/versioned/typed/dubbo.apache.org/v1beta1/fake/doc.go index 461041263..854b8847b 100644 --- a/pkg/authority/generated/clientset/versioned/typed/dubbo.apache.org/v1beta1/fake/doc.go +++ b/pkg/rule/clientgen/clientset/versioned/typed/dubbo.apache.org/v1beta1/fake/doc.go @@ -12,8 +12,23 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +/* +Copyright The Kubernetes Authors. -// Code generated by client-gen. DO NOT EDIT. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by clientgen-gen. DO NOT EDIT. // Package fake has the automatically generated clients. package fake diff --git a/pkg/authority/generated/clientset/versioned/typed/dubbo.apache.org/v1beta1/fake/fake_authenticationpolicy.go b/pkg/rule/clientgen/clientset/versioned/typed/dubbo.apache.org/v1beta1/fake/fake_authenticationpolicy.go similarity index 78% rename from pkg/authority/generated/clientset/versioned/typed/dubbo.apache.org/v1beta1/fake/fake_authenticationpolicy.go rename to pkg/rule/clientgen/clientset/versioned/typed/dubbo.apache.org/v1beta1/fake/fake_authenticationpolicy.go index 0dde8c88c..455153f53 100644 --- a/pkg/authority/generated/clientset/versioned/typed/dubbo.apache.org/v1beta1/fake/fake_authenticationpolicy.go +++ b/pkg/rule/clientgen/clientset/versioned/typed/dubbo.apache.org/v1beta1/fake/fake_authenticationpolicy.go @@ -12,20 +12,33 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +/* +Copyright The Kubernetes Authors. -// Code generated by client-gen. DO NOT EDIT. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by clientgen-gen. DO NOT EDIT. package fake import ( "context" - json "encoding/json" - "fmt" + v1beta1 "github.com/apache/dubbo-admin/pkg/rule/apis/dubbo.apache.org/v1beta1" - v1beta1 "github.com/apache/dubbo-admin/pkg/authority/apis/dubbo.apache.org/v1beta1" - dubboapacheorgv1beta1 "github.com/apache/dubbo-admin/pkg/authority/generated/applyconfiguration/dubbo.apache.org/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" @@ -37,9 +50,9 @@ type FakeAuthenticationPolicies struct { ns string } -var authenticationpoliciesResource = v1beta1.SchemeGroupVersion.WithResource("authenticationpolicies") +var authenticationpoliciesResource = schema.GroupVersionResource{Group: "dubbo.apache.org", Version: "v1beta1", Resource: "authenticationpolicies"} -var authenticationpoliciesKind = v1beta1.SchemeGroupVersion.WithKind("AuthenticationPolicy") +var authenticationpoliciesKind = schema.GroupVersionKind{Group: "dubbo.apache.org", Version: "v1beta1", Kind: "AuthenticationPolicy"} // Get takes name of the authenticationPolicy, and returns the corresponding authenticationPolicy object, and an error if there is any. func (c *FakeAuthenticationPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.AuthenticationPolicy, err error) { @@ -129,25 +142,3 @@ func (c *FakeAuthenticationPolicies) Patch(ctx context.Context, name string, pt } return obj.(*v1beta1.AuthenticationPolicy), err } - -// Apply takes the given apply declarative configuration, applies it and returns the applied authenticationPolicy. -func (c *FakeAuthenticationPolicies) Apply(ctx context.Context, authenticationPolicy *dubboapacheorgv1beta1.AuthenticationPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.AuthenticationPolicy, err error) { - if authenticationPolicy == nil { - return nil, fmt.Errorf("authenticationPolicy provided to Apply must not be nil") - } - data, err := json.Marshal(authenticationPolicy) - if err != nil { - return nil, err - } - name := authenticationPolicy.Name - if name == nil { - return nil, fmt.Errorf("authenticationPolicy.Name must be provided to Apply") - } - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(authenticationpoliciesResource, c.ns, *name, types.ApplyPatchType, data), &v1beta1.AuthenticationPolicy{}) - - if obj == nil { - return nil, err - } - return obj.(*v1beta1.AuthenticationPolicy), err -} diff --git a/pkg/authority/generated/clientset/versioned/typed/dubbo.apache.org/v1beta1/fake/fake_authorizationpolicy.go b/pkg/rule/clientgen/clientset/versioned/typed/dubbo.apache.org/v1beta1/fake/fake_authorizationpolicy.go similarity index 78% rename from pkg/authority/generated/clientset/versioned/typed/dubbo.apache.org/v1beta1/fake/fake_authorizationpolicy.go rename to pkg/rule/clientgen/clientset/versioned/typed/dubbo.apache.org/v1beta1/fake/fake_authorizationpolicy.go index 00eb12b97..cbbdb1ea3 100644 --- a/pkg/authority/generated/clientset/versioned/typed/dubbo.apache.org/v1beta1/fake/fake_authorizationpolicy.go +++ b/pkg/rule/clientgen/clientset/versioned/typed/dubbo.apache.org/v1beta1/fake/fake_authorizationpolicy.go @@ -12,20 +12,33 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +/* +Copyright The Kubernetes Authors. -// Code generated by client-gen. DO NOT EDIT. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by clientgen-gen. DO NOT EDIT. package fake import ( "context" - json "encoding/json" - "fmt" + v1beta1 "github.com/apache/dubbo-admin/pkg/rule/apis/dubbo.apache.org/v1beta1" - v1beta1 "github.com/apache/dubbo-admin/pkg/authority/apis/dubbo.apache.org/v1beta1" - dubboapacheorgv1beta1 "github.com/apache/dubbo-admin/pkg/authority/generated/applyconfiguration/dubbo.apache.org/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" @@ -37,9 +50,9 @@ type FakeAuthorizationPolicies struct { ns string } -var authorizationpoliciesResource = v1beta1.SchemeGroupVersion.WithResource("authorizationpolicies") +var authorizationpoliciesResource = schema.GroupVersionResource{Group: "dubbo.apache.org", Version: "v1beta1", Resource: "authorizationpolicies"} -var authorizationpoliciesKind = v1beta1.SchemeGroupVersion.WithKind("AuthorizationPolicy") +var authorizationpoliciesKind = schema.GroupVersionKind{Group: "dubbo.apache.org", Version: "v1beta1", Kind: "AuthorizationPolicy"} // Get takes name of the authorizationPolicy, and returns the corresponding authorizationPolicy object, and an error if there is any. func (c *FakeAuthorizationPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.AuthorizationPolicy, err error) { @@ -129,25 +142,3 @@ func (c *FakeAuthorizationPolicies) Patch(ctx context.Context, name string, pt t } return obj.(*v1beta1.AuthorizationPolicy), err } - -// Apply takes the given apply declarative configuration, applies it and returns the applied authorizationPolicy. -func (c *FakeAuthorizationPolicies) Apply(ctx context.Context, authorizationPolicy *dubboapacheorgv1beta1.AuthorizationPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.AuthorizationPolicy, err error) { - if authorizationPolicy == nil { - return nil, fmt.Errorf("authorizationPolicy provided to Apply must not be nil") - } - data, err := json.Marshal(authorizationPolicy) - if err != nil { - return nil, err - } - name := authorizationPolicy.Name - if name == nil { - return nil, fmt.Errorf("authorizationPolicy.Name must be provided to Apply") - } - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(authorizationpoliciesResource, c.ns, *name, types.ApplyPatchType, data), &v1beta1.AuthorizationPolicy{}) - - if obj == nil { - return nil, err - } - return obj.(*v1beta1.AuthorizationPolicy), err -} diff --git a/pkg/rule/clientgen/clientset/versioned/typed/dubbo.apache.org/v1beta1/fake/fake_conditionroute.go b/pkg/rule/clientgen/clientset/versioned/typed/dubbo.apache.org/v1beta1/fake/fake_conditionroute.go new file mode 100644 index 000000000..335f4ef98 --- /dev/null +++ b/pkg/rule/clientgen/clientset/versioned/typed/dubbo.apache.org/v1beta1/fake/fake_conditionroute.go @@ -0,0 +1,144 @@ +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by clientgen-gen. DO NOT EDIT. + +package fake + +import ( + "context" + v1beta1 "github.com/apache/dubbo-admin/pkg/rule/apis/dubbo.apache.org/v1beta1" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeConditionRoutes implements ConditionRouteInterface +type FakeConditionRoutes struct { + Fake *FakeDubboV1beta1 + ns string +} + +var conditionroutesResource = schema.GroupVersionResource{Group: "dubbo.apache.org", Version: "v1beta1", Resource: "conditionroutes"} + +var conditionroutesKind = schema.GroupVersionKind{Group: "dubbo.apache.org", Version: "v1beta1", Kind: "ConditionRoute"} + +// Get takes name of the conditionRoute, and returns the corresponding conditionRoute object, and an error if there is any. +func (c *FakeConditionRoutes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ConditionRoute, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(conditionroutesResource, c.ns, name), &v1beta1.ConditionRoute{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.ConditionRoute), err +} + +// List takes label and field selectors, and returns the list of ConditionRoutes that match those selectors. +func (c *FakeConditionRoutes) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ConditionRouteList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(conditionroutesResource, conditionroutesKind, c.ns, opts), &v1beta1.ConditionRouteList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.ConditionRouteList{ListMeta: obj.(*v1beta1.ConditionRouteList).ListMeta} + for _, item := range obj.(*v1beta1.ConditionRouteList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested conditionRoutes. +func (c *FakeConditionRoutes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(conditionroutesResource, c.ns, opts)) + +} + +// Create takes the representation of a conditionRoute and creates it. Returns the server's representation of the conditionRoute, and an error, if there is any. +func (c *FakeConditionRoutes) Create(ctx context.Context, conditionRoute *v1beta1.ConditionRoute, opts v1.CreateOptions) (result *v1beta1.ConditionRoute, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(conditionroutesResource, c.ns, conditionRoute), &v1beta1.ConditionRoute{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.ConditionRoute), err +} + +// Update takes the representation of a conditionRoute and updates it. Returns the server's representation of the conditionRoute, and an error, if there is any. +func (c *FakeConditionRoutes) Update(ctx context.Context, conditionRoute *v1beta1.ConditionRoute, opts v1.UpdateOptions) (result *v1beta1.ConditionRoute, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(conditionroutesResource, c.ns, conditionRoute), &v1beta1.ConditionRoute{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.ConditionRoute), err +} + +// Delete takes name of the conditionRoute and deletes it. Returns an error if one occurs. +func (c *FakeConditionRoutes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(conditionroutesResource, c.ns, name, opts), &v1beta1.ConditionRoute{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeConditionRoutes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(conditionroutesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.ConditionRouteList{}) + return err +} + +// Patch applies the patch and returns the patched conditionRoute. +func (c *FakeConditionRoutes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ConditionRoute, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(conditionroutesResource, c.ns, name, pt, data, subresources...), &v1beta1.ConditionRoute{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.ConditionRoute), err +} diff --git a/pkg/authority/generated/clientset/versioned/typed/dubbo.apache.org/v1beta1/fake/fake_dubbo.apache.org_client.go b/pkg/rule/clientgen/clientset/versioned/typed/dubbo.apache.org/v1beta1/fake/fake_dubbo.apache.org_client.go similarity index 51% rename from pkg/authority/generated/clientset/versioned/typed/dubbo.apache.org/v1beta1/fake/fake_dubbo.apache.org_client.go rename to pkg/rule/clientgen/clientset/versioned/typed/dubbo.apache.org/v1beta1/fake/fake_dubbo.apache.org_client.go index 68b92c602..2ef916481 100644 --- a/pkg/authority/generated/clientset/versioned/typed/dubbo.apache.org/v1beta1/fake/fake_dubbo.apache.org_client.go +++ b/pkg/rule/clientgen/clientset/versioned/typed/dubbo.apache.org/v1beta1/fake/fake_dubbo.apache.org_client.go @@ -12,13 +12,29 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +/* +Copyright The Kubernetes Authors. -// Code generated by client-gen. DO NOT EDIT. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by clientgen-gen. DO NOT EDIT. package fake import ( - v1beta1 "github.com/apache/dubbo-admin/pkg/authority/generated/clientset/versioned/typed/dubbo.apache.org/v1beta1" + v1beta1 "github.com/apache/dubbo-admin/pkg/rule/clientgen/clientset/versioned/typed/dubbo.apache.org/v1beta1" + rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) @@ -35,8 +51,24 @@ func (c *FakeDubboV1beta1) AuthorizationPolicies(namespace string) v1beta1.Autho return &FakeAuthorizationPolicies{c, namespace} } +func (c *FakeDubboV1beta1) ConditionRoutes(namespace string) v1beta1.ConditionRouteInterface { + return &FakeConditionRoutes{c, namespace} +} + +func (c *FakeDubboV1beta1) DynamicConfigs(namespace string) v1beta1.DynamicConfigInterface { + return &FakeDynamicConfigs{c, namespace} +} + +func (c *FakeDubboV1beta1) ServiceNameMappings(namespace string) v1beta1.ServiceNameMappingInterface { + return &FakeServiceNameMappings{c, namespace} +} + +func (c *FakeDubboV1beta1) TagRoutes(namespace string) v1beta1.TagRouteInterface { + return &FakeTagRoutes{c, namespace} +} + // RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. +// with API server by this clientgen implementation. func (c *FakeDubboV1beta1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret diff --git a/pkg/rule/clientgen/clientset/versioned/typed/dubbo.apache.org/v1beta1/fake/fake_dynamicconfig.go b/pkg/rule/clientgen/clientset/versioned/typed/dubbo.apache.org/v1beta1/fake/fake_dynamicconfig.go new file mode 100644 index 000000000..fc39dd5ba --- /dev/null +++ b/pkg/rule/clientgen/clientset/versioned/typed/dubbo.apache.org/v1beta1/fake/fake_dynamicconfig.go @@ -0,0 +1,144 @@ +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by clientgen-gen. DO NOT EDIT. + +package fake + +import ( + "context" + v1beta1 "github.com/apache/dubbo-admin/pkg/rule/apis/dubbo.apache.org/v1beta1" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeDynamicConfigs implements DynamicConfigInterface +type FakeDynamicConfigs struct { + Fake *FakeDubboV1beta1 + ns string +} + +var dynamicconfigsResource = schema.GroupVersionResource{Group: "dubbo.apache.org", Version: "v1beta1", Resource: "dynamicconfigs"} + +var dynamicconfigsKind = schema.GroupVersionKind{Group: "dubbo.apache.org", Version: "v1beta1", Kind: "DynamicConfig"} + +// Get takes name of the dynamicConfig, and returns the corresponding dynamicConfig object, and an error if there is any. +func (c *FakeDynamicConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.DynamicConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(dynamicconfigsResource, c.ns, name), &v1beta1.DynamicConfig{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.DynamicConfig), err +} + +// List takes label and field selectors, and returns the list of DynamicConfigs that match those selectors. +func (c *FakeDynamicConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.DynamicConfigList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(dynamicconfigsResource, dynamicconfigsKind, c.ns, opts), &v1beta1.DynamicConfigList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.DynamicConfigList{ListMeta: obj.(*v1beta1.DynamicConfigList).ListMeta} + for _, item := range obj.(*v1beta1.DynamicConfigList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested dynamicConfigs. +func (c *FakeDynamicConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(dynamicconfigsResource, c.ns, opts)) + +} + +// Create takes the representation of a dynamicConfig and creates it. Returns the server's representation of the dynamicConfig, and an error, if there is any. +func (c *FakeDynamicConfigs) Create(ctx context.Context, dynamicConfig *v1beta1.DynamicConfig, opts v1.CreateOptions) (result *v1beta1.DynamicConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(dynamicconfigsResource, c.ns, dynamicConfig), &v1beta1.DynamicConfig{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.DynamicConfig), err +} + +// Update takes the representation of a dynamicConfig and updates it. Returns the server's representation of the dynamicConfig, and an error, if there is any. +func (c *FakeDynamicConfigs) Update(ctx context.Context, dynamicConfig *v1beta1.DynamicConfig, opts v1.UpdateOptions) (result *v1beta1.DynamicConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(dynamicconfigsResource, c.ns, dynamicConfig), &v1beta1.DynamicConfig{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.DynamicConfig), err +} + +// Delete takes name of the dynamicConfig and deletes it. Returns an error if one occurs. +func (c *FakeDynamicConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(dynamicconfigsResource, c.ns, name, opts), &v1beta1.DynamicConfig{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeDynamicConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(dynamicconfigsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.DynamicConfigList{}) + return err +} + +// Patch applies the patch and returns the patched dynamicConfig. +func (c *FakeDynamicConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.DynamicConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(dynamicconfigsResource, c.ns, name, pt, data, subresources...), &v1beta1.DynamicConfig{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.DynamicConfig), err +} diff --git a/pkg/mapping/generated/clientset/versioned/typed/dubbo.apache.org/v1alpha1/fake/fake_servicenamemapping.go b/pkg/rule/clientgen/clientset/versioned/typed/dubbo.apache.org/v1beta1/fake/fake_servicenamemapping.go similarity index 59% rename from pkg/mapping/generated/clientset/versioned/typed/dubbo.apache.org/v1alpha1/fake/fake_servicenamemapping.go rename to pkg/rule/clientgen/clientset/versioned/typed/dubbo.apache.org/v1beta1/fake/fake_servicenamemapping.go index cddb67f25..931a787e2 100644 --- a/pkg/mapping/generated/clientset/versioned/typed/dubbo.apache.org/v1alpha1/fake/fake_servicenamemapping.go +++ b/pkg/rule/clientgen/clientset/versioned/typed/dubbo.apache.org/v1beta1/fake/fake_servicenamemapping.go @@ -1,3 +1,17 @@ +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. /* Copyright The Kubernetes Authors. @@ -14,16 +28,17 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by client-gen. DO NOT EDIT. +// Code generated by clientgen-gen. DO NOT EDIT. package fake import ( "context" - v1alpha1 "github.com/apache/dubbo-admin/pkg/mapping/apis/dubbo.apache.org/v1alpha1" + v1beta1 "github.com/apache/dubbo-admin/pkg/rule/apis/dubbo.apache.org/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" @@ -31,29 +46,29 @@ import ( // FakeServiceNameMappings implements ServiceNameMappingInterface type FakeServiceNameMappings struct { - Fake *FakeDubboV1alpha1 + Fake *FakeDubboV1beta1 ns string } -var servicenamemappingsResource = v1alpha1.SchemeGroupVersion.WithResource("servicenamemappings") +var servicenamemappingsResource = schema.GroupVersionResource{Group: "dubbo.apache.org", Version: "v1beta1", Resource: "servicenamemappings"} -var servicenamemappingsKind = v1alpha1.SchemeGroupVersion.WithKind("ServiceNameMapping") +var servicenamemappingsKind = schema.GroupVersionKind{Group: "dubbo.apache.org", Version: "v1beta1", Kind: "ServiceNameMapping"} // Get takes name of the serviceNameMapping, and returns the corresponding serviceNameMapping object, and an error if there is any. -func (c *FakeServiceNameMappings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ServiceNameMapping, err error) { +func (c *FakeServiceNameMappings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ServiceNameMapping, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(servicenamemappingsResource, c.ns, name), &v1alpha1.ServiceNameMapping{}) + Invokes(testing.NewGetAction(servicenamemappingsResource, c.ns, name), &v1beta1.ServiceNameMapping{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.ServiceNameMapping), err + return obj.(*v1beta1.ServiceNameMapping), err } // List takes label and field selectors, and returns the list of ServiceNameMappings that match those selectors. -func (c *FakeServiceNameMappings) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ServiceNameMappingList, err error) { +func (c *FakeServiceNameMappings) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ServiceNameMappingList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(servicenamemappingsResource, servicenamemappingsKind, c.ns, opts), &v1alpha1.ServiceNameMappingList{}) + Invokes(testing.NewListAction(servicenamemappingsResource, servicenamemappingsKind, c.ns, opts), &v1beta1.ServiceNameMappingList{}) if obj == nil { return nil, err @@ -63,8 +78,8 @@ func (c *FakeServiceNameMappings) List(ctx context.Context, opts v1.ListOptions) if label == nil { label = labels.Everything() } - list := &v1alpha1.ServiceNameMappingList{ListMeta: obj.(*v1alpha1.ServiceNameMappingList).ListMeta} - for _, item := range obj.(*v1alpha1.ServiceNameMappingList).Items { + list := &v1beta1.ServiceNameMappingList{ListMeta: obj.(*v1beta1.ServiceNameMappingList).ListMeta} + for _, item := range obj.(*v1beta1.ServiceNameMappingList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -80,31 +95,31 @@ func (c *FakeServiceNameMappings) Watch(ctx context.Context, opts v1.ListOptions } // Create takes the representation of a serviceNameMapping and creates it. Returns the server's representation of the serviceNameMapping, and an error, if there is any. -func (c *FakeServiceNameMappings) Create(ctx context.Context, serviceNameMapping *v1alpha1.ServiceNameMapping, opts v1.CreateOptions) (result *v1alpha1.ServiceNameMapping, err error) { +func (c *FakeServiceNameMappings) Create(ctx context.Context, serviceNameMapping *v1beta1.ServiceNameMapping, opts v1.CreateOptions) (result *v1beta1.ServiceNameMapping, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(servicenamemappingsResource, c.ns, serviceNameMapping), &v1alpha1.ServiceNameMapping{}) + Invokes(testing.NewCreateAction(servicenamemappingsResource, c.ns, serviceNameMapping), &v1beta1.ServiceNameMapping{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.ServiceNameMapping), err + return obj.(*v1beta1.ServiceNameMapping), err } // Update takes the representation of a serviceNameMapping and updates it. Returns the server's representation of the serviceNameMapping, and an error, if there is any. -func (c *FakeServiceNameMappings) Update(ctx context.Context, serviceNameMapping *v1alpha1.ServiceNameMapping, opts v1.UpdateOptions) (result *v1alpha1.ServiceNameMapping, err error) { +func (c *FakeServiceNameMappings) Update(ctx context.Context, serviceNameMapping *v1beta1.ServiceNameMapping, opts v1.UpdateOptions) (result *v1beta1.ServiceNameMapping, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(servicenamemappingsResource, c.ns, serviceNameMapping), &v1alpha1.ServiceNameMapping{}) + Invokes(testing.NewUpdateAction(servicenamemappingsResource, c.ns, serviceNameMapping), &v1beta1.ServiceNameMapping{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.ServiceNameMapping), err + return obj.(*v1beta1.ServiceNameMapping), err } // Delete takes name of the serviceNameMapping and deletes it. Returns an error if one occurs. func (c *FakeServiceNameMappings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(servicenamemappingsResource, c.ns, name, opts), &v1alpha1.ServiceNameMapping{}) + Invokes(testing.NewDeleteActionWithOptions(servicenamemappingsResource, c.ns, name, opts), &v1beta1.ServiceNameMapping{}) return err } @@ -113,17 +128,17 @@ func (c *FakeServiceNameMappings) Delete(ctx context.Context, name string, opts func (c *FakeServiceNameMappings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewDeleteCollectionAction(servicenamemappingsResource, c.ns, listOpts) - _, err := c.Fake.Invokes(action, &v1alpha1.ServiceNameMappingList{}) + _, err := c.Fake.Invokes(action, &v1beta1.ServiceNameMappingList{}) return err } // Patch applies the patch and returns the patched serviceNameMapping. -func (c *FakeServiceNameMappings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ServiceNameMapping, err error) { +func (c *FakeServiceNameMappings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ServiceNameMapping, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(servicenamemappingsResource, c.ns, name, pt, data, subresources...), &v1alpha1.ServiceNameMapping{}) + Invokes(testing.NewPatchSubresourceAction(servicenamemappingsResource, c.ns, name, pt, data, subresources...), &v1beta1.ServiceNameMapping{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.ServiceNameMapping), err + return obj.(*v1beta1.ServiceNameMapping), err } diff --git a/pkg/rule/clientgen/clientset/versioned/typed/dubbo.apache.org/v1beta1/fake/fake_tagroute.go b/pkg/rule/clientgen/clientset/versioned/typed/dubbo.apache.org/v1beta1/fake/fake_tagroute.go new file mode 100644 index 000000000..bd962f254 --- /dev/null +++ b/pkg/rule/clientgen/clientset/versioned/typed/dubbo.apache.org/v1beta1/fake/fake_tagroute.go @@ -0,0 +1,144 @@ +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by clientgen-gen. DO NOT EDIT. + +package fake + +import ( + "context" + v1beta1 "github.com/apache/dubbo-admin/pkg/rule/apis/dubbo.apache.org/v1beta1" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeTagRoutes implements TagRouteInterface +type FakeTagRoutes struct { + Fake *FakeDubboV1beta1 + ns string +} + +var tagroutesResource = schema.GroupVersionResource{Group: "dubbo.apache.org", Version: "v1beta1", Resource: "tagroutes"} + +var tagroutesKind = schema.GroupVersionKind{Group: "dubbo.apache.org", Version: "v1beta1", Kind: "TagRoute"} + +// Get takes name of the tagRoute, and returns the corresponding tagRoute object, and an error if there is any. +func (c *FakeTagRoutes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.TagRoute, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(tagroutesResource, c.ns, name), &v1beta1.TagRoute{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.TagRoute), err +} + +// List takes label and field selectors, and returns the list of TagRoutes that match those selectors. +func (c *FakeTagRoutes) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.TagRouteList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(tagroutesResource, tagroutesKind, c.ns, opts), &v1beta1.TagRouteList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.TagRouteList{ListMeta: obj.(*v1beta1.TagRouteList).ListMeta} + for _, item := range obj.(*v1beta1.TagRouteList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested tagRoutes. +func (c *FakeTagRoutes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(tagroutesResource, c.ns, opts)) + +} + +// Create takes the representation of a tagRoute and creates it. Returns the server's representation of the tagRoute, and an error, if there is any. +func (c *FakeTagRoutes) Create(ctx context.Context, tagRoute *v1beta1.TagRoute, opts v1.CreateOptions) (result *v1beta1.TagRoute, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(tagroutesResource, c.ns, tagRoute), &v1beta1.TagRoute{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.TagRoute), err +} + +// Update takes the representation of a tagRoute and updates it. Returns the server's representation of the tagRoute, and an error, if there is any. +func (c *FakeTagRoutes) Update(ctx context.Context, tagRoute *v1beta1.TagRoute, opts v1.UpdateOptions) (result *v1beta1.TagRoute, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(tagroutesResource, c.ns, tagRoute), &v1beta1.TagRoute{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.TagRoute), err +} + +// Delete takes name of the tagRoute and deletes it. Returns an error if one occurs. +func (c *FakeTagRoutes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(tagroutesResource, c.ns, name, opts), &v1beta1.TagRoute{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeTagRoutes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(tagroutesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.TagRouteList{}) + return err +} + +// Patch applies the patch and returns the patched tagRoute. +func (c *FakeTagRoutes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.TagRoute, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(tagroutesResource, c.ns, name, pt, data, subresources...), &v1beta1.TagRoute{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.TagRoute), err +} diff --git a/pkg/authority/generated/clientset/versioned/typed/dubbo.apache.org/v1beta1/generated_expansion.go b/pkg/rule/clientgen/clientset/versioned/typed/dubbo.apache.org/v1beta1/generated_expansion.go similarity index 53% rename from pkg/authority/generated/clientset/versioned/typed/dubbo.apache.org/v1beta1/generated_expansion.go rename to pkg/rule/clientgen/clientset/versioned/typed/dubbo.apache.org/v1beta1/generated_expansion.go index 7811d7c83..96a4ab8e3 100644 --- a/pkg/authority/generated/clientset/versioned/typed/dubbo.apache.org/v1beta1/generated_expansion.go +++ b/pkg/rule/clientgen/clientset/versioned/typed/dubbo.apache.org/v1beta1/generated_expansion.go @@ -12,11 +12,34 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +/* +Copyright The Kubernetes Authors. -// Code generated by client-gen. DO NOT EDIT. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by clientgen-gen. DO NOT EDIT. package v1beta1 type AuthenticationPolicyExpansion interface{} type AuthorizationPolicyExpansion interface{} + +type ConditionRouteExpansion interface{} + +type DynamicConfigExpansion interface{} + +type ServiceNameMappingExpansion interface{} + +type TagRouteExpansion interface{} diff --git a/pkg/mapping/generated/clientset/versioned/typed/dubbo.apache.org/v1alpha1/servicenamemapping.go b/pkg/rule/clientgen/clientset/versioned/typed/dubbo.apache.org/v1beta1/servicenamemapping.go similarity index 69% rename from pkg/mapping/generated/clientset/versioned/typed/dubbo.apache.org/v1alpha1/servicenamemapping.go rename to pkg/rule/clientgen/clientset/versioned/typed/dubbo.apache.org/v1beta1/servicenamemapping.go index e13dbff7e..c64ce876a 100644 --- a/pkg/mapping/generated/clientset/versioned/typed/dubbo.apache.org/v1alpha1/servicenamemapping.go +++ b/pkg/rule/clientgen/clientset/versioned/typed/dubbo.apache.org/v1beta1/servicenamemapping.go @@ -1,3 +1,17 @@ +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. /* Copyright The Kubernetes Authors. @@ -14,14 +28,14 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by client-gen. DO NOT EDIT. +// Code generated by clientgen-gen. DO NOT EDIT. -package v1alpha1 +package v1beta1 import ( "context" - v1alpha1 "github.com/apache/dubbo-admin/pkg/mapping/apis/dubbo.apache.org/v1alpha1" - scheme "github.com/apache/dubbo-admin/pkg/mapping/generated/clientset/versioned/scheme" + v1beta1 "github.com/apache/dubbo-admin/pkg/rule/apis/dubbo.apache.org/v1beta1" + scheme "github.com/apache/dubbo-admin/pkg/rule/clientgen/clientset/versioned/scheme" "time" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -31,21 +45,21 @@ import ( ) // ServiceNameMappingsGetter has a method to return a ServiceNameMappingInterface. -// A group's client should implement this interface. +// A group's clientgen should implement this interface. type ServiceNameMappingsGetter interface { ServiceNameMappings(namespace string) ServiceNameMappingInterface } // ServiceNameMappingInterface has methods to work with ServiceNameMapping resources. type ServiceNameMappingInterface interface { - Create(ctx context.Context, serviceNameMapping *v1alpha1.ServiceNameMapping, opts v1.CreateOptions) (*v1alpha1.ServiceNameMapping, error) - Update(ctx context.Context, serviceNameMapping *v1alpha1.ServiceNameMapping, opts v1.UpdateOptions) (*v1alpha1.ServiceNameMapping, error) + Create(ctx context.Context, serviceNameMapping *v1beta1.ServiceNameMapping, opts v1.CreateOptions) (*v1beta1.ServiceNameMapping, error) + Update(ctx context.Context, serviceNameMapping *v1beta1.ServiceNameMapping, opts v1.UpdateOptions) (*v1beta1.ServiceNameMapping, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.ServiceNameMapping, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ServiceNameMappingList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.ServiceNameMapping, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ServiceNameMappingList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ServiceNameMapping, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ServiceNameMapping, err error) ServiceNameMappingExpansion } @@ -56,7 +70,7 @@ type serviceNameMappings struct { } // newServiceNameMappings returns a ServiceNameMappings -func newServiceNameMappings(c *DubboV1alpha1Client, namespace string) *serviceNameMappings { +func newServiceNameMappings(c *DubboV1beta1Client, namespace string) *serviceNameMappings { return &serviceNameMappings{ client: c.RESTClient(), ns: namespace, @@ -64,8 +78,8 @@ func newServiceNameMappings(c *DubboV1alpha1Client, namespace string) *serviceNa } // Get takes name of the serviceNameMapping, and returns the corresponding serviceNameMapping object, and an error if there is any. -func (c *serviceNameMappings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ServiceNameMapping, err error) { - result = &v1alpha1.ServiceNameMapping{} +func (c *serviceNameMappings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ServiceNameMapping, err error) { + result = &v1beta1.ServiceNameMapping{} err = c.client.Get(). Namespace(c.ns). Resource("servicenamemappings"). @@ -77,12 +91,12 @@ func (c *serviceNameMappings) Get(ctx context.Context, name string, options v1.G } // List takes label and field selectors, and returns the list of ServiceNameMappings that match those selectors. -func (c *serviceNameMappings) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ServiceNameMappingList, err error) { +func (c *serviceNameMappings) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ServiceNameMappingList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second } - result = &v1alpha1.ServiceNameMappingList{} + result = &v1beta1.ServiceNameMappingList{} err = c.client.Get(). Namespace(c.ns). Resource("servicenamemappings"). @@ -109,8 +123,8 @@ func (c *serviceNameMappings) Watch(ctx context.Context, opts v1.ListOptions) (w } // Create takes the representation of a serviceNameMapping and creates it. Returns the server's representation of the serviceNameMapping, and an error, if there is any. -func (c *serviceNameMappings) Create(ctx context.Context, serviceNameMapping *v1alpha1.ServiceNameMapping, opts v1.CreateOptions) (result *v1alpha1.ServiceNameMapping, err error) { - result = &v1alpha1.ServiceNameMapping{} +func (c *serviceNameMappings) Create(ctx context.Context, serviceNameMapping *v1beta1.ServiceNameMapping, opts v1.CreateOptions) (result *v1beta1.ServiceNameMapping, err error) { + result = &v1beta1.ServiceNameMapping{} err = c.client.Post(). Namespace(c.ns). Resource("servicenamemappings"). @@ -122,8 +136,8 @@ func (c *serviceNameMappings) Create(ctx context.Context, serviceNameMapping *v1 } // Update takes the representation of a serviceNameMapping and updates it. Returns the server's representation of the serviceNameMapping, and an error, if there is any. -func (c *serviceNameMappings) Update(ctx context.Context, serviceNameMapping *v1alpha1.ServiceNameMapping, opts v1.UpdateOptions) (result *v1alpha1.ServiceNameMapping, err error) { - result = &v1alpha1.ServiceNameMapping{} +func (c *serviceNameMappings) Update(ctx context.Context, serviceNameMapping *v1beta1.ServiceNameMapping, opts v1.UpdateOptions) (result *v1beta1.ServiceNameMapping, err error) { + result = &v1beta1.ServiceNameMapping{} err = c.client.Put(). Namespace(c.ns). Resource("servicenamemappings"). @@ -163,8 +177,8 @@ func (c *serviceNameMappings) DeleteCollection(ctx context.Context, opts v1.Dele } // Patch applies the patch and returns the patched serviceNameMapping. -func (c *serviceNameMappings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ServiceNameMapping, err error) { - result = &v1alpha1.ServiceNameMapping{} +func (c *serviceNameMappings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ServiceNameMapping, err error) { + result = &v1beta1.ServiceNameMapping{} err = c.client.Patch(pt). Namespace(c.ns). Resource("servicenamemappings"). diff --git a/pkg/rule/clientgen/clientset/versioned/typed/dubbo.apache.org/v1beta1/tagroute.go b/pkg/rule/clientgen/clientset/versioned/typed/dubbo.apache.org/v1beta1/tagroute.go new file mode 100644 index 000000000..de9596128 --- /dev/null +++ b/pkg/rule/clientgen/clientset/versioned/typed/dubbo.apache.org/v1beta1/tagroute.go @@ -0,0 +1,192 @@ +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by clientgen-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + v1beta1 "github.com/apache/dubbo-admin/pkg/rule/apis/dubbo.apache.org/v1beta1" + scheme "github.com/apache/dubbo-admin/pkg/rule/clientgen/clientset/versioned/scheme" + "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// TagRoutesGetter has a method to return a TagRouteInterface. +// A group's clientgen should implement this interface. +type TagRoutesGetter interface { + TagRoutes(namespace string) TagRouteInterface +} + +// TagRouteInterface has methods to work with TagRoute resources. +type TagRouteInterface interface { + Create(ctx context.Context, tagRoute *v1beta1.TagRoute, opts v1.CreateOptions) (*v1beta1.TagRoute, error) + Update(ctx context.Context, tagRoute *v1beta1.TagRoute, opts v1.UpdateOptions) (*v1beta1.TagRoute, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.TagRoute, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.TagRouteList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.TagRoute, err error) + TagRouteExpansion +} + +// tagRoutes implements TagRouteInterface +type tagRoutes struct { + client rest.Interface + ns string +} + +// newTagRoutes returns a TagRoutes +func newTagRoutes(c *DubboV1beta1Client, namespace string) *tagRoutes { + return &tagRoutes{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the tagRoute, and returns the corresponding tagRoute object, and an error if there is any. +func (c *tagRoutes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.TagRoute, err error) { + result = &v1beta1.TagRoute{} + err = c.client.Get(). + Namespace(c.ns). + Resource("tagroutes"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of TagRoutes that match those selectors. +func (c *tagRoutes) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.TagRouteList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.TagRouteList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("tagroutes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested tagRoutes. +func (c *tagRoutes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("tagroutes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a tagRoute and creates it. Returns the server's representation of the tagRoute, and an error, if there is any. +func (c *tagRoutes) Create(ctx context.Context, tagRoute *v1beta1.TagRoute, opts v1.CreateOptions) (result *v1beta1.TagRoute, err error) { + result = &v1beta1.TagRoute{} + err = c.client.Post(). + Namespace(c.ns). + Resource("tagroutes"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(tagRoute). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a tagRoute and updates it. Returns the server's representation of the tagRoute, and an error, if there is any. +func (c *tagRoutes) Update(ctx context.Context, tagRoute *v1beta1.TagRoute, opts v1.UpdateOptions) (result *v1beta1.TagRoute, err error) { + result = &v1beta1.TagRoute{} + err = c.client.Put(). + Namespace(c.ns). + Resource("tagroutes"). + Name(tagRoute.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(tagRoute). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the tagRoute and deletes it. Returns an error if one occurs. +func (c *tagRoutes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("tagroutes"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *tagRoutes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("tagroutes"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched tagRoute. +func (c *tagRoutes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.TagRoute, err error) { + result = &v1beta1.TagRoute{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("tagroutes"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/authority/generated/informers/externalversions/dubbo.apache.org/interface.go b/pkg/rule/clientgen/informers/externalversions/dubbo.apache.org/interface.go similarity index 67% rename from pkg/authority/generated/informers/externalversions/dubbo.apache.org/interface.go rename to pkg/rule/clientgen/informers/externalversions/dubbo.apache.org/interface.go index bff7f5602..9ae92a60a 100644 --- a/pkg/authority/generated/informers/externalversions/dubbo.apache.org/interface.go +++ b/pkg/rule/clientgen/informers/externalversions/dubbo.apache.org/interface.go @@ -12,14 +12,29 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by informer-gen. DO NOT EDIT. package dubbo import ( - v1beta1 "github.com/apache/dubbo-admin/pkg/authority/generated/informers/externalversions/dubbo.apache.org/v1beta1" - internalinterfaces "github.com/apache/dubbo-admin/pkg/authority/generated/informers/externalversions/internalinterfaces" + v1beta1 "github.com/apache/dubbo-admin/pkg/rule/clientgen/informers/externalversions/dubbo.apache.org/v1beta1" + internalinterfaces "github.com/apache/dubbo-admin/pkg/rule/clientgen/informers/externalversions/internalinterfaces" ) // Interface provides access to each of this group's versions. diff --git a/pkg/authority/generated/informers/externalversions/dubbo.apache.org/v1beta1/authenticationpolicy.go b/pkg/rule/clientgen/informers/externalversions/dubbo.apache.org/v1beta1/authenticationpolicy.go similarity index 80% rename from pkg/authority/generated/informers/externalversions/dubbo.apache.org/v1beta1/authenticationpolicy.go rename to pkg/rule/clientgen/informers/externalversions/dubbo.apache.org/v1beta1/authenticationpolicy.go index 4dc26271a..dca25d40d 100644 --- a/pkg/authority/generated/informers/externalversions/dubbo.apache.org/v1beta1/authenticationpolicy.go +++ b/pkg/rule/clientgen/informers/externalversions/dubbo.apache.org/v1beta1/authenticationpolicy.go @@ -12,6 +12,21 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by informer-gen. DO NOT EDIT. @@ -19,12 +34,12 @@ package v1beta1 import ( "context" + dubboapacheorgv1beta1 "github.com/apache/dubbo-admin/pkg/rule/apis/dubbo.apache.org/v1beta1" + versioned "github.com/apache/dubbo-admin/pkg/rule/clientgen/clientset/versioned" + internalinterfaces "github.com/apache/dubbo-admin/pkg/rule/clientgen/informers/externalversions/internalinterfaces" + v1beta1 "github.com/apache/dubbo-admin/pkg/rule/clientgen/listers/dubbo.apache.org/v1beta1" time "time" - dubboapacheorgv1beta1 "github.com/apache/dubbo-admin/pkg/authority/apis/dubbo.apache.org/v1beta1" - versioned "github.com/apache/dubbo-admin/pkg/authority/generated/clientset/versioned" - internalinterfaces "github.com/apache/dubbo-admin/pkg/authority/generated/informers/externalversions/internalinterfaces" - v1beta1 "github.com/apache/dubbo-admin/pkg/authority/generated/listers/dubbo.apache.org/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/authority/generated/informers/externalversions/dubbo.apache.org/v1beta1/authorizationpolicy.go b/pkg/rule/clientgen/informers/externalversions/dubbo.apache.org/v1beta1/authorizationpolicy.go similarity index 79% rename from pkg/authority/generated/informers/externalversions/dubbo.apache.org/v1beta1/authorizationpolicy.go rename to pkg/rule/clientgen/informers/externalversions/dubbo.apache.org/v1beta1/authorizationpolicy.go index c64d61348..6fbd9ea89 100644 --- a/pkg/authority/generated/informers/externalversions/dubbo.apache.org/v1beta1/authorizationpolicy.go +++ b/pkg/rule/clientgen/informers/externalversions/dubbo.apache.org/v1beta1/authorizationpolicy.go @@ -12,6 +12,21 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by informer-gen. DO NOT EDIT. @@ -19,12 +34,12 @@ package v1beta1 import ( "context" + dubboapacheorgv1beta1 "github.com/apache/dubbo-admin/pkg/rule/apis/dubbo.apache.org/v1beta1" + versioned "github.com/apache/dubbo-admin/pkg/rule/clientgen/clientset/versioned" + internalinterfaces "github.com/apache/dubbo-admin/pkg/rule/clientgen/informers/externalversions/internalinterfaces" + v1beta1 "github.com/apache/dubbo-admin/pkg/rule/clientgen/listers/dubbo.apache.org/v1beta1" time "time" - dubboapacheorgv1beta1 "github.com/apache/dubbo-admin/pkg/authority/apis/dubbo.apache.org/v1beta1" - versioned "github.com/apache/dubbo-admin/pkg/authority/generated/clientset/versioned" - internalinterfaces "github.com/apache/dubbo-admin/pkg/authority/generated/informers/externalversions/internalinterfaces" - v1beta1 "github.com/apache/dubbo-admin/pkg/authority/generated/listers/dubbo.apache.org/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/rule/clientgen/informers/externalversions/dubbo.apache.org/v1beta1/conditionroute.go b/pkg/rule/clientgen/informers/externalversions/dubbo.apache.org/v1beta1/conditionroute.go new file mode 100644 index 000000000..4147d62b6 --- /dev/null +++ b/pkg/rule/clientgen/informers/externalversions/dubbo.apache.org/v1beta1/conditionroute.go @@ -0,0 +1,104 @@ +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + dubboapacheorgv1beta1 "github.com/apache/dubbo-admin/pkg/rule/apis/dubbo.apache.org/v1beta1" + versioned "github.com/apache/dubbo-admin/pkg/rule/clientgen/clientset/versioned" + internalinterfaces "github.com/apache/dubbo-admin/pkg/rule/clientgen/informers/externalversions/internalinterfaces" + v1beta1 "github.com/apache/dubbo-admin/pkg/rule/clientgen/listers/dubbo.apache.org/v1beta1" + time "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ConditionRouteInformer provides access to a shared informer and lister for +// ConditionRoutes. +type ConditionRouteInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1beta1.ConditionRouteLister +} + +type conditionRouteInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewConditionRouteInformer constructs a new informer for ConditionRoute type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewConditionRouteInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredConditionRouteInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredConditionRouteInformer constructs a new informer for ConditionRoute type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredConditionRouteInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.DubboV1beta1().ConditionRoutes(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.DubboV1beta1().ConditionRoutes(namespace).Watch(context.TODO(), options) + }, + }, + &dubboapacheorgv1beta1.ConditionRoute{}, + resyncPeriod, + indexers, + ) +} + +func (f *conditionRouteInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredConditionRouteInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *conditionRouteInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&dubboapacheorgv1beta1.ConditionRoute{}, f.defaultInformer) +} + +func (f *conditionRouteInformer) Lister() v1beta1.ConditionRouteLister { + return v1beta1.NewConditionRouteLister(f.Informer().GetIndexer()) +} diff --git a/pkg/rule/clientgen/informers/externalversions/dubbo.apache.org/v1beta1/dynamicconfig.go b/pkg/rule/clientgen/informers/externalversions/dubbo.apache.org/v1beta1/dynamicconfig.go new file mode 100644 index 000000000..4f6cf17c4 --- /dev/null +++ b/pkg/rule/clientgen/informers/externalversions/dubbo.apache.org/v1beta1/dynamicconfig.go @@ -0,0 +1,104 @@ +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + dubboapacheorgv1beta1 "github.com/apache/dubbo-admin/pkg/rule/apis/dubbo.apache.org/v1beta1" + versioned "github.com/apache/dubbo-admin/pkg/rule/clientgen/clientset/versioned" + internalinterfaces "github.com/apache/dubbo-admin/pkg/rule/clientgen/informers/externalversions/internalinterfaces" + v1beta1 "github.com/apache/dubbo-admin/pkg/rule/clientgen/listers/dubbo.apache.org/v1beta1" + time "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// DynamicConfigInformer provides access to a shared informer and lister for +// DynamicConfigs. +type DynamicConfigInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1beta1.DynamicConfigLister +} + +type dynamicConfigInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewDynamicConfigInformer constructs a new informer for DynamicConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewDynamicConfigInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredDynamicConfigInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredDynamicConfigInformer constructs a new informer for DynamicConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredDynamicConfigInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.DubboV1beta1().DynamicConfigs(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.DubboV1beta1().DynamicConfigs(namespace).Watch(context.TODO(), options) + }, + }, + &dubboapacheorgv1beta1.DynamicConfig{}, + resyncPeriod, + indexers, + ) +} + +func (f *dynamicConfigInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredDynamicConfigInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *dynamicConfigInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&dubboapacheorgv1beta1.DynamicConfig{}, f.defaultInformer) +} + +func (f *dynamicConfigInformer) Lister() v1beta1.DynamicConfigLister { + return v1beta1.NewDynamicConfigLister(f.Informer().GetIndexer()) +} diff --git a/pkg/authority/generated/informers/externalversions/dubbo.apache.org/v1beta1/interface.go b/pkg/rule/clientgen/informers/externalversions/dubbo.apache.org/v1beta1/interface.go similarity index 52% rename from pkg/authority/generated/informers/externalversions/dubbo.apache.org/v1beta1/interface.go rename to pkg/rule/clientgen/informers/externalversions/dubbo.apache.org/v1beta1/interface.go index 008f809c4..f9677a9fa 100644 --- a/pkg/authority/generated/informers/externalversions/dubbo.apache.org/v1beta1/interface.go +++ b/pkg/rule/clientgen/informers/externalversions/dubbo.apache.org/v1beta1/interface.go @@ -12,13 +12,28 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( - internalinterfaces "github.com/apache/dubbo-admin/pkg/authority/generated/informers/externalversions/internalinterfaces" + internalinterfaces "github.com/apache/dubbo-admin/pkg/rule/clientgen/informers/externalversions/internalinterfaces" ) // Interface provides access to all the informers in this group version. @@ -27,6 +42,14 @@ type Interface interface { AuthenticationPolicies() AuthenticationPolicyInformer // AuthorizationPolicies returns a AuthorizationPolicyInformer. AuthorizationPolicies() AuthorizationPolicyInformer + // ConditionRoutes returns a ConditionRouteInformer. + ConditionRoutes() ConditionRouteInformer + // DynamicConfigs returns a DynamicConfigInformer. + DynamicConfigs() DynamicConfigInformer + // ServiceNameMappings returns a ServiceNameMappingInformer. + ServiceNameMappings() ServiceNameMappingInformer + // TagRoutes returns a TagRouteInformer. + TagRoutes() TagRouteInformer } type version struct { @@ -49,3 +72,23 @@ func (v *version) AuthenticationPolicies() AuthenticationPolicyInformer { func (v *version) AuthorizationPolicies() AuthorizationPolicyInformer { return &authorizationPolicyInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } + +// ConditionRoutes returns a ConditionRouteInformer. +func (v *version) ConditionRoutes() ConditionRouteInformer { + return &conditionRouteInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// DynamicConfigs returns a DynamicConfigInformer. +func (v *version) DynamicConfigs() DynamicConfigInformer { + return &dynamicConfigInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// ServiceNameMappings returns a ServiceNameMappingInformer. +func (v *version) ServiceNameMappings() ServiceNameMappingInformer { + return &serviceNameMappingInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// TagRoutes returns a TagRouteInformer. +func (v *version) TagRoutes() TagRouteInformer { + return &tagRouteInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} diff --git a/pkg/mapping/generated/informers/externalversions/dubbo.apache.org/v1alpha1/servicenamemapping.go b/pkg/rule/clientgen/informers/externalversions/dubbo.apache.org/v1beta1/servicenamemapping.go similarity index 63% rename from pkg/mapping/generated/informers/externalversions/dubbo.apache.org/v1alpha1/servicenamemapping.go rename to pkg/rule/clientgen/informers/externalversions/dubbo.apache.org/v1beta1/servicenamemapping.go index b9ae228e5..1659790aa 100644 --- a/pkg/mapping/generated/informers/externalversions/dubbo.apache.org/v1alpha1/servicenamemapping.go +++ b/pkg/rule/clientgen/informers/externalversions/dubbo.apache.org/v1beta1/servicenamemapping.go @@ -1,3 +1,17 @@ +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. /* Copyright The Kubernetes Authors. @@ -16,14 +30,14 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package v1alpha1 +package v1beta1 import ( "context" - dubboapacheorgv1alpha1 "github.com/apache/dubbo-admin/pkg/mapping/apis/dubbo.apache.org/v1alpha1" - versioned "github.com/apache/dubbo-admin/pkg/mapping/generated/clientset/versioned" - internalinterfaces "github.com/apache/dubbo-admin/pkg/mapping/generated/informers/externalversions/internalinterfaces" - v1alpha1 "github.com/apache/dubbo-admin/pkg/mapping/generated/listers/dubbo.apache.org/v1alpha1" + dubboapacheorgv1beta1 "github.com/apache/dubbo-admin/pkg/rule/apis/dubbo.apache.org/v1beta1" + versioned "github.com/apache/dubbo-admin/pkg/rule/clientgen/clientset/versioned" + internalinterfaces "github.com/apache/dubbo-admin/pkg/rule/clientgen/informers/externalversions/internalinterfaces" + v1beta1 "github.com/apache/dubbo-admin/pkg/rule/clientgen/listers/dubbo.apache.org/v1beta1" time "time" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -36,7 +50,7 @@ import ( // ServiceNameMappings. type ServiceNameMappingInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha1.ServiceNameMappingLister + Lister() v1beta1.ServiceNameMappingLister } type serviceNameMappingInformer struct { @@ -62,16 +76,16 @@ func NewFilteredServiceNameMappingInformer(client versioned.Interface, namespace if tweakListOptions != nil { tweakListOptions(&options) } - return client.DubboV1alpha1().ServiceNameMappings(namespace).List(context.TODO(), options) + return client.DubboV1beta1().ServiceNameMappings(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.DubboV1alpha1().ServiceNameMappings(namespace).Watch(context.TODO(), options) + return client.DubboV1beta1().ServiceNameMappings(namespace).Watch(context.TODO(), options) }, }, - &dubboapacheorgv1alpha1.ServiceNameMapping{}, + &dubboapacheorgv1beta1.ServiceNameMapping{}, resyncPeriod, indexers, ) @@ -82,9 +96,9 @@ func (f *serviceNameMappingInformer) defaultInformer(client versioned.Interface, } func (f *serviceNameMappingInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&dubboapacheorgv1alpha1.ServiceNameMapping{}, f.defaultInformer) + return f.factory.InformerFor(&dubboapacheorgv1beta1.ServiceNameMapping{}, f.defaultInformer) } -func (f *serviceNameMappingInformer) Lister() v1alpha1.ServiceNameMappingLister { - return v1alpha1.NewServiceNameMappingLister(f.Informer().GetIndexer()) +func (f *serviceNameMappingInformer) Lister() v1beta1.ServiceNameMappingLister { + return v1beta1.NewServiceNameMappingLister(f.Informer().GetIndexer()) } diff --git a/pkg/rule/clientgen/informers/externalversions/dubbo.apache.org/v1beta1/tagroute.go b/pkg/rule/clientgen/informers/externalversions/dubbo.apache.org/v1beta1/tagroute.go new file mode 100644 index 000000000..cb8975c53 --- /dev/null +++ b/pkg/rule/clientgen/informers/externalversions/dubbo.apache.org/v1beta1/tagroute.go @@ -0,0 +1,104 @@ +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + dubboapacheorgv1beta1 "github.com/apache/dubbo-admin/pkg/rule/apis/dubbo.apache.org/v1beta1" + versioned "github.com/apache/dubbo-admin/pkg/rule/clientgen/clientset/versioned" + internalinterfaces "github.com/apache/dubbo-admin/pkg/rule/clientgen/informers/externalversions/internalinterfaces" + v1beta1 "github.com/apache/dubbo-admin/pkg/rule/clientgen/listers/dubbo.apache.org/v1beta1" + time "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// TagRouteInformer provides access to a shared informer and lister for +// TagRoutes. +type TagRouteInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1beta1.TagRouteLister +} + +type tagRouteInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewTagRouteInformer constructs a new informer for TagRoute type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTagRouteInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredTagRouteInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredTagRouteInformer constructs a new informer for TagRoute type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredTagRouteInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.DubboV1beta1().TagRoutes(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.DubboV1beta1().TagRoutes(namespace).Watch(context.TODO(), options) + }, + }, + &dubboapacheorgv1beta1.TagRoute{}, + resyncPeriod, + indexers, + ) +} + +func (f *tagRouteInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredTagRouteInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *tagRouteInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&dubboapacheorgv1beta1.TagRoute{}, f.defaultInformer) +} + +func (f *tagRouteInformer) Lister() v1beta1.TagRouteLister { + return v1beta1.NewTagRouteLister(f.Informer().GetIndexer()) +} diff --git a/pkg/authority/generated/informers/externalversions/factory.go b/pkg/rule/clientgen/informers/externalversions/factory.go similarity index 68% rename from pkg/authority/generated/informers/externalversions/factory.go rename to pkg/rule/clientgen/informers/externalversions/factory.go index d2dbe08d5..10e172b54 100644 --- a/pkg/authority/generated/informers/externalversions/factory.go +++ b/pkg/rule/clientgen/informers/externalversions/factory.go @@ -12,19 +12,34 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by informer-gen. DO NOT EDIT. package externalversions import ( + versioned "github.com/apache/dubbo-admin/pkg/rule/clientgen/clientset/versioned" + dubboapacheorg "github.com/apache/dubbo-admin/pkg/rule/clientgen/informers/externalversions/dubbo.apache.org" + internalinterfaces "github.com/apache/dubbo-admin/pkg/rule/clientgen/informers/externalversions/internalinterfaces" reflect "reflect" sync "sync" time "time" - versioned "github.com/apache/dubbo-admin/pkg/authority/generated/clientset/versioned" - dubboapacheorg "github.com/apache/dubbo-admin/pkg/authority/generated/informers/externalversions/dubbo.apache.org" - internalinterfaces "github.com/apache/dubbo-admin/pkg/authority/generated/informers/externalversions/internalinterfaces" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -46,11 +61,6 @@ type sharedInformerFactory struct { // startedInformers is used for tracking which informers have been started. // This allows Start() to be called multiple times safely. startedInformers map[reflect.Type]bool - // wg tracks how many goroutines were started. - wg sync.WaitGroup - // shuttingDown is true when Shutdown has been called. It may still be running - // because it needs to wait for goroutines. - shuttingDown bool } // WithCustomResyncConfig sets a custom resync period for the specified informer types. @@ -111,39 +121,20 @@ func NewSharedInformerFactoryWithOptions(client versioned.Interface, defaultResy return factory } +// Start initializes all requested informers. func (f *sharedInformerFactory) Start(stopCh <-chan struct{}) { f.lock.Lock() defer f.lock.Unlock() - if f.shuttingDown { - return - } - for informerType, informer := range f.informers { if !f.startedInformers[informerType] { - f.wg.Add(1) - // We need a new variable in each loop iteration, - // otherwise the goroutine would use the loop variable - // and that keeps changing. - informer := informer - go func() { - defer f.wg.Done() - informer.Run(stopCh) - }() + go informer.Run(stopCh) f.startedInformers[informerType] = true } } } -func (f *sharedInformerFactory) Shutdown() { - f.lock.Lock() - f.shuttingDown = true - f.lock.Unlock() - - // Will return immediately if there is nothing to wait for. - f.wg.Wait() -} - +// WaitForCacheSync waits for all started informers' cache were synced. func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool { informers := func() map[reflect.Type]cache.SharedIndexInformer { f.lock.Lock() @@ -166,7 +157,7 @@ func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[ref } // InternalInformerFor returns the SharedIndexInformer for obj using an internal -// client. +// clientgen. func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer { f.lock.Lock() defer f.lock.Unlock() @@ -190,57 +181,10 @@ func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internal // SharedInformerFactory provides shared informers for resources in all known // API group versions. -// -// It is typically used like this: -// -// ctx, cancel := context.Background() -// defer cancel() -// factory := NewSharedInformerFactory(client, resyncPeriod) -// defer factory.WaitForStop() // Returns immediately if nothing was started. -// genericInformer := factory.ForResource(resource) -// typedInformer := factory.SomeAPIGroup().V1().SomeType() -// factory.Start(ctx.Done()) // Start processing these informers. -// synced := factory.WaitForCacheSync(ctx.Done()) -// for v, ok := range synced { -// if !ok { -// fmt.Fprintf(os.Stderr, "caches failed to sync: %v", v) -// return -// } -// } -// -// // Creating informers can also be created after Start, but then -// // Start must be called again: -// anotherGenericInformer := factory.ForResource(resource) -// factory.Start(ctx.Done()) type SharedInformerFactory interface { internalinterfaces.SharedInformerFactory - - // Start initializes all requested informers. They are handled in goroutines - // which run until the stop channel gets closed. - Start(stopCh <-chan struct{}) - - // Shutdown marks a factory as shutting down. At that point no new - // informers can be started anymore and Start will return without - // doing anything. - // - // In addition, Shutdown blocks until all goroutines have terminated. For that - // to happen, the close channel(s) that they were started with must be closed, - // either before Shutdown gets called or while it is waiting. - // - // Shutdown may be called multiple times, even concurrently. All such calls will - // block until all goroutines have terminated. - Shutdown() - - // WaitForCacheSync blocks until all started informers' caches were synced - // or the stop channel gets closed. - WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool - - // ForResource gives generic access to a shared informer of the matching type. ForResource(resource schema.GroupVersionResource) (GenericInformer, error) - - // InternalInformerFor returns the SharedIndexInformer for obj using an internal - // client. - InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer + WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool Dubbo() dubboapacheorg.Interface } diff --git a/pkg/authority/generated/informers/externalversions/generic.go b/pkg/rule/clientgen/informers/externalversions/generic.go similarity index 61% rename from pkg/authority/generated/informers/externalversions/generic.go rename to pkg/rule/clientgen/informers/externalversions/generic.go index 2fb356064..e86b46402 100644 --- a/pkg/authority/generated/informers/externalversions/generic.go +++ b/pkg/rule/clientgen/informers/externalversions/generic.go @@ -13,14 +13,30 @@ // See the License for the specific language governing permissions and // limitations under the License. +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + // Code generated by informer-gen. DO NOT EDIT. package externalversions import ( "fmt" + v1beta1 "github.com/apache/dubbo-admin/pkg/rule/apis/dubbo.apache.org/v1beta1" - v1beta1 "github.com/apache/dubbo-admin/pkg/authority/apis/dubbo.apache.org/v1beta1" schema "k8s.io/apimachinery/pkg/runtime/schema" cache "k8s.io/client-go/tools/cache" ) @@ -48,7 +64,7 @@ func (f *genericInformer) Lister() cache.GenericLister { } // ForResource gives generic access to a shared informer of the matching type -// TODO extend this to unknown resources with a client pool +// TODO extend this to unknown resources with a clientgen pool func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { switch resource { // Group=dubbo.apache.org, Version=v1beta1 @@ -56,6 +72,14 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource return &genericInformer{resource: resource.GroupResource(), informer: f.Dubbo().V1beta1().AuthenticationPolicies().Informer()}, nil case v1beta1.SchemeGroupVersion.WithResource("authorizationpolicies"): return &genericInformer{resource: resource.GroupResource(), informer: f.Dubbo().V1beta1().AuthorizationPolicies().Informer()}, nil + case v1beta1.SchemeGroupVersion.WithResource("conditionroutes"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Dubbo().V1beta1().ConditionRoutes().Informer()}, nil + case v1beta1.SchemeGroupVersion.WithResource("dynamicconfigs"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Dubbo().V1beta1().DynamicConfigs().Informer()}, nil + case v1beta1.SchemeGroupVersion.WithResource("servicenamemappings"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Dubbo().V1beta1().ServiceNameMappings().Informer()}, nil + case v1beta1.SchemeGroupVersion.WithResource("tagroutes"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Dubbo().V1beta1().TagRoutes().Informer()}, nil } diff --git a/pkg/authority/generated/informers/externalversions/internalinterfaces/factory_interfaces.go b/pkg/rule/clientgen/informers/externalversions/internalinterfaces/factory_interfaces.go similarity index 70% rename from pkg/authority/generated/informers/externalversions/internalinterfaces/factory_interfaces.go rename to pkg/rule/clientgen/informers/externalversions/internalinterfaces/factory_interfaces.go index 8f4f30417..029785218 100644 --- a/pkg/authority/generated/informers/externalversions/internalinterfaces/factory_interfaces.go +++ b/pkg/rule/clientgen/informers/externalversions/internalinterfaces/factory_interfaces.go @@ -12,15 +12,30 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by informer-gen. DO NOT EDIT. package internalinterfaces import ( + versioned "github.com/apache/dubbo-admin/pkg/rule/clientgen/clientset/versioned" time "time" - versioned "github.com/apache/dubbo-admin/pkg/authority/generated/clientset/versioned" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" cache "k8s.io/client-go/tools/cache" diff --git a/pkg/authority/generated/listers/dubbo.apache.org/v1beta1/authenticationpolicy.go b/pkg/rule/clientgen/listers/dubbo.apache.org/v1beta1/authenticationpolicy.go similarity index 86% rename from pkg/authority/generated/listers/dubbo.apache.org/v1beta1/authenticationpolicy.go rename to pkg/rule/clientgen/listers/dubbo.apache.org/v1beta1/authenticationpolicy.go index 6c01b5132..08b141272 100644 --- a/pkg/authority/generated/listers/dubbo.apache.org/v1beta1/authenticationpolicy.go +++ b/pkg/rule/clientgen/listers/dubbo.apache.org/v1beta1/authenticationpolicy.go @@ -12,13 +12,29 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by lister-gen. DO NOT EDIT. package v1beta1 import ( - v1beta1 "github.com/apache/dubbo-admin/pkg/authority/apis/dubbo.apache.org/v1beta1" + v1beta1 "github.com/apache/dubbo-admin/pkg/rule/apis/dubbo.apache.org/v1beta1" + "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" diff --git a/pkg/authority/generated/listers/dubbo.apache.org/v1beta1/authorizationpolicy.go b/pkg/rule/clientgen/listers/dubbo.apache.org/v1beta1/authorizationpolicy.go similarity index 86% rename from pkg/authority/generated/listers/dubbo.apache.org/v1beta1/authorizationpolicy.go rename to pkg/rule/clientgen/listers/dubbo.apache.org/v1beta1/authorizationpolicy.go index bd670bd50..8a04f7632 100644 --- a/pkg/authority/generated/listers/dubbo.apache.org/v1beta1/authorizationpolicy.go +++ b/pkg/rule/clientgen/listers/dubbo.apache.org/v1beta1/authorizationpolicy.go @@ -12,13 +12,29 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by lister-gen. DO NOT EDIT. package v1beta1 import ( - v1beta1 "github.com/apache/dubbo-admin/pkg/authority/apis/dubbo.apache.org/v1beta1" + v1beta1 "github.com/apache/dubbo-admin/pkg/rule/apis/dubbo.apache.org/v1beta1" + "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" diff --git a/pkg/rule/clientgen/listers/dubbo.apache.org/v1beta1/conditionroute.go b/pkg/rule/clientgen/listers/dubbo.apache.org/v1beta1/conditionroute.go new file mode 100644 index 000000000..d2bb939c0 --- /dev/null +++ b/pkg/rule/clientgen/listers/dubbo.apache.org/v1beta1/conditionroute.go @@ -0,0 +1,114 @@ +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1beta1 "github.com/apache/dubbo-admin/pkg/rule/apis/dubbo.apache.org/v1beta1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ConditionRouteLister helps list ConditionRoutes. +// All objects returned here must be treated as read-only. +type ConditionRouteLister interface { + // List lists all ConditionRoutes in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1beta1.ConditionRoute, err error) + // ConditionRoutes returns an object that can list and get ConditionRoutes. + ConditionRoutes(namespace string) ConditionRouteNamespaceLister + ConditionRouteListerExpansion +} + +// conditionRouteLister implements the ConditionRouteLister interface. +type conditionRouteLister struct { + indexer cache.Indexer +} + +// NewConditionRouteLister returns a new ConditionRouteLister. +func NewConditionRouteLister(indexer cache.Indexer) ConditionRouteLister { + return &conditionRouteLister{indexer: indexer} +} + +// List lists all ConditionRoutes in the indexer. +func (s *conditionRouteLister) List(selector labels.Selector) (ret []*v1beta1.ConditionRoute, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.ConditionRoute)) + }) + return ret, err +} + +// ConditionRoutes returns an object that can list and get ConditionRoutes. +func (s *conditionRouteLister) ConditionRoutes(namespace string) ConditionRouteNamespaceLister { + return conditionRouteNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// ConditionRouteNamespaceLister helps list and get ConditionRoutes. +// All objects returned here must be treated as read-only. +type ConditionRouteNamespaceLister interface { + // List lists all ConditionRoutes in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1beta1.ConditionRoute, err error) + // Get retrieves the ConditionRoute from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1beta1.ConditionRoute, error) + ConditionRouteNamespaceListerExpansion +} + +// conditionRouteNamespaceLister implements the ConditionRouteNamespaceLister +// interface. +type conditionRouteNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all ConditionRoutes in the indexer for a given namespace. +func (s conditionRouteNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.ConditionRoute, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.ConditionRoute)) + }) + return ret, err +} + +// Get retrieves the ConditionRoute from the indexer for a given namespace and name. +func (s conditionRouteNamespaceLister) Get(name string) (*v1beta1.ConditionRoute, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1beta1.Resource("conditionroute"), name) + } + return obj.(*v1beta1.ConditionRoute), nil +} diff --git a/pkg/rule/clientgen/listers/dubbo.apache.org/v1beta1/dynamicconfig.go b/pkg/rule/clientgen/listers/dubbo.apache.org/v1beta1/dynamicconfig.go new file mode 100644 index 000000000..d518c8b26 --- /dev/null +++ b/pkg/rule/clientgen/listers/dubbo.apache.org/v1beta1/dynamicconfig.go @@ -0,0 +1,114 @@ +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1beta1 "github.com/apache/dubbo-admin/pkg/rule/apis/dubbo.apache.org/v1beta1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// DynamicConfigLister helps list DynamicConfigs. +// All objects returned here must be treated as read-only. +type DynamicConfigLister interface { + // List lists all DynamicConfigs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1beta1.DynamicConfig, err error) + // DynamicConfigs returns an object that can list and get DynamicConfigs. + DynamicConfigs(namespace string) DynamicConfigNamespaceLister + DynamicConfigListerExpansion +} + +// dynamicConfigLister implements the DynamicConfigLister interface. +type dynamicConfigLister struct { + indexer cache.Indexer +} + +// NewDynamicConfigLister returns a new DynamicConfigLister. +func NewDynamicConfigLister(indexer cache.Indexer) DynamicConfigLister { + return &dynamicConfigLister{indexer: indexer} +} + +// List lists all DynamicConfigs in the indexer. +func (s *dynamicConfigLister) List(selector labels.Selector) (ret []*v1beta1.DynamicConfig, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.DynamicConfig)) + }) + return ret, err +} + +// DynamicConfigs returns an object that can list and get DynamicConfigs. +func (s *dynamicConfigLister) DynamicConfigs(namespace string) DynamicConfigNamespaceLister { + return dynamicConfigNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// DynamicConfigNamespaceLister helps list and get DynamicConfigs. +// All objects returned here must be treated as read-only. +type DynamicConfigNamespaceLister interface { + // List lists all DynamicConfigs in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1beta1.DynamicConfig, err error) + // Get retrieves the DynamicConfig from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1beta1.DynamicConfig, error) + DynamicConfigNamespaceListerExpansion +} + +// dynamicConfigNamespaceLister implements the DynamicConfigNamespaceLister +// interface. +type dynamicConfigNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all DynamicConfigs in the indexer for a given namespace. +func (s dynamicConfigNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.DynamicConfig, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.DynamicConfig)) + }) + return ret, err +} + +// Get retrieves the DynamicConfig from the indexer for a given namespace and name. +func (s dynamicConfigNamespaceLister) Get(name string) (*v1beta1.DynamicConfig, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1beta1.Resource("dynamicconfig"), name) + } + return obj.(*v1beta1.DynamicConfig), nil +} diff --git a/pkg/rule/clientgen/listers/dubbo.apache.org/v1beta1/expansion_generated.go b/pkg/rule/clientgen/listers/dubbo.apache.org/v1beta1/expansion_generated.go new file mode 100644 index 000000000..1899b923a --- /dev/null +++ b/pkg/rule/clientgen/listers/dubbo.apache.org/v1beta1/expansion_generated.go @@ -0,0 +1,81 @@ +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1beta1 + +// AuthenticationPolicyListerExpansion allows custom methods to be added to +// AuthenticationPolicyLister. +type AuthenticationPolicyListerExpansion interface{} + +// AuthenticationPolicyNamespaceListerExpansion allows custom methods to be added to +// AuthenticationPolicyNamespaceLister. +type AuthenticationPolicyNamespaceListerExpansion interface{} + +// AuthorizationPolicyListerExpansion allows custom methods to be added to +// AuthorizationPolicyLister. +type AuthorizationPolicyListerExpansion interface{} + +// AuthorizationPolicyNamespaceListerExpansion allows custom methods to be added to +// AuthorizationPolicyNamespaceLister. +type AuthorizationPolicyNamespaceListerExpansion interface{} + +// ConditionRouteListerExpansion allows custom methods to be added to +// ConditionRouteLister. +type ConditionRouteListerExpansion interface{} + +// ConditionRouteNamespaceListerExpansion allows custom methods to be added to +// ConditionRouteNamespaceLister. +type ConditionRouteNamespaceListerExpansion interface{} + +// DynamicConfigListerExpansion allows custom methods to be added to +// DynamicConfigLister. +type DynamicConfigListerExpansion interface{} + +// DynamicConfigNamespaceListerExpansion allows custom methods to be added to +// DynamicConfigNamespaceLister. +type DynamicConfigNamespaceListerExpansion interface{} + +// ServiceNameMappingListerExpansion allows custom methods to be added to +// ServiceNameMappingLister. +type ServiceNameMappingListerExpansion interface{} + +// ServiceNameMappingNamespaceListerExpansion allows custom methods to be added to +// ServiceNameMappingNamespaceLister. +type ServiceNameMappingNamespaceListerExpansion interface{} + +// TagRouteListerExpansion allows custom methods to be added to +// TagRouteLister. +type TagRouteListerExpansion interface{} + +// TagRouteNamespaceListerExpansion allows custom methods to be added to +// TagRouteNamespaceLister. +type TagRouteNamespaceListerExpansion interface{} diff --git a/pkg/mapping/generated/listers/dubbo.apache.org/v1alpha1/servicenamemapping.go b/pkg/rule/clientgen/listers/dubbo.apache.org/v1beta1/servicenamemapping.go similarity index 68% rename from pkg/mapping/generated/listers/dubbo.apache.org/v1alpha1/servicenamemapping.go rename to pkg/rule/clientgen/listers/dubbo.apache.org/v1beta1/servicenamemapping.go index 3e202f2ac..61711c23f 100644 --- a/pkg/mapping/generated/listers/dubbo.apache.org/v1alpha1/servicenamemapping.go +++ b/pkg/rule/clientgen/listers/dubbo.apache.org/v1beta1/servicenamemapping.go @@ -1,3 +1,17 @@ +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. /* Copyright The Kubernetes Authors. @@ -16,10 +30,10 @@ limitations under the License. // Code generated by lister-gen. DO NOT EDIT. -package v1alpha1 +package v1beta1 import ( - v1alpha1 "github.com/apache/dubbo-admin/pkg/mapping/apis/dubbo.apache.org/v1alpha1" + v1beta1 "github.com/apache/dubbo-admin/pkg/rule/apis/dubbo.apache.org/v1beta1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" @@ -31,7 +45,7 @@ import ( type ServiceNameMappingLister interface { // List lists all ServiceNameMappings in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha1.ServiceNameMapping, err error) + List(selector labels.Selector) (ret []*v1beta1.ServiceNameMapping, err error) // ServiceNameMappings returns an object that can list and get ServiceNameMappings. ServiceNameMappings(namespace string) ServiceNameMappingNamespaceLister ServiceNameMappingListerExpansion @@ -48,9 +62,9 @@ func NewServiceNameMappingLister(indexer cache.Indexer) ServiceNameMappingLister } // List lists all ServiceNameMappings in the indexer. -func (s *serviceNameMappingLister) List(selector labels.Selector) (ret []*v1alpha1.ServiceNameMapping, err error) { +func (s *serviceNameMappingLister) List(selector labels.Selector) (ret []*v1beta1.ServiceNameMapping, err error) { err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.ServiceNameMapping)) + ret = append(ret, m.(*v1beta1.ServiceNameMapping)) }) return ret, err } @@ -65,10 +79,10 @@ func (s *serviceNameMappingLister) ServiceNameMappings(namespace string) Service type ServiceNameMappingNamespaceLister interface { // List lists all ServiceNameMappings in the indexer for a given namespace. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha1.ServiceNameMapping, err error) + List(selector labels.Selector) (ret []*v1beta1.ServiceNameMapping, err error) // Get retrieves the ServiceNameMapping from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha1.ServiceNameMapping, error) + Get(name string) (*v1beta1.ServiceNameMapping, error) ServiceNameMappingNamespaceListerExpansion } @@ -80,21 +94,21 @@ type serviceNameMappingNamespaceLister struct { } // List lists all ServiceNameMappings in the indexer for a given namespace. -func (s serviceNameMappingNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.ServiceNameMapping, err error) { +func (s serviceNameMappingNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.ServiceNameMapping, err error) { err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.ServiceNameMapping)) + ret = append(ret, m.(*v1beta1.ServiceNameMapping)) }) return ret, err } // Get retrieves the ServiceNameMapping from the indexer for a given namespace and name. -func (s serviceNameMappingNamespaceLister) Get(name string) (*v1alpha1.ServiceNameMapping, error) { +func (s serviceNameMappingNamespaceLister) Get(name string) (*v1beta1.ServiceNameMapping, error) { obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) if err != nil { return nil, err } if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("servicenamemapping"), name) + return nil, errors.NewNotFound(v1beta1.Resource("servicenamemapping"), name) } - return obj.(*v1alpha1.ServiceNameMapping), nil + return obj.(*v1beta1.ServiceNameMapping), nil } diff --git a/pkg/rule/clientgen/listers/dubbo.apache.org/v1beta1/tagroute.go b/pkg/rule/clientgen/listers/dubbo.apache.org/v1beta1/tagroute.go new file mode 100644 index 000000000..5c5478d46 --- /dev/null +++ b/pkg/rule/clientgen/listers/dubbo.apache.org/v1beta1/tagroute.go @@ -0,0 +1,114 @@ +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1beta1 "github.com/apache/dubbo-admin/pkg/rule/apis/dubbo.apache.org/v1beta1" + + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// TagRouteLister helps list TagRoutes. +// All objects returned here must be treated as read-only. +type TagRouteLister interface { + // List lists all TagRoutes in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1beta1.TagRoute, err error) + // TagRoutes returns an object that can list and get TagRoutes. + TagRoutes(namespace string) TagRouteNamespaceLister + TagRouteListerExpansion +} + +// tagRouteLister implements the TagRouteLister interface. +type tagRouteLister struct { + indexer cache.Indexer +} + +// NewTagRouteLister returns a new TagRouteLister. +func NewTagRouteLister(indexer cache.Indexer) TagRouteLister { + return &tagRouteLister{indexer: indexer} +} + +// List lists all TagRoutes in the indexer. +func (s *tagRouteLister) List(selector labels.Selector) (ret []*v1beta1.TagRoute, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.TagRoute)) + }) + return ret, err +} + +// TagRoutes returns an object that can list and get TagRoutes. +func (s *tagRouteLister) TagRoutes(namespace string) TagRouteNamespaceLister { + return tagRouteNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// TagRouteNamespaceLister helps list and get TagRoutes. +// All objects returned here must be treated as read-only. +type TagRouteNamespaceLister interface { + // List lists all TagRoutes in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1beta1.TagRoute, err error) + // Get retrieves the TagRoute from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1beta1.TagRoute, error) + TagRouteNamespaceListerExpansion +} + +// tagRouteNamespaceLister implements the TagRouteNamespaceLister +// interface. +type tagRouteNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all TagRoutes in the indexer for a given namespace. +func (s tagRouteNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.TagRoute, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.TagRoute)) + }) + return ret, err +} + +// Get retrieves the TagRoute from the indexer for a given namespace and name. +func (s tagRouteNamespaceLister) Get(name string) (*v1beta1.TagRoute, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1beta1.Resource("tagroute"), name) + } + return obj.(*v1beta1.TagRoute), nil +} diff --git a/pkg/authority/rule/authentication/definition.go b/pkg/rule/crd/authentication/definition.go similarity index 100% rename from pkg/authority/rule/authentication/definition.go rename to pkg/rule/crd/authentication/definition.go diff --git a/pkg/authority/rule/authentication/handler.go b/pkg/rule/crd/authentication/handler.go similarity index 92% rename from pkg/authority/rule/authentication/handler.go rename to pkg/rule/crd/authentication/handler.go index dbcfda718..82ee06662 100644 --- a/pkg/authority/rule/authentication/handler.go +++ b/pkg/rule/crd/authentication/handler.go @@ -16,12 +16,11 @@ package authentication import ( + "github.com/apache/dubbo-admin/pkg/core/logger" + "github.com/apache/dubbo-admin/pkg/rule/storage" "reflect" "sync" "sync/atomic" - - "github.com/apache/dubbo-admin/pkg/authority/rule/connection" - "github.com/apache/dubbo-admin/pkg/logger" ) type Handler interface { @@ -35,11 +34,11 @@ type Impl struct { mutex *sync.Mutex revision int64 - storage *connection.Storage + storage *storage.Storage cache map[string]*Policy } -func NewHandler(storage *connection.Storage) *Impl { +func NewHandler(storage *storage.Storage) *Impl { return &Impl{ mutex: &sync.Mutex{}, storage: storage, @@ -137,7 +136,7 @@ func (i *Impl) Notify() { data: i.cache, } - i.storage.LatestRules[RuleType] = originRule + i.storage.LatestRules[storage.Authentication] = originRule i.storage.Mutex.RLock() defer i.storage.Mutex.RUnlock() diff --git a/pkg/authority/rule/authentication/handler_test.go b/pkg/rule/crd/authentication/handler_test.go similarity index 85% rename from pkg/authority/rule/authentication/handler_test.go rename to pkg/rule/crd/authentication/handler_test.go index 39c766444..836338256 100644 --- a/pkg/authority/rule/authentication/handler_test.go +++ b/pkg/rule/crd/authentication/handler_test.go @@ -16,27 +16,27 @@ package authentication_test import ( + authentication2 "github.com/apache/dubbo-admin/pkg/rule/crd/authentication" + "github.com/apache/dubbo-admin/pkg/rule/storage" "strconv" "sync" "testing" - "github.com/apache/dubbo-admin/pkg/authority/rule/authentication" - "github.com/apache/dubbo-admin/pkg/authority/rule/connection" "k8s.io/client-go/util/workqueue" ) func TestAdd(t *testing.T) { t.Parallel() - storage := connection.NewStorage() + storages := storage.NewStorage() wq := workqueue.NewNamed("raw-rule") - storage.Connection = []*connection.Connection{ + storages.Connection = []*storage.Connection{ { RawRuleQueue: wq, }, } - handler := authentication.NewHandler(storage) + handler := authentication2.NewHandler(storages) handler.Add("test", nil) @@ -48,7 +48,7 @@ func TestAdd(t *testing.T) { t.Error("expected queue length to be 0") } - policy := &authentication.Policy{} + policy := &authentication2.Policy{} handler.Add("test", policy) if handler.Get("test") != policy { @@ -83,10 +83,10 @@ func TestAdd(t *testing.T) { t.Error("expected queue length to be 2") } - policies := make(map[string]*authentication.Policy, 1000) + policies := make(map[string]*authentication2.Policy, 1000) for i := 0; i < 1000; i++ { - policies["test"+strconv.Itoa(i)] = &authentication.Policy{ + policies["test"+strconv.Itoa(i)] = &authentication2.Policy{ Name: "test" + strconv.Itoa(i), } } @@ -117,15 +117,15 @@ func TestAdd(t *testing.T) { func TestUpdate(t *testing.T) { t.Parallel() - storage := connection.NewStorage() + storages := storage.NewStorage() wq := workqueue.NewNamed("raw-rule") - storage.Connection = []*connection.Connection{ + storages.Connection = []*storage.Connection{ { RawRuleQueue: wq, }, } - handler := authentication.NewHandler(storage) + handler := authentication2.NewHandler(storages) handler.Update("test", nil) @@ -137,7 +137,7 @@ func TestUpdate(t *testing.T) { t.Error("expected queue length to be 0") } - policy := &authentication.Policy{} + policy := &authentication2.Policy{} handler.Update("test", policy) if handler.Get("test") != policy { @@ -172,10 +172,10 @@ func TestUpdate(t *testing.T) { t.Error("expected queue length to be 2") } - policies := make(map[string]*authentication.Policy, 1000) + policies := make(map[string]*authentication2.Policy, 1000) for i := 0; i < 1000; i++ { - policies["test"+strconv.Itoa(i)] = &authentication.Policy{ + policies["test"+strconv.Itoa(i)] = &authentication2.Policy{ Name: "test" + strconv.Itoa(i), } } @@ -206,17 +206,17 @@ func TestUpdate(t *testing.T) { func TestDelete(t *testing.T) { t.Parallel() - storage := connection.NewStorage() + storages := storage.NewStorage() wq := workqueue.NewNamed("raw-rule") - storage.Connection = []*connection.Connection{ + storages.Connection = []*storage.Connection{ { RawRuleQueue: wq, }, } - handler := authentication.NewHandler(storage) + handler := authentication2.NewHandler(storages) - policy := &authentication.Policy{} + policy := &authentication2.Policy{} handler.Add("test", policy) if handler.Get("test") != policy { @@ -282,7 +282,7 @@ func TestDelete(t *testing.T) { } for i := 0; i < 1000; i++ { - handler.Add("test"+strconv.Itoa(i), &authentication.Policy{ + handler.Add("test"+strconv.Itoa(i), &authentication2.Policy{ Name: "test" + strconv.Itoa(i), }) } diff --git a/pkg/authority/rule/authentication/rule.go b/pkg/rule/crd/authentication/rule.go similarity index 86% rename from pkg/authority/rule/authentication/rule.go rename to pkg/rule/crd/authentication/rule.go index fd9fa3d0d..3988b1e76 100644 --- a/pkg/authority/rule/authentication/rule.go +++ b/pkg/rule/crd/authentication/rule.go @@ -17,24 +17,22 @@ package authentication import ( "encoding/json" + "github.com/apache/dubbo-admin/pkg/core/endpoint" + "github.com/apache/dubbo-admin/pkg/core/logger" + "github.com/apache/dubbo-admin/pkg/rule/storage" "net/netip" "strings" "github.com/tidwall/gjson" - - "github.com/apache/dubbo-admin/pkg/authority/rule" - "github.com/apache/dubbo-admin/pkg/logger" ) -const RuleType = "authentication/v1beta1" - type ToClient struct { revision int64 data string } func (r *ToClient) Type() string { - return "authentication/v1beta1" + return storage.Authentication } func (r *ToClient) Revision() int64 { @@ -51,14 +49,14 @@ type Origin struct { } func (o *Origin) Type() string { - return RuleType + return storage.Authentication } func (o *Origin) Revision() int64 { return o.revision } -func (o *Origin) Exact(endpoint *rule.Endpoint) (rule.ToClient, error) { +func (o *Origin) Exact(endpoint *endpoint.Endpoint) (storage.ToClient, error) { matchedRule := make([]*PolicyToClient, 0, len(o.data)) for _, v := range o.data { @@ -94,7 +92,7 @@ func (o *Origin) Exact(endpoint *rule.Endpoint) (rule.ToClient, error) { }, nil } -func matchSelector(selector *Selector, endpoint *rule.Endpoint) bool { +func matchSelector(selector *Selector, endpoint *endpoint.Endpoint) bool { if endpoint == nil { return true } @@ -160,7 +158,7 @@ func matchExtends(selector *Selector, endpointJSON []byte) bool { return false } -func matchNotPrincipals(selector *Selector, endpoint *rule.Endpoint) bool { +func matchNotPrincipals(selector *Selector, endpoint *endpoint.Endpoint) bool { if len(selector.NotPrincipals) == 0 { return true } @@ -175,7 +173,7 @@ func matchNotPrincipals(selector *Selector, endpoint *rule.Endpoint) bool { return true } -func matchPrincipals(selector *Selector, endpoint *rule.Endpoint) bool { +func matchPrincipals(selector *Selector, endpoint *endpoint.Endpoint) bool { if len(selector.Principals) == 0 { return true } @@ -190,7 +188,7 @@ func matchPrincipals(selector *Selector, endpoint *rule.Endpoint) bool { return false } -func matchNotIPBlocks(selector *Selector, endpoint *rule.Endpoint) bool { +func matchNotIPBlocks(selector *Selector, endpoint *endpoint.Endpoint) bool { if len(selector.NotIpBlocks) == 0 { return true } @@ -214,7 +212,7 @@ func matchNotIPBlocks(selector *Selector, endpoint *rule.Endpoint) bool { return true } -func matchIPBlocks(selector *Selector, endpoint *rule.Endpoint) bool { +func matchIPBlocks(selector *Selector, endpoint *endpoint.Endpoint) bool { if len(selector.IpBlocks) == 0 { return true } @@ -238,7 +236,7 @@ func matchIPBlocks(selector *Selector, endpoint *rule.Endpoint) bool { return false } -func matchNotNamespace(selector *Selector, endpoint *rule.Endpoint) bool { +func matchNotNamespace(selector *Selector, endpoint *endpoint.Endpoint) bool { if len(selector.NotNamespaces) == 0 { return true } @@ -250,7 +248,7 @@ func matchNotNamespace(selector *Selector, endpoint *rule.Endpoint) bool { return true } -func matchNamespace(selector *Selector, endpoint *rule.Endpoint) bool { +func matchNamespace(selector *Selector, endpoint *endpoint.Endpoint) bool { if len(selector.Namespaces) == 0 { return true } diff --git a/pkg/authority/rule/authentication/rule_test.go b/pkg/rule/crd/authentication/rule_test.go similarity index 79% rename from pkg/authority/rule/authentication/rule_test.go rename to pkg/rule/crd/authentication/rule_test.go index d97a5f59c..65f04c06e 100644 --- a/pkg/authority/rule/authentication/rule_test.go +++ b/pkg/rule/crd/authentication/rule_test.go @@ -17,31 +17,30 @@ package authentication import ( "encoding/json" + "github.com/apache/dubbo-admin/pkg/core/endpoint" + "github.com/apache/dubbo-admin/pkg/rule/storage" "testing" "github.com/stretchr/testify/assert" - - "github.com/apache/dubbo-admin/pkg/authority/rule" - "github.com/apache/dubbo-admin/pkg/authority/rule/connection" ) func TestRule(t *testing.T) { t.Parallel() - storage := connection.NewStorage() - handler := NewHandler(storage) + storages := storage.NewStorage() + handler := NewHandler(storages) handler.Add("test", &Policy{ Spec: &PolicySpec{}, }) - originRule := storage.LatestRules[RuleType] + originRule := storages.LatestRules[storage.Authentication] if originRule == nil { t.Error("expected origin rule to be added") } - if originRule.Type() != RuleType { + if originRule.Type() != storage.Authentication { t.Error("expected origin rule type to be authentication/v1beta1") } @@ -49,7 +48,7 @@ func TestRule(t *testing.T) { t.Error("expected origin rule revision to be 1") } - toClient, err := originRule.Exact(&rule.Endpoint{ + toClient, err := originRule.Exact(&endpoint.Endpoint{ ID: "test", Ips: []string{"127.0.0.1"}, }) @@ -57,7 +56,7 @@ func TestRule(t *testing.T) { t.Error(err) } - if toClient.Type() != RuleType { + if toClient.Type() != storage.Authentication { t.Error("expected toClient type to be authentication/v1beta1") } @@ -76,13 +75,13 @@ func TestRule(t *testing.T) { handler.Add("test2", policy) - originRule = storage.LatestRules[RuleType] + originRule = storages.LatestRules[storage.Authentication] if originRule == nil { t.Error("expected origin rule to be added") } - if originRule.Type() != RuleType { + if originRule.Type() != storage.Authentication { t.Error("expected origin rule type to be authentication/v1beta1") } @@ -90,7 +89,7 @@ func TestRule(t *testing.T) { t.Error("expected origin rule revision to be 2") } - toClient, err = originRule.Exact(&rule.Endpoint{ + toClient, err = originRule.Exact(&endpoint.Endpoint{ ID: "test", Ips: []string{"127.0.0.1"}, }) @@ -99,7 +98,7 @@ func TestRule(t *testing.T) { t.Error(err) } - if toClient.Type() != RuleType { + if toClient.Type() != storage.Authentication { t.Error("expected toClient type to be authentication/v1beta1") } @@ -142,7 +141,7 @@ func TestSelect_Empty(t *testing.T) { assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authentication) assert.Equal(t, generated.Revision(), int64(1)) var decoded []*PolicyToClient @@ -169,15 +168,15 @@ func TestSelect_NoSelector(t *testing.T) { }, } - generated, err := origin.Exact(&rule.Endpoint{ - KubernetesEnv: &rule.KubernetesEnv{ + generated, err := origin.Exact(&endpoint.Endpoint{ + KubernetesEnv: &endpoint.KubernetesEnv{ Namespace: "test", }, }) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authentication) assert.Equal(t, generated.Revision(), int64(1)) var decoded []*PolicyToClient @@ -207,15 +206,15 @@ func TestSelect_Namespace(t *testing.T) { }, } - generated, err := origin.Exact(&rule.Endpoint{ - KubernetesEnv: &rule.KubernetesEnv{ + generated, err := origin.Exact(&endpoint.Endpoint{ + KubernetesEnv: &endpoint.KubernetesEnv{ Namespace: "test", }, }) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authentication) assert.Equal(t, generated.Revision(), int64(1)) var decoded []*PolicyToClient @@ -225,15 +224,15 @@ func TestSelect_Namespace(t *testing.T) { assert.Equal(t, 1, len(decoded)) assert.Equal(t, "ALLOW", decoded[0].Spec.Action) - generated, err = origin.Exact(&rule.Endpoint{ - KubernetesEnv: &rule.KubernetesEnv{ + generated, err = origin.Exact(&endpoint.Endpoint{ + KubernetesEnv: &endpoint.KubernetesEnv{ Namespace: "demo", }, }) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authentication) assert.Equal(t, generated.Revision(), int64(1)) decoded = []*PolicyToClient{} @@ -266,7 +265,7 @@ func TestSelect_Selector_EndpointNil(t *testing.T) { assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authentication) assert.Equal(t, generated.Revision(), int64(1)) var decoded []*PolicyToClient @@ -296,15 +295,15 @@ func TestSelect_NotNamespace(t *testing.T) { }, } - generated, err := origin.Exact(&rule.Endpoint{ - KubernetesEnv: &rule.KubernetesEnv{ + generated, err := origin.Exact(&endpoint.Endpoint{ + KubernetesEnv: &endpoint.KubernetesEnv{ Namespace: "test", }, }) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authentication) assert.Equal(t, generated.Revision(), int64(1)) var decoded []*PolicyToClient @@ -313,15 +312,15 @@ func TestSelect_NotNamespace(t *testing.T) { assert.Equal(t, 0, len(decoded)) - generated, err = origin.Exact(&rule.Endpoint{ - KubernetesEnv: &rule.KubernetesEnv{ + generated, err = origin.Exact(&endpoint.Endpoint{ + KubernetesEnv: &endpoint.KubernetesEnv{ Namespace: "demo", }, }) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authentication) assert.Equal(t, generated.Revision(), int64(1)) decoded = []*PolicyToClient{} @@ -351,13 +350,13 @@ func TestSelect_IpBlocks_ErrFmt(t *testing.T) { }, } - generated, err := origin.Exact(&rule.Endpoint{ + generated, err := origin.Exact(&endpoint.Endpoint{ Ips: []string{"127.0.0.2"}, }) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authentication) assert.Equal(t, generated.Revision(), int64(1)) var decoded []*PolicyToClient @@ -366,13 +365,13 @@ func TestSelect_IpBlocks_ErrFmt(t *testing.T) { assert.Equal(t, 0, len(decoded)) - generated, err = origin.Exact(&rule.Endpoint{ + generated, err = origin.Exact(&endpoint.Endpoint{ Ips: []string{"127.0.0.3"}, }) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authentication) assert.Equal(t, generated.Revision(), int64(1)) decoded = []*PolicyToClient{} @@ -401,13 +400,13 @@ func TestSelect_IpBlocks(t *testing.T) { }, } - generated, err := origin.Exact(&rule.Endpoint{ + generated, err := origin.Exact(&endpoint.Endpoint{ Ips: []string{"127.0.0.2"}, }) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authentication) assert.Equal(t, generated.Revision(), int64(1)) var decoded []*PolicyToClient @@ -417,13 +416,13 @@ func TestSelect_IpBlocks(t *testing.T) { assert.Equal(t, 1, len(decoded)) assert.Equal(t, "ALLOW", decoded[0].Spec.Action) - generated, err = origin.Exact(&rule.Endpoint{ + generated, err = origin.Exact(&endpoint.Endpoint{ Ips: []string{"127.1.0.3"}, }) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authentication) assert.Equal(t, generated.Revision(), int64(1)) decoded = []*PolicyToClient{} @@ -431,13 +430,13 @@ func TestSelect_IpBlocks(t *testing.T) { assert.Nil(t, err) assert.Equal(t, 0, len(decoded)) - generated, err = origin.Exact(&rule.Endpoint{ + generated, err = origin.Exact(&endpoint.Endpoint{ Ips: []string{"127"}, }) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authentication) assert.Equal(t, generated.Revision(), int64(1)) decoded = []*PolicyToClient{} @@ -466,13 +465,13 @@ func TestSelect_NotIpBlocks_ErrFmt(t *testing.T) { }, } - generated, err := origin.Exact(&rule.Endpoint{ + generated, err := origin.Exact(&endpoint.Endpoint{ Ips: []string{"127.0.0.2"}, }) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authentication) assert.Equal(t, generated.Revision(), int64(1)) var decoded []*PolicyToClient @@ -482,13 +481,13 @@ func TestSelect_NotIpBlocks_ErrFmt(t *testing.T) { assert.Equal(t, 1, len(decoded)) assert.Equal(t, "ALLOW", decoded[0].Spec.Action) - generated, err = origin.Exact(&rule.Endpoint{ + generated, err = origin.Exact(&endpoint.Endpoint{ Ips: []string{"127.0.0.3"}, }) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authentication) assert.Equal(t, generated.Revision(), int64(1)) decoded = []*PolicyToClient{} @@ -518,13 +517,13 @@ func TestSelect_NotIpBlocks(t *testing.T) { }, } - generated, err := origin.Exact(&rule.Endpoint{ + generated, err := origin.Exact(&endpoint.Endpoint{ Ips: []string{"127.0.0.2"}, }) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authentication) assert.Equal(t, generated.Revision(), int64(1)) var decoded []*PolicyToClient @@ -533,13 +532,13 @@ func TestSelect_NotIpBlocks(t *testing.T) { assert.Equal(t, 0, len(decoded)) - generated, err = origin.Exact(&rule.Endpoint{ + generated, err = origin.Exact(&endpoint.Endpoint{ Ips: []string{"127.1.0.3"}, }) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authentication) assert.Equal(t, generated.Revision(), int64(1)) decoded = []*PolicyToClient{} @@ -549,13 +548,13 @@ func TestSelect_NotIpBlocks(t *testing.T) { assert.Equal(t, 1, len(decoded)) assert.Equal(t, "ALLOW", decoded[0].Spec.Action) - generated, err = origin.Exact(&rule.Endpoint{ + generated, err = origin.Exact(&endpoint.Endpoint{ Ips: []string{"127"}, }) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authentication) assert.Equal(t, generated.Revision(), int64(1)) decoded = []*PolicyToClient{} @@ -585,13 +584,13 @@ func TestSelect_Principals(t *testing.T) { }, } - generated, err := origin.Exact(&rule.Endpoint{ + generated, err := origin.Exact(&endpoint.Endpoint{ SpiffeID: "cluster.local/ns/default/sa/dubbo-demo-new", }) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authentication) assert.Equal(t, generated.Revision(), int64(1)) var decoded []*PolicyToClient @@ -600,13 +599,13 @@ func TestSelect_Principals(t *testing.T) { assert.Equal(t, 0, len(decoded)) - generated, err = origin.Exact(&rule.Endpoint{ + generated, err = origin.Exact(&endpoint.Endpoint{ SpiffeID: "cluster.local/ns/default/sa/dubbo-demo", }) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authentication) assert.Equal(t, generated.Revision(), int64(1)) decoded = []*PolicyToClient{} @@ -616,13 +615,13 @@ func TestSelect_Principals(t *testing.T) { assert.Equal(t, 1, len(decoded)) assert.Equal(t, "ALLOW", decoded[0].Spec.Action) - generated, err = origin.Exact(&rule.Endpoint{ + generated, err = origin.Exact(&endpoint.Endpoint{ SpiffeID: "spiffe://cluster.local/ns/default/sa/dubbo-demo", }) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authentication) assert.Equal(t, generated.Revision(), int64(1)) decoded = []*PolicyToClient{} @@ -652,13 +651,13 @@ func TestSelect_NotPrincipals(t *testing.T) { }, } - generated, err := origin.Exact(&rule.Endpoint{ + generated, err := origin.Exact(&endpoint.Endpoint{ SpiffeID: "cluster.local/ns/default/sa/dubbo-demo-new", }) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authentication) assert.Equal(t, generated.Revision(), int64(1)) var decoded []*PolicyToClient @@ -668,13 +667,13 @@ func TestSelect_NotPrincipals(t *testing.T) { assert.Equal(t, 1, len(decoded)) assert.Equal(t, "ALLOW", decoded[0].Spec.Action) - generated, err = origin.Exact(&rule.Endpoint{ + generated, err = origin.Exact(&endpoint.Endpoint{ SpiffeID: "cluster.local/ns/default/sa/dubbo-demo", }) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authentication) assert.Equal(t, generated.Revision(), int64(1)) decoded = []*PolicyToClient{} @@ -683,13 +682,13 @@ func TestSelect_NotPrincipals(t *testing.T) { assert.Equal(t, 0, len(decoded)) - generated, err = origin.Exact(&rule.Endpoint{ + generated, err = origin.Exact(&endpoint.Endpoint{ SpiffeID: "spiffe://cluster.local/ns/default/sa/dubbo-demo", }) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authentication) assert.Equal(t, generated.Revision(), int64(1)) decoded = []*PolicyToClient{} @@ -723,15 +722,15 @@ func TestSelect_Extends(t *testing.T) { }, } - generated, err := origin.Exact(&rule.Endpoint{ - KubernetesEnv: &rule.KubernetesEnv{ + generated, err := origin.Exact(&endpoint.Endpoint{ + KubernetesEnv: &endpoint.KubernetesEnv{ PodName: "dubbo-demo", }, }) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authentication) assert.Equal(t, generated.Revision(), int64(1)) var decoded []*PolicyToClient @@ -741,15 +740,15 @@ func TestSelect_Extends(t *testing.T) { assert.Equal(t, 1, len(decoded)) assert.Equal(t, "ALLOW", decoded[0].Spec.Action) - generated, err = origin.Exact(&rule.Endpoint{ - KubernetesEnv: &rule.KubernetesEnv{ + generated, err = origin.Exact(&endpoint.Endpoint{ + KubernetesEnv: &endpoint.KubernetesEnv{ PodName: "dubbo-demo-new", }, }) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authentication) assert.Equal(t, generated.Revision(), int64(1)) decoded = []*PolicyToClient{} @@ -783,15 +782,15 @@ func TestSelect_NotExtends(t *testing.T) { }, } - generated, err := origin.Exact(&rule.Endpoint{ - KubernetesEnv: &rule.KubernetesEnv{ + generated, err := origin.Exact(&endpoint.Endpoint{ + KubernetesEnv: &endpoint.KubernetesEnv{ PodName: "dubbo-demo", }, }) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authentication) assert.Equal(t, generated.Revision(), int64(1)) var decoded []*PolicyToClient @@ -800,15 +799,15 @@ func TestSelect_NotExtends(t *testing.T) { assert.Equal(t, 0, len(decoded)) - generated, err = origin.Exact(&rule.Endpoint{ - KubernetesEnv: &rule.KubernetesEnv{ + generated, err = origin.Exact(&endpoint.Endpoint{ + KubernetesEnv: &endpoint.KubernetesEnv{ PodName: "dubbo-demo-new", }, }) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authentication) assert.Equal(t, generated.Revision(), int64(1)) decoded = []*PolicyToClient{} diff --git a/pkg/authority/rule/authorization/definition.go b/pkg/rule/crd/authorization/definition.go similarity index 100% rename from pkg/authority/rule/authorization/definition.go rename to pkg/rule/crd/authorization/definition.go diff --git a/pkg/authority/rule/authorization/definition_test.go b/pkg/rule/crd/authorization/definition_test.go similarity index 100% rename from pkg/authority/rule/authorization/definition_test.go rename to pkg/rule/crd/authorization/definition_test.go diff --git a/pkg/authority/rule/authorization/handler.go b/pkg/rule/crd/authorization/handler.go similarity index 93% rename from pkg/authority/rule/authorization/handler.go rename to pkg/rule/crd/authorization/handler.go index 7d5cd4999..ca376ac08 100644 --- a/pkg/authority/rule/authorization/handler.go +++ b/pkg/rule/crd/authorization/handler.go @@ -16,11 +16,10 @@ package authorization import ( + "github.com/apache/dubbo-admin/pkg/rule/storage" "reflect" "sync" "sync/atomic" - - "github.com/apache/dubbo-admin/pkg/authority/rule/connection" ) type Handler interface { @@ -34,11 +33,11 @@ type Impl struct { mutex *sync.Mutex revision int64 - storage *connection.Storage + storage *storage.Storage cache map[string]*Policy } -func NewHandler(storage *connection.Storage) *Impl { +func NewHandler(storage *storage.Storage) *Impl { return &Impl{ mutex: &sync.Mutex{}, storage: storage, @@ -126,7 +125,7 @@ func (i *Impl) Notify() { data: i.cache, } - i.storage.LatestRules[RuleType] = originRule + i.storage.LatestRules[storage.Authorization] = originRule i.storage.Mutex.RLock() defer i.storage.Mutex.RUnlock() diff --git a/pkg/authority/rule/authorization/handler_test.go b/pkg/rule/crd/authorization/handler_test.go similarity index 85% rename from pkg/authority/rule/authorization/handler_test.go rename to pkg/rule/crd/authorization/handler_test.go index 204f890a7..f3f65db22 100644 --- a/pkg/authority/rule/authorization/handler_test.go +++ b/pkg/rule/crd/authorization/handler_test.go @@ -16,27 +16,27 @@ package authorization_test import ( + authorization2 "github.com/apache/dubbo-admin/pkg/rule/crd/authorization" + "github.com/apache/dubbo-admin/pkg/rule/storage" "strconv" "sync" "testing" - "github.com/apache/dubbo-admin/pkg/authority/rule/authorization" - "github.com/apache/dubbo-admin/pkg/authority/rule/connection" "k8s.io/client-go/util/workqueue" ) func TestAdd(t *testing.T) { t.Parallel() - storage := connection.NewStorage() + storages := storage.NewStorage() wq := workqueue.NewNamed("raw-rule") - storage.Connection = []*connection.Connection{ + storages.Connection = []*storage.Connection{ { RawRuleQueue: wq, }, } - handler := authorization.NewHandler(storage) + handler := authorization2.NewHandler(storages) handler.Add("test", nil) @@ -48,7 +48,7 @@ func TestAdd(t *testing.T) { t.Error("expected queue length to be 0") } - policy := &authorization.Policy{} + policy := &authorization2.Policy{} handler.Add("test", policy) if handler.Get("test") != policy { @@ -83,10 +83,10 @@ func TestAdd(t *testing.T) { t.Error("expected queue length to be 2") } - policies := make(map[string]*authorization.Policy, 1000) + policies := make(map[string]*authorization2.Policy, 1000) for i := 0; i < 1000; i++ { - policies["test"+strconv.Itoa(i)] = &authorization.Policy{ + policies["test"+strconv.Itoa(i)] = &authorization2.Policy{ Name: "test" + strconv.Itoa(i), } } @@ -117,15 +117,15 @@ func TestAdd(t *testing.T) { func TestUpdate(t *testing.T) { t.Parallel() - storage := connection.NewStorage() + storages := storage.NewStorage() wq := workqueue.NewNamed("raw-rule") - storage.Connection = []*connection.Connection{ + storages.Connection = []*storage.Connection{ { RawRuleQueue: wq, }, } - handler := authorization.NewHandler(storage) + handler := authorization2.NewHandler(storages) handler.Update("test", nil) @@ -137,7 +137,7 @@ func TestUpdate(t *testing.T) { t.Error("expected queue length to be 0") } - policy := &authorization.Policy{} + policy := &authorization2.Policy{} handler.Update("test", policy) if handler.Get("test") != policy { @@ -172,10 +172,10 @@ func TestUpdate(t *testing.T) { t.Error("expected queue length to be 2") } - policies := make(map[string]*authorization.Policy, 1000) + policies := make(map[string]*authorization2.Policy, 1000) for i := 0; i < 1000; i++ { - policies["test"+strconv.Itoa(i)] = &authorization.Policy{ + policies["test"+strconv.Itoa(i)] = &authorization2.Policy{ Name: "test" + strconv.Itoa(i), } } @@ -206,17 +206,17 @@ func TestUpdate(t *testing.T) { func TestDelete(t *testing.T) { t.Parallel() - storage := connection.NewStorage() + storages := storage.NewStorage() wq := workqueue.NewNamed("raw-rule") - storage.Connection = []*connection.Connection{ + storages.Connection = []*storage.Connection{ { RawRuleQueue: wq, }, } - handler := authorization.NewHandler(storage) + handler := authorization2.NewHandler(storages) - policy := &authorization.Policy{} + policy := &authorization2.Policy{} handler.Add("test", policy) if handler.Get("test") != policy { @@ -282,7 +282,7 @@ func TestDelete(t *testing.T) { } for i := 0; i < 1000; i++ { - handler.Add("test"+strconv.Itoa(i), &authorization.Policy{ + handler.Add("test"+strconv.Itoa(i), &authorization2.Policy{ Name: "test" + strconv.Itoa(i), }) } diff --git a/pkg/authority/rule/authorization/rule.go b/pkg/rule/crd/authorization/rule.go similarity index 86% rename from pkg/authority/rule/authorization/rule.go rename to pkg/rule/crd/authorization/rule.go index ecb7d99ca..e571bee37 100644 --- a/pkg/authority/rule/authorization/rule.go +++ b/pkg/rule/crd/authorization/rule.go @@ -17,24 +17,22 @@ package authorization import ( "encoding/json" + "github.com/apache/dubbo-admin/pkg/core/endpoint" + "github.com/apache/dubbo-admin/pkg/core/logger" + "github.com/apache/dubbo-admin/pkg/rule/storage" "net/netip" "strings" - "github.com/apache/dubbo-admin/pkg/logger" "github.com/tidwall/gjson" - - "github.com/apache/dubbo-admin/pkg/authority/rule" ) -const RuleType = "authorization/v1beta1" - type ToClient struct { revision int64 data string } func (r *ToClient) Type() string { - return RuleType + return storage.Authorization } func (r *ToClient) Revision() int64 { @@ -51,14 +49,14 @@ type Origin struct { } func (o *Origin) Type() string { - return RuleType + return storage.Authorization } func (o *Origin) Revision() int64 { return o.revision } -func (o *Origin) Exact(endpoint *rule.Endpoint) (rule.ToClient, error) { +func (o *Origin) Exact(endpoint *endpoint.Endpoint) (storage.ToClient, error) { matchedRule := make([]*PolicyToClient, 0, len(o.data)) for _, v := range o.data { @@ -94,7 +92,7 @@ func (o *Origin) Exact(endpoint *rule.Endpoint) (rule.ToClient, error) { }, nil } -func matchSelector(target *Target, endpoint *rule.Endpoint) bool { +func matchSelector(target *Target, endpoint *endpoint.Endpoint) bool { if endpoint == nil { return true } @@ -160,7 +158,7 @@ func matchExtends(target *Target, endpointJSON []byte) bool { return false } -func matchNotPrincipals(target *Target, endpoint *rule.Endpoint) bool { +func matchNotPrincipals(target *Target, endpoint *endpoint.Endpoint) bool { if len(target.NotPrincipals) == 0 { return true } @@ -175,7 +173,7 @@ func matchNotPrincipals(target *Target, endpoint *rule.Endpoint) bool { return true } -func matchPrincipals(target *Target, endpoint *rule.Endpoint) bool { +func matchPrincipals(target *Target, endpoint *endpoint.Endpoint) bool { if len(target.Principals) == 0 { return true } @@ -190,7 +188,7 @@ func matchPrincipals(target *Target, endpoint *rule.Endpoint) bool { return false } -func matchNotIPBlocks(target *Target, endpoint *rule.Endpoint) bool { +func matchNotIPBlocks(target *Target, endpoint *endpoint.Endpoint) bool { if len(target.NotIpBlocks) == 0 { return true } @@ -214,7 +212,7 @@ func matchNotIPBlocks(target *Target, endpoint *rule.Endpoint) bool { return true } -func matchIPBlocks(target *Target, endpoint *rule.Endpoint) bool { +func matchIPBlocks(target *Target, endpoint *endpoint.Endpoint) bool { if len(target.IpBlocks) == 0 { return true } @@ -238,7 +236,7 @@ func matchIPBlocks(target *Target, endpoint *rule.Endpoint) bool { return false } -func matchNotNamespace(target *Target, endpoint *rule.Endpoint) bool { +func matchNotNamespace(target *Target, endpoint *endpoint.Endpoint) bool { if len(target.NotNamespaces) == 0 { return true } @@ -250,7 +248,7 @@ func matchNotNamespace(target *Target, endpoint *rule.Endpoint) bool { return true } -func matchNamespace(target *Target, endpoint *rule.Endpoint) bool { +func matchNamespace(target *Target, endpoint *endpoint.Endpoint) bool { if len(target.Namespaces) == 0 { return true } diff --git a/pkg/authority/rule/authorization/rule_test.go b/pkg/rule/crd/authorization/rule_test.go similarity index 77% rename from pkg/authority/rule/authorization/rule_test.go rename to pkg/rule/crd/authorization/rule_test.go index 17af761d7..e54fef1d4 100644 --- a/pkg/authority/rule/authorization/rule_test.go +++ b/pkg/rule/crd/authorization/rule_test.go @@ -17,29 +17,28 @@ package authorization import ( "encoding/json" + "github.com/apache/dubbo-admin/pkg/core/endpoint" + "github.com/apache/dubbo-admin/pkg/rule/storage" "testing" "github.com/stretchr/testify/assert" - - "github.com/apache/dubbo-admin/pkg/authority/rule" - "github.com/apache/dubbo-admin/pkg/authority/rule/connection" ) func TestRule(t *testing.T) { t.Parallel() - storage := connection.NewStorage() - handler := NewHandler(storage) + storages := storage.NewStorage() + handler := NewHandler(storages) handler.Add("test", &Policy{}) - originRule := storage.LatestRules[RuleType] + originRule := storages.LatestRules[storage.Authorization] if originRule == nil { t.Error("expected origin rule to be added") } - if originRule.Type() != RuleType { + if originRule.Type() != storage.Authorization { t.Error("expected origin rule type to be authorization/v1beta1") } @@ -47,7 +46,7 @@ func TestRule(t *testing.T) { t.Error("expected origin rule revision to be 1") } - toClient, err := originRule.Exact(&rule.Endpoint{ + toClient, err := originRule.Exact(&endpoint.Endpoint{ ID: "test", Ips: []string{"127.0.0.1"}, }) @@ -55,7 +54,7 @@ func TestRule(t *testing.T) { t.Error(err) } - if toClient.Type() != RuleType { + if toClient.Type() != storage.Authorization { t.Error("expected toClient type to be authorization/v1beta1") } @@ -76,13 +75,13 @@ func TestRule(t *testing.T) { handler.Add("test2", policy) - originRule = storage.LatestRules[RuleType] + originRule = storages.LatestRules[storage.Authorization] if originRule == nil { t.Error("expected origin rule to be added") } - if originRule.Type() != RuleType { + if originRule.Type() != storage.Authorization { t.Error("expected origin rule type to be authorization/v1beta1") } @@ -90,7 +89,7 @@ func TestRule(t *testing.T) { t.Error("expected origin rule revision to be 2") } - toClient, err = originRule.Exact(&rule.Endpoint{ + toClient, err = originRule.Exact(&endpoint.Endpoint{ ID: "test", Ips: []string{"127.0.0.1"}, }) @@ -99,7 +98,7 @@ func TestRule(t *testing.T) { t.Error(err) } - if toClient.Type() != RuleType { + if toClient.Type() != storage.Authorization { t.Error("expected toClient type to be authorization/v1beta1") } @@ -138,7 +137,7 @@ func TestRule_Empty(t *testing.T) { assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authorization) assert.Equal(t, generated.Revision(), int64(1)) var decoded []*PolicyToClient @@ -172,15 +171,15 @@ func TestRule_Namespace(t *testing.T) { } // success - generated, err := origin.Exact(&rule.Endpoint{ - KubernetesEnv: &rule.KubernetesEnv{ + generated, err := origin.Exact(&endpoint.Endpoint{ + KubernetesEnv: &endpoint.KubernetesEnv{ Namespace: "test", }, }) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authorization) assert.Equal(t, generated.Revision(), int64(1)) var decoded []*PolicyToClient @@ -191,15 +190,15 @@ func TestRule_Namespace(t *testing.T) { assert.Equal(t, "ALLOW", decoded[0].Spec.Action) // failed - generated, err = origin.Exact(&rule.Endpoint{ - KubernetesEnv: &rule.KubernetesEnv{ + generated, err = origin.Exact(&endpoint.Endpoint{ + KubernetesEnv: &endpoint.KubernetesEnv{ Namespace: "test-new", }, }) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authorization) assert.Equal(t, generated.Revision(), int64(1)) err = json.Unmarshal([]byte(generated.Data()), &decoded) @@ -208,13 +207,13 @@ func TestRule_Namespace(t *testing.T) { assert.Equal(t, 0, len(decoded)) // failed - generated, err = origin.Exact(&rule.Endpoint{ - KubernetesEnv: &rule.KubernetesEnv{}, + generated, err = origin.Exact(&endpoint.Endpoint{ + KubernetesEnv: &endpoint.KubernetesEnv{}, }) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authorization) assert.Equal(t, generated.Revision(), int64(1)) err = json.Unmarshal([]byte(generated.Data()), &decoded) @@ -246,15 +245,15 @@ func TestRule_NotNamespace(t *testing.T) { } // success - generated, err := origin.Exact(&rule.Endpoint{ - KubernetesEnv: &rule.KubernetesEnv{ + generated, err := origin.Exact(&endpoint.Endpoint{ + KubernetesEnv: &endpoint.KubernetesEnv{ Namespace: "test-new", }, }) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authorization) assert.Equal(t, generated.Revision(), int64(1)) var decoded []*PolicyToClient @@ -265,15 +264,15 @@ func TestRule_NotNamespace(t *testing.T) { assert.Equal(t, "ALLOW", decoded[0].Spec.Action) // failed - generated, err = origin.Exact(&rule.Endpoint{ - KubernetesEnv: &rule.KubernetesEnv{ + generated, err = origin.Exact(&endpoint.Endpoint{ + KubernetesEnv: &endpoint.KubernetesEnv{ Namespace: "test", }, }) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authorization) assert.Equal(t, generated.Revision(), int64(1)) err = json.Unmarshal([]byte(generated.Data()), &decoded) @@ -282,13 +281,13 @@ func TestRule_NotNamespace(t *testing.T) { assert.Equal(t, 0, len(decoded)) // success - generated, err = origin.Exact(&rule.Endpoint{ - KubernetesEnv: &rule.KubernetesEnv{}, + generated, err = origin.Exact(&endpoint.Endpoint{ + KubernetesEnv: &endpoint.KubernetesEnv{}, }) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authorization) assert.Equal(t, generated.Revision(), int64(1)) err = json.Unmarshal([]byte(generated.Data()), &decoded) @@ -321,13 +320,13 @@ func TestRule_IPBlocks(t *testing.T) { } // success - generated, err := origin.Exact(&rule.Endpoint{ + generated, err := origin.Exact(&endpoint.Endpoint{ Ips: []string{"127.0.0.1"}, }) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authorization) assert.Equal(t, generated.Revision(), int64(1)) var decoded []*PolicyToClient @@ -338,13 +337,13 @@ func TestRule_IPBlocks(t *testing.T) { assert.Equal(t, "ALLOW", decoded[0].Spec.Action) // failed - generated, err = origin.Exact(&rule.Endpoint{ + generated, err = origin.Exact(&endpoint.Endpoint{ Ips: []string{"127.0.1.1"}, }) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authorization) assert.Equal(t, generated.Revision(), int64(1)) err = json.Unmarshal([]byte(generated.Data()), &decoded) @@ -353,13 +352,13 @@ func TestRule_IPBlocks(t *testing.T) { assert.Equal(t, 0, len(decoded)) // failed - generated, err = origin.Exact(&rule.Endpoint{ + generated, err = origin.Exact(&endpoint.Endpoint{ Ips: []string{"127"}, }) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authorization) assert.Equal(t, generated.Revision(), int64(1)) err = json.Unmarshal([]byte(generated.Data()), &decoded) @@ -368,11 +367,11 @@ func TestRule_IPBlocks(t *testing.T) { assert.Equal(t, 0, len(decoded)) // failed - generated, err = origin.Exact(&rule.Endpoint{}) + generated, err = origin.Exact(&endpoint.Endpoint{}) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authorization) assert.Equal(t, generated.Revision(), int64(1)) err = json.Unmarshal([]byte(generated.Data()), &decoded) @@ -404,13 +403,13 @@ func TestRule_IPBlocks_ErrFmt(t *testing.T) { } // failed - generated, err := origin.Exact(&rule.Endpoint{ + generated, err := origin.Exact(&endpoint.Endpoint{ Ips: []string{"127.0.0.1"}, }) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authorization) assert.Equal(t, generated.Revision(), int64(1)) var decoded []*PolicyToClient @@ -420,13 +419,13 @@ func TestRule_IPBlocks_ErrFmt(t *testing.T) { assert.Equal(t, 0, len(decoded)) // failed - generated, err = origin.Exact(&rule.Endpoint{ + generated, err = origin.Exact(&endpoint.Endpoint{ Ips: []string{"127.0.1.1"}, }) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authorization) assert.Equal(t, generated.Revision(), int64(1)) err = json.Unmarshal([]byte(generated.Data()), &decoded) @@ -435,11 +434,11 @@ func TestRule_IPBlocks_ErrFmt(t *testing.T) { assert.Equal(t, 0, len(decoded)) // failed - generated, err = origin.Exact(&rule.Endpoint{}) + generated, err = origin.Exact(&endpoint.Endpoint{}) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authorization) assert.Equal(t, generated.Revision(), int64(1)) err = json.Unmarshal([]byte(generated.Data()), &decoded) @@ -471,13 +470,13 @@ func TestRule_NotIPBlocks(t *testing.T) { } // success - generated, err := origin.Exact(&rule.Endpoint{ + generated, err := origin.Exact(&endpoint.Endpoint{ Ips: []string{"127.0.1.1"}, }) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authorization) assert.Equal(t, generated.Revision(), int64(1)) var decoded []*PolicyToClient @@ -488,13 +487,13 @@ func TestRule_NotIPBlocks(t *testing.T) { assert.Equal(t, "ALLOW", decoded[0].Spec.Action) // success - generated, err = origin.Exact(&rule.Endpoint{ + generated, err = origin.Exact(&endpoint.Endpoint{ Ips: []string{"127"}, }) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authorization) assert.Equal(t, generated.Revision(), int64(1)) err = json.Unmarshal([]byte(generated.Data()), &decoded) @@ -504,13 +503,13 @@ func TestRule_NotIPBlocks(t *testing.T) { assert.Equal(t, "ALLOW", decoded[0].Spec.Action) // failed - generated, err = origin.Exact(&rule.Endpoint{ + generated, err = origin.Exact(&endpoint.Endpoint{ Ips: []string{"127.0.0.1"}, }) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authorization) assert.Equal(t, generated.Revision(), int64(1)) err = json.Unmarshal([]byte(generated.Data()), &decoded) @@ -519,11 +518,11 @@ func TestRule_NotIPBlocks(t *testing.T) { assert.Equal(t, 0, len(decoded)) // success - generated, err = origin.Exact(&rule.Endpoint{}) + generated, err = origin.Exact(&endpoint.Endpoint{}) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authorization) assert.Equal(t, generated.Revision(), int64(1)) err = json.Unmarshal([]byte(generated.Data()), &decoded) @@ -556,13 +555,13 @@ func TestRule_NotIPBlocks_ErrFmt(t *testing.T) { } // success - generated, err := origin.Exact(&rule.Endpoint{ + generated, err := origin.Exact(&endpoint.Endpoint{ Ips: []string{"127.0.0.1"}, }) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authorization) assert.Equal(t, generated.Revision(), int64(1)) var decoded []*PolicyToClient @@ -573,13 +572,13 @@ func TestRule_NotIPBlocks_ErrFmt(t *testing.T) { assert.Equal(t, "ALLOW", decoded[0].Spec.Action) // success - generated, err = origin.Exact(&rule.Endpoint{ + generated, err = origin.Exact(&endpoint.Endpoint{ Ips: []string{"127.0.1.1"}, }) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authorization) assert.Equal(t, generated.Revision(), int64(1)) err = json.Unmarshal([]byte(generated.Data()), &decoded) @@ -589,11 +588,11 @@ func TestRule_NotIPBlocks_ErrFmt(t *testing.T) { assert.Equal(t, "ALLOW", decoded[0].Spec.Action) // success - generated, err = origin.Exact(&rule.Endpoint{}) + generated, err = origin.Exact(&endpoint.Endpoint{}) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authorization) assert.Equal(t, generated.Revision(), int64(1)) err = json.Unmarshal([]byte(generated.Data()), &decoded) @@ -626,13 +625,13 @@ func TestRule_Principals(t *testing.T) { } // success - generated, err := origin.Exact(&rule.Endpoint{ + generated, err := origin.Exact(&endpoint.Endpoint{ SpiffeID: "cluster.local/ns/default/sa/default", }) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authorization) assert.Equal(t, generated.Revision(), int64(1)) var decoded []*PolicyToClient @@ -643,13 +642,13 @@ func TestRule_Principals(t *testing.T) { assert.Equal(t, "ALLOW", decoded[0].Spec.Action) // success - generated, err = origin.Exact(&rule.Endpoint{ + generated, err = origin.Exact(&endpoint.Endpoint{ SpiffeID: "spiffe://cluster.local/ns/default/sa/default", }) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authorization) assert.Equal(t, generated.Revision(), int64(1)) err = json.Unmarshal([]byte(generated.Data()), &decoded) @@ -659,13 +658,13 @@ func TestRule_Principals(t *testing.T) { assert.Equal(t, "ALLOW", decoded[0].Spec.Action) // failed - generated, err = origin.Exact(&rule.Endpoint{ + generated, err = origin.Exact(&endpoint.Endpoint{ SpiffeID: "cluster.local/ns/test/sa/default", }) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authorization) assert.Equal(t, generated.Revision(), int64(1)) err = json.Unmarshal([]byte(generated.Data()), &decoded) @@ -674,11 +673,11 @@ func TestRule_Principals(t *testing.T) { assert.Equal(t, 0, len(decoded)) // failed - generated, err = origin.Exact(&rule.Endpoint{}) + generated, err = origin.Exact(&endpoint.Endpoint{}) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authorization) assert.Equal(t, generated.Revision(), int64(1)) err = json.Unmarshal([]byte(generated.Data()), &decoded) @@ -710,13 +709,13 @@ func TestRule_NotPrincipals(t *testing.T) { } // success - generated, err := origin.Exact(&rule.Endpoint{ + generated, err := origin.Exact(&endpoint.Endpoint{ SpiffeID: "cluster.local/ns/test/sa/default", }) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authorization) assert.Equal(t, generated.Revision(), int64(1)) var decoded []*PolicyToClient @@ -727,13 +726,13 @@ func TestRule_NotPrincipals(t *testing.T) { assert.Equal(t, "ALLOW", decoded[0].Spec.Action) // success - generated, err = origin.Exact(&rule.Endpoint{ + generated, err = origin.Exact(&endpoint.Endpoint{ SpiffeID: "spiffe://cluster.local/ns/test/sa/default", }) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authorization) assert.Equal(t, generated.Revision(), int64(1)) err = json.Unmarshal([]byte(generated.Data()), &decoded) @@ -743,13 +742,13 @@ func TestRule_NotPrincipals(t *testing.T) { assert.Equal(t, "ALLOW", decoded[0].Spec.Action) // failed - generated, err = origin.Exact(&rule.Endpoint{ + generated, err = origin.Exact(&endpoint.Endpoint{ SpiffeID: "cluster.local/ns/default/sa/default", }) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authorization) assert.Equal(t, generated.Revision(), int64(1)) err = json.Unmarshal([]byte(generated.Data()), &decoded) @@ -758,13 +757,13 @@ func TestRule_NotPrincipals(t *testing.T) { assert.Equal(t, 0, len(decoded)) // failed - generated, err = origin.Exact(&rule.Endpoint{ + generated, err = origin.Exact(&endpoint.Endpoint{ SpiffeID: "spiffe://cluster.local/ns/default/sa/default", }) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authorization) assert.Equal(t, generated.Revision(), int64(1)) err = json.Unmarshal([]byte(generated.Data()), &decoded) @@ -773,11 +772,11 @@ func TestRule_NotPrincipals(t *testing.T) { assert.Equal(t, 0, len(decoded)) // failed - generated, err = origin.Exact(&rule.Endpoint{}) + generated, err = origin.Exact(&endpoint.Endpoint{}) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authorization) assert.Equal(t, generated.Revision(), int64(1)) err = json.Unmarshal([]byte(generated.Data()), &decoded) @@ -815,15 +814,15 @@ func TestRule_Extends(t *testing.T) { } // success - generated, err := origin.Exact(&rule.Endpoint{ - KubernetesEnv: &rule.KubernetesEnv{ + generated, err := origin.Exact(&endpoint.Endpoint{ + KubernetesEnv: &endpoint.KubernetesEnv{ PodName: "test", }, }) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authorization) assert.Equal(t, generated.Revision(), int64(1)) var decoded []*PolicyToClient @@ -834,15 +833,15 @@ func TestRule_Extends(t *testing.T) { assert.Equal(t, "ALLOW", decoded[0].Spec.Action) // failed - generated, err = origin.Exact(&rule.Endpoint{ - KubernetesEnv: &rule.KubernetesEnv{ + generated, err = origin.Exact(&endpoint.Endpoint{ + KubernetesEnv: &endpoint.KubernetesEnv{ PodName: "test-new", }, }) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authorization) assert.Equal(t, generated.Revision(), int64(1)) err = json.Unmarshal([]byte(generated.Data()), &decoded) @@ -851,11 +850,11 @@ func TestRule_Extends(t *testing.T) { assert.Equal(t, 0, len(decoded)) // failed - generated, err = origin.Exact(&rule.Endpoint{}) + generated, err = origin.Exact(&endpoint.Endpoint{}) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authorization) assert.Equal(t, generated.Revision(), int64(1)) err = json.Unmarshal([]byte(generated.Data()), &decoded) @@ -892,15 +891,15 @@ func TestRule_NotExtends(t *testing.T) { } // success - generated, err := origin.Exact(&rule.Endpoint{ - KubernetesEnv: &rule.KubernetesEnv{ + generated, err := origin.Exact(&endpoint.Endpoint{ + KubernetesEnv: &endpoint.KubernetesEnv{ PodName: "test-new", }, }) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authorization) assert.Equal(t, generated.Revision(), int64(1)) var decoded []*PolicyToClient @@ -911,15 +910,15 @@ func TestRule_NotExtends(t *testing.T) { assert.Equal(t, "ALLOW", decoded[0].Spec.Action) // failed - generated, err = origin.Exact(&rule.Endpoint{ - KubernetesEnv: &rule.KubernetesEnv{ + generated, err = origin.Exact(&endpoint.Endpoint{ + KubernetesEnv: &endpoint.KubernetesEnv{ PodName: "test", }, }) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authorization) assert.Equal(t, generated.Revision(), int64(1)) err = json.Unmarshal([]byte(generated.Data()), &decoded) @@ -928,11 +927,11 @@ func TestRule_NotExtends(t *testing.T) { assert.Equal(t, 0, len(decoded)) // success - generated, err = origin.Exact(&rule.Endpoint{}) + generated, err = origin.Exact(&endpoint.Endpoint{}) assert.Nil(t, err) assert.NotNil(t, generated) - assert.Equal(t, generated.Type(), RuleType) + assert.Equal(t, generated.Type(), storage.Authorization) assert.Equal(t, generated.Revision(), int64(1)) err = json.Unmarshal([]byte(generated.Data()), &decoded) diff --git a/pkg/rule/crd/conditionroute/definition.go b/pkg/rule/crd/conditionroute/definition.go new file mode 100644 index 000000000..7942c19c1 --- /dev/null +++ b/pkg/rule/crd/conditionroute/definition.go @@ -0,0 +1,78 @@ +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package conditionroute + +type Policy struct { + Name string `json:"name,omitempty"` + + Spec *PolicySpec `json:"spec"` +} + +func (p *Policy) CopyToClient() *PolicyToClient { + toClient := &PolicyToClient{ + Name: p.Name, + } + + if p.Spec != nil { + toClient.Spec = p.Spec.CopyToClient() + } + + return toClient +} + +type PolicySpec struct { + Priority int `json:"priority" yaml:"priority,omitempty"` + Enabled bool `json:"enabled" yaml:"enabled"` + Force bool `json:"force" yaml:"force"` + Runtime bool `json:"runtime" yaml:"runtime"` + Key string `json:"key" yaml:"key"` + Scope string `json:"scope" yaml:"scope"` + Conditions []string `json:"conditions" yaml:"conditions"` + ConfigVersion string `json:"configVersion" yaml:"configVersion"` +} + +func (p *PolicySpec) CopyToClient() *PolicySpecToClient { + toClient := &PolicySpecToClient{ + Priority: p.Priority, + Enabled: p.Enabled, + Force: p.Force, + Runtime: p.Runtime, + Key: p.Key, + Scope: p.Scope, + Conditions: p.Conditions, + ConfigVersion: p.ConfigVersion, + } + return toClient +} + +// To Client Rule + +type PolicyToClient struct { + Name string `json:"name,omitempty"` + + Spec *PolicySpecToClient `json:"spec"` +} + +type PolicySpecToClient struct { + Priority int `json:"priority" yaml:"priority,omitempty"` + Enabled bool `json:"enabled" yaml:"enabled"` + Force bool `json:"force" yaml:"force"` + Runtime bool `json:"runtime" yaml:"runtime"` + Key string `json:"key" yaml:"key"` + Scope string `json:"scope" yaml:"scope"` + Conditions []string `json:"conditions" yaml:"conditions"` + ConfigVersion string `json:"configVersion" yaml:"configVersion"` +} diff --git a/pkg/rule/crd/conditionroute/handler.go b/pkg/rule/crd/conditionroute/handler.go new file mode 100644 index 000000000..b871d1c39 --- /dev/null +++ b/pkg/rule/crd/conditionroute/handler.go @@ -0,0 +1,150 @@ +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package conditionroute + +import ( + "github.com/apache/dubbo-admin/pkg/core/logger" + "github.com/apache/dubbo-admin/pkg/rule/storage" + "reflect" + "sync" + "sync/atomic" +) + +type Handler interface { + Add(key string, obj *Policy) + Get(key string) *Policy + Update(key string, newObj *Policy) + Delete(key string) +} + +type Impl struct { + mutex *sync.Mutex + + revision int64 + storage *storage.Storage + cache map[string]*Policy +} + +func NewHandler(storage *storage.Storage) *Impl { + return &Impl{ + mutex: &sync.Mutex{}, + storage: storage, + revision: 0, + cache: map[string]*Policy{}, + } +} + +func (i *Impl) Add(key string, obj *Policy) { + if !i.validatePolicy(obj) { + logger.Sugar().Warnf("invalid policy, key: %s, policy: %v", key, obj) + return + } + + i.mutex.Lock() + defer i.mutex.Unlock() + if origin := i.cache[key]; reflect.DeepEqual(origin, obj) { + return + } + + cloned := make(map[string]*Policy, len(i.cache)+1) + + for k, v := range i.cache { + cloned[k] = v + } + + cloned[key] = obj + + i.cache = cloned + atomic.AddInt64(&i.revision, 1) + + i.Notify() +} + +func (i *Impl) Get(key string) *Policy { + i.mutex.Lock() + defer i.mutex.Unlock() + + return i.cache[key] +} + +func (i *Impl) Update(key string, newObj *Policy) { + if !i.validatePolicy(newObj) { + logger.Sugar().Warnf("invalid policy, key: %s, policy: %v", key, newObj) + return + } + + i.mutex.Lock() + defer i.mutex.Unlock() + + if origin := i.cache[key]; reflect.DeepEqual(origin, newObj) { + return + } + + cloned := make(map[string]*Policy, len(i.cache)) + + for k, v := range i.cache { + cloned[k] = v + } + + cloned[key] = newObj + + i.cache = cloned + atomic.AddInt64(&i.revision, 1) + + i.Notify() +} + +func (i *Impl) Delete(key string) { + i.mutex.Lock() + defer i.mutex.Unlock() + + if _, ok := i.cache[key]; !ok { + return + } + + cloned := make(map[string]*Policy, len(i.cache)-1) + + for k, v := range i.cache { + if k == key { + continue + } + cloned[k] = v + } + + i.cache = cloned + atomic.AddInt64(&i.revision, 1) + + i.Notify() +} + +func (i *Impl) Notify() { + originRule := &Origin{ + revision: i.revision, + data: i.cache, + } + + i.storage.LatestRules[storage.ConditionRoute] = originRule + + i.storage.Mutex.RLock() + defer i.storage.Mutex.RUnlock() + for _, c := range i.storage.Connection { + c.RawRuleQueue.Add(originRule) + } +} + +func (i *Impl) validatePolicy(policy *Policy) bool { + return policy != nil +} diff --git a/pkg/rule/crd/conditionroute/rule.go b/pkg/rule/crd/conditionroute/rule.go new file mode 100644 index 000000000..9a42e9950 --- /dev/null +++ b/pkg/rule/crd/conditionroute/rule.go @@ -0,0 +1,75 @@ +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package conditionroute + +import ( + "encoding/json" + "github.com/apache/dubbo-admin/pkg/core/endpoint" + "github.com/apache/dubbo-admin/pkg/rule/storage" +) + +type ToClient struct { + revision int64 + data string +} + +func (r *ToClient) Type() string { + return storage.ConditionRoute +} + +func (r *ToClient) Revision() int64 { + return r.revision +} + +func (r *ToClient) Data() string { + return r.data +} + +type Origin struct { + revision int64 + data map[string]*Policy +} + +func (o *Origin) Type() string { + return storage.ConditionRoute +} + +func (o *Origin) Revision() int64 { + return o.revision +} + +func (o *Origin) Exact(endpoint *endpoint.Endpoint) (storage.ToClient, error) { + matchedRuled := make([]*PolicyToClient, 0, len(o.data)) + + for _, v := range o.data { + if v.Spec == nil { + continue + } + + toClient := v.CopyToClient() + matchedRuled = append(matchedRuled, toClient) + } + + allRule, err := json.Marshal(matchedRuled) + if err != nil { + return nil, err + } + + return &ToClient{ + revision: o.revision, + data: string(allRule), + }, nil +} diff --git a/pkg/rule/crd/controller.go b/pkg/rule/crd/controller.go new file mode 100644 index 000000000..cef06ef1f --- /dev/null +++ b/pkg/rule/crd/controller.go @@ -0,0 +1,641 @@ +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package crd + +import ( + "github.com/apache/dubbo-admin/pkg/core/logger" + apiV1beta1 "github.com/apache/dubbo-admin/pkg/rule/apis/dubbo.apache.org/v1beta1" + informerV1beta1 "github.com/apache/dubbo-admin/pkg/rule/clientgen/informers/externalversions/dubbo.apache.org/v1beta1" + "github.com/apache/dubbo-admin/pkg/rule/crd/authentication" + "github.com/apache/dubbo-admin/pkg/rule/crd/authorization" + "github.com/apache/dubbo-admin/pkg/rule/crd/conditionroute" + "github.com/apache/dubbo-admin/pkg/rule/crd/dynamicconfig" + "github.com/apache/dubbo-admin/pkg/rule/crd/servicemapping" + "github.com/apache/dubbo-admin/pkg/rule/crd/tagroute" + "k8s.io/client-go/tools/cache" + "k8s.io/utils/strings/slices" +) + +type NotificationType int + +const ( + // AddNotification is a notification type for add events. + AddNotification NotificationType = iota + // UpdateNotification is a notification type for update events. + UpdateNotification + // DeleteNotification is a notification type for delete events. + DeleteNotification +) + +// Controller is the controller implementation for Foo resources +type Controller struct { + rootNamespace string + + authenticationSynced cache.InformerSynced + authorizationSynced cache.InformerSynced + serviceMappingSynced cache.InformerSynced + tagRouteSynced cache.InformerSynced + conditionRouteSynced cache.InformerSynced + dynamicConfigSynced cache.InformerSynced + + authenticationHandler authentication.Handler + authorizationHandler authorization.Handler + serviceMappingHandler servicemapping.Handler + conditionRouteHandler conditionroute.Handler + tagRouteHandler tagroute.Handler + dynamicConfigHandler dynamicconfig.Handler +} + +func (c *Controller) NeedLeaderElection() bool { + return false +} + +func (c *Controller) Start(stop <-chan struct{}) error { + logger.Sugar().Info("Init rule controller...") + + return nil +} + +// NewController returns a new sample controller +func NewController( + rootNamespace string, + authenticationHandler authentication.Handler, + authorizationHandler authorization.Handler, + serviceMappingHandler servicemapping.Handler, + tagRouteHandler tagroute.Handler, + conditionRouteHandler conditionroute.Handler, + dynamicConfigHandler dynamicconfig.Handler, + acInformer informerV1beta1.AuthenticationPolicyInformer, + apInformer informerV1beta1.AuthorizationPolicyInformer, + smInformer informerV1beta1.ServiceNameMappingInformer, + tgInformer informerV1beta1.TagRouteInformer, + cdInformer informerV1beta1.ConditionRouteInformer, + dcInformer informerV1beta1.DynamicConfigInformer, +) *Controller { + controller := &Controller{ + rootNamespace: rootNamespace, + + authenticationSynced: acInformer.Informer().HasSynced, + authorizationSynced: apInformer.Informer().HasSynced, + serviceMappingSynced: smInformer.Informer().HasSynced, + tagRouteSynced: tgInformer.Informer().HasSynced, + conditionRouteSynced: cdInformer.Informer().HasSynced, + dynamicConfigSynced: dcInformer.Informer().HasSynced, + + authenticationHandler: authenticationHandler, + authorizationHandler: authorizationHandler, + serviceMappingHandler: serviceMappingHandler, + conditionRouteHandler: conditionRouteHandler, + tagRouteHandler: tagRouteHandler, + dynamicConfigHandler: dynamicConfigHandler, + } + logger.Sugar().Info("Setting up event handlers") + _, err := acInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{ + AddFunc: func(obj interface{}) { + controller.handleEvent(obj, AddNotification) + }, + UpdateFunc: func(oldObj, newObj interface{}) { + controller.handleEvent(newObj, UpdateNotification) + }, + DeleteFunc: func(obj interface{}) { + controller.handleEvent(obj, DeleteNotification) + }, + }) + if err != nil { + return nil + } + + _, err = apInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{ + AddFunc: func(obj interface{}) { + controller.handleEvent(obj, AddNotification) + }, + UpdateFunc: func(oldObj, newObj interface{}) { + controller.handleEvent(newObj, UpdateNotification) + }, + DeleteFunc: func(obj interface{}) { + controller.handleEvent(obj, DeleteNotification) + }, + }) + if err != nil { + return nil + } + + _, err = smInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{ + AddFunc: func(obj interface{}) { + controller.handleEvent(obj, AddNotification) + }, + UpdateFunc: func(oldObj, newObj interface{}) { + controller.handleEvent(newObj, UpdateNotification) + }, + DeleteFunc: func(obj interface{}) { + controller.handleEvent(obj, DeleteNotification) + }, + }) + if err != nil { + return nil + } + + _, err = tgInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{ + AddFunc: func(obj interface{}) { + controller.handleEvent(obj, AddNotification) + }, + UpdateFunc: func(oldObj, newObj interface{}) { + controller.handleEvent(newObj, UpdateNotification) + }, + DeleteFunc: func(obj interface{}) { + controller.handleEvent(obj, DeleteNotification) + }, + }) + if err != nil { + return nil + } + + _, err = cdInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{ + AddFunc: func(obj interface{}) { + controller.handleEvent(obj, AddNotification) + }, + UpdateFunc: func(oldObj, newObj interface{}) { + controller.handleEvent(newObj, UpdateNotification) + }, + DeleteFunc: func(obj interface{}) { + controller.handleEvent(obj, DeleteNotification) + }, + }) + if err != nil { + return nil + } + + _, err = dcInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{ + AddFunc: func(obj interface{}) { + controller.handleEvent(obj, AddNotification) + }, + UpdateFunc: func(oldObj, newObj interface{}) { + controller.handleEvent(newObj, UpdateNotification) + }, + DeleteFunc: func(obj interface{}) { + controller.handleEvent(obj, DeleteNotification) + }, + }) + if err != nil { + return nil + } + return controller +} + +func (c *Controller) handleEvent(obj interface{}, eventType NotificationType) { + key, err := cache.MetaNamespaceKeyFunc(obj) + if err != nil { + logger.Sugar().Errorf("error getting key for object: %v", err) + return + } + switch o := obj.(type) { + case *apiV1beta1.AuthenticationPolicy: + a := CopyToAuthentication(key, c.rootNamespace, o) + switch eventType { + case AddNotification: + c.authenticationHandler.Add(key, a) + case UpdateNotification: + c.authenticationHandler.Update(key, a) + case DeleteNotification: + c.authenticationHandler.Delete(key) + } + return + case *apiV1beta1.AuthorizationPolicy: + a := CopyToAuthorization(key, c.rootNamespace, o) + + switch eventType { + case AddNotification: + c.authorizationHandler.Add(key, a) + case UpdateNotification: + c.authorizationHandler.Update(key, a) + case DeleteNotification: + c.authorizationHandler.Delete(key) + } + case *apiV1beta1.ServiceNameMapping: + a := CopyToServiceMapping(key, c.rootNamespace, o) + + switch eventType { + case AddNotification: + c.serviceMappingHandler.Add(key, a) + case UpdateNotification: + c.serviceMappingHandler.Update(key, a) + case DeleteNotification: + c.serviceMappingHandler.Delete(key) + } + case *apiV1beta1.TagRoute: + a := CopyToTagRoute(key, c.rootNamespace, o) + + switch eventType { + case AddNotification: + c.tagRouteHandler.Add(key, a) + case UpdateNotification: + c.tagRouteHandler.Update(key, a) + case DeleteNotification: + c.tagRouteHandler.Delete(key) + } + case *apiV1beta1.ConditionRoute: + a := CopyToConditionRoute(key, c.rootNamespace, o) + + switch eventType { + case AddNotification: + c.conditionRouteHandler.Add(key, a) + case UpdateNotification: + c.conditionRouteHandler.Update(key, a) + case DeleteNotification: + c.conditionRouteHandler.Delete(key) + } + case *apiV1beta1.DynamicConfig: + a := CopyToDynamicConfig(key, c.rootNamespace, o) + + switch eventType { + case AddNotification: + c.dynamicConfigHandler.Add(key, a) + case UpdateNotification: + c.dynamicConfigHandler.Update(key, a) + case DeleteNotification: + c.dynamicConfigHandler.Delete(key) + } + default: + logger.Sugar().Errorf("unexpected object type: %v", obj) + return + } +} + +func CopyToServiceMapping(key, rootNamespace string, pa *apiV1beta1.ServiceNameMapping) *servicemapping.Policy { + a := &servicemapping.Policy{} + a.Name = key + a.Spec = &servicemapping.PolicySpec{} + a.Spec.ApplicationNames = pa.Spec.ApplicationNames + a.Spec.InterfaceName = pa.Spec.InterfaceName + return a +} + +func CopyToTagRoute(key, rootNamespace string, pa *apiV1beta1.TagRoute) *tagroute.Policy { + a := &tagroute.Policy{} + a.Name = key + a.Spec = &tagroute.PolicySpec{} + a.Spec.Priority = pa.Spec.Priority + a.Spec.Enabled = pa.Spec.Enabled + a.Spec.Force = pa.Spec.Force + a.Spec.Runtime = pa.Spec.Runtime + a.Spec.Key = pa.Spec.Key + a.Spec.ConfigVersion = pa.Spec.ConfigVersion + if pa.Spec.Tags != nil { + for _, tag := range pa.Spec.Tags { + t := &tagroute.Tag{ + Name: tag.Name, + } + if tag.Addresses != nil { + for _, address := range tag.Addresses { + t.Addresses = append(t.Addresses, address) + } + } + if tag.Match != nil { + for _, match := range tag.Match { + p := &tagroute.ParamMatch{ + Key: match.Key, + Value: &tagroute.StringMatch{ + Exact: match.Value.Exact, + Prefix: match.Value.Prefix, + Regex: match.Value.Regex, + Noempty: match.Value.Noempty, + Empty: match.Value.Empty, + Wildcard: match.Value.Wildcard, + }, + } + + t.Match = append(t.Match, p) + } + } + a.Spec.Tags = append(a.Spec.Tags, t) + } + } + return a +} + +func CopyToConditionRoute(key, rootNamespace string, pa *apiV1beta1.ConditionRoute) *conditionroute.Policy { + a := &conditionroute.Policy{} + a.Name = key + a.Spec = &conditionroute.PolicySpec{} + a.Spec.Key = pa.Spec.Key + a.Spec.Conditions = pa.Spec.Conditions + a.Spec.Runtime = pa.Spec.Runtime + a.Spec.ConfigVersion = pa.Spec.ConfigVersion + a.Spec.Force = pa.Spec.Force + a.Spec.Scope = pa.Spec.Scope + a.Spec.Priority = pa.Spec.Priority + if pa.Spec.Conditions != nil { + for _, rule := range pa.Spec.Conditions { + a.Spec.Conditions = append(a.Spec.Conditions, rule) + } + } + return nil +} + +func CopyToDynamicConfig(key, rootNamespace string, pa *apiV1beta1.DynamicConfig) *dynamicconfig.Policy { + a := &dynamicconfig.Policy{} + a.Name = key + a.Spec = &dynamicconfig.PolicySpec{} + a.Spec.Key = pa.Spec.Key + a.Spec.Scope = pa.Spec.Scope + a.Spec.ConfigVersion = pa.Spec.ConfigVersion + a.Spec.Enabled = pa.Spec.Enabled + if pa.Spec.Configs != nil { + for _, config := range pa.Spec.Configs { + o := &dynamicconfig.OverrideConfig{ + Side: config.Side, + Type: config.Type, + Enabled: config.Enabled, + } + if config.Addresses != nil { + for _, address := range config.Addresses { + o.Addresses = append(o.Addresses, address) + } + } + if config.ProviderAddresses != nil { + for _, providerAddresses := range config.ProviderAddresses { + o.ProviderAddresses = append(o.ProviderAddresses, providerAddresses) + } + } + if config.Applications != nil { + for _, application := range config.Applications { + o.Applications = append(o.Applications, application) + } + } + if config.Services != nil { + for _, service := range config.Services { + o.Services = append(o.Services, service) + } + } + newMap := make(map[string]string) + if config.Parameters != nil { + for key, value := range config.Parameters { + newMap[key] = value + } + } + o.Parameters = newMap + match := &dynamicconfig.ConditionMatch{ + Address: &dynamicconfig.AddressMatch{ + Wildcard: config.Match.Address.Wildcard, + Cird: config.Match.Address.Cird, + Exact: config.Match.Address.Exact, + }, + } + service := &dynamicconfig.ListStringMatch{} + if config.Match.Service.Oneof != nil { + for _, one := range config.Match.Service.Oneof { + s := &dynamicconfig.StringMatch{ + Exact: one.Exact, + Prefix: one.Prefix, + Regex: one.Regex, + Noempty: one.Noempty, + Empty: one.Empty, + Wildcard: one.Wildcard, + } + service.Oneof = append(service.Oneof, s) + } + } + application := &dynamicconfig.ListStringMatch{} + if config.Match.Application.Oneof != nil { + for _, one := range config.Match.Application.Oneof { + s := &dynamicconfig.StringMatch{ + Exact: one.Exact, + Prefix: one.Prefix, + Regex: one.Regex, + Noempty: one.Noempty, + Empty: one.Empty, + Wildcard: one.Wildcard, + } + application.Oneof = append(application.Oneof, s) + } + } + + match.Service = service + match.Application = application + if config.Match.Param != nil { + for _, param := range config.Match.Param { + p := &dynamicconfig.ParamMatch{ + Key: param.Key, + Value: &dynamicconfig.StringMatch{ + Exact: param.Value.Exact, + Prefix: param.Value.Prefix, + Regex: param.Value.Regex, + Noempty: param.Value.Noempty, + Empty: param.Value.Empty, + Wildcard: param.Value.Wildcard, + }, + } + match.Param = append(match.Param, p) + } + } + + o.Match = match + + a.Spec.Configs = append(a.Spec.Configs, o) + } + } + return a +} + +func CopyToAuthentication(key, rootNamespace string, pa *apiV1beta1.AuthenticationPolicy) *authentication.Policy { + a := &authentication.Policy{} + a.Name = key + a.Spec = &authentication.PolicySpec{} + a.Spec.Action = pa.Spec.Action + if pa.Spec.Selector != nil { + for _, selector := range pa.Spec.Selector { + r := &authentication.Selector{ + Namespaces: selector.Namespaces, + NotNamespaces: selector.NotNamespaces, + IpBlocks: selector.IpBlocks, + NotIpBlocks: selector.NotIpBlocks, + Principals: selector.Principals, + NotPrincipals: selector.NotPrincipals, + } + if selector.Extends != nil { + for _, extends := range selector.Extends { + r.Extends = append(r.Extends, &authentication.Extend{ + Key: extends.Key, + Value: extends.Value, + }) + } + } + if selector.NotExtends != nil { + for _, notExtend := range selector.NotExtends { + r.NotExtends = append(r.NotExtends, &authentication.Extend{ + Key: notExtend.Key, + Value: notExtend.Value, + }) + } + } + a.Spec.Selector = append(a.Spec.Selector, r) + } + } + + if pa.Spec.PortLevel != nil { + for _, portLevel := range pa.Spec.PortLevel { + r := &authentication.PortLevel{ + Port: portLevel.Port, + Action: portLevel.Action, + } + + a.Spec.PortLevel = append(a.Spec.PortLevel, r) + } + } + + if rootNamespace == pa.Namespace { + return a + } + + if len(a.Spec.Selector) == 0 { + a.Spec.Selector = append(a.Spec.Selector, &authentication.Selector{ + Namespaces: []string{pa.Namespace}, + }) + } else { + for _, selector := range a.Spec.Selector { + if !slices.Contains(selector.Namespaces, pa.Namespace) { + selector.Namespaces = append(selector.Namespaces, pa.Namespace) + } + } + } + + return a +} + +func CopyToAuthorization(key, rootNamespace string, pa *apiV1beta1.AuthorizationPolicy) *authorization.Policy { + a := &authorization.Policy{} + a.Name = key + a.Spec = &authorization.PolicySpec{} + a.Spec.Action = pa.Spec.Action + if pa.Spec.Rules != nil { + for _, rule := range pa.Spec.Rules { + r := &authorization.PolicyRule{ + From: &authorization.Source{ + Namespaces: rule.From.Namespaces, + NotNamespaces: rule.From.NotNamespaces, + IpBlocks: rule.From.IpBlocks, + NotIpBlocks: rule.From.NotIpBlocks, + Principals: rule.From.Principals, + NotPrincipals: rule.From.NotPrincipals, + }, + To: &authorization.Target{ + Namespaces: rule.To.Namespaces, + NotNamespaces: rule.To.NotNamespaces, + IpBlocks: rule.To.IpBlocks, + NotIpBlocks: rule.To.NotIpBlocks, + Principals: rule.To.Principals, + NotPrincipals: rule.To.NotPrincipals, + }, + When: &authorization.Condition{ + Key: rule.When.Key, + }, + } + if rule.From.Extends != nil { + for _, extends := range rule.From.Extends { + r.From.Extends = append(r.From.Extends, &authorization.Extend{ + Key: extends.Key, + Value: extends.Value, + }) + } + } + if rule.From.NotExtends != nil { + for _, notExtend := range rule.From.NotExtends { + r.From.NotExtends = append(r.From.NotExtends, &authorization.Extend{ + Key: notExtend.Key, + Value: notExtend.Value, + }) + } + } + if rule.To.Extends != nil { + for _, extends := range rule.To.Extends { + r.To.Extends = append(r.To.Extends, &authorization.Extend{ + Key: extends.Key, + Value: extends.Value, + }) + } + } + if rule.To.NotExtends != nil { + for _, notExtend := range rule.To.NotExtends { + r.To.NotExtends = append(r.To.NotExtends, &authorization.Extend{ + Key: notExtend.Key, + Value: notExtend.Value, + }) + } + } + if rule.When.Values != nil { + for _, value := range rule.When.Values { + r.When.Values = append(r.When.Values, &authorization.Match{ + Type: value.Type, + Value: value.Value, + }) + } + } + if rule.When.NotValues != nil { + for _, notValue := range rule.When.NotValues { + r.When.Values = append(r.When.Values, &authorization.Match{ + Type: notValue.Type, + Value: notValue.Value, + }) + } + } + + a.Spec.Rules = append(a.Spec.Rules, r) + } + } + a.Spec.Samples = pa.Spec.Samples + a.Spec.Order = pa.Spec.Order + a.Spec.MatchType = pa.Spec.MatchType + + if rootNamespace == pa.Namespace { + return a + } + + if len(a.Spec.Rules) == 0 { + a.Spec.Rules = append(a.Spec.Rules, &authorization.PolicyRule{ + To: &authorization.Target{ + Namespaces: []string{pa.Namespace}, + }, + }) + } else { + for _, rule := range a.Spec.Rules { + if rule.To != nil { + rule.To = &authorization.Target{} + } + if !slices.Contains(rule.To.Namespaces, pa.Namespace) { + rule.To.Namespaces = append(rule.To.Namespaces, pa.Namespace) + } + } + } + return a +} + +func (c *Controller) WaitSynced(stop <-chan struct{}) { + logger.Sugar().Info("Waiting for informer caches to sync") + + if !cache.WaitForCacheSync(stop, + c.authenticationSynced, + c.authorizationSynced, + c.serviceMappingSynced, + c.conditionRouteSynced, + c.tagRouteSynced, + c.dynamicConfigSynced, + ) { + logger.Sugar().Error("Timed out waiting for caches to sync") + return + } else { + logger.Sugar().Info("Caches synced") + } +} diff --git a/pkg/rule/crd/dynamicconfig/definition.go b/pkg/rule/crd/dynamicconfig/definition.go new file mode 100644 index 000000000..4597e8011 --- /dev/null +++ b/pkg/rule/crd/dynamicconfig/definition.go @@ -0,0 +1,247 @@ +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dynamicconfig + +type Policy struct { + Name string `json:"name,omitempty"` + + Spec *PolicySpec `json:"spec"` +} + +func (p *Policy) CopyToClient() *PolicyToClient { + toClient := &PolicyToClient{ + Name: p.Name, + } + + if p.Spec != nil { + toClient.Spec = p.Spec.CopyToClient() + } + + return toClient +} + +type PolicySpec struct { + Key string `json:"key,omitempty"` + Scope string `json:"scope,omitempty"` + ConfigVersion string `json:"configVersion,omitempty"` + Enabled bool `json:"enabled,omitempty"` + Configs []*OverrideConfig `json:"configs,omitempty"` +} + +func (p *PolicySpec) CopyToClient() *PolicySpecToClient { + toClient := &PolicySpecToClient{ + Key: p.Key, + Scope: p.Scope, + ConfigVersion: p.ConfigVersion, + Enabled: p.Enabled, + } + + if p.Configs != nil { + toClient.Configs = make([]*OverrideConfigToClient, 0, len(p.Configs)) + for _, config := range p.Configs { + toClient.Configs = append(toClient.Configs, config.CopyToClient()) + } + } + + return toClient +} + +type OverrideConfig struct { + Side string `json:"side,omitempty"` + Addresses []string `json:"addresses,omitempty"` + ProviderAddresses []string `json:"providerAddresses,omitempty"` + Parameters map[string]string `json:"parameters,omitempty"` + Applications []string `json:"applications,omitempty"` + Services []string `json:"services,omitempty"` + Type string `json:"type,omitempty"` + Enabled bool `json:"enabled,omitempty"` + Match *ConditionMatch `json:"match,omitempty"` +} + +func (p *OverrideConfig) CopyToClient() *OverrideConfigToClient { + toClient := &OverrideConfigToClient{ + Side: p.Side, + Addresses: p.Addresses, + ProviderAddresses: p.ProviderAddresses, + Parameters: p.Parameters, + Applications: p.Applications, + Services: p.Services, + Type: p.Type, + Enabled: p.Enabled, + } + + if p.Match != nil { + toClient.Match = p.Match.CopyToClient() + } + + return toClient +} + +type ConditionMatch struct { + Address *AddressMatch `json:"address,omitempty"` + Service *ListStringMatch `json:"service,omitempty"` + Application *ListStringMatch `json:"application,omitempty"` + Param []*ParamMatch `json:"param,omitempty"` +} + +func (p *ConditionMatch) CopyToClient() *ConditionMatchToClient { + toClient := &ConditionMatchToClient{} + if p.Address != nil { + toClient.Address = p.Address.CopyToClient() + } + if p.Service != nil { + toClient.Service = p.Service.CopyToClient() + } + if p.Application != nil { + toClient.Application = p.Application.CopyToClient() + } + if p.Param != nil { + toClient.Param = make([]*ParamMatchToClient, 0, len(p.Param)) + for _, param := range p.Param { + toClient.Param = append(toClient.Param, param.CopyToClient()) + } + } + + return toClient +} + +type AddressMatch struct { + Wildcard string `json:"wildcard,omitempty"` + Cird string `json:"cird,omitempty"` + Exact string `json:"exact,omitempty"` +} + +func (p *AddressMatch) CopyToClient() *AddressMatchToClient { + toClient := &AddressMatchToClient{ + Wildcard: p.Wildcard, + Cird: p.Cird, + Exact: p.Exact, + } + + return toClient +} + +type ParamMatch struct { + Key string `json:"key,omitempty"` + Value *StringMatch `json:"value,omitempty"` +} + +func (p *ParamMatch) CopyToClient() *ParamMatchToClient { + toClient := &ParamMatchToClient{ + Key: p.Key, + } + + if p.Value != nil { + toClient.Value = p.Value.CopyToClient() + } + + return toClient +} + +type ListStringMatch struct { + Oneof []*StringMatch `json:"oneof,omitempty"` +} + +func (p *ListStringMatch) CopyToClient() *ListStringMatchToClient { + toClient := &ListStringMatchToClient{} + if p.Oneof != nil { + toClient.Oneof = make([]*StringMatchToClient, 0, len(p.Oneof)) + for _, one := range p.Oneof { + toClient.Oneof = append(toClient.Oneof, one.CopyToClient()) + } + } + return toClient +} + +type StringMatch struct { + Exact string `json:"exact,omitempty"` + Prefix string `json:"prefix,omitempty"` + Regex string `json:"regex,omitempty"` + Noempty string `json:"noempty,omitempty"` + Empty string `json:"empty,omitempty"` + Wildcard string `json:"wildcard,omitempty"` +} + +func (p *StringMatch) CopyToClient() *StringMatchToClient { + toClient := &StringMatchToClient{ + Exact: p.Exact, + Prefix: p.Prefix, + Regex: p.Regex, + Noempty: p.Noempty, + Empty: p.Empty, + Wildcard: p.Wildcard, + } + return toClient +} + +// To Client Rule + +type PolicyToClient struct { + Name string `json:"name,omitempty"` + + Spec *PolicySpecToClient `json:"spec"` +} + +type PolicySpecToClient struct { + Key string `json:"key,omitempty"` + Scope string `json:"scope,omitempty"` + ConfigVersion string `json:"configVersion,omitempty"` + Enabled bool `json:"enabled,omitempty"` + Configs []*OverrideConfigToClient `json:"configs,omitempty"` +} + +type OverrideConfigToClient struct { + Side string `json:"side,omitempty"` + Addresses []string `json:"addresses,omitempty"` + ProviderAddresses []string `json:"providerAddresses,omitempty"` + Parameters map[string]string `json:"parameters,omitempty"` + Applications []string `json:"applications,omitempty"` + Services []string `json:"services,omitempty"` + Type string `json:"type,omitempty"` + Enabled bool `json:"enabled,omitempty"` + Match *ConditionMatchToClient `json:"match,omitempty"` +} + +type ConditionMatchToClient struct { + Address *AddressMatchToClient `json:"address,omitempty"` + Service *ListStringMatchToClient `json:"service,omitempty"` + Application *ListStringMatchToClient `json:"application,omitempty"` + Param []*ParamMatchToClient `json:"param,omitempty"` +} + +type AddressMatchToClient struct { + Wildcard string `json:"wildcard,omitempty"` + Cird string `json:"cird,omitempty"` + Exact string `json:"exact,omitempty"` +} + +type ParamMatchToClient struct { + Key string `json:"key,omitempty"` + Value *StringMatchToClient `json:"value,omitempty"` +} + +type ListStringMatchToClient struct { + Oneof []*StringMatchToClient `json:"oneof,omitempty"` +} + +type StringMatchToClient struct { + Exact string `json:"exact,omitempty"` + Prefix string `json:"prefix,omitempty"` + Regex string `json:"regex,omitempty"` + Noempty string `json:"noempty,omitempty"` + Empty string `json:"empty,omitempty"` + Wildcard string `json:"wildcard,omitempty"` +} diff --git a/pkg/rule/crd/dynamicconfig/handler.go b/pkg/rule/crd/dynamicconfig/handler.go new file mode 100644 index 000000000..80d0630b1 --- /dev/null +++ b/pkg/rule/crd/dynamicconfig/handler.go @@ -0,0 +1,135 @@ +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dynamicconfig + +import ( + "github.com/apache/dubbo-admin/pkg/rule/storage" + "reflect" + "sync" + "sync/atomic" +) + +type Handler interface { + Add(key string, obj *Policy) + Get(key string) *Policy + Update(key string, newObj *Policy) + Delete(key string) +} + +type Impl struct { + mutex *sync.Mutex + + revision int64 + storage *storage.Storage + cache map[string]*Policy +} + +func NewHandler(storage *storage.Storage) *Impl { + return &Impl{ + mutex: &sync.Mutex{}, + storage: storage, + revision: 0, + cache: map[string]*Policy{}, + } +} + +func (i *Impl) Add(key string, obj *Policy) { + i.mutex.Lock() + defer i.mutex.Unlock() + if origin := i.cache[key]; reflect.DeepEqual(origin, obj) { + return + } + + cloned := make(map[string]*Policy, len(i.cache)+1) + + for k, v := range i.cache { + cloned[k] = v + } + + cloned[key] = obj + + i.cache = cloned + atomic.AddInt64(&i.revision, 1) + + i.Notify() +} + +func (i *Impl) Get(key string) *Policy { + i.mutex.Lock() + defer i.mutex.Unlock() + + return i.cache[key] +} + +func (i *Impl) Update(key string, newObj *Policy) { + i.mutex.Lock() + defer i.mutex.Unlock() + + if origin := i.cache[key]; reflect.DeepEqual(origin, newObj) { + return + } + + cloned := make(map[string]*Policy, len(i.cache)) + + for k, v := range i.cache { + cloned[k] = v + } + + cloned[key] = newObj + + i.cache = cloned + atomic.AddInt64(&i.revision, 1) + + i.Notify() +} + +func (i *Impl) Delete(key string) { + i.mutex.Lock() + defer i.mutex.Unlock() + + if _, ok := i.cache[key]; !ok { + return + } + + cloned := make(map[string]*Policy, len(i.cache)-1) + + for k, v := range i.cache { + if k == key { + continue + } + cloned[k] = v + } + + i.cache = cloned + atomic.AddInt64(&i.revision, 1) + + i.Notify() +} + +func (i *Impl) Notify() { + originRule := &Origin{ + revision: i.revision, + data: i.cache, + } + + i.storage.LatestRules[storage.DynamicConfig] = originRule + + i.storage.Mutex.RLock() + defer i.storage.Mutex.RUnlock() + for _, c := range i.storage.Connection { + c.RawRuleQueue.Add(originRule) + } +} diff --git a/pkg/rule/crd/dynamicconfig/rule.go b/pkg/rule/crd/dynamicconfig/rule.go new file mode 100644 index 000000000..69235e05a --- /dev/null +++ b/pkg/rule/crd/dynamicconfig/rule.go @@ -0,0 +1,74 @@ +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dynamicconfig + +import ( + "encoding/json" + "github.com/apache/dubbo-admin/pkg/core/endpoint" + "github.com/apache/dubbo-admin/pkg/rule/storage" +) + +type ToClient struct { + revision int64 + data string +} + +func (r *ToClient) Type() string { + return storage.DynamicConfig +} + +func (r *ToClient) Revision() int64 { + return r.revision +} + +func (r *ToClient) Data() string { + return r.data +} + +type Origin struct { + revision int64 + data map[string]*Policy +} + +func (o *Origin) Type() string { + return storage.DynamicConfig +} + +func (o *Origin) Revision() int64 { + return o.revision +} + +func (o *Origin) Exact(endpoint *endpoint.Endpoint) (storage.ToClient, error) { + matchedRule := make([]*PolicyToClient, 0, len(o.data)) + for _, v := range o.data { + if v.Spec == nil { + continue + } + + toClient := v.CopyToClient() + matchedRule = append(matchedRule, toClient) + } + + allRule, err := json.Marshal(matchedRule) + if err != nil { + return nil, err + } + + return &ToClient{ + revision: o.revision, + data: string(allRule), + }, nil +} diff --git a/pkg/rule/crd/servicemapping/definition.go b/pkg/rule/crd/servicemapping/definition.go new file mode 100644 index 000000000..7e56f9c0c --- /dev/null +++ b/pkg/rule/crd/servicemapping/definition.go @@ -0,0 +1,61 @@ +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package servicemapping + +type Policy struct { + Name string `json:"name,omitempty"` + + Spec *PolicySpec `json:"spec"` +} + +func (p *Policy) CopyToClient() *PolicyToClient { + toClient := &PolicyToClient{ + Name: p.Name, + } + + if p.Spec != nil { + toClient.Spec = p.Spec.CopyToClient() + } + + return toClient +} + +type PolicySpec struct { + InterfaceName string `json:"interfaceName"` + ApplicationNames []string `json:"applicationNames"` +} + +func (p *PolicySpec) CopyToClient() *PolicySpecToClient { + toClient := &PolicySpecToClient{ + InterfaceName: p.InterfaceName, + ApplicationNames: p.ApplicationNames, + } + + return toClient +} + +// To Client Rule + +type PolicyToClient struct { + Name string `json:"name,omitempty"` + + Spec *PolicySpecToClient `json:"spec"` +} + +type PolicySpecToClient struct { + InterfaceName string `json:"interfaceName"` + ApplicationNames []string `json:"applicationNames"` +} diff --git a/pkg/rule/crd/servicemapping/handler.go b/pkg/rule/crd/servicemapping/handler.go new file mode 100644 index 000000000..f106d6a15 --- /dev/null +++ b/pkg/rule/crd/servicemapping/handler.go @@ -0,0 +1,135 @@ +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package servicemapping + +import ( + "github.com/apache/dubbo-admin/pkg/rule/storage" + "reflect" + "sync" + "sync/atomic" +) + +type Handler interface { + Add(key string, obj *Policy) + Get(key string) *Policy + Update(key string, newObj *Policy) + Delete(key string) +} + +type Impl struct { + mutex *sync.Mutex + + revision int64 + storage *storage.Storage + cache map[string]*Policy +} + +func NewHandler(storage *storage.Storage) *Impl { + return &Impl{ + mutex: &sync.Mutex{}, + storage: storage, + revision: 0, + cache: map[string]*Policy{}, + } +} + +func (i *Impl) Add(key string, obj *Policy) { + i.mutex.Lock() + defer i.mutex.Unlock() + if origin := i.cache[key]; reflect.DeepEqual(origin, obj) { + return + } + + cloned := make(map[string]*Policy, len(i.cache)+1) + + for k, v := range i.cache { + cloned[k] = v + } + + cloned[key] = obj + + i.cache = cloned + atomic.AddInt64(&i.revision, 1) + + i.Notify() +} + +func (i *Impl) Get(key string) *Policy { + i.mutex.Lock() + defer i.mutex.Unlock() + + return i.cache[key] +} + +func (i *Impl) Update(key string, newObj *Policy) { + i.mutex.Lock() + defer i.mutex.Unlock() + + if origin := i.cache[key]; reflect.DeepEqual(origin, newObj) { + return + } + + cloned := make(map[string]*Policy, len(i.cache)) + + for k, v := range i.cache { + cloned[k] = v + } + + cloned[key] = newObj + + i.cache = cloned + atomic.AddInt64(&i.revision, 1) + + i.Notify() +} + +func (i *Impl) Delete(key string) { + i.mutex.Lock() + defer i.mutex.Unlock() + + if _, ok := i.cache[key]; !ok { + return + } + + cloned := make(map[string]*Policy, len(i.cache)-1) + + for k, v := range i.cache { + if k == key { + continue + } + cloned[k] = v + } + + i.cache = cloned + atomic.AddInt64(&i.revision, 1) + + i.Notify() +} + +func (i *Impl) Notify() { + originRule := &Origin{ + revision: i.revision, + data: i.cache, + } + + i.storage.LatestRules[storage.ServiceMapping] = originRule + + i.storage.Mutex.RLock() + defer i.storage.Mutex.RUnlock() + for _, c := range i.storage.Connection { + c.RawRuleQueue.Add(originRule) + } +} diff --git a/pkg/rule/crd/servicemapping/rule.go b/pkg/rule/crd/servicemapping/rule.go new file mode 100644 index 000000000..92e1b38c7 --- /dev/null +++ b/pkg/rule/crd/servicemapping/rule.go @@ -0,0 +1,75 @@ +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package servicemapping + +import ( + "encoding/json" + "github.com/apache/dubbo-admin/pkg/core/endpoint" + "github.com/apache/dubbo-admin/pkg/rule/storage" +) + +type ToClient struct { + revision int64 + data string +} + +func (r *ToClient) Type() string { + return storage.ServiceMapping +} + +func (r *ToClient) Revision() int64 { + return r.revision +} + +func (r *ToClient) Data() string { + return r.data +} + +type Origin struct { + revision int64 + data map[string]*Policy +} + +func (o *Origin) Type() string { + return storage.ServiceMapping +} + +func (o *Origin) Revision() int64 { + return o.revision +} + +func (o *Origin) Exact(endpoint *endpoint.Endpoint) (storage.ToClient, error) { + matchedRule := make([]*PolicyToClient, 0, len(o.data)) + + for _, v := range o.data { + if v.Spec == nil { + continue + } + + toClient := v.CopyToClient() + matchedRule = append(matchedRule, toClient) + } + + allRule, err := json.Marshal(matchedRule) + if err != nil { + return nil, err + } + + return &ToClient{ + revision: o.revision, + data: string(allRule), + }, nil +} diff --git a/pkg/rule/crd/tagroute/definition.go b/pkg/rule/crd/tagroute/definition.go new file mode 100644 index 000000000..5ce2d9bdc --- /dev/null +++ b/pkg/rule/crd/tagroute/definition.go @@ -0,0 +1,163 @@ +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package tagroute + +type Policy struct { + Name string `json:"name,omitempty"` + + Spec *PolicySpec `json:"spec"` +} + +func (p *Policy) CopyToClient() *PolicyToClient { + toClient := &PolicyToClient{Name: p.Name} + if p.Spec != nil { + toClient.Spec = p.Spec.CopyToClient() + } + return toClient +} + +type PolicySpec struct { + Priority int `json:"priority"` + Enabled bool `json:"enabled"` + Force bool `json:"force"` + Runtime bool `json:"runtime"` + Key string `json:"key"` + Tags []*Tag `json:"tags"` + ConfigVersion string `json:"configVersion"` +} + +func (p *PolicySpec) CopyToClient() *PolicySpecToClient { + toClient := &PolicySpecToClient{ + Priority: p.Priority, + Enabled: p.Enabled, + Force: p.Force, + Runtime: p.Runtime, + Key: p.Key, + ConfigVersion: p.ConfigVersion, + } + + if p.Tags != nil { + toClient.Tags = make([]*TagToClient, 0, len(p.Tags)) + for _, tag := range p.Tags { + toClient.Tags = append(toClient.Tags, tag.CopyToClient()) + } + } + + return toClient +} + +type Tag struct { + Name string `json:"name"` + Match []*ParamMatch `json:"match"` + Addresses []string `json:"addresses"` +} + +func (p *Tag) CopyToClient() *TagToClient { + toClient := &TagToClient{ + Name: p.Name, + } + + if p.Addresses != nil { + toClient.Addresses = make([]string, len(p.Addresses)) + copy(toClient.Addresses, p.Addresses) + } + + if p.Match != nil { + toClient.Match = make([]*ParamMatchToClient, 0, len(p.Match)) + for _, match := range p.Match { + toClient.Match = append(toClient.Match, match.CopyToClient()) + } + } + + return toClient +} + +type ParamMatch struct { + Key string `json:"key,omitempty"` + Value *StringMatch `json:"value,omitempty"` +} + +func (p *ParamMatch) CopyToClient() *ParamMatchToClient { + toClient := &ParamMatchToClient{ + Key: p.Key, + } + + if p.Value != nil { + toClient.Value = p.Value.CopyToClient() + } + + return toClient +} + +type StringMatch struct { + Exact string `json:"exact,omitempty"` + Prefix string `json:"prefix,omitempty"` + Regex string `json:"regex,omitempty"` + Noempty string `json:"noempty,omitempty"` + Empty string `json:"empty,omitempty"` + Wildcard string `json:"wildcard,omitempty"` +} + +func (p *StringMatch) CopyToClient() *StringMatchToClient { + toClient := &StringMatchToClient{ + Exact: p.Exact, + Prefix: p.Prefix, + Regex: p.Regex, + Noempty: p.Noempty, + Empty: p.Empty, + Wildcard: p.Wildcard, + } + + return toClient +} + +// To Client Rule + +type PolicyToClient struct { + Name string `json:"name,omitempty"` + + Spec *PolicySpecToClient `json:"spec"` +} + +type PolicySpecToClient struct { + Priority int `json:"priority"` + Enabled bool `json:"enabled"` + Force bool `json:"force"` + Runtime bool `json:"runtime"` + Key string `json:"key"` + Tags []*TagToClient `json:"tags"` + ConfigVersion string `json:"configVersion"` +} + +type TagToClient struct { + Name string `json:"name"` + Match []*ParamMatchToClient `json:"match"` + Addresses []string `json:"addresses"` +} + +type ParamMatchToClient struct { + Key string `json:"key,omitempty"` + Value *StringMatchToClient `json:"value,omitempty"` +} + +type StringMatchToClient struct { + Exact string `json:"exact,omitempty"` + Prefix string `json:"prefix,omitempty"` + Regex string `json:"regex,omitempty"` + Noempty string `json:"noempty,omitempty"` + Empty string `json:"empty,omitempty"` + Wildcard string `json:"wildcard,omitempty"` +} diff --git a/pkg/rule/crd/tagroute/handler.go b/pkg/rule/crd/tagroute/handler.go new file mode 100644 index 000000000..dcc608c8a --- /dev/null +++ b/pkg/rule/crd/tagroute/handler.go @@ -0,0 +1,150 @@ +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package tagroute + +import ( + "github.com/apache/dubbo-admin/pkg/core/logger" + "github.com/apache/dubbo-admin/pkg/rule/storage" + "reflect" + "sync" + "sync/atomic" +) + +type Handler interface { + Add(key string, obj *Policy) + Get(key string) *Policy + Update(key string, newObj *Policy) + Delete(key string) +} + +type Impl struct { + mutex *sync.Mutex + + revision int64 + storage *storage.Storage + cache map[string]*Policy +} + +func NewHandler(storage *storage.Storage) *Impl { + return &Impl{ + mutex: &sync.Mutex{}, + storage: storage, + revision: 0, + cache: map[string]*Policy{}, + } +} + +func (i *Impl) Notify() { + originRule := &Origin{ + revision: i.revision, + data: i.cache, + } + + i.storage.LatestRules[storage.TagRoute] = originRule + + i.storage.Mutex.RLock() + defer i.storage.Mutex.RUnlock() + for _, c := range i.storage.Connection { + c.RawRuleQueue.Add(originRule) + } +} + +func (i *Impl) Add(key string, obj *Policy) { + if !i.validatePolicy(obj) { + logger.Sugar().Warnf("invalid policy, key: %s, policy: %v", key, obj) + return + } + + i.mutex.Lock() + defer i.mutex.Unlock() + if origin := i.cache[key]; reflect.DeepEqual(origin, obj) { + return + } + + cloned := make(map[string]*Policy, len(i.cache)+1) + + for k, v := range i.cache { + cloned[k] = v + } + + cloned[key] = obj + + i.cache = cloned + atomic.AddInt64(&i.revision, 1) + + i.Notify() +} + +func (i *Impl) Get(key string) *Policy { + i.mutex.Lock() + defer i.mutex.Unlock() + + return i.cache[key] +} + +func (i *Impl) Update(key string, newObj *Policy) { + if !i.validatePolicy(newObj) { + logger.Sugar().Warnf("invalid policy, key: %s, policy: %v", key, newObj) + return + } + + i.mutex.Lock() + defer i.mutex.Unlock() + + if origin := i.cache[key]; reflect.DeepEqual(origin, newObj) { + return + } + + cloned := make(map[string]*Policy, len(i.cache)) + + for k, v := range i.cache { + cloned[k] = v + } + + cloned[key] = newObj + + i.cache = cloned + atomic.AddInt64(&i.revision, 1) + + i.Notify() +} + +func (i *Impl) Delete(key string) { + i.mutex.Lock() + defer i.mutex.Unlock() + + if _, ok := i.cache[key]; !ok { + return + } + + cloned := make(map[string]*Policy, len(i.cache)-1) + + for k, v := range i.cache { + if k == key { + continue + } + cloned[k] = v + } + + i.cache = cloned + atomic.AddInt64(&i.revision, 1) + + i.Notify() +} + +func (i *Impl) validatePolicy(policy *Policy) bool { + return policy != nil +} diff --git a/pkg/rule/crd/tagroute/rule.go b/pkg/rule/crd/tagroute/rule.go new file mode 100644 index 000000000..867b92cd2 --- /dev/null +++ b/pkg/rule/crd/tagroute/rule.go @@ -0,0 +1,75 @@ +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package tagroute + +import ( + "encoding/json" + "github.com/apache/dubbo-admin/pkg/core/endpoint" + "github.com/apache/dubbo-admin/pkg/rule/storage" +) + +type ToClient struct { + revision int64 + data string +} + +func (r *ToClient) Type() string { + return storage.TagRoute +} + +func (r *ToClient) Revision() int64 { + return r.revision +} + +func (r *ToClient) Data() string { + return r.data +} + +type Origin struct { + revision int64 + data map[string]*Policy +} + +func (o *Origin) Type() string { + return storage.TagRoute +} + +func (o *Origin) Revision() int64 { + return o.revision +} + +func (o *Origin) Exact(endpoint *endpoint.Endpoint) (storage.ToClient, error) { + matchedRule := make([]*PolicyToClient, 0, len(o.data)) + + for _, v := range o.data { + if v.Spec != nil { + continue + } + + toClient := v.CopyToClient() + matchedRule = append(matchedRule, toClient) + } + + allRule, err := json.Marshal(matchedRule) + if err != nil { + return nil, err + } + + return &ToClient{ + revision: o.revision, + data: string(allRule), + }, nil +} diff --git a/pkg/rule/server/server.go b/pkg/rule/server/server.go new file mode 100644 index 000000000..c71a1ced1 --- /dev/null +++ b/pkg/rule/server/server.go @@ -0,0 +1,118 @@ +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package server + +import ( + "fmt" + "github.com/apache/dubbo-admin/api/mesh" + dubbo_cp "github.com/apache/dubbo-admin/pkg/config/app/dubbo-cp" + + "github.com/apache/dubbo-admin/pkg/core/cert/provider" + "github.com/apache/dubbo-admin/pkg/core/logger" + "github.com/apache/dubbo-admin/pkg/core/tools/endpoint" + informFactory "github.com/apache/dubbo-admin/pkg/rule/clientgen/informers/externalversions" + "github.com/apache/dubbo-admin/pkg/rule/crd" + "github.com/apache/dubbo-admin/pkg/rule/storage" + "google.golang.org/grpc/peer" +) + +type RuleServer struct { + mesh.UnimplementedRuleServiceServer + + Options *dubbo_cp.Config + CertStorage provider.Storage + KubeClient provider.Client + Storage *storage.Storage + Controller *crd.Controller + InformerFactory informFactory.SharedInformerFactory +} + +func NewRuleServer(options *dubbo_cp.Config) *RuleServer { + return &RuleServer{ + Options: options, + } +} + +func (s *RuleServer) NeedLeaderElection() bool { + return false +} + +func (s *RuleServer) Start(stop <-chan struct{}) error { + s.InformerFactory.Start(stop) + s.Controller.WaitSynced(stop) + return nil +} + +func (s *RuleServer) Observe(stream mesh.RuleService_ObserveServer) error { + c := &GrpcEndpointConnection{ + stream: stream, + stopChan: make(chan struct{}, 1), + } + + p, ok := peer.FromContext(stream.Context()) + if !ok { + logger.Sugar().Errorf("failed to get peer from context") + + return fmt.Errorf("failed to get peer from context") + } + + endpoint, err := endpoint.ExactEndpoint(stream.Context(), s.CertStorage, s.Options, s.KubeClient) + if err != nil { + logger.Sugar().Errorf("failed to get endpoint from context: %v. RemoteAddr: %s", err, p.Addr) + + return err + } + + logger.Sugar().Infof("New observe storage from %s", endpoint) + s.Storage.Connected(endpoint, c) + + <-c.stopChan + return nil +} + +type GrpcEndpointConnection struct { + storage.EndpointConnection + + stream mesh.RuleService_ObserveServer + stopChan chan struct{} +} + +func (c *GrpcEndpointConnection) Send(r *storage.ObserveResponse) error { + pbr := &mesh.ObserveResponse{ + Nonce: r.Nonce, + Type: r.Type, + Revision: r.Data.Revision(), + Data: r.Data.Data(), + } + + return c.stream.Send(pbr) +} + +func (c *GrpcEndpointConnection) Recv() (*storage.ObserveRequest, error) { + in, err := c.stream.Recv() + if err != nil { + return nil, err + } + + return &storage.ObserveRequest{ + Nonce: in.Nonce, + Type: in.Type, + }, nil +} + +func (c *GrpcEndpointConnection) Disconnect() { + c.stopChan <- struct{}{} +} diff --git a/pkg/rule/setup.go b/pkg/rule/setup.go new file mode 100644 index 000000000..cbfbe336c --- /dev/null +++ b/pkg/rule/setup.go @@ -0,0 +1,86 @@ +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package rule + +import ( + "github.com/apache/dubbo-admin/api/mesh" + "github.com/apache/dubbo-admin/pkg/core/logger" + core_runtime "github.com/apache/dubbo-admin/pkg/core/runtime" + informers "github.com/apache/dubbo-admin/pkg/rule/clientgen/informers/externalversions" + "github.com/apache/dubbo-admin/pkg/rule/crd" + "github.com/apache/dubbo-admin/pkg/rule/crd/authentication" + "github.com/apache/dubbo-admin/pkg/rule/crd/authorization" + "github.com/apache/dubbo-admin/pkg/rule/crd/conditionroute" + "github.com/apache/dubbo-admin/pkg/rule/crd/dynamicconfig" + "github.com/apache/dubbo-admin/pkg/rule/crd/servicemapping" + "github.com/pkg/errors" + "time" + + "github.com/apache/dubbo-admin/pkg/rule/crd/tagroute" + "github.com/apache/dubbo-admin/pkg/rule/server" + "github.com/apache/dubbo-admin/pkg/rule/storage" +) + +func Setup(rt core_runtime.Runtime) error { + ruleServer := server.NewRuleServer(rt.Config()) + ruleServer.CertStorage = rt.CertStorage() + ruleServer.KubeClient = rt.KubuClient() + ruleServer.Storage = storage.NewStorage() + if err := RegisterController(ruleServer); err != nil { + return errors.Wrap(err, "Controller Register failed") + } + if err := RegisterObserveService(rt, ruleServer); err != nil { + return errors.Wrap(err, "RuleService Register failed") + } + if err := rt.Add(ruleServer); err != nil { + return errors.Wrap(err, "RuleServer component add failed") + } + return nil +} + +func RegisterController(s *server.RuleServer) error { + logger.Sugar().Info("Init rule controller...") + informerFactory := informers.NewSharedInformerFactory(s.KubeClient.GetInformerClient(), time.Second*30) + s.InformerFactory = informerFactory + authenticationHandler := authentication.NewHandler(s.Storage) + authorizationHandler := authorization.NewHandler(s.Storage) + serviceMappingHandler := servicemapping.NewHandler(s.Storage) + conditionRouteHandler := conditionroute.NewHandler(s.Storage) + tagRouteHandler := tagroute.NewHandler(s.Storage) + dynamicConfigHandler := dynamicconfig.NewHandler(s.Storage) + controller := crd.NewController(s.Options.KubeConfig.Namespace, + authenticationHandler, + authorizationHandler, + serviceMappingHandler, + tagRouteHandler, + conditionRouteHandler, + dynamicConfigHandler, + informerFactory.Dubbo().V1beta1().AuthenticationPolicies(), + informerFactory.Dubbo().V1beta1().AuthorizationPolicies(), + informerFactory.Dubbo().V1beta1().ServiceNameMappings(), + informerFactory.Dubbo().V1beta1().TagRoutes(), + informerFactory.Dubbo().V1beta1().ConditionRoutes(), + informerFactory.Dubbo().V1beta1().DynamicConfigs(), + ) + s.Controller = controller + return nil +} + +func RegisterObserveService(rt core_runtime.Runtime, service *server.RuleServer) error { + mesh.RegisterRuleServiceServer(rt.GrpcServer().PlainServer, service) + mesh.RegisterRuleServiceServer(rt.GrpcServer().SecureServer, service) + return nil +} diff --git a/cmd/authority/main.go b/pkg/rule/storage/rule.go similarity index 60% rename from cmd/authority/main.go rename to pkg/rule/storage/rule.go index fcea093b6..3f42bbfbf 100644 --- a/cmd/authority/main.go +++ b/pkg/rule/storage/rule.go @@ -13,24 +13,27 @@ // See the License for the specific language governing permissions and // limitations under the License. -package main +package storage -import ( - "fmt" - "os" +import "github.com/apache/dubbo-admin/pkg/core/endpoint" - "github.com/apache/dubbo-admin/cmd/authority/app" - "github.com/apache/dubbo-admin/pkg/logger" +const ( + TagRoute = "tagroute/v1beta1" + ServiceMapping = "servicemapping/v1beta1" + DynamicConfig = "dynamicconfig/v1beta1" + ConditionRoute = "conditionroute/v1beta1" + Authorization = "authorization/v1beta1" + Authentication = "authentication/v1beta1" ) -func main() { - logger.Init() - - // Convert signal to ctx - // ctx := signals.SetupSignalHandler() +type ToClient interface { + Type() string + Revision() int64 + Data() string +} - if err := app.NewAppCommand().Execute(); err != nil { - fmt.Fprintf(os.Stderr, "%v\n", err) - os.Exit(1) - } +type Origin interface { + Type() string + Revision() int64 + Exact(endpoint *endpoint.Endpoint) (ToClient, error) } diff --git a/pkg/authority/rule/connection/storage.go b/pkg/rule/storage/storage.go similarity index 89% rename from pkg/authority/rule/connection/storage.go rename to pkg/rule/storage/storage.go index 21be73304..8f851c142 100644 --- a/pkg/authority/rule/connection/storage.go +++ b/pkg/rule/storage/storage.go @@ -13,19 +13,18 @@ // See the License for the specific language governing permissions and // limitations under the License. -package connection +package storage import ( "errors" + "github.com/apache/dubbo-admin/pkg/core/endpoint" + "github.com/apache/dubbo-admin/pkg/core/logger" "io" "strconv" "sync" "sync/atomic" "time" - "github.com/apache/dubbo-admin/pkg/authority/rule" - "github.com/apache/dubbo-admin/pkg/logger" - "k8s.io/client-go/util/workqueue" ) @@ -33,7 +32,7 @@ type Storage struct { Mutex *sync.RWMutex Connection []*Connection - LatestRules map[string]rule.Origin + LatestRules map[string]Origin } type EndpointConnection interface { @@ -46,7 +45,7 @@ type Connection struct { mutex *sync.RWMutex status ConnectionStatus EndpointConnection EndpointConnection - Endpoint *rule.Endpoint + Endpoint *endpoint.Endpoint TypeListened map[string]bool @@ -58,7 +57,7 @@ type Connection struct { type VersionedRule struct { Revision int64 Type string - Data rule.ToClient + Data ToClient } type PushingStatus int @@ -91,7 +90,7 @@ type ClientStatus struct { type ObserveResponse struct { Nonce string Type string - Data rule.ToClient + Data ToClient } type ObserveRequest struct { @@ -103,11 +102,11 @@ func NewStorage() *Storage { return &Storage{ Mutex: &sync.RWMutex{}, Connection: []*Connection{}, - LatestRules: map[string]rule.Origin{}, + LatestRules: map[string]Origin{}, } } -func (s *Storage) Connected(endpoint *rule.Endpoint, connection EndpointConnection) { +func (s *Storage) Connected(endpoint *endpoint.Endpoint, connection EndpointConnection) { s.Mutex.Lock() defer s.Mutex.Unlock() c := &Connection{ @@ -135,14 +134,14 @@ func (s *Storage) listenConnection(c *Connection) { req, err := c.EndpointConnection.Recv() if errors.Is(err, io.EOF) { - logger.Sugar().Infof("Observe connection closed. Connection ID: %s", c.Endpoint.ID) + logger.Sugar().Infof("Observe storage closed. Connection ID: %s", c.Endpoint.ID) s.Disconnect(c) return } if err != nil { - logger.Sugar().Warnf("Observe connection error: %v. Connection ID: %s", err, c.Endpoint.ID) + logger.Sugar().Warnf("Observe storage error: %v. Connection ID: %s", err, c.Endpoint.ID) s.Disconnect(c) return @@ -222,11 +221,11 @@ func (c *Connection) listenRule() { func(obj interface{}) { defer c.RawRuleQueue.Done(obj) - var key rule.Origin + var key Origin var ok bool - if key, ok = obj.(rule.Origin); !ok { + if key, ok = obj.(Origin); !ok { logger.Sugar().Errorf("expected rule.Origin in workqueue but got %#v", obj) return @@ -243,7 +242,7 @@ func (c *Connection) listenRule() { } } -func (c *Connection) handleRule(rawRule rule.Origin) error { +func (c *Connection) handleRule(rawRule Origin) error { targetRule, err := rawRule.Exact(c.Endpoint) if err != nil { return err @@ -290,7 +289,12 @@ func (c *Connection) handleRule(rawRule rule.Origin) error { } func TypeSupported(t string) bool { - return t == "authentication/v1beta1" || t == "authorization/v1beta1" + return t == TagRoute || + t == ServiceMapping || + t == DynamicConfig || + t == ConditionRoute || + t == Authentication || + t == Authorization } func (s *Storage) Disconnect(c *Connection) { diff --git a/pkg/authority/rule/connection/storage_test.go b/pkg/rule/storage/storage_test.go similarity index 69% rename from pkg/authority/rule/connection/storage_test.go rename to pkg/rule/storage/storage_test.go index df93c5fea..72adb374b 100644 --- a/pkg/authority/rule/connection/storage_test.go +++ b/pkg/rule/storage/storage_test.go @@ -13,41 +13,39 @@ // See the License for the specific language governing permissions and // limitations under the License. -package connection_test +package storage_test import ( "fmt" + "github.com/apache/dubbo-admin/pkg/core/endpoint" + authentication2 "github.com/apache/dubbo-admin/pkg/rule/crd/authentication" + authorization2 "github.com/apache/dubbo-admin/pkg/rule/crd/authorization" + "github.com/apache/dubbo-admin/pkg/rule/storage" "io" "testing" "time" - "github.com/apache/dubbo-admin/pkg/authority/rule/authentication" - - "github.com/apache/dubbo-admin/pkg/authority/rule/authorization" - - "github.com/apache/dubbo-admin/pkg/authority/rule" - "github.com/apache/dubbo-admin/pkg/authority/rule/connection" "github.com/stretchr/testify/assert" ) type fakeConnection struct { - sends []*connection.ObserveResponse + sends []*storage.ObserveResponse recvChan chan recvResult disconnected bool } type recvResult struct { - request *connection.ObserveRequest + request *storage.ObserveRequest err error } -func (f *fakeConnection) Send(response *connection.ObserveResponse) error { +func (f *fakeConnection) Send(response *storage.ObserveResponse) error { f.sends = append(f.sends, response) return nil } -func (f *fakeConnection) Recv() (*connection.ObserveRequest, error) { +func (f *fakeConnection) Recv() (*storage.ObserveRequest, error) { request := <-f.recvChan return request.request, request.err @@ -60,12 +58,12 @@ func (f *fakeConnection) Disconnect() { func TestStorage_CloseEOF(t *testing.T) { t.Parallel() - storage := connection.NewStorage() + storage := storage.NewStorage() fake := &fakeConnection{ recvChan: make(chan recvResult, 1), } - storage.Connected(&rule.Endpoint{ + storage.Connected(&endpoint.Endpoint{ ID: "test", }, fake) @@ -79,19 +77,19 @@ func TestStorage_CloseEOF(t *testing.T) { }, 10*time.Second, time.Millisecond) if len(storage.Connection) != 0 { - t.Error("expected connection to be removed") + t.Error("expected storage to be removed") } } func TestStorage_CloseErr(t *testing.T) { t.Parallel() - storage := connection.NewStorage() + storage := storage.NewStorage() fake := &fakeConnection{ recvChan: make(chan recvResult, 1), } - storage.Connected(&rule.Endpoint{ + storage.Connected(&endpoint.Endpoint{ ID: "test", }, fake) @@ -105,24 +103,24 @@ func TestStorage_CloseErr(t *testing.T) { }, 10*time.Second, time.Millisecond) if len(storage.Connection) != 0 { - t.Error("expected connection to be removed") + t.Error("expected storage to be removed") } } func TestStorage_UnknownType(t *testing.T) { t.Parallel() - storage := connection.NewStorage() + store := storage.NewStorage() fake := &fakeConnection{ recvChan: make(chan recvResult, 1), } - storage.Connected(&rule.Endpoint{ + store.Connected(&endpoint.Endpoint{ ID: "test", }, fake) fake.recvChan <- recvResult{ - request: &connection.ObserveRequest{ + request: &storage.ObserveRequest{ Nonce: "", Type: "test", }, @@ -130,14 +128,14 @@ func TestStorage_UnknownType(t *testing.T) { } fake.recvChan <- recvResult{ - request: &connection.ObserveRequest{ + request: &storage.ObserveRequest{ Nonce: "", Type: "", }, err: nil, } - conn := storage.Connection[0] + conn := store.Connection[0] fake.recvChan <- recvResult{ request: nil, @@ -156,24 +154,24 @@ func TestStorage_UnknownType(t *testing.T) { func TestStorage_StartNonEmptyNonce(t *testing.T) { t.Parallel() - storage := connection.NewStorage() + store := storage.NewStorage() fake := &fakeConnection{ recvChan: make(chan recvResult, 1), } - storage.Connected(&rule.Endpoint{ + store.Connected(&endpoint.Endpoint{ ID: "test", }, fake) fake.recvChan <- recvResult{ - request: &connection.ObserveRequest{ + request: &storage.ObserveRequest{ Nonce: "test", - Type: authorization.RuleType, + Type: storage.Authorization, }, err: nil, } - conn := storage.Connection[0] + conn := store.Connection[0] fake.recvChan <- recvResult{ request: nil, @@ -192,24 +190,24 @@ func TestStorage_StartNonEmptyNonce(t *testing.T) { func TestStorage_Listen(t *testing.T) { t.Parallel() - storage := connection.NewStorage() + storages := storage.NewStorage() fake := &fakeConnection{ recvChan: make(chan recvResult, 1), } - storage.Connected(&rule.Endpoint{ + storages.Connected(&endpoint.Endpoint{ ID: "test", }, fake) fake.recvChan <- recvResult{ - request: &connection.ObserveRequest{ + request: &storage.ObserveRequest{ Nonce: "", - Type: authorization.RuleType, + Type: storage.Authorization, }, err: nil, } - conn := storage.Connection[0] + conn := storages.Connection[0] fake.recvChan <- recvResult{ request: nil, @@ -224,7 +222,7 @@ func TestStorage_Listen(t *testing.T) { t.Error("expected type listened") } - if !conn.TypeListened[authorization.RuleType] { + if !conn.TypeListened[storage.Authorization] { t.Error("expected type listened") } } @@ -232,12 +230,12 @@ func TestStorage_Listen(t *testing.T) { func TestStorage_PreNotify(t *testing.T) { t.Parallel() - storage := connection.NewStorage() + storages := storage.NewStorage() - handler := authorization.NewHandler(storage) - handler.Add("test", &authorization.Policy{ + handler := authorization2.NewHandler(storages) + handler.Add("test", &authorization2.Policy{ Name: "test", - Spec: &authorization.PolicySpec{ + Spec: &authorization2.PolicySpec{ Action: "allow", }, }) @@ -246,14 +244,14 @@ func TestStorage_PreNotify(t *testing.T) { recvChan: make(chan recvResult, 1), } - storage.Connected(&rule.Endpoint{ + storages.Connected(&endpoint.Endpoint{ ID: "test", }, fake) fake.recvChan <- recvResult{ - request: &connection.ObserveRequest{ + request: &storage.ObserveRequest{ Nonce: "", - Type: authorization.RuleType, + Type: storage.Authorization, }, err: nil, } @@ -262,7 +260,7 @@ func TestStorage_PreNotify(t *testing.T) { return len(fake.sends) == 1 }, 10*time.Second, time.Millisecond) - if fake.sends[0].Type != authorization.RuleType { + if fake.sends[0].Type != storage.Authorization { t.Error("expected rule type") } @@ -274,7 +272,7 @@ func TestStorage_PreNotify(t *testing.T) { t.Error("expected data") } - if fake.sends[0].Data.Type() != authorization.RuleType { + if fake.sends[0].Data.Type() != storage.Authorization { t.Error("expected rule type") } @@ -287,17 +285,17 @@ func TestStorage_PreNotify(t *testing.T) { } fake.recvChan <- recvResult{ - request: &connection.ObserveRequest{ + request: &storage.ObserveRequest{ Nonce: fake.sends[0].Nonce, - Type: authorization.RuleType, + Type: storage.Authorization, }, err: nil, } - conn := storage.Connection[0] + conn := storages.Connection[0] assert.Eventually(t, func() bool { - return conn.ClientRules[authorization.RuleType].PushingStatus == connection.Pushed + return conn.ClientRules[storage.Authorization].PushingStatus == storage.Pushed }, 10*time.Second, time.Millisecond) fake.recvChan <- recvResult{ @@ -313,7 +311,7 @@ func TestStorage_PreNotify(t *testing.T) { t.Error("expected type listened") } - if !conn.TypeListened[authorization.RuleType] { + if !conn.TypeListened[storage.Authorization] { t.Error("expected type listened") } } @@ -321,35 +319,35 @@ func TestStorage_PreNotify(t *testing.T) { func TestStorage_AfterNotify(t *testing.T) { t.Parallel() - storage := connection.NewStorage() + store := storage.NewStorage() - handler := authorization.NewHandler(storage) + handler := authorization2.NewHandler(store) fake := &fakeConnection{ recvChan: make(chan recvResult, 1), } - storage.Connected(&rule.Endpoint{ + store.Connected(&endpoint.Endpoint{ ID: "test", }, fake) fake.recvChan <- recvResult{ - request: &connection.ObserveRequest{ + request: &storage.ObserveRequest{ Nonce: "", - Type: authorization.RuleType, + Type: storage.Authorization, }, err: nil, } - conn := storage.Connection[0] + conn := store.Connection[0] assert.Eventually(t, func() bool { - return conn.TypeListened[authorization.RuleType] + return conn.TypeListened[storage.Authorization] }, 10*time.Second, time.Millisecond) - handler.Add("test", &authorization.Policy{ + handler.Add("test", &authorization2.Policy{ Name: "test", - Spec: &authorization.PolicySpec{ + Spec: &authorization2.PolicySpec{ Action: "allow", }, }) @@ -358,7 +356,7 @@ func TestStorage_AfterNotify(t *testing.T) { return len(fake.sends) == 1 }, 10*time.Second, time.Millisecond) - if fake.sends[0].Type != authorization.RuleType { + if fake.sends[0].Type != storage.Authorization { t.Error("expected rule type") } @@ -370,7 +368,7 @@ func TestStorage_AfterNotify(t *testing.T) { t.Error("expected data") } - if fake.sends[0].Data.Type() != authorization.RuleType { + if fake.sends[0].Data.Type() != storage.Authorization { t.Error("expected rule type") } @@ -383,15 +381,15 @@ func TestStorage_AfterNotify(t *testing.T) { } fake.recvChan <- recvResult{ - request: &connection.ObserveRequest{ + request: &storage.ObserveRequest{ Nonce: fake.sends[0].Nonce, - Type: authorization.RuleType, + Type: storage.Authorization, }, err: nil, } assert.Eventually(t, func() bool { - return conn.ClientRules[authorization.RuleType].PushingStatus == connection.Pushed + return conn.ClientRules[storage.Authorization].PushingStatus == storage.Pushed }, 10*time.Second, time.Millisecond) fake.recvChan <- recvResult{ @@ -407,7 +405,7 @@ func TestStorage_AfterNotify(t *testing.T) { t.Error("expected type listened") } - if !conn.TypeListened[authorization.RuleType] { + if !conn.TypeListened[storage.Authorization] { t.Error("expected type listened") } } @@ -415,43 +413,43 @@ func TestStorage_AfterNotify(t *testing.T) { func TestStorage_MissNotify(t *testing.T) { t.Parallel() - storage := connection.NewStorage() + store := storage.NewStorage() - handler1 := authorization.NewHandler(storage) - handler2 := authentication.NewHandler(storage) + handler1 := authorization2.NewHandler(store) + handler2 := authentication2.NewHandler(store) fake := &fakeConnection{ recvChan: make(chan recvResult, 1), } - storage.Connected(&rule.Endpoint{ + store.Connected(&endpoint.Endpoint{ ID: "test", }, fake) fake.recvChan <- recvResult{ - request: &connection.ObserveRequest{ + request: &storage.ObserveRequest{ Nonce: "", - Type: authorization.RuleType, + Type: storage.Authorization, }, err: nil, } - conn := storage.Connection[0] + conn := store.Connection[0] assert.Eventually(t, func() bool { - return conn.TypeListened[authorization.RuleType] + return conn.TypeListened[storage.Authorization] }, 10*time.Second, time.Millisecond) - handler1.Add("test", &authorization.Policy{ + handler1.Add("test", &authorization2.Policy{ Name: "test", - Spec: &authorization.PolicySpec{ + Spec: &authorization2.PolicySpec{ Action: "allow", }, }) - handler2.Add("test", &authentication.Policy{ + handler2.Add("test", &authentication2.Policy{ Name: "test", - Spec: &authentication.PolicySpec{ + Spec: &authentication2.PolicySpec{ Action: "allow", }, }) @@ -460,7 +458,7 @@ func TestStorage_MissNotify(t *testing.T) { return len(fake.sends) == 1 }, 10*time.Second, time.Millisecond) - if fake.sends[0].Type != authorization.RuleType { + if fake.sends[0].Type != storage.Authorization { t.Error("expected rule type") } @@ -472,7 +470,7 @@ func TestStorage_MissNotify(t *testing.T) { t.Error("expected data") } - if fake.sends[0].Data.Type() != authorization.RuleType { + if fake.sends[0].Data.Type() != storage.Authorization { t.Error("expected rule type") } @@ -485,15 +483,15 @@ func TestStorage_MissNotify(t *testing.T) { } fake.recvChan <- recvResult{ - request: &connection.ObserveRequest{ + request: &storage.ObserveRequest{ Nonce: fake.sends[0].Nonce, - Type: authorization.RuleType, + Type: storage.Authorization, }, err: nil, } assert.Eventually(t, func() bool { - return conn.ClientRules[authorization.RuleType].PushingStatus == connection.Pushed + return conn.ClientRules[storage.Authorization].PushingStatus == storage.Pushed }, 10*time.Second, time.Millisecond) fake.recvChan <- recvResult{ @@ -509,7 +507,7 @@ func TestStorage_MissNotify(t *testing.T) { t.Error("expected type listened") } - if !conn.TypeListened[authorization.RuleType] { + if !conn.TypeListened[storage.Authorization] { t.Error("expected type listened") } @@ -525,33 +523,33 @@ type fakeOrigin struct { type errOrigin struct{} func (e errOrigin) Type() string { - return authorization.RuleType + return storage.Authorization } func (e errOrigin) Revision() int64 { return 1 } -func (e errOrigin) Exact(endpoint *rule.Endpoint) (rule.ToClient, error) { +func (e errOrigin) Exact(endpoint *endpoint.Endpoint) (storage.ToClient, error) { return nil, fmt.Errorf("test") } func (f *fakeOrigin) Type() string { - return authorization.RuleType + return storage.Authorization } func (f *fakeOrigin) Revision() int64 { return 1 } -func (f *fakeOrigin) Exact(endpoint *rule.Endpoint) (rule.ToClient, error) { +func (f *fakeOrigin) Exact(endpoint *endpoint.Endpoint) (storage.ToClient, error) { return &fakeToClient{}, nil } type fakeToClient struct{} func (f *fakeToClient) Type() string { - return authorization.RuleType + return storage.Authorization } func (f *fakeToClient) Revision() int64 { @@ -565,28 +563,28 @@ func (f *fakeToClient) Data() string { func TestStorage_MulitiNotify(t *testing.T) { t.Parallel() - storage := connection.NewStorage() + store := storage.NewStorage() fake := &fakeConnection{ recvChan: make(chan recvResult, 1), } - storage.Connected(&rule.Endpoint{ + store.Connected(&endpoint.Endpoint{ ID: "test", }, fake) fake.recvChan <- recvResult{ - request: &connection.ObserveRequest{ + request: &storage.ObserveRequest{ Nonce: "", - Type: authorization.RuleType, + Type: storage.Authorization, }, err: nil, } - conn := storage.Connection[0] + conn := store.Connection[0] assert.Eventually(t, func() bool { - return conn.TypeListened[authorization.RuleType] + return conn.TypeListened[storage.Authorization] }, 10*time.Second, time.Millisecond) // should err @@ -607,7 +605,7 @@ func TestStorage_MulitiNotify(t *testing.T) { return len(fake.sends) == 1 }, 10*time.Second, time.Millisecond) - if fake.sends[0].Type != authorization.RuleType { + if fake.sends[0].Type != storage.Authorization { t.Error("expected rule type") } @@ -619,7 +617,7 @@ func TestStorage_MulitiNotify(t *testing.T) { t.Error("expected data") } - if fake.sends[0].Data.Type() != authorization.RuleType { + if fake.sends[0].Data.Type() != storage.Authorization { t.Error("expected rule type") } @@ -632,18 +630,18 @@ func TestStorage_MulitiNotify(t *testing.T) { } assert.Eventually(t, func() bool { - return conn.ClientRules[authorization.RuleType].PushQueued + return conn.ClientRules[storage.Authorization].PushQueued }, 10*time.Second, time.Millisecond) fake.recvChan <- recvResult{ - request: &connection.ObserveRequest{ + request: &storage.ObserveRequest{ Nonce: fake.sends[0].Nonce, - Type: authorization.RuleType, + Type: storage.Authorization, }, err: nil, } assert.Eventually(t, func() bool { - return conn.ClientRules[authorization.RuleType].PushingStatus == connection.Pushed + return conn.ClientRules[storage.Authorization].PushingStatus == storage.Pushed }, 10*time.Second, time.Millisecond) assert.Eventually(t, func() bool { @@ -663,7 +661,7 @@ func TestStorage_MulitiNotify(t *testing.T) { t.Error("expected type listened") } - if !conn.TypeListened[authorization.RuleType] { + if !conn.TypeListened[storage.Authorization] { t.Error("expected type listened") } @@ -675,12 +673,12 @@ func TestStorage_MulitiNotify(t *testing.T) { func TestStorage_ReturnMisNonce(t *testing.T) { t.Parallel() - storage := connection.NewStorage() + store := storage.NewStorage() - handler := authorization.NewHandler(storage) - handler.Add("test", &authorization.Policy{ + handler := authorization2.NewHandler(store) + handler.Add("test", &authorization2.Policy{ Name: "test", - Spec: &authorization.PolicySpec{ + Spec: &authorization2.PolicySpec{ Action: "allow", }, }) @@ -689,14 +687,14 @@ func TestStorage_ReturnMisNonce(t *testing.T) { recvChan: make(chan recvResult, 1), } - storage.Connected(&rule.Endpoint{ + store.Connected(&endpoint.Endpoint{ ID: "test", }, fake) fake.recvChan <- recvResult{ - request: &connection.ObserveRequest{ + request: &storage.ObserveRequest{ Nonce: "", - Type: authorization.RuleType, + Type: storage.Authorization, }, err: nil, } @@ -705,7 +703,7 @@ func TestStorage_ReturnMisNonce(t *testing.T) { return len(fake.sends) == 1 }, 10*time.Second, time.Millisecond) - if fake.sends[0].Type != authorization.RuleType { + if fake.sends[0].Type != storage.Authorization { t.Error("expected rule type") } @@ -717,7 +715,7 @@ func TestStorage_ReturnMisNonce(t *testing.T) { t.Error("expected data") } - if fake.sends[0].Data.Type() != authorization.RuleType { + if fake.sends[0].Data.Type() != storage.Authorization { t.Error("expected rule type") } @@ -730,14 +728,14 @@ func TestStorage_ReturnMisNonce(t *testing.T) { } fake.recvChan <- recvResult{ - request: &connection.ObserveRequest{ + request: &storage.ObserveRequest{ Nonce: "test", - Type: authorization.RuleType, + Type: storage.Authorization, }, err: nil, } - conn := storage.Connection[0] + conn := store.Connection[0] fake.recvChan <- recvResult{ request: nil, @@ -752,11 +750,11 @@ func TestStorage_ReturnMisNonce(t *testing.T) { t.Error("expected type listened") } - if !conn.TypeListened[authorization.RuleType] { + if !conn.TypeListened[storage.Authorization] { t.Error("expected type listened") } - if conn.ClientRules[authorization.RuleType].PushingStatus == connection.Pushed { + if conn.ClientRules[storage.Authorization].PushingStatus == storage.Pushed { t.Error("expected not pushed") } } diff --git a/pkg/traffic/api/v1/conditionroute_types.go b/pkg/traffic/api/v1/conditionroute_types.go deleted file mode 100644 index 48a1f65ad..000000000 --- a/pkg/traffic/api/v1/conditionroute_types.go +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package v1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - "github.com/apache/dubbo-admin/pkg/admin/model" -) - -// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! -// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. - -// ConditionRouteSpec defines the desired state of ConditionRoute -type ConditionRouteSpec struct { - // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster - // Important: Run "make" to regenerate code after modifying this file - - ConditionRoute model.ConditionRoute `json:"ConditionRoute"` -} - -// ConditionRouteStatus defines the observed state of ConditionRoute -type ConditionRouteStatus struct { - // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster - // Important: Run "make" to regenerate code after modifying this file -} - -//+kubebuilder:object:root=true -//+kubebuilder:subresource:status - -// ConditionRoute is the Schema for the conditionroutes API -type ConditionRoute struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec ConditionRouteSpec `json:"spec,omitempty"` - Status ConditionRouteStatus `json:"status,omitempty"` -} - -//+kubebuilder:object:root=true - -// ConditionRouteList contains a list of ConditionRoute -type ConditionRouteList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []ConditionRoute `json:"items"` -} - -func init() { - SchemeBuilder.Register(&ConditionRoute{}, &ConditionRouteList{}) -} diff --git a/pkg/traffic/api/v1/dynamicconfig_types.go b/pkg/traffic/api/v1/dynamicconfig_types.go deleted file mode 100644 index 5dc648cc4..000000000 --- a/pkg/traffic/api/v1/dynamicconfig_types.go +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package v1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - "github.com/apache/dubbo-admin/pkg/admin/model" -) - -// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! -// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. - -// DynamicConfigSpec defines the desired state of DynamicConfig -type DynamicConfigSpec struct { - // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster - // Important: Run "make" to regenerate code after modifying this file - - DynamicConfig model.Override `json:"DynamicConfig"` -} - -// DynamicConfigStatus defines the observed state of DynamicConfig -type DynamicConfigStatus struct { - // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster - // Important: Run "make" to regenerate code after modifying this file -} - -//+kubebuilder:object:root=true -//+kubebuilder:subresource:status - -// DynamicConfig is the Schema for the dynamicconfigs API -type DynamicConfig struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec DynamicConfigSpec `json:"spec,omitempty"` - Status DynamicConfigStatus `json:"status,omitempty"` -} - -//+kubebuilder:object:root=true - -// DynamicConfigList contains a list of DynamicConfig -type DynamicConfigList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []DynamicConfig `json:"items"` -} - -func init() { - SchemeBuilder.Register(&DynamicConfig{}, &DynamicConfigList{}) -} diff --git a/pkg/traffic/api/v1/groupversion_info.go b/pkg/traffic/api/v1/groupversion_info.go deleted file mode 100644 index b87523fc8..000000000 --- a/pkg/traffic/api/v1/groupversion_info.go +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// Package v1 contains API Schema definitions for the traffic v1 API group -// +kubebuilder:object:generate=true -// +groupName=traffic.dubbo.apache.org -package v1 - -import ( - "k8s.io/apimachinery/pkg/runtime/schema" - "sigs.k8s.io/controller-runtime/pkg/scheme" -) - -var ( - // GroupVersion is group version used to register these objects - GroupVersion = schema.GroupVersion{Group: "traffic.dubbo.apache.org", Version: "v1"} - - // SchemeBuilder is used to add go types to the GroupVersionKind scheme - SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} - - // AddToScheme adds the types in this group-version to the given scheme. - AddToScheme = SchemeBuilder.AddToScheme -) diff --git a/pkg/traffic/api/v1/tagroute_types.go b/pkg/traffic/api/v1/tagroute_types.go deleted file mode 100644 index f1be8ec77..000000000 --- a/pkg/traffic/api/v1/tagroute_types.go +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package v1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - "github.com/apache/dubbo-admin/pkg/admin/model" -) - -// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! -// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. - -// TagRouteSpec defines the desired state of TagRoute -type TagRouteSpec struct { - // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster - // Important: Run "make" to regenerate code after modifying this file - - TagRoute model.TagRoute `json:"TagRoute"` -} - -// TagRouteStatus defines the observed state of TagRoute -type TagRouteStatus struct { - // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster - // Important: Run "make" to regenerate code after modifying this file -} - -//+kubebuilder:object:root=true -//+kubebuilder:subresource:status - -// TagRoute is the Schema for the tagroutes API -type TagRoute struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec TagRouteSpec `json:"spec,omitempty"` - Status TagRouteStatus `json:"status,omitempty"` -} - -//+kubebuilder:object:root=true - -// TagRouteList contains a list of TagRoute -type TagRouteList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []TagRoute `json:"items"` -} - -func init() { - SchemeBuilder.Register(&TagRoute{}, &TagRouteList{}) -} diff --git a/pkg/traffic/api/v1/zz_generated.deepcopy.go b/pkg/traffic/api/v1/zz_generated.deepcopy.go deleted file mode 100644 index 9179c8b17..000000000 --- a/pkg/traffic/api/v1/zz_generated.deepcopy.go +++ /dev/null @@ -1,294 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// Code generated by controller-gen. DO NOT EDIT. - -package v1 - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ConditionRoute) DeepCopyInto(out *ConditionRoute) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - out.Status = in.Status -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConditionRoute. -func (in *ConditionRoute) DeepCopy() *ConditionRoute { - if in == nil { - return nil - } - out := new(ConditionRoute) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ConditionRoute) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ConditionRouteList) DeepCopyInto(out *ConditionRouteList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ConditionRoute, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConditionRouteList. -func (in *ConditionRouteList) DeepCopy() *ConditionRouteList { - if in == nil { - return nil - } - out := new(ConditionRouteList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ConditionRouteList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ConditionRouteSpec) DeepCopyInto(out *ConditionRouteSpec) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConditionRouteSpec. -func (in *ConditionRouteSpec) DeepCopy() *ConditionRouteSpec { - if in == nil { - return nil - } - out := new(ConditionRouteSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ConditionRouteStatus) DeepCopyInto(out *ConditionRouteStatus) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConditionRouteStatus. -func (in *ConditionRouteStatus) DeepCopy() *ConditionRouteStatus { - if in == nil { - return nil - } - out := new(ConditionRouteStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DynamicConfig) DeepCopyInto(out *DynamicConfig) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - out.Status = in.Status -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DynamicConfig. -func (in *DynamicConfig) DeepCopy() *DynamicConfig { - if in == nil { - return nil - } - out := new(DynamicConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *DynamicConfig) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DynamicConfigList) DeepCopyInto(out *DynamicConfigList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]DynamicConfig, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DynamicConfigList. -func (in *DynamicConfigList) DeepCopy() *DynamicConfigList { - if in == nil { - return nil - } - out := new(DynamicConfigList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *DynamicConfigList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DynamicConfigSpec) DeepCopyInto(out *DynamicConfigSpec) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DynamicConfigSpec. -func (in *DynamicConfigSpec) DeepCopy() *DynamicConfigSpec { - if in == nil { - return nil - } - out := new(DynamicConfigSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DynamicConfigStatus) DeepCopyInto(out *DynamicConfigStatus) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DynamicConfigStatus. -func (in *DynamicConfigStatus) DeepCopy() *DynamicConfigStatus { - if in == nil { - return nil - } - out := new(DynamicConfigStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *TagRoute) DeepCopyInto(out *TagRoute) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - out.Status = in.Status -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TagRoute. -func (in *TagRoute) DeepCopy() *TagRoute { - if in == nil { - return nil - } - out := new(TagRoute) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *TagRoute) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *TagRouteList) DeepCopyInto(out *TagRouteList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]TagRoute, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TagRouteList. -func (in *TagRouteList) DeepCopy() *TagRouteList { - if in == nil { - return nil - } - out := new(TagRouteList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *TagRouteList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *TagRouteSpec) DeepCopyInto(out *TagRouteSpec) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TagRouteSpec. -func (in *TagRouteSpec) DeepCopy() *TagRouteSpec { - if in == nil { - return nil - } - out := new(TagRouteSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *TagRouteStatus) DeepCopyInto(out *TagRouteStatus) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TagRouteStatus. -func (in *TagRouteStatus) DeepCopy() *TagRouteStatus { - if in == nil { - return nil - } - out := new(TagRouteStatus) - in.DeepCopyInto(out) - return out -} diff --git a/pkg/traffic/client/client.go b/pkg/traffic/client/client.go deleted file mode 100644 index 6d5cdcf4a..000000000 --- a/pkg/traffic/client/client.go +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package client - -import ( - "context" - "sync" - - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/credentials/insecure" - "google.golang.org/grpc/status" -) - -type Client struct { - Watcher - - conn *grpc.ClientConn - - cfg *Config - mu *sync.RWMutex - - ctx context.Context - cancel context.CancelFunc -} - -func New(cfg *Config) (*Client, error) { - if cfg == nil { - cfg = &Config{} - } - baseCtx := context.TODO() - if cfg.Context != nil { - baseCtx = cfg.Context - } - ctx, cancel := context.WithCancel(baseCtx) - client := &Client{ - conn: nil, - cfg: cfg, - mu: new(sync.RWMutex), - ctx: ctx, - cancel: cancel, - } - conn, err := grpc.DialContext(ctx, cfg.Endpoints, grpc.WithTransportCredentials(insecure.NewCredentials())) - if err != nil { - return nil, err - } - - client.conn = conn - client.Watcher = NewWatcher(client) - - return client, nil -} - -// Close shuts down the client's etcd connections. -func (c *Client) Close() error { - c.cancel() - if c.Watcher != nil { - c.Watcher.Close() - } - if c.conn != nil { - return toErr(c.ctx, c.conn.Close()) - } - return c.ctx.Err() -} - -func toErr(ctx context.Context, err error) error { - if err == nil { - return nil - } - if ev, ok := status.FromError(err); ok { - code := ev.Code() - switch code { - case codes.DeadlineExceeded: - fallthrough - case codes.Canceled: - if ctx.Err() != nil { - err = ctx.Err() - } - } - } - return err -} - -// isHaltErr returns true if the given error and context indicate no forward -// progress can be made, even after reconnecting. -func isHaltErr(ctx context.Context, err error) bool { - if ctx != nil && ctx.Err() != nil { - return true - } - if err == nil { - return false - } - ev, _ := status.FromError(err) - // Unavailable codes mean the system will be right back. - // (e.g., can't connect, lost leader) - // Treat Internal codes as if something failed, leaving the - // system in an inconsistent state, but retrying could make progress. - // (e.g., failed in middle of send, corrupted frame) - // TODO: are permanent Internal errors possible from grpc? - return ev.Code() != codes.Unavailable && ev.Code() != codes.Internal -} diff --git a/pkg/traffic/client/watch.go b/pkg/traffic/client/watch.go deleted file mode 100644 index 601cff1a2..000000000 --- a/pkg/traffic/client/watch.go +++ /dev/null @@ -1,802 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package client - -import ( - "context" - "errors" - "fmt" - "log" - "sync" - "time" - - "google.golang.org/grpc" - "google.golang.org/grpc/metadata" - - "github.com/apache/dubbo-admin/pkg/logger" - pb2 "github.com/apache/dubbo-admin/pkg/traffic/internal/pb" -) - -const ( - closeSendErrTimeout = 250 * time.Millisecond - - // AutoWatchID is the watcher ID passed in WatchStream.Watch when no - // user-provided ID is available. If pass, an ID will automatically be assigned. - AutoWatchID = 0 - - // InvalidWatchID represents an invalid watch ID and prevents duplication with an existing watch. - InvalidWatchID = -1 -) - -type Event pb2.Event - -type WatchChan <-chan WatchResponse - -type Watcher interface { - Watch(ctx context.Context, key string) WatchChan - - GetRule(key string) string - - Close() error -} - -type watchStreamRequest interface { - toPB() *pb2.WatchRequest -} - -// toPB converts an internal watch request structure to its protobuf WatchRequest structure. -func (wr *watchRequest) toPB() *pb2.WatchRequest { - req := &pb2.WatchCreateRequest{ - Key: []byte(wr.key), - } - cr := &pb2.WatchRequest_CreateRequest{CreateRequest: req} - return &pb2.WatchRequest{RequestUnion: cr} -} - -func streamKeyFromCtx(ctx context.Context) string { - if md, ok := metadata.FromOutgoingContext(ctx); ok { - return fmt.Sprintf("%+v", md) - } - return "" -} - -type watcher struct { - remote pb2.WatchClient - - callOpts []grpc.CallOption - - mu sync.RWMutex - - streams map[string]*watchGrpcStream -} - -type watchGrpcStream struct { - owner *watcher - remote pb2.WatchClient - callOpts []grpc.CallOption - - ctx context.Context - ctxKey string - cancel context.CancelFunc - - substreams map[int64]*watcherStream - - resuming []*watcherStream - - reqc chan watchStreamRequest - respc chan *pb2.WatchResponse - donec chan struct{} - errc chan error - closingc chan *watcherStream - wg sync.WaitGroup - - resumec chan struct{} - closeErr error -} - -type watcherStream struct { - initReq watchRequest - - outc chan WatchResponse - recvc chan *WatchResponse - donec chan struct{} - closing bool - - // watcher id - id int64 - - buf []*WatchResponse -} - -type watchRequest struct { - ctx context.Context - key string - - retc chan chan WatchResponse -} - -type WatchResponse struct { - Events []*Event - - // Canceled is used to indicate watch failure. - // If the watch failed and the stream was about to close, before the channel is closed, - // the channel sends a final response that has Canceled set to true with a non-nil Err(). - Canceled bool - - // Created is used to indicate the creation of the watcher. - Created bool - - closeErr error - - // cancelReason is a reason of canceling watch - cancelReason string -} - -func NewWatcher(c *Client) Watcher { - return NewWatchFromWatchClient(pb2.NewWatchClient(c.conn), c) -} - -func NewWatchFromWatchClient(wc pb2.WatchClient, c *Client) Watcher { - w := &watcher{ - remote: wc, - streams: make(map[string]*watchGrpcStream), - } - return w -} - -// never closes -var valCtxCh = make(chan struct{}) -var zeroTime = time.Unix(0, 0) - -// ctx with only the values; never Done -type valCtx struct{ context.Context } - -func (vc *valCtx) Deadline() (time.Time, bool) { return zeroTime, false } -func (vc *valCtx) Done() <-chan struct{} { return valCtxCh } -func (vc *valCtx) Err() error { return nil } - -// unicastResponse sends a watch response to a specific watch substream. -func (w *watchGrpcStream) unicastResponse(wr *WatchResponse, watchId int64) bool { - ws, ok := w.substreams[watchId] - if !ok { - return false - } - select { - case ws.recvc <- wr: - case <-ws.donec: - return false - } - return true -} - -// broadcastResponse send a watch response to all watch substreams. -func (w *watchGrpcStream) broadcastResponse(wr *WatchResponse) bool { - for _, ws := range w.substreams { - select { - case ws.recvc <- wr: - case <-ws.donec: - } - } - return true -} - -func (w *watchGrpcStream) dispatchEvent(pbresp *pb2.WatchResponse) bool { - events := make([]*Event, len(pbresp.Events)) - for i, ev := range pbresp.Events { - events[i] = (*Event)(ev) - } - wr := &WatchResponse{ - Events: events, - Created: pbresp.Created, - Canceled: pbresp.Canceled, - cancelReason: pbresp.CancelReason, - } - - // watch IDs are zero indexed, so request notify watch responses are assigned a watch ID of InvalidWatchID to - // indicate they should be broadcast. - if pbresp.WatchId == InvalidWatchID { - return w.broadcastResponse(wr) - } - - return w.unicastResponse(wr, pbresp.WatchId) - -} - -func (w *watchGrpcStream) openWatchClient() (ws pb2.Watch_WatchClient, err error) { - for { - select { - case <-w.ctx.Done(): - if err == nil { - return nil, w.ctx.Err() - } - return nil, err - default: - } - if ws, err = w.remote.Watch(w.ctx, w.callOpts...); ws != nil && err == nil { - break - } - } - return ws, nil -} - -// joinSubstreams waits for all substream goroutines to complete. -func (w *watchGrpcStream) joinSubstreams() { - for _, ws := range w.substreams { - <-ws.donec - } - for _, ws := range w.resuming { - if ws != nil { - <-ws.donec - } - } -} - -func (w *watchGrpcStream) waitCancelSubstreams(stopc <-chan struct{}) <-chan struct{} { - var wg sync.WaitGroup - wg.Add(len(w.resuming)) - donec := make(chan struct{}) - for i := range w.resuming { - go func(ws *watcherStream) { - defer wg.Done() - if ws.closing { - if ws.initReq.ctx.Err() != nil && ws.outc != nil { - close(ws.outc) - ws.outc = nil - } - return - } - select { - case <-ws.initReq.ctx.Done(): - // closed ws will be removed from resuming - ws.closing = true - close(ws.outc) - ws.outc = nil - w.wg.Add(1) - go func() { - defer w.wg.Done() - w.closingc <- ws - }() - case <-stopc: - } - }(w.resuming[i]) - } - go func() { - defer close(donec) - wg.Wait() - }() - return donec -} - -func (w *watchGrpcStream) newWatchClient() (pb2.Watch_WatchClient, error) { - // mark all substreams as resuming - close(w.resumec) - w.resumec = make(chan struct{}) - w.joinSubstreams() - for _, ws := range w.substreams { - ws.id = InvalidWatchID - w.resuming = append(w.resuming, ws) - } - // strip out nils, if any - var resuming []*watcherStream - for _, ws := range w.resuming { - if ws != nil { - resuming = append(resuming, ws) - } - } - w.resuming = resuming - w.substreams = make(map[int64]*watcherStream) - - // connect to grpc stream while accepting watcher cancelation - stopc := make(chan struct{}) - donec := w.waitCancelSubstreams(stopc) - wc, err := w.openWatchClient() - close(stopc) - <-donec - - // serve all non-closing streams, even if there's a client error - // so that the teardown path can shutdown the streams as expected. - for _, ws := range w.resuming { - if ws.closing { - continue - } - ws.donec = make(chan struct{}) - w.wg.Add(1) - go w.serveSubstream(ws, w.resumec) - } - - if err != nil { - return nil, err - } - - // receive data from new grpc stream - go w.serveWatchClient(wc) - return wc, nil -} - -// serveWatchClient forwards messages from the grpc stream to run() -func (w *watchGrpcStream) serveWatchClient(wc pb2.Watch_WatchClient) { - for { - resp, err := wc.Recv() - if err != nil { - select { - case w.errc <- err: - case <-w.donec: - } - return - } - select { - case w.respc <- resp: - case <-w.donec: - return - } - } -} - -// serveSubstream forwards watch responses from run() to the subscriber -func (w *watchGrpcStream) serveSubstream(ws *watcherStream, resumec chan struct{}) { - if ws.closing { - panic("created substream goroutine but substream is closing") - } - - resuming := false - defer func() { - if !resuming { - ws.closing = true - } - close(ws.donec) - if !resuming { - w.closingc <- ws - } - w.wg.Done() - }() - - emptyWr := &WatchResponse{} - for { - curWr := emptyWr - outc := ws.outc - - if len(ws.buf) > 0 { - curWr = ws.buf[0] - } else { - outc = nil - } - select { - case outc <- *curWr: - if ws.buf[0].Err() != nil { - return - } - ws.buf[0] = nil - ws.buf = ws.buf[1:] - case wr, ok := <-ws.recvc: - if !ok { - // shutdown from closeSubstream - return - } - - if wr.Created { - if ws.initReq.retc != nil { - ws.initReq.retc <- ws.outc - // to prevent next write from taking the slot in buffered channel - // and posting duplicate create events - ws.initReq.retc = nil - - // ws.outc <- *wr - } - } - - // created event is already sent above, - // watcher should not post duplicate events - if wr.Created { - continue - } - - ws.buf = append(ws.buf, wr) - case <-w.ctx.Done(): - return - case <-ws.initReq.ctx.Done(): - return - case <-resumec: - resuming = true - return - } - } - // lazily send cancel message if events on missing id -} - -// Err is the error value if this WatchResponse holds an error. -func (wr *WatchResponse) Err() error { - switch { - case wr.closeErr != nil: - return wr.closeErr - case wr.Canceled: - if len(wr.cancelReason) != 0 { - return errors.New(wr.cancelReason) - } - return wr.Err() - } - return nil -} - -func (w *watcher) Close() (err error) { - w.mu.Lock() - streams := w.streams - w.streams = nil - w.mu.Unlock() - for _, wgs := range streams { - if werr := wgs.close(); werr != nil { - err = werr - } - } - // Consider context.Canceled as a successful close - if err == context.Canceled { - err = nil - } - return err -} - -func (w *watchGrpcStream) close() (err error) { - w.cancel() - <-w.donec - select { - case err = <-w.errc: - default: - } - return toErr(w.ctx, err) -} - -func (w *watchGrpcStream) addSubstream(resp *pb2.WatchResponse, ws *watcherStream) { - // check watch ID for backward compatibility (<= v3.3) - if resp.WatchId == InvalidWatchID || (resp.Canceled && resp.CancelReason != "") { - w.closeErr = errors.New(resp.CancelReason) - // failed; no channel - close(ws.recvc) - return - } - ws.id = resp.WatchId - w.substreams[ws.id] = ws -} - -func (w *watchGrpcStream) sendCloseSubstream(ws *watcherStream, resp *WatchResponse) { - select { - case ws.outc <- *resp: - case <-ws.initReq.ctx.Done(): - case <-time.After(closeSendErrTimeout): - } - close(ws.outc) -} - -func (w *watchGrpcStream) closeSubstream(ws *watcherStream) { - // send channel response in case stream was never established - select { - case ws.initReq.retc <- ws.outc: - default: - } - // close subscriber's channel - if closeErr := w.closeErr; closeErr != nil && ws.initReq.ctx.Err() == nil { - go w.sendCloseSubstream(ws, &WatchResponse{Canceled: true, closeErr: w.closeErr}) - } else if ws.outc != nil { - close(ws.outc) - } - if ws.id != InvalidWatchID { - delete(w.substreams, ws.id) - return - } - for i := range w.resuming { - if w.resuming[i] == ws { - w.resuming[i] = nil - return - } - } -} - -func (w *watcher) Watch(ctx context.Context, key string) WatchChan { - wr := &watchRequest{ - ctx: ctx, - key: key, - retc: make(chan chan WatchResponse, 1), - } - - ok := false - ctxKey := streamKeyFromCtx(ctx) - log.Println(ctxKey) - - var closeCh chan WatchResponse - for { - // find or allocate appropriate grpc watch stream - w.mu.Lock() - if w.streams == nil { - // closed - w.mu.Unlock() - ch := make(chan WatchResponse) - close(ch) - return ch - } - wgs := w.streams[ctxKey] - if wgs == nil { - wgs = w.newWatcherGrpcStream(ctx) - w.streams[ctxKey] = wgs - } - donec := wgs.donec - reqc := wgs.reqc - w.mu.Unlock() - - // couldn't create channel; return closed channel - if closeCh == nil { - closeCh = make(chan WatchResponse, 1) - } - - // submit request - select { - case reqc <- wr: - ok = true - case <-wr.ctx.Done(): - ok = false - case <-donec: - ok = false - if wgs.closeErr != nil { - closeCh <- WatchResponse{Canceled: true, closeErr: wgs.closeErr} - break - } - // retry; may have dropped stream from no ctxs - continue - } - - // receive channel - if ok { - select { - case ret := <-wr.retc: - return ret - case <-ctx.Done(): - case <-donec: - if wgs.closeErr != nil { - closeCh <- WatchResponse{Canceled: true, closeErr: wgs.closeErr} - break - } - // retry; may have dropped stream from no ctxs - continue - } - } - break - } - - close(closeCh) - return closeCh -} - -func (w *watcher) GetRule(key string) string { - rule, err := w.remote.GetRule(context.Background(), &pb2.GetRuleRequest{Key: key}) - if err != nil { - panic("get rule failed") - } - return rule.Value -} - -func (w *watcher) newWatcherGrpcStream(inctx context.Context) *watchGrpcStream { - ctx, cancel := context.WithCancel(&valCtx{inctx}) - wgs := &watchGrpcStream{ - owner: w, - remote: w.remote, - callOpts: w.callOpts, - ctx: ctx, - ctxKey: streamKeyFromCtx(inctx), - cancel: cancel, - substreams: make(map[int64]*watcherStream), - respc: make(chan *pb2.WatchResponse), - reqc: make(chan watchStreamRequest), - donec: make(chan struct{}), - errc: make(chan error, 1), - closingc: make(chan *watcherStream), - resumec: make(chan struct{}), - } - go wgs.run() - return wgs -} - -func (w *watcher) closeStream(wgs *watchGrpcStream) { - w.mu.Lock() - close(wgs.donec) - wgs.cancel() - if w.streams != nil { - delete(w.streams, wgs.ctxKey) - } - w.mu.Unlock() -} - -func (w *watchGrpcStream) run() { - var wc pb2.Watch_WatchClient - var closeErr error - - // substreams marked to close but goroutine still running; needed for - // avoiding double-closing recvc on grpc stream teardown - closing := make(map[*watcherStream]struct{}) - - defer func() { - w.closeErr = closeErr - for _, ws := range w.substreams { - if _, ok := closing[ws]; !ok { - close(ws.recvc) - closing[ws] = struct{}{} - } - } - for _, ws := range w.resuming { - if _, ok := closing[ws]; ws != nil && !ok { - close(ws.recvc) - closing[ws] = struct{}{} - } - } - w.joinSubstreams() - for range closing { - w.closeSubstream(<-w.closingc) - } - w.wg.Wait() - w.owner.closeStream(w) - }() - - if wc, closeErr = w.newWatchClient(); closeErr != nil { - return - } - - cancelSet := make(map[int64]struct{}) - - var cur *pb2.WatchResponse - for { - select { - case req := <-w.reqc: - switch wreq := req.(type) { - case *watchRequest: - outc := make(chan WatchResponse, 1) - ws := &watcherStream{ - initReq: *wreq, - id: InvalidWatchID, - outc: outc, - // unbuffered so resumes won't cause repeat events - recvc: make(chan *WatchResponse), - } - - ws.donec = make(chan struct{}) - w.wg.Add(1) - go w.serveSubstream(ws, w.resumec) - - // queue up for watcher creation/resume - w.resuming = append(w.resuming, ws) - if len(w.resuming) == 1 { - // head of resume queue, can register a new watcher - if err := wc.Send(ws.initReq.toPB()); err != nil { - logger.Sugar().Debug("error when sending request", err) - } - } - } - case pbresp := <-w.respc: - if cur == nil || pbresp.Created || pbresp.Canceled { - cur = pbresp - } else if cur != nil && cur.WatchId == pbresp.WatchId { - cur.Events = append(cur.Events, pbresp.Events...) - } - - switch { - case pbresp.Created: - // 把事件分配给对应的watch subStream - if ws := w.resuming[0]; ws != nil { - w.addSubstream(pbresp, ws) - w.dispatchEvent(pbresp) - w.resuming[0] = nil - } - - if ws := w.nextResume(); ws != nil { - if err := wc.Send(ws.initReq.toPB()); err != nil { - logger.Sugar().Debug("error when sending request", err) - } - } - - // reset for next iteration - cur = nil - - case pbresp.Canceled: - delete(cancelSet, pbresp.WatchId) - if ws, ok := w.substreams[pbresp.WatchId]; ok { - // signal to stream goroutine to update closingc - close(ws.recvc) - closing[ws] = struct{}{} - } - - // reset for next iteration - cur = nil - - default: - // dispatch to appropriate watch stream - ok := w.dispatchEvent(cur) - - // reset for next iteration - cur = nil - - if ok { - break - } - - if _, ok := cancelSet[pbresp.WatchId]; ok { - break - } - - cancelSet[pbresp.WatchId] = struct{}{} - cr := &pb2.WatchRequest_CancelRequest{ - CancelRequest: &pb2.WatchCancelRequest{ - WatchId: pbresp.WatchId, - }, - } - req := &pb2.WatchRequest{RequestUnion: cr} - if err := wc.Send(req); err != nil { - logger.Sugar().Debug("failed to send watch cancel request", pbresp.WatchId) - - } - } - - // watch client failed on Recv; spawn another if possible - case err := <-w.errc: - if isHaltErr(w.ctx, err) { - closeErr = err - return - } - if wc, closeErr = w.newWatchClient(); closeErr != nil { - return - } - if ws := w.nextResume(); ws != nil { - if err := wc.Send(ws.initReq.toPB()); err != nil { - logger.Sugar().Debug("error when sending request", err) - } - } - cancelSet = make(map[int64]struct{}) - - case <-w.ctx.Done(): - return - - case ws := <-w.closingc: - w.closeSubstream(ws) - delete(closing, ws) - // no more watchers on this stream, shutdown, skip cancellation - if len(w.substreams)+len(w.resuming) == 0 { - return - } - if ws.id != InvalidWatchID { - // client is closing an established watch; close it on the server proactively instead of waiting - // to close when the next message arrives - cancelSet[ws.id] = struct{}{} - cr := &pb2.WatchRequest_CancelRequest{ - CancelRequest: &pb2.WatchCancelRequest{ - WatchId: ws.id, - }, - } - req := &pb2.WatchRequest{RequestUnion: cr} - if err := wc.Send(req); err != nil { - logger.Sugar().Debug("failed to send watch cancel request", ws.id) - } - } - } - } -} - -// nextResume chooses the next resuming to register with the grpc stream. Abandoned -// streams are marked as nil in the queue since the head must wait for its inflight registration. -func (w *watchGrpcStream) nextResume() *watcherStream { - for len(w.resuming) != 0 { - if w.resuming[0] != nil { - return w.resuming[0] - } - w.resuming = w.resuming[1:len(w.resuming)] - } - return nil -} diff --git a/pkg/traffic/cmd/controller.go b/pkg/traffic/cmd/controller.go deleted file mode 100644 index a299b1512..000000000 --- a/pkg/traffic/cmd/controller.go +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package cmd - -import ( - "flag" - "os" - - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/healthz" - "sigs.k8s.io/controller-runtime/pkg/log/zap" - - "github.com/apache/dubbo-admin/pkg/traffic/internal/controller" -) - -func StartController() { - var metricsAddr string - var enableLeaderElection bool - var probeAddr string - flag.StringVar(&metricsAddr, "metrics-bind-address", ":8080", "The address the metric endpoint binds to.") - flag.StringVar(&probeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.") - flag.BoolVar(&enableLeaderElection, "leader-elect", false, - "Enable leader election for controller manager. "+ - "Enabling this will ensure there is only one active controller manager.") - opts := zap.Options{ - Development: true, - } - opts.BindFlags(flag.CommandLine) - flag.Parse() - - ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts))) - - mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{ - Scheme: scheme, - MetricsBindAddress: metricsAddr, - Port: 9443, - HealthProbeBindAddress: probeAddr, - LeaderElection: false, - LeaderElectionID: "333079c8.dubbo.apache.org", - // LeaderElectionReleaseOnCancel defines if the leader should step down voluntarily - // when the Manager ends. This requires the binary to immediately end when the - // Manager is stopped, otherwise, this setting is unsafe. Setting this significantly - // speeds up voluntary leader transitions as the new leader don't have to wait - // LeaseDuration time first. - // - // In the default scaffold provided, the program ends immediately after - // the manager stops, so would be fine to enable this option. However, - // if you are doing or is intended to do any operation such as perform cleanups - // after the manager stops then its usage might be unsafe. - // LeaderElectionReleaseOnCancel: true, - }) - if err != nil { - setupLog.Error(err, "unable to start manager") - os.Exit(1) - } - - if err = (&controller.TagRouteReconciler{ - Client: mgr.GetClient(), - Scheme: mgr.GetScheme(), - }).SetupWithManager(mgr); err != nil { - setupLog.Error(err, "unable to create controller", "controller", "TagRoute") - os.Exit(1) - } - if err = (&controller.ConditionRouteReconciler{ - Client: mgr.GetClient(), - Scheme: mgr.GetScheme(), - }).SetupWithManager(mgr); err != nil { - setupLog.Error(err, "unable to create controller", "controller", "ConditionRoute") - os.Exit(1) - } - if err = (&controller.DynamicConfigReconciler{ - Client: mgr.GetClient(), - Scheme: mgr.GetScheme(), - }).SetupWithManager(mgr); err != nil { - setupLog.Error(err, "unable to create controller", "controller", "DynamicConfig") - os.Exit(1) - } - //+kubebuilder:scaffold:builder - - if err := mgr.AddHealthzCheck("healthz", healthz.Ping); err != nil { - setupLog.Error(err, "unable to set up health check") - os.Exit(1) - } - if err := mgr.AddReadyzCheck("readyz", healthz.Ping); err != nil { - setupLog.Error(err, "unable to set up ready check") - os.Exit(1) - } - - setupLog.Info("starting manager") - if err := mgr.Start(ctrl.SetupSignalHandler()); err != nil { - setupLog.Error(err, "problem running manager") - os.Exit(1) - } -} diff --git a/pkg/traffic/cmd/start.go b/pkg/traffic/cmd/start.go deleted file mode 100644 index f34b7f79a..000000000 --- a/pkg/traffic/cmd/start.go +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package cmd - -import ( - "k8s.io/apimachinery/pkg/runtime" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" - clientgoscheme "k8s.io/client-go/kubernetes/scheme" - // Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.) - // to ensure that exec-entrypoint and run can make use of them. - _ "k8s.io/client-go/plugin/pkg/client/auth" - ctrl "sigs.k8s.io/controller-runtime" - //+kubebuilder:scaffold:imports - - trafficv1 "github.com/apache/dubbo-admin/pkg/traffic/api/v1" - "github.com/apache/dubbo-admin/pkg/traffic/cache" - "github.com/apache/dubbo-admin/pkg/traffic/internal/watchserver" -) - -var ( - scheme = runtime.NewScheme() - setupLog = ctrl.Log.WithName("setup") -) - -func init() { - cache.Init() - utilruntime.Must(clientgoscheme.AddToScheme(scheme)) - - utilruntime.Must(trafficv1.AddToScheme(scheme)) - //+kubebuilder:scaffold:scheme -} - -func Start() { - - gc := watchserver.RegisterGrpc() - defer func() { - gc.Stop() - }() - - StartController() -} diff --git a/pkg/traffic/config/crd/bases/traffic.dubbo.apache.org_dynamicconfigs.yaml b/pkg/traffic/config/crd/bases/traffic.dubbo.apache.org_dynamicconfigs.yaml deleted file mode 100644 index ce330432a..000000000 --- a/pkg/traffic/config/crd/bases/traffic.dubbo.apache.org_dynamicconfigs.yaml +++ /dev/null @@ -1,64 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.11.3 - creationTimestamp: null - name: dynamicconfigs.traffic.dubbo.apache.org -spec: - group: traffic.dubbo.apache.org - names: - kind: DynamicConfig - listKind: DynamicConfigList - plural: dynamicconfigs - singular: dynamicconfig - scope: Namespaced - versions: - - name: v1 - schema: - openAPIV3Schema: - description: DynamicConfig is the Schema for the dynamicconfigs API - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: DynamicConfigSpec defines the desired state of DynamicConfig - properties: - foo: - description: Foo is an example field of DynamicConfig. Edit dynamicconfig_types.go - to remove/update - type: string - type: object - status: - description: DynamicConfigStatus defines the observed state of DynamicConfig - type: object - type: object - served: true - storage: true - subresources: - status: {} diff --git a/pkg/traffic/config/crd/bases/traffic.dubbo.apache.org_tagroutes.yaml b/pkg/traffic/config/crd/bases/traffic.dubbo.apache.org_tagroutes.yaml deleted file mode 100644 index 5f3c40e38..000000000 --- a/pkg/traffic/config/crd/bases/traffic.dubbo.apache.org_tagroutes.yaml +++ /dev/null @@ -1,64 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.11.3 - creationTimestamp: null - name: tagroutes.traffic.dubbo.apache.org -spec: - group: traffic.dubbo.apache.org - names: - kind: TagRoute - listKind: TagRouteList - plural: tagroutes - singular: tagroute - scope: Namespaced - versions: - - name: v1 - schema: - openAPIV3Schema: - description: TagRoute is the Schema for the tagroutes API - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: TagRouteSpec defines the desired state of TagRoute - properties: - foo: - description: Foo is an example field of TagRoute. Edit tagroute_types.go - to remove/update - type: string - type: object - status: - description: TagRouteStatus defines the observed state of TagRoute - type: object - type: object - served: true - storage: true - subresources: - status: {} diff --git a/pkg/traffic/config/crd/kustomization.yaml b/pkg/traffic/config/crd/kustomization.yaml deleted file mode 100644 index 35c750506..000000000 --- a/pkg/traffic/config/crd/kustomization.yaml +++ /dev/null @@ -1,42 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# This kustomization.yaml is not intended to be run by itself, -# since it depends on service name and namespace that are out of this kustomize package. -# It should be run by config/default -resources: -- bases/traffic.dubbo.apache.org_tagroutes.yaml -- bases/traffic.dubbo.apache.org_conditionroutes.yaml -- bases/traffic.dubbo.apache.org_dynamicconfigs.yaml -#+kubebuilder:scaffold:crdkustomizeresource - -patchesStrategicMerge: -# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix. -# patches here are for enabling the conversion webhook for each CRD -#- patches/webhook_in_tagroutes.yaml -#- patches/webhook_in_conditionroutes.yaml -#- patches/webhook_in_dynamicconfigs.yaml -#+kubebuilder:scaffold:crdkustomizewebhookpatch - -# [CERTMANAGER] To enable cert-manager, uncomment all the sections with [CERTMANAGER] prefix. -# patches here are for enabling the CA injection for each CRD -#- patches/cainjection_in_tagroutes.yaml -#- patches/cainjection_in_conditionroutes.yaml -#- patches/cainjection_in_dynamicconfigs.yaml -#+kubebuilder:scaffold:crdkustomizecainjectionpatch - -# the following config is for teaching kustomize how to do kustomization for CRDs. -configurations: -- kustomizeconfig.yaml diff --git a/pkg/traffic/config/crd/patches/cainjection_in_conditionroutes.yaml b/pkg/traffic/config/crd/patches/cainjection_in_conditionroutes.yaml deleted file mode 100644 index 059b4baa1..000000000 --- a/pkg/traffic/config/crd/patches/cainjection_in_conditionroutes.yaml +++ /dev/null @@ -1,22 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# The following patch adds a directive for certmanager to inject CA into the CRD -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - cert-manager.io/inject-ca-from: CERTIFICATE_NAMESPACE/CERTIFICATE_NAME - name: conditionroutes.traffic.dubbo.apache.org diff --git a/pkg/traffic/config/crd/patches/cainjection_in_dynamicconfigs.yaml b/pkg/traffic/config/crd/patches/cainjection_in_dynamicconfigs.yaml deleted file mode 100644 index c2cf48d7f..000000000 --- a/pkg/traffic/config/crd/patches/cainjection_in_dynamicconfigs.yaml +++ /dev/null @@ -1,22 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# The following patch adds a directive for certmanager to inject CA into the CRD -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - cert-manager.io/inject-ca-from: CERTIFICATE_NAMESPACE/CERTIFICATE_NAME - name: dynamicconfigs.traffic.dubbo.apache.org diff --git a/pkg/traffic/config/crd/patches/cainjection_in_tagroutes.yaml b/pkg/traffic/config/crd/patches/cainjection_in_tagroutes.yaml deleted file mode 100644 index d0c62092b..000000000 --- a/pkg/traffic/config/crd/patches/cainjection_in_tagroutes.yaml +++ /dev/null @@ -1,22 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# The following patch adds a directive for certmanager to inject CA into the CRD -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - cert-manager.io/inject-ca-from: CERTIFICATE_NAMESPACE/CERTIFICATE_NAME - name: tagroutes.traffic.dubbo.apache.org diff --git a/pkg/traffic/config/crd/patches/webhook_in_conditionroutes.yaml b/pkg/traffic/config/crd/patches/webhook_in_conditionroutes.yaml deleted file mode 100644 index f7ca723a1..000000000 --- a/pkg/traffic/config/crd/patches/webhook_in_conditionroutes.yaml +++ /dev/null @@ -1,31 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# The following patch enables a conversion webhook for the CRD -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: conditionroutes.traffic.dubbo.apache.org -spec: - conversion: - strategy: Webhook - webhook: - clientConfig: - service: - namespace: system - name: webhook-service - path: /convert - conversionReviewVersions: - - v1 diff --git a/pkg/traffic/config/crd/patches/webhook_in_dynamicconfigs.yaml b/pkg/traffic/config/crd/patches/webhook_in_dynamicconfigs.yaml deleted file mode 100644 index e9ca04ef5..000000000 --- a/pkg/traffic/config/crd/patches/webhook_in_dynamicconfigs.yaml +++ /dev/null @@ -1,31 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# The following patch enables a conversion webhook for the CRD -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: dynamicconfigs.traffic.dubbo.apache.org -spec: - conversion: - strategy: Webhook - webhook: - clientConfig: - service: - namespace: system - name: webhook-service - path: /convert - conversionReviewVersions: - - v1 diff --git a/pkg/traffic/config/crd/patches/webhook_in_tagroutes.yaml b/pkg/traffic/config/crd/patches/webhook_in_tagroutes.yaml deleted file mode 100644 index 09c57c36b..000000000 --- a/pkg/traffic/config/crd/patches/webhook_in_tagroutes.yaml +++ /dev/null @@ -1,31 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# The following patch enables a conversion webhook for the CRD -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: tagroutes.traffic.dubbo.apache.org -spec: - conversion: - strategy: Webhook - webhook: - clientConfig: - service: - namespace: system - name: webhook-service - path: /convert - conversionReviewVersions: - - v1 diff --git a/pkg/traffic/config/default/kustomization.yaml b/pkg/traffic/config/default/kustomization.yaml deleted file mode 100644 index 5ed579a36..000000000 --- a/pkg/traffic/config/default/kustomization.yaml +++ /dev/null @@ -1,159 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Adds namespace to all resources. -namespace: dubbo-system - -# Value of this field is prepended to the -# names of all resources, e.g. a deployment named -# "wordpress" becomes "alices-wordpress". -# Note that it should also match with the prefix (text before '-') of the namespace -# field above. -namePrefix: dubbo- - -# Labels to add to all resources and selectors. -#labels: -#- includeSelectors: true -# pairs: -# someName: someValue - -resources: -- ../crd -- ../rbac -- ../manager -# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in -# crd/kustomization.yaml -#- ../webhook -# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'. 'WEBHOOK' components are required. -#- ../certmanager -# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'. -#- ../prometheus - -patchesStrategicMerge: -# Protect the /metrics endpoint by putting it behind auth. -# If you want your controller-manager to expose the /metrics -# endpoint w/o any authn/z, please comment the following line. -- manager_auth_proxy_patch.yaml - - - -# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in -# crd/kustomization.yaml -#- manager_webhook_patch.yaml - -# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'. -# Uncomment 'CERTMANAGER' sections in crd/kustomization.yaml to enable the CA injection in the admission webhooks. -# 'CERTMANAGER' needs to be enabled to use ca injection -#- webhookcainjection_patch.yaml - -# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER' prefix. -# Uncomment the following replacements to add the cert-manager CA injection annotations -#replacements: -# - source: # Add cert-manager annotation to ValidatingWebhookConfiguration, MutatingWebhookConfiguration and CRDs -# kind: Certificate -# group: cert-manager.io -# version: v1 -# name: serving-cert # this name should match the one in certificate.yaml -# fieldPath: .metadata.namespace # namespace of the certificate CR -# targets: -# - select: -# kind: ValidatingWebhookConfiguration -# fieldPaths: -# - .metadata.annotations.[cert-manager.io/inject-ca-from] -# options: -# delimiter: '/' -# index: 0 -# create: true -# - select: -# kind: MutatingWebhookConfiguration -# fieldPaths: -# - .metadata.annotations.[cert-manager.io/inject-ca-from] -# options: -# delimiter: '/' -# index: 0 -# create: true -# - select: -# kind: CustomResourceDefinition -# fieldPaths: -# - .metadata.annotations.[cert-manager.io/inject-ca-from] -# options: -# delimiter: '/' -# index: 0 -# create: true -# - source: -# kind: Certificate -# group: cert-manager.io -# version: v1 -# name: serving-cert # this name should match the one in certificate.yaml -# fieldPath: .metadata.name -# targets: -# - select: -# kind: ValidatingWebhookConfiguration -# fieldPaths: -# - .metadata.annotations.[cert-manager.io/inject-ca-from] -# options: -# delimiter: '/' -# index: 1 -# create: true -# - select: -# kind: MutatingWebhookConfiguration -# fieldPaths: -# - .metadata.annotations.[cert-manager.io/inject-ca-from] -# options: -# delimiter: '/' -# index: 1 -# create: true -# - select: -# kind: CustomResourceDefinition -# fieldPaths: -# - .metadata.annotations.[cert-manager.io/inject-ca-from] -# options: -# delimiter: '/' -# index: 1 -# create: true -# - source: # Add cert-manager annotation to the webhook Service -# kind: Service -# version: v1 -# name: webhook-service -# fieldPath: .metadata.name # namespace of the service -# targets: -# - select: -# kind: Certificate -# group: cert-manager.io -# version: v1 -# fieldPaths: -# - .spec.dnsNames.0 -# - .spec.dnsNames.1 -# options: -# delimiter: '.' -# index: 0 -# create: true -# - source: -# kind: Service -# version: v1 -# name: webhook-service -# fieldPath: .metadata.namespace # namespace of the service -# targets: -# - select: -# kind: Certificate -# group: cert-manager.io -# version: v1 -# fieldPaths: -# - .spec.dnsNames.0 -# - .spec.dnsNames.1 -# options: -# delimiter: '.' -# index: 1 -# create: true diff --git a/pkg/traffic/config/default/manager_auth_proxy_patch.yaml b/pkg/traffic/config/default/manager_auth_proxy_patch.yaml deleted file mode 100644 index 9e93ebf33..000000000 --- a/pkg/traffic/config/default/manager_auth_proxy_patch.yaml +++ /dev/null @@ -1,70 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# This patch inject a sidecar container which is a HTTP proxy for the -# controller manager, it performs RBAC authorization against the Kubernetes API using SubjectAccessReviews. -apiVersion: apps/v1 -kind: Deployment -metadata: - name: controller-manager - namespace: system -spec: - template: - spec: - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: kubernetes.io/arch - operator: In - values: - - amd64 - - arm64 - - ppc64le - - s390x - - key: kubernetes.io/os - operator: In - values: - - linux - containers: - - name: kube-rbac-proxy - securityContext: - allowPrivilegeEscalation: false - capabilities: - drop: - - "ALL" - image: gcr.io/kubebuilder/kube-rbac-proxy:v0.13.1 - args: - - "--secure-listen-address=0.0.0.0:8443" - - "--upstream=http://127.0.0.1:8080/" - - "--logtostderr=true" - - "--v=0" - ports: - - containerPort: 8443 - protocol: TCP - name: https - resources: - limits: - cpu: 500m - memory: 128Mi - requests: - cpu: 5m - memory: 64Mi - - name: manager - args: - - "--health-probe-bind-address=:8081" - - "--metrics-bind-address=127.0.0.1:8080" - - "--leader-elect" diff --git a/pkg/traffic/config/default/manager_config_patch.yaml b/pkg/traffic/config/default/manager_config_patch.yaml deleted file mode 100644 index ee26a4237..000000000 --- a/pkg/traffic/config/default/manager_config_patch.yaml +++ /dev/null @@ -1,24 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -apiVersion: apps/v1 -kind: Deployment -metadata: - name: controller-manager - namespace: system -spec: - template: - spec: - containers: - - name: manager diff --git a/pkg/traffic/config/manager/kustomization.yaml b/pkg/traffic/config/manager/kustomization.yaml deleted file mode 100644 index 1ef2c550c..000000000 --- a/pkg/traffic/config/manager/kustomization.yaml +++ /dev/null @@ -1,17 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -resources: -- manager.yaml diff --git a/pkg/traffic/config/manager/manager.yaml b/pkg/traffic/config/manager/manager.yaml deleted file mode 100644 index 945b1f99c..000000000 --- a/pkg/traffic/config/manager/manager.yaml +++ /dev/null @@ -1,117 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: v1 -kind: Namespace -metadata: - labels: - control-plane: controller-manager - app.kubernetes.io/name: namespace - app.kubernetes.io/instance: system - app.kubernetes.io/component: manager - app.kubernetes.io/created-by: dubbo - app.kubernetes.io/part-of: dubbo - app.kubernetes.io/managed-by: kustomize - name: system ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: controller-manager - namespace: system - labels: - control-plane: controller-manager - app.kubernetes.io/name: deployment - app.kubernetes.io/instance: controller-manager - app.kubernetes.io/component: manager - app.kubernetes.io/created-by: dubbo - app.kubernetes.io/part-of: dubbo - app.kubernetes.io/managed-by: kustomize -spec: - selector: - matchLabels: - control-plane: controller-manager - replicas: 1 - template: - metadata: - annotations: - kubectl.kubernetes.io/default-container: manager - labels: - control-plane: controller-manager - spec: - # TODO(user): Uncomment the following code to configure the nodeAffinity expression - # according to the platforms which are supported by your solution. - # It is considered best practice to support multiple architectures. You can - # build your manager image using the makefile target docker-buildx. - # affinity: - # nodeAffinity: - # requiredDuringSchedulingIgnoredDuringExecution: - # nodeSelectorTerms: - # - matchExpressions: - # - key: kubernetes.io/arch - # operator: In - # values: - # - amd64 - # - arm64 - # - ppc64le - # - s390x - # - key: kubernetes.io/os - # operator: In - # values: - # - linux - securityContext: - runAsNonRoot: true - # TODO(user): For common cases that do not require escalating privileges - # it is recommended to ensure that all your Pods/Containers are restrictive. - # More info: https://kubernetes.io/docs/concepts/security/pod-security-standards/#restricted - # Please uncomment the following code if your project does NOT have to work on old Kubernetes - # versions < 1.19 or on vendors versions which do NOT support this field by default (i.e. Openshift < 4.11 ). - # seccompProfile: - # type: RuntimeDefault - containers: - - command: - - /manager - args: - - --leader-elect - image: controller:latest - name: manager - securityContext: - allowPrivilegeEscalation: false - capabilities: - drop: - - "ALL" - livenessProbe: - httpGet: - path: /healthz - port: 8081 - initialDelaySeconds: 15 - periodSeconds: 20 - readinessProbe: - httpGet: - path: /readyz - port: 8081 - initialDelaySeconds: 5 - periodSeconds: 10 - # TODO(user): Configure the resources accordingly based on the project requirements. - # More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ - resources: - limits: - cpu: 500m - memory: 128Mi - requests: - cpu: 10m - memory: 64Mi - serviceAccountName: controller-manager - terminationGracePeriodSeconds: 10 diff --git a/pkg/traffic/config/prometheus/kustomization.yaml b/pkg/traffic/config/prometheus/kustomization.yaml deleted file mode 100644 index 0e67cbd68..000000000 --- a/pkg/traffic/config/prometheus/kustomization.yaml +++ /dev/null @@ -1,17 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -resources: -- monitor.yaml diff --git a/pkg/traffic/config/prometheus/monitor.yaml b/pkg/traffic/config/prometheus/monitor.yaml deleted file mode 100644 index 1864bf252..000000000 --- a/pkg/traffic/config/prometheus/monitor.yaml +++ /dev/null @@ -1,40 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Prometheus Monitor Service (Metrics) -apiVersion: monitoring.coreos.com/v1 -kind: ServiceMonitor -metadata: - labels: - control-plane: controller-manager - app.kubernetes.io/name: servicemonitor - app.kubernetes.io/instance: controller-manager-metrics-monitor - app.kubernetes.io/component: metrics - app.kubernetes.io/created-by: dubbo - app.kubernetes.io/part-of: dubbo - app.kubernetes.io/managed-by: kustomize - name: controller-manager-metrics-monitor - namespace: system -spec: - endpoints: - - path: /metrics - port: https - scheme: https - bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token - tlsConfig: - insecureSkipVerify: true - selector: - matchLabels: - control-plane: controller-manager diff --git a/pkg/traffic/config/rbac/auth_proxy_client_clusterrole.yaml b/pkg/traffic/config/rbac/auth_proxy_client_clusterrole.yaml deleted file mode 100644 index 5d1831f17..000000000 --- a/pkg/traffic/config/rbac/auth_proxy_client_clusterrole.yaml +++ /dev/null @@ -1,31 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - labels: - app.kubernetes.io/name: clusterrole - app.kubernetes.io/instance: metrics-reader - app.kubernetes.io/component: kube-rbac-proxy - app.kubernetes.io/created-by: dubbo - app.kubernetes.io/part-of: dubbo - app.kubernetes.io/managed-by: kustomize - name: metrics-reader -rules: -- nonResourceURLs: - - "/metrics" - verbs: - - get diff --git a/pkg/traffic/config/rbac/auth_proxy_role.yaml b/pkg/traffic/config/rbac/auth_proxy_role.yaml deleted file mode 100644 index ff1927afd..000000000 --- a/pkg/traffic/config/rbac/auth_proxy_role.yaml +++ /dev/null @@ -1,39 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - labels: - app.kubernetes.io/name: clusterrole - app.kubernetes.io/instance: proxy-role - app.kubernetes.io/component: kube-rbac-proxy - app.kubernetes.io/created-by: dubbo - app.kubernetes.io/part-of: dubbo - app.kubernetes.io/managed-by: kustomize - name: proxy-role -rules: -- apiGroups: - - authentication.k8s.io - resources: - - tokenreviews - verbs: - - create -- apiGroups: - - authorization.k8s.io - resources: - - subjectaccessreviews - verbs: - - create diff --git a/pkg/traffic/config/rbac/auth_proxy_role_binding.yaml b/pkg/traffic/config/rbac/auth_proxy_role_binding.yaml deleted file mode 100644 index 776e29338..000000000 --- a/pkg/traffic/config/rbac/auth_proxy_role_binding.yaml +++ /dev/null @@ -1,34 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - labels: - app.kubernetes.io/name: clusterrolebinding - app.kubernetes.io/instance: proxy-rolebinding - app.kubernetes.io/component: kube-rbac-proxy - app.kubernetes.io/created-by: dubbo - app.kubernetes.io/part-of: dubbo - app.kubernetes.io/managed-by: kustomize - name: proxy-rolebinding -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: proxy-role -subjects: -- kind: ServiceAccount - name: controller-manager - namespace: system diff --git a/pkg/traffic/config/rbac/auth_proxy_service.yaml b/pkg/traffic/config/rbac/auth_proxy_service.yaml deleted file mode 100644 index ddff7d431..000000000 --- a/pkg/traffic/config/rbac/auth_proxy_service.yaml +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: v1 -kind: Service -metadata: - labels: - control-plane: controller-manager - app.kubernetes.io/name: service - app.kubernetes.io/instance: controller-manager-metrics-service - app.kubernetes.io/component: kube-rbac-proxy - app.kubernetes.io/created-by: dubbo - app.kubernetes.io/part-of: dubbo - app.kubernetes.io/managed-by: kustomize - name: controller-manager-metrics-service - namespace: system -spec: - ports: - - name: https - port: 8443 - protocol: TCP - targetPort: https - selector: - control-plane: controller-manager diff --git a/pkg/traffic/config/rbac/conditionroute_editor_role.yaml b/pkg/traffic/config/rbac/conditionroute_editor_role.yaml deleted file mode 100644 index 8ed263614..000000000 --- a/pkg/traffic/config/rbac/conditionroute_editor_role.yaml +++ /dev/null @@ -1,46 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# permissions for end users to edit conditionroutes. -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - labels: - app.kubernetes.io/name: clusterrole - app.kubernetes.io/instance: conditionroute-editor-role - app.kubernetes.io/component: rbac - app.kubernetes.io/created-by: dubbo - app.kubernetes.io/part-of: dubbo - app.kubernetes.io/managed-by: kustomize - name: conditionroute-editor-role -rules: -- apiGroups: - - traffic.dubbo.apache.org - resources: - - conditionroutes - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - traffic.dubbo.apache.org - resources: - - conditionroutes/status - verbs: - - get diff --git a/pkg/traffic/config/rbac/conditionroute_viewer_role.yaml b/pkg/traffic/config/rbac/conditionroute_viewer_role.yaml deleted file mode 100644 index 303f757c7..000000000 --- a/pkg/traffic/config/rbac/conditionroute_viewer_role.yaml +++ /dev/null @@ -1,42 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# permissions for end users to view conditionroutes. -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - labels: - app.kubernetes.io/name: clusterrole - app.kubernetes.io/instance: conditionroute-viewer-role - app.kubernetes.io/component: rbac - app.kubernetes.io/created-by: dubbo - app.kubernetes.io/part-of: dubbo - app.kubernetes.io/managed-by: kustomize - name: conditionroute-viewer-role -rules: -- apiGroups: - - traffic.dubbo.apache.org - resources: - - conditionroutes - verbs: - - get - - list - - watch -- apiGroups: - - traffic.dubbo.apache.org - resources: - - conditionroutes/status - verbs: - - get diff --git a/pkg/traffic/config/rbac/dynamicconfig_editor_role.yaml b/pkg/traffic/config/rbac/dynamicconfig_editor_role.yaml deleted file mode 100644 index fdf0150fa..000000000 --- a/pkg/traffic/config/rbac/dynamicconfig_editor_role.yaml +++ /dev/null @@ -1,46 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# permissions for end users to edit dynamicconfigs. -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - labels: - app.kubernetes.io/name: clusterrole - app.kubernetes.io/instance: dynamicconfig-editor-role - app.kubernetes.io/component: rbac - app.kubernetes.io/created-by: dubbo - app.kubernetes.io/part-of: dubbo - app.kubernetes.io/managed-by: kustomize - name: dynamicconfig-editor-role -rules: -- apiGroups: - - traffic.dubbo.apache.org - resources: - - dynamicconfigs - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - traffic.dubbo.apache.org - resources: - - dynamicconfigs/status - verbs: - - get diff --git a/pkg/traffic/config/rbac/dynamicconfig_viewer_role.yaml b/pkg/traffic/config/rbac/dynamicconfig_viewer_role.yaml deleted file mode 100644 index f7a0074eb..000000000 --- a/pkg/traffic/config/rbac/dynamicconfig_viewer_role.yaml +++ /dev/null @@ -1,42 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# permissions for end users to view dynamicconfigs. -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - labels: - app.kubernetes.io/name: clusterrole - app.kubernetes.io/instance: dynamicconfig-viewer-role - app.kubernetes.io/component: rbac - app.kubernetes.io/created-by: dubbo - app.kubernetes.io/part-of: dubbo - app.kubernetes.io/managed-by: kustomize - name: dynamicconfig-viewer-role -rules: -- apiGroups: - - traffic.dubbo.apache.org - resources: - - dynamicconfigs - verbs: - - get - - list - - watch -- apiGroups: - - traffic.dubbo.apache.org - resources: - - dynamicconfigs/status - verbs: - - get diff --git a/pkg/traffic/config/rbac/kustomization.yaml b/pkg/traffic/config/rbac/kustomization.yaml deleted file mode 100644 index 7a7d01f12..000000000 --- a/pkg/traffic/config/rbac/kustomization.yaml +++ /dev/null @@ -1,33 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -resources: -# All RBAC will be applied under this service account in -# the deployment namespace. You may comment out this resource -# if your manager will use a service account that exists at -# runtime. Be sure to update RoleBinding and ClusterRoleBinding -# subjects if changing service account names. -- service_account.yaml -- role.yaml -- role_binding.yaml -- leader_election_role.yaml -- leader_election_role_binding.yaml -# Comment the following 4 lines if you want to disable -# the auth proxy (https://github.com/brancz/kube-rbac-proxy) -# which protects your /metrics endpoint. -- auth_proxy_service.yaml -- auth_proxy_role.yaml -- auth_proxy_role_binding.yaml -- auth_proxy_client_clusterrole.yaml diff --git a/pkg/traffic/config/rbac/leader_election_role.yaml b/pkg/traffic/config/rbac/leader_election_role.yaml deleted file mode 100644 index 31fbe24e0..000000000 --- a/pkg/traffic/config/rbac/leader_election_role.yaml +++ /dev/null @@ -1,59 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# permissions to do leader election. -apiVersion: rbac.authorization.k8s.io/v1 -kind: Role -metadata: - labels: - app.kubernetes.io/name: role - app.kubernetes.io/instance: leader-election-role - app.kubernetes.io/component: rbac - app.kubernetes.io/created-by: dubbo - app.kubernetes.io/part-of: dubbo - app.kubernetes.io/managed-by: kustomize - name: leader-election-role -rules: -- apiGroups: - - "" - resources: - - configmaps - verbs: - - get - - list - - watch - - create - - update - - patch - - delete -- apiGroups: - - coordination.k8s.io - resources: - - leases - verbs: - - get - - list - - watch - - create - - update - - patch - - delete -- apiGroups: - - "" - resources: - - events - verbs: - - create - - patch diff --git a/pkg/traffic/config/rbac/leader_election_role_binding.yaml b/pkg/traffic/config/rbac/leader_election_role_binding.yaml deleted file mode 100644 index 6addfe2c5..000000000 --- a/pkg/traffic/config/rbac/leader_election_role_binding.yaml +++ /dev/null @@ -1,34 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - labels: - app.kubernetes.io/name: rolebinding - app.kubernetes.io/instance: leader-election-rolebinding - app.kubernetes.io/component: rbac - app.kubernetes.io/created-by: dubbo - app.kubernetes.io/part-of: dubbo - app.kubernetes.io/managed-by: kustomize - name: leader-election-rolebinding -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: Role - name: leader-election-role -subjects: -- kind: ServiceAccount - name: controller-manager - namespace: system diff --git a/pkg/traffic/config/rbac/role.yaml b/pkg/traffic/config/rbac/role.yaml deleted file mode 100644 index 5644467aa..000000000 --- a/pkg/traffic/config/rbac/role.yaml +++ /dev/null @@ -1,100 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - creationTimestamp: null - name: manager-role -rules: -- apiGroups: - - traffic.dubbo.apache.org - resources: - - conditionroutes - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - traffic.dubbo.apache.org - resources: - - conditionroutes/finalizers - verbs: - - update -- apiGroups: - - traffic.dubbo.apache.org - resources: - - conditionroutes/status - verbs: - - get - - patch - - update -- apiGroups: - - traffic.dubbo.apache.org - resources: - - dynamicconfigs - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - traffic.dubbo.apache.org - resources: - - dynamicconfigs/finalizers - verbs: - - update -- apiGroups: - - traffic.dubbo.apache.org - resources: - - dynamicconfigs/status - verbs: - - get - - patch - - update -- apiGroups: - - traffic.dubbo.apache.org - resources: - - tagroutes - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - traffic.dubbo.apache.org - resources: - - tagroutes/finalizers - verbs: - - update -- apiGroups: - - traffic.dubbo.apache.org - resources: - - tagroutes/status - verbs: - - get - - patch - - update diff --git a/pkg/traffic/config/rbac/role_binding.yaml b/pkg/traffic/config/rbac/role_binding.yaml deleted file mode 100644 index 6b0db9cc8..000000000 --- a/pkg/traffic/config/rbac/role_binding.yaml +++ /dev/null @@ -1,34 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - labels: - app.kubernetes.io/name: clusterrolebinding - app.kubernetes.io/instance: manager-rolebinding - app.kubernetes.io/component: rbac - app.kubernetes.io/created-by: dubbo - app.kubernetes.io/part-of: dubbo - app.kubernetes.io/managed-by: kustomize - name: manager-rolebinding -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: manager-role -subjects: -- kind: ServiceAccount - name: controller-manager - namespace: system diff --git a/pkg/traffic/config/rbac/service_account.yaml b/pkg/traffic/config/rbac/service_account.yaml deleted file mode 100644 index 02dce994e..000000000 --- a/pkg/traffic/config/rbac/service_account.yaml +++ /dev/null @@ -1,27 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: v1 -kind: ServiceAccount -metadata: - labels: - app.kubernetes.io/name: serviceaccount - app.kubernetes.io/instance: controller-manager-sa - app.kubernetes.io/component: rbac - app.kubernetes.io/created-by: dubbo - app.kubernetes.io/part-of: dubbo - app.kubernetes.io/managed-by: kustomize - name: controller-manager - namespace: system diff --git a/pkg/traffic/config/rbac/tagroute_editor_role.yaml b/pkg/traffic/config/rbac/tagroute_editor_role.yaml deleted file mode 100644 index ef61504d9..000000000 --- a/pkg/traffic/config/rbac/tagroute_editor_role.yaml +++ /dev/null @@ -1,46 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# permissions for end users to edit tagroutes. -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - labels: - app.kubernetes.io/name: clusterrole - app.kubernetes.io/instance: tagroute-editor-role - app.kubernetes.io/component: rbac - app.kubernetes.io/created-by: dubbo - app.kubernetes.io/part-of: dubbo - app.kubernetes.io/managed-by: kustomize - name: tagroute-editor-role -rules: -- apiGroups: - - traffic.dubbo.apache.org - resources: - - tagroutes - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - traffic.dubbo.apache.org - resources: - - tagroutes/status - verbs: - - get diff --git a/pkg/traffic/config/rbac/tagroute_viewer_role.yaml b/pkg/traffic/config/rbac/tagroute_viewer_role.yaml deleted file mode 100644 index 0d11698d9..000000000 --- a/pkg/traffic/config/rbac/tagroute_viewer_role.yaml +++ /dev/null @@ -1,42 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# permissions for end users to view tagroutes. -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - labels: - app.kubernetes.io/name: clusterrole - app.kubernetes.io/instance: tagroute-viewer-role - app.kubernetes.io/component: rbac - app.kubernetes.io/created-by: dubbo - app.kubernetes.io/part-of: dubbo - app.kubernetes.io/managed-by: kustomize - name: tagroute-viewer-role -rules: -- apiGroups: - - traffic.dubbo.apache.org - resources: - - tagroutes - verbs: - - get - - list - - watch -- apiGroups: - - traffic.dubbo.apache.org - resources: - - tagroutes/status - verbs: - - get diff --git a/pkg/traffic/config/samples/kustomization.yaml b/pkg/traffic/config/samples/kustomization.yaml deleted file mode 100644 index b74cc86ef..000000000 --- a/pkg/traffic/config/samples/kustomization.yaml +++ /dev/null @@ -1,21 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -## Append samples of your project ## -resources: -- traffic_v1_tagroute.yaml -- traffic_v1_conditionroute.yaml -- traffic_v1_dynamicconfig.yaml -#+kubebuilder:scaffold:manifestskustomizesamples diff --git a/pkg/traffic/config/samples/traffic_v1_conditionroute.yaml b/pkg/traffic/config/samples/traffic_v1_conditionroute.yaml deleted file mode 100644 index 3231b377d..000000000 --- a/pkg/traffic/config/samples/traffic_v1_conditionroute.yaml +++ /dev/null @@ -1,27 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: traffic.dubbo.apache.org/v1 -kind: ConditionRoute -metadata: - labels: - app.kubernetes.io/name: conditionroute - app.kubernetes.io/instance: conditionroute-sample - app.kubernetes.io/part-of: dubbo - app.kubernetes.io/managed-by: kustomize - app.kubernetes.io/created-by: dubbo - name: conditionroute-sample -spec: - # TODO(user): Add fields here diff --git a/pkg/traffic/config/samples/traffic_v1_dynamicconfig.yaml b/pkg/traffic/config/samples/traffic_v1_dynamicconfig.yaml deleted file mode 100644 index ae93d40c4..000000000 --- a/pkg/traffic/config/samples/traffic_v1_dynamicconfig.yaml +++ /dev/null @@ -1,27 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: traffic.dubbo.apache.org/v1 -kind: DynamicConfig -metadata: - labels: - app.kubernetes.io/name: dynamicconfig - app.kubernetes.io/instance: dynamicconfig-sample - app.kubernetes.io/part-of: dubbo - app.kubernetes.io/managed-by: kustomize - app.kubernetes.io/created-by: dubbo - name: dynamicconfig-sample -spec: - # TODO(user): Add fields here diff --git a/pkg/traffic/config/samples/traffic_v1_tagroute.yaml b/pkg/traffic/config/samples/traffic_v1_tagroute.yaml deleted file mode 100644 index 634b6b27c..000000000 --- a/pkg/traffic/config/samples/traffic_v1_tagroute.yaml +++ /dev/null @@ -1,27 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: traffic.dubbo.apache.org/v1 -kind: TagRoute -metadata: - labels: - app.kubernetes.io/name: tagroute - app.kubernetes.io/instance: tagroute-sample - app.kubernetes.io/part-of: dubbo - app.kubernetes.io/managed-by: kustomize - app.kubernetes.io/created-by: dubbo - name: tagroute-sample -spec: - # TODO(user): Add fields here diff --git a/pkg/traffic/internal/controller/conditionroute_controller.go b/pkg/traffic/internal/controller/conditionroute_controller.go deleted file mode 100644 index 8f8db8df1..000000000 --- a/pkg/traffic/internal/controller/conditionroute_controller.go +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package controller - -import ( - "context" - - "github.com/dubbogo/gost/encoding/yaml" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/log" - - "github.com/apache/dubbo-admin/pkg/admin/constant" - trafficv1 "github.com/apache/dubbo-admin/pkg/traffic/api/v1" - "github.com/apache/dubbo-admin/pkg/traffic/cache" -) - -// ConditionRouteReconciler reconciles a ConditionRoute object -type ConditionRouteReconciler struct { - client.Client - Scheme *runtime.Scheme -} - -//+kubebuilder:rbac:groups=traffic.dubbo.apache.org,resources=conditionroutes,verbs=get;list;watch;create;update;patch;delete -//+kubebuilder:rbac:groups=traffic.dubbo.apache.org,resources=conditionroutes/status,verbs=get;update;patch -//+kubebuilder:rbac:groups=traffic.dubbo.apache.org,resources=conditionroutes/finalizers,verbs=update - -// Reconcile is part of the main kubernetes reconciliation loop which aims to -// move the current state of the cluster closer to the desired state. -// TODO(user): Modify the Reconcile function to compare the state specified by -// the ConditionRoute object against the actual cluster state, and then -// perform operations to make the cluster state reflect the state specified by -// the user. -// -// For more details, check Reconcile and its Result here: -// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.4/pkg/reconcile -func (r *ConditionRouteReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { - logger := log.FromContext(ctx) - logger.Enabled() - conditionRoute := &trafficv1.ConditionRoute{} - err := r.Get(ctx, req.NamespacedName, conditionRoute) - if err != nil { - if errors.IsNotFound(err) { - notify([]byte(""), constant.ConditionRoute) - return ctrl.Result{}, nil - } - return ctrl.Result{}, err - } - - if !conditionRoute.DeletionTimestamp.IsZero() { - notify([]byte(""), constant.ConditionRoute) - return ctrl.Result{}, nil - } - - condition := conditionRoute.Spec.ConditionRoute - bytes, err := yaml.MarshalYML(condition) - cache.ConfigMap[constant.ConditionRoute] = string(bytes) - if err != nil { - return ctrl.Result{}, err - } - notify(bytes, constant.ConditionRoute) - return ctrl.Result{}, nil -} - -// SetupWithManager sets up the controller with the Manager. -func (r *ConditionRouteReconciler) SetupWithManager(mgr ctrl.Manager) error { - return ctrl.NewControllerManagedBy(mgr). - For(&trafficv1.ConditionRoute{}). - Complete(r) -} diff --git a/pkg/traffic/internal/controller/dynamicconfig_controller.go b/pkg/traffic/internal/controller/dynamicconfig_controller.go deleted file mode 100644 index e0c560e19..000000000 --- a/pkg/traffic/internal/controller/dynamicconfig_controller.go +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package controller - -import ( - "context" - - "github.com/dubbogo/gost/encoding/yaml" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/log" - - "github.com/apache/dubbo-admin/pkg/admin/constant" - trafficv1 "github.com/apache/dubbo-admin/pkg/traffic/api/v1" - "github.com/apache/dubbo-admin/pkg/traffic/cache" -) - -// DynamicConfigReconciler reconciles a DynamicConfig object -type DynamicConfigReconciler struct { - client.Client - Scheme *runtime.Scheme -} - -//+kubebuilder:rbac:groups=traffic.dubbo.apache.org,resources=dynamicconfigs,verbs=get;list;watch;create;update;patch;delete -//+kubebuilder:rbac:groups=traffic.dubbo.apache.org,resources=dynamicconfigs/status,verbs=get;update;patch -//+kubebuilder:rbac:groups=traffic.dubbo.apache.org,resources=dynamicconfigs/finalizers,verbs=update - -// Reconcile is part of the main kubernetes reconciliation loop which aims to -// move the current state of the cluster closer to the desired state. -// TODO(user): Modify the Reconcile function to compare the state specified by -// the DynamicConfig object against the actual cluster state, and then -// perform operations to make the cluster state reflect the state specified by -// the user. -// -// For more details, check Reconcile and its Result here: -// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.4/pkg/reconcile -func (r *DynamicConfigReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { - logger := log.FromContext(ctx) - logger.Enabled() - dynamicConfig := &trafficv1.DynamicConfig{} - err := r.Get(ctx, req.NamespacedName, dynamicConfig) - if err != nil { - if errors.IsNotFound(err) { - notify([]byte(""), constant.DynamicKey) - return ctrl.Result{}, nil - } - return ctrl.Result{}, err - } - - if !dynamicConfig.DeletionTimestamp.IsZero() { - notify([]byte(""), constant.DynamicKey) - return ctrl.Result{}, nil - } - - dynamic := dynamicConfig.Spec.DynamicConfig - bytes, err := yaml.MarshalYML(dynamic) - cache.ConfigMap[constant.DynamicKey] = string(bytes) - if err != nil { - return ctrl.Result{}, err - } - notify(bytes, constant.DynamicKey) - return ctrl.Result{}, nil -} - -// SetupWithManager sets up the controller with the Manager. -func (r *DynamicConfigReconciler) SetupWithManager(mgr ctrl.Manager) error { - return ctrl.NewControllerManagedBy(mgr). - For(&trafficv1.DynamicConfig{}). - Complete(r) -} diff --git a/pkg/traffic/internal/controller/suite_test.go b/pkg/traffic/internal/controller/suite_test.go deleted file mode 100644 index 453fa3c1e..000000000 --- a/pkg/traffic/internal/controller/suite_test.go +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package controller - -import ( - "path/filepath" - "testing" - - . "github.com/onsi/ginkgo/v2" - . "github.com/onsi/gomega" - - "k8s.io/client-go/kubernetes/scheme" - "k8s.io/client-go/rest" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/envtest" - logf "sigs.k8s.io/controller-runtime/pkg/log" - "sigs.k8s.io/controller-runtime/pkg/log/zap" - - trafficv1 "github.com/apache/dubbo-admin/pkg/traffic/api/v1" - //+kubebuilder:scaffold:imports -) - -// These tests use Ginkgo (BDD-style Go testing framework). Refer to -// http://onsi.github.io/ginkgo/ to learn more about Ginkgo. - -var cfg *rest.Config -var k8sClient client.Client -var testEnv *envtest.Environment - -func TestAPIs(t *testing.T) { - RegisterFailHandler(Fail) - - RunSpecs(t, "Controller Suite") -} - -var _ = BeforeSuite(func() { - logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter), zap.UseDevMode(true))) - - By("bootstrapping test environment") - testEnv = &envtest.Environment{ - CRDDirectoryPaths: []string{filepath.Join("..", "..", "config", "crd", "bases")}, - ErrorIfCRDPathMissing: true, - } - - var err error - // cfg is defined in this file globally. - cfg, err = testEnv.Start() - Expect(err).NotTo(HaveOccurred()) - Expect(cfg).NotTo(BeNil()) - - err = trafficv1.AddToScheme(scheme.Scheme) - Expect(err).NotTo(HaveOccurred()) - - //+kubebuilder:scaffold:scheme - - k8sClient, err = client.New(cfg, client.Options{Scheme: scheme.Scheme}) - Expect(err).NotTo(HaveOccurred()) - Expect(k8sClient).NotTo(BeNil()) - -}) - -var _ = AfterSuite(func() { - By("tearing down the test environment") - err := testEnv.Stop() - Expect(err).NotTo(HaveOccurred()) -}) diff --git a/pkg/traffic/internal/controller/tagroute_controller.go b/pkg/traffic/internal/controller/tagroute_controller.go deleted file mode 100644 index 8b85e3282..000000000 --- a/pkg/traffic/internal/controller/tagroute_controller.go +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package controller - -import ( - "context" - - "github.com/dubbogo/gost/encoding/yaml" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/log" - - "github.com/apache/dubbo-admin/pkg/admin/constant" - trafficv1 "github.com/apache/dubbo-admin/pkg/traffic/api/v1" - "github.com/apache/dubbo-admin/pkg/traffic/cache" -) - -// TagRouteReconciler reconciles a TagRoute object -type TagRouteReconciler struct { - client.Client - Scheme *runtime.Scheme -} - -//+kubebuilder:rbac:groups=traffic.dubbo.apache.org,resources=tagroutes,verbs=get;list;watch;create;update;patch;delete -//+kubebuilder:rbac:groups=traffic.dubbo.apache.org,resources=tagroutes/status,verbs=get;update;patch -//+kubebuilder:rbac:groups=traffic.dubbo.apache.org,resources=tagroutes/finalizers,verbs=update - -// Reconcile is part of the main kubernetes reconciliation loop which aims to -// move the current state of the cluster closer to the desired state. -// TODO(user): Modify the Reconcile function to compare the state specified by -// the TagRoute object against the actual cluster state, and then -// perform operations to make the cluster state reflect the state specified by -// the user. -// -// For more details, check Reconcile and its Result here: -// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.4/pkg/reconcile -func (r *TagRouteReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { - logger := log.FromContext(ctx) - logger.Enabled() - tagRoute := &trafficv1.TagRoute{} - err := r.Get(ctx, req.NamespacedName, tagRoute) - if err != nil { - if errors.IsNotFound(err) { - notify([]byte(""), constant.TagRoute) - return ctrl.Result{}, nil - } - return ctrl.Result{}, err - } - - if !tagRoute.DeletionTimestamp.IsZero() { - notify([]byte(""), constant.TagRoute) - return ctrl.Result{}, nil - } - - tag := tagRoute.Spec.TagRoute - bytes, err := yaml.MarshalYML(tag) - cache.ConfigMap[constant.TagRoute] = string(bytes) - if err != nil { - return ctrl.Result{}, err - } - notify(bytes, constant.TagRoute) - return ctrl.Result{}, nil -} - -// SetupWithManager sets up the controller with the Manager. -func (r *TagRouteReconciler) SetupWithManager(mgr ctrl.Manager) error { - return ctrl.NewControllerManagedBy(mgr). - For(&trafficv1.TagRoute{}). - Complete(r) -} diff --git a/pkg/traffic/internal/pb/rpc.pb.go b/pkg/traffic/internal/pb/rpc.pb.go deleted file mode 100644 index dbb7e9a59..000000000 --- a/pkg/traffic/internal/pb/rpc.pb.go +++ /dev/null @@ -1,789 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc v3.21.9 -// source: rpc.proto - -package pb - -import ( - reflect "reflect" - sync "sync" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Event_EventType int32 - -const ( - Event_PUT Event_EventType = 0 - Event_DELETE Event_EventType = 1 -) - -// Enum value maps for Event_EventType. -var ( - Event_EventType_name = map[int32]string{ - 0: "PUT", - 1: "DELETE", - } - Event_EventType_value = map[string]int32{ - "PUT": 0, - "DELETE": 1, - } -) - -func (x Event_EventType) Enum() *Event_EventType { - p := new(Event_EventType) - *p = x - return p -} - -func (x Event_EventType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Event_EventType) Descriptor() protoreflect.EnumDescriptor { - return file_rpc_proto_enumTypes[0].Descriptor() -} - -func (Event_EventType) Type() protoreflect.EnumType { - return &file_rpc_proto_enumTypes[0] -} - -func (x Event_EventType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Event_EventType.Descriptor instead. -func (Event_EventType) EnumDescriptor() ([]byte, []int) { - return file_rpc_proto_rawDescGZIP(), []int{7, 0} -} - -type GetRuleRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` -} - -func (x *GetRuleRequest) Reset() { - *x = GetRuleRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetRuleRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetRuleRequest) ProtoMessage() {} - -func (x *GetRuleRequest) ProtoReflect() protoreflect.Message { - mi := &file_rpc_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetRuleRequest.ProtoReflect.Descriptor instead. -func (*GetRuleRequest) Descriptor() ([]byte, []int) { - return file_rpc_proto_rawDescGZIP(), []int{0} -} - -func (x *GetRuleRequest) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -type GetRuleResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *GetRuleResponse) Reset() { - *x = GetRuleResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetRuleResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetRuleResponse) ProtoMessage() {} - -func (x *GetRuleResponse) ProtoReflect() protoreflect.Message { - mi := &file_rpc_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetRuleResponse.ProtoReflect.Descriptor instead. -func (*GetRuleResponse) Descriptor() ([]byte, []int) { - return file_rpc_proto_rawDescGZIP(), []int{1} -} - -func (x *GetRuleResponse) GetValue() string { - if x != nil { - return x.Value - } - return "" -} - -type WatchRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to RequestUnion: - // - // *WatchRequest_CreateRequest - // *WatchRequest_CancelRequest - RequestUnion isWatchRequest_RequestUnion `protobuf_oneof:"request_union"` -} - -func (x *WatchRequest) Reset() { - *x = WatchRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *WatchRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*WatchRequest) ProtoMessage() {} - -func (x *WatchRequest) ProtoReflect() protoreflect.Message { - mi := &file_rpc_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use WatchRequest.ProtoReflect.Descriptor instead. -func (*WatchRequest) Descriptor() ([]byte, []int) { - return file_rpc_proto_rawDescGZIP(), []int{2} -} - -func (m *WatchRequest) GetRequestUnion() isWatchRequest_RequestUnion { - if m != nil { - return m.RequestUnion - } - return nil -} - -func (x *WatchRequest) GetCreateRequest() *WatchCreateRequest { - if x, ok := x.GetRequestUnion().(*WatchRequest_CreateRequest); ok { - return x.CreateRequest - } - return nil -} - -func (x *WatchRequest) GetCancelRequest() *WatchCancelRequest { - if x, ok := x.GetRequestUnion().(*WatchRequest_CancelRequest); ok { - return x.CancelRequest - } - return nil -} - -type isWatchRequest_RequestUnion interface { - isWatchRequest_RequestUnion() -} - -type WatchRequest_CreateRequest struct { - CreateRequest *WatchCreateRequest `protobuf:"bytes,1,opt,name=create_request,json=createRequest,proto3,oneof"` -} - -type WatchRequest_CancelRequest struct { - CancelRequest *WatchCancelRequest `protobuf:"bytes,2,opt,name=cancel_request,json=cancelRequest,proto3,oneof"` -} - -func (*WatchRequest_CreateRequest) isWatchRequest_RequestUnion() {} - -func (*WatchRequest_CancelRequest) isWatchRequest_RequestUnion() {} - -type WatchCreateRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // the key to register for watching - Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - // If watch_id is provided and non-zero, it will be assigned to this watcher. - // Since creating a watcher in etcd is not a synchronous operation, - // this can be used ensure that ordering is correct when creating multiple - // watchers on the same stream. Creating a watcher with an ID already in - // use on the stream will cause an error to be returned. - WatchId int64 `protobuf:"varint,2,opt,name=watch_id,json=watchId,proto3" json:"watch_id,omitempty"` -} - -func (x *WatchCreateRequest) Reset() { - *x = WatchCreateRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *WatchCreateRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*WatchCreateRequest) ProtoMessage() {} - -func (x *WatchCreateRequest) ProtoReflect() protoreflect.Message { - mi := &file_rpc_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use WatchCreateRequest.ProtoReflect.Descriptor instead. -func (*WatchCreateRequest) Descriptor() ([]byte, []int) { - return file_rpc_proto_rawDescGZIP(), []int{3} -} - -func (x *WatchCreateRequest) GetKey() []byte { - if x != nil { - return x.Key - } - return nil -} - -func (x *WatchCreateRequest) GetWatchId() int64 { - if x != nil { - return x.WatchId - } - return 0 -} - -type WatchCancelRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // watch_id is the watcher id to cancel so that no more events are transmitted. - WatchId int64 `protobuf:"varint,1,opt,name=watch_id,json=watchId,proto3" json:"watch_id,omitempty"` -} - -func (x *WatchCancelRequest) Reset() { - *x = WatchCancelRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *WatchCancelRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*WatchCancelRequest) ProtoMessage() {} - -func (x *WatchCancelRequest) ProtoReflect() protoreflect.Message { - mi := &file_rpc_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use WatchCancelRequest.ProtoReflect.Descriptor instead. -func (*WatchCancelRequest) Descriptor() ([]byte, []int) { - return file_rpc_proto_rawDescGZIP(), []int{4} -} - -func (x *WatchCancelRequest) GetWatchId() int64 { - if x != nil { - return x.WatchId - } - return 0 -} - -type WatchResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // watch_id is the ID of the watcher that corresponds to the response. - WatchId int64 `protobuf:"varint,1,opt,name=watch_id,json=watchId,proto3" json:"watch_id,omitempty"` - Created bool `protobuf:"varint,2,opt,name=created,proto3" json:"created,omitempty"` - Canceled bool `protobuf:"varint,3,opt,name=canceled,proto3" json:"canceled,omitempty"` - CancelReason string `protobuf:"bytes,4,opt,name=cancel_reason,json=cancelReason,proto3" json:"cancel_reason,omitempty"` - Events []*Event `protobuf:"bytes,5,rep,name=events,proto3" json:"events,omitempty"` -} - -func (x *WatchResponse) Reset() { - *x = WatchResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *WatchResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*WatchResponse) ProtoMessage() {} - -func (x *WatchResponse) ProtoReflect() protoreflect.Message { - mi := &file_rpc_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use WatchResponse.ProtoReflect.Descriptor instead. -func (*WatchResponse) Descriptor() ([]byte, []int) { - return file_rpc_proto_rawDescGZIP(), []int{5} -} - -func (x *WatchResponse) GetWatchId() int64 { - if x != nil { - return x.WatchId - } - return 0 -} - -func (x *WatchResponse) GetCreated() bool { - if x != nil { - return x.Created - } - return false -} - -func (x *WatchResponse) GetCanceled() bool { - if x != nil { - return x.Canceled - } - return false -} - -func (x *WatchResponse) GetCancelReason() string { - if x != nil { - return x.CancelReason - } - return "" -} - -func (x *WatchResponse) GetEvents() []*Event { - if x != nil { - return x.Events - } - return nil -} - -type KeyValue struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // key is the key in bytes. An empty key is not allowed. - Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - // value is the value held by the key, in bytes. - Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *KeyValue) Reset() { - *x = KeyValue{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *KeyValue) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*KeyValue) ProtoMessage() {} - -func (x *KeyValue) ProtoReflect() protoreflect.Message { - mi := &file_rpc_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use KeyValue.ProtoReflect.Descriptor instead. -func (*KeyValue) Descriptor() ([]byte, []int) { - return file_rpc_proto_rawDescGZIP(), []int{6} -} - -func (x *KeyValue) GetKey() []byte { - if x != nil { - return x.Key - } - return nil -} - -func (x *KeyValue) GetValue() []byte { - if x != nil { - return x.Value - } - return nil -} - -type Event struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Type Event_EventType `protobuf:"varint,1,opt,name=type,proto3,enum=pb.Event_EventType" json:"type,omitempty"` - Kv *KeyValue `protobuf:"bytes,2,opt,name=kv,proto3" json:"kv,omitempty"` -} - -func (x *Event) Reset() { - *x = Event{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Event) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Event) ProtoMessage() {} - -func (x *Event) ProtoReflect() protoreflect.Message { - mi := &file_rpc_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Event.ProtoReflect.Descriptor instead. -func (*Event) Descriptor() ([]byte, []int) { - return file_rpc_proto_rawDescGZIP(), []int{7} -} - -func (x *Event) GetType() Event_EventType { - if x != nil { - return x.Type - } - return Event_PUT -} - -func (x *Event) GetKv() *KeyValue { - if x != nil { - return x.Kv - } - return nil -} - -var File_rpc_proto protoreflect.FileDescriptor - -var file_rpc_proto_rawDesc = []byte{ - 0x0a, 0x09, 0x72, 0x70, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, - 0x22, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x6b, 0x65, 0x79, 0x22, 0x27, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xa1, 0x01, 0x0a, - 0x0c, 0x57, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, - 0x0e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x57, 0x61, 0x74, 0x63, 0x68, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, - 0x0d, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, - 0x0a, 0x0e, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x57, 0x61, 0x74, 0x63, - 0x68, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, - 0x52, 0x0d, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, - 0x0f, 0x0a, 0x0d, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x75, 0x6e, 0x69, 0x6f, 0x6e, - 0x22, 0x41, 0x0a, 0x12, 0x57, 0x61, 0x74, 0x63, 0x68, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x19, 0x0a, 0x08, 0x77, 0x61, 0x74, 0x63, - 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x77, 0x61, 0x74, 0x63, - 0x68, 0x49, 0x64, 0x22, 0x2f, 0x0a, 0x12, 0x57, 0x61, 0x74, 0x63, 0x68, 0x43, 0x61, 0x6e, 0x63, - 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x77, 0x61, 0x74, - 0x63, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x77, 0x61, 0x74, - 0x63, 0x68, 0x49, 0x64, 0x22, 0xa8, 0x01, 0x0a, 0x0d, 0x57, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x77, 0x61, 0x74, 0x63, 0x68, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x77, 0x61, 0x74, 0x63, 0x68, 0x49, - 0x64, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x63, - 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x63, - 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x65, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x61, 0x6e, 0x63, 0x65, - 0x6c, 0x5f, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, - 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x21, 0x0a, 0x06, - 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x70, - 0x62, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x22, - 0x32, 0x0a, 0x08, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, - 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x22, 0x70, 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x27, 0x0a, 0x04, - 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x70, 0x62, 0x2e, - 0x45, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, - 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1c, 0x0a, 0x02, 0x6b, 0x76, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, - 0x02, 0x6b, 0x76, 0x22, 0x20, 0x0a, 0x09, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, - 0x12, 0x07, 0x0a, 0x03, 0x50, 0x55, 0x54, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x44, 0x45, 0x4c, - 0x45, 0x54, 0x45, 0x10, 0x01, 0x32, 0x71, 0x0a, 0x05, 0x57, 0x61, 0x74, 0x63, 0x68, 0x12, 0x32, - 0x0a, 0x05, 0x57, 0x61, 0x74, 0x63, 0x68, 0x12, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x57, 0x61, 0x74, - 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x57, - 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, - 0x30, 0x01, 0x12, 0x34, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x12, 0x2e, - 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x13, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_rpc_proto_rawDescOnce sync.Once - file_rpc_proto_rawDescData = file_rpc_proto_rawDesc -) - -func file_rpc_proto_rawDescGZIP() []byte { - file_rpc_proto_rawDescOnce.Do(func() { - file_rpc_proto_rawDescData = protoimpl.X.CompressGZIP(file_rpc_proto_rawDescData) - }) - return file_rpc_proto_rawDescData -} - -var file_rpc_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_rpc_proto_msgTypes = make([]protoimpl.MessageInfo, 8) -var file_rpc_proto_goTypes = []interface{}{ - (Event_EventType)(0), // 0: pb.Event.EventType - (*GetRuleRequest)(nil), // 1: pb.GetRuleRequest - (*GetRuleResponse)(nil), // 2: pb.GetRuleResponse - (*WatchRequest)(nil), // 3: pb.WatchRequest - (*WatchCreateRequest)(nil), // 4: pb.WatchCreateRequest - (*WatchCancelRequest)(nil), // 5: pb.WatchCancelRequest - (*WatchResponse)(nil), // 6: pb.WatchResponse - (*KeyValue)(nil), // 7: pb.KeyValue - (*Event)(nil), // 8: pb.Event -} -var file_rpc_proto_depIdxs = []int32{ - 4, // 0: pb.WatchRequest.create_request:type_name -> pb.WatchCreateRequest - 5, // 1: pb.WatchRequest.cancel_request:type_name -> pb.WatchCancelRequest - 8, // 2: pb.WatchResponse.events:type_name -> pb.Event - 0, // 3: pb.Event.type:type_name -> pb.Event.EventType - 7, // 4: pb.Event.kv:type_name -> pb.KeyValue - 3, // 5: pb.Watch.Watch:input_type -> pb.WatchRequest - 1, // 6: pb.Watch.GetRule:input_type -> pb.GetRuleRequest - 6, // 7: pb.Watch.Watch:output_type -> pb.WatchResponse - 2, // 8: pb.Watch.GetRule:output_type -> pb.GetRuleResponse - 7, // [7:9] is the sub-list for method output_type - 5, // [5:7] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name -} - -func init() { file_rpc_proto_init() } -func file_rpc_proto_init() { - if File_rpc_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_rpc_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetRuleRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetRuleResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WatchRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WatchCreateRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WatchCancelRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WatchResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*KeyValue); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Event); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_rpc_proto_msgTypes[2].OneofWrappers = []interface{}{ - (*WatchRequest_CreateRequest)(nil), - (*WatchRequest_CancelRequest)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_rpc_proto_rawDesc, - NumEnums: 1, - NumMessages: 8, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_rpc_proto_goTypes, - DependencyIndexes: file_rpc_proto_depIdxs, - EnumInfos: file_rpc_proto_enumTypes, - MessageInfos: file_rpc_proto_msgTypes, - }.Build() - File_rpc_proto = out.File - file_rpc_proto_rawDesc = nil - file_rpc_proto_goTypes = nil - file_rpc_proto_depIdxs = nil -} diff --git a/pkg/traffic/internal/pb/rpc.proto b/pkg/traffic/internal/pb/rpc.proto deleted file mode 100644 index 73ffb3354..000000000 --- a/pkg/traffic/internal/pb/rpc.proto +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -syntax = "proto3"; - -package pb; - -option go_package="./pb"; - -service Watch { - rpc Watch(stream WatchRequest) returns (stream WatchResponse) {} - rpc GetRule(GetRuleRequest) returns (GetRuleResponse) {} -} - -message GetRuleRequest { - string key = 1; -} - -message GetRuleResponse { - string value = 1; -} - -message WatchRequest { - oneof request_union { - WatchCreateRequest create_request = 1; - WatchCancelRequest cancel_request = 2; - } -} - -message WatchCreateRequest { - // the key to register for watching - bytes key = 1; - - // If watch_id is provided and non-zero, it will be assigned to this watcher. - // Since creating a watcher in etcd is not a synchronous operation, - // this can be used ensure that ordering is correct when creating multiple - // watchers on the same stream. Creating a watcher with an ID already in - // use on the stream will cause an error to be returned. - int64 watch_id = 2; -} - - -message WatchCancelRequest { - // watch_id is the watcher id to cancel so that no more events are transmitted. - int64 watch_id = 1; -} - -message WatchResponse { - // watch_id is the ID of the watcher that corresponds to the response. - int64 watch_id = 1; - - bool created = 2; - - bool canceled = 3; - - string cancel_reason = 4; - - repeated Event events = 5; -} - -message KeyValue { - // key is the key in bytes. An empty key is not allowed. - bytes key = 1; - // value is the value held by the key, in bytes. - bytes value = 2; -} - -message Event { - enum EventType { - PUT = 0; - DELETE = 1; - } - - EventType type = 1; - - KeyValue kv = 2; -} diff --git a/pkg/traffic/internal/pb/rpc_grpc.pb.go b/pkg/traffic/internal/pb/rpc_grpc.pb.go deleted file mode 100644 index c4179176c..000000000 --- a/pkg/traffic/internal/pb/rpc_grpc.pb.go +++ /dev/null @@ -1,191 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc v3.21.9 -// source: rpc.proto - -package pb - -import ( - context "context" - - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -// WatchClient is the client API for Watch service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type WatchClient interface { - Watch(ctx context.Context, opts ...grpc.CallOption) (Watch_WatchClient, error) - GetRule(ctx context.Context, in *GetRuleRequest, opts ...grpc.CallOption) (*GetRuleResponse, error) -} - -type watchClient struct { - cc grpc.ClientConnInterface -} - -func NewWatchClient(cc grpc.ClientConnInterface) WatchClient { - return &watchClient{cc} -} - -func (c *watchClient) Watch(ctx context.Context, opts ...grpc.CallOption) (Watch_WatchClient, error) { - stream, err := c.cc.NewStream(ctx, &Watch_ServiceDesc.Streams[0], "/pb.Watch/Watch", opts...) - if err != nil { - return nil, err - } - x := &watchWatchClient{stream} - return x, nil -} - -type Watch_WatchClient interface { - Send(*WatchRequest) error - Recv() (*WatchResponse, error) - grpc.ClientStream -} - -type watchWatchClient struct { - grpc.ClientStream -} - -func (x *watchWatchClient) Send(m *WatchRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *watchWatchClient) Recv() (*WatchResponse, error) { - m := new(WatchResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *watchClient) GetRule(ctx context.Context, in *GetRuleRequest, opts ...grpc.CallOption) (*GetRuleResponse, error) { - out := new(GetRuleResponse) - err := c.cc.Invoke(ctx, "/pb.Watch/GetRule", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// WatchServer is the server API for Watch service. -// All implementations must embed UnimplementedWatchServer -// for forward compatibility -type WatchServer interface { - Watch(Watch_WatchServer) error - GetRule(context.Context, *GetRuleRequest) (*GetRuleResponse, error) -} - -// UnimplementedWatchServer must be embedded to have forward compatible implementations. -type UnimplementedWatchServer struct { -} - -func (UnimplementedWatchServer) Watch(Watch_WatchServer) error { - return status.Errorf(codes.Unimplemented, "method Watch not implemented") -} -func (UnimplementedWatchServer) GetRule(context.Context, *GetRuleRequest) (*GetRuleResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetRule not implemented") -} -func (UnimplementedWatchServer) mustEmbedUnimplementedWatchServer() {} - -// UnsafeWatchServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to WatchServer will -// result in compilation errors. -type UnsafeWatchServer interface { - mustEmbedUnimplementedWatchServer() -} - -func RegisterWatchServer(s grpc.ServiceRegistrar, srv WatchServer) { - s.RegisterService(&Watch_ServiceDesc, srv) -} - -func _Watch_Watch_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(WatchServer).Watch(&watchWatchServer{stream}) -} - -type Watch_WatchServer interface { - Send(*WatchResponse) error - Recv() (*WatchRequest, error) - grpc.ServerStream -} - -type watchWatchServer struct { - grpc.ServerStream -} - -func (x *watchWatchServer) Send(m *WatchResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *watchWatchServer) Recv() (*WatchRequest, error) { - m := new(WatchRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _Watch_GetRule_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetRuleRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(WatchServer).GetRule(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.Watch/GetRule", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(WatchServer).GetRule(ctx, req.(*GetRuleRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// Watch_ServiceDesc is the grpc.ServiceDesc for Watch service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Watch_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "pb.Watch", - HandlerType: (*WatchServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetRule", - Handler: _Watch_GetRule_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "Watch", - Handler: _Watch_Watch_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, - Metadata: "rpc.proto", -} diff --git a/pkg/traffic/internal/util/watch.go b/pkg/traffic/internal/util/watch.go deleted file mode 100644 index 991b15e04..000000000 --- a/pkg/traffic/internal/util/watch.go +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package util - -import ( - "strings" - - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -func IsClientCtxErr(ctxErr error, err error) bool { - if ctxErr != nil { - return true - } - - ev, ok := status.FromError(err) - if !ok { - return false - } - - switch ev.Code() { - case codes.Canceled, codes.DeadlineExceeded: - // client-side context cancel or deadline exceeded - // "rpc error: code = Canceled desc = context canceled" - // "rpc error: code = DeadlineExceeded desc = context deadline exceeded" - return true - case codes.Unavailable: - msg := ev.Message() - // client-side context cancel or deadline exceeded with TLS ("http2.errClientDisconnected") - // "rpc error: code = Unavailable desc = client disconnected" - if msg == "client disconnected" { - return true - } - // "grpc/transport.ClientTransport.CloseStream" on canceled streams - // "rpc error: code = Unavailable desc = stream error: stream ID 21; CANCEL") - if strings.HasPrefix(msg, "stream error: ") && strings.HasSuffix(msg, "; CANCEL") { - return true - } - } - return false -} diff --git a/pkg/traffic/internal/watchserver/watch.go b/pkg/traffic/internal/watchserver/watch.go deleted file mode 100644 index 8330b42cb..000000000 --- a/pkg/traffic/internal/watchserver/watch.go +++ /dev/null @@ -1,284 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package watchserver - -import ( - "context" - "errors" - "fmt" - "io" - "sync" - - "github.com/apache/dubbo-admin/pkg/logger" - "github.com/apache/dubbo-admin/pkg/traffic/cache" - "github.com/apache/dubbo-admin/pkg/traffic/client" - pb2 "github.com/apache/dubbo-admin/pkg/traffic/internal/pb" - "github.com/apache/dubbo-admin/pkg/traffic/internal/util" -) - -// We send ctrl response inside the read loop. We do not want -// send to block read, but we still want ctrl response we sent to -// be serialized. Thus we use a buffered chan to solve the problem. -// A small buffer should be OK for most cases, since we expect the -// ctrl requests are infrequent. -const ctrlStreamBufLen = 16 - -var WatchSrv *WatchServer - -func init() { - WatchSrv = NewWatchServer() -} - -type WatchServer struct { - Watchable *WatchableStore -} - -func NewWatchServer() *WatchServer { - srv := &WatchServer{ - Watchable: NewWatchableStore(), - } - return srv -} - -// serverWatchStream is an etcd server side stream. It receives requests -// from client side gRPC stream. It receives watch events from mvcc.WatchStream, -// and creates responses that forwarded to gRPC stream. -// It also forwards control message like watch created and canceled. -type serverWatchStream struct { - watchable *WatchableStore - - gRPCStream pb2.Watch_WatchServer - watchStream WatchStream - ctrlStream chan *pb2.WatchResponse - - // mu protects progress, prevKV, fragment - mu sync.RWMutex - - // closec indicates the stream is closed. - closec chan struct{} - - // wg waits for the send loop to complete - wg sync.WaitGroup -} - -func (ws *WatchServer) GetRule(ctx context.Context, req *pb2.GetRuleRequest) (*pb2.GetRuleResponse, error) { - key := req.Key - config := cache.ConfigMap[key] - return &pb2.GetRuleResponse{Value: config}, nil -} - -func (ws *WatchServer) Watch(stream pb2.Watch_WatchServer) (err error) { - sws := serverWatchStream{ - gRPCStream: stream, - watchStream: ws.Watchable.NewWatchStream(), - // chan for sending control response like watcher created and canceled. - ctrlStream: make(chan *pb2.WatchResponse, ctrlStreamBufLen), - closec: make(chan struct{}), - watchable: ws.Watchable, - } - - sws.wg.Add(1) - go func() { - sws.sendLoop() - sws.wg.Done() - }() - - errc := make(chan error, 1) - // Ideally recvLoop would also use sws.wg to signal its completion - // but when stream.Context().Done() is closed, the stream's recv - // may continue to block since it uses a different context, leading to - // deadlock when calling sws.close(). - go func() { - if rerr := sws.recvLoop(); rerr != nil { - if util.IsClientCtxErr(stream.Context().Err(), rerr) { - logger.Sugar().Debug("failed to receive watch request from gRPC stream", rerr) - } - errc <- rerr - } else { - logger.Sugar().Warn("failed to receive watch request from gRPC stream", err) - } - }() - select { - case err = <-errc: - if err == context.Canceled { - err = errors.New("grpc watch canceled") - } - close(sws.ctrlStream) - case <-stream.Context().Done(): - err = stream.Context().Err() - if err == context.Canceled { - err = errors.New("grpc watch canceled") - } - } - sws.close() - return err -} - -func (sws *serverWatchStream) close() { - sws.watchStream.Close() - close(sws.closec) - sws.wg.Wait() -} - -func (sws *serverWatchStream) sendLoop() { - // watch ids that are currently active - ids := make(map[WatchID]struct{}) - // watch responses pending on a watch id creation message - pending := make(map[WatchID][]*pb2.WatchResponse) - - for { - select { - case wresp, ok := <-sws.watchStream.Chan(): - if !ok { - return - } - - evs := wresp.Events - events := make([]*pb2.Event, len(evs)) - for i := range evs { - events[i] = &evs[i] - } - wr := &pb2.WatchResponse{ - WatchId: int64(wresp.WatchID), - Events: events, - } - - // Progress notifications can have WatchID -1 - // if they announce on behalf of multiple watchers - if wresp.WatchID != client.InvalidWatchID { - if _, okID := ids[wresp.WatchID]; !okID { - // buffer if id not yet announced - wrs := append(pending[wresp.WatchID], wr) - pending[wresp.WatchID] = wrs - continue - } - } - - var serr error - - serr = sws.gRPCStream.Send(wr) - if serr != nil { - if util.IsClientCtxErr(sws.gRPCStream.Context().Err(), serr) { - logger.Sugar().Debug("failed to send watch response to gRPC stream", serr) - } else { - logger.Sugar().Warn("failed to send watch response to gRPC stream", serr) - } - return - } - case c, ok := <-sws.ctrlStream: - if !ok { - return - } - if err := sws.gRPCStream.Send(c); err != nil { - if util.IsClientCtxErr(sws.gRPCStream.Context().Err(), err) { - logger.Sugar().Debug("failed to send watch control response to gRPC stream", err) - } else { - logger.Sugar().Warn("failed to send watch control response to gRPC stream", err) - } - return - } - - // track id creation - wid := WatchID(c.WatchId) - if !(!(c.Canceled && c.Created) || wid == client.InvalidWatchID) { - panic(fmt.Sprintf("unexpected watchId: %d, wanted: %d, since both 'Canceled' and 'Created' are true", wid, client.InvalidWatchID)) - } - - if c.Canceled && wid != client.InvalidWatchID { - delete(ids, wid) - continue - } - - if c.Created { - // flush buffered events - ids[wid] = struct{}{} - for _, v := range pending[wid] { - if err := sws.gRPCStream.Send(v); err != nil { - if util.IsClientCtxErr(sws.gRPCStream.Context().Err(), err) { - logger.Sugar().Debug("failed to send pending watch response to gRPC stream", err) - } else { - logger.Sugar().Warn("failed to send pending watch response to gRPC stream", err) - } - return - } - } - delete(pending, wid) - } - case <-sws.closec: - return - } - } -} - -func (sws *serverWatchStream) recvLoop() error { - for { - req, err := sws.gRPCStream.Recv() - if err == io.EOF { - return nil - } - if err != nil { - return err - } - - switch uv := req.RequestUnion.(type) { - case *pb2.WatchRequest_CreateRequest: - if uv.CreateRequest == nil { - break - } - - creq := uv.CreateRequest - if len(creq.Key) == 0 { - creq.Key = []byte{0} - } - - id, err := sws.watchStream.Watch(WatchID(creq.WatchId), creq.Key) - if err != nil { - id = client.InvalidWatchID - } - wr := &pb2.WatchResponse{ - WatchId: int64(id), - Created: true, - Canceled: err != nil, - } - if err != nil { - wr.CancelReason = err.Error() - } - select { - case sws.ctrlStream <- wr: - case <-sws.closec: - return nil - } - case *pb2.WatchRequest_CancelRequest: - if uv.CancelRequest != nil { - id := uv.CancelRequest.WatchId - err := sws.watchStream.Cancel(WatchID(id)) - if err == nil { - sws.ctrlStream <- &pb2.WatchResponse{ - WatchId: id, - Canceled: true, - } - } - } - default: - // we probably should not shutdown the entire stream when - // receive an valid command. - // so just do nothing instead. - continue - } - } -} diff --git a/pkg/traffic/internal/watchserver/watchable_store.go b/pkg/traffic/internal/watchserver/watchable_store.go deleted file mode 100644 index 7d4412503..000000000 --- a/pkg/traffic/internal/watchserver/watchable_store.go +++ /dev/null @@ -1,238 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package watchserver - -import ( - "sync" - "time" - - "github.com/apache/dubbo-admin/pkg/traffic/internal/pb" -) - -var ( - // chanBufLen is the length of the buffered chan - // for sending out watched events. - chanBufLen = 128 -) - -// cancelFunc updates synced maps when running -// cancel operations. -type cancelFunc func() - -type watchable interface { - watch(key []byte, id WatchID, ch chan<- WatchResponse) (*watcher, cancelFunc) -} - -type WatchableStore struct { - // mu protects watcher groups and batches. It should never be locked - // before locking store.mu to avoid deadlock. - mu sync.RWMutex - - victims []watcherBatch - - victimc chan struct{} - - synced watcherGroup - - stopc chan struct{} - wg sync.WaitGroup -} - -func (s *WatchableStore) NewWatchStream() WatchStream { - return &watchStream{ - watchable: s, - ch: make(chan WatchResponse, chanBufLen), - cancels: make(map[WatchID]cancelFunc), - watchers: make(map[WatchID]*watcher), - } -} - -func NewWatchableStore() *WatchableStore { - s := &WatchableStore{ - victimc: make(chan struct{}, 1), - synced: newWatcherGroup(), - stopc: make(chan struct{}), - } - s.wg.Add(1) - go s.syncVictimsLoop() - return s -} - -func (s *WatchableStore) watch(key []byte, id WatchID, ch chan<- WatchResponse) (*watcher, cancelFunc) { - wa := &watcher{ - key: key, - id: id, - ch: ch, - } - - s.mu.Lock() - s.synced.add(wa) - s.mu.Unlock() - - return wa, func() { s.cancelWatcher(wa) } -} - -// cancelWatcher removes references of the watcher from the WatchableStore -func (s *WatchableStore) cancelWatcher(wa *watcher) { - for { - s.mu.Lock() - if s.synced.delete(wa) { - break - } else if wa.ch == nil { - // already canceled (e.g., cancel/close race) - break - } - if !wa.victim { - panic("watcher not victim but not in watch groups") - } - - var victimBatch watcherBatch - for _, wb := range s.victims { - if wb[wa] != nil { - victimBatch = wb - break - } - } - if victimBatch != nil { - delete(victimBatch, wa) - break - } - - s.mu.Unlock() - time.Sleep(time.Millisecond) - } - wa.ch = nil - s.mu.Unlock() -} - -func (s *WatchableStore) syncVictimsLoop() { - defer s.wg.Done() - for { - for s.moveVictims() != 0 { - // try to update all victim watchers - } - s.mu.RLock() - isEmpty := len(s.victims) == 0 - s.mu.RUnlock() - - var tickc <-chan time.Time - if !isEmpty { - tickc = time.After(10 * time.Millisecond) - } - - select { - case <-tickc: - case <-s.victimc: - case <-s.stopc: - return - } - } -} - -// moveVictims tries to update watches with already pending event data -func (s *WatchableStore) moveVictims() (moved int) { - s.mu.Lock() - victims := s.victims - s.victims = nil - s.mu.Unlock() - - var newVictim watcherBatch - for _, wb := range victims { - // try to send responses again - for w, eb := range wb { - if !w.send(WatchResponse{WatchID: w.id, Events: eb.evs}) { - if newVictim == nil { - newVictim = make(watcherBatch) - } - newVictim[w] = eb - continue - } - moved++ - } - // assign completed victim watchers to sync - s.mu.Lock() - for w := range wb { - if newVictim != nil && newVictim[w] != nil { - // couldn't send watch response; stays victim - continue - } - w.victim = false - s.synced.add(w) - } - s.mu.Unlock() - } - if len(newVictim) > 0 { - s.mu.Lock() - s.victims = append(s.victims, newVictim) - s.mu.Unlock() - } - return moved -} - -func (s *WatchableStore) addVictim(victim watcherBatch) { - if victim == nil { - return - } - s.victims = append(s.victims, victim) - select { - case s.victimc <- struct{}{}: - default: - } -} - -// Notify notifies the fact that given event at the given rev just happened to -// watchers that watch on the key of the event. -func (s *WatchableStore) Notify(evs []pb.Event) { - var victim watcherBatch - for w, eb := range newWatcherBatch(&s.synced, evs) { - if !w.send(WatchResponse{WatchID: w.id, Events: eb.evs}) { - // move slow watcher to victims - if victim == nil { - victim = make(watcherBatch) - } - w.victim = true - victim[w] = eb - s.synced.delete(w) - } - } - s.addVictim(victim) -} - -type watcher struct { - key []byte - - victim bool - - id WatchID - - // a chan to send out the watch response. - // The chan might be shared with other watchers. - ch chan<- WatchResponse -} - -func (w *watcher) send(wr WatchResponse) bool { - if len(wr.Events) == 0 { - return true - } - select { - case w.ch <- wr: - return true - default: - return false - } -} diff --git a/pkg/traffic/internal/watchserver/watcher.go b/pkg/traffic/internal/watchserver/watcher.go deleted file mode 100644 index e6463eaf5..000000000 --- a/pkg/traffic/internal/watchserver/watcher.go +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package watchserver - -import ( - "errors" - "log" - "sync" - - "github.com/apache/dubbo-admin/pkg/traffic/client" - "github.com/apache/dubbo-admin/pkg/traffic/internal/pb" -) - -var ( - ErrWatcherNotExist = errors.New("watcher does not exist") - ErrWatcherDuplicateID = errors.New("duplicate watch ID provided on the WatchStream") -) - -type WatchID int64 - -type WatchStream interface { - // Watch The returned "id" is the ID of this watcher. It appears as WatchID - // in events that are sent to the created watcher through stream channel. - // The watch ID is used when it's not equal to AutoWatchID. Otherwise, - // an auto-generated watch ID is returned. - Watch(id WatchID, key []byte) (WatchID, error) - - // Chan returns a chan. All watch response will be sent to the returned chan. - Chan() <-chan WatchResponse - - // Cancel cancels a watcher by giving its ID. If watcher does not exist, an error will be - // returned. - Cancel(id WatchID) error - - // Close closes Chan and release all related resources. - Close() -} - -type WatchResponse struct { - // WatchID is the WatchID of the watcher this response sent to. - WatchID WatchID - - // Events contains all the events that needs to send. - Events []pb.Event -} - -// watchStream contains a collection of watchers that share -// one streaming chan to send out watched events and other control events. -type watchStream struct { - watchable watchable - ch chan WatchResponse - - mu sync.Mutex // guards fields below it - // nextID is the ID pre-allocated for next new watcher in this stream - nextID WatchID - closed bool - cancels map[WatchID]cancelFunc - watchers map[WatchID]*watcher -} - -// Watch creates a new watcher in the stream and returns its WatchID. -func (ws *watchStream) Watch(id WatchID, key []byte) (WatchID, error) { - - ws.mu.Lock() - defer ws.mu.Unlock() - if ws.closed { - return -1, errors.New("watchStream close") - } - - if id == client.AutoWatchID { - for ws.watchers[ws.nextID] != nil { - ws.nextID++ - } - id = ws.nextID - ws.nextID++ - } else if _, ok := ws.watchers[id]; ok { - return -1, ErrWatcherDuplicateID - } - - w, c := ws.watchable.watch(key, id, ws.ch) - - ws.cancels[id] = c - ws.watchers[id] = w - return id, nil -} - -func (ws *watchStream) Chan() <-chan WatchResponse { - return ws.ch -} - -func (ws *watchStream) Cancel(id WatchID) error { - log.Println("开始关闭的逻辑") - ws.mu.Lock() - cancel, ok := ws.cancels[id] - w := ws.watchers[id] - ok = ok && !ws.closed - ws.mu.Unlock() - - if !ok { - return ErrWatcherNotExist - } - cancel() - - ws.mu.Lock() - // The watch isn't removed until cancel so that if Close() is called, - // it will wait for the cancel. Otherwise, Close() could close the - // watch channel while the store is still posting events. - if ww := ws.watchers[id]; ww == w { - delete(ws.cancels, id) - delete(ws.watchers, id) - } - ws.mu.Unlock() - - return nil -} - -func (ws *watchStream) Close() { - ws.mu.Lock() - defer ws.mu.Unlock() - - for _, cancel := range ws.cancels { - cancel() - } - ws.closed = true - close(ws.ch) -} diff --git a/pkg/traffic/internal/watchserver/watcher_group.go b/pkg/traffic/internal/watchserver/watcher_group.go deleted file mode 100644 index 2d4edb9da..000000000 --- a/pkg/traffic/internal/watchserver/watcher_group.go +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package watchserver - -import ( - "github.com/apache/dubbo-admin/pkg/traffic/internal/pb" -) - -// watch callback event -type eventBatch struct { - evs []pb.Event -} - -func (eb *eventBatch) add(ev pb.Event) { - eb.evs = append(eb.evs, ev) -} - -type watcherBatch map[*watcher]*eventBatch - -func newWatcherBatch(wg *watcherGroup, evs []pb.Event) watcherBatch { - if len(wg.watchers) == 0 { - return nil - } - - wb := make(watcherBatch) - for _, ev := range evs { - for w := range wg.watcherSetByKey(string(ev.Kv.Key)) { - wb.add(w, ev) - } - } - return wb -} - -func (wb watcherBatch) add(w *watcher, ev pb.Event) { - eb := wb[w] - if eb == nil { - eb = &eventBatch{} - wb[w] = eb - } - eb.add(ev) -} - -type watcherSet map[*watcher]struct{} - -func (w watcherSet) add(wa *watcher) { - if _, ok := w[wa]; ok { - panic("add watcher twice!") - } - w[wa] = struct{}{} -} - -func (w watcherSet) union(ws watcherSet) { - for wa := range ws { - w.add(wa) - } -} - -func (w watcherSet) delete(wa *watcher) { - if _, ok := w[wa]; !ok { - panic("removing missing watcher!") - } - delete(w, wa) -} - -type watcherSetByKey map[string]watcherSet - -func (w watcherSetByKey) add(wa *watcher) { - set := w[string(wa.key)] - if set == nil { - set = make(watcherSet) - w[string(wa.key)] = set - } - set.add(wa) -} - -func (w watcherSetByKey) delete(wa *watcher) bool { - k := string(wa.key) - if v, ok := w[k]; ok { - if _, ok := v[wa]; ok { - delete(v, wa) - if len(v) == 0 { - // remove the set; nothing left - delete(w, k) - } - return true - } - } - return false -} - -type watcherGroup struct { - // keyWatchers has the watchers that watch on a single key - keyWatchers watcherSetByKey - // watchers is the set of all watchers - watchers watcherSet -} - -func newWatcherGroup() watcherGroup { - return watcherGroup{ - keyWatchers: make(watcherSetByKey), - watchers: make(watcherSet), - } -} - -func (wg *watcherGroup) add(wa *watcher) { - wg.watchers.add(wa) - wg.keyWatchers.add(wa) -} - -// contains is whether the given key has a watcher in the group. -func (wg *watcherGroup) contains(key string) bool { - _, ok := wg.keyWatchers[key] - return ok -} - -func (wg *watcherGroup) size() int { return len(wg.watchers) } - -// delete removes a watcher from the group. -func (wg *watcherGroup) delete(wa *watcher) bool { - if _, ok := wg.watchers[wa]; !ok { - return false - } - wg.watchers.delete(wa) - wg.keyWatchers.delete(wa) - return true -} - -// watcherSetByKey gets the set of watchers that receive events on the given key. -func (wg *watcherGroup) watcherSetByKey(key string) watcherSet { - wkeys := wg.keyWatchers[key] - return wkeys -} diff --git a/test/failer.go b/test/failer.go new file mode 100644 index 000000000..b10466ad8 --- /dev/null +++ b/test/failer.go @@ -0,0 +1,115 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package test + +import ( + "errors" + "fmt" + "runtime" + "sync" + "testing" +) + +var _ Failer = &testing.T{} + +// Failer is an interface to be provided to test functions of the form XXXOrFail. This is a +// substitute for testing.TB, which cannot be implemented outside of the testing +// package. +type Failer interface { + Fail() + FailNow() + Fatal(args ...interface{}) + Fatalf(format string, args ...interface{}) + Helper() + Cleanup(func()) +} + +// errorWrapper is a Failer that can be used to just extract an `error`. This allows mixing +// functions that take in a Failer and those that take an error. +// The function must be called within a goroutine, or calls to Fatal will try to terminate the outer +// test context, which will cause the test to panic. The Wrap function handles this automatically +type errorWrapper struct { + mu sync.RWMutex + failed error + cleanup func() +} + +// Wrap executes a function with a fake Failer, and returns an error if the test failed. This allows +// calling functions that take a Failer and using them with functions that expect an error, or +// allowing calling functions that would cause a test to immediately fail to instead return an error. +// Wrap handles Cleanup() and short-circuiting of Fatal() just like the real testing.T. +func Wrap(f func(t Failer)) error { + done := make(chan struct{}) + w := &errorWrapper{} + go func() { + defer close(done) + f(w) + }() + <-done + return w.ToErrorCleanup() +} + +// ToErrorCleanup returns any errors encountered and executes any cleanup actions +func (e *errorWrapper) ToErrorCleanup() error { + e.mu.RLock() + defer e.mu.RUnlock() + if e.cleanup != nil { + e.cleanup() + } + return e.failed +} + +func (e *errorWrapper) Fail() { + e.Fatal("fail called") +} + +func (e *errorWrapper) FailNow() { + e.Fatal("fail now called") +} + +func (e *errorWrapper) Fatal(args ...interface{}) { + e.mu.Lock() + defer e.mu.Unlock() + if e.failed == nil { + e.failed = errors.New(fmt.Sprint(args...)) + } + runtime.Goexit() +} + +func (e *errorWrapper) Fatalf(format string, args ...interface{}) { + e.Fatal(fmt.Sprintf(format, args...)) +} + +func (e *errorWrapper) Helper() { +} + +func (e *errorWrapper) Cleanup(f func()) { + e.mu.Lock() + defer e.mu.Unlock() + oldCleanup := e.cleanup + e.cleanup = func() { + if oldCleanup != nil { + defer func() { + oldCleanup() + }() + } + f() + } +} + +var _ Failer = &errorWrapper{} diff --git a/test/failer_test.go b/test/failer_test.go new file mode 100644 index 000000000..0880a8084 --- /dev/null +++ b/test/failer_test.go @@ -0,0 +1,47 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package test + +import "testing" + +func TestWrapper(t *testing.T) { + t.Run("fail", func(t *testing.T) { + if err := Wrap(func(t Failer) { + t.Fatalf("failed") + }); err == nil { + t.Fatalf("expected error, got none") + } + }) + t.Run("success", func(t *testing.T) { + if err := Wrap(func(t Failer) {}); err != nil { + t.Fatalf("expected no error, got: %v", err) + } + }) + t.Run("cleanup", func(t *testing.T) { + done := false + if err := Wrap(func(t Failer) { + t.Cleanup(func() { + done = true + }) + }); err != nil { + t.Fatalf("expected no error, got: %v", err) + } + if !done { + t.Fatalf("cleanup not triggered") + } + }) +} diff --git a/test/util/retry/retry.go b/test/util/retry/retry.go new file mode 100644 index 000000000..9bf0f30d4 --- /dev/null +++ b/test/util/retry/retry.go @@ -0,0 +1,183 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package retry + +import ( + "errors" + "fmt" + "github.com/apache/dubbo-admin/test" + "time" +) + +const ( + // DefaultTimeout the default timeout for the entire retry operation + DefaultTimeout = time.Second * 30 + + // DefaultDelay the default delay between successive retry attempts + DefaultDelay = time.Millisecond * 10 + + // DefaultConverge the default converge, requiring something to succeed one time + DefaultConverge = 1 +) + +var ( + defaultConfig = config{ + timeout: DefaultTimeout, + delay: DefaultDelay, + converge: DefaultConverge, + } +) + +type config struct { + error string + timeout time.Duration + delay time.Duration + converge int +} + +// Option for a retry operation. +type Option func(cfg *config) + +// Timeout sets the timeout for the entire retry operation. +func Timeout(timeout time.Duration) Option { + return func(cfg *config) { + cfg.timeout = timeout + } +} + +// Delay sets the delay between successive retry attempts. +func Delay(delay time.Duration) Option { + return func(cfg *config) { + cfg.delay = delay + } +} + +// Converge sets the number of successes in a row needed to count a success. +// This is useful to avoid the case where tests like `coin.Flip() == HEADS` will always +// return success due to random variance. +func Converge(successes int) Option { + return func(cfg *config) { + cfg.converge = successes + } +} + +// Message defines a more detailed error message to use when failing +func Message(errorMessage string) Option { + return func(cfg *config) { + cfg.error = errorMessage + } +} + +// RetriableFunc a function that can be retried. +type RetriableFunc func() (result interface{}, completed bool, err error) + +// UntilSuccess retries the given function until success, timeout, or until the passed-in function returns nil. +func UntilSuccess(fn func() error, options ...Option) error { + _, e := Do(func() (interface{}, bool, error) { + err := fn() + if err != nil { + return nil, false, err + } + + return nil, true, nil + }, options...) + + return e +} + +// UntilSuccessOrFail calls UntilSuccess, and fails t with Fatalf if it ends up returning an error +func UntilSuccessOrFail(t test.Failer, fn func() error, options ...Option) { + t.Helper() + err := UntilSuccess(fn, options...) + if err != nil { + t.Fatalf("retry.UntilSuccessOrFail: %v", err) + } +} + +var ErrConditionNotMet = errors.New("expected condition not met") + +// Until retries the given function until it returns true or hits the timeout timeout +func Until(fn func() bool, options ...Option) error { + return UntilSuccess(func() error { + if !fn() { + return getErrorMessage(options) + } + return nil + }, options...) +} + +// UntilOrFail calls Until, and fails t with Fatalf if it ends up returning an error +func UntilOrFail(t test.Failer, fn func() bool, options ...Option) { + t.Helper() + err := Until(fn, options...) + if err != nil { + t.Fatalf("retry.UntilOrFail: %v", err) + } +} + +func getErrorMessage(options []Option) error { + cfg := defaultConfig + for _, option := range options { + option(&cfg) + } + if cfg.error == "" { + return ErrConditionNotMet + } + return errors.New(cfg.error) +} + +// Do retries the given function, until there is a timeout, or until the function indicates that it has completed. +func Do(fn RetriableFunc, options ...Option) (interface{}, error) { + cfg := defaultConfig + for _, option := range options { + option(&cfg) + } + + successes := 0 + var lasterr error + to := time.After(cfg.timeout) + for { + select { + case <-to: + return nil, fmt.Errorf("timeout while waiting (last error: %v)", lasterr) + default: + } + + result, completed, err := fn() + if completed { + if err == nil { + successes++ + } else { + successes = 0 + } + if successes >= cfg.converge { + return result, err + } + + // Skip delay if we have a success + continue + } else { + successes = 0 + } + if err != nil { + lasterr = err + } + + <-time.After(cfg.delay) + } +} diff --git a/pkg/traffic/internal/watchserver/grpc.go b/test/util/retry/retry_test.go similarity index 52% rename from pkg/traffic/internal/watchserver/grpc.go rename to test/util/retry/retry_test.go index 95fff8b70..930ccb951 100644 --- a/pkg/traffic/internal/watchserver/grpc.go +++ b/test/util/retry/retry_test.go @@ -14,45 +14,40 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -package watchserver +package retry import ( - "log" - "net" - - "google.golang.org/grpc" - - "github.com/apache/dubbo-admin/pkg/traffic/internal/pb" + "fmt" + "testing" + "time" ) -const NetWork = "tcp" - -type WatchGrpcConfig struct { - Addr string - RegisterFunc func(server *grpc.Server) -} +func TestConverge(t *testing.T) { + t.Run("no converge", func(t *testing.T) { + flipFlop := true + err := UntilSuccess(func() error { + flipFlop = !flipFlop + if flipFlop { + return fmt.Errorf("flipFlop was true") + } + return nil + }, Converge(2), Timeout(time.Millisecond*10), Delay(time.Millisecond)) + if err == nil { + t.Fatal("expected no convergence, but test passed") + } + }) -func RegisterGrpc() *grpc.Server { - c := WatchGrpcConfig{ - // TODO the Addr config - Addr: "127.0.0.1:8000", - RegisterFunc: func(g *grpc.Server) { - pb.RegisterWatchServer(g, WatchSrv) - }, - } - s := grpc.NewServer() - c.RegisterFunc(s) - lis, err := net.Listen(NetWork, c.Addr) - if err != nil { - log.Println("cannot listen") - } - go func() { - err = s.Serve(lis) + t.Run("converge", func(t *testing.T) { + n := 0 + err := UntilSuccess(func() error { + n++ + if n < 10 { + return fmt.Errorf("%v is too low, try again", n) + } + return nil + }, Converge(2), Timeout(time.Second*10000), Delay(time.Millisecond)) if err != nil { - log.Println("server started error", err) - return + t.Fatalf("expected convergance, but test failed: %v", err) } - }() - return s + }) }